Skip to content

Commit c8ebd8a

Browse files
committed
Blocks standbyMode() if connected to SerialUSB
Entering sleep mode when connected to the native USB port causes issues (USB device errors).
1 parent 3a6e4ad commit c8ebd8a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/RTCZero.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,12 @@ void RTCZero::detachInterrupt()
108108

109109
void RTCZero::standbyMode()
110110
{
111-
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
112-
__WFI();
111+
// Entering standby mode when connected
112+
// via the native USB port causes issues
113+
if (!SerialUSB) {
114+
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
115+
__WFI();
116+
}
113117
}
114118

115119
/*

0 commit comments

Comments
 (0)