Merge upstream/dev (10 commits) [upstream-sync]
This commit is contained in:
commit
9d02e2870d
21 files changed
+123
-33
No files matched your search
@@ -1199,7 +1199,9 @@ void MyMesh::handleCmdFrame(size_t len) {
|
|||||||
? ERR_CODE_NOT_FOUND
|
? ERR_CODE_NOT_FOUND
|
||||||
: ERR_CODE_UNSUPPORTED_CMD); // unknown recipient, or unsupported TXT_TYPE_*
|
: ERR_CODE_UNSUPPORTED_CMD); // unknown recipient, or unsupported TXT_TYPE_*
|
||||||
}
|
}
|
||||||
} else if (cmd_frame[0] == CMD_SEND_CHANNEL_TXT_MSG) { // send GroupChannel text msg
|
} else if (cmd_frame[0] == CMD_SEND_CHANNEL_TXT_MSG && len >= 7) { // send GroupChannel text msg
|
||||||
|
// 7 = code, txt_type, channel_idx and the 4 byte timestamp; the text may be empty.
|
||||||
|
// Without this the text length below is computed as len - 7 and turns negative.
|
||||||
int i = 1;
|
int i = 1;
|
||||||
uint8_t txt_type = cmd_frame[i++]; // should be TXT_TYPE_PLAIN
|
uint8_t txt_type = cmd_frame[i++]; // should be TXT_TYPE_PLAIN
|
||||||
uint8_t channel_idx = cmd_frame[i++];
|
uint8_t channel_idx = cmd_frame[i++];
|
||||||
|
|||||||
@@ -197,11 +197,10 @@ class HomeScreen : public UIScreen {
|
|||||||
sensors_nb ++;
|
sensors_nb ++;
|
||||||
}
|
}
|
||||||
sensors_scroll = sensors_nb > UI_RECENT_LIST_SIZE;
|
sensors_scroll = sensors_nb > UI_RECENT_LIST_SIZE;
|
||||||
#if AUTO_OFF_MILLIS > 0
|
if (display.isEink()) // preserve eink displays
|
||||||
next_sensors_refresh = millis() + 5000; // refresh sensor values every 5 sec
|
next_sensors_refresh = millis() + 60000; // refresh sensor values every 1 min
|
||||||
#else
|
else
|
||||||
next_sensors_refresh = millis() + 60000; // refresh sensor values every 1 min
|
next_sensors_refresh = millis() + 5000; // refresh sensor values every 5 sec
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -705,11 +704,7 @@ public:
|
|||||||
display.translateUTF8ToBlocks(filtered_msg, p->msg, sizeof(filtered_msg));
|
display.translateUTF8ToBlocks(filtered_msg, p->msg, sizeof(filtered_msg));
|
||||||
display.printWordWrap(filtered_msg, display.width());
|
display.printWordWrap(filtered_msg, display.width());
|
||||||
|
|
||||||
#if AUTO_OFF_MILLIS==0 // probably e-ink
|
return display.isEink() ? 10000 : 1000; // 10 s for eink
|
||||||
return 10000; // 10 s
|
|
||||||
#else
|
|
||||||
return 1000; // next render after 1000 ms
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool handleInput(char c) override {
|
bool handleInput(char c) override {
|
||||||
@@ -741,6 +736,9 @@ void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* no
|
|||||||
#if defined(PIN_USER_BTN_ANA)
|
#if defined(PIN_USER_BTN_ANA)
|
||||||
analog_btn.begin();
|
analog_btn.begin();
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(BACKLIGHT_BTN)
|
||||||
|
backlight_btn.begin();
|
||||||
|
#endif
|
||||||
|
|
||||||
_node_prefs = node_prefs;
|
_node_prefs = node_prefs;
|
||||||
|
|
||||||
@@ -912,9 +910,11 @@ void UITask::shutdown(bool restart){
|
|||||||
if (restart) {
|
if (restart) {
|
||||||
_board->reboot();
|
_board->reboot();
|
||||||
} else {
|
} else {
|
||||||
display.forceFullRefresh();
|
if (_display->isEink()) {
|
||||||
display.clear();
|
_display->blankScreen();
|
||||||
display.endFrame();
|
_display->turnOff();
|
||||||
|
_display->powerOff();
|
||||||
|
}
|
||||||
// Power off board including radio, display, GPS and components
|
// Power off board including radio, display, GPS and components
|
||||||
_board->powerOff();
|
_board->powerOff();
|
||||||
}
|
}
|
||||||
@@ -959,7 +959,9 @@ void UITask::loop() {
|
|||||||
if (ev == BUTTON_EVENT_CLICK) {
|
if (ev == BUTTON_EVENT_CLICK) {
|
||||||
c = checkDisplayOn(KEY_ENTER);
|
c = checkDisplayOn(KEY_ENTER);
|
||||||
} else if (ev == BUTTON_EVENT_LONG_PRESS) {
|
} else if (ev == BUTTON_EVENT_LONG_PRESS) {
|
||||||
|
display.blankScreen();
|
||||||
display.turnOff();
|
display.turnOff();
|
||||||
|
display.powerOff();
|
||||||
} else if (ev == BUTTON_EVENT_DOUBLE_CLICK) {
|
} else if (ev == BUTTON_EVENT_DOUBLE_CLICK) {
|
||||||
c = handleDoubleClick(KEY_SELECT);
|
c = handleDoubleClick(KEY_SELECT);
|
||||||
} else if (ev == BUTTON_EVENT_TRIPLE_CLICK) {
|
} else if (ev == BUTTON_EVENT_TRIPLE_CLICK) {
|
||||||
@@ -1004,13 +1006,31 @@ void UITask::loop() {
|
|||||||
#endif
|
#endif
|
||||||
#if defined(BACKLIGHT_BTN)
|
#if defined(BACKLIGHT_BTN)
|
||||||
if (millis() > next_backlight_btn_check) {
|
if (millis() > next_backlight_btn_check) {
|
||||||
bool touch_state = digitalRead(PIN_BUTTON2);
|
if (backlight_btn.isPressed()) {
|
||||||
|
if (!_display->isOn()) {
|
||||||
|
_display->turnOn();
|
||||||
|
_next_refresh = 0;
|
||||||
|
}
|
||||||
|
_auto_off = millis() + AUTO_OFF_MILLIS; // extend auto-off timer
|
||||||
|
backlight_btn_pressed_at = millis(); // still pressed
|
||||||
|
}
|
||||||
|
bool touch_state = (millis() - backlight_btn_pressed_at > 5000);
|
||||||
|
// Backlight button events
|
||||||
|
int bev = backlight_btn.check();
|
||||||
|
if (bev == BUTTON_EVENT_DOUBLE_CLICK) {
|
||||||
|
_display->forceFullRefresh();
|
||||||
|
} else if (bev == BUTTON_EVENT_TRIPLE_CLICK) {
|
||||||
|
_display->blankScreen();
|
||||||
|
_display->turnOff();
|
||||||
|
_display->powerOff();
|
||||||
|
backlight_btn_pressed_at = 0;
|
||||||
|
}
|
||||||
#if defined(DISP_BACKLIGHT)
|
#if defined(DISP_BACKLIGHT)
|
||||||
digitalWrite(DISP_BACKLIGHT, !touch_state);
|
digitalWrite(DISP_BACKLIGHT, !touch_state);
|
||||||
#elif defined(EXP_PIN_BACKLIGHT)
|
#elif defined(EXP_PIN_BACKLIGHT)
|
||||||
expander.digitalWrite(EXP_PIN_BACKLIGHT, !touch_state);
|
expander.digitalWrite(EXP_PIN_BACKLIGHT, !touch_state);
|
||||||
#endif
|
#endif
|
||||||
next_backlight_btn_check = millis() + 300;
|
next_backlight_btn_check = millis() + 100;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1058,6 +1078,12 @@ void UITask::loop() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (millis() > _auto_off) {
|
if (millis() > _auto_off) {
|
||||||
|
#ifdef EINK_SCREENOFF_BLANK
|
||||||
|
if (curr != msg_preview) { // don't blank if messages are waiting
|
||||||
|
_display->blankScreen();
|
||||||
|
_display->powerOff();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
_display->turnOff();
|
_display->turnOff();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -61,7 +61,8 @@ class UITask : public AbstractUITask {
|
|||||||
unsigned long _alert_expiry;
|
unsigned long _alert_expiry;
|
||||||
int _msgcount;
|
int _msgcount;
|
||||||
unsigned long ui_started_at, next_batt_chck;
|
unsigned long ui_started_at, next_batt_chck;
|
||||||
int next_backlight_btn_check = 0;
|
unsigned long next_backlight_btn_check = 0;
|
||||||
|
unsigned long backlight_btn_pressed_at = 0;
|
||||||
#ifdef PIN_STATUS_LED
|
#ifdef PIN_STATUS_LED
|
||||||
int led_state = 0;
|
int led_state = 0;
|
||||||
int next_led_change = 0;
|
int next_led_change = 0;
|
||||||
|
|||||||
@@ -521,6 +521,11 @@ int BaseChatMesh::sendCommandData(const ContactInfo& recipient, uint32_t timest
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool BaseChatMesh::sendGroupMessage(uint32_t timestamp, mesh::GroupChannel& channel, const char* sender_name, const char* text, int text_len) {
|
bool BaseChatMesh::sendGroupMessage(uint32_t timestamp, mesh::GroupChannel& channel, const char* sender_name, const char* text, int text_len) {
|
||||||
|
if (text_len < 0) { // memcpy() below would read this as a size_t, so clamping cannot catch it
|
||||||
|
MESH_DEBUG_PRINTLN("sendGroupMessage: invalid negative text_len=%d", text_len);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t temp[5+MAX_TEXT_LEN+32];
|
uint8_t temp[5+MAX_TEXT_LEN+32];
|
||||||
memcpy(temp, ×tamp, 4); // mostly an extra blob to help make packet_hash unique
|
memcpy(temp, ×tamp, 4); // mostly an extra blob to help make packet_hash unique
|
||||||
temp[4] = 0; // TXT_TYPE_PLAIN
|
temp[4] = 0; // TXT_TYPE_PLAIN
|
||||||
|
|||||||
@@ -2,6 +2,22 @@
|
|||||||
#include "TxtDataHelpers.h"
|
#include "TxtDataHelpers.h"
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// strtof() and atof() also read "nan" and "inf". A NaN cannot be refused by a
|
||||||
|
// range check: no ordered comparison is true for it, and under -ffast-math,
|
||||||
|
// which nRF52 builds use, the compiler may assume it never occurs and fold any
|
||||||
|
// test on the parsed value away. So the text is checked before it is parsed:
|
||||||
|
// after optional white space and sign, a number starts with a digit or a '.'.
|
||||||
|
bool looksLikeANumber(const char* s) {
|
||||||
|
while (isspace((unsigned char)*s)) s++;
|
||||||
|
if (*s == '+' || *s == '-') s++;
|
||||||
|
return isdigit((unsigned char)*s) || *s == '.';
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
bool CommonRadioPrefs::getByKey(const char* key, char* value, size_t max_len) {
|
bool CommonRadioPrefs::getByKey(const char* key, char* value, size_t max_len) {
|
||||||
if (strcmp(key, "fem_rxgain") == 0) {
|
if (strcmp(key, "fem_rxgain") == 0) {
|
||||||
@@ -69,7 +85,7 @@ bool CommonRadioPrefs::handleCommand(const char* command, uint32_t sender_timest
|
|||||||
if (memcmp(command, "set af ", 7) == 0) {
|
if (memcmp(command, "set af ", 7) == 0) {
|
||||||
char* end;
|
char* end;
|
||||||
float af = strtof(&command[7], &end);
|
float af = strtof(&command[7], &end);
|
||||||
if (end == &command[7] || af < 0 || af > 9) {
|
if (end == &command[7] || !looksLikeANumber(&command[7]) || af < 0 || af > 9) {
|
||||||
strcpy(reply, "ERROR: af must be 0-9");
|
strcpy(reply, "ERROR: af must be 0-9");
|
||||||
} else {
|
} else {
|
||||||
setAirtimeFactor(af);
|
setAirtimeFactor(af);
|
||||||
@@ -87,7 +103,7 @@ bool CommonRadioPrefs::handleCommand(const char* command, uint32_t sender_timest
|
|||||||
}
|
}
|
||||||
if (memcmp(command, "set dutycycle ", 14) == 0) {
|
if (memcmp(command, "set dutycycle ", 14) == 0) {
|
||||||
float dc = atof(&command[14]);
|
float dc = atof(&command[14]);
|
||||||
if (dc < 1 || dc > 100) {
|
if (!looksLikeANumber(&command[14]) || dc < 1 || dc > 100) {
|
||||||
strcpy(reply, "ERROR: dutycycle must be 1-100");
|
strcpy(reply, "ERROR: dutycycle must be 1-100");
|
||||||
} else {
|
} else {
|
||||||
setAirtimeFactor((100.0f / dc) - 1.0f);
|
setAirtimeFactor((100.0f / dc) - 1.0f);
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ public:
|
|||||||
virtual void forceFullRefresh() {} // next refresh will be full for eink
|
virtual void forceFullRefresh() {} // next refresh will be full for eink
|
||||||
virtual void turnOn() = 0;
|
virtual void turnOn() = 0;
|
||||||
virtual void turnOff() = 0;
|
virtual void turnOff() = 0;
|
||||||
|
virtual void blankScreen() {} // to cleanly erase screen before turning off
|
||||||
|
virtual void powerOff() {}
|
||||||
virtual void clear() = 0;
|
virtual void clear() = 0;
|
||||||
virtual void startFrame(ColorVal bkg = UIColor::window_bkg) = 0;
|
virtual void startFrame(ColorVal bkg = UIColor::window_bkg) = 0;
|
||||||
virtual void setTextSize(int sz) = 0;
|
virtual void setTextSize(int sz) = 0;
|
||||||
|
|||||||
@@ -75,20 +75,27 @@ void GxEPDDisplay::turnOn() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxEPDDisplay::turnOff() {
|
void GxEPDDisplay::powerOff() {
|
||||||
|
display.hibernate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GxEPDDisplay::turnOff() { // Only stops refresh
|
||||||
#if defined(DISP_BACKLIGHT) && !defined(BACKLIGHT_BTN)
|
#if defined(DISP_BACKLIGHT) && !defined(BACKLIGHT_BTN)
|
||||||
digitalWrite(DISP_BACKLIGHT, LOW);
|
digitalWrite(DISP_BACKLIGHT, LOW);
|
||||||
#elif defined(EXP_PIN_BACKLIGHT) && !defined(BACKLIGHT_BTN)
|
#elif defined(EXP_PIN_BACKLIGHT) && !defined(BACKLIGHT_BTN)
|
||||||
expander.digitalWrite(EXP_PIN_BACKLIGHT, LOW);
|
expander.digitalWrite(EXP_PIN_BACKLIGHT, LOW);
|
||||||
#endif
|
#endif
|
||||||
_isOn = false;
|
_isOn = false;
|
||||||
|
last_display_crc_value=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GxEPDDisplay::blankScreen() {
|
||||||
// do full refresh before powering off to clear screen
|
// do full refresh before powering off to clear screen
|
||||||
// no full refresh needed at wakeup
|
// no full refresh needed at wakeup
|
||||||
display.clearScreen(0xFF); // Clears microcontroller side RAM
|
display.clearScreen(0xFF); // Clears microcontroller side RAM
|
||||||
display.writeScreenBuffer(0xFF); // Forces 0xFF (White) into the display controller's history registers
|
display.writeScreenBuffer(0xFF); // Forces 0xFF (White) into the display controller's history registers
|
||||||
resetPartialRefreshCounter();
|
resetPartialRefreshCounter();
|
||||||
last_display_crc_value=0;
|
last_display_crc_value=0;
|
||||||
display.hibernate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxEPDDisplay::clear() {
|
void GxEPDDisplay::clear() {
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ public:
|
|||||||
void resetPartialRefreshCounter() { _cycles_before_full_refresh = max_partial_refresh; };
|
void resetPartialRefreshCounter() { _cycles_before_full_refresh = max_partial_refresh; };
|
||||||
void turnOn() override;
|
void turnOn() override;
|
||||||
void turnOff() override;
|
void turnOff() override;
|
||||||
|
void blankScreen() override;
|
||||||
|
void powerOff() override;
|
||||||
void clear() override;
|
void clear() override;
|
||||||
void startFrame(ColorVal bkg = UIColor::window_bkg) override;
|
void startFrame(ColorVal bkg = UIColor::window_bkg) override;
|
||||||
void setTextSize(int sz) override;
|
void setTextSize(int sz) override;
|
||||||
|
|||||||
@@ -32,8 +32,12 @@ build_flags = ${nrf52_base.build_flags}
|
|||||||
-D PIN_GPS_RESET_ACTIVE=LOW
|
-D PIN_GPS_RESET_ACTIVE=LOW
|
||||||
-D TELEM_BME280_ADDRESS=0x77
|
-D TELEM_BME280_ADDRESS=0x77
|
||||||
-D DISPLAY_CLASS=GxEPDDisplay
|
-D DISPLAY_CLASS=GxEPDDisplay
|
||||||
|
-D EINK_SCREENOFF_BLANK
|
||||||
|
-D UI_RECENT_LIST_SIZE=9
|
||||||
|
-D UI_MSG_PREVIEW_SIZE=165
|
||||||
|
-D EINK_MAX_PARTIAL_REFRESH=60
|
||||||
|
-D AUTO_OFF_MILLIS=900000
|
||||||
-D BACKLIGHT_BTN=PIN_BUTTON2
|
-D BACKLIGHT_BTN=PIN_BUTTON2
|
||||||
-D AUTO_OFF_MILLIS=0
|
|
||||||
build_src_filter = ${nrf52_base.build_src_filter}
|
build_src_filter = ${nrf52_base.build_src_filter}
|
||||||
+<helpers/*.cpp>
|
+<helpers/*.cpp>
|
||||||
+<TechoBoard.cpp>
|
+<TechoBoard.cpp>
|
||||||
@@ -91,7 +95,6 @@ build_flags =
|
|||||||
-D BLE_PIN_CODE=123456
|
-D BLE_PIN_CODE=123456
|
||||||
; -D BLE_DEBUG_LOGGING=1
|
; -D BLE_DEBUG_LOGGING=1
|
||||||
-D OFFLINE_QUEUE_SIZE=256
|
-D OFFLINE_QUEUE_SIZE=256
|
||||||
-D UI_RECENT_LIST_SIZE=9
|
|
||||||
-D UI_SENSORS_PAGE=1
|
-D UI_SENSORS_PAGE=1
|
||||||
-D UI_GPS_PAGE=1
|
-D UI_GPS_PAGE=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
@@ -116,7 +119,6 @@ build_flags =
|
|||||||
-D MAX_CONTACTS=350
|
-D MAX_CONTACTS=350
|
||||||
-D MAX_GROUP_CHANNELS=40
|
-D MAX_GROUP_CHANNELS=40
|
||||||
-D OFFLINE_QUEUE_SIZE=256
|
-D OFFLINE_QUEUE_SIZE=256
|
||||||
-D UI_RECENT_LIST_SIZE=9
|
|
||||||
-D UI_SENSORS_PAGE=1
|
-D UI_SENSORS_PAGE=1
|
||||||
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
|
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
|
||||||
-D QSPIFLASH=1
|
-D QSPIFLASH=1
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager();
|
|||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
DISPLAY_CLASS display;
|
DISPLAY_CLASS display;
|
||||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||||
|
MomentaryButton backlight_btn(BACKLIGHT_BTN, 1000, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ extern EnvironmentSensorManager sensors;
|
|||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
extern DISPLAY_CLASS display;
|
extern DISPLAY_CLASS display;
|
||||||
extern MomentaryButton user_btn;
|
extern MomentaryButton user_btn;
|
||||||
|
extern MomentaryButton backlight_btn;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
|
|||||||
@@ -24,6 +24,18 @@ build_flags = ${nrf52_base.build_flags}
|
|||||||
-D SX126X_RX_BOOSTED_GAIN=1
|
-D SX126X_RX_BOOSTED_GAIN=1
|
||||||
-D LORA_TX_POWER=22
|
-D LORA_TX_POWER=22
|
||||||
-D P_LORA_TX_LED=13
|
-D P_LORA_TX_LED=13
|
||||||
|
-D UI_RECENT_LIST_SIZE=9
|
||||||
|
-D UI_MSG_PREVIEW_SIZE=165
|
||||||
|
-D EINK_MAX_PARTIAL_REFRESH=60
|
||||||
|
-D EINK_DISPLAY_MODEL=GxEPD2_154_D67
|
||||||
|
-D EINK_SCALE_X=1.5625f
|
||||||
|
-D EINK_SCALE_Y=1.5625f
|
||||||
|
-D EINK_X_OFFSET=0
|
||||||
|
-D EINK_Y_OFFSET=10
|
||||||
|
-D BACKLIGHT_BTN=PIN_BUTTON2
|
||||||
|
-D AUTO_OFF_MILLIS=900000
|
||||||
|
-D UI_NO_HIBERNATE
|
||||||
|
-D DISABLE_DIAGNOSTIC_OUTPUT
|
||||||
build_src_filter = ${nrf52_base.build_src_filter}
|
build_src_filter = ${nrf52_base.build_src_filter}
|
||||||
+<helpers/*.cpp>
|
+<helpers/*.cpp>
|
||||||
+<ThinkNodeM1Board.cpp>
|
+<ThinkNodeM1Board.cpp>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ ThinkNodeM1SensorManager sensors = ThinkNodeM1SensorManager(nmea);
|
|||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
DISPLAY_CLASS display;
|
DISPLAY_CLASS display;
|
||||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||||
|
MomentaryButton backlight_btn(BACKLIGHT_BTN, 1000, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ extern ThinkNodeM1SensorManager sensors;
|
|||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
extern DISPLAY_CLASS display;
|
extern DISPLAY_CLASS display;
|
||||||
extern MomentaryButton user_btn;
|
extern MomentaryButton user_btn;
|
||||||
|
extern MomentaryButton backlight_btn;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
#define BUTTON_PIN PIN_BUTTON1
|
#define BUTTON_PIN PIN_BUTTON1
|
||||||
#define PIN_USER_BTN BUTTON_PIN
|
#define PIN_USER_BTN BUTTON_PIN
|
||||||
|
|
||||||
#define PIN_BUTTON2 (11)
|
#define PIN_BUTTON2 (39)
|
||||||
#define BUTTON_PIN2 PIN_BUTTON2
|
#define BUTTON_PIN2 PIN_BUTTON2
|
||||||
|
|
||||||
#define EXTERNAL_FLASH_DEVICES MX25R1635F
|
#define EXTERNAL_FLASH_DEVICES MX25R1635F
|
||||||
@@ -131,6 +131,11 @@ extern const int SCK;
|
|||||||
#define DISP_BUSY (3)
|
#define DISP_BUSY (3)
|
||||||
#define DISP_BACKLIGHT (43)
|
#define DISP_BACKLIGHT (43)
|
||||||
|
|
||||||
|
#define PIN_DISPLAY_CS DISP_CS
|
||||||
|
#define PIN_DISPLAY_DC DISP_DC
|
||||||
|
#define PIN_DISPLAY_RST DISP_RST
|
||||||
|
#define PIN_DISPLAY_BUSY DISP_BUSY
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// GPS
|
// GPS
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,12 @@ build_flags = ${esp32_base.build_flags}
|
|||||||
-D EINK_SCALE_Y=1.5625f
|
-D EINK_SCALE_Y=1.5625f
|
||||||
-D EINK_X_OFFSET=0
|
-D EINK_X_OFFSET=0
|
||||||
-D EINK_Y_OFFSET=10
|
-D EINK_Y_OFFSET=10
|
||||||
|
-D UI_RECENT_LIST_SIZE=9
|
||||||
|
-D UI_MSG_PREVIEW_SIZE=165
|
||||||
|
-D EINK_MAX_PARTIAL_REFRESH=60
|
||||||
-D BACKLIGHT_BTN=PIN_BUTTON2
|
-D BACKLIGHT_BTN=PIN_BUTTON2
|
||||||
-D AUTO_OFF_MILLIS=0
|
-D AUTO_OFF_MILLIS=900000
|
||||||
|
-D UI_NO_HIBERNATE
|
||||||
-D DISABLE_DIAGNOSTIC_OUTPUT
|
-D DISABLE_DIAGNOSTIC_OUTPUT
|
||||||
-D SX126X_DIO2_AS_RF_SWITCH=true
|
-D SX126X_DIO2_AS_RF_SWITCH=true
|
||||||
-D SX126X_DIO3_TCXO_VOLTAGE=3.3
|
-D SX126X_DIO3_TCXO_VOLTAGE=3.3
|
||||||
@@ -150,7 +154,6 @@ build_flags =
|
|||||||
-D MAX_GROUP_CHANNELS=40
|
-D MAX_GROUP_CHANNELS=40
|
||||||
-D BLE_PIN_CODE=123456
|
-D BLE_PIN_CODE=123456
|
||||||
-D OFFLINE_QUEUE_SIZE=256
|
-D OFFLINE_QUEUE_SIZE=256
|
||||||
-D UI_RECENT_LIST_SIZE=9
|
|
||||||
; -D BLE_DEBUG_LOGGING=1
|
; -D BLE_DEBUG_LOGGING=1
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D GPS_NMEA_DEBUG
|
; -D GPS_NMEA_DEBUG
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager();
|
|||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
DISPLAY_CLASS display;
|
DISPLAY_CLASS display;
|
||||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||||
|
MomentaryButton backlight_btn(BACKLIGHT_BTN, 1000, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ extern PCA9557 expander;
|
|||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
extern DISPLAY_CLASS display;
|
extern DISPLAY_CLASS display;
|
||||||
extern MomentaryButton user_btn;
|
extern MomentaryButton user_btn;
|
||||||
|
extern MomentaryButton backlight_btn;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
|
|||||||
@@ -18,12 +18,16 @@ build_flags = ${nrf52_base.build_flags}
|
|||||||
-D P_LORA_SCLK=19
|
-D P_LORA_SCLK=19
|
||||||
-D P_LORA_MISO=22
|
-D P_LORA_MISO=22
|
||||||
-D P_LORA_MOSI=20
|
-D P_LORA_MOSI=20
|
||||||
-D UI_SHOW_CLOCK=1
|
-D DISPLAY_ROTATION=4
|
||||||
-D UI_HAS_ROTARY_INPUT=1
|
-D UI_HAS_ROTARY_INPUT=1
|
||||||
-D UI_HAS_NAV_INPUT=1
|
-D UI_HAS_NAV_INPUT=1
|
||||||
-D UI_RECENT_LIST_SIZE=9
|
-D UI_RECENT_LIST_SIZE=9
|
||||||
-D UI_MSG_PREVIEW_SIZE=165
|
-D UI_MSG_PREVIEW_SIZE=165
|
||||||
-D EINK_MAX_PARTIAL_REFRESH=60
|
-D EINK_MAX_PARTIAL_REFRESH=60
|
||||||
|
-D AUTO_OFF_MILLIS=900000
|
||||||
|
-D BACKLIGHT_BTN=PIN_BUTTON2
|
||||||
|
-D UI_SHOW_CLOCK=1
|
||||||
|
-D EINK_SCREENOFF_BLANK
|
||||||
-D EINK_DISPLAY_MODEL=GxEPD2_154_D67
|
-D EINK_DISPLAY_MODEL=GxEPD2_154_D67
|
||||||
; -D EINK_DISPLAY_MODEL=GxEPD2_154_GDEY0154D67
|
; -D EINK_DISPLAY_MODEL=GxEPD2_154_GDEY0154D67
|
||||||
; -D EINK_DISPLAY_MODEL=GxEPD2_150_BN
|
; -D EINK_DISPLAY_MODEL=GxEPD2_150_BN
|
||||||
@@ -92,10 +96,7 @@ build_flags =
|
|||||||
-D MAX_GROUP_CHANNELS=40
|
-D MAX_GROUP_CHANNELS=40
|
||||||
-D BLE_PIN_CODE=123456
|
-D BLE_PIN_CODE=123456
|
||||||
# -D BLE_DEBUG_LOGGING=1
|
# -D BLE_DEBUG_LOGGING=1
|
||||||
-D DISPLAY_ROTATION=4
|
|
||||||
-D DISPLAY_CLASS=GxEPDDisplay
|
-D DISPLAY_CLASS=GxEPDDisplay
|
||||||
-D BACKLIGHT_BTN=PIN_BUTTON2
|
|
||||||
-D AUTO_OFF_MILLIS=0
|
|
||||||
-D OFFLINE_QUEUE_SIZE=256
|
-D OFFLINE_QUEUE_SIZE=256
|
||||||
-D PIN_BUZZER=33
|
-D PIN_BUZZER=33
|
||||||
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
|
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
|
||||||
@@ -133,8 +134,6 @@ build_flags =
|
|||||||
-D DISPLAY_ROTATION=4
|
-D DISPLAY_ROTATION=4
|
||||||
-D QSPIFLASH=1
|
-D QSPIFLASH=1
|
||||||
-D DISPLAY_CLASS=GxEPDDisplay
|
-D DISPLAY_CLASS=GxEPDDisplay
|
||||||
-D BACKLIGHT_BTN=PIN_BUTTON2
|
|
||||||
-D AUTO_OFF_MILLIS=0
|
|
||||||
-D OFFLINE_QUEUE_SIZE=256
|
-D OFFLINE_QUEUE_SIZE=256
|
||||||
-D PIN_BUZZER=6
|
-D PIN_BUZZER=6
|
||||||
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
|
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ EnvironmentSensorManager sensors = EnvironmentSensorManager();
|
|||||||
DISPLAY_CLASS display;
|
DISPLAY_CLASS display;
|
||||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||||
RotaryInputGPIO rotary_input(PIN_BUTTON1_A, PIN_BUTTON1_B);
|
RotaryInputGPIO rotary_input(PIN_BUTTON1_A, PIN_BUTTON1_B);
|
||||||
|
MomentaryButton backlight_btn(BACKLIGHT_BTN, 1000, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ extern EnvironmentSensorManager sensors;
|
|||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
extern DISPLAY_CLASS display;
|
extern DISPLAY_CLASS display;
|
||||||
extern MomentaryButton user_btn;
|
extern MomentaryButton user_btn;
|
||||||
|
extern MomentaryButton backlight_btn;
|
||||||
extern RotaryInputGPIO rotary_input;
|
extern RotaryInputGPIO rotary_input;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user