drivers: nrf_rtc_timer: Always set an initial timeout
In the tickless kernel mode, the nRF system timer does not schedule
any timeout on initialization. This can lead to a situation that
for certain applications no timeout is scheduled at all (for example,
when an application does not create any threads, it exits `main()`
without any sleeping and only handles interrupts) and in consequence
`sys_clock_announce()` is never called (the nRF system timer calls
this function only from the timeout handler). This in turn causes that
uptime is reported correctly only until the RTC used as the system
timer overflows (what happens after 512 seconds).
Fix this by setting a maximum allowed timeout when initializing
the nRF system timer for the tickless kernel mode.
Signed-off-by:
Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Loading
Please sign in to comment