mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-25 06:42:13 +00:00
Default button polarity to active-LOW across all firmware types
Nearly all LoRa boards use a boot button that pulls to ground when pressed.
This commit is contained in:
committed by
Wessel Nieboer
parent
fb726e48c2
commit
0a13ac7fc7
@@ -2,6 +2,10 @@
|
||||
#include <Arduino.h>
|
||||
#include <helpers/CommonCLI.h>
|
||||
|
||||
#ifndef USER_BTN_PRESSED
|
||||
#define USER_BTN_PRESSED LOW
|
||||
#endif
|
||||
|
||||
#define AUTO_OFF_MILLIS 20000 // 20 seconds
|
||||
#define BOOT_SCREEN_MILLIS 4000 // 4 seconds
|
||||
|
||||
@@ -85,7 +89,7 @@ void UITask::loop() {
|
||||
if (millis() >= _next_read) {
|
||||
int btnState = digitalRead(PIN_USER_BTN);
|
||||
if (btnState != _prevBtnState) {
|
||||
if (btnState == LOW) { // pressed?
|
||||
if (btnState == USER_BTN_PRESSED) { // pressed?
|
||||
if (_display->isOn()) {
|
||||
// TODO: any action ?
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user