From 18268280dc6c0bd44035b53655ae43e9c88245bd Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 28 Feb 2026 17:37:19 +0530 Subject: Add set time mode + test for button --- src/button.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/button.h') diff --git a/src/button.h b/src/button.h index 8aa7442..5152336 100644 --- a/src/button.h +++ b/src/button.h @@ -1,19 +1,22 @@ #ifndef _LOADED_BUTTON #define _LOADED_BUTTON #include -#include + +#include "mode.h" #define DEBOUNCE_TICK_COUNT 10 #define LONG_PRESS_TICK_COUNT 60 #define MAX_TICK_COUNT 80 +#define BUTTON_INACTIVE_TICK_COUNT 10 + +bool extern is_button_active; -enum ButtonState { - BUTTON_IDLE = 0, - BUTTON_PRESSED = 1, - BUTTON_LONG_PRESSED = 2, -}; +void button_tick(); +enum ButtonState check_button_state(); + +// Exposed for test uint16_t extern button_tick_count; +uint16_t extern button_inactive_for_ticks; -void button_tick(); #endif -- cgit v1.3.1