summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien <damien.p.george@gmail.com>2013-12-06 00:42:13 +0000
committerDamien <damien.p.george@gmail.com>2013-12-06 00:42:13 +0000
commit261dbf8ce55e7237d5fa8cb65c1f33fc922db34d (patch)
tree131d8bd3e12805c4f6242e5d082aa718e59a6e4b
parentd6b4c6656517b59348357f751556fbbabe9a9a1e (diff)
downloadmicropython-261dbf8ce55e7237d5fa8cb65c1f33fc922db34d.tar.gz
micropython-261dbf8ce55e7237d5fa8cb65c1f33fc922db34d.zip
stm: add __WFI to sys_tick delay.
-rw-r--r--stm/systick.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/stm/systick.c b/stm/systick.c
index fb872ac9d5..40ae532793 100644
--- a/stm/systick.c
+++ b/stm/systick.c
@@ -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
}
}
}