reset index on message begin
This commit is contained in:
parent
6300048196
commit
9fbe032627
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue