I have better comments in the code but essentially, when the device is sleeping and is woken by the button then two things should happen:
it should start up the slideshow for a little while, either for some time X or until the sleep window ends
if the time to end the sleep window has not yet passed when X is over then re-enter the sleep window with the original deadline for wakeup
This is a slightly new idea for the main loop in that there is a fixed time for the sleep window to end, not just the size of the sleep window. It shouldn't be awful to implement though.
What happens now is that the device wakes up and powers up and starts the slide show, and then that goes until the sleep window ends. That can be a long way away (up to an hour normally). This is not what we want. We just want a peek.
An alternative is that when we wake up we end the sleep window and go directly to monitoring mode, perform monitoring and communication while the slideshow is running, and then enter a new sleep window. This would be fine probably.
I have better comments in the code but essentially, when the device is sleeping and is woken by the button then two things should happen:
This is a slightly new idea for the main loop in that there is a fixed time for the sleep window to end, not just the size of the sleep window. It shouldn't be awful to implement though.
What happens now is that the device wakes up and powers up and starts the slide show, and then that goes until the sleep window ends. That can be a long way away (up to an hour normally). This is not what we want. We just want a peek.
An alternative is that when we wake up we end the sleep window and go directly to monitoring mode, perform monitoring and communication while the slideshow is running, and then enter a new sleep window. This would be fine probably.