Skip to content

Commit d83ed63

Browse files
committed
RTOS: SysTimer: Fix update_tick
1 parent 74e0f95 commit d83ed63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rtos/TARGET_CORTEX/SysTimer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ uint32_t SysTimer::get_tick()
7878

7979
uint32_t SysTimer::update_tick()
8080
{
81-
uint64_t new_tick = ticker_read_us(_ticker_data) * OS_TICK_FREQ / 1000000;
81+
uint64_t new_tick = (ticker_read_us(_ticker_data) - _start_time) * OS_TICK_FREQ / 1000000;
8282
if (new_tick > _tick) {
8383
// Don't update to the current tick. Instead, update to the
8484
// previous tick and let the SysTick handler increment it

0 commit comments

Comments
 (0)