From f34b1e2fbd94bcc8d0ee2e2e2e43e214d0b329a1 Mon Sep 17 00:00:00 2001 From: krolyxon Date: Mon, 11 May 2026 14:01:44 +0530 Subject: Migrate to PlatformIO Now since i have been able to make PSRAM working with platformio, i don't have to use this shitty Arduino-IDE anymore which does not even allow me to use subfolders like a normal programmer would do --- src/buttons.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/buttons.cpp (limited to 'src/buttons.cpp') diff --git a/src/buttons.cpp b/src/buttons.cpp new file mode 100644 index 0000000..27ce40b --- /dev/null +++ b/src/buttons.cpp @@ -0,0 +1,20 @@ +#include "buttons.h" +#include +#include "config.h" + +void buttonsInit() +{ + pinMode(BTN_UP, INPUT_PULLUP); + 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); } -- cgit v1.2.3