Skip to content

Commit

Permalink
fix issue with utilTimerOffset drift
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Nov 7, 2024
1 parent a0f53ea commit 781ef81
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/jstimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ bool utilTimerInsertTask(UtilTimerTask *task, uint32_t *timerOffset) {

// How long was it since the timer was last scheduled? Update existing tasks #2575
uint32_t timePassed = jshGetSystemTime() - utilTimerSetTime;
utilTimerOffset += timePassed;
// find out where to insert
unsigned char insertPos = utilTimerTasksTail;
while (insertPos != utilTimerTasksHead && utilTimerTasks[insertPos].time < (task->time+timePassed))
Expand Down

0 comments on commit 781ef81

Please sign in to comment.