Skip to content

Commit fca1a1c

Browse files
committed
[USBDevice] LPC11UXX suspend status fix
The USB suspend status changed interrupt is now correctly reported.
1 parent 81af347 commit fca1a1c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libraries/USBDevice/USBDevice/USBHAL_LPC11U.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,17 +668,17 @@ void USBHAL::usbisr(void) {
668668
if (LPC_USB->DEVCMDSTAT & DSUS_C) {
669669
// Suspend status changed
670670
LPC_USB->DEVCMDSTAT = devCmdStat | DSUS_C;
671-
if((LPC_USB->DEVCMDSTAT & DSUS) != 0) {
671+
if (LPC_USB->DEVCMDSTAT & DSUS) {
672672
suspendStateChanged(1);
673+
} else {
674+
suspendStateChanged(0);
673675
}
674676
}
675677

676678
if (LPC_USB->DEVCMDSTAT & DRES_C) {
677679
// Bus reset
678680
LPC_USB->DEVCMDSTAT = devCmdStat | DRES_C;
679681

680-
suspendStateChanged(0);
681-
682682
// Disable endpoints > 0
683683
disableEndpoints();
684684

0 commit comments

Comments
 (0)