From 768668d78b8d92fe78f99bd142d5c9cb361c0d14 Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Mon, 17 Feb 2025 19:50:03 +0300 Subject: [PATCH] Refactoring: Buttons - rename revert to swapButtonMenu --- source/Core/Drivers/Buttons.cpp | 6 +++--- source/Core/Drivers/Buttons.hpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/Core/Drivers/Buttons.cpp b/source/Core/Drivers/Buttons.cpp index 8e08d47f..1fcc9a25 100644 --- a/source/Core/Drivers/Buttons.cpp +++ b/source/Core/Drivers/Buttons.cpp @@ -11,7 +11,7 @@ #include TickType_t lastButtonTime = 0; -ButtonState getButtonState(bool revert) { +ButtonState getButtonState(bool swapButtonMenu) { /* * Read in the buttons and then determine if a state change needs to occur */ @@ -28,8 +28,8 @@ ButtonState getButtonState(bool revert) { static TickType_t previousStateChange = 0; const TickType_t timeout = TICKS_100MS * 4; uint8_t currentState; - currentState = (getButtonA()) << (0 xor revert); - currentState |= (getButtonB()) << (1 xor revert); + currentState = (getButtonA()) << (0 xor swapButtonMenu); + currentState |= (getButtonB()) << (1 xor swapButtonMenu); if (currentState) { lastButtonTime = xTaskGetTickCount(); diff --git a/source/Core/Drivers/Buttons.hpp b/source/Core/Drivers/Buttons.hpp index e85d7112..2b82ecf5 100644 --- a/source/Core/Drivers/Buttons.hpp +++ b/source/Core/Drivers/Buttons.hpp @@ -27,7 +27,8 @@ enum ButtonState { }; // Returns what buttons are pressed (if any) -ButtonState getButtonState(bool revert=0); +ButtonState getButtonState(bool swapButtonMenu = 0); + // Helpers void waitForButtonPressOrTimeout(TickType_t timeout); void waitForButtonPress();