aboutsummaryrefslogtreecommitdiff
path: root/src/button.h
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2026-02-28 17:37:19 +0530
committerAkshay Nair <phenax5@gmail.com>2026-02-28 17:37:19 +0530
commit18268280dc6c0bd44035b53655ae43e9c88245bd (patch)
treec17b1703d8a3deb4cd67a6e6466d024f02a49bb7 /src/button.h
parent02c12bfedcf669df81491ea49502a982e980bcda (diff)
downloaddaft-watch-18268280dc6c0bd44035b53655ae43e9c88245bd.tar.gz
daft-watch-18268280dc6c0bd44035b53655ae43e9c88245bd.zip
Add set time mode + test for button
Diffstat (limited to '')
-rw-r--r--src/button.h17
1 files changed, 10 insertions, 7 deletions
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 <stdbool.h>
-#include <stdint.h>
+
+#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