Exit deep sleep with IO interrupt OR timer


I am working on an application where I need to wake from deep sleep after x minutes or when a button is pressed -
whichever happens first. I have it working each way, but not both. If this is possible it wasn’t clear how to make it happen. I am thinking it is possible with some low level commands. There is a great library for the Teensy which returns an int telling which wakeup was triggered - https://github.com/duff2013/Snooze - but I am not sure how / if something like that would be possible.

Anyway - its not super pressing for us right now but I figured I would start to look into this for future revisions.



Are you using Dash.attachWakeUp() for the IO interrupt, and then calling Dash.deepSleepAtMostMin()?

Dash.lastWakeupSource() will return an int for the wake up source. Refer to the datasheet for the specific values.


Hey Erik - yep after I had coffee today I re-read the documentation. I was looking at Dash.deepSleepMin() thinking it was Dash.deepSleepAtMostMin() .

Thanks for the quick reply!