diff options
| author | Patrice Chotard <[email protected]> | 2025-01-14 14:28:13 +0100 |
|---|---|---|
| committer | Stefan Roese <[email protected]> | 2025-01-22 10:22:34 +0100 |
| commit | 302f866e5c2671919f4900983a59476966c84156 (patch) | |
| tree | 27d09f556f398b1716a6d4df52da14b241bf2f27 /doc/develop/bootstd/script.rst | |
| parent | 82d262ae162d859d3b0bbcd40a9464e890b009da (diff) | |
cyclic: Fix rollover every 72 min on 32 bits platforms
On 32 bits platforms, timer_get_us() returns an unsigned long which
is a 32 bits. timer_get_us() wraps around every 72 minutes
(2 ^ 32 / 1000000 =~ 4295 sec =~ 72 min).
So the test "if time_after_eq64(now, cyclic->next_call)" is no more
true when cyclic->next_call becomes above 32 bits max value (4294967295).
At this point after 72 min, no more cyclic function are
executed included watchdog one.
Instead of using timer_get_us(), use get_timer_us() which returns a
uint64_t, this allows a rollover every 584942 years.
Signed-off-by: Patrice Chotard <[email protected]>
Reviewed-by: Stefan Roese <[email protected]>
Diffstat (limited to 'doc/develop/bootstd/script.rst')
0 files changed, 0 insertions, 0 deletions
