Skip to content
Snippets Groups Projects
Commit 261dbf8c authored by Damien's avatar Damien
Browse files

stm: add __WFI to sys_tick delay.

parent d6b4c665
No related branches found
No related tags found
No related merge requests found
......@@ -33,10 +33,12 @@ void sys_tick_wait_at_least(uint32_t stc, uint32_t delay_ms) {
if (stc_wait < stc) {
// stc_wait wrapped around
while (stc <= sys_tick_counter || sys_tick_counter < stc_wait) {
__WFI(); // enter sleep mode, waiting for interrupt
}
} else {
// stc_wait did not wrap around
while (stc <= sys_tick_counter && sys_tick_counter < stc_wait) {
__WFI(); // enter sleep mode, waiting for interrupt
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment