msp430 disconnect/connect

This commit is contained in:
hathach 2020-04-16 21:04:28 +07:00
parent 63655ac9d7
commit 18d936b414
No known key found for this signature in database
GPG Key ID: 2FA891220FBFD581
1 changed files with 18 additions and 3 deletions

View File

@ -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
*------------------------------------------------------------------*/