I'll just hijack this thread, as the title applies to my cause as well.
I've poked around inside the clock's firmware available for download on the 'make' site a bit.
It seems to me the "wakeup()" function is never called at all and the going back to normal stuff is handled inside main() already. If the comparator bit indicates a loss of power it calls "gosleep()", if not it activates or re-activates all normal functions there.
This doesn't break the clock, but the wakeup() function should be marked as "unused" if you keep it in there for reference or educational purpose.
it would be nice to add a comment to the hold-a-button checking routine to go and look at the other ISR that ticks every 1s.
there's some code like
- Code: Select all
and that variable is decreased inside the other ISR. At first glance that code would never exit the while loop if you keep the button pressed.