diff options
author | uvok | 2025-07-19 13:21:56 +0200 |
---|---|---|
committer | uvok | 2025-07-19 13:21:56 +0200 |
commit | cde2c46b4fcc027e7e64510a3241c196f6fe5ba0 (patch) | |
tree | 1ff1184113fdd63d07a4f2059f32aaf1f0ca5e59 /src/gpio.cpp | |
parent | 7b0712a41a4e861dda0a00be0179880b25a5437a (diff) |
Add very ugly prev/next navigation
Diffstat (limited to 'src/gpio.cpp')
-rw-r--r-- | src/gpio.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gpio.cpp b/src/gpio.cpp index 1bf50a0..a419d99 100644 --- a/src/gpio.cpp +++ b/src/gpio.cpp @@ -11,9 +11,7 @@ // Elecrow #define EXIT_KEY 1 #define HOME_KEY 2 -#define NEXT_KEY 4 #define OK_KEY 5 -#define PRV_KEY 6 #endif #define GPIO_STACK 2048 @@ -76,6 +74,8 @@ void de::uvok::badge::gpio_init(void) #endif } +static volatile uint8_t event; + // "Poll task", for button 0. long de::uvok::badge::gpio_poll(void) { @@ -101,6 +101,13 @@ long de::uvok::badge::gpio_poll(void) pressDuration = releasedTime - pressedTime; }; + if (event) + { + uint8_t r = event; + event = 0; + return r; + } + return pressDuration; } @@ -128,6 +135,7 @@ static void gpio_loop(void *ctx) continue; LOG_F(" Handling\n"); + event = pin; } } } |