Smartsleep with 20ms polling Timer1 ISR
stefaanv last edited by
I'm developming a node that polls a sensor every 20ms through a Timer1 interrupt. The main loop of the program has a 1000ms wait/sleep cycle that decides whether or not to send MySensors messages depending on the sensor value.
In orde to preserve energy, I'd like to use smart sleep.
My question is, will smartSleep work in together with the faster interrupt cycle ? I assume the interrupt will wake the node from smart sleep, but what happens at the end of the interrupt service routine ?
Does smartSleep resume automatically ?
Or should I call smartSleep at the end of the ISR ? Does that make sense ? Will smartSleep work properly when it is called every 20 ms ?