diff options
| author | hathach <[email protected]> | 2020-04-16 21:04:28 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2020-04-16 21:04:28 +0700 |
| commit | 18d936b414bd91a6337bbbddef54c09adcf6e49a (patch) | |
| tree | 8218daa05ea0e4bb866332f3dad5be88c365c05b /src/portable | |
| parent | 63655ac9d790d55d7a002248dafe9df888606b18 (diff) | |
msp430 disconnect/connect
Diffstat (limited to 'src/portable')
| -rw-r--r-- | src/portable/ti/msp430x5xx/dcd_msp430x5xx.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c b/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c index edccec33f..680d63588 100644 --- a/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c +++ b/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c @@ -134,9 +134,6 @@ void dcd_init (uint8_t rhport) // Enable reset and wait for it before continuing. USBIE |= RSTRIE; - // Enable pullup. - USBCNF |= PUR_EN; - USBKEYPID = 0; } @@ -207,6 +204,24 @@ void dcd_remote_wakeup(uint8_t rhport) (void) rhport; } +void dcd_connect(uint8_t rhport) +{ + (void) rhport; + + USBKEYPID = USBKEY; + USBCNF |= PUR_EN; // Enable pullup. + USBKEYPID = 0; +} + +void dcd_disconnect(uint8_t rhport) +{ + (void) rhport; + + USBKEYPID = USBKEY; + USBCNF &= ~PUR_EN; // Disable pullup. + USBKEYPID = 0; +} + /*------------------------------------------------------------------*/ /* DCD Endpoint port *------------------------------------------------------------------*/ |
