1
0
Fork 0

reset index on message begin

This commit is contained in:
Kevin Matz 2019-07-30 13:49:51 -04:00
parent 6300048196
commit 9fbe032627
1 changed files with 2 additions and 4 deletions

View File

@ -185,7 +185,7 @@ void readCommand() {
delay(10); // small delay to allow input buffer to fill
int c = Serial.read();
if ( c == -1 ) { // no bytes read
if ( c == -1 ) { // no bytes read
break;
}
if (!isAscii(c)) {
@ -196,6 +196,7 @@ void readCommand() {
if (!inMessage) {
if (c == '{') { // message start delimiter
inMessage = true;
index = 0;
}
continue;
}
@ -235,9 +236,6 @@ void readCommand() {
// move the axis
uint8_t v = ( Msb << 4 ) | (Lsb);
r.axis(index)->maneuver(v);
// next
continue;
}
} // readCommand