diff --git a/armsrc/ticks.c b/armsrc/ticks.c index 7ece25b93..22c5d5be1 100644 --- a/armsrc/ticks.c +++ b/armsrc/ticks.c @@ -64,7 +64,7 @@ uint32_t RAMFUNC GetTickCount(void) { uint32_t RAMFUNC GetTickCountDelta(uint32_t start_ticks) { uint32_t stop_ticks = AT91C_BASE_RTTC->RTTC_RTVR; - if (stop_ticks > start_ticks) + if (stop_ticks >= start_ticks) return stop_ticks - start_ticks; return (UINT32_MAX - start_ticks) + stop_ticks; }