Fix USB re-plugin not detected in NUMAKER_PFM_NUC472

pull/2861/head
ccli8 2016-08-11 11:24:55 +08:00
parent 537beb5837
commit aa4e880b4a
1 changed files with 6 additions and 2 deletions

View File

@ -311,6 +311,7 @@ void USBHALHost::UsbIrqhandler()
uint32_t ints_roothub = USBH->HcRhStatus;
uint32_t ints_port1 = USBH->HcRhPortStatus[0];
// Port1: ConnectStatusChange
if (ints_port1 & OR_RH_PORT_CSC) {
if (ints_roothub & OR_RH_STATUS_DRWE) {
// When DRWE is on, Connect Status Change means a remote wakeup event.
@ -343,11 +344,14 @@ void USBHALHost::UsbIrqhandler()
}
USBH->HcRhPortStatus[0] = OR_RH_PORT_CSC;
}
// Reset completed
// Port1: Reset completed
if (ints_port1 & OR_RH_PORT_PRSC) {
USBH->HcRhPortStatus[0] = OR_RH_PORT_PRSC;
}
// Port1: PortEnableStatusChange
if (ints_port1 & OR_RH_PORT_PESC) {
USBH->HcRhPortStatus[0] = OR_RH_PORT_PESC;
}
USBH->HcInterruptStatus = OR_INTR_STATUS_RHSC;
}