mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Updated to use #if defined... instead of #ifdef
This commit is contained in:
parent
faf043327d
commit
9a0b6e5326
1 changed files with 1 additions and 2 deletions
|
|
@ -209,7 +209,7 @@ void UITask::userLedHandler() {
|
|||
}
|
||||
|
||||
void UITask::buttonHandler() {
|
||||
#ifdef PIN_USER_BTN || PIN_USER_BTN_ANA
|
||||
#if defined(PIN_USER_BTN) || defined(PIN_USER_BTN_ANA)
|
||||
static int prev_btn_state = !USER_BTN_PRESSED;
|
||||
static int prev_btn_state_ana = !USER_BTN_PRESSED;
|
||||
static unsigned long btn_state_change_time = 0;
|
||||
|
|
@ -224,7 +224,6 @@ void UITask::buttonHandler() {
|
|||
#ifdef PIN_USER_BTN_ANA
|
||||
btn_state_ana = (analogRead(PIN_USER_BTN_ANA) < 20); // analogRead returns a value hopefully below 20 when button is pressed.
|
||||
#endif
|
||||
//Serial.println(analogRead(PIN_USER_BTN_ANA));
|
||||
if (btn_state != prev_btn_state || btn_state_ana != prev_btn_state_ana) { // check for either digital or analogue button change of state
|
||||
if (btn_state == USER_BTN_PRESSED || btn_state_ana == USER_BTN_PRESSED) { // pressed?
|
||||
if (_display != NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue