Restoring sleep semantics
This commit is contained in:
parent
6f1532c2a3
commit
c13eaaba4c
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue