Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/companion_radio/ui-new/UITask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ class HomeScreen : public UIScreen {
FIRST,
RECENT,
RADIO,
#ifndef UI_HIDE_BLUETOOTH_PAGE
BLUETOOTH,
#endif
ADVERT,
#if ENV_INCLUDE_GPS == 1
GPS,
Expand Down Expand Up @@ -278,13 +280,15 @@ class HomeScreen : public UIScreen {
display.setCursor(0, 53);
sprintf(tmp, "Noise floor: %d", radio_driver.getNoiseFloor());
display.print(tmp);
#ifndef UI_HIDE_BLUETOOTH_PAGE
} else if (_page == HomePage::BLUETOOTH) {
display.setColor(DisplayDriver::GREEN);
display.drawXbm((display.width() - 32) / 2, 18,
_task->isSerialEnabled() ? bluetooth_on : bluetooth_off,
32, 32);
display.setTextSize(1);
display.drawTextCentered(display.width() / 2, 64 - 11, "toggle: " PRESS_LABEL);
#endif
} else if (_page == HomePage::ADVERT) {
display.setColor(DisplayDriver::GREEN);
display.drawXbm((display.width() - 32) / 2, 18, advert_icon, 32, 32);
Expand Down Expand Up @@ -425,6 +429,7 @@ class HomeScreen : public UIScreen {
}
return true;
}
#ifndef UI_HIDE_BLUETOOTH_PAGE
if (c == KEY_ENTER && _page == HomePage::BLUETOOTH) {
if (_task->isSerialEnabled()) { // toggle Bluetooth on/off
_task->disableSerial();
Expand All @@ -433,6 +438,7 @@ class HomeScreen : public UIScreen {
}
return true;
}
#endif
if (c == KEY_ENTER && _page == HomePage::ADVERT) {
_task->notify(UIEventType::ack);
if (the_mesh.advert()) {
Expand Down
8 changes: 8 additions & 0 deletions variants/thinknode_m6/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,16 @@ build_flags =
-D OFFLINE_QUEUE_SIZE=256
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
-D QSPIFLASH=1
-D DISPLAY_CLASS=NullDisplayDriver
-D PIN_STATUS_LED=PIN_LED_RED
-D UI_HIDE_BLUETOOTH_PAGE
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${ThinkNode_M6.build_src_filter}
+<helpers/nrf52/SerialBLEInterface.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${ThinkNode_M6.lib_deps}
densaugeo/base64 @ ~1.4.0
Expand All @@ -109,10 +113,14 @@ build_flags =
-D QSPIFLASH=1
-D OFFLINE_QUEUE_SIZE=256
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
-D DISPLAY_CLASS=NullDisplayDriver
-D PIN_STATUS_LED=PIN_LED_RED
-D UI_HIDE_BLUETOOTH_PAGE
build_src_filter = ${ThinkNode_M6.build_src_filter}
+<helpers/ui/buzzer.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${ThinkNode_M6.lib_deps}
densaugeo/base64 @ ~1.4.0
Expand Down
4 changes: 3 additions & 1 deletion variants/thinknode_m6/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include <helpers/sensors/EnvironmentSensorManager.h>
#include <helpers/sensors/LocationProvider.h>
#ifdef DISPLAY_CLASS
#include <helpers/ui/GxEPDDisplay.h>
// The M6 is screenless; DISPLAY_CLASS=NullDisplayDriver is used only to run
// UITask headless so the status LED (PIN_STATUS_LED) and button work.
#include <helpers/ui/NullDisplayDriver.h>
#include <helpers/ui/MomentaryButton.h>
#endif

Expand Down