Skip to content

Commit 20e58fc

Browse files
committed
Merge pull request #1181 from neilt6/usb-suspend-fix
[USBDevice] LPC11UXX suspend status fix
2 parents 963ff55 + fca1a1c commit 20e58fc

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)