mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 09:00:23 +08:00
stm: add __WFI to sys_tick delay.
This commit is contained in:
parent
d6b4c66565
commit
261dbf8ce5
@ -33,10 +33,12 @@ void sys_tick_wait_at_least(uint32_t stc, uint32_t delay_ms) {
|
|||||||
if (stc_wait < stc) {
|
if (stc_wait < stc) {
|
||||||
// stc_wait wrapped around
|
// stc_wait wrapped around
|
||||||
while (stc <= sys_tick_counter || sys_tick_counter < stc_wait) {
|
while (stc <= sys_tick_counter || sys_tick_counter < stc_wait) {
|
||||||
|
__WFI(); // enter sleep mode, waiting for interrupt
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// stc_wait did not wrap around
|
// stc_wait did not wrap around
|
||||||
while (stc <= sys_tick_counter && sys_tick_counter < stc_wait) {
|
while (stc <= sys_tick_counter && sys_tick_counter < stc_wait) {
|
||||||
|
__WFI(); // enter sleep mode, waiting for interrupt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user