stm: add __WFI to sys_tick delay.

pull/3/head
Damien 2013-12-06 00:42:13 +00:00
rodzic d6b4c66565
commit 261dbf8ce5
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -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
}
}
}