optimized and commented code

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2025-06-14 19:02:51 +02:00
parent 4aa3e2cbeb
commit 52a49363eb
10 changed files with 494 additions and 134 deletions

View File

@@ -2,6 +2,20 @@
#include <functional>
enum class ButtonType { NONE, UP, DOWN, LEFT, RIGHT, SELECT, BACK };
// Enumeration defining the different types of buttons available in the system
// NONE represents no button pressed or an invalid button state
enum class ButtonType {
NONE, // No button or invalid state
UP, // Up directional button
DOWN, // Down directional button
LEFT, // Left directional button
RIGHT, // Right directional button
SELECT, // Select/confirm button
BACK // Back/cancel button
};
typedef std::function<void(uint8_t, ButtonType)> ButtonCallback;
// Type alias for button event callback function
// Parameters:
// - uint8_t: Button identifier or additional data
// - ButtonType: The type of button that was pressed
typedef std::function<void(uint8_t, ButtonType)> ButtonCallback;