Closed
Description
#2685 only adds light sleep during time.sleep
. We should add a new mechanic for sleeping until an alarm.
An alarm can be anything a microcontroller supports during sleep such as RTC alarm, pin change interrupt and comparator. The alarms should be in separate modules so that the microcontrollers can support different ones.
Then, one sleep_until_alarm()
function can take any number of alarms. It will return the object that woke it up.