diff options
Diffstat (limited to 'globals.hpp')
-rw-r--r-- | globals.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/globals.hpp b/globals.hpp new file mode 100644 index 0000000..0f61f64 --- /dev/null +++ b/globals.hpp @@ -0,0 +1,28 @@ +#pragma once +#include "base_app.hpp" + +struct global_status { + BaseApp* current_app = 0; + bool is_sleeping = false; + bool app_ready = true; + bool app_switch_requested = false; + int app_switch_to_app = 0; + + // 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 = 125; +}; + +struct user_settings { + unsigned char oled_contrast = OLED_DEFAULT_CONTRAST; + // In milliseconds + unsigned int sleep_delay = ENTER_SLEEP_DELAY; + // true: 24h, false: AM/PM + // TODO: Use an enum, but this would make programming the UI more complex. + bool time_format = true; +}; + +extern global_status g_s; +extern user_settings g_user;
\ No newline at end of file |