Default button polarity to active-LOW across all firmware types

Nearly all LoRa boards use a boot button that pulls to ground when
pressed.
Šī revīzija ir iekļauta:
Wessel Nieboer
2026-04-04 13:19:13 +02:00
revīziju iesūtīja Wessel Nieboer
vecāks fb726e48c2
revīzija 0a13ac7fc7
11 mainīti faili ar 27 papildinājumiem un 11 dzēšanām
+5 -1
Parādīt failu
@@ -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);