Merge branch 'develop' into clear-rangetest-results

This commit is contained in:
Ford Jones
2025-09-24 23:59:46 +12:00
committed by GitHub
co-authored by GitHub
28 changed files with 295 additions and 91 deletions
+5 -5
View File
@@ -9,24 +9,24 @@ plugins:
lint: lint:
enabled: enabled:
- checkov@3.2.471 - checkov@3.2.471
- renovate@41.115.6 - renovate@41.125.3
- prettier@3.6.2 - prettier@3.6.2
- trufflehog@3.90.6 - trufflehog@3.90.8
- yamllint@1.37.1 - yamllint@1.37.1
- bandit@1.8.6 - bandit@1.8.6
- trivy@0.66.0 - trivy@0.66.0
- taplo@0.10.0 - taplo@0.10.0
- ruff@0.13.0 - ruff@0.13.1
- isort@6.0.1 - isort@6.0.1
- markdownlint@0.45.0 - markdownlint@0.45.0
- oxipng@9.1.5 - oxipng@9.1.5
- svgo@4.0.0 - svgo@4.0.0
- actionlint@1.7.7 - actionlint@1.7.7
- flake8@7.3.0 - flake8@7.3.0
- hadolint@2.13.1 - hadolint@2.14.0
- shfmt@3.6.0 - shfmt@3.6.0
- shellcheck@0.11.0 - shellcheck@0.11.0
- black@25.1.0 - black@25.9.0
- git-diff-check - git-diff-check
- gitleaks@8.28.0 - gitleaks@8.28.0
- clang-format@16.0.3 - clang-format@16.0.3
+1 -1
View File
@@ -2,7 +2,7 @@
[portduino_base] [portduino_base]
platform = platform =
# renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop
https://github.com/meshtastic/platform-native/archive/c490bcd019e0658404088a61b96e653c9da22c45.zip https://github.com/meshtastic/platform-native/archive/d3f6e339534233c7217818867368767590ce549e.zip
framework = arduino framework = arduino
build_src_filter = build_src_filter =
@@ -87,6 +87,9 @@
</screenshots> </screenshots>
<releases> <releases>
<release version="2.7.11" date="2025-09-24">
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.11</url>
</release>
<release version="2.7.10" date="2025-09-18"> <release version="2.7.10" date="2025-09-18">
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.10</url> <url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.10</url>
</release> </release>
+3 -42
View File
@@ -1,49 +1,10 @@
meshtasticd (2.7.10.0) UNRELEASED; urgency=medium meshtasticd (2.7.11.0) UNRELEASED; urgency=medium
[ Austin Lane ]
* Initial packaging * Initial packaging
* Version 2.5.19 * Version 2.5.19
[ ] [ ]
* GitHub Actions Automatic version bump * GitHub Actions Automatic version bump
[ ] -- <github-actions[bot]@users.noreply.github.com> Wed, 24 Sep 2025 11:01:13 +0000
* GitHub Actions Automatic version bump
[ ]
* GitHub Actions Automatic version bump
[ ]
* GitHub Actions Automatic version bump
[ ]
* GitHub Actions Automatic version bump
[ ]
* GitHub Actions Automatic version bump
[ ]
* GitHub Actions Automatic version bump
[ Ubuntu ]
* GitHub Actions Automatic version bump
[ ]
* GitHub Actions Automatic version bump
[ ]
* GitHub Actions Automatic version bump
[ ]
* GitHub Actions Automatic version bump
* GitHub Actions Automatic version bump
[ ]
* GitHub Actions Automatic version bump
[ ]
* GitHub Actions Automatic version bump
[ ]
* GitHub Actions Automatic version bump
-- <github-actions[bot]@users.noreply.github.com> Thu, 18 Sep 2025 22:11:37 +0000
+1 -1
View File
@@ -125,7 +125,7 @@ lib_deps =
[environmental_base] [environmental_base]
lib_deps = lib_deps =
# renovate: datasource=custom.pio depName=Adafruit BusIO packageName=adafruit/library/Adafruit BusIO # renovate: datasource=custom.pio depName=Adafruit BusIO packageName=adafruit/library/Adafruit BusIO
adafruit/Adafruit BusIO@1.17.3 adafruit/Adafruit BusIO@1.17.4
# renovate: datasource=custom.pio depName=Adafruit Unified Sensor packageName=adafruit/library/Adafruit Unified Sensor # renovate: datasource=custom.pio depName=Adafruit Unified Sensor packageName=adafruit/library/Adafruit Unified Sensor
adafruit/Adafruit Unified Sensor@1.1.15 adafruit/Adafruit Unified Sensor@1.1.15
# renovate: datasource=custom.pio depName=Adafruit BMP280 packageName=adafruit/library/Adafruit BMP280 Library # renovate: datasource=custom.pio depName=Adafruit BMP280 packageName=adafruit/library/Adafruit BMP280 Library
+1 -1
View File
@@ -243,7 +243,7 @@ bool EInkDisplay::connect()
adafruitDisplay->setRotation(1); adafruitDisplay->setRotation(1);
adafruitDisplay->setPartialWindow(0, 0, EINK_WIDTH, EINK_HEIGHT); adafruitDisplay->setPartialWindow(0, 0, EINK_WIDTH, EINK_HEIGHT);
} }
#elif defined(HELTEC_MESH_POCKET) || defined(SEEED_WIO_TRACKER_L1_EINK) #elif defined(HELTEC_MESH_POCKET) || defined(SEEED_WIO_TRACKER_L1_EINK) || defined(HELTEC_MESH_SOLAR_EINK)
{ {
spi1 = &SPI1; spi1 = &SPI1;
spi1->begin(); spi1->begin();
+1 -1
View File
@@ -84,7 +84,7 @@ class EInkDisplay : public OLEDDisplay
SPIClass *hspi = NULL; SPIClass *hspi = NULL;
#endif #endif
#if defined(HELTEC_MESH_POCKET) || defined(SEEED_WIO_TRACKER_L1_EINK) #if defined(HELTEC_MESH_POCKET) || defined(SEEED_WIO_TRACKER_L1_EINK) || defined(HELTEC_MESH_SOLAR_EINK)
SPIClass *spi1 = NULL; SPIClass *spi1 = NULL;
#endif #endif
+18
View File
@@ -83,6 +83,11 @@ extern uint16_t TFT_MESH;
#include "platform/portduino/PortduinoGlue.h" #include "platform/portduino/PortduinoGlue.h"
#endif #endif
#if defined(T_LORA_PAGER)
// KB backlight control
#include "input/cardKbI2cImpl.h"
#endif
using namespace meshtastic; /** @todo remove */ using namespace meshtastic; /** @todo remove */
namespace graphics namespace graphics
@@ -655,6 +660,19 @@ void Screen::setup()
MeshModule::observeUIEvents(&uiFrameEventObserver); MeshModule::observeUIEvents(&uiFrameEventObserver);
} }
void Screen::setOn(bool on, FrameCallback einkScreensaver)
{
#if defined(T_LORA_PAGER)
if (cardKbI2cImpl)
cardKbI2cImpl->toggleBacklight(on);
#endif
if (!on)
// We handle off commands immediately, because they might be called because the CPU is shutting down
handleSetOn(false, einkScreensaver);
else
enqueueCmd(ScreenCmd{.cmd = Cmd::SET_ON});
}
void Screen::forceDisplay(bool forceUiUpdate) void Screen::forceDisplay(bool forceUiUpdate)
{ {
// Nasty hack to force epaper updates for 'key' frames. FIXME, cleanup. // Nasty hack to force epaper updates for 'key' frames. FIXME, cleanup.
+1 -9
View File
@@ -259,15 +259,7 @@ class Screen : public concurrency::OSThread
void setup(); void setup();
/// Turns the screen on/off. Optionally, pass a custom screensaver frame for E-Ink /// Turns the screen on/off. Optionally, pass a custom screensaver frame for E-Ink
void setOn(bool on, FrameCallback einkScreensaver = NULL) void setOn(bool on, FrameCallback einkScreensaver = NULL);
{
if (!on)
// We handle off commands immediately, because they might be called because the CPU is shutting down
handleSetOn(false, einkScreensaver);
else
enqueueCmd(ScreenCmd{.cmd = Cmd::SET_ON});
}
/** /**
* Prepare the display for the unit going to the lowest power mode possible. Most screens will just * Prepare the display for the unit going to the lowest power mode possible. Most screens will just
* poweroff, but eink screens will show a "I'm sleeping" graphic, possibly with a QR code * poweroff, but eink screens will show a "I'm sleeping" graphic, possibly with a QR code
+5
View File
@@ -200,6 +200,11 @@ uint8_t TCA8418KeyboardBase::flush()
return count; return count;
} }
void TCA8418KeyboardBase::clearInt()
{
writeRegister(TCA8418_REG_INT_STAT, 3);
}
uint8_t TCA8418KeyboardBase::digitalRead(uint8_t pinnum) const uint8_t TCA8418KeyboardBase::digitalRead(uint8_t pinnum) const
{ {
if (pinnum > TCA8418_COL9) if (pinnum > TCA8418_COL9)
+2
View File
@@ -37,6 +37,8 @@ class TCA8418KeyboardBase
virtual void begin(i2c_com_fptr_t r, i2c_com_fptr_t w, uint8_t addr = TCA8418_KB_ADDR); virtual void begin(i2c_com_fptr_t r, i2c_com_fptr_t w, uint8_t addr = TCA8418_KB_ADDR);
virtual void reset(void); virtual void reset(void);
void clearInt(void);
virtual void trigger(void); virtual void trigger(void);
virtual void setBacklight(bool on); virtual void setBacklight(bool on);
+9 -7
View File
@@ -105,7 +105,14 @@ void TLoraPagerKeyboard::trigger()
void TLoraPagerKeyboard::setBacklight(bool on) void TLoraPagerKeyboard::setBacklight(bool on)
{ {
toggleBacklight(!on); uint32_t _brightness = 0;
if (on)
_brightness = brightness;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
ledcWrite(KB_BL_PIN, _brightness);
#else
ledcWrite(LEDC_BACKLIGHT_CHANNEL, _brightness);
#endif
} }
void TLoraPagerKeyboard::pressed(uint8_t key) void TLoraPagerKeyboard::pressed(uint8_t key)
@@ -192,7 +199,6 @@ void TLoraPagerKeyboard::hapticFeedback()
// toggle brightness of the backlight in three steps // toggle brightness of the backlight in three steps
void TLoraPagerKeyboard::toggleBacklight(bool off) void TLoraPagerKeyboard::toggleBacklight(bool off)
{ {
static uint32_t brightness = 0;
if (off) { if (off) {
brightness = 0; brightness = 0;
} else { } else {
@@ -206,11 +212,7 @@ void TLoraPagerKeyboard::toggleBacklight(bool off)
} }
LOG_DEBUG("Toggle backlight: %d", brightness); LOG_DEBUG("Toggle backlight: %d", brightness);
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) setBacklight(true);
ledcWrite(KB_BL_PIN, brightness);
#else
ledcWrite(LEDC_BACKLIGHT_CHANNEL, brightness);
#endif
} }
void TLoraPagerKeyboard::updateModifierFlag(uint8_t key) void TLoraPagerKeyboard::updateModifierFlag(uint8_t key)
+1
View File
@@ -26,4 +26,5 @@ class TLoraPagerKeyboard : public TCA8418KeyboardBase
uint32_t last_tap; uint32_t last_tap;
uint8_t char_idx; uint8_t char_idx;
int32_t tap_interval; int32_t tap_interval;
uint32_t brightness = 0;
}; };
+8
View File
@@ -333,6 +333,7 @@ int32_t KbI2cBase::runOnce()
} }
TCAKeyboard.trigger(); TCAKeyboard.trigger();
} }
TCAKeyboard.clearInt();
break; break;
} }
case 0x02: { case 0x02: {
@@ -520,3 +521,10 @@ int32_t KbI2cBase::runOnce()
} }
return 300; return 300;
} }
void KbI2cBase::toggleBacklight(bool on)
{
#if defined(T_LORA_PAGER)
TCAKeyboard.setBacklight(on);
#endif
}
+1
View File
@@ -12,6 +12,7 @@ class KbI2cBase : public Observable<const InputEvent *>, public concurrency::OST
{ {
public: public:
explicit KbI2cBase(const char *name); explicit KbI2cBase(const char *name);
void toggleBacklight(bool on);
protected: protected:
virtual int32_t runOnce() override; virtual int32_t runOnce() override;
+1
View File
@@ -369,6 +369,7 @@ void setup()
digitalWrite(SDCARD_CS, HIGH); digitalWrite(SDCARD_CS, HIGH);
pinMode(TFT_CS, OUTPUT); pinMode(TFT_CS, OUTPUT);
digitalWrite(TFT_CS, HIGH); digitalWrite(TFT_CS, HIGH);
pinMode(KB_INT, INPUT_PULLUP);
// io expander // io expander
io.begin(Wire, XL9555_SLAVE_ADDRESS0, SDA, SCL); io.begin(Wire, XL9555_SLAVE_ADDRESS0, SDA, SCL);
io.pinMode(EXPANDS_DRV_EN, OUTPUT); io.pinMode(EXPANDS_DRV_EN, OUTPUT);
+1 -1
View File
@@ -204,7 +204,7 @@ NodeDB::NodeDB()
int saveWhat = 0; int saveWhat = 0;
// Get device unique id // Get device unique id
#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3) #if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C6)
uint32_t unique_id[4]; uint32_t unique_id[4];
// ESP32 factory burns a unique id in efuse for S2+ series and evidently C3+ series // ESP32 factory burns a unique id in efuse for S2+ series and evidently C3+ series
// This is used for HMACs in the esp-rainmaker AIOT platform and seems to be a good choice for us // This is used for HMACs in the esp-rainmaker AIOT platform and seems to be a good choice for us
+3
View File
@@ -250,6 +250,7 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
if (config_nonce == SPECIAL_NONCE_ONLY_NODES) { if (config_nonce == SPECIAL_NONCE_ONLY_NODES) {
// If client only wants node info, jump directly to sending nodes // If client only wants node info, jump directly to sending nodes
state = STATE_SEND_OTHER_NODEINFOS; state = STATE_SEND_OTHER_NODEINFOS;
onNowHasData(0);
} else { } else {
state = STATE_SEND_METADATA; state = STATE_SEND_METADATA;
} }
@@ -423,6 +424,7 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
state = STATE_SEND_FILEMANIFEST; state = STATE_SEND_FILEMANIFEST;
} else { } else {
state = STATE_SEND_OTHER_NODEINFOS; state = STATE_SEND_OTHER_NODEINFOS;
onNowHasData(0);
} }
config_state = 0; config_state = 0;
} }
@@ -588,6 +590,7 @@ bool PhoneAPI::available()
nodeInfoForPhone.snr = isUs ? 0 : nodeInfoForPhone.snr; nodeInfoForPhone.snr = isUs ? 0 : nodeInfoForPhone.snr;
nodeInfoForPhone.via_mqtt = isUs ? false : nodeInfoForPhone.via_mqtt; nodeInfoForPhone.via_mqtt = isUs ? false : nodeInfoForPhone.via_mqtt;
nodeInfoForPhone.is_favorite = nodeInfoForPhone.is_favorite || isUs; // Our node is always a favorite nodeInfoForPhone.is_favorite = nodeInfoForPhone.is_favorite || isUs; // Our node is always a favorite
onNowHasData(0);
} }
} }
return true; // Always say we have something, because we might need to advance our state machine return true; // Always say we have something, because we might need to advance our state machine
+1 -3
View File
@@ -293,9 +293,7 @@ void setupModules()
#endif #endif
#endif #endif
#if !MESHTASTIC_EXCLUDE_EXTERNALNOTIFICATION #if !MESHTASTIC_EXCLUDE_EXTERNALNOTIFICATION
if (moduleConfig.has_external_notification && moduleConfig.external_notification.enabled) { externalNotificationModule = new ExternalNotificationModule();
externalNotificationModule = new ExternalNotificationModule();
}
#endif #endif
#if !MESHTASTIC_EXCLUDE_RANGETEST && !MESHTASTIC_EXCLUDE_GPS #if !MESHTASTIC_EXCLUDE_RANGETEST && !MESHTASTIC_EXCLUDE_GPS
if (moduleConfig.has_range_test && moduleConfig.range_test.enabled) if (moduleConfig.has_range_test && moduleConfig.range_test.enabled)
+5 -2
View File
@@ -174,11 +174,11 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
display->setTextAlignment(TEXT_ALIGN_CENTER); display->setTextAlignment(TEXT_ALIGN_CENTER);
display->setFont(FONT_MEDIUM); display->setFont(FONT_MEDIUM);
display->drawString(x_offset + x, y_offset + y, "Bluetooth"); display->drawString(x_offset + x, y_offset + y, "Bluetooth");
#if !defined(M5STACK_UNITC6L)
display->setFont(FONT_SMALL); display->setFont(FONT_SMALL);
y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_MEDIUM - 4 : y_offset + FONT_HEIGHT_MEDIUM + 5; y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_MEDIUM - 4 : y_offset + FONT_HEIGHT_MEDIUM + 5;
display->drawString(x_offset + x, y_offset + y, "Enter this code"); display->drawString(x_offset + x, y_offset + y, "Enter this code");
#endif
display->setFont(FONT_LARGE); display->setFont(FONT_LARGE);
char pin[8]; char pin[8];
snprintf(pin, sizeof(pin), "%.3s %.3s", btPIN, btPIN + 3); snprintf(pin, sizeof(pin), "%.3s %.3s", btPIN, btPIN + 3);
@@ -247,6 +247,9 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
bluetoothPhoneAPI->numBytes = 0; bluetoothPhoneAPI->numBytes = 0;
bluetoothPhoneAPI->queue_size = 0; bluetoothPhoneAPI->queue_size = 0;
} }
// Clear the last ToRadio packet buffer to avoid rejecting first packet from new connection
memset(lastToRadio, 0, sizeof(lastToRadio));
#ifdef NIMBLE_TWO #ifdef NIMBLE_TWO
// Restart Advertising // Restart Advertising
ble->startAdvertising(); ble->startAdvertising();
+6 -2
View File
@@ -28,6 +28,9 @@ static BLEDfuSecure bledfusecure; //
static uint8_t fromRadioBytes[meshtastic_FromRadio_size]; static uint8_t fromRadioBytes[meshtastic_FromRadio_size];
static uint8_t toRadioBytes[meshtastic_ToRadio_size]; static uint8_t toRadioBytes[meshtastic_ToRadio_size];
// Last ToRadio value received from the phone
static uint8_t lastToRadio[MAX_TO_FROM_RADIO_SIZE];
static uint16_t connectionHandle; static uint16_t connectionHandle;
class BluetoothPhoneAPI : public PhoneAPI class BluetoothPhoneAPI : public PhoneAPI
@@ -74,6 +77,9 @@ void onDisconnect(uint16_t conn_handle, uint8_t reason)
bluetoothPhoneAPI->close(); bluetoothPhoneAPI->close();
} }
// Clear the last ToRadio packet buffer to avoid rejecting first packet from new connection
memset(lastToRadio, 0, sizeof(lastToRadio));
// Notify UI (or any other interested firmware components) // Notify UI (or any other interested firmware components)
meshtastic::BluetoothStatus newStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED); meshtastic::BluetoothStatus newStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED);
bluetoothStatus->updateStatus(&newStatus); bluetoothStatus->updateStatus(&newStatus);
@@ -145,8 +151,6 @@ void onFromRadioAuthorize(uint16_t conn_hdl, BLECharacteristic *chr, ble_gatts_e
} }
authorizeRead(conn_hdl); authorizeRead(conn_hdl);
} }
// Last ToRadio value received from the phone
static uint8_t lastToRadio[MAX_TO_FROM_RADIO_SIZE];
void onToRadioWrite(uint16_t conn_hdl, BLECharacteristic *chr, uint8_t *data, uint16_t len) void onToRadioWrite(uint16_t conn_hdl, BLECharacteristic *chr, uint8_t *data, uint16_t len)
{ {
+13 -4
View File
@@ -411,12 +411,16 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
// assert(uart_set_wakeup_threshold(UART_NUM_0, 3) == ESP_OK); // assert(uart_set_wakeup_threshold(UART_NUM_0, 3) == ESP_OK);
// assert(esp_sleep_enable_uart_wakeup(0) == ESP_OK); // assert(esp_sleep_enable_uart_wakeup(0) == ESP_OK);
#endif #endif
#ifdef BUTTON_PIN #ifdef ROTARY_PRESS
// The enableLoraInterrupt() method is using ext0_wakeup, so we are forced to use GPIO wakeup // The enableLoraInterrupt() method is using ext0_wakeup, so we are forced to use GPIO wakeup
gpio_wakeup_enable((gpio_num_t)ROTARY_PRESS, GPIO_INTR_LOW_LEVEL);
#endif
#ifdef KB_INT
gpio_wakeup_enable((gpio_num_t)KB_INT, GPIO_INTR_LOW_LEVEL);
#endif
#ifdef BUTTON_PIN
gpio_num_t pin = (gpio_num_t)(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN); gpio_num_t pin = (gpio_num_t)(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN);
gpio_wakeup_enable(pin, GPIO_INTR_LOW_LEVEL); gpio_wakeup_enable(pin, GPIO_INTR_LOW_LEVEL);
esp_sleep_enable_gpio_wakeup();
#endif #endif
#ifdef INPUTDRIVER_ENCODER_BTN #ifdef INPUTDRIVER_ENCODER_BTN
gpio_wakeup_enable((gpio_num_t)INPUTDRIVER_ENCODER_BTN, GPIO_INTR_LOW_LEVEL); gpio_wakeup_enable((gpio_num_t)INPUTDRIVER_ENCODER_BTN, GPIO_INTR_LOW_LEVEL);
@@ -450,7 +454,12 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
// commented out because it's not that crucial; // commented out because it's not that crucial;
// if it sporadically happens the node will go into light sleep during the next round // if it sporadically happens the node will go into light sleep during the next round
// assert(res == ESP_OK); // assert(res == ESP_OK);
#ifdef ROTARY_PRESS
gpio_wakeup_disable((gpio_num_t)ROTARY_PRESS);
#endif
#ifdef KB_INT
gpio_wakeup_disable((gpio_num_t)KB_INT);
#endif
#ifdef BUTTON_PIN #ifdef BUTTON_PIN
// Disable wake-on-button interrupt. Re-attach normal button-interrupts // Disable wake-on-button interrupt. Re-attach normal button-interrupts
gpio_wakeup_disable(pin); gpio_wakeup_disable(pin);
@@ -2,6 +2,7 @@
extends = esp32s3_base extends = esp32s3_base
board = heltec_v4 board = heltec_v4
board_check = true board_check = true
board_build.partitions = default_16MB.csv
build_flags = build_flags =
${esp32s3_base.build_flags} ${esp32s3_base.build_flags}
-D HELTEC_V4 -D HELTEC_V4
@@ -0,0 +1,90 @@
#pragma once
#include "configuration.h"
#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS
// InkHUD-specific components
// ---------------------------
#include "graphics/niche/InkHUD/InkHUD.h"
// Applets
#include "graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.h"
#include "graphics/niche/InkHUD/Applets/User/DM/DMApplet.h"
#include "graphics/niche/InkHUD/Applets/User/Heard/HeardApplet.h"
#include "graphics/niche/InkHUD/Applets/User/Positions/PositionsApplet.h"
#include "graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.h"
#include "graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h"
// Shared NicheGraphics components
// --------------------------------
#include "graphics/niche/Drivers/EInk/E0213A367.h"
#include "graphics/niche/Inputs/TwoButton.h"
void setupNicheGraphics()
{
using namespace NicheGraphics;
// SPI
// -----------------------------
// For NRF52 platforms, SPI pins are defined in variant.h
SPI1.begin();
// E-Ink Driver
// -----------------------------
Drivers::EInk *driver = new Drivers::E0213A367;
driver->begin(&SPI1, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES);
// InkHUD
// ----------------------------
InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance();
// Set the E-Ink driver
inkhud->setDriver(driver);
// Set how many FAST updates per FULL update
// Set how unhealthy additional FAST updates beyond this number are
inkhud->setDisplayResilience(10, 1.5);
// Select fonts
InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252;
InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252;
InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252;
// Customize default settings
inkhud->persistence->settings.userTiles.maxCount = 2; // How many tiles can the display handle?
inkhud->persistence->settings.rotation = 3; // 270 degrees clockwise
inkhud->persistence->settings.userTiles.count = 1; // One tile only by default, keep things simple for new users
inkhud->persistence->settings.optionalMenuItems.nextTile = true;
// Pick applets
// Note: order of applets determines priority of "auto-show" feature
inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet, true, true); // Activated, autoshown
inkhud->addApplet("DMs", new InkHUD::DMApplet); // -
inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // -
inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // -
inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true); // Activated
inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // -
inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, no autoshow, default on tile 0
// Start running InkHUD
inkhud->begin();
// Buttons
// --------------------------
Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component
// #0: Main User Button
buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin());
buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); });
buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); });
// Begin handling button events
buttons->start();
}
#endif
@@ -1,5 +1,5 @@
; First prototype nrf52840/sx1262 device ; First prototype nrf52840/sx1262 device
[env:heltec-mesh-solar] [heltec_mesh_solar_base]
extends = nrf52840_base extends = nrf52840_base
board = heltec_mesh_solar board = heltec_mesh_solar
board_level = pr board_level = pr
@@ -17,3 +17,100 @@ lib_deps =
https://github.com/NMIoT/meshsolar/archive/dfc5330dad443982e6cdd37a61d33fc7252f468b.zip https://github.com/NMIoT/meshsolar/archive/dfc5330dad443982e6cdd37a61d33fc7252f468b.zip
lewisxhe/PCF8563_Library@^1.0.1 lewisxhe/PCF8563_Library@^1.0.1
ArduinoJson@6.21.4 ArduinoJson@6.21.4
[env:heltec-mesh-solar]
extends = heltec_mesh_solar_base
build_flags = ${heltec_mesh_solar_base.build_flags}
-DSPI_INTERFACES_COUNT=1
[env:heltec-mesh-solar-eink]
extends = heltec_mesh_solar_base
build_flags = ${heltec_mesh_solar_base.build_flags}
-DHELTEC_MESH_SOLAR_EINK
-DSPI_INTERFACES_COUNT=2
-DUSE_EINK
-DPIN_SCREEN_VDD_CTL=3
-DPIN_EINK_CS=41
-DPIN_EINK_BUSY=11
-DPIN_EINK_DC=13
-DPIN_EINK_RES=40
-DPIN_EINK_SCLK=12
-DPIN_EINK_MOSI=2
-DPIN_SPI1_MISO=-1
-DPIN_SPI1_MOSI=PIN_EINK_MOSI
-DPIN_SPI1_SCK=PIN_EINK_SCLK
-DEINK_DISPLAY_MODEL=GxEPD2_213_E0213A367
-DEINK_WIDTH=250
-DEINK_HEIGHT=122
-DUSE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk
-DEINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted
-DEINK_LIMIT_RATE_BACKGROUND_SEC=30 ; Minimum interval between BACKGROUND updates
-DEINK_LIMIT_RATE_RESPONSIVE_SEC=1 ; Minimum interval between RESPONSIVE updates
-DEINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached.
-DEINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting"
lib_deps =
${heltec_mesh_solar_base.lib_deps}
https://github.com/meshtastic/GxEPD2/archive/a05c11c02862624266b61599b0d6ba93e33c6f24.zip
[env:heltec-mesh-solar-inkhud]
extends = heltec_mesh_solar_base, inkhud
build_src_filter = ${heltec_mesh_solar_base.build_src_filter} ${inkhud.build_src_filter}
build_flags = ${heltec_mesh_solar_base.build_flags}
${inkhud.build_flags}
-DHELTEC_MESH_SOLAR_INKHUD
-DSPI_INTERFACES_COUNT=2
-DPIN_SCREEN_VDD_CTL=3
-DPIN_EINK_CS=41
-DPIN_EINK_BUSY=11
-DPIN_EINK_DC=13
-DPIN_EINK_RES=40
-DPIN_EINK_SCLK=12
-DPIN_EINK_MOSI=2
-DPIN_SPI1_MISO=-1
-DPIN_SPI1_MOSI=PIN_EINK_MOSI
-DPIN_SPI1_SCK=PIN_EINK_SCLK
lib_deps =
${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX
${heltec_mesh_solar_base.lib_deps}
[env:heltec-mesh-solar-oled]
extends = heltec_mesh_solar_base
build_flags = ${heltec_mesh_solar_base.build_flags}
-DHELTEC_MESH_SOLAR_OLED
-DSPI_INTERFACES_COUNT=1
-DPIN_SCREEN_VDD_CTL=3
-DHAS_SCREEN=1
-DRESET_OLED=40
-DPIN_WIRE_SDA=2
-DPIN_WIRE_SCL=12
[env:heltec-mesh-solar-tft]
extends = heltec_mesh_solar_base
build_flags = ${heltec_mesh_solar_base.build_flags}
-DHELTEC_MESH_SOLAR_TFT
-DSPI_INTERFACES_COUNT=2
-DUSE_ST7789
-DST7789_NSS=41
-DST7789_RS=13
-DST7789_SDA=2
-DST7789_SCK=12
-DST7789_RESET=40
-DST7789_MISO=-1
-DST7789_BUSY=-1
-DVTFT_CTRL=3
-DVTFT_LEDA=11
-DTFT_BACKLIGHT_ON=HIGH
-DST7789_SPI_HOST=SPI2_HOST
-DSPI_FREQUENCY=10000000
-DSPI_READ_FREQUENCY=10000000
-DTFT_HEIGHT=170
-DTFT_WIDTH=320
-DTFT_OFFSET_X=0
-DTFT_OFFSET_Y=0
-DBRIGHTNESS_DEFAULT=100
-DPIN_SPI1_MISO=ST7789_MISO
-DPIN_SPI1_MOSI=ST7789_SDA
-DPIN_SPI1_SCK=ST7789_SCK
lib_deps =
${heltec_mesh_solar_base.lib_deps}
https://github.com/meshtastic/st7789/archive/bd33ea58ddfe4a5e4a66d53300ccbd38d66ac21f.zip
@@ -33,4 +33,8 @@ const uint32_t g_ADigitalPinMap[] = {
void initVariant() void initVariant()
{ {
pinMode(BQ4050_EMERGENCY_SHUTDOWN_PIN, INPUT); pinMode(BQ4050_EMERGENCY_SHUTDOWN_PIN, INPUT);
#if defined(PIN_SCREEN_VDD_CTL)
pinMode(PIN_SCREEN_VDD_CTL, OUTPUT);
digitalWrite(PIN_SCREEN_VDD_CTL, LOW); // Start with power on
#endif
} }
+10 -9
View File
@@ -39,7 +39,7 @@ extern "C" {
#define NUM_ANALOG_INPUTS (1) #define NUM_ANALOG_INPUTS (1)
#define NUM_ANALOG_OUTPUTS (0) #define NUM_ANALOG_OUTPUTS (0)
#define PIN_LED1 (0 + 12) // green (confirmed on 1.0 board) #define PIN_LED1 (0 + 4) // green (confirmed on 1.0 board)
#define LED_BLUE PIN_LED1 // fake for bluefruit library #define LED_BLUE PIN_LED1 // fake for bluefruit library
#define LED_GREEN PIN_LED1 #define LED_GREEN PIN_LED1
#define LED_BUILTIN LED_GREEN #define LED_BUILTIN LED_GREEN
@@ -62,7 +62,6 @@ No longer populated on PCB
*/ */
#define PIN_SERIAL2_RX (0 + 9) #define PIN_SERIAL2_RX (0 + 9)
#define PIN_SERIAL2_TX (0 + 10) #define PIN_SERIAL2_TX (0 + 10)
// #define PIN_SERIAL2_EN (0 + 17)
/* /*
* I2C * I2C
@@ -70,16 +69,19 @@ No longer populated on PCB
#define WIRE_INTERFACES_COUNT 2 #define WIRE_INTERFACES_COUNT 2
#ifndef HELTEC_MESH_SOLAR_OLED
#ifndef HELTEC_MESH_SOLAR_OLED
// I2C bus 0 // I2C bus 0
// Routed to footprint for PCF8563TS RTC #define PIN_WIRE_SDA (0 + 6)
// Not populated on T114 V1, maybe in future? #define PIN_WIRE_SCL (0 + 26)
#define PIN_WIRE_SDA (0 + 6) // P0.26 #endif
#define PIN_WIRE_SCL (0 + 26) // P0.26
// I2C bus 1 // I2C bus 1
// Available on header pins, for general use // Available on header pins, for general use
#define PIN_WIRE1_SDA (0 + 30) // P0.30 #define PIN_WIRE1_SDA (0 + 30)
#define PIN_WIRE1_SCL (0 + 5) // P0.13 #define PIN_WIRE1_SCL (0 + 5)
#define PIN_WIRE1_SDA (0 + 30)
#define PIN_WIRE1_SCL (0 + 5)
/* /*
* Lora radio * Lora radio
@@ -128,7 +130,6 @@ No longer populated on PCB
/* /*
* SPI Interfaces * SPI Interfaces
*/ */
#define SPI_INTERFACES_COUNT 1
// For LORA, spi 0 // For LORA, spi 0
#define PIN_SPI_MISO (0 + 23) #define PIN_SPI_MISO (0 + 23)
+1 -1
View File
@@ -1,4 +1,4 @@
[VERSION] [VERSION]
major = 2 major = 2
minor = 7 minor = 7
build = 10 build = 11