-
Notifications
You must be signed in to change notification settings - Fork 666
Open
Description
Issuing the following sequence of commands results in a motion downsampling query turning into a set:
MLC0.5MCD
The issue is that once a sentinel character is found, the buffer is passed to run as-is:
Arduino-FOC/src/communication/Commander.cpp
Lines 33 to 43 in 395b6cd
| // a string to hold incoming data | |
| while (serial.available()) { | |
| // get the new byte: | |
| int ch = serial.read(); | |
| received_chars[rec_cnt++] = (char)ch; | |
| // end of user input | |
| if(echo) | |
| print((char)ch); | |
| if (isSentinel(ch)) { | |
| // execute the user command | |
| run(received_chars); |
Later atof reads past the sentinel and picks up the trailing 5 in the buffer, and the downsampling is set to 5. The least invasive solution might be to null out the character after the sentinel (if we're not at the end of the buffer).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels