diff options
| author | krolyxon <me@krolyxon.com> | 2026-05-06 15:34:42 +0530 |
|---|---|---|
| committer | krolyxon <me@krolyxon.com> | 2026-05-06 15:34:42 +0530 |
| commit | 8f6c64d4b3e02e7c16c5130f3593c4825327fcbe (patch) | |
| tree | 65c22f1caa2054a70adf8c91848ee7ebddd3b37c /firmware/buttons.cpp | |
| parent | 2e20bbf3116601e35c2f93ce73d879f5f959a3f7 (diff) | |
prompt before restarting
Diffstat (limited to 'firmware/buttons.cpp')
| -rw-r--r-- | firmware/buttons.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/buttons.cpp b/firmware/buttons.cpp index d28c4cc..27ce40b 100644 --- a/firmware/buttons.cpp +++ b/firmware/buttons.cpp @@ -1,10 +1,6 @@ #include "buttons.h" #include <Arduino.h> - -#define BTN_UP 4 -#define BTN_DOWN 5 -#define BTN_SELECT 6 -#define BTN_BACK 7 +#include "config.h" void buttonsInit() { @@ -12,9 +8,13 @@ void buttonsInit() pinMode(BTN_DOWN, INPUT_PULLUP); pinMode(BTN_SELECT, INPUT_PULLUP); pinMode(BTN_BACK, INPUT_PULLUP); + pinMode(BTN_RIGHT, INPUT_PULLUP); + pinMode(BTN_LEFT, INPUT_PULLUP); } bool btnUp() { return !digitalRead(BTN_UP); } bool btnDown() { return !digitalRead(BTN_DOWN); } bool btnSelect() { return !digitalRead(BTN_SELECT); } bool btnBack() { return !digitalRead(BTN_BACK); } +bool btnRight() { return !digitalRead(BTN_RIGHT); } +bool btnLeft() { return !digitalRead(BTN_LEFT); } |
