Skip to content

Commit

Permalink
imxrt/timer: Fix wrong GPT rollover handling during time fetch
Browse files Browse the repository at this point in the history
DONE: RTOS-533
  • Loading branch information
agkaminski committed Jul 25, 2023
1 parent 49bb710 commit 1af0dfa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hal/armv7m/imxrt/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ static time_t hal_timerGetCyc(void)

if ((*(timer_common.base + gpt_sr) & (1 << 5)) != 0) {
lower = *(timer_common.base + gpt_cnt);
++upper;
if (lower != 0xffffffffUL) {
++upper;
}
}
hal_spinlockClear(&timer_common.sp, &sc);

Expand Down

0 comments on commit 1af0dfa

Please sign in to comment.