Skip to content

Commit d2bbe4d

Browse files
committed
Fix Xiao nRF52840 repeater compile failure
Compile fails due to user_btn not declared in board target. Fixes: - Add MomentaryButton declaration for user_btn in variants/xiao_nrf52/target.cpp - Add momentary button helper include in variants/xiao_nrf52/target.h - Add extern linkage for MomentaryButton -> user_btn in variants/xiao_nrf52/target.h
1 parent a45dae9 commit d2bbe4d

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

variants/xiao_nrf52/XiaoNrf52Board.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class XiaoNrf52Board : public NRF52BoardDCDC {
4747

4848
#ifdef PIN_USER_BTN
4949
// configure button press to wake up when in powered off state
50-
nrf_gpio_cfg_sense_input(digitalPinToInterrupt(g_ADigitalPinMap[PIN_USER_BTN]), NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_LOW);
50+
nrf_gpio_cfg_sense_input(digitalPinToInterrupt(g_ADigitalPinMap[PIN_USER_BTN]), NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
5151
#endif
5252

5353
NRF52Board::powerOff();

variants/xiao_nrf52/target.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#ifdef DISPLAY_CLASS
66
DISPLAY_CLASS display;
7+
MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true);
78
#endif
89

910
XiaoNrf52Board board;

variants/xiao_nrf52/target.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
#ifdef DISPLAY_CLASS
1313
#include <helpers/ui/NullDisplayDriver.h>
14+
#include <helpers/ui/MomentaryButton.h>
1415
extern DISPLAY_CLASS display;
16+
extern MomentaryButton user_btn;
1517
#endif
1618

1719
extern XiaoNrf52Board board;

0 commit comments

Comments
 (0)