Is it unsafe to use k_get_uptime_ticks() from an ISR?
Is it unsafe to use k_get_uptime_ticks() from an ISR?
Hello Didier,
Is it unsafe to use k_get_uptime_ticks() from an ISR?
It shouldn’t be a problem as the timer drivers are required to implement the underlying sys_clock_elapsed() utility in an ISR context.
There are in general very few Zephyr APIs that aren’t interrupt-safe; the only rule is that blocking calls must be passed a time-out of K_NO_WAIT.
Regards,
Markus
Hello Didier,
Is it unsafe to use k_get_uptime_ticks() from an ISR?
It shouldn’t be a problem as the timer drivers are required to implement the underlying sys_clock_elapsed() utility in an ISR context.
There are in general very few Zephyr APIs that aren’t interrupt-safe; the only rule is that blocking calls must be passed a time-out of K_NO_WAIT.
Regards,
Markus