Skip to content

Commit 3aeda9b

Browse files
committed
autosync
1 parent fe349ba commit 3aeda9b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
# [0.10.3]
3+
4+
# Fixes
5+
- Fixed CAN awaitMsg timeout; now actually milliseconds instead of seconds

src/ODriveCAN.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ void ODriveCAN::onReceive(uint32_t id, uint8_t length, const uint8_t* data) {
186186
}
187187
}
188188

189-
bool ODriveCAN::awaitMsg(uint16_t timeout) {
190-
uint64_t start_time = millis();
189+
bool ODriveCAN::awaitMsg(uint16_t timeout_ms) {
190+
uint64_t start_time = micros();
191191
while (requested_msg_id_ != REQUEST_PENDING) {
192192
can_intf_.pump_events(); // pump event loop while waiting
193-
if ((millis() - start_time) > 1000 * timeout)
193+
if ((micros() - start_time) > (1000 * timeout_ms))
194194
return false;
195195
}
196196
return true;

0 commit comments

Comments
 (0)