How to detect period of user inactivity and lock screen?
Hello,
I am working on a Cortex M4 and I'd like to add some power-saving features to my program and figured I'd need to detect user activity. For this reason, I'd like to
- detect if a user hasn't tapped the touchscreen for x [e.g. 5] seconds, and if so:
- dim the screen's backlight as much as possible or, better yet, manually set the display to standby and disable touch sensing.
- clock-down the MCU.
- if a HW button is pressed, I'd like to wake the display back up again, and increase the clock again.
Furthermore, I created a dedicated "charging screen" (basically only an animated battery filling up some bars in a loop) from which I want to go to power-saving mode even when a user touches the screen in order to charge faster.
So, my questions are:
- Where is the `TouchController::sampleTouch(...)` method even called? I haven't found it anywhere in the code...
- Would the `TouchController` be the best place to put the logic for detecting inactivity?
- If not, where should I best put this kind of code?
Thanks in advance.
