We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19b8a94 commit 2c1462dCopy full SHA for 2c1462d
hardware/arduino/sam/cores/arduino/USB/CDC.cpp
@@ -309,10 +309,18 @@ Serial_::operator bool()
309
}
310
311
int32_t Serial_::readBreak() {
312
+ // disable the USB OTG interrupt,
313
+ // to avoid clearing a breakValue that might occur
314
+ // while reading the current break value
315
+ NVIC_DisableIRQ((IRQn_Type) ID_UOTGHS);
316
+
317
int32_t ret = breakValue;
318
319
breakValue = -1;
320
321
+ // re-eable the USB OTG interupt
322
+ NVIC_EnableIRQ((IRQn_Type) ID_UOTGHS);
323
324
return ret;
325
326
0 commit comments