2024-06-30 10:08 PM - edited 2024-06-30 10:15 PM
I follow the guidelines in this article
https://support.touchgfx.com/docs/development/scenarios/example-gpio
and my Touchgfx program can react to a single hardware button pressed event.
Now I need to add 1 more hardware button and calculate how long the user has been pressing a button in order to direct a user to the relevant setup screen.
I have a few questions I would like to ask:
1. The HAL class has a single pointer to a ButtonController-inherited class object: ButtonController* buttonController, does it imply that I need to write a single class to handle all pressed events of all hardware buttons?
2. How often the method ButtonController::sample(uint8_t &key) is called andby which class?
3. How should I calculate the duration of a button press with the current Touchgfx's classes (ButtonController for example) and methods?
Thank you for your help.