diff options
| author | Ha Thach <[email protected]> | 2020-04-17 09:51:15 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-04-17 09:51:15 +0700 |
| commit | 19e2eb66c0181581010d0e26f2a29bf52268ff73 (patch) | |
| tree | b61a5c3e8f123e2f22a63f3392c949ba10c4c5cd /src/portable/ti | |
| parent | 9aa553ccc2e8977522202fa4e346a66a47c8e442 (diff) | |
| parent | 3aaad8cd730d01a65065d9eb8b694221724151c3 (diff) | |
Merge pull request #350 from hathach/synopsys-msp430-dcd-disconnect-connect
Synopsys msp430 dcd disconnect connect
Diffstat (limited to 'src/portable/ti')
| -rw-r--r-- | src/portable/ti/msp430x5xx/dcd_msp430x5xx.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c b/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c index edccec33f..1512f0de4 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,28 @@ void dcd_remote_wakeup(uint8_t rhport) (void) rhport; } +void dcd_connect(uint8_t rhport) +{ + dcd_int_disable(rhport); + + USBKEYPID = USBKEY; + USBCNF |= PUR_EN; // Enable pullup. + USBKEYPID = 0; + + dcd_int_enable(rhport); +} + +void dcd_disconnect(uint8_t rhport) +{ + dcd_int_disable(rhport); + + USBKEYPID = USBKEY; + USBCNF &= ~PUR_EN; // Disable pullup. + USBKEYPID = 0; + + dcd_int_enable(rhport); +} + /*------------------------------------------------------------------*/ /* DCD Endpoint port *------------------------------------------------------------------*/ |
