mirror of https://github.com/ARMmbed/mbed-os.git
Disable endpoints when disconnecting on Kinetis
Even thought the USB phy is disabled during disconnect, endpoints still nack packets sent. This patch disables all endpoints so after disconnect no USB traffic will be sent. This allows brief disconnects of ~200us (or more) to be reliably detected by the host PC.pull/9768/head
parent
0653799b5a
commit
aa76c776c9
|
@ -195,6 +195,10 @@ void USBPhyHw::connect()
|
|||
|
||||
void USBPhyHw::disconnect()
|
||||
{
|
||||
// disable all endpoints to prevent them from nacking when disconnected
|
||||
for(int i = 0; i < 16; i++) {
|
||||
USB0->ENDPOINT[i].ENDPT = 0x00;
|
||||
}
|
||||
// disable USB
|
||||
USB0->CTL &= ~USB_CTL_USBENSOFEN_MASK;
|
||||
// Pull up disable
|
||||
|
|
Loading…
Reference in New Issue