fix return value of ODriveArduino::run_state()

Previously, the function would return false in most cases even on
success.
This commit is contained in:
Samuel Sadok
2020-05-26 12:13:16 +02:00
parent b000d4889e
commit 392781c33d

View File

@@ -66,7 +66,7 @@ bool ODriveArduino::run_state(int axis, int requested_state, bool wait) {
do {
delay(100);
serial_ << "r axis" << axis << ".current_state\n";
} while (readInt() != AXIS_STATE_IDLE && --timeout_ctr > 0);
} while (readInt() != requested_state && --timeout_ctr > 0);
}
return timeout_ctr > 0;