Hi Frank, Yep, it looks like the times are preset as I look at your library code. The trick is that by using a null callback, you can cheat and get an immediate shutdown (can't remember where I found that tidbit). For many applications (most?) that is not desirable. But for mine, some folks are going to want that to be as quick as possible, some will be happy with the 500 ms shutdown hold.
The second part of the trick is that if I make the on time 0 ms coupled with the null call back, on and off are both effectively zero, so a touch of the button does an immediate shutdown followed by an immediate start up - voila... easy reset button! I will play around with it for a couple of days to be sure that contact bounce doesn't cause it to be unreliable. If it behaves itself, I will add some options in my app to allow folks to configure the behavior that they want (reset vs on/off, 5 sec vs immediate, etc).
defragster, I am using these functions from the power lib to power down and reset from within my app:
arm_reset();
arm_power_down();
They work great, and when I have the button wired in, I will have the best of both worlds, menu item or button. Two others have built this and a third is about to start and already the questions about a more graceful power control have been raised so thanks for the library and the help, it is all happening just in time!
Len