Restoring sleep semantics

This commit is contained in:
Ryan Summers 2021-03-02 17:16:40 +01:00
parent 6f1532c2a3
commit c13eaaba4c
1 changed files with 6 additions and 2 deletions

View File

@ -139,8 +139,8 @@ const APP: () = {
let clock = c.resources.clock; let clock = c.resources.clock;
loop { loop {
let _sleep = c.resources.mqtt_interface.lock(|interface| { let sleep = c.resources.mqtt_interface.lock(|interface| {
!interface.network_stack().poll(clock.current_ms()) interface.network_stack().poll(clock.current_ms())
}); });
if c.resources if c.resources
@ -149,6 +149,10 @@ const APP: () = {
{ {
c.spawn.settings_update().unwrap() c.spawn.settings_update().unwrap()
} }
if sleep {
cortex_m::asm::wfi();
}
} }
} }