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 2fb8500 commit de1429bCopy full SHA for de1429b
cores/arduino/USB/CDC.cpp
@@ -298,10 +298,18 @@ Serial_::operator bool()
298
}
299
300
int32_t Serial_::readBreak() {
301
+ // disable the USB interrupt,
302
+ // to avoid clearing a breakValue that might occur
303
+ // while processing the current break value
304
+ NVIC_DisableIRQ((IRQn_Type) USB_IRQn);
305
+
306
int32_t ret = breakValue;
307
308
breakValue = -1;
309
310
+ // re-enable the USB interupt
311
+ NVIC_EnableIRQ((IRQn_Type) USB_IRQn);
312
313
return ret;
314
315
0 commit comments