Skip to content

Commit 261dbf8

Browse files
committed
stm: add __WFI to sys_tick delay.
1 parent d6b4c66 commit 261dbf8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stm/systick.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ void sys_tick_wait_at_least(uint32_t stc, uint32_t delay_ms) {
3333
if (stc_wait < stc) {
3434
// stc_wait wrapped around
3535
while (stc <= sys_tick_counter || sys_tick_counter < stc_wait) {
36+
__WFI(); // enter sleep mode, waiting for interrupt
3637
}
3738
} else {
3839
// stc_wait did not wrap around
3940
while (stc <= sys_tick_counter && sys_tick_counter < stc_wait) {
41+
__WFI(); // enter sleep mode, waiting for interrupt
4042
}
4143
}
4244
}

0 commit comments

Comments
 (0)