Restoring sleep semantics

This commit is contained in:
Ryan Summers 2021-03-02 17:16:40 +01:00
parent 6f1532c2a3
commit c13eaaba4c

View File

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