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:
Wessel Nieboer
2026-02-07 16:18:23 +01:00
committed by Wessel Nieboer
parent fb726e48c2
commit 0a13ac7fc7
11 changed files with 27 additions and 11 deletions

View File

@@ -4,6 +4,10 @@
#include <Arduino.h>
#include <helpers/NRF52Board.h>
#ifndef USER_BTN_PRESSED
#define USER_BTN_PRESSED LOW
#endif
#ifdef XIAO_NRF52
class XiaoNrf52Board : public NRF52BoardDCDC {
@@ -35,7 +39,7 @@ public:
// set led on and wait for button release before poweroff
digitalWrite(PIN_LED, LOW);
#ifdef PIN_USER_BTN
while(digitalRead(PIN_USER_BTN) == LOW);
while(digitalRead(PIN_USER_BTN) == USER_BTN_PRESSED);
#endif
digitalWrite(LED_GREEN, HIGH);
digitalWrite(LED_BLUE, HIGH);