forked from zephyrproject-rtos/ArduinoCore-zephyr
-
-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Describe the bug
It appears like Monitor.read() does not return -1 when the q is empty;
This hangs:
int ch;
if ((ch = Monitor.available()) > 0) {
Monitor.print("Serial available:");
Monitor.println(ch);
uint8_t new_rototation = 0;
while ((ch = Monitor.read()) != -1) {
//Monitor.write(ch);
if ((ch >= '0') && (ch <= '9')) {
new_rototation = ch - '0';
}
}
This does not:
int ch;
if ((ch = Monitor.available()) > 0) {
Monitor.print("Serial available:");
Monitor.println(ch);
uint8_t new_rototation = 0;
while (Monitor.available()) {
ch = Monitor.read();
//Monitor.write(ch);
if ((ch >= '0') && (ch <= '9')) {
new_rototation = ch - '0';
}
}
Target board + cli verbose compilation output
Arduino UNO Q
Metadata
Metadata
Assignees
Labels
No labels