diff options
Diffstat (limited to 'buttons.hpp')
-rw-r--r-- | buttons.hpp | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/buttons.hpp b/buttons.hpp index c9a8b2d..f3ee020 100644 --- a/buttons.hpp +++ b/buttons.hpp @@ -1,5 +1,4 @@ -#ifndef __BUTTONS_H__ -#define __BUTTONS_H__ +#pragma once #include "init.hpp" // Init buttons used in conjuction with interrupts @@ -12,34 +11,6 @@ #define BUTTON_DOWN 20 #define BUTTON_UP 21 -struct global_status { - int 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; - void init_buttons(); void gpio_interrupt_cb(uint gpio, uint32_t events); unsigned long time_since_button_press(); - -#endif
\ No newline at end of file |