diff --git a/libuavcan/src/node/uc_scheduler.cpp b/libuavcan/src/node/uc_scheduler.cpp index 5901fe75c5..529d94ccc6 100644 --- a/libuavcan/src/node/uc_scheduler.cpp +++ b/libuavcan/src/node/uc_scheduler.cpp @@ -132,7 +132,7 @@ MonotonicTime Scheduler::computeDispatcherSpinDeadline(MonotonicTime spin_deadli const MonotonicTime ts = getMonotonicTime(); if (earliest > ts) { - if (ts - earliest > deadline_resolution_) + if (earliest - ts > deadline_resolution_) { return ts + deadline_resolution_; }