summaryrefslogtreecommitdiffstats
path: root/buttons.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'buttons.hpp')
-rw-r--r--buttons.hpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/buttons.hpp b/buttons.hpp
index 3899127..b8ecbc3 100644
--- a/buttons.hpp
+++ b/buttons.hpp
@@ -12,9 +12,20 @@
#define BUTTON_DOWN 20
#define BUTTON_UP 21
-// time is currently shared between all buttons.
-extern unsigned long button_last_pressed_time;
-extern const int button_delay_time;
+struct global_status {
+ int current_app = 0;
+ bool is_sleeping = false;
+ bool app_ready = true;
+ bool app_rendering = false;
+
+ // Debounce control
+ // See https://www.raspberrypi.org/forums/viewtopic.php?f=145&t=301522#p1812063
+ // Time is currently shared between all buttons.
+ unsigned long button_last_pressed_time;
+ const int button_delay_time = 50;
+};
+
+extern global_status g_s;
void init_buttons();
void gpio_interrupt_cb(uint gpio, uint32_t events);