Quote Originally Posted by DaveB View Post
I'm missing something basic here. The attachInterrupt feature lets you specify a function to call when the interrupt is triggered:
Code:
pinMode(21, INPUT_PULLUP);
attachInterrupt(21, ISR_Function, FALLING);
The Snooze library combines attachInterrupt into one line with pinMode, but it doesn't let you define a function to call:
Code:
digital.pinMode(21, INPUT_PULLUP, FALLING);
Can someone tell me what I'm missing?
Sorry for absence, but a extended family member has covid so I'm dealing with that now.

This was a bad attempt at trying to explain how the internal function of the Low Power mode wakeup for Digital Pins works and not how you go about using it. To wakeup from sleep, deepSleep or hibernate on Teensy 3.2 you do not attach your own callback function. (It should work with already attached callbacks though, it just won't use them during wakeups.) Since Snooze reuses the same interrupt function for all wakeups, providing a callback for the user is not recommended because of race conditions that can occur if the code in the wakeup ISR is not done right and I do not want to provide support for all the ways a person could screw it up. Also there is differences in how you configure everything between sleep and deepSleep and hibernate that further would confuse the user so I hide most of the complex code from the user to make Snooze usable for beginners. I'll update Snooze to make this clear since I see why you would think there is a callback you could attach to the wakeup.

While saying that I have thought about opening up the internals for an "Advanced" use cases where you would be able to configure the wakeups however you want and provide only the glue to the actual mcu sleep code. This would be to let you do what you want but then I think it will be a major headache because I don't want to debug everyones implementation of their wakeup code so most likely that will be far off if ever I get to it.