mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Fix T1000-E button helper polarity
This commit is contained in:
parent
a22c4b6270
commit
080c613497
1 changed files with 5 additions and 1 deletions
|
|
@ -4,6 +4,10 @@
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <helpers/NRF52Board.h>
|
#include <helpers/NRF52Board.h>
|
||||||
|
|
||||||
|
#ifndef USER_BTN_PRESSED
|
||||||
|
#define USER_BTN_PRESSED LOW
|
||||||
|
#endif
|
||||||
|
|
||||||
class T1000eBoard : public NRF52BoardDCDC {
|
class T1000eBoard : public NRF52BoardDCDC {
|
||||||
protected:
|
protected:
|
||||||
uint8_t btn_prev_state;
|
uint8_t btn_prev_state;
|
||||||
|
|
@ -43,7 +47,7 @@ public:
|
||||||
uint8_t v = digitalRead(BUTTON_PIN);
|
uint8_t v = digitalRead(BUTTON_PIN);
|
||||||
if (v != btn_prev_state) {
|
if (v != btn_prev_state) {
|
||||||
btn_prev_state = v;
|
btn_prev_state = v;
|
||||||
return (v == LOW) ? 1 : -1;
|
return (v == USER_BTN_PRESSED) ? 1 : -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue