Skip to content

Commit fe376e8

Browse files
author
Scott Powell
committed
* RAK_4631: ui-new
1 parent f5ad1df commit fe376e8

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

src/helpers/nrf52/SerialBLEInterface.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,14 @@ void SerialBLEInterface::disable() {
116116
_isEnabled = false;
117117
BLE_DEBUG_PRINTLN("SerialBLEInterface::disable");
118118

119+
#ifdef RAK_BOARD
120+
Bluefruit.disconnect(Bluefruit.connHandle());
121+
#else
119122
uint16_t conn_id;
120123
if (Bluefruit.getConnectedHandles(&conn_id, 1) > 0) {
121124
Bluefruit.disconnect(conn_id);
122125
}
126+
#endif
123127

124128
Bluefruit.Advertising.restartOnDisconnect(false);
125129
Bluefruit.Advertising.stop();

variants/rak4631/platformio.ini

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ build_src_filter = ${rak4631.build_src_filter}
6464
extends = rak4631
6565
build_flags =
6666
${rak4631.build_flags}
67+
-I examples/companion_radio/ui-new
6768
-D PIN_USER_BTN=9
6869
-D PIN_USER_BTN_ANA=31
6970
-D DISPLAY_CLASS=SSD1306Display
@@ -73,7 +74,9 @@ build_flags =
7374
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
7475
build_src_filter = ${rak4631.build_src_filter}
7576
+<helpers/ui/SSD1306Display.cpp>
76-
+<../examples/companion_radio>
77+
+<helpers/ui/MomentaryButton.cpp>
78+
+<../examples/companion_radio/*.cpp>
79+
+<../examples/companion_radio/ui-new/*.cpp>
7780
lib_deps =
7881
${rak4631.lib_deps}
7982
densaugeo/base64 @ ~1.4.0
@@ -82,6 +85,7 @@ lib_deps =
8285
extends = rak4631
8386
build_flags =
8487
${rak4631.build_flags}
88+
-I examples/companion_radio/ui-new
8589
-D PIN_USER_BTN=9
8690
-D PIN_USER_BTN_ANA=31
8791
-D DISPLAY_CLASS=SSD1306Display
@@ -95,7 +99,9 @@ build_flags =
9599
build_src_filter = ${rak4631.build_src_filter}
96100
+<helpers/ui/SSD1306Display.cpp>
97101
+<helpers/nrf52/SerialBLEInterface.cpp>
98-
+<../examples/companion_radio>
102+
+<helpers/ui/MomentaryButton.cpp>
103+
+<../examples/companion_radio/*.cpp>
104+
+<../examples/companion_radio/ui-new/*.cpp>
99105
lib_deps =
100106
${rak4631.lib_deps}
101107
densaugeo/base64 @ ~1.4.0

variants/rak4631/target.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ RAK4631Board board;
66

77
#ifdef DISPLAY_CLASS
88
DISPLAY_CLASS display;
9+
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
910
#endif
1011

1112
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI);

variants/rak4631/target.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#ifdef DISPLAY_CLASS
1212
#include <helpers/ui/SSD1306Display.h>
1313
extern DISPLAY_CLASS display;
14+
#include <helpers/ui/MomentaryButton.h>
15+
extern MomentaryButton user_btn;
1416
#endif
1517

1618
extern RAK4631Board board;

0 commit comments

Comments
 (0)