Browse Source
Merge pull request #588 from liamcottle/feature/new-companion-ui-thinknode-m1
add support for new companion ui on thinknode m1
pull/598/head
ripplebiz
10 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
8 additions and
3 deletions
-
examples/companion_radio/UITask.cpp
-
src/helpers/ui/GxEPDDisplay.cpp
-
variants/thinknode_m1/platformio.ini
-
variants/thinknode_m1/target.cpp
-
variants/thinknode_m1/target.h
|
|
|
@ -305,7 +305,7 @@ public: |
|
|
|
} else { |
|
|
|
sprintf(tmp, "%dh", secs / (60*60)); |
|
|
|
} |
|
|
|
display.setCursor(display.width() - display.getTextWidth(tmp), 0); |
|
|
|
display.setCursor(display.width() - display.getTextWidth(tmp) - 2, 0); |
|
|
|
display.print(tmp); |
|
|
|
|
|
|
|
display.drawRect(0, 11, display.width(), 1); // horiz line
|
|
|
|
|
|
|
|
@ -68,10 +68,11 @@ void GxEPDDisplay::setTextSize(int sz) { |
|
|
|
} |
|
|
|
|
|
|
|
void GxEPDDisplay::setColor(Color c) { |
|
|
|
// colours need to be inverted for epaper displays
|
|
|
|
if (c == DARK) { |
|
|
|
display.setTextColor(_curr_color = GxEPD_BLACK); |
|
|
|
} else { |
|
|
|
display.setTextColor(_curr_color = GxEPD_WHITE); |
|
|
|
} else { |
|
|
|
display.setTextColor(_curr_color = GxEPD_BLACK); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -83,6 +83,7 @@ build_src_filter = ${ThinkNode_M1.build_src_filter} |
|
|
|
+<helpers/nrf52/SerialBLEInterface.cpp> |
|
|
|
+<helpers/ui/GxEPDDisplay.cpp> |
|
|
|
+<helpers/ui/buzzer.cpp> |
|
|
|
+<helpers/ui/MomentaryButton.cpp> |
|
|
|
+<../examples/companion_radio> |
|
|
|
lib_deps = |
|
|
|
${ThinkNode_M1.lib_deps} |
|
|
|
|
|
|
|
@ -16,6 +16,7 @@ ThinkNodeM1SensorManager sensors = ThinkNodeM1SensorManager(nmea); |
|
|
|
|
|
|
|
#ifdef DISPLAY_CLASS |
|
|
|
DISPLAY_CLASS display; |
|
|
|
MomentaryButton user_btn(PIN_USER_BTN, 1000, true); |
|
|
|
#endif |
|
|
|
|
|
|
|
bool radio_init() { |
|
|
|
|
|
|
|
@ -10,6 +10,7 @@ |
|
|
|
#include <helpers/sensors/LocationProvider.h> |
|
|
|
#ifdef DISPLAY_CLASS |
|
|
|
#include <helpers/ui/GxEPDDisplay.h> |
|
|
|
#include <helpers/ui/MomentaryButton.h> |
|
|
|
#endif |
|
|
|
|
|
|
|
class ThinkNodeM1SensorManager : public SensorManager { |
|
|
|
@ -37,6 +38,7 @@ extern ThinkNodeM1SensorManager sensors; |
|
|
|
|
|
|
|
#ifdef DISPLAY_CLASS |
|
|
|
extern DISPLAY_CLASS display; |
|
|
|
extern MomentaryButton user_btn; |
|
|
|
#endif |
|
|
|
|
|
|
|
bool radio_init(); |
|
|
|
|