mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Refactoring: Buttons - rename revert to swapButtonMenu
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
#include <Buttons.hpp>
|
#include <Buttons.hpp>
|
||||||
TickType_t lastButtonTime = 0;
|
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
|
* 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;
|
static TickType_t previousStateChange = 0;
|
||||||
const TickType_t timeout = TICKS_100MS * 4;
|
const TickType_t timeout = TICKS_100MS * 4;
|
||||||
uint8_t currentState;
|
uint8_t currentState;
|
||||||
currentState = (getButtonA()) << (0 xor revert);
|
currentState = (getButtonA()) << (0 xor swapButtonMenu);
|
||||||
currentState |= (getButtonB()) << (1 xor revert);
|
currentState |= (getButtonB()) << (1 xor swapButtonMenu);
|
||||||
|
|
||||||
if (currentState) {
|
if (currentState) {
|
||||||
lastButtonTime = xTaskGetTickCount();
|
lastButtonTime = xTaskGetTickCount();
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ enum ButtonState {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Returns what buttons are pressed (if any)
|
// Returns what buttons are pressed (if any)
|
||||||
ButtonState getButtonState(bool revert=0);
|
ButtonState getButtonState(bool swapButtonMenu = 0);
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
void waitForButtonPressOrTimeout(TickType_t timeout);
|
void waitForButtonPressOrTimeout(TickType_t timeout);
|
||||||
void waitForButtonPress();
|
void waitForButtonPress();
|
||||||
|
|||||||
Reference in New Issue
Block a user