Closed sslupsky closed 6 years ago
@sslupsky It is possible to call low power sleep from, for instance, the main task. The task loop()
function should also contain a call to yield()
. The drawback is that other active tasks (e.g. not waiting for a condition or timeout) will be delayed as there is no task priority. One way to avoid this is to only call low power sleep when all other tasks are waiting for a timeout (i.e. have called delay()
) or to implement priority queues.
Do you have any advice regarding compatibility with low power sleep? How would one go about using LowPower.sleep() using the scheduler? Would it simply be to create a sleep task that calls LowPower.sleep()? Is there a way to set task priority so the sleep task is the lowest priority task?