From 72db671e007bcccc0cb67c6a44889aed0ad94e59 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 31 Mar 2025 02:54:27 -0500 Subject: [PATCH 001/461] Try-fix some import of configuration inconsistencies (#6364) --- src/modules/AdminModule.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index c04c26a5a..88109bc78 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -265,7 +265,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta disableBluetooth(); LOG_INFO("Commit transaction for edited settings"); hasOpenEditTransaction = false; - saveChanges(SEGMENT_CONFIG | SEGMENT_MODULECONFIG | SEGMENT_DEVICESTATE | SEGMENT_CHANNELS); + saveChanges(SEGMENT_CONFIG | SEGMENT_MODULECONFIG | SEGMENT_DEVICESTATE | SEGMENT_CHANNELS | SEGMENT_NODEDATABASE); break; } case meshtastic_AdminMessage_get_device_connection_status_request_tag: { @@ -334,7 +334,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta node->position = TypeConversions::ConvertToPositionLite(r->set_fixed_position); nodeDB->setLocalPosition(r->set_fixed_position); config.position.fixed_position = true; - saveChanges(SEGMENT_DEVICESTATE | SEGMENT_NODEDATABASE | SEGMENT_CONFIG, false); + saveChanges(SEGMENT_NODEDATABASE | SEGMENT_CONFIG, false); #if !MESHTASTIC_EXCLUDE_GPS if (gps != nullptr) gps->enable(); @@ -347,7 +347,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta LOG_INFO("Client received remove_fixed_position command"); nodeDB->clearLocalPosition(); config.position.fixed_position = false; - saveChanges(SEGMENT_DEVICESTATE | SEGMENT_NODEDATABASE | SEGMENT_CONFIG, false); + saveChanges(SEGMENT_NODEDATABASE | SEGMENT_CONFIG, false); break; } case meshtastic_AdminMessage_set_time_only_tag: { @@ -574,7 +574,6 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) config.has_position = true; config.position = c.payload_variant.position; // Save nodedb as well in case we got a fixed position packet - saveChanges(SEGMENT_DEVICESTATE, false); break; case meshtastic_Config_power_tag: LOG_INFO("Set config: Power"); From 3314b00fcc9500a722ac3e0fc700871a88ce74dd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 11:16:13 +0200 Subject: [PATCH 002/461] Upgrade trunk (#6471) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 8f938ce9e..4c570c856 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,12 +9,12 @@ plugins: lint: enabled: - prettier@3.5.3 - - trufflehog@3.88.18 + - trufflehog@3.88.20 - yamllint@1.37.0 - bandit@1.8.3 - checkov@3.2.394 - terrascan@1.19.9 - - trivy@0.60.0 + - trivy@0.61.0 - taplo@0.9.3 - ruff@0.11.2 - isort@6.0.1 From 39408fd3b1f39c6799caf9d214cc3dd613d4824c Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 31 Mar 2025 05:50:53 -0500 Subject: [PATCH 003/461] Disable network config for non-eth_gateway nrf52 and non-W RP2040 targets (#6462) * Disable network config for non-eth_gateway nrf52 and non-W RP2040 targets * Use HAS_ETHERNET logic --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 59cd6d8e9..f8443f9e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1274,6 +1274,12 @@ extern meshtastic_DeviceMetadata getDeviceMetadata() deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_AMBIENTLIGHTING_CONFIG; #endif +#if defined(ARCH_NRF52) && !HAS_ETHERNET // nrf52 doesn't have network unless it's a RAK ethernet gateway currently + deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_NETWORK_CONFIG; // No network on nRF52 +#elif defined(ARCH_RP2040) && !HAS_WIFI && !HAS_ETHERNET + deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_NETWORK_CONFIG; // No network on RP2040 +#endif + #if !(MESHTASTIC_EXCLUDE_PKI) deviceMetadata.hasPKC = true; #endif From 886bffe8f3b1e27b087c7f866129d7d763bc22de Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Tue, 1 Apr 2025 00:03:44 +1300 Subject: [PATCH 004/461] fix: honor user button customization (#6400) Co-authored-by: Ben Meadors --- src/graphics/niche/Inputs/TwoButton.cpp | 38 ++++++++++++++++++- src/graphics/niche/Inputs/TwoButton.h | 4 +- .../heltec_vision_master_e213/nicheGraphics.h | 2 +- .../heltec_vision_master_e290/nicheGraphics.h | 4 +- .../heltec_wireless_paper/nicheGraphics.h | 2 +- variants/t-echo/nicheGraphics.h | 2 +- 6 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/graphics/niche/Inputs/TwoButton.cpp b/src/graphics/niche/Inputs/TwoButton.cpp index 10d89ef41..b270d56cf 100644 --- a/src/graphics/niche/Inputs/TwoButton.cpp +++ b/src/graphics/niche/Inputs/TwoButton.cpp @@ -2,6 +2,7 @@ #include "./TwoButton.h" +#include "NodeDB.h" // For the helper function TwoButton::getUserButtonPin #include "PowerFSM.h" #include "sleep.h" @@ -57,14 +58,47 @@ void TwoButton::stop() detachInterrupt(buttons[1].pin); } +// Attempt to resolve a GPIO pin for the user button, honoring userPrefs.jsonc and device settings +// This helper method isn't used by the TweButton class itself, it could be moved elsewhere. +// Intention is to pass this value to TwoButton::setWiring in the setupNicheGraphics method. +uint8_t TwoButton::getUserButtonPin() +{ + uint8_t pin = 0xFF; // Unset + + // Use default pin for variant, if no better source +#ifdef BUTTON_PIN + pin = BUTTON_PIN; +#endif + + // From userPrefs.jsonc, if set +#ifdef USERPREFS_BUTTON_PIN + pin = USERPREFS_BUTTON_PIN; +#endif + + // From user's override in device settings, if set + if (config.device.button_gpio) + pin = config.device.button_gpio; + + return pin; +} + // Configures the wiring and logic of either button // Called when outlining your NicheGraphics implementation, in variant/nicheGraphics.cpp void TwoButton::setWiring(uint8_t whichButton, uint8_t pin, bool internalPullup) { + // Prevent the same GPIO being assigned to multiple buttons + // Allows an edge case when the user remaps hardware buttons using device settings, due to a broken user button + for (uint8_t i = 0; i < whichButton; i++) { + if (buttons[i].pin == pin) { + LOG_WARN("Attempted reuse of GPIO %d. Ignoring assignment whichButton=%d", pin, whichButton); + return; + } + } + assert(whichButton < 2); buttons[whichButton].pin = pin; - buttons[whichButton].activeLogic = LOW; - buttons[whichButton].mode = internalPullup ? INPUT_PULLUP : INPUT; // fix me + buttons[whichButton].activeLogic = LOW; // Unimplemented + buttons[whichButton].mode = internalPullup ? INPUT_PULLUP : INPUT; pinMode(buttons[whichButton].pin, buttons[whichButton].mode); } diff --git a/src/graphics/niche/Inputs/TwoButton.h b/src/graphics/niche/Inputs/TwoButton.h index 1e1576256..f1e18dd89 100644 --- a/src/graphics/niche/Inputs/TwoButton.h +++ b/src/graphics/niche/Inputs/TwoButton.h @@ -30,6 +30,8 @@ class TwoButton : protected concurrency::OSThread public: typedef std::function Callback; + static uint8_t getUserButtonPin(); // Resolve the GPIO, considering the various possible source of definition + static TwoButton *getInstance(); // Create or get the singleton instance void start(); // Start handling button input void stop(); // Stop handling button input (disconnect ISRs for sleep) @@ -62,7 +64,7 @@ class TwoButton : protected concurrency::OSThread public: // Per-button config uint8_t pin = 0xFF; // 0xFF: unset - bool activeLogic = LOW; // Active LOW by default. Todo: remove, unused + bool activeLogic = LOW; // Active LOW by default. Currently unimplemented. uint8_t mode = INPUT; // Whether to use internal pull up / pull down resistors uint32_t debounceLength = 50; // Minimum length for shortpress, in ms uint32_t longpressLength = 500; // How long after button down to fire longpress, in ms diff --git a/variants/heltec_vision_master_e213/nicheGraphics.h b/variants/heltec_vision_master_e213/nicheGraphics.h index 75e4423be..d6983bafe 100644 --- a/variants/heltec_vision_master_e213/nicheGraphics.h +++ b/variants/heltec_vision_master_e213/nicheGraphics.h @@ -95,7 +95,7 @@ void setupNicheGraphics() constexpr uint8_t AUX_BUTTON = 1; // Setup the main user button - buttons->setWiring(MAIN_BUTTON, BUTTON_PIN); + buttons->setWiring(MAIN_BUTTON, Inputs::TwoButton::getUserButtonPin()); buttons->setHandlerShortPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); buttons->setHandlerLongPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->longpress(); }); diff --git a/variants/heltec_vision_master_e290/nicheGraphics.h b/variants/heltec_vision_master_e290/nicheGraphics.h index 2674436b8..c2f26c7ff 100644 --- a/variants/heltec_vision_master_e290/nicheGraphics.h +++ b/variants/heltec_vision_master_e290/nicheGraphics.h @@ -19,7 +19,7 @@ Different NicheGraphics UIs and different hardware variants will each have their // InkHUD-specific components // --------------------------- -#include "graphics/niche/InkHUD/WindowManager.h" +#include "graphics/niche/InkHUD/InkHUD.h" // Applets #include "graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.h" @@ -113,7 +113,7 @@ void setupNicheGraphics() Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // A shared NicheGraphics component // Setup the main user button (0) - buttons->setWiring(0, BUTTON_PIN); + buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin()); buttons->setHandlerShortPress(0, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); buttons->setHandlerLongPress(0, []() { InkHUD::InkHUD::getInstance()->longpress(); }); diff --git a/variants/heltec_wireless_paper/nicheGraphics.h b/variants/heltec_wireless_paper/nicheGraphics.h index ece4225d0..5e938fa64 100644 --- a/variants/heltec_wireless_paper/nicheGraphics.h +++ b/variants/heltec_wireless_paper/nicheGraphics.h @@ -93,7 +93,7 @@ void setupNicheGraphics() constexpr uint8_t MAIN_BUTTON = 0; // Setup the main user button - buttons->setWiring(MAIN_BUTTON, BUTTON_PIN); + buttons->setWiring(MAIN_BUTTON, Inputs::TwoButton::getUserButtonPin()); buttons->setHandlerShortPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); buttons->setHandlerLongPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->longpress(); }); diff --git a/variants/t-echo/nicheGraphics.h b/variants/t-echo/nicheGraphics.h index e8a9232f1..f5dde6b19 100644 --- a/variants/t-echo/nicheGraphics.h +++ b/variants/t-echo/nicheGraphics.h @@ -104,7 +104,7 @@ void setupNicheGraphics() constexpr uint8_t TOUCH_BUTTON = 1; // Setup the main user button - buttons->setWiring(MAIN_BUTTON, BUTTON_PIN, LOW); + buttons->setWiring(MAIN_BUTTON, Inputs::TwoButton::getUserButtonPin()); buttons->setTiming(MAIN_BUTTON, 75, 500); buttons->setHandlerShortPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); buttons->setHandlerLongPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->longpress(); }); From a5efbfccd784f77784ec429794378b599476935e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 31 Mar 2025 06:32:54 -0500 Subject: [PATCH 005/461] Disable bluetooth config on rp2040, portduino (for now), and stm32 (#6465) * Disable bluetooth config on rp2040, portduino (for now), and stm32 * Add comments and exclude C6 --- src/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index f8443f9e9..05eeef2ae 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1274,6 +1274,13 @@ extern meshtastic_DeviceMetadata getDeviceMetadata() deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_AMBIENTLIGHTING_CONFIG; #endif +// No bluetooth on these targets (yet): +// Pico W / 2W may get it at some point +// Portduino and ESP32-C6 are excluded because we don't have a working bluetooth stacks integrated yet. +#if defined(ARCH_RP2040) || defined(ARCH_PORTDUINO) || defined(ARCH_STM32WL) || defined(CONFIG_IDF_TARGET_ESP32C6) + deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_BLUETOOTH_CONFIG; +#endif + #if defined(ARCH_NRF52) && !HAS_ETHERNET // nrf52 doesn't have network unless it's a RAK ethernet gateway currently deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_NETWORK_CONFIG; // No network on nRF52 #elif defined(ARCH_RP2040) && !HAS_WIFI && !HAS_ETHERNET From 2c01fad798e17bcc5e6feb4644ba15c12e32fffa Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 31 Mar 2025 08:31:54 -0400 Subject: [PATCH 006/461] meshtasticd: Add FrequencyLabs MeshAdv-Mini Hat (#6458) --- bin/config.d/lora-MeshAdv-900M30S.yaml | 4 +++- bin/config.d/lora-MeshAdv-Mini-900M22S.yaml | 11 +++++++++++ src/platform/portduino/PortduinoGlue.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 bin/config.d/lora-MeshAdv-Mini-900M22S.yaml diff --git a/bin/config.d/lora-MeshAdv-900M30S.yaml b/bin/config.d/lora-MeshAdv-900M30S.yaml index 113901d5e..5c148bf68 100644 --- a/bin/config.d/lora-MeshAdv-900M30S.yaml +++ b/bin/config.d/lora-MeshAdv-900M30S.yaml @@ -1,3 +1,5 @@ +# MeshAdv-Pi E22-900M30S +# https://github.com/chrismyers2000/MeshAdv-Pi-Hat Lora: Module: sx1262 CS: 21 @@ -9,4 +11,4 @@ Lora: DIO3_TCXO_VOLTAGE: true # Only for E22-900M33S: # Limit the output power to 8 dBm - # SX126X_MAX_POWER: 8 \ No newline at end of file + # SX126X_MAX_POWER: 8 diff --git a/bin/config.d/lora-MeshAdv-Mini-900M22S.yaml b/bin/config.d/lora-MeshAdv-Mini-900M22S.yaml new file mode 100644 index 000000000..554116b57 --- /dev/null +++ b/bin/config.d/lora-MeshAdv-Mini-900M22S.yaml @@ -0,0 +1,11 @@ +# MeshAdv Mini E22-900M22S +# https://github.com/chrismyers2000/MeshAdv-Mini +Lora: + Module: sx1262 # Ebyte E22-900M22S + CS: 8 + IRQ: 16 + Busy: 20 + Reset: 24 + TXen: 13 + DIO2_AS_RF_SWITCH: true + DIO3_TCXO_VOLTAGE: true diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index a7aea1c3e..4e074be71 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -11,6 +11,7 @@ inline const std::unordered_map configProducts = {{"MESHTOAD", "lora-usb-meshtoad-e22.yaml"}, {"MESHSTICK", "lora-meshstick-1262.yaml"}, {"MESHADV-PI", "lora-MeshAdv-900M30S.yaml"}, + {"MESHADV-MINI", "lora-MeshAdv-Mini-900M22S.yaml"}, {"POWERPI", "lora-MeshAdv-900M30S.yaml"}}; enum configNames { From ae887590594de8e573ca2ce16334f5534ce34155 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Tue, 1 Apr 2025 13:08:23 +1300 Subject: [PATCH 007/461] draft an InkHUD variant for Elecrow Thinknode M1 (#6473) Only an initial guess. No hardware here yet for testing. Button assignments are largely placeholder. Co-authored-by: Ben Meadors --- variants/ELECROW-ThinkNode-M1/nicheGraphics.h | 119 ++++++++++++++++++ variants/ELECROW-ThinkNode-M1/platformio.ini | 22 +++- variants/ELECROW-ThinkNode-M1/variant.h | 2 - 3 files changed, 140 insertions(+), 3 deletions(-) create mode 100644 variants/ELECROW-ThinkNode-M1/nicheGraphics.h diff --git a/variants/ELECROW-ThinkNode-M1/nicheGraphics.h b/variants/ELECROW-ThinkNode-M1/nicheGraphics.h new file mode 100644 index 000000000..f68ac9edd --- /dev/null +++ b/variants/ELECROW-ThinkNode-M1/nicheGraphics.h @@ -0,0 +1,119 @@ +#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/Backlight/LatchingBacklight.h" +#include "graphics/niche/Drivers/EInk/GDEY0154D67.h" +#include "graphics/niche/Inputs/TwoButton.h" + +#include "graphics/niche/Fonts/FreeSans6pt7b.h" +#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h" +#include + +void setupNicheGraphics() +{ + using namespace NicheGraphics; + + // SPI + // ----------------------------- + + // For NRF52 platforms, SPI pins are defined in variant.h, not passed to begin() + SPI1.begin(); + + // Driver + // ----------------------------- + + // Use E-Ink driver + Drivers::EInk *driver = new Drivers::GDEY0154D67; // Todo: confirm display model + driver->begin(&SPI1, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); + + // InkHUD + // ---------------------------- + + InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance(); + + // Set the driver + inkhud->setDriver(driver); + + // Set how many FAST updates per FULL update + // Set how unhealthy additional FAST updates beyond this number are + // Todo: observe the display's performance in-person and adjust accordingly. + // Currently set to the values given by Elecrow for EInkDynamicDisplay. + inkhud->setDisplayResilience(10, 1.5); + + // Prepare fonts + InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b); + InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b); + /* + // Font localization demo: Cyrillic + InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic); + InkHUD::Applet::fontSmall.addSubstitutionsWin1251(); + */ + + // Customize default settings + inkhud->persistence->settings.userTiles.maxCount = 2; // Two applets side-by-side + inkhud->persistence->settings.rotation = 0; // To be confirmed? + inkhud->persistence->settings.optionalFeatures.batteryIcon = true; // Device definitely has a battery + + // Setup backlight + // Note: button mapping for this configured further down + Drivers::LatchingBacklight *backlight = Drivers::LatchingBacklight::getInstance(); + backlight->setPin(PIN_EINK_EN); + + // 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); // Inactive + inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive + inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive + inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true); // Activated + inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // Inactive + 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 + + // As labeled on Elecrow diagram: https://www.elecrow.com/download/product/CIL12901M/ThinkNode-M1_User_Manual.pdf + constexpr uint8_t PAGE_TURN_BUTTON = 0; + constexpr uint8_t FUNCTION_BUTTON = 1; + + // Setup the main user button + buttons->setWiring(PAGE_TURN_BUTTON, PIN_BUTTON2); + buttons->setTiming(PAGE_TURN_BUTTON, 50, 500); // Todo: confirm 50ms is adequate debounce + buttons->setHandlerShortPress(PAGE_TURN_BUTTON, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); + buttons->setHandlerLongPress(PAGE_TURN_BUTTON, []() { InkHUD::InkHUD::getInstance()->longpress(); }); + + // Setup the aux button + // Initial testing only: mapped to the backlight + // Todo: additional features + buttons->setWiring(FUNCTION_BUTTON, PIN_BUTTON1); + buttons->setTiming(FUNCTION_BUTTON, 50, 500); // 500ms before latch + buttons->setHandlerDown(FUNCTION_BUTTON, [backlight]() { backlight->peek(); }); + buttons->setHandlerLongPress(FUNCTION_BUTTON, [backlight]() { backlight->latch(); }); + buttons->setHandlerShortPress(FUNCTION_BUTTON, [backlight]() { backlight->off(); }); + + buttons->start(); +} + +#endif \ No newline at end of file diff --git a/variants/ELECROW-ThinkNode-M1/platformio.ini b/variants/ELECROW-ThinkNode-M1/platformio.ini index f37f6d310..86fbde398 100644 --- a/variants/ELECROW-ThinkNode-M1/platformio.ini +++ b/variants/ELECROW-ThinkNode-M1/platformio.ini @@ -10,6 +10,7 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/ELECROW-ThinkNode-M1 -DELECROW_ThinkNode_M1 -DGPS_POWER_TOGGLE -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" + -DUSE_EINK -DEINK_DISPLAY_MODEL=GxEPD2_154_D67 -DEINK_WIDTH=200 -DEINK_HEIGHT=200 @@ -26,4 +27,23 @@ lib_deps = https://github.com/meshtastic/GxEPD2/archive/33db3fa8ee6fc47d160bdb44f8f127c9a9203a10.zip lewisxhe/PCF8563_Library@^1.0.1 khoih-prog/nRF52_PWM@^1.0.1 -;upload_protocol = fs \ No newline at end of file +;upload_protocol = fs + +[env:thinknode_m1-inkhud] +extends = nrf52840_base, inkhud +board = ThinkNode-M1 +board_check = true +debug_tool = jlink +build_flags = + ${nrf52840_base.build_flags} + ${inkhud.build_flags} + -I variants/ELECROW-ThinkNode-M1 + -D ELECROW_ThinkNode_M1 + -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" +build_src_filter = + ${nrf52_base.build_src_filter} + ${inkhud.build_src_filter} +lib_deps = + ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX + ${nrf52840_base.lib_deps} + lewisxhe/PCF8563_Library@^1.0.1 \ No newline at end of file diff --git a/variants/ELECROW-ThinkNode-M1/variant.h b/variants/ELECROW-ThinkNode-M1/variant.h index 3bfa360f6..fc2fddbdf 100644 --- a/variants/ELECROW-ThinkNode-M1/variant.h +++ b/variants/ELECROW-ThinkNode-M1/variant.h @@ -140,8 +140,6 @@ External serial flash WP25R1635FZUIL0 // Controls power for all peripherals (eink + GPS + LoRa + Sensor) #define PIN_POWER_EN (0 + 12) -#define USE_EINK - #define PIN_SPI1_MISO (32 + 7) #define PIN_SPI1_MOSI PIN_EINK_MOSI #define PIN_SPI1_SCK PIN_EINK_SCLK From 128c347c645d64497b5f024364e44c5884079b12 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Tue, 1 Apr 2025 23:26:46 +1300 Subject: [PATCH 008/461] fix: T-Echo frontlight on at boot when using OLED UI (#6474) --- src/graphics/EInkDisplay2.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 96c6b44c1..27117641e 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -128,11 +128,7 @@ bool EInkDisplay::connect() #ifdef PIN_EINK_EN // backlight power, HIGH is backlight on, LOW is off pinMode(PIN_EINK_EN, OUTPUT); -#ifdef ELECROW_ThinkNode_M1 digitalWrite(PIN_EINK_EN, LOW); -#else - digitalWrite(PIN_EINK_EN, HIGH); -#endif #endif #if defined(TTGO_T_ECHO) || defined(ELECROW_ThinkNode_M1) From ea4ce8d827d45e82e7ce5b377d956e324f80733c Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Tue, 1 Apr 2025 15:53:15 +0200 Subject: [PATCH 009/461] MUI unPhone-tft: fix defaults (#6477) --- src/mesh/NodeDB.cpp | 2 +- variants/unphone/platformio.ini | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 3f79d18e6..9bb63652a 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -689,7 +689,7 @@ void NodeDB::initConfigIntervals() config.display.screen_on_secs = default_screen_on_secs; -#if defined(T_WATCH_S3) || defined(T_DECK) || defined(MESH_TAB) || defined(RAK14014) +#if defined(T_WATCH_S3) || defined(T_DECK) || defined(UNPHONE) || defined(MESH_TAB) || defined(RAK14014) config.power.is_power_saving = true; config.display.screen_on_secs = 30; config.power.wait_bluetooth_secs = 30; diff --git a/variants/unphone/platformio.ini b/variants/unphone/platformio.ini index 18efbb157..399d65b03 100644 --- a/variants/unphone/platformio.ini +++ b/variants/unphone/platformio.ini @@ -35,19 +35,19 @@ lib_deps = ${esp32s3_base.lib_deps} extends = env:unphone build_flags = ${env:unphone.build_flags} + -D CONFIG_DISABLE_HAL_LOCKS=1 -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 -D MESHTASTIC_EXCLUDE_INPUTBROKER=1 - -D MESHTASTIC_EXCLUDE_BLUETOOTH=1 -D MESHTASTIC_EXCLUDE_WEBSERVER=1 -D MESHTASTIC_EXCLUDE_SERIAL=1 -D MESHTASTIC_EXCLUDE_SOCKETAPI=1 -D INPUTDRIVER_BUTTON_TYPE=21 - -D MAX_THREADS=40 -D HAS_SCREEN=0 -D HAS_TFT=1 -D HAS_SDCARD -D DISPLAY_SET_RESOLUTION - -D RAM_SIZE=3072 + -D RAM_SIZE=6144 + -D LV_CACHE_DEF_SIZE=2097152 -D LV_LVGL_H_INCLUDE_SIMPLE -D LV_CONF_INCLUDE_SIMPLE -D LV_COMP_CONF_INCLUDE_SIMPLE @@ -63,6 +63,7 @@ build_flags = -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_UNPHONE.h\" -D VIEW_320x240 -D USE_PACKET_API + -D MAP_FULL_REDRAW lib_deps = ${env:unphone.lib_deps} From 644849126ca179ee52f31133cc62e72142dde8f7 Mon Sep 17 00:00:00 2001 From: Benjamin Faershtein <119711889+RCGV1@users.noreply.github.com> Date: Tue, 1 Apr 2025 10:50:10 -0700 Subject: [PATCH 010/461] Fixes #6315 (#6475) * Fixed Canned Messages send to non broadcast * Small fix * Fix formatting for singular canned message * Trunk fmt --------- Co-authored-by: Ben Meadors --- src/modules/CannedMessageModule.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 2a5ec00ab..c16c0e4b3 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -483,7 +483,7 @@ int32_t CannedMessageModule::runOnce() #if defined(USE_VIRTUAL_KEYBOARD) sendText(this->dest, indexChannels[this->channel], this->messages[this->currentMessageIndex], true); #else - sendText(NODENUM_BROADCAST, channels.getPrimaryIndex(), this->messages[this->currentMessageIndex], true); + sendText(this->dest, indexChannels[this->channel], this->messages[this->currentMessageIndex], true); #endif } this->runState = CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE; @@ -1114,20 +1114,19 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st display->drawStringf(0 + x, 0 + y, buffer, "To: %s", cannedMessageModule->getNodeName(this->dest)); int lines = (display->getHeight() / FONT_HEIGHT_SMALL) - 1; if (lines == 3) { - // static (old) behavior for small displays - display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL, cannedMessageModule->getPrevMessage()); display->fillRect(0 + x, 0 + y + FONT_HEIGHT_SMALL * 2, x + display->getWidth(), y + FONT_HEIGHT_SMALL); display->setColor(BLACK); display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL * 2, cannedMessageModule->getCurrentMessage()); display->setColor(WHITE); - display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL * 3, cannedMessageModule->getNextMessage()); + if (this->messagesCount > 1) { + display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL, cannedMessageModule->getPrevMessage()); + display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL * 3, cannedMessageModule->getNextMessage()); + } } else { - // use entire display height for larger displays int topMsg = (messagesCount > lines && currentMessageIndex >= lines - 1) ? currentMessageIndex - lines + 2 : 0; for (int i = 0; i < std::min(messagesCount, lines); i++) { if (i == currentMessageIndex - topMsg) { #ifdef USE_EINK - // Avoid drawing solid black with fillRect: harder to clear for E-Ink display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL * (i + 1), ">"); display->drawString(12 + x, 0 + y + FONT_HEIGHT_SMALL * (i + 1), cannedMessageModule->getCurrentMessage()); @@ -1138,7 +1137,7 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL * (i + 1), cannedMessageModule->getCurrentMessage()); display->setColor(WHITE); #endif - } else { + } else if (messagesCount > 1) { // Only draw others if there are multiple messages display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL * (i + 1), cannedMessageModule->getMessageByIndex(topMsg + i)); } From f6ed10f3298abf6896892ca7906d3231c8b3f567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hampa=C3=AF?= Date: Tue, 1 Apr 2025 22:39:40 +0200 Subject: [PATCH 011/461] Added initial support for Texas Instruments LP5562 (#6381) * Added initial support for Texas Instrument LP5562 * Added proper support for Ambient Lighting * Code merge for all RBG_LED enabled devices * Fixed forgotten log_info & added firstRGBLED() --- src/AmbientLightingThread.h | 43 +++++++++++++++++----- src/configuration.h | 6 +++ src/detect/ScanI2C.cpp | 6 +++ src/detect/ScanI2C.h | 3 ++ src/detect/ScanI2CTwoWire.cpp | 3 ++ src/graphics/NomadStarLED.h | 5 +++ src/main.cpp | 8 ++-- src/modules/ExternalNotificationModule.cpp | 29 +++++++++++++-- 8 files changed, 87 insertions(+), 16 deletions(-) create mode 100644 src/graphics/NomadStarLED.h diff --git a/src/AmbientLightingThread.h b/src/AmbientLightingThread.h index c487f9d53..bff8846d6 100644 --- a/src/AmbientLightingThread.h +++ b/src/AmbientLightingThread.h @@ -6,6 +6,11 @@ NCP5623 rgb; #endif +#ifdef HAS_LP5562 +#include +LP5562 rgbw; +#endif + #ifdef HAS_NEOPIXEL #include Adafruit_NeoPixel pixels(NEOPIXEL_COUNT, NEOPIXEL_DATA, NEOPIXEL_TYPE); @@ -26,7 +31,7 @@ class AmbientLightingThread : public concurrency::OSThread notifyDeepSleepObserver.observe(¬ifyDeepSleep); // Let us know when shutdown() is issued. // Enables Ambient Lighting by default if conditions are meet. -#if defined(HAS_NCP5623) || defined(RGBLED_RED) || defined(HAS_NEOPIXEL) || defined(UNPHONE) +#ifdef HAS_RGB_LED #ifdef ENABLE_AMBIENTLIGHTING moduleConfig.ambient_lighting.led_state = true; #endif @@ -39,7 +44,7 @@ class AmbientLightingThread : public concurrency::OSThread // moduleConfig.ambient_lighting.green = (myNodeInfo.my_node_num & 0x00FF00) >> 8; // moduleConfig.ambient_lighting.blue = myNodeInfo.my_node_num & 0x0000FF; -#ifdef HAS_NCP5623 +#if defined(HAS_NCP5623) || defined(HAS_LP5562) _type = type; if (_type == ScanI2C::DeviceType::NONE) { LOG_DEBUG("AmbientLighting Disable due to no RGB leds found on I2C bus"); @@ -47,17 +52,21 @@ class AmbientLightingThread : public concurrency::OSThread return; } #endif -#if defined(HAS_NCP5623) || defined(RGBLED_RED) || defined(HAS_NEOPIXEL) || defined(UNPHONE) +#ifdef HAS_RGB_LED if (!moduleConfig.ambient_lighting.led_state) { LOG_DEBUG("AmbientLighting Disable due to moduleConfig.ambient_lighting.led_state OFF"); disable(); return; } LOG_DEBUG("AmbientLighting init"); -#ifdef HAS_NCP5623 +#if defined(HAS_NCP5623) || defined(HAS_LP5562) if (_type == ScanI2C::NCP5623) { rgb.begin(); #endif +#ifdef HAS_LP5562 + } else if (_type == ScanI2C::LP5562) { + rgbw.begin(); +#endif #ifdef RGBLED_RED pinMode(RGBLED_RED, OUTPUT); pinMode(RGBLED_GREEN, OUTPUT); @@ -70,7 +79,7 @@ class AmbientLightingThread : public concurrency::OSThread #endif setLighting(); #endif -#ifdef HAS_NCP5623 +#if defined(HAS_NCP5623) || defined(HAS_LP5562) } #endif } @@ -78,13 +87,13 @@ class AmbientLightingThread : public concurrency::OSThread protected: int32_t runOnce() override { -#if defined(HAS_NCP5623) || defined(RGBLED_RED) || defined(HAS_NEOPIXEL) || defined(UNPHONE) -#ifdef HAS_NCP5623 - if (_type == ScanI2C::NCP5623 && moduleConfig.ambient_lighting.led_state) { +#ifdef HAS_RGB_LED +#if defined(HAS_NCP5623) || defined(HAS_LP5562) + if ((_type == ScanI2C::NCP5623 || _type == ScanI2C::LP5562) && moduleConfig.ambient_lighting.led_state) { #endif setLighting(); return 30000; // 30 seconds to reset from any animations that may have been running from Ext. Notification -#ifdef HAS_NCP5623 +#if defined(HAS_NCP5623) || defined(HAS_LP5562) } #endif #endif @@ -108,6 +117,14 @@ class AmbientLightingThread : public concurrency::OSThread rgb.setBlue(0); LOG_INFO("OFF: NCP5623 Ambient lighting"); #endif +#ifdef HAS_LP5562 + rgbw.setCurrent(0); + rgbw.setRed(0); + rgbw.setGreen(0); + rgbw.setBlue(0); + rgbw.setWhite(0); + LOG_INFO("OFF: LP5562 Ambient lighting"); +#endif #ifdef HAS_NEOPIXEL pixels.clear(); pixels.show(); @@ -141,6 +158,14 @@ class AmbientLightingThread : public concurrency::OSThread LOG_DEBUG("Init NCP5623 Ambient light w/ current=%d, red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.current, moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue); #endif +#ifdef HAS_LP5562 + rgbw.setCurrent(moduleConfig.ambient_lighting.current); + rgbw.setRed(moduleConfig.ambient_lighting.red); + rgbw.setGreen(moduleConfig.ambient_lighting.green); + rgbw.setBlue(moduleConfig.ambient_lighting.blue); + LOG_DEBUG("Init LP5562 Ambient light w/ current=%d, red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.current, + moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue); +#endif #ifdef HAS_NEOPIXEL pixels.fill(pixels.Color(moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue), diff --git a/src/configuration.h b/src/configuration.h index fd4a5b196..ba6066896 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -170,6 +170,7 @@ along with this program. If not, see . // LED // ----------------------------------------------------------------------------- #define NCP5623_ADDR 0x38 +#define LP5562_ADDR 0x30 // ----------------------------------------------------------------------------- // Security @@ -295,6 +296,11 @@ along with this program. If not, see . #error HW_VENDOR must be defined #endif +// Support multiple RGB LED configuration +#if defined(HAS_NCP5623) || defined(HAS_LP5562) || defined(RGBLED_RED) || defined(HAS_NEOPIXEL) || defined(UNPHONE) +#define HAS_RGB_LED +#endif + // ----------------------------------------------------------------------------- // Global switches to turn off features for a minimized build // ----------------------------------------------------------------------------- diff --git a/src/detect/ScanI2C.cpp b/src/detect/ScanI2C.cpp index 4caa0f730..b88843a78 100644 --- a/src/detect/ScanI2C.cpp +++ b/src/detect/ScanI2C.cpp @@ -41,6 +41,12 @@ ScanI2C::FoundDevice ScanI2C::firstAccelerometer() const return firstOfOrNONE(8, types); } +ScanI2C::FoundDevice ScanI2C::firstRGBLED() const +{ + ScanI2C::DeviceType types[] = {NCP5623, LP5562}; + return firstOfOrNONE(2, types); +} + ScanI2C::FoundDevice ScanI2C::find(ScanI2C::DeviceType) const { return DEVICE_NONE; diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index 5b6bbe629..cfa3ea9cd 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -49,6 +49,7 @@ class ScanI2C VEML7700, RCWL9620, NCP5623, + LP5562, TSL2591, OPT3001, MLX90632, @@ -121,6 +122,8 @@ class ScanI2C FoundDevice firstAccelerometer() const; + FoundDevice firstRGBLED() const; + virtual FoundDevice find(DeviceType) const; virtual bool exists(DeviceType) const; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 8b779277d..82fcda480 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -218,6 +218,9 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) #ifdef HAS_NCP5623 SCAN_SIMPLE_CASE(NCP5623_ADDR, NCP5623, "NCP5623", (uint8_t)addr.address); #endif +#ifdef HAS_LP5562 + SCAN_SIMPLE_CASE(LP5562_ADDR, LP5562, "LP5562", (uint8_t)addr.address); +#endif #ifdef HAS_PMU SCAN_SIMPLE_CASE(XPOWERS_AXP192_AXP2101_ADDRESS, PMU_AXP192_AXP2101, "AXP192/AXP2101", (uint8_t)addr.address) #endif diff --git a/src/graphics/NomadStarLED.h b/src/graphics/NomadStarLED.h new file mode 100644 index 000000000..0633a577e --- /dev/null +++ b/src/graphics/NomadStarLED.h @@ -0,0 +1,5 @@ +#ifdef HAS_LP5562 +#include +extern LP5562 rgbw; + +#endif \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 05eeef2ae..4b098b3f3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -602,9 +602,9 @@ void setup() * "found". */ -// Only one supported RGB LED currently -#ifdef HAS_NCP5623 - rgb_found = i2cScanner->find(ScanI2C::DeviceType::NCP5623); +// Two supported RGB LED currently +#ifdef HAS_RGB_LED + rgb_found = i2cScanner->firstRGBLED(); #endif #ifdef HAS_TPS65233 @@ -1270,7 +1270,7 @@ extern meshtastic_DeviceMetadata getDeviceMetadata() #ifndef ARCH_ESP32 deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_PAXCOUNTER_CONFIG; #endif -#if !defined(HAS_NCP5623) && !defined(RGBLED_RED) && !defined(HAS_NEOPIXEL) && !defined(UNPHONE) && !RAK_4631 +#if !defined(HAS_RGB_LED) && !RAK_4631 deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_AMBIENTLIGHTING_CONFIG; #endif diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index bbb3f90e0..dc17460f6 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -28,6 +28,10 @@ #include #endif +#ifdef HAS_LP5562 +#include +#endif + #ifdef HAS_NEOPIXEL #include #endif @@ -37,10 +41,11 @@ extern unPhone unphone; #endif -#if defined(HAS_NCP5623) || defined(RGBLED_RED) || defined(HAS_NEOPIXEL) || defined(UNPHONE) +#if defined(HAS_RGB_LED) uint8_t red = 0; uint8_t green = 0; uint8_t blue = 0; +uint8_t white = 0; uint8_t colorState = 1; uint8_t brightnessIndex = 0; uint8_t brightnessValues[] = {0, 10, 20, 30, 50, 90, 160, 170}; // blue gets multiplied by 1.5 @@ -128,15 +133,21 @@ int32_t ExternalNotificationModule::runOnce() millis()); setExternalState(2, !getExternal(2)); } -#if defined(HAS_NCP5623) || defined(RGBLED_RED) || defined(HAS_NEOPIXEL) || defined(UNPHONE) +#if defined(HAS_RGB_LED) red = (colorState & 4) ? brightnessValues[brightnessIndex] : 0; // Red enabled on colorState = 4,5,6,7 green = (colorState & 2) ? brightnessValues[brightnessIndex] : 0; // Green enabled on colorState = 2,3,6,7 blue = (colorState & 1) ? (brightnessValues[brightnessIndex] * 1.5) : 0; // Blue enabled on colorState = 1,3,5,7 + white = (colorState & 12) ? brightnessValues[brightnessIndex] : 0; #ifdef HAS_NCP5623 if (rgb_found.type == ScanI2C::NCP5623) { rgb.setColor(red, green, blue); } #endif +#ifdef HAS_LP5562 + if (rgb_found.type == ScanI2C::LP5562) { + rgbw.setColor(red, green, blue, white); + } +#endif #ifdef RGBLED_CA analogWrite(RGBLED_RED, 255 - red); // CA type needs reverse logic analogWrite(RGBLED_GREEN, 255 - green); @@ -233,11 +244,12 @@ void ExternalNotificationModule::setExternalState(uint8_t index, bool on) break; } -#if defined(HAS_NCP5623) || defined(RGBLED_RED) || defined(HAS_NEOPIXEL) || defined(UNPHONE) +#if defined(HAS_RGB_LED) if (!on) { red = 0; green = 0; blue = 0; + white = 0; } #endif @@ -246,6 +258,11 @@ void ExternalNotificationModule::setExternalState(uint8_t index, bool on) rgb.setColor(red, green, blue); } #endif +#ifdef HAS_LP5562 + if (rgb_found.type == ScanI2C::LP5562) { + rgbw.setColor(red, green, blue, white); + } +#endif #ifdef RGBLED_CA analogWrite(RGBLED_RED, 255 - red); // CA type needs reverse logic analogWrite(RGBLED_GREEN, 255 - green); @@ -365,6 +382,12 @@ ExternalNotificationModule::ExternalNotificationModule() rgb.setCurrent(10); } #endif +#ifdef HAS_LP5562 + if (rgb_found.type == ScanI2C::LP5562) { + rgbw.begin(); + rgbw.setCurrent(20); + } +#endif #ifdef RGBLED_RED pinMode(RGBLED_RED, OUTPUT); // set up the RGB led pins pinMode(RGBLED_GREEN, OUTPUT); From 67fddcc2142bed7e6748d0a5485d4848f32856fc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 2 Apr 2025 05:41:36 -0500 Subject: [PATCH 012/461] Upgrade trunk (#6480) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 4c570c856..b89f1f835 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -12,7 +12,7 @@ lint: - trufflehog@3.88.20 - yamllint@1.37.0 - bandit@1.8.3 - - checkov@3.2.394 + - checkov@3.2.395 - terrascan@1.19.9 - trivy@0.61.0 - taplo@0.9.3 @@ -22,7 +22,7 @@ lint: - oxipng@9.1.4 - svgo@3.3.2 - actionlint@1.7.7 - - flake8@7.1.2 + - flake8@7.2.0 - hadolint@2.12.1-beta - shfmt@3.6.0 - shellcheck@0.10.0 From ef18a9b5b5a2a756ad15009ce9cd7e0b7717d077 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 2 Apr 2025 07:55:14 -0400 Subject: [PATCH 013/461] meshtasticd: Set available.d dir in yaml (#6481) --- bin/config-dist.yaml | 3 ++- src/platform/portduino/PortduinoGlue.cpp | 4 +++- src/platform/portduino/PortduinoGlue.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/config-dist.yaml b/bin/config-dist.yaml index 722f80fae..9238d0e56 100644 --- a/bin/config-dist.yaml +++ b/bin/config-dist.yaml @@ -197,5 +197,6 @@ General: MaxNodes: 200 MaxMessageQueue: 100 ConfigDirectory: /etc/meshtasticd/config.d/ + AvailableDirectory: /etc/meshtasticd/available.d/ # MACAddress: AA:BB:CC:DD:EE:FF -# MACAddressSource: eth0 \ No newline at end of file +# MACAddressSource: eth0 diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index a4050e702..6d0972dc3 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -247,7 +247,7 @@ void portduinoSetup() std::cerr << "autoconf: Unable to find config for " << autoconf_product << std::endl; exit(EXIT_FAILURE); } - if (loadConfig(("/etc/meshtasticd/available.d/" + product_config).c_str())) { + if (loadConfig((settingsStrings[available_directory] + product_config).c_str())) { std::cout << "autoconf: Using " << product_config << " as config file for " << autoconf_product << std::endl; } else { std::cerr << "autoconf: Unable to use " << product_config << " as config file for " << autoconf_product @@ -602,6 +602,8 @@ bool loadConfig(const char *configPath) settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as(200); settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as(100); settingsStrings[config_directory] = (yamlConfig["General"]["ConfigDirectory"]).as(""); + settingsStrings[available_directory] = + (yamlConfig["General"]["AvailableDirectory"]).as("/etc/meshtasticd/available.d/"); if ((yamlConfig["General"]["MACAddress"]).as("") != "" && (yamlConfig["General"]["MACAddressSource"]).as("") != "") { std::cout << "Cannot set both MACAddress and MACAddressSource!" << std::endl; diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index 4e074be71..f7239cb73 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -99,6 +99,7 @@ enum configNames { maxnodes, ascii_logs, config_directory, + available_directory, mac_address }; enum { no_screen, x11, st7789, st7735, st7735s, st7796, ili9341, ili9342, ili9486, ili9488, hx8357d }; From 594cb0cc1e94b478aac755025f0912b452aa2845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 3 Apr 2025 02:15:12 +0200 Subject: [PATCH 014/461] reinstate M1 Backlight (#6484) --- src/graphics/EInkDisplay2.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 27117641e..d2d373d24 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -128,8 +128,13 @@ bool EInkDisplay::connect() #ifdef PIN_EINK_EN // backlight power, HIGH is backlight on, LOW is off pinMode(PIN_EINK_EN, OUTPUT); +#ifdef ELECROW_ThinkNode_M1 + // ThinkNode M1 has a hardware dimmable backlight. Start enabled + digitalWrite(PIN_EINK_EN, HIGH); +#else digitalWrite(PIN_EINK_EN, LOW); #endif +#endif #if defined(TTGO_T_ECHO) || defined(ELECROW_ThinkNode_M1) { From 31130fd49e732bdd813492e8155e71605275595c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 06:52:39 -0500 Subject: [PATCH 015/461] Upgrade trunk to 1.22.12 (#6487) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index b89f1f835..aeb0a1b43 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -1,6 +1,6 @@ version: 0.1 cli: - version: 1.22.11 + version: 1.22.12 plugins: sources: - id: trunk @@ -12,7 +12,7 @@ lint: - trufflehog@3.88.20 - yamllint@1.37.0 - bandit@1.8.3 - - checkov@3.2.395 + - checkov@3.2.396 - terrascan@1.19.9 - trivy@0.61.0 - taplo@0.9.3 From 11bafae2872c244dd821ce0b6273e699f55cfae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 3 Apr 2025 16:02:46 +0200 Subject: [PATCH 016/461] update OLED library (#6489) --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 010aea90f..377635873 100644 --- a/platformio.ini +++ b/platformio.ini @@ -56,7 +56,7 @@ build_flags = -Wno-missing-field-initializers monitor_speed = 115200 monitor_filters = direct lib_deps = - https://github.com/meshtastic/esp8266-oled-ssd1306/archive/e16cee124fe26490cb14880c679321ad8ac89c95.zip + https://github.com/meshtastic/esp8266-oled-ssd1306/archive/0119501e9983bd894830b02f545c377ee08d66fe.zip mathertel/OneButton@2.6.1 https://github.com/meshtastic/arduino-fsm/archive/7db3702bf0cfe97b783d6c72595e3f38e0b19159.zip https://github.com/meshtastic/TinyGPSPlus/archive/71a82db35f3b973440044c476d4bcdc673b104f4.zip From 1017f6af355f6e531d76578118b59bb4c9bee41b Mon Sep 17 00:00:00 2001 From: rcarteraz Date: Thu, 3 Apr 2025 07:07:43 -0700 Subject: [PATCH 017/461] remove very long slow (#6486) --- src/DisplayFormatters.cpp | 3 --- src/mesh/RadioInterface.cpp | 5 ----- 2 files changed, 8 deletions(-) diff --git a/src/DisplayFormatters.cpp b/src/DisplayFormatters.cpp index 0718ffcbd..44bc0897b 100644 --- a/src/DisplayFormatters.cpp +++ b/src/DisplayFormatters.cpp @@ -27,9 +27,6 @@ const char *DisplayFormatters::getModemPresetDisplayName(meshtastic_Config_LoRaC case meshtastic_Config_LoRaConfig_ModemPreset_LONG_MODERATE: return useShortName ? "LongM" : "LongMod"; break; - case meshtastic_Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW: - return useShortName ? "VeryL" : "VLongSlow"; - break; default: return useShortName ? "Custom" : "Invalid"; break; diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 2e50c0168..86903153b 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -488,11 +488,6 @@ void RadioInterface::applyModemConfig() cr = 8; sf = 12; break; - case meshtastic_Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW: - bw = (myRegion->wideLora) ? 203.125 : 62.5; - cr = 8; - sf = 12; - break; } } else { sf = loraConfig.spread_factor; From 06658028234b86dc9cb7055f6f57ce6fd5a417fd Mon Sep 17 00:00:00 2001 From: "Jason B. Cox" Date: Thu, 3 Apr 2025 12:17:36 -0700 Subject: [PATCH 018/461] Improve PKC unit test coverage (#6485) * Cleanup PKC unit test a bit * Add unit test coverage for encryptCurve25519 --------- Co-authored-by: Ben Meadors --- test/test_crypto/test_main.cpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/test/test_crypto/test_main.cpp b/test/test_crypto/test_main.cpp index ac507116c..36dc37b9d 100644 --- a/test/test_crypto/test_main.cpp +++ b/test/test_crypto/test_main.cpp @@ -110,7 +110,7 @@ void test_DH25519(void) TEST_ASSERT_EQUAL_MEMORY(expected_shared, crypto->shared_key, 32); } -void test_PKC_Decrypt(void) +void test_PKC(void) { uint8_t private_key[32]; meshtastic_UserLite_public_key_t public_key; @@ -120,7 +120,8 @@ void test_PKC_Decrypt(void) uint8_t decrypted[128] __attribute__((__aligned__)); uint8_t expected_nonce[16]; - uint32_t fromNode; + uint32_t fromNode = 0x0929; + uint64_t packetNum = 0x13b2d662; HexToBytes(public_key.bytes, "db18fc50eea47f00251cb784819a3cf5fc361882597f589f0d7ff820e8064457"); public_key.size = 32; HexToBytes(private_key, "a00330633e63522f8a4d81ec6d9d1e6617f6c8ffd3a4c698229537d44e522277"); @@ -128,14 +129,26 @@ void test_PKC_Decrypt(void) HexToBytes(expected_decrypted, "08011204746573744800"); HexToBytes(radioBytes, "8c646d7a2909000062d6b2136b00000040df24abfcc30a17a3d9046726099e796a1c036a792b"); HexToBytes(expected_nonce, "62d6b213036a792b2909000000"); - fromNode = 0x0929; crypto->setDHPrivateKey(private_key); - // TEST_ASSERT(crypto->setDHPublicKey(public_key)); - // crypto->hash(crypto->shared_key, 32); - crypto->decryptCurve25519(fromNode, public_key, 0x13b2d662, 22, radioBytes + 16, decrypted); + + TEST_ASSERT(crypto->decryptCurve25519(fromNode, public_key, packetNum, 22, radioBytes + 16, decrypted)); TEST_ASSERT_EQUAL_MEMORY(expected_shared, crypto->shared_key, 8); TEST_ASSERT_EQUAL_MEMORY(expected_nonce, crypto->nonce, 13); + TEST_ASSERT_EQUAL_MEMORY(expected_decrypted, decrypted, 10); + uint32_t toNode = 0; // Only impacts logging + uint8_t encrypted[128] __attribute__((__aligned__)); + TEST_ASSERT(crypto->encryptCurve25519(toNode, fromNode, public_key, packetNum, 10, decrypted, encrypted)); + TEST_ASSERT_EQUAL_MEMORY(expected_shared, crypto->shared_key, 8); + // The extraNonce is random, so skip checking the nonce and encrypted output here + + // Copy the nonce to check it after encryption + memcpy(expected_nonce, crypto->nonce, 16); + + // Decrypt the re-encrypted bytes and check they are the same as what we expect + TEST_ASSERT(crypto->decryptCurve25519(fromNode, public_key, packetNum, 22, encrypted, decrypted)); + TEST_ASSERT_EQUAL_MEMORY(expected_shared, crypto->shared_key, 8); + TEST_ASSERT_EQUAL_MEMORY(expected_nonce, crypto->nonce, 13); TEST_ASSERT_EQUAL_MEMORY(expected_decrypted, decrypted, 10); } @@ -178,7 +191,7 @@ void setup() RUN_TEST(test_ECB_AES256); RUN_TEST(test_DH25519); RUN_TEST(test_AES_CTR); - RUN_TEST(test_PKC_Decrypt); + RUN_TEST(test_PKC); exit(UNITY_END()); // stop unit testing } From 749410617007319e995f5014329bc5f2c31e8a9e Mon Sep 17 00:00:00 2001 From: Nasimovy Date: Thu, 3 Apr 2025 19:18:18 +0000 Subject: [PATCH 019/461] TCA8418 initial config + basic 3x4 keypad config (#6422) * TCA8418 with base config for 3x4 keypad * replaced k with uppercase K * change detection method * reflect changes #6381 --------- Co-authored-by: Ben Meadors --- src/configuration.h | 1 + src/detect/ScanI2C.cpp | 4 +- src/detect/ScanI2C.h | 3 +- src/detect/ScanI2CTwoWire.cpp | 20 +- src/input/TCA8418Keyboard.cpp | 561 ++++++++++++++++++++++++++++++++++ src/input/TCA8418Keyboard.h | 83 +++++ src/input/cardKbI2cImpl.cpp | 8 +- src/input/kbI2cBase.cpp | 68 +++++ src/input/kbI2cBase.h | 2 + src/main.cpp | 4 + 10 files changed, 742 insertions(+), 12 deletions(-) create mode 100644 src/input/TCA8418Keyboard.cpp create mode 100644 src/input/TCA8418Keyboard.h diff --git a/src/configuration.h b/src/configuration.h index ba6066896..d319ddb0a 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -152,6 +152,7 @@ along with this program. If not, see . #define MLX90614_ADDR_DEF 0x5A #define CGRADSENS_ADDR 0x66 #define LTR390UV_ADDR 0x53 +#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34 // same adress as TCA8418 // ----------------------------------------------------------------------------- // ACCELEROMETER diff --git a/src/detect/ScanI2C.cpp b/src/detect/ScanI2C.cpp index b88843a78..5bd5c0d12 100644 --- a/src/detect/ScanI2C.cpp +++ b/src/detect/ScanI2C.cpp @@ -31,8 +31,8 @@ ScanI2C::FoundDevice ScanI2C::firstRTC() const ScanI2C::FoundDevice ScanI2C::firstKeyboard() const { - ScanI2C::DeviceType types[] = {CARDKB, TDECKKB, BBQ10KB, RAK14004, MPR121KB}; - return firstOfOrNONE(5, types); + ScanI2C::DeviceType types[] = {CARDKB, TDECKKB, BBQ10KB, RAK14004, MPR121KB, TCA8418KB}; + return firstOfOrNONE(6, types); } ScanI2C::FoundDevice ScanI2C::firstAccelerometer() const diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index cfa3ea9cd..c363db1b5 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -18,7 +18,7 @@ class ScanI2C TDECKKB, BBQ10KB, RAK14004, - PMU_AXP192_AXP2101, + PMU_AXP192_AXP2101, // has the same adress as the TCA8418KB BME_680, BME_280, BMP_280, @@ -70,6 +70,7 @@ class ScanI2C DFROBOT_RAIN, DPS310, LTR390UV, + TCA8418KB, } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 82fcda480..230271b94 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -10,11 +10,6 @@ #include "meshUtils.h" // vformat #endif -// AXP192 and AXP2101 have the same device address, we just need to identify it in Power.cpp -#ifndef XPOWERS_AXP192_AXP2101_ADDRESS -#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34 -#endif - bool in_array(uint8_t *array, int size, uint8_t lookfor) { int i; @@ -221,8 +216,19 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) #ifdef HAS_LP5562 SCAN_SIMPLE_CASE(LP5562_ADDR, LP5562, "LP5562", (uint8_t)addr.address); #endif -#ifdef HAS_PMU - SCAN_SIMPLE_CASE(XPOWERS_AXP192_AXP2101_ADDRESS, PMU_AXP192_AXP2101, "AXP192/AXP2101", (uint8_t)addr.address) + case XPOWERS_AXP192_AXP2101_ADDRESS: + // Do we have the axp2101/192 or the TCA8418 + registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x90), 1); + if (registerValue == 0x0) { + logFoundDevice("TCA8418", (uint8_t)addr.address); + type = TCA8418KB; + } else { + logFoundDevice("AXP192/AXP2101", (uint8_t)addr.address); + type = PMU_AXP192_AXP2101; + } + break; +#ifdef HAS_LP5562 + SCAN_SIMPLE_CASE(LP5562_ADDR, LP5562, "LP5562", (uint8_t)addr.address); #endif case BME_ADDR: case BME_ADDR_ALTERNATE: diff --git a/src/input/TCA8418Keyboard.cpp b/src/input/TCA8418Keyboard.cpp new file mode 100644 index 000000000..21cd7b2d5 --- /dev/null +++ b/src/input/TCA8418Keyboard.cpp @@ -0,0 +1,561 @@ +// Based on the MPR121 Keyboard and Adafruit TCA8418 library + +#include "TCA8418Keyboard.h" +#include "configuration.h" + +#include + +// REGISTERS +// #define _TCA8418_REG_RESERVED 0x00 +#define _TCA8418_REG_CFG 0x01 // Configuration register +#define _TCA8418_REG_INT_STAT 0x02 // Interrupt status +#define _TCA8418_REG_KEY_LCK_EC 0x03 // Key lock and event counter +#define _TCA8418_REG_KEY_EVENT_A 0x04 // Key event register A +#define _TCA8418_REG_KEY_EVENT_B 0x05 // Key event register B +#define _TCA8418_REG_KEY_EVENT_C 0x06 // Key event register C +#define _TCA8418_REG_KEY_EVENT_D 0x07 // Key event register D +#define _TCA8418_REG_KEY_EVENT_E 0x08 // Key event register E +#define _TCA8418_REG_KEY_EVENT_F 0x09 // Key event register F +#define _TCA8418_REG_KEY_EVENT_G 0x0A // Key event register G +#define _TCA8418_REG_KEY_EVENT_H 0x0B // Key event register H +#define _TCA8418_REG_KEY_EVENT_I 0x0C // Key event register I +#define _TCA8418_REG_KEY_EVENT_J 0x0D // Key event register J +#define _TCA8418_REG_KP_LCK_TIMER 0x0E // Keypad lock1 to lock2 timer +#define _TCA8418_REG_UNLOCK_1 0x0F // Unlock register 1 +#define _TCA8418_REG_UNLOCK_2 0x10 // Unlock register 2 +#define _TCA8418_REG_GPIO_INT_STAT_1 0x11 // GPIO interrupt status 1 +#define _TCA8418_REG_GPIO_INT_STAT_2 0x12 // GPIO interrupt status 2 +#define _TCA8418_REG_GPIO_INT_STAT_3 0x13 // GPIO interrupt status 3 +#define _TCA8418_REG_GPIO_DAT_STAT_1 0x14 // GPIO data status 1 +#define _TCA8418_REG_GPIO_DAT_STAT_2 0x15 // GPIO data status 2 +#define _TCA8418_REG_GPIO_DAT_STAT_3 0x16 // GPIO data status 3 +#define _TCA8418_REG_GPIO_DAT_OUT_1 0x17 // GPIO data out 1 +#define _TCA8418_REG_GPIO_DAT_OUT_2 0x18 // GPIO data out 2 +#define _TCA8418_REG_GPIO_DAT_OUT_3 0x19 // GPIO data out 3 +#define _TCA8418_REG_GPIO_INT_EN_1 0x1A // GPIO interrupt enable 1 +#define _TCA8418_REG_GPIO_INT_EN_2 0x1B // GPIO interrupt enable 2 +#define _TCA8418_REG_GPIO_INT_EN_3 0x1C // GPIO interrupt enable 3 +#define _TCA8418_REG_KP_GPIO_1 0x1D // Keypad/GPIO select 1 +#define _TCA8418_REG_KP_GPIO_2 0x1E // Keypad/GPIO select 2 +#define _TCA8418_REG_KP_GPIO_3 0x1F // Keypad/GPIO select 3 +#define _TCA8418_REG_GPI_EM_1 0x20 // GPI event mode 1 +#define _TCA8418_REG_GPI_EM_2 0x21 // GPI event mode 2 +#define _TCA8418_REG_GPI_EM_3 0x22 // GPI event mode 3 +#define _TCA8418_REG_GPIO_DIR_1 0x23 // GPIO data direction 1 +#define _TCA8418_REG_GPIO_DIR_2 0x24 // GPIO data direction 2 +#define _TCA8418_REG_GPIO_DIR_3 0x25 // GPIO data direction 3 +#define _TCA8418_REG_GPIO_INT_LVL_1 0x26 // GPIO edge/level detect 1 +#define _TCA8418_REG_GPIO_INT_LVL_2 0x27 // GPIO edge/level detect 2 +#define _TCA8418_REG_GPIO_INT_LVL_3 0x28 // GPIO edge/level detect 3 +#define _TCA8418_REG_DEBOUNCE_DIS_1 0x29 // Debounce disable 1 +#define _TCA8418_REG_DEBOUNCE_DIS_2 0x2A // Debounce disable 2 +#define _TCA8418_REG_DEBOUNCE_DIS_3 0x2B // Debounce disable 3 +#define _TCA8418_REG_GPIO_PULL_1 0x2C // GPIO pull-up disable 1 +#define _TCA8418_REG_GPIO_PULL_2 0x2D // GPIO pull-up disable 2 +#define _TCA8418_REG_GPIO_PULL_3 0x2E // GPIO pull-up disable 3 +// #define _TCA8418_REG_RESERVED 0x2F + +// FIELDS CONFIG REGISTER 1 +#define _TCA8418_REG_CFG_AI 0x80 // Auto-increment for read/write +#define _TCA8418_REG_CFG_GPI_E_CGF 0x40 // Event mode config +#define _TCA8418_REG_CFG_OVR_FLOW_M 0x20 // Overflow mode enable +#define _TCA8418_REG_CFG_INT_CFG 0x10 // Interrupt config +#define _TCA8418_REG_CFG_OVR_FLOW_IEN 0x08 // Overflow interrupt enable +#define _TCA8418_REG_CFG_K_LCK_IEN 0x04 // Keypad lock interrupt enable +#define _TCA8418_REG_CFG_GPI_IEN 0x02 // GPI interrupt enable +#define _TCA8418_REG_CFG_KE_IEN 0x01 // Key events interrupt enable + +// FIELDS INT_STAT REGISTER 2 +#define _TCA8418_REG_STAT_CAD_INT 0x10 // Ctrl-alt-del seq status +#define _TCA8418_REG_STAT_OVR_FLOW_INT 0x08 // Overflow interrupt status +#define _TCA8418_REG_STAT_K_LCK_INT 0x04 // Key lock interrupt status +#define _TCA8418_REG_STAT_GPI_INT 0x02 // GPI interrupt status +#define _TCA8418_REG_STAT_K_INT 0x01 // Key events interrupt status + +// FIELDS KEY_LCK_EC REGISTER 3 +#define _TCA8418_REG_LCK_EC_K_LCK_EN 0x40 // Key lock enable +#define _TCA8418_REG_LCK_EC_LCK_2 0x20 // Keypad lock status 2 +#define _TCA8418_REG_LCK_EC_LCK_1 0x10 // Keypad lock status 1 +#define _TCA8418_REG_LCK_EC_KLEC_3 0x08 // Key event count bit 3 +#define _TCA8418_REG_LCK_EC_KLEC_2 0x04 // Key event count bit 2 +#define _TCA8418_REG_LCK_EC_KLEC_1 0x02 // Key event count bit 1 +#define _TCA8418_REG_LCK_EC_KLEC_0 0x01 // Key event count bit 0 + +// Pin IDs for matrix rows/columns +enum { + _TCA8418_ROW0, // Pin ID for row 0 + _TCA8418_ROW1, // Pin ID for row 1 + _TCA8418_ROW2, // Pin ID for row 2 + _TCA8418_ROW3, // Pin ID for row 3 + _TCA8418_ROW4, // Pin ID for row 4 + _TCA8418_ROW5, // Pin ID for row 5 + _TCA8418_ROW6, // Pin ID for row 6 + _TCA8418_ROW7, // Pin ID for row 7 + _TCA8418_COL0, // Pin ID for column 0 + _TCA8418_COL1, // Pin ID for column 1 + _TCA8418_COL2, // Pin ID for column 2 + _TCA8418_COL3, // Pin ID for column 3 + _TCA8418_COL4, // Pin ID for column 4 + _TCA8418_COL5, // Pin ID for column 5 + _TCA8418_COL6, // Pin ID for column 6 + _TCA8418_COL7, // Pin ID for column 7 + _TCA8418_COL8, // Pin ID for column 8 + _TCA8418_COL9 // Pin ID for column 9 +}; + +#define _TCA8418_COLS 3 +#define _TCA8418_ROWS 4 +#define _TCA8418_NUM_KEYS 12 + +uint8_t TCA8418TapMod[_TCA8418_NUM_KEYS] = {13, 7, 7, 7, 7, 7, + 9, 7, 9, 2, 2, 2}; // Num chars per key, Modulus for rotating through characters + +unsigned char TCA8418TapMap[_TCA8418_NUM_KEYS][13] = { + {'1', '.', ',', '?', '!', ':', ';', '-', '_', '\\', '/', '(', ')'}, // 1 + {'2', 'a', 'b', 'c', 'A', 'B', 'C'}, // 2 + {'3', 'd', 'e', 'f', 'D', 'E', 'F'}, // 3 + {'4', 'g', 'h', 'i', 'G', 'H', 'I'}, // 4 + {'5', 'j', 'k', 'l', 'J', 'K', 'L'}, // 5 + {'6', 'm', 'n', 'o', 'M', 'N', 'O'}, // 6 + {'7', 'p', 'q', 'r', 's', 'P', 'Q', 'R', 'S'}, // 7 + {'8', 't', 'u', 'v', 'T', 'U', 'V'}, // 8 + {'9', 'w', 'x', 'y', 'z', 'W', 'X', 'Y', 'Z'}, // 9 + {'*', '+'}, // * + {'0', ' '}, // 0 + {'#', '@'}, // # +}; + +unsigned char TCA8418LongPressMap[_TCA8418_NUM_KEYS] = { + _TCA8418_ESC, // 1 + _TCA8418_UP, // 2 + _TCA8418_NONE, // 3 + _TCA8418_LEFT, // 4 + _TCA8418_NONE, // 5 + _TCA8418_RIGHT, // 6 + _TCA8418_NONE, // 7 + _TCA8418_DOWN, // 8 + _TCA8418_NONE, // 9 + _TCA8418_BSP, // * + _TCA8418_NONE, // 0 + _TCA8418_NONE, // # +}; + +#define _TCA8418_LONG_PRESS_THRESHOLD 2000 +#define _TCA8418_MULTI_TAP_THRESHOLD 750 + +TCA8418Keyboard::TCA8418Keyboard() : m_wire(nullptr), m_addr(0), readCallback(nullptr), writeCallback(nullptr) +{ + state = Init; + last_key = -1; + next_key = -1; + should_backspace = false; + last_tap = 0L; + char_idx = 0; + tap_interval = 0; + backlight_on = true; + queue = ""; +} + +void TCA8418Keyboard::begin(uint8_t addr, TwoWire *wire) +{ + m_addr = addr; + m_wire = wire; + + m_wire->begin(); + + reset(); +} + +void TCA8418Keyboard::begin(i2c_com_fptr_t r, i2c_com_fptr_t w, uint8_t addr) +{ + m_addr = addr; + m_wire = nullptr; + writeCallback = w; + readCallback = r; + reset(); +} + +void TCA8418Keyboard::reset() +{ + LOG_DEBUG("TCA8418 Reset"); + // GPIO + // set default all GIO pins to INPUT + writeRegister(_TCA8418_REG_GPIO_DIR_1, 0x00); + writeRegister(_TCA8418_REG_GPIO_DIR_2, 0x00); + // Set COL9 as GPIO output + writeRegister(_TCA8418_REG_GPIO_DIR_3, 0x02); + // Switch off keyboard backlight (COL9 = LOW) + writeRegister(_TCA8418_REG_GPIO_DAT_OUT_3, 0x00); + + // add all pins to key events + writeRegister(_TCA8418_REG_GPI_EM_1, 0xFF); + writeRegister(_TCA8418_REG_GPI_EM_2, 0xFF); + writeRegister(_TCA8418_REG_GPI_EM_3, 0xFF); + + // set all pins to FALLING interrupts + writeRegister(_TCA8418_REG_GPIO_INT_LVL_1, 0x00); + writeRegister(_TCA8418_REG_GPIO_INT_LVL_2, 0x00); + writeRegister(_TCA8418_REG_GPIO_INT_LVL_3, 0x00); + + // add all pins to interrupts + writeRegister(_TCA8418_REG_GPIO_INT_EN_1, 0xFF); + writeRegister(_TCA8418_REG_GPIO_INT_EN_2, 0xFF); + writeRegister(_TCA8418_REG_GPIO_INT_EN_3, 0xFF); + + // Set keyboard matrix size + matrix(_TCA8418_ROWS, _TCA8418_COLS); + enableDebounce(); + flush(); + state = Idle; +} + +bool TCA8418Keyboard::matrix(uint8_t rows, uint8_t columns) +{ + if ((rows > 8) || (columns > 10)) + return false; + + // Skip zero size matrix + if ((rows != 0) && (columns != 0)) { + // Setup the keypad matrix. + uint8_t mask = 0x00; + for (int r = 0; r < rows; r++) { + mask <<= 1; + mask |= 1; + } + writeRegister(_TCA8418_REG_KP_GPIO_1, mask); + + mask = 0x00; + for (int c = 0; c < columns && c < 8; c++) { + mask <<= 1; + mask |= 1; + } + writeRegister(_TCA8418_REG_KP_GPIO_2, mask); + + if (columns > 8) { + if (columns == 9) + mask = 0x01; + else + mask = 0x03; + writeRegister(_TCA8418_REG_KP_GPIO_3, mask); + } + } + + return true; +} + +uint8_t TCA8418Keyboard::keyCount() const +{ + uint8_t eventCount = readRegister(_TCA8418_REG_KEY_LCK_EC); + eventCount &= 0x0F; // lower 4 bits only + return eventCount; +} + +bool TCA8418Keyboard::hasEvent() +{ + return queue.length() > 0; +} + +void TCA8418Keyboard::queueEvent(char next) +{ + if (next == _TCA8418_NONE) { + return; + } + queue.concat(next); +} + +char TCA8418Keyboard::dequeueEvent() +{ + if (queue.length() < 1) { + return _TCA8418_NONE; + } + char next = queue.charAt(0); + queue.remove(0, 1); + return next; +} + +void TCA8418Keyboard::trigger() +{ + if (keyCount() == 0) { + return; + } + if (state != Init) { + // Read the key register + uint8_t k = readRegister(_TCA8418_REG_KEY_EVENT_A); + uint8_t key = k & 0x7F; + if (k & 0x80) { + if (state == Idle) + pressed(key); + return; + } else { + if (state == Held) { + released(); + } + state = Idle; + return; + } + } else { + reset(); + } +} + +void TCA8418Keyboard::pressed(uint8_t key) +{ + if (state == Init || state == Busy) { + return; + } + uint8_t next_key = 0; + int row = (key - 1) / 10; + int col = (key - 1) % 10; + + if (row >= _TCA8418_ROWS || col >= _TCA8418_COLS) { + return; // Invalid key + } + + // Compute key index based on dynamic row/column + next_key = row * _TCA8418_COLS + col; + + // LOG_DEBUG("TCA8418: Key %u -> Next Key %u", key, next_key); + + state = Held; + uint32_t now = millis(); + tap_interval = now - last_tap; + if (tap_interval < 0) { + // Long running, millis has overflowed. + last_tap = 0; + state = Busy; + return; + } + + // Check if the key is the same as the last one or if the time interval has passed + if (next_key != last_key || tap_interval > _TCA8418_MULTI_TAP_THRESHOLD) { + char_idx = 0; // Reset char index if new key or long press + should_backspace = false; // dont backspace on new key + } else { + char_idx += 1; // Cycle through characters if same key pressed + should_backspace = true; // allow backspace on same key + } + + // Store the current key as the last key + last_key = next_key; + last_tap = now; +} + +void TCA8418Keyboard::released() +{ + if (state != Held) { + return; + } + + if (last_key < 0 || last_key > _TCA8418_NUM_KEYS) { // reset to idle if last_key out of bounds + last_key = -1; + state = Idle; + return; + } + uint32_t now = millis(); + int32_t held_interval = now - last_tap; + last_tap = now; + if (tap_interval < _TCA8418_MULTI_TAP_THRESHOLD && should_backspace) { + queueEvent(_TCA8418_BSP); + } + if (held_interval > _TCA8418_LONG_PRESS_THRESHOLD) { + queueEvent(TCA8418LongPressMap[last_key]); + // LOG_DEBUG("Long Press Key: %i Map: %i", last_key, TCA8418LongPressMap[last_key]); + } else { + queueEvent(TCA8418TapMap[last_key][(char_idx % TCA8418TapMod[last_key])]); + // LOG_DEBUG("Key Press: %i Index:%i if %i Map: %c", last_key, char_idx, TCA8418TapMod[last_key], + // TCA8418TapMap[last_key][(char_idx % TCA8418TapMod[last_key])]); + } +} + +uint8_t TCA8418Keyboard::flush() +{ + // Flush key events + uint8_t count = 0; + while (readRegister(_TCA8418_REG_KEY_EVENT_A) != 0) + count++; + // Flush gpio events + readRegister(_TCA8418_REG_GPIO_INT_STAT_1); + readRegister(_TCA8418_REG_GPIO_INT_STAT_2); + readRegister(_TCA8418_REG_GPIO_INT_STAT_3); + // Clear INT_STAT register + writeRegister(_TCA8418_REG_INT_STAT, 3); + return count; +} + +uint8_t TCA8418Keyboard::digitalRead(uint8_t pinnum) const +{ + if (pinnum > _TCA8418_COL9) + return 0xFF; + + uint8_t reg = _TCA8418_REG_GPIO_DAT_STAT_1 + pinnum / 8; + uint8_t mask = (1 << (pinnum % 8)); + + // Level 0 = low other = high + uint8_t value = readRegister(reg); + if (value & mask) + return HIGH; + return LOW; +} + +bool TCA8418Keyboard::digitalWrite(uint8_t pinnum, uint8_t level) +{ + if (pinnum > _TCA8418_COL9) + return false; + + uint8_t reg = _TCA8418_REG_GPIO_DAT_OUT_1 + pinnum / 8; + uint8_t mask = (1 << (pinnum % 8)); + + // Level 0 = low other = high + uint8_t value = readRegister(reg); + if (level == LOW) + value &= ~mask; + else + value |= mask; + writeRegister(reg, value); + return true; +} + +bool TCA8418Keyboard::pinMode(uint8_t pinnum, uint8_t mode) +{ + if (pinnum > _TCA8418_COL9) + return false; + + uint8_t idx = pinnum / 8; + uint8_t reg = _TCA8418_REG_GPIO_DIR_1 + idx; + uint8_t mask = (1 << (pinnum % 8)); + + // Mode 0 = input 1 = output + uint8_t value = readRegister(reg); + if (mode == OUTPUT) + value |= mask; + else + value &= ~mask; + writeRegister(reg, value); + + // Pullup 0 = enabled 1 = disabled + reg = _TCA8418_REG_GPIO_PULL_1 + idx; + value = readRegister(reg); + if (mode == INPUT_PULLUP) + value &= ~mask; + else + value |= mask; + writeRegister(reg, value); + + return true; +} + +bool TCA8418Keyboard::pinIRQMode(uint8_t pinnum, uint8_t mode) +{ + if (pinnum > _TCA8418_COL9) + return false; + if ((mode != RISING) && (mode != FALLING)) + return false; + + // Mode 0 = falling 1 = rising + uint8_t idx = pinnum / 8; + uint8_t reg = _TCA8418_REG_GPIO_INT_LVL_1 + idx; + uint8_t mask = (1 << (pinnum % 8)); + + uint8_t value = readRegister(reg); + if (mode == RISING) + value |= mask; + else + value &= ~mask; + writeRegister(reg, value); + + // Enable interrupt + reg = _TCA8418_REG_GPIO_INT_EN_1 + idx; + value = readRegister(reg); + value |= mask; + writeRegister(reg, value); + + return true; +} + +void TCA8418Keyboard::enableInterrupts() +{ + uint8_t value = readRegister(_TCA8418_REG_CFG); + value |= (_TCA8418_REG_CFG_GPI_IEN | _TCA8418_REG_CFG_KE_IEN); + writeRegister(_TCA8418_REG_CFG, value); +}; + +void TCA8418Keyboard::disableInterrupts() +{ + uint8_t value = readRegister(_TCA8418_REG_CFG); + value &= ~(_TCA8418_REG_CFG_GPI_IEN | _TCA8418_REG_CFG_KE_IEN); + writeRegister(_TCA8418_REG_CFG, value); +}; + +void TCA8418Keyboard::enableMatrixOverflow() +{ + uint8_t value = readRegister(_TCA8418_REG_CFG); + value |= _TCA8418_REG_CFG_OVR_FLOW_M; + writeRegister(_TCA8418_REG_CFG, value); +}; + +void TCA8418Keyboard::disableMatrixOverflow() +{ + uint8_t value = readRegister(_TCA8418_REG_CFG); + value &= ~_TCA8418_REG_CFG_OVR_FLOW_M; + writeRegister(_TCA8418_REG_CFG, value); +}; + +void TCA8418Keyboard::enableDebounce() +{ + writeRegister(_TCA8418_REG_DEBOUNCE_DIS_1, 0x00); + writeRegister(_TCA8418_REG_DEBOUNCE_DIS_2, 0x00); + writeRegister(_TCA8418_REG_DEBOUNCE_DIS_3, 0x00); +} + +void TCA8418Keyboard::disableDebounce() +{ + writeRegister(_TCA8418_REG_DEBOUNCE_DIS_1, 0xFF); + writeRegister(_TCA8418_REG_DEBOUNCE_DIS_2, 0xFF); + writeRegister(_TCA8418_REG_DEBOUNCE_DIS_3, 0xFF); +} + +void TCA8418Keyboard::setBacklight(bool on) +{ + if (on) { + digitalWrite(_TCA8418_COL9, HIGH); + } else { + digitalWrite(_TCA8418_COL9, LOW); + } +} + +uint8_t TCA8418Keyboard::readRegister(uint8_t reg) const +{ + if (m_wire) { + m_wire->beginTransmission(m_addr); + m_wire->write(reg); + m_wire->endTransmission(); + + m_wire->requestFrom(m_addr, (uint8_t)1); + if (m_wire->available() < 1) + return 0; + + return m_wire->read(); + } + if (readCallback) { + uint8_t data; + readCallback(m_addr, reg, &data, 1); + return data; + } + return 0; +} + +void TCA8418Keyboard::writeRegister(uint8_t reg, uint8_t value) +{ + uint8_t data[2]; + data[0] = reg; + data[1] = value; + + if (m_wire) { + m_wire->beginTransmission(m_addr); + m_wire->write(data, sizeof(uint8_t) * 2); + m_wire->endTransmission(); + } + if (writeCallback) { + writeCallback(m_addr, data[0], &(data[1]), 1); + } +} \ No newline at end of file diff --git a/src/input/TCA8418Keyboard.h b/src/input/TCA8418Keyboard.h new file mode 100644 index 000000000..c7f3c1f28 --- /dev/null +++ b/src/input/TCA8418Keyboard.h @@ -0,0 +1,83 @@ +// Based on the MPR121 Keyboard and Adafruit TCA8418 library +#include "configuration.h" +#include + +#define _TCA8418_NONE 0x00 +#define _TCA8418_REBOOT 0x90 +#define _TCA8418_LEFT 0xb4 +#define _TCA8418_UP 0xb5 +#define _TCA8418_DOWN 0xb6 +#define _TCA8418_RIGHT 0xb7 +#define _TCA8418_ESC 0x1b +#define _TCA8418_BSP 0x08 +#define _TCA8418_SELECT 0x0d + +class TCA8418Keyboard +{ + public: + typedef uint8_t (*i2c_com_fptr_t)(uint8_t dev_addr, uint8_t reg_addr, uint8_t *data, uint8_t len); + + enum KeyState { Init = 0, Idle, Held, Busy }; + + KeyState state; + int8_t last_key; + int8_t next_key; + bool should_backspace; + uint32_t last_tap; + uint8_t char_idx; + int32_t tap_interval; + bool backlight_on; + + String queue; + + TCA8418Keyboard(); + + void begin(uint8_t addr = XPOWERS_AXP192_AXP2101_ADDRESS, TwoWire *wire = &Wire); + void begin(i2c_com_fptr_t r, i2c_com_fptr_t w, uint8_t addr = XPOWERS_AXP192_AXP2101_ADDRESS); + + void reset(void); + // Configure the size of the keypad. + // All other rows and columns are set as inputs. + bool matrix(uint8_t rows, uint8_t columns); + + // Flush all events in the FIFO buffer + GPIO events. + uint8_t flush(void); + + // Key events available in the internal FIFO buffer. + uint8_t keyCount(void) const; + + void trigger(void); + void pressed(uint8_t key); + void released(void); + bool hasEvent(void); + char dequeueEvent(void); + void queueEvent(char); + + uint8_t digitalRead(uint8_t pinnum) const; + bool digitalWrite(uint8_t pinnum, uint8_t level); + bool pinMode(uint8_t pinnum, uint8_t mode); + bool pinIRQMode(uint8_t pinnum, uint8_t mode); // MODE FALLING or RISING + + // enable / disable interrupts for matrix and GPI pins + void enableInterrupts(); + void disableInterrupts(); + + // ignore key events when FIFO buffer is full or not. + void enableMatrixOverflow(); + void disableMatrixOverflow(); + + // debounce keys. + void enableDebounce(); + void disableDebounce(); + + void setBacklight(bool on); + + uint8_t readRegister(uint8_t reg) const; + void writeRegister(uint8_t reg, uint8_t value); + + private: + TwoWire *m_wire; + uint8_t m_addr; + i2c_com_fptr_t readCallback; + i2c_com_fptr_t writeCallback; +}; diff --git a/src/input/cardKbI2cImpl.cpp b/src/input/cardKbI2cImpl.cpp index eb9b07d6e..21ecf381a 100644 --- a/src/input/cardKbI2cImpl.cpp +++ b/src/input/cardKbI2cImpl.cpp @@ -12,8 +12,8 @@ void CardKbI2cImpl::init() #if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_PORTDUINO) && !defined(I2C_NO_RESCAN) if (cardkb_found.address == 0x00) { LOG_DEBUG("Rescan for I2C keyboard"); - uint8_t i2caddr_scan[] = {CARDKB_ADDR, TDECK_KB_ADDR, BBQ10_KB_ADDR, MPR121_KB_ADDR}; - uint8_t i2caddr_asize = 4; + uint8_t i2caddr_scan[] = {CARDKB_ADDR, TDECK_KB_ADDR, BBQ10_KB_ADDR, MPR121_KB_ADDR, XPOWERS_AXP192_AXP2101_ADDRESS}; + uint8_t i2caddr_asize = 5; auto i2cScanner = std::unique_ptr(new ScanI2CTwoWire()); #if WIRE_INTERFACES_COUNT == 2 @@ -43,6 +43,10 @@ void CardKbI2cImpl::init() // assign an arbitrary value to distinguish from other models kb_model = 0x37; break; + case ScanI2C::DeviceType::TCA8418KB: + // assign an arbitrary value to distinguish from other models + kb_model = 0x84; + break; default: // use this as default since it's also just zero LOG_WARN("kb_info.type is unknown(0x%02x), setting kb_model=0x00", kb_info.type); diff --git a/src/input/kbI2cBase.cpp b/src/input/kbI2cBase.cpp index 9b1a27745..70e9e4365 100644 --- a/src/input/kbI2cBase.cpp +++ b/src/input/kbI2cBase.cpp @@ -43,6 +43,9 @@ int32_t KbI2cBase::runOnce() if (cardkb_found.address == MPR121_KB_ADDR) { MPRkeyboard.begin(MPR121_KB_ADDR, &Wire1); } + if (cardkb_found.address == XPOWERS_AXP192_AXP2101_ADDRESS) { + TCAKeyboard.begin(XPOWERS_AXP192_AXP2101_ADDRESS, &Wire1); + } break; #endif case ScanI2C::WIRE: @@ -55,6 +58,9 @@ int32_t KbI2cBase::runOnce() if (cardkb_found.address == MPR121_KB_ADDR) { MPRkeyboard.begin(MPR121_KB_ADDR, &Wire); } + if (cardkb_found.address == XPOWERS_AXP192_AXP2101_ADDRESS) { + TCAKeyboard.begin(XPOWERS_AXP192_AXP2101_ADDRESS, &Wire); + } break; case ScanI2C::NO_I2C: default: @@ -226,6 +232,68 @@ int32_t KbI2cBase::runOnce() } break; } + case 0x84: { // Adafruit TCA8418 + TCAKeyboard.trigger(); + InputEvent e; + while (TCAKeyboard.hasEvent()) { + char nextEvent = TCAKeyboard.dequeueEvent(); + e.inputEvent = ANYKEY; + e.kbchar = 0x00; + e.source = this->_originName; + switch (nextEvent) { + case _TCA8418_NONE: + e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.kbchar = 0x00; + break; + case _TCA8418_REBOOT: + e.inputEvent = ANYKEY; + e.kbchar = INPUT_BROKER_MSG_REBOOT; + break; + case _TCA8418_LEFT: + e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT; + e.kbchar = 0x00; + break; + case _TCA8418_UP: + e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP; + e.kbchar = 0x00; + break; + case _TCA8418_DOWN: + e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN; + e.kbchar = 0x00; + break; + case _TCA8418_RIGHT: + e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT; + e.kbchar = 0x00; + break; + case _TCA8418_BSP: + e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK; + e.kbchar = 0x08; + break; + case _TCA8418_SELECT: + e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT; + e.kbchar = 0x0d; + break; + case _TCA8418_ESC: + e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL; + e.kbchar = 0x1b; + break; + default: + if (nextEvent > 127) { + e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.kbchar = 0x00; + break; + } + e.inputEvent = ANYKEY; + e.kbchar = nextEvent; + break; + } + if (e.inputEvent != meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE) { + LOG_DEBUG("TCA8418 Notifying: %i Char: %c", e.inputEvent, e.kbchar); + this->notifyObservers(&e); + } + } + break; + } case 0x02: { // RAK14004 uint8_t rDataBuf[8] = {0}; diff --git a/src/input/kbI2cBase.h b/src/input/kbI2cBase.h index dc2414fc0..8193433fe 100644 --- a/src/input/kbI2cBase.h +++ b/src/input/kbI2cBase.h @@ -3,6 +3,7 @@ #include "BBQ10Keyboard.h" #include "InputBroker.h" #include "MPR121Keyboard.h" +#include "TCA8418Keyboard.h" #include "Wire.h" #include "concurrency/OSThread.h" @@ -21,5 +22,6 @@ class KbI2cBase : public Observable, public concurrency::OST BBQ10Keyboard Q10keyboard; MPR121Keyboard MPRkeyboard; + TCA8418Keyboard TCAKeyboard; bool is_sym = false; }; \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 4b098b3f3..fd65830ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -587,6 +587,10 @@ void setup() // assign an arbitrary value to distinguish from other models kb_model = 0x37; break; + case ScanI2C::DeviceType::TCA8418KB: + // assign an arbitrary value to distinguish from other models + kb_model = 0x84; + break; default: // use this as default since it's also just zero LOG_WARN("kb_info.type is unknown(0x%02x), setting kb_model=0x00", kb_info.type); From 4dfba503044d7d77bdd40f151aa95e6df80cb8bb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 20:23:44 -0500 Subject: [PATCH 020/461] [create-pull-request] automated change (#6490) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/protobufs b/protobufs index 484d002a5..13a3e5dce 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 484d002a52bc20fa9f91ebf1b216d585c5f93a1b +Subproject commit 13a3e5dcee25a2d2d4f1fbaba4c091c66d698ca5 diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index defaaad28..191f9e121 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -237,6 +237,8 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_T_ETH_ELITE = 91, /* Heltec HRI-3621 industrial probe */ meshtastic_HardwareModel_HELTEC_SENSOR_HUB = 92, + /* Reserved Fried Chicken ID for future use */ + meshtastic_HardwareModel_RESERVED_FRIED_CHICKEN = 93, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ From 01102754945ac2bc8d52062fcb2b4a446ea35b35 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 4 Apr 2025 04:59:31 -0500 Subject: [PATCH 021/461] Revert "Try-fix ESP32 wifi disconnects (#6363)" (#6493) This reverts commit a902776e578bc2574c95eff8c13402e8cb5f5fbd. --- src/mesh/wifi/WiFiAPClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/wifi/WiFiAPClient.cpp b/src/mesh/wifi/WiFiAPClient.cpp index e050c2057..4d0b74f7c 100644 --- a/src/mesh/wifi/WiFiAPClient.cpp +++ b/src/mesh/wifi/WiFiAPClient.cpp @@ -163,7 +163,7 @@ static int32_t reconnectWiFi() delay(5000); if (!WiFi.isConnected()) { -#ifdef ARCH_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32C3 WiFi.mode(WIFI_MODE_NULL); WiFi.useStaticBuffers(true); WiFi.mode(WIFI_STA); From 25237a15ff68d482c16369b4b802a2931b733ab2 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Fri, 4 Apr 2025 23:53:54 +1300 Subject: [PATCH 022/461] feat: menu entry to send adhoc-ping (#6492) --- .../InkHUD/Applets/System/Menu/MenuAction.h | 3 +-- .../InkHUD/Applets/System/Menu/MenuApplet.cpp | 21 ++++++++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h index 4f8205647..f162aa385 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h +++ b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h @@ -18,8 +18,7 @@ namespace NicheGraphics::InkHUD enum MenuAction { NO_ACTION, - SEND_NODEINFO, - SEND_POSITION, + SEND_PING, SHUTDOWN, NEXT_TILE, TOGGLE_BACKLIGHT, diff --git a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp index f59579230..5ca9692c8 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp @@ -4,6 +4,7 @@ #include "RTC.h" +#include "MeshService.h" #include "airtime.h" #include "main.h" #include "power.h" @@ -144,6 +145,14 @@ void InkHUD::MenuApplet::execute(MenuItem item) inkhud->nextTile(); break; + case SEND_PING: + service->refreshLocalMeshNode(); + service->trySendPosition(NODENUM_BROADCAST, true); + + // Force the next refresh to use FULL, to protect the display, as some users will probably spam this button + inkhud->forceUpdate(Drivers::EInk::UpdateTypes::FULL); + break; + case ROTATE: inkhud->rotate(); break; @@ -242,7 +251,7 @@ void InkHUD::MenuApplet::showPage(MenuPage page) if (settings->optionalMenuItems.nextTile && settings->userTiles.count > 1) items.push_back(MenuItem("Next Tile", MenuAction::NEXT_TILE, MenuPage::ROOT)); // Only if multiple applets shown - // items.push_back(MenuItem("Send", MenuPage::SEND)); // TODO + items.push_back(MenuItem("Send", MenuPage::SEND)); items.push_back(MenuItem("Options", MenuPage::OPTIONS)); // items.push_back(MenuItem("Display Off", MenuPage::EXIT)); // TODO items.push_back(MenuItem("Save & Shut Down", MenuAction::SHUTDOWN)); @@ -250,9 +259,8 @@ void InkHUD::MenuApplet::showPage(MenuPage page) break; case SEND: - items.push_back(MenuItem("Send Message", MenuPage::EXIT)); - items.push_back(MenuItem("Send NodeInfo", MenuAction::SEND_NODEINFO)); - items.push_back(MenuItem("Send Position", MenuAction::SEND_POSITION)); + items.push_back(MenuItem("Ping", MenuAction::SEND_PING, MenuPage::EXIT)); + // Todo: canned messages items.push_back(MenuItem("Exit", MenuPage::EXIT)); break; @@ -389,11 +397,14 @@ void InkHUD::MenuApplet::onRender() // Center-line for the text int16_t center = itemT + (itemH / 2); + // Box, if currently selected if (cursorShown && i == cursor) drawRect(itemL, itemT, itemW, itemH, BLACK); + + // Item's text printAt(itemL + X(padding), center, item.label, LEFT, MIDDLE); - // Testing only: circle instead of check box + // Checkbox, if relevant if (item.checkState) { const uint16_t cbWH = fontSmall.lineHeight(); // Checkbox: width / height const int16_t cbL = itemR - X(padding) - cbWH; // Checkbox: left From 1b33189fe62d57b067b98facd84656531903457b Mon Sep 17 00:00:00 2001 From: Nasimovy Date: Fri, 4 Apr 2025 13:35:15 +0000 Subject: [PATCH 023/461] remove duplicate HAS_LP5562 introduced by #6422 (#6494) --- src/detect/ScanI2CTwoWire.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 230271b94..9781cbf56 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -227,9 +227,6 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) type = PMU_AXP192_AXP2101; } break; -#ifdef HAS_LP5562 - SCAN_SIMPLE_CASE(LP5562_ADDR, LP5562, "LP5562", (uint8_t)addr.address); -#endif case BME_ADDR: case BME_ADDR_ALTERNATE: registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xD0), 1); // GET_ID From 56eb0c08b288b5b549399a5f441f07c51bc8d459 Mon Sep 17 00:00:00 2001 From: Chris LaFlash Date: Sat, 5 Apr 2025 20:49:01 -0700 Subject: [PATCH 024/461] Add support for Quectel-L96, a MT3333 module (#6498) --- src/gps/GPS.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 41a2ff980..a2e7ebbc7 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -1206,7 +1206,8 @@ GnssModel_t GPS::probe(int serialSpeed) delay(20); std::vector mtk = {{"L76B", "Quectel-L76B", GNSS_MODEL_MTK_L76B}, {"PA1616S", "1616S", GNSS_MODEL_MTK_PA1616S}, - {"LS20031", "MC-1513", GNSS_MODEL_MTK_L76B}}; + {"LS20031", "MC-1513", GNSS_MODEL_MTK_L76B}, + {"L96", "Quectel-L96", GNSS_MODEL_MTK_L76B}}; PROBE_FAMILY("MTK Family", "$PMTK605*31", mtk, 500); uint8_t cfg_rate[] = {0xB5, 0x62, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00}; From 2125c039745aa06248b2e76819303a9c99c4de63 Mon Sep 17 00:00:00 2001 From: Nasimovy Date: Mon, 7 Apr 2025 01:27:46 +0000 Subject: [PATCH 025/461] Fix for PSRAM detection on ESP32-S3R8 and t-beam (#6504) * remove duplicate HAS_LP5562 introduced by #6422 * T190 PSRAM fix * all the boards with a ESP32-S3R8 * T-beam V1.1 PSRAM --- boards/heltec_vision_master_e213.json | 4 +++- boards/heltec_vision_master_e290.json | 4 +++- boards/heltec_vision_master_t190.json | 4 +++- boards/seeed-sensecap-indicator.json | 1 + boards/seeed-xiao-s3.json | 1 + boards/t-watch-s3.json | 1 + variants/tbeam/platformio.ini | 2 ++ 7 files changed, 14 insertions(+), 3 deletions(-) diff --git a/boards/heltec_vision_master_e213.json b/boards/heltec_vision_master_e213.json index bf5fe15ad..152515cf3 100644 --- a/boards/heltec_vision_master_e213.json +++ b/boards/heltec_vision_master_e213.json @@ -2,7 +2,8 @@ "build": { "arduino": { "ldscript": "esp32s3_out.ld", - "partitions": "default_8MB.csv" + "partitions": "default_8MB.csv", + "memory_type": "qio_opi" }, "core": "esp32", "extra_flags": [ @@ -15,6 +16,7 @@ "f_cpu": "240000000L", "f_flash": "80000000L", "flash_mode": "qio", + "psram_type": "opi", "hwids": [ ["0x303A", "0x1001"], ["0x303A", "0x0002"] diff --git a/boards/heltec_vision_master_e290.json b/boards/heltec_vision_master_e290.json index 70f7d5f02..b7cbac878 100644 --- a/boards/heltec_vision_master_e290.json +++ b/boards/heltec_vision_master_e290.json @@ -2,7 +2,8 @@ "build": { "arduino": { "ldscript": "esp32s3_out.ld", - "partitions": "default_8MB.csv" + "partitions": "default_8MB.csv", + "memory_type": "qio_opi" }, "core": "esp32", "extra_flags": [ @@ -15,6 +16,7 @@ "f_cpu": "240000000L", "f_flash": "80000000L", "flash_mode": "qio", + "psram_type": "opi", "hwids": [ ["0x303A", "0x1001"], ["0x303A", "0x0002"] diff --git a/boards/heltec_vision_master_t190.json b/boards/heltec_vision_master_t190.json index 341e70218..440f76ad0 100644 --- a/boards/heltec_vision_master_t190.json +++ b/boards/heltec_vision_master_t190.json @@ -2,7 +2,8 @@ "build": { "arduino": { "ldscript": "esp32s3_out.ld", - "partitions": "default_8MB.csv" + "partitions": "default_8MB.csv", + "memory_type": "qio_opi" }, "core": "esp32", "extra_flags": [ @@ -15,6 +16,7 @@ "f_cpu": "240000000L", "f_flash": "80000000L", "flash_mode": "qio", + "psram_type": "opi", "hwids": [ ["0x303A", "0x1001"], ["0x303A", "0x0002"] diff --git a/boards/seeed-sensecap-indicator.json b/boards/seeed-sensecap-indicator.json index 0a02fc882..03bff35b5 100644 --- a/boards/seeed-sensecap-indicator.json +++ b/boards/seeed-sensecap-indicator.json @@ -18,6 +18,7 @@ "f_boot": "120000000L", "boot": "qio", "flash_mode": "qio", + "psram_type": "opi", "hwids": [["0x1A86", "0x7523"]], "mcu": "esp32s3", "variant": "esp32s3" diff --git a/boards/seeed-xiao-s3.json b/boards/seeed-xiao-s3.json index 0b7b432a0..6981085dd 100644 --- a/boards/seeed-xiao-s3.json +++ b/boards/seeed-xiao-s3.json @@ -15,6 +15,7 @@ "f_cpu": "240000000L", "f_flash": "80000000L", "flash_mode": "qio", + "psram_type": "opi", "hwids": [["0x2886", "0x0059"]], "mcu": "esp32s3", "variant": "seeed-xiao-s3" diff --git a/boards/t-watch-s3.json b/boards/t-watch-s3.json index 5d4afd322..51bb7cf4b 100644 --- a/boards/t-watch-s3.json +++ b/boards/t-watch-s3.json @@ -16,6 +16,7 @@ "f_cpu": "240000000L", "f_flash": "80000000L", "flash_mode": "qio", + "psram_type": "opi", "hwids": [ ["0x303A", "0x1001"], ["0x303A", "0x0002"] diff --git a/variants/tbeam/platformio.ini b/variants/tbeam/platformio.ini index 85e66c2dd..9049836a3 100644 --- a/variants/tbeam/platformio.ini +++ b/variants/tbeam/platformio.ini @@ -8,4 +8,6 @@ lib_deps = build_flags = ${esp32_base.build_flags} -D TBEAM_V10 -I variants/tbeam -DGPS_POWER_TOGGLE ; comment this line to disable double press function on the user button to turn off gps entirely. + -DBOARD_HAS_PSRAM + -mfix-esp32-psram-cache-issue upload_speed = 921600 \ No newline at end of file From 5a9d70b445930dec9e7175831e79c66d2f203f84 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 10:39:45 +0200 Subject: [PATCH 026/461] Upgrade trunk (#6509) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index aeb0a1b43..608045e45 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,14 +9,14 @@ plugins: lint: enabled: - prettier@3.5.3 - - trufflehog@3.88.20 + - trufflehog@3.88.22 - yamllint@1.37.0 - bandit@1.8.3 - checkov@3.2.396 - terrascan@1.19.9 - trivy@0.61.0 - taplo@0.9.3 - - ruff@0.11.2 + - ruff@0.11.3 - isort@6.0.1 - markdownlint@0.44.0 - oxipng@9.1.4 From 860e8eca5aab7a4586891b3218420624f7b30c31 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 11:51:05 +0200 Subject: [PATCH 027/461] [create-pull-request] automated change (#6511) Co-authored-by: caveman99 <25002+caveman99@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/config.pb.h | 14 ++++++++------ src/mesh/generated/meshtastic/telemetry.pb.h | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/protobufs b/protobufs index 13a3e5dce..5a5ab103d 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 13a3e5dcee25a2d2d4f1fbaba4c091c66d698ca5 +Subproject commit 5a5ab103d2f6aa071fca29417475681a2cec5dcf diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index 848f8df86..edcd7b41c 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -180,14 +180,16 @@ typedef enum _meshtastic_Config_DisplayConfig_DisplayUnits { /* Override OLED outo detect with this if it fails. */ typedef enum _meshtastic_Config_DisplayConfig_OledType { - /* Default / Auto */ + /* Default / Autodetect */ meshtastic_Config_DisplayConfig_OledType_OLED_AUTO = 0, - /* Default / Auto */ + /* Default / Autodetect */ meshtastic_Config_DisplayConfig_OledType_OLED_SSD1306 = 1, - /* Default / Auto */ + /* Default / Autodetect */ meshtastic_Config_DisplayConfig_OledType_OLED_SH1106 = 2, /* Can not be auto detected but set by proto. Used for 128x128 screens */ - meshtastic_Config_DisplayConfig_OledType_OLED_SH1107 = 3 + meshtastic_Config_DisplayConfig_OledType_OLED_SH1107 = 3, + /* Can not be auto detected but set by proto. Used for 128x64 screens */ + meshtastic_Config_DisplayConfig_OledType_OLED_SH1107_128_64 = 4 } meshtastic_Config_DisplayConfig_OledType; typedef enum _meshtastic_Config_DisplayConfig_DisplayMode { @@ -639,8 +641,8 @@ extern "C" { #define _meshtastic_Config_DisplayConfig_DisplayUnits_ARRAYSIZE ((meshtastic_Config_DisplayConfig_DisplayUnits)(meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL+1)) #define _meshtastic_Config_DisplayConfig_OledType_MIN meshtastic_Config_DisplayConfig_OledType_OLED_AUTO -#define _meshtastic_Config_DisplayConfig_OledType_MAX meshtastic_Config_DisplayConfig_OledType_OLED_SH1107 -#define _meshtastic_Config_DisplayConfig_OledType_ARRAYSIZE ((meshtastic_Config_DisplayConfig_OledType)(meshtastic_Config_DisplayConfig_OledType_OLED_SH1107+1)) +#define _meshtastic_Config_DisplayConfig_OledType_MAX meshtastic_Config_DisplayConfig_OledType_OLED_SH1107_128_64 +#define _meshtastic_Config_DisplayConfig_OledType_ARRAYSIZE ((meshtastic_Config_DisplayConfig_OledType)(meshtastic_Config_DisplayConfig_OledType_OLED_SH1107_128_64+1)) #define _meshtastic_Config_DisplayConfig_DisplayMode_MIN meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT #define _meshtastic_Config_DisplayConfig_DisplayMode_MAX meshtastic_Config_DisplayConfig_DisplayMode_COLOR diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index 69cdd33fe..dcc511ea6 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -242,7 +242,7 @@ typedef struct _meshtastic_AirQualityMetrics { /* 10.0um Particle Count */ bool has_particles_100um; uint32_t particles_100um; - /* 10.0um Particle Count */ + /* CO2 concentration in ppm */ bool has_co2; uint32_t co2; } meshtastic_AirQualityMetrics; From 606abfc1165711f57b12ee0a022660082ec18f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 7 Apr 2025 12:46:22 +0200 Subject: [PATCH 028/461] Fix several features of M1 and M2 (i know what the 7 is now ...) (#6507) * Fix several features of M1 and M2 (i know what the 7 is now ...) * 'THe' should be 'The'. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * remove floating definition --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ben Meadors --- src/ButtonThread.cpp | 138 ++++++++++++------------ src/ButtonThread.h | 13 +-- src/Power.cpp | 29 +++-- src/gps/GPS.cpp | 46 ++++++++ src/graphics/Screen.cpp | 3 + src/main.cpp | 70 ++++++++++-- src/mesh/NodeDB.cpp | 9 ++ src/platform/esp32/main-esp32.cpp | 5 +- src/platform/nrf52/main-nrf52.cpp | 6 +- src/power.h | 5 - variants/ELECROW-ThinkNode-M1/variant.h | 10 +- variants/ELECROW-ThinkNode-M2/variant.h | 11 +- 12 files changed, 221 insertions(+), 124 deletions(-) diff --git a/src/ButtonThread.cpp b/src/ButtonThread.cpp index 2363f804c..375029c99 100644 --- a/src/ButtonThread.cpp +++ b/src/ButtonThread.cpp @@ -116,46 +116,55 @@ ButtonThread::ButtonThread() : OSThread("Button") #endif } +void ButtonThread::switchPage() +{ +#ifdef BUTTON_PIN +#if !defined(USERPREFS_BUTTON_PIN) + if (((config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN) != + moduleConfig.canned_message.inputbroker_pin_press) || + !(moduleConfig.canned_message.updown1_enabled || moduleConfig.canned_message.rotary1_enabled) || + !moduleConfig.canned_message.enabled) { + powerFSM.trigger(EVENT_PRESS); + } +#endif +#if defined(USERPREFS_BUTTON_PIN) + if (((config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN) != + moduleConfig.canned_message.inputbroker_pin_press) || + !(moduleConfig.canned_message.updown1_enabled || moduleConfig.canned_message.rotary1_enabled) || + !moduleConfig.canned_message.enabled) { + powerFSM.trigger(EVENT_PRESS); + } +#endif + +#endif +#if defined(ARCH_PORTDUINO) + if ((settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC) && + (settingsMap[user] != moduleConfig.canned_message.inputbroker_pin_press) || + !moduleConfig.canned_message.enabled) { + powerFSM.trigger(EVENT_PRESS); + } +#endif +} + +void ButtonThread::sendAdHocPosition() +{ + service->refreshLocalMeshNode(); + auto sentPosition = service->trySendPosition(NODENUM_BROADCAST, true); + if (screen) { + if (sentPosition) + screen->print("Sent ad-hoc position\n"); + else + screen->print("Sent ad-hoc nodeinfo\n"); + screen->forceDisplay(true); // Force a new UI frame, then force an EInk update + } +} + int32_t ButtonThread::runOnce() { // If the button is pressed we suppress CPU sleep until release canSleep = true; // Assume we should not keep the board awake #if defined(BUTTON_PIN) || defined(USERPREFS_BUTTON_PIN) - // #if defined(ELECROW_ThinkNode_M1) || defined(ELECROW_ThinkNode_M2) - // buzzer_updata(); - // if (buttonPressed) { - // buttonPressed = false; // 清除标志 - // LOG_INFO("PIN_BUTTON2 pressed!"); // 串口打印信息 - // // off_currentTime = millis(); - // while (digitalRead(PIN_BUTTON2) == HIGH) { - // if (cont < 40) { - // // unsigned long currentTime = millis(); // 获取当前时间 - // // if (currentTime - off_currentTime >= 1000) { - // cont++; - // // off_currentTime = currentTime; - // // } - // delay(100); - // } else { - - // currentState = OFF; - // isBuzzing = false; - // cont = 0; - // BEEP_STATE = false; - // analogWrite(M2_buzzer, 0); - // pinMode(M2_buzzer, INPUT); - // screen->setOn(false); - // cont = 0; - // LOG_INFO("GGGGGGGGGGGGGGGGGGGGGGGGG"); - // pinMode(1, OUTPUT); - // digitalWrite(1, LOW); - // pinMode(6, OUTPUT); - // digitalWrite(6, LOW); - // } - // } - // } - - // #endif userButton.tick(); canSleep &= userButton.isIdle(); #elif defined(ARCH_PORTDUINO) @@ -180,32 +189,27 @@ int32_t ButtonThread::runOnce() // If a nag notification is running, stop it and prevent other actions if (moduleConfig.external_notification.enabled && (externalNotificationModule->nagCycleCutoff != UINT32_MAX)) { externalNotificationModule->stopNow(); - return 50; - } -#ifdef BUTTON_PIN -#if !defined(USERPREFS_BUTTON_PIN) - if (((config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN) != -#endif -#if defined(USERPREFS_BUTTON_PIN) - if (((config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN) != -#endif - moduleConfig.canned_message.inputbroker_pin_press) || - !(moduleConfig.canned_message.updown1_enabled || moduleConfig.canned_message.rotary1_enabled) || - !moduleConfig.canned_message.enabled) { - powerFSM.trigger(EVENT_PRESS); - } -#endif -#if defined(ARCH_PORTDUINO) - if ((settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC) && - (settingsMap[user] != moduleConfig.canned_message.inputbroker_pin_press) || - !moduleConfig.canned_message.enabled) { - powerFSM.trigger(EVENT_PRESS); + break; } +#ifdef ELECROW_ThinkNode_M1 + sendAdHocPosition(); + break; #endif + switchPage(); break; } case BUTTON_EVENT_PRESSED_SCREEN: { + LOG_BUTTON("AltPress!"); +#ifdef ELECROW_ThinkNode_M1 + // If a nag notification is running, stop it and prevent other actions + if (moduleConfig.external_notification.enabled && (externalNotificationModule->nagCycleCutoff != UINT32_MAX)) { + externalNotificationModule->stopNow(); + break; + } + switchPage(); + break; +#endif // turn screen on or off screen_flag = !screen_flag; if (screen) @@ -215,22 +219,18 @@ int32_t ButtonThread::runOnce() case BUTTON_EVENT_DOUBLE_PRESSED: { LOG_BUTTON("Double press!"); - service->refreshLocalMeshNode(); - auto sentPosition = service->trySendPosition(NODENUM_BROADCAST, true); - if (screen) { - if (sentPosition) - screen->print("Sent ad-hoc position\n"); - else - screen->print("Sent ad-hoc nodeinfo\n"); - screen->forceDisplay(true); // Force a new UI frame, then force an EInk update - } +#ifdef ELECROW_ThinkNode_M1 + digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW); + break; +#endif + sendAdHocPosition(); break; } case BUTTON_EVENT_MULTI_PRESSED: { LOG_BUTTON("Mulitipress! %hux", multipressClickCount); switch (multipressClickCount) { -#if HAS_GPS +#if HAS_GPS && !defined(ELECROW_ThinkNode_M1) // 3 clicks: toggle GPS case 3: if (!config.device.disable_triple_click && (gps != nullptr)) { @@ -239,17 +239,17 @@ int32_t ButtonThread::runOnce() screen->forceDisplay(true); // Force a new UI frame, then force an EInk update } break; -#elif defined(ELECROW_ThinkNode_M2) +#elif defined(ELECROW_ThinkNode_M1) || defined(ELECROW_ThinkNode_M2) case 3: LOG_INFO("3 clicks: toggle buzzer"); buzzer_flag = !buzzer_flag; - if (buzzer_flag) { - playBeep(); - } + if (!buzzer_flag) + noTone(PIN_BUZZER); break; + #endif -#if defined(USE_EINK) && defined(PIN_EINK_EN) // i.e. T-Echo +#if defined(USE_EINK) && defined(PIN_EINK_EN) && !defined(ELECROW_ThinkNode_M1) // i.e. T-Echo // 4 clicks: toggle backlight case 4: digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW); diff --git a/src/ButtonThread.h b/src/ButtonThread.h index a8f1f77c3..3af700dd0 100644 --- a/src/ButtonThread.h +++ b/src/ButtonThread.h @@ -37,6 +37,9 @@ class ButtonThread : public concurrency::OSThread void attachButtonInterrupts(); void detachButtonInterrupts(); void storeClickCount(); + bool isBuzzing() { return buzzer_flag; } + void setScreenFlag(bool flag) { screen_flag = flag; } + bool getScreenFlag() { return screen_flag; } // Disconnect and reconnect interrupts for light sleep #ifdef ARCH_ESP32 @@ -72,14 +75,12 @@ class ButtonThread : public concurrency::OSThread static void wakeOnIrq(int irq, int mode); + static void sendAdHocPosition(); + static void switchPage(); + // IRQ callbacks static void userButtonPressed() { btnEvent = BUTTON_EVENT_PRESSED; } - static void userButtonPressedScreen() - { - if (millis() > c_holdOffTime) { - btnEvent = BUTTON_EVENT_PRESSED_SCREEN; - } - } + static void userButtonPressedScreen() { btnEvent = BUTTON_EVENT_PRESSED_SCREEN; } static void userButtonDoublePressed() { btnEvent = BUTTON_EVENT_DOUBLE_PRESSED; } static void userButtonMultiPressed(void *callerThread); // Retrieve click count from non-static Onebutton while still valid static void userButtonPressedLongStart(); diff --git a/src/Power.cpp b/src/Power.cpp index 0dec0fc21..f11f8eac3 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -380,6 +380,20 @@ class AnalogBatteryLevel : public HasBatteryLevel // if we have a integrated device with a battery, we can assume that the battery is always connected #ifdef BATTERY_IMMUTABLE virtual bool isBatteryConnect() override { return true; } +#elif defined(ADC_V) + virtual bool isBatteryConnect() override + { + int lastReading = digitalRead(ADC_V); + // 判断值是否变化 + for (int i = 2; i < 500; i++) { + int reading = digitalRead(ADC_V); + if (reading != lastReading) { + return false; // 有变化,USB供电, 没接电池 + } + } + + return true; + } #else virtual bool isBatteryConnect() override { return getBatteryPercent() != -1; } #endif @@ -533,9 +547,6 @@ Power::Power() : OSThread("Power") { statusHandler = {}; low_voltage_counter = 0; -#if defined(ELECROW_ThinkNode_M1) || defined(POWER_CFG) - low_voltage_counter_led3 = 0; -#endif #ifdef DEBUG_HEAP lastheap = memGet.getFreeHeap(); #endif @@ -716,9 +727,6 @@ void Power::readPowerStatus() const PowerStatus powerStatus2 = PowerStatus(hasBattery, usbPowered, isChargingNow, batteryVoltageMv, batteryChargePercent); LOG_DEBUG("Battery: usbPower=%d, isCharging=%d, batMv=%d, batPct=%d", powerStatus2.getHasUSB(), powerStatus2.getIsCharging(), powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent()); -#if defined(ELECROW_ThinkNode_M1) || defined(POWER_CFG) - power_num = powerStatus2.getBatteryVoltageMv(); -#endif newStatus.notifyObservers(&powerStatus2); #ifdef DEBUG_HEAP if (lastheap != memGet.getFreeHeap()) { @@ -766,9 +774,6 @@ void Power::readPowerStatus() if (batteryLevel && powerStatus2.getHasBattery() && !powerStatus2.getHasUSB()) { if (batteryLevel->getBattVoltage() < OCV[NUM_OCV_POINTS - 1]) { low_voltage_counter++; -#if defined(ELECROW_ThinkNode_M1) - low_voltage_counter_led3 = low_voltage_counter; -#endif LOG_DEBUG("Low voltage counter: %d/10", low_voltage_counter); if (low_voltage_counter > 10) { #ifdef ARCH_NRF52 @@ -781,13 +786,7 @@ void Power::readPowerStatus() } } else { low_voltage_counter = 0; -#if defined(ELECROW_ThinkNode_M1) - low_voltage_counter_led3 = low_voltage_counter; -#endif } -#ifdef POWER_CFG - low_voltage_counter_led3 = low_voltage_counter; -#endif } } diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index a2e7ebbc7..689f5e204 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -12,6 +12,7 @@ #include "RTC.h" #include "Throttle.h" #include "buzz.h" +#include "concurrency/Periodic.h" #include "meshUtils.h" #include "main.h" // pmu_found @@ -89,6 +90,45 @@ static const char *getGPSPowerStateString(GPSPowerState state) } } +#ifdef PIN_GPS_SWITCH +// If we have a hardware switch, define a periodic watcher outside of the GPS runOnce thread, since this can be sleeping +// idefinitely + +int lastState = LOW; +bool firstrun = true; + +static int32_t gpsSwitch() +{ + if (gps) { + int currentState = digitalRead(PIN_GPS_SWITCH); + + // if the switch is set to zero, disable the GPS Thread + if (firstrun) + if (currentState == LOW) + lastState = HIGH; + + if (currentState != lastState) { + if (currentState == LOW) { + config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_DISABLED; + if (!firstrun) + playGPSDisableBeep(); + gps->disable(); + } else { + config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_ENABLED; + if (!firstrun) + playGPSEnableBeep(); + gps->enable(); + } + lastState = currentState; + } + firstrun = false; + } + return 1000; +} + +static concurrency::Periodic *gpsPeriodic; +#endif + static void UBXChecksum(uint8_t *message, size_t length) { uint8_t CK_A = 0, CK_B = 0; @@ -1390,6 +1430,12 @@ GPS *GPS::createGps() pinMode(PIN_GPS_PPS, INPUT); #endif +#ifdef PIN_GPS_SWITCH + // toggle GPS via external GPIO switch + pinMode(PIN_GPS_SWITCH, INPUT); + gpsPeriodic = new concurrency::Periodic("GPSSwitch", gpsSwitch); +#endif + // Currently disabled per issue #525 (TinyGPS++ crash bug) // when fixed upstream, can be un-disabled to enable 3D FixType and PDOP #ifndef TINYGPS_OPTION_NO_CUSTOM_FIELDS diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index e27495f54..8075dd468 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -30,6 +30,7 @@ along with this program. If not, see . #if !MESHTASTIC_EXCLUDE_GPS #include "GPS.h" #endif +#include "ButtonThread.h" #include "MeshService.h" #include "NodeDB.h" #include "error.h" @@ -1606,6 +1607,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) if (on != screenOn) { if (on) { LOG_INFO("Turn on screen"); + buttonThread->setScreenFlag(true); powerMon->setState(meshtastic_PowerMon_State_Screen_On); #ifdef T_WATCH_S3 PMU->enablePowerOutput(XPOWERS_ALDO2); @@ -1641,6 +1643,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) setScreensaverFrames(einkScreensaver); #endif LOG_INFO("Turn off screen"); + buttonThread->setScreenFlag(false); #ifdef ELECROW_ThinkNode_M1 if (digitalRead(PIN_EINK_EN) == HIGH) { digitalWrite(PIN_EINK_EN, LOW); diff --git a/src/main.cpp b/src/main.cpp index fd65830ef..a528da8af 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -212,6 +212,60 @@ const char *getDeviceName() return name; } +#if defined(ELECROW_ThinkNode_M1) || defined(ELECROW_ThinkNode_M2) +static int32_t ledBlinkCount = 0; + +static int32_t elecrowLedBlinker() +{ + // are we in alert buzzer mode? + if (buttonThread->isBuzzing()) { + + // blink LED three times for 3 seconds, then 3 times for a second, with one second pause + if (ledBlinkCount % 2) { // odd means LED OFF + ledBlink.set(false); + ledBlinkCount++; + if (ledBlinkCount >= 12) + ledBlinkCount = 0; + noTone(PIN_BUZZER); + return 1000; + } else { + if (ledBlinkCount < 6) { + ledBlink.set(true); + tone(PIN_BUZZER, 4000, 3000); + ledBlinkCount++; + return 3000; + } else { + ledBlink.set(true); + tone(PIN_BUZZER, 4000, 1000); + ledBlinkCount++; + return 1000; + } + } + } else { + ledBlinkCount = 0; + if (config.device.led_heartbeat_disabled) + return 1000; + + static bool ledOn; + // when fully charged, remain on! + if (powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() >= 100) { + ledOn = true; + } else { + ledOn ^= 1; + } + ledBlink.set(ledOn); + // when charging, blink 0.5Hz square wave rate to indicate that + if (powerStatus->getIsCharging()) { + return 500; + } + // When almost empty, blink rapidly + if (!powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() < 10) { + return 250; + } + } + return 1000; +} +#else static int32_t ledBlinker() { // Still set up the blinking (heartbeat) interval but skip code path below, so LED will blink if @@ -227,6 +281,7 @@ static int32_t ledBlinker() // have a very sparse duty cycle of LED being on, unless charging, then blink 0.5Hz square wave rate to indicate that return powerStatus->getIsCharging() ? 1000 : (ledOn ? 1 : 1000); } +#endif uint32_t timeLastPowered = 0; @@ -263,11 +318,6 @@ void printInfo() void setup() { -#ifdef POWER_CHRG - pinMode(POWER_CHRG, OUTPUT); - digitalWrite(POWER_CHRG, HIGH); -#endif - #if defined(PIN_POWER_EN) pinMode(PIN_POWER_EN, OUTPUT); digitalWrite(PIN_POWER_EN, HIGH); @@ -278,11 +328,6 @@ void setup() digitalWrite(LED_POWER, HIGH); #endif -#ifdef POWER_LED - pinMode(POWER_LED, OUTPUT); - digitalWrite(POWER_LED, HIGH); -#endif - #ifdef USER_LED pinMode(USER_LED, OUTPUT); digitalWrite(USER_LED, LOW); @@ -414,7 +459,12 @@ void setup() OSThread::setup(); +#if defined(ELECROW_ThinkNode_M1) || defined(ELECROW_ThinkNode_M2) + // The ThinkNodes have their own blink logic + ledPeriodic = new Periodic("Blink", elecrowLedBlinker); +#else ledPeriodic = new Periodic("Blink", ledBlinker); +#endif fsInit(); diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 9bb63652a..c89abbe74 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -743,6 +743,15 @@ void NodeDB::installDefaultModuleConfig() moduleConfig.external_notification.output_ms = 100; moduleConfig.external_notification.active = true; #endif +#ifdef ELECROW_ThinkNode_M1 + // Default to Elecrow USER_LED (blue) + moduleConfig.external_notification.enabled = true; + moduleConfig.external_notification.output = USER_LED; + moduleConfig.external_notification.active = true; + moduleConfig.external_notification.alert_message = true; + moduleConfig.external_notification.output_ms = 1000; + moduleConfig.external_notification.nag_timeout = 60; +#endif #ifdef BUTTON_SECONDARY_CANNEDMESSAGES // Use a board's second built-in button as input source for canned messages moduleConfig.canned_message.enabled = true; diff --git a/src/platform/esp32/main-esp32.cpp b/src/platform/esp32/main-esp32.cpp index ab1e5c922..3c4faac3e 100644 --- a/src/platform/esp32/main-esp32.cpp +++ b/src/platform/esp32/main-esp32.cpp @@ -109,9 +109,8 @@ void esp32Setup() randomSeed(seed); */ -#ifdef POWER_FULL - pinMode(POWER_FULL, INPUT); - pinMode(7, INPUT); +#ifdef ADC_V + pinMode(ADC_V, INPUT); #endif LOG_DEBUG("Total heap: %d", ESP.getHeapSize()); diff --git a/src/platform/nrf52/main-nrf52.cpp b/src/platform/nrf52/main-nrf52.cpp index 53971e95a..9accd2a02 100644 --- a/src/platform/nrf52/main-nrf52.cpp +++ b/src/platform/nrf52/main-nrf52.cpp @@ -235,10 +235,6 @@ void nrf52InitSemiHosting() void nrf52Setup() { -#ifdef USB_CHECK - pinMode(USB_CHECK, INPUT); -#endif - #ifdef ADC_V pinMode(ADC_V, INPUT); #endif @@ -288,7 +284,7 @@ void cpuDeepSleep(uint32_t msecToWake) #endif // This may cause crashes as debug messages continue to flow. Serial.end(); -#ifdef PIN_SERIAL_RX1 +#ifdef PIN_SERIAL1_RX Serial1.end(); #endif setBluetoothEnable(false); diff --git a/src/power.h b/src/power.h index 97944fef7..e9c0deb7c 100644 --- a/src/power.h +++ b/src/power.h @@ -84,11 +84,6 @@ class Power : private concurrency::OSThread void setStatusHandler(meshtastic::PowerStatus *handler) { statusHandler = handler; } const uint16_t OCV[11] = {OCV_ARRAY}; -#if defined(ELECROW_ThinkNode_M1) || defined(POWER_CFG) - uint8_t low_voltage_counter_led3; - int power_num = 0; -#endif - protected: meshtastic::PowerStatus *statusHandler; diff --git a/variants/ELECROW-ThinkNode-M1/variant.h b/variants/ELECROW-ThinkNode-M1/variant.h index fc2fddbdf..2e91e378d 100644 --- a/variants/ELECROW-ThinkNode-M1/variant.h +++ b/variants/ELECROW-ThinkNode-M1/variant.h @@ -41,16 +41,15 @@ extern "C" { #define NUM_ANALOG_INPUTS (1) #define NUM_ANALOG_OUTPUTS (0) -#define PIN_LED1 -1 #define PIN_LED2 -1 #define PIN_LED3 -1 // LED -#define POWER_LED (32 + 6) // red +#define PIN_LED1 (32 + 6) // red #define LED_POWER (32 + 4) #define USER_LED (0 + 13) // green // USB_CHECK -#define USB_CHECK (32 + 3) +#define EXT_PWR_DETECT (32 + 3) #define ADC_V (0 + 8) #define LED_RED PIN_LED3 @@ -59,7 +58,7 @@ extern "C" { #define LED_BUILTIN LED_BLUE #define LED_CONN PIN_GREEN #define LED_STATE_ON 0 // State when LED is lit // LED灯亮时的状态 -#define M1_buzzer (0 + 6) +#define PIN_BUZZER (0 + 6) /* * Buttons */ @@ -82,6 +81,7 @@ extern "C" { static const uint8_t A0 = PIN_A0; #define ADC_RESOLUTION 14 +#define BATTERY_SENSE_SAMPLES 30 #define PIN_NFC1 (9) #define PIN_NFC2 (10) @@ -159,7 +159,7 @@ External serial flash WP25R1635FZUIL0 #define GPS_THREAD_INTERVAL 50 -#define PIN_GPS_PPS (32 + 1) // GPS开关判断 +#define PIN_GPS_SWITCH (32 + 1) // GPS开关判断 #define PIN_SERIAL1_RX GPS_TX_PIN #define PIN_SERIAL1_TX GPS_RX_PIN diff --git a/variants/ELECROW-ThinkNode-M2/variant.h b/variants/ELECROW-ThinkNode-M2/variant.h index 801d5606f..55f35e498 100644 --- a/variants/ELECROW-ThinkNode-M2/variant.h +++ b/variants/ELECROW-ThinkNode-M2/variant.h @@ -1,14 +1,13 @@ // Status -#define LED_PIN_POWER 1 -#define BIAS_T_ENABLE LED_PIN_POWER -#define BIAS_T_VALUE HIGH +#define LED_PIN 1 #define PIN_BUTTON1 47 // 功能键 #define PIN_BUTTON2 4 // 电源键 -#define POWER_CFG -#define POWER_CHRG 6 -#define POWER_FULL 42 +#define LED_PIN_POWER 6 +#define ADC_V 42 +// USB_CHECK +#define EXT_PWR_DETECT 7 #define PIN_BUZZER 5 From e2933bcb5b92f92569f9b78e75d5e4a001e33088 Mon Sep 17 00:00:00 2001 From: Mark Trevor Birss Date: Mon, 7 Apr 2025 14:04:31 +0200 Subject: [PATCH 029/461] Update platformio.ini (#6512) --- variants/crowpanel-esp32s3-5-epaper/platformio.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/variants/crowpanel-esp32s3-5-epaper/platformio.ini b/variants/crowpanel-esp32s3-5-epaper/platformio.ini index f1257a979..ebf013f64 100644 --- a/variants/crowpanel-esp32s3-5-epaper/platformio.ini +++ b/variants/crowpanel-esp32s3-5-epaper/platformio.ini @@ -11,7 +11,7 @@ board = esp32-s3-devkitc-1 board_level = extra upload_protocol = esptool build_flags = - ${esp32_base.build_flags} -D CROWPANEL_ESP32S3_5_EPAPER -I variants/crowpanel-esp32s3-5-epaper + ${esp32s3_base.build_flags} -D CROWPANEL_ESP32S3_5_EPAPER -I variants/crowpanel-esp32s3-5-epaper -D PRIVATE_HW -DBOARD_HAS_PSRAM -DGPS_POWER_TOGGLE @@ -39,7 +39,7 @@ board = esp32-s3-devkitc-1 board_level = extra upload_protocol = esptool build_flags = - ${esp32_base.build_flags} -D CROWPANEL_ESP32S3_4_EPAPER -I variants/crowpanel-esp32s3-5-epaper + ${esp32s3_base.build_flags} -D CROWPANEL_ESP32S3_4_EPAPER -I variants/crowpanel-esp32s3-5-epaper -D PRIVATE_HW -DBOARD_HAS_PSRAM -DGPS_POWER_TOGGLE @@ -67,7 +67,7 @@ board = esp32-s3-devkitc-1 board_level = extra upload_protocol = esptool build_flags = - ${esp32_base.build_flags} -D CROWPANEL_ESP32S3_2_EPAPER -I variants/crowpanel-esp32s3-5-epaper + ${esp32s3_base.build_flags} -D CROWPANEL_ESP32S3_2_EPAPER -I variants/crowpanel-esp32s3-5-epaper -D PRIVATE_HW -DBOARD_HAS_PSRAM -DGPS_POWER_TOGGLE From a084073cc15b4cb0a05c5f9ca52d6fffd94d4530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 7 Apr 2025 15:35:51 +0200 Subject: [PATCH 030/461] inkhud doesn't have a button thread (#6513) --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index a528da8af..bf4b0c2f2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -218,8 +218,8 @@ static int32_t ledBlinkCount = 0; static int32_t elecrowLedBlinker() { // are we in alert buzzer mode? +#if HAS_BUTTON if (buttonThread->isBuzzing()) { - // blink LED three times for 3 seconds, then 3 times for a second, with one second pause if (ledBlinkCount % 2) { // odd means LED OFF ledBlink.set(false); @@ -242,6 +242,7 @@ static int32_t elecrowLedBlinker() } } } else { +#endif ledBlinkCount = 0; if (config.device.led_heartbeat_disabled) return 1000; @@ -262,7 +263,9 @@ static int32_t elecrowLedBlinker() if (!powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() < 10) { return 250; } +#if HAS_BUTTON } +#endif return 1000; } #else From 12d13056188956a1002db2187605c178693c1f03 Mon Sep 17 00:00:00 2001 From: Eric Wolak Date: Mon, 7 Apr 2025 17:34:16 -0700 Subject: [PATCH 031/461] Fix device-specific logic in install script (#6508) * Fix device-specific logic in install script These new for loops to check for variants in a list should be checking for the string to _be empty_, not _non-empty_, if a match is found causing the replacement to fire. * simplify logic per review feedback --------- Co-authored-by: Ben Meadors --- bin/device-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/device-install.sh b/bin/device-install.sh index bacf48f69..796626a9d 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -138,7 +138,7 @@ if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then # littlefs* offset for BigDB 8mb and OTA OFFSET. for variant in "${BIGDB_8MB[@]}"; do - if [ -n "${FILENAME##*"$variant"*}" ]; then + if [ -z "${FILENAME##*"$variant"*}" ]; then OFFSET=0x670000 OTA_OFFSET=0x340000 fi @@ -146,7 +146,7 @@ if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then # littlefs* offset for BigDB 16mb and OTA OFFSET. for variant in "${BIGDB_16MB[@]}"; do - if [ -n "${FILENAME##*"$variant"*}" ]; then + if [ -z "${FILENAME##*"$variant"*}" ]; then OFFSET=0xc90000 OTA_OFFSET=0x650000 fi @@ -155,7 +155,7 @@ if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then # Account for S3 board's different OTA partition # FIXME: Use PlatformIO info to determine MCU type, this is unmaintainable for variant in "${S3_VARIANTS[@]}"; do - if [ -n "${FILENAME##*"$variant"*}" ]; then + if [ -z "${FILENAME##*"$variant"*}" ]; then MCU="esp32s3" fi done From c0dab4a672c3ea92f3879df2107a4a9f95a34fba Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 08:27:58 -0500 Subject: [PATCH 032/461] Upgrade trunk (#6519) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 608045e45..3aa9628fc 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,14 +9,14 @@ plugins: lint: enabled: - prettier@3.5.3 - - trufflehog@3.88.22 + - trufflehog@3.88.23 - yamllint@1.37.0 - bandit@1.8.3 - - checkov@3.2.396 + - checkov@3.2.398 - terrascan@1.19.9 - trivy@0.61.0 - taplo@0.9.3 - - ruff@0.11.3 + - ruff@0.11.4 - isort@6.0.1 - markdownlint@0.44.0 - oxipng@9.1.4 From cfc2a96a459318e7fe8a41f9ed9c997ef08b19a7 Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 8 Apr 2025 10:09:23 -0400 Subject: [PATCH 033/461] Update web, use centrally defined version (#6500) --- .github/actions/build-variant/action.yml | 9 ++++++++- bin/rpkg.macros | 4 ++++ bin/web.version | 1 + debian/ci_pack_sdeb.sh | 5 +++-- meshtasticd.spec.rpkg | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 bin/web.version diff --git a/.github/actions/build-variant/action.yml b/.github/actions/build-variant/action.yml index 2f0883fad..67d002eea 100644 --- a/.github/actions/build-variant/action.yml +++ b/.github/actions/build-variant/action.yml @@ -43,6 +43,13 @@ runs: id: base uses: ./.github/actions/setup-base + - name: Get web ui version + if: inputs.include-web-ui == 'true' + id: webver + shell: bash + run: | + echo "ver=$(cat bin/web.version)" >> $GITHUB_OUTPUT + - name: Pull web ui if: inputs.include-web-ui == 'true' uses: dsaltares/fetch-gh-release-asset@master @@ -51,7 +58,7 @@ runs: file: build.tar target: build.tar token: ${{ inputs.github_token }} - version: tags/v2.5.3 + version: tags/v${{ steps.webver.outputs.ver }} - name: Unpack web ui if: inputs.include-web-ui == 'true' diff --git a/bin/rpkg.macros b/bin/rpkg.macros index 2bbb203de..aa036fc33 100644 --- a/bin/rpkg.macros +++ b/bin/rpkg.macros @@ -2,6 +2,10 @@ function meshtastic_version { meshtastic_version=$(python3 bin/buildinfo.py short) echo -n "$meshtastic_version" } +function web_version { + web_version=$(cat bin/web.version) + echo -n "$web_version" +} function git_commits_num { total_commits=$(git rev-list --all --count) echo -n "$total_commits" diff --git a/bin/web.version b/bin/web.version new file mode 100644 index 000000000..914ec9671 --- /dev/null +++ b/bin/web.version @@ -0,0 +1 @@ +2.6.0 \ No newline at end of file diff --git a/debian/ci_pack_sdeb.sh b/debian/ci_pack_sdeb.sh index a8b2252ae..c0cea0010 100755 --- a/debian/ci_pack_sdeb.sh +++ b/debian/ci_pack_sdeb.sh @@ -10,8 +10,9 @@ platformio pkg install -e native -t platformio/tool-scons@4.40502.0 # Compress `pio` directory to prevent dh_clean from sanitizing it tar -cf pio.tar pio/ rm -rf pio -# Download the latest meshtastic/web release build.tar to `web.tar` -curl -L https://github.com/meshtastic/web/releases/latest/download/build.tar -o web.tar +# Download the meshtastic/web release build.tar to `web.tar` +web_ver=$(cat bin/web.version) +curl -L "https://github.com/meshtastic/web/releases/download/v$web_ver/build.tar" -o web.tar package=$(dpkg-parsechangelog --show-field Source) diff --git a/meshtasticd.spec.rpkg b/meshtasticd.spec.rpkg index a09261056..4d6c9d6f5 100644 --- a/meshtasticd.spec.rpkg +++ b/meshtasticd.spec.rpkg @@ -21,7 +21,7 @@ Summary: Meshtastic daemon for communicating with Meshtastic devices License: GPL-3.0 URL: https://github.com/meshtastic/firmware Source0: {{{ git_dir_pack }}} -Source1: https://github.com/meshtastic/web/releases/latest/download/build.tar +Source1: https://github.com/meshtastic/web/releases/download/v{{{ web_version }}}/build.tar BuildRequires: systemd-rpm-macros BuildRequires: python3-devel From c94dd1e33110e10c5afbd642212c545664ed5927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 8 Apr 2025 17:46:39 +0200 Subject: [PATCH 034/461] Minor adjustment of blink codes and 'unstick' the M2 button. (#6521) --- src/ButtonThread.cpp | 4 ++++ src/main.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/ButtonThread.cpp b/src/ButtonThread.cpp index 375029c99..04200a7df 100644 --- a/src/ButtonThread.cpp +++ b/src/ButtonThread.cpp @@ -349,8 +349,12 @@ void ButtonThread::attachButtonInterrupts() #endif #ifdef BUTTON_PIN_ALT +#ifdef ELECROW_ThinkNode_M2 + wakeOnIrq(BUTTON_PIN_ALT, RISING); +#else wakeOnIrq(BUTTON_PIN_ALT, FALLING); #endif +#endif #ifdef BUTTON_PIN_TOUCH wakeOnIrq(BUTTON_PIN_TOUCH, FALLING); diff --git a/src/main.cpp b/src/main.cpp index bf4b0c2f2..bfbd73a43 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -248,8 +248,9 @@ static int32_t elecrowLedBlinker() return 1000; static bool ledOn; - // when fully charged, remain on! - if (powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() >= 100) { + // remain on when fully charged or discharging above 10% + if ((powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() >= 100) || + (!powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() >= 10)) { ledOn = true; } else { ledOn ^= 1; @@ -259,8 +260,8 @@ static int32_t elecrowLedBlinker() if (powerStatus->getIsCharging()) { return 500; } - // When almost empty, blink rapidly - if (!powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() < 10) { + // Blink rapidly when almost empty or if battery is not connected + if ((!powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() < 10) || !powerStatus->getHasBattery()) { return 250; } #if HAS_BUTTON From fb2010552faea355f8fbf1491d1c1cc9eaa316d2 Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Tue, 8 Apr 2025 20:50:58 +0200 Subject: [PATCH 035/461] MUI: update commit reference (#6526) new feature: map locations filtering bugfix: boot logo / bt logo --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 377635873..749aa94c7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -94,7 +94,7 @@ lib_deps = [device-ui_base] lib_deps = - https://github.com/meshtastic/device-ui/archive/99171e87a70452395b56cce713a951c1c2964370.zip + https://github.com/meshtastic/device-ui/archive/56ef8db7eb4dda44dc0c1ec5828044debbbc6d33.zip ; Common libs for environmental measurements in telemetry module ; (not included in native / portduino) From 1b1d4625aa83c8a76855422db1dfc19846fdb125 Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Wed, 9 Apr 2025 04:04:33 +0900 Subject: [PATCH 036/461] chore: update ubx.h (#6522) usefull -> useful --- src/gps/ubx.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gps/ubx.h b/src/gps/ubx.h index d674bed51..0fe2f01fb 100644 --- a/src/gps/ubx.h +++ b/src/gps/ubx.h @@ -224,7 +224,7 @@ static const uint8_t _message_GSA[] = { 0x00, // Rate for DDC 0x00, // Rate for UART1 0x00, // Rate for UART2 - 0x00, // Rate for USB usefull for native linux + 0x00, // Rate for USB useful for native linux 0x00, // Rate for SPI 0x00 // Reserved }; @@ -258,7 +258,7 @@ static const uint8_t _message_RMC[] = { 0x00, // Rate for DDC 0x01, // Rate for UART1 0x00, // Rate for UART2 - 0x01, // Rate for USB usefull for native linux + 0x01, // Rate for USB useful for native linux 0x00, // Rate for SPI 0x00 // Reserved }; @@ -269,7 +269,7 @@ static const uint8_t _message_GGA[] = { 0x00, // Rate for DDC 0x01, // Rate for UART1 0x00, // Rate for UART2 - 0x01, // Rate for USB, usefull for native linux + 0x01, // Rate for USB, useful for native linux 0x00, // Rate for SPI 0x00 // Reserved }; From 0d800b7a22be675717f3d5cbff29e66234d88ffb Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 8 Apr 2025 17:14:39 -0400 Subject: [PATCH 037/461] meshtasticd docker: Support webui (#6482) --- Dockerfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 733a46325..55580c579 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ ENV TZ=Etc/UTC # Install Dependencies ENV PIP_ROOT_USER_ACTION=ignore RUN apt-get update && apt-get install --no-install-recommends -y \ - wget g++ zip git ca-certificates \ + curl wget g++ zip git ca-certificates \ libgpiod-dev libyaml-cpp-dev libbluetooth-dev libi2c-dev libuv1-dev \ libusb-1.0-0-dev libulfius-dev liborcania-dev libssl-dev pkg-config \ && apt-get clean && rm -rf /var/lib/apt/lists/* \ @@ -27,6 +27,12 @@ COPY . /tmp/firmware RUN bash ./bin/build-native.sh && \ cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd" +# Fetch web assets +RUN curl -L "https://github.com/meshtastic/web/releases/download/v$(cat /tmp/firmware/bin/web.version)/build.tar" -o /tmp/web.tar \ + && mkdir -p /tmp/web \ + && tar -xf /tmp/web.tar -C /tmp/web/ \ + && gzip -dr /tmp/web \ + && rm /tmp/web.tar ##### PRODUCTION BUILD ############# @@ -46,6 +52,7 @@ RUN apt-get update && apt-get --no-install-recommends -y install \ # Fetch compiled binary from the builder COPY --from=builder /tmp/firmware/release/meshtasticd /usr/sbin/ +COPY --from=builder /tmp/web /usr/share/meshtasticd/ # Copy config templates COPY ./bin/config.d /etc/meshtasticd/available.d @@ -54,7 +61,9 @@ VOLUME /var/lib/meshtasticd # Expose Meshtastic TCP API port from the host EXPOSE 4403 +# Expose Meshtastic Web UI port from the host +EXPOSE 443 CMD [ "sh", "-cx", "meshtasticd -d /var/lib/meshtasticd" ] -HEALTHCHECK NONE \ No newline at end of file +HEALTHCHECK NONE From ec298199ee1cdceaad25b743dcbf31e3ddb021ff Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Wed, 9 Apr 2025 18:40:12 +0800 Subject: [PATCH 038/461] remove checkov from trunk config (#6532) We don't have terraform, cloudformation, helm templates ... and this check pushes out new versions very frequently which is annoying with out automation :) --- .trunk/trunk.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 3aa9628fc..903b4c298 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -12,7 +12,6 @@ lint: - trufflehog@3.88.23 - yamllint@1.37.0 - bandit@1.8.3 - - checkov@3.2.398 - terrascan@1.19.9 - trivy@0.61.0 - taplo@0.9.3 From 69f938ea98dca5c103f0898489877afd2c7b2e25 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Wed, 9 Apr 2025 13:13:49 +0200 Subject: [PATCH 039/461] Send UDP packet even if it's encrypted (#6524) Co-authored-by: Ben Meadors --- src/mesh/Router.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index b8b7ee610..2cc3007a2 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -283,11 +283,6 @@ ErrorCode Router::send(meshtastic_MeshPacket *p) abortSendAndNak(encodeResult, p); return encodeResult; // FIXME - this isn't a valid ErrorCode } -#if HAS_UDP_MULTICAST - if (udpThread && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST) { - udpThread->onSend(const_cast(p)); - } -#endif #if !MESHTASTIC_EXCLUDE_MQTT // Only publish to MQTT if we're the original transmitter of the packet if (moduleConfig.mqtt.enabled && isFromUs(p) && mqtt) { @@ -297,6 +292,12 @@ ErrorCode Router::send(meshtastic_MeshPacket *p) packetPool.release(p_decoded); } +#if HAS_UDP_MULTICAST + if (udpThread && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST) { + udpThread->onSend(const_cast(p)); + } +#endif + assert(iface); // This should have been detected already in sendLocal (or we just received a packet from outside) return iface->send(p); } From fc3d9f2a15e201bbedc3a98049abdc8b3bd648da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 9 Apr 2025 14:55:23 +0200 Subject: [PATCH 040/461] fix power pin definition --- variants/ELECROW-ThinkNode-M2/variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/ELECROW-ThinkNode-M2/variant.h b/variants/ELECROW-ThinkNode-M2/variant.h index 55f35e498..a6bb40f1a 100644 --- a/variants/ELECROW-ThinkNode-M2/variant.h +++ b/variants/ELECROW-ThinkNode-M2/variant.h @@ -4,7 +4,7 @@ #define PIN_BUTTON1 47 // 功能键 #define PIN_BUTTON2 4 // 电源键 -#define LED_PIN_POWER 6 +#define LED_POWER 6 #define ADC_V 42 // USB_CHECK #define EXT_PWR_DETECT 7 From 5256ae90dc4e96a4978cd3fde4a89c56699fb351 Mon Sep 17 00:00:00 2001 From: Andrik45719 Date: Wed, 9 Apr 2025 18:40:38 +0300 Subject: [PATCH 041/461] DIY v1/v1_1 add TCXO_OPTIONAL make it so that the firmware can try both TCXO and XTAL (#6534) * EBYTE_E22 TCXO_OPTIONAL * EBYTE_E22 --------- Co-authored-by: Ben Meadors --- variants/diy/v1/variant.h | 1 + variants/diy/v1_1/variant.h | 1 + 2 files changed, 2 insertions(+) diff --git a/variants/diy/v1/variant.h b/variants/diy/v1/variant.h index 4802dbe89..8a2df3f2b 100644 --- a/variants/diy/v1/variant.h +++ b/variants/diy/v1/variant.h @@ -53,4 +53,5 @@ // Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch // (which is the default for the sx1262interface code) #define SX126X_DIO3_TCXO_VOLTAGE 1.8 +#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL #endif diff --git a/variants/diy/v1_1/variant.h b/variants/diy/v1_1/variant.h index 8a006d0d2..1c8110301 100644 --- a/variants/diy/v1_1/variant.h +++ b/variants/diy/v1_1/variant.h @@ -54,4 +54,5 @@ // Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch // (which is the default for the sx1262interface code) #define SX126X_DIO3_TCXO_VOLTAGE 1.8 +#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL #endif From 536b6d87c63888e8ee480a3f06d004e4360b4459 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Thu, 10 Apr 2025 03:41:51 +1200 Subject: [PATCH 042/461] InkHUD support for LilyGo T3S3 E-Paper (#6503) * Purge an incomplete E-Ink driver * Use the deep-sleep mode of SSD16XX E-Ink displays * TwoButton doesn't need to store pin mode * Fix false positive button presses after light sleep * E-Ink driver for DEPG0213BNS800 * InkHUD support for LilyGo T3S3 E-paper --------- Co-authored-by: Ben Meadors --- .../niche/Drivers/EInk/DEPG0154BNS800.cpp | 1 - .../niche/Drivers/EInk/DEPG0154BNS800.h | 34 ----- .../niche/Drivers/EInk/DEPG0213BNS800.cpp | 132 ++++++++++++++++++ .../niche/Drivers/EInk/DEPG0213BNS800.h | 44 ++++++ .../niche/Drivers/EInk/DEPG0290BNS800.cpp | 5 + src/graphics/niche/Drivers/EInk/SSD16XX.cpp | 13 ++ src/graphics/niche/Drivers/EInk/SSD16XX.h | 1 + src/graphics/niche/Inputs/TwoButton.cpp | 7 +- src/graphics/niche/Inputs/TwoButton.h | 3 +- variants/t-echo/nicheGraphics.h | 2 +- variants/tlora_t3s3_epaper/nicheGraphics.h | 102 ++++++++++++++ variants/tlora_t3s3_epaper/platformio.ini | 19 +++ variants/tlora_t3s3_epaper/variant.h | 1 - 13 files changed, 322 insertions(+), 42 deletions(-) delete mode 100644 src/graphics/niche/Drivers/EInk/DEPG0154BNS800.cpp delete mode 100644 src/graphics/niche/Drivers/EInk/DEPG0154BNS800.h create mode 100644 src/graphics/niche/Drivers/EInk/DEPG0213BNS800.cpp create mode 100644 src/graphics/niche/Drivers/EInk/DEPG0213BNS800.h create mode 100644 variants/tlora_t3s3_epaper/nicheGraphics.h diff --git a/src/graphics/niche/Drivers/EInk/DEPG0154BNS800.cpp b/src/graphics/niche/Drivers/EInk/DEPG0154BNS800.cpp deleted file mode 100644 index b8715ed1d..000000000 --- a/src/graphics/niche/Drivers/EInk/DEPG0154BNS800.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "./DEPG0154BNS800.h" \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/DEPG0154BNS800.h b/src/graphics/niche/Drivers/EInk/DEPG0154BNS800.h deleted file mode 100644 index 62d42ef57..000000000 --- a/src/graphics/niche/Drivers/EInk/DEPG0154BNS800.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - -E-Ink display driver - - DEPG0154BNS800 - - Manufacturer: DKE - - Size: 1.54 inch - - Resolution: 152px x 152px - - Flex connector marking: FPC7525 - -*/ - -#pragma once - -#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS -#include "configuration.h" - -#include "./SSD16XX.h" - -namespace NicheGraphics::Drivers -{ -class DEPG0154BNS800 : public SSD16XX -{ - // Display properties - private: - static constexpr uint32_t width = 152; - static constexpr uint32_t height = 152; - static constexpr UpdateTypes supported = (UpdateTypes)(FULL); - - public: - DEPG0154BNS800() : SSD16XX(width, height, supported, 1) {} // Note: left edge of this display is offset by 1 byte -}; - -} // namespace NicheGraphics::Drivers -#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/DEPG0213BNS800.cpp b/src/graphics/niche/Drivers/EInk/DEPG0213BNS800.cpp new file mode 100644 index 000000000..2c8df96ed --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/DEPG0213BNS800.cpp @@ -0,0 +1,132 @@ +#include "./DEPG0213BNS800.h" + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +using namespace NicheGraphics::Drivers; + +// Describes the operation performed when a "fast refresh" is performed +// Source: Modified from GxEPD2 (GxEPD2_213_BN) +static const uint8_t LUT_FAST[] = { + // 1 2 3 + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // B2B (Existing black pixels) + 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // B2W (New white pixels) + 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // W2B (New black pixels) + 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // W2W (Existing white pixels) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // VCOM + + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // 1. Any pixels changing W2B or B2W. Two medium taps. + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2. All pixels. One short tap. + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 3. Cooldown + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, // +}; + +// How strongly the pixels are pulled and pushed +void DEPG0213BNS800::configVoltages() +{ + switch (updateType) { + case FAST: + // Reference: display datasheet, GxEPD1 + sendCommand(0x03); // Gate voltage + sendData(0x17); // VGH: 20V + + // Reference: display datasheet, GxEPD1 + sendCommand(0x04); // Source voltage + sendData(0x41); // VSH1: 15V + sendData(0x00); // VSH2: NA + sendData(0x32); // VSL: -15V + + // GxEPD1 sets this at -1.2V, but that seems to be drive the pixels very hard + sendCommand(0x2C); // VCOM voltage + sendData(0x08); // VCOM: -0.2V + break; + + case FULL: + default: + // From OTP memory + break; + } +} + +// Load settings about how the pixels are moved from old state to new state during a refresh +// - manually specified, +// - or with stored values from displays OTP memory +void DEPG0213BNS800::configWaveform() +{ + switch (updateType) { + case FAST: + sendCommand(0x3C); // Border waveform: + sendData(0x80); // VSS + + sendCommand(0x32); // Write LUT register from MCU: + sendData(LUT_FAST, sizeof(LUT_FAST)); // (describes operation for a FAST refresh) + break; + + case FULL: + default: + // From OTP memory + break; + } +} + +// Describes the sequence of events performed by the displays controller IC during a refresh +// Includes "power up", "load settings from memory", "update the pixels", etc +void DEPG0213BNS800::configUpdateSequence() +{ + switch (updateType) { + case FAST: + sendCommand(0x22); // Set "update sequence" + sendData(0xCF); // Differential, use manually loaded waveform + break; + + case FULL: + default: + sendCommand(0x22); // Set "update sequence" + sendData(0xF7); // Non-differential, load waveform from OTP + break; + } +} + +// Once the refresh operation has been started, +// begin periodically polling the display to check for completion, using the normal Meshtastic threading code +// Only used when refresh is "async" +void DEPG0213BNS800::detachFromUpdate() +{ + switch (updateType) { + case FAST: + return beginPolling(50, 500); // At least 500ms, then poll every 50ms + case FULL: + default: + return beginPolling(100, 3500); // At least 3500ms, then poll every 100ms + } +} + +// For this display, we do not need to re-write the new image. +// We're overriding SSD16XX::finalizeUpdate to make this small optimization. +// The display does also work just fine with the generic SSD16XX method, though. +void DEPG0213BNS800::finalizeUpdate() +{ + // Put a copy of the image into the "old memory". + // Used with differential refreshes (e.g. FAST update), to determine which px need to move, and which can remain in place + // We need to keep the "old memory" up to date, because don't know whether next refresh will be FULL or FAST etc. + if (updateType != FULL) { + // writeNewImage(); // Not required for this display + writeOldImage(); + sendCommand(0x7F); // Terminate image write without update + wait(); + } + + // Enter deep-sleep to save a few µA + // Waking from this requires that display's reset pin is broken out + if (pin_rst != 0xFF) + deepSleep(); +} +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/DEPG0213BNS800.h b/src/graphics/niche/Drivers/EInk/DEPG0213BNS800.h new file mode 100644 index 000000000..e1bb96450 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/DEPG0213BNS800.h @@ -0,0 +1,44 @@ +/* + +E-Ink display driver + - DEPG0213BNS800 + - Manufacturer: DKE + - Size: 2.13 inch + - Resolution: 122px x 250px + - Flex connector marking: FPC-7528B + + Note: this is from an older generation of DKE panels, which still used Solomon Systech controller ICs. + DKE's website suggests that the latest DEPG0213BN displays may use Fitipower controllers instead. +*/ + +#pragma once + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +#include "configuration.h" + +#include "./SSD16XX.h" + +namespace NicheGraphics::Drivers +{ +class DEPG0213BNS800 : public SSD16XX +{ + // Display properties + private: + static constexpr uint32_t width = 122; + static constexpr uint32_t height = 250; + static constexpr UpdateTypes supported = (UpdateTypes)(FULL | FAST); + + public: + DEPG0213BNS800() : SSD16XX(width, height, supported, 1) {} // Note: left edge of this display is offset by 1 byte + + protected: + void configVoltages() override; + void configWaveform() override; + void configUpdateSequence() override; + void detachFromUpdate() override; + void finalizeUpdate() override; // Only overriden for a slight optimization +}; + +} // namespace NicheGraphics::Drivers +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/DEPG0290BNS800.cpp b/src/graphics/niche/Drivers/EInk/DEPG0290BNS800.cpp index 5f3a05670..15134d5ad 100644 --- a/src/graphics/niche/Drivers/EInk/DEPG0290BNS800.cpp +++ b/src/graphics/niche/Drivers/EInk/DEPG0290BNS800.cpp @@ -116,5 +116,10 @@ void DEPG0290BNS800::finalizeUpdate() sendCommand(0x7F); // Terminate image write without update wait(); } + + // Enter deep-sleep to save a few µA + // Waking from this requires that display's reset pin is broken out + if (pin_rst != 0xFF) + deepSleep(); } #endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/SSD16XX.cpp b/src/graphics/niche/Drivers/EInk/SSD16XX.cpp index 5a5397dbd..a2357a80b 100644 --- a/src/graphics/niche/Drivers/EInk/SSD16XX.cpp +++ b/src/graphics/niche/Drivers/EInk/SSD16XX.cpp @@ -242,5 +242,18 @@ void SSD16XX::finalizeUpdate() sendCommand(0x7F); // Terminate image write without update wait(); } + + // Enter deep-sleep to save a few µA + // Waking from this requires that display's reset pin is broken out + if (pin_rst != 0xFF) + deepSleep(); +} + +// Enter a lower-power state +// May only save a few µA.. +void SSD16XX::deepSleep() +{ + sendCommand(0x10); // Enter deep sleep + sendData(0x01); // Mode 1: preserve image RAM } #endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/SSD16XX.h b/src/graphics/niche/Drivers/EInk/SSD16XX.h index 799a378c0..3f92818ce 100644 --- a/src/graphics/niche/Drivers/EInk/SSD16XX.h +++ b/src/graphics/niche/Drivers/EInk/SSD16XX.h @@ -44,6 +44,7 @@ class SSD16XX : public EInk virtual void detachFromUpdate(); virtual bool isUpdateDone() override; virtual void finalizeUpdate() override; + virtual void deepSleep(); protected: uint8_t bufferOffsetX = 0; // In bytes. Panel x=0 does not always align with controller x=0. Quirky internal wiring? diff --git a/src/graphics/niche/Inputs/TwoButton.cpp b/src/graphics/niche/Inputs/TwoButton.cpp index b270d56cf..1e91d9080 100644 --- a/src/graphics/niche/Inputs/TwoButton.cpp +++ b/src/graphics/niche/Inputs/TwoButton.cpp @@ -98,9 +98,8 @@ void TwoButton::setWiring(uint8_t whichButton, uint8_t pin, bool internalPullup) assert(whichButton < 2); buttons[whichButton].pin = pin; buttons[whichButton].activeLogic = LOW; // Unimplemented - buttons[whichButton].mode = internalPullup ? INPUT_PULLUP : INPUT; - pinMode(buttons[whichButton].pin, buttons[whichButton].mode); + pinMode(buttons[whichButton].pin, internalPullup ? INPUT_PULLUP : INPUT); } void TwoButton::setTiming(uint8_t whichButton, uint32_t debounceMs, uint32_t longpressMs) @@ -299,7 +298,9 @@ int TwoButton::afterLightSleep(esp_sleep_wakeup_cause_t cause) // Manually trigger the button-down ISR // - during light sleep, our ISR is disabled // - if light sleep ends by button press, pretend our own ISR caught it - if (cause == ESP_SLEEP_WAKEUP_GPIO) + // - need to manually confirm by reading pin ourselves, to avoid occasional false positives + // (false positive only when using internal pullup resistors?) + if (cause == ESP_SLEEP_WAKEUP_GPIO && digitalRead(buttons[0].pin) == buttons[0].activeLogic) isrPrimary(); return 0; // Indicates success diff --git a/src/graphics/niche/Inputs/TwoButton.h b/src/graphics/niche/Inputs/TwoButton.h index f1e18dd89..ae66adf96 100644 --- a/src/graphics/niche/Inputs/TwoButton.h +++ b/src/graphics/niche/Inputs/TwoButton.h @@ -35,7 +35,7 @@ class TwoButton : protected concurrency::OSThread static TwoButton *getInstance(); // Create or get the singleton instance void start(); // Start handling button input void stop(); // Stop handling button input (disconnect ISRs for sleep) - void setWiring(uint8_t whichButton, uint8_t pin, bool internalPulldown = false); + void setWiring(uint8_t whichButton, uint8_t pin, bool internalPullup = false); void setTiming(uint8_t whichButton, uint32_t debounceMs, uint32_t longpressMs); void setHandlerDown(uint8_t whichButton, Callback onDown); void setHandlerUp(uint8_t whichButton, Callback onUp); @@ -65,7 +65,6 @@ class TwoButton : protected concurrency::OSThread // Per-button config uint8_t pin = 0xFF; // 0xFF: unset bool activeLogic = LOW; // Active LOW by default. Currently unimplemented. - uint8_t mode = INPUT; // Whether to use internal pull up / pull down resistors uint32_t debounceLength = 50; // Minimum length for shortpress, in ms uint32_t longpressLength = 500; // How long after button down to fire longpress, in ms volatile State state = State::REST; // Internal state diff --git a/variants/t-echo/nicheGraphics.h b/variants/t-echo/nicheGraphics.h index f5dde6b19..5862dcdfb 100644 --- a/variants/t-echo/nicheGraphics.h +++ b/variants/t-echo/nicheGraphics.h @@ -112,7 +112,7 @@ void setupNicheGraphics() // Setup the capacitive touch button // - short: momentary backlight // - long: latch backlight on - buttons->setWiring(TOUCH_BUTTON, PIN_BUTTON_TOUCH, LOW); + buttons->setWiring(TOUCH_BUTTON, PIN_BUTTON_TOUCH); buttons->setTiming(TOUCH_BUTTON, 50, 5000); // 5 seconds before latch - limited by T-Echo's capacitive touch IC buttons->setHandlerDown(TOUCH_BUTTON, [backlight]() { backlight->peek(); diff --git a/variants/tlora_t3s3_epaper/nicheGraphics.h b/variants/tlora_t3s3_epaper/nicheGraphics.h new file mode 100644 index 000000000..55bb9a203 --- /dev/null +++ b/variants/tlora_t3s3_epaper/nicheGraphics.h @@ -0,0 +1,102 @@ +#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" + +// #include "graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.h" +// #include "graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h" + +// Shared NicheGraphics components +// -------------------------------- +#include "graphics/niche/Drivers/EInk/DEPG0213BNS800.h" +#include "graphics/niche/Inputs/TwoButton.h" + +#include "graphics/niche/Fonts/FreeSans6pt7b.h" +#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h" +#include + +void setupNicheGraphics() +{ + using namespace NicheGraphics; + + // SPI + // ----------------------------- + + // Display is connected to HSPI + SPIClass *hspi = new SPIClass(HSPI); + hspi->begin(PIN_EINK_SCLK, -1, PIN_EINK_MOSI, PIN_EINK_CS); + + // E-Ink Driver + // ----------------------------- + + // Use E-Ink driver + Drivers::EInk *driver = new Drivers::DEPG0213BNS800; + driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); + + // InkHUD + // ---------------------------- + + InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance(); + + // Set the driver + inkhud->setDriver(driver); + + // Set how many FAST updates per FULL update + // Set how unhealthy additional FAST updates beyond this number are + inkhud->setDisplayResilience(15, 1.5); + + // Prepare fonts + InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b); + InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b); + /* + // Font localization demo: Cyrillic + InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic); + InkHUD::Applet::fontSmall.addSubstitutionsWin1251(); + */ + + // 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 + + // Pick applets + inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet, true, true); // Activated, autoshown + inkhud->addApplet("DMs", new InkHUD::DMApplet); // Inactive + inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive + inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive + inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true); // Activated + inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // Inactive + inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, not autoshown, default on tile 0 + // inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet); + // inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet); + + // Start running InkHUD + inkhud->begin(); + + // Buttons + // -------------------------- + + Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component + + // Setup the main user button + buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin(), true); + buttons->setHandlerShortPress(0, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); + buttons->setHandlerLongPress(0, []() { InkHUD::InkHUD::getInstance()->longpress(); }); + + buttons->start(); +} + +#endif \ No newline at end of file diff --git a/variants/tlora_t3s3_epaper/platformio.ini b/variants/tlora_t3s3_epaper/platformio.ini index 87351e586..957c37b95 100644 --- a/variants/tlora_t3s3_epaper/platformio.ini +++ b/variants/tlora_t3s3_epaper/platformio.ini @@ -7,6 +7,7 @@ upload_protocol = esptool build_flags = ${esp32_base.build_flags} -D TLORA_T3S3_EPAPER -I variants/tlora_t3s3_epaper -DGPS_POWER_TOGGLE + -DUSE_EINK -DEINK_DISPLAY_MODEL=GxEPD2_213_BN -DEINK_WIDTH=250 -DEINK_HEIGHT=122 @@ -16,3 +17,21 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} https://github.com/meshtastic/GxEPD2/archive/b202ebfec6a4821e098cf7a625ba0f6f2400292d.zip + +[env:tlora-t3s3-epaper-inkhud] +extends = esp32s3_base, inkhud +board = tlora-t3s3-v1 +board_check = true +upload_protocol = esptool +build_src_filter = + ${esp32_base.build_src_filter} + ${inkhud.build_src_filter} +build_flags = + ${esp32s3_base.build_flags} + ${inkhud.build_flags} + -I variants/tlora_t3s3_epaper + -D TLORA_T3S3_EPAPER + -D MAX_THREADS=40 ; Required if used with WiFi +lib_deps = + ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX + ${esp32s3_base.lib_deps} \ No newline at end of file diff --git a/variants/tlora_t3s3_epaper/variant.h b/variants/tlora_t3s3_epaper/variant.h index 732869b20..1ed505420 100644 --- a/variants/tlora_t3s3_epaper/variant.h +++ b/variants/tlora_t3s3_epaper/variant.h @@ -2,7 +2,6 @@ #define SDCARD_USE_SPI1 // Display (E-Ink) -#define USE_EINK #define PIN_EINK_CS 15 #define PIN_EINK_BUSY 48 #define PIN_EINK_DC 16 From 78fa4c5c7057232b9b1f70e4e072310b76cb1ff8 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 9 Apr 2025 13:31:40 -0400 Subject: [PATCH 043/461] Setup RenovateBot (#6535) --- .github/dependabot.yml | 29 --------------- .trunk/trunk.yaml | 1 + arch/esp32/esp32.ini | 10 +++++- arch/esp32/esp32c6.ini | 7 +++- arch/esp32/esp32s2.ini | 2 +- arch/esp32/esp32s3.ini | 1 - arch/nrf52/nrf52.ini | 8 +++-- arch/nrf52/nrf52840.ini | 1 + arch/portduino/portduino.ini | 7 +++- arch/rp2xx0/rp2040.ini | 12 +++++-- arch/rp2xx0/rp2350.ini | 14 +++++--- arch/stm32/stm32.ini | 9 +++-- platformio.ini | 49 +++++++++++++++++++++++++ renovate.json | 70 ++++++++++++++++++++++++++++++++++++ 14 files changed, 175 insertions(+), 45 deletions(-) delete mode 100644 .github/dependabot.yml create mode 100644 renovate.json diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index b14290be2..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,29 +0,0 @@ -#trunk-ignore-all(yamllint/quoted-strings): required by dependabot syntax check -version: 2 -updates: - - package-ecosystem: docker - directory: /.devcontainer - schedule: - interval: daily - time: "05:00" - timezone: US/Pacific - - package-ecosystem: docker - directory: / - schedule: - interval: daily - time: "05:00" - timezone: US/Pacific - - package-ecosystem: gitsubmodule - directory: / - schedule: - interval: daily - time: "05:00" - timezone: US/Pacific - ignore: - - dependency-name: protobufs - - package-ecosystem: github-actions - directory: /.github/workflows - schedule: - interval: daily - time: "05:00" - timezone: US/Pacific diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 903b4c298..e74c1a362 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,6 +8,7 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: + - renovate@39.235.2 - prettier@3.5.3 - trufflehog@3.88.23 - yamllint@1.37.0 diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index df3778002..3dfefbdb6 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -2,7 +2,9 @@ [esp32_base] extends = arduino_base custom_esp32_kind = esp32 -platform = platformio/espressif32@6.10.0 +platform = + # renovate: datasource=custom.pio depName=platformio/espressif32 packageName=platformio/platform/espressif32 + platformio/espressif32@6.10.0 build_src_filter = ${arduino_base.build_src_filter} - - - - - @@ -45,11 +47,17 @@ lib_deps = ${networking_base.lib_deps} ${environmental_base.lib_deps} ${radiolib_base.lib_deps} + # renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master https://github.com/meshtastic/esp32_https_server/archive/23665b3adc080a311dcbb586ed5941b5f94d6ea2.zip + # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino h2zero/NimBLE-Arduino@^1.4.3 + # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip + # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib lewisxhe/XPowersLib@^0.2.7 + # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip + # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto rweather/Crypto@^0.4.0 lib_ignore = diff --git a/arch/esp32/esp32c6.ini b/arch/esp32/esp32c6.ini index dba3bac08..e1cf955e8 100644 --- a/arch/esp32/esp32c6.ini +++ b/arch/esp32/esp32c6.ini @@ -1,6 +1,8 @@ [esp32c6_base] extends = esp32_base -platform = https://github.com/Jason2866/platform-espressif32/archive/22faa566df8c789000f8136cd8d0aca49617af55.zip +platform = + # renovate: datasource=git-refs depName=ESP32c6 platform-espressif32 packageName=https://github.com/Jason2866/platform-espressif32 gitBranch=Arduino/IDF5 + https://github.com/Jason2866/platform-espressif32/archive/22faa566df8c789000f8136cd8d0aca49617af55.zip build_flags = ${arduino_base.build_flags} -Wall @@ -24,8 +26,11 @@ lib_deps = ${networking_base.lib_deps} ${environmental_base.lib_deps} ${radiolib_base.lib_deps} + # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib lewisxhe/XPowersLib@^0.2.7 + # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip + # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto rweather/Crypto@^0.4.0 build_src_filter = diff --git a/arch/esp32/esp32s2.ini b/arch/esp32/esp32s2.ini index 40fdc461a..0f97408b8 100644 --- a/arch/esp32/esp32s2.ini +++ b/arch/esp32/esp32s2.ini @@ -16,4 +16,4 @@ build_flags = lib_ignore = ${esp32_base.lib_ignore} NimBLE-Arduino - libpax \ No newline at end of file + libpax diff --git a/arch/esp32/esp32s3.ini b/arch/esp32/esp32s3.ini index 1cd0e2033..8d8b6899e 100644 --- a/arch/esp32/esp32s3.ini +++ b/arch/esp32/esp32s3.ini @@ -3,4 +3,3 @@ extends = esp32_base custom_esp32_kind = esp32s3 monitor_speed = 115200 - diff --git a/arch/nrf52/nrf52.ini b/arch/nrf52/nrf52.ini index ca12be6b1..127f46183 100644 --- a/arch/nrf52/nrf52.ini +++ b/arch/nrf52/nrf52.ini @@ -1,10 +1,14 @@ [nrf52_base] ; Instead of the standard nordicnrf52 platform, we use our fork which has our added variant files -platform = platformio/nordicnrf52@^10.8.0 +platform = + # renovate: datasource=custom.pio depName=platformio/nordicnrf52 packageName=platformio/platform/nordicnrf52 + platformio/nordicnrf52@^10.8.0 extends = arduino_base platform_packages = ; our custom Git version until they merge our PR + # TODO renovate platformio/framework-arduinoadafruitnrf52 @ https://github.com/meshtastic/Adafruit_nRF52_Arduino#e13f5820002a4fb2a5e6754b42ace185277e5adf + # renovate: datasource=custom.pio depName=platformio/toolchain-gccarmnoneeabi packageName=platformio/tool/toolchain-gccarmnoneeabi platformio/toolchain-gccarmnoneeabi@~1.90301.0 build_type = debug @@ -28,4 +32,4 @@ lib_deps= lib_ignore = BluetoothOTA - lvgl \ No newline at end of file + lvgl diff --git a/arch/nrf52/nrf52840.ini b/arch/nrf52/nrf52840.ini index 0dab5d9ba..fb5ba9960 100644 --- a/arch/nrf52/nrf52840.ini +++ b/arch/nrf52/nrf52840.ini @@ -6,6 +6,7 @@ build_flags = ${nrf52_base.build_flags} lib_deps = ${nrf52_base.lib_deps} ${environmental_base.lib_deps} + # renovate: datasource=git-refs depName=Kongduino-Adafruit_nRFCrypto packageName=https://github.com/Kongduino/Adafruit_nRFCrypto gitBranch=master https://github.com/Kongduino/Adafruit_nRFCrypto/archive/e31a8825ea3300b163a0a3c1ddd5de34e10e1371.zip ; Common NRF52 debugging settings follow. See the Meshtastic developer docs for how to connect SWD debugging probes to your board. diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index e0488aeff..07e7db95c 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -1,6 +1,8 @@ ; The Portduino based 'native' environment. Currently supported on Linux targets with real LoRa hardware (or simulated). [portduino_base] -platform = https://github.com/meshtastic/platform-native/archive/c5bd469ab9b5a6966321e09557b27d906961da63.zip +platform = + # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop + https://github.com/meshtastic/platform-native/archive/c5bd469ab9b5a6966321e09557b27d906961da63.zip framework = arduino build_src_filter = @@ -24,8 +26,11 @@ lib_deps = ${env.lib_deps} ${networking_base.lib_deps} ${radiolib_base.lib_deps} + # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto rweather/Crypto@^0.4.0 + # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX lovyan03/LovyanGFX@^1.2.0 + # renovate: datasource=git-refs depName=libch341-spi-userspace packageName=https://github.com/pine64/libch341-spi-userspace gitBranch=main https://github.com/pine64/libch341-spi-userspace/archive/a9b17e3452f7fb747000d9b4ad4409155b39f6ef.zip build_flags = diff --git a/arch/rp2xx0/rp2040.ini b/arch/rp2xx0/rp2040.ini index 33fcfb211..cd7e684b4 100644 --- a/arch/rp2xx0/rp2040.ini +++ b/arch/rp2xx0/rp2040.ini @@ -1,8 +1,13 @@ ; Common settings for rp2040 Processor based targets [rp2040_base] -platform = https://github.com/maxgerhardt/platform-raspberrypi#76ecf3c7e9dd4503af0331154c4ca1cddc4b03e5 ; For arduino-pico >= 4.4.3 +platform = + # TODO renovate + https://github.com/maxgerhardt/platform-raspberrypi#76ecf3c7e9dd4503af0331154c4ca1cddc4b03e5 + ; For arduino-pico >= 4.4.3 extends = arduino_base -platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico#4.4.3 +platform_packages = + # TODO renovate + framework-arduinopico@https://github.com/earlephilhower/arduino-pico#4.4.3 board_build.core = earlephilhower board_build.filesystem_size = 0.5m @@ -24,4 +29,5 @@ lib_deps = ${arduino_base.lib_deps} ${environmental_base.lib_deps} ${radiolib_base.lib_deps} - rweather/Crypto \ No newline at end of file + # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto + rweather/Crypto@0.4.0 diff --git a/arch/rp2xx0/rp2350.ini b/arch/rp2xx0/rp2350.ini index 841035c80..1c7af8be4 100644 --- a/arch/rp2xx0/rp2350.ini +++ b/arch/rp2xx0/rp2350.ini @@ -1,8 +1,13 @@ -; Common settings for rp2040 Processor based targets +; Common settings for rp2350 Processor based targets [rp2350_base] -platform = https://github.com/maxgerhardt/platform-raspberrypi#76ecf3c7e9dd4503af0331154c4ca1cddc4b03e5 ; For arduino-pico >= 4.4.3 +platform = + # TODO renovate + https://github.com/maxgerhardt/platform-raspberrypi#76ecf3c7e9dd4503af0331154c4ca1cddc4b03e5 + ; For arduino-pico >= 4.4.3 extends = arduino_base -platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico#4.4.3 +platform_packages = + # TODO renovate + framework-arduinopico@https://github.com/earlephilhower/arduino-pico#4.4.3 board_build.core = earlephilhower board_build.filesystem_size = 0.5m @@ -21,4 +26,5 @@ lib_deps = ${arduino_base.lib_deps} ${environmental_base.lib_deps} ${radiolib_base.lib_deps} - rweather/Crypto \ No newline at end of file + # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto + rweather/Crypto@0.4.0 diff --git a/arch/stm32/stm32.ini b/arch/stm32/stm32.ini index c1b58bb82..dd190c9d4 100644 --- a/arch/stm32/stm32.ini +++ b/arch/stm32/stm32.ini @@ -1,7 +1,11 @@ [stm32_base] extends = arduino_base -platform = ststm32 -platform_packages = platformio/framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32/archive/2.10.1.zip +platform = + # renovate: datasource=custom.pio depName=platformio/ststm32 packageName=platformio/platform/ststm32 + platformio/ststm32@19.1.0 +platform_packages = + # TODO renovate + platformio/framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32/archive/2.10.1.zip extra_scripts = ${env.extra_scripts} post:extra_scripts/extra_stm32.py @@ -35,6 +39,7 @@ debug_tool = stlink lib_deps = ${env.lib_deps} ${radiolib_base.lib_deps} + # renovate: datasource=git-refs depName=caveman99-stm32-Crypto packageName=https://github.com/caveman99/Crypto gitBranch=main https://github.com/caveman99/Crypto/archive/eae9c768054118a9399690f8af202853d1ae8516.zip lib_ignore = diff --git a/platformio.ini b/platformio.ini index 749aa94c7..844ba261d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -56,12 +56,19 @@ build_flags = -Wno-missing-field-initializers monitor_speed = 115200 monitor_filters = direct lib_deps = + # renovate: datasource=git-refs depName=meshtastic-esp8266-oled-ssd1306 packageName=https://github.com/meshtastic/esp8266-oled-ssd1306 gitBranch=master https://github.com/meshtastic/esp8266-oled-ssd1306/archive/0119501e9983bd894830b02f545c377ee08d66fe.zip + # renovate: datasource=custom.pio depName=OneButton packageName=mathertel/library/OneButton mathertel/OneButton@2.6.1 + # renovate: datasource=git-refs depName=meshtastic-arduino-fsm packageName=https://github.com/meshtastic/arduino-fsm gitBranch=master https://github.com/meshtastic/arduino-fsm/archive/7db3702bf0cfe97b783d6c72595e3f38e0b19159.zip + # renovate: datasource=git-refs depName=meshtastic-TinyGPSPlus packageName=https://github.com/meshtastic/TinyGPSPlus gitBranch=master https://github.com/meshtastic/TinyGPSPlus/archive/71a82db35f3b973440044c476d4bcdc673b104f4.zip + # renovate: datasource=git-refs depName=meshtastic-ArduinoThread packageName=https://github.com/meshtastic/ArduinoThread gitBranch=master https://github.com/meshtastic/ArduinoThread/archive/7c3ee9e1951551b949763b1f5280f8db1fa4068d.zip + # renovate: datasource=custom.pio depName=Nanopb packageName=nanopb/library/Nanopb nanopb/Nanopb@0.4.91 + # renovate: datasource=custom.pio depName=ErriezCRC32 packageName=erriez/library/ErriezCRC32 erriez/ErriezCRC32@1.0.1 ; Used for the code analysis in PIO Home / Inspect @@ -77,6 +84,7 @@ check_flags = framework = arduino lib_deps = ${env.lib_deps} + # renovate: datasource=custom.pio depName=NonBlockingRTTTL packageName=end2endzone/library/NonBlockingRTTTL end2endzone/NonBlockingRTTTL@1.3.0 build_flags = ${env.build_flags} -Os build_src_filter = ${env.build_src_filter} - - @@ -84,57 +92,98 @@ build_src_filter = ${env.build_src_filter} - -.+)$"], + "datasourceTemplate": "github-releases", + "depNameTemplate": "meshtastic/web", + "versioningTemplate": "semver-coerced" + }, + { + "customType": "regex", + "description": "Match normal PIO dependencies", + "fileMatch": [".*\\.ini$"], + "matchStrings": [ + "# renovate: datasource=(?.*?)(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\s+?.+?@(?.+?)\\s" + ], + "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver-coerced{{/if}}" + }, + { + "customType": "regex", + "description": "Match PIO zipped dependencies with github tag ref", + "fileMatch": [".*\\.ini$"], + "matchStrings": [ + "# renovate: datasource=github-tags(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\s+?https:\/\/.+?archive\/(?.+?).zip\\s" + ], + "datasourceTemplate": "github-tags", + "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver-coerced{{/if}}" + }, + { + "customType": "regex", + "description": "Match PIO zipped dependencies with git commit ref", + "fileMatch": [".*\\.ini$"], + "matchStrings": [ + "# renovate: datasource=git-refs(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\sgitBranch=(?.+?)\\s+?https:\/\/.+?archive\/(?.+?).zip\\s" + ], + "datasourceTemplate": "git-refs", + "currentValueTemplate": "{{{gitBranch}}}", + "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}git{{/if}}" + } + ], + "packageRules": [] +} From 0d8e39cc2ad748b5a45407c8c309d1913034989a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 12:46:58 -0500 Subject: [PATCH 044/461] chore(deps): update ntpclient to v3.2.1 (#6545) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 844ba261d..5f3cbe7cd 100644 --- a/platformio.ini +++ b/platformio.ini @@ -95,7 +95,7 @@ lib_deps = # renovate: datasource=custom.pio depName=PubSubClient packageName=knolleary/library/PubSubClient knolleary/PubSubClient@2.8 # renovate: datasource=custom.pio depName=NTPClient packageName=arduino-libraries/library/NTPClient - arduino-libraries/NTPClient@3.1.0 + arduino-libraries/NTPClient@3.2.1 # renovate: datasource=custom.pio depName=Syslog packageName=arcao/library/Syslog arcao/Syslog@2.0.0 From 8e40d88e2436e00a7a5f7f23312f90a07cff1430 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 12:56:36 -0500 Subject: [PATCH 045/461] chore(deps): update platform-native digest to 46f509b (#6540) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/portduino/portduino.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 07e7db95c..7d2569c32 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/c5bd469ab9b5a6966321e09557b27d906961da63.zip + https://github.com/meshtastic/platform-native/archive/46f509b96ddce22d1bf38efc93319dfb3e4f5acf.zip framework = arduino build_src_filter = From 1888342a5701cfbab620d889f1893fbc93181930 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 12:57:21 -0500 Subject: [PATCH 046/461] chore(deps): update platformio/toolchain-gccarmnoneeabi to v1.140201.0 (#6546) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/nrf52/nrf52.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/nrf52/nrf52.ini b/arch/nrf52/nrf52.ini index 127f46183..e311089ae 100644 --- a/arch/nrf52/nrf52.ini +++ b/arch/nrf52/nrf52.ini @@ -9,7 +9,7 @@ platform_packages = # TODO renovate platformio/framework-arduinoadafruitnrf52 @ https://github.com/meshtastic/Adafruit_nRF52_Arduino#e13f5820002a4fb2a5e6754b42ace185277e5adf # renovate: datasource=custom.pio depName=platformio/toolchain-gccarmnoneeabi packageName=platformio/tool/toolchain-gccarmnoneeabi - platformio/toolchain-gccarmnoneeabi@~1.90301.0 + platformio/toolchain-gccarmnoneeabi@1.140201.0 build_type = debug build_flags = From 456f94511f45844dae9db709ec79486046c755d8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 12:57:43 -0500 Subject: [PATCH 047/461] chore(deps): update libch341-spi-userspace digest to af9bc27 (#6539) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/portduino/portduino.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 7d2569c32..6df3854f4 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -31,7 +31,7 @@ lib_deps = # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX lovyan03/LovyanGFX@^1.2.0 # renovate: datasource=git-refs depName=libch341-spi-userspace packageName=https://github.com/pine64/libch341-spi-userspace gitBranch=main - https://github.com/pine64/libch341-spi-userspace/archive/a9b17e3452f7fb747000d9b4ad4409155b39f6ef.zip + https://github.com/pine64/libch341-spi-userspace/archive/af9bc27c9c30fa90772279925b7c5913dff789b4.zip build_flags = ${arduino_base.build_flags} From daa03aba306375324c8a59d4464149bb9697633a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 13:02:42 -0500 Subject: [PATCH 048/461] chore(deps): update meshtastic-esp32_https_server digest to 896f177 (#6542) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/esp32/esp32.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 3dfefbdb6..5e15cb451 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -48,7 +48,7 @@ lib_deps = ${environmental_base.lib_deps} ${radiolib_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master - https://github.com/meshtastic/esp32_https_server/archive/23665b3adc080a311dcbb586ed5941b5f94d6ea2.zip + https://github.com/meshtastic/esp32_https_server/archive/896f1771ceb5979987a0b41028bf1b4e7aad419b.zip # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino h2zero/NimBLE-Arduino@^1.4.3 # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master From e98da27446a9878984f7197d06a3191c67e72a5c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 13:38:21 -0500 Subject: [PATCH 049/461] chore(deps): update ubuntu to v24 (#6541) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/sec_sast_semgrep_cron.yml | 2 +- .github/workflows/sec_sast_semgrep_pull.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sec_sast_semgrep_cron.yml b/.github/workflows/sec_sast_semgrep_cron.yml index db308c9f5..d7eef29b4 100644 --- a/.github/workflows/sec_sast_semgrep_cron.yml +++ b/.github/workflows/sec_sast_semgrep_cron.yml @@ -13,7 +13,7 @@ permissions: jobs: semgrep-full: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 container: image: semgrep/semgrep diff --git a/.github/workflows/sec_sast_semgrep_pull.yml b/.github/workflows/sec_sast_semgrep_pull.yml index 527a5c076..3707c91b8 100644 --- a/.github/workflows/sec_sast_semgrep_pull.yml +++ b/.github/workflows/sec_sast_semgrep_pull.yml @@ -6,7 +6,7 @@ permissions: read-all jobs: semgrep-diff: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 container: image: semgrep/semgrep From 1008a08c9911a849952158c9276ada5275de4dfa Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 9 Apr 2025 16:36:53 -0400 Subject: [PATCH 050/461] =?UTF-8?q?Revert=20"chore(deps):=20update=20platf?= =?UTF-8?q?ormio/toolchain-gccarmnoneeabi=20to=20v1.140201.=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1888342a5701cfbab620d889f1893fbc93181930. --- arch/nrf52/nrf52.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/nrf52/nrf52.ini b/arch/nrf52/nrf52.ini index e311089ae..127f46183 100644 --- a/arch/nrf52/nrf52.ini +++ b/arch/nrf52/nrf52.ini @@ -9,7 +9,7 @@ platform_packages = # TODO renovate platformio/framework-arduinoadafruitnrf52 @ https://github.com/meshtastic/Adafruit_nRF52_Arduino#e13f5820002a4fb2a5e6754b42ace185277e5adf # renovate: datasource=custom.pio depName=platformio/toolchain-gccarmnoneeabi packageName=platformio/tool/toolchain-gccarmnoneeabi - platformio/toolchain-gccarmnoneeabi@1.140201.0 + platformio/toolchain-gccarmnoneeabi@~1.90301.0 build_type = debug build_flags = From 5c13f3451cf710a2f0e65b4f7872532c13520f71 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 16:10:01 -0500 Subject: [PATCH 051/461] chore(deps): update meshtastic-device-ui digest to 9345b03 (#6552) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 5f3cbe7cd..3c052e6ad 100644 --- a/platformio.ini +++ b/platformio.ini @@ -107,7 +107,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/56ef8db7eb4dda44dc0c1ec5828044debbbc6d33.zip + https://github.com/meshtastic/device-ui/archive/9345b03d47d3e2be91125325842b8bced0daaf86.zip ; Common libs for environmental measurements in telemetry module ; (not included in native / portduino) From 3694805938777e2be05385cf33f8b901fb840724 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 9 Apr 2025 18:40:14 -0400 Subject: [PATCH 052/461] renovate: Link PIO deps to PlatformIO page (#6548) --- renovate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 417e17d9b..bf6ffdd4b 100644 --- a/renovate.json +++ b/renovate.json @@ -21,7 +21,7 @@ "defaultRegistryUrlTemplate": "https://api.registry.platformio.org/v3/packages/{{packageName}}", "format": "json", "transformTemplates": [ - "{\"releases\": [$map($.versions, function($v) { { \"version\": $v.name, \"releaseTimestamp\": $v.released_at } })] }" + "{\"releases\": [$map($.versions, function($v) { { \"version\": $v.name, \"releaseTimestamp\": $v.released_at } })], \"homepage\": $encodeUrl($join([\"https://registry.platformio.org/\",$.type,\"/\",$.owner.username,\"/\",$.name])) }" ] } }, From 06ce6f3e8a31e062f6ad5af8d1de165a62128cd4 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Thu, 10 Apr 2025 11:48:40 +1200 Subject: [PATCH 053/461] fix: remove redundant GPS code targeting Heltec T114 (#6497) --- src/gps/GPS.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 689f5e204..55f62d8ad 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -810,13 +810,6 @@ void GPS::setPowerState(GPSPowerState newState, uint32_t sleepTime) powerState = newState; LOG_INFO("GPS power state move from %s to %s", getGPSPowerStateString(oldState), getGPSPowerStateString(newState)); -#ifdef HELTEC_MESH_NODE_T114 - if ((oldState == GPS_OFF || oldState == GPS_HARDSLEEP) && (newState != GPS_OFF && newState != GPS_HARDSLEEP)) { - _serial_gps->begin(serialSpeeds[speedSelect]); - } else if ((newState == GPS_OFF || newState == GPS_HARDSLEEP) && (oldState != GPS_OFF && oldState != GPS_HARDSLEEP)) { - _serial_gps->end(); - } -#endif switch (newState) { case GPS_ACTIVE: case GPS_IDLE: From 91f38797a8c770b693a30ee52f5be6d81bcf14c9 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 9 Apr 2025 20:23:15 -0400 Subject: [PATCH 054/461] Don't renovate toolchain-gccarmnoneeabi (#6554) --- arch/nrf52/nrf52.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/nrf52/nrf52.ini b/arch/nrf52/nrf52.ini index 127f46183..d49d8920c 100644 --- a/arch/nrf52/nrf52.ini +++ b/arch/nrf52/nrf52.ini @@ -8,7 +8,7 @@ platform_packages = ; our custom Git version until they merge our PR # TODO renovate platformio/framework-arduinoadafruitnrf52 @ https://github.com/meshtastic/Adafruit_nRF52_Arduino#e13f5820002a4fb2a5e6754b42ace185277e5adf - # renovate: datasource=custom.pio depName=platformio/toolchain-gccarmnoneeabi packageName=platformio/tool/toolchain-gccarmnoneeabi + ; Don't renovate toolchain-gccarmnoneeabi platformio/toolchain-gccarmnoneeabi@~1.90301.0 build_type = debug From 854d74f8db468e0be0db9e8c60bdbf43e22a4a5b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 22:18:42 +0200 Subject: [PATCH 055/461] chore(deps): update meshtastic-device-ui digest to acf343b (#6559) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 3c052e6ad..647114537 100644 --- a/platformio.ini +++ b/platformio.ini @@ -107,7 +107,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/9345b03d47d3e2be91125325842b8bced0daaf86.zip + https://github.com/meshtastic/device-ui/archive/acf343b73cedbdcd5838ba1407c054974a0b6914.zip ; Common libs for environmental measurements in telemetry module ; (not included in native / portduino) From 4ef9eae69571517b6954d4292691603682c5938c Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 11 Apr 2025 07:02:55 -0400 Subject: [PATCH 056/461] Portduino: Set C standard to 17 (#6561) --- arch/portduino/portduino.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 6df3854f4..1d731f6b7 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -47,4 +47,5 @@ build_flags = -lyaml-cpp -li2c -luv + -std=gnu17 -std=c++17 From baa05aacf53b910b206b39fb4b55395d2103ab69 Mon Sep 17 00:00:00 2001 From: Ken Piper Date: Fri, 11 Apr 2025 06:04:37 -0500 Subject: [PATCH 057/461] fix: Correct underlying cause of T-Watch not functioning when set to a 16MB filesystem (#6563) * Fix maximum flash size in T-Watch S3 board definition * Revert "Fix: T-Watch-S3 has 8MB Flash (#6407)" This reverts commit 769f0623be6a7d7503c56bc1b6e468114dacdff0. --- bin/device-install.bat | 4 ++-- bin/device-install.sh | 2 +- boards/t-watch-s3.json | 6 +++--- variants/t-watch-s3/platformio.ini | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/device-install.bat b/bin/device-install.bat index 594d973f5..3ffca0b63 100755 --- a/bin/device-install.bat +++ b/bin/device-install.bat @@ -17,8 +17,8 @@ SET "LOGCOUNTER=0" SET "S3=s3 v3 t-deck wireless-paper wireless-tracker station-g2 unphone" SET "C3=esp32c3" @REM FIXME: Determine flash size from PlatformIO variant, this is unmaintainable. -SET "BIGDB_8MB=picomputer-s3 unphone seeed-sensecap-indicator crowpanel-esp32s3 heltec_capsule_sensor_v3 heltec-v3 heltec-vision-master-e213 heltec-vision-master-e290 heltec-vision-master-t190 heltec-wireless-paper heltec-wireless-tracker heltec-wsl-v3 icarus seeed-xiao-s3 tbeam-s3-core t-watch-s3 tracksenger" -SET "BIGDB_16MB=t-deck mesh-tab t-energy-s3 dreamcatcher ESP32-S3-Pico m5stack-cores3 station-g2 t-eth-elite" +SET "BIGDB_8MB=picomputer-s3 unphone seeed-sensecap-indicator crowpanel-esp32s3 heltec_capsule_sensor_v3 heltec-v3 heltec-vision-master-e213 heltec-vision-master-e290 heltec-vision-master-t190 heltec-wireless-paper heltec-wireless-tracker heltec-wsl-v3 icarus seeed-xiao-s3 tbeam-s3-core tracksenger" +SET "BIGDB_16MB=t-deck mesh-tab t-energy-s3 dreamcatcher ESP32-S3-Pico m5stack-cores3 station-g2 t-eth-elite t-watch-s3" GOTO getopts :help diff --git a/bin/device-install.sh b/bin/device-install.sh index 796626a9d..a43ccbdb4 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -22,7 +22,6 @@ BIGDB_8MB=( "icarus" "seeed-xiao-s3" "tbeam-s3-core" - "t-watch-s3" "tracksenger" ) BIGDB_16MB=( @@ -34,6 +33,7 @@ BIGDB_16MB=( "m5stack-cores3" "station-g2" "t-eth-elite" + "t-watch-s3" ) S3_VARIANTS=( "s3" diff --git a/boards/t-watch-s3.json b/boards/t-watch-s3.json index 51bb7cf4b..bae4f47b0 100644 --- a/boards/t-watch-s3.json +++ b/boards/t-watch-s3.json @@ -24,16 +24,16 @@ "mcu": "esp32s3", "variant": "t-watch-s3" }, - "connectivity": ["wifi", "bluetooth"], + "connectivity": ["wifi", "bluetooth", "lora"], "debug": { "openocd_target": "esp32s3.cfg" }, "frameworks": ["arduino"], "name": "LilyGo T-Watch 2020 V3", "upload": { - "flash_size": "8MB", + "flash_size": "16MB", "maximum_ram_size": 327680, - "maximum_size": 8388608, + "maximum_size": 16777216, "require_upload_port": true, "use_1200bps_touch": true, "wait_for_upload_port": true, diff --git a/variants/t-watch-s3/platformio.ini b/variants/t-watch-s3/platformio.ini index d650b1f11..f98237943 100644 --- a/variants/t-watch-s3/platformio.ini +++ b/variants/t-watch-s3/platformio.ini @@ -3,7 +3,7 @@ extends = esp32s3_base board = t-watch-s3 board_check = true -board_build.partitions = default_8MB.csv +board_build.partitions = default_16MB.csv upload_protocol = esptool build_flags = ${esp32_base.build_flags} From 7079f538edc1d90560453e5246218a95db5eba25 Mon Sep 17 00:00:00 2001 From: Kevin Jahaziel Leon Morales Date: Fri, 11 Apr 2025 04:26:30 -0700 Subject: [PATCH 058/461] feat: Add Electronic Cats variant for Catsniffer (#6483) * feat: Add Electronic Cats variant for catsniffer * fix: Trunk fmt * fix: Variant error --- variants/ec_catsniffer/platformio.ini | 15 ++++++++++ variants/ec_catsniffer/variant.cpp | 39 +++++++++++++++++++++++++ variants/ec_catsniffer/variant.h | 41 +++++++++++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 variants/ec_catsniffer/platformio.ini create mode 100644 variants/ec_catsniffer/variant.cpp create mode 100644 variants/ec_catsniffer/variant.h diff --git a/variants/ec_catsniffer/platformio.ini b/variants/ec_catsniffer/platformio.ini new file mode 100644 index 000000000..9afb44236 --- /dev/null +++ b/variants/ec_catsniffer/platformio.ini @@ -0,0 +1,15 @@ +[env:catsniffer] +extends = rp2040_base +board = rpipico +upload_protocol = picotool + +build_flags = ${rp2040_base.build_flags} + -DRPI_PICO + -Ivariants/ec_catsniffer + -DDEBUG_RP2040_PORT=Serial + # -DHW_SPI1_DEVICE + -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus" +lib_deps = + ${rp2040_base.lib_deps} +debug_build_flags = ${rp2040_base.build_flags}, -g +debug_tool = cmsis-dap \ No newline at end of file diff --git a/variants/ec_catsniffer/variant.cpp b/variants/ec_catsniffer/variant.cpp new file mode 100644 index 000000000..db5226541 --- /dev/null +++ b/variants/ec_catsniffer/variant.cpp @@ -0,0 +1,39 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "variant.h" +#include "wiring_constants.h" +#include "wiring_digital.h" + +#define CTF1 8 +#define CTF2 9 +#define CTF3 10 + +void initVariant() +{ + // Config the LoRa Switch + pinMode(CTF1, OUTPUT); + pinMode(CTF2, OUTPUT); + pinMode(CTF3, OUTPUT); + + digitalWrite(CTF1, HIGH); + digitalWrite(CTF2, LOW); + digitalWrite(CTF3, LOW); +} \ No newline at end of file diff --git a/variants/ec_catsniffer/variant.h b/variants/ec_catsniffer/variant.h new file mode 100644 index 000000000..400074e59 --- /dev/null +++ b/variants/ec_catsniffer/variant.h @@ -0,0 +1,41 @@ +// #define RADIOLIB_CUSTOM_ARDUINO 1 +// #define RADIOLIB_TONE_UNSUPPORTED 1 +// #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED 1 + +#define ARDUINO_ARCH_AVR + +#define HAS_SCREEN 0 +#define HAS_GPS 0 +#undef GPS_RX_PIN +#undef GPS_TX_PIN + +#define LED_PIN 27 + +#define USE_SX1262 + +#undef LORA_SCK +#undef LORA_MISO +#undef LORA_MOSI +#undef LORA_CS + +#define LORA_SCK 18 +#define LORA_MISO 16 +#define LORA_MOSI 19 +#define LORA_CS 17 // NSS + +#define LORA_DIO0 5 +#define LORA_RESET 24 +#define LORA_DIO1 4 +#define LORA_DIO2 23 +#define LORA_DIO3 25 +#define SX126X_RXEN 21 +#define SX126X_TXEN 20 + +#ifdef USE_SX1262 +#define SX126X_CS LORA_CS +#define SX126X_DIO1 LORA_DIO0 +#define SX126X_BUSY LORA_DIO1 +#define SX126X_RESET LORA_RESET +// #define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 0 +#endif From e9570090193cca7d428dcd951220a280116b54e4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 11 Apr 2025 07:48:13 -0500 Subject: [PATCH 059/461] Upgrade trunk (#6564) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index e74c1a362..ba0dd97cc 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,7 +8,7 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - renovate@39.235.2 + - renovate@39.238.1 - prettier@3.5.3 - trufflehog@3.88.23 - yamllint@1.37.0 From e7ce910c3b6613ca50ce8133e3998758c3f07eaa Mon Sep 17 00:00:00 2001 From: Tavis Date: Fri, 11 Apr 2025 07:38:44 -1000 Subject: [PATCH 060/461] Add generic thread module (#5484) * compiling, untested * use INCLUDE not EXLUDE for option to include module * protobuf update * working genericthread module Update protobufs * use EXCLUDE style instead of INCLUDE * Update Modules.cpp --------- Co-authored-by: Ben Meadors --- platformio.ini | 1 + src/modules/GenericThreadModule.cpp | 28 ++++++++++++++++++++++++++++ src/modules/GenericThreadModule.h | 21 +++++++++++++++++++++ src/modules/Modules.cpp | 9 ++++++++- 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/modules/GenericThreadModule.cpp create mode 100644 src/modules/GenericThreadModule.h diff --git a/platformio.ini b/platformio.ini index 647114537..e1eabf952 100644 --- a/platformio.ini +++ b/platformio.ini @@ -50,6 +50,7 @@ build_flags = -Wno-missing-field-initializers -DMESHTASTIC_EXCLUDE_REMOTEHARDWARE=1 -DMESHTASTIC_EXCLUDE_HEALTH_TELEMETRY=1 -DMESHTASTIC_EXCLUDE_POWERSTRESS=1 ; exclude power stress test module from main firmware + -DMESHTASTIC_EXCLUDE_GENERIC_THREAD_MODULE=1 #-DBUILD_EPOCH=$UNIX_TIME #-D OLED_PL=1 diff --git a/src/modules/GenericThreadModule.cpp b/src/modules/GenericThreadModule.cpp new file mode 100644 index 000000000..eb92566bd --- /dev/null +++ b/src/modules/GenericThreadModule.cpp @@ -0,0 +1,28 @@ +#include "GenericThreadModule.h" +#include "MeshService.h" +#include "configuration.h" +#include + +/* +Generic Thread Module allows for the execution of custom code at a set interval. +*/ +GenericThreadModule *genericThreadModule; + +GenericThreadModule::GenericThreadModule() : concurrency::OSThread("GenericThreadModule") {} + +int32_t GenericThreadModule::runOnce() +{ + + bool enabled = true; + if (!enabled) + return disable(); + + if (firstTime) { + // do something the first time we run + firstTime = 0; + LOG_INFO("first time GenericThread running"); + } + + LOG_INFO("GenericThread executing"); + return (my_interval); +} diff --git a/src/modules/GenericThreadModule.h b/src/modules/GenericThreadModule.h new file mode 100644 index 000000000..05f7946bb --- /dev/null +++ b/src/modules/GenericThreadModule.h @@ -0,0 +1,21 @@ +#pragma once + +#include "MeshModule.h" +#include "concurrency/OSThread.h" +#include "configuration.h" +#include +#include + +class GenericThreadModule : private concurrency::OSThread +{ + bool firstTime = 1; + + public: + GenericThreadModule(); + + protected: + unsigned int my_interval = 10000; // interval in millisconds + virtual int32_t runOnce() override; +}; + +extern GenericThreadModule *genericThreadModule; diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp index e2a4a970c..1f2b50057 100644 --- a/src/modules/Modules.cpp +++ b/src/modules/Modules.cpp @@ -65,6 +65,10 @@ #if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_POWER_TELEMETRY #include "modules/Telemetry/PowerTelemetry.h" #endif +#if !MESHTASTIC_EXCLUDE_GENERIC_THREAD_MODULE +#include "modules/GenericThreadModule.h" +#endif + #ifdef ARCH_ESP32 #if defined(USE_SX1280) && !MESHTASTIC_EXCLUDE_AUDIO #include "modules/esp32/AudioModule.h" @@ -131,6 +135,9 @@ void setupModules() #if !MESHTASTIC_EXCLUDE_DROPZONE dropzoneModule = new DropzoneModule(); +#endif +#if !MESHTASTIC_EXCLUDE_GENERIC_THREAD_MODULE + new GenericThreadModule(); #endif // Note: if the rest of meshtastic doesn't need to explicitly use your module, you do not need to assign the instance // to a global variable. @@ -249,4 +256,4 @@ void setupModules() // NOTE! This module must be added LAST because it likes to check for replies from other modules and avoid sending extra // acks routingModule = new RoutingModule(); -} \ No newline at end of file +} From e7d0837d014271c9d3e8a2b1d61b75102cf4184c Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 11 Apr 2025 16:54:53 -0400 Subject: [PATCH 061/461] Add Meshtastic Linux desktop metadata (#6568) --- bin/org.meshtastic.meshtasticd.desktop | 8 ++ bin/org.meshtastic.meshtasticd.metainfo.xml | 94 +++++++++++++++++++++ bin/org.meshtastic.meshtasticd.svg | 16 ++++ 3 files changed, 118 insertions(+) create mode 100644 bin/org.meshtastic.meshtasticd.desktop create mode 100644 bin/org.meshtastic.meshtasticd.metainfo.xml create mode 100644 bin/org.meshtastic.meshtasticd.svg diff --git a/bin/org.meshtastic.meshtasticd.desktop b/bin/org.meshtastic.meshtasticd.desktop new file mode 100644 index 000000000..215c7ee05 --- /dev/null +++ b/bin/org.meshtastic.meshtasticd.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Meshtastic +Comment=Meshtastic App +Exec=meshtasticd +Icon=org.meshtastic.meshtasticd +Terminal=true +Type=Application +Categories=Network;Chat;HamRadio; \ No newline at end of file diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml new file mode 100644 index 000000000..a9e6cbdf5 --- /dev/null +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -0,0 +1,94 @@ + + + org.meshtastic.meshtasticd + + Meshtastic + Decentralized mesh communication + + CC-BY-4.0 + GPL-3.0-or-later + + + Meshtastic + + + +

+ Meshtastic is an open source project for creating off-grid, affordable, and resilient communication with LoRa mesh networks. +

+
+ + org.meshtastic.meshtasticd.desktop + + + Network + Chat + HamRadio + + + mesh + LoRa + + + + keyboard + pointing + touch + + + 360 + + + + #97be89 + #206538 + + + + intense + intense + + + https://github.com/meshtastic/firmware/issues + https://meshtastic.org/ + https://opencollective.com/meshtastic + https://meshtastic.org/docs/software/linux/usage/ + https://github.com/meshtastic/firmware/ + + + + https://meshtastic.org/img/software/meshtastic-ui/mui_home_dashboard_dark.webp + Home Dashboard + + + https://meshtastic.org/img/software/meshtastic-ui/mui_initial_boot.webp + Setup + + + https://meshtastic.org/img/software/meshtastic-ui/mui_node_list_dark.webp + Nodes List + + + https://meshtastic.org/img/software/meshtastic-ui/mui_chat_list_dark.webp + Chats List + + + https://meshtastic.org/img/software/meshtastic-ui/mui_chat_message_dark.webp + Messages + + + https://meshtastic.org/img/software/meshtastic-ui/mui_map_dark.webp + Map + + + https://meshtastic.org/img/software/meshtastic-ui/mui_settings_dark.webp + Settings + + + + + + https://github.com/meshtastic/firmware/releases/tag/v2.6.4.b89355f + + +
\ No newline at end of file diff --git a/bin/org.meshtastic.meshtasticd.svg b/bin/org.meshtastic.meshtasticd.svg new file mode 100644 index 000000000..e6863f6a6 --- /dev/null +++ b/bin/org.meshtastic.meshtasticd.svg @@ -0,0 +1,16 @@ + + + +Created with Fabric.js 4.6.0 + + + + + + + + + + + + \ No newline at end of file From e4c2730f71f7002a374bcf17cd30f3dbc47b8036 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 12 Apr 2025 19:47:36 +0200 Subject: [PATCH 062/461] chore(deps): update meshtastic-device-ui digest to 13f69c5 (#6567) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index e1eabf952..b0d9d6237 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/acf343b73cedbdcd5838ba1407c054974a0b6914.zip + https://github.com/meshtastic/device-ui/archive/13f69c5f8d992b9e028d036bfc9b6485183e742f.zip ; Common libs for environmental measurements in telemetry module ; (not included in native / portduino) From 3eb845eaae6421de8a642a7d7c85cef6ec7657e4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 12 Apr 2025 19:28:37 -0500 Subject: [PATCH 063/461] chore(deps): update meshtastic-device-ui digest to 3cdb8a6 (#6572) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index b0d9d6237..bba4dfe18 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/13f69c5f8d992b9e028d036bfc9b6485183e742f.zip + https://github.com/meshtastic/device-ui/archive/3cdb8a63039aa2cf426104ab02656996730f79fa.zip ; Common libs for environmental measurements in telemetry module ; (not included in native / portduino) From 28e62e53e5dd83888ecf1bf5bd288c3684fcde62 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 07:50:09 -0500 Subject: [PATCH 064/461] Upgrade trunk (#6581) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index ba0dd97cc..01e8f8d1b 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -4,7 +4,7 @@ cli: plugins: sources: - id: trunk - ref: v1.6.7 + ref: v1.6.8 uri: https://github.com/trunk-io/plugins lint: enabled: @@ -16,7 +16,7 @@ lint: - terrascan@1.19.9 - trivy@0.61.0 - taplo@0.9.3 - - ruff@0.11.4 + - ruff@0.11.5 - isort@6.0.1 - markdownlint@0.44.0 - oxipng@9.1.4 From c4dc3472ac3d8f987bb905a570b2c2a5dbd785c2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 01:09:32 +0200 Subject: [PATCH 065/461] chore(deps): update meshtastic-device-ui digest to 3fde170 (#6586) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index bba4dfe18..f22d92b2e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/3cdb8a63039aa2cf426104ab02656996730f79fa.zip + https://github.com/meshtastic/device-ui/archive/3fde170dca16863218cec133e05c5f2fc8d6e59a.zip ; Common libs for environmental measurements in telemetry module ; (not included in native / portduino) From b46aad85ccd765edf75a45b8434833a85d2910d2 Mon Sep 17 00:00:00 2001 From: "Aaron.Lee" <32860565+Heltec-Aaron-Lee@users.noreply.github.com> Date: Tue, 15 Apr 2025 11:34:30 +0800 Subject: [PATCH 066/461] Add new hardware: Heltec MeshPocket (#6533) * Add Heltec MeshPocket. * MeshPocket source code update * Optimiz code for refresh border during full update. * Update Heltec MeshPocket json file info. --- boards/heltec_mesh_pocket.json | 54 +++++++ src/graphics/EInkDisplay2.cpp | 16 ++- src/graphics/EInkDisplay2.h | 4 + .../niche/Drivers/EInk/LCMEN2R13ECC1.cpp | 68 +++++++++ .../niche/Drivers/EInk/LCMEN2R13ECC1.h | 41 ++++++ src/platform/nrf52/architecture.h | 2 + src/power.h | 4 + variants/heltec_mesh_pocket/nicheGraphics.h | 107 ++++++++++++++ variants/heltec_mesh_pocket/platformio.ini | 92 ++++++++++++ variants/heltec_mesh_pocket/variant.cpp | 13 ++ variants/heltec_mesh_pocket/variant.h | 135 ++++++++++++++++++ 11 files changed, 535 insertions(+), 1 deletion(-) create mode 100644 boards/heltec_mesh_pocket.json create mode 100644 src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.cpp create mode 100644 src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h create mode 100644 variants/heltec_mesh_pocket/nicheGraphics.h create mode 100644 variants/heltec_mesh_pocket/platformio.ini create mode 100644 variants/heltec_mesh_pocket/variant.cpp create mode 100644 variants/heltec_mesh_pocket/variant.h diff --git a/boards/heltec_mesh_pocket.json b/boards/heltec_mesh_pocket.json new file mode 100644 index 000000000..a35387857 --- /dev/null +++ b/boards/heltec_mesh_pocket.json @@ -0,0 +1,54 @@ +{ + "build": { + "arduino": { + "ldscript": "nrf52840_s140_v6.ld" + }, + "core": "nRF5", + "cpu": "cortex-m4", + "extra_flags": "-DNRF52840_XXAA", + "f_cpu": "64000000L", + "hwids": [ + ["0x239A", "0x4405"], + ["0x239A", "0x0029"], + ["0x239A", "0x002A"] + ], + "usb_product": "HT-n5262", + "mcu": "nrf52840", + "variant": "heltec_mesh_pocket", + "variants_dir": "variants", + "bsp": { + "name": "adafruit" + }, + "softdevice": { + "sd_flags": "-DS140", + "sd_name": "s140", + "sd_version": "6.1.1", + "sd_fwid": "0x00B6" + }, + "bootloader": { + "settings_addr": "0xFF000" + } + }, + "connectivity": ["bluetooth"], + "debug": { + "jlink_device": "nRF52840_xxAA", + "onboard_tools": ["jlink"], + "svd_path": "nrf52840.svd", + "openocd_target": "nrf52840-mdk-rs" + }, + "frameworks": ["arduino"], + "name": "Heltec nrf (Adafruit BSP)", + "upload": { + "maximum_ram_size": 248832, + "maximum_size": 815104, + "speed": 115200, + "protocol": "nrfutil", + "protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"], + "use_1200bps_touch": true, + "require_upload_port": true, + "wait_for_upload_port": true + }, + "url": "https://heltec.org/project/meshpocket/", + "vendor": "Heltec" + } + \ No newline at end of file diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index d2d373d24..737fcc3f0 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -181,7 +181,6 @@ bool EInkDisplay::connect() // Start HSPI hspi = new SPIClass(HSPI); hspi->begin(PIN_EINK_SCLK, -1, PIN_EINK_MOSI, PIN_EINK_CS); // SCLK, MISO, MOSI, SS - // VExt already enabled in setup() // RTC GPIO hold disabled in setup() @@ -218,6 +217,21 @@ bool EInkDisplay::connect() adafruitDisplay->setRotation(1); adafruitDisplay->setPartialWindow(0, 0, EINK_WIDTH, EINK_HEIGHT); } +#elif defined(HELTEC_MESH_POCKET) + { + spi1=&SPI1; + spi1->begin(); + // VExt already enabled in setup() + // RTC GPIO hold disabled in setup() + + // Create GxEPD2 objects + auto lowLevel = new EINK_DISPLAY_MODEL(PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY, *spi1); + adafruitDisplay = new GxEPD2_BW(*lowLevel); + + // Init GxEPD2 + adafruitDisplay->init(); + adafruitDisplay->setRotation(3); + } #endif return true; diff --git a/src/graphics/EInkDisplay2.h b/src/graphics/EInkDisplay2.h index 9c1c8d18e..93be197b0 100644 --- a/src/graphics/EInkDisplay2.h +++ b/src/graphics/EInkDisplay2.h @@ -73,6 +73,10 @@ class EInkDisplay : public OLEDDisplay SPIClass *hspi = NULL; #endif +#if defined(HELTEC_MESH_POCKET) + SPIClass *spi1 = NULL; +#endif + private: // FIXME quick hack to limit drawing to a very slow rate uint32_t lastDrawMsec = 0; diff --git a/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.cpp b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.cpp new file mode 100644 index 000000000..5e21c00f6 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.cpp @@ -0,0 +1,68 @@ +#include "./LCMEN2R13ECC1.h" + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +using namespace NicheGraphics::Drivers; + +// Map the display controller IC's output to the connected panel +void LCMEN2R13ECC1::configScanning() +{ + // "Driver output control" + sendCommand(0x01); + sendData(0xF9); + sendData(0x00); + sendData(0x00); + + // To-do: delete this method? + // Values set here might be redundant: F9, 00, 00 seems to be default +} + +// Specify which information is used to control the sequence of voltages applied to move the pixels +// - For this display, configUpdateSequence() specifies that a suitable LUT will be loaded from +// the controller IC's OTP memory, when the update procedure begins. +void LCMEN2R13ECC1::configWaveform() +{ + switch (updateType) { + case FAST: + sendCommand(0x3C); // Border waveform: + sendData(0x85); + break; + + case FULL: + default: + // From OTP memory + break; + } +} + +void LCMEN2R13ECC1::configUpdateSequence() +{ + switch (updateType) { + case FAST: + sendCommand(0x22); // Set "update sequence" + sendData(0xFF); // Will load LUT from OTP memory, Display mode 2 "differential refresh" + break; + + case FULL: + default: + sendCommand(0x22); // Set "update sequence" + sendData(0xF7); // Will load LUT from OTP memory + break; + } +} + +// Once the refresh operation has been started, +// begin periodically polling the display to check for completion, using the normal Meshtastic threading code +// Only used when refresh is "async" +void LCMEN2R13ECC1::detachFromUpdate() +{ + switch (updateType) { + case FAST: + return beginPolling(50, 800); // At least 500ms for fast refresh + case FULL: + default: + return beginPolling(100, 2500); // At least 2 seconds for full refresh + } +} + +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h new file mode 100644 index 000000000..7b0aed282 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h @@ -0,0 +1,41 @@ +/* + +E-Ink display driver + - SSD1680 + - Manufacturer: WISEVAST + - Size: 2.13 inch + - Resolution: 122px x 255px + - Flex connector marking: Soldering connector, no connector is needed + +*/ + +#pragma once + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +#include "configuration.h" + +#include "./SSD16XX.h" + +namespace NicheGraphics::Drivers +{ +class LCMEN2R13ECC1 : public SSD16XX +{ + // Display properties + private: + static constexpr uint32_t width = 122; + static constexpr uint32_t height = 250; + static constexpr UpdateTypes supported = (UpdateTypes)(FULL | FAST); + + public: + LCMEN2R13ECC1() : SSD16XX(width, height, supported, 1) {} // Note: left edge of this display is offset by 1 byte + + protected: + virtual void configScanning() override; + virtual void configWaveform() override; + virtual void configUpdateSequence() override; + void detachFromUpdate() override; +}; + +} // namespace NicheGraphics::Drivers +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/platform/nrf52/architecture.h b/src/platform/nrf52/architecture.h index 4e8823063..21296c3fc 100644 --- a/src/platform/nrf52/architecture.h +++ b/src/platform/nrf52/architecture.h @@ -81,6 +81,8 @@ #define HW_VENDOR meshtastic_HardwareModel_MESHLINK #elif defined(SEEED_XIAO_NRF52840_KIT) #define HW_VENDOR meshtastic_HardwareModel_XIAO_NRF52_KIT +#elif defined(HELTEC_MESH_POCKET) +#define HW_VENDOR meshtastic_HardwareModel_HELTEC_MESH_POCKET #else #define HW_VENDOR meshtastic_HardwareModel_NRF52_UNKNOWN #endif diff --git a/src/power.h b/src/power.h index e9c0deb7c..a21f7d164 100644 --- a/src/power.h +++ b/src/power.h @@ -26,6 +26,10 @@ #define OCV_ARRAY 2700, 2560, 2540, 2520, 2500, 2460, 2420, 2400, 2380, 2320, 1500 #elif defined(TRACKER_T1000_E) #define OCV_ARRAY 4190, 4078, 4017, 3969, 3887, 3818, 3798, 3791, 3766, 3712, 3100 +#elif defined(HELTEC_MESH_POCKET_BATTERY_5000) +#define OCV_ARRAY 4300, 4240, 4120, 4000, 3888, 3800, 3740, 3698, 3655, 3580, 3400 +#elif defined(HELTEC_MESH_POCKET_BATTERY_10000) +#define OCV_ARRAY 4100, 4060, 3960, 3840, 3729, 3625, 3550, 3500, 3420, 3345, 3100 #else // LiIon #define OCV_ARRAY 4190, 4050, 3990, 3890, 3800, 3720, 3630, 3530, 3420, 3300, 3100 #endif diff --git a/variants/heltec_mesh_pocket/nicheGraphics.h b/variants/heltec_mesh_pocket/nicheGraphics.h new file mode 100644 index 000000000..352a9bc47 --- /dev/null +++ b/variants/heltec_mesh_pocket/nicheGraphics.h @@ -0,0 +1,107 @@ +#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" + +// #include "graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.h" +// #include "graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h" + +// Shared NicheGraphics components +// -------------------------------- +#include "graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h" +#include "graphics/niche/Inputs/TwoButton.h" + +#include "graphics/niche/Fonts/FreeSans6pt7b.h" +#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h" +#include + +void setupNicheGraphics() +{ + using namespace NicheGraphics; + + // SPI + // ----------------------------- + SPIClass *spi1=&SPI1; + spi1->begin(); + // Display is connected to SPI1 + + // E-Ink Driver + // ----------------------------- + // Use E-Ink driver + Drivers::EInk *driver = new Drivers::LCMEN2R13ECC1; + driver->begin(spi1, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); + + // InkHUD + // ---------------------------- + + InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance(); + + // Set the 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); + + // Prepare fonts + InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b); + InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b); + /* + // Font localization demo: Cyrillic + InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic); + InkHUD::Applet::fontSmall.addSubstitutionsWin1251(); + */ + + // 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 + inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet, true, true); // Activated, autoshown + inkhud->addApplet("DMs", new InkHUD::DMApplet); // Inactive + inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive + inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive + inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true); // Activated + inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // Inactive + inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, not autoshown, default on tile 0 + // inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet); + // inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet); + + // Start running InkHUD + inkhud->begin(); + + // Buttons + // -------------------------- + + Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component + constexpr uint8_t MAIN_BUTTON = 0; + // constexpr uint8_t AUX_BUTTON = 1; + + // Setup the main user button + buttons->setWiring(MAIN_BUTTON, Inputs::TwoButton::getUserButtonPin()); + buttons->setHandlerShortPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); + buttons->setHandlerLongPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->longpress(); }); + + // Setup the aux button + // Bonus feature of VME213 + // buttons->setWiring(AUX_BUTTON, BUTTON_PIN_SECONDARY); + // buttons->setHandlerShortPress(AUX_BUTTON, []() { InkHUD::InkHUD::getInstance()->nextTile(); }); + buttons->start(); +} + +#endif \ No newline at end of file diff --git a/variants/heltec_mesh_pocket/platformio.ini b/variants/heltec_mesh_pocket/platformio.ini new file mode 100644 index 000000000..53f56e973 --- /dev/null +++ b/variants/heltec_mesh_pocket/platformio.ini @@ -0,0 +1,92 @@ +; First prototype nrf52840/sx1262 device +[env:heltec-mesh-pocket-5000] +extends = nrf52840_base +board = heltec_mesh_pocket +debug_tool = jlink + +# add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. +build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_pocket + -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" + -DHELTEC_MESH_POCKET + -DHELTEC_MESH_POCKET_BATTERY_5000 + -DUSE_EINK + -DEINK_DISPLAY_MODEL=GxEPD2_213_B74 + -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 +; -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated + -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" + -DEINK_HASQUIRK_WEAKFASTREFRESH ; Pixels set with fast-refresh are easy to clear, disrupted by sunlight + +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket> +lib_deps = + ${nrf52840_base.lib_deps} + lewisxhe/PCF8563_Library@^1.0.1 + https://github.com/meshtastic/GxEPD2#b202ebfec6a4821e098cf7a625ba0f6f2400292d + + +[env:heltec-mesh-pocket-inkhud-5000] +extends = nrf52840_base, inkhud +board = heltec_mesh_pocket +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket> ${inkhud.build_src_filter} +build_flags = + ${inkhud.build_flags} + ${nrf52840_base.build_flags} + -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" + -I variants/heltec_mesh_pocket + -D HELTEC_MESH_POCKET + -D HELTEC_MESH_POCKET_BATTERY_5000 +lib_deps = + ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX + ${nrf52840_base.lib_deps} + + +; First prototype nrf52840/sx1262 device +[env:heltec-mesh-pocket-10000] +extends = nrf52840_base +board = heltec_mesh_pocket +debug_tool = jlink + +# add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. +build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_pocket + -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" + -DHELTEC_MESH_POCKET + -DHELTEC_MESH_POCKET_BATTERY_10000 + -DUSE_EINK + -DEINK_DISPLAY_MODEL=GxEPD2_213_B74 + -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 +; -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated + -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" + -DEINK_HASQUIRK_WEAKFASTREFRESH ; Pixels set with fast-refresh are easy to clear, disrupted by sunlight + +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket> +lib_deps = + ${nrf52840_base.lib_deps} + lewisxhe/PCF8563_Library@^1.0.1 + https://github.com/meshtastic/GxEPD2#b202ebfec6a4821e098cf7a625ba0f6f2400292d + + +[env:heltec-mesh-pocket-inkhud-10000] +extends = nrf52840_base, inkhud +board = heltec_mesh_pocket +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket> ${inkhud.build_src_filter} +build_flags = + ${inkhud.build_flags} + ${nrf52840_base.build_flags} + -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" + -I variants/heltec_mesh_pocket + -D HELTEC_MESH_POCKET + -D HELTEC_MESH_POCKET_BATTERY_10000 +lib_deps = + ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX + ${nrf52840_base.lib_deps} diff --git a/variants/heltec_mesh_pocket/variant.cpp b/variants/heltec_mesh_pocket/variant.cpp new file mode 100644 index 000000000..20ba5f2ae --- /dev/null +++ b/variants/heltec_mesh_pocket/variant.cpp @@ -0,0 +1,13 @@ +#include "variant.h" +#include "nrf.h" +#include "wiring_constants.h" +#include "wiring_digital.h" + +const uint32_t g_ADigitalPinMap[] = { + // P0 - pins 0 and 1 are hardwired for xtal and should never be enabled + 0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + + // P1 + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}; + + diff --git a/variants/heltec_mesh_pocket/variant.h b/variants/heltec_mesh_pocket/variant.h new file mode 100644 index 000000000..89f06f358 --- /dev/null +++ b/variants/heltec_mesh_pocket/variant.h @@ -0,0 +1,135 @@ +#ifndef _VARIANT_HELTEC_NRF_ +#define _VARIANT_HELTEC_NRF_ +/** Master clock frequency */ +#define VARIANT_MCK (64000000ul) + +#define USE_LFXO // Board uses 32khz crystal for LF + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// Number of pins defined in PinDescription array +#define PINS_COUNT (48) +#define NUM_DIGITAL_PINS (48) +#define NUM_ANALOG_INPUTS (1) +#define NUM_ANALOG_OUTPUTS (0) + +// LEDs +#define PIN_LED1 (13) // 13 red (confirmed on 1.0 board) +#define LED_RED PIN_LED1 +#define LED_BLUE PIN_LED1 +#define LED_GREEN PIN_LED1 +#define LED_BUILTIN LED_BLUE +#define LED_CONN LED_BLUE +#define LED_STATE_ON 0 // State when LED is lit + +/* + * Buttons + */ +#define PIN_BUTTON1 (32 + 10) +// #define PIN_BUTTON2 (0 + 18) // 0.18 is labeled on the board as RESET but we configure it in the bootloader as a regular +// GPIO + +/* +No longer populated on PCB +*/ +#define PIN_SERIAL2_RX (0 + 7) +#define PIN_SERIAL2_TX (0 + 8) +// #define PIN_SERIAL2_EN (0 + 17) + +/** + Wire Interfaces + */ +#define WIRE_INTERFACES_COUNT 1 + +#define PIN_WIRE_SDA (32+15) +#define PIN_WIRE_SCL (32+13) + +/* + * Lora radio + */ + +#define USE_SX1262 +#define SX126X_CS (0 + 26) // FIXME - we really should define LORA_CS instead +#define LORA_CS (0 + 26) +#define SX126X_DIO1 (0 + 16) +// Note DIO2 is attached internally to the module to an analog switch for TX/RX switching +// #define SX1262_DIO3 (0 + 21) +// This is used as an *output* from the sx1262 and connected internally to power the tcxo, do not drive from the +// main +// CPU? +#define SX126X_BUSY (0 + 15) +#define SX126X_RESET (0 + 12) +// Not really an E22 but TTGO seems to be trying to clone that +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 + +// Display (E-Ink) +#define PIN_EINK_CS 24 +#define PIN_EINK_BUSY 32+6 +#define PIN_EINK_DC 31 +#define PIN_EINK_RES 32+4 +#define PIN_EINK_SCLK 22 +#define PIN_EINK_MOSI 20 + + +#define PIN_SPI1_MISO -1 +#define PIN_SPI1_MOSI PIN_EINK_MOSI +#define PIN_SPI1_SCK PIN_EINK_SCLK + + +/* + * GPS pins + */ + +#define PIN_SERIAL1_RX 32+5 +#define PIN_SERIAL1_TX 32+7 + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 2 + +// For LORA, spi 0 +#define PIN_SPI_MISO (32 + 9) +#define PIN_SPI_MOSI (0 + 5) +#define PIN_SPI_SCK (0 + 4) + +// #define PIN_PWR_EN (0 + 6) + +// To debug via the segger JLINK console rather than the CDC-ACM serial device +// #define USE_SEGGER + +// Battery +// The battery sense is hooked to pin A0 (4) +// it is defined in the anlaolgue pin section of this file +// and has 12 bit resolution + +#define ADC_CTRL 32+2 +#define ADC_CTRL_ENABLED HIGH +#define BATTERY_PIN 29 +#define ADC_RESOLUTION 14 + +#define BATTERY_SENSE_RESOLUTION_BITS 12 +#define BATTERY_SENSE_RESOLUTION 4096.0 +#undef AREF_VOLTAGE +#define AREF_VOLTAGE 3.0 +#define VBAT_AR_INTERNAL AR_INTERNAL_3_0 +#define ADC_MULTIPLIER (4.90F) + +#undef HAS_GPS +#define HAS_GPS 0 +#define HAS_RTC 0 +#ifdef __cplusplus +} +#endif + + +#endif \ No newline at end of file From 4e30023a4bd9a010d2f2b34d103897278ff898b4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 06:41:33 -0500 Subject: [PATCH 067/461] [create-pull-request] automated change (#6589) Co-authored-by: fifieldt <1287116+fifieldt@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/protobufs b/protobufs index 5a5ab103d..f9aa5cfd0 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 5a5ab103d2f6aa071fca29417475681a2cec5dcf +Subproject commit f9aa5cfd08cf14917fce54e5ebc0441b35ce32b3 diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 191f9e121..46f9d8315 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -239,6 +239,8 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_HELTEC_SENSOR_HUB = 92, /* Reserved Fried Chicken ID for future use */ meshtastic_HardwareModel_RESERVED_FRIED_CHICKEN = 93, + /* Heltec Magnetic Power Bank with Meshtastic compatible */ + meshtastic_HardwareModel_HELTEC_MESH_POCKET = 94, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ From ecd9f015d8f079a0170a06afdc1243655f5867db Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 06:41:52 -0500 Subject: [PATCH 068/461] chore(deps): update meshtastic-device-ui digest to da8fb5e (#6593) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index f22d92b2e..cb36e412e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/3fde170dca16863218cec133e05c5f2fc8d6e59a.zip + https://github.com/meshtastic/device-ui/archive/da8fb5eaac7874c31508fad5252999ec82c02498.zip ; Common libs for environmental measurements in telemetry module ; (not included in native / portduino) From 040a34fca8cd0a9581d575c3bf344e8fd82ddf84 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 15 Apr 2025 10:50:24 -0500 Subject: [PATCH 069/461] Switch to actually maintained thingsboard pubsubclient (#5204) * Switch to actually maintained thingsboard pubsubclient * .0 * TBPubSubClient * SetBufferSize is split into Send and Receive. * Update TBPubSubClient to 2.11 * Update platformio.ini Co-authored-by: Austin * Re-add setBufferSize fix --------- Co-authored-by: Tom Fifield Co-authored-by: Austin --- platformio.ini | 4 ++-- src/mqtt/MQTT.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index cb36e412e..85505d63a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -93,8 +93,8 @@ build_src_filter = ${env.build_src_filter} - - Date: Wed, 16 Apr 2025 07:37:09 +1000 Subject: [PATCH 070/461] Trunk fixes for heltec mesh pocket. (#6588) https://github.com/meshtastic/firmware/pull/6533 was merged without running trunk. This patch fixes the newly introduced trunk errors. --- boards/heltec_mesh_pocket.json | 99 +++++++++---------- src/graphics/EInkDisplay2.cpp | 2 +- .../niche/Drivers/EInk/LCMEN2R13ECC1.cpp | 22 ++--- .../niche/Drivers/EInk/LCMEN2R13ECC1.h | 10 +- variants/heltec_mesh_pocket/nicheGraphics.h | 2 +- variants/heltec_mesh_pocket/variant.cpp | 2 - variants/heltec_mesh_pocket/variant.h | 27 +++-- 7 files changed, 79 insertions(+), 85 deletions(-) diff --git a/boards/heltec_mesh_pocket.json b/boards/heltec_mesh_pocket.json index a35387857..e078c860c 100644 --- a/boards/heltec_mesh_pocket.json +++ b/boards/heltec_mesh_pocket.json @@ -1,54 +1,53 @@ { - "build": { - "arduino": { - "ldscript": "nrf52840_s140_v6.ld" - }, - "core": "nRF5", - "cpu": "cortex-m4", - "extra_flags": "-DNRF52840_XXAA", - "f_cpu": "64000000L", - "hwids": [ - ["0x239A", "0x4405"], - ["0x239A", "0x0029"], - ["0x239A", "0x002A"] - ], - "usb_product": "HT-n5262", - "mcu": "nrf52840", - "variant": "heltec_mesh_pocket", - "variants_dir": "variants", - "bsp": { - "name": "adafruit" - }, - "softdevice": { - "sd_flags": "-DS140", - "sd_name": "s140", - "sd_version": "6.1.1", - "sd_fwid": "0x00B6" - }, - "bootloader": { - "settings_addr": "0xFF000" - } + "build": { + "arduino": { + "ldscript": "nrf52840_s140_v6.ld" }, - "connectivity": ["bluetooth"], - "debug": { - "jlink_device": "nRF52840_xxAA", - "onboard_tools": ["jlink"], - "svd_path": "nrf52840.svd", - "openocd_target": "nrf52840-mdk-rs" + "core": "nRF5", + "cpu": "cortex-m4", + "extra_flags": "-DNRF52840_XXAA", + "f_cpu": "64000000L", + "hwids": [ + ["0x239A", "0x4405"], + ["0x239A", "0x0029"], + ["0x239A", "0x002A"] + ], + "usb_product": "HT-n5262", + "mcu": "nrf52840", + "variant": "heltec_mesh_pocket", + "variants_dir": "variants", + "bsp": { + "name": "adafruit" }, - "frameworks": ["arduino"], - "name": "Heltec nrf (Adafruit BSP)", - "upload": { - "maximum_ram_size": 248832, - "maximum_size": 815104, - "speed": 115200, - "protocol": "nrfutil", - "protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"], - "use_1200bps_touch": true, - "require_upload_port": true, - "wait_for_upload_port": true + "softdevice": { + "sd_flags": "-DS140", + "sd_name": "s140", + "sd_version": "6.1.1", + "sd_fwid": "0x00B6" }, - "url": "https://heltec.org/project/meshpocket/", - "vendor": "Heltec" - } - \ No newline at end of file + "bootloader": { + "settings_addr": "0xFF000" + } + }, + "connectivity": ["bluetooth"], + "debug": { + "jlink_device": "nRF52840_xxAA", + "onboard_tools": ["jlink"], + "svd_path": "nrf52840.svd", + "openocd_target": "nrf52840-mdk-rs" + }, + "frameworks": ["arduino"], + "name": "Heltec nrf (Adafruit BSP)", + "upload": { + "maximum_ram_size": 248832, + "maximum_size": 815104, + "speed": 115200, + "protocol": "nrfutil", + "protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"], + "use_1200bps_touch": true, + "require_upload_port": true, + "wait_for_upload_port": true + }, + "url": "https://heltec.org/project/meshpocket/", + "vendor": "Heltec" +} diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 737fcc3f0..5a2749482 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -219,7 +219,7 @@ bool EInkDisplay::connect() } #elif defined(HELTEC_MESH_POCKET) { - spi1=&SPI1; + spi1 = &SPI1; spi1->begin(); // VExt already enabled in setup() // RTC GPIO hold disabled in setup() diff --git a/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.cpp b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.cpp index 5e21c00f6..e9a663f80 100644 --- a/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.cpp +++ b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.cpp @@ -23,16 +23,16 @@ void LCMEN2R13ECC1::configScanning() void LCMEN2R13ECC1::configWaveform() { switch (updateType) { - case FAST: - sendCommand(0x3C); // Border waveform: - sendData(0x85); - break; - - case FULL: - default: - // From OTP memory - break; - } + case FAST: + sendCommand(0x3C); // Border waveform: + sendData(0x85); + break; + + case FULL: + default: + // From OTP memory + break; + } } void LCMEN2R13ECC1::configUpdateSequence() @@ -65,4 +65,4 @@ void LCMEN2R13ECC1::detachFromUpdate() } } -#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h index 7b0aed282..b78e3bcca 100644 --- a/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h +++ b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h @@ -28,13 +28,13 @@ class LCMEN2R13ECC1 : public SSD16XX static constexpr UpdateTypes supported = (UpdateTypes)(FULL | FAST); public: - LCMEN2R13ECC1() : SSD16XX(width, height, supported, 1) {} // Note: left edge of this display is offset by 1 byte + LCMEN2R13ECC1() : SSD16XX(width, height, supported, 1) {} // Note: left edge of this display is offset by 1 byte protected: - virtual void configScanning() override; - virtual void configWaveform() override; - virtual void configUpdateSequence() override; - void detachFromUpdate() override; + virtual void configScanning() override; + virtual void configWaveform() override; + virtual void configUpdateSequence() override; + void detachFromUpdate() override; }; } // namespace NicheGraphics::Drivers diff --git a/variants/heltec_mesh_pocket/nicheGraphics.h b/variants/heltec_mesh_pocket/nicheGraphics.h index 352a9bc47..b697faa57 100644 --- a/variants/heltec_mesh_pocket/nicheGraphics.h +++ b/variants/heltec_mesh_pocket/nicheGraphics.h @@ -34,7 +34,7 @@ void setupNicheGraphics() // SPI // ----------------------------- - SPIClass *spi1=&SPI1; + SPIClass *spi1 = &SPI1; spi1->begin(); // Display is connected to SPI1 diff --git a/variants/heltec_mesh_pocket/variant.cpp b/variants/heltec_mesh_pocket/variant.cpp index 20ba5f2ae..bdded700b 100644 --- a/variants/heltec_mesh_pocket/variant.cpp +++ b/variants/heltec_mesh_pocket/variant.cpp @@ -9,5 +9,3 @@ const uint32_t g_ADigitalPinMap[] = { // P1 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}; - - diff --git a/variants/heltec_mesh_pocket/variant.h b/variants/heltec_mesh_pocket/variant.h index 89f06f358..79f47bd0e 100644 --- a/variants/heltec_mesh_pocket/variant.h +++ b/variants/heltec_mesh_pocket/variant.h @@ -49,16 +49,16 @@ No longer populated on PCB */ #define WIRE_INTERFACES_COUNT 1 -#define PIN_WIRE_SDA (32+15) -#define PIN_WIRE_SCL (32+13) +#define PIN_WIRE_SDA (32 + 15) +#define PIN_WIRE_SCL (32 + 13) /* * Lora radio */ #define USE_SX1262 -#define SX126X_CS (0 + 26) // FIXME - we really should define LORA_CS instead -#define LORA_CS (0 + 26) +#define SX126X_CS (0 + 26) // FIXME - we really should define LORA_CS instead +#define LORA_CS (0 + 26) #define SX126X_DIO1 (0 + 16) // Note DIO2 is attached internally to the module to an analog switch for TX/RX switching // #define SX1262_DIO3 (0 + 21) @@ -72,25 +72,23 @@ No longer populated on PCB #define SX126X_DIO3_TCXO_VOLTAGE 1.8 // Display (E-Ink) -#define PIN_EINK_CS 24 -#define PIN_EINK_BUSY 32+6 -#define PIN_EINK_DC 31 -#define PIN_EINK_RES 32+4 +#define PIN_EINK_CS 24 +#define PIN_EINK_BUSY 32 + 6 +#define PIN_EINK_DC 31 +#define PIN_EINK_RES 32 + 4 #define PIN_EINK_SCLK 22 #define PIN_EINK_MOSI 20 - #define PIN_SPI1_MISO -1 #define PIN_SPI1_MOSI PIN_EINK_MOSI #define PIN_SPI1_SCK PIN_EINK_SCLK - /* * GPS pins */ -#define PIN_SERIAL1_RX 32+5 -#define PIN_SERIAL1_TX 32+7 +#define PIN_SERIAL1_RX 32 + 5 +#define PIN_SERIAL1_TX 32 + 7 /* * SPI Interfaces @@ -112,7 +110,7 @@ No longer populated on PCB // it is defined in the anlaolgue pin section of this file // and has 12 bit resolution -#define ADC_CTRL 32+2 +#define ADC_CTRL 32 + 2 #define ADC_CTRL_ENABLED HIGH #define BATTERY_PIN 29 #define ADC_RESOLUTION 14 @@ -124,12 +122,11 @@ No longer populated on PCB #define VBAT_AR_INTERNAL AR_INTERNAL_3_0 #define ADC_MULTIPLIER (4.90F) -#undef HAS_GPS +#undef HAS_GPS #define HAS_GPS 0 #define HAS_RTC 0 #ifdef __cplusplus } #endif - #endif \ No newline at end of file From 7e8294dfad233e883c58005cff549812587145ff Mon Sep 17 00:00:00 2001 From: Kalle Lilja <15094562+ThatKalle@users.noreply.github.com> Date: Wed, 16 Apr 2025 00:57:21 +0200 Subject: [PATCH 071/461] FlatHub: bump metainfo.xml on release (#6578) * add bump_metainfo.py * bump org.meshtastic.meshtasticd.metainfo.xml on release * update bump-version job to trigger on published * use defusedxml.ElementTree parse * move bump_metainfo, use requirements.txt * add bin/bump_metainfo/requirements.txt to renovate * Switch to short version string * Bump version.properties to 2.6.6 * change version format * remove url * Add url back in * Update url format * manual add 2.6.6 * consolidate into one PR * update run steps * add ability to add date if missing * update pull request title * add comments * remove quote changes --------- Co-authored-by: Austin --- .github/workflows/release_channels.yml | 32 ++++++--- bin/bump_metainfo/bump_metainfo.py | 72 +++++++++++++++++++++ bin/bump_metainfo/requirements.txt | 1 + bin/org.meshtastic.meshtasticd.metainfo.xml | 10 ++- renovate.json | 3 + version.properties | 2 +- 6 files changed, 109 insertions(+), 11 deletions(-) create mode 100755 bin/bump_metainfo/bump_metainfo.py create mode 100644 bin/bump_metainfo/requirements.txt diff --git a/.github/workflows/release_channels.yml b/.github/workflows/release_channels.yml index 710e8e51d..eece12346 100644 --- a/.github/workflows/release_channels.yml +++ b/.github/workflows/release_channels.yml @@ -46,11 +46,14 @@ jobs: # Create a PR to bump version when a release is Published bump-version: - if: ${{ github.event.release.published }} + if: github.event.action == 'published' runs-on: ubuntu-latest permissions: pull-requests: write contents: write + defaults: + run: + shell: bash steps: - name: Checkout uses: actions/checkout@v4 @@ -63,29 +66,42 @@ jobs: - name: Get release version string run: | echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + echo "short=$(./bin/buildinfo.py short)" >> $GITHUB_OUTPUT echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT id: version env: BUILD_LOCATION: local - name: Bump version.properties - run: >- - bin/bump_version.py + run: | + # Bump version.properties + chmod +x ./bin/bump_version.py + ./bin/bump_version.py - name: Ensure debian deps are installed - shell: bash run: | sudo apt-get update -y --fix-missing sudo apt-get install -y devscripts - name: Update debian changelog - run: >- - debian/ci_changelog.sh + run: | + # Update debian changelog + chmod +x ./debian/ci_changelog.sh + ./debian/ci_changelog.sh - - name: Create version.properties pull request + - name: Bump org.meshtastic.meshtasticd.metainfo.xml + run: | + # Bump org.meshtastic.meshtasticd.metainfo.xml + pip install -r bin/bump_metainfo/requirements.txt -q + chmod +x ./bin/bump_metainfo/bump_metainfo.py + ./bin/bump_metainfo/bump_metainfo.py --file bin/org.meshtastic.meshtasticd.metainfo.xml "${{ steps.version.outputs.short }}" + + - name: Create Bumps pull request uses: peter-evans/create-pull-request@v7 with: - title: Bump version.properties + title: Bump release version + commit-message: automated bumps add-paths: | version.properties debian/changelog + bin/org.meshtastic.meshtasticd.metainfo.xml diff --git a/bin/bump_metainfo/bump_metainfo.py b/bin/bump_metainfo/bump_metainfo.py new file mode 100755 index 000000000..290cbae79 --- /dev/null +++ b/bin/bump_metainfo/bump_metainfo.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +import argparse +import xml.etree.ElementTree as ET +from defusedxml.ElementTree import parse +from datetime import datetime, timezone + + +# Indent by 2 spaces to align with xml formatting. +def indent(elem, level=0): + i = "\n" + level * " " + if len(elem): + if not elem.text or not elem.text.strip(): + elem.text = i + " " + for child in elem: + indent(child, level + 1) + if not child.tail or not child.tail.strip(): + child.tail = i + if level and (not elem.tail or not elem.tail.strip()): + elem.tail = i + + +def main(): + parser = argparse.ArgumentParser( + description="Prepend new release entry to metainfo.xml file.") + parser.add_argument("--file", help="Path to the metainfo.xml file", + default="org.meshtastic.meshtasticd.metainfo.xml") + parser.add_argument("version", help="Version string (e.g. 2.6.4)") + parser.add_argument("--date", help="Release date (YYYY-MM-DD), defaults to today", + default=datetime.now(timezone.utc).date().isoformat()) + + args = parser.parse_args() + + tree = parse(args.file) + root = tree.getroot() + + releases = root.find('releases') + if releases is None: + raise RuntimeError(" element not found in XML.") + + existing_versions = { + release.get('version'): release + for release in releases.findall('release') + } + existing_release = existing_versions.get(args.version) + + if existing_release is not None: + if not existing_release.get('date'): + print(f"Version {args.version} found without date. Adding date...") + existing_release.set('date', args.date) + else: + print( + f"Version {args.version} is already present with date, skipping insertion.") + else: + new_release = ET.Element('release', { + 'version': args.version, + 'date': args.date + }) + url = ET.SubElement(new_release, 'url', {'type': 'details'}) + url.text = f"https://github.com/meshtastic/firmware/releases?q=tag%3Av{args.version}" + + releases.insert(0, new_release) + + indent(releases, level=1) + releases.tail = "\n" + + print(f"Inserted new release: {args.version}") + + tree.write(args.file, encoding='UTF-8', xml_declaration=True) + + +if __name__ == "__main__": + main() diff --git a/bin/bump_metainfo/requirements.txt b/bin/bump_metainfo/requirements.txt new file mode 100644 index 000000000..09dd20d24 --- /dev/null +++ b/bin/bump_metainfo/requirements.txt @@ -0,0 +1 @@ +defusedxml==0.7.1 diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index a9e6cbdf5..cb921fcb3 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,8 +87,14 @@ - - https://github.com/meshtastic/firmware/releases/tag/v2.6.4.b89355f + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.6 + + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.5 + + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.4 \ No newline at end of file diff --git a/renovate.json b/renovate.json index bf6ffdd4b..11d35aff8 100644 --- a/renovate.json +++ b/renovate.json @@ -13,6 +13,9 @@ "git-submodules": { "enabled": true }, + "pip_requirements": { + "fileMatch": ["bin/bump_metainfo/requirements.txt"] + }, "commitMessageTopic": "{{depName}}", "labels": ["dependencies"], "customDatasources": { diff --git a/version.properties b/version.properties index 0b46aeec6..8f5953fdc 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 6 -build = 5 +build = 6 From cf5c8de92e21acf7b5814225b225ceac7d87553b Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Wed, 16 Apr 2025 13:33:44 +1200 Subject: [PATCH 072/461] Fix spurious button presses on some T-Echos (#6590) Co-authored-by: Ben Meadors --- src/graphics/niche/Inputs/TwoButton.cpp | 2 +- src/mesh/RadioLibInterface.cpp | 8 ++++++++ src/mesh/RadioLibInterface.h | 5 +++++ variants/t-echo/nicheGraphics.h | 19 +++++++++++++++++-- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/graphics/niche/Inputs/TwoButton.cpp b/src/graphics/niche/Inputs/TwoButton.cpp index 1e91d9080..bd29f981d 100644 --- a/src/graphics/niche/Inputs/TwoButton.cpp +++ b/src/graphics/niche/Inputs/TwoButton.cpp @@ -181,7 +181,7 @@ void TwoButton::isrSecondary() void TwoButton::startThread() { if (!OSThread::enabled) { - OSThread::setInterval(50); + OSThread::setInterval(10); OSThread::enabled = true; } } diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index a6faebff4..e3ef58f14 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -210,6 +210,14 @@ bool RadioLibInterface::canSleep() return res; } +/** Allow other firmware components to ask whether we are currently sending a packet +Initially implemented to protect T-Echo's capacitive touch button from spurious presses during tx +*/ +bool RadioLibInterface::isSending() +{ + return sendingPacket != NULL; +} + /** Attempt to cancel a previously sent packet. Returns true if a packet was found we could cancel */ bool RadioLibInterface::cancelSending(NodeNum from, PacketId id) { diff --git a/src/mesh/RadioLibInterface.h b/src/mesh/RadioLibInterface.h index b24879eaf..9622bd625 100644 --- a/src/mesh/RadioLibInterface.h +++ b/src/mesh/RadioLibInterface.h @@ -132,6 +132,11 @@ class RadioLibInterface : public RadioInterface, protected concurrency::Notified */ virtual bool isActivelyReceiving() = 0; + /** Are we are currently sending a packet? + * This method is public, intending to expose this information to other firmware components + */ + virtual bool isSending(); + /** Attempt to cancel a previously sent packet. Returns true if a packet was found we could cancel */ virtual bool cancelSending(NodeNum from, PacketId id) override; diff --git a/variants/t-echo/nicheGraphics.h b/variants/t-echo/nicheGraphics.h index 5862dcdfb..af310db25 100644 --- a/variants/t-echo/nicheGraphics.h +++ b/variants/t-echo/nicheGraphics.h @@ -29,6 +29,12 @@ #include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h" #include +// Special case - fix T-Echo's touch button +// ---------------------------------------- +// On a handful of T-Echos, LoRa TX triggers the capacitive touch +// To avoid this, we lockout the button during TX +#include "mesh/RadioLibInterface.h" + void setupNicheGraphics() { using namespace NicheGraphics; @@ -115,13 +121,22 @@ void setupNicheGraphics() buttons->setWiring(TOUCH_BUTTON, PIN_BUTTON_TOUCH); buttons->setTiming(TOUCH_BUTTON, 50, 5000); // 5 seconds before latch - limited by T-Echo's capacitive touch IC buttons->setHandlerDown(TOUCH_BUTTON, [backlight]() { + // Discard the button press if radio is active + // Rare hardware fault: LoRa activity triggers touch button + if (!RadioLibInterface::instance || RadioLibInterface::instance->isSending()) + return; + + // Backlight on (while held) backlight->peek(); - InkHUD::InkHUD::getInstance()->persistence->settings.optionalMenuItems.backlight = - false; // We've proved user still has the button. No need to make backlight togglable via the menu. + + // Handler has run, which confirms touch button wasn't removed as part of DIY build. + // No longer need the fallback backlight toggle in menu. + InkHUD::InkHUD::getInstance()->persistence->settings.optionalMenuItems.backlight = false; }); buttons->setHandlerLongPress(TOUCH_BUTTON, [backlight]() { backlight->latch(); }); buttons->setHandlerShortPress(TOUCH_BUTTON, [backlight]() { backlight->off(); }); + // Begin handling button events buttons->start(); } From 1138f74e2c025852534cd529248de45e6a6347ac Mon Sep 17 00:00:00 2001 From: Niklas <44636701+MayNiklas@users.noreply.github.com> Date: Wed, 16 Apr 2025 03:39:13 +0200 Subject: [PATCH 073/461] fix: set upload_speed for tlora_v1_3 & tlora_v2_1_16 (#6595) --- variants/tlora_v1_3/platformio.ini | 3 ++- variants/tlora_v2_1_16/platformio.ini | 3 ++- variants/tlora_v2_1_16_tcxo/platformio.ini | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/variants/tlora_v1_3/platformio.ini b/variants/tlora_v1_3/platformio.ini index 99df28e56..c5eca589f 100644 --- a/variants/tlora_v1_3/platformio.ini +++ b/variants/tlora_v1_3/platformio.ini @@ -3,4 +3,5 @@ board_level = extra extends = esp32_base board = ttgo-lora32-v1 build_flags = - ${esp32_base.build_flags} -D TLORA_V1_3 -I variants/tlora_v1_3 \ No newline at end of file + ${esp32_base.build_flags} -D TLORA_V1_3 -I variants/tlora_v1_3 +upload_speed = 115200 \ No newline at end of file diff --git a/variants/tlora_v2_1_16/platformio.ini b/variants/tlora_v2_1_16/platformio.ini index 351f71676..4253cc6af 100644 --- a/variants/tlora_v2_1_16/platformio.ini +++ b/variants/tlora_v2_1_16/platformio.ini @@ -4,4 +4,5 @@ board = ttgo-lora32-v21 board_check = true build_flags = ${esp32_base.build_flags} -D TLORA_V2_1_16 -I variants/tlora_v2_1_16 - -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. \ No newline at end of file + -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. +upload_speed = 115200 \ No newline at end of file diff --git a/variants/tlora_v2_1_16_tcxo/platformio.ini b/variants/tlora_v2_1_16_tcxo/platformio.ini index 538fd81b0..5c7cb7eb3 100644 --- a/variants/tlora_v2_1_16_tcxo/platformio.ini +++ b/variants/tlora_v2_1_16_tcxo/platformio.ini @@ -7,4 +7,5 @@ build_flags = -D TLORA_V2_1_16 -I variants/tlora_v2_1_16 -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. - -D LORA_TCXO_GPIO=33 \ No newline at end of file + -D LORA_TCXO_GPIO=33 +upload_speed = 115200 \ No newline at end of file From 447703197174d38e5326cdd70e3edaa0276bb82a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 09:46:06 +0200 Subject: [PATCH 074/461] [create-pull-request] automated change (#6599) --- protobufs | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/protobufs b/protobufs index f9aa5cfd0..b982b36df 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit f9aa5cfd08cf14917fce54e5ebc0441b35ce32b3 +Subproject commit b982b36dfab2e96b8f8be90af891c68ebf8790c2 diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 46f9d8315..36bded9b2 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -241,6 +241,8 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_RESERVED_FRIED_CHICKEN = 93, /* Heltec Magnetic Power Bank with Meshtastic compatible */ meshtastic_HardwareModel_HELTEC_MESH_POCKET = 94, + /* Seeed Solar Node */ + meshtastic_HardwareModel_SEEED_SOLAR_NODE = 95, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ From 64c8bde04a222aea6694d40897b3f5db996ce4bf Mon Sep 17 00:00:00 2001 From: Benjamin Kyd Date: Wed, 16 Apr 2025 09:12:23 +0100 Subject: [PATCH 075/461] Update platformio.ini to exclude unused modules from t1000-e (#6584) * Update platformio.ini to exclude unused modules * Add No EXT GPIO flag and also correct some exclusions in main * CANNEDMSG != CANNEDMESSAGES * Remove NO_EXT_GPIO --- src/main.cpp | 8 ++++---- variants/tracker-t1000-e/platformio.ini | 6 +++++- variants/tracker-t1000-e/variant.h | 4 +++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index bfbd73a43..535a7afa1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1310,7 +1310,7 @@ extern meshtastic_DeviceMetadata getDeviceMetadata() deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_AUDIO_CONFIG; #endif // Option to explicitly include canned messages for edge cases, e.g. niche graphics -#if (!HAS_SCREEN && NO_EXT_GPIO) && !MESHTASTIC_INCLUDE_CANNEDMSG +#if (!HAS_SCREEN || NO_EXT_GPIO) || MESHTASTIC_EXCLUDE_CANNEDMESSAGES deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_CANNEDMSG_CONFIG; #endif #if NO_EXT_GPIO @@ -1318,11 +1318,11 @@ extern meshtastic_DeviceMetadata getDeviceMetadata() #endif // Only edge case here is if we apply this a device with built in Accelerometer and want to detect interrupts // We'll have to macro guard against those targets potentially -#if NO_EXT_GPIO +#if NO_EXT_GPIO || MESHTASTIC_EXCLUDE_DETECTIONSENSOR deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_DETECTIONSENSOR_CONFIG; #endif -// If we don't have any GPIO and we don't have GPS, no purpose in having serial config -#if NO_EXT_GPIO && NO_GPS +// If we don't have any GPIO and we don't have GPS OR we don't want too - no purpose in having serial config +#if NO_EXT_GPIO && NO_GPS || MESHTASTIC_EXCLUDE_SERIAL deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_SERIAL_CONFIG; #endif #ifndef ARCH_ESP32 diff --git a/variants/tracker-t1000-e/platformio.ini b/variants/tracker-t1000-e/platformio.ini index 8c3c97e6c..64da61434 100644 --- a/variants/tracker-t1000-e/platformio.ini +++ b/variants/tracker-t1000-e/platformio.ini @@ -5,6 +5,10 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/tracker-t1000-e -Isrc/plat -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE -DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL=1 + -DMESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 + -DMESHTASTIC_EXCLUDE_SCREEN=1 + -DMESHTASTIC_EXCLUDE_DETECTIONSENSOR=1 + -DMESHTASTIC_EXCLUDE_WIFI=1 board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld build_src_filter = ${nrf52_base.build_src_filter} +<../variants/tracker-t1000-e> lib_deps = @@ -12,4 +16,4 @@ lib_deps = https://github.com/meshtastic/QMA6100P_Arduino_Library/archive/14c900b8b2e4feaac5007a7e41e0c1b7f0841136.zip debug_tool = jlink ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) -upload_protocol = nrfutil \ No newline at end of file +upload_protocol = nrfutil diff --git a/variants/tracker-t1000-e/variant.h b/variants/tracker-t1000-e/variant.h index 0d98a3033..81b4ef3fb 100644 --- a/variants/tracker-t1000-e/variant.h +++ b/variants/tracker-t1000-e/variant.h @@ -152,6 +152,8 @@ extern "C" { #define T1000X_NTC_PIN (0 + 31) // P0.31/AIN7 #define T1000X_LUX_PIN (0 + 29) // P0.29/AIN5 +#define HAS_SCREEN 0 + #ifdef __cplusplus } #endif @@ -160,4 +162,4 @@ extern "C" { * Arduino objects - C++ only *----------------------------------------------------------------------------*/ -#endif // _VARIANT_TRACKER_T1000_E_ \ No newline at end of file +#endif // _VARIANT_TRACKER_T1000_E_ From e5cd0d613cc2cdf643e162cda80aa9d24af3b4f8 Mon Sep 17 00:00:00 2001 From: "Aaron.Lee" <32860565+Heltec-Aaron-Lee@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:20:12 +0800 Subject: [PATCH 076/461] Make startup screen show the short ID (#6591) * Update the short ID show on the boot up screen function --- .../InkHUD/Applets/System/Logo/LogoApplet.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp index 520b3ef65..89bdb0bc7 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp @@ -11,10 +11,19 @@ InkHUD::LogoApplet::LogoApplet() : concurrency::OSThread("LogoApplet") OSThread::setIntervalFromNow(8 * 1000UL); OSThread::enabled = true; - textLeft = ""; - textRight = ""; - textTitle = xstr(APP_VERSION_SHORT); - fontTitle = fontSmall; + // During onboarding, show the default short name as well as the version string + // This behavior assists manufacturers during mass production, and should not be modified without good reason + if (!settings->tips.safeShutdownSeen) { + fontTitle = fontLarge; + textLeft = xstr(APP_VERSION_SHORT); + textRight = owner.short_name; + textTitle = "Meshtastic"; + } else { + fontTitle = fontSmall; + textLeft = ""; + textRight = ""; + textTitle = xstr(APP_VERSION_SHORT); + } bringToForeground(); // This is then drawn with a FULL refresh by Renderer::begin From 5699d8632ef27d527e6907735208cbdec51d1de2 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 16 Apr 2025 05:21:31 -0400 Subject: [PATCH 077/461] Debian: use native-tft compile target (#6580) --- debian/ci_pack_sdeb.sh | 4 ++-- debian/control | 5 ++++- debian/meshtasticd.install | 10 +++++----- debian/rules | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/debian/ci_pack_sdeb.sh b/debian/ci_pack_sdeb.sh index c0cea0010..81e681e0c 100755 --- a/debian/ci_pack_sdeb.sh +++ b/debian/ci_pack_sdeb.sh @@ -5,8 +5,8 @@ export PLATFORMIO_PACKAGES_DIR=pio/packages export PLATFORMIO_CORE_DIR=pio/core # Download libraries to `pio` -platformio pkg install -e native -platformio pkg install -e native -t platformio/tool-scons@4.40502.0 +platformio pkg install -e native-tft +platformio pkg install -e native-tft -t platformio/tool-scons@4.40502.0 # Compress `pio` directory to prevent dh_clean from sanitizing it tar -cf pio.tar pio/ rm -rf pio diff --git a/debian/control b/debian/control index 693cd6aa5..9277f6f54 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,10 @@ Build-Depends: debhelper-compat (= 13), openssl, libssl-dev, libulfius-dev, - liborcania-dev + liborcania-dev, + libx11-dev, + libinput-dev, + libxkbcommon-x11-dev Standards-Version: 4.6.2 Homepage: https://github.com/meshtastic/firmware Rules-Requires-Root: no diff --git a/debian/meshtasticd.install b/debian/meshtasticd.install index da1b0685d..6b6b5a361 100644 --- a/debian/meshtasticd.install +++ b/debian/meshtasticd.install @@ -1,8 +1,8 @@ -.pio/build/native/meshtasticd usr/sbin +.pio/build/native-tft/meshtasticd usr/sbin -bin/config.yaml etc/meshtasticd -bin/config.d/* etc/meshtasticd/available.d +bin/config.yaml etc/meshtasticd +bin/config.d/* etc/meshtasticd/available.d -bin/meshtasticd.service lib/systemd/system +bin/meshtasticd.service lib/systemd/system -web/* usr/share/meshtasticd/web \ No newline at end of file +web/* usr/share/meshtasticd/web \ No newline at end of file diff --git a/debian/rules b/debian/rules index 0612ba352..0b5d1ac57 100755 --- a/debian/rules +++ b/debian/rules @@ -26,7 +26,7 @@ override_dh_auto_build: mkdir -p web && tar -xf web.tar -C web gunzip web/ -r # Build with platformio - $(PIO_ENV) platformio run -e native + $(PIO_ENV) platformio run -e native-tft # Move the binary and default config to the correct name - mv .pio/build/native/program .pio/build/native/meshtasticd + mv .pio/build/native-tft/program .pio/build/native-tft/meshtasticd cp bin/config-dist.yaml bin/config.yaml From 4a9a59342a3f6227fb8f48807314e1bbb2b6f650 Mon Sep 17 00:00:00 2001 From: Mark Trevor Birss Date: Wed, 16 Apr 2025 11:23:52 +0200 Subject: [PATCH 078/461] Create lora-piggystick-lr1121.yaml (#6600) --- bin/config.d/lora-piggystick-lr1121.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 bin/config.d/lora-piggystick-lr1121.yaml diff --git a/bin/config.d/lora-piggystick-lr1121.yaml b/bin/config.d/lora-piggystick-lr1121.yaml new file mode 100644 index 000000000..348db61b1 --- /dev/null +++ b/bin/config.d/lora-piggystick-lr1121.yaml @@ -0,0 +1,11 @@ +Lora: + Module: lr1121 + CS: 0 + IRQ: 6 + Reset: 2 + Busy: 4 + spidev: ch341 + DIO3_TCXO_VOLTAGE: 1.8 +# USB_Serialnum: 12345678 + USB_PID: 0x5512 + USB_VID: 0x1A86 From e0dafc3618ae8ce6c115caafdd7a1f68fdb94df6 Mon Sep 17 00:00:00 2001 From: Niklas <44636701+MayNiklas@users.noreply.github.com> Date: Wed, 16 Apr 2025 13:15:16 +0200 Subject: [PATCH 079/461] fix: set upload_speed for tlora_v1 (#6601) --- variants/tlora_v1/platformio.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/variants/tlora_v1/platformio.ini b/variants/tlora_v1/platformio.ini index 65ec4bcdc..17fc71d72 100644 --- a/variants/tlora_v1/platformio.ini +++ b/variants/tlora_v1/platformio.ini @@ -3,4 +3,5 @@ board_level = extra extends = esp32_base board = ttgo-lora32-v1 build_flags = - ${esp32_base.build_flags} -D TLORA_V1 -I variants/tlora_v1 \ No newline at end of file + ${esp32_base.build_flags} -D TLORA_V1 -I variants/tlora_v1 +upload_speed = 115200 \ No newline at end of file From 816d948ee53d9125001945963a5cd9fe800ae980 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 06:15:33 -0500 Subject: [PATCH 080/461] Upgrade trunk (#6592) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 01e8f8d1b..60e422312 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,7 +8,7 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - renovate@39.238.1 + - renovate@39.243.0 - prettier@3.5.3 - trufflehog@3.88.23 - yamllint@1.37.0 @@ -28,7 +28,7 @@ lint: - shellcheck@0.10.0 - black@25.1.0 - git-diff-check - - gitleaks@8.24.2 + - gitleaks@8.24.3 - clang-format@16.0.3 ignore: - linters: [ALL] From 5fd64d41143c3ef33d1f5e584f6964e39b806ac4 Mon Sep 17 00:00:00 2001 From: Benjamin Kyd Date: Wed, 16 Apr 2025 20:42:08 +0100 Subject: [PATCH 081/461] Fix uninitialised memory read (adminModule) (#6605) --- src/graphics/Screen.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 8075dd468..9afd88c76 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1796,7 +1796,9 @@ void Screen::setup() powerStatusObserver.observe(&powerStatus->onNewStatus); gpsStatusObserver.observe(&gpsStatus->onNewStatus); nodeStatusObserver.observe(&nodeStatus->onNewStatus); +#if !MESHTASTIC_EXCLUDE_ADMIN adminMessageObserver.observe(adminModule); +#endif if (textMessageModule) textMessageObserver.observe(textMessageModule); if (inputBroker) @@ -2857,4 +2859,4 @@ int Screen::handleAdminMessage(const meshtastic_AdminMessage *arg) } // namespace graphics #else graphics::Screen::Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY) {} -#endif // HAS_SCREEN \ No newline at end of file +#endif // HAS_SCREEN From d74359abf0d07d66b893f1e1366f7d5dd21364ee Mon Sep 17 00:00:00 2001 From: dylanli Date: Thu, 17 Apr 2025 14:11:17 +0800 Subject: [PATCH 082/461] add support for Seeed solar panel (#6597) * add seeed_solar_node * fix RF_SW problem * fix IIC problem * Update Button redefination * Add on-board flash pin defination * fix missing a ',' * update seeed sorlar panel defination * fix word spell * fix upstream change * fix upstream change * fix upstream change * fix formate * Restore the FLASH definition that was deleted by mistake and pull down the CS pin to ensure low power consumption * fix led defination conflict * Delete lib/device-ui directory * Restore protobufs submodule --------- Co-authored-by: WayenWeng --- boards/Seeed_Solar_Node.json | 54 ++++++++ src/platform/nrf52/architecture.h | 4 +- variants/Seeed_Solar_Node/platformio.ini | 14 ++ variants/Seeed_Solar_Node/variant.cpp | 108 ++++++++++++++++ variants/Seeed_Solar_Node/variant.h | 157 +++++++++++++++++++++++ 5 files changed, 336 insertions(+), 1 deletion(-) create mode 100644 boards/Seeed_Solar_Node.json create mode 100644 variants/Seeed_Solar_Node/platformio.ini create mode 100644 variants/Seeed_Solar_Node/variant.cpp create mode 100644 variants/Seeed_Solar_Node/variant.h diff --git a/boards/Seeed_Solar_Node.json b/boards/Seeed_Solar_Node.json new file mode 100644 index 000000000..e1b502cfa --- /dev/null +++ b/boards/Seeed_Solar_Node.json @@ -0,0 +1,54 @@ +{ + "build": { + "arduino": { + "ldscript": "nrf52840_s140_v7.ld" + }, + "core": "nRF5", + "cpu": "cortex-m4", + "extra_flags": "-DARDUINO_MDBT50Q_RX -DNRF52840_XXAA", + "f_cpu": "64000000L", + "hwids": [["0x2886", "0x0059"]], + "usb_product": "XIAO-BOOT", + "mcu": "nrf52840", + "variant": "Seeed_Solar_Node", + "bsp": { + "name": "adafruit" + }, + "softdevice": { + "sd_flags": "-DS140", + "sd_name": "s140", + "sd_version": "7.3.0", + "sd_fwid": "0x0123" + }, + "bootloader": { + "settings_addr": "0xFF000" + } + }, + "connectivity": ["bluetooth"], + "debug": { + "jlink_device": "nRF52840_xxAA", + "svd_path": "nrf52840.svd", + "openocd_target": "nrf52840-mdk-rs" + }, + "frameworks": ["arduino"], + "name": "Seeed_Solar_Node", + "upload": { + "maximum_ram_size": 248832, + "maximum_size": 815104, + "speed": 115200, + "protocol": "nrfutil", + "protocols": [ + "jlink", + "nrfjprog", + "nrfutil", + "stlink", + "cmsis-dap", + "blackmagic" + ], + "use_1200bps_touch": true, + "require_upload_port": true, + "wait_for_upload_port": true + }, + "url": "https://www.seeedstudio.com/Seeed-XIAO-BLE-Sense-nRF52840-p-5253.html", + "vendor": "Seeed Studio" +} diff --git a/src/platform/nrf52/architecture.h b/src/platform/nrf52/architecture.h index 21296c3fc..9d1d48f1c 100644 --- a/src/platform/nrf52/architecture.h +++ b/src/platform/nrf52/architecture.h @@ -81,6 +81,8 @@ #define HW_VENDOR meshtastic_HardwareModel_MESHLINK #elif defined(SEEED_XIAO_NRF52840_KIT) #define HW_VENDOR meshtastic_HardwareModel_XIAO_NRF52_KIT +#elif defined(SEEED_SOLAR_NODE) +#define HW_VENDOR meshtastic_HardwareModel_SEEED_SOLAR_NODE #elif defined(HELTEC_MESH_POCKET) #define HW_VENDOR meshtastic_HardwareModel_HELTEC_MESH_POCKET #else @@ -135,4 +137,4 @@ #if !defined(PIN_SERIAL_RX) && !defined(NRF52840_XXAA) // No serial ports on this board - ONLY use segger in memory console #define USE_SEGGER -#endif +#endif \ No newline at end of file diff --git a/variants/Seeed_Solar_Node/platformio.ini b/variants/Seeed_Solar_Node/platformio.ini new file mode 100644 index 000000000..9651d3a77 --- /dev/null +++ b/variants/Seeed_Solar_Node/platformio.ini @@ -0,0 +1,14 @@ +[env:Seeed_Solar_Node] +board = Seeed_Solar_Node +extends = nrf52840_base +;board_level = extra +build_flags = ${nrf52840_base.build_flags} + -I $PROJECT_DIR/variants/Seeed_Solar_Node + -D SEEED_SOLAR_NODE + -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 + -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" +board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/Seeed_Solar_Node> +lib_deps = + ${nrf52840_base.lib_deps} +debug_tool = jlink diff --git a/variants/Seeed_Solar_Node/variant.cpp b/variants/Seeed_Solar_Node/variant.cpp new file mode 100644 index 000000000..994e97ff9 --- /dev/null +++ b/variants/Seeed_Solar_Node/variant.cpp @@ -0,0 +1,108 @@ +/* + * variant.cpp - Digital pin mapping for nRF52-based development board + * + * This file defines the pin mapping array that maps logical digital pins (D0-D17) + * to physical GPIO ports/pins on the Nordic nRF52 series microcontroller. + * + * Board: [Seeed Studio XIAO nRF52840 Sense (Seeed Solar Node)] + * Hardware Features: + * - LoRa module (CS/SCK/MISO/MOSI control pins) + * - GNSS module (TX/RX/Reset/Wakeup) + * - User LEDs (D11-D12) + * - User button (D13) + * - Grove/NFC interface (D14-D15) + * - Battery voltage monitoring (D16) + * + * Created [20250225] + * By [Dylan] + * Version 1.0 + * License: [MIT] + */ + +#include "variant.h" +#include "nrf.h" +#include "wiring_constants.h" +#include "wiring_digital.h" + +/** + * @brief Digital pin to GPIO port/pin mapping table + * + * Format: Logical Pin (Dx) -> nRF Port.Pin (Px.xx) + * + * Pin Groupings: + * [D0-D10] - Peripheral control (LoRa, GNSS) + * [D11-D12] - LED outputs + * [D13] - User button + * [D14-D15] - Grove/NFC interface + * [D16] - Battery voltage ADC input + * [D17] - GNSS module reset + */ + +extern "C" { +const uint32_t g_ADigitalPinMap[] = { + // D0 .. D10 - Peripheral control pins + 2, // D0 P0.02 (A0) GNSS_WAKEUP + 3, // D1 P0.03 (A1) LORA_DIO1 + 28, // D2 P0.28 (A2) LORA_RESET + 29, // D3 P0.29 (A3) LORA_BUSY + 4, // D4 P0.04 (A4/SDA) LORA_CS + 5, // D5 P0.05 (A5/SCL) LORA_SW + 43, // D6 P1.11 (UART_TX) GNSS_TX + 44, // D7 P1.12 (UART_RX) GNSS_RX + 45, // D8 P1.13 (SPI_SCK) LORA_SCK + 46, // D9 P1.14 (SPI_MISO) LORA_MISO + 47, // D10 P1.15 (SPI_MOSI) LORA_MOSI + + // D11-D12 - LED outputs + 15, // D11 P0.15 User LED + 19, // D12 P0.19 Breathing LED + + // D13 - User input + 33, // D13 P1.01 User Button + + // D14-D15 - Grove/NFC interface + 9, // D14 P0.09 NFC1/GROVE_D1 + 10, // D15 P0.10 NFC2/GROVE_D0 + + // D16 - Power management + // 31, // D16 P0.31 VBAT_ADC (Battery voltage) + 31, // D16 P0.31 VBAT_ADC (Battery voltage) + // D17 - GNSS control + 35, // D17 P1.03 GNSS_RESET + + 37, // D18 P1.05 GNSS_ENABLE + 14, // D19 P0.14 BAT_READ + 39, // D20 P1.07 USER_BUTTON + + // + 21, // D21 P0.21 (QSPI_SCK) + 25, // D22 P0.25 (QSPI_CSN) + 20, // D23 P0.20 (QSPI_SIO_0 DI) + 24, // D24 P0.24 (QSPI_SIO_1 DO) + 22, // D25 P0.22 (QSPI_SIO_2 WP) + 23, // D26 P0.23 (QSPI_SIO_3 HOLD) +}; +} + +void initVariant() +{ + pinMode(PIN_QSPI_CS, OUTPUT); + digitalWrite(PIN_QSPI_CS, HIGH); + // This setup is crucial for ensuring low power consumption and proper initialization of the hardware components. + pinMode(GPS_EN, OUTPUT); + digitalWrite(GPS_EN, LOW); + + // VBAT_ENABLE + pinMode(BAT_READ, OUTPUT); + digitalWrite(BAT_READ, LOW); + + pinMode(PIN_LED1, OUTPUT); + digitalWrite(PIN_LED1, LOW); + pinMode(PIN_LED2, OUTPUT); + digitalWrite(PIN_LED2, LOW); + pinMode(PIN_LED2, OUTPUT); + // digitalWrite(LED_PIN, LOW); + + pinMode(GPS_EN, OUTPUT); + digitalWrite(GPS_EN, HIGH); +} \ No newline at end of file diff --git a/variants/Seeed_Solar_Node/variant.h b/variants/Seeed_Solar_Node/variant.h new file mode 100644 index 000000000..86682302b --- /dev/null +++ b/variants/Seeed_Solar_Node/variant.h @@ -0,0 +1,157 @@ +#ifndef _SEEED_SOLAR_NODE_H_ +#define _SEEED_SOLAR_NODE_H_ +#include "WVariant.h" +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Clock Configuration +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define VARIANT_MCK (64000000ul) // Master clock frequency +#define USE_LFXO // 32.768kHz crystal for LFCLK + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Pin Capacity Definitions +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define PINS_COUNT (33u) // Total GPIO pins +#define NUM_DIGITAL_PINS (33u) // Digital I/O pins +#define NUM_ANALOG_INPUTS (8u) // Analog inputs (A0-A5 + VBAT + AREF) +#define NUM_ANALOG_OUTPUTS (0u) + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// LED Configuration +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// LEDs +// LEDs +#define PIN_LED1 (11) // LED P1.15 +#define PIN_LED2 (12) // + +#define LED_BUILTIN PIN_LED1 +#define LED_CONN PIN_LED2 + +#define LED_GREEN PIN_LED1 +#define LED_BLUE PIN_LED2 +// #define LED_PIN PIN_LED2 +#define LED_STATE_ON 1 // State when LED is litted +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Button Configuration +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define BUTTON_PIN D13 // This is the Program Button +// #define BUTTON_NEED_PULLUP 1 +#define BUTTON_ACTIVE_LOW true +#define BUTTON_ACTIVE_PULLUP false + +#define BUTTON_PIN_TOUCH 20 // Touch button +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Digital Pin Mapping (D0-D10) +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define D0 0 // P0.02 GNSS_WAKEUP/IO0 +#define D1 1 // P0.03 LORA_DIO1 +#define D2 2 // P0.28 LORA_RESET +#define D3 3 // P0.29 LORA_BUSY +#define D4 4 // P0.04 LORA_CS/I2C_SDA +#define D5 5 // P0.05 LORA_SW/I2C_SCL +#define D6 6 // P1.11 GNSS_TX +#define D7 7 // P1.12 GNSS_RX +#define D8 8 // P1.13 SPI_SCK +#define D9 9 // P1.14 SPI_MISO +#define D10 10 // P1.15 SPI_MOSI +#define D13 13 // P1.01 User Button +#define D14 14 // P0.09 NFC1/GROVE_D1 +#define D15 15 // P0.10 NFC2/GROVE_D0 +#define D16 16 // P0.31 VBAT_ADC (Battery voltage) +#define D17 17 // P1.03 GNSS_RESET +#define D18 18 // P1.05 GNSS_ENABLE +#define D19 19 // P0.14 BAT_READ +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Analog Pin Definitions +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define PIN_A0 0 // P0.02 Analog Input 0 +#define PIN_A1 1 // P0.03 Analog Input 1 +#define PIN_A2 2 // P0.28 Analog Input 2 +#define PIN_A3 3 // P0.29 Analog Input 3 +#define PIN_A4 4 // P0.04 Analog Input 4 +#define PIN_A5 5 // P0.05 Analog Input 5 +#define PIN_VBAT D16 // P0.31 Battery voltage sense +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Communication Interfaces +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// I2C Configuration +#define HAS_WIRE 1 +#define PIN_WIRE_SDA D14 // P0.09 +#define PIN_WIRE_SCL D15 // P0.10 +#define WIRE_INTERFACES_COUNT 1 +#define I2C_NO_RESCAN + +static const uint8_t SDA = PIN_WIRE_SDA; +static const uint8_t SCL = PIN_WIRE_SCL; +// SPI Configuration (SX1262) + +#define SPI_INTERFACES_COUNT 1 +#define PIN_SPI_MISO 9 // P1.14 (D9) +#define PIN_SPI_MOSI 10 // P1.15 (D10) +#define PIN_SPI_SCK 8 // P1.13 (D8) + +// SX1262 LoRa Module Pins +#define USE_SX1262 +#define SX126X_CS D4 // Chip select +#define SX126X_DIO1 D1 // Digital IO 1 (Interrupt) +#define SX126X_BUSY D3 // Busy status +#define SX126X_RESET D2 // Reset control +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 // TCXO supply voltage +#define SX126X_RXEN D5 // RX enable control +#define SX126X_TXEN RADIOLIB_NC +#define SX126X_DIO2_AS_RF_SWITCH // This Line is really necessary for SX1262 to work with RF switch or will loss TX power +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Power Management +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +#define BAT_READ \ + D19 // P0_14 = 14 Reads battery voltage from divider on signal board. (PIN_VBAT is reading voltage divider on XIAO and is + // program pin 32 / or P0.31) +#define BATTERY_SENSE_RESOLUTION_BITS 12 +#define ADC_MULTIPLIER 3.3 +#define BATTERY_PIN PIN_VBAT // PIN_A7 +#define AREF_VOLTAGE 3.3 +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// GPS L76KB +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define GPS_L76K +#ifdef GPS_L76K +#define PIN_GPS_RX D6 // 44 +#define PIN_GPS_TX D7 // 43 +#define HAS_GPS 1 +#define GPS_BAUDRATE 9600 +#define GPS_THREAD_INTERVAL 50 +#define PIN_SERIAL1_RX PIN_GPS_TX +#define PIN_SERIAL1_TX PIN_GPS_RX +#define PIN_GPS_STANDBY D0 +#define GPS_EN D18 // P1.05 +#endif + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// On-board QSPI Flash +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// On-board QSPI Flash +#define PIN_QSPI_SCK (21) +#define PIN_QSPI_CS (22) +#define PIN_QSPI_IO0 (23) +#define PIN_QSPI_IO1 (24) +#define PIN_QSPI_IO2 (25) +#define PIN_QSPI_IO3 (26) + +#define EXTERNAL_FLASH_DEVICES P25Q16H +#define EXTERNAL_FLASH_USE_QSPI + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Compatibility Definitions +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#ifdef __cplusplus +extern "C" { +#endif +// Serial port placeholders + +#define PIN_SERIAL2_RX (-1) +#define PIN_SERIAL2_TX (-1) +#ifdef __cplusplus +} +#endif + +#endif // _SEEED_SOLAR_NODE_H_ \ No newline at end of file From a36f21b29ae22b5c1476277aa3b9768460cd7642 Mon Sep 17 00:00:00 2001 From: Benjamin Kyd Date: Thu, 17 Apr 2025 10:36:19 +0100 Subject: [PATCH 083/461] Fix compiler error in PowerFSM when WiFi is excluded (#6603) --- src/PowerFSM.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/PowerFSM.cpp b/src/PowerFSM.cpp index 4c4d203c2..dbe4796cf 100644 --- a/src/PowerFSM.cpp +++ b/src/PowerFSM.cpp @@ -19,7 +19,7 @@ #include "sleep.h" #include "target_specific.h" -#if HAS_WIFI && !defined(ARCH_PORTDUINO) +#if HAS_WIFI && !defined(ARCH_PORTDUINO) || defined(MESHTASTIC_EXCLUDE_WIFI) #include "mesh/wifi/WiFiAPClient.h" #endif @@ -269,9 +269,6 @@ Fsm powerFSM(&stateBOOT); void PowerFSM_setup() { bool isRouter = (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ? 1 : 0); - bool isTrackerOrSensor = config.device.role == meshtastic_Config_DeviceConfig_Role_TRACKER || - config.device.role == meshtastic_Config_DeviceConfig_Role_TAK_TRACKER || - config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR; bool hasPower = isPowered(); LOG_INFO("PowerFSM init, USB power=%d", hasPower ? 1 : 0); @@ -383,6 +380,12 @@ void PowerFSM_setup() // See: https://github.com/meshtastic/firmware/issues/1071 // Don't add power saving transitions if we are a power saving tracker or sensor or have Wifi enabled. Sleep will be initiated // through the modules + +#if HAS_WIFI || !defined(MESHTASTIC_EXCLUDE_WIFI) + bool isTrackerOrSensor = config.device.role == meshtastic_Config_DeviceConfig_Role_TRACKER || + config.device.role == meshtastic_Config_DeviceConfig_Role_TAK_TRACKER || + config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR; + if ((isRouter || config.power.is_power_saving) && !isWifiAvailable() && !isTrackerOrSensor) { powerFSM.add_timed_transition(&stateNB, &stateLS, Default::getConfiguredOrDefaultMs(config.power.min_wake_secs, default_min_wake_secs), NULL, @@ -400,7 +403,9 @@ void PowerFSM_setup() Default::getConfiguredOrDefaultMs(config.display.screen_on_secs, default_screen_on_secs), NULL, "Screen-on timeout"); } -#else +#endif // HAS_WIFI || !defined(MESHTASTIC_EXCLUDE_WIFI) + +#else // (not) ARCH_ESP32 // If not ESP32, light-sleep not used. Check periodically if config has drifted out of stateDark powerFSM.add_timed_transition(&stateDARK, &stateDARK, Default::getConfiguredOrDefaultMs(config.display.screen_on_secs, default_screen_on_secs), NULL, @@ -409,4 +414,4 @@ void PowerFSM_setup() powerFSM.run_machine(); // run one iteration of the state machine, so we run our on enter tasks for the initial DARK state } -#endif \ No newline at end of file +#endif From c177c6d655b2bbb05d4d8711fd67756de9fc6412 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 05:33:42 -0500 Subject: [PATCH 084/461] [create-pull-request] automated change (#6610) Co-authored-by: caveman99 <25002+caveman99@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/protobufs b/protobufs index b982b36df..27fac3914 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit b982b36dfab2e96b8f8be90af891c68ebf8790c2 +Subproject commit 27fac39141d99fe727a0a1824c5397409b1aea75 diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 36bded9b2..6fa0b60b0 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -243,6 +243,10 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_HELTEC_MESH_POCKET = 94, /* Seeed Solar Node */ meshtastic_HardwareModel_SEEED_SOLAR_NODE = 95, + /* NomadStar Meteor Pro https://nomadstar.ch/ */ + meshtastic_HardwareModel_NOMADSTAR_METEOR_PRO = 96, + /* Elecrow CrowPanel Advance models, ESP32-S3 and TFT with SX1262 radio plugin */ + meshtastic_HardwareModel_CROWPANEL = 97, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ From ef14967fbf29f0aa2dc38f5dcc9c8289b7461ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 17 Apr 2025 16:03:37 +0200 Subject: [PATCH 085/461] Crowpanel 2.4,2.8 and 3.5 support (#6355) Co-authored-by: mverch67 --- boards/crowpanel.json | 43 ++++ src/FSCommon.cpp | 9 +- src/Power.cpp | 2 + src/graphics/Screen.cpp | 12 +- src/graphics/ScreenFonts.h | 4 +- src/graphics/TFTDisplay.cpp | 330 +++++++++++++++++++++++++- src/graphics/images.h | 2 +- src/main.cpp | 24 +- src/mesh/NodeDB.cpp | 7 +- src/platform/esp32/architecture.h | 2 + src/sleep.cpp | 4 +- variants/elecrow_panel/pins_arduino.h | 64 +++++ variants/elecrow_panel/platformio.ini | 123 ++++++++++ variants/elecrow_panel/variant.h | 195 +++++++++++++++ 14 files changed, 789 insertions(+), 32 deletions(-) create mode 100644 boards/crowpanel.json create mode 100644 variants/elecrow_panel/pins_arduino.h create mode 100644 variants/elecrow_panel/platformio.ini create mode 100644 variants/elecrow_panel/variant.h diff --git a/boards/crowpanel.json b/boards/crowpanel.json new file mode 100644 index 000000000..570961ed7 --- /dev/null +++ b/boards/crowpanel.json @@ -0,0 +1,43 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32s3_out.ld", + "memory_type": "qio_opi", + "partitions": "default_16MB.csv" + }, + "core": "esp32", + "extra_flags": [ + "-DBOARD_HAS_PSRAM", + "-DARDUINO_USB_CDC_ON_BOOT=1", + "-DARDUINO_USB_MODE=0", + "-DARDUINO_RUNNING_CORE=1", + "-DARDUINO_EVENT_RUNNING_CORE=0" + ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "hwids": [["0x303A", "0x1001"]], + "mcu": "esp32s3", + "variant": "ESP32-S3-WROOM-1-N16R8" + }, + "connectivity": ["wifi", "bluetooth", "lora"], + "debug": { + "default_tool": "esp-builtin", + "onboard_tools": ["esp-builtin"], + "openocd_target": "esp32s3.cfg" + }, + "frameworks": ["arduino", "espidf"], + "name": "ESP32-S3-WROOM-1-N16R8 (16 MB Flash, 8 MB PSRAM)", + "upload": { + "flash_size": "16MB", + "maximum_ram_size": 524288, + "maximum_size": 16777216, + "require_upload_port": true, + "speed": 921600 + }, + "monitor": { + "speed": 115200 + }, + "url": "https://www.espressif.com/sites/default/files/documentation/esp32-s3-wroom-1_wroom-1u_datasheet_en.pdf", + "vendor": "Espressif" +} diff --git a/src/FSCommon.cpp b/src/FSCommon.cpp index 88f0764b5..f215be80f 100644 --- a/src/FSCommon.cpp +++ b/src/FSCommon.cpp @@ -12,13 +12,14 @@ #include "SPILock.h" #include "configuration.h" -#ifdef HAS_SDCARD +// Software SPI is used by MUI so disable SD card here until it's also implemented +#if defined(HAS_SDCARD) && !defined(SDCARD_USE_SOFT_SPI) #include #include #ifdef SDCARD_USE_SPI1 -SPIClass SPI1(HSPI); -#define SDHandler SPI1 +SPIClass SPI_HSPI(HSPI); +#define SDHandler SPI_HSPI #else #define SDHandler SPI #endif @@ -306,7 +307,7 @@ void fsInit() */ void setupSDCard() { -#ifdef HAS_SDCARD +#if defined(HAS_SDCARD) && !defined(SDCARD_USE_SOFT_SPI) concurrency::LockGuard g(spiLock); SDHandler.begin(SPI_SCK, SPI_MISO, SPI_MOSI); if (!SD.begin(SDCARD_CS, SDHandler, SD_SPI_FREQUENCY)) { diff --git a/src/Power.cpp b/src/Power.cpp index f11f8eac3..ed1bd20ef 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -450,6 +450,8 @@ class AnalogBatteryLevel : public HasBatteryLevel return isBatteryConnect() && isVbusIn(); #endif #endif + // by default, we check the battery voltage only + return isVbusIn(); } private: diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 9afd88c76..ad0b94efe 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1104,7 +1104,7 @@ static void drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const NodeStat char usersString[20]; snprintf(usersString, sizeof(usersString), "%d/%d", nodeStatus->getNumOnline(), nodeStatus->getNumTotal()); #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS)) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS)) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) display->drawFastImage(x, y + 3, 8, 8, imgUser); #else @@ -1545,7 +1545,7 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O dispdev = new SSD1306Wire(address.address, -1, -1, geometry, (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); #elif defined(ST7735_CS) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7789_CS) || \ - defined(RAK14014) || defined(HX8357_CS) + defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) dispdev = new TFTDisplay(address.address, -1, -1, geometry, (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); #elif defined(USE_EINK) && !defined(USE_EINK_DYNAMICDISPLAY) @@ -1751,7 +1751,7 @@ void Screen::setup() // flip it. If you have a headache now, you're welcome. if (!config.display.flip_screen) { #if defined(ST7701_CS) || defined(ST7735_CS) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || \ - defined(ST7789_CS) || defined(RAK14014) || defined(HX8357_CS) + defined(ST7789_CS) || defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) static_cast(dispdev)->flipScreenVertically(); #elif defined(USE_ST7789) static_cast(dispdev)->flipScreenVertically(); @@ -2492,7 +2492,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 if (!Throttle::isWithinTimespanMs(storeForwardModule->lastHeartbeat, (storeForwardModule->heartbeatInterval * 1200))) { // no heartbeat, overlap a bit #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || ARCH_PORTDUINO) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || ARCH_PORTDUINO) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, imgQuestionL1); @@ -2504,7 +2504,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 #endif } else { #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS)) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS)) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 16, 8, imgSFL1); @@ -2519,7 +2519,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 } else { // TODO: Raspberry Pi supports more than just the one screen size #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || ARCH_PORTDUINO) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || ARCH_PORTDUINO) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, imgInfoL1); diff --git a/src/graphics/ScreenFonts.h b/src/graphics/ScreenFonts.h index 079a3e282..0be0dc814 100644 --- a/src/graphics/ScreenFonts.h +++ b/src/graphics/ScreenFonts.h @@ -65,8 +65,8 @@ #endif #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS)) && \ - !defined(DISPLAY_FORCE_SMALL_FONTS) + defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS)) || \ + defined(ILI9488_CS) && !defined(DISPLAY_FORCE_SMALL_FONTS) // The screen is bigger so use bigger fonts #define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19 #define FONT_MEDIUM FONT_LARGE_LOCAL // Height: 28 diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index c5187cffc..14787baff 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -120,6 +120,303 @@ static void rak14014_tpIntHandle(void) _rak14014_touch_int = true; } +#elif defined(ST72xx_DE) +#include +#include +#include +#include +TCA9534 ioex; + +class LGFX : public lgfx::LGFX_Device +{ + lgfx::Bus_RGB _bus_instance; + lgfx::Panel_RGB _panel_instance; + lgfx::Touch_GT911 _touch_instance; + + public: + const uint16_t screenWidth = TFT_WIDTH; + const uint16_t screenHeight = TFT_HEIGHT; + + bool init_impl(bool use_reset, bool use_clear) override + { + ioex.attach(Wire); + ioex.setDeviceAddress(0x18); + ioex.config(1, TCA9534::Config::OUT); + ioex.config(2, TCA9534::Config::OUT); + ioex.config(3, TCA9534::Config::OUT); + ioex.config(4, TCA9534::Config::OUT); + + ioex.output(1, TCA9534::Level::H); + ioex.output(3, TCA9534::Level::L); + ioex.output(4, TCA9534::Level::H); + + pinMode(1, OUTPUT); + digitalWrite(1, LOW); + ioex.output(2, TCA9534::Level::L); + delay(20); + ioex.output(2, TCA9534::Level::H); + delay(100); + pinMode(1, INPUT); + + return LGFX_Device::init_impl(use_reset, use_clear); + } + + LGFX(void) + { + { + auto cfg = _panel_instance.config(); + + cfg.memory_width = screenWidth; + cfg.memory_height = screenHeight; + cfg.panel_width = screenWidth; + cfg.panel_height = screenHeight; + cfg.offset_x = 0; + cfg.offset_y = 0; + cfg.offset_rotation = 0; + _panel_instance.config(cfg); + } + + { + auto cfg = _panel_instance.config_detail(); + cfg.use_psram = 0; + _panel_instance.config_detail(cfg); + } + + { + auto cfg = _bus_instance.config(); + cfg.panel = &_panel_instance; + cfg.pin_d0 = ST72xx_B0; // B0 + cfg.pin_d1 = ST72xx_B1; // B1 + cfg.pin_d2 = ST72xx_B2; // B2 + cfg.pin_d3 = ST72xx_B3; // B3 + cfg.pin_d4 = ST72xx_B4; // B4 + cfg.pin_d5 = ST72xx_G0; // G0 + cfg.pin_d6 = ST72xx_G1; // G1 + cfg.pin_d7 = ST72xx_G2; // G2 + cfg.pin_d8 = ST72xx_G3; // G3 + cfg.pin_d9 = ST72xx_G4; // G4 + cfg.pin_d10 = ST72xx_G5; // G5 + cfg.pin_d11 = ST72xx_R0; // R0 + cfg.pin_d12 = ST72xx_R1; // R1 + cfg.pin_d13 = ST72xx_R2; // R2 + cfg.pin_d14 = ST72xx_R3; // R3 + cfg.pin_d15 = ST72xx_R4; // R4 + + cfg.pin_henable = ST72xx_DE; + cfg.pin_vsync = ST72xx_VSYNC; + cfg.pin_hsync = ST72xx_HSYNC; + cfg.pin_pclk = ST72xx_PCLK; + cfg.freq_write = 13000000; + +#ifdef ST7265_HSYNC_POLARITY + cfg.hsync_polarity = ST7265_HSYNC_POLARITY; + cfg.hsync_front_porch = ST7265_HSYNC_FRONT_PORCH; // 8; + cfg.hsync_pulse_width = ST7265_HSYNC_PULSE_WIDTH; // 4; + cfg.hsync_back_porch = ST7265_HSYNC_BACK_PORCH; // 8; + + cfg.vsync_polarity = ST7265_VSYNC_POLARITY; // 0; + cfg.vsync_front_porch = ST7265_VSYNC_FRONT_PORCH; // 8; + cfg.vsync_pulse_width = ST7265_VSYNC_PULSE_WIDTH; // 4; + cfg.vsync_back_porch = ST7265_VSYNC_BACK_PORCH; // 8; + + cfg.pclk_idle_high = 1; + cfg.pclk_active_neg = ST7265_PCLK_ACTIVE_NEG; // 0; + // cfg.pclk_idle_high = 0; + // cfg.de_idle_high = 1; +#endif + +#ifdef ST7262_HSYNC_POLARITY + cfg.hsync_polarity = ST7262_HSYNC_POLARITY; + cfg.hsync_front_porch = ST7262_HSYNC_FRONT_PORCH; // 8; + cfg.hsync_pulse_width = ST7262_HSYNC_PULSE_WIDTH; // 4; + cfg.hsync_back_porch = ST7262_HSYNC_BACK_PORCH; // 8; + + cfg.vsync_polarity = ST7262_VSYNC_POLARITY; // 0; + cfg.vsync_front_porch = ST7262_VSYNC_FRONT_PORCH; // 8; + cfg.vsync_pulse_width = ST7262_VSYNC_PULSE_WIDTH; // 4; + cfg.vsync_back_porch = ST7262_VSYNC_BACK_PORCH; // 8; + + cfg.pclk_idle_high = 1; + cfg.pclk_active_neg = ST7262_PCLK_ACTIVE_NEG; // 0; + // cfg.pclk_idle_high = 0; + // cfg.de_idle_high = 1; +#endif + +#ifdef SC7277_HSYNC_POLARITY + cfg.hsync_polarity = SC7277_HSYNC_POLARITY; + cfg.hsync_front_porch = SC7277_HSYNC_FRONT_PORCH; // 8; + cfg.hsync_pulse_width = SC7277_HSYNC_PULSE_WIDTH; // 4; + cfg.hsync_back_porch = SC7277_HSYNC_BACK_PORCH; // 8; + + cfg.vsync_polarity = SC7277_VSYNC_POLARITY; // 0; + cfg.vsync_front_porch = SC7277_VSYNC_FRONT_PORCH; // 8; + cfg.vsync_pulse_width = SC7277_VSYNC_PULSE_WIDTH; // 4; + cfg.vsync_back_porch = SC7277_VSYNC_BACK_PORCH; // 8; + + cfg.pclk_idle_high = 1; + cfg.pclk_active_neg = SC7277_PCLK_ACTIVE_NEG; // 0; + // cfg.pclk_idle_high = 0; + // cfg.de_idle_high = 1; +#endif + + _bus_instance.config(cfg); + } + _panel_instance.setBus(&_bus_instance); + + { + auto cfg = _touch_instance.config(); + cfg.x_min = 0; + cfg.x_max = TFT_WIDTH; + cfg.y_min = 0; + cfg.y_max = TFT_HEIGHT; + cfg.pin_int = -1; + cfg.pin_rst = -1; + cfg.bus_shared = true; + cfg.offset_rotation = 0; + + cfg.i2c_port = 0; + cfg.i2c_addr = 0x5D; + cfg.pin_sda = I2C_SDA; + cfg.pin_scl = I2C_SCL; + cfg.freq = 400000; + _touch_instance.config(cfg); + _panel_instance.setTouch(&_touch_instance); + } + + setPanel(&_panel_instance); + } +}; + +static LGFX *tft = nullptr; + +#elif defined(ILI9488_CS) +#include // Graphics and font library for ILI9488 driver chip + +class LGFX : public lgfx::LGFX_Device +{ + lgfx::Panel_ILI9488 _panel_instance; + lgfx::Bus_SPI _bus_instance; + lgfx::Light_PWM _light_instance; + lgfx::Touch_GT911 _touch_instance; + + public: + LGFX(void) + { + { + auto cfg = _bus_instance.config(); + + // configure SPI + cfg.spi_host = ILI9488_SPI_HOST; // ESP32-S2,S3,C3 : SPI2_HOST or SPI3_HOST / ESP32 : VSPI_HOST or HSPI_HOST + cfg.spi_mode = 0; + cfg.freq_write = SPI_FREQUENCY; // SPI clock for transmission (up to 80MHz, rounded to the value obtained by dividing + // 80MHz by an integer) + cfg.freq_read = SPI_READ_FREQUENCY; // SPI clock when receiving + cfg.spi_3wire = false; // Set to true if reception is done on the MOSI pin + cfg.use_lock = true; // Set to true to use transaction locking + cfg.dma_channel = SPI_DMA_CH_AUTO; // SPI_DMA_CH_AUTO; // Set DMA channel to use (0=not use DMA / 1=1ch / 2=ch / + // SPI_DMA_CH_AUTO=auto setting) + cfg.pin_sclk = ILI9488_SCK; // Set SPI SCLK pin number + cfg.pin_mosi = ILI9488_SDA; // Set SPI MOSI pin number + cfg.pin_miso = ILI9488_MISO; // Set SPI MISO pin number (-1 = disable) + cfg.pin_dc = ILI9488_RS; // Set SPI DC pin number (-1 = disable) + + _bus_instance.config(cfg); // applies the set value to the bus. + _panel_instance.setBus(&_bus_instance); // set the bus on the panel. + } + + { // Set the display panel control. + auto cfg = _panel_instance.config(); // Gets a structure for display panel settings. + + cfg.pin_cs = ILI9488_CS; // Pin number where CS is connected (-1 = disable) + cfg.pin_rst = -1; // Pin number where RST is connected (-1 = disable) + cfg.pin_busy = -1; // Pin number where BUSY is connected (-1 = disable) + + // The following setting values ​​are general initial values ​​for each panel, so please comment out any + // unknown items and try them. + + cfg.memory_width = TFT_WIDTH; // Maximum width supported by the driver IC + cfg.memory_height = TFT_HEIGHT; // Maximum height supported by the driver IC + cfg.panel_width = TFT_WIDTH; // actual displayable width + cfg.panel_height = TFT_HEIGHT; // actual displayable height + cfg.offset_x = TFT_OFFSET_X; // Panel offset amount in X direction + cfg.offset_y = TFT_OFFSET_Y; // Panel offset amount in Y direction + cfg.offset_rotation = TFT_OFFSET_ROTATION; // Rotation direction value offset 0~7 (4~7 is mirrored) +#ifdef TFT_DUMMY_READ_PIXELS + cfg.dummy_read_pixel = TFT_DUMMY_READ_PIXELS; // Number of bits for dummy read before pixel readout +#else + cfg.dummy_read_pixel = 9; // Number of bits for dummy read before pixel readout +#endif + cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read + cfg.readable = true; // Set to true if data can be read + cfg.invert = true; // Set to true if the light/darkness of the panel is reversed + cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped + cfg.dlen_16bit = + false; // Set to true for panels that transmit data length in 16-bit units with 16-bit parallel or SPI + cfg.bus_shared = true; // If the bus is shared with the SD card, set to true (bus control with drawJpgFile etc.) + + // Set the following only when the display is shifted with a driver with a variable number of pixels, such as the + // ST7735 or ILI9163. + // cfg.memory_width = TFT_WIDTH; // Maximum width supported by the driver IC + // cfg.memory_height = TFT_HEIGHT; // Maximum height supported by the driver IC + _panel_instance.config(cfg); + } + +#ifdef ILI9488_BL + // Set the backlight control + { + auto cfg = _light_instance.config(); // Gets a structure for backlight settings. + + cfg.pin_bl = ILI9488_BL; // Pin number to which the backlight is connected + cfg.invert = false; // true to invert the brightness of the backlight + // cfg.freq = 44100; // PWM frequency of backlight + // cfg.pwm_channel = 1; // PWM channel number to use + + _light_instance.config(cfg); + _panel_instance.setLight(&_light_instance); // Set the backlight on the panel. + } +#endif + +#if HAS_TOUCHSCREEN + // Configure settings for touch screen control. + { + auto cfg = _touch_instance.config(); + + cfg.pin_cs = -1; + cfg.x_min = 0; + cfg.x_max = TFT_HEIGHT - 1; + cfg.y_min = 0; + cfg.y_max = TFT_WIDTH - 1; + cfg.pin_int = SCREEN_TOUCH_INT; +#ifdef SCREEN_TOUCH_RST + cfg.pin_rst = SCREEN_TOUCH_RST; +#endif + cfg.bus_shared = true; + cfg.offset_rotation = TFT_OFFSET_ROTATION; + // cfg.freq = 2500000; + + // I2C + cfg.i2c_port = TOUCH_I2C_PORT; + cfg.i2c_addr = TOUCH_SLAVE_ADDRESS; +#ifdef SCREEN_TOUCH_USE_I2C1 + cfg.pin_sda = I2C_SDA1; + cfg.pin_scl = I2C_SCL1; +#else + cfg.pin_sda = I2C_SDA; + cfg.pin_scl = I2C_SCL; +#endif + // cfg.freq = 400000; + + _touch_instance.config(cfg); + _panel_instance.setTouch(&_touch_instance); + } +#endif + + setPanel(&_panel_instance); + } +}; + +static LGFX *tft = nullptr; + #elif defined(ST7789_CS) #include // Graphics and font library for ST7735 driver chip @@ -129,7 +426,7 @@ class LGFX : public lgfx::LGFX_Device lgfx::Bus_SPI _bus_instance; lgfx::Light_PWM _light_instance; #if HAS_TOUCHSCREEN -#ifdef T_WATCH_S3 +#if defined(T_WATCH_S3) || defined(ELECROW) lgfx::Touch_FT5x06 _touch_instance; #else lgfx::Touch_GT911 _touch_instance; @@ -171,16 +468,22 @@ class LGFX : public lgfx::LGFX_Device // The following setting values ​​are general initial values ​​for each panel, so please comment out any // unknown items and try them. - cfg.panel_width = TFT_WIDTH; // actual displayable width - cfg.panel_height = TFT_HEIGHT; // actual displayable height - cfg.offset_x = TFT_OFFSET_X; // Panel offset amount in X direction - cfg.offset_y = TFT_OFFSET_Y; // Panel offset amount in Y direction - cfg.offset_rotation = TFT_OFFSET_ROTATION; // Rotation direction value offset 0~7 (4~7 is mirrored) - cfg.dummy_read_pixel = 9; // Number of bits for dummy read before pixel readout - cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read - cfg.readable = true; // Set to true if data can be read - cfg.invert = true; // Set to true if the light/darkness of the panel is reversed - cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped + cfg.memory_width = TFT_WIDTH; // Maximum width supported by the driver IC + cfg.memory_height = TFT_HEIGHT; // Maximum height supported by the driver IC + cfg.panel_width = TFT_WIDTH; // actual displayable width + cfg.panel_height = TFT_HEIGHT; // actual displayable height + cfg.offset_x = TFT_OFFSET_X; // Panel offset amount in X direction + cfg.offset_y = TFT_OFFSET_Y; // Panel offset amount in Y direction + cfg.offset_rotation = TFT_OFFSET_ROTATION; // Rotation direction value offset 0~7 (4~7 is mirrored) +#ifdef TFT_DUMMY_READ_PIXELS + cfg.dummy_read_pixel = TFT_DUMMY_READ_PIXELS; // Number of bits for dummy read before pixel readout +#else + cfg.dummy_read_pixel = 9; // Number of bits for dummy read before pixel readout +#endif + cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read + cfg.readable = true; // Set to true if data can be read + cfg.invert = true; // Set to true if the light/darkness of the panel is reversed + cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped cfg.dlen_16bit = false; // Set to true for panels that transmit data length in 16-bit units with 16-bit parallel or SPI cfg.bus_shared = true; // If the bus is shared with the SD card, set to true (bus control with drawJpgFile etc.) @@ -217,6 +520,9 @@ class LGFX : public lgfx::LGFX_Device cfg.y_min = 0; cfg.y_max = TFT_WIDTH - 1; cfg.pin_int = SCREEN_TOUCH_INT; +#ifdef SCREEN_TOUCH_RST + cfg.pin_rst = SCREEN_TOUCH_RST; +#endif cfg.bus_shared = true; cfg.offset_rotation = TFT_OFFSET_ROTATION; // cfg.freq = 2500000; @@ -640,7 +946,7 @@ static LGFX *tft = nullptr; #endif #if defined(ST7701_CS) || defined(ST7735_CS) || defined(ST7789_CS) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \ - defined(RAK14014) || defined(HX8357_CS) || (ARCH_PORTDUINO && HAS_SCREEN != 0) + defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST72xx_DE) || (ARCH_PORTDUINO && HAS_SCREEN != 0) #include "SPILock.h" #include "TFTDisplay.h" #include diff --git a/src/graphics/images.h b/src/graphics/images.h index b757dcf30..069839a16 100644 --- a/src/graphics/images.h +++ b/src/graphics/images.h @@ -21,7 +21,7 @@ const uint8_t bluetoothConnectedIcon[36] PROGMEM = {0xfe, 0x01, 0xff, 0x03, 0x03 #endif #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || ARCH_PORTDUINO) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || ARCH_PORTDUINO) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) const uint8_t imgQuestionL1[] PROGMEM = {0xff, 0x01, 0x01, 0x32, 0x7b, 0x49, 0x49, 0x6f, 0x26, 0x01, 0x01, 0xff}; const uint8_t imgQuestionL2[] PROGMEM = {0x0f, 0x08, 0x08, 0x08, 0x06, 0x0f, 0x0f, 0x06, 0x08, 0x08, 0x08, 0x0f}; diff --git a/src/main.cpp b/src/main.cpp index 535a7afa1..eb93a70d1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -115,6 +115,10 @@ AccelerometerThread *accelerometerThread = nullptr; AudioThread *audioThread = nullptr; #endif +#ifdef USE_PCA9557 +PCA9557 IOEXP; +#endif + #if HAS_TFT extern void tftSetup(void); #endif @@ -133,6 +137,10 @@ void setupNicheGraphics(); #include "nicheGraphics.h" #endif +#if defined(HW_SPI1_DEVICE) && defined(ARCH_ESP32) +SPIClass SPI1(HSPI); +#endif + using namespace concurrency; volatile static const char slipstreamTZString[] = {USERPREFS_TZ_STRING}; @@ -364,9 +372,11 @@ void setup() SPISettings spiSettings(4000000, MSBFIRST, SPI_MODE0); #endif +#if !HAS_TFT meshtastic_Config_DisplayConfig_OledType screen_model = meshtastic_Config_DisplayConfig_OledType::meshtastic_Config_DisplayConfig_OledType_OLED_AUTO; OLEDDISPLAY_GEOMETRY screen_geometry = GEOMETRY_128_64; +#endif #ifdef USE_SEGGER auto mode = false ? SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL : SEGGER_RTT_MODE_NO_BLOCK_TRIM; @@ -595,6 +605,7 @@ void setup() } #endif +#if !HAS_TFT auto screenInfo = i2cScanner->firstScreen(); screen_found = screenInfo.type != ScanI2C::DeviceType::NONE ? screenInfo.address : ScanI2C::ADDRESS_NONE; @@ -612,6 +623,7 @@ void setup() screen_model = meshtastic_Config_DisplayConfig_OledType::meshtastic_Config_DisplayConfig_OledType_OLED_AUTO; } } +#endif #define UPDATE_FROM_SCANNER(FIND_FN) @@ -779,9 +791,11 @@ void setup() else playStartMelody(); +#if !HAS_TFT // fixed screen override? if (config.display.oled != meshtastic_Config_DisplayConfig_OledType_OLED_AUTO) screen_model = config.display.oled; +#endif #if defined(USE_SH1107) screen_model = meshtastic_Config_DisplayConfig_OledType_OLED_SH1107; // set dimension of 128x128 @@ -837,10 +851,16 @@ void setup() #elif !defined(ARCH_ESP32) // ARCH_RP2040 SPI.begin(); #else - // ESP32 + // ESP32 +#if defined(HW_SPI1_DEVICE) + SPI1.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); + LOG_DEBUG("SPI1.begin(SCK=%d, MISO=%d, MOSI=%d, NSS=%d)", LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); + SPI1.setFrequency(4000000); +#else SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); LOG_DEBUG("SPI.begin(SCK=%d, MISO=%d, MOSI=%d, NSS=%d)", LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); SPI.setFrequency(4000000); +#endif #endif // Initialize the screen first so we can show the logo while we start up everything else. @@ -934,7 +954,7 @@ void setup() // Don't call screen setup until after nodedb is setup (because we need // the current region name) #if defined(ST7701_CS) || defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \ - defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) + defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) screen->setup(); #elif defined(ARCH_PORTDUINO) if (screen_found.port != ScanI2C::I2CPort::NO_I2C || settingsMap[displayPanel]) { diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index c89abbe74..90a90e89f 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -584,7 +584,8 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) resetRadioConfig(true); // This also triggers NodeInfo/Position requests since we're fresh strncpy(config.network.ntp_server, "meshtastic.pool.ntp.org", 32); -#if (defined(T_DECK) || defined(T_WATCH_S3) || defined(UNPHONE) || defined(PICOMPUTER_S3) || defined(SENSECAP_INDICATOR)) && \ +#if (defined(T_DECK) || defined(T_WATCH_S3) || defined(UNPHONE) || defined(PICOMPUTER_S3) || defined(SENSECAP_INDICATOR) || \ + defined(ELECROW)) && \ HAS_TFT // switch BT off by default; use TFT programming mode or hotkey to enable config.bluetooth.enabled = false; @@ -595,7 +596,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) config.bluetooth.fixed_pin = defaultBLEPin; #if defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7789_CS) || \ - defined(HX8357_CS) || defined(USE_ST7789) + defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) bool hasScreen = true; #ifdef HELTEC_MESH_NODE_T114 uint32_t st7789_id = get_st7789_id(ST7789_NSS, ST7789_SCK, ST7789_SDA, ST7789_RS, ST7789_RESET); @@ -689,7 +690,7 @@ void NodeDB::initConfigIntervals() config.display.screen_on_secs = default_screen_on_secs; -#if defined(T_WATCH_S3) || defined(T_DECK) || defined(UNPHONE) || defined(MESH_TAB) || defined(RAK14014) +#if defined(T_WATCH_S3) || defined(T_DECK) || defined(UNPHONE) || defined(MESH_TAB) || defined(RAK14014) || defined(ELECROW) config.power.is_power_saving = true; config.display.screen_on_secs = 30; config.power.wait_bluetooth_secs = 30; diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index 0af6d4d04..68d06c6d7 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -182,6 +182,8 @@ #define HW_VENDOR meshtastic_HardwareModel_T_ETH_ELITE #elif defined(HELTEC_SENSOR_HUB) #define HW_VENDOR meshtastic_HardwareModel_HELTEC_SENSOR_HUB +#elif defined(ELECROW_PANEL) +#define HW_VENDOR meshtastic_HardwareModel_CROWPANEL #endif // ----------------------------------------------------------------------------- diff --git a/src/sleep.cpp b/src/sleep.cpp index 02fa8d871..2985db0c2 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -400,7 +400,7 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r #ifdef INPUTDRIVER_ENCODER_BTN gpio_wakeup_enable((gpio_num_t)INPUTDRIVER_ENCODER_BTN, GPIO_INTR_LOW_LEVEL); #endif -#ifdef T_WATCH_S3 +#if defined(T_WATCH_S3) || defined(ELECROW) gpio_wakeup_enable((gpio_num_t)SCREEN_TOUCH_INT, GPIO_INTR_LOW_LEVEL); #endif enableLoraInterrupt(); @@ -434,7 +434,7 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r gpio_wakeup_disable(pin); #endif -#ifdef T_WATCH_S3 +#if defined(T_WATCH_S3) || defined(ELECROW) gpio_wakeup_disable((gpio_num_t)SCREEN_TOUCH_INT); #endif diff --git a/variants/elecrow_panel/pins_arduino.h b/variants/elecrow_panel/pins_arduino.h new file mode 100644 index 000000000..b98530378 --- /dev/null +++ b/variants/elecrow_panel/pins_arduino.h @@ -0,0 +1,64 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +// static const uint8_t LED_BUILTIN = -1; + +// static const uint8_t TX = 43; +// static const uint8_t RX = 44; + +static const uint8_t SDA = 39; +static const uint8_t SCL = 40; + +// Default SPI will be mapped to Radio +static const uint8_t SS = -1; +static const uint8_t MOSI = 48; +static const uint8_t MISO = 47; +static const uint8_t SCK = 41; + +#ifndef CROW_SELECT +static const uint8_t SPI_MOSI = 6; +static const uint8_t SPI_SCK = 5; +static const uint8_t SPI_MISO = 4; +static const uint8_t SPI_CS = 7; // SD does not support -1 +static const uint8_t SDCARD_CS = SPI_CS; +#endif + +static const uint8_t A0 = 1; +static const uint8_t A1 = 2; +static const uint8_t A2 = 3; +static const uint8_t A3 = 4; +static const uint8_t A4 = 5; +static const uint8_t A5 = 6; +static const uint8_t A6 = 7; +static const uint8_t A7 = 8; +static const uint8_t A8 = 9; +static const uint8_t A9 = 10; +static const uint8_t A10 = 11; +static const uint8_t A11 = 12; +static const uint8_t A12 = 13; +static const uint8_t A13 = 14; +static const uint8_t A14 = 15; +static const uint8_t A15 = 16; +static const uint8_t A16 = 17; +static const uint8_t A17 = 18; +static const uint8_t A18 = 19; +static const uint8_t A19 = 20; + +static const uint8_t T1 = 1; +static const uint8_t T2 = 2; +static const uint8_t T3 = 3; +static const uint8_t T4 = 4; +static const uint8_t T5 = 5; +static const uint8_t T6 = 6; +static const uint8_t T7 = 7; +static const uint8_t T8 = 8; +static const uint8_t T9 = 9; +static const uint8_t T10 = 10; +static const uint8_t T11 = 11; +static const uint8_t T12 = 12; +static const uint8_t T13 = 13; +static const uint8_t T14 = 14; + +#endif /* Pins_Arduino_h */ \ No newline at end of file diff --git a/variants/elecrow_panel/platformio.ini b/variants/elecrow_panel/platformio.ini new file mode 100644 index 000000000..66dc35c3b --- /dev/null +++ b/variants/elecrow_panel/platformio.ini @@ -0,0 +1,123 @@ +[crowpanel_base] +extends = esp32s3_base +board = crowpanel +board_check = true +upload_protocol = esptool +board_build.partitions = default_16MB.csv ; must be here for some reason, board.json is not enough !? + +build_flags = ${esp32s3_base.build_flags} -Os + -I variants/elecrow_panel + -D ELECROW + -D ELECROW_PANEL + -D CONFIG_ARDUHAL_LOG_COLORS + -D RADIOLIB_DEBUG_SPI=0 + -D RADIOLIB_DEBUG_PROTOCOL=0 + -D RADIOLIB_DEBUG_BASIC=0 + -D RADIOLIB_VERBOSE_ASSERT=0 + -D RADIOLIB_SPI_PARANOID=0 + -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 + -D MESHTASTIC_EXCLUDE_INPUTBROKER=1 + -D MESHTASTIC_EXCLUDE_WEBSERVER=1 + -D MESHTASTIC_EXCLUDE_SERIAL=1 + -D MESHTASTIC_EXCLUDE_SOCKETAPI=1 + -D MESHTASTIC_EXCLUDE_SCREEN=1 + -D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1 +; -D INPUTDRIVER_BUTTON_TYPE=0 + -D HAS_TELEMETRY=0 + -D CONFIG_DISABLE_HAL_LOCKS=1 + -D HAS_SCREEN=0 + -D HAS_TFT=1 + -D RAM_SIZE=6144 + -D LV_LVGL_H_INCLUDE_SIMPLE + -D LV_CONF_INCLUDE_SIMPLE + -D LV_COMP_CONF_INCLUDE_SIMPLE + -D LV_USE_SYSMON=0 + -D LV_USE_PROFILER=0 + -D LV_USE_PERF_MONITOR=0 + -D LV_USE_MEM_MONITOR=0 + -D LV_USE_LOG=0 + -D LV_BUILD_TEST=0 + -D USE_LOG_DEBUG + -D LOG_DEBUG_INC=\"DebugConfiguration.h\" + -D USE_PACKET_API + +lib_deps = ${esp32s3_base.lib_deps} + ${device-ui_base.lib_deps} + earlephilhower/ESP8266Audio@^1.9.9 + earlephilhower/ESP8266SAM@^1.0.1 + lovyan03/LovyanGFX@^1.2.0 + hideakitai/TCA9534@^0.1.1 + +[env:elecrow-24-28-tft] +extends = crowpanel_base + +build_flags = + ${crowpanel_base.build_flags} + -D TFT_HEIGHT=320 ; needed in variant.h + -D HAS_SDCARD + -D SDCARD_USE_SOFT_SPI + -D SPI_DRIVER_SELECT=2 + -D USE_PIN_BUZZER +; -D INPUTDRIVER_BUTTON_TYPE=0 ; no button as this pin is assigned to LoRa cs! + -D SCREEN_TOUCH_INT=47 ; used to wake up the MCU by touch + -D LGFX_DRIVER_TEMPLATE + -D LGFX_DRIVER=LGFX_GENERIC + -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\" + -D SPI_FREQUENCY=80000000 + -D LGFX_SCREEN_WIDTH=240 + -D LGFX_SCREEN_HEIGHT=320 + -D LGFX_PANEL=ST7789 + -D LGFX_ROTATION=1 + -D LGFX_CFG_HOST=SPI2_HOST + -D LGFX_PIN_SCK=42 + -D LGFX_PIN_MOSI=39 + -D LGFX_PIN_DC=41 + -D LGFX_PIN_CS=40 + -D LGFX_PIN_BL=38 + -D LGFX_TOUCH=FT5x06 + -D LGFX_TOUCH_I2C_ADDR=0x38 + -D LGFX_TOUCH_I2C_SDA=15 + -D LGFX_TOUCH_I2C_SCL=16 + -D LGFX_TOUCH_INT=47 + -D LGFX_TOUCH_RST=48 + -D LGFX_TOUCH_ROTATION=0 + -D VIEW_320x240 + -D MAP_FULL_REDRAW + +[env:elecrow-35-tft] +extends = crowpanel_base + +build_flags = + ${crowpanel_base.build_flags} + -D TFT_HEIGHT=480 ; needed in variant.h + -D HAS_SDCARD + -D SDCARD_USE_SOFT_SPI + -D SPI_DRIVER_SELECT=2 + -D USE_PIN_BUZZER +; -D INPUTDRIVER_BUTTON_TYPE=0 ; no button as this pin is assigned to LoRa cs! + -D SCREEN_TOUCH_INT=47 ; used to wake up the MCU by touch + -D LV_CACHE_DEF_SIZE=2097152 + -D LGFX_DRIVER_TEMPLATE + -D LGFX_DRIVER=LGFX_GENERIC + -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\" + -D SPI_FREQUENCY=60000000 + -D LGFX_SCREEN_WIDTH=320 + -D LGFX_SCREEN_HEIGHT=480 + -D LGFX_PANEL=ILI9488 + -D LGFX_ROTATION=0 + -D LGFX_CFG_HOST=SPI2_HOST + -D LGFX_PIN_SCK=42 + -D LGFX_PIN_MOSI=39 + -D LGFX_PIN_DC=41 + -D LGFX_PIN_CS=40 + -D LGFX_PIN_BL=38 + -D LGFX_TOUCH=GT911 + -D LGFX_TOUCH_I2C_ADDR=0x5D + -D LGFX_TOUCH_I2C_SDA=15 + -D LGFX_TOUCH_I2C_SCL=16 + -D LGFX_TOUCH_INT=47 + -D LGFX_TOUCH_RST=48 + -D LGFX_TOUCH_ROTATION=0 + -D DISPLAY_SET_RESOLUTION + -D VIEW_320x240 + -D MAP_FULL_REDRAW diff --git a/variants/elecrow_panel/variant.h b/variants/elecrow_panel/variant.h new file mode 100644 index 000000000..b1035ed31 --- /dev/null +++ b/variants/elecrow_panel/variant.h @@ -0,0 +1,195 @@ +#define I2C_SDA 15 +#define I2C_SCL 16 + +#if TFT_HEIGHT == 320 && not defined(HAS_TFT) // 2.4 and 2.8 TFT +// ST7789 TFT LCD +#define ST7789_CS 40 +#define ST7789_RS 41 // DC +#define ST7789_SDA 39 // MOSI +#define ST7789_SCK 42 +#define ST7789_RESET -1 +#define ST7789_MISO 38 +#define ST7789_BUSY -1 +#define ST7789_BL 38 +#define ST7789_SPI_HOST SPI2_HOST +#define TFT_BL 38 +#define SPI_FREQUENCY 60000000 +#define SPI_READ_FREQUENCY 16000000 +#define TFT_OFFSET_ROTATION 0 +#define SCREEN_ROTATE +#define TFT_DUMMY_READ_PIXELS 8 +#define SCREEN_TRANSITION_FRAMERATE 5 +#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness + +#define HAS_TOUCHSCREEN 1 +#define SCREEN_TOUCH_INT 47 +#define SCREEN_TOUCH_RST 48 +#define TOUCH_I2C_PORT 0 +#define TOUCH_SLAVE_ADDRESS 0x38 // FT5x06 +#endif + +#if TFT_HEIGHT == 480 && not defined(HAS_TFT) // 3.5 TFT +// ILI9488 TFT LCD +#define ILI9488_CS 40 +#define ILI9488_RS 41 // DC +#define ILI9488_SDA 39 // MOSI +#define ILI9488_SCK 42 +#define ILI9488_RESET -1 +#define ILI9488_MISO 38 +#define ILI9488_BUSY -1 +#define ILI9488_BL 38 +#define ILI9488_SPI_HOST SPI2_HOST +#define TFT_BL 38 +#define SPI_FREQUENCY 40000000 +#define SPI_READ_FREQUENCY 16000000 +#define TFT_OFFSET_ROTATION 0 +#define SCREEN_ROTATE +#define TFT_DUMMY_READ_PIXELS 8 +#define SCREEN_TRANSITION_FRAMERATE 5 +#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness + +#define HAS_TOUCHSCREEN 1 +#define SCREEN_TOUCH_INT 47 +#define SCREEN_TOUCH_RST 48 +#define TOUCH_I2C_PORT 0 +#define TOUCH_SLAVE_ADDRESS 0x5D // GT911 +#endif + +#ifdef CROW_SELECT +#define ST72xx_DE 42 +#define ST72xx_VSYNC 41 +#define ST72xx_HSYNC 40 +#define ST72xx_PCLK 39 +#define ST72xx_R0 7 +#define ST72xx_R1 17 +#define ST72xx_R2 18 +#define ST72xx_R3 3 +#define ST72xx_R4 46 +#define ST72xx_G0 9 +#define ST72xx_G1 10 +#define ST72xx_G2 11 +#define ST72xx_G3 12 +#define ST72xx_G4 13 +#define ST72xx_G5 14 +#define ST72xx_B0 21 +#define ST72xx_B1 47 +#define ST72xx_B2 48 +#define ST72xx_B3 45 +#define ST72xx_B4 38 + +#define HAS_TOUCHSCREEN 1 +#define TOUCH_I2C_PORT 0 +#define TOUCH_SLAVE_ADDRESS 0x5D // GT911 +#endif + +#if defined(CROW_SELECT) && CROW_SELECT == 1 // 4.3 TFT 800x480 +#define ST7265_HSYNC_POLARITY 0 +#define ST7265_HSYNC_FRONT_PORCH 24 +#define ST7265_HSYNC_PULSE_WIDTH 8 +#define ST7265_HSYNC_BACK_PORCH 24 +#define ST7265_VSYNC_POLARITY 1 +#define ST7265_VSYNC_FRONT_PORCH 24 +#define ST7265_VSYNC_PULSE_WIDTH 8 +#define ST7265_VSYNC_BACK_PORCH 24 +#define ST7265_PCLK_ACTIVE_NEG 1 +#endif + +#if defined(CROW_SELECT) && CROW_SELECT == 2 // 5.0 TFT 800x480 +#define ST7262_HSYNC_POLARITY 0 +#define ST7262_HSYNC_FRONT_PORCH 8 +#define ST7262_HSYNC_PULSE_WIDTH 4 +#define ST7262_HSYNC_BACK_PORCH 8 +#define ST7262_VSYNC_POLARITY 0 +#define ST7262_VSYNC_FRONT_PORCH 8 +#define ST7262_VSYNC_PULSE_WIDTH 4 +#define ST7262_VSYNC_BACK_PORCH 8 +#define ST7262_PCLK_ACTIVE_NEG 0 +#endif + +#if defined(CROW_SELECT) && CROW_SELECT == 3 // 7.0 TFT 800x480 +#define SC7277_HSYNC_POLARITY 0 +#define SC7277_HSYNC_FRONT_PORCH 8 +#define SC7277_HSYNC_PULSE_WIDTH 4 +#define SC7277_HSYNC_BACK_PORCH 8 +#define SC7277_VSYNC_POLARITY 0 +#define SC7277_VSYNC_FRONT_PORCH 8 +#define SC7277_VSYNC_PULSE_WIDTH 4 +#define SC7277_VSYNC_BACK_PORCH 8 +#define SC7277_PCLK_ACTIVE_NEG 0 +#endif + +#if TFT_HEIGHT == 320 // 2.4-2.8 have I2S audio +// dac / amp +// #define HAS_I2S // didn't get I2S sound working +#define PIN_BUZZER 8 // using pwm buzzer instead (nobody will notice, lol) +#define DAC_I2S_BCK 13 +#define DAC_I2S_WS 11 +#define DAC_I2S_DOUT 12 +#define DAC_I2S_MCLK 8 // don't use GPIO0 because it's assigned to LoRa or button +#else +#define PIN_BUZZER 8 +#endif + +// GPS via UART1 connector +#define HAS_GPS 1 +#define GPS_DEFAULT_NOT_PRESENT 1 +#define GPS_RX_PIN 18 +#define GPS_TX_PIN 17 + +// Extension Slot Layout, viewed from above (2.4-3.5) +// DIO1/IO1 o o IO2/NRESET +// SCK/IO10 o o IO16/NC +// MISO/IO9 o o IO15/NC +// MOSI/IO3 o o NC/DIO2 +// 3V3 o o IO46/BUSY +// GND o o IO0/NSS +// 5V/NC o o NC/DIO3 +// J9 J8 + +// Extension Slot Layout, viewed from above (4.3-7.0) +// !! DIO1/IO20 o o IO19/NRESET !! +// !! SCK/IO5 o o IO16/NC +// !! MISO/IO4 o o IO15/NC +// !! MOSI/IO6 o o NC/DIO2 +// 3V3 o o IO2/BUSY !! +// GND o o IO0/NSS +// 5V/NC o o NC/DIO3 +// J9 J8 + +// LoRa +#define USE_SX1262 +#define LORA_CS 0 // GND + +#if TFT_HEIGHT == 320 || TFT_HEIGHT == 480 // 2.4 - 3.5 TFT +#define LORA_SCK 10 +#define LORA_MISO 9 +#define LORA_MOSI 3 + +#define LORA_RESET 2 +#define LORA_DIO1 1 // SX1262 IRQ +#define LORA_DIO2 46 // SX1262 BUSY + +// need to pull IO45 low to enable LORA and disable Microphone on 24 28 35 +#define SENSOR_POWER_CTRL_PIN 45 +#define SENSOR_POWER_ON LOW +#else +#define LORA_SCK 5 +#define LORA_MISO 4 +#define LORA_MOSI 6 + +#define LORA_RESET 19 +#define LORA_DIO1 20 // SX1262 IRQ +#define LORA_DIO2 2 // SX1262 BUSY +#endif + +#define HW_SPI1_DEVICE +#define SX126X_CS LORA_CS +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_DIO2 +#define SX126X_RESET LORA_RESET +#define SX126X_DIO2_AS_RF_SWITCH + +#define SX126X_DIO3_TCXO_VOLTAGE 3.3 + +#define USE_VIRTUAL_KEYBOARD 1 +#define DISPLAY_CLOCK_FRAME 1 \ No newline at end of file From e2f6600cb955f8de86175a87fae36f49863ba72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 17 Apr 2025 22:58:28 +0200 Subject: [PATCH 086/461] Lib Update (#6510) * Lib Update Draft because PIN display doesn't work yet. * pin entry still no worky * Fix for missing PIN code issue (#6574) --------- Co-authored-by: Ben Meadors Co-authored-by: Alexander Begoon --- arch/esp32/esp32.ini | 2 +- src/nimble/NimbleBluetooth.cpp | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 5e15cb451..35f3a5a1c 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -50,7 +50,7 @@ lib_deps = # renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master https://github.com/meshtastic/esp32_https_server/archive/896f1771ceb5979987a0b41028bf1b4e7aad419b.zip # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino - h2zero/NimBLE-Arduino@^1.4.3 + h2zero/NimBLE-Arduino@^2.2.3 # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib diff --git a/src/nimble/NimbleBluetooth.cpp b/src/nimble/NimbleBluetooth.cpp index 009439f25..208d8ae3c 100644 --- a/src/nimble/NimbleBluetooth.cpp +++ b/src/nimble/NimbleBluetooth.cpp @@ -49,7 +49,7 @@ static uint8_t lastToRadio[MAX_TO_FROM_RADIO_SIZE]; class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks { - virtual void onWrite(NimBLECharacteristic *pCharacteristic) + virtual void onWrite(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo) { LOG_DEBUG("To Radio onwrite"); auto val = pCharacteristic->getValue(); @@ -66,7 +66,7 @@ class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks { - virtual void onRead(NimBLECharacteristic *pCharacteristic) + virtual void onRead(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo) { uint8_t fromRadioBytes[meshtastic_FromRadio_size]; size_t numBytes = bluetoothPhoneAPI->getFromRadio(fromRadioBytes); @@ -79,7 +79,7 @@ class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks class NimbleBluetoothServerCallback : public NimBLEServerCallbacks { - virtual uint32_t onPassKeyRequest() + virtual uint32_t onPassKeyDisplay() { uint32_t passkey = config.bluetooth.fixed_pin; @@ -125,7 +125,7 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks return passkey; } - virtual void onAuthenticationComplete(ble_gap_conn_desc *desc) + virtual void onAuthenticationComplete(NimBLEConnInfo &connInfo) { LOG_INFO("BLE authentication complete"); @@ -138,9 +138,9 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks } } - virtual void onDisconnect(NimBLEServer *pServer, ble_gap_conn_desc *desc) + virtual void onDisconnect(NimBLEServer *pServer, NimBLEConnInfo &connInfo, int reason) { - LOG_INFO("BLE disconnect"); + LOG_INFO("BLE disconnect. Reason %i", reason); bluetoothStatus->updateStatus( new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED)); @@ -191,7 +191,7 @@ int NimbleBluetooth::getRssi() if (bleServer && isConnected()) { auto service = bleServer->getServiceByUUID(MESH_SERVICE_UUID); uint16_t handle = service->getHandle(); - return NimBLEDevice::getClientByID(handle)->getRssi(); + return NimBLEDevice::getClientByHandle(handle)->getRssi(); } return 0; // FIXME figure out where to source this } @@ -216,6 +216,7 @@ void NimbleBluetooth::setup() NimbleBluetoothServerCallback *serverCallbacks = new NimbleBluetoothServerCallback(); bleServer->setCallbacks(serverCallbacks, true); + bleServer->advertiseOnDisconnect(true); setupService(); startAdvertising(); } @@ -259,7 +260,7 @@ void NimbleBluetooth::setupService() BatteryCharacteristic = batteryService->createCharacteristic( // 0x2A19 is the Battery Level characteristic) (uint16_t)0x2a19, NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::NOTIFY, 1); - NimBLE2904 *batteryLevelDescriptor = (NimBLE2904 *)BatteryCharacteristic->createDescriptor((uint16_t)0x2904); + NimBLE2904 *batteryLevelDescriptor = (NimBLE2904 *)BatteryCharacteristic->create2904(); batteryLevelDescriptor->setFormat(NimBLE2904::FORMAT_UINT8); batteryLevelDescriptor->setNamespace(1); batteryLevelDescriptor->setUnit(0x27ad); From 74b3dc34e4e230193fa6e5bab9fd88fbce5d574b Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Fri, 18 Apr 2025 10:11:42 +1200 Subject: [PATCH 087/461] Fix crash when clearing NRF52 BLE bonds (#6609) * Fix crash before clearing BLE bonds * Prevent clients re-pairing BLE during factory reset Clients seem able to re-pair BLE after clearing bonds during factory reset, even after advertising disabled. This seems to primarily occur on Android devices, which seem to more actively maintain the BLE connection. As a workaround, `NRF52Bluetooth::shutdown` swaps the BLE pairing callback to one which actively rejects new connections. --------- Co-authored-by: Ben Meadors --- src/mesh/NodeDB.cpp | 1 - src/platform/nrf52/NRF52Bluetooth.cpp | 40 +++++++++++++++++++-------- src/platform/nrf52/NRF52Bluetooth.h | 3 ++ 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 90a90e89f..67f0da600 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -450,7 +450,6 @@ bool NodeDB::factoryReset(bool eraseBleBonds) nvs_flash_erase(); #endif #ifdef ARCH_NRF52 - Bluefruit.begin(); LOG_INFO("Clear bluetooth bonds!"); bond_print_list(BLE_GAP_ROLE_PERIPH); bond_print_list(BLE_GAP_ROLE_CENTRAL); diff --git a/src/platform/nrf52/NRF52Bluetooth.cpp b/src/platform/nrf52/NRF52Bluetooth.cpp index 87d8adfa9..4f6fe7c6b 100644 --- a/src/platform/nrf52/NRF52Bluetooth.cpp +++ b/src/platform/nrf52/NRF52Bluetooth.cpp @@ -210,17 +210,8 @@ void NRF52Bluetooth::shutdown() { // Shutdown bluetooth for minimum power draw LOG_INFO("Disable NRF52 bluetooth"); - uint8_t connection_num = Bluefruit.connected(); - if (connection_num) { - for (uint8_t i = 0; i < connection_num; i++) { - LOG_INFO("NRF52 bluetooth disconnecting handle %d", i); - Bluefruit.disconnect(i); - } - // Wait for disconnection - while (Bluefruit.connected()) - yield(); - LOG_INFO("All bluetooth connections ended"); - } + Bluefruit.Security.setPairPasskeyCallback(NRF52Bluetooth::onUnwantedPairing); // Actively refuse (during factory reset) + disconnect(); Bluefruit.Advertising.stop(); } void NRF52Bluetooth::startDisabled() @@ -372,6 +363,33 @@ bool NRF52Bluetooth::onPairingPasskey(uint16_t conn_handle, uint8_t const passke LOG_INFO("BLE passkey pair: match_request=%i", match_request); return true; } + +// Actively refuse new BLE pairings +// After clearing bonds (at factory reset), clients seem initially able to attempt to re-pair, even with advertising disabled. +// On NRF52Bluetooth::shutdown, we change the pairing callback to this method, to aggressively refuse any connection attempts. +bool NRF52Bluetooth::onUnwantedPairing(uint16_t conn_handle, uint8_t const passkey[6], bool match_request) +{ + NRF52Bluetooth::disconnect(); + return false; +} + +// Disconnect any BLE connections +void NRF52Bluetooth::disconnect() +{ + uint8_t connection_num = Bluefruit.connected(); + if (connection_num) { + // Close all connections. We're only expecting one. + for (uint8_t i = 0; i < connection_num; i++) + Bluefruit.disconnect(i); + + // Wait for disconnection + while (Bluefruit.connected()) + yield(); + + LOG_INFO("Ended BLE connection"); + } +} + void NRF52Bluetooth::onPairingCompleted(uint16_t conn_handle, uint8_t auth_status) { if (auth_status == BLE_GAP_SEC_STATUS_SUCCESS) { diff --git a/src/platform/nrf52/NRF52Bluetooth.h b/src/platform/nrf52/NRF52Bluetooth.h index 2229163f8..630ab05bc 100644 --- a/src/platform/nrf52/NRF52Bluetooth.h +++ b/src/platform/nrf52/NRF52Bluetooth.h @@ -19,4 +19,7 @@ class NRF52Bluetooth : BluetoothApi static void onConnectionSecured(uint16_t conn_handle); static bool onPairingPasskey(uint16_t conn_handle, uint8_t const passkey[6], bool match_request); static void onPairingCompleted(uint16_t conn_handle, uint8_t auth_status); + + static bool onUnwantedPairing(uint16_t conn_handle, uint8_t const passkey[6], bool match_request); + static void disconnect(); }; \ No newline at end of file From 9da141aa8c062bfb3664214d0945fb95b6a44e8a Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 18 Apr 2025 08:27:38 -0400 Subject: [PATCH 088/461] Add TFT docker builds (for CI) (#6614) --- .github/workflows/docker_build.yml | 7 +++++++ .github/workflows/main_matrix.yml | 26 ++++++++++++++++++++++---- Dockerfile | 13 ++++++++----- alpine.Dockerfile | 6 ++++-- bin/build-native.sh | 7 ++++--- 5 files changed, 45 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index eec0785c0..cde7fd274 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -26,6 +26,11 @@ on: required: false type: boolean default: false + pio_env: + description: PlatformIO environment to build + required: false + type: string + default: native outputs: digest: description: Digest of built image @@ -90,3 +95,5 @@ jobs: push: ${{ inputs.push }} tags: ${{ steps.meta.outputs.tags }} # Tag is only meant to be consumed by the "manifest" job platforms: ${{ inputs.platform }} + build-args: | + PIO_ENV=${{ inputs.pio_env }} diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 5b11926f2..0889ce22e 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -145,7 +145,7 @@ jobs: test-native: uses: ./.github/workflows/test_native.yml - docker-debian-amd64: + docker-deb-amd64: uses: ./.github/workflows/docker_build.yml with: distro: debian @@ -153,7 +153,16 @@ jobs: runs-on: ubuntu-24.04 push: false - docker-alpine-amd64: + docker-deb-amd64-tft: + uses: ./.github/workflows/docker_build.yml + with: + distro: debian + platform: linux/amd64 + runs-on: ubuntu-24.04 + push: false + pio_env: native-tft + + docker-alp-amd64: uses: ./.github/workflows/docker_build.yml with: distro: alpine @@ -161,7 +170,16 @@ jobs: runs-on: ubuntu-24.04 push: false - docker-debian-arm64: + docker-alp-amd64-tft: + uses: ./.github/workflows/docker_build.yml + with: + distro: alpine + platform: linux/amd64 + runs-on: ubuntu-24.04 + push: false + pio_env: native-tft + + docker-deb-arm64: uses: ./.github/workflows/docker_build.yml with: distro: debian @@ -169,7 +187,7 @@ jobs: runs-on: ubuntu-24.04-arm push: false - docker-debian-armv7: + docker-deb-armv7: uses: ./.github/workflows/docker_build.yml with: distro: debian diff --git a/Dockerfile b/Dockerfile index 55580c579..be192f216 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ # trunk-ignore-all(terrascan/AC_DOCKER_0002): Known terrascan issue # trunk-ignore-all(trivy/DS002): We must run as root for this container -# trunk-ignore-all(checkov/CKV_DOCKER_8): We must run as root for this container # trunk-ignore-all(hadolint/DL3002): We must run as root for this container # trunk-ignore-all(hadolint/DL3008): Do not pin apt package versions # trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions +ARG PIO_ENV=native FROM python:3.13-bookworm AS builder ENV DEBIAN_FRONTEND=noninteractive @@ -12,9 +12,10 @@ ENV TZ=Etc/UTC # Install Dependencies ENV PIP_ROOT_USER_ACTION=ignore RUN apt-get update && apt-get install --no-install-recommends -y \ - curl wget g++ zip git ca-certificates \ + curl wget g++ zip git ca-certificates pkg-config \ libgpiod-dev libyaml-cpp-dev libbluetooth-dev libi2c-dev libuv1-dev \ - libusb-1.0-0-dev libulfius-dev liborcania-dev libssl-dev pkg-config \ + libusb-1.0-0-dev libulfius-dev liborcania-dev libssl-dev \ + libx11-dev libinput-dev libxkbcommon-x11-dev \ && apt-get clean && rm -rf /var/lib/apt/lists/* \ && pip install --no-cache-dir -U platformio \ && mkdir /tmp/firmware @@ -24,7 +25,7 @@ WORKDIR /tmp/firmware COPY . /tmp/firmware # Build -RUN bash ./bin/build-native.sh && \ +RUN bash ./bin/build-native.sh "$PIO_ENV" && \ cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd" # Fetch web assets @@ -44,7 +45,9 @@ ENV TZ=Etc/UTC USER root RUN apt-get update && apt-get --no-install-recommends -y install \ - libc-bin libc6 libgpiod2 libyaml-cpp0.7 libi2c0 libuv1 libusb-1.0-0-dev liborcania2.3 libulfius2.7 libssl3 \ + libc-bin libc6 libgpiod2 libyaml-cpp0.7 libi2c0 libuv1 libusb-1.0-0-dev \ + liborcania2.3 libulfius2.7 libssl3 \ + libx11-6 libinput10 libxkbcommon-x11-0 \ && apt-get clean && rm -rf /var/lib/apt/lists/* \ && mkdir -p /var/lib/meshtasticd \ && mkdir -p /etc/meshtasticd/config.d \ diff --git a/alpine.Dockerfile b/alpine.Dockerfile index 17afc2964..f85c147da 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -1,8 +1,8 @@ # trunk-ignore-all(trivy/DS002): We must run as root for this container -# trunk-ignore-all(checkov/CKV_DOCKER_8): We must run as root for this container # trunk-ignore-all(hadolint/DL3002): We must run as root for this container # trunk-ignore-all(hadolint/DL3018): Do not pin apk package versions # trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions +ARG PIO_ENV=native FROM python:3.13-alpine3.21 AS builder @@ -10,6 +10,7 @@ ENV PIP_ROOT_USER_ACTION=ignore RUN apk --no-cache add \ bash g++ libstdc++-dev linux-headers zip git ca-certificates libgpiod-dev yaml-cpp-dev bluez-dev \ libusb-dev i2c-tools-dev libuv-dev openssl-dev pkgconf argp-standalone \ + libx11-dev libinput-dev libxkbcommon-dev \ && rm -rf /var/cache/apk/* \ && pip install --no-cache-dir -U platformio \ && mkdir /tmp/firmware @@ -21,7 +22,7 @@ COPY . /tmp/firmware # Add `argp` for musl ENV PLATFORMIO_BUILD_FLAGS="-Os -ffunction-sections -fdata-sections -Wl,--gc-sections -largp" -RUN bash ./bin/build-native.sh && \ +RUN bash ./bin/build-native.sh "$PIO_ENV" && \ cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd" # ##### PRODUCTION BUILD ############# @@ -33,6 +34,7 @@ USER root RUN apk --no-cache add \ libstdc++ libgpiod yaml-cpp libusb i2c-tools libuv \ + libx11 libinput libxkbcommon \ && rm -rf /var/cache/apk/* \ && mkdir -p /var/lib/meshtasticd \ && mkdir -p /etc/meshtasticd/config.d \ diff --git a/bin/build-native.sh b/bin/build-native.sh index c6b1434dd..51379ad76 100755 --- a/bin/build-native.sh +++ b/bin/build-native.sh @@ -15,6 +15,7 @@ platformioFailed() { VERSION=$(bin/buildinfo.py long) SHORT_VERSION=$(bin/buildinfo.py short) +PIO_ENV=${1:-native} OUTDIR=release/ @@ -24,7 +25,7 @@ mkdir -p $OUTDIR/ rm -r $OUTDIR/* || true # Important to pull latest version of libs into all device flavors, otherwise some devices might be stale -pio pkg update --environment native || platformioFailed -pio run --environment native || platformioFailed -cp .pio/build/native/program "$OUTDIR/meshtasticd_linux_$(uname -m)" +pio pkg update --environment "$PIO_ENV" || platformioFailed +pio run --environment "$PIO_ENV" || platformioFailed +cp ".pio/build/$PIO_ENV/program" "$OUTDIR/meshtasticd_linux_$(uname -m)" cp bin/native-install.* $OUTDIR From 64a1cd3f99ca39f08f302b0cecd6b6aa0fdf4231 Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 18 Apr 2025 10:29:39 -0400 Subject: [PATCH 089/461] Docker is fun (#6623) --- Dockerfile | 2 +- alpine.Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index be192f216..6c1b83653 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,9 @@ # trunk-ignore-all(hadolint/DL3002): We must run as root for this container # trunk-ignore-all(hadolint/DL3008): Do not pin apt package versions # trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions -ARG PIO_ENV=native FROM python:3.13-bookworm AS builder +ARG PIO_ENV=native ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Etc/UTC diff --git a/alpine.Dockerfile b/alpine.Dockerfile index f85c147da..f4a95095d 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -2,11 +2,11 @@ # trunk-ignore-all(hadolint/DL3002): We must run as root for this container # trunk-ignore-all(hadolint/DL3018): Do not pin apk package versions # trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions -ARG PIO_ENV=native FROM python:3.13-alpine3.21 AS builder - +ARG PIO_ENV=native ENV PIP_ROOT_USER_ACTION=ignore + RUN apk --no-cache add \ bash g++ libstdc++-dev linux-headers zip git ca-certificates libgpiod-dev yaml-cpp-dev bluez-dev \ libusb-dev i2c-tools-dev libuv-dev openssl-dev pkgconf argp-standalone \ From 5ab1db01420210896082eb4fcc2be741a23b1d70 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 18 Apr 2025 09:36:23 -0500 Subject: [PATCH 090/461] chore(deps): update meshtastic-device-ui digest to 65eb74f (#6624) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 85505d63a..f0756cb89 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/da8fb5eaac7874c31508fad5252999ec82c02498.zip + https://github.com/meshtastic/device-ui/archive/65eb74fadf373e3ceec0bddb95a7cb978e2acd81.zip ; Common libs for environmental measurements in telemetry module ; (not included in native / portduino) From c6e5ec055f9bb44b823d0895eea053726fe07e3d Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 18 Apr 2025 20:48:32 -0400 Subject: [PATCH 091/461] RPM: Build native-tft target (#6613) --- meshtasticd.spec.rpkg | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/meshtasticd.spec.rpkg b/meshtasticd.spec.rpkg index 4d6c9d6f5..2d777bc76 100644 --- a/meshtasticd.spec.rpkg +++ b/meshtasticd.spec.rpkg @@ -42,6 +42,10 @@ BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(liborcania) BuildRequires: pkgconfig(libyder) BuildRequires: pkgconfig(libulfius) +# TFT components: +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(libinput) +BuildRequires: pkgconfig(xkbcommon-x11) %description Meshtastic daemon for controlling Meshtastic devices. Meshtastic is an off-grid @@ -55,12 +59,12 @@ tar -xf %{SOURCE1} -C web gzip -dr web %build -# Use the “native” environment from platformio to build a Linux binary -platformio run -e native +# Use the “native-tft” environment from platformio to build a Linux binary +platformio run -e native-tft %install mkdir -p %{buildroot}%{_sbindir} -install -m 0755 .pio/build/native/program %{buildroot}%{_sbindir}/meshtasticd +install -m 0755 .pio/build/native-tft/program %{buildroot}%{_sbindir}/meshtasticd mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd install -m 0644 bin/config-dist.yaml %{buildroot}%{_sysconfdir}/meshtasticd/config.yaml From d26b50b78c28cf9cfaf2002fce0946b0fb14d36d Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 19 Apr 2025 00:29:59 -0400 Subject: [PATCH 092/461] docker alpine: Add available.d config templates (#6631) --- alpine.Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/alpine.Dockerfile b/alpine.Dockerfile index f4a95095d..350129040 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -39,7 +39,11 @@ RUN apk --no-cache add \ && mkdir -p /var/lib/meshtasticd \ && mkdir -p /etc/meshtasticd/config.d \ && mkdir -p /etc/meshtasticd/ssl + +# Fetch compiled binary from the builder COPY --from=builder /tmp/firmware/release/meshtasticd /usr/sbin/ +# Copy config templates +COPY ./bin/config.d /etc/meshtasticd/available.d WORKDIR /var/lib/meshtasticd VOLUME /var/lib/meshtasticd From 916afb5098d320cacb324e81d0f663a57696ba12 Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 19 Apr 2025 10:56:41 -0400 Subject: [PATCH 093/461] appdata.xml: Add date to all releases (#6632) --- bin/org.meshtastic.meshtasticd.metainfo.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index cb921fcb3..32e6eb077 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -1,4 +1,4 @@ - + org.meshtastic.meshtasticd @@ -87,13 +87,13 @@ - + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.6 - + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.5 - + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.4 From a30f431b6a89261ef02ed115bd78f51cb0294299 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 19 Apr 2025 18:49:05 +0200 Subject: [PATCH 094/461] Update Kongduino-Adafruit_nRFCrypto digest to 5f838d2 (#6634) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/nrf52/nrf52840.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/nrf52/nrf52840.ini b/arch/nrf52/nrf52840.ini index fb5ba9960..f0a4ab6c0 100644 --- a/arch/nrf52/nrf52840.ini +++ b/arch/nrf52/nrf52840.ini @@ -7,7 +7,7 @@ lib_deps = ${nrf52_base.lib_deps} ${environmental_base.lib_deps} # renovate: datasource=git-refs depName=Kongduino-Adafruit_nRFCrypto packageName=https://github.com/Kongduino/Adafruit_nRFCrypto gitBranch=master - https://github.com/Kongduino/Adafruit_nRFCrypto/archive/e31a8825ea3300b163a0a3c1ddd5de34e10e1371.zip + https://github.com/Kongduino/Adafruit_nRFCrypto/archive/5f838d2709461a2c981f642917aa50254a25c14c.zip ; Common NRF52 debugging settings follow. See the Meshtastic developer docs for how to connect SWD debugging probes to your board. From 2b57ffafd78c15adc024268d6882f6cc1c57cd63 Mon Sep 17 00:00:00 2001 From: Nivek-domo <123359286+Nivek-domo@users.noreply.github.com> Date: Sun, 20 Apr 2025 10:51:01 +0200 Subject: [PATCH 095/461] Rak13800 Ethernet works on rak11310 too we can use rak13800 on rak11310 too --- src/mesh/api/ServerAPI.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/api/ServerAPI.h b/src/mesh/api/ServerAPI.h index fe6a733a7..111314476 100644 --- a/src/mesh/api/ServerAPI.h +++ b/src/mesh/api/ServerAPI.h @@ -43,7 +43,7 @@ template class APIServerPort : public U, private concurrency: * delegate to the worker. Once coroutines are implemented we can relax this restriction. */ T *openAPI = NULL; -#if RAK_4631 +#if defined(RAK_4631) || defined(RAK11310) // Track wait time for RAK13800 Ethernet requests int32_t waitTime = 100; #endif From 5d48d2c0a74b1a561246899e7786aa1460cf0ef1 Mon Sep 17 00:00:00 2001 From: Nivek-domo <123359286+Nivek-domo@users.noreply.github.com> Date: Sun, 20 Apr 2025 12:06:39 +0200 Subject: [PATCH 096/461] Add IP Address Frame (#6615) * Update Screen.cpp add ip on screen if has ethernet pcb like w5500 spi * Run Trunk Format and Translate Comments FR->EN --------- Co-authored-by: Tom Fifield --- src/graphics/Screen.cpp | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index ad0b94efe..45706cf33 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -56,6 +56,10 @@ along with this program. If not, see . #include "mesh/wifi/WiFiAPClient.h" #endif +#if HAS_ETHERNET +#include "mesh/eth/ethClient.h" +#endif + #ifdef ARCH_ESP32 #include "esp_task_wdt.h" #include "modules/StoreForwardModule.h" @@ -232,6 +236,42 @@ static void drawOEMBootScreen(OLEDDisplay *display, OLEDDisplayUiState *state, i #endif +#if HAS_ETHERNET +static void drawEthernetFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + display->setFont(FONT_SMALL); + display->setTextAlignment(TEXT_ALIGN_LEFT); + + if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { + display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL); + display->setColor(BLACK); + } + + display->setColor(WHITE); + + // Adjust vertical position verticale ajustée - starts higher + int16_t y_offset = y + 2; // Reduces space at top + + // Left Alignement (x + small offset) + int16_t x_offset = x + 2; + + // Display is not centered, align left + display->drawString(x_offset, y_offset, "Ethernet Config:"); + y_offset += FONT_HEIGHT_SMALL + 2; // Slightly reduced spacing + + display->drawString(x_offset, y_offset, "IP: " + Ethernet.localIP().toString()); + y_offset += FONT_HEIGHT_SMALL; + + display->drawString(x_offset, y_offset, "Mask: " + Ethernet.subnetMask().toString()); + y_offset += FONT_HEIGHT_SMALL; + + display->drawString(x_offset, y_offset, "GW: " + Ethernet.gatewayIP().toString()); + // y_offset += FONT_HEIGHT_SMALL; + + // display->drawString(x_offset, y_offset, "DNS: " + Ethernet.dnsServerIP().toString()); +} +#endif + void Screen::drawFrameText(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y, const char *message) { uint16_t x_offset = display->width() / 2; @@ -2182,6 +2222,12 @@ void Screen::setFrames(FrameFocus focus) } #endif +#if HAS_ETHERNET + if (Ethernet.hardwareStatus() != EthernetNoHardware) { + normalFrames[numframes++] = drawEthernetFrame; + } +#endif + fsi.frameCount = numframes; // Total framecount is used to apply FOCUS_PRESERVE LOG_DEBUG("Finished build frames. numframes: %d", numframes); From e03f3de185e8a67bd08e7af0c3425989e4b6e0ec Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 20 Apr 2025 10:45:58 -0400 Subject: [PATCH 097/461] Build and deploy event firmwares (#6628) --- .github/workflows/main_matrix.yml | 52 ++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 0889ce22e..b6a0a3445 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -5,14 +5,20 @@ concurrency: on: # # Triggers the workflow on push but only for the master branch push: - branches: [master, develop] + branches: + - master + - develop + - event/* paths-ignore: - "**.md" - version.properties # Note: This is different from "pull_request". Need to specify ref when doing checkouts. pull_request_target: - branches: [master, develop] + branches: + - master + - develop + - event/* paths-ignore: - "**.md" #- "**.yml" @@ -32,12 +38,12 @@ jobs: name: Checkout base - id: jsonStep run: | - if [[ "${{ github.head_ref }}" == "" ]]; then + if [[ "$GITHUB_HEAD_REF" == "" ]]; then TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}}) else TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} quick) fi - echo "Name: ${{ github.ref_name }} Base: ${{ github.base_ref }} } Ref: ${{ github.ref }} Targets: $TARGETS" + echo "Name: $GITHUB_REF_NAME Base: $GITHUB_BASE_REF Ref: $GITHUB_REF Targets: $TARGETS" echo "${{matrix.arch}}=$(jq -cn --argjson environments "$TARGETS" '{board: $environments}')" >> $GITHUB_OUTPUT outputs: esp32: ${{ steps.jsonStep.outputs.esp32 }} @@ -195,17 +201,6 @@ jobs: runs-on: ubuntu-24.04-arm push: false - after-checks: - runs-on: ubuntu-latest - if: ${{ github.event_name != 'workflow_dispatch' }} - needs: [check] - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - gather-artifacts: permissions: contents: write @@ -350,7 +345,7 @@ jobs: merge-multiple: true path: ./output/pio-deps-native-tft - - name: Zip linux sources + - name: Zip Linux sources working-directory: output run: | zip -j -9 -r ./meshtasticd-${{ steps.version.outputs.deb }}-src.zip ./debian-src @@ -360,7 +355,9 @@ jobs: - name: Display structure of downloaded files run: ls -lR - - name: Add linux sources to release + - name: Add Linux sources to GtiHub Release + # Only run when targeting master branch with workflow_dispatch + if: ${{ github.ref_name == 'master' }} run: | gh release upload v${{ steps.version.outputs.long }} ./output/meshtasticd-${{ steps.version.outputs.deb }}-src.zip gh release upload v${{ steps.version.outputs.long }} ./output/platformio-deps-native-tft-${{ steps.version.outputs.long }}.zip @@ -418,9 +415,28 @@ jobs: - name: Display structure of downloaded files run: ls -lR - - name: Add bins and debug elfs to release + - name: Add bins and debug elfs to GitHub Release + # Only run when targeting master branch with workflow_dispatch + if: ${{ github.ref_name == 'master' }} run: | gh release upload v${{ steps.version.outputs.long }} ./firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip gh release upload v${{ steps.version.outputs.long }} ./debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish firmware to meshtastic.github.io + uses: peaceiris/actions-gh-pages@v4 + env: + # On event/* branches, use the event name as the destination prefix + DEST_PREFIX: ${{ contains(github.ref_name, 'event/') && format('{0}/', github.ref_name) || '' }} + with: + deploy_key: ${{ secrets.DIST_PAGES_DEPLOY_KEY }} + external_repository: meshtastic/meshtastic.github.io + publish_branch: master + publish_dir: ./output + destination_dir: ${{ env.DEST_PREFIX }}firmware-${{ steps.version.outputs.long }} + keep_files: true + user_name: github-actions[bot] + user_email: github-actions[bot]@users.noreply.github.com + commit_message: ${{ steps.version.outputs.long }} ${{ matrix.arch }} + enable_jekyll: true From 48dc0e014c451fed8b3979d8548a8f328a613301 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 20 Apr 2025 09:48:07 -0500 Subject: [PATCH 098/461] Revert "Lib Update (#6510)" (#6640) This reverts commit e2f6600cb955f8de86175a87fae36f49863ba72f. --- arch/esp32/esp32.ini | 2 +- src/nimble/NimbleBluetooth.cpp | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 35f3a5a1c..5e15cb451 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -50,7 +50,7 @@ lib_deps = # renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master https://github.com/meshtastic/esp32_https_server/archive/896f1771ceb5979987a0b41028bf1b4e7aad419b.zip # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino - h2zero/NimBLE-Arduino@^2.2.3 + h2zero/NimBLE-Arduino@^1.4.3 # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib diff --git a/src/nimble/NimbleBluetooth.cpp b/src/nimble/NimbleBluetooth.cpp index 208d8ae3c..009439f25 100644 --- a/src/nimble/NimbleBluetooth.cpp +++ b/src/nimble/NimbleBluetooth.cpp @@ -49,7 +49,7 @@ static uint8_t lastToRadio[MAX_TO_FROM_RADIO_SIZE]; class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks { - virtual void onWrite(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo) + virtual void onWrite(NimBLECharacteristic *pCharacteristic) { LOG_DEBUG("To Radio onwrite"); auto val = pCharacteristic->getValue(); @@ -66,7 +66,7 @@ class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks { - virtual void onRead(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo) + virtual void onRead(NimBLECharacteristic *pCharacteristic) { uint8_t fromRadioBytes[meshtastic_FromRadio_size]; size_t numBytes = bluetoothPhoneAPI->getFromRadio(fromRadioBytes); @@ -79,7 +79,7 @@ class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks class NimbleBluetoothServerCallback : public NimBLEServerCallbacks { - virtual uint32_t onPassKeyDisplay() + virtual uint32_t onPassKeyRequest() { uint32_t passkey = config.bluetooth.fixed_pin; @@ -125,7 +125,7 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks return passkey; } - virtual void onAuthenticationComplete(NimBLEConnInfo &connInfo) + virtual void onAuthenticationComplete(ble_gap_conn_desc *desc) { LOG_INFO("BLE authentication complete"); @@ -138,9 +138,9 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks } } - virtual void onDisconnect(NimBLEServer *pServer, NimBLEConnInfo &connInfo, int reason) + virtual void onDisconnect(NimBLEServer *pServer, ble_gap_conn_desc *desc) { - LOG_INFO("BLE disconnect. Reason %i", reason); + LOG_INFO("BLE disconnect"); bluetoothStatus->updateStatus( new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED)); @@ -191,7 +191,7 @@ int NimbleBluetooth::getRssi() if (bleServer && isConnected()) { auto service = bleServer->getServiceByUUID(MESH_SERVICE_UUID); uint16_t handle = service->getHandle(); - return NimBLEDevice::getClientByHandle(handle)->getRssi(); + return NimBLEDevice::getClientByID(handle)->getRssi(); } return 0; // FIXME figure out where to source this } @@ -216,7 +216,6 @@ void NimbleBluetooth::setup() NimbleBluetoothServerCallback *serverCallbacks = new NimbleBluetoothServerCallback(); bleServer->setCallbacks(serverCallbacks, true); - bleServer->advertiseOnDisconnect(true); setupService(); startAdvertising(); } @@ -260,7 +259,7 @@ void NimbleBluetooth::setupService() BatteryCharacteristic = batteryService->createCharacteristic( // 0x2A19 is the Battery Level characteristic) (uint16_t)0x2a19, NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::NOTIFY, 1); - NimBLE2904 *batteryLevelDescriptor = (NimBLE2904 *)BatteryCharacteristic->create2904(); + NimBLE2904 *batteryLevelDescriptor = (NimBLE2904 *)BatteryCharacteristic->createDescriptor((uint16_t)0x2904); batteryLevelDescriptor->setFormat(NimBLE2904::FORMAT_UINT8); batteryLevelDescriptor->setNamespace(1); batteryLevelDescriptor->setUnit(0x27ad); From 8812eadd4444386919d985d4370756cc28aa9093 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 20 Apr 2025 10:49:21 -0400 Subject: [PATCH 099/461] Revert "Add IP Address Frame (#6615)" (#6639) This reverts commit 5d48d2c0a74b1a561246899e7786aa1460cf0ef1. --- src/graphics/Screen.cpp | 46 ----------------------------------------- 1 file changed, 46 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 45706cf33..ad0b94efe 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -56,10 +56,6 @@ along with this program. If not, see . #include "mesh/wifi/WiFiAPClient.h" #endif -#if HAS_ETHERNET -#include "mesh/eth/ethClient.h" -#endif - #ifdef ARCH_ESP32 #include "esp_task_wdt.h" #include "modules/StoreForwardModule.h" @@ -236,42 +232,6 @@ static void drawOEMBootScreen(OLEDDisplay *display, OLEDDisplayUiState *state, i #endif -#if HAS_ETHERNET -static void drawEthernetFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - display->setFont(FONT_SMALL); - display->setTextAlignment(TEXT_ALIGN_LEFT); - - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { - display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL); - display->setColor(BLACK); - } - - display->setColor(WHITE); - - // Adjust vertical position verticale ajustée - starts higher - int16_t y_offset = y + 2; // Reduces space at top - - // Left Alignement (x + small offset) - int16_t x_offset = x + 2; - - // Display is not centered, align left - display->drawString(x_offset, y_offset, "Ethernet Config:"); - y_offset += FONT_HEIGHT_SMALL + 2; // Slightly reduced spacing - - display->drawString(x_offset, y_offset, "IP: " + Ethernet.localIP().toString()); - y_offset += FONT_HEIGHT_SMALL; - - display->drawString(x_offset, y_offset, "Mask: " + Ethernet.subnetMask().toString()); - y_offset += FONT_HEIGHT_SMALL; - - display->drawString(x_offset, y_offset, "GW: " + Ethernet.gatewayIP().toString()); - // y_offset += FONT_HEIGHT_SMALL; - - // display->drawString(x_offset, y_offset, "DNS: " + Ethernet.dnsServerIP().toString()); -} -#endif - void Screen::drawFrameText(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y, const char *message) { uint16_t x_offset = display->width() / 2; @@ -2222,12 +2182,6 @@ void Screen::setFrames(FrameFocus focus) } #endif -#if HAS_ETHERNET - if (Ethernet.hardwareStatus() != EthernetNoHardware) { - normalFrames[numframes++] = drawEthernetFrame; - } -#endif - fsi.frameCount = numframes; // Total framecount is used to apply FOCUS_PRESERVE LOG_DEBUG("Finished build frames. numframes: %d", numframes); From 72dd5bd88d541eaa8b91dd02ec66a0b8ece41b29 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 20 Apr 2025 16:31:47 -0400 Subject: [PATCH 100/461] Publish firmware all together (#6642) --- .github/workflows/main_matrix.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index b6a0a3445..a9c4cbb52 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -424,6 +424,31 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + publish-firmware: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'workflow_dispatch' }} + needs: [release-firmware] + env: + targets: esp32,esp32s3,esp32c3,esp32c6,nrf52840,rp2040,stm32 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + + - name: Get release version string + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + + - uses: actions/download-artifact@v4 + with: + pattern: firmware-{${{ env.targets }}}-${{ steps.version.outputs.long }} + merge-multiple: true + path: ./publish + - name: Publish firmware to meshtastic.github.io uses: peaceiris/actions-gh-pages@v4 env: @@ -433,10 +458,10 @@ jobs: deploy_key: ${{ secrets.DIST_PAGES_DEPLOY_KEY }} external_repository: meshtastic/meshtastic.github.io publish_branch: master - publish_dir: ./output + publish_dir: ./publish destination_dir: ${{ env.DEST_PREFIX }}firmware-${{ steps.version.outputs.long }} keep_files: true user_name: github-actions[bot] user_email: github-actions[bot]@users.noreply.github.com - commit_message: ${{ steps.version.outputs.long }} ${{ matrix.arch }} + commit_message: ${{ steps.version.outputs.long }} enable_jekyll: true From 24e9539d40f91b8e6a0ec533fc688cfee3d0da5a Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Tue, 22 Apr 2025 13:25:07 +0200 Subject: [PATCH 101/461] remove buzzer (#6652) --- variants/seeed-sensecap-indicator/platformio.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/variants/seeed-sensecap-indicator/platformio.ini b/variants/seeed-sensecap-indicator/platformio.ini index fb51d77c3..b643288a6 100644 --- a/variants/seeed-sensecap-indicator/platformio.ini +++ b/variants/seeed-sensecap-indicator/platformio.ini @@ -49,7 +49,6 @@ build_flags = -D HAS_SCREEN=0 -D HAS_TFT=1 -D DISPLAY_SET_RESOLUTION - -D USE_PIN_BUZZER -D RAM_SIZE=4096 -D LV_LVGL_H_INCLUDE_SIMPLE -D LV_CONF_INCLUDE_SIMPLE From 70ced735d966724f665bf3442e9e261c51b12a2e Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Tue, 22 Apr 2025 23:25:53 +1200 Subject: [PATCH 102/461] Correct a typing error in InkHUD display driver (#6651) * Fix LCMEN2R13EFC1 LUT A typing error when the driver was initially created. * Spelling.. --- src/graphics/niche/Drivers/EInk/LCMEN2R13EFC1.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/graphics/niche/Drivers/EInk/LCMEN2R13EFC1.cpp b/src/graphics/niche/Drivers/EInk/LCMEN2R13EFC1.cpp index c843c4694..13a3f452d 100644 --- a/src/graphics/niche/Drivers/EInk/LCMEN2R13EFC1.cpp +++ b/src/graphics/niche/Drivers/EInk/LCMEN2R13EFC1.cpp @@ -42,11 +42,10 @@ static const uint8_t LUT_FAST_BW[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // }; -// Look up table: fash refresh, pixels which change from white to black +// Look up table: fast refresh, pixels which change from white to black static const uint8_t LUT_FAST_WB[] = { - 0x01, 0x46, 0x42, 0x01, 0x01, 0x01, 0x01, // - 0x01, 0x46, 0x42, 0x01, 0x01, 0x01, 0x01, // 0x01, 0x46, 0x43, 0x02, 0x01, 0x01, 0x01, // + 0x01, 0x46, 0x42, 0x01, 0x01, 0x01, 0x01, // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // @@ -55,7 +54,7 @@ static const uint8_t LUT_FAST_WB[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // }; -// Look up table: fash refresh, pixels which remain black +// Look up table: fast refresh, pixels which remain black static const uint8_t LUT_FAST_BB[] = { 0x01, 0x06, 0x03, 0x42, 0x41, 0x01, 0x01, // 0x01, 0x06, 0x02, 0x01, 0x01, 0x01, 0x01, // From b1e35cd8b36a57098184491dc3841d83ff65ec76 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Tue, 22 Apr 2025 21:21:29 +0200 Subject: [PATCH 103/461] Fix preamble detected IRQ flag (#6653) --- src/mesh/LR11x0Interface.cpp | 4 ++-- src/mesh/RadioLibInterface.h | 3 +++ src/mesh/SX126xInterface.cpp | 3 +-- src/mesh/SX128xInterface.cpp | 3 +-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mesh/LR11x0Interface.cpp b/src/mesh/LR11x0Interface.cpp index 2b060ad38..aecc8f722 100644 --- a/src/mesh/LR11x0Interface.cpp +++ b/src/mesh/LR11x0Interface.cpp @@ -247,8 +247,8 @@ template void LR11x0Interface::startReceive() lora.setPreambleLength(preambleLength); // Solve RX ack fail after direct message sent. Not sure why this is needed. // We use a 16 bit preamble so this should save some power by letting radio sit in standby mostly. - // Furthermore, we need the PREAMBLE_DETECTED and HEADER_VALID IRQ flag to detect whether we are actively receiving - int err = lora.startReceive(RADIOLIB_LR11X0_RX_TIMEOUT_INF, RADIOLIB_IRQ_RX_DEFAULT_FLAGS, RADIOLIB_IRQ_RX_DEFAULT_MASK, 0); + int err = + lora.startReceive(RADIOLIB_LR11X0_RX_TIMEOUT_INF, MESHTASTIC_RADIOLIB_IRQ_RX_FLAGS, RADIOLIB_IRQ_RX_DEFAULT_MASK, 0); assert(err == RADIOLIB_ERR_NONE); RadioLibInterface::startReceive(); diff --git a/src/mesh/RadioLibInterface.h b/src/mesh/RadioLibInterface.h index 9622bd625..2ab2679c0 100644 --- a/src/mesh/RadioLibInterface.h +++ b/src/mesh/RadioLibInterface.h @@ -16,6 +16,9 @@ #define RADIOLIB_PIN_TYPE uint32_t +// In addition to the default Rx flags, we need the PREAMBLE_DETECTED flag to detect whether we are actively receiving +#define MESHTASTIC_RADIOLIB_IRQ_RX_FLAGS (RADIOLIB_IRQ_RX_DEFAULT_FLAGS | (1 << RADIOLIB_IRQ_PREAMBLE_DETECTED)) + /** * We need to override the RadioLib ArduinoHal class to add mutex protection for SPI bus access */ diff --git a/src/mesh/SX126xInterface.cpp b/src/mesh/SX126xInterface.cpp index 6a4be023b..c867466b7 100644 --- a/src/mesh/SX126xInterface.cpp +++ b/src/mesh/SX126xInterface.cpp @@ -277,8 +277,7 @@ template void SX126xInterface::startReceive() setStandby(); // We use a 16 bit preamble so this should save some power by letting radio sit in standby mostly. - // Furthermore, we need the PREAMBLE_DETECTED and HEADER_VALID IRQ flag to detect whether we are actively receiving - int err = lora.startReceiveDutyCycleAuto(preambleLength, 8, RADIOLIB_IRQ_RX_DEFAULT_FLAGS | RADIOLIB_IRQ_PREAMBLE_DETECTED); + int err = lora.startReceiveDutyCycleAuto(preambleLength, 8, MESHTASTIC_RADIOLIB_IRQ_RX_FLAGS); if (err != RADIOLIB_ERR_NONE) LOG_ERROR("SX126X startReceiveDutyCycleAuto %s%d", radioLibErr, err); assert(err == RADIOLIB_ERR_NONE); diff --git a/src/mesh/SX128xInterface.cpp b/src/mesh/SX128xInterface.cpp index e06f274e7..23a023d3f 100644 --- a/src/mesh/SX128xInterface.cpp +++ b/src/mesh/SX128xInterface.cpp @@ -260,8 +260,7 @@ template void SX128xInterface::startReceive() #endif #endif - // We use the PREAMBLE_DETECTED and HEADER_VALID IRQ flag to detect whether we are actively receiving - int err = lora.startReceive(RADIOLIB_SX128X_RX_TIMEOUT_INF, RADIOLIB_IRQ_RX_DEFAULT_FLAGS | RADIOLIB_IRQ_PREAMBLE_DETECTED); + int err = lora.startReceive(RADIOLIB_SX128X_RX_TIMEOUT_INF, MESHTASTIC_RADIOLIB_IRQ_RX_FLAGS); if (err != RADIOLIB_ERR_NONE) LOG_ERROR("SX128X startReceive %s%d", radioLibErr, err); From 45fcd479f61a5350ead219dcba0e2610aa55da2b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:50:35 +0200 Subject: [PATCH 104/461] Update meshtastic-device-ui digest to 189ed6c (#6657) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index f0756cb89..fe87fb3d8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/65eb74fadf373e3ceec0bddb95a7cb978e2acd81.zip + https://github.com/meshtastic/device-ui/archive/189ed6cba42c218e79142a876987f4516d0c87fd.zip ; Common libs for environmental measurements in telemetry module ; (not included in native / portduino) From 89df9d7686390aebecff349b63b9ffb2b333a69d Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Fri, 25 Apr 2025 13:40:48 +1200 Subject: [PATCH 105/461] Fix WiPhone variant.h (#6664) --- variants/wiphone/variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/wiphone/variant.h b/variants/wiphone/variant.h index cfa5667bb..70973db16 100644 --- a/variants/wiphone/variant.h +++ b/variants/wiphone/variant.h @@ -24,7 +24,7 @@ // This board has no GPS or Screen for now #undef GPS_RX_PIN #undef GPS_TX_PIN -#define NO_GPS +#define NO_GPS 1 #define HAS_GPS 0 #define NO_SCREEN #define HAS_SCREEN 0 From 03f19bca0e9e456342dfb0397a805404677e5abc Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 25 Apr 2025 12:30:20 -0400 Subject: [PATCH 106/461] Downgrade web to 2.5.4 (#6669) --- bin/web.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/web.version b/bin/web.version index 914ec9671..d21aa93cc 100644 --- a/bin/web.version +++ b/bin/web.version @@ -1 +1 @@ -2.6.0 \ No newline at end of file +2.5.4 \ No newline at end of file From 54c1423039bbb2b6fdecc807843eef8de47a6b41 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 26 Apr 2025 06:17:08 -0500 Subject: [PATCH 107/461] Use the last GOOD version --- bin/web.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/web.version b/bin/web.version index d21aa93cc..a4db534a2 100644 --- a/bin/web.version +++ b/bin/web.version @@ -1 +1 @@ -2.5.4 \ No newline at end of file +2.5.3 \ No newline at end of file From 77e6868d5dbcf280fa19cfae0d10c7ecc1834411 Mon Sep 17 00:00:00 2001 From: Kalle Lilja <15094562+ThatKalle@users.noreply.github.com> Date: Mon, 28 Apr 2025 22:47:09 +0200 Subject: [PATCH 108/461] Fix create pull request (#6680) * add base property * bump to 2.6.7 - manual * disable pip version check --- .github/workflows/release_channels.yml | 3 +++ bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ version.properties | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release_channels.yml b/.github/workflows/release_channels.yml index eece12346..12d66b9c2 100644 --- a/.github/workflows/release_channels.yml +++ b/.github/workflows/release_channels.yml @@ -95,10 +95,13 @@ jobs: pip install -r bin/bump_metainfo/requirements.txt -q chmod +x ./bin/bump_metainfo/bump_metainfo.py ./bin/bump_metainfo/bump_metainfo.py --file bin/org.meshtastic.meshtasticd.metainfo.xml "${{ steps.version.outputs.short }}" + env: + PIP_DISABLE_PIP_VERSION_CHECK: 1 - name: Create Bumps pull request uses: peter-evans/create-pull-request@v7 with: + base: ${{ github.event.repository.default_branch }} title: Bump release version commit-message: automated bumps add-paths: | diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 32e6eb077..2cfba3523 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.7 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.6 diff --git a/version.properties b/version.properties index 8f5953fdc..5baa63dc2 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 6 -build = 6 +build = 7 From ca8c1773634fd2781b6e2cc2631a134c880a249b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 08:24:00 +1000 Subject: [PATCH 109/461] Update meshtastic-device-ui digest to 8113d4f (#6677) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index fe87fb3d8..9ed780c87 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/189ed6cba42c218e79142a876987f4516d0c87fd.zip + https://github.com/meshtastic/device-ui/archive/8113d4ff5a63280834acfeb7584f179cdc6376b6.zip ; Common libs for environmental measurements in telemetry module ; (not included in native / portduino) From 473ef1bc032c4d898cab090b9e3a3cd632092993 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 28 Apr 2025 18:35:13 -0500 Subject: [PATCH 110/461] Step one of Linux Sensor support (#6673) * First addition of __has_include for sensor support * Add __has_include blocks for sensors * Put BMP and BME back in the right sensors * Make TelemetrySensor::setup() a pure virtual finction * Split environmental_base to environmental_extra, to compile the working sensor libs for Native * Remove hard-coded checks for ARCH_PORTDUINO * Un-clobber bmx160 * Move BusIO to environmental_extra due to Armv7 compile error * Move to forked BusIO for the moment * Enable HAS_SENSOR for Portduino * Move back to Adafruit BusIO after patch --- arch/esp32/esp32.ini | 1 + arch/esp32/esp32c6.ini | 1 + arch/nrf52/nrf52840.ini | 1 + arch/portduino/portduino.ini | 6 +- arch/rp2xx0/rp2040.ini | 1 + arch/rp2xx0/rp2350.ini | 1 + platformio.ini | 59 +++--- src/Power.cpp | 51 ++++-- src/modules/Telemetry/AirQualityTelemetry.cpp | 2 +- src/modules/Telemetry/AirQualityTelemetry.h | 2 +- src/modules/Telemetry/DeviceTelemetry.cpp | 4 - .../Telemetry/EnvironmentTelemetry.cpp | 170 ++++++++++++++---- src/modules/Telemetry/PowerTelemetry.cpp | 4 +- src/modules/Telemetry/Sensor/AHT10.cpp | 2 +- src/modules/Telemetry/Sensor/AHT10.h | 2 +- src/modules/Telemetry/Sensor/BME280Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/BME280Sensor.h | 2 +- src/modules/Telemetry/Sensor/BME680Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/BME680Sensor.h | 2 +- src/modules/Telemetry/Sensor/BMP085Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/BMP085Sensor.h | 2 +- src/modules/Telemetry/Sensor/BMP280Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/BMP280Sensor.h | 2 +- src/modules/Telemetry/Sensor/BMP3XXSensor.cpp | 2 +- src/modules/Telemetry/Sensor/BMP3XXSensor.h | 2 +- .../Telemetry/Sensor/DFRobotGravitySensor.cpp | 2 +- .../Telemetry/Sensor/DFRobotGravitySensor.h | 2 +- .../Telemetry/Sensor/DFRobotLarkSensor.cpp | 2 +- .../Telemetry/Sensor/DFRobotLarkSensor.h | 2 +- src/modules/Telemetry/Sensor/DPS310Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/DPS310Sensor.h | 2 +- src/modules/Telemetry/Sensor/INA219Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/INA219Sensor.h | 2 +- src/modules/Telemetry/Sensor/INA226Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/INA260Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/INA260Sensor.h | 2 +- .../Telemetry/Sensor/INA3221Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/INA3221Sensor.h | 2 +- .../Telemetry/Sensor/LPS22HBSensor.cpp | 2 +- src/modules/Telemetry/Sensor/LPS22HBSensor.h | 2 +- .../Telemetry/Sensor/MAX17048Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/MAX17048Sensor.h | 2 +- .../Telemetry/Sensor/MAX30102Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/MAX30102Sensor.h | 2 +- .../Telemetry/Sensor/MCP9808Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/MCP9808Sensor.h | 2 +- .../Telemetry/Sensor/MLX90614Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/MLX90614Sensor.h | 2 +- .../Telemetry/Sensor/MLX90632Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/MLX90632Sensor.h | 2 +- .../Telemetry/Sensor/NAU7802Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/NAU7802Sensor.h | 2 +- .../Telemetry/Sensor/OPT3001Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/OPT3001Sensor.h | 2 +- src/modules/Telemetry/Sensor/SHT31Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/SHT31Sensor.h | 2 +- src/modules/Telemetry/Sensor/SHT4XSensor.cpp | 2 +- src/modules/Telemetry/Sensor/SHT4XSensor.h | 2 +- src/modules/Telemetry/Sensor/SHTC3Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/SHTC3Sensor.h | 2 +- .../Telemetry/Sensor/TSL2591Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/TSL2591Sensor.h | 2 +- .../Telemetry/Sensor/TelemetrySensor.h | 4 +- .../Telemetry/Sensor/VEML7700Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/VEML7700Sensor.h | 2 +- src/modules/Telemetry/Sensor/nullSensor.cpp | 23 +++ src/modules/Telemetry/Sensor/nullSensor.h | 22 +++ src/motion/BMA423Sensor.cpp | 2 +- src/motion/BMA423Sensor.h | 2 +- src/motion/BMX160Sensor.cpp | 4 +- src/motion/BMX160Sensor.h | 4 +- src/motion/ICM20948Sensor.cpp | 2 +- src/motion/ICM20948Sensor.h | 2 +- src/motion/LIS3DHSensor.cpp | 2 +- src/motion/LIS3DHSensor.h | 2 +- src/motion/LSM6DS3Sensor.cpp | 2 +- src/motion/LSM6DS3Sensor.h | 2 +- src/motion/MPU6050Sensor.cpp | 2 +- src/motion/MPU6050Sensor.h | 2 +- src/motion/MotionSensor.cpp | 2 +- src/motion/MotionSensor.h | 2 +- src/motion/QMA6100PSensor.cpp | 2 +- src/motion/QMA6100PSensor.h | 2 +- src/motion/STK8XXXSensor.cpp | 2 +- src/motion/STK8XXXSensor.h | 2 +- src/platform/portduino/architecture.h | 3 + src/power.h | 37 +++- 87 files changed, 366 insertions(+), 168 deletions(-) create mode 100644 src/modules/Telemetry/Sensor/nullSensor.cpp create mode 100644 src/modules/Telemetry/Sensor/nullSensor.h diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 5e15cb451..3a6dc8323 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -46,6 +46,7 @@ lib_deps = ${arduino_base.lib_deps} ${networking_base.lib_deps} ${environmental_base.lib_deps} + ${environmental_extra.lib_deps} ${radiolib_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master https://github.com/meshtastic/esp32_https_server/archive/896f1771ceb5979987a0b41028bf1b4e7aad419b.zip diff --git a/arch/esp32/esp32c6.ini b/arch/esp32/esp32c6.ini index e1cf955e8..7c7e3e923 100644 --- a/arch/esp32/esp32c6.ini +++ b/arch/esp32/esp32c6.ini @@ -25,6 +25,7 @@ lib_deps = ${arduino_base.lib_deps} ${networking_base.lib_deps} ${environmental_base.lib_deps} + ${environmental_extra.lib_deps} ${radiolib_base.lib_deps} # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib lewisxhe/XPowersLib@^0.2.7 diff --git a/arch/nrf52/nrf52840.ini b/arch/nrf52/nrf52840.ini index f0a4ab6c0..5e846b3b7 100644 --- a/arch/nrf52/nrf52840.ini +++ b/arch/nrf52/nrf52840.ini @@ -6,6 +6,7 @@ build_flags = ${nrf52_base.build_flags} lib_deps = ${nrf52_base.lib_deps} ${environmental_base.lib_deps} + ${environmental_extra.lib_deps} # renovate: datasource=git-refs depName=Kongduino-Adafruit_nRFCrypto packageName=https://github.com/Kongduino/Adafruit_nRFCrypto gitBranch=master https://github.com/Kongduino/Adafruit_nRFCrypto/archive/5f838d2709461a2c981f642917aa50254a25c14c.zip diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 1d731f6b7..5dc0daf6b 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -17,15 +17,13 @@ build_src_filter = + - - - - - - - - +<../variants/portduino> lib_deps = ${env.lib_deps} ${networking_base.lib_deps} ${radiolib_base.lib_deps} + ${environmental_base.lib_deps} # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto rweather/Crypto@^0.4.0 # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX @@ -49,3 +47,5 @@ build_flags = -luv -std=gnu17 -std=c++17 + +lib_ignore = Adafruit NeoPixel \ No newline at end of file diff --git a/arch/rp2xx0/rp2040.ini b/arch/rp2xx0/rp2040.ini index cd7e684b4..4f9421872 100644 --- a/arch/rp2xx0/rp2040.ini +++ b/arch/rp2xx0/rp2040.ini @@ -28,6 +28,7 @@ lib_ignore = lib_deps = ${arduino_base.lib_deps} ${environmental_base.lib_deps} + ${environmental_extra.lib_deps} ${radiolib_base.lib_deps} # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto rweather/Crypto@0.4.0 diff --git a/arch/rp2xx0/rp2350.ini b/arch/rp2xx0/rp2350.ini index 1c7af8be4..e8611a113 100644 --- a/arch/rp2xx0/rp2350.ini +++ b/arch/rp2xx0/rp2350.ini @@ -25,6 +25,7 @@ lib_ignore = lib_deps = ${arduino_base.lib_deps} ${environmental_base.lib_deps} + ${environmental_extra.lib_deps} ${radiolib_base.lib_deps} # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto rweather/Crypto@0.4.0 diff --git a/platformio.ini b/platformio.ini index 9ed780c87..fb121aafe 100644 --- a/platformio.ini +++ b/platformio.ini @@ -111,11 +111,10 @@ lib_deps = https://github.com/meshtastic/device-ui/archive/8113d4ff5a63280834acfeb7584f179cdc6376b6.zip ; Common libs for environmental measurements in telemetry module -; (not included in native / portduino) [environmental_base] lib_deps = - # renovate: datasource=custom.pio depName=Adafruit BusIO packageName=adafruit/library/Adafruit BusIO - adafruit/Adafruit BusIO@1.17.0 + # renovate: datasource=git-refs depName=Adafruit BusIO packageName=https://github.com/adafruit/Adafruit_BusIO gitBranch=master + https://github.com/adafruit/Adafruit_BusIO/archive/5e8f137415f473e390c9410421bb54d828898fad.zip # renovate: datasource=custom.pio depName=Adafruit Unified Sensor packageName=adafruit/library/Adafruit Unified Sensor adafruit/Adafruit Unified Sensor@1.1.15 # renovate: datasource=custom.pio depName=Adafruit BMP280 packageName=adafruit/library/Adafruit BMP280 Library @@ -124,8 +123,6 @@ lib_deps = adafruit/Adafruit BMP085 Library@1.2.4 # renovate: datasource=custom.pio depName=Adafruit BME280 packageName=adafruit/library/Adafruit BME280 Library adafruit/Adafruit BME280 Library@2.2.4 - # renovate: datasource=custom.pio depName=Adafruit BMP3XX packageName=adafruit/library/Adafruit BMP3XX Library - adafruit/Adafruit BMP3XX Library@2.1.6 # renovate: datasource=custom.pio depName=Adafruit DPS310 packageName=adafruit/library/Adafruit DPS310 adafruit/Adafruit DPS310@1.1.5 # renovate: datasource=custom.pio depName=Adafruit MCP9808 packageName=adafruit/library/Adafruit MCP9808 Library @@ -134,14 +131,6 @@ lib_deps = adafruit/Adafruit INA260 Library@1.5.2 # renovate: datasource=custom.pio depName=Adafruit INA219 packageName=adafruit/library/Adafruit INA219 adafruit/Adafruit INA219@1.2.3 - # renovate: datasource=custom.pio depName=Adafruit MAX1704X packageName=adafruit/library/Adafruit MAX1704X - adafruit/Adafruit MAX1704X@1.0.3 - # renovate: datasource=custom.pio depName=Adafruit SHTC3 packageName=adafruit/library/Adafruit SHTC3 Library - adafruit/Adafruit SHTC3 Library@1.0.1 - # renovate: datasource=custom.pio depName=Adafruit LPS2X packageName=adafruit/library/Adafruit LPS2X - adafruit/Adafruit LPS2X@2.0.6 - # renovate: datasource=custom.pio depName=Adafruit SHT31 packageName=adafruit/library/Adafruit SHT31 Library - adafruit/Adafruit SHT31 Library@2.2.2 # renovate: datasource=custom.pio depName=Adafruit PM25 AQI Sensor packageName=adafruit/library/Adafruit PM25 AQI Sensor adafruit/Adafruit PM25 AQI Sensor@1.2.0 # renovate: datasource=custom.pio depName=Adafruit MPU6050 packageName=adafruit/library/Adafruit MPU6050 @@ -152,24 +141,12 @@ lib_deps = adafruit/Adafruit AHTX0@2.0.5 # renovate: datasource=custom.pio depName=Adafruit LSM6DS packageName=adafruit/library/Adafruit LSM6DS adafruit/Adafruit LSM6DS@4.7.4 - # renovate: datasource=custom.pio depName=Adafruit VEML7700 packageName=adafruit/library/Adafruit VEML7700 Library - adafruit/Adafruit VEML7700 Library@2.1.6 - # renovate: datasource=custom.pio depName=Adafruit SHT4x packageName=adafruit/library/Adafruit SHT4x Library - adafruit/Adafruit SHT4x Library@1.0.5 # renovate: datasource=custom.pio depName=Adafruit TSL2591 packageName=adafruit/library/Adafruit TSL2591 Library adafruit/Adafruit TSL2591 Library@1.4.5 - # renovate: datasource=custom.pio depName=SparkFun Qwiic Scale NAU7802 packageName=sparkfun/library/SparkFun Qwiic Scale NAU7802 Arduino Library - sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6 - # renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library - sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.0 - # renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001 - ClosedCube OPT3001@1.1.2 # renovate: datasource=custom.pio depName=EmotiBit MLX90632 packageName=emotibit/library/EmotiBit MLX90632 emotibit/EmotiBit MLX90632@1.0.8 # renovate: datasource=custom.pio depName=Adafruit MLX90614 packageName=adafruit/library/Adafruit MLX90614 Library adafruit/Adafruit MLX90614 Library@2.1.5 - # renovate: datasource=github-tags depName=Bosch BSEC2 packageName=boschsensortec/Bosch-BSEC2-Library - https://github.com/boschsensortec/Bosch-BSEC2-Library/archive/v1.7.2502.zip # renovate: datasource=custom.pio depName=Bosch BME68x packageName=boschsensortec/library/BME68x Sensor Library boschsensortec/BME68x Sensor Library@1.1.40407 # renovate: datasource=github-tags depName=INA3221 packageName=KodinLanewave/INA3221 @@ -178,13 +155,37 @@ lib_deps = mprograms/QMC5883LCompass@1.2.3 # renovate: datasource=custom.pio depName=DFRobot_RTU packageName=dfrobot/library/DFRobot_RTU dfrobot/DFRobot_RTU@1.0.3 - # renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master - https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip # renovate: datasource=git-refs depName=DFRobot_RainfallSensor packageName=https://github.com/DFRobot/DFRobot_RainfallSensor gitBranch=master https://github.com/DFRobot/DFRobot_RainfallSensor/archive/38fea5e02b40a5430be6dab39a99a6f6347d667e.zip # renovate: datasource=custom.pio depName=INA226 packageName=robtillaart/library/INA226 robtillaart/INA226@0.6.4 - - ; Health Sensor Libraries # renovate: datasource=custom.pio depName=SparkFun MAX3010x packageName=sparkfun/library/SparkFun MAX3010x Pulse and Proximity Sensor Library sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library@1.1.2 + +; (not included in native / portduino) +[environmental_extra] +lib_deps = + # renovate: datasource=custom.pio depName=Adafruit BMP3XX packageName=adafruit/library/Adafruit BMP3XX Library + adafruit/Adafruit BMP3XX Library@2.1.6 + # renovate: datasource=custom.pio depName=Adafruit MAX1704X packageName=adafruit/library/Adafruit MAX1704X + adafruit/Adafruit MAX1704X@1.0.3 + # renovate: datasource=custom.pio depName=Adafruit SHTC3 packageName=adafruit/library/Adafruit SHTC3 Library + adafruit/Adafruit SHTC3 Library@1.0.1 + # renovate: datasource=custom.pio depName=Adafruit LPS2X packageName=adafruit/library/Adafruit LPS2X + adafruit/Adafruit LPS2X@2.0.6 + # renovate: datasource=custom.pio depName=Adafruit SHT31 packageName=adafruit/library/Adafruit SHT31 Library + adafruit/Adafruit SHT31 Library@2.2.2 + # renovate: datasource=custom.pio depName=Adafruit VEML7700 packageName=adafruit/library/Adafruit VEML7700 Library + adafruit/Adafruit VEML7700 Library@2.1.6 + # renovate: datasource=custom.pio depName=Adafruit SHT4x packageName=adafruit/library/Adafruit SHT4x Library + adafruit/Adafruit SHT4x Library@1.0.5 + # renovate: datasource=custom.pio depName=SparkFun Qwiic Scale NAU7802 packageName=sparkfun/library/SparkFun Qwiic Scale NAU7802 Arduino Library + sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6 + # renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library + sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.0 + # renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001 + ClosedCube OPT3001@1.1.2 + # renovate: datasource=github-tags depName=Bosch BSEC2 packageName=boschsensortec/Bosch-BSEC2-Library + https://github.com/boschsensortec/Bosch-BSEC2-Library/archive/v1.7.2502.zip + # renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master + https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip \ No newline at end of file diff --git a/src/Power.cpp b/src/Power.cpp index ed1bd20ef..a9ed6360e 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -76,23 +76,47 @@ static const uint8_t ext_chrg_detect_value = EXT_CHRG_DETECT_VALUE; #endif #endif -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_PORTDUINO) +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if __has_include() INA219Sensor ina219Sensor; -INA226Sensor ina226Sensor; -INA260Sensor ina260Sensor; -INA3221Sensor ina3221Sensor; +#else +NullSensor ina219Sensor; #endif -#if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) +#if __has_include() +INA226Sensor ina226Sensor; +#else +NullSensor ina226Sensor; +#endif + +#if __has_include() +INA260Sensor ina260Sensor; +#else +NullSensor ina260Sensor; +#endif + +#if __has_include() +INA3221Sensor ina3221Sensor; +#else +NullSensor ina3221Sensor; +#endif + +#endif + +#if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_STM32WL) #include "modules/Telemetry/Sensor/MAX17048Sensor.h" #include extern std::pair nodeTelemetrySensorsMap[_meshtastic_TelemetrySensorType_MAX + 1]; #if HAS_TELEMETRY && (!MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR || !MESHTASTIC_EXCLUDE_POWER_TELEMETRY) +#if __has_include() MAX17048Sensor max17048Sensor; +#else +NullSensor max17048Sensor; +#endif #endif #endif -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && HAS_RAKPROT && !defined(ARCH_PORTDUINO) +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && HAS_RAKPROT RAK9154Sensor rak9154Sensor; #endif @@ -203,7 +227,7 @@ class AnalogBatteryLevel : public HasBatteryLevel */ virtual int getBatteryPercent() override { -#if defined(HAS_RAKPROT) && !defined(ARCH_PORTDUINO) && !defined(HAS_PMU) +#if defined(HAS_RAKPROT) && !defined(HAS_PMU) if (hasRAK()) { return rak9154Sensor.getBusBatteryPercent(); } @@ -248,15 +272,13 @@ class AnalogBatteryLevel : public HasBatteryLevel virtual uint16_t getBattVoltage() override { -#if HAS_TELEMETRY && defined(HAS_RAKPROT) && !defined(ARCH_PORTDUINO) && !defined(HAS_PMU) && \ - !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if HAS_TELEMETRY && defined(HAS_RAKPROT) && !defined(HAS_PMU) && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR if (hasRAK()) { return getRAKVoltage(); } #endif -#if HAS_TELEMETRY && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(HAS_PMU) && \ - !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if HAS_TELEMETRY && !defined(ARCH_STM32WL) && !defined(HAS_PMU) && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR if (hasINA()) { return getINAVoltage(); } @@ -426,8 +448,7 @@ class AnalogBatteryLevel : public HasBatteryLevel /// we can't be smart enough to say 'full'? virtual bool isCharging() override { -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && defined(HAS_RAKPROT) && !defined(ARCH_PORTDUINO) && \ - !defined(HAS_PMU) +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && defined(HAS_RAKPROT) && !defined(HAS_PMU) if (hasRAK()) { return (rak9154Sensor.isCharging()) ? OptTrue : OptFalse; } @@ -435,7 +456,7 @@ class AnalogBatteryLevel : public HasBatteryLevel #ifdef EXT_CHRG_DETECT return digitalRead(EXT_CHRG_DETECT) == ext_chrg_detect_value; #else -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && \ +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_STM32WL) && \ !defined(DISABLE_INA_CHARGING_DETECTION) if (hasINA()) { // get current flow from INA sensor - negative value means power flowing into the battery @@ -482,7 +503,7 @@ class AnalogBatteryLevel : public HasBatteryLevel } #endif -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_STM32WL) uint16_t getINAVoltage() { if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA219].first == config.power.device_battery_ina_address) { diff --git a/src/modules/Telemetry/AirQualityTelemetry.cpp b/src/modules/Telemetry/AirQualityTelemetry.cpp index 392bd6148..1ddb9ca9b 100644 --- a/src/modules/Telemetry/AirQualityTelemetry.cpp +++ b/src/modules/Telemetry/AirQualityTelemetry.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include("Adafruit_PM25AQI.h") #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "AirQualityTelemetry.h" diff --git a/src/modules/Telemetry/AirQualityTelemetry.h b/src/modules/Telemetry/AirQualityTelemetry.h index 3b983bd56..4e82efac3 100644 --- a/src/modules/Telemetry/AirQualityTelemetry.h +++ b/src/modules/Telemetry/AirQualityTelemetry.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include("Adafruit_PM25AQI.h") #pragma once #include "../mesh/generated/meshtastic/telemetry.pb.h" diff --git a/src/modules/Telemetry/DeviceTelemetry.cpp b/src/modules/Telemetry/DeviceTelemetry.cpp index 192754e09..251608641 100644 --- a/src/modules/Telemetry/DeviceTelemetry.cpp +++ b/src/modules/Telemetry/DeviceTelemetry.cpp @@ -99,13 +99,9 @@ meshtastic_Telemetry DeviceTelemetryModule::getDeviceTelemetry() t.variant.device_metrics.has_uptime_seconds = true; t.variant.device_metrics.air_util_tx = airTime->utilizationTXPercent(); -#if ARCH_PORTDUINO - t.variant.device_metrics.battery_level = MAGIC_USB_BATTERY_LEVEL; -#else t.variant.device_metrics.battery_level = (!powerStatus->getHasBattery() || powerStatus->getIsCharging()) ? MAGIC_USB_BATTERY_LEVEL : powerStatus->getBatteryChargePercent(); -#endif t.variant.device_metrics.channel_utilization = airTime->channelUtilizationPercent(); t.variant.device_metrics.voltage = powerStatus->getBatteryVoltageMv() / 1000.0; t.variant.device_metrics.uptime_seconds = getUptimeSeconds(); diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index 8c0507e77..32c660bbf 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -20,48 +20,144 @@ #if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL // Sensors -#include "Sensor/AHT10.h" -#include "Sensor/BME280Sensor.h" -#include "Sensor/BME680Sensor.h" -#include "Sensor/BMP085Sensor.h" -#include "Sensor/BMP280Sensor.h" -#include "Sensor/BMP3XXSensor.h" -#include "Sensor/CGRadSensSensor.h" -#include "Sensor/DFRobotGravitySensor.h" -#include "Sensor/DFRobotLarkSensor.h" -#include "Sensor/DPS310Sensor.h" -#include "Sensor/LPS22HBSensor.h" -#include "Sensor/MCP9808Sensor.h" -#include "Sensor/MLX90632Sensor.h" -#include "Sensor/NAU7802Sensor.h" -#include "Sensor/OPT3001Sensor.h" -#include "Sensor/RCWL9620Sensor.h" -#include "Sensor/SHT31Sensor.h" -#include "Sensor/SHT4XSensor.h" -#include "Sensor/SHTC3Sensor.h" -#include "Sensor/TSL2591Sensor.h" -#include "Sensor/VEML7700Sensor.h" -BMP085Sensor bmp085Sensor; -BMP280Sensor bmp280Sensor; -BME280Sensor bme280Sensor; -BME680Sensor bme680Sensor; -DPS310Sensor dps310Sensor; -MCP9808Sensor mcp9808Sensor; -SHTC3Sensor shtc3Sensor; -LPS22HBSensor lps22hbSensor; -SHT31Sensor sht31Sensor; -VEML7700Sensor veml7700Sensor; -TSL2591Sensor tsl2591Sensor; -OPT3001Sensor opt3001Sensor; -SHT4XSensor sht4xSensor; -RCWL9620Sensor rcwl9620Sensor; +#include "Sensor/CGRadSensSensor.h" +#include "Sensor/RCWL9620Sensor.h" +#include "Sensor/nullSensor.h" + +#if __has_include() +#include "Sensor/AHT10.h" AHT10Sensor aht10Sensor; +#else +NullSensor aht10Sensor; +#endif +#if __has_include() +#include "Sensor/BME280Sensor.h" +BME280Sensor bme280Sensor; +#else +NullSensor bmp280Sensor; +#endif + +#if __has_include() +#include "Sensor/BMP085Sensor.h" +BMP085Sensor bmp085Sensor; +#else +NullSensor bmp085Sensor; +#endif + +#if __has_include() +#include "Sensor/BMP280Sensor.h" +BMP280Sensor bmp280Sensor; +#else +NullSensor bme280Sensor; +#endif + +#if __has_include() +#include "Sensor/BME680Sensor.h" +BME680Sensor bme680Sensor; +#else +NullSensor bme680Sensor; +#endif + +#if __has_include() +#include "Sensor/DPS310Sensor.h" +DPS310Sensor dps310Sensor; +#else +NullSensor dps310Sensor; +#endif + +#if __has_include() +#include "Sensor/MCP9808Sensor.h" +MCP9808Sensor mcp9808Sensor; +#else +NullSensor mcp9808Sensor; +#endif + +#if __has_include() +#include "Sensor/SHT31Sensor.h" +SHT31Sensor sht31Sensor; +#else +NullSensor sht31Sensor; +#endif + +#if __has_include() +#include "Sensor/LPS22HBSensor.h" +LPS22HBSensor lps22hbSensor; +#else +NullSensor lps22hbSensor; +#endif + +#if __has_include() +#include "Sensor/SHTC3Sensor.h" +SHTC3Sensor shtc3Sensor; +#else +NullSensor shtc3Sensor; +#endif + +#if __has_include() +#include "Sensor/VEML7700Sensor.h" +VEML7700Sensor veml7700Sensor; +#else +NullSensor veml7700Sensor; +#endif + +#if __has_include() +#include "Sensor/TSL2591Sensor.h" +TSL2591Sensor tsl2591Sensor; +#else +NullSensor tsl2591Sensor; +#endif + +#if __has_include() +#include "Sensor/OPT3001Sensor.h" +OPT3001Sensor opt3001Sensor; +#else +NullSensor opt3001Sensor; +#endif + +#if __has_include() +#include "Sensor/SHT4XSensor.h" +SHT4XSensor sht4xSensor; +#else +NullSensor sht4xSensor; +#endif + +#if __has_include() +#include "Sensor/MLX90632Sensor.h" MLX90632Sensor mlx90632Sensor; +#else +NullSensor mlx90632Sensor; +#endif + +#if __has_include() +#include "Sensor/DFRobotLarkSensor.h" DFRobotLarkSensor dfRobotLarkSensor; +#else +NullSensor dfRobotLarkSensor; +#endif + +#if __has_include() +#include "Sensor/DFRobotGravitySensor.h" DFRobotGravitySensor dfRobotGravitySensor; +#else +NullSensor dfRobotGravitySensor; +#endif + +#if __has_include() +#include "Sensor/NAU7802Sensor.h" NAU7802Sensor nau7802Sensor; +#else +NullSensor nau7802Sensor; +#endif + +#if __has_include() +#include "Sensor/BMP3XXSensor.h" BMP3XXSensor bmp3xxSensor; +#else +NullSensor bmp3xxSensor; +#endif + +RCWL9620Sensor rcwl9620Sensor; CGRadSensSensor cgRadSens; #endif #ifdef T1000X_SENSOR_EN @@ -122,8 +218,10 @@ int32_t EnvironmentTelemetryModule::runOnce() result = dfRobotGravitySensor.runOnce(); if (bmp085Sensor.hasSensor()) result = bmp085Sensor.runOnce(); +#if __has_include() if (bmp280Sensor.hasSensor()) result = bmp280Sensor.runOnce(); +#endif if (bme280Sensor.hasSensor()) result = bme280Sensor.runOnce(); if (bmp3xxSensor.hasSensor()) @@ -407,10 +505,12 @@ bool EnvironmentTelemetryModule::getEnvironmentTelemetry(meshtastic_Telemetry *m valid = valid && bmp085Sensor.getMetrics(m); hasSensor = true; } +#if __has_include() if (bmp280Sensor.hasSensor()) { valid = valid && bmp280Sensor.getMetrics(m); hasSensor = true; } +#endif if (bme280Sensor.hasSensor()) { valid = valid && bme280Sensor.getMetrics(m); hasSensor = true; diff --git a/src/modules/Telemetry/PowerTelemetry.cpp b/src/modules/Telemetry/PowerTelemetry.cpp index 14901f0af..54ec90dae 100644 --- a/src/modules/Telemetry/PowerTelemetry.cpp +++ b/src/modules/Telemetry/PowerTelemetry.cpp @@ -53,7 +53,7 @@ int32_t PowerTelemetryModule::runOnce() firstTime = 0; uint32_t result = UINT32_MAX; -#if HAS_TELEMETRY && !defined(ARCH_PORTDUINO) +#if HAS_TELEMETRY if (moduleConfig.telemetry.power_measurement_enabled) { LOG_INFO("Power Telemetry: init"); // If sensor is already initialized by EnvironmentTelemetryModule, then we don't need to initialize it again, @@ -175,7 +175,7 @@ bool PowerTelemetryModule::getPowerTelemetry(meshtastic_Telemetry *m) m->which_variant = meshtastic_Telemetry_power_metrics_tag; m->variant.power_metrics = meshtastic_PowerMetrics_init_zero; -#if HAS_TELEMETRY && !defined(ARCH_PORTDUINO) +#if HAS_TELEMETRY if (ina219Sensor.hasSensor()) valid = ina219Sensor.getMetrics(m); if (ina226Sensor.hasSensor()) diff --git a/src/modules/Telemetry/Sensor/AHT10.cpp b/src/modules/Telemetry/Sensor/AHT10.cpp index 4d8c80200..096a131b9 100644 --- a/src/modules/Telemetry/Sensor/AHT10.cpp +++ b/src/modules/Telemetry/Sensor/AHT10.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "AHT10.h" diff --git a/src/modules/Telemetry/Sensor/AHT10.h b/src/modules/Telemetry/Sensor/AHT10.h index d9a133402..b2f0d8ae5 100644 --- a/src/modules/Telemetry/Sensor/AHT10.h +++ b/src/modules/Telemetry/Sensor/AHT10.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/BME280Sensor.cpp b/src/modules/Telemetry/Sensor/BME280Sensor.cpp index 65dab5105..d7b0a8a38 100644 --- a/src/modules/Telemetry/Sensor/BME280Sensor.cpp +++ b/src/modules/Telemetry/Sensor/BME280Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "BME280Sensor.h" diff --git a/src/modules/Telemetry/Sensor/BME280Sensor.h b/src/modules/Telemetry/Sensor/BME280Sensor.h index eb78f79f7..d1e21c8d5 100644 --- a/src/modules/Telemetry/Sensor/BME280Sensor.h +++ b/src/modules/Telemetry/Sensor/BME280Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/BME680Sensor.cpp b/src/modules/Telemetry/Sensor/BME680Sensor.cpp index 9237cf0c9..0e0212bc5 100644 --- a/src/modules/Telemetry/Sensor/BME680Sensor.cpp +++ b/src/modules/Telemetry/Sensor/BME680Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "BME680Sensor.h" diff --git a/src/modules/Telemetry/Sensor/BME680Sensor.h b/src/modules/Telemetry/Sensor/BME680Sensor.h index a5d2b5a48..249c4b3e7 100644 --- a/src/modules/Telemetry/Sensor/BME680Sensor.h +++ b/src/modules/Telemetry/Sensor/BME680Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/BMP085Sensor.cpp b/src/modules/Telemetry/Sensor/BMP085Sensor.cpp index 7f59f14f0..8087eb4b9 100644 --- a/src/modules/Telemetry/Sensor/BMP085Sensor.cpp +++ b/src/modules/Telemetry/Sensor/BMP085Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "BMP085Sensor.h" diff --git a/src/modules/Telemetry/Sensor/BMP085Sensor.h b/src/modules/Telemetry/Sensor/BMP085Sensor.h index 4ba8c5af1..8dadceab4 100644 --- a/src/modules/Telemetry/Sensor/BMP085Sensor.h +++ b/src/modules/Telemetry/Sensor/BMP085Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/BMP280Sensor.cpp b/src/modules/Telemetry/Sensor/BMP280Sensor.cpp index 56a8bc080..47069b8e0 100644 --- a/src/modules/Telemetry/Sensor/BMP280Sensor.cpp +++ b/src/modules/Telemetry/Sensor/BMP280Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "BMP280Sensor.h" diff --git a/src/modules/Telemetry/Sensor/BMP280Sensor.h b/src/modules/Telemetry/Sensor/BMP280Sensor.h index da85fdc1d..d615411b2 100644 --- a/src/modules/Telemetry/Sensor/BMP280Sensor.h +++ b/src/modules/Telemetry/Sensor/BMP280Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/BMP3XXSensor.cpp b/src/modules/Telemetry/Sensor/BMP3XXSensor.cpp index 69feaf3d9..28a71b48f 100644 --- a/src/modules/Telemetry/Sensor/BMP3XXSensor.cpp +++ b/src/modules/Telemetry/Sensor/BMP3XXSensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "BMP3XXSensor.h" diff --git a/src/modules/Telemetry/Sensor/BMP3XXSensor.h b/src/modules/Telemetry/Sensor/BMP3XXSensor.h index 79939c8d8..6ab0f533d 100644 --- a/src/modules/Telemetry/Sensor/BMP3XXSensor.h +++ b/src/modules/Telemetry/Sensor/BMP3XXSensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #ifndef _BMP3XX_SENSOR_H #define _BMP3XX_SENSOR_H diff --git a/src/modules/Telemetry/Sensor/DFRobotGravitySensor.cpp b/src/modules/Telemetry/Sensor/DFRobotGravitySensor.cpp index c7fa29966..9581057b0 100644 --- a/src/modules/Telemetry/Sensor/DFRobotGravitySensor.cpp +++ b/src/modules/Telemetry/Sensor/DFRobotGravitySensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "DFRobotGravitySensor.h" diff --git a/src/modules/Telemetry/Sensor/DFRobotGravitySensor.h b/src/modules/Telemetry/Sensor/DFRobotGravitySensor.h index 8bd7335b5..dfd81a913 100644 --- a/src/modules/Telemetry/Sensor/DFRobotGravitySensor.h +++ b/src/modules/Telemetry/Sensor/DFRobotGravitySensor.h @@ -4,7 +4,7 @@ #define _MT_DFROBOTGRAVITYSENSOR_H #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/DFRobotLarkSensor.cpp b/src/modules/Telemetry/Sensor/DFRobotLarkSensor.cpp index 1d143b03b..d962f1634 100644 --- a/src/modules/Telemetry/Sensor/DFRobotLarkSensor.cpp +++ b/src/modules/Telemetry/Sensor/DFRobotLarkSensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "DFRobotLarkSensor.h" diff --git a/src/modules/Telemetry/Sensor/DFRobotLarkSensor.h b/src/modules/Telemetry/Sensor/DFRobotLarkSensor.h index 7a988e84a..7b67bc5b6 100644 --- a/src/modules/Telemetry/Sensor/DFRobotLarkSensor.h +++ b/src/modules/Telemetry/Sensor/DFRobotLarkSensor.h @@ -4,7 +4,7 @@ #define _MT_DFROBOTLARKSENSOR_H #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/DPS310Sensor.cpp b/src/modules/Telemetry/Sensor/DPS310Sensor.cpp index dc5dc4fdf..cc9b83af8 100644 --- a/src/modules/Telemetry/Sensor/DPS310Sensor.cpp +++ b/src/modules/Telemetry/Sensor/DPS310Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "DPS310Sensor.h" diff --git a/src/modules/Telemetry/Sensor/DPS310Sensor.h b/src/modules/Telemetry/Sensor/DPS310Sensor.h index 452975806..e9b4ece89 100644 --- a/src/modules/Telemetry/Sensor/DPS310Sensor.h +++ b/src/modules/Telemetry/Sensor/DPS310Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/INA219Sensor.cpp b/src/modules/Telemetry/Sensor/INA219Sensor.cpp index ea47e265d..d94afbc7c 100644 --- a/src/modules/Telemetry/Sensor/INA219Sensor.cpp +++ b/src/modules/Telemetry/Sensor/INA219Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "INA219Sensor.h" diff --git a/src/modules/Telemetry/Sensor/INA219Sensor.h b/src/modules/Telemetry/Sensor/INA219Sensor.h index 9b6a2fcca..908366ce6 100644 --- a/src/modules/Telemetry/Sensor/INA219Sensor.h +++ b/src/modules/Telemetry/Sensor/INA219Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "CurrentSensor.h" diff --git a/src/modules/Telemetry/Sensor/INA226Sensor.cpp b/src/modules/Telemetry/Sensor/INA226Sensor.cpp index 8b1cded60..4b313ba81 100644 --- a/src/modules/Telemetry/Sensor/INA226Sensor.cpp +++ b/src/modules/Telemetry/Sensor/INA226Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include("INA226.h") #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "INA226.h" diff --git a/src/modules/Telemetry/Sensor/INA260Sensor.cpp b/src/modules/Telemetry/Sensor/INA260Sensor.cpp index 24182b336..9d9a99c00 100644 --- a/src/modules/Telemetry/Sensor/INA260Sensor.cpp +++ b/src/modules/Telemetry/Sensor/INA260Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "INA260Sensor.h" diff --git a/src/modules/Telemetry/Sensor/INA260Sensor.h b/src/modules/Telemetry/Sensor/INA260Sensor.h index f436b8f38..ea71c24e0 100644 --- a/src/modules/Telemetry/Sensor/INA260Sensor.h +++ b/src/modules/Telemetry/Sensor/INA260Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/INA3221Sensor.cpp b/src/modules/Telemetry/Sensor/INA3221Sensor.cpp index 7ac11dfde..78081132a 100644 --- a/src/modules/Telemetry/Sensor/INA3221Sensor.cpp +++ b/src/modules/Telemetry/Sensor/INA3221Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "INA3221Sensor.h" diff --git a/src/modules/Telemetry/Sensor/INA3221Sensor.h b/src/modules/Telemetry/Sensor/INA3221Sensor.h index 8eeda3e02..69edf8c50 100644 --- a/src/modules/Telemetry/Sensor/INA3221Sensor.h +++ b/src/modules/Telemetry/Sensor/INA3221Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "CurrentSensor.h" diff --git a/src/modules/Telemetry/Sensor/LPS22HBSensor.cpp b/src/modules/Telemetry/Sensor/LPS22HBSensor.cpp index 170fafd39..cf0fbe4a9 100644 --- a/src/modules/Telemetry/Sensor/LPS22HBSensor.cpp +++ b/src/modules/Telemetry/Sensor/LPS22HBSensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "LPS22HBSensor.h" diff --git a/src/modules/Telemetry/Sensor/LPS22HBSensor.h b/src/modules/Telemetry/Sensor/LPS22HBSensor.h index 955f2a1e5..24d75e903 100644 --- a/src/modules/Telemetry/Sensor/LPS22HBSensor.h +++ b/src/modules/Telemetry/Sensor/LPS22HBSensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/MAX17048Sensor.cpp b/src/modules/Telemetry/Sensor/MAX17048Sensor.cpp index 3aacf9cd7..6ab96aa57 100644 --- a/src/modules/Telemetry/Sensor/MAX17048Sensor.cpp +++ b/src/modules/Telemetry/Sensor/MAX17048Sensor.cpp @@ -1,6 +1,6 @@ #include "MAX17048Sensor.h" -#if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) +#if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_STM32WL) && __has_include() MAX17048Singleton *MAX17048Singleton::GetInstance() { diff --git a/src/modules/Telemetry/Sensor/MAX17048Sensor.h b/src/modules/Telemetry/Sensor/MAX17048Sensor.h index bd109cbb1..6f61421dc 100644 --- a/src/modules/Telemetry/Sensor/MAX17048Sensor.h +++ b/src/modules/Telemetry/Sensor/MAX17048Sensor.h @@ -5,7 +5,7 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) +#if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_STM32WL) && __has_include() // Samples to store in a buffer to determine if the battery is charging or discharging #define MAX17048_CHARGING_SAMPLES 3 diff --git a/src/modules/Telemetry/Sensor/MAX30102Sensor.cpp b/src/modules/Telemetry/Sensor/MAX30102Sensor.cpp index f99956925..ceca4be5e 100644 --- a/src/modules/Telemetry/Sensor/MAX30102Sensor.cpp +++ b/src/modules/Telemetry/Sensor/MAX30102Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !MESHTASTIC_EXCLUDE_HEALTH_TELEMETRY && !defined(ARCH_PORTDUINO) +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !MESHTASTIC_EXCLUDE_HEALTH_TELEMETRY && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "MAX30102Sensor.h" diff --git a/src/modules/Telemetry/Sensor/MAX30102Sensor.h b/src/modules/Telemetry/Sensor/MAX30102Sensor.h index 026e30ed0..9981d4006 100644 --- a/src/modules/Telemetry/Sensor/MAX30102Sensor.h +++ b/src/modules/Telemetry/Sensor/MAX30102Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !MESHTASTIC_EXCLUDE_HEALTH_TELEMETRY && !defined(ARCH_PORTDUINO) +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !MESHTASTIC_EXCLUDE_HEALTH_TELEMETRY && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/MCP9808Sensor.cpp b/src/modules/Telemetry/Sensor/MCP9808Sensor.cpp index 58ce29cd2..906634c40 100644 --- a/src/modules/Telemetry/Sensor/MCP9808Sensor.cpp +++ b/src/modules/Telemetry/Sensor/MCP9808Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "MCP9808Sensor.h" diff --git a/src/modules/Telemetry/Sensor/MCP9808Sensor.h b/src/modules/Telemetry/Sensor/MCP9808Sensor.h index 05bdabf3f..705a71700 100644 --- a/src/modules/Telemetry/Sensor/MCP9808Sensor.h +++ b/src/modules/Telemetry/Sensor/MCP9808Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/MLX90614Sensor.cpp b/src/modules/Telemetry/Sensor/MLX90614Sensor.cpp index d9908fce3..9661b59c2 100644 --- a/src/modules/Telemetry/Sensor/MLX90614Sensor.cpp +++ b/src/modules/Telemetry/Sensor/MLX90614Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_PORTDUINO) +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "MLX90614Sensor.h" diff --git a/src/modules/Telemetry/Sensor/MLX90614Sensor.h b/src/modules/Telemetry/Sensor/MLX90614Sensor.h index 00f63449e..c2571027e 100644 --- a/src/modules/Telemetry/Sensor/MLX90614Sensor.h +++ b/src/modules/Telemetry/Sensor/MLX90614Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_PORTDUINO) +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" #include diff --git a/src/modules/Telemetry/Sensor/MLX90632Sensor.cpp b/src/modules/Telemetry/Sensor/MLX90632Sensor.cpp index b7bd6ae61..dfc049023 100644 --- a/src/modules/Telemetry/Sensor/MLX90632Sensor.cpp +++ b/src/modules/Telemetry/Sensor/MLX90632Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "MLX90632Sensor.h" diff --git a/src/modules/Telemetry/Sensor/MLX90632Sensor.h b/src/modules/Telemetry/Sensor/MLX90632Sensor.h index 7b36c44cd..ef7be180a 100644 --- a/src/modules/Telemetry/Sensor/MLX90632Sensor.h +++ b/src/modules/Telemetry/Sensor/MLX90632Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/NAU7802Sensor.cpp b/src/modules/Telemetry/Sensor/NAU7802Sensor.cpp index 1329c8d90..ef1756b36 100644 --- a/src/modules/Telemetry/Sensor/NAU7802Sensor.cpp +++ b/src/modules/Telemetry/Sensor/NAU7802Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "FSCommon.h" diff --git a/src/modules/Telemetry/Sensor/NAU7802Sensor.h b/src/modules/Telemetry/Sensor/NAU7802Sensor.h index c53a3b31a..cb9e64829 100644 --- a/src/modules/Telemetry/Sensor/NAU7802Sensor.h +++ b/src/modules/Telemetry/Sensor/NAU7802Sensor.h @@ -1,7 +1,7 @@ #include "MeshModule.h" #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/OPT3001Sensor.cpp b/src/modules/Telemetry/Sensor/OPT3001Sensor.cpp index 75c6cd41a..1f0407374 100644 --- a/src/modules/Telemetry/Sensor/OPT3001Sensor.cpp +++ b/src/modules/Telemetry/Sensor/OPT3001Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "OPT3001Sensor.h" diff --git a/src/modules/Telemetry/Sensor/OPT3001Sensor.h b/src/modules/Telemetry/Sensor/OPT3001Sensor.h index 2ac149319..a9da2d705 100644 --- a/src/modules/Telemetry/Sensor/OPT3001Sensor.h +++ b/src/modules/Telemetry/Sensor/OPT3001Sensor.h @@ -1,7 +1,7 @@ #pragma once #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/SHT31Sensor.cpp b/src/modules/Telemetry/Sensor/SHT31Sensor.cpp index b96b94fa8..8619a7905 100644 --- a/src/modules/Telemetry/Sensor/SHT31Sensor.cpp +++ b/src/modules/Telemetry/Sensor/SHT31Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "SHT31Sensor.h" diff --git a/src/modules/Telemetry/Sensor/SHT31Sensor.h b/src/modules/Telemetry/Sensor/SHT31Sensor.h index 560b22436..c3d81af95 100644 --- a/src/modules/Telemetry/Sensor/SHT31Sensor.h +++ b/src/modules/Telemetry/Sensor/SHT31Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/SHT4XSensor.cpp b/src/modules/Telemetry/Sensor/SHT4XSensor.cpp index 0fa6021dc..83fdaf6c6 100644 --- a/src/modules/Telemetry/Sensor/SHT4XSensor.cpp +++ b/src/modules/Telemetry/Sensor/SHT4XSensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "SHT4XSensor.h" diff --git a/src/modules/Telemetry/Sensor/SHT4XSensor.h b/src/modules/Telemetry/Sensor/SHT4XSensor.h index 62a5cefeb..da608cb82 100644 --- a/src/modules/Telemetry/Sensor/SHT4XSensor.h +++ b/src/modules/Telemetry/Sensor/SHT4XSensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp b/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp index 3a7cc48d2..dbebec9d3 100644 --- a/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp +++ b/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "SHTC3Sensor.h" diff --git a/src/modules/Telemetry/Sensor/SHTC3Sensor.h b/src/modules/Telemetry/Sensor/SHTC3Sensor.h index 7a760292f..458af6465 100644 --- a/src/modules/Telemetry/Sensor/SHTC3Sensor.h +++ b/src/modules/Telemetry/Sensor/SHTC3Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/TSL2591Sensor.cpp b/src/modules/Telemetry/Sensor/TSL2591Sensor.cpp index add475d5b..beec3c70b 100644 --- a/src/modules/Telemetry/Sensor/TSL2591Sensor.cpp +++ b/src/modules/Telemetry/Sensor/TSL2591Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TSL2591Sensor.h" diff --git a/src/modules/Telemetry/Sensor/TSL2591Sensor.h b/src/modules/Telemetry/Sensor/TSL2591Sensor.h index 27bebdfe5..edf7698b1 100644 --- a/src/modules/Telemetry/Sensor/TSL2591Sensor.h +++ b/src/modules/Telemetry/Sensor/TSL2591Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/TelemetrySensor.h b/src/modules/Telemetry/Sensor/TelemetrySensor.h index 08cc1125d..83d7b38b0 100644 --- a/src/modules/Telemetry/Sensor/TelemetrySensor.h +++ b/src/modules/Telemetry/Sensor/TelemetrySensor.h @@ -8,7 +8,9 @@ #include "NodeDB.h" #include +#if !ARCH_PORTDUINO class TwoWire; +#endif #define DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000 extern std::pair nodeTelemetrySensorsMap[_meshtastic_TelemetrySensorType_MAX + 1]; @@ -40,7 +42,7 @@ class TelemetrySensor initialized = true; return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; } - virtual void setup(); + virtual void setup() = 0; public: virtual AdminMessageHandleResult handleAdminMessage(const meshtastic_MeshPacket &mp, meshtastic_AdminMessage *request, diff --git a/src/modules/Telemetry/Sensor/VEML7700Sensor.cpp b/src/modules/Telemetry/Sensor/VEML7700Sensor.cpp index 496b49aeb..b075bf405 100644 --- a/src/modules/Telemetry/Sensor/VEML7700Sensor.cpp +++ b/src/modules/Telemetry/Sensor/VEML7700Sensor.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/VEML7700Sensor.h b/src/modules/Telemetry/Sensor/VEML7700Sensor.h index 97e57334c..f40384ad3 100644 --- a/src/modules/Telemetry/Sensor/VEML7700Sensor.h +++ b/src/modules/Telemetry/Sensor/VEML7700Sensor.h @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" diff --git a/src/modules/Telemetry/Sensor/nullSensor.cpp b/src/modules/Telemetry/Sensor/nullSensor.cpp new file mode 100644 index 000000000..9522c7fcc --- /dev/null +++ b/src/modules/Telemetry/Sensor/nullSensor.cpp @@ -0,0 +1,23 @@ +#include "configuration.h" + +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR + +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include "nullSensor.h" +#include + +NullSensor::NullSensor() : TelemetrySensor(meshtastic_TelemetrySensorType_SENSOR_UNSET, "nullSensor") {} + +int32_t NullSensor::runOnce() +{ + return 0; +} + +void NullSensor::setup() {} + +bool NullSensor::getMetrics(meshtastic_Telemetry *measurement) +{ + return false; +} +#endif \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/nullSensor.h b/src/modules/Telemetry/Sensor/nullSensor.h new file mode 100644 index 000000000..94dbcc7f8 --- /dev/null +++ b/src/modules/Telemetry/Sensor/nullSensor.h @@ -0,0 +1,22 @@ +#include "configuration.h" + +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#pragma once + +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" + +class NullSensor : public TelemetrySensor +{ + + protected: + virtual void setup() override; + + public: + NullSensor(); + virtual int32_t runOnce() override; + virtual bool getMetrics(meshtastic_Telemetry *measurement) override; + int32_t runTrigger() { return 0; } +}; + +#endif \ No newline at end of file diff --git a/src/motion/BMA423Sensor.cpp b/src/motion/BMA423Sensor.cpp index d7058bab0..7951a236e 100755 --- a/src/motion/BMA423Sensor.cpp +++ b/src/motion/BMA423Sensor.cpp @@ -1,6 +1,6 @@ #include "BMA423Sensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && defined(HAS_BMA423) +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && defined(HAS_BMA423) && __has_include() using namespace MotionSensorI2C; diff --git a/src/motion/BMA423Sensor.h b/src/motion/BMA423Sensor.h index 455315aa9..b9d7b4aa0 100755 --- a/src/motion/BMA423Sensor.h +++ b/src/motion/BMA423Sensor.h @@ -4,7 +4,7 @@ #include "MotionSensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && defined(HAS_BMA423) +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && defined(HAS_BMA423) && __has_include() #include #include diff --git a/src/motion/BMX160Sensor.cpp b/src/motion/BMX160Sensor.cpp index 3ddbe46ea..39bc04ea1 100755 --- a/src/motion/BMX160Sensor.cpp +++ b/src/motion/BMX160Sensor.cpp @@ -1,10 +1,10 @@ #include "BMX160Sensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C BMX160Sensor::BMX160Sensor(ScanI2C::FoundDevice foundDevice) : MotionSensor::MotionSensor(foundDevice) {} -#if defined(RAK_4631) && !defined(RAK2560) +#if defined(RAK_4631) && !defined(RAK2560) && __has_include() #if !defined(MESHTASTIC_EXCLUDE_SCREEN) // screen is defined in main.cpp diff --git a/src/motion/BMX160Sensor.h b/src/motion/BMX160Sensor.h index fc5a48aa4..d0efa5ae6 100755 --- a/src/motion/BMX160Sensor.h +++ b/src/motion/BMX160Sensor.h @@ -5,9 +5,9 @@ #include "MotionSensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C -#if defined(RAK_4631) && !defined(RAK2560) +#if defined(RAK_4631) && !defined(RAK2560) && __has_include() #include "Fusion/Fusion.h" #include diff --git a/src/motion/ICM20948Sensor.cpp b/src/motion/ICM20948Sensor.cpp index 338a4fc5f..946390ddb 100755 --- a/src/motion/ICM20948Sensor.cpp +++ b/src/motion/ICM20948Sensor.cpp @@ -1,6 +1,6 @@ #include "ICM20948Sensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include() // Flag when an interrupt has been detected volatile static bool ICM20948_IRQ = false; diff --git a/src/motion/ICM20948Sensor.h b/src/motion/ICM20948Sensor.h index d5e246c8d..8344b0703 100755 --- a/src/motion/ICM20948Sensor.h +++ b/src/motion/ICM20948Sensor.h @@ -4,7 +4,7 @@ #include "MotionSensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include() #include diff --git a/src/motion/LIS3DHSensor.cpp b/src/motion/LIS3DHSensor.cpp index 995f74abe..903cc92f7 100755 --- a/src/motion/LIS3DHSensor.cpp +++ b/src/motion/LIS3DHSensor.cpp @@ -1,7 +1,7 @@ #include "LIS3DHSensor.h" #include "NodeDB.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include() LIS3DHSensor::LIS3DHSensor(ScanI2C::FoundDevice foundDevice) : MotionSensor::MotionSensor(foundDevice) {} diff --git a/src/motion/LIS3DHSensor.h b/src/motion/LIS3DHSensor.h index 603d195a8..924b193e2 100755 --- a/src/motion/LIS3DHSensor.h +++ b/src/motion/LIS3DHSensor.h @@ -4,7 +4,7 @@ #include "MotionSensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include() #include diff --git a/src/motion/LSM6DS3Sensor.cpp b/src/motion/LSM6DS3Sensor.cpp index 2dcb4d663..7e2d7dfcd 100755 --- a/src/motion/LSM6DS3Sensor.cpp +++ b/src/motion/LSM6DS3Sensor.cpp @@ -1,7 +1,7 @@ #include "LSM6DS3Sensor.h" #include "NodeDB.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include() LSM6DS3Sensor::LSM6DS3Sensor(ScanI2C::FoundDevice foundDevice) : MotionSensor::MotionSensor(foundDevice) {} diff --git a/src/motion/LSM6DS3Sensor.h b/src/motion/LSM6DS3Sensor.h index 77069ef3c..8bf885149 100755 --- a/src/motion/LSM6DS3Sensor.h +++ b/src/motion/LSM6DS3Sensor.h @@ -4,7 +4,7 @@ #include "MotionSensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include() #ifndef LSM6DS3_WAKE_THRESH #define LSM6DS3_WAKE_THRESH 20 diff --git a/src/motion/MPU6050Sensor.cpp b/src/motion/MPU6050Sensor.cpp index c3f2d0b7c..5d4f7bfdb 100755 --- a/src/motion/MPU6050Sensor.cpp +++ b/src/motion/MPU6050Sensor.cpp @@ -1,6 +1,6 @@ #include "MPU6050Sensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include() MPU6050Sensor::MPU6050Sensor(ScanI2C::FoundDevice foundDevice) : MotionSensor::MotionSensor(foundDevice) {} diff --git a/src/motion/MPU6050Sensor.h b/src/motion/MPU6050Sensor.h index 2e6eafecd..2bca72b34 100755 --- a/src/motion/MPU6050Sensor.h +++ b/src/motion/MPU6050Sensor.h @@ -4,7 +4,7 @@ #include "MotionSensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include() #include diff --git a/src/motion/MotionSensor.cpp b/src/motion/MotionSensor.cpp index d87380085..54a2f883a 100755 --- a/src/motion/MotionSensor.cpp +++ b/src/motion/MotionSensor.cpp @@ -1,6 +1,6 @@ #include "MotionSensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C char timeRemainingBuffer[12]; diff --git a/src/motion/MotionSensor.h b/src/motion/MotionSensor.h index 1f4d093bf..90080577f 100755 --- a/src/motion/MotionSensor.h +++ b/src/motion/MotionSensor.h @@ -7,7 +7,7 @@ #include "../configuration.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C #include "../PowerFSM.h" #include "../detect/ScanI2C.h" diff --git a/src/motion/QMA6100PSensor.cpp b/src/motion/QMA6100PSensor.cpp index eb81e16c7..a04837e80 100644 --- a/src/motion/QMA6100PSensor.cpp +++ b/src/motion/QMA6100PSensor.cpp @@ -1,6 +1,6 @@ #include "QMA6100PSensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && defined(HAS_QMA6100P) +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && defined(HAS_QMA6100P) // Flag when an interrupt has been detected volatile static bool QMA6100P_IRQ = false; diff --git a/src/motion/QMA6100PSensor.h b/src/motion/QMA6100PSensor.h index 7ba00149c..72e716ef9 100644 --- a/src/motion/QMA6100PSensor.h +++ b/src/motion/QMA6100PSensor.h @@ -4,7 +4,7 @@ #include "MotionSensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && defined(HAS_QMA6100P) +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && defined(HAS_QMA6100P) #include diff --git a/src/motion/STK8XXXSensor.cpp b/src/motion/STK8XXXSensor.cpp index 377ee3c37..d27a1e88d 100755 --- a/src/motion/STK8XXXSensor.cpp +++ b/src/motion/STK8XXXSensor.cpp @@ -1,6 +1,6 @@ #include "STK8XXXSensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && defined(HAS_STK8XXX) +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && defined(HAS_STK8XXX) STK8XXXSensor::STK8XXXSensor(ScanI2C::FoundDevice foundDevice) : MotionSensor::MotionSensor(foundDevice) {} diff --git a/src/motion/STK8XXXSensor.h b/src/motion/STK8XXXSensor.h index cff98d87d..f54bc7707 100755 --- a/src/motion/STK8XXXSensor.h +++ b/src/motion/STK8XXXSensor.h @@ -4,7 +4,7 @@ #include "MotionSensor.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && defined(HAS_STK8XXX) +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && defined(HAS_STK8XXX) #ifdef STK8XXX_INT diff --git a/src/platform/portduino/architecture.h b/src/platform/portduino/architecture.h index 3dde87199..a5e263d5a 100644 --- a/src/platform/portduino/architecture.h +++ b/src/platform/portduino/architecture.h @@ -19,4 +19,7 @@ #endif #ifndef HAS_TELEMETRY #define HAS_TELEMETRY 1 +#endif +#ifndef HAS_SENSOR +#define HAS_SENSOR 1 #endif \ No newline at end of file diff --git a/src/power.h b/src/power.h index a21f7d164..d7fa7f8a9 100644 --- a/src/power.h +++ b/src/power.h @@ -45,23 +45,48 @@ extern RTC_NOINIT_ATTR uint64_t RTC_reg_b; #include "soc/sens_reg.h" // needed for adc pin reset #endif -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_PORTDUINO) +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#include "modules/Telemetry/Sensor/nullSensor.h" +#if __has_include() #include "modules/Telemetry/Sensor/INA219Sensor.h" -#include "modules/Telemetry/Sensor/INA226Sensor.h" -#include "modules/Telemetry/Sensor/INA260Sensor.h" -#include "modules/Telemetry/Sensor/INA3221Sensor.h" extern INA219Sensor ina219Sensor; +#else +extern NullSensor ina219Sensor; +#endif + +#if __has_include() +#include "modules/Telemetry/Sensor/INA226Sensor.h" extern INA226Sensor ina226Sensor; +#else +extern NullSensor ina226Sensor; +#endif + +#if __has_include() +#include "modules/Telemetry/Sensor/INA260Sensor.h" extern INA260Sensor ina260Sensor; +#else +extern NullSensor ina260Sensor; +#endif + +#if __has_include() +#include "modules/Telemetry/Sensor/INA3221Sensor.h" extern INA3221Sensor ina3221Sensor; +#else +extern NullSensor ina3221Sensor; #endif -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) +#endif + +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_STM32WL) #include "modules/Telemetry/Sensor/MAX17048Sensor.h" +#if __has_include() extern MAX17048Sensor max17048Sensor; +#else +extern NullSensor max17048Sensor; +#endif #endif -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && HAS_RAKPROT && !defined(ARCH_PORTDUINO) +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && HAS_RAKPROT #include "modules/Telemetry/Sensor/RAK9154Sensor.h" extern RAK9154Sensor rak9154Sensor; #endif From b4e8f7dbb656518aa277869358f56201dc8eb14e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 20:32:19 -0500 Subject: [PATCH 111/461] Update Adafruit BusIO digest to 159f86a (#6681) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index fb121aafe..0c2524b25 100644 --- a/platformio.ini +++ b/platformio.ini @@ -114,7 +114,7 @@ lib_deps = [environmental_base] lib_deps = # renovate: datasource=git-refs depName=Adafruit BusIO packageName=https://github.com/adafruit/Adafruit_BusIO gitBranch=master - https://github.com/adafruit/Adafruit_BusIO/archive/5e8f137415f473e390c9410421bb54d828898fad.zip + https://github.com/adafruit/Adafruit_BusIO/archive/159f86a3bd64485227f63ef2f60abe35877051d0.zip # renovate: datasource=custom.pio depName=Adafruit Unified Sensor packageName=adafruit/library/Adafruit Unified Sensor adafruit/Adafruit Unified Sensor@1.1.15 # renovate: datasource=custom.pio depName=Adafruit BMP280 packageName=adafruit/library/Adafruit BMP280 Library From 72eae42b81722771fdae885b5d9817274e80af96 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 29 Apr 2025 04:31:01 -0700 Subject: [PATCH 112/461] PMSA003I: add support for driving SET pin low while not actively taking a telemetry reading (#6569) * support manually shutting off power to the PMSA003I sensor when we aren't doing a telemetry reading * add comment about PMSA003I_WARMUP_MS to AirQualityTelemetry.cpp * fix typos, use arduino gpio defines instead of magic numbers * support manually shutting off power to the PMSA003I sensor when we aren't doing a telemetry reading * add comment about PMSA003I_WARMUP_MS to AirQualityTelemetry.cpp * fix typos, use arduino gpio defines instead of magic numbers * RAK4631: add PMSA003I_ENABLE_PIN define * fix indentation --------- Co-authored-by: Ben Meadors --- src/modules/Telemetry/AirQualityTelemetry.cpp | 64 +++++++++++++++---- src/modules/Telemetry/AirQualityTelemetry.h | 14 ++++ variants/rak4631/variant.h | 6 ++ 3 files changed, 71 insertions(+), 13 deletions(-) diff --git a/src/modules/Telemetry/AirQualityTelemetry.cpp b/src/modules/Telemetry/AirQualityTelemetry.cpp index 1ddb9ca9b..fafb28699 100644 --- a/src/modules/Telemetry/AirQualityTelemetry.cpp +++ b/src/modules/Telemetry/AirQualityTelemetry.cpp @@ -14,6 +14,13 @@ #include "main.h" #include +#ifndef PMSA003I_WARMUP_MS +// from the PMSA003I datasheet: +// "Stable data should be got at least 30 seconds after the sensor wakeup +// from the sleep mode because of the fan’s performance." +#define PMSA003I_WARMUP_MS 30000 +#endif + int32_t AirQualityTelemetryModule::runOnce() { /* @@ -34,6 +41,13 @@ int32_t AirQualityTelemetryModule::runOnce() if (moduleConfig.telemetry.air_quality_enabled) { LOG_INFO("Air quality Telemetry: init"); + +#ifdef PMSA003I_ENABLE_PIN + // put the sensor to sleep on startup + pinMode(PMSA003I_ENABLE_PIN, OUTPUT); + digitalWrite(PMSA003I_ENABLE_PIN, LOW); +#endif /* PMSA003I_ENABLE_PIN */ + if (!aqi.begin_I2C()) { #ifndef I2C_NO_RESCAN LOG_WARN("Could not establish i2c connection to AQI sensor. Rescan"); @@ -63,21 +77,45 @@ int32_t AirQualityTelemetryModule::runOnce() if (!moduleConfig.telemetry.air_quality_enabled) return disable(); - if (((lastSentToMesh == 0) || - !Throttle::isWithinTimespanMs(lastSentToMesh, Default::getConfiguredOrDefaultMsScaled( - moduleConfig.telemetry.air_quality_interval, - default_telemetry_broadcast_interval_secs, numOnlineNodes))) && - airTime->isTxAllowedChannelUtil(config.device.role != meshtastic_Config_DeviceConfig_Role_SENSOR) && - airTime->isTxAllowedAirUtil()) { - sendTelemetry(); - lastSentToMesh = millis(); - } else if (service->isToPhoneQueueEmpty()) { - // Just send to phone when it's not our time to send to mesh yet - // Only send while queue is empty (phone assumed connected) - sendTelemetry(NODENUM_BROADCAST, true); + switch (state) { +#ifdef PMSA003I_ENABLE_PIN + case State::IDLE: + // sensor is in standby; fire it up and sleep + LOG_DEBUG("runOnce(): state = idle"); + digitalWrite(PMSA003I_ENABLE_PIN, HIGH); + state = State::ACTIVE; + + return PMSA003I_WARMUP_MS; +#endif /* PMSA003I_ENABLE_PIN */ + case State::ACTIVE: + // sensor is already warmed up; grab telemetry and send it + LOG_DEBUG("runOnce(): state = active"); + + if (((lastSentToMesh == 0) || + !Throttle::isWithinTimespanMs(lastSentToMesh, Default::getConfiguredOrDefaultMsScaled( + moduleConfig.telemetry.air_quality_interval, + default_telemetry_broadcast_interval_secs, numOnlineNodes))) && + airTime->isTxAllowedChannelUtil(config.device.role != meshtastic_Config_DeviceConfig_Role_SENSOR) && + airTime->isTxAllowedAirUtil()) { + sendTelemetry(); + lastSentToMesh = millis(); + } else if (service->isToPhoneQueueEmpty()) { + // Just send to phone when it's not our time to send to mesh yet + // Only send while queue is empty (phone assumed connected) + sendTelemetry(NODENUM_BROADCAST, true); + } + +#ifdef PMSA003I_ENABLE_PIN + // put sensor back to sleep + digitalWrite(PMSA003I_ENABLE_PIN, LOW); + state = State::IDLE; +#endif /* PMSA003I_ENABLE_PIN */ + + return sendToPhoneIntervalMs; + default: + return disable(); } } - return sendToPhoneIntervalMs; } bool AirQualityTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Telemetry *t) diff --git a/src/modules/Telemetry/AirQualityTelemetry.h b/src/modules/Telemetry/AirQualityTelemetry.h index 4e82efac3..0142ee686 100644 --- a/src/modules/Telemetry/AirQualityTelemetry.h +++ b/src/modules/Telemetry/AirQualityTelemetry.h @@ -23,6 +23,14 @@ class AirQualityTelemetryModule : private concurrency::OSThread, public Protobuf setIntervalFromNow(10 * 1000); aqi = Adafruit_PM25AQI(); nodeStatusObserver.observe(&nodeStatus->onNewStatus); + +#ifdef PMSA003I_ENABLE_PIN + // the PMSA003I sensor uses about 300mW on its own; support powering it off when it's not actively taking + // a reading + state = State::IDLE; +#else + state = State::ACTIVE; +#endif } protected: @@ -42,6 +50,12 @@ class AirQualityTelemetryModule : private concurrency::OSThread, public Protobuf bool sendTelemetry(NodeNum dest = NODENUM_BROADCAST, bool wantReplies = false); private: + enum State { + IDLE = 0, + ACTIVE = 1, + }; + + State state; Adafruit_PM25AQI aqi; PM25_AQI_Data data = {0}; bool firstTime = true; diff --git a/variants/rak4631/variant.h b/variants/rak4631/variant.h index bc5541336..0da1c04ea 100644 --- a/variants/rak4631/variant.h +++ b/variants/rak4631/variant.h @@ -197,6 +197,12 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG */ +// configure the SET pin on the RAK12039 sensor board to disable the sensor while not reading +// air quality telemetry. PIN_NFC2 doesn't seem to be used anywhere else in the codebase, but if +// you're having problems with your node behaving weirdly when a RAK12039 board isn't connected, +// try disabling this. +#define PMSA003I_ENABLE_PIN PIN_NFC2 + #define DETECTION_SENSOR_EN 4 #define USE_SX1262 From 635de2d2296d463fb61fe5a650bd06b94a6559ee Mon Sep 17 00:00:00 2001 From: Jorropo Date: Tue, 29 Apr 2025 13:31:53 +0200 Subject: [PATCH 113/461] udp-multicast: bump platform-native to fix UDP read of unitialized memory bug (#6686) * udp-multicast: bump platform-native to fix UDP read of unitialized memory bug Fixes: #6683 * Update portduino.ini --------- Co-authored-by: Ben Meadors --- arch/portduino/portduino.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 5dc0daf6b..890169c28 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/46f509b96ddce22d1bf38efc93319dfb3e4f5acf.zip + https://github.com/meshtastic/platform-native/archive/e19f77e034590669feaaf26214667b76d0821d06.zip framework = arduino build_src_filter = @@ -48,4 +48,4 @@ build_flags = -std=gnu17 -std=c++17 -lib_ignore = Adafruit NeoPixel \ No newline at end of file +lib_ignore = Adafruit NeoPixel From 216fbf23434a60d200e2519c002ed1d010febdea Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 29 Apr 2025 19:24:00 -0400 Subject: [PATCH 114/461] Update 'Adafruit BusIO' to 1.17.1 (#6694) --- platformio.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index 0c2524b25..527140835 100644 --- a/platformio.ini +++ b/platformio.ini @@ -113,8 +113,8 @@ lib_deps = ; Common libs for environmental measurements in telemetry module [environmental_base] lib_deps = - # renovate: datasource=git-refs depName=Adafruit BusIO packageName=https://github.com/adafruit/Adafruit_BusIO gitBranch=master - https://github.com/adafruit/Adafruit_BusIO/archive/159f86a3bd64485227f63ef2f60abe35877051d0.zip + # renovate: datasource=custom.pio depName=Adafruit BusIO packageName=adafruit/library/Adafruit BusIO + adafruit/Adafruit BusIO@1.17.1 # renovate: datasource=custom.pio depName=Adafruit Unified Sensor packageName=adafruit/library/Adafruit Unified Sensor adafruit/Adafruit Unified Sensor@1.1.15 # renovate: datasource=custom.pio depName=Adafruit BMP280 packageName=adafruit/library/Adafruit BMP280 Library From a7ef9e9c084e8301c0e42ec7e7b1877848997e2c Mon Sep 17 00:00:00 2001 From: Jorropo Date: Wed, 30 Apr 2025 12:52:42 +0200 Subject: [PATCH 115/461] udp-multicast: remove the thread from the multicast thread API (#6685) * udp-multicast: remove the thread from the multicast thread API The whole API is parallel & asynchronous we don't need to start a thread ourself, the implementation probably does when we call start listening already. * Take copilot advice and call it a handler --------- Co-authored-by: Ben Meadors --- src/main.cpp | 8 ++++---- src/main.h | 4 ++-- src/mesh/Router.cpp | 4 ++-- .../{UdpMulticastThread.h => UdpMulticastHandler.h} | 13 ++----------- src/mesh/wifi/WiFiAPClient.cpp | 4 ++-- 5 files changed, 12 insertions(+), 21 deletions(-) rename src/mesh/udp/{UdpMulticastThread.h => UdpMulticastHandler.h} (85%) diff --git a/src/main.cpp b/src/main.cpp index eb93a70d1..9ef944e65 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -124,8 +124,8 @@ extern void tftSetup(void); #endif #ifdef HAS_UDP_MULTICAST -#include "mesh/udp/UdpMulticastThread.h" -UdpMulticastThread *udpThread = nullptr; +#include "mesh/udp/UdpMulticastHandler.h" +UdpMulticastHandler *udpHandler = nullptr; #endif #if defined(TCXO_OPTIONAL) @@ -918,12 +918,12 @@ void setup() #ifdef HAS_UDP_MULTICAST LOG_DEBUG("Start multicast thread"); - udpThread = new UdpMulticastThread(); + udpHandler = new UdpMulticastHandler(); #ifdef ARCH_PORTDUINO // FIXME: portduino does not ever call onNetworkConnected so call it here because I don't know what happen if I call // onNetworkConnected there if (config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST) { - udpThread->start(); + udpHandler->start(); } #endif #endif diff --git a/src/main.h b/src/main.h index 3b71cfeea..c3807cfd5 100644 --- a/src/main.h +++ b/src/main.h @@ -51,8 +51,8 @@ extern AudioThread *audioThread; #endif #ifdef HAS_UDP_MULTICAST -#include "mesh/udp/UdpMulticastThread.h" -extern UdpMulticastThread *udpThread; +#include "mesh/udp/UdpMulticastHandler.h" +extern UdpMulticastHandler *udpHandler; #endif // Global Screen singleton. diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 2cc3007a2..fef29388e 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -293,8 +293,8 @@ ErrorCode Router::send(meshtastic_MeshPacket *p) } #if HAS_UDP_MULTICAST - if (udpThread && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST) { - udpThread->onSend(const_cast(p)); + if (udpHandler && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST) { + udpHandler->onSend(const_cast(p)); } #endif diff --git a/src/mesh/udp/UdpMulticastThread.h b/src/mesh/udp/UdpMulticastHandler.h similarity index 85% rename from src/mesh/udp/UdpMulticastThread.h rename to src/mesh/udp/UdpMulticastHandler.h index 88824dc4d..39bd61021 100644 --- a/src/mesh/udp/UdpMulticastThread.h +++ b/src/mesh/udp/UdpMulticastHandler.h @@ -13,12 +13,11 @@ #endif // HAS_ETHERNET #define UDP_MULTICAST_DEFAUL_PORT 4403 // Default port for UDP multicast is same as TCP api server -#define UDP_MULTICAST_THREAD_INTERVAL_MS 15000 -class UdpMulticastThread : public concurrency::OSThread +class UdpMulticastHandler final { public: - UdpMulticastThread() : OSThread("UdpMulticast") { udpIpAddress = IPAddress(224, 0, 0, 69); } + UdpMulticastHandler() { udpIpAddress = IPAddress(224, 0, 0, 69); } void start() { @@ -71,14 +70,6 @@ class UdpMulticastThread : public concurrency::OSThread return true; } - protected: - int32_t runOnce() override - { - canSleep = true; - // TODO: Implement nodeinfo broadcast - return UDP_MULTICAST_THREAD_INTERVAL_MS; - } - private: IPAddress udpIpAddress; AsyncUDP udp; diff --git a/src/mesh/wifi/WiFiAPClient.cpp b/src/mesh/wifi/WiFiAPClient.cpp index 4d0b74f7c..789f8ac44 100644 --- a/src/mesh/wifi/WiFiAPClient.cpp +++ b/src/mesh/wifi/WiFiAPClient.cpp @@ -133,8 +133,8 @@ static void onNetworkConnected() } #if HAS_UDP_MULTICAST - if (udpThread && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST) { - udpThread->start(); + if (udpHandler && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST) { + udpHandler->start(); } #endif } From e0b1fdb5e8131010d598f7b74a8058e64f8c3959 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 30 Apr 2025 06:08:10 -0500 Subject: [PATCH 116/461] Rate limit waypoints and alerts and increase to allow every 10 seconds instead of 5 (#6699) * Rate limit waypoints and alerts and increase to allow every 10 seconds instead of 5. * Update src/mesh/PhoneAPI.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Doot --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/mesh/Default.h | 1 + src/mesh/PhoneAPI.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mesh/Default.h b/src/mesh/Default.h index d39886d1c..0daccbb6f 100644 --- a/src/mesh/Default.h +++ b/src/mesh/Default.h @@ -6,6 +6,7 @@ #define ONE_MINUTE_MS 60 * 1000 #define THIRTY_SECONDS_MS 30 * 1000 #define FIVE_SECONDS_MS 5 * 1000 +#define TEN_SECONDS_MS 10 * 1000 #define min_default_telemetry_interval_secs 30 * 60 #define default_gps_update_interval IF_ROUTER(ONE_DAY, 2 * 60) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 204886be5..0e18b8ab1 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -649,8 +649,10 @@ bool PhoneAPI::handleToRadioPacket(meshtastic_MeshPacket &p) meshtastic_QueueStatus qs = router->getQueueStatus(); service->sendQueueStatusToPhone(qs, 0, p.id); return false; - } else if (p.decoded.portnum == meshtastic_PortNum_POSITION_APP && lastPortNumToRadio[p.decoded.portnum] && - Throttle::isWithinTimespanMs(lastPortNumToRadio[p.decoded.portnum], FIVE_SECONDS_MS)) { + } else if (IS_ONE_OF(meshtastic_PortNum_POSITION_APP, meshtastic_PortNum_WAYPOINT_APP, meshtastic_PortNum_ALERT_APP) && + lastPortNumToRadio[p.decoded.portnum] && + Throttle::isWithinTimespanMs(lastPortNumToRadio[p.decoded.portnum], TEN_SECONDS_MS)) { + // TODO: [Issue #6700] Make this rate limit throttling scale up / down with the preset LOG_WARN("Rate limit portnum %d", p.decoded.portnum); meshtastic_QueueStatus qs = router->getQueueStatus(); service->sendQueueStatusToPhone(qs, 0, p.id); From 845088e45b573496a2e58475c7141999d8b7962b Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 30 Apr 2025 06:17:24 -0500 Subject: [PATCH 117/461] Add 100 msecond delay in tft_task_handler when deviceScreen is null (#6695) * Add 100 msecond delay in tft_task_handler when deviceScreen is null, to fix 100% usage bug * move portduino tft task creation into tftSetup * remove superfluous check * update platform-native commit --------- Co-authored-by: mverch67 --- arch/portduino/portduino.ini | 2 +- src/graphics/tftSetup.cpp | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 890169c28..6af3a7717 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/e19f77e034590669feaaf26214667b76d0821d06.zip + https://github.com/meshtastic/platform-native/archive/622341c6de8a239704318b10c3dbb00c21a3eab3.zip framework = arduino build_src_filter = diff --git a/src/graphics/tftSetup.cpp b/src/graphics/tftSetup.cpp index cacb02694..a8d51bb82 100644 --- a/src/graphics/tftSetup.cpp +++ b/src/graphics/tftSetup.cpp @@ -11,6 +11,7 @@ #ifdef ARCH_PORTDUINO #include "PortduinoGlue.h" +#include #endif DeviceScreen *deviceScreen = nullptr; @@ -26,12 +27,10 @@ CallbackObserver endSleepObserver = void tft_task_handler(void *param = nullptr) { while (true) { - if (deviceScreen) { - spiLock->lock(); - deviceScreen->task_handler(); - spiLock->unlock(); - deviceScreen->sleep(); - } + spiLock->lock(); + deviceScreen->task_handler(); + spiLock->unlock(); + deviceScreen->sleep(); } } @@ -116,11 +115,15 @@ void tftSetup(void) } #endif + if (deviceScreen) { #ifdef ARCH_ESP32 - tftSleepObserver.observe(¬ifyLightSleep); - endSleepObserver.observe(¬ifyLightSleepEnd); - xTaskCreatePinnedToCore(tft_task_handler, "tft", 10240, NULL, 1, NULL, 0); + tftSleepObserver.observe(¬ifyLightSleep); + endSleepObserver.observe(¬ifyLightSleepEnd); + xTaskCreatePinnedToCore(tft_task_handler, "tft", 10240, NULL, 1, NULL, 0); +#elif defined(ARCH_PORTDUINO) + std::thread *tft_task = new std::thread([] { tft_task_handler(); }); #endif + } } #endif \ No newline at end of file From 00e2ac33ad082ae27353aece92c40265ecc58424 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 06:24:47 -0500 Subject: [PATCH 118/461] Update platform-native digest to e19f77e (#6701) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/portduino/portduino.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 6af3a7717..890169c28 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/622341c6de8a239704318b10c3dbb00c21a3eab3.zip + https://github.com/meshtastic/platform-native/archive/e19f77e034590669feaaf26214667b76d0821d06.zip framework = arduino build_src_filter = From 124f4daa71a3cf088a9ccc24d44be5ec8a82cb5d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 22:14:38 +0200 Subject: [PATCH 119/461] Update meshtastic-device-ui digest to 33aa689 (#6705) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 527140835..73a9bbe1f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/8113d4ff5a63280834acfeb7584f179cdc6376b6.zip + https://github.com/meshtastic/device-ui/archive/33aa6890f7862d81c2bc1658f43eeea7a8081c6e.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From f9fbc3ff862f479fef29628771109a52d3f6601a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 15:55:13 -0500 Subject: [PATCH 120/461] Update platform-native digest to 622341c (#6702) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/portduino/portduino.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 890169c28..6af3a7717 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/e19f77e034590669feaaf26214667b76d0821d06.zip + https://github.com/meshtastic/platform-native/archive/622341c6de8a239704318b10c3dbb00c21a3eab3.zip framework = arduino build_src_filter = From 5c005aaed5910f56d6e47aa6c35e2ba86653d049 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Thu, 1 May 2025 12:28:05 +1200 Subject: [PATCH 121/461] Restore InkHUD to defaults on factory reset (#6637) * Erase InkHUD settings on factory reset * Documentation * Captialn't Lower case m. Also move the include statement to .cpp, because it doesn't really need to be in the .h --- src/graphics/Screen.cpp | 3 --- src/graphics/niche/FlashData.h | 23 ++++++++++++++++++ src/graphics/niche/InkHUD/Events.cpp | 31 ++++++++++++++++++++++-- src/graphics/niche/InkHUD/Events.h | 8 ++++++ src/graphics/niche/InkHUD/docs/README.md | 4 +++ src/modules/AdminModule.cpp | 4 ++- 6 files changed, 67 insertions(+), 6 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index ad0b94efe..1ee0c0fdd 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -2840,9 +2840,6 @@ int Screen::handleInputEvent(const InputEvent *event) int Screen::handleAdminMessage(const meshtastic_AdminMessage *arg) { - // Note: only selected admin messages notify this observer - // If you wish to handle a new type of message, you should modify AdminModule.cpp first - switch (arg->which_payload_variant) { // Node removed manually (i.e. via app) case meshtastic_AdminMessage_remove_by_nodenum_tag: diff --git a/src/graphics/niche/FlashData.h b/src/graphics/niche/FlashData.h index 8a63c6108..a27c4aea0 100644 --- a/src/graphics/niche/FlashData.h +++ b/src/graphics/niche/FlashData.h @@ -135,6 +135,29 @@ template class FlashData } }; +// Erase contents of the NicheGraphics data directory +inline void clearFlashData() +{ + +#ifdef FSCom + File dir = FSCom.open("/NicheGraphics"); // Open the directory + File file = dir.openNextFile(); // Attempt to open the first file in the directory + + // While the directory still contains files + while (file) { + std::string path = "/NicheGraphics/"; + path += file.name(); + LOG_DEBUG("Erasing %s", path.c_str()); + file.close(); + FSCom.remove(path.c_str()); + + file = dir.openNextFile(); + } +#else + LOG_ERROR("ERROR: Filesystem not implemented\n"); +#endif +} + } // namespace NicheGraphics #endif \ No newline at end of file diff --git a/src/graphics/niche/InkHUD/Events.cpp b/src/graphics/niche/InkHUD/Events.cpp index ddd01b7e1..d0bd35250 100644 --- a/src/graphics/niche/InkHUD/Events.cpp +++ b/src/graphics/niche/InkHUD/Events.cpp @@ -3,11 +3,13 @@ #include "./Events.h" #include "RTC.h" +#include "modules/AdminModule.h" #include "modules/TextMessageModule.h" #include "sleep.h" #include "./Applet.h" #include "./SystemApplet.h" +#include "graphics/niche/FlashData.h" using namespace NicheGraphics; @@ -25,6 +27,9 @@ void InkHUD::Events::begin() deepSleepObserver.observe(¬ifyDeepSleep); rebootObserver.observe(¬ifyReboot); textMessageObserver.observe(textMessageModule); +#if !MESHTASTIC_EXCLUDE_ADMIN + adminMessageObserver.observe(adminModule); +#endif #ifdef ARCH_ESP32 lightSleepObserver.observe(¬ifyLightSleep); #endif @@ -117,8 +122,13 @@ int InkHUD::Events::beforeReboot(void *unused) sa->onReboot(); } - inkhud->persistence->saveSettings(); - inkhud->persistence->saveLatestMessage(); + // Save settings to flash, or erase if factory reset in progress + if (!eraseOnReboot) { + inkhud->persistence->saveSettings(); + inkhud->persistence->saveLatestMessage(); + } else { + NicheGraphics::clearFlashData(); + } // Note: no forceUpdate call here // We don't have any final screen to draw, although LogoApplet::onReboot did already display a "rebooting" screen @@ -171,6 +181,23 @@ int InkHUD::Events::onReceiveTextMessage(const meshtastic_MeshPacket *packet) return 0; // Tell caller to continue notifying other observers. (No reason to abort this event) } +int InkHUD::Events::onAdminMessage(const meshtastic_AdminMessage *message) +{ + switch (message->which_payload_variant) { + // Factory reset + // Two possible messages. One preserves BLE bonds, other wipes. Both should clear InkHUD data. + case meshtastic_AdminMessage_factory_reset_device_tag: + case meshtastic_AdminMessage_factory_reset_config_tag: + eraseOnReboot = true; + break; + + default: + break; + } + + return 0; // Tell caller to continue notifying other observers. (No reason to abort this event) +} + #ifdef ARCH_ESP32 // Callback for lightSleepObserver // Make sure the display is not partway through an update when we begin light sleep diff --git a/src/graphics/niche/InkHUD/Events.h b/src/graphics/niche/InkHUD/Events.h index 6a6e9d7a2..489135ea3 100644 --- a/src/graphics/niche/InkHUD/Events.h +++ b/src/graphics/niche/InkHUD/Events.h @@ -33,6 +33,7 @@ class Events int beforeDeepSleep(void *unused); // Prepare for shutdown int beforeReboot(void *unused); // Prepare for reboot int onReceiveTextMessage(const meshtastic_MeshPacket *packet); // Store most recent text message + int onAdminMessage(const meshtastic_AdminMessage *message); // Handle incoming admin messages #ifdef ARCH_ESP32 int beforeLightSleep(void *unused); // Prepare for light sleep #endif @@ -52,10 +53,17 @@ class Events CallbackObserver textMessageObserver = CallbackObserver(this, &Events::onReceiveTextMessage); + // Get notified of incoming admin messages, and handle any which are relevant to InkHUD + CallbackObserver adminMessageObserver = + CallbackObserver(this, &Events::onAdminMessage); + #ifdef ARCH_ESP32 // Get notified when the system is entering light sleep CallbackObserver lightSleepObserver = CallbackObserver(this, &Events::beforeLightSleep); #endif + + // If set, InkHUD's data will be erased during onReboot + bool eraseOnReboot = false; }; } // namespace NicheGraphics::InkHUD diff --git a/src/graphics/niche/InkHUD/docs/README.md b/src/graphics/niche/InkHUD/docs/README.md index 07fe6c942..c3082add1 100644 --- a/src/graphics/niche/InkHUD/docs/README.md +++ b/src/graphics/niche/InkHUD/docs/README.md @@ -502,6 +502,10 @@ Applets themselves do also listen separately for various events, but for the pur Button input is sometimes handled by a system applet. `InkHUD::Events` determines whether the button should be handled by a specific system applet, or should instead trigger a default behavior +#### Factory Reset + +The Events class handles the admin messages(s) which trigger factory reset. We set `Events::eraseOnReboot = true`, which causes `Events::onReboot` to erase the contents of InkHUD's data directory. We do this because some applets (e.g. ThreadedMessageApplet) save their own data to flash, so if we erased earlier, that data would get re-written during reboot. + --- ### `InkHUD::Applet` diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 88109bc78..650910542 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -284,7 +284,6 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta case meshtastic_AdminMessage_remove_by_nodenum_tag: { LOG_INFO("Client received remove_nodenum command"); nodeDB->removeNodeByNum(r->remove_by_nodenum); - this->notifyObservers(r); // Observed by screen break; } case meshtastic_AdminMessage_set_favorite_node_tag: { @@ -444,6 +443,9 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp); } + // Allow any observers (e.g. the UI) to respond to this event + notifyObservers(r); + return handled; } From a8ab6e82e63e7452bd0f197e1e045573f9cd2145 Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Thu, 1 May 2025 03:50:30 +0200 Subject: [PATCH 122/461] MUI framebuffer support (#6703) Co-authored-by: Ben Meadors --- src/graphics/tftSetup.cpp | 14 ++++++++--- src/platform/portduino/PortduinoGlue.cpp | 2 ++ src/platform/portduino/PortduinoGlue.h | 2 +- variants/portduino/platformio.ini | 31 ++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 4 deletions(-) diff --git a/src/graphics/tftSetup.cpp b/src/graphics/tftSetup.cpp index a8d51bb82..b2e92bdae 100644 --- a/src/graphics/tftSetup.cpp +++ b/src/graphics/tftSetup.cpp @@ -43,10 +43,10 @@ void tftSetup(void) #else if (settingsMap[displayPanel] != no_screen) { DisplayDriverConfig displayConfig; - static char *panels[] = {"NOSCREEN", "X11", "ST7789", "ST7735", "ST7735S", "ST7796", - "ILI9341", "ILI9342", "ILI9486", "ILI9488", "HX8357D"}; + static char *panels[] = {"NOSCREEN", "X11", "FB", "ST7789", "ST7735", "ST7735S", + "ST7796", "ILI9341", "ILI9342", "ILI9486", "ILI9488", "HX8357D"}; static char *touch[] = {"NOTOUCH", "XPT2046", "STMPE610", "GT911", "FT5x06"}; -#ifdef USE_X11 +#if defined(USE_X11) if (settingsMap[displayPanel] == x11) { if (settingsMap[displayWidth] && settingsMap[displayHeight]) displayConfig = DisplayDriverConfig(DisplayDriverConfig::device_t::X11, (uint16_t)settingsMap[displayWidth], @@ -54,6 +54,14 @@ void tftSetup(void) else displayConfig.device(DisplayDriverConfig::device_t::X11); } else +#elif defined(USE_FRAMEBUFFER) + if (settingsMap[displayPanel] == fb) { + if (settingsMap[displayWidth] && settingsMap[displayHeight]) + displayConfig = DisplayDriverConfig(DisplayDriverConfig::device_t::FB, (uint16_t)settingsMap[displayWidth], + (uint16_t)settingsMap[displayHeight]); + else + displayConfig.device(DisplayDriverConfig::device_t::FB); + } else #endif { displayConfig.device(DisplayDriverConfig::device_t::CUSTOM_TFT) diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 6d0972dc3..4b96e662a 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -531,6 +531,8 @@ bool loadConfig(const char *configPath) settingsMap[displayPanel] = hx8357d; else if (yamlConfig["Display"]["Panel"].as("") == "X11") settingsMap[displayPanel] = x11; + else if (yamlConfig["Display"]["Panel"].as("") == "FB") + settingsMap[displayPanel] = fb; settingsMap[displayHeight] = yamlConfig["Display"]["Height"].as(0); settingsMap[displayWidth] = yamlConfig["Display"]["Width"].as(0); settingsMap[displayDC] = yamlConfig["Display"]["DC"].as(-1); diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index f7239cb73..6393d7294 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -102,7 +102,7 @@ enum configNames { available_directory, mac_address }; -enum { no_screen, x11, st7789, st7735, st7735s, st7796, ili9341, ili9342, ili9486, ili9488, hx8357d }; +enum { no_screen, x11, fb, st7789, st7735, st7735s, st7796, ili9341, ili9342, ili9486, ili9488, hx8357d }; enum { no_touchscreen, xpt2046, stmpe610, gt911, ft5x06 }; enum { level_error, level_warn, level_info, level_debug, level_trace }; diff --git a/variants/portduino/platformio.ini b/variants/portduino/platformio.ini index 7a3392eb4..fe89ad6e6 100644 --- a/variants/portduino/platformio.ini +++ b/variants/portduino/platformio.ini @@ -43,6 +43,37 @@ build_src_filter = ${native_base.build_src_filter} - +[env:native-fb] +extends = native_base +build_type = release +lib_deps = + ${native_base.lib_deps} + ${device-ui_base.lib_deps} +board_level = extra +build_flags = ${native_base.build_flags} -Os -ffunction-sections -fdata-sections -Wl,--gc-sections + -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 + -D RAM_SIZE=8192 + -D USE_FRAMEBUFFER=1 + -D LV_COLOR_DEPTH=32 + -D HAS_TFT=1 + -D HAS_SCREEN=0 + -D LV_BUILD_TEST=0 + -D LV_USE_LOG=0 + -D LV_USE_EVDEV=1 + -D LV_LVGL_H_INCLUDE_SIMPLE + -D LV_CONF_INCLUDE_SIMPLE + -D LV_COMP_CONF_INCLUDE_SIMPLE + -D USE_LOG_DEBUG + -D LOG_DEBUG_INC=\"DebugConfiguration.h\" + -D USE_PACKET_API + -D VIEW_320x240 + -D MAP_FULL_REDRAW + !pkg-config --libs libulfius --silence-errors || : + !pkg-config --libs openssl --silence-errors || : +build_src_filter = + ${native_base.build_src_filter} + - + [env:native-tft-debug] extends = native_base build_type = debug From 987623567ae06ce58e996b474d3659dd88495e05 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Thu, 1 May 2025 13:32:20 +0200 Subject: [PATCH 123/461] router: on linux add a mutex around the queue (#6709) UDP reception happens on an other thread, avoid data races and potential data corruption issues. --- src/mesh/Router.cpp | 8 ++++++++ src/mesh/Router.h | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index fef29388e..bb0858c8b 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -64,6 +64,10 @@ Router::Router() : concurrency::OSThread("Router"), fromRadioQueue(MAX_RX_FROMRA */ int32_t Router::runOnce() { +#ifdef ARCH_PORTDUINO + const std::lock_guard lock(queueMutex); +#endif + meshtastic_MeshPacket *mp; while ((mp = fromRadioQueue.dequeuePtr(0)) != NULL) { // printPacket("handle fromRadioQ", mp); @@ -80,6 +84,10 @@ int32_t Router::runOnce() */ void Router::enqueueReceivedMessage(meshtastic_MeshPacket *p) { +#ifdef ARCH_PORTDUINO + const std::lock_guard lock(queueMutex); +#endif + // Try enqueue until successful while (!fromRadioQueue.enqueue(p, 0)) { meshtastic_MeshPacket *old_p; diff --git a/src/mesh/Router.h b/src/mesh/Router.h index 58ca50f3d..f4782d863 100644 --- a/src/mesh/Router.h +++ b/src/mesh/Router.h @@ -8,6 +8,9 @@ #include "PointerQueue.h" #include "RadioInterface.h" #include "concurrency/OSThread.h" +#ifdef ARCH_PORTDUINO +#include +#endif /** * A mesh aware router that supports multiple interfaces. @@ -19,6 +22,12 @@ class Router : protected concurrency::OSThread, protected PacketHistory /// forwarded to the phone. PointerQueue fromRadioQueue; +#ifdef ARCH_PORTDUINO + /// linux calls enqueueReceivedMessage from an other thread when receiving UDP packets, + /// to avoid a data race with LoRa, lock that method. + std::mutex queueMutex; +#endif + protected: RadioInterface *iface = NULL; From 947191a7979bf394986d3c3920e8fd0da472be58 Mon Sep 17 00:00:00 2001 From: Ferdia McKeogh Date: Fri, 2 May 2025 03:11:09 +0100 Subject: [PATCH 124/461] Add PA1010D GPS support (#6691) --- src/gps/GPS.cpp | 15 +++++++++++++++ src/gps/GPS.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 55f62d8ad..e234fdb4a 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -570,6 +570,19 @@ bool GPS::setup() // Switch to Fitness Mode, for running and walking purpose with low speed (<5 m/s) _serial_gps->write("$PMTK886,1*29\r\n"); delay(250); + } else if (gnssModel == GNSS_MODEL_MTK_PA1010D) { + // PA1010D is used in the Pimoroni GPS board. + + // Enable all constellations. + _serial_gps->write("$PMTK353,1,1,1,1,1*2A\r\n"); + // Above command will reset the GPS and takes longer before it will accept new commands + delay(1000); + // Only ask for RMC and GGA (GNRMC and GNGGA) + _serial_gps->write("$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n"); + delay(250); + // Enable SBAS / WAAS + _serial_gps->write("$PMTK301,2*2E\r\n"); + delay(250); } else if (gnssModel == GNSS_MODEL_MTK_PA1616S) { // PA1616S is used in some GPS breakout boards from Adafruit // PA1616S does not have GLONASS capability. PA1616D does, but is not implemented here. @@ -1238,9 +1251,11 @@ GnssModel_t GPS::probe(int serialSpeed) _serial_gps->write("$PMTK514,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*2E\r\n"); delay(20); std::vector mtk = {{"L76B", "Quectel-L76B", GNSS_MODEL_MTK_L76B}, + {"PA1010D", "1010D", GNSS_MODEL_MTK_PA1010D}, {"PA1616S", "1616S", GNSS_MODEL_MTK_PA1616S}, {"LS20031", "MC-1513", GNSS_MODEL_MTK_L76B}, {"L96", "Quectel-L96", GNSS_MODEL_MTK_L76B}}; + PROBE_FAMILY("MTK Family", "$PMTK605*31", mtk, 500); uint8_t cfg_rate[] = {0xB5, 0x62, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/gps/GPS.h b/src/gps/GPS.h index 240cf66d2..9be57017f 100644 --- a/src/gps/GPS.h +++ b/src/gps/GPS.h @@ -27,6 +27,7 @@ typedef enum { GNSS_MODEL_UC6580, GNSS_MODEL_UNKNOWN, GNSS_MODEL_MTK_L76B, + GNSS_MODEL_MTK_PA1010D, GNSS_MODEL_MTK_PA1616S, GNSS_MODEL_AG3335, GNSS_MODEL_AG3352, From baae2503d53c1ce107fb69734ad88e8d8808367d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 2 May 2025 16:24:21 +0800 Subject: [PATCH 125/461] Upgrade trunk to 1.22.15 (#6608) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 60e422312..92cd5b316 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -1,6 +1,6 @@ version: 0.1 cli: - version: 1.22.12 + version: 1.22.15 plugins: sources: - id: trunk @@ -8,18 +8,18 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - renovate@39.243.0 + - renovate@40.0.6 - prettier@3.5.3 - - trufflehog@3.88.23 + - trufflehog@3.88.26 - yamllint@1.37.0 - bandit@1.8.3 - terrascan@1.19.9 - - trivy@0.61.0 + - trivy@0.61.1 - taplo@0.9.3 - - ruff@0.11.5 + - ruff@0.11.7 - isort@6.0.1 - markdownlint@0.44.0 - - oxipng@9.1.4 + - oxipng@9.1.5 - svgo@3.3.2 - actionlint@1.7.7 - flake8@7.2.0 @@ -28,7 +28,7 @@ lint: - shellcheck@0.10.0 - black@25.1.0 - git-diff-check - - gitleaks@8.24.3 + - gitleaks@8.25.1 - clang-format@16.0.3 ignore: - linters: [ALL] From 7da8aea1df3b87c26d9c3f8002e95adeb83a93eb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 May 2025 06:16:53 -0500 Subject: [PATCH 126/461] chore(deps): update meshtastic-device-ui digest to aa38459 (#6706) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 73a9bbe1f..cfa6cd4ef 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/33aa6890f7862d81c2bc1658f43eeea7a8081c6e.zip + https://github.com/meshtastic/device-ui/archive/aa38459f4e4c0bc6e4d1bda52d26393f0fcf1b97.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 10693c4569b4bf33e02255c598693569f0950b18 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Fri, 2 May 2025 23:20:56 +1200 Subject: [PATCH 127/461] Lock SPI bus while in use by InkHUD (#6719) Co-authored-by: Ben Meadors --- .../niche/Drivers/EInk/LCMEN2R13EFC1.cpp | 16 ++++++++++++++-- src/graphics/niche/Drivers/EInk/SSD16XX.cpp | 15 ++++++++++++++- src/graphics/niche/FlashData.h | 17 ++++++++++++++--- src/graphics/niche/InkHUD/MessageStore.cpp | 14 ++++++++++++++ 4 files changed, 56 insertions(+), 6 deletions(-) diff --git a/src/graphics/niche/Drivers/EInk/LCMEN2R13EFC1.cpp b/src/graphics/niche/Drivers/EInk/LCMEN2R13EFC1.cpp index 13a3f452d..fb37544b2 100644 --- a/src/graphics/niche/Drivers/EInk/LCMEN2R13EFC1.cpp +++ b/src/graphics/niche/Drivers/EInk/LCMEN2R13EFC1.cpp @@ -1,9 +1,11 @@ -#include "./LCMEN2R13EFC1.h" - #ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS +#include "./LCMEN2R13EFC1.h" + #include +#include "SPILock.h" + using namespace NicheGraphics::Drivers; // Look up table: fast refresh, common electrode @@ -150,6 +152,9 @@ void LCMEN213EFC1::reset() void LCMEN213EFC1::sendCommand(const uint8_t command) { + // Take firmware's SPI lock + spiLock->lock(); + spi->beginTransaction(spiSettings); digitalWrite(pin_dc, LOW); // DC pin low indicates command digitalWrite(pin_cs, LOW); @@ -157,6 +162,8 @@ void LCMEN213EFC1::sendCommand(const uint8_t command) digitalWrite(pin_cs, HIGH); digitalWrite(pin_dc, HIGH); spi->endTransaction(); + + spiLock->unlock(); } void LCMEN213EFC1::sendData(uint8_t data) @@ -166,6 +173,9 @@ void LCMEN213EFC1::sendData(uint8_t data) void LCMEN213EFC1::sendData(const uint8_t *data, uint32_t size) { + // Take firmware's SPI lock + spiLock->lock(); + spi->beginTransaction(spiSettings); digitalWrite(pin_dc, HIGH); // DC pin HIGH indicates data, instead of command digitalWrite(pin_cs, LOW); @@ -183,6 +193,8 @@ void LCMEN213EFC1::sendData(const uint8_t *data, uint32_t size) digitalWrite(pin_cs, HIGH); digitalWrite(pin_dc, HIGH); spi->endTransaction(); + + spiLock->unlock(); } void LCMEN213EFC1::configFull() diff --git a/src/graphics/niche/Drivers/EInk/SSD16XX.cpp b/src/graphics/niche/Drivers/EInk/SSD16XX.cpp index a2357a80b..d0d030be8 100644 --- a/src/graphics/niche/Drivers/EInk/SSD16XX.cpp +++ b/src/graphics/niche/Drivers/EInk/SSD16XX.cpp @@ -1,6 +1,9 @@ +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + #include "./SSD16XX.h" -#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS +#include "SPILock.h" + using namespace NicheGraphics::Drivers; SSD16XX::SSD16XX(uint16_t width, uint16_t height, UpdateTypes supported, uint8_t bufferOffsetX) @@ -82,6 +85,9 @@ void SSD16XX::sendCommand(const uint8_t command) if (failed) return; + // Take firmware's SPI lock + spiLock->lock(); + spi->beginTransaction(spiSettings); digitalWrite(pin_dc, LOW); // DC pin low indicates command digitalWrite(pin_cs, LOW); @@ -89,6 +95,8 @@ void SSD16XX::sendCommand(const uint8_t command) digitalWrite(pin_cs, HIGH); digitalWrite(pin_dc, HIGH); spi->endTransaction(); + + spiLock->unlock(); } void SSD16XX::sendData(uint8_t data) @@ -103,6 +111,9 @@ void SSD16XX::sendData(const uint8_t *data, uint32_t size) if (failed) return; + // Take firmware's SPI lock + spiLock->lock(); + spi->beginTransaction(spiSettings); digitalWrite(pin_dc, HIGH); // DC pin HIGH indicates data, instead of command digitalWrite(pin_cs, LOW); @@ -119,6 +130,8 @@ void SSD16XX::sendData(const uint8_t *data, uint32_t size) digitalWrite(pin_cs, HIGH); digitalWrite(pin_dc, HIGH); spi->endTransaction(); + + spiLock->unlock(); } void SSD16XX::configFullscreen() diff --git a/src/graphics/niche/FlashData.h b/src/graphics/niche/FlashData.h index a27c4aea0..233d0922e 100644 --- a/src/graphics/niche/FlashData.h +++ b/src/graphics/niche/FlashData.h @@ -13,6 +13,7 @@ Avoid bloating everyone's protobuf code for our one-off UI implementations #include "configuration.h" +#include "SPILock.h" #include "SafeFile.h" namespace NicheGraphics @@ -46,6 +47,9 @@ template class FlashData public: static bool load(T *data, const char *label) { + // Take firmware's SPI lock + concurrency::LockGuard guard(spiLock); + // Set false if we run into issues bool okay = true; @@ -103,14 +107,18 @@ template class FlashData return okay; } - // Save module's custom data (settings?) to flash. Does use protobufs + // Save module's custom data (settings?) to flash. Doesn't use protobufs + // Takes the firmware's SPI lock, in case the files are stored on SD card + // Need to lock and unlock around specific FS methods, as the SafeFile class takes the lock for itself internally. static void save(T *data, const char *label) { // Get a filename based on the label std::string filename = getFilename(label); #ifdef FSCom + spiLock->lock(); FSCom.mkdir("/NicheGraphics"); + spiLock->unlock(); auto f = SafeFile(filename.c_str(), true); // "true": full atomic. Write new data to temp file, then rename. @@ -119,10 +127,10 @@ template class FlashData // Calculate a hash of the data uint32_t hash = getHash(data); + spiLock->lock(); f.write((uint8_t *)data, sizeof(T)); // Write the actual data f.write((uint8_t *)&hash, sizeof(hash)); // Append the hash - - // f.flush(); + spiLock->unlock(); bool writeSucceeded = f.close(); @@ -139,6 +147,9 @@ template class FlashData inline void clearFlashData() { + // Take firmware's SPI lock, in case the files are stored on SD card + concurrency::LockGuard guard(spiLock); + #ifdef FSCom File dir = FSCom.open("/NicheGraphics"); // Open the directory File file = dir.openNextFile(); // Attempt to open the first file in the directory diff --git a/src/graphics/niche/InkHUD/MessageStore.cpp b/src/graphics/niche/InkHUD/MessageStore.cpp index ac6fe1b35..94e0aa661 100644 --- a/src/graphics/niche/InkHUD/MessageStore.cpp +++ b/src/graphics/niche/InkHUD/MessageStore.cpp @@ -22,6 +22,8 @@ InkHUD::MessageStore::MessageStore(std::string label) } // Write the contents of the MessageStore::messages object to flash +// Takes the firmware's SPI lock during FS operations. Implemented for consistency, but only relevant when using SD card. +// Need to lock and unlock around specific FS methods, as the SafeFile class takes the lock for itself internally void InkHUD::MessageStore::saveToFlash() { assert(!filename.empty()); @@ -29,7 +31,9 @@ void InkHUD::MessageStore::saveToFlash() #ifdef FSCom // Make the directory, if doesn't already exist // This is the same directory accessed by NicheGraphics::FlashData + spiLock->lock(); FSCom.mkdir("/NicheGraphics"); + spiLock->unlock(); // Open or create the file // No "full atomic": don't save then rename @@ -37,6 +41,9 @@ void InkHUD::MessageStore::saveToFlash() LOG_INFO("Saving messages in %s", filename.c_str()); + // Take firmware's SPI Lock while writing + spiLock->lock(); + // 1st byte: how many messages will be written to store f.write(messages.size()); @@ -51,6 +58,9 @@ void InkHUD::MessageStore::saveToFlash() LOG_DEBUG("Wrote message %u, length %u, text \"%s\"", (uint32_t)i, min(MAX_MESSAGE_SIZE, m.text.size()), m.text.c_str()); } + // Release firmware's SPI lock, because SafeFile::close needs it + spiLock->unlock(); + bool writeSucceeded = f.close(); if (!writeSucceeded) { @@ -63,6 +73,7 @@ void InkHUD::MessageStore::saveToFlash() // Attempt to load the previous contents of the MessageStore:message deque from flash. // Filename is controlled by the "label" parameter +// Takes the firmware's SPI lock during FS operations. Implemented for consistency, but only relevant when using SD card. void InkHUD::MessageStore::loadFromFlash() { // Hopefully redundant. Initial intention is to only load / save once per boot. @@ -70,6 +81,9 @@ void InkHUD::MessageStore::loadFromFlash() #ifdef FSCom + // Take the firmware's SPI Lock, in case filesystem is on SD card + concurrency::LockGuard guard(spiLock); + // Check that the file *does* actually exist if (!FSCom.exists(filename.c_str())) { LOG_WARN("'%s' not found. Using default values", filename.c_str()); From 152b8b1b0235bc461c6e4451fbcdac0987b8bf90 Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 2 May 2025 13:53:25 -0400 Subject: [PATCH 128/461] Revert "router: on linux add a mutex around the queue (#6709)" (#6726) This reverts commit 987623567ae06ce58e996b474d3659dd88495e05. --- src/mesh/Router.cpp | 8 -------- src/mesh/Router.h | 9 --------- 2 files changed, 17 deletions(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index bb0858c8b..fef29388e 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -64,10 +64,6 @@ Router::Router() : concurrency::OSThread("Router"), fromRadioQueue(MAX_RX_FROMRA */ int32_t Router::runOnce() { -#ifdef ARCH_PORTDUINO - const std::lock_guard lock(queueMutex); -#endif - meshtastic_MeshPacket *mp; while ((mp = fromRadioQueue.dequeuePtr(0)) != NULL) { // printPacket("handle fromRadioQ", mp); @@ -84,10 +80,6 @@ int32_t Router::runOnce() */ void Router::enqueueReceivedMessage(meshtastic_MeshPacket *p) { -#ifdef ARCH_PORTDUINO - const std::lock_guard lock(queueMutex); -#endif - // Try enqueue until successful while (!fromRadioQueue.enqueue(p, 0)) { meshtastic_MeshPacket *old_p; diff --git a/src/mesh/Router.h b/src/mesh/Router.h index f4782d863..58ca50f3d 100644 --- a/src/mesh/Router.h +++ b/src/mesh/Router.h @@ -8,9 +8,6 @@ #include "PointerQueue.h" #include "RadioInterface.h" #include "concurrency/OSThread.h" -#ifdef ARCH_PORTDUINO -#include -#endif /** * A mesh aware router that supports multiple interfaces. @@ -22,12 +19,6 @@ class Router : protected concurrency::OSThread, protected PacketHistory /// forwarded to the phone. PointerQueue fromRadioQueue; -#ifdef ARCH_PORTDUINO - /// linux calls enqueueReceivedMessage from an other thread when receiving UDP packets, - /// to avoid a data race with LoRa, lock that method. - std::mutex queueMutex; -#endif - protected: RadioInterface *iface = NULL; From 9d31d9f43b25b5f2f388546f28ab64d0ce05ce48 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 3 May 2025 22:18:39 +0200 Subject: [PATCH 129/461] chore(deps): update meshtastic-device-ui digest to b9e2ad1 (#6729) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index cfa6cd4ef..fcece8639 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/aa38459f4e4c0bc6e4d1bda52d26393f0fcf1b97.zip + https://github.com/meshtastic/device-ui/archive/b9e2ad1222db9f5a5080248b2f018c250f0efae5.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From d75c91a760afbc1dd9f5192776c284338f52a2e4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 4 May 2025 08:39:59 -0500 Subject: [PATCH 130/461] [create-pull-request] automated change (#6732) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/module_config.pb.h | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/protobufs b/protobufs index 27fac3914..078ac8dfb 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 27fac39141d99fe727a0a1824c5397409b1aea75 +Subproject commit 078ac8dfbe5f7533d7755cbe2ca3d08d86e5af34 diff --git a/src/mesh/generated/meshtastic/module_config.pb.h b/src/mesh/generated/meshtastic/module_config.pb.h index d5031cb89..dbf6ddb2e 100644 --- a/src/mesh/generated/meshtastic/module_config.pb.h +++ b/src/mesh/generated/meshtastic/module_config.pb.h @@ -79,7 +79,10 @@ typedef enum _meshtastic_ModuleConfig_SerialConfig_Serial_Mode { /* NMEA messages specifically tailored for CalTopo */ meshtastic_ModuleConfig_SerialConfig_Serial_Mode_CALTOPO = 5, /* Ecowitt WS85 weather station */ - meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85 = 6 + meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85 = 6, + /* VE.Direct is a serial protocol used by Victron Energy products + https://beta.ivc.no/wiki/index.php/Victron_VE_Direct_DIY_Cable */ + meshtastic_ModuleConfig_SerialConfig_Serial_Mode_VE_DIRECT = 7 } meshtastic_ModuleConfig_SerialConfig_Serial_Mode; /* TODO: REPLACE */ @@ -467,8 +470,8 @@ extern "C" { #define _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Baud)(meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600+1)) #define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN meshtastic_ModuleConfig_SerialConfig_Serial_Mode_DEFAULT -#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MAX meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85 -#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Mode)(meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85+1)) +#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MAX meshtastic_ModuleConfig_SerialConfig_Serial_Mode_VE_DIRECT +#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Mode)(meshtastic_ModuleConfig_SerialConfig_Serial_Mode_VE_DIRECT+1)) #define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE #define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MAX meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK From 8bb1f3e869efbd76abae794630d31352fe4896c8 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 4 May 2025 14:18:48 -0400 Subject: [PATCH 131/461] Update template for event userprefs (#6720) --- userPrefs.jsonc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/userPrefs.jsonc b/userPrefs.jsonc index d522ad272..eb6dc64b6 100644 --- a/userPrefs.jsonc +++ b/userPrefs.jsonc @@ -1,21 +1,21 @@ { // "USERPREFS_BUTTON_PIN": "36", // "USERPREFS_CHANNELS_TO_WRITE": "3", - // "USERPREFS_CHANNEL_0_DOWNLINK_ENABLED": "true", - // "USERPREFS_CHANNEL_0_NAME": "DEFCONnect", + // "USERPREFS_CHANNEL_0_DOWNLINK_ENABLED": "false", + // "USERPREFS_CHANNEL_0_NAME": "REPLACEME", // "USERPREFS_CHANNEL_0_PRECISION": "14", // "USERPREFS_CHANNEL_0_PSK": "{ 0x38, 0x4b, 0xbc, 0xc0, 0x1d, 0xc0, 0x22, 0xd1, 0x81, 0xbf, 0x36, 0xb8, 0x61, 0x21, 0xe1, 0xfb, 0x96, 0xb7, 0x2e, 0x55, 0xbf, 0x74, 0x22, 0x7e, 0x9d, 0x6a, 0xfb, 0x48, 0xd6, 0x4c, 0xb1, 0xa1 }", // "USERPREFS_CHANNEL_0_UPLINK_ENABLED": "true", - // "USERPREFS_CHANNEL_1_DOWNLINK_ENABLED": "true", - // "USERPREFS_CHANNEL_1_NAME": "REPLACEME", + // "USERPREFS_CHANNEL_1_DOWNLINK_ENABLED": "false", + // "USERPREFS_CHANNEL_1_NAME": "Node Build Chat", // "USERPREFS_CHANNEL_1_PRECISION": "14", - // "USERPREFS_CHANNEL_1_PSK": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }", - // "USERPREFS_CHANNEL_1_UPLINK_ENABLED": "true", - // "USERPREFS_CHANNEL_2_DOWNLINK_ENABLED": "true", - // "USERPREFS_CHANNEL_2_NAME": "REPLACEME", + // "USERPREFS_CHANNEL_1_PSK": "{ 0x38, 0x4b, 0xbc, 0xc0, 0x1d, 0xc0, 0x22, 0xd1, 0x81, 0xbf, 0x36, 0xb8, 0x61, 0x21, 0xe1, 0xfb, 0x96, 0xb7, 0x2e, 0x55, 0xbf, 0x74, 0x22, 0x7e, 0x9d, 0x6a, 0xfb, 0x48, 0xd6, 0x4c, 0xb1, 0xa2 }", + // "USERPREFS_CHANNEL_1_UPLINK_ENABLED": "false", + // "USERPREFS_CHANNEL_2_DOWNLINK_ENABLED": "false", + // "USERPREFS_CHANNEL_2_NAME": "Equipment Exchange", // "USERPREFS_CHANNEL_2_PRECISION": "14", - // "USERPREFS_CHANNEL_2_PSK": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }", - // "USERPREFS_CHANNEL_2_UPLINK_ENABLED": "true", + // "USERPREFS_CHANNEL_2_PSK": "{ 0x38, 0x4b, 0xbc, 0xc0, 0x1d, 0xc0, 0x22, 0xd1, 0x81, 0xbf, 0x36, 0xb8, 0x61, 0x21, 0xe1, 0xfb, 0x96, 0xb7, 0x2e, 0x55, 0xbf, 0x74, 0x22, 0x7e, 0x9d, 0x6a, 0xfb, 0x48, 0xd6, 0x4c, 0xb1, 0xa3 }", + // "USERPREFS_CHANNEL_2_UPLINK_ENABLED": "false", // "USERPREFS_CONFIG_GPS_MODE": "meshtastic_Config_PositionConfig_GpsMode_ENABLED", // "USERPREFS_CONFIG_LORA_IGNORE_MQTT": "true", // "USERPREFS_CONFIG_LORA_REGION": "meshtastic_Config_LoRaConfig_RegionCode_US", From 055fdcb7f6f3f8e8c8b8810a072bf5c5a54a6cd7 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 4 May 2025 20:08:39 -0400 Subject: [PATCH 132/461] Renovate: Add changelogs for device-ui, cleanup (#6733) --- arch/esp32/esp32.ini | 2 +- arch/esp32/esp32c6.ini | 4 ++-- arch/nrf52/nrf52.ini | 3 ++- arch/portduino/portduino.ini | 2 +- platformio.ini | 2 +- renovate.json | 8 +++++++- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 3a6dc8323..a6eff7bf9 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -59,7 +59,7 @@ lib_deps = # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto - rweather/Crypto@^0.4.0 + rweather/Crypto@0.4.0 lib_ignore = segger_rtt diff --git a/arch/esp32/esp32c6.ini b/arch/esp32/esp32c6.ini index 7c7e3e923..26b5c0f5b 100644 --- a/arch/esp32/esp32c6.ini +++ b/arch/esp32/esp32c6.ini @@ -1,7 +1,7 @@ [esp32c6_base] extends = esp32_base platform = - # renovate: datasource=git-refs depName=ESP32c6 platform-espressif32 packageName=https://github.com/Jason2866/platform-espressif32 gitBranch=Arduino/IDF5 + # Do not renovate until we have switched to pioarduino tagged builds https://github.com/Jason2866/platform-espressif32/archive/22faa566df8c789000f8136cd8d0aca49617af55.zip build_flags = ${arduino_base.build_flags} @@ -32,7 +32,7 @@ lib_deps = # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto - rweather/Crypto@^0.4.0 + rweather/Crypto@0.4.0 build_src_filter = ${esp32_base.build_src_filter} - diff --git a/arch/nrf52/nrf52.ini b/arch/nrf52/nrf52.ini index d49d8920c..4a77ec4b2 100644 --- a/arch/nrf52/nrf52.ini +++ b/arch/nrf52/nrf52.ini @@ -28,7 +28,8 @@ build_src_filter = lib_deps= ${arduino_base.lib_deps} ${radiolib_base.lib_deps} - rweather/Crypto@^0.4.0 + # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto + rweather/Crypto@0.4.0 lib_ignore = BluetoothOTA diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 6af3a7717..a19c50319 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -25,7 +25,7 @@ lib_deps = ${radiolib_base.lib_deps} ${environmental_base.lib_deps} # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto - rweather/Crypto@^0.4.0 + rweather/Crypto@0.4.0 # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX lovyan03/LovyanGFX@^1.2.0 # renovate: datasource=git-refs depName=libch341-spi-userspace packageName=https://github.com/pine64/libch341-spi-userspace gitBranch=main diff --git a/platformio.ini b/platformio.ini index fcece8639..636ef3c25 100644 --- a/platformio.ini +++ b/platformio.ini @@ -107,7 +107,7 @@ lib_deps = [device-ui_base] lib_deps = - # renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master + # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master https://github.com/meshtastic/device-ui/archive/b9e2ad1222db9f5a5080248b2f018c250f0efae5.zip ; Common libs for environmental measurements in telemetry module diff --git a/renovate.json b/renovate.json index 11d35aff8..e88bfb4e1 100644 --- a/renovate.json +++ b/renovate.json @@ -69,5 +69,11 @@ "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}git{{/if}}" } ], - "packageRules": [] + "packageRules": [ + { + "matchPackageNames": ["meshtastic/device-ui"], + "reviewers": ["mverch67"], + "changelogUrl": "https://github.com/meshtastic/device-ui/compare/{{currentDigest}}...{{newDigest}}" + } + ] } From a32e45f8f2082d2b009298018802bd646383d2a5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 05:16:51 -0500 Subject: [PATCH 133/461] Upgrade trunk (#6737) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 92cd5b316..c55635d9c 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -16,7 +16,7 @@ lint: - terrascan@1.19.9 - trivy@0.61.1 - taplo@0.9.3 - - ruff@0.11.7 + - ruff@0.11.8 - isort@6.0.1 - markdownlint@0.44.0 - oxipng@9.1.5 From 2d6181fca0efabacb56ccc5a01f35df0ccc3cdbd Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 5 May 2025 07:03:36 -0400 Subject: [PATCH 134/461] update bosch bsec2 (#6727) Co-authored-by: Ben Meadors --- platformio.ini | 8 ++++---- variants/Dongle_nRF52840-pca10059-v1/platformio.ini | 1 - variants/ELECROW-ThinkNode-M1/platformio.ini | 2 -- variants/ME25LS01-4Y10TD/platformio.ini | 1 - variants/ME25LS01-4Y10TD_e-ink/platformio.ini | 1 - variants/MS24SF1/platformio.ini | 1 - variants/MakePython_nRF52840_eink/platformio.ini | 1 - variants/MakePython_nRF52840_oled/platformio.ini | 1 - variants/Seeed_Solar_Node/platformio.ini | 1 - variants/canaryone/platformio.ini | 1 - variants/diy/platformio.ini | 3 --- variants/ec_catsniffer/platformio.ini | 1 - variants/feather_diy/platformio.ini | 1 - variants/feather_rp2040_rfm95/platformio.ini | 1 - variants/heltec_mesh_node_t114/platformio.ini | 1 - variants/heltec_mesh_pocket/platformio.ini | 4 ---- variants/meshlink/platformio.ini | 1 - variants/meshlink_eink/platformio.ini | 1 - variants/monteops_hw1/platformio.ini | 1 - variants/nano-g2-ultra/platformio.ini | 1 - variants/nibble_rp2040/platformio.ini | 1 - variants/rak11310/platformio.ini | 1 - variants/rak2560/platformio.ini | 1 - variants/rak4631/platformio.ini | 1 - variants/rak4631_epaper/platformio.ini | 1 - variants/rak4631_epaper_onrxtx/platformio.ini | 1 - variants/rak4631_eth_gw/platformio.ini | 1 - variants/rak_wismeshtap/platformio.ini | 1 - variants/rp2040-lora/platformio.ini | 1 - variants/rpipico-slowclock/platformio.ini | 1 - variants/rpipico/platformio.ini | 1 - variants/rpipico2/platformio.ini | 1 - variants/rpipico2w/platformio.ini | 1 - variants/rpipicow/platformio.ini | 1 - variants/seeed_xiao_nrf52840_kit/platformio.ini | 1 - variants/senselora_rp2040/platformio.ini | 1 - variants/t-echo/platformio.ini | 2 -- variants/tlora_c6/platformio.ini | 1 - variants/tracker-t1000-e/platformio.ini | 1 - variants/wio-sdk-wm1110/platformio.ini | 1 - variants/wio-t1000-s/platformio.ini | 1 - variants/wio-tracker-wm1110/platformio.ini | 1 - variants/xiao_ble/platformio.ini | 1 - 43 files changed, 4 insertions(+), 53 deletions(-) diff --git a/platformio.ini b/platformio.ini index 636ef3c25..ba41b386d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -148,7 +148,7 @@ lib_deps = # renovate: datasource=custom.pio depName=Adafruit MLX90614 packageName=adafruit/library/Adafruit MLX90614 Library adafruit/Adafruit MLX90614 Library@2.1.5 # renovate: datasource=custom.pio depName=Bosch BME68x packageName=boschsensortec/library/BME68x Sensor Library - boschsensortec/BME68x Sensor Library@1.1.40407 + boschsensortec/BME68x Sensor Library@1.2.40408 # renovate: datasource=github-tags depName=INA3221 packageName=KodinLanewave/INA3221 https://github.com/KodinLanewave/INA3221/archive/1.0.1.zip # renovate: datasource=custom.pio depName=QMC5883L Compass packageName=mprograms/library/QMC5883LCompass @@ -185,7 +185,7 @@ lib_deps = sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.0 # renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001 ClosedCube OPT3001@1.1.2 - # renovate: datasource=github-tags depName=Bosch BSEC2 packageName=boschsensortec/Bosch-BSEC2-Library - https://github.com/boschsensortec/Bosch-BSEC2-Library/archive/v1.7.2502.zip + # renovate: datasource=git-refs depName=Bosch BSEC2 packageName=https://github.com/meshtastic/Bosch-BSEC2-Library gitBranch=extra_script + https://github.com/meshtastic/Bosch-BSEC2-Library/archive/e16952dfe5addd4287e1eb8c4f6ecac0fa3dd3de.zip # renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master - https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip \ No newline at end of file + https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip diff --git a/variants/Dongle_nRF52840-pca10059-v1/platformio.ini b/variants/Dongle_nRF52840-pca10059-v1/platformio.ini index 9e87fd237..ad944779d 100644 --- a/variants/Dongle_nRF52840-pca10059-v1/platformio.ini +++ b/variants/Dongle_nRF52840-pca10059-v1/platformio.ini @@ -3,7 +3,6 @@ board_level = extra extends = nrf52840_base board = nordic_pca10059 build_flags = ${nrf52840_base.build_flags} -Ivariants/Dongle_nRF52840-pca10059-v1 -D NORDIC_PCA10059 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DEINK_DISPLAY_MODEL=GxEPD2_420_M01 -DEINK_WIDTH=300 -DEINK_HEIGHT=400 diff --git a/variants/ELECROW-ThinkNode-M1/platformio.ini b/variants/ELECROW-ThinkNode-M1/platformio.ini index 86fbde398..2e9a20dfe 100644 --- a/variants/ELECROW-ThinkNode-M1/platformio.ini +++ b/variants/ELECROW-ThinkNode-M1/platformio.ini @@ -9,7 +9,6 @@ debug_tool = jlink build_flags = ${nrf52840_base.build_flags} -Ivariants/ELECROW-ThinkNode-M1 -DELECROW_ThinkNode_M1 -DGPS_POWER_TOGGLE - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DUSE_EINK -DEINK_DISPLAY_MODEL=GxEPD2_154_D67 -DEINK_WIDTH=200 @@ -39,7 +38,6 @@ build_flags = ${inkhud.build_flags} -I variants/ELECROW-ThinkNode-M1 -D ELECROW_ThinkNode_M1 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" build_src_filter = ${nrf52_base.build_src_filter} ${inkhud.build_src_filter} diff --git a/variants/ME25LS01-4Y10TD/platformio.ini b/variants/ME25LS01-4Y10TD/platformio.ini index bd764e107..b452f0ad8 100644 --- a/variants/ME25LS01-4Y10TD/platformio.ini +++ b/variants/ME25LS01-4Y10TD/platformio.ini @@ -4,7 +4,6 @@ board = me25ls01-4y10td board_level = extra ; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e build_flags = ${nrf52840_base.build_flags} -Ivariants/ME25LS01-4Y10TD -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DME25LS01_4Y10TD - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld build_src_filter = ${nrf52_base.build_src_filter} +<../variants/ME25LS01-4Y10TD> diff --git a/variants/ME25LS01-4Y10TD_e-ink/platformio.ini b/variants/ME25LS01-4Y10TD_e-ink/platformio.ini index fb9bd27d5..f9788a521 100644 --- a/variants/ME25LS01-4Y10TD_e-ink/platformio.ini +++ b/variants/ME25LS01-4Y10TD_e-ink/platformio.ini @@ -4,7 +4,6 @@ board = me25ls01-4y10td board_level = extra ; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e build_flags = ${nrf52840_base.build_flags} -Ivariants/ME25LS01-4Y10TD_e-ink -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DME25LS01_4Y10TD - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DEINK_DISPLAY_MODEL=GxEPD2_420_GDEY042T81 -DEINK_WIDTH=400 diff --git a/variants/MS24SF1/platformio.ini b/variants/MS24SF1/platformio.ini index e109a3270..10e8d2c95 100644 --- a/variants/MS24SF1/platformio.ini +++ b/variants/MS24SF1/platformio.ini @@ -4,7 +4,6 @@ board = ms24sf1 board_level = extra ; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e build_flags = ${nrf52840_base.build_flags} -Ivariants/MS24SF1 -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MS24SF1> diff --git a/variants/MakePython_nRF52840_eink/platformio.ini b/variants/MakePython_nRF52840_eink/platformio.ini index 9e2d5bbf7..ef97172e9 100644 --- a/variants/MakePython_nRF52840_eink/platformio.ini +++ b/variants/MakePython_nRF52840_eink/platformio.ini @@ -3,7 +3,6 @@ board_level = extra extends = nrf52840_base board = nordic_pca10059 build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_eink -D PRIVATE_HW - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -D PIN_EINK_EN -DEINK_DISPLAY_MODEL=GxEPD2_290_T5D -DEINK_WIDTH=296 diff --git a/variants/MakePython_nRF52840_oled/platformio.ini b/variants/MakePython_nRF52840_oled/platformio.ini index 25dd36c08..57b9ecb79 100644 --- a/variants/MakePython_nRF52840_oled/platformio.ini +++ b/variants/MakePython_nRF52840_oled/platformio.ini @@ -3,7 +3,6 @@ board_level = extra extends = nrf52840_base board = nordic_pca10059 build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_oled -D PRIVATE_HW - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MakePython_nRF52840_oled> lib_deps = ${nrf52840_base.lib_deps} diff --git a/variants/Seeed_Solar_Node/platformio.ini b/variants/Seeed_Solar_Node/platformio.ini index 9651d3a77..5ee0a5e8f 100644 --- a/variants/Seeed_Solar_Node/platformio.ini +++ b/variants/Seeed_Solar_Node/platformio.ini @@ -6,7 +6,6 @@ build_flags = ${nrf52840_base.build_flags} -I $PROJECT_DIR/variants/Seeed_Solar_Node -D SEEED_SOLAR_NODE -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld build_src_filter = ${nrf52_base.build_src_filter} +<../variants/Seeed_Solar_Node> lib_deps = diff --git a/variants/canaryone/platformio.ini b/variants/canaryone/platformio.ini index 5e01c3763..ad11305db 100644 --- a/variants/canaryone/platformio.ini +++ b/variants/canaryone/platformio.ini @@ -6,7 +6,6 @@ debug_tool = jlink # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. build_flags = ${nrf52840_base.build_flags} -Ivariants/canaryone - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" build_src_filter = ${nrf52_base.build_src_filter} +<../variants/canaryone> lib_deps = ${nrf52840_base.lib_deps} diff --git a/variants/diy/platformio.ini b/variants/diy/platformio.ini index 825c464a2..d8ceee9cc 100644 --- a/variants/diy/platformio.ini +++ b/variants/diy/platformio.ini @@ -50,7 +50,6 @@ board_level = extra build_flags = ${nrf52840_base.build_flags} -I variants/diy/nrf52_promicro_diy_xtal -D NRF52_PROMICRO_DIY - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/nrf52_promicro_diy_xtal> lib_deps = ${nrf52840_base.lib_deps} @@ -64,7 +63,6 @@ board = promicro-nrf52840 build_flags = ${nrf52840_base.build_flags} -I variants/diy/nrf52_promicro_diy_tcxo -D NRF52_PROMICRO_DIY - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/nrf52_promicro_diy_tcxo> lib_deps = ${nrf52840_base.lib_deps} @@ -77,7 +75,6 @@ extends = nrf52840_base board_level = extra build_flags = ${nrf52840_base.build_flags} -Ivariants/diy/seeed-xiao-nrf52840-wio-sx1262 -D PRIVATE_HW -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/seeed-xiao-nrf52840-wio-sx1262> lib_deps = diff --git a/variants/ec_catsniffer/platformio.ini b/variants/ec_catsniffer/platformio.ini index 9afb44236..6db9abe90 100644 --- a/variants/ec_catsniffer/platformio.ini +++ b/variants/ec_catsniffer/platformio.ini @@ -8,7 +8,6 @@ build_flags = ${rp2040_base.build_flags} -Ivariants/ec_catsniffer -DDEBUG_RP2040_PORT=Serial # -DHW_SPI1_DEVICE - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus" lib_deps = ${rp2040_base.lib_deps} debug_build_flags = ${rp2040_base.build_flags}, -g diff --git a/variants/feather_diy/platformio.ini b/variants/feather_diy/platformio.ini index 82dbb317c..84c582ab0 100644 --- a/variants/feather_diy/platformio.ini +++ b/variants/feather_diy/platformio.ini @@ -3,7 +3,6 @@ extends = nrf52840_base board = adafruit_feather_nrf52840 build_flags = ${nrf52840_base.build_flags} -Ivariants/feather_diy -Dfeather_diy - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" build_src_filter = ${nrf52_base.build_src_filter} +<../variants/feather_diy> lib_deps = ${nrf52840_base.lib_deps} diff --git a/variants/feather_rp2040_rfm95/platformio.ini b/variants/feather_rp2040_rfm95/platformio.ini index a28ad7655..db1eb4f02 100644 --- a/variants/feather_rp2040_rfm95/platformio.ini +++ b/variants/feather_rp2040_rfm95/platformio.ini @@ -9,7 +9,6 @@ build_flags = ${rp2040_base.build_flags} -Ivariants/feather_rp2040_rfm95 -DDEBUG_RP2040_PORT=Serial -DHW_SPI1_DEVICE - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus" lib_deps = ${rp2040_base.lib_deps} debug_build_flags = ${rp2040_base.build_flags} diff --git a/variants/heltec_mesh_node_t114/platformio.ini b/variants/heltec_mesh_node_t114/platformio.ini index 4f83d8516..3ba97bd04 100644 --- a/variants/heltec_mesh_node_t114/platformio.ini +++ b/variants/heltec_mesh_node_t114/platformio.ini @@ -6,7 +6,6 @@ debug_tool = jlink # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_node_t114 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE -DHELTEC_T114 diff --git a/variants/heltec_mesh_pocket/platformio.ini b/variants/heltec_mesh_pocket/platformio.ini index 53f56e973..6632c10fe 100644 --- a/variants/heltec_mesh_pocket/platformio.ini +++ b/variants/heltec_mesh_pocket/platformio.ini @@ -6,7 +6,6 @@ debug_tool = jlink # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_pocket - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DHELTEC_MESH_POCKET -DHELTEC_MESH_POCKET_BATTERY_5000 -DUSE_EINK @@ -36,7 +35,6 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pock build_flags = ${inkhud.build_flags} ${nrf52840_base.build_flags} - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -I variants/heltec_mesh_pocket -D HELTEC_MESH_POCKET -D HELTEC_MESH_POCKET_BATTERY_5000 @@ -53,7 +51,6 @@ debug_tool = jlink # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_pocket - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DHELTEC_MESH_POCKET -DHELTEC_MESH_POCKET_BATTERY_10000 -DUSE_EINK @@ -83,7 +80,6 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pock build_flags = ${inkhud.build_flags} ${nrf52840_base.build_flags} - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -I variants/heltec_mesh_pocket -D HELTEC_MESH_POCKET -D HELTEC_MESH_POCKET_BATTERY_10000 diff --git a/variants/meshlink/platformio.ini b/variants/meshlink/platformio.ini index ec3506b0e..384858576 100644 --- a/variants/meshlink/platformio.ini +++ b/variants/meshlink/platformio.ini @@ -6,7 +6,6 @@ extends = nrf52840_base board = meshlink ;board_check = true build_flags = ${nrf52840_base.build_flags} -I variants/meshlink -D MESHLINK - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -D EINK_DISPLAY_MODEL=GxEPD2_213_B74 -D EINK_WIDTH=250 diff --git a/variants/meshlink_eink/platformio.ini b/variants/meshlink_eink/platformio.ini index f8ee96fc3..550b1e2fc 100644 --- a/variants/meshlink_eink/platformio.ini +++ b/variants/meshlink_eink/platformio.ini @@ -6,7 +6,6 @@ extends = nrf52840_base board = meshlink ;board_check = true build_flags = ${nrf52840_base.build_flags} -I variants/meshlink_eink -D MESHLINK - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -D EINK_DISPLAY_MODEL=GxEPD2_213_B74 -D EINK_WIDTH=250 diff --git a/variants/monteops_hw1/platformio.ini b/variants/monteops_hw1/platformio.ini index 1464ca7e7..82567f614 100644 --- a/variants/monteops_hw1/platformio.ini +++ b/variants/monteops_hw1/platformio.ini @@ -4,7 +4,6 @@ board_level = extra extends = nrf52840_base board = wiscore_rak4631 build_flags = ${nrf52840_base.build_flags} -Ivariants/monteops_hw1 -D MONTEOPS_HW1 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" build_src_filter = ${nrf52_base.build_src_filter} +<../variants/monteops_hw1> + + + lib_deps = ${nrf52840_base.lib_deps} diff --git a/variants/nano-g2-ultra/platformio.ini b/variants/nano-g2-ultra/platformio.ini index 913b38e3f..7da168b47 100644 --- a/variants/nano-g2-ultra/platformio.ini +++ b/variants/nano-g2-ultra/platformio.ini @@ -5,7 +5,6 @@ board = nano-g2-ultra debug_tool = jlink build_flags = ${nrf52840_base.build_flags} -Ivariants/nano-g2-ultra -D NANO_G2_ULTRA - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nano-g2-ultra> lib_deps = ${nrf52840_base.lib_deps} diff --git a/variants/nibble_rp2040/platformio.ini b/variants/nibble_rp2040/platformio.ini index ad987895f..c3a1923c5 100644 --- a/variants/nibble_rp2040/platformio.ini +++ b/variants/nibble_rp2040/platformio.ini @@ -10,7 +10,6 @@ build_flags = ${rp2040_base.build_flags} -Ivariants/nibble_rp2040 -DDEBUG_RP2040_PORT=Serial -DHW_SPI1_DEVICE - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus" lib_deps = ${rp2040_base.lib_deps} debug_build_flags = ${rp2040_base.build_flags}, -g diff --git a/variants/rak11310/platformio.ini b/variants/rak11310/platformio.ini index c87304e61..fd7e842cc 100644 --- a/variants/rak11310/platformio.ini +++ b/variants/rak11310/platformio.ini @@ -9,7 +9,6 @@ build_flags = ${rp2040_base.build_flags} -Ivariants/rak11310 -DDEBUG_RP2040_PORT=Serial -DRV3028_RTC=0x52 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus" build_src_filter = ${rp2040_base.build_src_filter} +<../variants/rak11310> + + + lib_deps = ${rp2040_base.lib_deps} diff --git a/variants/rak2560/platformio.ini b/variants/rak2560/platformio.ini index faed231f1..8a720ce5a 100644 --- a/variants/rak2560/platformio.ini +++ b/variants/rak2560/platformio.ini @@ -4,7 +4,6 @@ extends = nrf52840_base board = wiscore_rak4631 board_check = true build_flags = ${nrf52840_base.build_flags} -Ivariants/rak2560 -D RAK_4631 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DRADIOLIB_EXCLUDE_SX128X=1 -DRADIOLIB_EXCLUDE_SX127X=1 diff --git a/variants/rak4631/platformio.ini b/variants/rak4631/platformio.ini index 1c6bdabcf..f2d68e704 100644 --- a/variants/rak4631/platformio.ini +++ b/variants/rak4631/platformio.ini @@ -4,7 +4,6 @@ extends = nrf52840_base board = wiscore_rak4631 board_check = true build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631 -D RAK_4631 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DEINK_DISPLAY_MODEL=GxEPD2_213_BN -DEINK_WIDTH=250 diff --git a/variants/rak4631_epaper/platformio.ini b/variants/rak4631_epaper/platformio.ini index b851691ed..7c8a299bb 100644 --- a/variants/rak4631_epaper/platformio.ini +++ b/variants/rak4631_epaper/platformio.ini @@ -3,7 +3,6 @@ extends = nrf52840_base board = wiscore_rak4631 build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_epaper -D RAK_4631 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DEINK_DISPLAY_MODEL=GxEPD2_213_BN -DEINK_WIDTH=250 -DEINK_HEIGHT=122 diff --git a/variants/rak4631_epaper_onrxtx/platformio.ini b/variants/rak4631_epaper_onrxtx/platformio.ini index 8612a3f3d..c749fc686 100644 --- a/variants/rak4631_epaper_onrxtx/platformio.ini +++ b/variants/rak4631_epaper_onrxtx/platformio.ini @@ -4,7 +4,6 @@ board_level = extra extends = nrf52840_base board = wiscore_rak4631 build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_epaper -D RAK_4631 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -D PIN_EINK_EN=34 -D EINK_DISPLAY_MODEL=GxEPD2_213_BN -D EINK_WIDTH=250 diff --git a/variants/rak4631_eth_gw/platformio.ini b/variants/rak4631_eth_gw/platformio.ini index e3da21c55..492ca374b 100644 --- a/variants/rak4631_eth_gw/platformio.ini +++ b/variants/rak4631_eth_gw/platformio.ini @@ -4,7 +4,6 @@ extends = nrf52840_base board = wiscore_rak4631 board_check = true build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_eth_gw -D RAK_4631 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DEINK_DISPLAY_MODEL=GxEPD2_213_BN -DEINK_WIDTH=250 diff --git a/variants/rak_wismeshtap/platformio.ini b/variants/rak_wismeshtap/platformio.ini index 78472783e..6ed97c7ad 100644 --- a/variants/rak_wismeshtap/platformio.ini +++ b/variants/rak_wismeshtap/platformio.ini @@ -3,7 +3,6 @@ extends = nrf52840_base board = wiscore_rak4631 build_flags = ${nrf52840_base.build_flags} -Ivariants/rak_wismeshtap -DWISMESH_TAP -DRAK_4631 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DEINK_DISPLAY_MODEL=GxEPD2_213_BN -DEINK_WIDTH=250 diff --git a/variants/rp2040-lora/platformio.ini b/variants/rp2040-lora/platformio.ini index 4c578fb2b..7ac5b2cac 100644 --- a/variants/rp2040-lora/platformio.ini +++ b/variants/rp2040-lora/platformio.ini @@ -9,7 +9,6 @@ build_flags = ${rp2040_base.build_flags} -Ivariants/rp2040-lora -DDEBUG_RP2040_PORT=Serial -DHW_SPI1_DEVICE - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus" lib_deps = ${rp2040_base.lib_deps} debug_build_flags = ${rp2040_base.build_flags}, -g diff --git a/variants/rpipico-slowclock/platformio.ini b/variants/rpipico-slowclock/platformio.ini index c21994249..c56f9e78c 100644 --- a/variants/rpipico-slowclock/platformio.ini +++ b/variants/rpipico-slowclock/platformio.ini @@ -19,7 +19,6 @@ build_flags = ${rp2040_base.build_flags} -Ivariants/rpipico-slowclock -DDEBUG_RP2040_PORT=Serial2 -DHW_SPI1_DEVICE - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus" -g -DNO_USB lib_deps = diff --git a/variants/rpipico/platformio.ini b/variants/rpipico/platformio.ini index 9c62ebcb5..e34cfa43b 100644 --- a/variants/rpipico/platformio.ini +++ b/variants/rpipico/platformio.ini @@ -9,7 +9,6 @@ build_flags = ${rp2040_base.build_flags} -Ivariants/rpipico -DDEBUG_RP2040_PORT=Serial -DHW_SPI1_DEVICE - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus" lib_deps = ${rp2040_base.lib_deps} debug_build_flags = ${rp2040_base.build_flags}, -g diff --git a/variants/rpipico2/platformio.ini b/variants/rpipico2/platformio.ini index de4954ea2..066809a91 100644 --- a/variants/rpipico2/platformio.ini +++ b/variants/rpipico2/platformio.ini @@ -9,7 +9,6 @@ build_flags = ${rp2350_base.build_flags} -Ivariants/rpipico2 -DDEBUG_RP2040_PORT=Serial -DHW_SPI1_DEVICE - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m33" lib_deps = ${rp2350_base.lib_deps} debug_build_flags = ${rp2350_base.build_flags}, -g diff --git a/variants/rpipico2w/platformio.ini b/variants/rpipico2w/platformio.ini index 282be1a42..0fac1e9ce 100644 --- a/variants/rpipico2w/platformio.ini +++ b/variants/rpipico2w/platformio.ini @@ -21,7 +21,6 @@ build_flags = ${rp2350_base.build_flags} -DARDUINO_RASPBERRY_PI_PICO_2W -DARDUINO_ARCH_RP2040 -DHAS_WIFI=1 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m33" -fexceptions # for exception handling in MQTT -DHAS_UDP_MULTICAST=1 build_src_filter = ${rp2350_base.build_src_filter} + diff --git a/variants/rpipicow/platformio.ini b/variants/rpipicow/platformio.ini index 4b714434a..e59944b5d 100644 --- a/variants/rpipicow/platformio.ini +++ b/variants/rpipicow/platformio.ini @@ -8,7 +8,6 @@ build_flags = ${rp2040_base.build_flags} -DRPI_PICO -Ivariants/rpipicow -DHW_SPI1_DEVICE - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus" -fexceptions # for exception handling in MQTT -DHAS_UDP_MULTICAST=1 build_src_filter = ${rp2040_base.build_src_filter} + diff --git a/variants/seeed_xiao_nrf52840_kit/platformio.ini b/variants/seeed_xiao_nrf52840_kit/platformio.ini index 41956249b..0a8bee31c 100644 --- a/variants/seeed_xiao_nrf52840_kit/platformio.ini +++ b/variants/seeed_xiao_nrf52840_kit/platformio.ini @@ -3,7 +3,6 @@ extends = nrf52840_base board = xiao_ble_sense build_flags = ${nrf52840_base.build_flags} -Ivariants/seeed_xiao_nrf52840_kit -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DSEEED_XIAO_NRF52840_KIT - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_xiao_nrf52840_kit> lib_deps = diff --git a/variants/senselora_rp2040/platformio.ini b/variants/senselora_rp2040/platformio.ini index 852ecbbb9..b05fc1f8b 100644 --- a/variants/senselora_rp2040/platformio.ini +++ b/variants/senselora_rp2040/platformio.ini @@ -9,6 +9,5 @@ build_flags = ${rp2040_base.build_flags} -DSENSELORA_RP2040 -Ivariants/senselora_rp2040 -DDEBUG_RP2040_PORT=Serial - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus" lib_deps = ${rp2040_base.lib_deps} \ No newline at end of file diff --git a/variants/t-echo/platformio.ini b/variants/t-echo/platformio.ini index 59fd52ccd..85c3b5799 100644 --- a/variants/t-echo/platformio.ini +++ b/variants/t-echo/platformio.ini @@ -8,7 +8,6 @@ debug_tool = jlink # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. build_flags = ${nrf52840_base.build_flags} -Ivariants/t-echo -DGPS_POWER_TOGGLE - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DEINK_DISPLAY_MODEL=GxEPD2_154_D67 -DEINK_WIDTH=200 -DEINK_HEIGHT=200 @@ -33,7 +32,6 @@ build_flags = ${nrf52840_base.build_flags} ${inkhud.build_flags} -I variants/t-echo - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" build_src_filter = ${nrf52_base.build_src_filter} ${inkhud.build_src_filter} diff --git a/variants/tlora_c6/platformio.ini b/variants/tlora_c6/platformio.ini index d042cd78b..2da10138a 100644 --- a/variants/tlora_c6/platformio.ini +++ b/variants/tlora_c6/platformio.ini @@ -7,4 +7,3 @@ build_flags = -I variants/tlora_c6 -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MODE=1 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/esp32c3" \ No newline at end of file diff --git a/variants/tracker-t1000-e/platformio.ini b/variants/tracker-t1000-e/platformio.ini index 64da61434..b1f11d524 100644 --- a/variants/tracker-t1000-e/platformio.ini +++ b/variants/tracker-t1000-e/platformio.ini @@ -2,7 +2,6 @@ extends = nrf52840_base board = tracker-t1000-e build_flags = ${nrf52840_base.build_flags} -Ivariants/tracker-t1000-e -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DTRACKER_T1000_E - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE -DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL=1 -DMESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 diff --git a/variants/wio-sdk-wm1110/platformio.ini b/variants/wio-sdk-wm1110/platformio.ini index e77455bcf..4e1415678 100644 --- a/variants/wio-sdk-wm1110/platformio.ini +++ b/variants/wio-sdk-wm1110/platformio.ini @@ -10,7 +10,6 @@ extra_scripts = # Remove adafruit USB serial from the build (it is incompatible with using the ch340 serial chip on this board) build_unflags = ${nrf52840_base:build_unflags} -DUSBCON -DUSE_TINYUSB build_flags = ${nrf52840_base.build_flags} -Ivariants/wio-sdk-wm1110 -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DWIO_WM1110 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DCFG_TUD_CDC=0 board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld diff --git a/variants/wio-t1000-s/platformio.ini b/variants/wio-t1000-s/platformio.ini index cb1cf86f7..2eab1e1c5 100644 --- a/variants/wio-t1000-s/platformio.ini +++ b/variants/wio-t1000-s/platformio.ini @@ -4,7 +4,6 @@ extends = nrf52840_base board = wio-t1000-s board_level = extra build_flags = ${nrf52840_base.build_flags} -Ivariants/wio-t1000-s -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DWIO_WM1110 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld build_src_filter = ${nrf52_base.build_src_filter} +<../variants/wio-t1000-s> diff --git a/variants/wio-tracker-wm1110/platformio.ini b/variants/wio-tracker-wm1110/platformio.ini index 614fea588..a6960b435 100644 --- a/variants/wio-tracker-wm1110/platformio.ini +++ b/variants/wio-tracker-wm1110/platformio.ini @@ -3,7 +3,6 @@ extends = nrf52840_base board = wio-tracker-wm1110 build_flags = ${nrf52840_base.build_flags} -Ivariants/wio-tracker-wm1110 -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DWIO_WM1110 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld build_src_filter = ${nrf52_base.build_src_filter} +<../variants/wio-tracker-wm1110> diff --git a/variants/xiao_ble/platformio.ini b/variants/xiao_ble/platformio.ini index 6c47780d5..6fa1dd611 100644 --- a/variants/xiao_ble/platformio.ini +++ b/variants/xiao_ble/platformio.ini @@ -4,7 +4,6 @@ extends = nrf52840_base board = xiao_ble_sense board_level = extra build_flags = ${nrf52840_base.build_flags} -Ivariants/xiao_ble -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -D EBYTE_E22 -DEBYTE_E22_900M30S -DPRIVATE_HW - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld build_src_filter = ${nrf52_base.build_src_filter} +<../variants/xiao_ble> lib_deps = From a2903921cd2cd2d949764318b931d7b5acd7b7dc Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 6 May 2025 12:09:01 -0400 Subject: [PATCH 135/461] Renovate: fix device-ui match (#6748) --- renovate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index e88bfb4e1..3403e7211 100644 --- a/renovate.json +++ b/renovate.json @@ -71,7 +71,7 @@ ], "packageRules": [ { - "matchPackageNames": ["meshtastic/device-ui"], + "matchDepNames": ["meshtastic/device-ui"], "reviewers": ["mverch67"], "changelogUrl": "https://github.com/meshtastic/device-ui/compare/{{currentDigest}}...{{newDigest}}" } From fdbe16f650f12e3b635b444933e4b244808256ee Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 11:09:14 -0500 Subject: [PATCH 136/461] Bump release version (#6743) * automated bumps * Bump org.meshtastic.meshtasticd, fix GHA --------- Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> Co-authored-by: vidplace7 --- .github/workflows/release_channels.yml | 16 ++++++---------- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 8 ++++++-- version.properties | 2 +- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release_channels.yml b/.github/workflows/release_channels.yml index 12d66b9c2..6f216b411 100644 --- a/.github/workflows/release_channels.yml +++ b/.github/workflows/release_channels.yml @@ -63,21 +63,17 @@ jobs: with: python-version: 3.x - - name: Get release version string - run: | - echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - echo "short=$(./bin/buildinfo.py short)" >> $GITHUB_OUTPUT - echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT - id: version - env: - BUILD_LOCATION: local - - name: Bump version.properties run: | # Bump version.properties chmod +x ./bin/bump_version.py ./bin/bump_version.py + - name: Get new release version string + run: | + echo "short=$(./bin/buildinfo.py short)" >> $GITHUB_OUTPUT + id: new_version + - name: Ensure debian deps are installed run: | sudo apt-get update -y --fix-missing @@ -94,7 +90,7 @@ jobs: # Bump org.meshtastic.meshtasticd.metainfo.xml pip install -r bin/bump_metainfo/requirements.txt -q chmod +x ./bin/bump_metainfo/bump_metainfo.py - ./bin/bump_metainfo/bump_metainfo.py --file bin/org.meshtastic.meshtasticd.metainfo.xml "${{ steps.version.outputs.short }}" + ./bin/bump_metainfo/bump_metainfo.py --file bin/org.meshtastic.meshtasticd.metainfo.xml "${{ steps.new_version.outputs.short }}" env: PIP_DISABLE_PIP_VERSION_CHECK: 1 diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 2cfba3523..b98b54dd4 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.8 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.7 diff --git a/debian/changelog b/debian/changelog index 3ec57b805..8fce06c14 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,13 @@ -meshtasticd (2.5.22.0) UNRELEASED; urgency=medium +meshtasticd (2.6.8.0) UNRELEASED; urgency=medium + [ Austin Lane ] * Initial packaging * GitHub Actions Automatic version bump * GitHub Actions Automatic version bump * GitHub Actions Automatic version bump * GitHub Actions Automatic version bump - -- Austin Lane Wed, 05 Feb 2025 01:10:33 +0000 + [ ] + * GitHub Actions Automatic version bump + + -- Tue, 06 May 2025 01:32:49 +0000 diff --git a/version.properties b/version.properties index 5baa63dc2..bedba21b7 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 6 -build = 7 +build = 8 From dd2cf633b0e3e3df348e1aaef91fb009879cfe67 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 11:09:25 -0500 Subject: [PATCH 137/461] Upgrade trunk (#6745) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index c55635d9c..364ed746b 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -10,8 +10,8 @@ lint: enabled: - renovate@40.0.6 - prettier@3.5.3 - - trufflehog@3.88.26 - - yamllint@1.37.0 + - trufflehog@3.88.27 + - yamllint@1.37.1 - bandit@1.8.3 - terrascan@1.19.9 - trivy@0.61.1 From 1e81ebed06ca954a22ea8046732e86a5d3b8844c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 11:14:45 -0500 Subject: [PATCH 138/461] chore(deps): update meshtastic/device-ui digest to 35576e1 (#6747) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index ba41b386d..70a607f2f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/b9e2ad1222db9f5a5080248b2f018c250f0efae5.zip + https://github.com/meshtastic/device-ui/archive/35576e131e250f259878ea81819a90df837d1307.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 867f50ab111cdb07269c123e9ecaf70b1d5fb2e3 Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 6 May 2025 13:03:01 -0400 Subject: [PATCH 139/461] Don't run `test-native` for event firmwares (#6749) --- .github/workflows/main_matrix.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index a9c4cbb52..9b9877e04 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -149,6 +149,7 @@ jobs: secrets: inherit test-native: + if: ${{ !contains(github.ref_name, 'event/') }} uses: ./.github/workflows/test_native.yml docker-deb-amd64: From 62421a83fd602fc2c5fc17ed655de8ce1fe0d224 Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 6 May 2025 13:12:25 -0400 Subject: [PATCH 140/461] Fix EVENT_MODE on mqttless targets (#6750) --- src/mesh/Channels.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/Channels.cpp b/src/mesh/Channels.cpp index 4d061f80f..2ba3499f1 100644 --- a/src/mesh/Channels.cpp +++ b/src/mesh/Channels.cpp @@ -345,7 +345,7 @@ void Channels::setChannel(const meshtastic_Channel &c) bool Channels::anyMqttEnabled() { -#if USERPREFS_EVENT_MODE +#if USERPREFS_EVENT_MODE && !MESHTASTIC_EXCLUDE_MQTT // Don't publish messages on the public MQTT broker if we are in event mode if (mqtt && mqtt->isUsingDefaultServer()) { return false; From 57d6c1fa8512bf18c1a2483d2362857b1705c065 Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 6 May 2025 18:05:22 -0400 Subject: [PATCH 141/461] Fix event templates (names, PSKs) (#6753) --- userPrefs.jsonc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/userPrefs.jsonc b/userPrefs.jsonc index eb6dc64b6..06c4a7eec 100644 --- a/userPrefs.jsonc +++ b/userPrefs.jsonc @@ -7,14 +7,14 @@ // "USERPREFS_CHANNEL_0_PSK": "{ 0x38, 0x4b, 0xbc, 0xc0, 0x1d, 0xc0, 0x22, 0xd1, 0x81, 0xbf, 0x36, 0xb8, 0x61, 0x21, 0xe1, 0xfb, 0x96, 0xb7, 0x2e, 0x55, 0xbf, 0x74, 0x22, 0x7e, 0x9d, 0x6a, 0xfb, 0x48, 0xd6, 0x4c, 0xb1, 0xa1 }", // "USERPREFS_CHANNEL_0_UPLINK_ENABLED": "true", // "USERPREFS_CHANNEL_1_DOWNLINK_ENABLED": "false", - // "USERPREFS_CHANNEL_1_NAME": "Node Build Chat", + // "USERPREFS_CHANNEL_1_NAME": "NodeChat", // "USERPREFS_CHANNEL_1_PRECISION": "14", - // "USERPREFS_CHANNEL_1_PSK": "{ 0x38, 0x4b, 0xbc, 0xc0, 0x1d, 0xc0, 0x22, 0xd1, 0x81, 0xbf, 0x36, 0xb8, 0x61, 0x21, 0xe1, 0xfb, 0x96, 0xb7, 0x2e, 0x55, 0xbf, 0x74, 0x22, 0x7e, 0x9d, 0x6a, 0xfb, 0x48, 0xd6, 0x4c, 0xb1, 0xa2 }", + // "USERPREFS_CHANNEL_1_PSK": "{ 0x4e, 0x22, 0x1d, 0x8b, 0xc3, 0x09, 0x1b, 0xe2, 0x11, 0x9c, 0x89, 0x12, 0xf2, 0x25, 0x19, 0x5d, 0x15, 0x3e, 0x30, 0x7b, 0x86, 0xb6, 0xec, 0xc4, 0x6a, 0xc3, 0x96, 0x5e, 0x9e, 0x10, 0x9d, 0xd5 }", // "USERPREFS_CHANNEL_1_UPLINK_ENABLED": "false", // "USERPREFS_CHANNEL_2_DOWNLINK_ENABLED": "false", - // "USERPREFS_CHANNEL_2_NAME": "Equipment Exchange", + // "USERPREFS_CHANNEL_2_NAME": "YardSale", // "USERPREFS_CHANNEL_2_PRECISION": "14", - // "USERPREFS_CHANNEL_2_PSK": "{ 0x38, 0x4b, 0xbc, 0xc0, 0x1d, 0xc0, 0x22, 0xd1, 0x81, 0xbf, 0x36, 0xb8, 0x61, 0x21, 0xe1, 0xfb, 0x96, 0xb7, 0x2e, 0x55, 0xbf, 0x74, 0x22, 0x7e, 0x9d, 0x6a, 0xfb, 0x48, 0xd6, 0x4c, 0xb1, 0xa3 }", + // "USERPREFS_CHANNEL_2_PSK": "{ 0x15, 0x6f, 0xfe, 0x46, 0xd4, 0x56, 0x63, 0x8a, 0x54, 0x43, 0x13, 0xf2, 0xef, 0x6c, 0x63, 0x89, 0xf0, 0x06, 0x30, 0x52, 0xce, 0x36, 0x5e, 0xb1, 0xe8, 0xbb, 0x86, 0xe6, 0x26, 0x5b, 0x1d, 0x58 }", // "USERPREFS_CHANNEL_2_UPLINK_ENABLED": "false", // "USERPREFS_CONFIG_GPS_MODE": "meshtastic_Config_PositionConfig_GpsMode_ENABLED", // "USERPREFS_CONFIG_LORA_IGNORE_MQTT": "true", From 86217111b26885b2f92235388afc5d41575de94d Mon Sep 17 00:00:00 2001 From: Benjamin Faershtein <119711889+RCGV1@users.noreply.github.com> Date: Wed, 7 May 2025 04:28:18 -0700 Subject: [PATCH 142/461] Update SECURITY.md (#6757) --- SECURITY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index fb4d9005a..5092595e1 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,8 +4,8 @@ | Firmware Version | Supported | | ---------------- | ------------------ | -| 2.5.x | :white_check_mark: | -| <= 2.4.x | :x: | +| 2.6.x | :white_check_mark: | +| <= 2.5.x | :x: | ## Reporting a Vulnerability From 6f256c06f6ce078137bb6b6a06b60714a90964f5 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 May 2025 09:26:10 -0500 Subject: [PATCH 143/461] Fix warning --- src/modules/SerialModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/SerialModule.cpp b/src/modules/SerialModule.cpp index e088b4612..8d280581c 100644 --- a/src/modules/SerialModule.cpp +++ b/src/modules/SerialModule.cpp @@ -513,7 +513,7 @@ void SerialModule::processWXSerial() // Extract the current line char line[meshtastic_Constants_DATA_PAYLOAD_LEN]; memset(line, '\0', sizeof(line)); - if (lineEnd - lineStart < sizeof(line) - 1) { + if ((size_t)(lineEnd - lineStart) < sizeof(line) - 1) { memcpy(line, &serialBytes[lineStart], lineEnd - lineStart); ParsedLine parsed = parseLine(line); From b657ba1abbaad875ba11877cbc35e45ee737c031 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 13:27:44 -0500 Subject: [PATCH 144/461] chore(deps): update sparkfun 9dof imu breakout icm 20948 to v1.3.2 (#6761) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 70a607f2f..706e01b44 100644 --- a/platformio.ini +++ b/platformio.ini @@ -182,7 +182,7 @@ lib_deps = # renovate: datasource=custom.pio depName=SparkFun Qwiic Scale NAU7802 packageName=sparkfun/library/SparkFun Qwiic Scale NAU7802 Arduino Library sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6 # renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library - sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.0 + sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.2 # renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001 ClosedCube OPT3001@1.1.2 # renovate: datasource=git-refs depName=Bosch BSEC2 packageName=https://github.com/meshtastic/Bosch-BSEC2-Library gitBranch=extra_script From 3a6fc668d8d799313fdcf068c5f201fe983f0566 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 7 May 2025 18:38:42 -0500 Subject: [PATCH 145/461] 20948 compass support (#6707) * Add __has_include blocks for sensors * Put BMP and BME back in the right sensors * Split environmental_base to environmental_extra, to compile the working sensor libs for Native * Remove hard-coded checks for ARCH_PORTDUINO * Un-clobber bmx160 * Move BusIO to environmental_extra due to Armv7 compile error * Move to forked BusIO for the moment * Switch to Meshtastic ICM-20948 lib for Portduino support * Use 20948 for compass direction * Compass is more than just RAK4631 * Cleanup for 20948 compass * use Meshtastic branch of 20948 lib * Check for HAS_SCREEN for showing calibration screen * No accelerometerThread on STM32 --- platformio.ini | 8 +-- src/ButtonThread.cpp | 2 +- src/main.cpp | 11 +++- src/main.h | 2 +- src/modules/AdminModule.cpp | 2 +- src/motion/AccelerometerThread.h | 10 +-- src/motion/BMX160Sensor.cpp | 2 +- src/motion/ICM20948Sensor.cpp | 103 +++++++++++++++++++++++++++++++ src/motion/ICM20948Sensor.h | 4 ++ src/motion/MotionSensor.cpp | 2 +- src/motion/MotionSensor.h | 2 +- 11 files changed, 126 insertions(+), 22 deletions(-) diff --git a/platformio.ini b/platformio.ini index 706e01b44..1673dfc78 100644 --- a/platformio.ini +++ b/platformio.ini @@ -161,8 +161,10 @@ lib_deps = robtillaart/INA226@0.6.4 # renovate: datasource=custom.pio depName=SparkFun MAX3010x packageName=sparkfun/library/SparkFun MAX3010x Pulse and Proximity Sensor Library sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library@1.1.2 - -; (not included in native / portduino) + # renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library + sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.2 + + ; (not included in native / portduino) [environmental_extra] lib_deps = # renovate: datasource=custom.pio depName=Adafruit BMP3XX packageName=adafruit/library/Adafruit BMP3XX Library @@ -181,8 +183,6 @@ lib_deps = adafruit/Adafruit SHT4x Library@1.0.5 # renovate: datasource=custom.pio depName=SparkFun Qwiic Scale NAU7802 packageName=sparkfun/library/SparkFun Qwiic Scale NAU7802 Arduino Library sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6 - # renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library - sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.2 # renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001 ClosedCube OPT3001@1.1.2 # renovate: datasource=git-refs depName=Bosch BSEC2 packageName=https://github.com/meshtastic/Bosch-BSEC2-Library gitBranch=extra_script diff --git a/src/ButtonThread.cpp b/src/ButtonThread.cpp index 04200a7df..352885dbe 100644 --- a/src/ButtonThread.cpp +++ b/src/ButtonThread.cpp @@ -255,7 +255,7 @@ int32_t ButtonThread::runOnce() digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW); break; #endif -#if defined(RAK_4631) +#if !MESHTASTIC_EXCLUDE_SCREEN && HAS_SCREEN // 5 clicks: start accelerometer/magenetometer calibration for 30 seconds case 5: if (accelerometerThread) { diff --git a/src/main.cpp b/src/main.cpp index 9ef944e65..452cb3526 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -105,7 +105,7 @@ NRF52Bluetooth *nrf52Bluetooth = nullptr; #include "AmbientLightingThread.h" #include "PowerFSMThread.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C #include "motion/AccelerometerThread.h" AccelerometerThread *accelerometerThread = nullptr; #endif @@ -692,7 +692,7 @@ void setup() } #endif -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) +#if !defined(ARCH_STM32WL) auto acc_info = i2cScanner->firstAccelerometer(); accelerometer_found = acc_info.type != ScanI2C::DeviceType::NONE ? acc_info.address : accelerometer_found; LOG_DEBUG("acc_info = %i", acc_info.type); @@ -807,7 +807,7 @@ void setup() #endif #if !MESHTASTIC_EXCLUDE_I2C -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) +#if !defined(ARCH_STM32WL) if (acc_info.type != ScanI2C::DeviceType::NONE) { accelerometerThread = new AccelerometerThread(acc_info.type); } @@ -1300,7 +1300,12 @@ void setup() LOG_DEBUG("Free heap : %7d bytes", ESP.getFreeHeap()); LOG_DEBUG("Free PSRAM : %7d bytes", ESP.getFreePsram()); #endif +#if !defined(ARCH_STM32WL) + if (accelerometerThread) + accelerometerThread->calibrate(30); +#endif } + #endif uint32_t rebootAtMsec; // If not zero we will reboot at this time (used to reboot shortly after the update completes) uint32_t shutdownAtMsec; // If not zero we will shutdown at this time (used to shutdown from python or mobile client) diff --git a/src/main.h b/src/main.h index c3807cfd5..beeb1f940 100644 --- a/src/main.h +++ b/src/main.h @@ -58,7 +58,7 @@ extern UdpMulticastHandler *udpHandler; // Global Screen singleton. extern graphics::Screen *screen; -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C #include "motion/AccelerometerThread.h" extern AccelerometerThread *accelerometerThread; #endif diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 650910542..0e1e1555b 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -38,7 +38,7 @@ #include "modules/PositionModule.h" #endif -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C #include "motion/AccelerometerThread.h" #endif diff --git a/src/motion/AccelerometerThread.h b/src/motion/AccelerometerThread.h index dd6413d64..02e5b0bd4 100755 --- a/src/motion/AccelerometerThread.h +++ b/src/motion/AccelerometerThread.h @@ -4,7 +4,7 @@ #include "configuration.h" -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C #include "../concurrency/OSThread.h" #ifdef HAS_BMA423 @@ -81,14 +81,6 @@ class AccelerometerThread : public concurrency::OSThread return; } -#ifndef RAK_4631 - if (!config.display.wake_on_tap_or_motion && !config.device.double_tap_as_button_press) { - LOG_DEBUG("AccelerometerThread Disable due to no interested configurations"); - disable(); - return; - } -#endif - switch (device.type) { #ifdef HAS_BMA423 case ScanI2C::DeviceType::BMA423: diff --git a/src/motion/BMX160Sensor.cpp b/src/motion/BMX160Sensor.cpp index 39bc04ea1..a3909ea3a 100755 --- a/src/motion/BMX160Sensor.cpp +++ b/src/motion/BMX160Sensor.cpp @@ -4,7 +4,7 @@ BMX160Sensor::BMX160Sensor(ScanI2C::FoundDevice foundDevice) : MotionSensor::MotionSensor(foundDevice) {} -#if defined(RAK_4631) && !defined(RAK2560) && __has_include() +#if !defined(RAK2560) && __has_include() #if !defined(MESHTASTIC_EXCLUDE_SCREEN) // screen is defined in main.cpp diff --git a/src/motion/ICM20948Sensor.cpp b/src/motion/ICM20948Sensor.cpp index 946390ddb..d03633124 100755 --- a/src/motion/ICM20948Sensor.cpp +++ b/src/motion/ICM20948Sensor.cpp @@ -1,6 +1,11 @@ #include "ICM20948Sensor.h" #if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include() +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) + +// screen is defined in main.cpp +extern graphics::Screen *screen; +#endif // Flag when an interrupt has been detected volatile static bool ICM20948_IRQ = false; @@ -41,6 +46,88 @@ int32_t ICM20948Sensor::runOnce() int32_t ICM20948Sensor::runOnce() { +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN + float magX = 0, magY = 0, magZ = 0; + if (sensor->dataReady()) { + sensor->getAGMT(); + magX = sensor->agmt.mag.axes.x; + magY = sensor->agmt.mag.axes.y; + magZ = sensor->agmt.mag.axes.z; + } + + if (doCalibration) { + + if (!showingScreen) { + powerFSM.trigger(EVENT_PRESS); // keep screen alive during calibration + showingScreen = true; + screen->startAlert((FrameCallback)drawFrameCalibration); + } + + if (magX > highestX) + highestX = magX; + if (magX < lowestX) + lowestX = magX; + if (magY > highestY) + highestY = magY; + if (magY < lowestY) + lowestY = magY; + if (magZ > highestZ) + highestZ = magZ; + if (magZ < lowestZ) + lowestZ = magZ; + + uint32_t now = millis(); + if (now > endCalibrationAt) { + doCalibration = false; + endCalibrationAt = 0; + showingScreen = false; + screen->endAlert(); + } + + // LOG_DEBUG("ICM20948 min_x: %.4f, max_X: %.4f, min_Y: %.4f, max_Y: %.4f, min_Z: %.4f, max_Z: %.4f", lowestX, highestX, + // lowestY, highestY, lowestZ, highestZ); + } + + magX -= (highestX + lowestX) / 2; + magY -= (highestY + lowestY) / 2; + magZ -= (highestZ + lowestZ) / 2; + FusionVector ga, ma; + ga.axis.x = (sensor->agmt.acc.axes.x); + ga.axis.y = -(sensor->agmt.acc.axes.y); + ga.axis.z = -(sensor->agmt.acc.axes.z); + ma.axis.x = magX; + ma.axis.y = magY; + ma.axis.z = magZ; + + // If we're set to one of the inverted positions + if (config.display.compass_orientation > meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270) { + ma = FusionAxesSwap(ma, FusionAxesAlignmentNXNYPZ); + ga = FusionAxesSwap(ga, FusionAxesAlignmentNXNYPZ); + } + + float heading = FusionCompassCalculateHeading(FusionConventionNed, ga, ma); + + switch (config.display.compass_orientation) { + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_0_INVERTED: + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_0: + break; + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_90: + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_90_INVERTED: + heading += 90; + break; + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_180: + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_180_INVERTED: + heading += 180; + break; + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270: + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270_INVERTED: + heading += 270; + break; + } + + screen->setHeading(heading); +#endif + // Wake on motion using polling - this is not as efficient as using hardware interrupt pin (see above) auto status = sensor->setBank(0); if (sensor->status != ICM_20948_Stat_Ok) { @@ -64,6 +151,17 @@ int32_t ICM20948Sensor::runOnce() #endif +void ICM20948Sensor::calibrate(uint16_t forSeconds) +{ +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN + LOG_DEBUG("BMX160 calibration started for %is", forSeconds); + + doCalibration = true; + uint16_t calibrateFor = forSeconds * 1000; // calibrate for seconds provided + endCalibrationAt = millis() + calibrateFor; + screen->setEndCalibration(endCalibrationAt); +#endif +} // ---------------------------------------------------------------------- // ICM20948Singleton // ---------------------------------------------------------------------- @@ -121,6 +219,11 @@ bool ICM20948Singleton::init(ScanI2C::FoundDevice device) return false; } + if (startupMagnetometer(false) != ICM_20948_Stat_Ok) { + LOG_DEBUG("ICM20948 init magnetometer - %s", statusString()); + return false; + } + #ifdef ICM_20948_INT_PIN // Active low diff --git a/src/motion/ICM20948Sensor.h b/src/motion/ICM20948Sensor.h index 8344b0703..27ce4f451 100755 --- a/src/motion/ICM20948Sensor.h +++ b/src/motion/ICM20948Sensor.h @@ -6,6 +6,7 @@ #if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include() +#include "Fusion/Fusion.h" #include // Set the default gyro scale - dps250, dps500, dps1000, dps2000 @@ -80,6 +81,8 @@ class ICM20948Sensor : public MotionSensor { private: ICM20948Singleton *sensor = nullptr; + bool showingScreen = false; + float highestX = 0, lowestX = 0, highestY = 0, lowestY = 0, highestZ = 0, lowestZ = 0; public: explicit ICM20948Sensor(ScanI2C::FoundDevice foundDevice); @@ -89,6 +92,7 @@ class ICM20948Sensor : public MotionSensor // Called each time our sensor gets a chance to run virtual int32_t runOnce() override; + virtual void calibrate(uint16_t forSeconds) override; }; #endif diff --git a/src/motion/MotionSensor.cpp b/src/motion/MotionSensor.cpp index 54a2f883a..56738d355 100755 --- a/src/motion/MotionSensor.cpp +++ b/src/motion/MotionSensor.cpp @@ -31,7 +31,7 @@ ScanI2C::I2CPort MotionSensor::devicePort() return device.address.port; } -#if defined(RAK_4631) & !MESHTASTIC_EXCLUDE_SCREEN +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN void MotionSensor::drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { // int x_offset = display->width() / 2; diff --git a/src/motion/MotionSensor.h b/src/motion/MotionSensor.h index 90080577f..5039f2551 100755 --- a/src/motion/MotionSensor.h +++ b/src/motion/MotionSensor.h @@ -49,7 +49,7 @@ class MotionSensor // Register a button press when a double-tap is detected virtual void buttonPress(); -#if defined(RAK_4631) & !MESHTASTIC_EXCLUDE_SCREEN +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN // draw an OLED frame (currently only used by the RAK4631 BMX160 sensor) static void drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); #endif From ff2a12d5795b7bd3a7d5c66056d5034f7f0d4da2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 8 May 2025 08:32:01 +0800 Subject: [PATCH 146/461] chore(deps): update adafruit bme280 to v2.3.0 (#6708) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 1673dfc78..8ceca3d87 100644 --- a/platformio.ini +++ b/platformio.ini @@ -122,7 +122,7 @@ lib_deps = # renovate: datasource=custom.pio depName=Adafruit BMP085 packageName=adafruit/library/Adafruit BMP085 Library adafruit/Adafruit BMP085 Library@1.2.4 # renovate: datasource=custom.pio depName=Adafruit BME280 packageName=adafruit/library/Adafruit BME280 Library - adafruit/Adafruit BME280 Library@2.2.4 + adafruit/Adafruit BME280 Library@2.3.0 # renovate: datasource=custom.pio depName=Adafruit DPS310 packageName=adafruit/library/Adafruit DPS310 adafruit/Adafruit DPS310@1.1.5 # renovate: datasource=custom.pio depName=Adafruit MCP9808 packageName=adafruit/library/Adafruit MCP9808 Library From ca9bf6b31aca8de3011d52bfe5a7ceebb8635171 Mon Sep 17 00:00:00 2001 From: Tom <116762865+NomDeTom@users.noreply.github.com> Date: Thu, 8 May 2025 03:20:15 +0100 Subject: [PATCH 147/461] Update XIAO_NRF_KIT RXEN Pin definition (#6717) The XIAO NRF kit comes with a hat which has a slightly different pinout than the one supplied with the XIAO S3. At the last update, the RXEN pin was not moved with the rest. --- variants/seeed_xiao_nrf52840_kit/variant.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/variants/seeed_xiao_nrf52840_kit/variant.h b/variants/seeed_xiao_nrf52840_kit/variant.h index 20362cb52..869c3d405 100644 --- a/variants/seeed_xiao_nrf52840_kit/variant.h +++ b/variants/seeed_xiao_nrf52840_kit/variant.h @@ -114,8 +114,8 @@ static const uint8_t SCK = PIN_SPI_SCK; #define SX126X_TXEN RADIOLIB_NC -#define SX126X_RXEN D4 -#define SX126X_DIO2_AS_RF_SWITCH // DIO2 is used to control the RF switch really necessary!!! +#define SX126X_RXEN D5 // This is used to control the RX side of the RF switch +#define SX126X_DIO2_AS_RF_SWITCH // DIO2 is used to control the TX side of the RF switch #define SX126X_DIO3_TCXO_VOLTAGE 1.8 /* From 981ecfdb61bd231c47988bdec9c55e28bdaeef79 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 May 2025 21:20:32 -0500 Subject: [PATCH 148/461] Add client notification before role based power saving (sleep) (#6759) * Add client notification before role based power saving (sleep) * Unsigned --- src/modules/PositionModule.cpp | 11 +++++++++-- src/modules/Telemetry/EnvironmentTelemetry.cpp | 12 ++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index acbc3143d..0b1bdcc46 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -370,9 +370,16 @@ void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t cha if (IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_TRACKER, meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) && config.power.is_power_saving) { - LOG_DEBUG("Start next execution in 5s, then sleep"); + meshtastic_ClientNotification *notification = clientNotificationPool.allocZeroed(); + notification->level = meshtastic_LogRecord_Level_INFO; + notification->time = getValidTime(RTCQualityFromNet); + sprintf(notification->message, "Sending position and sleeping for %us interval in a moment", + Default::getConfiguredOrDefaultMs(config.position.position_broadcast_secs, default_broadcast_interval_secs) / + 1000U); + service->sendClientNotification(notification); sleepOnNextExecution = true; - setIntervalFromNow(5000); + LOG_DEBUG("Start next execution in 5s, then sleep"); + setIntervalFromNow(FIVE_SECONDS_MS); } } diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index 32c660bbf..56f9d7433 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -675,9 +675,17 @@ bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly) service->sendToMesh(p, RX_SRC_LOCAL, true); if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR && config.power.is_power_saving) { - LOG_DEBUG("Start next execution in 5s, then sleep"); + meshtastic_ClientNotification *notification = clientNotificationPool.allocZeroed(); + notification->level = meshtastic_LogRecord_Level_INFO; + notification->time = getValidTime(RTCQualityFromNet); + sprintf(notification->message, "Sending telemetry and sleeping for %us interval in a moment", + Default::getConfiguredOrDefaultMs(moduleConfig.telemetry.environment_update_interval, + default_telemetry_broadcast_interval_secs) / + 1000U); + service->sendClientNotification(notification); sleepOnNextExecution = true; - setIntervalFromNow(5000); + LOG_DEBUG("Start next execution in 5s, then sleep"); + setIntervalFromNow(FIVE_SECONDS_MS); } } return true; From 3aee4bfc6bf2a67fe2c18664dcae2ee7d4fafb21 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 10 May 2025 19:01:03 +0800 Subject: [PATCH 149/461] Upgrade trunk (#6758) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 364ed746b..ca38c978a 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -10,11 +10,11 @@ lint: enabled: - renovate@40.0.6 - prettier@3.5.3 - - trufflehog@3.88.27 + - trufflehog@3.88.28 - yamllint@1.37.1 - bandit@1.8.3 - terrascan@1.19.9 - - trivy@0.61.1 + - trivy@0.62.1 - taplo@0.9.3 - ruff@0.11.8 - isort@6.0.1 From c2a38357f174f301f344f960ed43a9d6f368b537 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 10 May 2025 14:54:58 +0200 Subject: [PATCH 150/461] chore(deps): update meshtastic/device-ui digest to 09b1780 (#6782) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 8ceca3d87..042853ec6 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/35576e131e250f259878ea81819a90df837d1307.zip + https://github.com/meshtastic/device-ui/archive/09b1780c8f944cffbc18a8ec5713cdfe03278503.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 23fe093a6556a9be577fedfa63ec7411711283dc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 10 May 2025 11:49:01 -0400 Subject: [PATCH 151/461] chore(config): migrate renovate config (#6784) * chore(config): migrate config renovate.json * Prettier: Ignore renovate --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: vidplace7 --- .trunk/configs/.prettierignore | 1 + renovate.json | 44 ++++++++++++++++++++++++---------- 2 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 .trunk/configs/.prettierignore diff --git a/.trunk/configs/.prettierignore b/.trunk/configs/.prettierignore new file mode 100644 index 000000000..a63a557a4 --- /dev/null +++ b/.trunk/configs/.prettierignore @@ -0,0 +1 @@ +renovate.json diff --git a/renovate.json b/renovate.json index 3403e7211..e90462cc3 100644 --- a/renovate.json +++ b/renovate.json @@ -9,15 +9,21 @@ "workarounds:all" ], "forkProcessing": "enabled", - "ignoreDeps": ["protobufs"], + "ignoreDeps": [ + "protobufs" + ], "git-submodules": { "enabled": true }, "pip_requirements": { - "fileMatch": ["bin/bump_metainfo/requirements.txt"] + "managerFilePatterns": [ + "/bin/bump_metainfo/requirements.txt/" + ] }, "commitMessageTopic": "{{depName}}", - "labels": ["dependencies"], + "labels": [ + "dependencies" + ], "customDatasources": { "pio": { "description": "PlatformIO Registry", @@ -32,8 +38,12 @@ { "customType": "regex", "description": "Match meshtastic/web version", - "fileMatch": ["bin/web.version"], - "matchStrings": ["(?.+)$"], + "managerFilePatterns": [ + "/bin/web.version/" + ], + "matchStrings": [ + "(?.+)$" + ], "datasourceTemplate": "github-releases", "depNameTemplate": "meshtastic/web", "versioningTemplate": "semver-coerced" @@ -41,7 +51,9 @@ { "customType": "regex", "description": "Match normal PIO dependencies", - "fileMatch": [".*\\.ini$"], + "managerFilePatterns": [ + "/.*\\.ini$/" + ], "matchStrings": [ "# renovate: datasource=(?.*?)(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\s+?.+?@(?.+?)\\s" ], @@ -50,9 +62,11 @@ { "customType": "regex", "description": "Match PIO zipped dependencies with github tag ref", - "fileMatch": [".*\\.ini$"], + "managerFilePatterns": [ + "/.*\\.ini$/" + ], "matchStrings": [ - "# renovate: datasource=github-tags(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\s+?https:\/\/.+?archive\/(?.+?).zip\\s" + "# renovate: datasource=github-tags(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\s+?https://.+?archive/(?.+?).zip\\s" ], "datasourceTemplate": "github-tags", "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver-coerced{{/if}}" @@ -60,9 +74,11 @@ { "customType": "regex", "description": "Match PIO zipped dependencies with git commit ref", - "fileMatch": [".*\\.ini$"], + "managerFilePatterns": [ + "/.*\\.ini$/" + ], "matchStrings": [ - "# renovate: datasource=git-refs(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\sgitBranch=(?.+?)\\s+?https:\/\/.+?archive\/(?.+?).zip\\s" + "# renovate: datasource=git-refs(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\sgitBranch=(?.+?)\\s+?https://.+?archive/(?.+?).zip\\s" ], "datasourceTemplate": "git-refs", "currentValueTemplate": "{{{gitBranch}}}", @@ -71,8 +87,12 @@ ], "packageRules": [ { - "matchDepNames": ["meshtastic/device-ui"], - "reviewers": ["mverch67"], + "matchDepNames": [ + "meshtastic/device-ui" + ], + "reviewers": [ + "mverch67" + ], "changelogUrl": "https://github.com/meshtastic/device-ui/compare/{{currentDigest}}...{{newDigest}}" } ] From 7c9296b0f43348204f8f1356e8a9fb8bec57b12c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 10 May 2025 18:48:39 +0200 Subject: [PATCH 152/461] chore(deps): update meshtastic/device-ui digest to 027f5a5 (#6783) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 042853ec6..427ff1702 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/09b1780c8f944cffbc18a8ec5713cdfe03278503.zip + https://github.com/meshtastic/device-ui/archive/027f5a5bace46e75a8208239b20655140dc186df.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From b17bb49a6333facf9dee585ac3dd914c13cfcf8f Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 10 May 2025 17:21:23 -0400 Subject: [PATCH 153/461] Actions: Fix end to end tests (#6776) --- .github/workflows/tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0f0ee0af4..28b6a40a5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,10 @@ on: - cron: 0 0 * * * # Run every day at midnight workflow_dispatch: {} -permissions: read-all +permissions: + contents: read + actions: read + checks: write jobs: native-tests: @@ -44,7 +47,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 22 - name: Setup pnpm uses: pnpm/action-setup@v4 From b208e1924fb82c9ab9eb273a8679b0edfdc11821 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 11 May 2025 00:59:38 +0200 Subject: [PATCH 154/461] chore(deps): update meshtastic/device-ui digest to 7dee10a (#6786) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 427ff1702..b78ecdc1a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/027f5a5bace46e75a8208239b20655140dc186df.zip + https://github.com/meshtastic/device-ui/archive/7dee10ad31a0c6ea04880cba399e240be743d752.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 62e1974d092453d481dfa2546bcb34180707a029 Mon Sep 17 00:00:00 2001 From: Tom <116762865+NomDeTom@users.noreply.github.com> Date: Sun, 11 May 2025 10:17:37 +0100 Subject: [PATCH 155/461] Add clarifying note about AHT20 also being included with AHT10 library (#6787) * Update AHT10.h Add clarifying note about AHT20 also being included * Update AHT10.cpp Add clarifying note about AHT20 also being included --- src/modules/Telemetry/Sensor/AHT10.cpp | 6 +++++- src/modules/Telemetry/Sensor/AHT10.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/Telemetry/Sensor/AHT10.cpp b/src/modules/Telemetry/Sensor/AHT10.cpp index 096a131b9..35934533b 100644 --- a/src/modules/Telemetry/Sensor/AHT10.cpp +++ b/src/modules/Telemetry/Sensor/AHT10.cpp @@ -1,3 +1,7 @@ +/* + * Worth noting that both the AHT10 and AHT20 are supported without alteration. + */ + #include "configuration.h" #if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() @@ -41,4 +45,4 @@ bool AHT10Sensor::getMetrics(meshtastic_Telemetry *measurement) return true; } -#endif \ No newline at end of file +#endif diff --git a/src/modules/Telemetry/Sensor/AHT10.h b/src/modules/Telemetry/Sensor/AHT10.h index b2f0d8ae5..a6fa19952 100644 --- a/src/modules/Telemetry/Sensor/AHT10.h +++ b/src/modules/Telemetry/Sensor/AHT10.h @@ -1,3 +1,7 @@ +/* + * Worth noting that both the AHT10 and AHT20 are supported without alteration. + */ + #include "configuration.h" #if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() @@ -20,4 +24,4 @@ class AHT10Sensor : public TelemetrySensor virtual bool getMetrics(meshtastic_Telemetry *measurement) override; }; -#endif \ No newline at end of file +#endif From 2a06b058fdd7dca02667635ba9415030b675b9cc Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 11 May 2025 15:18:53 -0500 Subject: [PATCH 156/461] Only send nodes on want_config of 69421 (#6792) --- src/mesh/PhoneAPI.cpp | 28 +++++++++++++++++++++++----- src/mesh/PhoneAPI.h | 3 ++- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 0e18b8ab1..db01e95f3 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -54,7 +54,13 @@ void PhoneAPI::handleStartConfig() } // even if we were already connected - restart our state machine - state = STATE_SEND_MY_INFO; + if (config_nonce == SPECIAL_NONCE_ONLY_NODES) { + // If client only wants node info, jump directly to sending nodes + state = STATE_SEND_OWN_NODEINFO; + LOG_INFO("Client only wants node info, skipping other config"); + } else { + state = STATE_SEND_MY_INFO; + } pauseBluetoothLogging = true; spiLock->lock(); filesManifest = getFiles("/", 10); @@ -224,7 +230,12 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) // Should allow us to resume sending NodeInfo in STATE_SEND_OTHER_NODEINFOS nodeInfoForPhone.num = 0; } - state = STATE_SEND_METADATA; + if (config_nonce == SPECIAL_NONCE_ONLY_NODES) { + // If client only wants node info, jump directly to sending nodes + state = STATE_SEND_OTHER_NODEINFOS; + } else { + state = STATE_SEND_METADATA; + } break; } @@ -388,8 +399,14 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) config_state++; // Advance when we have sent all of our ModuleConfig objects if (config_state > (_meshtastic_AdminMessage_ModuleConfigType_MAX + 1)) { - // Clients sending special nonce don't want to see other nodeinfos - state = config_nonce == SPECIAL_NONCE ? STATE_SEND_FILEMANIFEST : STATE_SEND_OTHER_NODEINFOS; + // Handle special nonce behaviors: + // - SPECIAL_NONCE_ONLY_CONFIG: Skip node info, go directly to file manifest + // - SPECIAL_NONCE_ONLY_NODES: After sending nodes, skip to complete + if (config_nonce == SPECIAL_NONCE_ONLY_CONFIG) { + state = STATE_SEND_FILEMANIFEST; + } else { + state = STATE_SEND_OTHER_NODEINFOS; + } config_state = 0; } break; @@ -415,7 +432,8 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) case STATE_SEND_FILEMANIFEST: { LOG_DEBUG("FromRadio=STATE_SEND_FILEMANIFEST"); // last element - if (config_state == filesManifest.size()) { // also handles an empty filesManifest + if (config_state == filesManifest.size() || + config_nonce == SPECIAL_NONCE_ONLY_NODES) { // also handles an empty filesManifest config_state = 0; filesManifest.clear(); // Skip to complete packet diff --git a/src/mesh/PhoneAPI.h b/src/mesh/PhoneAPI.h index 681b244c8..0d7772d17 100644 --- a/src/mesh/PhoneAPI.h +++ b/src/mesh/PhoneAPI.h @@ -18,7 +18,8 @@ #error "meshtastic_ToRadio_size is too large for our BLE packets" #endif -#define SPECIAL_NONCE 69420 +#define SPECIAL_NONCE_ONLY_CONFIG 69420 +#define SPECIAL_NONCE_ONLY_NODES 69421 // ( ͡° ͜ʖ ͡°) /** * Provides our protobuf based API which phone/PC clients can use to talk to our device From b9fcd9da233ad5b7438f2b836b612eba15b149ef Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 11 May 2025 18:08:29 -0500 Subject: [PATCH 157/461] Add some no-nonsense coercion for self-reporting node values (#6793) * Add some no-nonsense coercion for self-reporting node values * Update src/mesh/PhoneAPI.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/mesh/PhoneAPI.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index db01e95f3..e2acd8463 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -565,9 +565,12 @@ bool PhoneAPI::available() auto nextNode = nodeDB->readNextMeshNode(readIndex); if (nextNode) { nodeInfoForPhone = TypeConversions::ConvertToNodeInfo(nextNode); - nodeInfoForPhone.hops_away = nodeInfoForPhone.num == nodeDB->getNodeNum() ? 0 : nodeInfoForPhone.hops_away; - nodeInfoForPhone.is_favorite = - nodeInfoForPhone.is_favorite || nodeInfoForPhone.num == nodeDB->getNodeNum(); // Our node is always a favorite + bool isUs = nodeInfoForPhone.num == nodeDB->getNodeNum(); + nodeInfoForPhone.hops_away = isUs ? 0 : nodeInfoForPhone.hops_away; + nodeInfoForPhone.last_heard = isUs ? getValidTime(RTCQualityFromNet) : nodeInfoForPhone.last_heard; + nodeInfoForPhone.snr = isUs ? 0 : nodeInfoForPhone.snr; + nodeInfoForPhone.via_mqtt = isUs ? false : nodeInfoForPhone.via_mqtt; + nodeInfoForPhone.is_favorite = nodeInfoForPhone.is_favorite || isUs; // Our node is always a favorite } } return true; // Always say we have something, because we might need to advance our state machine From e1417cff2e8796b3c8c7af5988b7955ae59d9054 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 06:59:26 -0500 Subject: [PATCH 158/461] [create-pull-request] automated change (#6804) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/admin.pb.cpp | 3 +++ src/mesh/generated/meshtastic/admin.pb.h | 28 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/protobufs b/protobufs index 078ac8dfb..816595c8b 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 078ac8dfbe5f7533d7755cbe2ca3d08d86e5af34 +Subproject commit 816595c8bbdfc3b4388e11348ccd043294d58705 diff --git a/src/mesh/generated/meshtastic/admin.pb.cpp b/src/mesh/generated/meshtastic/admin.pb.cpp index 2e527f669..9bf40870f 100644 --- a/src/mesh/generated/meshtastic/admin.pb.cpp +++ b/src/mesh/generated/meshtastic/admin.pb.cpp @@ -15,6 +15,9 @@ PB_BIND(meshtastic_HamParameters, meshtastic_HamParameters, AUTO) PB_BIND(meshtastic_NodeRemoteHardwarePinsResponse, meshtastic_NodeRemoteHardwarePinsResponse, 2) +PB_BIND(meshtastic_SharedContact, meshtastic_SharedContact, AUTO) + + diff --git a/src/mesh/generated/meshtastic/admin.pb.h b/src/mesh/generated/meshtastic/admin.pb.h index efe60f493..09499b075 100644 --- a/src/mesh/generated/meshtastic/admin.pb.h +++ b/src/mesh/generated/meshtastic/admin.pb.h @@ -99,6 +99,14 @@ typedef struct _meshtastic_NodeRemoteHardwarePinsResponse { meshtastic_NodeRemoteHardwarePin node_remote_hardware_pins[16]; } meshtastic_NodeRemoteHardwarePinsResponse; +typedef struct _meshtastic_SharedContact { + /* The node number of the contact */ + uint32_t node_num; + /* The User of the contact */ + bool has_user; + meshtastic_User user; +} meshtastic_SharedContact; + typedef PB_BYTES_ARRAY_T(8) meshtastic_AdminMessage_session_passkey_t; /* This message is handled by the Admin module and is responsible for all settings/channel read/write operations. This message is used to do settings operations to both remote AND local nodes. @@ -202,6 +210,8 @@ typedef struct _meshtastic_AdminMessage { bool begin_edit_settings; /* Commits an open transaction for any edits made to config, module config, owner, and channel settings */ bool commit_edit_settings; + /* Add a contact (User) to the nodedb */ + meshtastic_SharedContact add_contact; /* Tell the node to factory reset config everything; all device state and configuration will be returned to factory defaults and BLE bonds will be cleared. */ int32_t factory_reset_device; /* Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot) @@ -252,13 +262,16 @@ extern "C" { + /* Initializer values for message structs */ #define meshtastic_AdminMessage_init_default {0, {0}, {0, {0}}} #define meshtastic_HamParameters_init_default {"", 0, 0, ""} #define meshtastic_NodeRemoteHardwarePinsResponse_init_default {0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}} +#define meshtastic_SharedContact_init_default {0, false, meshtastic_User_init_default} #define meshtastic_AdminMessage_init_zero {0, {0}, {0, {0}}} #define meshtastic_HamParameters_init_zero {"", 0, 0, ""} #define meshtastic_NodeRemoteHardwarePinsResponse_init_zero {0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}} +#define meshtastic_SharedContact_init_zero {0, false, meshtastic_User_init_zero} /* Field tags (for use in manual encoding/decoding) */ #define meshtastic_HamParameters_call_sign_tag 1 @@ -266,6 +279,8 @@ extern "C" { #define meshtastic_HamParameters_frequency_tag 3 #define meshtastic_HamParameters_short_name_tag 4 #define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_tag 1 +#define meshtastic_SharedContact_node_num_tag 1 +#define meshtastic_SharedContact_user_tag 2 #define meshtastic_AdminMessage_get_channel_request_tag 1 #define meshtastic_AdminMessage_get_channel_response_tag 2 #define meshtastic_AdminMessage_get_owner_request_tag 3 @@ -310,6 +325,7 @@ extern "C" { #define meshtastic_AdminMessage_remove_ignored_node_tag 48 #define meshtastic_AdminMessage_begin_edit_settings_tag 64 #define meshtastic_AdminMessage_commit_edit_settings_tag 65 +#define meshtastic_AdminMessage_add_contact_tag 66 #define meshtastic_AdminMessage_factory_reset_device_tag 94 #define meshtastic_AdminMessage_reboot_ota_seconds_tag 95 #define meshtastic_AdminMessage_exit_simulator_tag 96 @@ -365,6 +381,7 @@ X(a, STATIC, ONEOF, UINT32, (payload_variant,set_ignored_node,set_ignored X(a, STATIC, ONEOF, UINT32, (payload_variant,remove_ignored_node,remove_ignored_node), 48) \ X(a, STATIC, ONEOF, BOOL, (payload_variant,begin_edit_settings,begin_edit_settings), 64) \ X(a, STATIC, ONEOF, BOOL, (payload_variant,commit_edit_settings,commit_edit_settings), 65) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,add_contact,add_contact), 66) \ X(a, STATIC, ONEOF, INT32, (payload_variant,factory_reset_device,factory_reset_device), 94) \ X(a, STATIC, ONEOF, INT32, (payload_variant,reboot_ota_seconds,reboot_ota_seconds), 95) \ X(a, STATIC, ONEOF, BOOL, (payload_variant,exit_simulator,exit_simulator), 96) \ @@ -390,6 +407,7 @@ X(a, STATIC, SINGULAR, BYTES, session_passkey, 101) #define meshtastic_AdminMessage_payload_variant_set_fixed_position_MSGTYPE meshtastic_Position #define meshtastic_AdminMessage_payload_variant_get_ui_config_response_MSGTYPE meshtastic_DeviceUIConfig #define meshtastic_AdminMessage_payload_variant_store_ui_config_MSGTYPE meshtastic_DeviceUIConfig +#define meshtastic_AdminMessage_payload_variant_add_contact_MSGTYPE meshtastic_SharedContact #define meshtastic_HamParameters_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, STRING, call_sign, 1) \ @@ -405,20 +423,30 @@ X(a, STATIC, REPEATED, MESSAGE, node_remote_hardware_pins, 1) #define meshtastic_NodeRemoteHardwarePinsResponse_DEFAULT NULL #define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_MSGTYPE meshtastic_NodeRemoteHardwarePin +#define meshtastic_SharedContact_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, node_num, 1) \ +X(a, STATIC, OPTIONAL, MESSAGE, user, 2) +#define meshtastic_SharedContact_CALLBACK NULL +#define meshtastic_SharedContact_DEFAULT NULL +#define meshtastic_SharedContact_user_MSGTYPE meshtastic_User + extern const pb_msgdesc_t meshtastic_AdminMessage_msg; extern const pb_msgdesc_t meshtastic_HamParameters_msg; extern const pb_msgdesc_t meshtastic_NodeRemoteHardwarePinsResponse_msg; +extern const pb_msgdesc_t meshtastic_SharedContact_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ #define meshtastic_AdminMessage_fields &meshtastic_AdminMessage_msg #define meshtastic_HamParameters_fields &meshtastic_HamParameters_msg #define meshtastic_NodeRemoteHardwarePinsResponse_fields &meshtastic_NodeRemoteHardwarePinsResponse_msg +#define meshtastic_SharedContact_fields &meshtastic_SharedContact_msg /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_ADMIN_PB_H_MAX_SIZE meshtastic_AdminMessage_size #define meshtastic_AdminMessage_size 511 #define meshtastic_HamParameters_size 31 #define meshtastic_NodeRemoteHardwarePinsResponse_size 496 +#define meshtastic_SharedContact_size 121 #ifdef __cplusplus } /* extern "C" */ From cc66f7c79ba976dc780cd2082258c6c5c4126fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 13 May 2025 14:15:52 +0200 Subject: [PATCH 159/461] Crowpanel 4.3, 5.0, 7.0 support (#6611) * SD software SPI control * fix notification crash; * allow wake on touch * don't build non-MUI variants * use pwm buzzer * Finalize support for Crowpanel TFT 2.4, 2.8 and 3.5 * add hardware ID for TFT panels * Add stubs for the bigger panels. WIP! * fix braces * elecrow 4.3, 5.0, 7.0 support * completed implementation 4.3, 5.0, 7.0 variants * NodeDB default config & simplified light sleep macros * trunk fmt * remove flags * removed leftovers (note: rtc gpios are only needed for deep sleep; the remove section caused issues with the elecrows) --------- Co-authored-by: mverch67 Co-authored-by: Manuel <71137295+mverch67@users.noreply.github.com> Co-authored-by: Austin --- boards/crowpanel.json | 4 +- src/graphics/ScreenFonts.h | 4 +- src/mesh/NodeDB.cpp | 4 +- src/sleep.cpp | 35 ++++--- variants/elecrow_panel/pins_arduino.h | 14 +-- variants/elecrow_panel/platformio.ini | 73 ++++++------- variants/elecrow_panel/variant.h | 141 ++++---------------------- variants/mesh-tab/variant.h | 3 +- variants/rak_wismeshtap/variant.h | 3 + variants/t-deck/variant.h | 1 + variants/t-watch-s3/variant.h | 2 + variants/unphone/variant.h | 3 + 12 files changed, 98 insertions(+), 189 deletions(-) diff --git a/boards/crowpanel.json b/boards/crowpanel.json index 570961ed7..75b097ef7 100644 --- a/boards/crowpanel.json +++ b/boards/crowpanel.json @@ -8,8 +8,8 @@ "core": "esp32", "extra_flags": [ "-DBOARD_HAS_PSRAM", - "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_CDC_ON_BOOT=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=0" ], diff --git a/src/graphics/ScreenFonts.h b/src/graphics/ScreenFonts.h index 0be0dc814..3373a47a7 100644 --- a/src/graphics/ScreenFonts.h +++ b/src/graphics/ScreenFonts.h @@ -65,8 +65,8 @@ #endif #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS)) || \ - defined(ILI9488_CS) && !defined(DISPLAY_FORCE_SMALL_FONTS) + defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS)) && \ + !defined(DISPLAY_FORCE_SMALL_FONTS) // The screen is bigger so use bigger fonts #define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19 #define FONT_MEDIUM FONT_LARGE_LOCAL // Height: 28 diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 67f0da600..b64cb0fe1 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -584,7 +584,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) strncpy(config.network.ntp_server, "meshtastic.pool.ntp.org", 32); #if (defined(T_DECK) || defined(T_WATCH_S3) || defined(UNPHONE) || defined(PICOMPUTER_S3) || defined(SENSECAP_INDICATOR) || \ - defined(ELECROW)) && \ + defined(ELECROW_PANEL)) && \ HAS_TFT // switch BT off by default; use TFT programming mode or hotkey to enable config.bluetooth.enabled = false; @@ -689,7 +689,7 @@ void NodeDB::initConfigIntervals() config.display.screen_on_secs = default_screen_on_secs; -#if defined(T_WATCH_S3) || defined(T_DECK) || defined(UNPHONE) || defined(MESH_TAB) || defined(RAK14014) || defined(ELECROW) +#if defined(USE_POWERSAVE) config.power.is_power_saving = true; config.display.screen_on_secs = 30; config.power.wait_bluetooth_secs = 30; diff --git a/src/sleep.cpp b/src/sleep.cpp index 2985db0c2..8ffb08b04 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -24,6 +24,7 @@ #include "mesh/wifi/WiFiAPClient.h" #endif #include "rom/rtc.h" +#include #include #include @@ -284,6 +285,8 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false, bool skipSaveN pinMode(LORA_CS, OUTPUT); digitalWrite(LORA_CS, HIGH); gpio_hold_en((gpio_num_t)LORA_CS); +#elif defined(ELECROW_PANEL) + // Elecrow panels do not use LORA_CS, do nothing #else if (GPIO_IS_VALID_OUTPUT_GPIO(LORA_CS)) { // LoRa CS (RADIO_NSS) needs to stay HIGH, even during deep sleep @@ -400,7 +403,7 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r #ifdef INPUTDRIVER_ENCODER_BTN gpio_wakeup_enable((gpio_num_t)INPUTDRIVER_ENCODER_BTN, GPIO_INTR_LOW_LEVEL); #endif -#if defined(T_WATCH_S3) || defined(ELECROW) +#if defined(WAKE_ON_TOUCH) gpio_wakeup_enable((gpio_num_t)SCREEN_TOUCH_INT, GPIO_INTR_LOW_LEVEL); #endif enableLoraInterrupt(); @@ -433,11 +436,12 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r // Disable wake-on-button interrupt. Re-attach normal button-interrupts gpio_wakeup_disable(pin); #endif - -#if defined(T_WATCH_S3) || defined(ELECROW) +#if defined(INPUTDRIVER_ENCODER_BTN) + gpio_wakeup_disable((gpio_num_t)INPUTDRIVER_ENCODER_BTN); +#endif +#if defined(WAKE_ON_TOUCH) gpio_wakeup_disable((gpio_num_t)SCREEN_TOUCH_INT); #endif - #if !defined(SOC_PM_SUPPORT_EXT_WAKEUP) && defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC) if (radioType != RF95_RADIO) { gpio_wakeup_disable((gpio_num_t)LORA_DIO1); @@ -506,23 +510,24 @@ bool shouldLoraWake(uint32_t msecToWake) void enableLoraInterrupt() { + esp_err_t res; #if SOC_PM_SUPPORT_EXT_WAKEUP && defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC) - gpio_pulldown_en((gpio_num_t)LORA_DIO1); + res = gpio_pulldown_en((gpio_num_t)LORA_DIO1); + if (res != ESP_OK) { + LOG_ERROR("gpio_pulldown_en(LORA_DIO1) result %d", res); + } #if defined(LORA_RESET) && (LORA_RESET != RADIOLIB_NC) - gpio_pullup_en((gpio_num_t)LORA_RESET); + res = gpio_pullup_en((gpio_num_t)LORA_RESET); + if (res != ESP_OK) { + LOG_ERROR("gpio_pullup_en(LORA_RESET) result %d", res); + } #endif -#if defined(LORA_CS) && (LORA_CS != RADIOLIB_NC) +#if defined(LORA_CS) && (LORA_CS != RADIOLIB_NC) && !defined(ELECROW_PANEL) gpio_pullup_en((gpio_num_t)LORA_CS); #endif - if (rtc_gpio_is_valid_gpio((gpio_num_t)LORA_DIO1)) { - // Setup light/deep sleep with wakeup by external source - LOG_INFO("setup LORA_DIO1 (GPIO%02d) with wakeup by external source", LORA_DIO1); - esp_sleep_enable_ext0_wakeup((gpio_num_t)LORA_DIO1, HIGH); - } else { - LOG_INFO("setup LORA_DIO1 (GPIO%02d) with wakeup by gpio interrupt", LORA_DIO1); - gpio_wakeup_enable((gpio_num_t)LORA_DIO1, GPIO_INTR_HIGH_LEVEL); - } + LOG_INFO("setup LORA_DIO1 (GPIO%02d) with wakeup by gpio interrupt", LORA_DIO1); + gpio_wakeup_enable((gpio_num_t)LORA_DIO1, GPIO_INTR_HIGH_LEVEL); #elif defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC) if (radioType != RF95_RADIO) { diff --git a/variants/elecrow_panel/pins_arduino.h b/variants/elecrow_panel/pins_arduino.h index b98530378..81c9e0a2c 100644 --- a/variants/elecrow_panel/pins_arduino.h +++ b/variants/elecrow_panel/pins_arduino.h @@ -3,13 +3,11 @@ #include -// static const uint8_t LED_BUILTIN = -1; +static const uint8_t TX = 43; +static const uint8_t RX = 44; -// static const uint8_t TX = 43; -// static const uint8_t RX = 44; - -static const uint8_t SDA = 39; -static const uint8_t SCL = 40; +static const uint8_t SDA = 15; +static const uint8_t SCL = 16; // Default SPI will be mapped to Radio static const uint8_t SS = -1; @@ -17,13 +15,9 @@ static const uint8_t MOSI = 48; static const uint8_t MISO = 47; static const uint8_t SCK = 41; -#ifndef CROW_SELECT static const uint8_t SPI_MOSI = 6; static const uint8_t SPI_SCK = 5; static const uint8_t SPI_MISO = 4; -static const uint8_t SPI_CS = 7; // SD does not support -1 -static const uint8_t SDCARD_CS = SPI_CS; -#endif static const uint8_t A0 = 1; static const uint8_t A1 = 2; diff --git a/variants/elecrow_panel/platformio.ini b/variants/elecrow_panel/platformio.ini index 66dc35c3b..963174560 100644 --- a/variants/elecrow_panel/platformio.ini +++ b/variants/elecrow_panel/platformio.ini @@ -4,10 +4,8 @@ board = crowpanel board_check = true upload_protocol = esptool board_build.partitions = default_16MB.csv ; must be here for some reason, board.json is not enough !? - build_flags = ${esp32s3_base.build_flags} -Os -I variants/elecrow_panel - -D ELECROW -D ELECROW_PANEL -D CONFIG_ARDUHAL_LOG_COLORS -D RADIOLIB_DEBUG_SPI=0 @@ -22,15 +20,15 @@ build_flags = ${esp32s3_base.build_flags} -Os -D MESHTASTIC_EXCLUDE_SOCKETAPI=1 -D MESHTASTIC_EXCLUDE_SCREEN=1 -D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1 -; -D INPUTDRIVER_BUTTON_TYPE=0 -D HAS_TELEMETRY=0 -D CONFIG_DISABLE_HAL_LOCKS=1 + -D USE_PIN_BUZZER -D HAS_SCREEN=0 -D HAS_TFT=1 -D RAM_SIZE=6144 - -D LV_LVGL_H_INCLUDE_SIMPLE - -D LV_CONF_INCLUDE_SIMPLE - -D LV_COMP_CONF_INCLUDE_SIMPLE + -D LV_LVGL_H_INCLUDE_SIMPLE + -D LV_CONF_INCLUDE_SIMPLE + -D LV_COMP_CONF_INCLUDE_SIMPLE -D LV_USE_SYSMON=0 -D LV_USE_PROFILER=0 -D LV_USE_PERF_MONITOR=0 @@ -40,29 +38,44 @@ build_flags = ${esp32s3_base.build_flags} -Os -D USE_LOG_DEBUG -D LOG_DEBUG_INC=\"DebugConfiguration.h\" -D USE_PACKET_API + -D HAS_SDCARD + -D SD_SPI_FREQUENCY=75000000 lib_deps = ${esp32s3_base.lib_deps} ${device-ui_base.lib_deps} - earlephilhower/ESP8266Audio@^1.9.9 - earlephilhower/ESP8266SAM@^1.0.1 - lovyan03/LovyanGFX@^1.2.0 - hideakitai/TCA9534@^0.1.1 + earlephilhower/ESP8266Audio@1.9.9 + earlephilhower/ESP8266SAM@1.0.1 + lovyan03/LovyanGFX@1.2.0 ; note: v1.2.7 breaks the elecrow 7" display functionality + hideakitai/TCA9534@0.1.1 -[env:elecrow-24-28-tft] +[crowpanel_small] ; 2.4, 2.8, 3.5 inch extends = crowpanel_base - build_flags = ${crowpanel_base.build_flags} - -D TFT_HEIGHT=320 ; needed in variant.h - -D HAS_SDCARD + -D CROW_SELECT=1 -D SDCARD_USE_SOFT_SPI + -D SDCARD_CS=7 -D SPI_DRIVER_SELECT=2 - -D USE_PIN_BUZZER -; -D INPUTDRIVER_BUTTON_TYPE=0 ; no button as this pin is assigned to LoRa cs! - -D SCREEN_TOUCH_INT=47 ; used to wake up the MCU by touch -D LGFX_DRIVER_TEMPLATE -D LGFX_DRIVER=LGFX_GENERIC -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\" + -D VIEW_320x240 + -D MAP_FULL_REDRAW + +[crowpanel_large] ; 4.3, 5.0, 7.0 inch +extends = crowpanel_base +build_flags = + ${crowpanel_base.build_flags} + -D CROW_SELECT=2 + -D SDCARD_CS=7 + -D LGFX_DRIVER=LGFX_ELECROW70 + -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_ELECROW70.h\" + -D DISPLAY_SET_RESOLUTION + +[env:elecrow-adv-24-28-tft] +extends = crowpanel_small +build_flags = + ${crowpanel_small.build_flags} -D SPI_FREQUENCY=80000000 -D LGFX_SCREEN_WIDTH=240 -D LGFX_SCREEN_HEIGHT=320 @@ -81,25 +94,12 @@ build_flags = -D LGFX_TOUCH_INT=47 -D LGFX_TOUCH_RST=48 -D LGFX_TOUCH_ROTATION=0 - -D VIEW_320x240 - -D MAP_FULL_REDRAW - -[env:elecrow-35-tft] -extends = crowpanel_base +[env:elecrow-adv-35-tft] +extends = crowpanel_small build_flags = - ${crowpanel_base.build_flags} - -D TFT_HEIGHT=480 ; needed in variant.h - -D HAS_SDCARD - -D SDCARD_USE_SOFT_SPI - -D SPI_DRIVER_SELECT=2 - -D USE_PIN_BUZZER -; -D INPUTDRIVER_BUTTON_TYPE=0 ; no button as this pin is assigned to LoRa cs! - -D SCREEN_TOUCH_INT=47 ; used to wake up the MCU by touch + ${crowpanel_small.build_flags} -D LV_CACHE_DEF_SIZE=2097152 - -D LGFX_DRIVER_TEMPLATE - -D LGFX_DRIVER=LGFX_GENERIC - -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\" -D SPI_FREQUENCY=60000000 -D LGFX_SCREEN_WIDTH=320 -D LGFX_SCREEN_HEIGHT=480 @@ -119,5 +119,10 @@ build_flags = -D LGFX_TOUCH_RST=48 -D LGFX_TOUCH_ROTATION=0 -D DISPLAY_SET_RESOLUTION + +; 4.3, 5.0, 7.0 inch 800x480 IPS (V1) +[env:elecrow-adv1-43-50-70-tft] +extends = crowpanel_large +build_flags = + ${crowpanel_large.build_flags} -D VIEW_320x240 - -D MAP_FULL_REDRAW diff --git a/variants/elecrow_panel/variant.h b/variants/elecrow_panel/variant.h index b1035ed31..99069b723 100644 --- a/variants/elecrow_panel/variant.h +++ b/variants/elecrow_panel/variant.h @@ -1,124 +1,14 @@ #define I2C_SDA 15 #define I2C_SCL 16 -#if TFT_HEIGHT == 320 && not defined(HAS_TFT) // 2.4 and 2.8 TFT -// ST7789 TFT LCD -#define ST7789_CS 40 -#define ST7789_RS 41 // DC -#define ST7789_SDA 39 // MOSI -#define ST7789_SCK 42 -#define ST7789_RESET -1 -#define ST7789_MISO 38 -#define ST7789_BUSY -1 -#define ST7789_BL 38 -#define ST7789_SPI_HOST SPI2_HOST -#define TFT_BL 38 -#define SPI_FREQUENCY 60000000 -#define SPI_READ_FREQUENCY 16000000 -#define TFT_OFFSET_ROTATION 0 -#define SCREEN_ROTATE -#define TFT_DUMMY_READ_PIXELS 8 -#define SCREEN_TRANSITION_FRAMERATE 5 -#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness - -#define HAS_TOUCHSCREEN 1 +#if CROW_SELECT == 1 +#define WAKE_ON_TOUCH #define SCREEN_TOUCH_INT 47 -#define SCREEN_TOUCH_RST 48 -#define TOUCH_I2C_PORT 0 -#define TOUCH_SLAVE_ADDRESS 0x38 // FT5x06 +#define USE_POWERSAVE +#define SLEEP_TIME 180 #endif -#if TFT_HEIGHT == 480 && not defined(HAS_TFT) // 3.5 TFT -// ILI9488 TFT LCD -#define ILI9488_CS 40 -#define ILI9488_RS 41 // DC -#define ILI9488_SDA 39 // MOSI -#define ILI9488_SCK 42 -#define ILI9488_RESET -1 -#define ILI9488_MISO 38 -#define ILI9488_BUSY -1 -#define ILI9488_BL 38 -#define ILI9488_SPI_HOST SPI2_HOST -#define TFT_BL 38 -#define SPI_FREQUENCY 40000000 -#define SPI_READ_FREQUENCY 16000000 -#define TFT_OFFSET_ROTATION 0 -#define SCREEN_ROTATE -#define TFT_DUMMY_READ_PIXELS 8 -#define SCREEN_TRANSITION_FRAMERATE 5 -#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness - -#define HAS_TOUCHSCREEN 1 -#define SCREEN_TOUCH_INT 47 -#define SCREEN_TOUCH_RST 48 -#define TOUCH_I2C_PORT 0 -#define TOUCH_SLAVE_ADDRESS 0x5D // GT911 -#endif - -#ifdef CROW_SELECT -#define ST72xx_DE 42 -#define ST72xx_VSYNC 41 -#define ST72xx_HSYNC 40 -#define ST72xx_PCLK 39 -#define ST72xx_R0 7 -#define ST72xx_R1 17 -#define ST72xx_R2 18 -#define ST72xx_R3 3 -#define ST72xx_R4 46 -#define ST72xx_G0 9 -#define ST72xx_G1 10 -#define ST72xx_G2 11 -#define ST72xx_G3 12 -#define ST72xx_G4 13 -#define ST72xx_G5 14 -#define ST72xx_B0 21 -#define ST72xx_B1 47 -#define ST72xx_B2 48 -#define ST72xx_B3 45 -#define ST72xx_B4 38 - -#define HAS_TOUCHSCREEN 1 -#define TOUCH_I2C_PORT 0 -#define TOUCH_SLAVE_ADDRESS 0x5D // GT911 -#endif - -#if defined(CROW_SELECT) && CROW_SELECT == 1 // 4.3 TFT 800x480 -#define ST7265_HSYNC_POLARITY 0 -#define ST7265_HSYNC_FRONT_PORCH 24 -#define ST7265_HSYNC_PULSE_WIDTH 8 -#define ST7265_HSYNC_BACK_PORCH 24 -#define ST7265_VSYNC_POLARITY 1 -#define ST7265_VSYNC_FRONT_PORCH 24 -#define ST7265_VSYNC_PULSE_WIDTH 8 -#define ST7265_VSYNC_BACK_PORCH 24 -#define ST7265_PCLK_ACTIVE_NEG 1 -#endif - -#if defined(CROW_SELECT) && CROW_SELECT == 2 // 5.0 TFT 800x480 -#define ST7262_HSYNC_POLARITY 0 -#define ST7262_HSYNC_FRONT_PORCH 8 -#define ST7262_HSYNC_PULSE_WIDTH 4 -#define ST7262_HSYNC_BACK_PORCH 8 -#define ST7262_VSYNC_POLARITY 0 -#define ST7262_VSYNC_FRONT_PORCH 8 -#define ST7262_VSYNC_PULSE_WIDTH 4 -#define ST7262_VSYNC_BACK_PORCH 8 -#define ST7262_PCLK_ACTIVE_NEG 0 -#endif - -#if defined(CROW_SELECT) && CROW_SELECT == 3 // 7.0 TFT 800x480 -#define SC7277_HSYNC_POLARITY 0 -#define SC7277_HSYNC_FRONT_PORCH 8 -#define SC7277_HSYNC_PULSE_WIDTH 4 -#define SC7277_HSYNC_BACK_PORCH 8 -#define SC7277_VSYNC_POLARITY 0 -#define SC7277_VSYNC_FRONT_PORCH 8 -#define SC7277_VSYNC_PULSE_WIDTH 4 -#define SC7277_VSYNC_BACK_PORCH 8 -#define SC7277_PCLK_ACTIVE_NEG 0 -#endif - -#if TFT_HEIGHT == 320 // 2.4-2.8 have I2S audio +#if CROW_SELECT == 1 // dac / amp // #define HAS_I2S // didn't get I2S sound working #define PIN_BUZZER 8 // using pwm buzzer instead (nobody will notice, lol) @@ -131,10 +21,16 @@ #endif // GPS via UART1 connector -#define HAS_GPS 1 #define GPS_DEFAULT_NOT_PRESENT 1 +#define HAS_GPS 1 +#if CROW_SELECT == 1 #define GPS_RX_PIN 18 #define GPS_TX_PIN 17 +#else +// GPIOs shared with LoRa or MIC module +#define GPS_RX_PIN 19 +#define GPS_TX_PIN 20 +#endif // Extension Slot Layout, viewed from above (2.4-3.5) // DIO1/IO1 o o IO2/NRESET @@ -158,9 +54,11 @@ // LoRa #define USE_SX1262 -#define LORA_CS 0 // GND -#if TFT_HEIGHT == 320 || TFT_HEIGHT == 480 // 2.4 - 3.5 TFT +#if CROW_SELECT == 1 +// 2.4", 2.8, 3.5""" +#define HW_SPI1_DEVICE +#define LORA_CS 0 #define LORA_SCK 10 #define LORA_MISO 9 #define LORA_MOSI 3 @@ -173,6 +71,8 @@ #define SENSOR_POWER_CTRL_PIN 45 #define SENSOR_POWER_ON LOW #else +// 4.3", 5.0", 7.0" +#define LORA_CS 0 #define LORA_SCK 5 #define LORA_MISO 4 #define LORA_MOSI 6 @@ -182,14 +82,9 @@ #define LORA_DIO2 2 // SX1262 BUSY #endif -#define HW_SPI1_DEVICE #define SX126X_CS LORA_CS #define SX126X_DIO1 LORA_DIO1 #define SX126X_BUSY LORA_DIO2 #define SX126X_RESET LORA_RESET #define SX126X_DIO2_AS_RF_SWITCH - #define SX126X_DIO3_TCXO_VOLTAGE 3.3 - -#define USE_VIRTUAL_KEYBOARD 1 -#define DISPLAY_CLOCK_FRAME 1 \ No newline at end of file diff --git a/variants/mesh-tab/variant.h b/variants/mesh-tab/variant.h index 533c931bc..63ef17d85 100644 --- a/variants/mesh-tab/variant.h +++ b/variants/mesh-tab/variant.h @@ -3,7 +3,8 @@ #define HAS_TOUCHSCREEN 1 -#define SLEEP_TIME 120 +#define USE_POWERSAVE +#define SLEEP_TIME 180 // Analog pins #define BATTERY_PIN 4 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage diff --git a/variants/rak_wismeshtap/variant.h b/variants/rak_wismeshtap/variant.h index c21a11ac1..1980dc4a1 100644 --- a/variants/rak_wismeshtap/variant.h +++ b/variants/rak_wismeshtap/variant.h @@ -305,6 +305,9 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG #define HAS_TOUCHSCREEN 1 #define SCREEN_TOUCH_INT WB_IO6 +#define USE_POWERSAVE +#define SLEEP_TIME 120 + #define CANNED_MESSAGE_MODULE_ENABLE 1 #define USE_VIRTUAL_KEYBOARD 1 /*---------------------------------------------------------------------------- diff --git a/variants/t-deck/variant.h b/variants/t-deck/variant.h index 5b2c13a91..a21c786b3 100644 --- a/variants/t-deck/variant.h +++ b/variants/t-deck/variant.h @@ -31,6 +31,7 @@ #define TOUCH_I2C_PORT 0 #define TOUCH_SLAVE_ADDRESS 0x5D // GT911 +#define USE_POWERSAVE #define SLEEP_TIME 120 #ifndef HAS_TFT diff --git a/variants/t-watch-s3/variant.h b/variants/t-watch-s3/variant.h index 5a6aebfa2..578c23c0a 100644 --- a/variants/t-watch-s3/variant.h +++ b/variants/t-watch-s3/variant.h @@ -24,7 +24,9 @@ #define SCREEN_TOUCH_USE_I2C1 #define TOUCH_I2C_PORT 1 #define TOUCH_SLAVE_ADDRESS 0x38 +#define WAKE_ON_TOUCH +#define USE_POWERSAVE #define SLEEP_TIME 180 #define I2C_SDA1 39 // Used for capacitive touch diff --git a/variants/unphone/variant.h b/variants/unphone/variant.h index 7b39a5aa5..eaf142721 100644 --- a/variants/unphone/variant.h +++ b/variants/unphone/variant.h @@ -41,6 +41,9 @@ #define USE_XPT2046 1 #define TOUCH_CS 38 +#define USE_POWERSAVE +#define SLEEP_TIME 180 + #define HAS_GPS \ 0 // the unphone doesn't have a gps module by default (though // GPS featherwing -- https://www.adafruit.com/product/3133 From a7415791a56cca7816c52ee7cda74e532dcccd11 Mon Sep 17 00:00:00 2001 From: Chris Vogel Date: Tue, 13 May 2025 15:10:57 +0200 Subject: [PATCH 160/461] device-install.sh: detect t-eth-elite as s3 device (#6767) device-install.sh: detect t-eth-elite as s3 device fixes https://github.com/meshtastic/firmware/issues/6754#issuecomment-2857468902 Thanks @mverch67! --- bin/device-install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/device-install.sh b/bin/device-install.sh index a43ccbdb4..7fa5ffdbb 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -43,6 +43,16 @@ S3_VARIANTS=( "wireless-tracker" "station-g2" "unphone" + "t-eth-elite" + "mesh-tab" + "dreamcatcher" + "ESP32-S3-Pico" + "seeed-sensecap-indicator" + "heltec_capsule_sensor_v3" + "vision-master" + "icarus" + "tracksenger" + "elecrow-adv" ) # Determine the correct esptool command to use From 0a8bd1e4bee9b24f9a41203f9490fe1ac4390f3f Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 14 May 2025 05:33:51 -0500 Subject: [PATCH 161/461] Add contact admin message (for QR code) (#6806) --- src/mesh/NodeDB.cpp | 20 ++++++++++++++++++++ src/mesh/NodeDB.h | 2 ++ src/modules/AdminModule.cpp | 5 +++++ 3 files changed, 27 insertions(+) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index b64cb0fe1..0495fa7aa 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1455,6 +1455,26 @@ void NodeDB::updateTelemetry(uint32_t nodeId, const meshtastic_Telemetry &t, RxS notifyObservers(true); // Force an update whether or not our node counts have changed } +/** + * Update the node database with a new contact + */ +void NodeDB::addFromContact(meshtastic_SharedContact contact) +{ + meshtastic_NodeInfoLite *info = getOrCreateMeshNode(contact.node_num); + if (!info) { + return; + } + info->num = contact.node_num; + info->last_heard = getValidTime(RTCQualityNTP); + info->has_user = true; + info->user = TypeConversions::ConvertToUserLite(contact.user); + info->is_favorite = true; + updateGUIforNode = info; + powerFSM.trigger(EVENT_NODEDB_UPDATED); + notifyObservers(true); // Force an update whether or not our node counts have changed + saveNodeDatabaseToDisk(); +} + /** Update user info and channel for this node based on received user data */ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelIndex) diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 291c3804b..4dbda6a9f 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -110,6 +110,8 @@ class NodeDB /// we updateGUI and updateGUIforNode if we think our this change is big enough for a redraw void updateFrom(const meshtastic_MeshPacket &p); + void addFromContact(const meshtastic_SharedContact); + /** Update position info for this node based on received position data */ void updatePosition(uint32_t nodeId, const meshtastic_Position &p, RxSource src = RX_SRC_RADIO); diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 0e1e1555b..cbf82ae73 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -286,6 +286,11 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta nodeDB->removeNodeByNum(r->remove_by_nodenum); break; } + case meshtastic_AdminMessage_add_contact_tag: { + LOG_INFO("Client received add_contact command"); + nodeDB->addFromContact(r->add_contact); + break; + } case meshtastic_AdminMessage_set_favorite_node_tag: { LOG_INFO("Client received set_favorite_node command"); meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(r->set_favorite_node); From d9ad2322e8898ff5d9454b2ab3ef1f23a2d32005 Mon Sep 17 00:00:00 2001 From: Richard Zhang <129845637+Richard3366@users.noreply.github.com> Date: Wed, 14 May 2025 19:29:05 +0800 Subject: [PATCH 162/461] Fixes BUG #6243 Heltec Tracker (#6781) * fix wireless tracker screen issues * fix SHTC3 BUG * Remove the 32K crystal oscillator option for the Wireless Paper and Vision Master series. * Correct spelling errors * Update src/graphics/Screen.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Ben Meadors Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/graphics/Screen.cpp | 10 ++++++++++ src/modules/Telemetry/Sensor/SHTC3Sensor.cpp | 2 +- variants/heltec_vision_master_e213/variant.h | 1 - variants/heltec_vision_master_e290/variant.h | 1 - variants/heltec_vision_master_t190/variant.h | 1 - variants/heltec_wireless_paper/variant.h | 1 - variants/heltec_wireless_paper_v1/variant.h | 1 - 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 1ee0c0fdd..4f73c79be 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1612,6 +1612,9 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) #ifdef T_WATCH_S3 PMU->enablePowerOutput(XPOWERS_ALDO2); #endif +#ifdef HELTEC_TRACKER_V1_X + uint8_t tft_vext_enabled=digitalRead(VEXT_ENABLE); +#endif #if !ARCH_PORTDUINO dispdev->displayOn(); #endif @@ -1622,6 +1625,13 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) #endif dispdev->displayOn(); +#ifdef HELTEC_TRACKER_V1_X + // If the TFT VEXT power is not enabled, initialize the UI. + if(!tft_vext_enabled) + { + ui->init(); + } +#endif #ifdef USE_ST7789 pinMode(VTFT_CTRL, OUTPUT); digitalWrite(VTFT_CTRL, LOW); diff --git a/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp b/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp index dbebec9d3..e9c4d2a0b 100644 --- a/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp +++ b/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp @@ -15,7 +15,7 @@ int32_t SHTC3Sensor::runOnce() if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; } - status = shtc3.begin(); + status = shtc3.begin(nodeTelemetrySensorsMap[sensorType].second); return initI2CSensor(); } diff --git a/variants/heltec_vision_master_e213/variant.h b/variants/heltec_vision_master_e213/variant.h index 49b8e91f5..ebb2c341f 100644 --- a/variants/heltec_vision_master_e213/variant.h +++ b/variants/heltec_vision_master_e213/variant.h @@ -31,7 +31,6 @@ #define ADC_CHANNEL ADC1_GPIO7_CHANNEL #define ADC_MULTIPLIER 4.9 * 1.03 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 -#define HAS_32768HZ // LoRa #define USE_SX1262 diff --git a/variants/heltec_vision_master_e290/variant.h b/variants/heltec_vision_master_e290/variant.h index 9d6041539..02986d26b 100644 --- a/variants/heltec_vision_master_e290/variant.h +++ b/variants/heltec_vision_master_e290/variant.h @@ -30,7 +30,6 @@ #define ADC_CHANNEL ADC1_GPIO7_CHANNEL #define ADC_MULTIPLIER 4.9 * 1.03 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 -#define HAS_32768HZ // LoRa #define USE_SX1262 diff --git a/variants/heltec_vision_master_t190/variant.h b/variants/heltec_vision_master_t190/variant.h index 1da3f9971..788466919 100644 --- a/variants/heltec_vision_master_t190/variant.h +++ b/variants/heltec_vision_master_t190/variant.h @@ -47,7 +47,6 @@ #define ADC_CHANNEL ADC1_GPIO6_CHANNEL #define ADC_MULTIPLIER 4.9 * 1.03 // Voltage divider is roughly 1:1 #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // Voltage divider output is quite high -#define HAS_32768HZ // LoRa #define USE_SX1262 diff --git a/variants/heltec_wireless_paper/variant.h b/variants/heltec_wireless_paper/variant.h index 0385945e6..bbfd54ada 100644 --- a/variants/heltec_wireless_paper/variant.h +++ b/variants/heltec_wireless_paper/variant.h @@ -28,7 +28,6 @@ #define ADC_MULTIPLIER 2 // Voltage divider is roughly 1:1 #define BAT_MEASURE_ADC_UNIT 2 // Use ADC2 #define ADC_ATTENUATION ADC_ATTEN_DB_12 // Voltage divider output is quite high -#define HAS_32768HZ #define ADC_CTRL_ENABLED LOW #define NO_EXT_GPIO 1 diff --git a/variants/heltec_wireless_paper_v1/variant.h b/variants/heltec_wireless_paper_v1/variant.h index fe8f391df..4505395c9 100644 --- a/variants/heltec_wireless_paper_v1/variant.h +++ b/variants/heltec_wireless_paper_v1/variant.h @@ -29,7 +29,6 @@ #define ADC_MULTIPLIER 2 // Voltage divider is roughly 1:1 #define BAT_MEASURE_ADC_UNIT 2 // Use ADC2 #define ADC_ATTENUATION ADC_ATTEN_DB_12 // Voltage divider output is quite high -#define HAS_32768HZ #define ADC_CTRL_ENABLED LOW #define NO_EXT_GPIO 1 From 94af3bd1ab8eb94d2aaa9be3e510b591768b0623 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 14 May 2025 06:31:18 -0500 Subject: [PATCH 163/461] Formatting --- src/graphics/Screen.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 4f73c79be..61999ee79 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1613,7 +1613,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) PMU->enablePowerOutput(XPOWERS_ALDO2); #endif #ifdef HELTEC_TRACKER_V1_X - uint8_t tft_vext_enabled=digitalRead(VEXT_ENABLE); + uint8_t tft_vext_enabled = digitalRead(VEXT_ENABLE); #endif #if !ARCH_PORTDUINO dispdev->displayOn(); @@ -1627,9 +1627,8 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) dispdev->displayOn(); #ifdef HELTEC_TRACKER_V1_X // If the TFT VEXT power is not enabled, initialize the UI. - if(!tft_vext_enabled) - { - ui->init(); + if (!tft_vext_enabled) { + ui->init(); } #endif #ifdef USE_ST7789 From b1955c34aa80dd7e2ed9e08a7e17b1bd532f793b Mon Sep 17 00:00:00 2001 From: rcarteraz Date: Wed, 14 May 2025 04:32:24 -0700 Subject: [PATCH 164/461] Update Seeed Solar Node (#6763) * Update Seeed Solar Node * Update Seeed Solar Node * updates * updates * updates --------- Co-authored-by: Ben Meadors --- boards/{Seeed_Solar_Node.json => seeed_solar_node.json} | 4 ++-- .../{Seeed_Solar_Node => seeed_solar_node}/platformio.ini | 8 ++++---- .../{Seeed_Solar_Node => seeed_solar_node}/variant.cpp | 0 variants/{Seeed_Solar_Node => seeed_solar_node}/variant.h | 0 4 files changed, 6 insertions(+), 6 deletions(-) rename boards/{Seeed_Solar_Node.json => seeed_solar_node.json} (94%) rename variants/{Seeed_Solar_Node => seeed_solar_node}/platformio.ini (76%) rename variants/{Seeed_Solar_Node => seeed_solar_node}/variant.cpp (100%) rename variants/{Seeed_Solar_Node => seeed_solar_node}/variant.h (100%) diff --git a/boards/Seeed_Solar_Node.json b/boards/seeed_solar_node.json similarity index 94% rename from boards/Seeed_Solar_Node.json rename to boards/seeed_solar_node.json index e1b502cfa..e77fbd077 100644 --- a/boards/Seeed_Solar_Node.json +++ b/boards/seeed_solar_node.json @@ -10,7 +10,7 @@ "hwids": [["0x2886", "0x0059"]], "usb_product": "XIAO-BOOT", "mcu": "nrf52840", - "variant": "Seeed_Solar_Node", + "variant": "seeed_solar_node", "bsp": { "name": "adafruit" }, @@ -31,7 +31,7 @@ "openocd_target": "nrf52840-mdk-rs" }, "frameworks": ["arduino"], - "name": "Seeed_Solar_Node", + "name": "seeed_solar_node", "upload": { "maximum_ram_size": 248832, "maximum_size": 815104, diff --git a/variants/Seeed_Solar_Node/platformio.ini b/variants/seeed_solar_node/platformio.ini similarity index 76% rename from variants/Seeed_Solar_Node/platformio.ini rename to variants/seeed_solar_node/platformio.ini index 5ee0a5e8f..eb91a435f 100644 --- a/variants/Seeed_Solar_Node/platformio.ini +++ b/variants/seeed_solar_node/platformio.ini @@ -1,13 +1,13 @@ -[env:Seeed_Solar_Node] -board = Seeed_Solar_Node +[env:seeed_solar_node] +board = seeed_solar_node extends = nrf52840_base ;board_level = extra build_flags = ${nrf52840_base.build_flags} - -I $PROJECT_DIR/variants/Seeed_Solar_Node + -I $PROJECT_DIR/variants/seeed_solar_node -D SEEED_SOLAR_NODE -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/Seeed_Solar_Node> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_solar_node> lib_deps = ${nrf52840_base.lib_deps} debug_tool = jlink diff --git a/variants/Seeed_Solar_Node/variant.cpp b/variants/seeed_solar_node/variant.cpp similarity index 100% rename from variants/Seeed_Solar_Node/variant.cpp rename to variants/seeed_solar_node/variant.cpp diff --git a/variants/Seeed_Solar_Node/variant.h b/variants/seeed_solar_node/variant.h similarity index 100% rename from variants/Seeed_Solar_Node/variant.h rename to variants/seeed_solar_node/variant.h From feafd2bc0c94a6e85077543c20a5a626e1e7eea6 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Wed, 14 May 2025 23:33:51 +1200 Subject: [PATCH 165/461] Protect T-Echo's touch button against phantom presses in OLED UI (#6735) * Guard T-Echo touch button during LoRa TX * Guard for T-Echo only --------- Co-authored-by: Ben Meadors --- src/ButtonThread.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/ButtonThread.cpp b/src/ButtonThread.cpp index 352885dbe..8db52c074 100644 --- a/src/ButtonThread.cpp +++ b/src/ButtonThread.cpp @@ -300,14 +300,23 @@ int32_t ButtonThread::runOnce() #ifdef BUTTON_PIN_TOUCH case BUTTON_EVENT_TOUCH_LONG_PRESSED: { LOG_BUTTON("Touch press!"); - if (screen) { - // Wake if asleep - if (powerFSM.getState() == &stateDARK) - powerFSM.trigger(EVENT_PRESS); + // Ignore if: no screen + if (!screen) + break; - // Update display (legacy behaviour) - screen->forceDisplay(); - } +#ifdef TTGO_T_ECHO + // Ignore if: TX in progress + // Uncommon T-Echo hardware bug, LoRa TX triggers touch button + if (!RadioLibInterface::instance || RadioLibInterface::instance->isSending()) + break; +#endif + + // Wake if asleep + if (powerFSM.getState() == &stateDARK) + powerFSM.trigger(EVENT_PRESS); + + // Update display (legacy behaviour) + screen->forceDisplay(); break; } #endif // BUTTON_PIN_TOUCH From f16402dec152df25c35c953186418321e8bb26bb Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 14 May 2025 14:39:46 -0400 Subject: [PATCH 166/461] MQTT userprefs (#6802) --- src/mesh/Channels.cpp | 2 +- src/mesh/Default.h | 2 ++ src/mesh/NodeDB.cpp | 30 +++++++++++++++++++++++++++++- src/mqtt/MQTT.cpp | 7 +++++++ src/mqtt/MQTT.h | 2 ++ userPrefs.jsonc | 7 +++++++ 6 files changed, 48 insertions(+), 2 deletions(-) diff --git a/src/mesh/Channels.cpp b/src/mesh/Channels.cpp index 2ba3499f1..70e4127d8 100644 --- a/src/mesh/Channels.cpp +++ b/src/mesh/Channels.cpp @@ -347,7 +347,7 @@ bool Channels::anyMqttEnabled() { #if USERPREFS_EVENT_MODE && !MESHTASTIC_EXCLUDE_MQTT // Don't publish messages on the public MQTT broker if we are in event mode - if (mqtt && mqtt->isUsingDefaultServer()) { + if (mqtt && mqtt->isUsingDefaultServer() && mqtt->isUsingDefaultRootTopic()) { return false; } #endif diff --git a/src/mesh/Default.h b/src/mesh/Default.h index 0daccbb6f..bc2aa785f 100644 --- a/src/mesh/Default.h +++ b/src/mesh/Default.h @@ -26,6 +26,8 @@ #define default_mqtt_username "meshdev" #define default_mqtt_password "large4cats" #define default_mqtt_root "msh" +#define default_mqtt_encryption_enabled true +#define default_mqtt_tls_enabled false #define IF_ROUTER(routerVal, normalVal) \ ((config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER) ? (routerVal) : (normalVal)) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 0495fa7aa..f22f7bf91 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -761,11 +761,39 @@ void NodeDB::installDefaultModuleConfig() moduleConfig.has_canned_message = true; +#if USERPREFS_MQTT_ENABLED && !MESHTASTIC_EXCLUDE_MQTT + moduleConfig.mqtt.enabled = true; +#endif +#ifdef USERPREFS_MQTT_ADDRESS + strncpy(moduleConfig.mqtt.address, USERPREFS_MQTT_ADDRESS, sizeof(moduleConfig.mqtt.address)); +#else strncpy(moduleConfig.mqtt.address, default_mqtt_address, sizeof(moduleConfig.mqtt.address)); +#endif +#ifdef USERPREFS_MQTT_USERNAME + strncpy(moduleConfig.mqtt.username, USERPREFS_MQTT_USERNAME, sizeof(moduleConfig.mqtt.username)); +#else strncpy(moduleConfig.mqtt.username, default_mqtt_username, sizeof(moduleConfig.mqtt.username)); +#endif +#ifdef USERPREFS_MQTT_PASSWORD + strncpy(moduleConfig.mqtt.password, USERPREFS_MQTT_PASSWORD, sizeof(moduleConfig.mqtt.password)); +#else strncpy(moduleConfig.mqtt.password, default_mqtt_password, sizeof(moduleConfig.mqtt.password)); +#endif +#ifdef USERPREFS_MQTT_ROOT_TOPIC + strncpy(moduleConfig.mqtt.root, USERPREFS_MQTT_ROOT_TOPIC, sizeof(moduleConfig.mqtt.root)); +#else strncpy(moduleConfig.mqtt.root, default_mqtt_root, sizeof(moduleConfig.mqtt.root)); - moduleConfig.mqtt.encryption_enabled = true; +#endif +#ifdef USERPREFS_MQTT_ENCRYPTION_ENABLED + moduleConfig.mqtt.encryption_enabled = USERPREFS_MQTT_ENCRYPTION_ENABLED; +#else + moduleConfig.mqtt.encryption_enabled = default_mqtt_encryption_enabled; +#endif +#ifdef USERPREFS_MQTT_TLS_ENABLED + moduleConfig.mqtt.tls_enabled = USERPREFS_MQTT_TLS_ENABLED; +#else + moduleConfig.mqtt.tls_enabled = default_mqtt_tls_enabled; +#endif moduleConfig.has_neighbor_info = true; moduleConfig.neighbor_info.enabled = false; diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index fb92789ee..3776f59f5 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -256,6 +256,11 @@ bool isDefaultServer(const String &host) return host.length() == 0 || host == default_mqtt_address; } +bool isDefaultRootTopic(const String &root) +{ + return root.length() == 0 || root == default_mqtt_root; +} + struct PubSubConfig { explicit PubSubConfig(const meshtastic_ModuleConfig_MQTTConfig &config) { @@ -387,10 +392,12 @@ MQTT::MQTT() : concurrency::OSThread("mqtt"), mqttQueue(MAX_MQTT_QUEUE) cryptTopic = moduleConfig.mqtt.root + cryptTopic; jsonTopic = moduleConfig.mqtt.root + jsonTopic; mapTopic = moduleConfig.mqtt.root + mapTopic; + isConfiguredForDefaultRootTopic = isDefaultRootTopic(moduleConfig.mqtt.root); } else { cryptTopic = "msh" + cryptTopic; jsonTopic = "msh" + jsonTopic; mapTopic = "msh" + mapTopic; + isConfiguredForDefaultRootTopic = true; } if (moduleConfig.mqtt.map_reporting_enabled && moduleConfig.mqtt.has_map_report_settings) { diff --git a/src/mqtt/MQTT.h b/src/mqtt/MQTT.h index 0c260dc9c..2b11f479d 100644 --- a/src/mqtt/MQTT.h +++ b/src/mqtt/MQTT.h @@ -58,6 +58,7 @@ class MQTT : private concurrency::OSThread void start() { setIntervalFromNow(0); }; bool isUsingDefaultServer() { return isConfiguredForDefaultServer; } + bool isUsingDefaultRootTopic() { return isConfiguredForDefaultRootTopic; } /// Validate the meshtastic_ModuleConfig_MQTTConfig. static bool isValidConfig(const meshtastic_ModuleConfig_MQTTConfig &config) { return isValidConfig(config, nullptr); } @@ -71,6 +72,7 @@ class MQTT : private concurrency::OSThread int reconnectCount = 0; bool isConfiguredForDefaultServer = true; + bool isConfiguredForDefaultRootTopic = true; virtual int32_t runOnce() override; diff --git a/userPrefs.jsonc b/userPrefs.jsonc index 06c4a7eec..a349a5700 100644 --- a/userPrefs.jsonc +++ b/userPrefs.jsonc @@ -44,5 +44,12 @@ // "USERPREFS_NETWORK_WIFI_ENABLED": "true", // "USERPREFS_NETWORK_WIFI_SSID": "wifi_ssid", // "USERPREFS_NETWORK_WIFI_PSK": "wifi_psk", + // "USERPREFS_MQTT_ENABLED": "1", + // "USERPREFS_MQTT_ADDRESS": "'mqtt.meshtastic.org'", + // "USERPREFS_MQTT_USERNAME": "meshdev", + // "USERPREFS_MQTT_PASSWORD": "large4cats", + // "USERPREFS_MQTT_ENCRYPTION_ENABLED": "true", + // "USERPREFS_MQTT_TLS_ENABLED": "false", + // "USERPREFS_MQTT_ROOT_TOPIC": "event/REPLACEME", "USERPREFS_TZ_STRING": "tzplaceholder " } From bc313da064abee20474a8e078d865ffd18658916 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 13:48:14 -0500 Subject: [PATCH 167/461] [create-pull-request] automated change (#6810) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/admin.pb.h | 2 +- src/mesh/generated/meshtastic/deviceonly.pb.h | 19 ++++++++++++------- src/mesh/generated/meshtastic/mesh.pb.h | 15 ++++++++++----- src/mesh/generated/meshtastic/telemetry.pb.h | 8 +++++--- 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/protobufs b/protobufs index 816595c8b..8cb3e62a0 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 816595c8bbdfc3b4388e11348ccd043294d58705 +Subproject commit 8cb3e62a0d35d470e3d5d9950c0f1d85ccb35b22 diff --git a/src/mesh/generated/meshtastic/admin.pb.h b/src/mesh/generated/meshtastic/admin.pb.h index 09499b075..0a46e6275 100644 --- a/src/mesh/generated/meshtastic/admin.pb.h +++ b/src/mesh/generated/meshtastic/admin.pb.h @@ -446,7 +446,7 @@ extern const pb_msgdesc_t meshtastic_SharedContact_msg; #define meshtastic_AdminMessage_size 511 #define meshtastic_HamParameters_size 31 #define meshtastic_NodeRemoteHardwarePinsResponse_size 496 -#define meshtastic_SharedContact_size 121 +#define meshtastic_SharedContact_size 123 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index 83563a9fc..5e92cacd0 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -58,6 +58,9 @@ typedef struct _meshtastic_UserLite { /* The public key of the user's device. This is sent out to other nodes on the mesh to allow them to compute a shared secret key. */ meshtastic_UserLite_public_key_t public_key; + /* Whether or not the node can be messaged */ + bool has_is_unmessagable; + bool is_unmessagable; } meshtastic_UserLite; typedef struct _meshtastic_NodeInfoLite { @@ -183,14 +186,14 @@ extern "C" { /* Initializer values for message structs */ #define meshtastic_PositionLite_init_default {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN} -#define meshtastic_UserLite_init_default {{0}, "", "", _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}} +#define meshtastic_UserLite_init_default {{0}, "", "", _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}, false, 0} #define meshtastic_NodeInfoLite_init_default {0, false, meshtastic_UserLite_init_default, false, meshtastic_PositionLite_init_default, 0, 0, false, meshtastic_DeviceMetrics_init_default, 0, 0, false, 0, 0, 0, 0} #define meshtastic_DeviceState_init_default {false, meshtastic_MyNodeInfo_init_default, false, meshtastic_User_init_default, 0, {meshtastic_MeshPacket_init_default}, false, meshtastic_MeshPacket_init_default, 0, 0, 0, false, meshtastic_MeshPacket_init_default, 0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}} #define meshtastic_NodeDatabase_init_default {0, {0}} #define meshtastic_ChannelFile_init_default {0, {meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default}, 0} #define meshtastic_BackupPreferences_init_default {0, 0, false, meshtastic_LocalConfig_init_default, false, meshtastic_LocalModuleConfig_init_default, false, meshtastic_ChannelFile_init_default, false, meshtastic_User_init_default} #define meshtastic_PositionLite_init_zero {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN} -#define meshtastic_UserLite_init_zero {{0}, "", "", _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}} +#define meshtastic_UserLite_init_zero {{0}, "", "", _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}, false, 0} #define meshtastic_NodeInfoLite_init_zero {0, false, meshtastic_UserLite_init_zero, false, meshtastic_PositionLite_init_zero, 0, 0, false, meshtastic_DeviceMetrics_init_zero, 0, 0, false, 0, 0, 0, 0} #define meshtastic_DeviceState_init_zero {false, meshtastic_MyNodeInfo_init_zero, false, meshtastic_User_init_zero, 0, {meshtastic_MeshPacket_init_zero}, false, meshtastic_MeshPacket_init_zero, 0, 0, 0, false, meshtastic_MeshPacket_init_zero, 0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}} #define meshtastic_NodeDatabase_init_zero {0, {0}} @@ -210,6 +213,7 @@ extern "C" { #define meshtastic_UserLite_is_licensed_tag 5 #define meshtastic_UserLite_role_tag 6 #define meshtastic_UserLite_public_key_tag 7 +#define meshtastic_UserLite_is_unmessagable_tag 9 #define meshtastic_NodeInfoLite_num_tag 1 #define meshtastic_NodeInfoLite_user_tag 2 #define meshtastic_NodeInfoLite_position_tag 3 @@ -259,7 +263,8 @@ X(a, STATIC, SINGULAR, STRING, short_name, 3) \ X(a, STATIC, SINGULAR, UENUM, hw_model, 4) \ X(a, STATIC, SINGULAR, BOOL, is_licensed, 5) \ X(a, STATIC, SINGULAR, UENUM, role, 6) \ -X(a, STATIC, SINGULAR, BYTES, public_key, 7) +X(a, STATIC, SINGULAR, BYTES, public_key, 7) \ +X(a, STATIC, OPTIONAL, BOOL, is_unmessagable, 9) #define meshtastic_UserLite_CALLBACK NULL #define meshtastic_UserLite_DEFAULT NULL @@ -350,12 +355,12 @@ extern const pb_msgdesc_t meshtastic_BackupPreferences_msg; /* Maximum encoded size of messages (where known) */ /* meshtastic_NodeDatabase_size depends on runtime parameters */ #define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size -#define meshtastic_BackupPreferences_size 2263 +#define meshtastic_BackupPreferences_size 2265 #define meshtastic_ChannelFile_size 718 -#define meshtastic_DeviceState_size 1720 -#define meshtastic_NodeInfoLite_size 188 +#define meshtastic_DeviceState_size 1722 +#define meshtastic_NodeInfoLite_size 190 #define meshtastic_PositionLite_size 28 -#define meshtastic_UserLite_size 96 +#define meshtastic_UserLite_size 98 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 6fa0b60b0..572a6f5d5 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -609,6 +609,9 @@ typedef struct _meshtastic_User { /* The public key of the user's device. This is sent out to other nodes on the mesh to allow them to compute a shared secret key. */ meshtastic_User_public_key_t public_key; + /* Whether or not the node can be messaged */ + bool has_is_unmessagable; + bool is_unmessagable; } meshtastic_User; /* A message used in a traceroute */ @@ -1204,7 +1207,7 @@ extern "C" { /* Initializer values for message structs */ #define meshtastic_Position_init_default {false, 0, false, 0, false, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, false, 0, false, 0, 0, 0, 0, 0, false, 0, false, 0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_User_init_default {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}} +#define meshtastic_User_init_default {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}, false, 0} #define meshtastic_RouteDiscovery_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}} #define meshtastic_Routing_init_default {0, {meshtastic_RouteDiscovery_init_default}} #define meshtastic_Data_init_default {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, 0} @@ -1229,7 +1232,7 @@ extern "C" { #define meshtastic_resend_chunks_init_default {{{NULL}, NULL}} #define meshtastic_ChunkedPayloadResponse_init_default {0, 0, {0}} #define meshtastic_Position_init_zero {false, 0, false, 0, false, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, false, 0, false, 0, 0, 0, 0, 0, false, 0, false, 0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_User_init_zero {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}} +#define meshtastic_User_init_zero {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}, false, 0} #define meshtastic_RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}} #define meshtastic_Routing_init_zero {0, {meshtastic_RouteDiscovery_init_zero}} #define meshtastic_Data_init_zero {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, 0} @@ -1286,6 +1289,7 @@ extern "C" { #define meshtastic_User_is_licensed_tag 6 #define meshtastic_User_role_tag 7 #define meshtastic_User_public_key_tag 8 +#define meshtastic_User_is_unmessagable_tag 9 #define meshtastic_RouteDiscovery_route_tag 1 #define meshtastic_RouteDiscovery_snr_towards_tag 2 #define meshtastic_RouteDiscovery_route_back_tag 3 @@ -1457,7 +1461,8 @@ X(a, STATIC, SINGULAR, FIXED_LENGTH_BYTES, macaddr, 4) \ X(a, STATIC, SINGULAR, UENUM, hw_model, 5) \ X(a, STATIC, SINGULAR, BOOL, is_licensed, 6) \ X(a, STATIC, SINGULAR, UENUM, role, 7) \ -X(a, STATIC, SINGULAR, BYTES, public_key, 8) +X(a, STATIC, SINGULAR, BYTES, public_key, 8) \ +X(a, STATIC, OPTIONAL, BOOL, is_unmessagable, 9) #define meshtastic_User_CALLBACK NULL #define meshtastic_User_DEFAULT NULL @@ -1786,14 +1791,14 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; #define meshtastic_MyNodeInfo_size 77 #define meshtastic_NeighborInfo_size 258 #define meshtastic_Neighbor_size 22 -#define meshtastic_NodeInfo_size 319 +#define meshtastic_NodeInfo_size 321 #define meshtastic_NodeRemoteHardwarePin_size 29 #define meshtastic_Position_size 144 #define meshtastic_QueueStatus_size 23 #define meshtastic_RouteDiscovery_size 256 #define meshtastic_Routing_size 259 #define meshtastic_ToRadio_size 504 -#define meshtastic_User_size 113 +#define meshtastic_User_size 115 #define meshtastic_Waypoint_size 165 #ifdef __cplusplus diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index dcc511ea6..be3fa0907 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -87,7 +87,9 @@ typedef enum _meshtastic_TelemetrySensorType { /* Infineon DPS310 High accuracy pressure and temperature */ meshtastic_TelemetrySensorType_DPS310 = 36, /* RAKWireless RAK12035 Soil Moisture Sensor Module */ - meshtastic_TelemetrySensorType_RAK12035 = 37 + meshtastic_TelemetrySensorType_RAK12035 = 37, + /* MAX17261 lipo battery gauge */ + meshtastic_TelemetrySensorType_MAX17261 = 38 } meshtastic_TelemetrySensorType; /* Struct definitions */ @@ -324,8 +326,8 @@ extern "C" { /* Helper constants for enums */ #define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET -#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_RAK12035 -#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_RAK12035+1)) +#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_MAX17261 +#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_MAX17261+1)) From 1af4a0bdc9ab66081a6ccb5e1444e1d15b807083 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 14:10:45 -0500 Subject: [PATCH 168/461] Upgrade trunk (#6797) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index ca38c978a..4aa5527be 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -10,13 +10,13 @@ lint: enabled: - renovate@40.0.6 - prettier@3.5.3 - - trufflehog@3.88.28 + - trufflehog@3.88.29 - yamllint@1.37.1 - bandit@1.8.3 - terrascan@1.19.9 - trivy@0.62.1 - taplo@0.9.3 - - ruff@0.11.8 + - ruff@0.11.9 - isort@6.0.1 - markdownlint@0.44.0 - oxipng@9.1.5 @@ -28,7 +28,7 @@ lint: - shellcheck@0.10.0 - black@25.1.0 - git-diff-check - - gitleaks@8.25.1 + - gitleaks@8.26.0 - clang-format@16.0.3 ignore: - linters: [ALL] From a51a6b8c475cdd654dc3c12ccff33340be6709cd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 14:41:37 -0500 Subject: [PATCH 169/461] [create-pull-request] automated change (#6812) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/deviceonly.pb.h | 2 +- src/mesh/generated/meshtastic/localonly.pb.h | 2 +- src/mesh/generated/meshtastic/module_config.pb.h | 16 ++++++++++------ src/mesh/generated/meshtastic/mqtt.pb.h | 13 +++++++++---- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/protobufs b/protobufs index 8cb3e62a0..47ec99aa4 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 8cb3e62a0d35d470e3d5d9950c0f1d85ccb35b22 +Subproject commit 47ec99aa4c4a2e3fff71fd5170663f0848deb021 diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index 5e92cacd0..d29fb17a7 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -355,7 +355,7 @@ extern const pb_msgdesc_t meshtastic_BackupPreferences_msg; /* Maximum encoded size of messages (where known) */ /* meshtastic_NodeDatabase_size depends on runtime parameters */ #define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size -#define meshtastic_BackupPreferences_size 2265 +#define meshtastic_BackupPreferences_size 2267 #define meshtastic_ChannelFile_size 718 #define meshtastic_DeviceState_size 1722 #define meshtastic_NodeInfoLite_size 190 diff --git a/src/mesh/generated/meshtastic/localonly.pb.h b/src/mesh/generated/meshtastic/localonly.pb.h index 6a59b8eb0..53d8d7d80 100644 --- a/src/mesh/generated/meshtastic/localonly.pb.h +++ b/src/mesh/generated/meshtastic/localonly.pb.h @@ -188,7 +188,7 @@ extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalConfig_size #define meshtastic_LocalConfig_size 743 -#define meshtastic_LocalModuleConfig_size 667 +#define meshtastic_LocalModuleConfig_size 669 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/module_config.pb.h b/src/mesh/generated/meshtastic/module_config.pb.h index dbf6ddb2e..e8ae48072 100644 --- a/src/mesh/generated/meshtastic/module_config.pb.h +++ b/src/mesh/generated/meshtastic/module_config.pb.h @@ -112,6 +112,8 @@ typedef struct _meshtastic_ModuleConfig_MapReportSettings { uint32_t publish_interval_secs; /* Bits of precision for the location sent (default of 32 is full precision). */ uint32_t position_precision; + /* Whether we have opted-in to report our location to the map */ + bool should_report_location; } meshtastic_ModuleConfig_MapReportSettings; /* MQTT Client Config */ @@ -505,7 +507,7 @@ extern "C" { /* Initializer values for message structs */ #define meshtastic_ModuleConfig_init_default {0, {meshtastic_ModuleConfig_MQTTConfig_init_default}} #define meshtastic_ModuleConfig_MQTTConfig_init_default {0, "", "", "", 0, 0, 0, "", 0, 0, false, meshtastic_ModuleConfig_MapReportSettings_init_default} -#define meshtastic_ModuleConfig_MapReportSettings_init_default {0, 0} +#define meshtastic_ModuleConfig_MapReportSettings_init_default {0, 0, 0} #define meshtastic_ModuleConfig_RemoteHardwareConfig_init_default {0, 0, 0, {meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default}} #define meshtastic_ModuleConfig_NeighborInfoConfig_init_default {0, 0, 0} #define meshtastic_ModuleConfig_DetectionSensorConfig_init_default {0, 0, 0, 0, "", 0, _meshtastic_ModuleConfig_DetectionSensorConfig_TriggerType_MIN, 0} @@ -521,7 +523,7 @@ extern "C" { #define meshtastic_RemoteHardwarePin_init_default {0, "", _meshtastic_RemoteHardwarePinType_MIN} #define meshtastic_ModuleConfig_init_zero {0, {meshtastic_ModuleConfig_MQTTConfig_init_zero}} #define meshtastic_ModuleConfig_MQTTConfig_init_zero {0, "", "", "", 0, 0, 0, "", 0, 0, false, meshtastic_ModuleConfig_MapReportSettings_init_zero} -#define meshtastic_ModuleConfig_MapReportSettings_init_zero {0, 0} +#define meshtastic_ModuleConfig_MapReportSettings_init_zero {0, 0, 0} #define meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero {0, 0, 0, {meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero}} #define meshtastic_ModuleConfig_NeighborInfoConfig_init_zero {0, 0, 0} #define meshtastic_ModuleConfig_DetectionSensorConfig_init_zero {0, 0, 0, 0, "", 0, _meshtastic_ModuleConfig_DetectionSensorConfig_TriggerType_MIN, 0} @@ -539,6 +541,7 @@ extern "C" { /* Field tags (for use in manual encoding/decoding) */ #define meshtastic_ModuleConfig_MapReportSettings_publish_interval_secs_tag 1 #define meshtastic_ModuleConfig_MapReportSettings_position_precision_tag 2 +#define meshtastic_ModuleConfig_MapReportSettings_should_report_location_tag 3 #define meshtastic_ModuleConfig_MQTTConfig_enabled_tag 1 #define meshtastic_ModuleConfig_MQTTConfig_address_tag 2 #define meshtastic_ModuleConfig_MQTTConfig_username_tag 3 @@ -702,7 +705,8 @@ X(a, STATIC, OPTIONAL, MESSAGE, map_report_settings, 11) #define meshtastic_ModuleConfig_MapReportSettings_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, publish_interval_secs, 1) \ -X(a, STATIC, SINGULAR, UINT32, position_precision, 2) +X(a, STATIC, SINGULAR, UINT32, position_precision, 2) \ +X(a, STATIC, SINGULAR, BOOL, should_report_location, 3) #define meshtastic_ModuleConfig_MapReportSettings_CALLBACK NULL #define meshtastic_ModuleConfig_MapReportSettings_DEFAULT NULL @@ -890,8 +894,8 @@ extern const pb_msgdesc_t meshtastic_RemoteHardwarePin_msg; #define meshtastic_ModuleConfig_CannedMessageConfig_size 49 #define meshtastic_ModuleConfig_DetectionSensorConfig_size 44 #define meshtastic_ModuleConfig_ExternalNotificationConfig_size 42 -#define meshtastic_ModuleConfig_MQTTConfig_size 222 -#define meshtastic_ModuleConfig_MapReportSettings_size 12 +#define meshtastic_ModuleConfig_MQTTConfig_size 224 +#define meshtastic_ModuleConfig_MapReportSettings_size 14 #define meshtastic_ModuleConfig_NeighborInfoConfig_size 10 #define meshtastic_ModuleConfig_PaxcounterConfig_size 30 #define meshtastic_ModuleConfig_RangeTestConfig_size 10 @@ -899,7 +903,7 @@ extern const pb_msgdesc_t meshtastic_RemoteHardwarePin_msg; #define meshtastic_ModuleConfig_SerialConfig_size 28 #define meshtastic_ModuleConfig_StoreForwardConfig_size 24 #define meshtastic_ModuleConfig_TelemetryConfig_size 46 -#define meshtastic_ModuleConfig_size 225 +#define meshtastic_ModuleConfig_size 227 #define meshtastic_RemoteHardwarePin_size 21 #ifdef __cplusplus diff --git a/src/mesh/generated/meshtastic/mqtt.pb.h b/src/mesh/generated/meshtastic/mqtt.pb.h index 1726bc470..c5b10f1f5 100644 --- a/src/mesh/generated/meshtastic/mqtt.pb.h +++ b/src/mesh/generated/meshtastic/mqtt.pb.h @@ -54,6 +54,9 @@ typedef struct _meshtastic_MapReport { uint32_t position_precision; /* Number of online nodes (heard in the last 2 hours) this node has in its list that were received locally (not via MQTT) */ uint16_t num_online_local_nodes; + /* User has opted in to share their location (map report) with the mqtt server + Controlled by map_report.should_report_location */ + bool has_opted_report_location; } meshtastic_MapReport; @@ -63,9 +66,9 @@ extern "C" { /* Initializer values for message structs */ #define meshtastic_ServiceEnvelope_init_default {NULL, NULL, NULL} -#define meshtastic_MapReport_init_default {"", "", _meshtastic_Config_DeviceConfig_Role_MIN, _meshtastic_HardwareModel_MIN, "", _meshtastic_Config_LoRaConfig_RegionCode_MIN, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, 0, 0} +#define meshtastic_MapReport_init_default {"", "", _meshtastic_Config_DeviceConfig_Role_MIN, _meshtastic_HardwareModel_MIN, "", _meshtastic_Config_LoRaConfig_RegionCode_MIN, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_ServiceEnvelope_init_zero {NULL, NULL, NULL} -#define meshtastic_MapReport_init_zero {"", "", _meshtastic_Config_DeviceConfig_Role_MIN, _meshtastic_HardwareModel_MIN, "", _meshtastic_Config_LoRaConfig_RegionCode_MIN, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, 0, 0} +#define meshtastic_MapReport_init_zero {"", "", _meshtastic_Config_DeviceConfig_Role_MIN, _meshtastic_HardwareModel_MIN, "", _meshtastic_Config_LoRaConfig_RegionCode_MIN, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, 0, 0, 0} /* Field tags (for use in manual encoding/decoding) */ #define meshtastic_ServiceEnvelope_packet_tag 1 @@ -84,6 +87,7 @@ extern "C" { #define meshtastic_MapReport_altitude_tag 11 #define meshtastic_MapReport_position_precision_tag 12 #define meshtastic_MapReport_num_online_local_nodes_tag 13 +#define meshtastic_MapReport_has_opted_report_location_tag 14 /* Struct field encoding specification for nanopb */ #define meshtastic_ServiceEnvelope_FIELDLIST(X, a) \ @@ -107,7 +111,8 @@ X(a, STATIC, SINGULAR, SFIXED32, latitude_i, 9) \ X(a, STATIC, SINGULAR, SFIXED32, longitude_i, 10) \ X(a, STATIC, SINGULAR, INT32, altitude, 11) \ X(a, STATIC, SINGULAR, UINT32, position_precision, 12) \ -X(a, STATIC, SINGULAR, UINT32, num_online_local_nodes, 13) +X(a, STATIC, SINGULAR, UINT32, num_online_local_nodes, 13) \ +X(a, STATIC, SINGULAR, BOOL, has_opted_report_location, 14) #define meshtastic_MapReport_CALLBACK NULL #define meshtastic_MapReport_DEFAULT NULL @@ -121,7 +126,7 @@ extern const pb_msgdesc_t meshtastic_MapReport_msg; /* Maximum encoded size of messages (where known) */ /* meshtastic_ServiceEnvelope_size depends on runtime parameters */ #define MESHTASTIC_MESHTASTIC_MQTT_PB_H_MAX_SIZE meshtastic_MapReport_size -#define meshtastic_MapReport_size 108 +#define meshtastic_MapReport_size 110 #ifdef __cplusplus } /* extern "C" */ From fc64bea6982a1d6f31b39e4def84e28e26e93988 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 14 May 2025 15:28:09 -0500 Subject: [PATCH 170/461] Unmessagable implementation and defaults (#6811) * Unmessagable implementation and defaults * Router and router late are unmessagable by default * Update src/modules/AdminModule.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/mesh/NodeDB.cpp | 16 ++++++++++++++++ src/modules/AdminModule.cpp | 10 +++++++++- src/modules/NodeInfoModule.cpp | 5 +++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index f22f7bf91..48d22c65d 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -819,10 +819,19 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role) initConfigIntervals(); initModuleConfigIntervals(); config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY; + owner.has_is_unmessagable = true; + owner.is_unmessagable = true; + } else if (role == meshtastic_Config_DeviceConfig_Role_ROUTER_LATE) { + owner.has_is_unmessagable = true; + owner.is_unmessagable = true; } else if (role == meshtastic_Config_DeviceConfig_Role_REPEATER) { + owner.has_is_unmessagable = true; + owner.is_unmessagable = true; config.display.screen_on_secs = 1; config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY; } else if (role == meshtastic_Config_DeviceConfig_Role_SENSOR) { + owner.has_is_unmessagable = true; + owner.is_unmessagable = true; moduleConfig.telemetry.environment_measurement_enabled = true; moduleConfig.telemetry.environment_update_interval = 300; } else if (role == meshtastic_Config_DeviceConfig_Role_LOST_AND_FOUND) { @@ -837,7 +846,12 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role) (meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE | meshtastic_Config_PositionConfig_PositionFlags_SPEED | meshtastic_Config_PositionConfig_PositionFlags_HEADING | meshtastic_Config_PositionConfig_PositionFlags_DOP); moduleConfig.telemetry.device_update_interval = ONE_DAY; + } else if (role == meshtastic_Config_DeviceConfig_Role_TRACKER) { + owner.has_is_unmessagable = true; + owner.is_unmessagable = true; } else if (role == meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) { + owner.has_is_unmessagable = true; + owner.is_unmessagable = true; config.device.node_info_broadcast_secs = ONE_DAY; config.position.position_broadcast_smart_enabled = true; config.position.position_broadcast_secs = 3 * 60; // Every 3 minutes @@ -970,6 +984,8 @@ void NodeDB::installDefaultDeviceState() #endif snprintf(owner.id, sizeof(owner.id), "!%08x", getNodeNum()); // Default node ID now based on nodenum memcpy(owner.macaddr, ourMacAddr, sizeof(owner.macaddr)); + owner.has_is_unmessagable = true; + owner.is_unmessagable = false; } // We reserve a few nodenums for future use diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index cbf82ae73..0fac15b15 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -504,6 +504,12 @@ void AdminModule::handleSetOwner(const meshtastic_User &o) sendWarning(licensedModeMessage); } } + if (owner.has_is_unmessagable != o.has_is_unmessagable || + (o.has_is_unmessagable && owner.is_unmessagable != o.is_unmessagable)) { + changed = 1; + owner.has_is_unmessagable = o.has_is_unmessagable || o.has_is_unmessagable; + owner.is_unmessagable = o.is_unmessagable; + } if (changed) { // If nothing really changed, don't broadcast on the network or write to flash service->reloadOwner(!hasOpenEditTransaction); @@ -553,8 +559,10 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) sendWarning(warning); } // If we're setting router role for the first time, install its intervals - if (existingRole != c.payload_variant.device.role) + if (existingRole != c.payload_variant.device.role) { nodeDB->installRoleDefaults(c.payload_variant.device.role); + changes |= SEGMENT_NODEDATABASE | SEGMENT_DEVICESTATE; // Some role defaults affect owner + } if (config.device.node_info_broadcast_secs < min_node_info_broadcast_secs) { LOG_DEBUG("Tried to set node_info_broadcast_secs too low, setting to %d", min_node_info_broadcast_secs); config.device.node_info_broadcast_secs = min_node_info_broadcast_secs; diff --git a/src/modules/NodeInfoModule.cpp b/src/modules/NodeInfoModule.cpp index ce4a6bd06..5142f2db0 100644 --- a/src/modules/NodeInfoModule.cpp +++ b/src/modules/NodeInfoModule.cpp @@ -86,6 +86,11 @@ meshtastic_MeshPacket *NodeInfoModule::allocReply() u.public_key.bytes[0] = 0; u.public_key.size = 0; } + // Coerce unmessagable for Repeater role + if (u.role == meshtastic_Config_DeviceConfig_Role_REPEATER) { + u.has_is_unmessagable = true; + u.is_unmessagable = true; + } LOG_INFO("Send owner %s/%s/%s", u.id, u.long_name, u.short_name); lastSentToMesh = millis(); From 7cffd9ba7083468816a63d3485c70e1a698dcda3 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 14 May 2025 15:31:28 -0500 Subject: [PATCH 171/461] Added new map report opt-in for compliance and limit map report (and default) to one hour (#6813) * Added new map report opt-in for compliance and limit map report (and default) to one hour * Trunk --- src/mesh/Default.h | 1 + src/mesh/NodeDB.cpp | 5 +++++ src/modules/AdminModule.cpp | 2 +- src/mqtt/MQTT.cpp | 4 +++- src/mqtt/MQTT.h | 4 ++-- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/mesh/Default.h b/src/mesh/Default.h index bc2aa785f..208f992c8 100644 --- a/src/mesh/Default.h +++ b/src/mesh/Default.h @@ -21,6 +21,7 @@ #define default_neighbor_info_broadcast_secs 6 * 60 * 60 #define min_node_info_broadcast_secs 60 * 60 // No regular broadcasts of more than once an hour #define min_neighbor_info_broadcast_secs 4 * 60 * 60 +#define default_map_publish_interval_secs 60 * 60 #define default_mqtt_address "mqtt.meshtastic.org" #define default_mqtt_username "meshdev" diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 48d22c65d..4b1a6d64d 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -328,6 +328,11 @@ NodeDB::NodeDB() moduleConfig.telemetry.health_update_interval = Default::getConfiguredOrMinimumValue( moduleConfig.telemetry.health_update_interval, min_default_telemetry_interval_secs); } + if (moduleConfig.mqtt.has_map_report_settings && + moduleConfig.mqtt.map_report_settings.publish_interval_secs < default_map_publish_interval_secs) { + moduleConfig.mqtt.map_report_settings.publish_interval_secs = default_map_publish_interval_secs; + } + // Ensure that the neighbor info update interval is coerced to the minimum moduleConfig.neighbor_info.update_interval = Default::getConfiguredOrMinimumValue(moduleConfig.neighbor_info.update_interval, min_neighbor_info_broadcast_secs); diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 0fac15b15..3ff4fa74d 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -504,7 +504,7 @@ void AdminModule::handleSetOwner(const meshtastic_User &o) sendWarning(licensedModeMessage); } } - if (owner.has_is_unmessagable != o.has_is_unmessagable || + if (owner.has_is_unmessagable != o.has_is_unmessagable || (o.has_is_unmessagable && owner.is_unmessagable != o.is_unmessagable)) { changed = 1; owner.has_is_unmessagable = o.has_is_unmessagable || o.has_is_unmessagable; diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 3776f59f5..713077272 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -769,7 +769,8 @@ void MQTT::onSend(const meshtastic_MeshPacket &mp_encrypted, const meshtastic_Me void MQTT::perhapsReportToMap() { - if (!moduleConfig.mqtt.map_reporting_enabled || !(moduleConfig.mqtt.proxy_to_client_enabled || isConnectedDirectly())) + if (!moduleConfig.mqtt.map_reporting_enabled || !moduleConfig.mqtt.map_report_settings.should_report_location || + !(moduleConfig.mqtt.proxy_to_client_enabled || isConnectedDirectly())) return; if (Throttle::isWithinTimespanMs(last_report_to_map, map_publish_interval_msecs)) @@ -801,6 +802,7 @@ void MQTT::perhapsReportToMap() mapReport.region = config.lora.region; mapReport.modem_preset = config.lora.modem_preset; mapReport.has_default_channel = channels.hasDefaultChannel(); + mapReport.has_opted_report_location = true; // Set position with precision (same as in PositionModule) if (map_position_precision < 32 && map_position_precision > 0) { diff --git a/src/mqtt/MQTT.h b/src/mqtt/MQTT.h index 2b11f479d..7d5715602 100644 --- a/src/mqtt/MQTT.h +++ b/src/mqtt/MQTT.h @@ -1,5 +1,6 @@ #pragma once +#include "Default.h" #include "configuration.h" #include "concurrency/OSThread.h" @@ -105,8 +106,7 @@ class MQTT : private concurrency::OSThread std::string mapTopic = "/2/map/"; // For protobuf-encoded MapReport messages // For map reporting (only applies when enabled) - const uint32_t default_map_position_precision = 14; // defaults to max. offset of ~1459m - const uint32_t default_map_publish_interval_secs = 60 * 15; // defaults to 15 minutes + const uint32_t default_map_position_precision = 14; // defaults to max. offset of ~1459m uint32_t last_report_to_map = 0; uint32_t map_position_precision = default_map_position_precision; uint32_t map_publish_interval_msecs = default_map_publish_interval_secs * 1000; From 3901ae8956d34130d436182224896aa0d27e890e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 14 May 2025 16:44:32 -0500 Subject: [PATCH 172/461] Default --- test/test_mqtt/MQTT.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_mqtt/MQTT.cpp b/test/test_mqtt/MQTT.cpp index 50a98001a..feb9c7e83 100644 --- a/test/test_mqtt/MQTT.cpp +++ b/test/test_mqtt/MQTT.cpp @@ -308,8 +308,8 @@ const meshtastic_MeshPacket encrypted = { // Initialize mocks and configuration before running each test. void setUp(void) { - moduleConfig.mqtt = - meshtastic_ModuleConfig_MQTTConfig{.enabled = true, .map_reporting_enabled = true, .has_map_report_settings = true}; + moduleConfig.mqtt = meshtastic_ModuleConfig_MQTTConfig{ + .enabled = true, .map_reporting_enabled = true, .has_map_report_settings = true, .should_report_location = true}; channelFile.channels[0] = meshtastic_Channel{ .index = 0, .has_settings = true, From b63b73ab84562887338700c47c46eb6eec45827a Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 14 May 2025 17:16:46 -0500 Subject: [PATCH 173/461] Fix --- test/test_mqtt/MQTT.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_mqtt/MQTT.cpp b/test/test_mqtt/MQTT.cpp index feb9c7e83..a297dc229 100644 --- a/test/test_mqtt/MQTT.cpp +++ b/test/test_mqtt/MQTT.cpp @@ -308,8 +308,10 @@ const meshtastic_MeshPacket encrypted = { // Initialize mocks and configuration before running each test. void setUp(void) { - moduleConfig.mqtt = meshtastic_ModuleConfig_MQTTConfig{ - .enabled = true, .map_reporting_enabled = true, .has_map_report_settings = true, .should_report_location = true}; + moduleConfig.mqtt = + meshtastic_ModuleConfig_MQTTConfig{.enabled = true, .map_reporting_enabled = true, .has_map_report_settings = true}; + mqtt.map_report_settings = meshtastic_ModuleConfig_MQTTConfig_MapReportSettings{ + .position_precision = 14, .publish_interval_secs = 0, .should_report_location = true}; channelFile.channels[0] = meshtastic_Channel{ .index = 0, .has_settings = true, From ed6de5095e9cf3f89c9ce25dafeeab837173d6fd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 17:54:21 -0500 Subject: [PATCH 174/461] [create-pull-request] automated change (#6815) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- .../generated/meshtastic/telemetry.pb.cpp | 3 + src/mesh/generated/meshtastic/telemetry.pb.h | 55 ++++++++++++++++++- 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/protobufs b/protobufs index 47ec99aa4..4eb0aebae 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 47ec99aa4c4a2e3fff71fd5170663f0848deb021 +Subproject commit 4eb0aebaef1304a5516b6fa864cb4c55daed9147 diff --git a/src/mesh/generated/meshtastic/telemetry.pb.cpp b/src/mesh/generated/meshtastic/telemetry.pb.cpp index c79941fa5..b54cbb00e 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.cpp +++ b/src/mesh/generated/meshtastic/telemetry.pb.cpp @@ -24,6 +24,9 @@ PB_BIND(meshtastic_LocalStats, meshtastic_LocalStats, AUTO) PB_BIND(meshtastic_HealthMetrics, meshtastic_HealthMetrics, AUTO) +PB_BIND(meshtastic_HostMetrics, meshtastic_HostMetrics, AUTO) + + PB_BIND(meshtastic_Telemetry, meshtastic_Telemetry, AUTO) diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index be3fa0907..1c5eb4843 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -290,6 +290,28 @@ typedef struct _meshtastic_HealthMetrics { float temperature; } meshtastic_HealthMetrics; +/* Linux host metrics */ +typedef struct _meshtastic_HostMetrics { + /* Host system uptime */ + uint32_t uptime_seconds; + /* Host system free memory */ + uint64_t freemem_bytes; + /* Host system disk space free for / */ + uint64_t diskfree1_bytes; + /* Secondary system disk space free */ + bool has_diskfree2_bytes; + uint64_t diskfree2_bytes; + /* Tertiary disk space free */ + bool has_diskfree3_bytes; + uint64_t diskfree3_bytes; + /* Host system one minute load in 1/100ths */ + uint16_t load1; + /* Host system five minute load in 1/100ths */ + uint16_t load5; + /* Host system fifteen minute load in 1/100ths */ + uint16_t load15; +} meshtastic_HostMetrics; + /* Types of Measurements the telemetry module is equipped to handle */ typedef struct _meshtastic_Telemetry { /* Seconds since 1970 - or 0 for unknown/unset */ @@ -308,6 +330,8 @@ typedef struct _meshtastic_Telemetry { meshtastic_LocalStats local_stats; /* Health telemetry metrics */ meshtastic_HealthMetrics health_metrics; + /* Linux host metrics */ + meshtastic_HostMetrics host_metrics; } variant; } meshtastic_Telemetry; @@ -338,6 +362,7 @@ extern "C" { + /* Initializer values for message structs */ #define meshtastic_DeviceMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_EnvironmentMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} @@ -345,6 +370,7 @@ extern "C" { #define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0} +#define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0} #define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}} #define meshtastic_Nau7802Config_init_default {0, 0} #define meshtastic_DeviceMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0} @@ -353,6 +379,7 @@ extern "C" { #define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0} +#define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0} #define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}} #define meshtastic_Nau7802Config_init_zero {0, 0} @@ -417,6 +444,14 @@ extern "C" { #define meshtastic_HealthMetrics_heart_bpm_tag 1 #define meshtastic_HealthMetrics_spO2_tag 2 #define meshtastic_HealthMetrics_temperature_tag 3 +#define meshtastic_HostMetrics_uptime_seconds_tag 1 +#define meshtastic_HostMetrics_freemem_bytes_tag 2 +#define meshtastic_HostMetrics_diskfree1_bytes_tag 3 +#define meshtastic_HostMetrics_diskfree2_bytes_tag 4 +#define meshtastic_HostMetrics_diskfree3_bytes_tag 5 +#define meshtastic_HostMetrics_load1_tag 6 +#define meshtastic_HostMetrics_load5_tag 7 +#define meshtastic_HostMetrics_load15_tag 8 #define meshtastic_Telemetry_time_tag 1 #define meshtastic_Telemetry_device_metrics_tag 2 #define meshtastic_Telemetry_environment_metrics_tag 3 @@ -424,6 +459,7 @@ extern "C" { #define meshtastic_Telemetry_power_metrics_tag 5 #define meshtastic_Telemetry_local_stats_tag 6 #define meshtastic_Telemetry_health_metrics_tag 7 +#define meshtastic_Telemetry_host_metrics_tag 8 #define meshtastic_Nau7802Config_zeroOffset_tag 1 #define meshtastic_Nau7802Config_calibrationFactor_tag 2 @@ -512,6 +548,18 @@ X(a, STATIC, OPTIONAL, FLOAT, temperature, 3) #define meshtastic_HealthMetrics_CALLBACK NULL #define meshtastic_HealthMetrics_DEFAULT NULL +#define meshtastic_HostMetrics_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, uptime_seconds, 1) \ +X(a, STATIC, SINGULAR, UINT64, freemem_bytes, 2) \ +X(a, STATIC, SINGULAR, UINT64, diskfree1_bytes, 3) \ +X(a, STATIC, OPTIONAL, UINT64, diskfree2_bytes, 4) \ +X(a, STATIC, OPTIONAL, UINT64, diskfree3_bytes, 5) \ +X(a, STATIC, SINGULAR, UINT32, load1, 6) \ +X(a, STATIC, SINGULAR, UINT32, load5, 7) \ +X(a, STATIC, SINGULAR, UINT32, load15, 8) +#define meshtastic_HostMetrics_CALLBACK NULL +#define meshtastic_HostMetrics_DEFAULT NULL + #define meshtastic_Telemetry_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, FIXED32, time, 1) \ X(a, STATIC, ONEOF, MESSAGE, (variant,device_metrics,variant.device_metrics), 2) \ @@ -519,7 +567,8 @@ X(a, STATIC, ONEOF, MESSAGE, (variant,environment_metrics,variant.environm X(a, STATIC, ONEOF, MESSAGE, (variant,air_quality_metrics,variant.air_quality_metrics), 4) \ X(a, STATIC, ONEOF, MESSAGE, (variant,power_metrics,variant.power_metrics), 5) \ X(a, STATIC, ONEOF, MESSAGE, (variant,local_stats,variant.local_stats), 6) \ -X(a, STATIC, ONEOF, MESSAGE, (variant,health_metrics,variant.health_metrics), 7) +X(a, STATIC, ONEOF, MESSAGE, (variant,health_metrics,variant.health_metrics), 7) \ +X(a, STATIC, ONEOF, MESSAGE, (variant,host_metrics,variant.host_metrics), 8) #define meshtastic_Telemetry_CALLBACK NULL #define meshtastic_Telemetry_DEFAULT NULL #define meshtastic_Telemetry_variant_device_metrics_MSGTYPE meshtastic_DeviceMetrics @@ -528,6 +577,7 @@ X(a, STATIC, ONEOF, MESSAGE, (variant,health_metrics,variant.health_metric #define meshtastic_Telemetry_variant_power_metrics_MSGTYPE meshtastic_PowerMetrics #define meshtastic_Telemetry_variant_local_stats_MSGTYPE meshtastic_LocalStats #define meshtastic_Telemetry_variant_health_metrics_MSGTYPE meshtastic_HealthMetrics +#define meshtastic_Telemetry_variant_host_metrics_MSGTYPE meshtastic_HostMetrics #define meshtastic_Nau7802Config_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, INT32, zeroOffset, 1) \ @@ -541,6 +591,7 @@ extern const pb_msgdesc_t meshtastic_PowerMetrics_msg; extern const pb_msgdesc_t meshtastic_AirQualityMetrics_msg; extern const pb_msgdesc_t meshtastic_LocalStats_msg; extern const pb_msgdesc_t meshtastic_HealthMetrics_msg; +extern const pb_msgdesc_t meshtastic_HostMetrics_msg; extern const pb_msgdesc_t meshtastic_Telemetry_msg; extern const pb_msgdesc_t meshtastic_Nau7802Config_msg; @@ -551,6 +602,7 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg; #define meshtastic_AirQualityMetrics_fields &meshtastic_AirQualityMetrics_msg #define meshtastic_LocalStats_fields &meshtastic_LocalStats_msg #define meshtastic_HealthMetrics_fields &meshtastic_HealthMetrics_msg +#define meshtastic_HostMetrics_fields &meshtastic_HostMetrics_msg #define meshtastic_Telemetry_fields &meshtastic_Telemetry_msg #define meshtastic_Nau7802Config_fields &meshtastic_Nau7802Config_msg @@ -560,6 +612,7 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg; #define meshtastic_DeviceMetrics_size 27 #define meshtastic_EnvironmentMetrics_size 113 #define meshtastic_HealthMetrics_size 11 +#define meshtastic_HostMetrics_size 62 #define meshtastic_LocalStats_size 60 #define meshtastic_Nau7802Config_size 16 #define meshtastic_PowerMetrics_size 30 From 60d2cb35e026040013e98c102761def6498d48b9 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 14 May 2025 18:55:27 -0500 Subject: [PATCH 175/461] Namespace --- test/test_mqtt/MQTT.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_mqtt/MQTT.cpp b/test/test_mqtt/MQTT.cpp index a297dc229..3cd56cfb6 100644 --- a/test/test_mqtt/MQTT.cpp +++ b/test/test_mqtt/MQTT.cpp @@ -310,7 +310,7 @@ void setUp(void) { moduleConfig.mqtt = meshtastic_ModuleConfig_MQTTConfig{.enabled = true, .map_reporting_enabled = true, .has_map_report_settings = true}; - mqtt.map_report_settings = meshtastic_ModuleConfig_MQTTConfig_MapReportSettings{ + mqtt.map_report_settings = meshtastic_ModuleConfig_MapReportSettings{ .position_precision = 14, .publish_interval_secs = 0, .should_report_location = true}; channelFile.channels[0] = meshtastic_Channel{ .index = 0, From ef9d0d7805a012cd48af90ff702ee7c082512628 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 14 May 2025 20:22:01 -0500 Subject: [PATCH 176/461] Go --- test/test_mqtt/MQTT.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_mqtt/MQTT.cpp b/test/test_mqtt/MQTT.cpp index 3cd56cfb6..c1f5da358 100644 --- a/test/test_mqtt/MQTT.cpp +++ b/test/test_mqtt/MQTT.cpp @@ -310,8 +310,8 @@ void setUp(void) { moduleConfig.mqtt = meshtastic_ModuleConfig_MQTTConfig{.enabled = true, .map_reporting_enabled = true, .has_map_report_settings = true}; - mqtt.map_report_settings = meshtastic_ModuleConfig_MapReportSettings{ - .position_precision = 14, .publish_interval_secs = 0, .should_report_location = true}; + moduleConfig.mqtt.map_report_settings = meshtastic_ModuleConfig_MapReportSettings{ + .publish_interval_secs = 0, .position_precision = 14, .should_report_location = true}; channelFile.channels[0] = meshtastic_Channel{ .index = 0, .has_settings = true, From 6bba17d463b9cf114b1db9bb420ad1ea075bd974 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Thu, 15 May 2025 19:26:41 +1000 Subject: [PATCH 177/461] Add suppport for Quectel L80 (#6803) * Add suppport for Quectel L80 Another PMTK family chip, requires only a modification to the probe code. * Update support for L80 based on testing. --- src/gps/GPS.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index e234fdb4a..142241c43 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -1250,11 +1250,10 @@ GnssModel_t GPS::probe(int serialSpeed) // Close all NMEA sentences, valid for MTK3333 and MTK3339 platforms _serial_gps->write("$PMTK514,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*2E\r\n"); delay(20); - std::vector mtk = {{"L76B", "Quectel-L76B", GNSS_MODEL_MTK_L76B}, - {"PA1010D", "1010D", GNSS_MODEL_MTK_PA1010D}, - {"PA1616S", "1616S", GNSS_MODEL_MTK_PA1616S}, - {"LS20031", "MC-1513", GNSS_MODEL_MTK_L76B}, - {"L96", "Quectel-L96", GNSS_MODEL_MTK_L76B}}; + std::vector mtk = {{"L76B", "Quectel-L76B", GNSS_MODEL_MTK_L76B}, {"PA1010D", "1010D", GNSS_MODEL_MTK_PA1010D}, + {"PA1616S", "1616S", GNSS_MODEL_MTK_PA1616S}, {"LS20031", "MC-1513", GNSS_MODEL_MTK_L76B}, + {"L96", "Quectel-L96", GNSS_MODEL_MTK_L76B}, {"L80-R", "_3337_", GNSS_MODEL_MTK_L76B}, + {"L80", "_3339_", GNSS_MODEL_MTK_L76B}}; PROBE_FAMILY("MTK Family", "$PMTK605*31", mtk, 500); From c2d586216103192995d1059809ef213f38dc4592 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 06:40:07 -0500 Subject: [PATCH 178/461] automated bumps (#6820) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 7 +++++-- version.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index b98b54dd4..1a7ad284d 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.9 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.8 diff --git a/debian/changelog b/debian/changelog index 8fce06c14..ae27bc3e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.6.8.0) UNRELEASED; urgency=medium +meshtasticd (2.6.9.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging @@ -10,4 +10,7 @@ meshtasticd (2.6.8.0) UNRELEASED; urgency=medium [ ] * GitHub Actions Automatic version bump - -- Tue, 06 May 2025 01:32:49 +0000 + [ ] + * GitHub Actions Automatic version bump + + -- Thu, 15 May 2025 11:13:30 +0000 diff --git a/version.properties b/version.properties index bedba21b7..b0e960697 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 6 -build = 8 +build = 9 From 7d8f9c7f6df516d8c2561f3c3979581ab5209f47 Mon Sep 17 00:00:00 2001 From: Austin Date: Thu, 15 May 2025 07:40:46 -0400 Subject: [PATCH 179/461] Stop the madness! Run as a user (not root) (#6718) * Stop the madness! Run as a user (not root) * Trigger fsdir migration for < 2.6.9 --------- Co-authored-by: Ben Meadors --- .trunk/trunk.yaml | 1 - Dockerfile | 14 ++++-- alpine.Dockerfile | 11 ++++- bin/99-meshtasticd-udev.rules | 4 ++ bin/config-dist.yaml | 2 +- bin/meshtasticd.service | 7 +-- bin/native-install.sh | 2 +- debian/control | 6 ++- debian/meshtasticd.dirs | 3 +- debian/meshtasticd.install | 4 +- debian/meshtasticd.postinst | 79 ++++++++++++++++++++++++++++++ debian/meshtasticd.postrm | 41 ++++++++++++++++ debian/meshtasticd.udev | 4 ++ meshtasticd.spec.rpkg | 66 +++++++++++++++++++++++-- src/mesh/raspihttp/PiWebServer.cpp | 4 +- 15 files changed, 225 insertions(+), 23 deletions(-) create mode 100644 bin/99-meshtasticd-udev.rules create mode 100755 debian/meshtasticd.postinst create mode 100755 debian/meshtasticd.postrm create mode 100644 debian/meshtasticd.udev diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 4aa5527be..79bdf4778 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -13,7 +13,6 @@ lint: - trufflehog@3.88.29 - yamllint@1.37.1 - bandit@1.8.3 - - terrascan@1.19.9 - trivy@0.62.1 - taplo@0.9.3 - ruff@0.11.9 diff --git a/Dockerfile b/Dockerfile index 6c1b83653..e033b1bba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,3 @@ -# trunk-ignore-all(terrascan/AC_DOCKER_0002): Known terrascan issue # trunk-ignore-all(trivy/DS002): We must run as root for this container # trunk-ignore-all(hadolint/DL3002): We must run as root for this container # trunk-ignore-all(hadolint/DL3008): Do not pin apt package versions @@ -38,6 +37,13 @@ RUN curl -L "https://github.com/meshtastic/web/releases/download/v$(cat /tmp/fir ##### PRODUCTION BUILD ############# FROM debian:bookworm-slim +LABEL org.opencontainers.image.title="Meshtastic" \ + org.opencontainers.image.description="Debian Meshtastic daemon and web interface" \ + org.opencontainers.image.url="https://meshtastic.org" \ + org.opencontainers.image.documentation="https://meshtastic.org/docs/" \ + org.opencontainers.image.authors="Meshtastic" \ + org.opencontainers.image.licenses="GPL-3.0-or-later" \ + org.opencontainers.image.source="https://github.com/meshtastic/firmware/" ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Etc/UTC @@ -54,7 +60,7 @@ RUN apt-get update && apt-get --no-install-recommends -y install \ && mkdir -p /etc/meshtasticd/ssl # Fetch compiled binary from the builder -COPY --from=builder /tmp/firmware/release/meshtasticd /usr/sbin/ +COPY --from=builder /tmp/firmware/release/meshtasticd /usr/bin/ COPY --from=builder /tmp/web /usr/share/meshtasticd/ # Copy config templates COPY ./bin/config.d /etc/meshtasticd/available.d @@ -65,8 +71,8 @@ VOLUME /var/lib/meshtasticd # Expose Meshtastic TCP API port from the host EXPOSE 4403 # Expose Meshtastic Web UI port from the host -EXPOSE 443 +EXPOSE 9443 -CMD [ "sh", "-cx", "meshtasticd -d /var/lib/meshtasticd" ] +CMD [ "sh", "-cx", "meshtasticd --fsdir=/var/lib/meshtasticd" ] HEALTHCHECK NONE diff --git a/alpine.Dockerfile b/alpine.Dockerfile index 350129040..bf7cad6d4 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -28,12 +28,19 @@ RUN bash ./bin/build-native.sh "$PIO_ENV" && \ # ##### PRODUCTION BUILD ############# FROM alpine:3.21 +LABEL org.opencontainers.image.title="Meshtastic" \ + org.opencontainers.image.description="Alpine Meshtastic daemon" \ + org.opencontainers.image.url="https://meshtastic.org" \ + org.opencontainers.image.documentation="https://meshtastic.org/docs/" \ + org.opencontainers.image.authors="Meshtastic" \ + org.opencontainers.image.licenses="GPL-3.0-or-later" \ + org.opencontainers.image.source="https://github.com/meshtastic/firmware/" # nosemgrep: dockerfile.security.last-user-is-root.last-user-is-root USER root RUN apk --no-cache add \ - libstdc++ libgpiod yaml-cpp libusb i2c-tools libuv \ + shadow libstdc++ libgpiod yaml-cpp libusb i2c-tools libuv \ libx11 libinput libxkbcommon \ && rm -rf /var/cache/apk/* \ && mkdir -p /var/lib/meshtasticd \ @@ -41,7 +48,7 @@ RUN apk --no-cache add \ && mkdir -p /etc/meshtasticd/ssl # Fetch compiled binary from the builder -COPY --from=builder /tmp/firmware/release/meshtasticd /usr/sbin/ +COPY --from=builder /tmp/firmware/release/meshtasticd /usr/bin/ # Copy config templates COPY ./bin/config.d /etc/meshtasticd/available.d diff --git a/bin/99-meshtasticd-udev.rules b/bin/99-meshtasticd-udev.rules new file mode 100644 index 000000000..69a468d7a --- /dev/null +++ b/bin/99-meshtasticd-udev.rules @@ -0,0 +1,4 @@ +# Set spidev ownership to 'spi' group. +SUBSYSTEM=="spidev", KERNEL=="spidev*", GROUP="spi", MODE="0660" +# Allow access to USB CH341 devices +SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5512", MODE="0666" diff --git a/bin/config-dist.yaml b/bin/config-dist.yaml index 9238d0e56..98c7696f0 100644 --- a/bin/config-dist.yaml +++ b/bin/config-dist.yaml @@ -188,7 +188,7 @@ Logging: # AsciiLogs: true # default if not specified is !isatty() on stdout Webserver: -# Port: 443 # Port for Webserver & Webservices +# Port: 9443 # Port for Webserver & Webservices # RootPath: /usr/share/meshtasticd/web # Root Dir of WebServer # SSLKey: /etc/meshtasticd/ssl/private_key.pem # Path to SSL Key, generated if not present # SSLCert: /etc/meshtasticd/ssl/certificate.pem # Path to SSL Certificate, generated if not present diff --git a/bin/meshtasticd.service b/bin/meshtasticd.service index 1e8ee98b8..63430bae8 100644 --- a/bin/meshtasticd.service +++ b/bin/meshtasticd.service @@ -5,10 +5,11 @@ StartLimitInterval=200 StartLimitBurst=5 [Service] -User=root -Group=root +AmbientCapabilities=CAP_NET_BIND_SERVICE +User=meshtasticd +Group=meshtasticd Type=simple -ExecStart=/usr/sbin/meshtasticd +ExecStart=/usr/bin/meshtasticd Restart=always RestartSec=3 diff --git a/bin/native-install.sh b/bin/native-install.sh index a8fcc29a6..18cd9205b 100755 --- a/bin/native-install.sh +++ b/bin/native-install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -cp "release/meshtasticd_linux_$(uname -m)" /usr/sbin/meshtasticd +cp "release/meshtasticd_linux_$(uname -m)" /usr/bin/meshtasticd mkdir -p /etc/meshtasticd if [[ -f "/etc/meshtasticd/config.yaml" ]]; then cp bin/config-dist.yaml /etc/meshtasticd/config-upgrade.yaml diff --git a/debian/control b/debian/control index 9277f6f54..761383a5c 100644 --- a/debian/control +++ b/debian/control @@ -31,7 +31,9 @@ Rules-Requires-Root: no Package: meshtasticd Architecture: any -Depends: ${misc:Depends}, ${shlibs:Depends} +Depends: adduser, + ${misc:Depends}, + ${shlibs:Depends} Description: Meshtastic daemon for communicating with Meshtastic devices Meshtastic is an off-grid text communication platform that uses inexpensive - LoRa radios. \ No newline at end of file + LoRa radios. diff --git a/debian/meshtasticd.dirs b/debian/meshtasticd.dirs index 45a1ca3db..a667768b2 100644 --- a/debian/meshtasticd.dirs +++ b/debian/meshtasticd.dirs @@ -1,5 +1,6 @@ +var/lib/meshtasticd etc/meshtasticd etc/meshtasticd/config.d etc/meshtasticd/available.d usr/share/meshtasticd/web -etc/meshtasticd/ssl \ No newline at end of file +etc/meshtasticd/ssl diff --git a/debian/meshtasticd.install b/debian/meshtasticd.install index 6b6b5a361..3c68b42b1 100644 --- a/debian/meshtasticd.install +++ b/debian/meshtasticd.install @@ -1,8 +1,8 @@ -.pio/build/native-tft/meshtasticd usr/sbin +.pio/build/native-tft/meshtasticd usr/bin bin/config.yaml etc/meshtasticd bin/config.d/* etc/meshtasticd/available.d bin/meshtasticd.service lib/systemd/system -web/* usr/share/meshtasticd/web \ No newline at end of file +web/* usr/share/meshtasticd/web diff --git a/debian/meshtasticd.postinst b/debian/meshtasticd.postinst new file mode 100755 index 000000000..324865718 --- /dev/null +++ b/debian/meshtasticd.postinst @@ -0,0 +1,79 @@ +#!/bin/sh +# postinst script for meshtasticd +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure|reconfigure) + # create spi group (for udev rules) + # this group already exists on Raspberry Pi OS + getent group spi >/dev/null 2>/dev/null || addgroup --system spi + # create a meshtasticd group and user + getent passwd meshtasticd >/dev/null 2>/dev/null || adduser --system --home /var/lib/meshtasticd --no-create-home meshtasticd + getent group meshtasticd >/dev/null 2>/dev/null || addgroup --system meshtasticd + adduser meshtasticd meshtasticd >/dev/null 2>/dev/null + adduser meshtasticd spi >/dev/null 2>/dev/null + # add meshtasticd user to appropriate groups (if they exist) + getent group gpio >/dev/null 2>/dev/null && adduser meshtasticd gpio >/dev/null 2>/dev/null + getent group plugdev >/dev/null 2>/dev/null && adduser meshtasticd plugdev >/dev/null 2>/dev/null + getent group dialout >/dev/null 2>/dev/null && adduser meshtasticd dialout >/dev/null 2>/dev/null + getent group i2c >/dev/null 2>/dev/null && adduser meshtasticd i2c >/dev/null 2>/dev/null + getent group video >/dev/null 2>/dev/null && adduser meshtasticd video >/dev/null 2>/dev/null + getent group audio >/dev/null 2>/dev/null && adduser meshtasticd audio >/dev/null 2>/dev/null + getent group input >/dev/null 2>/dev/null && adduser meshtasticd input >/dev/null 2>/dev/null + + + # migrate /root/.portduino to /var/lib/meshtasticd/.portduino + # should only run once, upon upgrade from < 2.6.9 + if [ -n "$2" ] && dpkg --compare-versions "$2" lt 2.6.9; then + if [ -d /root/.portduino ] && [ ! -e /var/lib/meshtasticd/.portduino ]; then + cp -r /root/.portduino /var/lib/meshtasticd/.portduino + echo "Migrated meshtasticd VFS from /root/.portduino to /var/lib/meshtasticd/.portduino" + echo "meshtasticd now runs as the 'meshtasticd' user, not 'root'." + echo "See https://github.com/meshtastic/firmware/pull/6718 for details" + fi + fi + + if [ -d /var/lib/meshtasticd ]; then + chown -R meshtasticd:meshtasticd /var/lib/meshtasticd + fi + + if [ -d /etc/meshtasticd ]; then + chown -R meshtasticd:meshtasticd /etc/meshtasticd + fi + + if [ -d /usr/share/meshtasticd ]; then + chown -R meshtasticd:meshtasticd /usr/share/meshtasticd + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/meshtasticd.postrm b/debian/meshtasticd.postrm new file mode 100755 index 000000000..bb2c32a5b --- /dev/null +++ b/debian/meshtasticd.postrm @@ -0,0 +1,41 @@ +#!/bin/sh +# postrm script for meshtasticd +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + # Only remove /var/lib/meshtasticd on purge + if [ "${1}" = "purge" ] ; then + rm -rf /var/lib/meshtasticd + fi + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/meshtasticd.udev b/debian/meshtasticd.udev new file mode 100644 index 000000000..69a468d7a --- /dev/null +++ b/debian/meshtasticd.udev @@ -0,0 +1,4 @@ +# Set spidev ownership to 'spi' group. +SUBSYSTEM=="spidev", KERNEL=="spidev*", GROUP="spi", MODE="0660" +# Allow access to USB CH341 devices +SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5512", MODE="0666" diff --git a/meshtasticd.spec.rpkg b/meshtasticd.spec.rpkg index 2d777bc76..eb4ab5ae7 100644 --- a/meshtasticd.spec.rpkg +++ b/meshtasticd.spec.rpkg @@ -10,6 +10,8 @@ # - https://docs.pagure.org/rpkg-util/v3/index.html # - https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/ +%global meshtasticd_user meshtasticd + Name: meshtasticd # Version Ex: 2.5.19 Version: {{{ meshtastic_version }}} @@ -47,6 +49,8 @@ BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(libinput) BuildRequires: pkgconfig(xkbcommon-x11) +Requires: systemd-udev + %description Meshtastic daemon for controlling Meshtastic devices. Meshtastic is an off-grid text communication platform that uses inexpensive LoRa radios. @@ -63,15 +67,25 @@ gzip -dr web platformio run -e native-tft %install -mkdir -p %{buildroot}%{_sbindir} -install -m 0755 .pio/build/native-tft/program %{buildroot}%{_sbindir}/meshtasticd +# Install meshtasticd binary +mkdir -p %{buildroot}%{_bindir} +install -m 0755 .pio/build/native-tft/program %{buildroot}%{_bindir}/meshtasticd +# Install portduino VFS dir +install -p -d -m 0770 %{buildroot}%{_localstatedir}/lib/meshtasticd + +# Install udev rules +mkdir -p %{buildroot}%{_udevrulesdir} +install -m 0644 bin/99-meshtasticd-udev.rules %{buildroot}%{_udevrulesdir}/99-meshtasticd-udev.rules + +# Install config dirs mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd install -m 0644 bin/config-dist.yaml %{buildroot}%{_sysconfdir}/meshtasticd/config.yaml mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/config.d mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/available.d cp -r bin/config.d/* %{buildroot}%{_sysconfdir}/meshtasticd/available.d +# Install systemd service install -D -m 0644 bin/meshtasticd.service %{buildroot}%{_unitdir}/meshtasticd.service # Install the web files under /usr/share/meshtasticd/web @@ -80,10 +94,54 @@ cp -r web/* %{buildroot}%{_datadir}/meshtasticd/web # Install default SSL storage directory (for web) mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/ssl +%pre +# create spi group (for udev rules) +getent group spi > /dev/null || groupadd -r spi +# create a meshtasticd group and user +getent group %{meshtasticd_user} > /dev/null || groupadd -r %{meshtasticd_user} +getent passwd %{meshtasticd_user} > /dev/null || \ + useradd -r -d %{_localstatedir}/lib/meshtasticd -g %{meshtasticd_user} -G spi \ + -s /sbin/nologin -c "Meshtastic Daemon" %{meshtasticd_user} +# add meshtasticd user to appropriate groups (if they exist) +getent group gpio > /dev/null && usermod -a -G gpio %{meshtasticd_user} > /dev/null +getent group plugdev > /dev/null && usermod -a -G plugdev %{meshtasticd_user} > /dev/null +getent group dialout > /dev/null && usermod -a -G dialout %{meshtasticd_user} > /dev/null +getent group i2c > /dev/null && usermod -a -G i2c %{meshtasticd_user} > /dev/null +getent group video > /dev/null && usermod -a -G video %{meshtasticd_user} > /dev/null +getent group audio > /dev/null && usermod -a -G audio %{meshtasticd_user} > /dev/null +getent group input > /dev/null && usermod -a -G input %{meshtasticd_user} > /dev/null +exit 0 + +%triggerin -- meshtasticd < 2.6.9 +# migrate .portduino (if it exists and hasn’t already been copied) +if [ -d /root/.portduino ] && [ ! -e /var/lib/meshtasticd/.portduino ]; then + mkdir -p /var/lib/meshtasticd + cp -r /root/.portduino /var/lib/meshtasticd/.portduino + chown -R %{meshtasticd_user}:%{meshtasticd_user} \ + %{_localstatedir}/lib/meshtasticd || : + # Fix SELinux labels if present (no-op on non-SELinux systems) + restorecon -R /var/lib/meshtasticd/.portduino 2>/dev/null || : + echo "Migrated meshtasticd VFS from /root/.portduino to /var/lib/meshtasticd/.portduino" + echo "meshtasticd now runs as the 'meshtasticd' user, not 'root'." + echo "See https://github.com/meshtastic/firmware/pull/6718 for details" +fi + +%post +%systemd_post meshtasticd.service + +%preun +%systemd_preun meshtasticd.service + +%postun +%systemd_postun_with_restart meshtasticd.service + %files +%defattr(-,%{meshtasticd_user},%{meshtasticd_user}) %license LICENSE %doc README.md -%{_sbindir}/meshtasticd +%{_bindir}/meshtasticd +%dir %{_localstatedir}/lib/meshtasticd +%{_udevrulesdir}/99-meshtasticd-udev.rules %dir %{_sysconfdir}/meshtasticd %dir %{_sysconfdir}/meshtasticd/config.d %dir %{_sysconfdir}/meshtasticd/available.d @@ -96,4 +154,4 @@ mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/ssl %dir %{_sysconfdir}/meshtasticd/ssl %changelog -%autochangelog \ No newline at end of file +%autochangelog diff --git a/src/mesh/raspihttp/PiWebServer.cpp b/src/mesh/raspihttp/PiWebServer.cpp index 4fae0bc3d..7d3542e83 100644 --- a/src/mesh/raspihttp/PiWebServer.cpp +++ b/src/mesh/raspihttp/PiWebServer.cpp @@ -462,8 +462,8 @@ PiWebServerThread::PiWebServerThread() webservport = settingsMap[webserverport]; LOG_INFO("Use webserver port from yaml config %i ", webservport); } else { - LOG_INFO("Webserver port in yaml config set to 0, defaulting to port 443"); - webservport = 443; + LOG_INFO("Webserver port in yaml config set to 0, defaulting to port 9443"); + webservport = 9443; } // Web Content Service Instance From 1ef4caea05939c23cf3dfdedbf250bc0eff8b04e Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 15 May 2025 09:23:37 -0500 Subject: [PATCH 180/461] Host metrics (#6817) * Add std::string exec() function to PortduinoGlue for future work * MVP for HostMetrics module. * Fix compilation for other targets * Remove extra debug calls * Big numbers don't do well as INTs. * Add HostMetrics to config.yaml --- bin/config-dist.yaml | 6 ++ src/modules/Modules.cpp | 4 + src/modules/Telemetry/HostMetrics.cpp | 131 +++++++++++++++++++++++ src/modules/Telemetry/HostMetrics.h | 40 +++++++ src/platform/portduino/PortduinoGlue.cpp | 19 ++++ src/platform/portduino/PortduinoGlue.h | 7 +- 6 files changed, 205 insertions(+), 2 deletions(-) create mode 100644 src/modules/Telemetry/HostMetrics.cpp create mode 100644 src/modules/Telemetry/HostMetrics.h diff --git a/bin/config-dist.yaml b/bin/config-dist.yaml index 98c7696f0..2907e4aab 100644 --- a/bin/config-dist.yaml +++ b/bin/config-dist.yaml @@ -193,6 +193,12 @@ Webserver: # SSLKey: /etc/meshtasticd/ssl/private_key.pem # Path to SSL Key, generated if not present # SSLCert: /etc/meshtasticd/ssl/certificate.pem # Path to SSL Certificate, generated if not present + +HostMetrics: +# ReportInterval: 30 # Interval in minutes between HostMetrics report packets, or 0 for disabled +# Channel: 0 # channel to send Host Metrics over. Defaults to the primary channel. + + General: MaxNodes: 200 MaxMessageQueue: 100 diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp index 1f2b50057..fac2ca976 100644 --- a/src/modules/Modules.cpp +++ b/src/modules/Modules.cpp @@ -49,6 +49,7 @@ #endif #if ARCH_PORTDUINO #include "input/LinuxInputImpl.h" +#include "modules/Telemetry/HostMetrics.h" #if !MESHTASTIC_EXCLUDE_STOREFORWARD #include "modules/StoreForwardModule.h" #endif @@ -196,6 +197,9 @@ void setupModules() #if HAS_SCREEN && !MESHTASTIC_EXCLUDE_CANNEDMESSAGES cannedMessageModule = new CannedMessageModule(); #endif +#if ARCH_PORTDUINO + new HostMetricsModule(); +#endif #if HAS_TELEMETRY new DeviceTelemetryModule(); #endif diff --git a/src/modules/Telemetry/HostMetrics.cpp b/src/modules/Telemetry/HostMetrics.cpp new file mode 100644 index 000000000..655be4b25 --- /dev/null +++ b/src/modules/Telemetry/HostMetrics.cpp @@ -0,0 +1,131 @@ +#include "HostMetrics.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "MeshService.h" +#if ARCH_PORTDUINO +#include "PortduinoGlue.h" +#include +#endif + +int32_t HostMetricsModule::runOnce() +{ +#if ARCH_PORTDUINO + if (settingsMap[hostMetrics_interval] == 0) { + return disable(); + } else { + sendMetrics(); + return 60 * 1000 * settingsMap[hostMetrics_interval]; + } +#else + return disable(); +#endif +} + +bool HostMetricsModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Telemetry *t) +{ + // Don't worry about storing telemetry in NodeDB if we're a repeater + if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) + return false; + + if (t->which_variant == meshtastic_Telemetry_host_metrics_tag) { +#ifdef DEBUG_PORT + const char *sender = getSenderShortName(mp); + + LOG_INFO("(Received Host Metrics from %s): uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f", sender, + t->variant.host_metrics.uptime_seconds, t->variant.host_metrics.diskfree1_bytes, + t->variant.host_metrics.freemem_bytes, static_cast(t->variant.host_metrics.load1) / 100, + static_cast(t->variant.host_metrics.load5) / 100, + static_cast(t->variant.host_metrics.load15) / 100); +#endif + } + return false; // Let others look at this message also if they want +} + +/* +meshtastic_MeshPacket *HostMetricsModule::allocReply() +{ + if (currentRequest) { + auto req = *currentRequest; + const auto &p = req.decoded; + meshtastic_Telemetry scratch; + meshtastic_Telemetry *decoded = NULL; + memset(&scratch, 0, sizeof(scratch)); + if (pb_decode_from_bytes(p.payload.bytes, p.payload.size, &meshtastic_HostMetrics_msg, &scratch)) { + decoded = &scratch; + } else { + LOG_ERROR("Error decoding HostMetrics module!"); + return NULL; + } + // Check for a request for device metrics + if (decoded->which_variant == meshtastic_Telemetry_host_metrics_tag) { + LOG_INFO("Device telemetry reply to request"); + return allocDataProtobuf(getHostMetrics()); + } + } + return NULL; +} + */ + +#if ARCH_PORTDUINO +meshtastic_Telemetry HostMetricsModule::getHostMetrics() +{ + std::string file_line; + meshtastic_Telemetry t = meshtastic_HostMetrics_init_zero; + t.which_variant = meshtastic_Telemetry_host_metrics_tag; + + if (access("/proc/uptime", R_OK) == 0) { + std::ifstream proc_uptime("/proc/uptime"); + if (proc_uptime.is_open()) { + std::getline(proc_uptime, file_line, ' '); + proc_uptime.close(); + t.variant.host_metrics.uptime_seconds = stoul(file_line); + } + } + + std::filesystem::space_info root = std::filesystem::space("/"); + t.variant.host_metrics.diskfree1_bytes = root.available; + + if (access("/proc/meminfo", R_OK) == 0) { + std::ifstream proc_meminfo("/proc/meminfo"); + if (proc_meminfo.is_open()) { + do { + std::getline(proc_meminfo, file_line); + } while (file_line.find("MemAvailable") == std::string::npos); + proc_meminfo.close(); + t.variant.host_metrics.freemem_bytes = stoull(file_line.substr(file_line.find_first_of("0123456789"))) * 1024; + } + } + if (access("/proc/loadavg", R_OK) == 0) { + std::ifstream proc_loadavg("/proc/loadavg"); + if (proc_loadavg.is_open()) { + std::getline(proc_loadavg, file_line, ' '); + t.variant.host_metrics.load1 = stof(file_line) * 100; + std::getline(proc_loadavg, file_line, ' '); + t.variant.host_metrics.load5 = stof(file_line) * 100; + std::getline(proc_loadavg, file_line, ' '); + t.variant.host_metrics.load15 = stof(file_line) * 100; + proc_loadavg.close(); + } + } + + return t; +} + +bool HostMetricsModule::sendMetrics() +{ + meshtastic_Telemetry telemetry = getHostMetrics(); + LOG_INFO("Send: uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f", + telemetry.variant.host_metrics.uptime_seconds, telemetry.variant.host_metrics.diskfree1_bytes, + telemetry.variant.host_metrics.freemem_bytes, static_cast(telemetry.variant.host_metrics.load1) / 100, + static_cast(telemetry.variant.host_metrics.load5) / 100, + static_cast(telemetry.variant.host_metrics.load15) / 100); + + meshtastic_MeshPacket *p = allocDataProtobuf(telemetry); + p->to = NODENUM_BROADCAST; + p->decoded.want_response = false; + p->priority = meshtastic_MeshPacket_Priority_BACKGROUND; + p->channel = settingsMap[hostMetrics_channel]; + LOG_INFO("Send packet to mesh"); + service->sendToMesh(p, RX_SRC_LOCAL, true); + return true; +} +#endif \ No newline at end of file diff --git a/src/modules/Telemetry/HostMetrics.h b/src/modules/Telemetry/HostMetrics.h new file mode 100644 index 000000000..99ee631c1 --- /dev/null +++ b/src/modules/Telemetry/HostMetrics.h @@ -0,0 +1,40 @@ +#pragma once +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "ProtobufModule.h" + +class HostMetricsModule : private concurrency::OSThread, public ProtobufModule +{ + CallbackObserver nodeStatusObserver = + CallbackObserver(this, &HostMetricsModule::handleStatusUpdate); + + public: + HostMetricsModule() + : concurrency::OSThread("HostMetrics"), + ProtobufModule("HostMetrics", meshtastic_PortNum_TELEMETRY_APP, &meshtastic_Telemetry_msg) + { + uptimeWrapCount = 0; + uptimeLastMs = millis(); + nodeStatusObserver.observe(&nodeStatus->onNewStatus); + setIntervalFromNow(setStartDelay()); // Wait until NodeInfo is sent + } + virtual bool wantUIFrame() { return false; } + + protected: + /** Called to handle a particular incoming message + @return true if you've guaranteed you've handled this message and no other handlers should be considered for it + */ + virtual bool handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Telemetry *p) override; + // virtual meshtastic_MeshPacket *allocReply() override; + virtual int32_t runOnce() override; + /** + * Send our Telemetry into the mesh + */ + bool sendMetrics(); + + private: + meshtastic_Telemetry getHostMetrics(); + + uint32_t lastSentToMesh = 0; + uint32_t uptimeWrapCount; + uint32_t uptimeLastMs; +}; \ No newline at end of file diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 4b96e662a..c6aa30629 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -600,6 +600,11 @@ bool loadConfig(const char *configPath) (yamlConfig["Webserver"]["SSLCert"]).as("/etc/meshtasticd/ssl/certificate.pem"); } + if (yamlConfig["HostMetrics"]) { + settingsMap[hostMetrics_channel] = (yamlConfig["HostMetrics"]["Channel"]).as(0); + settingsMap[hostMetrics_interval] = (yamlConfig["HostMetrics"]["ReportInterval"]).as(0); + } + if (yamlConfig["General"]) { settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as(200); settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as(100); @@ -650,4 +655,18 @@ bool MAC_from_string(std::string mac_str, uint8_t *dmac) } else { return false; } +} + +std::string exec(const char *cmd) +{ // https://stackoverflow.com/a/478960 + std::array buffer; + std::string result; + std::unique_ptr pipe(popen(cmd, "r"), pclose); + if (!pipe) { + throw std::runtime_error("popen() failed!"); + } + while (fgets(buffer.data(), static_cast(buffer.size()), pipe.get()) != nullptr) { + result += buffer.data(); + } + return result; } \ No newline at end of file diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index 6393d7294..0cf0201aa 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -100,7 +100,9 @@ enum configNames { ascii_logs, config_directory, available_directory, - mac_address + mac_address, + hostMetrics_interval, + hostMetrics_channel }; enum { no_screen, x11, fb, st7789, st7735, st7735s, st7796, ili9341, ili9342, ili9486, ili9488, hx8357d }; enum { no_touchscreen, xpt2046, stmpe610, gt911, ft5x06 }; @@ -114,4 +116,5 @@ int initGPIOPin(int pinNum, std::string gpioChipname, int line); bool loadConfig(const char *configPath); static bool ends_with(std::string_view str, std::string_view suffix); void getMacAddr(uint8_t *dmac); -bool MAC_from_string(std::string mac_str, uint8_t *dmac); \ No newline at end of file +bool MAC_from_string(std::string mac_str, uint8_t *dmac); +std::string exec(const char *cmd); \ No newline at end of file From 066609a7189163f607fee5966f223526c30bd7d1 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 15 May 2025 21:29:08 -0500 Subject: [PATCH 181/461] Remove incomplete compass boot calibration (#6825) The made it in from testing unintentionally. --- src/main.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 452cb3526..1e46d9db1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1300,10 +1300,6 @@ void setup() LOG_DEBUG("Free heap : %7d bytes", ESP.getFreeHeap()); LOG_DEBUG("Free PSRAM : %7d bytes", ESP.getFreePsram()); #endif -#if !defined(ARCH_STM32WL) - if (accelerometerThread) - accelerometerThread->calibrate(30); -#endif } #endif From 3398a52a346263ff88a441e325d549242691aae7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 17 May 2025 06:15:44 -0500 Subject: [PATCH 182/461] Update meshtastic/device-ui digest to 55f7152 (#6830) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index b78ecdc1a..d5a954a80 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/7dee10ad31a0c6ea04880cba399e240be743d752.zip + https://github.com/meshtastic/device-ui/archive/55f71527f3137ed4eabc258498d5c6ad9f610674.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From a50a94150aba14aaba1639412c535e8f6e99a4ad Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 17 May 2025 10:44:02 -0500 Subject: [PATCH 183/461] [create-pull-request] automated change (#6834) Co-authored-by: jp-bennett <5630967+jp-bennett@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/telemetry.pb.h | 27 ++++++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/protobufs b/protobufs index 4eb0aebae..475694e62 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 4eb0aebaef1304a5516b6fa864cb4c55daed9147 +Subproject commit 475694e62b0fdac3469abc15c6d66d05fc9ad69a diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index 1c5eb4843..4cce7ca33 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -89,7 +89,9 @@ typedef enum _meshtastic_TelemetrySensorType { /* RAKWireless RAK12035 Soil Moisture Sensor Module */ meshtastic_TelemetrySensorType_RAK12035 = 37, /* MAX17261 lipo battery gauge */ - meshtastic_TelemetrySensorType_MAX17261 = 38 + meshtastic_TelemetrySensorType_MAX17261 = 38, + /* PCT2075 Temperature Sensor */ + meshtastic_TelemetrySensorType_PCT2075 = 39 } meshtastic_TelemetrySensorType; /* Struct definitions */ @@ -310,6 +312,9 @@ typedef struct _meshtastic_HostMetrics { uint16_t load5; /* Host system fifteen minute load in 1/100ths */ uint16_t load15; + /* Optional User-provided string for arbitrary host system information + that doesn't make sense as a dedicated entry. */ + pb_callback_t user_string; } meshtastic_HostMetrics; /* Types of Measurements the telemetry module is equipped to handle */ @@ -350,8 +355,8 @@ extern "C" { /* Helper constants for enums */ #define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET -#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_MAX17261 -#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_MAX17261+1)) +#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_PCT2075 +#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_PCT2075+1)) @@ -370,7 +375,7 @@ extern "C" { #define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0} -#define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0} +#define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0, {{NULL}, NULL}} #define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}} #define meshtastic_Nau7802Config_init_default {0, 0} #define meshtastic_DeviceMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0} @@ -379,7 +384,7 @@ extern "C" { #define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0} -#define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0} +#define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0, {{NULL}, NULL}} #define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}} #define meshtastic_Nau7802Config_init_zero {0, 0} @@ -452,6 +457,7 @@ extern "C" { #define meshtastic_HostMetrics_load1_tag 6 #define meshtastic_HostMetrics_load5_tag 7 #define meshtastic_HostMetrics_load15_tag 8 +#define meshtastic_HostMetrics_user_string_tag 9 #define meshtastic_Telemetry_time_tag 1 #define meshtastic_Telemetry_device_metrics_tag 2 #define meshtastic_Telemetry_environment_metrics_tag 3 @@ -556,8 +562,9 @@ X(a, STATIC, OPTIONAL, UINT64, diskfree2_bytes, 4) \ X(a, STATIC, OPTIONAL, UINT64, diskfree3_bytes, 5) \ X(a, STATIC, SINGULAR, UINT32, load1, 6) \ X(a, STATIC, SINGULAR, UINT32, load5, 7) \ -X(a, STATIC, SINGULAR, UINT32, load15, 8) -#define meshtastic_HostMetrics_CALLBACK NULL +X(a, STATIC, SINGULAR, UINT32, load15, 8) \ +X(a, CALLBACK, OPTIONAL, STRING, user_string, 9) +#define meshtastic_HostMetrics_CALLBACK pb_default_field_callback #define meshtastic_HostMetrics_DEFAULT NULL #define meshtastic_Telemetry_FIELDLIST(X, a) \ @@ -607,16 +614,16 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg; #define meshtastic_Nau7802Config_fields &meshtastic_Nau7802Config_msg /* Maximum encoded size of messages (where known) */ -#define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_Telemetry_size +/* meshtastic_HostMetrics_size depends on runtime parameters */ +/* meshtastic_Telemetry_size depends on runtime parameters */ +#define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_EnvironmentMetrics_size #define meshtastic_AirQualityMetrics_size 78 #define meshtastic_DeviceMetrics_size 27 #define meshtastic_EnvironmentMetrics_size 113 #define meshtastic_HealthMetrics_size 11 -#define meshtastic_HostMetrics_size 62 #define meshtastic_LocalStats_size 60 #define meshtastic_Nau7802Config_size 16 #define meshtastic_PowerMetrics_size 30 -#define meshtastic_Telemetry_size 120 #ifdef __cplusplus } /* extern "C" */ From 5b312ab9175402d41cafe1c0a29f4c6a45f8c3a2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 17 May 2025 12:29:18 -0500 Subject: [PATCH 184/461] [create-pull-request] automated change (#6836) Co-authored-by: jp-bennett <5630967+jp-bennett@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/telemetry.pb.cpp | 4 ++-- src/mesh/generated/meshtastic/telemetry.pb.h | 17 +++++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/protobufs b/protobufs index 475694e62..d8b709aa5 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 475694e62b0fdac3469abc15c6d66d05fc9ad69a +Subproject commit d8b709aa5da85959a80a06a6624761678a96f9c0 diff --git a/src/mesh/generated/meshtastic/telemetry.pb.cpp b/src/mesh/generated/meshtastic/telemetry.pb.cpp index b54cbb00e..345d7a157 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.cpp +++ b/src/mesh/generated/meshtastic/telemetry.pb.cpp @@ -24,10 +24,10 @@ PB_BIND(meshtastic_LocalStats, meshtastic_LocalStats, AUTO) PB_BIND(meshtastic_HealthMetrics, meshtastic_HealthMetrics, AUTO) -PB_BIND(meshtastic_HostMetrics, meshtastic_HostMetrics, AUTO) +PB_BIND(meshtastic_HostMetrics, meshtastic_HostMetrics, 2) -PB_BIND(meshtastic_Telemetry, meshtastic_Telemetry, AUTO) +PB_BIND(meshtastic_Telemetry, meshtastic_Telemetry, 2) PB_BIND(meshtastic_Nau7802Config, meshtastic_Nau7802Config, AUTO) diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index 4cce7ca33..4071c611e 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -314,7 +314,8 @@ typedef struct _meshtastic_HostMetrics { uint16_t load15; /* Optional User-provided string for arbitrary host system information that doesn't make sense as a dedicated entry. */ - pb_callback_t user_string; + bool has_user_string; + char user_string[200]; } meshtastic_HostMetrics; /* Types of Measurements the telemetry module is equipped to handle */ @@ -375,7 +376,7 @@ extern "C" { #define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0} -#define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0, {{NULL}, NULL}} +#define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""} #define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}} #define meshtastic_Nau7802Config_init_default {0, 0} #define meshtastic_DeviceMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0} @@ -384,7 +385,7 @@ extern "C" { #define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0} -#define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0, {{NULL}, NULL}} +#define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""} #define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}} #define meshtastic_Nau7802Config_init_zero {0, 0} @@ -563,8 +564,8 @@ X(a, STATIC, OPTIONAL, UINT64, diskfree3_bytes, 5) \ X(a, STATIC, SINGULAR, UINT32, load1, 6) \ X(a, STATIC, SINGULAR, UINT32, load5, 7) \ X(a, STATIC, SINGULAR, UINT32, load15, 8) \ -X(a, CALLBACK, OPTIONAL, STRING, user_string, 9) -#define meshtastic_HostMetrics_CALLBACK pb_default_field_callback +X(a, STATIC, OPTIONAL, STRING, user_string, 9) +#define meshtastic_HostMetrics_CALLBACK NULL #define meshtastic_HostMetrics_DEFAULT NULL #define meshtastic_Telemetry_FIELDLIST(X, a) \ @@ -614,16 +615,16 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg; #define meshtastic_Nau7802Config_fields &meshtastic_Nau7802Config_msg /* Maximum encoded size of messages (where known) */ -/* meshtastic_HostMetrics_size depends on runtime parameters */ -/* meshtastic_Telemetry_size depends on runtime parameters */ -#define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_EnvironmentMetrics_size +#define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_Telemetry_size #define meshtastic_AirQualityMetrics_size 78 #define meshtastic_DeviceMetrics_size 27 #define meshtastic_EnvironmentMetrics_size 113 #define meshtastic_HealthMetrics_size 11 +#define meshtastic_HostMetrics_size 264 #define meshtastic_LocalStats_size 60 #define meshtastic_Nau7802Config_size 16 #define meshtastic_PowerMetrics_size 30 +#define meshtastic_Telemetry_size 272 #ifdef __cplusplus } /* extern "C" */ From 61e4eb12e63db87d9f7839d29f5042d329b8e32f Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 17 May 2025 14:02:39 -0500 Subject: [PATCH 185/461] Use the _init_zero macro correctly for HostMetrics (#6837) --- src/modules/Telemetry/HostMetrics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/Telemetry/HostMetrics.cpp b/src/modules/Telemetry/HostMetrics.cpp index 655be4b25..d1e5bdd00 100644 --- a/src/modules/Telemetry/HostMetrics.cpp +++ b/src/modules/Telemetry/HostMetrics.cpp @@ -69,8 +69,9 @@ meshtastic_MeshPacket *HostMetricsModule::allocReply() meshtastic_Telemetry HostMetricsModule::getHostMetrics() { std::string file_line; - meshtastic_Telemetry t = meshtastic_HostMetrics_init_zero; + meshtastic_Telemetry t = meshtastic_Telemetry_init_zero; t.which_variant = meshtastic_Telemetry_host_metrics_tag; + t.variant.host_metrics = meshtastic_HostMetrics_init_zero; if (access("/proc/uptime", R_OK) == 0) { std::ifstream proc_uptime("/proc/uptime"); From b2d81b740f2e5556ad2d76d0f01a60fb769d4a84 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 18 May 2025 21:11:02 +1000 Subject: [PATCH 186/461] Update dorny/test-reporter action to v2.1.0 (#6833) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/test_native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_native.yml b/.github/workflows/test_native.yml index c3643dcbd..536d93665 100644 --- a/.github/workflows/test_native.yml +++ b/.github/workflows/test_native.yml @@ -143,7 +143,7 @@ jobs: merge-multiple: true - name: Test Report - uses: dorny/test-reporter@v2.0.0 + uses: dorny/test-reporter@v2.1.0 with: name: PlatformIO Tests path: testreport.xml From 3dd6dc0296cc06dd7e33eb25b5705f753d726054 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 18 May 2025 14:37:54 -0500 Subject: [PATCH 187/461] Update meshtastic/device-ui digest to 48e963f (#6841) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index d5a954a80..03206da00 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/55f71527f3137ed4eabc258498d5c6ad9f610674.zip + https://github.com/meshtastic/device-ui/archive/48e963f164238d9e83719b8ee77cfea735a6cd6e.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 16994c872540771663571bd83de1d5cbe11d3512 Mon Sep 17 00:00:00 2001 From: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> Date: Mon, 19 May 2025 07:49:38 -0400 Subject: [PATCH 188/461] Fix for ICM-20948 not initializing (#6827) * Fix for ICM-20948 not initializing * trunk fix --- src/motion/ICM20948Sensor.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/motion/ICM20948Sensor.cpp b/src/motion/ICM20948Sensor.cpp index d03633124..ecc48d39b 100755 --- a/src/motion/ICM20948Sensor.cpp +++ b/src/motion/ICM20948Sensor.cpp @@ -189,13 +189,19 @@ bool ICM20948Singleton::init(ScanI2C::FoundDevice device) enableDebugging(); #endif -// startup -#ifdef Wire1 - ICM_20948_Status_e status = - begin(device.address.port == ScanI2C::I2CPort::WIRE1 ? Wire1 : Wire, device.address.address == ICM20948_ADDR ? 1 : 0); + // startup +#if defined(WIRE_INTERFACES_COUNT) && (WIRE_INTERFACES_COUNT > 1) + TwoWire &bus = (device.address.port == ScanI2C::I2CPort::WIRE1 ? Wire1 : Wire); #else - ICM_20948_Status_e status = begin(Wire, device.address.address == ICM20948_ADDR ? 1 : 0); + TwoWire &bus = Wire; // fallback if only one I2C interface #endif + + bool bAddr = (device.address.address == 0x69); + delay(100); + + LOG_DEBUG("ICM20948 begin on addr 0x%02X (port=%d, bAddr=%d)", device.address.address, device.address.port, bAddr); + + ICM_20948_Status_e status = begin(bus, bAddr); if (status != ICM_20948_Stat_Ok) { LOG_DEBUG("ICM20948 init begin - %s", statusString()); return false; From c70fa0ef13d4fea6b94b9beb618fb32e14751525 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 19:10:22 +0200 Subject: [PATCH 189/461] Update meshtastic/device-ui digest to c9a55f6 (#6845) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 03206da00..adf9cb717 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/48e963f164238d9e83719b8ee77cfea735a6cd6e.zip + https://github.com/meshtastic/device-ui/archive/c9a55f661a735d1f393a02657e5183ccf39cf1a2.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From e0f878872f98b4583363094345e8cae413e3c112 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 20 May 2025 13:04:05 -0500 Subject: [PATCH 190/461] Hostmetrics user string (#6850) --- bin/config-dist.yaml | 1 + src/modules/Telemetry/HostMetrics.cpp | 18 ++++++++++++------ src/platform/portduino/PortduinoGlue.cpp | 1 + src/platform/portduino/PortduinoGlue.h | 3 ++- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/bin/config-dist.yaml b/bin/config-dist.yaml index 2907e4aab..55e8648d9 100644 --- a/bin/config-dist.yaml +++ b/bin/config-dist.yaml @@ -197,6 +197,7 @@ Webserver: HostMetrics: # ReportInterval: 30 # Interval in minutes between HostMetrics report packets, or 0 for disabled # Channel: 0 # channel to send Host Metrics over. Defaults to the primary channel. +# UserStringCommand: cat /sys/firmware/devicetree/base/serial-number # Command to execute, to send the results as the userString General: diff --git a/src/modules/Telemetry/HostMetrics.cpp b/src/modules/Telemetry/HostMetrics.cpp index d1e5bdd00..dc4315efa 100644 --- a/src/modules/Telemetry/HostMetrics.cpp +++ b/src/modules/Telemetry/HostMetrics.cpp @@ -30,11 +30,11 @@ bool HostMetricsModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, #ifdef DEBUG_PORT const char *sender = getSenderShortName(mp); - LOG_INFO("(Received Host Metrics from %s): uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f", sender, - t->variant.host_metrics.uptime_seconds, t->variant.host_metrics.diskfree1_bytes, + LOG_INFO("(Received Host Metrics from %s): uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f, %s", + sender, t->variant.host_metrics.uptime_seconds, t->variant.host_metrics.diskfree1_bytes, t->variant.host_metrics.freemem_bytes, static_cast(t->variant.host_metrics.load1) / 100, static_cast(t->variant.host_metrics.load5) / 100, - static_cast(t->variant.host_metrics.load15) / 100); + static_cast(t->variant.host_metrics.load15) / 100, t->variant.host_metrics.user_string); #endif } return false; // Let others look at this message also if they want @@ -107,18 +107,24 @@ meshtastic_Telemetry HostMetricsModule::getHostMetrics() proc_loadavg.close(); } } - + if (settingsStrings[hostMetrics_user_command] != "") { + std::string userCommandResult = exec(settingsStrings[hostMetrics_user_command].c_str()); + if (userCommandResult.length() > 1) { + strncpy(t.variant.host_metrics.user_string, userCommandResult.c_str(), 200); + t.variant.host_metrics.has_user_string = true; + } + } return t; } bool HostMetricsModule::sendMetrics() { meshtastic_Telemetry telemetry = getHostMetrics(); - LOG_INFO("Send: uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f", + LOG_INFO("Send: uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f %s", telemetry.variant.host_metrics.uptime_seconds, telemetry.variant.host_metrics.diskfree1_bytes, telemetry.variant.host_metrics.freemem_bytes, static_cast(telemetry.variant.host_metrics.load1) / 100, static_cast(telemetry.variant.host_metrics.load5) / 100, - static_cast(telemetry.variant.host_metrics.load15) / 100); + static_cast(telemetry.variant.host_metrics.load15) / 100, telemetry.variant.host_metrics.user_string); meshtastic_MeshPacket *p = allocDataProtobuf(telemetry); p->to = NODENUM_BROADCAST; diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index c6aa30629..cc0c417d3 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -603,6 +603,7 @@ bool loadConfig(const char *configPath) if (yamlConfig["HostMetrics"]) { settingsMap[hostMetrics_channel] = (yamlConfig["HostMetrics"]["Channel"]).as(0); settingsMap[hostMetrics_interval] = (yamlConfig["HostMetrics"]["ReportInterval"]).as(0); + settingsStrings[hostMetrics_user_command] = (yamlConfig["HostMetrics"]["UserStringCommand"]).as(""); } if (yamlConfig["General"]) { diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index 0cf0201aa..d324aaf47 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -102,7 +102,8 @@ enum configNames { available_directory, mac_address, hostMetrics_interval, - hostMetrics_channel + hostMetrics_channel, + hostMetrics_user_command }; enum { no_screen, x11, fb, st7789, st7735, st7735s, st7796, ili9341, ili9342, ili9486, ili9488, hx8357d }; enum { no_touchscreen, xpt2046, stmpe610, gt911, ft5x06 }; From cf3f35d5661fb499009a192e7ec6710c72de7691 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 20 May 2025 19:51:03 -0500 Subject: [PATCH 191/461] [create-pull-request] automated change (#6857) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/deviceonly.pb.h | 13 +++++++++---- src/mesh/generated/meshtastic/mesh.pb.h | 14 ++++++++++---- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/protobufs b/protobufs index d8b709aa5..0b32ce24f 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit d8b709aa5da85959a80a06a6624761678a96f9c0 +Subproject commit 0b32ce24f029f69635026aec9428b5c8176e2ce1 diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index d29fb17a7..2436098da 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -96,6 +96,9 @@ typedef struct _meshtastic_NodeInfoLite { bool is_ignored; /* Last byte of the node number of the node that should be used as the next hop to reach this node. */ uint8_t next_hop; + /* Bitfield for storing booleans. + LSB 0 is_key_manually_verified */ + uint32_t bitfield; } meshtastic_NodeInfoLite; /* This message is never sent over the wire, but it is used for serializing DB @@ -187,14 +190,14 @@ extern "C" { /* Initializer values for message structs */ #define meshtastic_PositionLite_init_default {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN} #define meshtastic_UserLite_init_default {{0}, "", "", _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}, false, 0} -#define meshtastic_NodeInfoLite_init_default {0, false, meshtastic_UserLite_init_default, false, meshtastic_PositionLite_init_default, 0, 0, false, meshtastic_DeviceMetrics_init_default, 0, 0, false, 0, 0, 0, 0} +#define meshtastic_NodeInfoLite_init_default {0, false, meshtastic_UserLite_init_default, false, meshtastic_PositionLite_init_default, 0, 0, false, meshtastic_DeviceMetrics_init_default, 0, 0, false, 0, 0, 0, 0, 0} #define meshtastic_DeviceState_init_default {false, meshtastic_MyNodeInfo_init_default, false, meshtastic_User_init_default, 0, {meshtastic_MeshPacket_init_default}, false, meshtastic_MeshPacket_init_default, 0, 0, 0, false, meshtastic_MeshPacket_init_default, 0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}} #define meshtastic_NodeDatabase_init_default {0, {0}} #define meshtastic_ChannelFile_init_default {0, {meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default}, 0} #define meshtastic_BackupPreferences_init_default {0, 0, false, meshtastic_LocalConfig_init_default, false, meshtastic_LocalModuleConfig_init_default, false, meshtastic_ChannelFile_init_default, false, meshtastic_User_init_default} #define meshtastic_PositionLite_init_zero {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN} #define meshtastic_UserLite_init_zero {{0}, "", "", _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}, false, 0} -#define meshtastic_NodeInfoLite_init_zero {0, false, meshtastic_UserLite_init_zero, false, meshtastic_PositionLite_init_zero, 0, 0, false, meshtastic_DeviceMetrics_init_zero, 0, 0, false, 0, 0, 0, 0} +#define meshtastic_NodeInfoLite_init_zero {0, false, meshtastic_UserLite_init_zero, false, meshtastic_PositionLite_init_zero, 0, 0, false, meshtastic_DeviceMetrics_init_zero, 0, 0, false, 0, 0, 0, 0, 0} #define meshtastic_DeviceState_init_zero {false, meshtastic_MyNodeInfo_init_zero, false, meshtastic_User_init_zero, 0, {meshtastic_MeshPacket_init_zero}, false, meshtastic_MeshPacket_init_zero, 0, 0, 0, false, meshtastic_MeshPacket_init_zero, 0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}} #define meshtastic_NodeDatabase_init_zero {0, {0}} #define meshtastic_ChannelFile_init_zero {0, {meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero}, 0} @@ -226,6 +229,7 @@ extern "C" { #define meshtastic_NodeInfoLite_is_favorite_tag 10 #define meshtastic_NodeInfoLite_is_ignored_tag 11 #define meshtastic_NodeInfoLite_next_hop_tag 12 +#define meshtastic_NodeInfoLite_bitfield_tag 13 #define meshtastic_DeviceState_my_node_tag 2 #define meshtastic_DeviceState_owner_tag 3 #define meshtastic_DeviceState_receive_queue_tag 5 @@ -280,7 +284,8 @@ X(a, STATIC, SINGULAR, BOOL, via_mqtt, 8) \ X(a, STATIC, OPTIONAL, UINT32, hops_away, 9) \ X(a, STATIC, SINGULAR, BOOL, is_favorite, 10) \ X(a, STATIC, SINGULAR, BOOL, is_ignored, 11) \ -X(a, STATIC, SINGULAR, UINT32, next_hop, 12) +X(a, STATIC, SINGULAR, UINT32, next_hop, 12) \ +X(a, STATIC, SINGULAR, UINT32, bitfield, 13) #define meshtastic_NodeInfoLite_CALLBACK NULL #define meshtastic_NodeInfoLite_DEFAULT NULL #define meshtastic_NodeInfoLite_user_MSGTYPE meshtastic_UserLite @@ -358,7 +363,7 @@ extern const pb_msgdesc_t meshtastic_BackupPreferences_msg; #define meshtastic_BackupPreferences_size 2267 #define meshtastic_ChannelFile_size 718 #define meshtastic_DeviceState_size 1722 -#define meshtastic_NodeInfoLite_size 190 +#define meshtastic_NodeInfoLite_size 196 #define meshtastic_PositionLite_size 28 #define meshtastic_UserLite_size 98 diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 572a6f5d5..d6816eeef 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -854,6 +854,10 @@ typedef struct _meshtastic_NodeInfo { /* True if node is in our ignored list Persists between NodeDB internal clean ups */ bool is_ignored; + /* True if node public key has been verified. + Persists between NodeDB internal clean ups + LSB 0 of the bitfield */ + bool is_key_manually_verified; } meshtastic_NodeInfo; typedef PB_BYTES_ARRAY_T(16) meshtastic_MyNodeInfo_device_id_t; @@ -1214,7 +1218,7 @@ extern "C" { #define meshtastic_Waypoint_init_default {0, false, 0, false, 0, 0, 0, "", "", 0} #define meshtastic_MqttClientProxyMessage_init_default {"", 0, {{0, {0}}}, 0} #define meshtastic_MeshPacket_init_default {0, 0, 0, 0, {meshtastic_Data_init_default}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN, 0, 0, {0, {0}}, 0, 0, 0, 0} -#define meshtastic_NodeInfo_init_default {0, false, meshtastic_User_init_default, false, meshtastic_Position_init_default, 0, 0, false, meshtastic_DeviceMetrics_init_default, 0, 0, false, 0, 0, 0} +#define meshtastic_NodeInfo_init_default {0, false, meshtastic_User_init_default, false, meshtastic_Position_init_default, 0, 0, false, meshtastic_DeviceMetrics_init_default, 0, 0, false, 0, 0, 0, 0} #define meshtastic_MyNodeInfo_init_default {0, 0, 0, {0, {0}}, ""} #define meshtastic_LogRecord_init_default {"", 0, "", _meshtastic_LogRecord_Level_MIN} #define meshtastic_QueueStatus_init_default {0, 0, 0, 0} @@ -1239,7 +1243,7 @@ extern "C" { #define meshtastic_Waypoint_init_zero {0, false, 0, false, 0, 0, 0, "", "", 0} #define meshtastic_MqttClientProxyMessage_init_zero {"", 0, {{0, {0}}}, 0} #define meshtastic_MeshPacket_init_zero {0, 0, 0, 0, {meshtastic_Data_init_zero}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN, 0, 0, {0, {0}}, 0, 0, 0, 0} -#define meshtastic_NodeInfo_init_zero {0, false, meshtastic_User_init_zero, false, meshtastic_Position_init_zero, 0, 0, false, meshtastic_DeviceMetrics_init_zero, 0, 0, false, 0, 0, 0} +#define meshtastic_NodeInfo_init_zero {0, false, meshtastic_User_init_zero, false, meshtastic_Position_init_zero, 0, 0, false, meshtastic_DeviceMetrics_init_zero, 0, 0, false, 0, 0, 0, 0} #define meshtastic_MyNodeInfo_init_zero {0, 0, 0, {0, {0}}, ""} #define meshtastic_LogRecord_init_zero {"", 0, "", _meshtastic_LogRecord_Level_MIN} #define meshtastic_QueueStatus_init_zero {0, 0, 0, 0} @@ -1349,6 +1353,7 @@ extern "C" { #define meshtastic_NodeInfo_hops_away_tag 9 #define meshtastic_NodeInfo_is_favorite_tag 10 #define meshtastic_NodeInfo_is_ignored_tag 11 +#define meshtastic_NodeInfo_is_key_manually_verified_tag 12 #define meshtastic_MyNodeInfo_my_node_num_tag 1 #define meshtastic_MyNodeInfo_reboot_count_tag 8 #define meshtastic_MyNodeInfo_min_app_version_tag 11 @@ -1552,7 +1557,8 @@ X(a, STATIC, SINGULAR, UINT32, channel, 7) \ X(a, STATIC, SINGULAR, BOOL, via_mqtt, 8) \ X(a, STATIC, OPTIONAL, UINT32, hops_away, 9) \ X(a, STATIC, SINGULAR, BOOL, is_favorite, 10) \ -X(a, STATIC, SINGULAR, BOOL, is_ignored, 11) +X(a, STATIC, SINGULAR, BOOL, is_ignored, 11) \ +X(a, STATIC, SINGULAR, BOOL, is_key_manually_verified, 12) #define meshtastic_NodeInfo_CALLBACK NULL #define meshtastic_NodeInfo_DEFAULT NULL #define meshtastic_NodeInfo_user_MSGTYPE meshtastic_User @@ -1791,7 +1797,7 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; #define meshtastic_MyNodeInfo_size 77 #define meshtastic_NeighborInfo_size 258 #define meshtastic_Neighbor_size 22 -#define meshtastic_NodeInfo_size 321 +#define meshtastic_NodeInfo_size 323 #define meshtastic_NodeRemoteHardwarePin_size 29 #define meshtastic_Position_size 144 #define meshtastic_QueueStatus_size 23 From 6041357cbba41f6f4e290a1dc08d2214c3636868 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 20 May 2025 20:31:01 -0500 Subject: [PATCH 192/461] Increase the debt ceiling --- src/mesh/mesh-pb-constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/mesh-pb-constants.h b/src/mesh/mesh-pb-constants.h index f748d295e..08c03dc6b 100644 --- a/src/mesh/mesh-pb-constants.h +++ b/src/mesh/mesh-pb-constants.h @@ -20,7 +20,7 @@ /// Verify baseline assumption of node size. If it increases, we need to reevaluate /// the impact of its memory footprint, notably on MAX_NUM_NODES. -static_assert(sizeof(meshtastic_NodeInfoLite) <= 192, "NodeInfoLite size increased. Reconsider impact on MAX_NUM_NODES."); +static_assert(sizeof(meshtastic_NodeInfoLite) <= 200, "NodeInfoLite size increased. Reconsider impact on MAX_NUM_NODES."); /// max number of nodes allowed in the nodeDB #ifndef MAX_NUM_NODES From 41c1b29d70f463b4a0c33970c0f79d1358b0518a Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 20 May 2025 21:29:29 -0500 Subject: [PATCH 193/461] Add basic handling for is_manually_validated (#6856) --- src/mesh/NodeDB.cpp | 6 ++++-- src/mesh/NodeDB.h | 2 ++ src/mesh/TypeConversions.cpp | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 4b1a6d64d..12756abce 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1653,8 +1653,10 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n) int oldestIndex = -1; int oldestBoringIndex = -1; for (int i = 1; i < numMeshNodes; i++) { - // Simply the oldest non-favorite node - if (!meshNodes->at(i).is_favorite && !meshNodes->at(i).is_ignored && meshNodes->at(i).last_heard < oldest) { + // Simply the oldest non-favorite, non-ignored, non-verified node + if (!meshNodes->at(i).is_favorite && !meshNodes->at(i).is_ignored && + !(meshNodes->at(i).bitfield & NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK) && + meshNodes->at(i).last_heard < oldest) { oldest = meshNodes->at(i).last_heard; oldestIndex = i; } diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 4dbda6a9f..16159d380 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -274,6 +274,8 @@ extern meshtastic_CriticalErrorCode error_code; * A numeric error address (nonzero if available) */ extern uint32_t error_address; +#define NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_SHIFT 0 +#define NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK (1 << NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_SHIFT) #define Module_Config_size \ (ModuleConfig_CannedMessageConfig_size + ModuleConfig_ExternalNotificationConfig_size + ModuleConfig_MQTTConfig_size + \ diff --git a/src/mesh/TypeConversions.cpp b/src/mesh/TypeConversions.cpp index 5fc6b8a64..c47a67e68 100644 --- a/src/mesh/TypeConversions.cpp +++ b/src/mesh/TypeConversions.cpp @@ -13,6 +13,7 @@ meshtastic_NodeInfo TypeConversions::ConvertToNodeInfo(const meshtastic_NodeInfo info.via_mqtt = lite->via_mqtt; info.is_favorite = lite->is_favorite; info.is_ignored = lite->is_ignored; + info.is_key_manually_verified = lite->bitfield & NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK; if (lite->has_hops_away) { info.has_hops_away = true; From 7cd50d70443802707c2c5545f453f4fb9f5dd00a Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 22 May 2025 07:40:36 -0500 Subject: [PATCH 194/461] If a contact is add from a QR, it's "verified" manually (#6858) * If a contact is add from a QR, it's "verified" manually * Update src/mesh/NodeDB.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/mesh/NodeDB.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 12756abce..28af7d308 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1518,6 +1518,8 @@ void NodeDB::addFromContact(meshtastic_SharedContact contact) info->has_user = true; info->user = TypeConversions::ConvertToUserLite(contact.user); info->is_favorite = true; + // Mark the node's key as manually verified to indicate trustworthiness. + info->bitfield |= NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK; updateGUIforNode = info; powerFSM.trigger(EVENT_NODEDB_UPDATED); notifyObservers(true); // Force an update whether or not our node counts have changed From b12e9d43be00f6c496892d2567d1535d094f22be Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 14:53:16 -0500 Subject: [PATCH 195/461] Update meshtastic/device-ui digest to 405ca49 (#6865) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index adf9cb717..ae3cbd53b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/c9a55f661a735d1f393a02657e5183ccf39cf1a2.zip + https://github.com/meshtastic/device-ui/archive/405ca495322b7dc3b61f7588d28267d49b2ebc38.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From ba1ef45024b0829c887e7fa8e0f6889fd4160cdf Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Fri, 23 May 2025 11:16:53 +1200 Subject: [PATCH 196/461] InkHUD Extended ASCII (#6768) * Custom AdafruitGFX fonts with extended ASCII encodings * AppletFont handles re-encoding of UTF-8 text * Manual parsing of text which may contain non-ASCII chars * Display emoji reactions, even when unprintable Important to indicate to users that a message has been received, even if meaning is unclear. * Superstitious shrink_to_fit I don't think these help, but they're not hurting! * Use Windows-1252 fonts by default * Spelling * Tidy up nicheGraphics.h * Documentation * Fix inverted logic Slipped in during a last minute renaming while tidying up to push.. --- src/graphics/niche/Fonts/FreeSans6pt7b.h | 317 +++++---- .../niche/Fonts/FreeSans6pt8bCyrillic.h | 302 -------- .../niche/Fonts/FreeSans6pt_Win1250.h | 457 ++++++++++++ .../niche/Fonts/FreeSans6pt_Win1251.h | 457 ++++++++++++ .../niche/Fonts/FreeSans6pt_Win1252.h | 457 ++++++++++++ .../niche/Fonts/FreeSans9pt_Win1250.h | 494 +++++++++++++ .../niche/Fonts/FreeSans9pt_Win1251.h | 493 +++++++++++++ .../niche/Fonts/FreeSans9pt_Win1252.h | 494 +++++++++++++ src/graphics/niche/InkHUD/Applet.cpp | 73 +- src/graphics/niche/InkHUD/Applet.h | 15 +- src/graphics/niche/InkHUD/AppletFont.cpp | 651 ++++++++++++++---- src/graphics/niche/InkHUD/AppletFont.h | 54 +- .../InkHUD/Applets/Bases/Map/MapApplet.cpp | 8 +- .../Applets/Bases/NodeList/NodeListApplet.cpp | 12 +- .../BasicExample/BasicExampleApplet.cpp | 6 + .../NewMsgExample/NewMsgExampleApplet.h | 2 +- .../InkHUD/Applets/System/Menu/MenuApplet.cpp | 1 + .../Notification/NotificationApplet.cpp | 10 +- .../Applets/System/Pairing/PairingApplet.cpp | 4 +- .../User/AllMessage/AllMessageApplet.cpp | 12 +- .../niche/InkHUD/Applets/User/DM/DMApplet.cpp | 12 +- .../InkHUD/Applets/User/Heard/HeardApplet.cpp | 7 +- .../User/RecentsList/RecentsListApplet.cpp | 5 +- .../ThreadedMessage/ThreadedMessageApplet.cpp | 32 +- src/graphics/niche/InkHUD/Events.cpp | 5 - src/graphics/niche/InkHUD/docs/README.md | 130 +++- variants/ELECROW-ThinkNode-M1/nicheGraphics.h | 67 +- variants/heltec_mesh_pocket/nicheGraphics.h | 58 +- .../heltec_vision_master_e213/nicheGraphics.h | 51 +- .../heltec_vision_master_e290/nicheGraphics.h | 51 +- .../heltec_wireless_paper/nicheGraphics.h | 42 +- variants/t-echo/nicheGraphics.h | 78 +-- variants/tlora_t3s3_epaper/nicheGraphics.h | 34 +- 33 files changed, 3977 insertions(+), 914 deletions(-) delete mode 100644 src/graphics/niche/Fonts/FreeSans6pt8bCyrillic.h create mode 100644 src/graphics/niche/Fonts/FreeSans6pt_Win1250.h create mode 100644 src/graphics/niche/Fonts/FreeSans6pt_Win1251.h create mode 100644 src/graphics/niche/Fonts/FreeSans6pt_Win1252.h create mode 100644 src/graphics/niche/Fonts/FreeSans9pt_Win1250.h create mode 100644 src/graphics/niche/Fonts/FreeSans9pt_Win1251.h create mode 100644 src/graphics/niche/Fonts/FreeSans9pt_Win1252.h diff --git a/src/graphics/niche/Fonts/FreeSans6pt7b.h b/src/graphics/niche/Fonts/FreeSans6pt7b.h index c5bcc32c4..0b3e74b8f 100644 --- a/src/graphics/niche/Fonts/FreeSans6pt7b.h +++ b/src/graphics/niche/Fonts/FreeSans6pt7b.h @@ -1,129 +1,198 @@ #pragma once - const uint8_t FreeSans6pt7bBitmaps[] PROGMEM = { - 0xAA, 0xA8, 0xC0, 0xF6, 0xA0, 0x24, 0x51, 0xF9, 0x42, 0x9F, 0x92, 0x28, 0x10, 0xE5, 0x55, 0x50, 0xE1, 0x65, 0x55, 0xE1, 0x00, - 0x71, 0x24, 0x89, 0x22, 0x50, 0x74, 0x02, 0x70, 0xA4, 0x49, 0x11, 0xC0, 0x70, 0x91, 0x23, 0x86, 0x12, 0xA2, 0x4E, 0xF4, 0xE0, - 0x5A, 0xAA, 0x94, 0x89, 0x12, 0x49, 0x29, 0x00, 0x27, 0x50, 0x21, 0x3E, 0x42, 0x00, 0xE0, 0xC0, 0x80, 0x24, 0xA4, 0xA4, 0x80, - 0x74, 0xE3, 0x18, 0xC6, 0x33, 0x70, 0x27, 0x92, 0x49, 0x20, 0x79, 0x10, 0x41, 0x08, 0xC6, 0x10, 0xFC, 0x79, 0x30, 0x43, 0x18, - 0x10, 0x71, 0x78, 0x08, 0x61, 0x8A, 0x49, 0x2F, 0xC2, 0x08, 0x7D, 0x04, 0x1E, 0x44, 0x10, 0x51, 0x78, 0x74, 0x61, 0xE8, 0xC6, - 0x31, 0x70, 0xF8, 0x44, 0x22, 0x11, 0x08, 0x40, 0x39, 0x34, 0x53, 0x39, 0x1C, 0x51, 0x38, 0x39, 0x3C, 0x71, 0x4C, 0xF0, 0x53, - 0x78, 0x82, 0x87, 0x01, 0xF1, 0x83, 0x04, 0xF8, 0x3E, 0x07, 0x06, 0x36, 0x40, 0x74, 0x42, 0x11, 0x10, 0x80, 0x20, 0x0F, 0x86, - 0x19, 0x9A, 0xA4, 0xD9, 0x13, 0x22, 0x56, 0xDA, 0x6E, 0x60, 0x06, 0x00, 0x3C, 0x00, 0x18, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, - 0x42, 0xC3, 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xFC, 0x3E, 0x63, 0x40, 0x40, 0xC0, 0x40, 0x41, 0x63, 0x3E, 0xF9, 0x0A, 0x1C, - 0x18, 0x30, 0x61, 0xC2, 0xF8, 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, 0xFE, 0x08, 0x20, 0xFA, 0x08, 0x20, 0x80, 0x1E, 0x61, - 0x40, 0x40, 0xC7, 0x41, 0x41, 0x63, 0x1D, 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, 0xFF, 0x80, 0x08, 0x42, 0x10, 0x87, - 0x29, 0x70, 0x85, 0x12, 0x45, 0x0D, 0x13, 0x22, 0x42, 0x86, 0x84, 0x21, 0x08, 0x42, 0x10, 0xF8, 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, - 0xA5, 0x99, 0x99, 0x99, 0x83, 0x86, 0x8D, 0x19, 0x33, 0x62, 0xC3, 0x86, 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x06, 0xC6, - 0x1E, 0x00, 0xFA, 0x18, 0x61, 0xFA, 0x08, 0x20, 0x80, 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x06, 0xC6, 0x1F, 0x00, 0x00, - 0xFD, 0x0E, 0x1C, 0x2F, 0x90, 0xA1, 0x42, 0x86, 0x7A, 0x18, 0x30, 0x78, 0x38, 0x61, 0x78, 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, - 0x08, 0x10, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xE2, 0x78, 0xC2, 0x42, 0x42, 0x64, 0x24, 0x24, 0x38, 0x18, 0x18, 0xC4, 0x28, - 0xCD, 0x29, 0x25, 0x24, 0xA4, 0x52, 0x8C, 0x61, 0x8C, 0x31, 0x80, 0x42, 0x66, 0x24, 0x18, 0x18, 0x18, 0x24, 0x46, 0x42, 0xC3, - 0x42, 0x24, 0x34, 0x18, 0x08, 0x08, 0x08, 0x08, 0x7E, 0x0C, 0x30, 0x41, 0x06, 0x18, 0x20, 0xFE, 0xEA, 0xAA, 0xAB, 0x92, 0x24, - 0x89, 0x20, 0xE9, 0x24, 0x92, 0x49, 0x70, 0x46, 0xA9, 0x10, 0xFE, 0x40, 0x79, 0x20, 0x4F, 0xC6, 0x37, 0x40, 0x84, 0x3D, 0x18, - 0xC6, 0x31, 0xF0, 0x39, 0x3C, 0x20, 0xC1, 0x33, 0x80, 0x04, 0x13, 0xD3, 0xC6, 0x1C, 0x53, 0x3C, 0x39, 0x38, 0x7F, 0x81, 0x13, - 0x80, 0x6B, 0xA4, 0x92, 0x40, 0x35, 0x3C, 0x61, 0xC5, 0x33, 0x41, 0x4D, 0xE0, 0x84, 0x3D, 0x38, 0xC6, 0x31, 0x88, 0xBF, 0x80, - 0x45, 0x55, 0x57, 0x84, 0x25, 0x4E, 0x52, 0xD2, 0x88, 0xFF, 0x80, 0xF7, 0x99, 0x91, 0x91, 0x91, 0x91, 0x91, 0xF4, 0x63, 0x18, - 0xC6, 0x20, 0x39, 0x3C, 0x61, 0xC5, 0x33, 0x80, 0xF4, 0x63, 0x18, 0xC7, 0xD0, 0x80, 0x3D, 0x3C, 0x61, 0xC5, 0x37, 0x41, 0x04, - 0xF2, 0x49, 0x20, 0x79, 0x24, 0x1C, 0x0B, 0x27, 0x80, 0x5D, 0x24, 0x93, 0x8C, 0x63, 0x18, 0xCF, 0xA0, 0x85, 0x24, 0x92, 0x30, - 0xC3, 0x00, 0x89, 0x2C, 0x96, 0x4A, 0xA5, 0x61, 0x30, 0x98, 0x49, 0x23, 0x08, 0x31, 0x2C, 0x80, 0x89, 0x24, 0x94, 0x50, 0xC2, - 0x08, 0x21, 0x00, 0x78, 0x44, 0x46, 0x23, 0xE0, 0x6A, 0xAA, 0xA9, 0xFF, 0xE0, 0x95, 0x55, 0x56, 0x66, 0x60}; + /* ' ' 0x20 */ + /* '!' 0x21 */ 0xFE, 0x80, + /* '"' 0x22 */ 0xB6, 0x80, + /* '#' 0x23 */ 0x24, 0x49, 0xF9, 0x42, 0x9F, 0x92, 0x28, + /* '$' 0x24 */ 0x23, 0xAB, 0x5A, 0x38, 0xB5, 0xAB, 0x88, + /* '%' 0x25 */ 0x71, 0x22, 0x88, 0xA2, 0x30, 0x74, 0x02, 0x60, 0xA4, 0x49, 0x11, 0x80, + /* '&' 0x26 */ 0x31, 0x24, 0x8C, 0x72, 0x58, 0xA3, 0x74, + /* ''' 0x27 */ 0xE0, + /* '(' 0x28 */ 0x5A, 0xAA, 0x94, + /* ')' 0x29 */ 0x89, 0x12, 0x49, 0x49, 0x00, + /* '*' 0x2A */ 0x5E, 0x80, + /* '+' 0x2B */ 0x21, 0x3E, 0x42, 0x00, + /* ',' 0x2C */ 0xE0, + /* '-' 0x2D */ 0xE0, + /* '.' 0x2E */ 0x80, + /* '/' 0x2F */ 0x25, 0x24, 0xA4, 0x80, + /* '0' 0x30 */ 0x76, 0xE3, 0x18, 0xC6, 0x3B, 0x70, + /* '1' 0x31 */ 0x5D, 0x55, 0x40, + /* '2' 0x32 */ 0x74, 0x42, 0x11, 0x11, 0x10, 0xF8, + /* '3' 0x33 */ 0x74, 0x42, 0x13, 0x04, 0x31, 0x70, + /* '4' 0x34 */ 0x11, 0x8C, 0xA9, 0x4B, 0xE2, 0x10, + /* '5' 0x35 */ 0x7D, 0x04, 0x1E, 0x4C, 0x10, 0x63, 0x78, + /* '6' 0x36 */ 0x72, 0x61, 0xE8, 0xC6, 0x39, 0x70, + /* '7' 0x37 */ 0xF8, 0x44, 0x22, 0x11, 0x08, 0x40, + /* '8' 0x38 */ 0x7A, 0x18, 0x61, 0x7A, 0x18, 0x61, 0x78, + /* '9' 0x39 */ 0x7B, 0x28, 0x61, 0xCD, 0xD0, 0x62, 0x70, + /* ':' 0x3A */ 0x82, + /* ';' 0x3B */ 0x87, + /* '<' 0x3C */ 0x3E, 0x30, 0x60, 0x80, + /* '=' 0x3D */ 0xF8, 0x3E, + /* '>' 0x3E */ 0xE0, 0xC6, 0xC8, 0x00, + /* '?' 0x3F */ 0x74, 0x42, 0x11, 0x10, 0x80, 0x20, + /* '@' 0x40 */ 0x0F, 0x06, 0x19, 0x3B, 0xC4, 0x99, 0x13, 0x22, 0x64, 0x96, 0x6E, 0x40, 0x04, 0x00, 0x7C, 0x00, + /* 'A' 0x41 */ 0x18, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, + /* 'B' 0x42 */ 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xF8, + /* 'C' 0x43 */ 0x3E, 0x41, 0x80, 0x80, 0x80, 0x80, 0x81, 0x43, 0x3E, + /* 'D' 0x44 */ 0xF9, 0x0A, 0x0C, 0x18, 0x30, 0x60, 0xC2, 0xF8, + /* 'E' 0x45 */ 0xFE, 0x08, 0x20, 0xFA, 0x08, 0x20, 0xFC, + /* 'F' 0x46 */ 0xFC, 0x21, 0x0F, 0xC2, 0x10, 0x80, + /* 'G' 0x47 */ 0x3E, 0x41, 0x80, 0x80, 0x87, 0x81, 0xC1, 0x43, 0x3D, + /* 'H' 0x48 */ 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, + /* 'I' 0x49 */ 0xFF, 0x80, + /* 'J' 0x4A */ 0x08, 0x42, 0x10, 0x86, 0x31, 0x70, + /* 'K' 0x4B */ 0x86, 0x29, 0x28, 0xD2, 0x48, 0xA1, 0x84, + /* 'L' 0x4C */ 0x84, 0x21, 0x08, 0x42, 0x10, 0xF8, + /* 'M' 0x4D */ 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, + /* 'N' 0x4E */ 0xC3, 0x86, 0x8D, 0x19, 0x33, 0x62, 0xC3, 0x86, + /* 'O' 0x4F */ 0x3E, 0x31, 0xB0, 0x70, 0x18, 0x0C, 0x07, 0x06, 0xC6, 0x3E, 0x00, + /* 'P' 0x50 */ 0xFA, 0x18, 0x61, 0xFA, 0x08, 0x20, 0x80, + /* 'Q' 0x51 */ 0x3E, 0x31, 0xB0, 0x70, 0x18, 0x0C, 0x07, 0x06, 0xC6, 0x3F, 0x00, 0x40, + /* 'R' 0x52 */ 0xF9, 0x0A, 0x14, 0x2F, 0x90, 0xA1, 0x42, 0x86, + /* 'S' 0x53 */ 0x7A, 0x18, 0x30, 0x78, 0x38, 0x71, 0x78, + /* 'T' 0x54 */ 0xFC, 0x41, 0x04, 0x10, 0x41, 0x04, 0x10, + /* 'U' 0x55 */ 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xE3, 0x7C, + /* 'V' 0x56 */ 0xC2, 0x85, 0x0B, 0x22, 0x44, 0x8E, 0x0C, 0x18, + /* 'W' 0x57 */ 0x84, 0x38, 0xCD, 0x29, 0x25, 0x24, 0xA4, 0xD2, 0x8C, 0x61, 0x8C, 0x31, 0x80, + /* 'X' 0x58 */ 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xA3, 0x84, + /* 'Y' 0x59 */ 0x82, 0x89, 0x11, 0x43, 0x82, 0x04, 0x08, 0x10, + /* 'Z' 0x5A */ 0x7E, 0x0C, 0x30, 0x41, 0x06, 0x18, 0x20, 0xFE, + /* '[' 0x5B */ 0xEA, 0xAA, 0xAB, + /* '\' 0x5C */ 0x92, 0x24, 0x91, 0x20, + /* ']' 0x5D */ 0xD5, 0x55, 0x57, + /* '^' 0x5E */ 0x46, 0xA9, 0x10, + /* '_' 0x5F */ 0xFE, + /* '`' 0x60 */ 0x80, + /* 'a' 0x61 */ 0x79, 0x08, 0x11, 0xEC, 0x51, 0x9D, 0x80, + /* 'b' 0x62 */ 0x84, 0x3D, 0xB8, 0xC6, 0x3B, 0xF0, + /* 'c' 0x63 */ 0x7B, 0x18, 0x20, 0x83, 0x17, 0x80, + /* 'd' 0x64 */ 0x04, 0x17, 0xF3, 0x86, 0x18, 0x73, 0x74, + /* 'e' 0x65 */ 0x7B, 0x38, 0x7F, 0x83, 0x17, 0x80, + /* 'f' 0x66 */ 0x6B, 0xA4, 0x92, 0x40, + /* 'g' 0x67 */ 0x77, 0x38, 0x61, 0x87, 0x37, 0x41, 0x8D, 0xE0, + /* 'h' 0x68 */ 0x84, 0x2D, 0x98, 0xC6, 0x31, 0x88, + /* 'i' 0x69 */ 0xBF, 0x80, + /* 'j' 0x6A */ 0x45, 0x55, 0x57, + /* 'k' 0x6B */ 0x84, 0x25, 0x6E, 0x72, 0x52, 0x88, + /* 'l' 0x6C */ 0xFF, 0x80, + /* 'm' 0x6D */ 0xFF, 0x99, 0x91, 0x91, 0x91, 0x91, 0x91, + /* 'n' 0x6E */ 0xB6, 0x63, 0x18, 0xC6, 0x20, + /* 'o' 0x6F */ 0x7B, 0x38, 0x61, 0x87, 0x37, 0x80, + /* 'p' 0x70 */ 0xF6, 0xE3, 0x18, 0xEF, 0xD0, 0x80, + /* 'q' 0x71 */ 0x77, 0x38, 0x61, 0x87, 0x37, 0x41, 0x04, + /* 'r' 0x72 */ 0xBA, 0x49, 0x20, + /* 's' 0x73 */ 0x69, 0x8E, 0x19, 0x60, + /* 't' 0x74 */ 0x5D, 0x24, 0x93, + /* 'u' 0x75 */ 0x8C, 0x63, 0x18, 0xCD, 0xA0, + /* 'v' 0x76 */ 0x85, 0x24, 0x92, 0x30, 0xC3, 0x00, + /* 'w' 0x77 */ 0x89, 0x99, 0x59, 0x55, 0x56, 0x66, 0x26, + /* 'x' 0x78 */ 0x4A, 0x4C, 0x43, 0x27, 0x20, + /* 'y' 0x79 */ 0x85, 0x24, 0x92, 0x30, 0xC3, 0x08, 0x21, 0x80, + /* 'z' 0x7A */ 0x78, 0x44, 0x46, 0x23, 0xE0, + /* '{' 0x7B */ 0x69, 0x25, 0xB2, 0x49, 0x30, + /* '|' 0x7C */ 0xFF, 0xE0, + /* '}' 0x7D */ 0xC9, 0x24, 0xDA, 0x49, 0x60, + /* '~' 0x7E */ 0x66, 0x70, +}; -const GFXglyph FreeSans6pt7bGlyphs[] PROGMEM = {{0, 0, 0, 3, 0, 1}, // 0x20 ' ' - {0, 2, 9, 4, 1, -8}, // 0x21 '!' - {3, 4, 3, 4, 0, -8}, // 0x22 '"' - {5, 7, 8, 7, 0, -7}, // 0x23 '#' - {12, 6, 11, 7, 0, -9}, // 0x24 '$' - {21, 10, 9, 11, 0, -8}, // 0x25 '%' - {33, 7, 9, 8, 1, -8}, // 0x26 '&' - {41, 1, 3, 2, 1, -8}, // 0x27 ''' - {42, 2, 11, 4, 1, -8}, // 0x28 '(' - {45, 3, 11, 4, 0, -8}, // 0x29 ')' - {50, 4, 3, 5, 0, -8}, // 0x2A '*' - {52, 5, 5, 7, 1, -4}, // 0x2B '+' - {56, 1, 3, 3, 1, 0}, // 0x2C ',' - {57, 2, 1, 4, 1, -3}, // 0x2D '-' - {58, 1, 1, 3, 1, 0}, // 0x2E '.' - {59, 3, 9, 3, 0, -8}, // 0x2F '/' - {63, 5, 9, 7, 1, -8}, // 0x30 '0' - {69, 3, 9, 7, 1, -8}, // 0x31 '1' - {73, 6, 9, 7, 0, -8}, // 0x32 '2' - {80, 6, 9, 7, 0, -8}, // 0x33 '3' - {87, 6, 9, 7, 0, -8}, // 0x34 '4' - {94, 6, 9, 7, 0, -8}, // 0x35 '5' - {101, 5, 9, 7, 1, -8}, // 0x36 '6' - {107, 5, 9, 7, 1, -8}, // 0x37 '7' - {113, 6, 9, 7, 0, -8}, // 0x38 '8' - {120, 6, 9, 7, 0, -8}, // 0x39 '9' - {127, 1, 7, 3, 1, -6}, // 0x3A ':' - {128, 1, 8, 3, 1, -5}, // 0x3B ';' - {129, 5, 6, 7, 1, -5}, // 0x3C '<' - {133, 5, 3, 7, 1, -3}, // 0x3D '=' - {135, 5, 6, 7, 1, -5}, // 0x3E '>' - {139, 5, 9, 7, 1, -8}, // 0x3F '?' - {145, 11, 11, 12, 0, -8}, // 0x40 '@' - {161, 8, 9, 8, 0, -8}, // 0x41 'A' - {170, 6, 9, 8, 1, -8}, // 0x42 'B' - {177, 8, 9, 9, 0, -8}, // 0x43 'C' - {186, 7, 9, 8, 1, -8}, // 0x44 'D' - {194, 6, 9, 8, 1, -8}, // 0x45 'E' - {201, 6, 9, 7, 1, -8}, // 0x46 'F' - {208, 8, 9, 9, 0, -8}, // 0x47 'G' - {217, 7, 9, 9, 1, -8}, // 0x48 'H' - {225, 1, 9, 3, 1, -8}, // 0x49 'I' - {227, 5, 9, 6, 0, -8}, // 0x4A 'J' - {233, 7, 9, 8, 1, -8}, // 0x4B 'K' - {241, 5, 9, 7, 1, -8}, // 0x4C 'L' - {247, 8, 9, 10, 1, -8}, // 0x4D 'M' - {256, 7, 9, 9, 1, -8}, // 0x4E 'N' - {264, 9, 9, 9, 0, -8}, // 0x4F 'O' - {275, 6, 9, 8, 1, -8}, // 0x50 'P' - {282, 9, 10, 9, 0, -8}, // 0x51 'Q' - {294, 7, 9, 9, 1, -8}, // 0x52 'R' - {302, 6, 9, 8, 1, -8}, // 0x53 'S' - {309, 7, 9, 8, 0, -8}, // 0x54 'T' - {317, 7, 9, 9, 1, -8}, // 0x55 'U' - {325, 8, 9, 8, 0, -8}, // 0x56 'V' - {334, 11, 9, 11, 0, -8}, // 0x57 'W' - {347, 8, 9, 8, 0, -8}, // 0x58 'X' - {356, 8, 9, 8, 0, -8}, // 0x59 'Y' - {365, 7, 9, 7, 0, -8}, // 0x5A 'Z' - {373, 2, 12, 3, 1, -8}, // 0x5B '[' - {376, 3, 9, 3, 0, -8}, // 0x5C '\' - {380, 3, 12, 3, 0, -8}, // 0x5D ']' - {385, 4, 5, 6, 1, -8}, // 0x5E '^' - {388, 7, 1, 7, 0, 2}, // 0x5F '_' - {389, 3, 1, 3, 0, -8}, // 0x60 '`' - {390, 6, 7, 7, 0, -6}, // 0x61 'a' - {396, 5, 9, 7, 1, -8}, // 0x62 'b' - {402, 6, 7, 6, 0, -6}, // 0x63 'c' - {408, 6, 9, 7, 0, -8}, // 0x64 'd' - {415, 6, 7, 6, 0, -6}, // 0x65 'e' - {421, 3, 9, 3, 0, -8}, // 0x66 'f' - {425, 6, 10, 7, 0, -6}, // 0x67 'g' - {433, 5, 9, 6, 1, -8}, // 0x68 'h' - {439, 1, 9, 3, 1, -8}, // 0x69 'i' - {441, 2, 12, 3, 0, -8}, // 0x6A 'j' - {444, 5, 9, 6, 1, -8}, // 0x6B 'k' - {450, 1, 9, 3, 1, -8}, // 0x6C 'l' - {452, 8, 7, 10, 1, -6}, // 0x6D 'm' - {459, 5, 7, 6, 1, -6}, // 0x6E 'n' - {464, 6, 7, 6, 0, -6}, // 0x6F 'o' - {470, 5, 9, 7, 1, -6}, // 0x70 'p' - {476, 6, 9, 7, 0, -6}, // 0x71 'q' - {483, 3, 7, 4, 1, -6}, // 0x72 'r' - {486, 6, 7, 6, 0, -6}, // 0x73 's' - {492, 3, 8, 3, 0, -7}, // 0x74 't' - {495, 5, 7, 6, 1, -6}, // 0x75 'u' - {500, 6, 7, 6, 0, -6}, // 0x76 'v' - {506, 9, 7, 9, 0, -6}, // 0x77 'w' - {514, 6, 7, 6, 0, -6}, // 0x78 'x' - {520, 6, 10, 6, 0, -6}, // 0x79 'y' - {528, 5, 7, 6, 0, -6}, // 0x7A 'z' - {533, 2, 12, 4, 1, -8}, // 0x7B '{' - {536, 1, 11, 3, 1, -8}, // 0x7C '|' - {538, 2, 12, 4, 1, -8}, // 0x7D '}' - {541, 6, 2, 6, 0, -4}}; // 0x7E '~' +const GFXglyph FreeSans6pt7bGlyphs[] PROGMEM = { + /* ' ' 0x20 */ {0, 0, 0, 3, 0, 0}, + /* '!' 0x21 */ {0, 1, 9, 4, 2, -8}, + /* '"' 0x22 */ {2, 3, 3, 4, 0, -8}, + /* '#' 0x23 */ {4, 7, 8, 7, 0, -7}, + /* '$' 0x24 */ {11, 5, 11, 7, 1, -9}, + /* '%' 0x25 */ {18, 10, 9, 11, 0, -8}, + /* '&' 0x26 */ {30, 6, 9, 8, 1, -8}, + /* ''' 0x27 */ {37, 1, 3, 2, 1, -8}, + /* '(' 0x28 */ {38, 2, 11, 4, 1, -8}, + /* ')' 0x29 */ {41, 3, 11, 4, 0, -8}, + /* '*' 0x2A */ {46, 3, 3, 5, 1, -8}, + /* '+' 0x2B */ {48, 5, 5, 7, 1, -4}, + /* ',' 0x2C */ {52, 1, 3, 3, 1, 0}, + /* '-' 0x2D */ {53, 3, 1, 4, 1, -3}, + /* '.' 0x2E */ {54, 1, 1, 3, 1, 0}, + /* '/' 0x2F */ {55, 3, 9, 3, 0, -8}, + /* '0' 0x30 */ {59, 5, 9, 7, 1, -8}, + /* '1' 0x31 */ {65, 2, 9, 7, 2, -8}, + /* '2' 0x32 */ {68, 5, 9, 7, 1, -8}, + /* '3' 0x33 */ {74, 5, 9, 7, 1, -8}, + /* '4' 0x34 */ {80, 5, 9, 7, 1, -8}, + /* '5' 0x35 */ {86, 6, 9, 7, 0, -8}, + /* '6' 0x36 */ {93, 5, 9, 7, 1, -8}, + /* '7' 0x37 */ {99, 5, 9, 7, 1, -8}, + /* '8' 0x38 */ {105, 6, 9, 7, 0, -8}, + /* '9' 0x39 */ {112, 6, 9, 7, 0, -8}, + /* ':' 0x3A */ {119, 1, 7, 3, 1, -6}, + /* ';' 0x3B */ {120, 1, 8, 3, 1, -5}, + /* '<' 0x3C */ {121, 5, 5, 7, 1, -4}, + /* '=' 0x3D */ {125, 5, 3, 7, 1, -3}, + /* '>' 0x3E */ {127, 5, 5, 7, 1, -4}, + /* '?' 0x3F */ {131, 5, 9, 7, 1, -8}, + /* '@' 0x40 */ {137, 11, 11, 12, 0, -8}, + /* 'A' 0x41 */ {153, 8, 9, 8, 0, -8}, + /* 'B' 0x42 */ {162, 6, 9, 8, 1, -8}, + /* 'C' 0x43 */ {169, 8, 9, 9, 0, -8}, + /* 'D' 0x44 */ {178, 7, 9, 8, 1, -8}, + /* 'E' 0x45 */ {186, 6, 9, 8, 1, -8}, + /* 'F' 0x46 */ {193, 5, 9, 7, 1, -8}, + /* 'G' 0x47 */ {199, 8, 9, 9, 0, -8}, + /* 'H' 0x48 */ {208, 7, 9, 9, 1, -8}, + /* 'I' 0x49 */ {216, 1, 9, 3, 1, -8}, + /* 'J' 0x4A */ {218, 5, 9, 6, 0, -8}, + /* 'K' 0x4B */ {224, 6, 9, 8, 1, -8}, + /* 'L' 0x4C */ {231, 5, 9, 7, 1, -8}, + /* 'M' 0x4D */ {237, 8, 9, 10, 1, -8}, + /* 'N' 0x4E */ {246, 7, 9, 9, 1, -8}, + /* 'O' 0x4F */ {254, 9, 9, 9, 0, -8}, + /* 'P' 0x50 */ {265, 6, 9, 8, 1, -8}, + /* 'Q' 0x51 */ {272, 9, 10, 9, 0, -8}, + /* 'R' 0x52 */ {284, 7, 9, 9, 1, -8}, + /* 'S' 0x53 */ {292, 6, 9, 8, 1, -8}, + /* 'T' 0x54 */ {299, 6, 9, 8, 0, -8}, + /* 'U' 0x55 */ {306, 7, 9, 9, 1, -8}, + /* 'V' 0x56 */ {314, 7, 9, 8, 0, -8}, + /* 'W' 0x57 */ {322, 11, 9, 11, 0, -8}, + /* 'X' 0x58 */ {335, 6, 9, 8, 1, -8}, + /* 'Y' 0x59 */ {342, 7, 9, 8, 1, -8}, + /* 'Z' 0x5A */ {350, 7, 9, 7, 0, -8}, + /* '[' 0x5B */ {358, 2, 12, 3, 1, -8}, + /* '\' 0x5C */ {361, 3, 9, 3, 0, -8}, + /* ']' 0x5D */ {365, 2, 12, 3, 0, -8}, + /* '^' 0x5E */ {368, 4, 5, 6, 1, -8}, + /* '_' 0x5F */ {371, 7, 1, 7, 0, 2}, + /* '`' 0x60 */ {372, 1, 1, 3, 1, -8}, + /* 'a' 0x61 */ {373, 7, 7, 7, 0, -6}, + /* 'b' 0x62 */ {380, 5, 9, 7, 1, -8}, + /* 'c' 0x63 */ {386, 6, 7, 6, 0, -6}, + /* 'd' 0x64 */ {392, 6, 9, 7, 0, -8}, + /* 'e' 0x65 */ {399, 6, 7, 6, 0, -6}, + /* 'f' 0x66 */ {405, 3, 9, 3, 0, -8}, + /* 'g' 0x67 */ {409, 6, 10, 7, 0, -6}, + /* 'h' 0x68 */ {417, 5, 9, 6, 1, -8}, + /* 'i' 0x69 */ {423, 1, 9, 3, 1, -8}, + /* 'j' 0x6A */ {425, 2, 12, 3, 0, -8}, + /* 'k' 0x6B */ {428, 5, 9, 6, 1, -8}, + /* 'l' 0x6C */ {434, 1, 9, 3, 1, -8}, + /* 'm' 0x6D */ {436, 8, 7, 10, 1, -6}, + /* 'n' 0x6E */ {443, 5, 7, 6, 1, -6}, + /* 'o' 0x6F */ {448, 6, 7, 6, 0, -6}, + /* 'p' 0x70 */ {454, 5, 9, 7, 1, -6}, + /* 'q' 0x71 */ {460, 6, 9, 7, 0, -6}, + /* 'r' 0x72 */ {467, 3, 7, 4, 1, -6}, + /* 's' 0x73 */ {470, 4, 7, 6, 1, -6}, + /* 't' 0x74 */ {474, 3, 8, 3, 0, -7}, + /* 'u' 0x75 */ {477, 5, 7, 6, 1, -6}, + /* 'v' 0x76 */ {482, 6, 7, 6, 0, -6}, + /* 'w' 0x77 */ {488, 8, 7, 9, 0, -6}, + /* 'x' 0x78 */ {495, 5, 7, 6, 0, -6}, + /* 'y' 0x79 */ {500, 6, 10, 6, 0, -6}, + /* 'z' 0x7A */ {508, 5, 7, 6, 0, -6}, + /* '{' 0x7B */ {513, 3, 12, 4, 0, -8}, + /* '|' 0x7C */ {518, 1, 11, 3, 1, -8}, + /* '}' 0x7D */ {520, 3, 12, 4, 1, -8}, + /* '~' 0x7E */ {525, 6, 2, 6, 0, -4}, +}; const GFXfont FreeSans6pt7b PROGMEM = {(uint8_t *)FreeSans6pt7bBitmaps, (GFXglyph *)FreeSans6pt7bGlyphs, 0x20, 0x7E, 14}; - -// Approx. 1215 bytes diff --git a/src/graphics/niche/Fonts/FreeSans6pt8bCyrillic.h b/src/graphics/niche/Fonts/FreeSans6pt8bCyrillic.h deleted file mode 100644 index d222cd1c3..000000000 --- a/src/graphics/niche/Fonts/FreeSans6pt8bCyrillic.h +++ /dev/null @@ -1,302 +0,0 @@ -/* - -Uses Windows-1251 encoding to map translingual Cyrillic characters to range between (uint8_t)127 and (uint8_t)255 -https://en.wikipedia.org/wiki/Windows-1251 - -Cyrillic characters present to the firmware as UTF8. -A NicheGraphics implementation needs to identify these, and substitute the appropriate Windows-1251 char value. - -*/ - -#pragma once - -const uint8_t FreeSans6pt8bCyrillicBitmaps[] PROGMEM = { - 0xFF, 0xA0, 0xC0, 0xFF, 0xA0, 0xC0, 0xB6, 0x80, 0x24, 0x51, 0xF9, 0x42, 0x9F, 0x92, 0x28, 0x31, 0x75, 0x54, 0x78, 0x79, 0x75, - 0x7C, 0x41, 0x00, 0x01, 0x1C, 0x49, 0x22, 0x50, 0x74, 0x02, 0x60, 0xA4, 0x49, 0x11, 0xC0, 0x21, 0x44, 0x94, 0x62, 0x59, 0xE2, - 0xF4, 0xE0, 0x6A, 0xAA, 0x90, 0x48, 0x92, 0x49, 0x4A, 0x00, 0x5D, 0x40, 0x21, 0x09, 0xF2, 0x10, 0xE0, 0xC0, 0x80, 0x25, 0x25, - 0x24, 0x26, 0xA3, 0x18, 0xC6, 0x31, 0xF0, 0x27, 0x92, 0x49, 0x20, 0x11, 0xB4, 0x41, 0x0C, 0xC6, 0x10, 0xFC, 0x26, 0xA2, 0x13, - 0x04, 0x31, 0xF0, 0x08, 0x61, 0x8A, 0x49, 0x2F, 0xC2, 0x08, 0xFF, 0xE1, 0x4D, 0x84, 0x31, 0xF0, 0x26, 0xE3, 0x0F, 0x46, 0x31, - 0xF0, 0xFF, 0xC4, 0x22, 0x11, 0x08, 0x40, 0x11, 0xA4, 0x51, 0x39, 0x1C, 0x51, 0x78, 0x11, 0xA4, 0x71, 0x45, 0xF0, 0x51, 0x78, - 0xC0, 0x30, 0xC0, 0x36, 0x1F, 0x20, 0xE0, 0x80, 0xF8, 0x3E, 0xC1, 0xC2, 0xE8, 0x00, 0x74, 0x62, 0x11, 0x10, 0x80, 0x20, 0x0F, - 0x06, 0x18, 0x81, 0xA7, 0xD4, 0x93, 0x22, 0x64, 0x4A, 0x7E, 0x60, 0x06, 0x00, 0x3C, 0x00, 0x18, 0x18, 0x1C, 0x24, 0x24, 0x7E, - 0x42, 0x42, 0xC3, 0xFA, 0x38, 0x61, 0xFA, 0x18, 0x61, 0xFC, 0x38, 0x8A, 0x0C, 0x08, 0x10, 0x20, 0xE3, 0x7C, 0xF9, 0x1A, 0x1C, - 0x18, 0x30, 0x60, 0xC2, 0xF8, 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, 0xFE, 0x08, 0x20, 0xFA, 0x08, 0x20, 0x80, 0x3C, 0x46, - 0x82, 0x80, 0x8F, 0x81, 0x83, 0xC3, 0x7D, 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, 0xFF, 0x80, 0x08, 0x42, 0x10, 0x86, - 0x31, 0x78, 0x87, 0x1A, 0x65, 0x8F, 0x1A, 0x22, 0x42, 0x86, 0x84, 0x21, 0x08, 0x42, 0x10, 0xF8, 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, - 0xA5, 0x99, 0x99, 0x99, 0x83, 0x87, 0x8D, 0x19, 0x32, 0x62, 0xC3, 0x86, 0x1E, 0x11, 0x90, 0x48, 0x1C, 0x0A, 0x05, 0x06, 0xC2, - 0x3E, 0x00, 0xFA, 0x18, 0x61, 0xFE, 0x08, 0x20, 0x80, 0x1E, 0x11, 0x90, 0x48, 0x1C, 0x0A, 0x05, 0x06, 0xC6, 0x3F, 0x00, 0xFD, - 0x0E, 0x0C, 0x1F, 0xD0, 0xA0, 0xC1, 0x82, 0x7A, 0x18, 0x70, 0x78, 0x38, 0x61, 0x7C, 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, - 0x10, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC3, 0x7C, 0xC3, 0x42, 0x42, 0x26, 0x24, 0x24, 0x14, 0x18, 0x18, 0xC4, 0x28, 0xC5, - 0x39, 0xA5, 0x24, 0xA4, 0x52, 0x8C, 0x71, 0x8C, 0x30, 0x80, 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xB3, 0x84, 0xC3, 0x42, 0x26, 0x24, - 0x18, 0x18, 0x08, 0x08, 0x08, 0x7E, 0x0C, 0x10, 0x41, 0x06, 0x08, 0x20, 0xFE, 0xEA, 0xAA, 0xAB, 0x92, 0x24, 0x89, 0x20, 0xED, - 0xB6, 0xDB, 0x6D, 0xF0, 0x46, 0xAA, 0x90, 0xFC, 0x90, 0xFC, 0x4F, 0x98, 0xFC, 0x84, 0x21, 0xF8, 0xC6, 0x31, 0xF0, 0x79, 0x18, - 0x20, 0x45, 0xE0, 0x04, 0x10, 0x5F, 0xC6, 0x18, 0x51, 0x7C, 0xFC, 0x7F, 0x08, 0xF8, 0x29, 0x74, 0x92, 0x40, 0x7D, 0x18, 0x61, - 0x45, 0xF0, 0x52, 0x30, 0x84, 0x21, 0xF8, 0xC6, 0x31, 0x88, 0xDF, 0x80, 0x51, 0x55, 0x56, 0x84, 0x21, 0x2A, 0x72, 0x92, 0x98, - 0xFF, 0x80, 0xFF, 0x99, 0x99, 0x99, 0x99, 0x99, 0xFC, 0x63, 0x18, 0xC4, 0x79, 0x18, 0x71, 0x45, 0xE0, 0xFC, 0x63, 0x18, 0xFA, - 0x10, 0x80, 0x7D, 0x18, 0x61, 0x45, 0xF0, 0x41, 0x04, 0xF2, 0x49, 0x00, 0x79, 0x07, 0x02, 0xCD, 0xE0, 0x4B, 0xA4, 0x93, 0x8C, - 0x63, 0x18, 0xFC, 0xCD, 0x24, 0x94, 0x30, 0xC0, 0x99, 0x59, 0x55, 0x56, 0x66, 0x26, 0x96, 0x66, 0x99, 0xCA, 0x52, 0x63, 0x18, - 0x84, 0x40, 0x78, 0xC4, 0x44, 0x7C, 0x6A, 0xAA, 0xA9, 0xFF, 0xF0, 0xC9, 0x24, 0x4A, 0x49, 0x40, 0xE8, 0xC0, 0xFE, 0x18, 0x61, - 0x86, 0x18, 0x61, 0xFC, 0xFC, 0x08, 0x04, 0x02, 0x01, 0xF0, 0x8C, 0x46, 0x23, 0x11, 0x80, 0xC0, 0xC0, 0x10, 0x8F, 0xE0, 0x82, - 0x08, 0x20, 0x82, 0x08, 0x00, 0x64, 0x0F, 0x88, 0x88, 0x80, 0x3D, 0x0C, 0x2E, 0xF9, 0x04, 0x0F, 0x7C, 0x08, 0x81, 0x10, 0x22, - 0x04, 0x7C, 0x88, 0x51, 0x0A, 0x21, 0x87, 0xC0, 0x84, 0x10, 0x82, 0x10, 0x42, 0x0F, 0xFD, 0x08, 0xA1, 0x0C, 0x23, 0x87, 0xC0, - 0x10, 0x88, 0xE6, 0xB3, 0x8C, 0x28, 0x92, 0x28, 0xC0, 0xFC, 0x08, 0x04, 0x02, 0x01, 0xF0, 0x8C, 0x46, 0x23, 0x11, 0x80, 0x83, - 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xFE, 0x20, 0x40, 0x43, 0xC4, 0x1F, 0x45, 0x14, 0x51, 0x44, 0x11, 0x80, 0x78, 0x24, 0x13, - 0xC9, 0x14, 0x8E, 0x7C, 0x88, 0x44, 0x3F, 0xD1, 0x38, 0x8C, 0x78, 0x60, 0x9A, 0xCC, 0xA9, 0x43, 0xC4, 0x1F, 0x45, 0x14, 0x51, - 0x44, 0x8C, 0x63, 0x18, 0xFC, 0x80, 0x24, 0x33, 0x0A, 0x36, 0x45, 0x8E, 0x0C, 0x10, 0x60, 0x80, 0x70, 0x22, 0x95, 0xA8, 0xC4, - 0x23, 0x10, 0x08, 0x42, 0x10, 0x86, 0x31, 0x78, 0x07, 0xF8, 0x20, 0x82, 0x08, 0x20, 0x82, 0x00, 0x28, 0x0F, 0xE0, 0x82, 0x0F, - 0xE0, 0x82, 0x0F, 0xC0, 0x38, 0x8A, 0x0C, 0x0F, 0x90, 0x20, 0xE3, 0x7C, 0x51, 0x55, 0x56, 0xA1, 0x24, 0x92, 0x49, 0x00, 0xFF, - 0x80, 0xDF, 0x80, 0x27, 0xC9, 0x24, 0x8A, 0x28, 0xA2, 0x8B, 0xF8, 0x20, 0x80, 0x28, 0xA0, 0x1E, 0x47, 0xFC, 0x11, 0x78, 0x88, - 0x44, 0x32, 0x59, 0xDA, 0xCD, 0x66, 0x6B, 0x32, 0x89, 0x80, 0x79, 0x1F, 0x30, 0x45, 0xE0, 0x7A, 0x18, 0x70, 0x78, 0x38, 0x61, - 0x7C, 0x79, 0x07, 0x02, 0xCD, 0xE0, 0xB4, 0x24, 0x92, 0x40, 0x18, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, 0xFE, 0x08, - 0x20, 0xFE, 0x18, 0x61, 0xFC, 0xFA, 0x38, 0x61, 0xFA, 0x18, 0x61, 0xFC, 0xFE, 0x08, 0x20, 0x82, 0x08, 0x20, 0x80, 0x1F, 0x08, - 0x84, 0x42, 0x21, 0x10, 0x88, 0x44, 0x42, 0xFF, 0xC0, 0x60, 0x20, 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, 0x88, 0xA4, 0x9A, - 0x87, 0xC1, 0xC1, 0xF1, 0xAD, 0x92, 0x88, 0x80, 0x7A, 0x18, 0x41, 0x38, 0x18, 0x61, 0x7C, 0x87, 0x0E, 0x2C, 0x59, 0x34, 0x68, - 0xE1, 0xC2, 0x28, 0x22, 0x1C, 0x38, 0xB1, 0x64, 0xD1, 0xA3, 0x87, 0x08, 0x8E, 0x6B, 0x38, 0xC2, 0x89, 0x22, 0x8C, 0x3E, 0x44, - 0x89, 0x12, 0x24, 0x58, 0xA1, 0xC2, 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, - 0xC1, 0x82, 0x3C, 0x46, 0x83, 0x81, 0x81, 0x81, 0x81, 0xC2, 0x7C, 0xFF, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x82, 0xFA, 0x18, - 0x61, 0xFE, 0x08, 0x20, 0x80, 0x38, 0x8A, 0x0C, 0x08, 0x10, 0x20, 0xE3, 0x7C, 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, - 0xC2, 0x8D, 0x91, 0x63, 0x83, 0x04, 0x18, 0x20, 0x08, 0x1E, 0x32, 0xD1, 0x38, 0x8C, 0x4F, 0x2C, 0xFC, 0x08, 0x00, 0x87, 0x34, - 0x8C, 0x30, 0xC4, 0xB3, 0x84, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0xFF, 0x01, 0x01, 0x8E, 0x38, 0xE3, 0x8D, 0xF0, - 0xC3, 0x0C, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0xFF, 0x99, 0x4C, 0xA6, 0x53, 0x29, 0x94, 0xCA, 0x65, 0x32, 0xFF, - 0x80, 0x40, 0x20, 0xF0, 0x04, 0x01, 0x00, 0x40, 0x1F, 0x84, 0x21, 0x0C, 0x42, 0x1F, 0x00, 0x81, 0xC0, 0xE0, 0x70, 0x3F, 0xDC, - 0x2E, 0x17, 0x0B, 0xF9, 0x80, 0x82, 0x08, 0x20, 0xFE, 0x18, 0x61, 0xF8, 0x79, 0x8A, 0x18, 0x13, 0xE0, 0x60, 0xC2, 0x7C, 0x87, - 0x26, 0x39, 0x06, 0x41, 0xF0, 0x64, 0x19, 0x06, 0x63, 0x8F, 0x80, 0x7E, 0x18, 0x61, 0x7C, 0xD6, 0x71, 0x84, 0x79, 0x11, 0xD9, - 0xCD, 0xD0, 0x0D, 0xC4, 0x1E, 0x47, 0x1C, 0x51, 0x78, 0xF4, 0xBD, 0x29, 0xF8, 0xF8, 0x88, 0x88, 0x3C, 0x48, 0x91, 0x22, 0x5F, - 0xE0, 0x80, 0x79, 0x1F, 0xF0, 0x45, 0xE0, 0x92, 0x54, 0x38, 0x3C, 0x56, 0x93, 0x78, 0x23, 0x82, 0xCD, 0xE0, 0x9C, 0xEB, 0x5C, - 0xC4, 0x70, 0x27, 0x3A, 0xD7, 0x31, 0x9A, 0xCC, 0xA9, 0x7A, 0x52, 0x94, 0xE4, 0x8F, 0x3D, 0x6D, 0xA6, 0x90, 0x8C, 0x7F, 0x18, - 0xC4, 0x79, 0x1C, 0x71, 0x45, 0xE0, 0xFC, 0x63, 0x18, 0xC4, 0xFC, 0x63, 0x18, 0xFA, 0x10, 0x80, 0x79, 0x1C, 0x30, 0x45, 0xE0, - 0xF9, 0x08, 0x42, 0x10, 0x8A, 0x56, 0xA3, 0x10, 0x8C, 0x40, 0x04, 0x01, 0x07, 0xF9, 0x31, 0xC4, 0x71, 0x14, 0xC5, 0xFE, 0x04, - 0x01, 0x00, 0x40, 0x4B, 0x8C, 0x65, 0xE4, 0x8A, 0x28, 0xA2, 0x8B, 0xF0, 0x40, 0x99, 0x97, 0x11, 0x96, 0x59, 0x65, 0x97, 0xF0, - 0x95, 0x2A, 0x54, 0xA9, 0x5F, 0xC0, 0x80, 0xF0, 0x20, 0x78, 0x91, 0x23, 0xC0, 0x86, 0x1F, 0x63, 0x8F, 0xD0, 0x84, 0x3D, 0x18, - 0xF8, 0xF4, 0xDE, 0x19, 0xF8, 0x9E, 0xA2, 0xE1, 0xA1, 0xA2, 0x9E, 0xFC, 0x7E, 0xD4, 0xC4, -}; - -const GFXglyph FreeSans6pt8bCyrillicGlyphs[] PROGMEM = { - {0, 0, 0, 3, 0, 0}, // 0x20 ' ' - {3, 2, 9, 3, 1, -8}, // 0x21 '!' - {6, 3, 3, 4, 1, -8}, // 0x22 '"' - {8, 7, 8, 7, 0, -7}, // 0x23 '#' - {15, 6, 11, 7, 0, -8}, // 0x24 '$' - {24, 10, 9, 11, 0, -8}, // 0x25 '%' - {36, 6, 9, 8, 1, -8}, // 0x26 '&' - {43, 1, 3, 2, 1, -8}, // 0x27 ''' - {44, 2, 10, 4, 1, -7}, // 0x28 '(' - {47, 3, 11, 4, 0, -7}, // 0x29 ')' - {52, 3, 4, 5, 1, -8}, // 0x2A '*' - {54, 5, 6, 7, 1, -5}, // 0x2B '+' - {58, 1, 3, 3, 1, 0}, // 0x2C ',' - {59, 2, 1, 4, 1, -3}, // 0x2D '-' - {60, 1, 1, 3, 1, 0}, // 0x2E '.' - {61, 3, 8, 3, 0, -7}, // 0x2F '/' - {64, 5, 9, 7, 1, -8}, // 0x30 '0' - {70, 3, 9, 7, 1, -8}, // 0x31 '1' - {74, 6, 9, 7, 0, -8}, // 0x32 '2' - {81, 5, 9, 7, 1, -8}, // 0x33 '3' - {87, 6, 9, 7, 0, -8}, // 0x34 '4' - {94, 5, 9, 7, 1, -8}, // 0x35 '5' - {100, 5, 9, 7, 1, -8}, // 0x36 '6' - {106, 5, 9, 7, 1, -8}, // 0x37 '7' - {112, 6, 9, 7, 0, -8}, // 0x38 '8' - {119, 6, 9, 7, 0, -8}, // 0x39 '9' - {126, 2, 6, 3, 1, -5}, // 0x3A ':' - {128, 2, 8, 3, 1, -5}, // 0x3B ';' - {130, 5, 5, 7, 1, -4}, // 0x3C '<' - {134, 5, 3, 7, 1, -3}, // 0x3D '=' - {136, 5, 5, 7, 1, -4}, // 0x3E '>' - {140, 5, 9, 7, 1, -8}, // 0x3F '?' - {146, 11, 11, 12, 0, -8}, // 0x40 '@' - {162, 8, 9, 8, 0, -8}, // 0x41 'A' - {171, 6, 9, 8, 1, -8}, // 0x42 'B' - {178, 7, 9, 9, 1, -8}, // 0x43 'C' - {186, 7, 9, 9, 1, -8}, // 0x44 'D' - {194, 6, 9, 8, 1, -8}, // 0x45 'E' - {201, 6, 9, 7, 1, -8}, // 0x46 'F' - {208, 8, 9, 9, 1, -8}, // 0x47 'G' - {217, 7, 9, 9, 1, -8}, // 0x48 'H' - {225, 1, 9, 3, 1, -8}, // 0x49 'I' - {227, 5, 9, 6, 0, -8}, // 0x4A 'J' - {233, 7, 9, 8, 1, -8}, // 0x4B 'K' - {241, 5, 9, 7, 1, -8}, // 0x4C 'L' - {247, 8, 9, 10, 1, -8}, // 0x4D 'M' - {256, 7, 9, 9, 1, -8}, // 0x4E 'N' - {264, 9, 9, 9, 0, -8}, // 0x4F 'O' - {275, 6, 9, 8, 1, -8}, // 0x50 'P' - {282, 9, 9, 9, 0, -8}, // 0x51 'Q' - {293, 7, 9, 9, 1, -8}, // 0x52 'R' - {301, 6, 9, 8, 1, -8}, // 0x53 'S' - {308, 7, 9, 7, 0, -8}, // 0x54 'T' - {316, 7, 9, 9, 1, -8}, // 0x55 'U' - {324, 8, 9, 8, 0, -8}, // 0x56 'V' - {333, 11, 9, 11, 0, -8}, // 0x57 'W' - {346, 6, 9, 8, 1, -8}, // 0x58 'X' - {353, 8, 9, 8, 0, -8}, // 0x59 'Y' - {362, 7, 9, 7, 0, -8}, // 0x5A 'Z' - {370, 2, 12, 3, 1, -8}, // 0x5B '[' - {373, 3, 9, 3, 0, -8}, // 0x5C '\' - {377, 3, 12, 3, 0, -8}, // 0x5D ']' - {382, 4, 5, 6, 1, -8}, // 0x5E '^' - {385, 6, 1, 7, 0, 2}, // 0x5F '_' - {386, 2, 2, 4, 1, -8}, // 0x60 '`' - {387, 5, 6, 7, 1, -5}, // 0x61 'a' - {391, 5, 9, 7, 1, -8}, // 0x62 'b' - {397, 6, 6, 6, 0, -5}, // 0x63 'c' - {402, 6, 9, 7, 0, -8}, // 0x64 'd' - {409, 5, 6, 7, 1, -5}, // 0x65 'e' - {413, 3, 9, 3, 0, -8}, // 0x66 'f' - {417, 6, 9, 7, 0, -5}, // 0x67 'g' - {424, 5, 9, 7, 1, -8}, // 0x68 'h' - {430, 1, 9, 3, 1, -8}, // 0x69 'i' - {432, 2, 12, 3, 0, -8}, // 0x6A 'j' - {435, 5, 9, 6, 1, -8}, // 0x6B 'k' - {441, 1, 9, 3, 1, -8}, // 0x6C 'l' - {443, 8, 6, 10, 1, -5}, // 0x6D 'm' - {449, 5, 6, 7, 1, -5}, // 0x6E 'n' - {453, 6, 6, 7, 0, -5}, // 0x6F 'o' - {458, 5, 9, 7, 1, -5}, // 0x70 'p' - {464, 6, 9, 7, 0, -5}, // 0x71 'q' - {471, 3, 6, 4, 1, -5}, // 0x72 'r' - {474, 6, 6, 6, 0, -5}, // 0x73 's' - {479, 3, 8, 3, 0, -7}, // 0x74 't' - {482, 5, 6, 7, 1, -5}, // 0x75 'u' - {486, 6, 6, 6, 0, -5}, // 0x76 'v' - {491, 8, 6, 9, 0, -5}, // 0x77 'w' - {497, 4, 6, 6, 1, -5}, // 0x78 'x' - {500, 5, 9, 6, 0, -5}, // 0x79 'y' - {506, 5, 6, 6, 0, -5}, // 0x7A 'z' - {510, 2, 12, 4, 1, -8}, // 0x7B '{' - {513, 1, 12, 3, 1, -8}, // 0x7C '|' - {515, 3, 12, 4, 0, -8}, // 0x7D '}' - {520, 5, 2, 7, 1, -4}, // 0x7E '~' - {522, 6, 9, 8, 1, -8}, // - {529, 9, 11, 9, 0, -8}, // - {542, 6, 11, 7, 1, -10}, // - {551, 0, 0, 8, 0, 0}, // - {551, 4, 9, 5, 1, -8}, // - {556, 0, 0, 8, 0, 0}, // - {556, 0, 0, 8, 0, 0}, // - {556, 0, 0, 8, 0, 0}, // - {556, 0, 0, 8, 0, 0}, // - {556, 6, 8, 8, 1, -7}, // - {562, 0, 0, 8, 0, 0}, // - {562, 11, 9, 13, 1, -8}, // - {575, 0, 0, 8, 0, 0}, // - {575, 11, 9, 12, 1, -8}, // - {588, 6, 11, 8, 1, -10}, // - {597, 9, 9, 9, 0, -8}, // - {608, 7, 11, 9, 1, -8}, // - {618, 6, 11, 7, 0, -8}, // - {627, 0, 0, 8, 0, 0}, // - {627, 0, 0, 8, 0, 0}, // - {627, 0, 0, 8, 0, 0}, // - {627, 0, 0, 8, 0, 0}, // - {627, 0, 0, 8, 0, 0}, // - {627, 0, 0, 8, 0, 0}, // - {627, 0, 0, 8, 0, 0}, // - {627, 0, 0, 8, 0, 0}, // - {627, 0, 0, 8, 0, 0}, // - {627, 9, 6, 10, 0, -5}, // - {634, 0, 0, 8, 0, 0}, // - {634, 9, 6, 10, 1, -5}, // - {641, 4, 8, 6, 1, -7}, // - {645, 6, 9, 7, 0, -8}, // - {652, 5, 7, 7, 1, -5}, // - {657, 0, 0, 8, 0, 0}, // - {657, 7, 11, 7, 0, -10}, // - {667, 5, 11, 6, 0, -7}, // - {674, 5, 9, 6, 0, -8}, // - {680, 0, 0, 8, 0, 0}, // - {680, 6, 10, 7, 1, -9}, // - {688, 0, 0, 8, 0, 0}, // - {688, 0, 0, 8, 0, 0}, // - {688, 6, 11, 8, 1, -10}, // - {697, 7, 9, 9, 1, -8}, // - {705, 0, 0, 8, 0, 0}, // - {705, 0, 0, 8, 0, 0}, // - {705, 2, 12, 3, 0, -8}, // - {708, 0, 0, 8, 0, 0}, // - {708, 0, 0, 8, 0, 0}, // - {708, 3, 11, 3, 0, -10}, // - {713, 0, 0, 8, 0, 0}, // - {713, 0, 0, 8, 0, 0}, // - {713, 1, 9, 3, 1, -8}, // - {715, 1, 9, 3, 1, -8}, // - {717, 3, 8, 5, 1, -7}, // - {720, 6, 9, 7, 1, -5}, // - {727, 0, 0, 8, 0, 0}, // - {727, 0, 0, 8, 0, 0}, // - {727, 6, 9, 7, 0, -8}, // - {734, 9, 9, 11, 1, -8}, // - {745, 6, 6, 6, 0, -5}, // - {750, 0, 0, 8, 0, 0}, // - {750, 0, 0, 8, 0, 0}, // - {750, 6, 9, 8, 1, -8}, // - {757, 6, 6, 6, 0, -5}, // - {762, 3, 9, 3, 0, -8}, // - {766, 8, 9, 8, 0, -8}, // - {775, 6, 9, 8, 1, -8}, // - {782, 6, 9, 8, 1, -8}, // - {789, 6, 9, 7, 1, -8}, // - {796, 9, 11, 10, 0, -8}, // - {809, 6, 9, 8, 1, -8}, // - {816, 9, 9, 11, 1, -8}, // - {827, 6, 9, 8, 1, -8}, // - {834, 7, 9, 9, 1, -8}, // - {842, 7, 11, 9, 1, -10}, // - {852, 6, 9, 8, 1, -8}, // - {859, 7, 9, 8, 0, -8}, // - {867, 8, 9, 10, 1, -8}, // - {876, 7, 9, 9, 1, -8}, // - {884, 8, 9, 10, 1, -8}, // - {893, 7, 9, 9, 1, -8}, // - {901, 6, 9, 8, 1, -8}, // - {908, 7, 9, 9, 1, -8}, // - {916, 7, 9, 7, 0, -8}, // - {924, 7, 9, 7, 0, -8}, // - {932, 9, 9, 10, 1, -8}, // - {943, 6, 9, 8, 1, -8}, // - {950, 8, 11, 9, 1, -8}, // - {961, 6, 9, 8, 1, -8}, // - {968, 8, 9, 10, 1, -8}, // - {977, 9, 11, 10, 1, -8}, // - {990, 10, 9, 10, 0, -8}, // - {1002, 9, 9, 10, 1, -8}, // - {1013, 6, 9, 8, 1, -8}, // - {1020, 7, 9, 9, 1, -8}, // - {1028, 10, 9, 12, 1, -8}, // - {1040, 6, 9, 8, 1, -8}, // - {1047, 6, 6, 7, 0, -5}, // - {1052, 6, 9, 7, 0, -8}, // - {1059, 5, 6, 6, 1, -5}, // - {1063, 4, 6, 5, 1, -5}, // - {1066, 7, 7, 7, 0, -5}, // - {1073, 6, 6, 7, 0, -5}, // - {1078, 8, 6, 9, 1, -5}, // - {1084, 6, 6, 6, 0, -5}, // - {1089, 5, 6, 7, 1, -5}, // - {1093, 5, 8, 7, 1, -7}, // - {1098, 4, 6, 6, 1, -5}, // - {1101, 5, 6, 6, 0, -5}, // - {1105, 6, 6, 7, 1, -5}, // - {1110, 5, 6, 7, 1, -5}, // - {1114, 6, 6, 7, 0, -5}, // - {1119, 5, 6, 7, 1, -5}, // - {1123, 5, 9, 7, 1, -5}, // - {1129, 6, 6, 6, 0, -5}, // - {1134, 5, 6, 5, 0, -5}, // - {1138, 5, 9, 6, 0, -5}, // - {1144, 10, 11, 10, 0, -7}, // - {1158, 5, 6, 6, 0, -5}, // - {1162, 6, 7, 7, 1, -5}, // - {1168, 4, 6, 6, 1, -5}, // - {1171, 6, 6, 8, 1, -5}, // - {1176, 7, 7, 9, 1, -5}, // - {1183, 7, 6, 8, 0, -5}, // - {1189, 6, 6, 8, 1, -5}, // - {1194, 5, 6, 6, 1, -5}, // - {1198, 5, 6, 6, 1, -5}, // - {1202, 8, 6, 9, 1, -5}, // - {1208, 5, 6, 7, 1, -5} // -}; - -const GFXfont FreeSans6pt8bCyrillic PROGMEM = {(uint8_t *)FreeSans6pt8bCyrillicBitmaps, (GFXglyph *)FreeSans6pt8bCyrillicGlyphs, - 0x20, 0xFF, 16}; diff --git a/src/graphics/niche/Fonts/FreeSans6pt_Win1250.h b/src/graphics/niche/Fonts/FreeSans6pt_Win1250.h new file mode 100644 index 000000000..aee777783 --- /dev/null +++ b/src/graphics/niche/Fonts/FreeSans6pt_Win1250.h @@ -0,0 +1,457 @@ +#pragma once +const uint8_t FreeSans6pt_Win1250Bitmaps[] PROGMEM = { + /* ' ' 0x20 */ + 0xFC, 0x80, /* '!' 0x21 */ + 0xB6, 0x80, /* '"' 0x22 */ + 0x24, 0x51, 0xF9, 0x42, 0x9F, 0x92, 0x28, /* '#' 0x23 */ + 0x10, 0xE5, 0x55, 0x50, 0xE1, 0x65, 0x55, 0xE1, 0x00, /* '$' 0x24 */ + 0x71, 0x24, 0x89, 0x22, 0x50, 0x74, 0x02, 0x70, 0xA4, 0x49, 0x11, 0xC0, /* '%' 0x25 */ + 0x71, 0x24, 0x9C, 0x62, 0x58, 0xA7, 0xF4, /* '&' 0x26 */ + 0xE0, /* ''' 0x27 */ + 0x5A, 0xAA, 0x94, /* '(' 0x28 */ + 0x89, 0x12, 0x49, 0x29, 0x00, /* ')' 0x29 */ + 0x5E, 0x80, /* '*' 0x2A */ + 0x21, 0x3E, 0x42, 0x00, /* '+' 0x2B */ + 0xE0, /* ',' 0x2C */ + 0xC0, /* '-' 0x2D */ + 0x80, /* '.' 0x2E */ + 0x24, 0xA4, 0xA4, 0x80, /* '/' 0x2F */ + 0x76, 0xE3, 0x18, 0xC6, 0x3B, 0x70, /* '0' 0x30 */ + 0x27, 0x92, 0x49, 0x20, /* '1' 0x31 */ + 0x79, 0x10, 0x41, 0x08, 0xC6, 0x10, 0xFC, /* '2' 0x32 */ + 0x79, 0x30, 0x43, 0x18, 0x10, 0x71, 0x78, /* '3' 0x33 */ + 0x08, 0x61, 0x8A, 0x49, 0x2F, 0xC2, 0x08, /* '4' 0x34 */ + 0xFC, 0x21, 0xE8, 0x84, 0x31, 0xF0, /* '5' 0x35 */ + 0x74, 0x61, 0xE8, 0xC6, 0x31, 0x70, /* '6' 0x36 */ + 0xF8, 0x44, 0x22, 0x11, 0x08, 0x40, /* '7' 0x37 */ + 0x39, 0x34, 0x53, 0x39, 0x1C, 0x51, 0x38, /* '8' 0x38 */ + 0x39, 0x3C, 0x71, 0x4C, 0xF0, 0x53, 0x78, /* '9' 0x39 */ + 0x82, /* ':' 0x3A */ + 0x87, /* ';' 0x3B */ + 0x3E, 0x30, 0x60, 0x80, /* '<' 0x3C */ + 0xF8, 0x3E, /* '=' 0x3D */ + 0xE0, 0xC6, 0xC8, 0x00, /* '>' 0x3E */ + 0x74, 0x42, 0x11, 0x10, 0x80, 0x20, /* '?' 0x3F */ + 0x0F, 0x86, 0x19, 0x9A, 0xA4, 0xD9, 0x13, 0x22, 0x56, 0xDA, 0x6E, 0x60, 0x06, 0x00, 0x3C, 0x00, /* '@' 0x40 */ + 0x18, 0x18, 0x24, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, /* 'A' 0x41 */ + 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xFC, /* 'B' 0x42 */ + 0x3E, 0x63, 0x40, 0x40, 0xC0, 0x40, 0x41, 0x63, 0x3E, /* 'C' 0x43 */ + 0xF9, 0x0A, 0x1C, 0x18, 0x30, 0x61, 0xC2, 0xF8, /* 'D' 0x44 */ + 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, /* 'E' 0x45 */ + 0xFE, 0x08, 0x20, 0xFA, 0x08, 0x20, 0x80, /* 'F' 0x46 */ + 0x1E, 0x61, 0x40, 0x40, 0xC7, 0x41, 0x41, 0x63, 0x1D, /* 'G' 0x47 */ + 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, /* 'H' 0x48 */ + 0xFF, 0x80, /* 'I' 0x49 */ + 0x08, 0x42, 0x10, 0x87, 0x29, 0x70, /* 'J' 0x4A */ + 0x85, 0x12, 0x45, 0x0D, 0x13, 0x22, 0x42, 0x86, /* 'K' 0x4B */ + 0x84, 0x21, 0x08, 0x42, 0x10, 0xF8, /* 'L' 0x4C */ + 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, /* 'M' 0x4D */ + 0x83, 0x86, 0x8D, 0x19, 0x33, 0x62, 0xC3, 0x86, /* 'N' 0x4E */ + 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x06, 0xC6, 0x1E, 0x00, /* 'O' 0x4F */ + 0xFA, 0x18, 0x61, 0xFA, 0x08, 0x20, 0x80, /* 'P' 0x50 */ + 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x16, 0xC6, 0x1F, 0x00, 0x40, /* 'Q' 0x51 */ + 0xFD, 0x0E, 0x1C, 0x2F, 0x90, 0xA1, 0x42, 0x86, /* 'R' 0x52 */ + 0x7A, 0x18, 0x30, 0x78, 0x38, 0x61, 0x78, /* 'S' 0x53 */ + 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, /* 'T' 0x54 */ + 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xE2, 0x78, /* 'U' 0x55 */ + 0xC2, 0x85, 0x0B, 0x22, 0x44, 0x8E, 0x0C, 0x18, /* 'V' 0x56 */ + 0xC4, 0x28, 0xCD, 0x29, 0x25, 0x24, 0xA4, 0x52, 0x8C, 0x61, 0x8C, 0x31, 0x80, /* 'W' 0x57 */ + 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xA3, 0x84, /* 'X' 0x58 */ + 0xC3, 0x42, 0x24, 0x34, 0x18, 0x08, 0x08, 0x08, 0x08, /* 'Y' 0x59 */ + 0x7E, 0x0C, 0x30, 0x41, 0x06, 0x18, 0x20, 0xFE, /* 'Z' 0x5A */ + 0xEA, 0xAA, 0xAB, /* '[' 0x5B */ + 0x92, 0x24, 0x89, 0x20, /* '\' 0x5C */ + 0xD5, 0x55, 0x57, /* ']' 0x5D */ + 0x46, 0xA9, /* '^' 0x5E */ + 0xFE, /* '_' 0x5F */ + 0x80, /* '`' 0x60 */ + 0x79, 0x20, 0x4F, 0xC6, 0x37, 0x40, /* 'a' 0x61 */ + 0x84, 0x3D, 0x18, 0xC6, 0x31, 0xF0, /* 'b' 0x62 */ + 0x39, 0x3C, 0x20, 0xC1, 0x33, 0x80, /* 'c' 0x63 */ + 0x04, 0x13, 0xD3, 0xC6, 0x1C, 0x53, 0x3C, /* 'd' 0x64 */ + 0x39, 0x38, 0x7F, 0x81, 0x13, 0x80, /* 'e' 0x65 */ + 0x6B, 0xA4, 0x92, 0x40, /* 'f' 0x66 */ + 0x35, 0x3C, 0x61, 0xC5, 0x33, 0x41, 0x4D, 0xE0, /* 'g' 0x67 */ + 0x84, 0x3D, 0x38, 0xC6, 0x31, 0x88, /* 'h' 0x68 */ + 0xBF, 0x80, /* 'i' 0x69 */ + 0x45, 0x55, 0x57, /* 'j' 0x6A */ + 0x84, 0x25, 0x4E, 0x52, 0xD2, 0x88, /* 'k' 0x6B */ + 0xFF, 0x80, /* 'l' 0x6C */ + 0xF7, 0x99, 0x91, 0x91, 0x91, 0x91, 0x91, /* 'm' 0x6D */ + 0xF4, 0x63, 0x18, 0xC6, 0x20, /* 'n' 0x6E */ + 0x39, 0x3C, 0x61, 0xC5, 0x33, 0x80, /* 'o' 0x6F */ + 0xF4, 0x63, 0x18, 0xC7, 0xD0, 0x80, /* 'p' 0x70 */ + 0x3D, 0x3C, 0x61, 0xC5, 0x37, 0x41, 0x04, /* 'q' 0x71 */ + 0xF2, 0x49, 0x20, /* 'r' 0x72 */ + 0x7A, 0x50, 0xE0, 0xE5, 0xE0, /* 's' 0x73 */ + 0x5D, 0x24, 0x93, /* 't' 0x74 */ + 0x8C, 0x63, 0x18, 0xCF, 0xA0, /* 'u' 0x75 */ + 0x85, 0x24, 0x92, 0x30, 0xC3, 0x00, /* 'v' 0x76 */ + 0x89, 0x59, 0x59, 0x55, 0x56, 0x26, 0x26, /* 'w' 0x77 */ + 0x4A, 0x4C, 0x43, 0x27, 0x20, /* 'x' 0x78 */ + 0x8A, 0x52, 0xA5, 0x18, 0x84, 0x22, 0x00, /* 'y' 0x79 */ + 0x78, 0x44, 0x46, 0x23, 0xE0, /* 'z' 0x7A */ + 0x6A, 0xAA, 0xA9, /* '{' 0x7B */ + 0xFF, 0xE0, /* '|' 0x7C */ + 0x95, 0x55, 0x56, /* '}' 0x7D */ + 0x66, 0x60, /* '~' 0x7E */ + 0xFF, 0xC0, 0x67, 0x34, 0x58, 0x4C, 0x46, 0x03, 0x11, 0x80, 0xFF, 0xC0, /* 0x7F */ + 0x1C, 0x45, 0x07, 0xE4, 0x1F, 0x10, 0x10, 0x1E, /* 0x80 */ + /* 0x81 */ + 0xE0, /* 0x82 */ + /* 0x83 */ + 0xB6, 0x80, /* 0x84 */ + 0xA8, /* 0x85 */ + 0x21, 0x09, 0xF2, 0x10, 0x84, 0x21, 0x08, /* 0x86 */ + 0x21, 0x09, 0xF2, 0x10, 0x84, 0xF9, 0x08, /* 0x87 */ + /* 0x88 */ + 0x62, 0x09, 0x40, 0x98, 0x06, 0x80, 0x10, 0x01, 0x66, 0x29, 0x92, 0x99, 0x06, 0x60, /* 0x89 */ + 0x28, 0x47, 0xA1, 0x83, 0x07, 0x83, 0x87, 0x17, 0x80, /* 0x8A */ + 0x64, /* 0x8B */ + 0x10, 0x87, 0xA1, 0x83, 0x07, 0x83, 0x87, 0x17, 0x80, /* 0x8C */ + 0x28, 0x4F, 0xC4, 0x10, 0x41, 0x04, 0x10, 0x40, /* 0x8D */ + 0x14, 0x11, 0xF8, 0x30, 0xC1, 0x04, 0x18, 0x61, 0xFC, /* 0x8E */ + 0x08, 0x21, 0xF8, 0x30, 0xC1, 0x04, 0x18, 0x61, 0xFC, /* 0x8F */ + /* 0x90 */ + 0xE0, /* 0x91 */ + 0xE0, /* 0x92 */ + 0xB6, 0x80, /* 0x93 */ + 0xB6, 0x80, /* 0x94 */ + 0xFF, 0x80, /* 0x95 */ + 0xFC, /* 0x96 */ + 0xFF, 0xF0, /* 0x97 */ + /* 0x98 */ + 0xE6, 0x28, 0xCD, 0x19, 0xA3, 0x34, 0x6A, 0x8B, 0x51, 0x68, /* 0x99 */ + 0x52, 0x69, 0x8E, 0x19, 0x60, /* 0x9A */ + 0x98, /* 0x9B */ + 0x24, 0x06, 0x98, 0xE1, 0x96, /* 0x9C */ + 0x15, 0xE4, 0x44, 0x44, 0x60, /* 0x9D */ + 0x51, 0x00, 0xF0, 0x88, 0x8C, 0x47, 0xC0, /* 0x9E */ + 0x11, 0x00, 0xF0, 0x88, 0x8C, 0x47, 0xC0, /* 0x9F */ + /* 0xA0 */ + 0xA8, /* 0xA1 */ + 0x96, /* 0xA2 */ + 0x41, 0x05, 0x18, 0x43, 0x04, 0x10, 0x7C, /* 0xA3 */ + 0xFC, 0x63, 0xF0, /* 0xA4 */ + 0x30, 0x38, 0x28, 0x48, 0x4C, 0x7C, 0x84, 0x86, 0x82, 0x04, 0x07, /* 0xA5 */ + 0xF9, 0xF0, /* 0xA6 */ + 0x32, 0x91, 0xC9, 0x47, 0x26, 0x14, 0xA4, 0xC0, /* 0xA7 */ + 0xA0, /* 0xA8 */ + 0x3E, 0x3F, 0xB8, 0xF4, 0x1A, 0x0D, 0x17, 0x76, 0xC6, 0x3E, 0x00, /* 0xA9 */ + 0x7A, 0x18, 0x30, 0x78, 0x38, 0x61, 0x78, 0xC1, 0x0C, /* 0xAA */ + 0x5A, 0xA5, /* 0xAB */ + 0xFC, 0x10, 0x40, /* 0xAC */ + /* 0xAD */ + 0x3E, 0x31, 0xB7, 0x72, 0x99, 0xCC, 0xC7, 0x56, 0xC6, 0x3E, 0x00, /* 0xAE */ + 0x18, 0x31, 0xF8, 0x30, 0xC1, 0x04, 0x18, 0x61, 0xFC, /* 0xAF */ + 0x69, 0x96, /* 0xB0 */ + 0x21, 0x3E, 0x42, 0x03, 0xE0, /* 0xB1 */ + 0x9C, /* 0xB2 */ + 0x49, 0x35, 0x92, 0x40, /* 0xB3 */ + 0x80, /* 0xB4 */ + 0x8A, 0x28, 0xA2, 0x8A, 0x6E, 0xE0, 0x80, /* 0xB5 */ + 0x7F, 0xAE, 0xBA, 0x68, 0xA2, 0x8A, 0x28, 0xA0, /* 0xB6 */ + 0x80, /* 0xB7 */ + 0x67, 0x80, /* 0xB8 */ + 0x78, 0x84, 0x04, 0x3C, 0xC4, 0x8C, 0x76, 0x04, 0x07, /* 0xB9 */ + 0x69, 0x8E, 0x19, 0x66, 0x26, /* 0xBA */ + 0xA5, 0x5A, /* 0xBB */ + 0xA5, 0x21, 0x08, 0x42, 0x10, 0xF8, /* 0xBC */ + 0xA0, /* 0xBD */ + 0xBA, 0x49, 0x24, 0x90, /* 0xBE */ + 0x31, 0x9E, 0x11, 0x11, 0x88, 0xF8, /* 0xBF */ + 0x10, 0x43, 0xE4, 0x28, 0x50, 0xBE, 0x42, 0x85, 0x0C, /* 0xC0 */ + 0x08, 0x10, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC1 */ + 0x18, 0x24, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC2 */ + 0x24, 0x18, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC3 */ + 0x24, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, /* 0xC4 */ + 0x11, 0x21, 0x08, 0x42, 0x10, 0x87, 0xC0, /* 0xC5 */ + 0x08, 0x20, 0x01, 0xE4, 0x30, 0x20, 0x40, 0x82, 0x8C, 0xF0, /* 0xC6 */ + 0x3E, 0x61, 0xC0, 0x80, 0x80, 0x80, 0xC1, 0x63, 0x3E, 0x0C, 0x04, 0x1C, /* 0xC7 */ + 0x28, 0x20, 0x01, 0xE4, 0x30, 0x20, 0x40, 0x82, 0x8C, 0xF0, /* 0xC8 */ + 0x08, 0x40, 0x3F, 0x82, 0x0F, 0xA0, 0x83, 0xF0, /* 0xC9 */ + 0xFD, 0x02, 0x04, 0x0F, 0xD0, 0x20, 0x40, 0xFC, 0x10, 0x38, /* 0xCA */ + 0x28, 0x0F, 0xE0, 0x83, 0xE8, 0x20, 0x83, 0xF0, /* 0xCB */ + 0x28, 0x40, 0x3F, 0x82, 0x0F, 0xA0, 0x82, 0x0F, 0xC0, /* 0xCC */ + 0x62, 0xAA, 0xA0, /* 0xCD */ + 0x54, 0x24, 0x92, 0x48, /* 0xCE */ + 0x50, 0x43, 0xE4, 0x28, 0x30, 0x60, 0xC1, 0x85, 0xF0, /* 0xCF */ + 0x7C, 0x42, 0x41, 0x41, 0xF1, 0x41, 0x41, 0x42, 0x7C, /* 0xD0 */ + 0x08, 0x23, 0x0F, 0x1B, 0x32, 0x66, 0xC7, 0x87, 0x04, /* 0xD1 */ + 0x28, 0x23, 0x0F, 0x1B, 0x32, 0x66, 0xC7, 0x87, 0x04, /* 0xD2 */ + 0x04, 0x04, 0x0F, 0x8C, 0x6C, 0x1C, 0x06, 0x03, 0x83, 0x63, 0x1F, 0x00, /* 0xD3 */ + 0x08, 0x0A, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, /* 0xD4 */ + 0x0A, 0x0A, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, /* 0xD5 */ + 0x14, 0x00, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, /* 0xD6 */ + 0x8A, 0x88, 0xA8, 0x80, /* 0xD7 */ + 0x50, 0x43, 0xE4, 0x28, 0x50, 0xBE, 0x42, 0x85, 0x0C, /* 0xD8 */ + 0x10, 0x52, 0x4C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xD9 */ + 0x08, 0x22, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xDA */ + 0x14, 0x52, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xDB */ + 0x29, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xDC */ + 0x09, 0x25, 0x12, 0x22, 0x87, 0x04, 0x08, 0x10, 0x20, /* 0xDD */ + 0xFC, 0x41, 0x04, 0x10, 0x41, 0x04, 0x10, 0x60, 0x8E, /* 0xDE */ + 0x7A, 0x18, 0x61, 0x8A, 0x18, 0x61, 0xB8, /* 0xDF */ + 0x42, 0xE9, 0x24, 0x80, /* 0xE0 */ + 0x10, 0x40, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE1 */ + 0x10, 0x50, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE2 */ + 0x48, 0x60, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE3 */ + 0x28, 0x01, 0xE4, 0x20, 0x47, 0xB1, 0x46, 0x76, /* 0xE4 */ + 0x62, 0xAA, 0xA0, /* 0xE5 */ + 0x10, 0x80, 0x1E, 0xC6, 0x08, 0x20, 0xC5, 0xE0, /* 0xE6 */ + 0x7B, 0x18, 0x20, 0x83, 0x17, 0x8C, 0x11, 0xC0, /* 0xE7 */ + 0x28, 0x40, 0x1E, 0xC6, 0x08, 0x20, 0xC5, 0xE0, /* 0xE8 */ + 0x10, 0x80, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, /* 0xE9 */ + 0x7B, 0x38, 0x7F, 0x83, 0x37, 0x84, 0x1C, /* 0xEA */ + 0x28, 0x07, 0xB3, 0x87, 0xF8, 0x31, 0x78, /* 0xEB */ + 0x28, 0x40, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, /* 0xEC */ + 0x62, 0xAA, 0xA0, /* 0xED */ + 0x54, 0x24, 0x92, 0x48, /* 0xEE */ + 0x02, 0x0C, 0x13, 0xEC, 0xD0, 0xA1, 0x42, 0xCC, 0xE8, /* 0xEF */ + 0x04, 0x1D, 0xD6, 0x68, 0x50, 0xA1, 0x66, 0x74, /* 0xF0 */ + 0x11, 0x01, 0x6C, 0xC6, 0x31, 0x8C, 0x40, /* 0xF1 */ + 0x20, 0x81, 0x6C, 0xC6, 0x31, 0x8C, 0x40, /* 0xF2 */ + 0x10, 0x80, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF3 */ + 0x10, 0xA0, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF4 */ + 0x29, 0x40, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF5 */ + 0x28, 0x07, 0xB3, 0x86, 0x18, 0x73, 0x78, /* 0xF6 */ + 0x20, 0x3E, 0x02, 0x00, /* 0xF7 */ + 0xA8, 0x5D, 0x24, 0x90, /* 0xF8 */ + 0x22, 0x89, 0x18, 0xC6, 0x31, 0x9B, 0x40, /* 0xF9 */ + 0x11, 0x23, 0x18, 0xC6, 0x33, 0x68, /* 0xFA */ + 0x2A, 0x81, 0x18, 0xC6, 0x31, 0x9B, 0x40, /* 0xFB */ + 0x50, 0x23, 0x18, 0xC6, 0x33, 0x68, /* 0xFC */ + 0x10, 0x88, 0x52, 0x49, 0x23, 0x0C, 0x30, 0x82, 0x18, /* 0xFD */ + 0x4E, 0x44, 0x44, 0x46, 0x31, 0x70, /* 0xFE */ + 0x80, /* 0xFF */ +}; + +const GFXglyph FreeSans6pt_Win1250Glyphs[] PROGMEM = { + /* ' ' 0x20 */ {0, 0, 0, 3, 0, 0}, + /* '!' 0x21 */ {0, 1, 9, 4, 2, -8}, + /* '"' 0x22 */ {2, 3, 3, 4, 0, -8}, + /* '#' 0x23 */ {4, 7, 8, 7, 0, -7}, + /* '$' 0x24 */ {11, 6, 11, 7, 0, -9}, + /* '%' 0x25 */ {20, 10, 9, 11, 0, -8}, + /* '&' 0x26 */ {32, 6, 9, 8, 1, -8}, + /* ''' 0x27 */ {39, 1, 3, 2, 1, -8}, + /* '(' 0x28 */ {40, 2, 11, 4, 1, -8}, + /* ')' 0x29 */ {43, 3, 11, 4, 0, -8}, + /* '*' 0x2A */ {48, 3, 3, 5, 1, -8}, + /* '+' 0x2B */ {50, 5, 5, 7, 1, -4}, + /* ',' 0x2C */ {54, 1, 3, 3, 1, 0}, + /* '-' 0x2D */ {55, 2, 1, 4, 1, -3}, + /* '.' 0x2E */ {56, 1, 1, 3, 1, 0}, + /* '/' 0x2F */ {57, 3, 9, 3, 0, -8}, + /* '0' 0x30 */ {61, 5, 9, 7, 1, -8}, + /* '1' 0x31 */ {67, 3, 9, 7, 1, -8}, + /* '2' 0x32 */ {71, 6, 9, 7, 0, -8}, + /* '3' 0x33 */ {78, 6, 9, 7, 0, -8}, + /* '4' 0x34 */ {85, 6, 9, 7, 0, -8}, + /* '5' 0x35 */ {92, 5, 9, 7, 1, -8}, + /* '6' 0x36 */ {98, 5, 9, 7, 1, -8}, + /* '7' 0x37 */ {104, 5, 9, 7, 1, -8}, + /* '8' 0x38 */ {110, 6, 9, 7, 0, -8}, + /* '9' 0x39 */ {117, 6, 9, 7, 0, -8}, + /* ':' 0x3A */ {124, 1, 7, 3, 1, -6}, + /* ';' 0x3B */ {125, 1, 8, 3, 1, -5}, + /* '<' 0x3C */ {126, 5, 5, 7, 1, -4}, + /* '=' 0x3D */ {130, 5, 3, 7, 1, -3}, + /* '>' 0x3E */ {132, 5, 5, 7, 1, -4}, + /* '?' 0x3F */ {136, 5, 9, 7, 1, -8}, + /* '@' 0x40 */ {142, 11, 11, 12, 0, -8}, + /* 'A' 0x41 */ {158, 8, 9, 8, 0, -8}, + /* 'B' 0x42 */ {167, 6, 9, 8, 1, -8}, + /* 'C' 0x43 */ {174, 8, 9, 9, 0, -8}, + /* 'D' 0x44 */ {183, 7, 9, 8, 1, -8}, + /* 'E' 0x45 */ {191, 6, 9, 8, 1, -8}, + /* 'F' 0x46 */ {198, 6, 9, 7, 1, -8}, + /* 'G' 0x47 */ {205, 8, 9, 9, 0, -8}, + /* 'H' 0x48 */ {214, 7, 9, 9, 1, -8}, + /* 'I' 0x49 */ {222, 1, 9, 3, 1, -8}, + /* 'J' 0x4A */ {224, 5, 9, 6, 0, -8}, + /* 'K' 0x4B */ {230, 7, 9, 8, 1, -8}, + /* 'L' 0x4C */ {238, 5, 9, 7, 1, -8}, + /* 'M' 0x4D */ {244, 8, 9, 10, 1, -8}, + /* 'N' 0x4E */ {253, 7, 9, 9, 1, -8}, + /* 'O' 0x4F */ {261, 9, 9, 9, 0, -8}, + /* 'P' 0x50 */ {272, 6, 9, 8, 1, -8}, + /* 'Q' 0x51 */ {279, 9, 10, 9, 0, -8}, + /* 'R' 0x52 */ {291, 7, 9, 9, 1, -8}, + /* 'S' 0x53 */ {299, 6, 9, 8, 1, -8}, + /* 'T' 0x54 */ {306, 7, 9, 8, 0, -8}, + /* 'U' 0x55 */ {314, 7, 9, 9, 1, -8}, + /* 'V' 0x56 */ {322, 7, 9, 8, 0, -8}, + /* 'W' 0x57 */ {330, 11, 9, 11, 0, -8}, + /* 'X' 0x58 */ {343, 6, 9, 8, 1, -8}, + /* 'Y' 0x59 */ {350, 8, 9, 8, 0, -8}, + /* 'Z' 0x5A */ {359, 7, 9, 7, 0, -8}, + /* '[' 0x5B */ {367, 2, 12, 3, 1, -8}, + /* '\' 0x5C */ {370, 3, 9, 3, 0, -8}, + /* ']' 0x5D */ {374, 2, 12, 3, 0, -8}, + /* '^' 0x5E */ {377, 4, 4, 6, 1, -8}, + /* '_' 0x5F */ {379, 7, 1, 7, 0, 2}, + /* '`' 0x60 */ {380, 1, 1, 3, 1, -8}, + /* 'a' 0x61 */ {381, 6, 7, 7, 0, -6}, + /* 'b' 0x62 */ {387, 5, 9, 7, 1, -8}, + /* 'c' 0x63 */ {393, 6, 7, 6, 0, -6}, + /* 'd' 0x64 */ {399, 6, 9, 7, 0, -8}, + /* 'e' 0x65 */ {406, 6, 7, 6, 0, -6}, + /* 'f' 0x66 */ {412, 3, 9, 3, 0, -8}, + /* 'g' 0x67 */ {416, 6, 10, 7, 0, -6}, + /* 'h' 0x68 */ {424, 5, 9, 6, 1, -8}, + /* 'i' 0x69 */ {430, 1, 9, 3, 1, -8}, + /* 'j' 0x6A */ {432, 2, 12, 3, 0, -8}, + /* 'k' 0x6B */ {435, 5, 9, 6, 1, -8}, + /* 'l' 0x6C */ {441, 1, 9, 3, 1, -8}, + /* 'm' 0x6D */ {443, 8, 7, 10, 1, -6}, + /* 'n' 0x6E */ {450, 5, 7, 6, 1, -6}, + /* 'o' 0x6F */ {455, 6, 7, 6, 0, -6}, + /* 'p' 0x70 */ {461, 5, 9, 7, 1, -6}, + /* 'q' 0x71 */ {467, 6, 9, 7, 0, -6}, + /* 'r' 0x72 */ {474, 3, 7, 4, 1, -6}, + /* 's' 0x73 */ {477, 5, 7, 6, 0, -6}, + /* 't' 0x74 */ {482, 3, 8, 3, 0, -7}, + /* 'u' 0x75 */ {485, 5, 7, 6, 1, -6}, + /* 'v' 0x76 */ {490, 6, 7, 6, 0, -6}, + /* 'w' 0x77 */ {496, 8, 7, 9, 0, -6}, + /* 'x' 0x78 */ {503, 5, 7, 6, 0, -6}, + /* 'y' 0x79 */ {508, 5, 10, 6, 0, -6}, + /* 'z' 0x7A */ {515, 5, 7, 6, 0, -6}, + /* '{' 0x7B */ {520, 2, 12, 4, 1, -8}, + /* '|' 0x7C */ {523, 1, 11, 3, 1, -8}, + /* '}' 0x7D */ {525, 2, 12, 4, 1, -8}, + /* '~' 0x7E */ {528, 6, 2, 6, 0, -4}, + /* 0x7F */ {530, 9, 10, 11, 1, -8}, + /* 0x80 */ {542, 7, 9, 8, 0, -8}, + /* 0x81 */ {550, 0, 0, 8, 0, 0}, + /* 0x82 */ {550, 1, 3, 3, 1, 0}, + /* 0x83 */ {551, 0, 0, 8, 0, 0}, + /* 0x84 */ {551, 3, 3, 5, 1, 0}, + /* 0x85 */ {553, 5, 1, 7, 1, 0}, + /* 0x86 */ {554, 5, 11, 7, 1, -8}, + /* 0x87 */ {561, 5, 11, 7, 1, -8}, + /* 0x88 */ {568, 0, 0, 8, 0, 0}, + /* 0x89 */ {568, 12, 9, 12, 0, -8}, + /* 0x8A */ {582, 6, 11, 8, 1, -9}, + /* 0x8B */ {591, 2, 3, 4, 1, -4}, + /* 0x8C */ {592, 6, 11, 8, 1, -10}, + /* 0x8D */ {601, 6, 10, 8, 0, -9}, + /* 0x8E */ {609, 7, 10, 7, 0, -9}, + /* 0x8F */ {618, 7, 10, 7, 0, -9}, + /* 0x90 */ {627, 0, 0, 8, 0, 0}, + /* 0x91 */ {627, 1, 3, 3, 1, -8}, + /* 0x92 */ {628, 1, 3, 2, 1, -8}, + /* 0x93 */ {629, 3, 3, 5, 1, -8}, + /* 0x94 */ {631, 3, 3, 5, 1, -8}, + /* 0x95 */ {633, 3, 3, 5, 1, -5}, + /* 0x96 */ {635, 6, 1, 6, 0, -3}, + /* 0x97 */ {636, 12, 1, 12, 0, -3}, + /* 0x98 */ {638, 0, 0, 8, 0, 0}, + /* 0x99 */ {638, 11, 7, 12, 1, -8}, + /* 0x9A */ {648, 4, 9, 6, 1, -8}, + /* 0x9B */ {653, 2, 3, 3, 1, -4}, + /* 0x9C */ {654, 4, 10, 6, 1, -9}, + /* 0x9D */ {659, 4, 9, 5, 0, -8}, + /* 0x9E */ {664, 5, 10, 6, 0, -9}, + /* 0x9F */ {671, 5, 10, 6, 0, -9}, + /* 0xA0 */ {678, 0, 0, 3, 0, 0}, + /* 0xA1 */ {678, 3, 2, 4, 0, -8}, + /* 0xA2 */ {679, 4, 2, 4, 0, -8}, + /* 0xA3 */ {680, 6, 9, 7, 0, -8}, + /* 0xA4 */ {687, 5, 4, 7, 1, -5}, + /* 0xA5 */ {690, 8, 11, 8, 1, -8}, + /* 0xA6 */ {701, 1, 12, 3, 1, -8}, + /* 0xA7 */ {703, 5, 12, 7, 1, -8}, + /* 0xA8 */ {711, 3, 1, 4, 0, -7}, + /* 0xA9 */ {712, 9, 9, 10, 0, -8}, + /* 0xAA */ {723, 6, 12, 8, 1, -8}, + /* 0xAB */ {732, 4, 4, 6, 1, -4}, + /* 0xAC */ {734, 6, 3, 7, 1, -4}, + /* 0xAD */ {737, 0, 0, 0, 0, 0}, + /* 0xAE */ {737, 9, 9, 10, 0, -8}, + /* 0xAF */ {748, 7, 10, 7, 0, -9}, + /* 0xB0 */ {757, 4, 4, 7, 2, -8}, + /* 0xB1 */ {759, 5, 7, 7, 1, -6}, + /* 0xB2 */ {764, 3, 2, 4, 1, 1}, + /* 0xB3 */ {765, 3, 9, 3, 0, -8}, + /* 0xB4 */ {769, 1, 1, 4, 1, -8}, + /* 0xB5 */ {770, 6, 9, 7, 1, -6}, + /* 0xB6 */ {777, 6, 10, 6, 1, -8}, + /* 0xB7 */ {785, 1, 1, 3, 1, -2}, + /* 0xB8 */ {786, 3, 3, 4, 1, 1}, + /* 0xB9 */ {788, 8, 9, 7, 0, -6}, + /* 0xBA */ {797, 4, 10, 6, 1, -6}, + /* 0xBB */ {802, 4, 4, 6, 1, -5}, + /* 0xBC */ {804, 5, 9, 7, 1, -8}, + /* 0xBD */ {810, 3, 1, 4, 0, -8}, + /* 0xBE */ {811, 3, 10, 3, 1, -9}, + /* 0xBF */ {815, 5, 9, 6, 0, -8}, + /* 0xC0 */ {821, 7, 10, 9, 1, -9}, + /* 0xC1 */ {830, 8, 10, 8, 0, -9}, + /* 0xC2 */ {840, 8, 10, 8, 0, -9}, + /* 0xC3 */ {850, 8, 10, 8, 0, -9}, + /* 0xC4 */ {860, 8, 10, 8, 0, -9}, + /* 0xC5 */ {870, 5, 10, 7, 1, -9}, + /* 0xC6 */ {877, 7, 11, 9, 0, -10}, + /* 0xC7 */ {887, 8, 12, 9, 0, -8}, + /* 0xC8 */ {899, 7, 11, 9, 0, -10}, + /* 0xC9 */ {909, 6, 10, 8, 1, -9}, + /* 0xCA */ {917, 7, 11, 8, 1, -8}, + /* 0xCB */ {927, 6, 10, 8, 1, -9}, + /* 0xCC */ {935, 6, 11, 8, 1, -10}, + /* 0xCD */ {944, 2, 10, 3, 1, -9}, + /* 0xCE */ {947, 3, 10, 4, 0, -9}, + /* 0xCF */ {951, 7, 10, 8, 1, -9}, + /* 0xD0 */ {960, 8, 9, 8, 0, -8}, + /* 0xD1 */ {969, 7, 10, 9, 1, -9}, + /* 0xD2 */ {978, 7, 10, 9, 1, -9}, + /* 0xD3 */ {987, 9, 10, 9, 0, -9}, + /* 0xD4 */ {999, 9, 11, 9, 0, -10}, + /* 0xD5 */ {1012, 9, 11, 9, 0, -10}, + /* 0xD6 */ {1025, 9, 11, 9, 0, -10}, + /* 0xD7 */ {1038, 5, 5, 7, 1, -5}, + /* 0xD8 */ {1042, 7, 10, 9, 1, -9}, + /* 0xD9 */ {1051, 7, 10, 9, 1, -9}, + /* 0xDA */ {1060, 7, 10, 9, 1, -9}, + /* 0xDB */ {1069, 7, 10, 9, 1, -9}, + /* 0xDC */ {1078, 7, 10, 9, 1, -9}, + /* 0xDD */ {1087, 7, 10, 8, 1, -9}, + /* 0xDE */ {1096, 6, 12, 7, 0, -8}, + /* 0xDF */ {1105, 6, 9, 7, 1, -8}, + /* 0xE0 */ {1112, 3, 9, 4, 1, -8}, + /* 0xE1 */ {1116, 7, 10, 7, 0, -9}, + /* 0xE2 */ {1125, 7, 10, 7, 0, -9}, + /* 0xE3 */ {1134, 7, 10, 7, 0, -9}, + /* 0xE4 */ {1143, 7, 9, 7, 0, -8}, + /* 0xE5 */ {1151, 2, 10, 3, 1, -9}, + /* 0xE6 */ {1154, 6, 10, 6, 0, -9}, + /* 0xE7 */ {1162, 6, 10, 6, 0, -6}, + /* 0xE8 */ {1170, 6, 10, 6, 0, -9}, + /* 0xE9 */ {1178, 6, 10, 6, 0, -9}, + /* 0xEA */ {1186, 6, 9, 6, 0, -6}, + /* 0xEB */ {1193, 6, 9, 6, 0, -8}, + /* 0xEC */ {1200, 6, 10, 6, 0, -9}, + /* 0xED */ {1208, 2, 10, 3, 1, -9}, + /* 0xEE */ {1211, 3, 10, 3, 0, -9}, + /* 0xEF */ {1215, 7, 10, 7, 0, -9}, + /* 0xF0 */ {1224, 7, 9, 7, 0, -8}, + /* 0xF1 */ {1232, 5, 10, 6, 1, -9}, + /* 0xF2 */ {1239, 5, 10, 6, 1, -9}, + /* 0xF3 */ {1246, 6, 10, 6, 0, -9}, + /* 0xF4 */ {1254, 6, 10, 6, 0, -9}, + /* 0xF5 */ {1262, 6, 10, 6, 0, -9}, + /* 0xF6 */ {1270, 6, 9, 6, 0, -8}, + /* 0xF7 */ {1277, 5, 5, 7, 1, -5}, + /* 0xF8 */ {1281, 3, 10, 4, 1, -9}, + /* 0xF9 */ {1285, 5, 10, 6, 1, -9}, + /* 0xFA */ {1292, 5, 9, 6, 1, -8}, + /* 0xFB */ {1298, 5, 10, 6, 1, -9}, + /* 0xFC */ {1305, 5, 9, 6, 1, -8}, + /* 0xFD */ {1311, 6, 12, 6, 0, -8}, + /* 0xFE */ {1320, 4, 11, 3, 0, -7}, + /* 0xFF */ {1326, 1, 1, 4, 1, -7}, +}; + +const GFXfont FreeSans6pt_Win1250 PROGMEM = {(uint8_t *)FreeSans6pt_Win1250Bitmaps, (GFXglyph *)FreeSans6pt_Win1250Glyphs, 0x20, + 0xFF, 14}; diff --git a/src/graphics/niche/Fonts/FreeSans6pt_Win1251.h b/src/graphics/niche/Fonts/FreeSans6pt_Win1251.h new file mode 100644 index 000000000..4d3ad1705 --- /dev/null +++ b/src/graphics/niche/Fonts/FreeSans6pt_Win1251.h @@ -0,0 +1,457 @@ +#pragma once +const uint8_t FreeSans6pt_Win1251Bitmaps[] PROGMEM = { + /* ' ' 0x20 */ + 0xFC, 0x80, /* '!' 0x21 */ + 0xB6, 0x80, /* '"' 0x22 */ + 0x24, 0x51, 0xF9, 0x42, 0x9F, 0x92, 0x28, /* '#' 0x23 */ + 0x10, 0xE5, 0x55, 0x50, 0xE1, 0x65, 0x55, 0xE1, 0x00, /* '$' 0x24 */ + 0x71, 0x24, 0x89, 0x22, 0x50, 0x74, 0x02, 0x70, 0xA4, 0x49, 0x11, 0xC0, /* '%' 0x25 */ + 0x71, 0x24, 0x9C, 0x62, 0x58, 0xA7, 0xF4, /* '&' 0x26 */ + 0xE0, /* ''' 0x27 */ + 0x5A, 0xAA, 0x94, /* '(' 0x28 */ + 0x89, 0x12, 0x49, 0x29, 0x00, /* ')' 0x29 */ + 0x5E, 0x80, /* '*' 0x2A */ + 0x21, 0x3E, 0x42, 0x00, /* '+' 0x2B */ + 0xE0, /* ',' 0x2C */ + 0xC0, /* '-' 0x2D */ + 0x80, /* '.' 0x2E */ + 0x24, 0xA4, 0xA4, 0x80, /* '/' 0x2F */ + 0x76, 0xE3, 0x18, 0xC6, 0x3B, 0x70, /* '0' 0x30 */ + 0x27, 0x92, 0x49, 0x20, /* '1' 0x31 */ + 0x79, 0x10, 0x41, 0x08, 0xC6, 0x10, 0xFC, /* '2' 0x32 */ + 0x79, 0x30, 0x43, 0x18, 0x10, 0x71, 0x78, /* '3' 0x33 */ + 0x08, 0x61, 0x8A, 0x49, 0x2F, 0xC2, 0x08, /* '4' 0x34 */ + 0xFC, 0x21, 0xE8, 0x84, 0x31, 0xF0, /* '5' 0x35 */ + 0x74, 0x61, 0xE8, 0xC6, 0x31, 0x70, /* '6' 0x36 */ + 0xF8, 0x44, 0x22, 0x11, 0x08, 0x40, /* '7' 0x37 */ + 0x39, 0x34, 0x53, 0x39, 0x1C, 0x51, 0x38, /* '8' 0x38 */ + 0x39, 0x3C, 0x71, 0x4C, 0xF0, 0x53, 0x78, /* '9' 0x39 */ + 0x82, /* ':' 0x3A */ + 0x87, /* ';' 0x3B */ + 0x3E, 0x30, 0x60, 0x80, /* '<' 0x3C */ + 0xF8, 0x3E, /* '=' 0x3D */ + 0xE0, 0xC6, 0xC8, 0x00, /* '>' 0x3E */ + 0x74, 0x42, 0x11, 0x10, 0x80, 0x20, /* '?' 0x3F */ + 0x0F, 0x86, 0x19, 0x9A, 0xA4, 0xD9, 0x13, 0x22, 0x56, 0xDA, 0x6E, 0x60, 0x06, 0x00, 0x3C, 0x00, /* '@' 0x40 */ + 0x18, 0x18, 0x24, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, /* 'A' 0x41 */ + 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xFC, /* 'B' 0x42 */ + 0x3E, 0x63, 0x40, 0x40, 0xC0, 0x40, 0x41, 0x63, 0x3E, /* 'C' 0x43 */ + 0xF9, 0x0A, 0x1C, 0x18, 0x30, 0x61, 0xC2, 0xF8, /* 'D' 0x44 */ + 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, /* 'E' 0x45 */ + 0xFE, 0x08, 0x20, 0xFA, 0x08, 0x20, 0x80, /* 'F' 0x46 */ + 0x1E, 0x61, 0x40, 0x40, 0xC7, 0x41, 0x41, 0x63, 0x1D, /* 'G' 0x47 */ + 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, /* 'H' 0x48 */ + 0xFF, 0x80, /* 'I' 0x49 */ + 0x08, 0x42, 0x10, 0x87, 0x29, 0x70, /* 'J' 0x4A */ + 0x85, 0x12, 0x45, 0x0D, 0x13, 0x22, 0x42, 0x86, /* 'K' 0x4B */ + 0x84, 0x21, 0x08, 0x42, 0x10, 0xF8, /* 'L' 0x4C */ + 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, /* 'M' 0x4D */ + 0x83, 0x86, 0x8D, 0x19, 0x33, 0x62, 0xC3, 0x86, /* 'N' 0x4E */ + 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x06, 0xC6, 0x1E, 0x00, /* 'O' 0x4F */ + 0xFA, 0x18, 0x61, 0xFA, 0x08, 0x20, 0x80, /* 'P' 0x50 */ + 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x16, 0xC6, 0x1F, 0x00, 0x40, /* 'Q' 0x51 */ + 0xFD, 0x0E, 0x1C, 0x2F, 0x90, 0xA1, 0x42, 0x86, /* 'R' 0x52 */ + 0x7A, 0x18, 0x30, 0x78, 0x38, 0x61, 0x78, /* 'S' 0x53 */ + 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, /* 'T' 0x54 */ + 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xE2, 0x78, /* 'U' 0x55 */ + 0xC2, 0x85, 0x0B, 0x22, 0x44, 0x8E, 0x0C, 0x18, /* 'V' 0x56 */ + 0xC4, 0x28, 0xCD, 0x29, 0x25, 0x24, 0xA4, 0x52, 0x8C, 0x61, 0x8C, 0x31, 0x80, /* 'W' 0x57 */ + 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xA3, 0x84, /* 'X' 0x58 */ + 0xC3, 0x42, 0x24, 0x34, 0x18, 0x08, 0x08, 0x08, 0x08, /* 'Y' 0x59 */ + 0x7E, 0x0C, 0x30, 0x41, 0x06, 0x18, 0x20, 0xFE, /* 'Z' 0x5A */ + 0xEA, 0xAA, 0xAB, /* '[' 0x5B */ + 0x92, 0x24, 0x89, 0x20, /* '\' 0x5C */ + 0xD5, 0x55, 0x57, /* ']' 0x5D */ + 0x46, 0xA9, /* '^' 0x5E */ + 0xFE, /* '_' 0x5F */ + 0x80, /* '`' 0x60 */ + 0x79, 0x20, 0x4F, 0xC6, 0x37, 0x40, /* 'a' 0x61 */ + 0x84, 0x3D, 0x18, 0xC6, 0x31, 0xF0, /* 'b' 0x62 */ + 0x39, 0x3C, 0x20, 0xC1, 0x33, 0x80, /* 'c' 0x63 */ + 0x04, 0x13, 0xD3, 0xC6, 0x1C, 0x53, 0x3C, /* 'd' 0x64 */ + 0x39, 0x38, 0x7F, 0x81, 0x13, 0x80, /* 'e' 0x65 */ + 0x6B, 0xA4, 0x92, 0x40, /* 'f' 0x66 */ + 0x35, 0x3C, 0x61, 0xC5, 0x33, 0x41, 0x4D, 0xE0, /* 'g' 0x67 */ + 0x84, 0x3D, 0x38, 0xC6, 0x31, 0x88, /* 'h' 0x68 */ + 0xBF, 0x80, /* 'i' 0x69 */ + 0x45, 0x55, 0x57, /* 'j' 0x6A */ + 0x84, 0x25, 0x4E, 0x52, 0xD2, 0x88, /* 'k' 0x6B */ + 0xFF, 0x80, /* 'l' 0x6C */ + 0xF7, 0x99, 0x91, 0x91, 0x91, 0x91, 0x91, /* 'm' 0x6D */ + 0xF4, 0x63, 0x18, 0xC6, 0x20, /* 'n' 0x6E */ + 0x39, 0x3C, 0x61, 0xC5, 0x33, 0x80, /* 'o' 0x6F */ + 0xF4, 0x63, 0x18, 0xC7, 0xD0, 0x80, /* 'p' 0x70 */ + 0x3D, 0x3C, 0x61, 0xC5, 0x37, 0x41, 0x04, /* 'q' 0x71 */ + 0xF2, 0x49, 0x20, /* 'r' 0x72 */ + 0x7A, 0x50, 0xE0, 0xE5, 0xE0, /* 's' 0x73 */ + 0x5D, 0x24, 0x93, /* 't' 0x74 */ + 0x8C, 0x63, 0x18, 0xCF, 0xA0, /* 'u' 0x75 */ + 0x85, 0x24, 0x92, 0x30, 0xC3, 0x00, /* 'v' 0x76 */ + 0x89, 0x59, 0x59, 0x55, 0x56, 0x26, 0x26, /* 'w' 0x77 */ + 0x4A, 0x4C, 0x43, 0x27, 0x20, /* 'x' 0x78 */ + 0x8A, 0x52, 0xA5, 0x18, 0x84, 0x22, 0x00, /* 'y' 0x79 */ + 0x78, 0x44, 0x46, 0x23, 0xE0, /* 'z' 0x7A */ + 0x6A, 0xAA, 0xA9, /* '{' 0x7B */ + 0xFF, 0xE0, /* '|' 0x7C */ + 0x95, 0x55, 0x56, /* '}' 0x7D */ + 0x66, 0x60, /* '~' 0x7E */ + 0xFF, 0xC0, 0x67, 0x34, 0x58, 0x4C, 0x46, 0x03, 0x11, 0x80, 0xFF, 0xC0, /* 0x7F */ + 0xFC, 0x08, 0x04, 0x02, 0x01, 0xF0, 0x8C, 0x46, 0x23, 0x11, 0x80, 0xC0, 0xC0, /* 0x80 */ + 0x10, 0x8F, 0xE0, 0x82, 0x08, 0x20, 0x82, 0x00, /* 0x81 */ + 0xE0, /* 0x82 */ + 0x24, 0x0F, 0x88, 0x88, 0x80, /* 0x83 */ + 0xB6, 0x80, /* 0x84 */ + 0xA8, /* 0x85 */ + 0x21, 0x09, 0xF2, 0x10, 0x84, 0x21, 0x08, /* 0x86 */ + 0x21, 0x09, 0xF2, 0x10, 0x84, 0xF9, 0x08, /* 0x87 */ + 0x1C, 0x45, 0x07, 0xE4, 0x1F, 0x10, 0x10, 0x1E, /* 0x88 */ + 0x62, 0x09, 0x40, 0x98, 0x06, 0x80, 0x10, 0x01, 0x66, 0x29, 0x92, 0x99, 0x06, 0x60, /* 0x89 */ + 0x7C, 0x08, 0x81, 0x10, 0x22, 0x04, 0x7C, 0x88, 0x51, 0x0A, 0x21, 0x87, 0xC0, /* 0x8A */ + 0x64, /* 0x8B */ + 0x84, 0x10, 0x82, 0x10, 0x42, 0x0F, 0xFD, 0x08, 0xA1, 0x0C, 0x23, 0x87, 0xC0, /* 0x8C */ + 0x10, 0x88, 0xE6, 0xB3, 0x8C, 0x28, 0x92, 0x28, 0xC0, /* 0x8D */ + 0xFC, 0x08, 0x04, 0x02, 0x01, 0xF0, 0x8C, 0x46, 0x23, 0x11, 0x80, /* 0x8E */ + 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xFE, 0x20, 0x40, /* 0x8F */ + 0x43, 0xC4, 0x1F, 0x45, 0x14, 0x51, 0x44, 0x11, 0x80, /* 0x90 */ + 0xE0, /* 0x91 */ + 0xE0, /* 0x92 */ + 0xB6, 0x80, /* 0x93 */ + 0xB6, 0x80, /* 0x94 */ + 0xFF, 0x80, /* 0x95 */ + 0xFC, /* 0x96 */ + 0xFF, 0xF0, /* 0x97 */ + /* 0x98 */ + 0xE6, 0x28, 0xCD, 0x19, 0xA3, 0x34, 0x6A, 0x8B, 0x51, 0x68, /* 0x99 */ + 0x78, 0x24, 0x13, 0xC9, 0x14, 0x8E, 0x7C, /* 0x9A */ + 0x98, /* 0x9B */ + 0x88, 0x44, 0x3F, 0xD1, 0x38, 0x8C, 0x78, /* 0x9C */ + 0x24, 0x09, 0xAC, 0xCA, 0x90, /* 0x9D */ + 0x43, 0xC4, 0x1F, 0x45, 0x14, 0x51, 0x44, /* 0x9E */ + 0x8C, 0x63, 0x18, 0xFC, 0x80, /* 0x9F */ + /* 0xA0 */ + 0x24, 0x33, 0x0A, 0x36, 0x45, 0x8E, 0x0C, 0x10, 0x60, 0x80, /* 0xA1 */ + 0x51, 0x22, 0x95, 0xA8, 0xC4, 0x23, 0x10, /* 0xA2 */ + 0x08, 0x42, 0x10, 0x86, 0x31, 0x78, /* 0xA3 */ + 0xFC, 0x63, 0xF0, /* 0xA4 */ + 0x07, 0xF8, 0x20, 0x82, 0x08, 0x20, 0x82, 0x00, /* 0xA5 */ + 0xF9, 0xF0, /* 0xA6 */ + 0x32, 0x91, 0xC9, 0x47, 0x26, 0x14, 0xA4, 0xC0, /* 0xA7 */ + 0x28, 0x0F, 0xE0, 0x82, 0x0F, 0xE0, 0x82, 0x0F, 0xC0, /* 0xA8 */ + 0x3E, 0x3F, 0xB8, 0xF4, 0x1A, 0x0D, 0x17, 0x76, 0xC6, 0x3E, 0x00, /* 0xA9 */ + 0x38, 0x8A, 0x0C, 0x0F, 0x90, 0x20, 0xE3, 0x7C, /* 0xAA */ + 0x5A, 0xA5, /* 0xAB */ + 0x51, 0x55, 0x56, /* 0xAC */ + /* 0xAD */ + 0x3E, 0x31, 0xB7, 0x72, 0x99, 0xCC, 0xC7, 0x56, 0xC6, 0x3E, 0x00, /* 0xAE */ + 0xA1, 0x24, 0x92, 0x49, 0x00, /* 0xAF */ + 0x69, 0x96, /* 0xB0 */ + 0x21, 0x3E, 0x42, 0x03, 0xE0, /* 0xB1 */ + 0xFF, 0x80, /* 0xB2 */ + 0xDF, 0x80, /* 0xB3 */ + 0x27, 0xC9, 0x24, /* 0xB4 */ + 0x8A, 0x28, 0xA2, 0x8A, 0x6E, 0xE0, 0x80, /* 0xB5 */ + 0x7F, 0xAE, 0xBA, 0x68, 0xA2, 0x8A, 0x28, 0xA0, /* 0xB6 */ + 0x80, /* 0xB7 */ + 0x28, 0xA0, 0x1E, 0x47, 0xFC, 0x11, 0x78, /* 0xB8 */ + 0x88, 0x44, 0x32, 0x59, 0xDA, 0xCD, 0x66, 0x6B, 0x32, 0x8B, 0x80, /* 0xB9 */ + 0x79, 0x1F, 0x30, 0x45, 0xE0, /* 0xBA */ + 0xA5, 0x5A, /* 0xBB */ + 0x45, 0x55, 0x57, /* 0xBC */ + 0x7A, 0x18, 0x70, 0x78, 0x38, 0x61, 0x7C, /* 0xBD */ + 0x7A, 0x1C, 0x1C, 0xBC, /* 0xBE */ + 0xB4, 0x24, 0x92, 0x40, /* 0xBF */ + 0x18, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, /* 0xC0 */ + 0xFE, 0x08, 0x20, 0xFA, 0x18, 0x61, 0xF8, /* 0xC1 */ + 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xFC, /* 0xC2 */ + 0xFE, 0x08, 0x20, 0x82, 0x08, 0x20, 0x80, /* 0xC3 */ + 0x1F, 0x08, 0x84, 0x42, 0x21, 0x10, 0x88, 0x44, 0x42, 0xFF, 0xC0, 0x60, 0x20, /* 0xC4 */ + 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, /* 0xC5 */ + 0x88, 0xA4, 0x9A, 0x87, 0xC1, 0xC1, 0xF1, 0xAD, 0x92, 0x88, 0x80, /* 0xC6 */ + 0x7A, 0x18, 0x41, 0x38, 0x18, 0x61, 0x7C, /* 0xC7 */ + 0x87, 0x0E, 0x2C, 0x59, 0x34, 0x68, 0xE1, 0xC2, /* 0xC8 */ + 0x28, 0x22, 0x1C, 0x38, 0xB1, 0x64, 0xD1, 0xA3, 0x87, 0x08, /* 0xC9 */ + 0x8E, 0x6B, 0x38, 0xC2, 0x89, 0x22, 0x8C, /* 0xCA */ + 0x3E, 0x44, 0x89, 0x12, 0x24, 0x58, 0xA1, 0xC2, /* 0xCB */ + 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, /* 0xCC */ + 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, /* 0xCD */ + 0x3C, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0xC2, 0x7C, /* 0xCE */ + 0xFF, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x82, /* 0xCF */ + 0xFA, 0x18, 0x61, 0xFE, 0x08, 0x20, 0x80, /* 0xD0 */ + 0x38, 0x8A, 0x0C, 0x08, 0x10, 0x20, 0xE3, 0x7C, /* 0xD1 */ + 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, /* 0xD2 */ + 0xC2, 0x8D, 0x91, 0x63, 0x83, 0x04, 0x18, 0x20, /* 0xD3 */ + 0x08, 0x1F, 0x32, 0x71, 0x18, 0x8C, 0x47, 0x26, 0xFE, 0x08, 0x00, /* 0xD4 */ + 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xB3, 0x84, /* 0xD5 */ + 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0xFF, 0x01, 0x01, /* 0xD6 */ + 0x8E, 0x38, 0xE3, 0x8D, 0xF0, 0xC3, 0x0C, /* 0xD7 */ + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0xFF, /* 0xD8 */ + 0x99, 0x4C, 0xA6, 0x53, 0x29, 0x94, 0xCA, 0x65, 0x32, 0xFF, 0x80, 0x40, 0x20, /* 0xD9 */ + 0xF0, 0x04, 0x01, 0x00, 0x40, 0x1F, 0x84, 0x21, 0x0C, 0x42, 0x1F, 0x00, /* 0xDA */ + 0x81, 0xC0, 0xE0, 0x70, 0x3F, 0xDC, 0x2E, 0x17, 0x0B, 0xF9, 0x80, /* 0xDB */ + 0x82, 0x08, 0x20, 0xFE, 0x18, 0x61, 0xF8, /* 0xDC */ + 0x79, 0x8A, 0x18, 0x13, 0xE0, 0x60, 0xC2, 0x7C, /* 0xDD */ + 0x87, 0x26, 0x39, 0x06, 0x41, 0xF0, 0x64, 0x19, 0x06, 0x63, 0x8F, 0x80, /* 0xDE */ + 0x7E, 0x18, 0x61, 0x7C, 0xD6, 0x71, 0x84, /* 0xDF */ + 0x79, 0x11, 0xD9, 0xCD, 0xD0, /* 0xE0 */ + 0x0D, 0xC4, 0x1E, 0x47, 0x1C, 0x51, 0x78, /* 0xE1 */ + 0xF4, 0xBD, 0x29, 0xF8, /* 0xE2 */ + 0xF8, 0x88, 0x88, /* 0xE3 */ + 0x3C, 0x48, 0x91, 0x22, 0x5F, 0xE0, 0x80, /* 0xE4 */ + 0x79, 0x1F, 0xF0, 0x45, 0xE0, /* 0xE5 */ + 0x92, 0x54, 0x38, 0x3C, 0x56, 0x93, /* 0xE6 */ + 0x78, 0x23, 0x82, 0xCD, 0xE0, /* 0xE7 */ + 0x9C, 0xEB, 0x5C, 0xC4, /* 0xE8 */ + 0x70, 0x27, 0x3A, 0xD7, 0x31, /* 0xE9 */ + 0x9A, 0xCC, 0xA9, /* 0xEA */ + 0x7A, 0x52, 0x94, 0xE4, /* 0xEB */ + 0x8F, 0x3D, 0x6D, 0xA6, 0x90, /* 0xEC */ + 0x8C, 0x7F, 0x18, 0xC4, /* 0xED */ + 0x79, 0x1C, 0x71, 0x45, 0xE0, /* 0xEE */ + 0xFC, 0x63, 0x18, 0xC4, /* 0xEF */ + 0xFC, 0x63, 0x18, 0xFA, 0x10, 0x80, /* 0xF0 */ + 0x79, 0x1C, 0x30, 0x45, 0xE0, /* 0xF1 */ + 0xF9, 0x08, 0x42, 0x10, /* 0xF2 */ + 0x8A, 0x56, 0xA3, 0x10, 0x8C, 0x40, /* 0xF3 */ + 0x04, 0x01, 0x07, 0xF9, 0x31, 0xC4, 0x71, 0x14, 0xC5, 0xFE, 0x04, 0x01, 0x00, 0x40, /* 0xF4 */ + 0x4B, 0x8C, 0x65, 0xE4, /* 0xF5 */ + 0x8A, 0x28, 0xA2, 0x8B, 0xF0, 0x40, /* 0xF6 */ + 0x99, 0x97, 0x11, /* 0xF7 */ + 0x96, 0x59, 0x65, 0x97, 0xF0, /* 0xF8 */ + 0x95, 0x2A, 0x54, 0xA9, 0x5F, 0xC0, 0x80, /* 0xF9 */ + 0xF0, 0x20, 0x78, 0x91, 0x23, 0xC0, /* 0xFA */ + 0x86, 0x1F, 0x63, 0x8F, 0xD0, /* 0xFB */ + 0x84, 0x3D, 0x18, 0xF8, /* 0xFC */ + 0xF4, 0xDE, 0x19, 0xF8, /* 0xFD */ + 0x9E, 0xA2, 0xE1, 0xA1, 0xA2, 0x9E, /* 0xFE */ + 0xFC, 0x7E, 0xD4, 0xC4, /* 0xFF */ +}; + +const GFXglyph FreeSans6pt_Win1251Glyphs[] PROGMEM = { + /* ' ' 0x20 */ {0, 0, 0, 3, 0, 0}, + /* '!' 0x21 */ {0, 1, 9, 4, 2, -8}, + /* '"' 0x22 */ {2, 3, 3, 4, 0, -8}, + /* '#' 0x23 */ {4, 7, 8, 7, 0, -7}, + /* '$' 0x24 */ {11, 6, 11, 7, 0, -9}, + /* '%' 0x25 */ {20, 10, 9, 11, 0, -8}, + /* '&' 0x26 */ {32, 6, 9, 8, 1, -8}, + /* ''' 0x27 */ {39, 1, 3, 2, 1, -8}, + /* '(' 0x28 */ {40, 2, 11, 4, 1, -8}, + /* ')' 0x29 */ {43, 3, 11, 4, 0, -8}, + /* '*' 0x2A */ {48, 3, 3, 5, 1, -8}, + /* '+' 0x2B */ {50, 5, 5, 7, 1, -4}, + /* ',' 0x2C */ {54, 1, 3, 3, 1, 0}, + /* '-' 0x2D */ {55, 2, 1, 4, 1, -3}, + /* '.' 0x2E */ {56, 1, 1, 3, 1, 0}, + /* '/' 0x2F */ {57, 3, 9, 3, 0, -8}, + /* '0' 0x30 */ {61, 5, 9, 7, 1, -8}, + /* '1' 0x31 */ {67, 3, 9, 7, 1, -8}, + /* '2' 0x32 */ {71, 6, 9, 7, 0, -8}, + /* '3' 0x33 */ {78, 6, 9, 7, 0, -8}, + /* '4' 0x34 */ {85, 6, 9, 7, 0, -8}, + /* '5' 0x35 */ {92, 5, 9, 7, 1, -8}, + /* '6' 0x36 */ {98, 5, 9, 7, 1, -8}, + /* '7' 0x37 */ {104, 5, 9, 7, 1, -8}, + /* '8' 0x38 */ {110, 6, 9, 7, 0, -8}, + /* '9' 0x39 */ {117, 6, 9, 7, 0, -8}, + /* ':' 0x3A */ {124, 1, 7, 3, 1, -6}, + /* ';' 0x3B */ {125, 1, 8, 3, 1, -5}, + /* '<' 0x3C */ {126, 5, 5, 7, 1, -4}, + /* '=' 0x3D */ {130, 5, 3, 7, 1, -3}, + /* '>' 0x3E */ {132, 5, 5, 7, 1, -4}, + /* '?' 0x3F */ {136, 5, 9, 7, 1, -8}, + /* '@' 0x40 */ {142, 11, 11, 12, 0, -8}, + /* 'A' 0x41 */ {158, 8, 9, 8, 0, -8}, + /* 'B' 0x42 */ {167, 6, 9, 8, 1, -8}, + /* 'C' 0x43 */ {174, 8, 9, 9, 0, -8}, + /* 'D' 0x44 */ {183, 7, 9, 8, 1, -8}, + /* 'E' 0x45 */ {191, 6, 9, 8, 1, -8}, + /* 'F' 0x46 */ {198, 6, 9, 7, 1, -8}, + /* 'G' 0x47 */ {205, 8, 9, 9, 0, -8}, + /* 'H' 0x48 */ {214, 7, 9, 9, 1, -8}, + /* 'I' 0x49 */ {222, 1, 9, 3, 1, -8}, + /* 'J' 0x4A */ {224, 5, 9, 6, 0, -8}, + /* 'K' 0x4B */ {230, 7, 9, 8, 1, -8}, + /* 'L' 0x4C */ {238, 5, 9, 7, 1, -8}, + /* 'M' 0x4D */ {244, 8, 9, 10, 1, -8}, + /* 'N' 0x4E */ {253, 7, 9, 9, 1, -8}, + /* 'O' 0x4F */ {261, 9, 9, 9, 0, -8}, + /* 'P' 0x50 */ {272, 6, 9, 8, 1, -8}, + /* 'Q' 0x51 */ {279, 9, 10, 9, 0, -8}, + /* 'R' 0x52 */ {291, 7, 9, 9, 1, -8}, + /* 'S' 0x53 */ {299, 6, 9, 8, 1, -8}, + /* 'T' 0x54 */ {306, 7, 9, 8, 0, -8}, + /* 'U' 0x55 */ {314, 7, 9, 9, 1, -8}, + /* 'V' 0x56 */ {322, 7, 9, 8, 0, -8}, + /* 'W' 0x57 */ {330, 11, 9, 11, 0, -8}, + /* 'X' 0x58 */ {343, 6, 9, 8, 1, -8}, + /* 'Y' 0x59 */ {350, 8, 9, 8, 0, -8}, + /* 'Z' 0x5A */ {359, 7, 9, 7, 0, -8}, + /* '[' 0x5B */ {367, 2, 12, 3, 1, -8}, + /* '\' 0x5C */ {370, 3, 9, 3, 0, -8}, + /* ']' 0x5D */ {374, 2, 12, 3, 0, -8}, + /* '^' 0x5E */ {377, 4, 4, 6, 1, -8}, + /* '_' 0x5F */ {379, 7, 1, 7, 0, 2}, + /* '`' 0x60 */ {380, 1, 1, 3, 1, -8}, + /* 'a' 0x61 */ {381, 6, 7, 7, 0, -6}, + /* 'b' 0x62 */ {387, 5, 9, 7, 1, -8}, + /* 'c' 0x63 */ {393, 6, 7, 6, 0, -6}, + /* 'd' 0x64 */ {399, 6, 9, 7, 0, -8}, + /* 'e' 0x65 */ {406, 6, 7, 6, 0, -6}, + /* 'f' 0x66 */ {412, 3, 9, 3, 0, -8}, + /* 'g' 0x67 */ {416, 6, 10, 7, 0, -6}, + /* 'h' 0x68 */ {424, 5, 9, 6, 1, -8}, + /* 'i' 0x69 */ {430, 1, 9, 3, 1, -8}, + /* 'j' 0x6A */ {432, 2, 12, 3, 0, -8}, + /* 'k' 0x6B */ {435, 5, 9, 6, 1, -8}, + /* 'l' 0x6C */ {441, 1, 9, 3, 1, -8}, + /* 'm' 0x6D */ {443, 8, 7, 10, 1, -6}, + /* 'n' 0x6E */ {450, 5, 7, 6, 1, -6}, + /* 'o' 0x6F */ {455, 6, 7, 6, 0, -6}, + /* 'p' 0x70 */ {461, 5, 9, 7, 1, -6}, + /* 'q' 0x71 */ {467, 6, 9, 7, 0, -6}, + /* 'r' 0x72 */ {474, 3, 7, 4, 1, -6}, + /* 's' 0x73 */ {477, 5, 7, 6, 0, -6}, + /* 't' 0x74 */ {482, 3, 8, 3, 0, -7}, + /* 'u' 0x75 */ {485, 5, 7, 6, 1, -6}, + /* 'v' 0x76 */ {490, 6, 7, 6, 0, -6}, + /* 'w' 0x77 */ {496, 8, 7, 9, 0, -6}, + /* 'x' 0x78 */ {503, 5, 7, 6, 0, -6}, + /* 'y' 0x79 */ {508, 5, 10, 6, 0, -6}, + /* 'z' 0x7A */ {515, 5, 7, 6, 0, -6}, + /* '{' 0x7B */ {520, 2, 12, 4, 1, -8}, + /* '|' 0x7C */ {523, 1, 11, 3, 1, -8}, + /* '}' 0x7D */ {525, 2, 12, 4, 1, -8}, + /* '~' 0x7E */ {528, 6, 2, 6, 0, -4}, + /* 0x7F */ {530, 9, 10, 11, 1, -8}, + /* 0x80 */ {542, 9, 11, 9, 0, -8}, + /* 0x81 */ {555, 6, 10, 7, 1, -9}, + /* 0x82 */ {563, 1, 3, 3, 1, 0}, + /* 0x83 */ {564, 4, 9, 5, 1, -8}, + /* 0x84 */ {569, 3, 3, 5, 1, 0}, + /* 0x85 */ {571, 5, 1, 7, 1, 0}, + /* 0x86 */ {572, 5, 11, 7, 1, -8}, + /* 0x87 */ {579, 5, 11, 7, 1, -8}, + /* 0x88 */ {586, 7, 9, 8, 0, -8}, + /* 0x89 */ {594, 12, 9, 12, 0, -8}, + /* 0x8A */ {608, 11, 9, 13, 1, -8}, + /* 0x8B */ {621, 2, 3, 4, 1, -4}, + /* 0x8C */ {622, 11, 9, 12, 1, -8}, + /* 0x8D */ {635, 6, 11, 8, 1, -10}, + /* 0x8E */ {644, 9, 9, 9, 0, -8}, + /* 0x8F */ {655, 7, 11, 9, 1, -8}, + /* 0x90 */ {665, 6, 11, 7, 0, -8}, + /* 0x91 */ {674, 1, 3, 3, 1, -8}, + /* 0x92 */ {675, 1, 3, 2, 1, -8}, + /* 0x93 */ {676, 3, 3, 5, 1, -8}, + /* 0x94 */ {678, 3, 3, 5, 1, -8}, + /* 0x95 */ {680, 3, 3, 5, 1, -5}, + /* 0x96 */ {682, 6, 1, 6, 0, -3}, + /* 0x97 */ {683, 12, 1, 12, 0, -3}, + /* 0x98 */ {685, 0, 0, 8, 0, 0}, + /* 0x99 */ {685, 11, 7, 12, 1, -8}, + /* 0x9A */ {695, 9, 6, 10, 0, -5}, + /* 0x9B */ {702, 2, 3, 3, 1, -4}, + /* 0x9C */ {703, 9, 6, 10, 1, -5}, + /* 0x9D */ {710, 4, 9, 6, 1, -8}, + /* 0x9E */ {715, 6, 9, 7, 0, -8}, + /* 0x9F */ {722, 5, 7, 7, 1, -5}, + /* 0xA0 */ {727, 0, 0, 3, 0, 0}, + /* 0xA1 */ {727, 7, 11, 7, 0, -10}, + /* 0xA2 */ {737, 5, 11, 6, 0, -7}, + /* 0xA3 */ {744, 5, 9, 6, 0, -8}, + /* 0xA4 */ {750, 5, 4, 7, 1, -5}, + /* 0xA5 */ {753, 6, 10, 7, 1, -9}, + /* 0xA6 */ {761, 1, 12, 3, 1, -8}, + /* 0xA7 */ {763, 5, 12, 7, 1, -8}, + /* 0xA8 */ {771, 6, 11, 8, 1, -10}, + /* 0xA9 */ {780, 9, 9, 10, 0, -8}, + /* 0xAA */ {791, 7, 9, 9, 1, -8}, + /* 0xAB */ {799, 4, 4, 6, 1, -4}, + /* 0xAC */ {801, 2, 12, 3, 0, -8}, + /* 0xAD */ {804, 0, 0, 0, 0, 0}, + /* 0xAE */ {804, 9, 9, 10, 0, -8}, + /* 0xAF */ {815, 3, 11, 3, 0, -10}, + /* 0xB0 */ {820, 4, 4, 7, 2, -8}, + /* 0xB1 */ {822, 5, 7, 7, 1, -6}, + /* 0xB2 */ {827, 1, 9, 3, 1, -8}, + /* 0xB3 */ {829, 1, 9, 3, 1, -8}, + /* 0xB4 */ {831, 3, 8, 5, 1, -7}, + /* 0xB5 */ {834, 6, 9, 7, 1, -6}, + /* 0xB6 */ {841, 6, 10, 6, 1, -8}, + /* 0xB7 */ {849, 1, 1, 3, 1, -2}, + /* 0xB8 */ {850, 6, 9, 7, 0, -8}, + /* 0xB9 */ {857, 9, 9, 11, 1, -8}, + /* 0xBA */ {868, 6, 6, 6, 0, -5}, + /* 0xBB */ {873, 4, 4, 6, 1, -5}, + /* 0xBC */ {875, 2, 12, 3, 0, -8}, + /* 0xBD */ {878, 6, 9, 8, 1, -8}, + /* 0xBE */ {885, 5, 6, 6, 0, -5}, + /* 0xBF */ {889, 3, 9, 3, 0, -8}, + /* 0xC0 */ {893, 8, 9, 8, 0, -8}, + /* 0xC1 */ {902, 6, 9, 8, 1, -8}, + /* 0xC2 */ {909, 6, 9, 8, 1, -8}, + /* 0xC3 */ {916, 6, 9, 7, 1, -8}, + /* 0xC4 */ {923, 9, 11, 10, 0, -8}, + /* 0xC5 */ {936, 6, 9, 8, 1, -8}, + /* 0xC6 */ {943, 9, 9, 11, 1, -8}, + /* 0xC7 */ {954, 6, 9, 8, 1, -8}, + /* 0xC8 */ {961, 7, 9, 9, 1, -8}, + /* 0xC9 */ {969, 7, 11, 9, 1, -10}, + /* 0xCA */ {979, 6, 9, 8, 1, -8}, + /* 0xCB */ {986, 7, 9, 8, 0, -8}, + /* 0xCC */ {994, 8, 9, 10, 1, -8}, + /* 0xCD */ {1003, 7, 9, 9, 1, -8}, + /* 0xCE */ {1011, 8, 9, 10, 1, -8}, + /* 0xCF */ {1020, 7, 9, 9, 1, -8}, + /* 0xD0 */ {1028, 6, 9, 8, 1, -8}, + /* 0xD1 */ {1035, 7, 9, 9, 1, -8}, + /* 0xD2 */ {1043, 7, 9, 7, 0, -8}, + /* 0xD3 */ {1051, 7, 9, 7, 0, -8}, + /* 0xD4 */ {1059, 9, 9, 10, 1, -8}, + /* 0xD5 */ {1070, 6, 9, 8, 1, -8}, + /* 0xD6 */ {1077, 8, 11, 9, 1, -8}, + /* 0xD7 */ {1088, 6, 9, 8, 1, -8}, + /* 0xD8 */ {1095, 8, 9, 10, 1, -8}, + /* 0xD9 */ {1104, 9, 11, 10, 1, -8}, + /* 0xDA */ {1117, 10, 9, 10, 0, -8}, + /* 0xDB */ {1129, 9, 9, 10, 1, -8}, + /* 0xDC */ {1140, 6, 9, 8, 1, -8}, + /* 0xDD */ {1147, 7, 9, 9, 1, -8}, + /* 0xDE */ {1155, 10, 9, 12, 1, -8}, + /* 0xDF */ {1167, 6, 9, 8, 1, -8}, + /* 0xE0 */ {1174, 6, 6, 7, 0, -5}, + /* 0xE1 */ {1179, 6, 9, 7, 0, -8}, + /* 0xE2 */ {1186, 5, 6, 6, 1, -5}, + /* 0xE3 */ {1190, 4, 6, 5, 1, -5}, + /* 0xE4 */ {1193, 7, 7, 7, 0, -5}, + /* 0xE5 */ {1200, 6, 6, 7, 0, -5}, + /* 0xE6 */ {1205, 8, 6, 9, 1, -5}, + /* 0xE7 */ {1211, 6, 6, 6, 0, -5}, + /* 0xE8 */ {1216, 5, 6, 7, 1, -5}, + /* 0xE9 */ {1220, 5, 8, 7, 1, -7}, + /* 0xEA */ {1225, 4, 6, 6, 1, -5}, + /* 0xEB */ {1228, 5, 6, 6, 0, -5}, + /* 0xEC */ {1232, 6, 6, 7, 1, -5}, + /* 0xED */ {1237, 5, 6, 7, 1, -5}, + /* 0xEE */ {1241, 6, 6, 7, 0, -5}, + /* 0xEF */ {1246, 5, 6, 7, 1, -5}, + /* 0xF0 */ {1250, 5, 9, 7, 1, -5}, + /* 0xF1 */ {1256, 6, 6, 6, 0, -5}, + /* 0xF2 */ {1261, 5, 6, 5, 0, -5}, + /* 0xF3 */ {1265, 5, 9, 6, 0, -5}, + /* 0xF4 */ {1271, 10, 11, 10, 0, -7}, + /* 0xF5 */ {1285, 5, 6, 6, 0, -5}, + /* 0xF6 */ {1289, 6, 7, 7, 1, -5}, + /* 0xF7 */ {1295, 4, 6, 6, 1, -5}, + /* 0xF8 */ {1298, 6, 6, 8, 1, -5}, + /* 0xF9 */ {1303, 7, 7, 9, 1, -5}, + /* 0xFA */ {1310, 7, 6, 8, 0, -5}, + /* 0xFB */ {1316, 6, 6, 8, 1, -5}, + /* 0xFC */ {1321, 5, 6, 6, 1, -5}, + /* 0xFD */ {1325, 5, 6, 6, 1, -5}, + /* 0xFE */ {1329, 8, 6, 9, 1, -5}, + /* 0xFF */ {1335, 5, 6, 7, 1, -5}, +}; + +const GFXfont FreeSans6pt_Win1251 PROGMEM = {(uint8_t *)FreeSans6pt_Win1251Bitmaps, (GFXglyph *)FreeSans6pt_Win1251Glyphs, 0x20, + 0xFF, 14}; diff --git a/src/graphics/niche/Fonts/FreeSans6pt_Win1252.h b/src/graphics/niche/Fonts/FreeSans6pt_Win1252.h new file mode 100644 index 000000000..32f995270 --- /dev/null +++ b/src/graphics/niche/Fonts/FreeSans6pt_Win1252.h @@ -0,0 +1,457 @@ +#pragma once +const uint8_t FreeSans6pt_Win1252Bitmaps[] PROGMEM = { + /* ' ' 0x20 */ + 0xFC, 0x80, /* '!' 0x21 */ + 0xB6, 0x80, /* '"' 0x22 */ + 0x24, 0x51, 0xF9, 0x42, 0x9F, 0x92, 0x28, /* '#' 0x23 */ + 0x10, 0xE5, 0x55, 0x50, 0xE1, 0x65, 0x55, 0xE1, 0x00, /* '$' 0x24 */ + 0x71, 0x24, 0x89, 0x22, 0x50, 0x74, 0x02, 0x70, 0xA4, 0x49, 0x11, 0xC0, /* '%' 0x25 */ + 0x71, 0x24, 0x9C, 0x62, 0x58, 0xA7, 0xF4, /* '&' 0x26 */ + 0xE0, /* ''' 0x27 */ + 0x5A, 0xAA, 0x94, /* '(' 0x28 */ + 0x89, 0x12, 0x49, 0x29, 0x00, /* ')' 0x29 */ + 0x5E, 0x80, /* '*' 0x2A */ + 0x21, 0x3E, 0x42, 0x00, /* '+' 0x2B */ + 0xE0, /* ',' 0x2C */ + 0xC0, /* '-' 0x2D */ + 0x80, /* '.' 0x2E */ + 0x24, 0xA4, 0xA4, 0x80, /* '/' 0x2F */ + 0x76, 0xE3, 0x18, 0xC6, 0x3B, 0x70, /* '0' 0x30 */ + 0x27, 0x92, 0x49, 0x20, /* '1' 0x31 */ + 0x79, 0x10, 0x41, 0x08, 0xC6, 0x10, 0xFC, /* '2' 0x32 */ + 0x79, 0x30, 0x43, 0x18, 0x10, 0x71, 0x78, /* '3' 0x33 */ + 0x08, 0x61, 0x8A, 0x49, 0x2F, 0xC2, 0x08, /* '4' 0x34 */ + 0xFC, 0x21, 0xE8, 0x84, 0x31, 0xF0, /* '5' 0x35 */ + 0x74, 0x61, 0xE8, 0xC6, 0x31, 0x70, /* '6' 0x36 */ + 0xF8, 0x44, 0x22, 0x11, 0x08, 0x40, /* '7' 0x37 */ + 0x39, 0x34, 0x53, 0x39, 0x1C, 0x51, 0x38, /* '8' 0x38 */ + 0x39, 0x3C, 0x71, 0x4C, 0xF0, 0x53, 0x78, /* '9' 0x39 */ + 0x82, /* ':' 0x3A */ + 0x87, /* ';' 0x3B */ + 0x3E, 0x30, 0x60, 0x80, /* '<' 0x3C */ + 0xF8, 0x3E, /* '=' 0x3D */ + 0xE0, 0xC6, 0xC8, 0x00, /* '>' 0x3E */ + 0x74, 0x42, 0x11, 0x10, 0x80, 0x20, /* '?' 0x3F */ + 0x0F, 0x86, 0x19, 0x9A, 0xA4, 0xD9, 0x13, 0x22, 0x56, 0xDA, 0x6E, 0x60, 0x06, 0x00, 0x3C, 0x00, /* '@' 0x40 */ + 0x18, 0x18, 0x24, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, /* 'A' 0x41 */ + 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xFC, /* 'B' 0x42 */ + 0x3E, 0x63, 0x40, 0x40, 0xC0, 0x40, 0x41, 0x63, 0x3E, /* 'C' 0x43 */ + 0xF9, 0x0A, 0x1C, 0x18, 0x30, 0x61, 0xC2, 0xF8, /* 'D' 0x44 */ + 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, /* 'E' 0x45 */ + 0xFE, 0x08, 0x20, 0xFA, 0x08, 0x20, 0x80, /* 'F' 0x46 */ + 0x1E, 0x61, 0x40, 0x40, 0xC7, 0x41, 0x41, 0x63, 0x1D, /* 'G' 0x47 */ + 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, /* 'H' 0x48 */ + 0xFF, 0x80, /* 'I' 0x49 */ + 0x08, 0x42, 0x10, 0x87, 0x29, 0x70, /* 'J' 0x4A */ + 0x85, 0x12, 0x45, 0x0D, 0x13, 0x22, 0x42, 0x86, /* 'K' 0x4B */ + 0x84, 0x21, 0x08, 0x42, 0x10, 0xF8, /* 'L' 0x4C */ + 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, /* 'M' 0x4D */ + 0x83, 0x86, 0x8D, 0x19, 0x33, 0x62, 0xC3, 0x86, /* 'N' 0x4E */ + 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x06, 0xC6, 0x1E, 0x00, /* 'O' 0x4F */ + 0xFA, 0x18, 0x61, 0xFA, 0x08, 0x20, 0x80, /* 'P' 0x50 */ + 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x16, 0xC6, 0x1F, 0x00, 0x40, /* 'Q' 0x51 */ + 0xFD, 0x0E, 0x1C, 0x2F, 0x90, 0xA1, 0x42, 0x86, /* 'R' 0x52 */ + 0x7A, 0x18, 0x30, 0x78, 0x38, 0x61, 0x78, /* 'S' 0x53 */ + 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, /* 'T' 0x54 */ + 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xE2, 0x78, /* 'U' 0x55 */ + 0xC2, 0x85, 0x0B, 0x22, 0x44, 0x8E, 0x0C, 0x18, /* 'V' 0x56 */ + 0xC4, 0x28, 0xCD, 0x29, 0x25, 0x24, 0xA4, 0x52, 0x8C, 0x61, 0x8C, 0x31, 0x80, /* 'W' 0x57 */ + 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xA3, 0x84, /* 'X' 0x58 */ + 0xC3, 0x42, 0x24, 0x34, 0x18, 0x08, 0x08, 0x08, 0x08, /* 'Y' 0x59 */ + 0x7E, 0x0C, 0x30, 0x41, 0x06, 0x18, 0x20, 0xFE, /* 'Z' 0x5A */ + 0xEA, 0xAA, 0xAB, /* '[' 0x5B */ + 0x92, 0x24, 0x89, 0x20, /* '\' 0x5C */ + 0xD5, 0x55, 0x57, /* ']' 0x5D */ + 0x46, 0xA9, /* '^' 0x5E */ + 0xFE, /* '_' 0x5F */ + 0x80, /* '`' 0x60 */ + 0x79, 0x20, 0x4F, 0xC6, 0x37, 0x40, /* 'a' 0x61 */ + 0x84, 0x3D, 0x18, 0xC6, 0x31, 0xF0, /* 'b' 0x62 */ + 0x39, 0x3C, 0x20, 0xC1, 0x33, 0x80, /* 'c' 0x63 */ + 0x04, 0x13, 0xD3, 0xC6, 0x1C, 0x53, 0x3C, /* 'd' 0x64 */ + 0x39, 0x38, 0x7F, 0x81, 0x13, 0x80, /* 'e' 0x65 */ + 0x6B, 0xA4, 0x92, 0x40, /* 'f' 0x66 */ + 0x35, 0x3C, 0x61, 0xC5, 0x33, 0x41, 0x4D, 0xE0, /* 'g' 0x67 */ + 0x84, 0x3D, 0x38, 0xC6, 0x31, 0x88, /* 'h' 0x68 */ + 0xBF, 0x80, /* 'i' 0x69 */ + 0x45, 0x55, 0x57, /* 'j' 0x6A */ + 0x84, 0x25, 0x4E, 0x52, 0xD2, 0x88, /* 'k' 0x6B */ + 0xFF, 0x80, /* 'l' 0x6C */ + 0xF7, 0x99, 0x91, 0x91, 0x91, 0x91, 0x91, /* 'm' 0x6D */ + 0xF4, 0x63, 0x18, 0xC6, 0x20, /* 'n' 0x6E */ + 0x39, 0x3C, 0x61, 0xC5, 0x33, 0x80, /* 'o' 0x6F */ + 0xF4, 0x63, 0x18, 0xC7, 0xD0, 0x80, /* 'p' 0x70 */ + 0x3D, 0x3C, 0x61, 0xC5, 0x37, 0x41, 0x04, /* 'q' 0x71 */ + 0xF2, 0x49, 0x20, /* 'r' 0x72 */ + 0x7A, 0x50, 0xE0, 0xE5, 0xE0, /* 's' 0x73 */ + 0x5D, 0x24, 0x93, /* 't' 0x74 */ + 0x8C, 0x63, 0x18, 0xCF, 0xA0, /* 'u' 0x75 */ + 0x85, 0x24, 0x92, 0x30, 0xC3, 0x00, /* 'v' 0x76 */ + 0x89, 0x59, 0x59, 0x55, 0x56, 0x26, 0x26, /* 'w' 0x77 */ + 0x4A, 0x4C, 0x43, 0x27, 0x20, /* 'x' 0x78 */ + 0x8A, 0x52, 0xA5, 0x18, 0x84, 0x22, 0x00, /* 'y' 0x79 */ + 0x78, 0x44, 0x46, 0x23, 0xE0, /* 'z' 0x7A */ + 0x6A, 0xAA, 0xA9, /* '{' 0x7B */ + 0xFF, 0xE0, /* '|' 0x7C */ + 0x95, 0x55, 0x56, /* '}' 0x7D */ + 0x66, 0x60, /* '~' 0x7E */ + 0xFF, 0xC0, 0x67, 0x34, 0x58, 0x4C, 0x46, 0x03, 0x11, 0x80, 0xFF, 0xC0, /* 0x7F */ + 0x1C, 0x45, 0x07, 0xE4, 0x1F, 0x10, 0x10, 0x1E, /* 0x80 */ + /* 0x81 */ + 0xE0, /* 0x82 */ + 0x6B, 0xA4, 0x92, 0x49, 0x60, /* 0x83 */ + 0xB6, 0x80, /* 0x84 */ + 0xA8, /* 0x85 */ + 0x21, 0x09, 0xF2, 0x10, 0x84, 0x21, 0x08, /* 0x86 */ + 0x21, 0x09, 0xF2, 0x10, 0x84, 0xF9, 0x08, /* 0x87 */ + 0x54, /* 0x88 */ + 0x62, 0x09, 0x40, 0x98, 0x06, 0x80, 0x10, 0x01, 0x66, 0x29, 0x92, 0x99, 0x06, 0x60, /* 0x89 */ + 0x28, 0x47, 0xA1, 0x83, 0x07, 0x83, 0x87, 0x17, 0x80, /* 0x8A */ + 0x64, /* 0x8B */ + 0x3B, 0xE8, 0xC2, 0x08, 0x41, 0x08, 0x3F, 0x04, 0x20, 0x82, 0x30, 0x3B, 0xE0, /* 0x8C */ + /* 0x8D */ + 0x14, 0x11, 0xF8, 0x30, 0xC1, 0x04, 0x18, 0x61, 0xFC, /* 0x8E */ + /* 0x8F */ + /* 0x90 */ + 0xE0, /* 0x91 */ + 0xE0, /* 0x92 */ + 0xB6, 0x80, /* 0x93 */ + 0xB6, 0x80, /* 0x94 */ + 0xFF, 0x80, /* 0x95 */ + 0xFC, /* 0x96 */ + 0xFF, 0xF0, /* 0x97 */ + 0xDB, /* 0x98 */ + 0xE6, 0x28, 0xCD, 0x19, 0xA3, 0x34, 0x6A, 0x8B, 0x51, 0x68, /* 0x99 */ + 0x52, 0x69, 0x8E, 0x19, 0x60, /* 0x9A */ + 0x98, /* 0x9B */ + 0x7B, 0xD9, 0xCE, 0x10, 0xC3, 0xF8, 0x41, 0x9C, 0x5E, 0xF0, /* 0x9C */ + /* 0x9D */ + 0x51, 0x1E, 0x11, 0x11, 0x88, 0xF8, /* 0x9E */ + 0x29, 0x05, 0x12, 0x22, 0x87, 0x04, 0x08, 0x10, 0x20, /* 0x9F */ + /* 0xA0 */ + 0xBF, 0x80, /* 0xA1 */ + 0x23, 0xAB, 0x4A, 0x52, 0xAE, 0x20, /* 0xA2 */ + 0x39, 0x14, 0x10, 0xF0, 0x82, 0x1C, 0x4C, /* 0xA3 */ + 0xFC, 0x63, 0xF0, /* 0xA4 */ + 0x8C, 0x54, 0xAF, 0x93, 0xE4, 0x20, /* 0xA5 */ + 0xF9, 0xF0, /* 0xA6 */ + 0x32, 0x91, 0xC9, 0x47, 0x26, 0x14, 0xA4, 0xC0, /* 0xA7 */ + 0xA0, /* 0xA8 */ + 0x3E, 0x3F, 0xB8, 0xF4, 0x1A, 0x0D, 0x17, 0x76, 0xC6, 0x3E, 0x00, /* 0xA9 */ + 0x61, 0x79, 0x60, /* 0xAA */ + 0x5A, 0xA5, /* 0xAB */ + 0xFC, 0x10, 0x40, /* 0xAC */ + /* 0xAD */ + 0x3E, 0x31, 0xB7, 0x72, 0x99, 0xCC, 0xC7, 0x56, 0xC6, 0x3E, 0x00, /* 0xAE */ + 0xE0, /* 0xAF */ + 0x69, 0x96, /* 0xB0 */ + 0x21, 0x3E, 0x42, 0x03, 0xE0, /* 0xB1 */ + 0x69, 0x3C, 0xF0, /* 0xB2 */ + 0x79, 0x29, 0x70, /* 0xB3 */ + 0x80, /* 0xB4 */ + 0x8A, 0x28, 0xA2, 0x8A, 0x6E, 0xE0, 0x80, /* 0xB5 */ + 0x7F, 0xAE, 0xBA, 0x68, 0xA2, 0x8A, 0x28, 0xA0, /* 0xB6 */ + 0x80, /* 0xB7 */ + 0x67, 0x80, /* 0xB8 */ + 0x75, 0x50, /* 0xB9 */ + 0x69, 0x96, 0xF0, /* 0xBA */ + 0xA5, 0x5A, /* 0xBB */ + 0x42, 0x30, 0x84, 0x41, 0x10, 0x48, 0x82, 0x61, 0x28, 0x8F, 0x20, 0x80, /* 0xBC */ + 0x40, 0x63, 0x11, 0x09, 0x74, 0xA8, 0x84, 0x44, 0x44, 0x43, 0x80, /* 0xBD */ + 0x71, 0x24, 0x82, 0x20, 0x50, 0x98, 0x9A, 0x61, 0x28, 0x4F, 0x20, 0x80, /* 0xBE */ + 0x20, 0x08, 0x44, 0x42, 0x11, 0x70, /* 0xBF */ + 0x10, 0x08, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC0 */ + 0x08, 0x10, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC1 */ + 0x18, 0x24, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC2 */ + 0x34, 0x2C, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC3 */ + 0x24, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, /* 0xC4 */ + 0x18, 0x24, 0x18, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC5 */ + 0x1F, 0xC5, 0x02, 0x40, 0x90, 0x47, 0xDF, 0x04, 0x42, 0x10, 0x87, 0xC0, /* 0xC6 */ + 0x3E, 0x61, 0xC0, 0x80, 0x80, 0x80, 0xC1, 0x63, 0x3E, 0x0C, 0x04, 0x1C, /* 0xC7 */ + 0x20, 0x40, 0x3F, 0x82, 0x0F, 0xA0, 0x83, 0xF0, /* 0xC8 */ + 0x08, 0x40, 0x3F, 0x82, 0x0F, 0xA0, 0x83, 0xF0, /* 0xC9 */ + 0x10, 0xA0, 0x3F, 0x82, 0x0F, 0xA0, 0x83, 0xF0, /* 0xCA */ + 0x28, 0x0F, 0xE0, 0x83, 0xE8, 0x20, 0x83, 0xF0, /* 0xCB */ + 0x91, 0x55, 0x50, /* 0xCC */ + 0x62, 0xAA, 0xA0, /* 0xCD */ + 0x54, 0x24, 0x92, 0x48, /* 0xCE */ + 0xA1, 0x24, 0x92, 0x48, /* 0xCF */ + 0x7C, 0x42, 0x41, 0x41, 0xF1, 0x41, 0x41, 0x42, 0x7C, /* 0xD0 */ + 0x14, 0x53, 0x0F, 0x1B, 0x32, 0x66, 0xC7, 0x87, 0x04, /* 0xD1 */ + 0x10, 0x04, 0x0F, 0x8C, 0x6C, 0x1C, 0x06, 0x03, 0x83, 0x63, 0x1F, 0x00, /* 0xD2 */ + 0x04, 0x04, 0x0F, 0x8C, 0x6C, 0x1C, 0x06, 0x03, 0x83, 0x63, 0x1F, 0x00, /* 0xD3 */ + 0x08, 0x0A, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, /* 0xD4 */ + 0x1A, 0x0B, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, /* 0xD5 */ + 0x14, 0x00, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, /* 0xD6 */ + 0x8A, 0x88, 0xA8, 0x80, /* 0xD7 */ + 0x3E, 0xB1, 0xB0, 0xF0, 0x98, 0x8C, 0x87, 0x86, 0xC6, 0xBE, 0x00, /* 0xD8 */ + 0x20, 0x22, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xD9 */ + 0x08, 0x22, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xDA */ + 0x10, 0x52, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xDB */ + 0x29, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xDC */ + 0x09, 0x25, 0x12, 0x22, 0x87, 0x04, 0x08, 0x10, 0x20, /* 0xDD */ + 0x83, 0xE8, 0x61, 0x87, 0xE8, 0x20, 0x80, /* 0xDE */ + 0x7A, 0x18, 0x61, 0x8A, 0x18, 0x61, 0xB8, /* 0xDF */ + 0x20, 0x20, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE0 */ + 0x10, 0x40, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE1 */ + 0x10, 0x50, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE2 */ + 0x68, 0xB0, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE3 */ + 0x28, 0x01, 0xE4, 0x20, 0x47, 0xB1, 0x46, 0x76, /* 0xE4 */ + 0x10, 0x50, 0x43, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE5 */ + 0x7B, 0xA1, 0x90, 0x45, 0xFF, 0x84, 0x23, 0x17, 0x38, /* 0xE6 */ + 0x7B, 0x18, 0x20, 0x83, 0x17, 0x8C, 0x11, 0xC0, /* 0xE7 */ + 0x20, 0x40, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, /* 0xE8 */ + 0x10, 0x80, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, /* 0xE9 */ + 0x10, 0xA0, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, /* 0xEA */ + 0x28, 0x07, 0xB3, 0x87, 0xF8, 0x31, 0x78, /* 0xEB */ + 0x91, 0x55, 0x50, /* 0xEC */ + 0x62, 0xAA, 0xA0, /* 0xED */ + 0x54, 0x24, 0x92, 0x48, /* 0xEE */ + 0xA1, 0x24, 0x92, 0x40, /* 0xEF */ + 0x28, 0x42, 0x8F, 0x46, 0x18, 0x52, 0x30, /* 0xF0 */ + 0x6A, 0xC1, 0x6C, 0xC6, 0x31, 0x8C, 0x40, /* 0xF1 */ + 0x20, 0x40, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF2 */ + 0x10, 0x80, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF3 */ + 0x10, 0xA0, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF4 */ + 0x69, 0x60, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF5 */ + 0x28, 0x07, 0xB3, 0x86, 0x18, 0x73, 0x78, /* 0xF6 */ + 0x20, 0x3E, 0x02, 0x00, /* 0xF7 */ + 0x7F, 0x39, 0x69, 0xC7, 0x3F, 0x80, /* 0xF8 */ + 0x41, 0x23, 0x18, 0xC6, 0x33, 0x68, /* 0xF9 */ + 0x11, 0x23, 0x18, 0xC6, 0x33, 0x68, /* 0xFA */ + 0x22, 0x81, 0x18, 0xC6, 0x31, 0x9B, 0x40, /* 0xFB */ + 0x50, 0x23, 0x18, 0xC6, 0x33, 0x68, /* 0xFC */ + 0x10, 0x88, 0x52, 0x49, 0x23, 0x0C, 0x30, 0x82, 0x18, /* 0xFD */ + 0x84, 0x3D, 0xB8, 0xC6, 0x3B, 0xF4, 0x20, /* 0xFE */ + 0x28, 0x08, 0x52, 0x49, 0x23, 0x0C, 0x30, 0x82, 0x18, /* 0xFF */ +}; + +const GFXglyph FreeSans6pt_Win1252Glyphs[] PROGMEM = { + /* ' ' 0x20 */ {0, 0, 0, 3, 0, 0}, + /* '!' 0x21 */ {0, 1, 9, 4, 2, -8}, + /* '"' 0x22 */ {2, 3, 3, 4, 0, -8}, + /* '#' 0x23 */ {4, 7, 8, 7, 0, -7}, + /* '$' 0x24 */ {11, 6, 11, 7, 0, -9}, + /* '%' 0x25 */ {20, 10, 9, 11, 0, -8}, + /* '&' 0x26 */ {32, 6, 9, 8, 1, -8}, + /* ''' 0x27 */ {39, 1, 3, 2, 1, -8}, + /* '(' 0x28 */ {40, 2, 11, 4, 1, -8}, + /* ')' 0x29 */ {43, 3, 11, 4, 0, -8}, + /* '*' 0x2A */ {48, 3, 3, 5, 1, -8}, + /* '+' 0x2B */ {50, 5, 5, 7, 1, -4}, + /* ',' 0x2C */ {54, 1, 3, 3, 1, 0}, + /* '-' 0x2D */ {55, 2, 1, 4, 1, -3}, + /* '.' 0x2E */ {56, 1, 1, 3, 1, 0}, + /* '/' 0x2F */ {57, 3, 9, 3, 0, -8}, + /* '0' 0x30 */ {61, 5, 9, 7, 1, -8}, + /* '1' 0x31 */ {67, 3, 9, 7, 1, -8}, + /* '2' 0x32 */ {71, 6, 9, 7, 0, -8}, + /* '3' 0x33 */ {78, 6, 9, 7, 0, -8}, + /* '4' 0x34 */ {85, 6, 9, 7, 0, -8}, + /* '5' 0x35 */ {92, 5, 9, 7, 1, -8}, + /* '6' 0x36 */ {98, 5, 9, 7, 1, -8}, + /* '7' 0x37 */ {104, 5, 9, 7, 1, -8}, + /* '8' 0x38 */ {110, 6, 9, 7, 0, -8}, + /* '9' 0x39 */ {117, 6, 9, 7, 0, -8}, + /* ':' 0x3A */ {124, 1, 7, 3, 1, -6}, + /* ';' 0x3B */ {125, 1, 8, 3, 1, -5}, + /* '<' 0x3C */ {126, 5, 5, 7, 1, -4}, + /* '=' 0x3D */ {130, 5, 3, 7, 1, -3}, + /* '>' 0x3E */ {132, 5, 5, 7, 1, -4}, + /* '?' 0x3F */ {136, 5, 9, 7, 1, -8}, + /* '@' 0x40 */ {142, 11, 11, 12, 0, -8}, + /* 'A' 0x41 */ {158, 8, 9, 8, 0, -8}, + /* 'B' 0x42 */ {167, 6, 9, 8, 1, -8}, + /* 'C' 0x43 */ {174, 8, 9, 9, 0, -8}, + /* 'D' 0x44 */ {183, 7, 9, 8, 1, -8}, + /* 'E' 0x45 */ {191, 6, 9, 8, 1, -8}, + /* 'F' 0x46 */ {198, 6, 9, 7, 1, -8}, + /* 'G' 0x47 */ {205, 8, 9, 9, 0, -8}, + /* 'H' 0x48 */ {214, 7, 9, 9, 1, -8}, + /* 'I' 0x49 */ {222, 1, 9, 3, 1, -8}, + /* 'J' 0x4A */ {224, 5, 9, 6, 0, -8}, + /* 'K' 0x4B */ {230, 7, 9, 8, 1, -8}, + /* 'L' 0x4C */ {238, 5, 9, 7, 1, -8}, + /* 'M' 0x4D */ {244, 8, 9, 10, 1, -8}, + /* 'N' 0x4E */ {253, 7, 9, 9, 1, -8}, + /* 'O' 0x4F */ {261, 9, 9, 9, 0, -8}, + /* 'P' 0x50 */ {272, 6, 9, 8, 1, -8}, + /* 'Q' 0x51 */ {279, 9, 10, 9, 0, -8}, + /* 'R' 0x52 */ {291, 7, 9, 9, 1, -8}, + /* 'S' 0x53 */ {299, 6, 9, 8, 1, -8}, + /* 'T' 0x54 */ {306, 7, 9, 8, 0, -8}, + /* 'U' 0x55 */ {314, 7, 9, 9, 1, -8}, + /* 'V' 0x56 */ {322, 7, 9, 8, 0, -8}, + /* 'W' 0x57 */ {330, 11, 9, 11, 0, -8}, + /* 'X' 0x58 */ {343, 6, 9, 8, 1, -8}, + /* 'Y' 0x59 */ {350, 8, 9, 8, 0, -8}, + /* 'Z' 0x5A */ {359, 7, 9, 7, 0, -8}, + /* '[' 0x5B */ {367, 2, 12, 3, 1, -8}, + /* '\' 0x5C */ {370, 3, 9, 3, 0, -8}, + /* ']' 0x5D */ {374, 2, 12, 3, 0, -8}, + /* '^' 0x5E */ {377, 4, 4, 6, 1, -8}, + /* '_' 0x5F */ {379, 7, 1, 7, 0, 2}, + /* '`' 0x60 */ {380, 1, 1, 3, 1, -8}, + /* 'a' 0x61 */ {381, 6, 7, 7, 0, -6}, + /* 'b' 0x62 */ {387, 5, 9, 7, 1, -8}, + /* 'c' 0x63 */ {393, 6, 7, 6, 0, -6}, + /* 'd' 0x64 */ {399, 6, 9, 7, 0, -8}, + /* 'e' 0x65 */ {406, 6, 7, 6, 0, -6}, + /* 'f' 0x66 */ {412, 3, 9, 3, 0, -8}, + /* 'g' 0x67 */ {416, 6, 10, 7, 0, -6}, + /* 'h' 0x68 */ {424, 5, 9, 6, 1, -8}, + /* 'i' 0x69 */ {430, 1, 9, 3, 1, -8}, + /* 'j' 0x6A */ {432, 2, 12, 3, 0, -8}, + /* 'k' 0x6B */ {435, 5, 9, 6, 1, -8}, + /* 'l' 0x6C */ {441, 1, 9, 3, 1, -8}, + /* 'm' 0x6D */ {443, 8, 7, 10, 1, -6}, + /* 'n' 0x6E */ {450, 5, 7, 6, 1, -6}, + /* 'o' 0x6F */ {455, 6, 7, 6, 0, -6}, + /* 'p' 0x70 */ {461, 5, 9, 7, 1, -6}, + /* 'q' 0x71 */ {467, 6, 9, 7, 0, -6}, + /* 'r' 0x72 */ {474, 3, 7, 4, 1, -6}, + /* 's' 0x73 */ {477, 5, 7, 6, 0, -6}, + /* 't' 0x74 */ {482, 3, 8, 3, 0, -7}, + /* 'u' 0x75 */ {485, 5, 7, 6, 1, -6}, + /* 'v' 0x76 */ {490, 6, 7, 6, 0, -6}, + /* 'w' 0x77 */ {496, 8, 7, 9, 0, -6}, + /* 'x' 0x78 */ {503, 5, 7, 6, 0, -6}, + /* 'y' 0x79 */ {508, 5, 10, 6, 0, -6}, + /* 'z' 0x7A */ {515, 5, 7, 6, 0, -6}, + /* '{' 0x7B */ {520, 2, 12, 4, 1, -8}, + /* '|' 0x7C */ {523, 1, 11, 3, 1, -8}, + /* '}' 0x7D */ {525, 2, 12, 4, 1, -8}, + /* '~' 0x7E */ {528, 6, 2, 6, 0, -4}, + /* 0x7F */ {530, 9, 10, 11, 1, -8}, + /* 0x80 */ {542, 7, 9, 8, 0, -8}, + /* 0x81 */ {550, 0, 0, 8, 0, 0}, + /* 0x82 */ {550, 1, 3, 3, 1, 0}, + /* 0x83 */ {551, 3, 12, 3, 0, -8}, + /* 0x84 */ {556, 3, 3, 5, 1, 0}, + /* 0x85 */ {558, 5, 1, 7, 1, 0}, + /* 0x86 */ {559, 5, 11, 7, 1, -8}, + /* 0x87 */ {566, 5, 11, 7, 1, -8}, + /* 0x88 */ {573, 3, 2, 4, 0, -9}, + /* 0x89 */ {574, 12, 9, 12, 0, -8}, + /* 0x8A */ {588, 6, 11, 8, 1, -9}, + /* 0x8B */ {597, 2, 3, 4, 1, -4}, + /* 0x8C */ {598, 11, 9, 12, 0, -8}, + /* 0x8D */ {611, 0, 0, 8, 0, 0}, + /* 0x8E */ {611, 7, 10, 7, 0, -9}, + /* 0x8F */ {620, 0, 0, 8, 0, 0}, + /* 0x90 */ {620, 0, 0, 8, 0, 0}, + /* 0x91 */ {620, 1, 3, 3, 1, -8}, + /* 0x92 */ {621, 1, 3, 2, 1, -8}, + /* 0x93 */ {622, 3, 3, 5, 1, -8}, + /* 0x94 */ {624, 3, 3, 5, 1, -8}, + /* 0x95 */ {626, 3, 3, 5, 1, -5}, + /* 0x96 */ {628, 6, 1, 6, 0, -3}, + /* 0x97 */ {629, 12, 1, 12, 0, -3}, + /* 0x98 */ {631, 4, 2, 4, 0, -8}, + /* 0x99 */ {632, 11, 7, 12, 1, -8}, + /* 0x9A */ {642, 4, 9, 6, 1, -8}, + /* 0x9B */ {647, 2, 3, 3, 1, -4}, + /* 0x9C */ {648, 11, 7, 11, 0, -6}, + /* 0x9D */ {658, 0, 0, 8, 0, 0}, + /* 0x9E */ {658, 5, 9, 6, 0, -8}, + /* 0x9F */ {664, 7, 10, 8, 1, -9}, + /* 0xA0 */ {673, 0, 0, 3, 0, 0}, + /* 0xA1 */ {673, 1, 9, 4, 1, -5}, + /* 0xA2 */ {675, 5, 9, 7, 1, -7}, + /* 0xA3 */ {681, 6, 9, 7, 0, -8}, + /* 0xA4 */ {688, 5, 4, 7, 1, -5}, + /* 0xA5 */ {691, 5, 9, 7, 1, -8}, + /* 0xA6 */ {697, 1, 12, 3, 1, -8}, + /* 0xA7 */ {699, 5, 12, 7, 1, -8}, + /* 0xA8 */ {707, 3, 1, 4, 0, -7}, + /* 0xA9 */ {708, 9, 9, 10, 0, -8}, + /* 0xAA */ {719, 4, 5, 4, 0, -8}, + /* 0xAB */ {722, 4, 4, 6, 1, -4}, + /* 0xAC */ {724, 6, 3, 7, 1, -4}, + /* 0xAD */ {727, 0, 0, 0, 0, 0}, + /* 0xAE */ {727, 9, 9, 10, 0, -8}, + /* 0xAF */ {738, 3, 1, 4, 0, -8}, + /* 0xB0 */ {739, 4, 4, 7, 2, -8}, + /* 0xB1 */ {741, 5, 7, 7, 1, -6}, + /* 0xB2 */ {746, 4, 5, 4, 0, -9}, + /* 0xB3 */ {749, 4, 5, 4, 0, -9}, + /* 0xB4 */ {752, 1, 1, 4, 1, -8}, + /* 0xB5 */ {753, 6, 9, 7, 1, -6}, + /* 0xB6 */ {760, 6, 10, 6, 1, -8}, + /* 0xB7 */ {768, 1, 1, 3, 1, -2}, + /* 0xB8 */ {769, 3, 3, 4, 1, 1}, + /* 0xB9 */ {771, 2, 6, 4, 1, -9}, + /* 0xBA */ {773, 4, 5, 4, 0, -8}, + /* 0xBB */ {776, 4, 4, 6, 1, -5}, + /* 0xBC */ {778, 10, 9, 10, 1, -8}, + /* 0xBD */ {790, 9, 9, 10, 1, -8}, + /* 0xBE */ {801, 10, 9, 11, 0, -8}, + /* 0xBF */ {813, 5, 9, 7, 1, -5}, + /* 0xC0 */ {819, 8, 10, 8, 0, -9}, + /* 0xC1 */ {829, 8, 10, 8, 0, -9}, + /* 0xC2 */ {839, 8, 10, 8, 0, -9}, + /* 0xC3 */ {849, 8, 10, 8, 0, -9}, + /* 0xC4 */ {859, 8, 10, 8, 0, -9}, + /* 0xC5 */ {869, 8, 10, 8, 0, -9}, + /* 0xC6 */ {879, 10, 9, 12, 1, -8}, + /* 0xC7 */ {891, 8, 12, 9, 0, -8}, + /* 0xC8 */ {903, 6, 10, 8, 1, -9}, + /* 0xC9 */ {911, 6, 10, 8, 1, -9}, + /* 0xCA */ {919, 6, 10, 8, 1, -9}, + /* 0xCB */ {927, 6, 10, 8, 1, -9}, + /* 0xCC */ {935, 2, 10, 3, 0, -9}, + /* 0xCD */ {938, 2, 10, 3, 1, -9}, + /* 0xCE */ {941, 3, 10, 4, 0, -9}, + /* 0xCF */ {945, 3, 10, 4, 0, -9}, + /* 0xD0 */ {949, 8, 9, 8, 0, -8}, + /* 0xD1 */ {958, 7, 10, 9, 1, -9}, + /* 0xD2 */ {967, 9, 10, 9, 0, -9}, + /* 0xD3 */ {979, 9, 10, 9, 0, -9}, + /* 0xD4 */ {991, 9, 11, 9, 0, -10}, + /* 0xD5 */ {1004, 9, 11, 9, 0, -10}, + /* 0xD6 */ {1017, 9, 11, 9, 0, -10}, + /* 0xD7 */ {1030, 5, 5, 7, 1, -5}, + /* 0xD8 */ {1034, 9, 9, 9, 0, -8}, + /* 0xD9 */ {1045, 7, 10, 9, 1, -9}, + /* 0xDA */ {1054, 7, 10, 9, 1, -9}, + /* 0xDB */ {1063, 7, 10, 9, 1, -9}, + /* 0xDC */ {1072, 7, 10, 9, 1, -9}, + /* 0xDD */ {1081, 7, 10, 8, 1, -9}, + /* 0xDE */ {1090, 6, 9, 8, 1, -8}, + /* 0xDF */ {1097, 6, 9, 7, 1, -8}, + /* 0xE0 */ {1104, 7, 10, 7, 0, -9}, + /* 0xE1 */ {1113, 7, 10, 7, 0, -9}, + /* 0xE2 */ {1122, 7, 10, 7, 0, -9}, + /* 0xE3 */ {1131, 7, 10, 7, 0, -9}, + /* 0xE4 */ {1140, 7, 9, 7, 0, -8}, + /* 0xE5 */ {1148, 7, 10, 7, 0, -9}, + /* 0xE6 */ {1157, 10, 7, 10, 0, -6}, + /* 0xE7 */ {1166, 6, 10, 6, 0, -6}, + /* 0xE8 */ {1174, 6, 10, 6, 0, -9}, + /* 0xE9 */ {1182, 6, 10, 6, 0, -9}, + /* 0xEA */ {1190, 6, 10, 6, 0, -9}, + /* 0xEB */ {1198, 6, 9, 6, 0, -8}, + /* 0xEC */ {1205, 2, 10, 3, 0, -9}, + /* 0xED */ {1208, 2, 10, 3, 1, -9}, + /* 0xEE */ {1211, 3, 10, 3, 0, -9}, + /* 0xEF */ {1215, 3, 9, 3, 0, -8}, + /* 0xF0 */ {1219, 6, 9, 6, 0, -8}, + /* 0xF1 */ {1226, 5, 10, 6, 1, -9}, + /* 0xF2 */ {1233, 6, 10, 6, 0, -9}, + /* 0xF3 */ {1241, 6, 10, 6, 0, -9}, + /* 0xF4 */ {1249, 6, 10, 6, 0, -9}, + /* 0xF5 */ {1257, 6, 10, 6, 0, -9}, + /* 0xF6 */ {1265, 6, 9, 6, 0, -8}, + /* 0xF7 */ {1272, 5, 5, 7, 1, -5}, + /* 0xF8 */ {1276, 6, 7, 6, 0, -6}, + /* 0xF9 */ {1282, 5, 9, 6, 1, -8}, + /* 0xFA */ {1288, 5, 9, 6, 1, -8}, + /* 0xFB */ {1294, 5, 10, 6, 1, -9}, + /* 0xFC */ {1301, 5, 9, 6, 1, -8}, + /* 0xFD */ {1307, 6, 12, 6, 0, -8}, + /* 0xFE */ {1316, 5, 11, 7, 1, -8}, + /* 0xFF */ {1323, 6, 12, 6, 0, -8}, +}; + +const GFXfont FreeSans6pt_Win1252 PROGMEM = {(uint8_t *)FreeSans6pt_Win1252Bitmaps, (GFXglyph *)FreeSans6pt_Win1252Glyphs, 0x20, + 0xFF, 14}; diff --git a/src/graphics/niche/Fonts/FreeSans9pt_Win1250.h b/src/graphics/niche/Fonts/FreeSans9pt_Win1250.h new file mode 100644 index 000000000..7022939a0 --- /dev/null +++ b/src/graphics/niche/Fonts/FreeSans9pt_Win1250.h @@ -0,0 +1,494 @@ +#pragma once +const uint8_t FreeSans9pt_Win1250Bitmaps[] PROGMEM = { + /* ' ' 0x20 */ + 0xFF, 0xFF, 0xF0, 0xC0, /* '!' 0x21 */ + 0xDE, 0xF7, 0x20, /* '"' 0x22 */ + 0x09, 0x86, 0x41, 0x91, 0xFF, 0x13, 0x04, 0xC3, 0x20, 0xC8, 0xFF, 0x89, 0x82, 0x61, 0x90, /* '#' 0x23 */ + 0x10, 0x1F, 0x14, 0xDA, 0x3D, 0x1E, 0x83, 0x40, 0x78, 0x17, 0x08, 0xF4, 0x7A, 0x35, 0x33, 0xF0, 0x40, 0x20, /* '$' 0x24 */ + 0x38, 0x10, 0xEC, 0x20, 0xC6, 0x20, 0xC6, 0x40, 0xC6, 0x40, 0x6C, 0x80, 0x39, 0x00, 0x01, 0x3C, 0x02, 0x77, 0x02, 0x63, 0x04, + 0x63, 0x04, 0x77, 0x08, 0x3C, /* '%' 0x25 */ + 0x0E, 0x0C, 0xC3, 0x30, 0xCC, 0x1E, 0x03, 0x03, 0xC1, 0x9B, 0xC2, 0xF0, 0xEC, 0x19, 0x8F, 0x3C, 0x40, /* '&' 0x26 */ + 0xFE, /* ''' 0x27 */ + 0x13, 0x26, 0x6C, 0xCC, 0xCC, 0xC4, 0x66, 0x23, 0x10, /* '(' 0x28 */ + 0x8C, 0x46, 0x63, 0x33, 0x33, 0x32, 0x66, 0x4C, 0x80, /* ')' 0x29 */ + 0x25, 0x7E, 0xA5, 0x00, /* '*' 0x2A */ + 0x30, 0xC3, 0x3F, 0x30, 0xC3, 0x0C, /* '+' 0x2B */ + 0xD6, /* ',' 0x2C */ + 0xF0, /* '-' 0x2D */ + 0xC0, /* '.' 0x2E */ + 0x08, 0x44, 0x21, 0x10, 0x84, 0x42, 0x11, 0x08, 0x00, /* '/' 0x2F */ + 0x3C, 0x66, 0x42, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x42, 0x66, 0x3C, /* '0' 0x30 */ + 0x11, 0x3F, 0x33, 0x33, 0x33, 0x33, 0x30, /* '1' 0x31 */ + 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x1C, 0x1C, 0x1C, 0x18, 0x18, 0x10, 0x08, 0x07, 0xF8, /* '2' 0x32 */ + 0x3C, 0x66, 0xC3, 0xC3, 0x03, 0x06, 0x1C, 0x07, 0x03, 0xC3, 0xC3, 0x66, 0x3C, /* '3' 0x33 */ + 0x0C, 0x18, 0x71, 0x62, 0xC9, 0xA3, 0x46, 0xFE, 0x18, 0x30, 0x60, 0xC0, /* '4' 0x34 */ + 0x7F, 0x20, 0x10, 0x08, 0x08, 0x07, 0xF3, 0x8C, 0x03, 0x01, 0x80, 0xF0, 0x6C, 0x63, 0xE0, /* '5' 0x35 */ + 0x1E, 0x31, 0x98, 0x78, 0x0C, 0x06, 0xF3, 0x8D, 0x83, 0xC1, 0xE0, 0xD0, 0x6C, 0x63, 0xE0, /* '6' 0x36 */ + 0xFF, 0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x18, 0x18, 0x18, 0x10, 0x30, 0x30, /* '7' 0x37 */ + 0x3E, 0x31, 0xB0, 0x78, 0x3C, 0x1B, 0x18, 0xF8, 0xC6, 0xC1, 0xE0, 0xF0, 0x6C, 0x63, 0xE0, /* '8' 0x38 */ + 0x3C, 0x66, 0xC2, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0xC2, 0x66, 0x3C, /* '9' 0x39 */ + 0xC0, 0x00, 0x30, /* ':' 0x3A */ + 0xC0, 0x00, 0x00, 0x64, 0xA0, /* ';' 0x3B */ + 0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x07, 0x80, 0x70, 0x0E, 0x01, 0x80, /* '<' 0x3C */ + 0xFF, 0x80, 0x00, 0x1F, 0xF0, /* '=' 0x3D */ + 0xE0, 0x1C, 0x03, 0x80, 0x30, 0x70, 0xE3, 0x81, 0x00, /* '>' 0x3E */ + 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x18, 0x38, 0x18, 0x18, 0x0C, 0x00, 0x00, 0x01, 0x80, /* '?' 0x3F */ + 0x03, 0xF0, 0x06, 0x0E, 0x06, 0x01, 0x86, 0x00, 0x66, 0x1D, 0xBB, 0x31, 0xCF, 0x18, 0xC7, 0x98, 0x63, 0xCC, 0x31, 0xE6, 0x11, + 0xB3, 0x99, 0xCC, 0xF7, 0x86, 0x00, 0x01, 0x80, 0x00, 0x70, 0x40, 0x0F, 0xE0, /* '@' 0x40 */ + 0x06, 0x00, 0xF0, 0x0F, 0x00, 0x90, 0x19, 0x81, 0x98, 0x10, 0x83, 0x0C, 0x3F, 0xC2, 0x04, 0x60, 0x66, 0x06, 0xC0, + 0x30, /* 'A' 0x41 */ + 0xFF, 0x18, 0x33, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x3F, 0xC6, 0x06, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, /* 'B' 0x42 */ + 0x1F, 0x86, 0x19, 0x81, 0xA0, 0x3C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0x61, 0xF0, /* 'C' 0x43 */ + 0xFF, 0x18, 0x33, 0x03, 0x60,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1E, 0x33, 0xC3, 0x78, 0x6F, 0x07, 0xE0, 0x7C, 0x0E, /* 'N' 0x4E */ + 0x0F, 0x81, 0x83, 0x18, 0x0C, 0xC0, 0x6C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1B, 0x01, 0x98, 0x0C, 0x60, 0xC0, 0xF8, + 0x00, /* 'O' 0x4F */ + 0xFF, 0x30, 0x6C, 0x0F, 0x03, 0xC0, 0xF0, 0x6F, 0xF3, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x00, /* 'P' 0x50 */ + 0x0F, 0x81, 0x83, 0x18, 0x0C, 0xC0, 0x6C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1B, 0x01, 0x98, 0x6C, 0x60, 0xC0, 0xFB, + 0x00, 0x08, /* 'Q' 0x51 */ + 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x0C, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x06, 0xC0, + 0x70, /* 'R' 0x52 */ + 0x3F, 0x18, 0x6C, 0x0F, 0x03, 0xC0, 0x1E, 0x01, 0xF0, 0x0E, 0x00, 0xF0, 0x3C, 0x0D, 0x86, 0x3F, 0x00, /* 'S' 0x53 */ + 0xFF, 0x86, 0x03, 0x01, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, /* 'T' 0x54 */ + 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xB0, 0x61, 0xF0, /* 'U' 0x55 */ + 0xC0, 0x6C, 0x0D, 0x81, 0x10, 0x63, 0x0C, 0x61, 0x04, 0x60, 0xCC, 0x19, 0x01, 0x60, 0x3C, 0x07, 0x00, 0x60, /* 'V' 0x56 */ + 0xC1, 0x81, 0x61, 0xC3, 0x61, 0xC3, 0x61, 0x43, 0x62, 0x62, 0x22, 0x66, 0x32, 0x26, 0x36, 0x26, 0x14, 0x34, 0x14, 0x34, 0x1C, + 0x1C, 0x18, 0x1C, 0x08, 0x18, /* 'W' 0x57 */ + 0xC0, 0xD8, 0x66, 0x18, 0xCC, 0x1E, 0x07, 0x00, 0xC0, 0x78, 0x32, 0x0C, 0xC6, 0x1B, 0x07, 0xC0, 0xC0, /* 'X' 0x58 */ + 0xC0, 0x36, 0x06, 0x30, 0xC3, 0x0C, 0x19, 0x81, 0xD8, 0x0F, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, + 0x00, /* 'Y' 0x59 */ + 0xFF, 0xC0, 0x60, 0x30, 0x0C, 0x06, 0x03, 0x01, 0xC0, 0x60, 0x30, 0x18, 0x06, 0x03, 0x00, 0xFF, 0xC0, /* 'Z' 0x5A */ + 0xFB, 0x6D, 0xB6, 0xDB, 0x6D, 0xB6, 0xE0, /* '[' 0x5B */ + 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x80, /* '\' 0x5C */ + 0xED, 0xB6, 0xDB, 0x6D, 0xB6, 0xDB, 0xE0, /* ']' 0x5D */ + 0x30, 0x60, 0xA2, 0x44, 0xD8, 0xA1, 0x80, /* '^' 0x5E */ + 0xFF, 0xC0, /* '_' 0x5F */ + 0xC6, 0x30, /* '`' 0x60 */ + 0x7E, 0x71, 0xB0, 0xC0, 0x60, 0xF3, 0xDB, 0x0D, 0x86, 0xC7, 0x3D, 0xC0, /* 'a' 0x61 */ + 0xC0, 0x60, 0x30, 0x1B, 0xCE, 0x36, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x6D, 0xE0, /* 'b' 0x62 */ + 0x3C, 0x66, 0xC3, 0xC0, 0xC0, 0xC0, 0xC0, 0xC3, 0x66, 0x3C, /* 'c' 0x63 */ + 0x03, 0x03, 0x03, 0x3B, 0x67, 0xC3, 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0x71 */ + 0xDF, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0x00, /* 'r' 0x72 */ + 0x3E, 0xE3, 0xC0, 0xC0, 0xE0, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, /* 's' 0x73 */ + 0x66, 0xF6, 0x66, 0x66, 0x66, 0x67, /* 't' 0x74 */ + 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 'u' 0x75 */ + 0xC1, 0xA0, 0x98, 0xCC, 0x42, 0x21, 0xB0, 0xD0, 0x28, 0x1C, 0x0C, 0x00, /* 'v' 0x76 */ + 0xC6, 0x1E, 0x38, 0x91, 0xC4, 0xCA, 0x66, 0xD3, 0x16, 0xD0, 0xA6, 0x87, 0x1C, 0x38, 0xC0, 0xC6, 0x00, /* 'w' 0x77 */ + 0x87, 0x89, 0xB1, 0xC3, 0x07, 0x1E, 0x26, 0xC5, 0x0C, /* 'x' 0x78 */ + 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, /* 'y' 0x79 */ + 0xFE, 0x0C, 0x30, 0xC1, 0x86, 0x18, 0x20, 0xC1, 0xFC, /* 'z' 0x7A */ + 0x36, 0x66, 0x66, 0x6E, 0xCE, 0x66, 0x66, 0x66, 0x30, /* '{' 0x7B */ + 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, /* '|' 0x7C */ + 0xC6, 0x66, 0x66, 0x67, 0x37, 0x66, 0x66, 0x66, 0xC0, /* '}' 0x7D */ + 0x61, 0x24, 0x38, /* '~' 0x7E */ + 0xFF, 0xFC, 0x00, 0x63, 0xE3, 0x31, 0x99, 0x04, 0xC8, 0x66, 0x06, 0x30, 0x61, 0x83, 0x0C, 0x18, 0x60, 0x03, 0x06, 0x18, 0x00, + 0xFF, 0xFC, /* 0x7F */ + 0x07, 0xC6, 0x13, 0x00, 0xC0, 0x60, 0x3F, 0xE6, 0x03, 0xFC, 0x60, 0x0C, 0x03, 0x00, 0x61, 0x07, 0xC0, /* 0x80 */ + /* 0x81 */ + 0xDC, /* 0x82 */ + /* 0x83 */ + 0xDA, 0x76, /* 0x84 */ + 0xCC, 0xC0, /* 0x85 */ + 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 0x86 */ + 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, /* 0x87 */ + /* 0x88 */ + 0x70, 0x80, 0x22, 0x20, 0x08, 0x90, 0x02, 0x24, 0x00, 0x72, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x10, 0x00, 0x09, 0xC7, 0x84, + 0x8B, 0x31, 0x22, 0x84, 0x88, 0xB3, 0x21, 0xC7, 0x80, /* 0x89 */ + 0x1B, 0x03, 0x83, 0xF1, 0x86, 0xC0, 0xF0, 0x3C, 0x01, 0xE0, 0x1F, 0x00, 0xE0, 0x0F, 0x03, 0xC0, 0xD8, 0x63, 0xF0, /* 0x8A */ + 0x69, /* 0x8B */ + 0x06, 0x03, 0x03, 0xF1, 0x86, 0xC0, 0xF0, 0x3C, 0x01, 0xE0, 0x1F, 0x00, 0xE0, 0x0F, 0x03, 0xC0, 0xD8, 0x63, 0xF0, /* 0x8C */ + 0x33, 0x0F, 0x3F, 0xE1, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, 0x60, 0x30, /* 0x8D */ + 0x1B, 0x03, 0x8F, 0xFC, 0x06, 0x03, 0x00, 0xC0, 0x60, 0x30, 0x1C, 0x06, 0x03, 0x01, 0x80, 0x60, 0x30, 0x0F, 0xFC, /* 0x8E */ + 0x0C, 0x06, 0x0F, 0xFC, 0x06, 0x03, 0x00, 0xC0, 0x60, 0x30, 0x1C, 0x06, 0x03, 0x01, 0x80, 0x60, 0x30, 0x0F, 0xFC, /* 0x8F */ + /* 0x90 */ + 0x6B, /* 0x91 */ + 0xD6, /* 0x92 */ + 0x4C, 0xA5, 0xB0, /* 0x93 */ + 0xDA, 0x53, 0x20, /* 0x94 */ + 0x6F, 0xFF, 0x60, /* 0x95 */ + 0xFE, /* 0x96 */ + 0xFF, 0xFF, /* 0x97 */ + /* 0x98 */ + 0xFC, 0xE1, 0xCC, 0x38, 0x73, 0x0E, 0x1C, 0xC3, 0x8F, 0x30, 0xD2, 0xCC, 0x34, 0xB3, 0x0D, 0x6C, 0xC3, 0x53, 0x30, 0xCC, 0xCC, + 0x33, 0x30, /* 0x99 */ + 0x24, 0x3C, 0x18, 0x7E, 0xE3, 0xC0, 0xC0, 0x60, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, /* 0x9A */ + 0x96, /* 0x9B */ + 0x0C, 0x18, 0x10, 0x3E, 0xE3, 0xC0, 0xC0, 0xE0, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, /* 0x9C */ + 0x0D, 0xA7, 0x3C, 0x61, 0x86, 0x18, 0x61, 0x86, 0x18, 0x70, /* 0x9D */ + 0x48, 0xF0, 0xC7, 0xF0, 0x61, 0x86, 0x0C, 0x30, 0xC1, 0x06, 0x0F, 0xE0, /* 0x9E */ + 0x0C, 0x10, 0x47, 0xF0, 0x61, 0x86, 0x0C, 0x30, 0xC1, 0x06, 0x0F, 0xE0, /* 0x9F */ + /* 0xA0 */ + 0x8A, 0x9C, /* 0xA1 */ + 0x85, 0xE0, /* 0xA2 */ + 0x60, 0x30, 0x18, 0x0C, 0x86, 0xC3, 0xC1, 0xC1, 0xC0, 0xE0, 0x30, 0x18, 0x0C, 0x07, 0xF8, /* 0xA3 */ + 0xFF, 0xDF, 0x1E, 0x3E, 0xFF, 0xC0, /* 0xA4 */ + 0x06, 0x00, 0xF0, 0x0F, 0x01, 0x30, 0x13, 0x81, 0x38, 0x21, 0x82, 0x1C, 0x3F, 0xC6, 0x04, 0x60, 0x66, 0x06, 0xC0, 0x30, 0x06, + 0x00, 0xC0, 0x0C, 0x00, 0x70, /* 0xA5 */ + 0xFF, 0xFC, 0x0F, 0xFF, 0xC0, /* 0xA6 */ + 0x0C, 0x09, 0x0C, 0xC6, 0x63, 0x81, 0xE3, 0x19, 0x87, 0xE1, 0xB8, 0xC6, 0x41, 0xC0, 0x73, 0x19, 0x8C, 0x66, 0x1E, + 0x00, /* 0xA7 */ + 0xCC, /* 0xA8 */ + 0x0F, 0xC0, 0x61, 0x87, 0x03, 0x9B, 0xC6, 0xD9, 0x8F, 0x60, 0x3D, 0x00, 0xF4, 0x03, 0xD8, 0x0D, 0xE6, 0x67, 0xF3, 0x86, 0x18, + 0x0F, 0xC0, /* 0xA9 */ + 0x3F, 0x18, 0x6C, 0x0F, 0x03, 0xC0, 0x1E, 0x01, 0xF0, 0x0E, 0x00, 0xF0, 0x3C, 0x0D, 0x86, 0x3F, 0x02, 0x00, 0xE0, 0x18, 0x1C, + 0x00, /* 0xAA */ + 0x22, 0xCF, 0x26, 0x46, 0x64, 0x40, /* 0xAB */ + 0xFF, 0x80, 0xC0, 0x60, 0x30, 0x18, /* 0xAC */ + /* 0xAD */ + 0x0F, 0xC0, 0x61, 0x87, 0x03, 0x9F, 0xE6, 0xD0, 0x8F, 0x42, 0x3D, 0xF0, 0xF4, 0x23, 0xD0, 0x8D, 0xC2, 0x67, 0x0B, 0x86, 0x18, + 0x0F, 0xC0, /* 0xAE */ + 0x0C, 0x00, 0x0F, 0xFC, 0x06, 0x03, 0x00, 0xC0, 0x60, 0x30, 0x1C, 0x06, 0x03, 0x01, 0x80, 0x60, 0x30, 0x0F, 0xFC, /* 0xAF */ + 0x74, 0x63, 0x17, 0x00, /* 0xB0 */ + 0x0C, 0x06, 0x03, 0x07, 0xE0, 0xC0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x3F, 0xE0, /* 0xB1 */ + 0x6C, 0xC7, /* 0xB2 */ + 0x66, 0x66, 0x67, 0x6E, 0x66, 0x66, 0x60, /* 0xB3 */ + 0x36, 0xC0, /* 0xB4 */ + 0xC3, 0x61, 0xB0, 0xD8, 0x6C, 0x36, 0x1B, 0x0D, 0x86, 0xE7, 0x7D, 0xF0, 0x18, 0x0C, 0x00, /* 0xB5 */ + 0x3F, 0x7E, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0x72, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, /* 0xB6 */ + 0xE0, /* 0xB7 */ + 0x21, 0xC7, 0xE0, /* 0xB8 */ + 0x7E, 0x38, 0xCC, 0x30, 0x0C, 0x0F, 0x1E, 0xCC, 0x33, 0x0C, 0xC7, 0x1E, 0xE0, 0x10, 0x0C, 0x03, 0x00, 0x70, /* 0xB9 */ + 0x3E, 0xE3, 0xC0, 0xC0, 0xE0, 0x3C, 0x07, 0xC3, 0xC3, 0x7E, 0x10, 0x1C, 0x0C, 0x38, /* 0xBA */ + 0x89, 0x98, 0x99, 0x3C, 0xD1, 0x00, /* 0xBB */ + 0xC6, 0xC4, 0xC8, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, /* 0xBC */ + 0x6F, 0x69, 0x00, /* 0xBD */ + 0xDE, 0xB9, 0x8C, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x00, /* 0xBE */ + 0x30, 0x03, 0xF8, 0x30, 0xC3, 0x06, 0x18, 0x60, 0x83, 0x07, 0xF0, /* 0xBF */ + 0x06, 0x00, 0xC0, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x0C, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x06, + 0xC0, 0x70, /* 0xC0 */ + 0x06, 0x03, 0x00, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC1 */ + 0x0C, 0x04, 0x80, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC2 */ + 0x21, 0x07, 0x80, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC3 */ + 0x33, 0x00, 0x00, 0xC0, 0x78, 0x1E, 0x04, 0x83, 0x30, 0xCC, 0x33, 0x1F, 0xE6, 0x19, 0x02, 0xC0, 0xF0, 0x30, /* 0xC4 */ + 0x30, 0x60, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, /* 0xC5 */ + 0x06, 0x01, 0x80, 0x00, 0x0F, 0xC3, 0x0C, 0xC0, 0xD0, 0x1E, 0x00, 0xC0, 0x18, 0x03, 0x01, 0xA0, 0x36, 0x0C, 0x61, 0x87, + 0xC0, /* 0xC6 */ + 0x1F, 0x06, 0x19, 0x83, 0xA0, 0x3C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0xE1, 0xF0, 0x08, 0x01, 0xC0, + 0x18, 0x0E, 0x00, /* 0xC7 */ + 0x19, 0x81, 0xE0, 0x00, 0x0F, 0xC3, 0x0C, 0xC0, 0xF0, 0x1E, 0x00, 0xC0, 0x18, 0x03, 0x01, 0xA0, 0x36, 0x0C, 0x61, 0x87, + 0xC0, /* 0xC8 */ + 0x0C, 0x0C, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, /* 0xC9 */ + 0xFF, 0xD8, 0x03, 0x00, 0x60, 0x0C, 0x01, 0x80, 0x3F, 0xF6, 0x00, 0xC0, 0x18, 0x03, 0x00, 0x60, 0x0F, 0xFC, 0x01, 0x80, 0x60, + 0x0C, 0x00, 0xE0, /* 0xCA */ + 0x33, 0x00, 0x3F, 0xF8, 0x0C, 0x06, 0x03, 0x01, 0xFE, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, /* 0xCB */ + 0x33, 0x0F, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0xFE, /* 0xCC */ + 0x78, 0x36, 0xDB, 0x6D, 0xB6, 0xC0, /* 0xCD */ + 0x76, 0xC0, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18, /* 0xCE */ + 0x66, 0x0F, 0x00, 0x03, 0xF8, 0xC3, 0x30, 0x6C, 0x0F, 0x03, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC1, 0xB0, 0xEF, 0xE0, /* 0xCF */ + 0x7F, 0x0C, 0x31, 0x83, 0x30, 0x36, 0x06, 0xC0, 0xFE, 0x1B, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x30, 0xE7, 0xF0, /* 0xD0 */ + 0x03, 0x01, 0x83, 0x81, 0xF0, 0x3F, 0x07, 0xA0, 0xF6, 0x1E, 0x63, 0xC4, 0x78, 0xCF, 0x0D, 0xE1, 0xBC, 0x1F, 0x81, + 0xC0, /* 0xD1 */ + 0x19, 0x81, 0xE3, 0x81, 0xF0, 0x3F, 0x07, 0xA0, 0xF6, 0x1E, 0x63, 0xC4, 0x78, 0xCF, 0x0D, 0xE1, 0xBC, 0x1F, 0x81, + 0xC0, /* 0xD2 */ + 0x03, 0x00, 0x60, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, + 0x0F, 0x00, /* 0xD3 */ + 0x0F, 0x01, 0x98, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, + 0x0F, 0x00, /* 0xD4 */ + 0x0D, 0x81, 0xB0, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, + 0x0F, 0x00, /* 0xD5 */ + 0x19, 0x81, 0x98, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, + 0x0F, 0x00, /* 0xD6 */ + 0x83, 0x89, 0xA1, 0x83, 0x89, 0xA1, 0x80, /* 0xD7 */ + 0x33, 0x01, 0xE0, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x0C, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x06, + 0xC0, 0x70, /* 0xD8 */ + 0x04, 0x01, 0x43, 0x11, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, + 0x00, /* 0xD9 */ + 0x06, 0x01, 0x83, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, + 0x00, /* 0xDA */ + 0x0D, 0x83, 0x63, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, + 0x00, /* 0xDB */ + 0x1B, 0x00, 0x03, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, + 0x00, /* 0xDC */ + 0x03, 0x0C, 0x63, 0x60, 0x63, 0x0C, 0x30, 0xC1, 0x98, 0x1D, 0x80, 0xF0, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, + 0x60, /* 0xDD */ + 0xFF, 0x86, 0x03, 0x01, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, 0x40, 0x3C, 0x06, 0x1E, + 0x00, /* 0xDE */ + 0x3C, 0x33, 0x30, 0xD8, 0x6C, 0x36, 0x33, 0x39, 0x86, 0xC1, 0xE0, 0xF0, 0x78, 0x6D, 0xE0, /* 0xDF */ + 0x19, 0x89, 0xBE, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x00, /* 0xE0 */ + 0x0C, 0x04, 0x04, 0x0F, 0xCE, 0x36, 0x18, 0x0C, 0x1E, 0x7B, 0x61, 0xB0, 0xD8, 0xE7, 0xB8, /* 0xE1 */ + 0x10, 0x14, 0x1B, 0x0F, 0xCE, 0x36, 0x18, 0x0C, 0x1E, 0x7B, 0x61, 0xB0, 0xD8, 0xE7, 0xB8, /* 0xE2 */ + 0x66, 0x1E, 0x00, 0x0F, 0xCE, 0x36, 0x18, 0x0C, 0x1E, 0x7B, 0x61, 0xB0, 0xD8, 0xE7, 0xB8, /* 0xE3 */ + 0x66, 0x00, 0x1F, 0x9C, 0x6C, 0x30, 0x18, 0x3C, 0xF6, 0xC3, 0x61, 0xB1, 0xCF, 0x70, /* 0xE4 */ + 0x78, 0x36, 0xDB, 0x6D, 0xB6, 0xD8, /* 0xE5 */ + 0x0C, 0x08, 0x10, 0x3C, 0x66, 0xC3, 0xC0, 0xC0, 0xC0, 0xC0, 0xC3, 0x66, 0x3C, /* 0xE6 */ + 0x3C, 0x66, 0xC3, 0xC0, 0xC0, 0xC0, 0xC0, 0xC3, 0x66, 0x3C, 0x10, 0x1C, 0x0C, 0x38, /* 0xE7 */ + 0x44, 0x28, 0x38, 0x3C, 0x66, 0xC3, 0xC0, 0xC0, 0xC0, 0xC0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0x3C, 0x66, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x66, 0x3C, /* 0xF5 */ + 0x66, 0x00, 0x3C, 0x66, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x66, 0x3C, /* 0xF6 */ + 0x18, 0x00, 0x00, 0x1F, 0xF0, 0x00, 0x00, 0x00, 0x30, /* 0xF7 */ + 0xDB, 0x81, 0xBE, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x00, /* 0xF8 */ + 0x10, 0x28, 0x10, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 0xF9 */ + 0x06, 0x0C, 0x18, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 0xFA */ + 0x36, 0x6C, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 0xFB */ + 0x66, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 0xFC */ + 0x06, 0x04, 0x08, 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, /* 0xFD */ + 0x63, 0x3C, 0xC6, 0x31, 0x8C, 0x63, 0x18, 0xE2, 0x1C, 0x6F, /* 0xFE */ + 0xC0, /* 0xFF */ +}; + +const GFXglyph FreeSans9pt_Win1250Glyphs[] PROGMEM = { + /* ' ' 0x20 */ {0, 0, 0, 5, 0, 0}, + /* '!' 0x21 */ {0, 2, 13, 6, 2, -12}, + /* '"' 0x22 */ {4, 5, 4, 6, 1, -12}, + /* '#' 0x23 */ {7, 10, 12, 10, 0, -11}, + /* '$' 0x24 */ {22, 9, 16, 10, 1, -13}, + /* '%' 0x25 */ {40, 16, 13, 16, 1, -12}, + /* '&' 0x26 */ {66, 10, 13, 12, 1, -12}, + /* ''' 0x27 */ {83, 2, 4, 4, 1, -12}, + /* '(' 0x28 */ {84, 4, 17, 6, 1, -12}, + /* ')' 0x29 */ {93, 4, 17, 6, 1, -12}, + /* '*' 0x2A */ {102, 5, 5, 7, 1, -12}, + /* '+' 0x2B */ {106, 6, 8, 11, 3, -7}, + /* ',' 0x2C */ {112, 2, 4, 5, 2, 0}, + /* '-' 0x2D */ {113, 4, 1, 6, 1, -4}, + /* '.' 0x2E */ {114, 2, 1, 5, 1, 0}, + /* '/' 0x2F */ {115, 5, 13, 5, 0, -12}, + /* '0' 0x30 */ {124, 8, 13, 10, 1, -12}, + /* '1' 0x31 */ {137, 4, 13, 10, 3, -12}, + /* '2' 0x32 */ {144, 9, 13, 10, 1, -12}, + /* '3' 0x33 */ {159, 8, 13, 10, 1, -12}, + /* '4' 0x34 */ {172, 7, 13, 10, 2, -12}, + /* '5' 0x35 */ {184, 9, 13, 10, 1, -12}, + /* '6' 0x36 */ {199, 9, 13, 10, 1, -12}, + /* '7' 0x37 */ {214, 8, 13, 10, 0, -12}, + /* '8' 0x38 */ {227, 9, 13, 10, 1, -12}, + /* '9' 0x39 */ {242, 8, 13, 10, 1, -12}, + /* ':' 0x3A */ {255, 2, 10, 5, 1, -9}, + /* ';' 0x3B */ {258, 3, 12, 5, 1, -8}, + /* '<' 0x3C */ {263, 9, 9, 11, 1, -8}, + /* '=' 0x3D */ {274, 9, 4, 11, 1, -5}, + /* '>' 0x3E */ {279, 9, 8, 11, 1, -7}, + /* '?' 0x3F */ {288, 9, 13, 10, 1, -12}, + /* '@' 0x40 */ {303, 17, 16, 18, 1, -12}, + /* 'A' 0x41 */ {337, 12, 13, 12, 0, -12}, + /* 'B' 0x42 */ {357, 11, 13, 12, 1, -12}, + /* 'C' 0x43 */ {375, 11, 13, 13, 1, -12}, + /* 'D' 0x44 */ {393, 11, 13, 13, 1, -12}, + /* 'E' 0x45 */ {411, 9, 13, 11, 1, -12}, + /* 'F' 0x46 */ {426, 8, 13, 11, 1, -12}, + /* 'G' 0x47 */ {439, 12, 13, 14, 1, -12}, + /* 'H' 0x48 */ {459, 11, 13, 13, 1, -12}, + /* 'I' 0x49 */ {477, 2, 13, 5, 2, -12}, + /* 'J' 0x4A */ {481, 7, 13, 10, 1, -12}, + /* 'K' 0x4B */ {493, 10, 13, 12, 1, -12}, + /* 'L' 0x4C */ {510, 8, 13, 10, 1, -12}, + /* 'M' 0x4D */ {523, 13, 13, 15, 1, -12}, + /* 'N' 0x4E */ {545, 11, 13, 13, 1, -12}, + /* 'O' 0x4F */ {563, 13, 13, 14, 1, -12}, + /* 'P' 0x50 */ {585, 10, 13, 12, 1, -12}, + /* 'Q' 0x51 */ {602, 13, 14, 14, 1, -12}, + /* 'R' 0x52 */ {625, 12, 13, 13, 1, -12}, + /* 'S' 0x53 */ {645, 10, 13, 12, 1, -12}, + /* 'T' 0x54 */ {662, 9, 13, 11, 1, -12}, + /* 'U' 0x55 */ {677, 11, 13, 13, 1, -12}, + /* 'V' 0x56 */ {695, 11, 13, 11, 0, -12}, + /* 'W' 0x57 */ {713, 16, 13, 17, 0, -12}, + /* 'X' 0x58 */ {739, 10, 13, 12, 1, -12}, + /* 'Y' 0x59 */ {756, 12, 13, 12, 0, -12}, + /* 'Z' 0x5A */ {776, 10, 13, 11, 1, -12}, + /* '[' 0x5B */ {793, 3, 17, 5, 1, -12}, + /* '\' 0x5C */ {800, 5, 13, 5, 0, -12}, + /* ']' 0x5D */ {809, 3, 17, 5, 0, -12}, + /* '^' 0x5E */ {816, 7, 7, 8, 1, -12}, + /* '_' 0x5F */ {823, 10, 1, 10, 0, 3}, + /* '`' 0x60 */ {825, 4, 3, 5, 0, -12}, + /* 'a' 0x61 */ {827, 9, 10, 10, 1, -9}, + /* 'b' 0x62 */ {839, 9, 13, 10, 1, -12}, + /* 'c' 0x63 */ {854, 8, 10, 9, 1, -9}, + /* 'd' 0x64 */ {864, 8, 13, 10, 1, -12}, + /* 'e' 0x65 */ {877, 8, 10, 10, 1, -9}, + /* 'f' 0x66 */ {887, 4, 13, 5, 1, -12}, + /* 'g' 0x67 */ {894, 8, 14, 10, 1, -9}, + /* 'h' 0x68 */ {908, 8, 13, 10, 1, -12}, + /* 'i' 0x69 */ {921, 2, 13, 4, 1, -12}, + /* 'j' 0x6A */ {925, 4, 17, 4, 0, -12}, + /* 'k' 0x6B */ {934, 8, 13, 9, 1, -12}, + /* 'l' 0x6C */ {947, 2, 13, 4, 1, -12}, + /* 'm' 0x6D */ {951, 13, 10, 15, 1, -9}, + /* 'n' 0x6E */ {968, 8, 10, 10, 1, -9}, + /* 'o' 0x6F */ {978, 8, 10, 10, 1, -9}, + /* 'p' 0x70 */ {988, 9, 13, 10, 1, -9}, + /* 'q' 0x71 */ {1003, 8, 13, 10, 1, -9}, + /* 'r' 0x72 */ {1016, 5, 10, 6, 1, -9}, + /* 's' 0x73 */ {1023, 8, 10, 9, 1, -9}, + /* 't' 0x74 */ {1033, 4, 12, 5, 1, -11}, + /* 'u' 0x75 */ {1039, 8, 10, 10, 1, -9}, + /* 'v' 0x76 */ {1049, 9, 10, 9, 0, -9}, + /* 'w' 0x77 */ {1061, 13, 10, 13, 0, -9}, + /* 'x' 0x78 */ {1078, 7, 10, 9, 1, -9}, + /* 'y' 0x79 */ {1087, 8, 14, 9, 0, -9}, + /* 'z' 0x7A */ {1101, 7, 10, 9, 1, -9}, + /* '{' 0x7B */ {1110, 4, 17, 6, 1, -12}, + /* '|' 0x7C */ {1119, 2, 17, 4, 2, -12}, + /* '}' 0x7D */ {1124, 4, 17, 6, 1, -12}, + /* '~' 0x7E */ {1133, 7, 3, 9, 1, -7}, + /* 0x7F */ {1136, 13, 14, 15, 1, -12}, + /* 0x80 */ {1159, 10, 13, 12, 1, -12}, + /* 0x81 */ {1176, 0, 0, 0, 0, 0}, + /* 0x82 */ {1176, 2, 3, 5, 1, 0}, + /* 0x83 */ {1177, 0, 0, 0, 0, 0}, + /* 0x84 */ {1177, 5, 3, 7, 1, 0}, + /* 0x85 */ {1179, 10, 1, 12, 1, 0}, + /* 0x86 */ {1181, 8, 16, 10, 1, -12}, + /* 0x87 */ {1197, 8, 16, 10, 1, -12}, + /* 0x88 */ {1213, 0, 0, 0, 0, 0}, + /* 0x89 */ {1213, 18, 13, 18, 0, -12}, + /* 0x8A */ {1243, 10, 15, 12, 1, -14}, + /* 0x8B */ {1262, 2, 4, 4, 1, -6}, + /* 0x8C */ {1263, 10, 15, 12, 1, -14}, + /* 0x8D */ {1282, 9, 15, 11, 1, -14}, + /* 0x8E */ {1299, 10, 15, 11, 1, -14}, + /* 0x8F */ {1318, 10, 15, 11, 1, -14}, + /* 0x90 */ {1337, 0, 0, 0, 0, 0}, + /* 0x91 */ {1337, 2, 4, 4, 2, -12}, + /* 0x92 */ {1338, 2, 4, 4, 1, -12}, + /* 0x93 */ {1339, 5, 4, 7, 2, -12}, + /* 0x94 */ {1342, 5, 4, 7, 1, -12}, + /* 0x95 */ {1345, 4, 5, 7, 1, -8}, + /* 0x96 */ {1348, 7, 1, 9, 1, -4}, + /* 0x97 */ {1349, 16, 1, 18, 1, -4}, + /* 0x98 */ {1351, 0, 0, 0, 0, 0}, + /* 0x99 */ {1351, 18, 10, 18, 1, -13}, + /* 0x9A */ {1374, 8, 13, 9, 1, -12}, + /* 0x9B */ {1387, 2, 4, 5, 2, -6}, + /* 0x9C */ {1388, 8, 13, 9, 1, -12}, + /* 0x9D */ {1401, 6, 13, 8, 1, -12}, + /* 0x9E */ {1411, 7, 13, 9, 1, -12}, + /* 0x9F */ {1423, 7, 13, 9, 1, -12}, + /* 0xA0 */ {1435, 0, 0, 5, 0, 0}, + /* 0xA1 */ {1435, 5, 3, 6, 0, -12}, + /* 0xA2 */ {1437, 6, 2, 6, 0, -12}, + /* 0xA3 */ {1439, 9, 13, 11, 1, -12}, + /* 0xA4 */ {1454, 7, 6, 10, 2, -8}, + /* 0xA5 */ {1460, 12, 17, 12, 1, -12}, + /* 0xA6 */ {1486, 2, 17, 5, 2, -12}, + /* 0xA7 */ {1491, 9, 17, 10, 1, -12}, + /* 0xA8 */ {1511, 6, 1, 6, 0, -11}, + /* 0xA9 */ {1512, 14, 13, 14, 1, -12}, + /* 0xAA */ {1535, 10, 17, 12, 1, -12}, + /* 0xAB */ {1557, 7, 6, 9, 1, -7}, + /* 0xAC */ {1563, 9, 5, 11, 2, -5}, + /* 0xAD */ {1569, 0, 0, 0, 0, 0}, + /* 0xAE */ {1569, 14, 13, 14, 1, -12}, + /* 0xAF */ {1592, 10, 15, 11, 1, -14}, + /* 0xB0 */ {1611, 5, 5, 11, 3, -11}, + /* 0xB1 */ {1615, 9, 11, 11, 1, -10}, + /* 0xB2 */ {1628, 4, 4, 6, 1, 1}, + /* 0xB3 */ {1630, 4, 13, 5, 1, -12}, + /* 0xB4 */ {1637, 4, 3, 6, 2, -12}, + /* 0xB5 */ {1639, 9, 13, 10, 1, -9}, + /* 0xB6 */ {1654, 8, 16, 10, 2, -12}, + /* 0xB7 */ {1670, 3, 1, 5, 1, -4}, + /* 0xB8 */ {1671, 5, 4, 6, 1, 1}, + /* 0xB9 */ {1674, 10, 14, 10, 1, -9}, + /* 0xBA */ {1692, 8, 14, 9, 1, -9}, + /* 0xBB */ {1706, 7, 6, 9, 1, -7}, + /* 0xBC */ {1712, 8, 13, 10, 1, -12}, + /* 0xBD */ {1725, 6, 3, 6, 0, -12}, + /* 0xBE */ {1728, 5, 13, 7, 1, -12}, + /* 0xBF */ {1737, 7, 12, 9, 1, -11}, + /* 0xC0 */ {1748, 12, 15, 13, 1, -14}, + /* 0xC1 */ {1771, 10, 14, 12, 1, -13}, + /* 0xC2 */ {1789, 10, 14, 12, 1, -13}, + /* 0xC3 */ {1807, 10, 14, 12, 1, -13}, + /* 0xC4 */ {1825, 10, 14, 12, 1, -13}, + /* 0xC5 */ {1843, 8, 14, 10, 1, -13}, + /* 0xC6 */ {1857, 11, 15, 13, 1, -14}, + /* 0xC7 */ {1878, 11, 17, 13, 1, -12}, + /* 0xC8 */ {1902, 11, 15, 13, 1, -14}, + /* 0xC9 */ {1923, 9, 14, 11, 1, -13}, + /* 0xCA */ {1939, 11, 17, 12, 1, -12}, + /* 0xCB */ {1963, 9, 14, 11, 1, -13}, + /* 0xCC */ {1979, 9, 15, 11, 1, -14}, + /* 0xCD */ {1996, 3, 14, 5, 1, -13}, + /* 0xCE */ {2002, 5, 14, 5, 0, -13}, + /* 0xCF */ {2011, 10, 15, 13, 2, -14}, + /* 0xD0 */ {2030, 11, 13, 13, 1, -12}, + /* 0xD1 */ {2048, 11, 14, 13, 1, -13}, + /* 0xD2 */ {2068, 11, 14, 13, 1, -13}, + /* 0xD3 */ {2088, 12, 15, 13, 1, -14}, + /* 0xD4 */ {2111, 12, 15, 13, 1, -14}, + /* 0xD5 */ {2134, 12, 15, 13, 1, -14}, + /* 0xD6 */ {2157, 12, 15, 13, 1, -14}, + /* 0xD7 */ {2180, 7, 7, 11, 2, -7}, + /* 0xD8 */ {2187, 12, 15, 13, 1, -14}, + /* 0xD9 */ {2210, 11, 14, 13, 1, -13}, + /* 0xDA */ {2230, 11, 14, 13, 1, -13}, + /* 0xDB */ {2250, 11, 14, 13, 1, -13}, + /* 0xDC */ {2270, 11, 14, 13, 1, -13}, + /* 0xDD */ {2290, 12, 14, 12, 0, -13}, + /* 0xDE */ {2311, 9, 17, 11, 1, -12}, + /* 0xDF */ {2331, 9, 13, 11, 1, -12}, + /* 0xE0 */ {2346, 5, 13, 6, 1, -12}, + /* 0xE1 */ {2355, 9, 13, 10, 1, -12}, + /* 0xE2 */ {2370, 9, 13, 10, 1, -12}, + /* 0xE3 */ {2385, 9, 13, 10, 1, -12}, + /* 0xE4 */ {2400, 9, 12, 10, 1, -11}, + /* 0xE5 */ {2414, 3, 15, 4, 0, -14}, + /* 0xE6 */ {2420, 8, 13, 9, 1, -12}, + /* 0xE7 */ {2433, 8, 14, 9, 1, -9}, + /* 0xE8 */ {2447, 8, 13, 9, 1, -12}, + /* 0xE9 */ {2460, 8, 13, 10, 1, -12}, + /* 0xEA */ {2473, 8, 14, 10, 1, -9}, + /* 0xEB */ {2487, 8, 12, 10, 1, -11}, + /* 0xEC */ {2499, 8, 13, 10, 1, -12}, + /* 0xED */ {2512, 3, 13, 4, 1, -12}, + /* 0xEE */ {2517, 4, 13, 5, 0, -12}, + /* 0xEF */ {2524, 12, 13, 12, 1, -12}, + /* 0xF0 */ {2544, 9, 13, 10, 1, -12}, + /* 0xF1 */ {2559, 8, 13, 10, 1, -12}, + /* 0xF2 */ {2572, 8, 13, 10, 1, -12}, + /* 0xF3 */ {2585, 8, 13, 10, 1, -12}, + /* 0xF4 */ {2598, 8, 13, 10, 1, -12}, + /* 0xF5 */ {2611, 8, 13, 10, 1, -12}, + /* 0xF6 */ {2624, 8, 12, 10, 1, -11}, + /* 0xF7 */ {2636, 9, 8, 11, 1, -7}, + /* 0xF8 */ {2645, 5, 13, 6, 1, -12}, + /* 0xF9 */ {2654, 8, 13, 10, 1, -12}, + /* 0xFA */ {2667, 8, 13, 10, 1, -12}, + /* 0xFB */ {2680, 8, 13, 10, 1, -12}, + /* 0xFC */ {2693, 8, 12, 10, 1, -11}, + /* 0xFD */ {2705, 8, 17, 9, 0, -12}, + /* 0xFE */ {2722, 5, 16, 5, 1, -11}, + /* 0xFF */ {2732, 2, 1, 6, 2, -11}, +}; + +const GFXfont FreeSans9pt_Win1250 PROGMEM = {(uint8_t *)FreeSans9pt_Win1250Bitmaps, (GFXglyph *)FreeSans9pt_Win1250Glyphs, 0x20, + 0xFF, 21}; diff --git a/src/graphics/niche/Fonts/FreeSans9pt_Win1251.h b/src/graphics/niche/Fonts/FreeSans9pt_Win1251.h new file mode 100644 index 000000000..82857cb91 --- /dev/null +++ b/src/graphics/niche/Fonts/FreeSans9pt_Win1251.h @@ -0,0 +1,493 @@ +#pragma once +const uint8_t FreeSans9pt_Win1251Bitmaps[] PROGMEM = { + /* ' ' 0x20 */ + 0xFF, 0xFF, 0xF0, 0xC0, /* '!' 0x21 */ + 0xDE, 0xF7, 0x20, /* '"' 0x22 */ + 0x09, 0x86, 0x41, 0x91, 0xFF, 0x13, 0x04, 0xC3, 0x20, 0xC8, 0xFF, 0x89, 0x82, 0x61, 0x90, /* '#' 0x23 */ + 0x10, 0x1F, 0x14, 0xDA, 0x3D, 0x1E, 0x83, 0x40, 0x78, 0x17, 0x08, 0xF4, 0x7A, 0x35, 0x33, 0xF0, 0x40, 0x20, /* '$' 0x24 */ + 0x38, 0x10, 0xEC, 0x20, 0xC6, 0x20, 0xC6, 0x40, 0xC6, 0x40, 0x6C, 0x80, 0x39, 0x00, 0x01, 0x3C, 0x02, 0x77, 0x02, 0x63, 0x04, + 0x63, 0x04, 0x77, 0x08, 0x3C, /* '%' 0x25 */ + 0x0E, 0x0C, 0xC3, 0x30, 0xCC, 0x1E, 0x03, 0x03, 0xC1, 0x9B, 0xC2, 0xF0, 0xEC, 0x19, 0x8F, 0x3C, 0x40, /* '&' 0x26 */ + 0xFE, /* ''' 0x27 */ + 0x13, 0x26, 0x6C, 0xCC, 0xCC, 0xC4, 0x66, 0x23, 0x10, /* '(' 0x28 */ + 0x8C, 0x46, 0x63, 0x33, 0x33, 0x32, 0x66, 0x4C, 0x80, /* ')' 0x29 */ + 0x25, 0x7E, 0xA5, 0x00, /* '*' 0x2A */ + 0x30, 0xC3, 0x3F, 0x30, 0xC3, 0x0C, /* '+' 0x2B */ + 0xD6, /* ',' 0x2C */ + 0xF0, /* '-' 0x2D */ + 0xC0, /* '.' 0x2E */ + 0x08, 0x44, 0x21, 0x10, 0x84, 0x42, 0x11, 0x08, 0x00, /* '/' 0x2F */ + 0x3C, 0x66, 0x42, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x42, 0x66, 0x3C, /* '0' 0x30 */ + 0x11, 0x3F, 0x33, 0x33, 0x33, 0x33, 0x30, /* '1' 0x31 */ + 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x1C, 0x1C, 0x1C, 0x18, 0x18, 0x10, 0x08, 0x07, 0xF8, /* '2' 0x32 */ + 0x3C, 0x66, 0xC3, 0xC3, 0x03, 0x06, 0x1C, 0x07, 0x03, 0xC3, 0xC3, 0x66, 0x3C, /* '3' 0x33 */ + 0x0C, 0x18, 0x71, 0x62, 0xC9, 0xA3, 0x46, 0xFE, 0x18, 0x30, 0x60, 0xC0, /* '4' 0x34 */ + 0x7F, 0x20, 0x10, 0x08, 0x08, 0x07, 0xF3, 0x8C, 0x03, 0x01, 0x80, 0xF0, 0x6C, 0x63, 0xE0, /* '5' 0x35 */ + 0x1E, 0x31, 0x98, 0x78, 0x0C, 0x06, 0xF3, 0x8D, 0x83, 0xC1, 0xE0, 0xD0, 0x6C, 0x63, 0xE0, /* '6' 0x36 */ + 0xFF, 0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x18, 0x18, 0x18, 0x10, 0x30, 0x30, /* '7' 0x37 */ + 0x3E, 0x31, 0xB0, 0x78, 0x3C, 0x1B, 0x18, 0xF8, 0xC6, 0xC1, 0xE0, 0xF0, 0x6C, 0x63, 0xE0, /* '8' 0x38 */ + 0x3C, 0x66, 0xC2, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0xC2, 0x66, 0x3C, /* '9' 0x39 */ + 0xC0, 0x00, 0x30, /* ':' 0x3A */ + 0xC0, 0x00, 0x00, 0x64, 0xA0, /* ';' 0x3B */ + 0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x07, 0x80, 0x70, 0x0E, 0x01, 0x80, /* '<' 0x3C */ + 0xFF, 0x80, 0x00, 0x1F, 0xF0, /* '=' 0x3D */ + 0xE0, 0x1C, 0x03, 0x80, 0x30, 0x70, 0xE3, 0x81, 0x00, /* '>' 0x3E */ + 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x18, 0x38, 0x18, 0x18, 0x0C, 0x00, 0x00, 0x01, 0x80, /* '?' 0x3F */ + 0x03, 0xF0, 0x06, 0x0E, 0x06, 0x01, 0x86, 0x00, 0x66, 0x1D, 0xBB, 0x31, 0xCF, 0x18, 0xC7, 0x98, 0x63, 0xCC, 0x31, 0xE6, 0x11, + 0xB3, 0x99, 0xCC, 0xF7, 0x86, 0x00, 0x01, 0x80, 0x00, 0x70, 0x40, 0x0F, 0xE0, /* '@' 0x40 */ + 0x06, 0x00, 0xF0, 0x0F, 0x00, 0x90, 0x19, 0x81, 0x98, 0x10, 0x83, 0x0C, 0x3F, 0xC2, 0x04, 0x60, 0x66, 0x06, 0xC0, + 0x30, /* 'A' 0x41 */ + 0xFF, 0x18, 0x33, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x3F, 0xC6, 0x06, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, /* 'B' 0x42 */ + 0x1F, 0x86, 0x19, 0x81, 0xA0, 0x3C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0x61, 0xF0, /* 'C' 0x43 */ + 0xFF, 0x18, 0x33, 0x03, 0x60, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x03, 0x60, 0xCF, 0xF0, /* 'D' 0x44 */ + 0xFF, 0xE0, 0x30, 0x18, 0x0C, 0x06, 0x03, 0xFD, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0F, 0xF8, /* 'E' 0x45 */ + 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFE, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, /* 'F' 0x46 */ + 0x0F, 0x83, 0x0E, 0x60, 0x66, 0x03, 0xC0, 0x0C, 0x00, 0xC1, 0xFC, 0x03, 0xC0, 0x36, 0x03, 0x60, 0x73, 0x0F, 0x0F, + 0x10, /* 'G' 0x47 */ + 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xFF, 0xFE, 0x03, 0xC0, 0x78, 0x0F, 0x01,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x06, 0xC0, 0x6C, 0x0C, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x06, 0xC0, + 0x70, /* 'R' 0x52 */ + 0x3F, 0x18, 0x6C, 0x0F, 0x03, 0xC0, 0x1E, 0x01, 0xF0, 0x0E, 0x00, 0xF0, 0x3C, 0x0D, 0x86, 0x3F, 0x00, /* 'S' 0x53 */ + 0xFF, 0x86, 0x03, 0x01, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, /* 'T' 0x54 */ + 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xB0, 0x61, 0xF0, /* 'U' 0x55 */ + 0xC0, 0x6C, 0x0D, 0x81, 0x10, 0x63, 0x0C, 0x61, 0x04, 0x60, 0xCC, 0x19, 0x01, 0x60, 0x3C, 0x07, 0x00, 0x60, /* 'V' 0x56 */ + 0xC1, 0x81, 0x61, 0xC3, 0x61, 0xC3, 0x61, 0x43, 0x62, 0x62, 0x22, 0x66, 0x32, 0x26, 0x36, 0x26, 0x14, 0x34, 0x14, 0x34, 0x1C, + 0x1C, 0x18, 0x1C, 0x08, 0x18, /* 'W' 0x57 */ + 0xC0, 0xD8, 0x66, 0x18, 0xCC, 0x1E, 0x07, 0x00, 0xC0, 0x78, 0x32, 0x0C, 0xC6, 0x1B, 0x07, 0xC0, 0xC0, /* 'X' 0x58 */ + 0xC0, 0x36, 0x06, 0x30, 0xC3, 0x0C, 0x19, 0x81, 0xD8, 0x0F, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, + 0x00, /* 'Y' 0x59 */ + 0xFF, 0xC0, 0x60, 0x30, 0x0C, 0x06, 0x03, 0x01, 0xC0, 0x60, 0x30, 0x18, 0x06, 0x03, 0x00, 0xFF, 0xC0, /* 'Z' 0x5A */ + 0xFB, 0x6D, 0xB6, 0xDB, 0x6D, 0xB6, 0xE0, /* '[' 0x5B */ + 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x80, /* '\' 0x5C */ + 0xED, 0xB6, 0xDB, 0x6D, 0xB6, 0xDB, 0xE0, /* ']' 0x5D */ + 0x30, 0x60, 0xA2, 0x44, 0xD8, 0xA1, 0x80, /* '^' 0x5E */ + 0xFF, 0xC0, /* '_' 0x5F */ + 0xC6, 0x30, /* '`' 0x60 */ + 0x7E, 0x71, 0xB0, 0xC0, 0x60, 0xF3, 0xDB, 0x0D, 0x86, 0xC7, 0x3D, 0xC0, /* 'a' 0x61 */ + 0xC0, 0x60, 0x30, 0x1B, 0xCE, 0x36, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x6D, 0xE0, /* 'b' 0x62 */ + 0x3C, 0x66, 0xC3, 0xC0, 0xC0, 0xC0, 0xC0, 0xC3, 0x66, 0x3C, /* 'c' 0x63 */ + 0x03, 0x03, 0x03, 0x3B, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, /* 'd' 0x64 */ + 0x3C, 0x66, 0xC3, 0xC3, 0xFF, 0xC0, 0xC0, 0xC3, 0x66, 0x3C, /* 'e' 0x65 */ + 0x36, 0x6F, 0x66, 0x66, 0x66, 0x66, 0x60, /* 'f' 0x66 */ + 0x3B, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0xC6, 0x7C, /* 'g' 0x67 */ + 0xC0, 0xC0, 0xC0, 0xDE, 0xE3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, /* 'h' 0x68 */ + 0xC3, 0xFF, 0xFF, 0xC0, /* 'i' 0x69 */ + 0x30, 0x03, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0xE0, /* 'j' 0x6A */ + 0xC0, 0xC0, 0xC0, 0x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5, 0x0C, /* 'x' 0x78 */ + 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, /* 'y' 0x79 */ + 0xFE, 0x0C, 0x30, 0xC1, 0x86, 0x18, 0x20, 0xC1, 0xFC, /* 'z' 0x7A */ + 0x36, 0x66, 0x66, 0x6E, 0xCE, 0x66, 0x66, 0x66, 0x30, /* '{' 0x7B */ + 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, /* '|' 0x7C */ + 0xC6, 0x66, 0x66, 0x67, 0x37, 0x66, 0x66, 0x66, 0xC0, /* '}' 0x7D */ + 0x61, 0x24, 0x38, /* '~' 0x7E */ + 0xFF, 0xFC, 0x00, 0x63, 0xE3, 0x31, 0x99, 0x04, 0xC8, 0x66, 0x06, 0x30, 0x61, 0x83, 0x0C, 0x18, 0x60, 0x03, 0x06, 0x18, 0x00, + 0xFF, 0xFC, /* 0x7F */ + 0xFF, 0x01, 0x80, 0x18, 0x01, 0x80, 0x18, 0x01, 0xFE, 0x18, 0x31, 0x83, 0x18, 0x31, 0x83, 0x18, 0x31, 0x83, 0x18, 0x30, 0x03, + 0x00, 0x30, 0x0E, /* 0x80 */ + 0x0C, 0x18, 0x00, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, /* 0x81 */ + 0xDC, /* 0x82 */ + 0x18, 0x89, 0xFC, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x00, /* 0x83 */ + 0xDA, 0x76, /* 0x84 */ + 0xCC, 0xC0, /* 0x85 */ + 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 0x86 */ + 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, /* 0x87 */ + 0x07, 0xC6, 0x13, 0x00, 0xC0, 0x60, 0x3F, 0xE6, 0x03, 0xFC, 0x60, 0x0C, 0x03, 0x00, 0x61, 0x07, 0xC0, /* 0x88 */ + 0x70, 0x80, 0x22, 0x20, 0x08, 0x90, 0x02, 0x24, 0x00, 0x72, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x10, 0x00, 0x09, 0xC7, 0x84, + 0x8B, 0x31, 0x22, 0x84, 0x88, 0xB3, 0x21, 0xC7, 0x80, /* 0x89 */ + 0x3F, 0x80, 0x18, 0xC0, 0x0C, 0x60, 0x06, 0x30, 0x03, 0x18, 0x01, 0x8C, 0x00, 0xC7, 0xF8, 0x63, 0x06, 0x31, 0x81, 0x90, 0xC0, + 0xD8, 0x60, 0x6C, 0x30, 0x6C, 0x1F, 0xE0, /* 0x8A */ + 0x69, /* 0x8B */ + 0xC0, 0xC0, 0x60, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0C, 0x0C, 0x06, 0x06, 0x03, 0xFF, 0xF9, 0x81, 0x86, 0xC0, 0xC1, 0xE0, 0x60, + 0xF0, 0x30, 0x78, 0x18, 0x6C, 0x0F, 0xE0, /* 0x8C */ + 0x0C, 0x06, 0x0C, 0x1B, 0x0C, 0xC6, 0x33, 0x0D, 0x83, 0xC0, 0xF0, 0x3E, 0x0D, 0xC3, 0x38, 0xC7, 0x30, 0xEC, 0x1C, /* 0x8D */ + 0xFF, 0x01, 0x80, 0x18, 0x01, 0x80, 0x18, 0x01, 0xFE, 0x18, 0x31, 0x83, 0x18, 0x31, 0x83, 0x18, 0x31, 0x83, 0x18, + 0x30, /* 0x8E */ + 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3F, 0xFE, 0x0C, 0x01, + 0x80, /* 0x8F */ + 0x60, 0x7C, 0x18, 0x0D, 0xE7, 0x1B, 0x0D, 0x86, 0xC3, 0x61, 0xB0, 0xD8, 0x6C, 0x36, 0x18, 0x18, 0x08, 0x08, /* 0x90 */ + 0x6B, /* 0x91 */ + 0xD6, /* 0x92 */ + 0x4C, 0xA5, 0xB0, /* 0x93 */ + 0xDA, 0x53, 0x20, /* 0x94 */ + 0x6F, 0xFF, 0x60, /* 0x95 */ + 0xFE, /* 0x96 */ + 0xFF, 0xFF, /* 0x97 */ + /* 0x98 */ + 0xFC, 0xE1, 0xCC, 0x38, 0x73, 0x0E, 0x1C, 0xC3, 0x8F, 0x30, 0xD2, 0xCC, 0x34, 0xB3, 0x0D, 0x6C, 0xC3, 0x53, 0x30, 0xCC, 0xCC, + 0x33, 0x30, /* 0x99 */ + 0x7E, 0x03, 0x30, 0x19, 0x80, 0xCC, 0x06, 0x60, 0x33, 0xF9, 0x98, 0x6C, 0xC3, 0x46, 0x1E, 0x3F, 0x80, /* 0x9A */ + 0x96, /* 0x9B */ + 0xC3, 0x03, 0x0C, 0x0C, 0x30, 0x30, 0xC0, 0xC3, 0x03, 0xFF, 0xEC, 0x30, 0xF0, 0xC3, 0xC3, 0x0F, 0x0F, 0xE0, /* 0x9C */ + 0x0C, 0x30, 0x46, 0x3C, 0xDB, 0x34, 0x70, 0xF1, 0xB3, 0x36, 0x3C, 0x20, /* 0x9D */ + 0x60, 0x7C, 0x18, 0x0D, 0xE7, 0x3B, 0x0D, 0x86, 0xC3, 0x61, 0xB0, 0xD8, 0x6C, 0x36, 0x18, /* 0x9E */ + 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xFF, 0x18, 0x18, /* 0x9F */ + /* 0xA0 */ + 0x21, 0x07, 0x8C, 0x0F, 0x06, 0x61, 0x98, 0xC3, 0x30, 0xD8, 0x1E, 0x07, 0x00, 0xC0, 0x60, 0x18, 0x0C, 0x03, 0x00, /* 0xA1 */ + 0x66, 0x18, 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, /* 0xA2 */ + 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x07, 0x8F, 0x1E, 0x27, 0x80, /* 0xA3 */ + 0xFF, 0xDF, 0x1E, 0x3E, 0xFF, 0xC0, /* 0xA4 */ + 0x00, 0xC0, 0x3F, 0xFF, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x00, /* 0xA5 */ + 0xFF, 0xFC, 0x0F, 0xFF, 0xC0, /* 0xA6 */ + 0x0C, 0x09, 0x0C, 0xC6, 0x63, 0x81, 0xE3, 0x19, 0x87, 0xE1, 0xB8, 0xC6, 0x41, 0xC0, 0x73, 0x19, 0x8C, 0x66, 0x1E, + 0x00, /* 0xA7 */ + 0x33, 0x00, 0x3F, 0xF8, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0xFE, /* 0xA8 */ + 0x0F, 0xC0, 0x61, 0x87, 0x03, 0x9B, 0xC6, 0xD9, 0x8F, 0x60, 0x3D, 0x00, 0xF4, 0x03, 0xD8, 0x0D, 0xE6, 0x67, 0xF3, 0x86, 0x18, + 0x0F, 0xC0, /* 0xA9 */ + 0x1F, 0x86, 0x19, 0x81, 0xB0, 0x3C, 0x01, 0x80, 0x3F, 0xC6, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0x61, 0xF0, /* 0xAA */ + 0x22, 0xCF, 0x26, 0x46, 0x64, 0x40, /* 0xAB */ + 0xFF, 0x80, 0xC0, 0x60, 0x30, 0x18, /* 0xAC */ + /* 0xAD */ + 0x0F, 0xC0, 0x61, 0x87, 0x03, 0x9F, 0xE6, 0xD0, 0x8F, 0x42, 0x3D, 0xF0, 0xF4, 0x23, 0xD0, 0x8D, 0xC2, 0x67, 0x0B, 0x86, 0x18, + 0x0F, 0xC0, /* 0xAE */ + 0xCC, 0x03, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x00, /* 0xAF */ + 0x74, 0x63, 0x17, 0x00, /* 0xB0 */ + 0x0C, 0x06, 0x03, 0x07, 0xE0, 0xC0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x3F, 0xE0, /* 0xB1 */ + 0xFF, 0xFF, 0xFF, 0xC0, /* 0xB2 */ + 0xC3, 0xFF, 0xFF, 0xC0, /* 0xB3 */ + 0x0C, 0x3F, 0xF0, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, /* 0xB4 */ + 0xC3, 0x61, 0xB0, 0xD8, 0x6C, 0x36, 0x1B, 0x0D, 0x86, 0xE7, 0x7D, 0xF0, 0x18, 0x0C, 0x00, /* 0xB5 */ + 0x3F, 0x7E, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0x72, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, /* 0xB6 */ + 0xE0, /* 0xB7 */ + 0x66, 0x00, 0x3C, 0x66, 0xC3, 0xC3, 0xFF, 0xC0, 0xC0, 0xC3, 0x66, 0x3C, /* 0xB8 */ + 0xC1, 0x81, 0x83, 0x03, 0x86, 0x05, 0x0C, 0xEB, 0x1A, 0x32, 0x34, 0x66, 0x68, 0xC4, 0xD1, 0x8D, 0xB3, 0x0B, 0x3A, 0x1E, 0x04, + 0x1C, 0x08, 0x1B, 0xC0, /* 0xB9 */ + 0x3C, 0x46, 0xC3, 0x80, 0xF8, 0x80, 0x80, 0xC3, 0x46, 0x3C, /* 0xBA */ + 0x89, 0x98, 0x99, 0x3C, 0xD1, 0x00, /* 0xBB */ + 0x30, 0x03, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0xE0, /* 0xBC */ + 0x3F, 0x18, 0x6C, 0x0F, 0x03, 0xC0, 0x1E, 0x01, 0xF0, 0x0E, 0x00, 0xF0, 0x3C, 0x0D, 0x86, 0x3F, 0x00, /* 0xBD */ + 0x3E, 0xE3, 0xC0, 0xC0, 0x60, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, /* 0xBE */ + 0xCC, 0x03, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, /* 0xBF */ + 0x06, 0x00, 0xF0, 0x0F, 0x00, 0x90, 0x19, 0x81, 0x98, 0x10, 0x83, 0x0C, 0x3F, 0xC2, 0x04, 0x60, 0x66, 0x06, 0xC0, + 0x30, /* 0xC0 */ + 0xFF, 0x18, 0x03, 0x00, 0x60, 0x0C, 0x01, 0x80, 0x3F, 0xE6, 0x06, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, /* 0xC1 */ + 0xFF, 0x18, 0x33, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x3F, 0xC6, 0x06, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, /* 0xC2 */ + 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, /* 0xC3 */ + 0x1F, 0xF0, 0x60, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x03, 0x0C, 0x0C, + 0xFF, 0xFF, 0x00, 0x3C, 0x00, 0xF0, 0x03, /* 0xC4 */ + 0xFF, 0xE0, 0x30, 0x18, 0x0C, 0x06, 0x03, 0xFD, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0F, 0xF8, /* 0xC5 */ + 0x61, 0x86, 0x31, 0x8C, 0x19, 0x98, 0x19, 0x98, 0x0D, 0xB0, 0x07, 0xE0, 0x03, 0xC0, 0x07, 0xE0, 0x0D, 0xB0, 0x19, 0x98, 0x31, + 0x8C, 0x61, 0x86, 0xC1, 0x83, /* 0xC6 */ + 0x3F, 0x18, 0x6C, 0x0F, 0x03, 0x00, 0xC0, 0x60, 0xF0, 0x06, 0x00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, 0xC0, 0xF0, 0x6F, 0xF3, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x00, /* 0xD0 */ + 0x1F, 0x86, 0x19, 0x81, 0xA0, 0x3C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0x61, 0xF0, /* 0xD1 */ + 0xFF, 0x86, 0x03, 0x01, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, /* 0xD2 */ + 0xC0, 0xF0, 0x66, 0x19, 0x8C, 0x33, 0x0D, 0x81, 0xE0, 0x70, 0x0C, 0x06, 0x01, 0x80, 0xC0, 0x30, 0x00, /* 0xD3 */ + 0x03, 0x00, 0x0C, 0x01, 0xFE, 0x1C, 0xCE, 0xE3, 0x1F, 0x0C, 0x3C, 0x30, 0xF0, 0xC3, 0xE3, 0x1D, 0xCC, 0xE3, 0xFF, 0x00, 0xC0, + 0x03, 0x00, /* 0xD4 */ + 0xC0, 0xD8, 0x66, 0x18, 0xCC, 0x1E, 0x07, 0x00, 0xC0, 0x78, 0x32, 0x0C, 0xC6, 0x1B, 0x07, 0xC0, 0xC0, /* 0xD5 */ + 0xC0, 0x66, 0x03, 0x30, 0x19, 0x80, 0xCC, 0x06, 0x60, 0x33, 0x01, 0x98, 0x0C, 0xC0, 0x66, 0x03, 0x30, 0x19, 0x80, 0xCF, 0xFF, + 0x80, 0x0C, 0x00, 0x60, /* 0xD6 */ + 0xC1, 0xE0, 0xF0, 0x78, 0x3C, 0x1E, 0x0F, 0x06, 0xFF, 0x01, 0x80, 0xC0, 0x60, 0x30, 0x18, /* 0xD7 */ + 0xC3, 0x1E, 0x18, 0xF0, 0xC7, 0x86, 0x3C, 0x31, 0xE1, 0x8F, 0x0C, 0x78, 0x63, 0xC3, 0x1E, 0x18, 0xF0, 0xC7, 0x86, 0x3F, 0xFF, + 0x80, /* 0xD8 */ + 0xC3, 0x19, 0x86, 0x33, 0x0C, 0x66, 0x18, 0xCC, 0x31, 0x98, 0x63, 0x30, 0xC6, 0x61, 0x8C, 0xC3, 0x19, 0x86, 0x33, 0x0C, 0x66, + 0x18, 0xCF, 0xFF, 0xE0, 0x00, 0xC0, 0x01, 0x80, /* 0xD9 */ + 0xF8, 0x00, 0xC0, 0x06, 0x00, 0x30, 0x01, 0x80, 0x0F, 0xF0, 0x60, 0xC3, 0x03, 0x18, 0x18, 0xC0, 0xC6, 0x06, 0x30, 0x61, 0xFE, + 0x00, /* 0xDA */ + 0xC0, 0x0F, 0x00, 0x3C, 0x00, 0xF0, 0x03, 0xC0, 0x0F, 0xFE, 0x3C, 0x0C, 0xF0, 0x1B, 0xC0, 0x6F, 0x01, 0xBC, 0x06, 0xF0, 0x33, + 0xFF, 0x8C, /* 0xDB */ + 0xC0, 0x18, 0x03, 0x00, 0x60, 0x0C, 0x01, 0xFF, 0x30, 0x36, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, /* 0xDC */ + 0x3F, 0x0C, 0x33, 0x83, 0x60, 0x20, 0x06, 0x00, 0x47, 0xF8, 0x01, 0xC0, 0x78, 0x0D, 0x81, 0x30, 0xC1, 0xF0, /* 0xDD */ + 0xC0, 0xF8, 0x61, 0x83, 0x31, 0x80, 0xD8, 0xC0, 0x6C, 0xC0, 0x1E, 0x60, 0x0F, 0xF0, 0x07, 0x98, 0x03, 0xCC, 0x01, 0xE3, 0x01, + 0xB1, 0x80, 0xD8, 0x60, 0xCC, 0x0F, 0x80, /* 0xDE */ + 0x3F, 0xD8, 0x3C, 0x0F, 0x03, 0xC0, 0xD8, 0x33, 0xFC, 0x33, 0x18, 0xCC, 0x36, 0x0D, 0x83, 0xC0, 0xC0, /* 0xDF */ + 0x7E, 0x71, 0xB0, 0xC0, 0x60, 0xF3, 0xDB, 0x0D, 0x86, 0xC7, 0x3D, 0xC0, /* 0xE0 */ + 0x03, 0x1F, 0x78, 0x40, 0xFC, 0xE6, 0xC3,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0xFE, 0xF0, 0xFC, 0x3F, 0x0F, 0xC3, 0xFF, 0xB0, /* 0xFB */ + 0xC0, 0xC0, 0xC0, 0xC0, 0xFE, 0xC3, 0xC3, 0xC3, 0xC3, 0xFE, /* 0xFC */ + 0x3C, 0x62, 0xC3, 0x01, 0x1F, 0x01, 0x01, 0xC3, 0x62, 0x3C, /* 0xFD */ + 0xC7, 0xCC, 0xC6, 0xD8, 0x3D, 0x83, 0xF8, 0x3D, 0x83, 0xD8, 0x3C, 0xC2, 0xCC, 0x6C, 0x7C, /* 0xFE */ + 0x7F, 0xC3, 0xC3, 0xC3, 0x7F, 0x13, 0x33, 0x63, 0xC3, 0x83, /* 0xFF */ +}; + +const GFXglyph FreeSans9pt_Win1251Glyphs[] PROGMEM = { + /* ' ' 0x20 */ {0, 0, 0, 5, 0, 0}, + /* '!' 0x21 */ {0, 2, 13, 6, 2, -12}, + /* '"' 0x22 */ {4, 5, 4, 6, 1, -12}, + /* '#' 0x23 */ {7, 10, 12, 10, 0, -11}, + /* '$' 0x24 */ {22, 9, 16, 10, 1, -13}, + /* '%' 0x25 */ {40, 16, 13, 16, 1, -12}, + /* '&' 0x26 */ {66, 10, 13, 12, 1, -12}, + /* ''' 0x27 */ {83, 2, 4, 4, 1, -12}, + /* '(' 0x28 */ {84, 4, 17, 6, 1, -12}, + /* ')' 0x29 */ {93, 4, 17, 6, 1, -12}, + /* '*' 0x2A */ {102, 5, 5, 7, 1, -12}, + /* '+' 0x2B */ {106, 6, 8, 11, 3, -7}, + /* ',' 0x2C */ {112, 2, 4, 5, 2, 0}, + /* '-' 0x2D */ {113, 4, 1, 6, 1, -4}, + /* '.' 0x2E */ {114, 2, 1, 5, 1, 0}, + /* '/' 0x2F */ {115, 5, 13, 5, 0, -12}, + /* '0' 0x30 */ {124, 8, 13, 10, 1, -12}, + /* '1' 0x31 */ {137, 4, 13, 10, 3, -12}, + /* '2' 0x32 */ {144, 9, 13, 10, 1, -12}, + /* '3' 0x33 */ {159, 8, 13, 10, 1, -12}, + /* '4' 0x34 */ {172, 7, 13, 10, 2, -12}, + /* '5' 0x35 */ {184, 9, 13, 10, 1, -12}, + /* '6' 0x36 */ {199, 9, 13, 10, 1, -12}, + /* '7' 0x37 */ {214, 8, 13, 10, 0, -12}, + /* '8' 0x38 */ {227, 9, 13, 10, 1, -12}, + /* '9' 0x39 */ {242, 8, 13, 10, 1, -12}, + /* ':' 0x3A */ {255, 2, 10, 5, 1, -9}, + /* ';' 0x3B */ {258, 3, 12, 5, 1, -8}, + /* '<' 0x3C */ {263, 9, 9, 11, 1, -8}, + /* '=' 0x3D */ {274, 9, 4, 11, 1, -5}, + /* '>' 0x3E */ {279, 9, 8, 11, 1, -7}, + /* '?' 0x3F */ {288, 9, 13, 10, 1, -12}, + /* '@' 0x40 */ {303, 17, 16, 18, 1, -12}, + /* 'A' 0x41 */ {337, 12, 13, 12, 0, -12}, + /* 'B' 0x42 */ {357, 11, 13, 12, 1, -12}, + /* 'C' 0x43 */ {375, 11, 13, 13, 1, -12}, + /* 'D' 0x44 */ {393, 11, 13, 13, 1, -12}, + /* 'E' 0x45 */ {411, 9, 13, 11, 1, -12}, + /* 'F' 0x46 */ {426, 8, 13, 11, 1, -12}, + /* 'G' 0x47 */ {439, 12, 13, 14, 1, -12}, + /* 'H' 0x48 */ {459, 11, 13, 13, 1, -12}, + /* 'I' 0x49 */ {477, 2, 13, 5, 2, -12}, + /* 'J' 0x4A */ {481, 7, 13, 10, 1, -12}, + /* 'K' 0x4B */ {493, 10, 13, 12, 1, -12}, + /* 'L' 0x4C */ {510, 8, 13, 10, 1, -12}, + /* 'M' 0x4D */ {523, 13, 13, 15, 1, -12}, + /* 'N' 0x4E */ {545, 11, 13, 13, 1, -12}, + /* 'O' 0x4F */ {563, 13, 13, 14, 1, -12}, + /* 'P' 0x50 */ {585, 10, 13, 12, 1, -12}, + /* 'Q' 0x51 */ {602, 13, 14, 14, 1, -12}, + /* 'R' 0x52 */ {625, 12, 13, 13, 1, -12}, + /* 'S' 0x53 */ {645, 10, 13, 12, 1, -12}, + /* 'T' 0x54 */ {662, 9, 13, 11, 1, -12}, + /* 'U' 0x55 */ {677, 11, 13, 13, 1, -12}, + /* 'V' 0x56 */ {695, 11, 13, 11, 0, -12}, + /* 'W' 0x57 */ {713, 16, 13, 17, 0, -12}, + /* 'X' 0x58 */ {739, 10, 13, 12, 1, -12}, + /* 'Y' 0x59 */ {756, 12, 13, 12, 0, -12}, + /* 'Z' 0x5A */ {776, 10, 13, 11, 1, -12}, + /* '[' 0x5B */ {793, 3, 17, 5, 1, -12}, + /* '\' 0x5C */ {800, 5, 13, 5, 0, -12}, + /* ']' 0x5D */ {809, 3, 17, 5, 0, -12}, + /* '^' 0x5E */ {816, 7, 7, 8, 1, -12}, + /* '_' 0x5F */ {823, 10, 1, 10, 0, 3}, + /* '`' 0x60 */ {825, 4, 3, 5, 0, -12}, + /* 'a' 0x61 */ {827, 9, 10, 10, 1, -9}, + /* 'b' 0x62 */ {839, 9, 13, 10, 1, -12}, + /* 'c' 0x63 */ {854, 8, 10, 9, 1, -9}, + /* 'd' 0x64 */ {864, 8, 13, 10, 1, -12}, + /* 'e' 0x65 */ {877, 8, 10, 10, 1, -9}, + /* 'f' 0x66 */ {887, 4, 13, 5, 1, -12}, + /* 'g' 0x67 */ {894, 8, 14, 10, 1, -9}, + /* 'h' 0x68 */ {908, 8, 13, 10, 1, -12}, + /* 'i' 0x69 */ {921, 2, 13, 4, 1, -12}, + /* 'j' 0x6A */ {925, 4, 17, 4, 0, -12}, + /* 'k' 0x6B */ {934, 8, 13, 9, 1, -12}, + /* 'l' 0x6C */ {947, 2, 13, 4, 1, -12}, + /* 'm' 0x6D */ {951, 13, 10, 15, 1, -9}, + /* 'n' 0x6E */ {968, 8, 10, 10, 1, -9}, + /* 'o' 0x6F */ {978, 8, 10, 10, 1, -9}, + /* 'p' 0x70 */ {988, 9, 13, 10, 1, -9}, + /* 'q' 0x71 */ {1003, 8, 13, 10, 1, -9}, + /* 'r' 0x72 */ {1016, 5, 10, 6, 1, -9}, + /* 's' 0x73 */ {1023, 8, 10, 9, 1, -9}, + /* 't' 0x74 */ {1033, 4, 12, 5, 1, -11}, + /* 'u' 0x75 */ {1039, 8, 10, 10, 1, -9}, + /* 'v' 0x76 */ {1049, 9, 10, 9, 0, -9}, + /* 'w' 0x77 */ {1061, 13, 10, 13, 0, -9}, + /* 'x' 0x78 */ {1078, 7, 10, 9, 1, -9}, + /* 'y' 0x79 */ {1087, 8, 14, 9, 0, -9}, + /* 'z' 0x7A */ {1101, 7, 10, 9, 1, -9}, + /* '{' 0x7B */ {1110, 4, 17, 6, 1, -12}, + /* '|' 0x7C */ {1119, 2, 17, 4, 2, -12}, + /* '}' 0x7D */ {1124, 4, 17, 6, 1, -12}, + /* '~' 0x7E */ {1133, 7, 3, 9, 1, -7}, + /* 0x7F */ {1136, 13, 14, 15, 1, -12}, + /* 0x80 */ {1159, 12, 16, 14, 1, -12}, + /* 0x81 */ {1183, 8, 15, 11, 1, -14}, + /* 0x82 */ {1198, 2, 3, 5, 1, 0}, + /* 0x83 */ {1199, 5, 13, 7, 1, -12}, + /* 0x84 */ {1208, 5, 3, 7, 1, 0}, + /* 0x85 */ {1210, 10, 1, 12, 1, 0}, + /* 0x86 */ {1212, 8, 16, 10, 1, -12}, + /* 0x87 */ {1228, 8, 16, 10, 1, -12}, + /* 0x88 */ {1244, 10, 13, 12, 1, -12}, + /* 0x89 */ {1261, 18, 13, 18, 0, -12}, + /* 0x8A */ {1291, 17, 13, 18, 1, -12}, + /* 0x8B */ {1319, 2, 4, 4, 1, -6}, + /* 0x8C */ {1320, 17, 13, 18, 1, -12}, + /* 0x8D */ {1348, 10, 15, 11, 1, -14}, + /* 0x8E */ {1367, 12, 13, 14, 1, -12}, + /* 0x8F */ {1387, 11, 15, 13, 1, -12}, + /* 0x90 */ {1408, 9, 16, 10, 1, -12}, + /* 0x91 */ {1426, 2, 4, 4, 2, -12}, + /* 0x92 */ {1427, 2, 4, 4, 1, -12}, + /* 0x93 */ {1428, 5, 4, 7, 2, -12}, + /* 0x94 */ {1431, 5, 4, 7, 1, -12}, + /* 0x95 */ {1434, 4, 5, 7, 1, -8}, + /* 0x96 */ {1437, 7, 1, 9, 1, -4}, + /* 0x97 */ {1438, 16, 1, 18, 1, -4}, + /* 0x98 */ {1440, 0, 0, 0, 0, 0}, + /* 0x99 */ {1440, 18, 10, 18, 1, -13}, + /* 0x9A */ {1463, 13, 10, 14, 1, -9}, + /* 0x9B */ {1480, 2, 4, 5, 2, -6}, + /* 0x9C */ {1481, 14, 10, 15, 1, -9}, + /* 0x9D */ {1499, 7, 13, 9, 1, -12}, + /* 0x9E */ {1511, 9, 13, 10, 1, -12}, + /* 0x9F */ {1526, 8, 12, 10, 1, -9}, + /* 0xA0 */ {1538, 0, 0, 5, 0, 0}, + /* 0xA1 */ {1538, 10, 15, 11, 1, -14}, + /* 0xA2 */ {1557, 8, 16, 9, 0, -11}, + /* 0xA3 */ {1573, 7, 13, 10, 1, -12}, + /* 0xA4 */ {1585, 7, 6, 10, 2, -8}, + /* 0xA5 */ {1591, 10, 14, 11, 1, -13}, + /* 0xA6 */ {1609, 2, 17, 5, 2, -12}, + /* 0xA7 */ {1614, 9, 17, 10, 1, -12}, + /* 0xA8 */ {1634, 9, 15, 12, 1, -14}, + /* 0xA9 */ {1651, 14, 13, 14, 1, -12}, + /* 0xAA */ {1674, 11, 13, 13, 1, -12}, + /* 0xAB */ {1692, 7, 6, 9, 1, -7}, + /* 0xAC */ {1698, 9, 5, 11, 2, -5}, + /* 0xAD */ {1704, 0, 0, 0, 0, 0}, + /* 0xAE */ {1704, 14, 13, 14, 1, -12}, + /* 0xAF */ {1727, 6, 15, 5, 0, -14}, + /* 0xB0 */ {1739, 5, 5, 11, 3, -11}, + /* 0xB1 */ {1743, 9, 11, 11, 1, -10}, + /* 0xB2 */ {1756, 2, 13, 4, 1, -12}, + /* 0xB3 */ {1760, 2, 13, 4, 1, -12}, + /* 0xB4 */ {1764, 6, 12, 7, 1, -11}, + /* 0xB5 */ {1773, 9, 13, 10, 1, -9}, + /* 0xB6 */ {1788, 8, 16, 10, 2, -12}, + /* 0xB7 */ {1804, 3, 1, 5, 1, -4}, + /* 0xB8 */ {1805, 8, 12, 10, 1, -11}, + /* 0xB9 */ {1817, 15, 13, 17, 1, -12}, + /* 0xBA */ {1842, 8, 10, 9, 1, -9}, + /* 0xBB */ {1852, 7, 6, 9, 1, -7}, + /* 0xBC */ {1858, 4, 17, 4, 0, -12}, + /* 0xBD */ {1867, 10, 13, 12, 1, -12}, + /* 0xBE */ {1884, 8, 10, 9, 1, -9}, + /* 0xBF */ {1894, 6, 12, 5, -1, -11}, + /* 0xC0 */ {1903, 12, 13, 12, 0, -12}, + /* 0xC1 */ {1923, 11, 13, 12, 1, -12}, + /* 0xC2 */ {1941, 11, 13, 12, 1, -12}, + /* 0xC3 */ {1959, 8, 13, 8, 1, -12}, + /* 0xC4 */ {1972, 14, 16, 15, 1, -12}, + /* 0xC5 */ {2000, 9, 13, 12, 1, -12}, + /* 0xC6 */ {2015, 16, 13, 16, 0, -12}, + /* 0xC7 */ {2041, 10, 13, 12, 1, -12}, + /* 0xC8 */ {2058, 11, 13, 13, 1, -12}, + /* 0xC9 */ {2076, 11, 16, 13, 1, -15}, + /* 0xCA */ {2098, 10, 13, 11, 1, -12}, + /* 0xCB */ {2115, 10, 13, 12, 1, -12}, + /* 0xCC */ {2132, 13, 13, 15, 1, -12}, + /* 0xCD */ {2154, 11, 13, 13, 1, -12}, + /* 0xCE */ {2172, 13, 13, 14, 1, -12}, + /* 0xCF */ {2194, 11, 13, 13, 1, -12}, + /* 0xD0 */ {2212, 10, 13, 12, 1, -12}, + /* 0xD1 */ {2229, 11, 13, 13, 1, -12}, + /* 0xD2 */ {2247, 9, 13, 11, 1, -12}, + /* 0xD3 */ {2262, 10, 13, 11, 1, -12}, + /* 0xD4 */ {2279, 14, 13, 15, 1, -12}, + /* 0xD5 */ {2302, 10, 13, 12, 1, -12}, + /* 0xD6 */ {2319, 13, 15, 13, 1, -12}, + /* 0xD7 */ {2344, 9, 13, 11, 1, -12}, + /* 0xD8 */ {2359, 13, 13, 15, 1, -12}, + /* 0xD9 */ {2381, 15, 15, 15, 1, -12}, + /* 0xDA */ {2410, 13, 13, 15, 2, -12}, + /* 0xDB */ {2432, 14, 13, 16, 1, -12}, + /* 0xDC */ {2455, 11, 13, 12, 1, -12}, + /* 0xDD */ {2473, 11, 13, 13, 1, -12}, + /* 0xDE */ {2491, 17, 13, 18, 1, -12}, + /* 0xDF */ {2519, 10, 13, 12, 1, -12}, + /* 0xE0 */ {2536, 9, 10, 10, 1, -9}, + /* 0xE1 */ {2548, 8, 14, 10, 1, -13}, + /* 0xE2 */ {2562, 7, 10, 9, 1, -9}, + /* 0xE3 */ {2571, 5, 10, 7, 1, -9}, + /* 0xE4 */ {2578, 11, 12, 10, 0, -9}, + /* 0xE5 */ {2595, 8, 10, 10, 1, -9}, + /* 0xE6 */ {2605, 12, 10, 14, 1, -9}, + /* 0xE7 */ {2620, 7, 10, 9, 1, -9}, + /* 0xE8 */ {2629, 8, 10, 10, 1, -9}, + /* 0xE9 */ {2639, 8, 12, 10, 1, -11}, + /* 0xEA */ {2651, 7, 10, 9, 1, -9}, + /* 0xEB */ {2660, 7, 10, 8, 0, -9}, + /* 0xEC */ {2669, 9, 10, 11, 1, -9}, + /* 0xED */ {2681, 8, 10, 10, 1, -9}, + /* 0xEE */ {2691, 8, 10, 10, 1, -9}, + /* 0xEF */ {2701, 8, 10, 10, 1, -9}, + /* 0xF0 */ {2711, 9, 13, 10, 1, -9}, + /* 0xF1 */ {2726, 8, 10, 9, 1, -9}, + /* 0xF2 */ {2736, 6, 10, 7, 1, -9}, + /* 0xF3 */ {2744, 8, 14, 9, 0, -9}, + /* 0xF4 */ {2758, 14, 15, 15, 1, -11}, + /* 0xF5 */ {2785, 7, 10, 9, 1, -9}, + /* 0xF6 */ {2794, 10, 12, 10, 1, -9}, + /* 0xF7 */ {2809, 7, 10, 9, 1, -9}, + /* 0xF8 */ {2818, 10, 10, 12, 1, -9}, + /* 0xF9 */ {2831, 12, 12, 13, 1, -9}, + /* 0xFA */ {2849, 9, 10, 12, 2, -9}, + /* 0xFB */ {2861, 10, 10, 12, 1, -9}, + /* 0xFC */ {2874, 8, 10, 9, 1, -9}, + /* 0xFD */ {2884, 8, 10, 9, 1, -9}, + /* 0xFE */ {2894, 12, 10, 13, 1, -9}, + /* 0xFF */ {2909, 8, 10, 10, 1, -9}, +}; + +const GFXfont FreeSans9pt_Win1251 PROGMEM = {(uint8_t *)FreeSans9pt_Win1251Bitmaps, (GFXglyph *)FreeSans9pt_Win1251Glyphs, 0x20, + 0xFF, 21}; diff --git a/src/graphics/niche/Fonts/FreeSans9pt_Win1252.h b/src/graphics/niche/Fonts/FreeSans9pt_Win1252.h new file mode 100644 index 000000000..20f2ddc2f --- /dev/null +++ b/src/graphics/niche/Fonts/FreeSans9pt_Win1252.h @@ -0,0 +1,494 @@ +#pragma once +const uint8_t FreeSans9pt_Win1252Bitmaps[] PROGMEM = { + /* ' ' 0x20 */ + 0xFF, 0xFF, 0xF0, 0xC0, /* '!' 0x21 */ + 0xDE, 0xF7, 0x20, /* '"' 0x22 */ + 0x09, 0x86, 0x41, 0x91, 0xFF, 0x13, 0x04, 0xC3, 0x20, 0xC8, 0xFF, 0x89, 0x82, 0x61, 0x90, /* '#' 0x23 */ + 0x10, 0x1F, 0x14, 0xDA, 0x3D, 0x1E, 0x83, 0x40, 0x78, 0x17, 0x08, 0xF4, 0x7A, 0x35, 0x33, 0xF0, 0x40, 0x20, /* '$' 0x24 */ + 0x38, 0x10, 0xEC, 0x20, 0xC6, 0x20, 0xC6, 0x40, 0xC6, 0x40, 0x6C, 0x80, 0x39, 0x00, 0x01, 0x3C, 0x02, 0x77, 0x02, 0x63, 0x04, + 0x63, 0x04, 0x77, 0x08, 0x3C, /* '%' 0x25 */ + 0x0E, 0x0C, 0xC3, 0x30, 0xCC, 0x1E, 0x03, 0x03, 0xC1, 0x9B, 0xC2, 0xF0, 0xEC, 0x19, 0x8F, 0x3C, 0x40, /* '&' 0x26 */ + 0xFE, /* ''' 0x27 */ + 0x13, 0x26, 0x6C, 0xCC, 0xCC, 0xC4, 0x66, 0x23, 0x10, /* '(' 0x28 */ + 0x8C, 0x46, 0x63, 0x33, 0x33, 0x32, 0x66, 0x4C, 0x80, /* ')' 0x29 */ + 0x25, 0x7E, 0xA5, 0x00, /* '*' 0x2A */ + 0x30, 0xC3, 0x3F, 0x30, 0xC3, 0x0C, /* '+' 0x2B */ + 0xD6, /* ',' 0x2C */ + 0xF0, /* '-' 0x2D */ + 0xC0, /* '.' 0x2E */ + 0x08, 0x44, 0x21, 0x10, 0x84, 0x42, 0x11, 0x08, 0x00, /* '/' 0x2F */ + 0x3C, 0x66, 0x42, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x42, 0x66, 0x3C, /* '0' 0x30 */ + 0x11, 0x3F, 0x33, 0x33, 0x33, 0x33, 0x30, /* '1' 0x31 */ + 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x1C, 0x1C, 0x1C, 0x18, 0x18, 0x10, 0x08, 0x07, 0xF8, /* '2' 0x32 */ + 0x3C, 0x66, 0xC3, 0xC3, 0x03, 0x06, 0x1C, 0x07, 0x03, 0xC3, 0xC3, 0x66, 0x3C, /* '3' 0x33 */ + 0x0C, 0x18, 0x71, 0x62, 0xC9, 0xA3, 0x46, 0xFE, 0x18, 0x30, 0x60, 0xC0, /* '4' 0x34 */ + 0x7F, 0x20, 0x10, 0x08, 0x08, 0x07, 0xF3, 0x8C, 0x03, 0x01, 0x80, 0xF0, 0x6C, 0x63, 0xE0, /* '5' 0x35 */ + 0x1E, 0x31, 0x98, 0x78, 0x0C, 0x06, 0xF3, 0x8D, 0x83, 0xC1, 0xE0, 0xD0, 0x6C, 0x63, 0xE0, /* '6' 0x36 */ + 0xFF, 0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x18, 0x18, 0x18, 0x10, 0x30, 0x30, /* '7' 0x37 */ + 0x3E, 0x31, 0xB0, 0x78, 0x3C, 0x1B, 0x18, 0xF8, 0xC6, 0xC1, 0xE0, 0xF0, 0x6C, 0x63, 0xE0, /* '8' 0x38 */ + 0x3C, 0x66, 0xC2, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0xC2, 0x66, 0x3C, /* '9' 0x39 */ + 0xC0, 0x00, 0x30, /* ':' 0x3A */ + 0xC0, 0x00, 0x00, 0x64, 0xA0, /* ';' 0x3B */ + 0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x07, 0x80, 0x70, 0x0E, 0x01, 0x80, /* '<' 0x3C */ + 0xFF, 0x80, 0x00, 0x1F, 0xF0, /* '=' 0x3D */ + 0xE0, 0x1C, 0x03, 0x80, 0x30, 0x70, 0xE3, 0x81, 0x00, /* '>' 0x3E */ + 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x18, 0x38, 0x18, 0x18, 0x0C, 0x00, 0x00, 0x01, 0x80, /* '?' 0x3F */ + 0x03, 0xF0, 0x06, 0x0E, 0x06, 0x01, 0x86, 0x00, 0x66, 0x1D, 0xBB, 0x31, 0xCF, 0x18, 0xC7, 0x98, 0x63, 0xCC, 0x31, 0xE6, 0x11, + 0xB3, 0x99, 0xCC, 0xF7, 0x86, 0x00, 0x01, 0x80, 0x00, 0x70, 0x40, 0x0F, 0xE0, /* '@' 0x40 */ + 0x06, 0x00, 0xF0, 0x0F, 0x00, 0x90, 0x19, 0x81, 0x98, 0x10, 0x83, 0x0C, 0x3F, 0xC2, 0x04, 0x60, 0x66, 0x06, 0xC0, + 0x30, /* 'A' 0x41 */ + 0xFF, 0x18, 0x33, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x3F, 0xC6, 0x06, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, /* 'B' 0x42 */ + 0x1F, 0x86, 0x19, 0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6C, 0x0D, 0x81, 0x10, 0x63, 0x0C, 0x61, 0x04, 0x60, 0xCC, 0x19, 0x01, 0x60, 0x3C, 0x07, 0x00, 0x60, /* 'V' 0x56 */ + 0xC1, 0x81, 0x61, 0xC3, 0x61, 0xC3, 0x61, 0x43, 0x62, 0x62, 0x22, 0x66, 0x32, 0x26, 0x36, 0x26, 0x14, 0x34, 0x14, 0x34, 0x1C, + 0x1C, 0x18, 0x1C, 0x08, 0x18, /* 'W' 0x57 */ + 0xC0, 0xD8, 0x66, 0x18, 0xCC, 0x1E, 0x07, 0x00, 0xC0, 0x78, 0x32, 0x0C, 0xC6, 0x1B, 0x07, 0xC0, 0xC0, /* 'X' 0x58 */ + 0xC0, 0x36, 0x06, 0x30, 0xC3, 0x0C, 0x19, 0x81, 0xD8, 0x0F, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, + 0x00, /* 'Y' 0x59 */ + 0xFF, 0xC0, 0x60, 0x30, 0x0C, 0x06, 0x03, 0x01, 0xC0, 0x60, 0x30, 0x18, 0x06, 0x03, 0x00, 0xFF, 0xC0, /* 'Z' 0x5A */ + 0xFB, 0x6D, 0xB6, 0xDB, 0x6D, 0xB6, 0xE0, /* '[' 0x5B */ + 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x80, /* '\' 0x5C */ + 0xED, 0xB6, 0xDB, 0x6D, 0xB6, 0xDB, 0xE0, /* ']' 0x5D */ + 0x30, 0x60, 0xA2, 0x44, 0xD8, 0xA1, 0x80, /* '^' 0x5E */ + 0xFF, 0xC0, /* '_' 0x5F */ + 0xC6, 0x30, /* '`' 0x60 */ + 0x7E, 0x71, 0xB0, 0xC0, 0x60, 0xF3, 0xDB, 0x0D, 0x86, 0xC7, 0x3D, 0xC0, /* 'a' 0x61 */ + 0xC0, 0x60, 0x30, 0x1B, 0xCE, 0x36, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x6D, 0xE0, /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6F, 0x30, 0x18, 0x0C, 0x00, /* 'p' 0x70 */ + 0x3B, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0x03, /* 'q' 0x71 */ + 0xDF, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0x00, /* 'r' 0x72 */ + 0x3E, 0xE3, 0xC0, 0xC0, 0xE0, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, /* 's' 0x73 */ + 0x66, 0xF6, 0x66, 0x66, 0x66, 0x67, /* 't' 0x74 */ + 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 'u' 0x75 */ + 0xC1, 0xA0, 0x98, 0xCC, 0x42, 0x21, 0xB0, 0xD0, 0x28, 0x1C, 0x0C, 0x00, /* 'v' 0x76 */ + 0xC6, 0x1E, 0x38, 0x91, 0xC4, 0xCA, 0x66, 0xD3, 0x16, 0xD0, 0xA6, 0x87, 0x1C, 0x38, 0xC0, 0xC6, 0x00, /* 'w' 0x77 */ + 0x87, 0x89, 0xB1, 0xC3, 0x07, 0x1E, 0x26, 0xC5, 0x0C, /* 'x' 0x78 */ + 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, /* 'y' 0x79 */ + 0xFE, 0x0C, 0x30, 0xC1, 0x86, 0x18, 0x20, 0xC1, 0xFC, /* 'z' 0x7A */ + 0x36, 0x66, 0x66, 0x6E, 0xCE, 0x66, 0x66, 0x66, 0x30, /* '{' 0x7B */ + 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, /* '|' 0x7C */ + 0xC6, 0x66, 0x66, 0x67, 0x37, 0x66, 0x66, 0x66, 0xC0, /* '}' 0x7D */ + 0x61, 0x24, 0x38, /* '~' 0x7E */ + 0xFF, 0xFC, 0x00, 0x63, 0xE3, 0x31, 0x99, 0x04, 0xC8, 0x66, 0x06, 0x30, 0x61, 0x83, 0x0C, 0x18, 0x60, 0x03, 0x06, 0x18, 0x00, + 0xFF, 0xFC, /* 0x7F */ + 0x07, 0xC6, 0x13, 0x00, 0xC0, 0x60, 0x3F, 0xE6, 0x03, 0xFC, 0x60, 0x0C, 0x03, 0x00, 0x61, 0x07, 0xC0, /* 0x80 */ + /* 0x81 */ + 0xDC, /* 0x82 */ + 0x19, 0x8C, 0xF3, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0xE0, /* 0x83 */ + 0xDA, 0x76, /* 0x84 */ + 0xCC, 0xC0, /* 0x85 */ + 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 0x86 */ + 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, /* 0x87 */ + 0x72, 0xA2, /* 0x88 */ + 0x70, 0x80, 0x22, 0x20, 0x08, 0x90, 0x02, 0x24, 0x00, 0x72, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x10, 0x00, 0x09, 0xC7, 0x84, + 0x8B, 0x31, 0x22, 0x84, 0x88, 0xB3, 0x21, 0xC7, 0x80, /* 0x89 */ + 0x1B, 0x03, 0x80, 0x00, 0xFC, 0x61, 0xB0, 0x3C, 0x0F, 0x00, 0x78, 0x07, 0xC0, 0x38, 0x03, 0xC0, 0xF0, 0x36, 0x18, + 0xFC, /* 0x8A */ + 0x69, /* 0x8B */ + 0x1E, 0xFE, 0x43, 0x81, 0x83, 0x06, 0x06, 0x0C, 0x0C, 0x18, 0x18, 0x30, 0x3F, 0xE0, 0x60, 0xC0, 0xC1, 0x81, 0x81, 0x83, 0x01, + 0x8E, 0x01, 0xEF, 0xE0, /* 0x8C */ + /* 0x8D */ + 0x1B, 0x03, 0x80, 0x03, 0xFF, 0x01, 0x80, 0xC0, 0x30, 0x18, 0x0C, 0x07, 0x01, 0x80, 0xC0, 0x60, 0x18, 0x0C, 0x03, + 0xFF, /* 0x8E */ + /* 0x8F */ + /* 0x90 */ + 0x6B, /* 0x91 */ + 0xD6, /* 0x92 */ + 0x4C, 0xA5, 0xB0, /* 0x93 */ + 0xDA, 0x53, 0x20, /* 0x94 */ + 0x6F, 0xFF, 0x60, /* 0x95 */ + 0xFE, /* 0x96 */ + 0xFF, 0xFF, /* 0x97 */ + 0x4D, 0xC0, /* 0x98 */ + 0xFC, 0xE1, 0xCC, 0x38, 0x73, 0x0E, 0x1C, 0xC3, 0x8F, 0x30, 0xD2, 0xCC, 0x34, 0xB3, 0x0D, 0x6C, 0xC3, 0x53, 0x30, 0xCC, 0xCC, + 0x33, 0x30, /* 0x99 */ + 0x24, 0x3C, 0x18, 0x7E, 0xE3, 0xC0, 0xC0, 0x60, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, /* 0x9A */ + 0x96, /* 0x9B */ + 0x3C, 0xF8, 0xCF, 0x1B, 0x0C, 0x1E, 0x18, 0x3C, 0x3F, 0xF8, 0x60, 0x30, 0xC0, 0x61, 0x83, 0x67, 0x8C, 0x79, 0xF0, /* 0x9C */ + /* 0x9D */ + 0x48, 0xF0, 0xC7, 0xF0, 0x61, 0x86, 0x0C, 0x30, 0xC1, 0x06, 0x0F, 0xE0, /* 0x9E */ + 0x19, 0x80, 0x00, 0xC0, 0x36, 0x06, 0x30, 0xC3, 0x0C, 0x19, 0x81, 0xD8, 0x0F, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, + 0x60, /* 0x9F */ + /* 0xA0 */ + 0xCF, 0xFF, 0xFF, 0xC0, /* 0xA1 */ + 0x08, 0x04, 0x0F, 0x8D, 0x6C, 0x9E, 0x43, 0x21, 0x90, 0xC8, 0x64, 0xDA, 0xC7, 0xC0, 0x80, 0x40, /* 0xA2 */ + 0x1F, 0x0C, 0x66, 0x0D, 0x83, 0x60, 0x0C, 0x0F, 0xC0, 0x60, 0x18, 0x06, 0x03, 0x01, 0xF1, 0x43, 0xC0, /* 0xA3 */ + 0xFF, 0xDF, 0x1E, 0x3E, 0xFF, 0xC0, /* 0xA4 */ + 0xC3, 0x42, 0x42, 0x24, 0x24, 0x3C, 0x18, 0x7E, 0x18, 0x7E, 0x18, 0x18, 0x18, /* 0xA5 */ + 0xFF, 0xFC, 0x0F, 0xFF, 0xC0, /* 0xA6 */ + 0x0C, 0x09, 0x0C, 0xC6, 0x63, 0x81, 0xE3, 0x19, 0x87, 0xE1, 0xB8, 0xC6, 0x41, 0xC0, 0x73, 0x19, 0x8C, 0x66, 0x1E, + 0x00, /* 0xA7 */ + 0xCC, /* 0xA8 */ + 0x0F, 0xC0, 0x61, 0x87, 0x03, 0x9B, 0xC6, 0xD9, 0x8F, 0x60, 0x3D, 0x00, 0xF4, 0x03, 0xD8, 0x0D, 0xE6, 0x67, 0xF3, 0x86, 0x18, + 0x0F, 0xC0, /* 0xA9 */ + 0x74, 0x8D, 0xA9, 0x7C, 0x1F, /* 0xAA */ + 0x22, 0xCF, 0x26, 0x46, 0x64, 0x40, /* 0xAB */ + 0xFF, 0x80, 0xC0, 0x60, 0x30, 0x18, /* 0xAC */ + /* 0xAD */ + 0x0F, 0xC0, 0x61, 0x87, 0x03, 0x9F, 0xE6, 0xD0, 0x8F, 0x42, 0x3D, 0xF0, 0xF4, 0x23, 0xD0, 0x8D, 0xC2, 0x67, 0x0B, 0x86, 0x18, + 0x0F, 0xC0, /* 0xAE */ + 0xF8, /* 0xAF */ + 0x74, 0x63, 0x17, 0x00, /* 0xB0 */ + 0x0C, 0x06, 0x03, 0x07, 0xE0, 0xC0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x3F, 0xE0, /* 0xB1 */ + 0x7B, 0x30, 0xC3, 0x11, 0x84, 0x3F, /* 0xB2 */ + 0x7D, 0x8C, 0x18, 0xC0, 0x60, 0xF1, 0xBE, /* 0xB3 */ + 0x36, 0xC0, /* 0xB4 */ + 0xC3, 0x61, 0xB0, 0xD8, 0x6C, 0x36, 0x1B, 0x0D, 0x86, 0xE7, 0x7D, 0xF0, 0x18, 0x0C, 0x00, /* 0xB5 */ + 0x3F, 0x7E, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0x72, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, /* 0xB6 */ + 0xE0, /* 0xB7 */ + 0x21, 0xC7, 0xE0, /* 0xB8 */ + 0x3D, 0xB6, 0xD8, /* 0xB9 */ + 0x74, 0x63, 0x18, 0xB8, 0x1F, /* 0xBA */ + 0x89, 0x98, 0x99, 0x3C, 0xD1, 0x00, /* 0xBB */ + 0x20, 0x43, 0x81, 0x06, 0x08, 0x18, 0x20, 0x61, 0x01, 0x84, 0x06, 0x21, 0x80, 0x86, 0x04, 0x78, 0x32, 0x60, 0x87, 0xC4, 0x06, + 0x10, 0x18, /* 0xBC */ + 0x20, 0x43, 0x81, 0x06, 0x08, 0x18, 0x20, 0x61, 0x01, 0x8D, 0xE6, 0x2C, 0xC1, 0x03, 0x0C, 0x0C, 0x20, 0x41, 0x86, 0x0C, 0x30, + 0x20, 0xFC, /* 0xBD */ + 0x78, 0x11, 0x98, 0x40, 0x31, 0x00, 0x82, 0x00, 0xC8, 0x01, 0x90, 0x33, 0x43, 0x3D, 0x06, 0x02, 0x3C, 0x08, 0x98, 0x10, 0xF8, + 0x40, 0x61, 0x00, 0xC0, /* 0xBE */ + 0x0C, 0x00, 0x00, 0x01, 0x80, 0xC0, 0xC0, 0xE0, 0xC0, 0xC0, 0x60, 0xF0, 0x6C, 0x63, 0xE0, /* 0xBF */ + 0x18, 0x03, 0x00, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC0 */ + 0x06, 0x03, 0x00, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC1 */ + 0x0C, 0x04, 0x80, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC2 */ + 0x19, 0x09, 0x80, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC3 */ + 0x33, 0x00, 0x00, 0xC0, 0x78, 0x1E, 0x04, 0x83, 0x30, 0xCC, 0x33, 0x1F, 0xE6, 0x19, 0x02, 0xC0, 0xF0, 0x30, /* 0xC4 */ + 0x0C, 0x04, 0x81, 0x20, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC5 */ + 0x07, 0xFF, 0x04, 0xC0, 0x0C, 0xC0, 0x08, 0xC0, 0x18, 0xC0, 0x18, 0xC0, 0x30, 0xFF, 0x30, 0xC0, 0x3F, 0xC0, 0x60, 0xC0, 0x60, + 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, /* 0xC6 */ + 0x1F, 0x06, 0x19, 0x83, 0xA0, 0x3C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0xE1, 0xF0, 0x08, 0x01, 0xC0, + 0x18, 0x0E, 0x00, /* 0xC7 */ + 0x18, 0x06, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, /* 0xC8 */ + 0x0C, 0x0C, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, /* 0xC9 */ + 0x1C, 0x1B, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, /* 0xCA */ + 0x33, 0x00, 0x3F, 0xF8, 0x0C, 0x06, 0x03, 0x01, 0xFE, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, /* 0xCB */ + 0xCC, 0x36, 0xDB, 0x6D, 0xB6, 0xD8, /* 0xCC */ + 0x78, 0x36, 0xDB, 0x6D, 0xB6, 0xC0, /* 0xCD */ + 0x76, 0xC0, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18, /* 0xCE */ + 0xCC, 0x03, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC0, /* 0xCF */ + 0x7F, 0x0C, 0x31, 0x83, 0x30, 0x36, 0x06, 0xC0, 0xFE, 0x1B, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x30, 0xE7, 0xF0, /* 0xD0 */ + 0x19, 0x02, 0xC3, 0x81, 0xF0, 0x3F, 0x07, 0xA0, 0xF6, 0x1E, 0x63, 0xC4, 0x78, 0xCF, 0x0D, 0xE1, 0xBC, 0x1F, 0x81, + 0xC0, /* 0xD1 */ + 0x0C, 0x00, 0x60, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, + 0x0F, 0x00, /* 0xD2 */ + 0x03, 0x00, 0x60, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, + 0x0F, 0x00, /* 0xD3 */ + 0x0F, 0x01, 0x98, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, + 0x0F, 0x00, /* 0xD4 */ + 0x1C, 0x81, 0x38, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, + 0x0F, 0x00, /* 0xD5 */ + 0x19, 0x81, 0x98, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, + 0x0F, 0x00, /* 0xD6 */ + 0x83, 0x89, 0xA1, 0x83, 0x89, 0xA1, 0x80, /* 0xD7 */ + 0x0F, 0xD9, 0x83, 0x18, 0x1C, 0xC1, 0xEC, 0x19, 0xE0, 0x8F, 0x08, 0x78, 0x83, 0xC8, 0x1B, 0x81, 0x98, 0x0C, 0xE0, 0xC8, 0xF8, + 0x00, /* 0xD8 */ + 0x0C, 0x00, 0xC3, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, + 0x00, /* 0xD9 */ + 0x06, 0x01, 0x83, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, + 0x00, /* 0xDA */ + 0x0E, 0x03, 0x63, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, + 0x00, /* 0xDB */ + 0x1B, 0x00, 0x03, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, + 0x00, /* 0xDC */ + 0x03, 0x0C, 0x63, 0x60, 0x63, 0x0C, 0x30, 0xC1, 0x98, 0x1D, 0x80, 0xF0, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, + 0x60, /* 0xDD */ + 0xC0, 0x30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, 0xC3, 0x66, 0x3C, /* 0xF6 */ + 0x18, 0x00, 0x00, 0x1F, 0xF0, 0x00, 0x00, 0x00, 0x30, /* 0xF7 */ + 0x3D, 0x66, 0xC7, 0xCB, 0xCB, 0xD3, 0xD3, 0xE3, 0x66, 0xBC, /* 0xF8 */ + 0x60, 0x30, 0x18, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 0xF9 */ + 0x06, 0x0C, 0x18, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 0xFA */ + 0x3C, 0x66, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 0xFB */ + 0x66, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 0xFC */ + 0x06, 0x04, 0x08, 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, /* 0xFD */ + 0xC0, 0x60, 0x30, 0x1B, 0xCE, 0x36, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x6D, 0xE6, 0x03, 0x01, 0x80, /* 0xFE */ + 0x33, 0x00, 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, /* 0xFF */ +}; + +const GFXglyph FreeSans9pt_Win1252Glyphs[] PROGMEM = { + /* ' ' 0x20 */ {0, 0, 0, 5, 0, 0}, + /* '!' 0x21 */ {0, 2, 13, 6, 2, -12}, + /* '"' 0x22 */ {4, 5, 4, 6, 1, -12}, + /* '#' 0x23 */ {7, 10, 12, 10, 0, -11}, + /* '$' 0x24 */ {22, 9, 16, 10, 1, -13}, + /* '%' 0x25 */ {40, 16, 13, 16, 1, -12}, + /* '&' 0x26 */ {66, 10, 13, 12, 1, -12}, + /* ''' 0x27 */ {83, 2, 4, 4, 1, -12}, + /* '(' 0x28 */ {84, 4, 17, 6, 1, -12}, + /* ')' 0x29 */ {93, 4, 17, 6, 1, -12}, + /* '*' 0x2A */ {102, 5, 5, 7, 1, -12}, + /* '+' 0x2B */ {106, 6, 8, 11, 3, -7}, + /* ',' 0x2C */ {112, 2, 4, 5, 2, 0}, + /* '-' 0x2D */ {113, 4, 1, 6, 1, -4}, + /* '.' 0x2E */ {114, 2, 1, 5, 1, 0}, + /* '/' 0x2F */ {115, 5, 13, 5, 0, -12}, + /* '0' 0x30 */ {124, 8, 13, 10, 1, -12}, + /* '1' 0x31 */ {137, 4, 13, 10, 3, -12}, + /* '2' 0x32 */ {144, 9, 13, 10, 1, -12}, + /* '3' 0x33 */ {159, 8, 13, 10, 1, -12}, + /* '4' 0x34 */ {172, 7, 13, 10, 2, -12}, + /* '5' 0x35 */ {184, 9, 13, 10, 1, -12}, + /* '6' 0x36 */ {199, 9, 13, 10, 1, -12}, + /* '7' 0x37 */ {214, 8, 13, 10, 0, -12}, + /* '8' 0x38 */ {227, 9, 13, 10, 1, -12}, + /* '9' 0x39 */ {242, 8, 13, 10, 1, -12}, + /* ':' 0x3A */ {255, 2, 10, 5, 1, -9}, + /* ';' 0x3B */ {258, 3, 12, 5, 1, -8}, + /* '<' 0x3C */ {263, 9, 9, 11, 1, -8}, + /* '=' 0x3D */ {274, 9, 4, 11, 1, -5}, + /* '>' 0x3E */ {279, 9, 8, 11, 1, -7}, + /* '?' 0x3F */ {288, 9, 13, 10, 1, -12}, + /* '@' 0x40 */ {303, 17, 16, 18, 1, -12}, + /* 'A' 0x41 */ {337, 12, 13, 12, 0, -12}, + /* 'B' 0x42 */ {357, 11, 13, 12, 1, -12}, + /* 'C' 0x43 */ {375, 11, 13, 13, 1, -12}, + /* 'D' 0x44 */ {393, 11, 13, 13, 1, -12}, + /* 'E' 0x45 */ {411, 9, 13, 11, 1, -12}, + /* 'F' 0x46 */ {426, 8, 13, 11, 1, -12}, + /* 'G' 0x47 */ {439, 12, 13, 14, 1, -12}, + /* 'H' 0x48 */ {459, 11, 13, 13, 1, -12}, + /* 'I' 0x49 */ {477, 2, 13, 5, 2, -12}, + /* 'J' 0x4A */ {481, 7, 13, 10, 1, -12}, + /* 'K' 0x4B */ {493, 10, 13, 12, 1, -12}, + /* 'L' 0x4C */ {510, 8, 13, 10, 1, -12}, + /* 'M' 0x4D */ {523, 13, 13, 15, 1, -12}, + /* 'N' 0x4E */ {545, 11, 13, 13, 1, -12}, + /* 'O' 0x4F */ {563, 13, 13, 14, 1, -12}, + /* 'P' 0x50 */ {585, 10, 13, 12, 1, -12}, + /* 'Q' 0x51 */ {602, 13, 14, 14, 1, -12}, + /* 'R' 0x52 */ {625, 12, 13, 13, 1, -12}, + /* 'S' 0x53 */ {645, 10, 13, 12, 1, -12}, + /* 'T' 0x54 */ {662, 9, 13, 11, 1, -12}, + /* 'U' 0x55 */ {677, 11, 13, 13, 1, -12}, + /* 'V' 0x56 */ {695, 11, 13, 11, 0, -12}, + /* 'W' 0x57 */ {713, 16, 13, 17, 0, -12}, + /* 'X' 0x58 */ {739, 10, 13, 12, 1, -12}, + /* 'Y' 0x59 */ {756, 12, 13, 12, 0, -12}, + /* 'Z' 0x5A */ {776, 10, 13, 11, 1, -12}, + /* '[' 0x5B */ {793, 3, 17, 5, 1, -12}, + /* '\' 0x5C */ {800, 5, 13, 5, 0, -12}, + /* ']' 0x5D */ {809, 3, 17, 5, 0, -12}, + /* '^' 0x5E */ {816, 7, 7, 8, 1, -12}, + /* '_' 0x5F */ {823, 10, 1, 10, 0, 3}, + /* '`' 0x60 */ {825, 4, 3, 5, 0, -12}, + /* 'a' 0x61 */ {827, 9, 10, 10, 1, -9}, + /* 'b' 0x62 */ {839, 9, 13, 10, 1, -12}, + /* 'c' 0x63 */ {854, 8, 10, 9, 1, -9}, + /* 'd' 0x64 */ {864, 8, 13, 10, 1, -12}, + /* 'e' 0x65 */ {877, 8, 10, 10, 1, -9}, + /* 'f' 0x66 */ {887, 4, 13, 5, 1, -12}, + /* 'g' 0x67 */ {894, 8, 14, 10, 1, -9}, + /* 'h' 0x68 */ {908, 8, 13, 10, 1, -12}, + /* 'i' 0x69 */ {921, 2, 13, 4, 1, -12}, + /* 'j' 0x6A */ {925, 4, 17, 4, 0, -12}, + /* 'k' 0x6B */ {934, 8, 13, 9, 1, -12}, + /* 'l' 0x6C */ {947, 2, 13, 4, 1, -12}, + /* 'm' 0x6D */ {951, 13, 10, 15, 1, -9}, + /* 'n' 0x6E */ {968, 8, 10, 10, 1, -9}, + /* 'o' 0x6F */ {978, 8, 10, 10, 1, -9}, + /* 'p' 0x70 */ {988, 9, 13, 10, 1, -9}, + /* 'q' 0x71 */ {1003, 8, 13, 10, 1, -9}, + /* 'r' 0x72 */ {1016, 5, 10, 6, 1, -9}, + /* 's' 0x73 */ {1023, 8, 10, 9, 1, -9}, + /* 't' 0x74 */ {1033, 4, 12, 5, 1, -11}, + /* 'u' 0x75 */ {1039, 8, 10, 10, 1, -9}, + /* 'v' 0x76 */ {1049, 9, 10, 9, 0, -9}, + /* 'w' 0x77 */ {1061, 13, 10, 13, 0, -9}, + /* 'x' 0x78 */ {1078, 7, 10, 9, 1, -9}, + /* 'y' 0x79 */ {1087, 8, 14, 9, 0, -9}, + /* 'z' 0x7A */ {1101, 7, 10, 9, 1, -9}, + /* '{' 0x7B */ {1110, 4, 17, 6, 1, -12}, + /* '|' 0x7C */ {1119, 2, 17, 4, 2, -12}, + /* '}' 0x7D */ {1124, 4, 17, 6, 1, -12}, + /* '~' 0x7E */ {1133, 7, 3, 9, 1, -7}, + /* 0x7F */ {1136, 13, 14, 15, 1, -12}, + /* 0x80 */ {1159, 10, 13, 12, 1, -12}, + /* 0x81 */ {1176, 0, 0, 8, 0, 0}, + /* 0x82 */ {1176, 2, 3, 5, 1, 0}, + /* 0x83 */ {1177, 5, 17, 5, 0, -12}, + /* 0x84 */ {1188, 5, 3, 7, 1, 0}, + /* 0x85 */ {1190, 10, 1, 12, 1, 0}, + /* 0x86 */ {1192, 8, 16, 10, 1, -12}, + /* 0x87 */ {1208, 8, 16, 10, 1, -12}, + /* 0x88 */ {1224, 5, 3, 6, 0, -12}, + /* 0x89 */ {1226, 18, 13, 18, 0, -12}, + /* 0x8A */ {1256, 10, 16, 12, 1, -15}, + /* 0x8B */ {1276, 2, 4, 4, 1, -6}, + /* 0x8C */ {1277, 15, 13, 18, 1, -12}, + /* 0x8D */ {1302, 0, 0, 8, 0, 0}, + /* 0x8E */ {1302, 10, 16, 11, 1, -15}, + /* 0x8F */ {1322, 0, 0, 8, 0, 0}, + /* 0x90 */ {1322, 0, 0, 8, 0, 0}, + /* 0x91 */ {1322, 2, 4, 4, 2, -12}, + /* 0x92 */ {1323, 2, 4, 4, 1, -12}, + /* 0x93 */ {1324, 5, 4, 7, 2, -12}, + /* 0x94 */ {1327, 5, 4, 7, 1, -12}, + /* 0x95 */ {1330, 4, 5, 7, 1, -8}, + /* 0x96 */ {1333, 7, 1, 9, 1, -4}, + /* 0x97 */ {1334, 16, 1, 18, 1, -4}, + /* 0x98 */ {1336, 5, 2, 6, 0, -12}, + /* 0x99 */ {1338, 18, 10, 18, 1, -13}, + /* 0x9A */ {1361, 8, 13, 9, 1, -12}, + /* 0x9B */ {1374, 2, 4, 5, 2, -6}, + /* 0x9C */ {1375, 15, 10, 17, 1, -9}, + /* 0x9D */ {1394, 0, 0, 8, 0, 0}, + /* 0x9E */ {1394, 7, 13, 9, 1, -12}, + /* 0x9F */ {1406, 12, 14, 12, 0, -13}, + /* 0xA0 */ {1427, 0, 0, 5, 0, 0}, + /* 0xA1 */ {1427, 2, 13, 6, 2, -8}, + /* 0xA2 */ {1431, 9, 14, 10, 1, -11}, + /* 0xA3 */ {1447, 10, 13, 10, 0, -12}, + /* 0xA4 */ {1464, 7, 6, 10, 2, -8}, + /* 0xA5 */ {1470, 8, 13, 10, 1, -12}, + /* 0xA6 */ {1483, 2, 17, 5, 2, -12}, + /* 0xA7 */ {1488, 9, 17, 10, 1, -12}, + /* 0xA8 */ {1508, 6, 1, 6, 0, -11}, + /* 0xA9 */ {1509, 14, 13, 14, 1, -12}, + /* 0xAA */ {1532, 5, 8, 7, 1, -12}, + /* 0xAB */ {1537, 7, 6, 9, 1, -7}, + /* 0xAC */ {1543, 9, 5, 11, 2, -5}, + /* 0xAD */ {1549, 0, 0, 0, 0, 0}, + /* 0xAE */ {1549, 14, 13, 14, 1, -12}, + /* 0xAF */ {1572, 5, 1, 6, 0, -12}, + /* 0xB0 */ {1573, 5, 5, 11, 3, -11}, + /* 0xB1 */ {1577, 9, 11, 11, 1, -10}, + /* 0xB2 */ {1590, 6, 8, 6, 1, -13}, + /* 0xB3 */ {1596, 7, 8, 6, 0, -13}, + /* 0xB4 */ {1603, 4, 3, 6, 2, -12}, + /* 0xB5 */ {1605, 9, 13, 10, 1, -9}, + /* 0xB6 */ {1620, 8, 16, 10, 2, -12}, + /* 0xB7 */ {1636, 3, 1, 5, 1, -4}, + /* 0xB8 */ {1637, 5, 4, 6, 1, 1}, + /* 0xB9 */ {1640, 3, 7, 6, 2, -13}, + /* 0xBA */ {1643, 5, 8, 7, 1, -12}, + /* 0xBB */ {1648, 7, 6, 9, 1, -7}, + /* 0xBC */ {1654, 14, 13, 16, 2, -12}, + /* 0xBD */ {1677, 14, 13, 16, 2, -12}, + /* 0xBE */ {1700, 15, 13, 16, 1, -12}, + /* 0xBF */ {1725, 9, 13, 10, 1, -8}, + /* 0xC0 */ {1740, 10, 14, 12, 1, -13}, + /* 0xC1 */ {1758, 10, 14, 12, 1, -13}, + /* 0xC2 */ {1776, 10, 14, 12, 1, -13}, + /* 0xC3 */ {1794, 10, 14, 12, 1, -13}, + /* 0xC4 */ {1812, 10, 14, 12, 1, -13}, + /* 0xC5 */ {1830, 10, 14, 12, 1, -13}, + /* 0xC6 */ {1848, 16, 13, 18, 1, -12}, + /* 0xC7 */ {1874, 11, 17, 13, 1, -12}, + /* 0xC8 */ {1898, 9, 14, 11, 1, -13}, + /* 0xC9 */ {1914, 9, 14, 11, 1, -13}, + /* 0xCA */ {1930, 9, 14, 11, 1, -13}, + /* 0xCB */ {1946, 9, 14, 11, 1, -13}, + /* 0xCC */ {1962, 3, 15, 5, 1, -13}, + /* 0xCD */ {1968, 3, 14, 5, 1, -13}, + /* 0xCE */ {1974, 5, 14, 5, 0, -13}, + /* 0xCF */ {1983, 6, 14, 5, 0, -13}, + /* 0xD0 */ {1994, 11, 13, 13, 1, -12}, + /* 0xD1 */ {2012, 11, 14, 13, 1, -13}, + /* 0xD2 */ {2032, 12, 15, 13, 1, -14}, + /* 0xD3 */ {2055, 12, 15, 13, 1, -14}, + /* 0xD4 */ {2078, 12, 15, 13, 1, -14}, + /* 0xD5 */ {2101, 12, 15, 13, 1, -14}, + /* 0xD6 */ {2124, 12, 15, 13, 1, -14}, + /* 0xD7 */ {2147, 7, 7, 11, 2, -7}, + /* 0xD8 */ {2154, 13, 13, 14, 1, -12}, + /* 0xD9 */ {2176, 11, 14, 13, 1, -13}, + /* 0xDA */ {2196, 11, 14, 13, 1, -13}, + /* 0xDB */ {2216, 11, 14, 13, 1, -13}, + /* 0xDC */ {2236, 11, 14, 13, 1, -13}, + /* 0xDD */ {2256, 12, 14, 12, 0, -13}, + /* 0xDE */ {2277, 10, 13, 12, 1, -12}, + /* 0xDF */ {2294, 9, 13, 11, 1, -12}, + /* 0xE0 */ {2309, 9, 13, 10, 1, -12}, + /* 0xE1 */ {2324, 9, 13, 10, 1, -12}, + /* 0xE2 */ {2339, 9, 13, 10, 1, -12}, + /* 0xE3 */ {2354, 9, 13, 10, 1, -12}, + /* 0xE4 */ {2369, 9, 12, 10, 1, -11}, + /* 0xE5 */ {2383, 9, 14, 10, 1, -13}, + /* 0xE6 */ {2399, 15, 10, 16, 1, -9}, + /* 0xE7 */ {2418, 8, 14, 9, 1, -9}, + /* 0xE8 */ {2432, 8, 13, 10, 1, -12}, + /* 0xE9 */ {2445, 8, 13, 10, 1, -12}, + /* 0xEA */ {2458, 8, 13, 10, 1, -12}, + /* 0xEB */ {2471, 8, 12, 10, 1, -11}, + /* 0xEC */ {2483, 3, 13, 4, 0, -12}, + /* 0xED */ {2488, 3, 13, 4, 1, -12}, + /* 0xEE */ {2493, 4, 13, 5, 0, -12}, + /* 0xEF */ {2500, 6, 12, 5, -1, -11}, + /* 0xF0 */ {2509, 8, 13, 10, 1, -12}, + /* 0xF1 */ {2522, 8, 13, 10, 1, -12}, + /* 0xF2 */ {2535, 8, 13, 10, 1, -12}, + /* 0xF3 */ {2548, 8, 13, 10, 1, -12}, + /* 0xF4 */ {2561, 8, 13, 10, 1, -12}, + /* 0xF5 */ {2574, 8, 13, 10, 1, -12}, + /* 0xF6 */ {2587, 8, 12, 10, 1, -11}, + /* 0xF7 */ {2599, 9, 8, 11, 1, -7}, + /* 0xF8 */ {2608, 8, 10, 10, 1, -9}, + /* 0xF9 */ {2618, 8, 13, 10, 1, -12}, + /* 0xFA */ {2631, 8, 13, 10, 1, -12}, + /* 0xFB */ {2644, 8, 13, 10, 1, -12}, + /* 0xFC */ {2657, 8, 12, 10, 1, -11}, + /* 0xFD */ {2669, 8, 17, 9, 0, -12}, + /* 0xFE */ {2686, 9, 16, 10, 1, -12}, + /* 0xFF */ {2704, 8, 16, 9, 0, -11}, +}; + +const GFXfont FreeSans9pt_Win1252 PROGMEM = {(uint8_t *)FreeSans9pt_Win1252Bitmaps, (GFXglyph *)FreeSans9pt_Win1252Glyphs, 0x20, + 0xFF, 21}; diff --git a/src/graphics/niche/InkHUD/Applet.cpp b/src/graphics/niche/InkHUD/Applet.cpp index 6c6245ec3..f63bd4bbe 100644 --- a/src/graphics/niche/InkHUD/Applet.cpp +++ b/src/graphics/niche/InkHUD/Applet.cpp @@ -263,22 +263,10 @@ uint16_t InkHUD::Applet::Y(float f) // Print text, specifying the position of any edge / corner of the textbox void InkHUD::Applet::printAt(int16_t x, int16_t y, const char *text, HorizontalAlignment ha, VerticalAlignment va) { - printAt(x, y, std::string(text), ha, va); -} - -// Print text, specifying the position of any edge / corner of the textbox -void InkHUD::Applet::printAt(int16_t x, int16_t y, std::string text, HorizontalAlignment ha, VerticalAlignment va) -{ - // Custom font - // - set with AppletFont::addSubstitution - // - find certain UTF8 chars - // - replace with glyph from custom font (or suitable ASCII addSubstitution?) - getFont().applySubstitutions(&text); - // We do still have to run getTextBounds to find the width int16_t textOffsetX, textOffsetY; uint16_t textWidth, textHeight; - getTextBounds(text.c_str(), 0, 0, &textOffsetX, &textOffsetY, &textWidth, &textHeight); + getTextBounds(text, 0, 0, &textOffsetX, &textOffsetY, &textWidth, &textHeight); int16_t cursorX = 0; int16_t cursorY = 0; @@ -310,7 +298,13 @@ void InkHUD::Applet::printAt(int16_t x, int16_t y, std::string text, HorizontalA } setCursor(cursorX, cursorY); - print(text.c_str()); + print(text); +} + +// Print text, specifying the position of any edge / corner of the textbox +void InkHUD::Applet::printAt(int16_t x, int16_t y, std::string text, HorizontalAlignment ha, VerticalAlignment va) +{ + printAt(x, y, text.c_str(), ha, va); } // Set which font should be used for subsequent drawing @@ -328,11 +322,52 @@ InkHUD::AppletFont InkHUD::Applet::getFont() return currentFont; } +// Parse any text which might have "special characters" +// Re-encodes UTF-8 characters to match our 8-bit encoded fonts +std::string InkHUD::Applet::parse(std::string text) +{ + return getFont().decodeUTF8(text); +} + +// Get the best version of a node's short name available to us +// Parses any non-ascii chars +// Swaps for last-four of node-id if the real short name is unknown or can't be rendered (emoji) +std::string InkHUD::Applet::parseShortName(meshtastic_NodeInfoLite *node) +{ + assert(node); + + // Use the true shortname if known, and doesn't contain any unprintable characters (emoji, etc.) + if (node->has_user) { + std::string parsed = parse(node->user.short_name); + if (isPrintable(parsed)) + return parsed; + } + + // Otherwise, use the "last 4" of node id + // - if short name unknown, or + // - if short name is emoji (we can't render this) + std::string nodeID = hexifyNodeNum(node->num); + return nodeID.substr(nodeID.length() - 4); +} + +// Determine if all characters of a string are printable using the current font +bool InkHUD::Applet::isPrintable(std::string text) +{ + // Scan for DEL (0x7F), which is the value assigned by AppletFont::applyEncoding if a unicode character is not handled + // Todo: move this to from DEL to SUB, once the fonts have been changed for this + for (char &c : text) { + if (c == '\x7F') + return false; + } + + // No unprintable characters found + return true; +} + // Gets rendered width of a string // Wrapper for getTextBounds uint16_t InkHUD::Applet::getTextWidth(const char *text) { - // We do still have to run getTextBounds to find the width int16_t textOffsetX, textOffsetY; uint16_t textWidth, textHeight; @@ -345,8 +380,6 @@ uint16_t InkHUD::Applet::getTextWidth(const char *text) // Wrapper for getTextBounds uint16_t InkHUD::Applet::getTextWidth(std::string text) { - getFont().applySubstitutions(&text); - return getTextWidth(text.c_str()); } @@ -395,12 +428,6 @@ std::string InkHUD::Applet::hexifyNodeNum(NodeNum num) // Avoids splitting words in half, instead moving the entire word to a new line wherever possible void InkHUD::Applet::printWrapped(int16_t left, int16_t top, uint16_t width, std::string text) { - // Custom font glyphs - // - set with AppletFont::addSubstitution - // - find certain UTF8 chars - // - replace with glyph from custom font (or suitable ASCII addSubstitution?) - getFont().applySubstitutions(&text); - // Place the AdafruitGFX cursor to suit our "top" coord setCursor(left, top + getFont().heightAboveCursor()); diff --git a/src/graphics/niche/InkHUD/Applet.h b/src/graphics/niche/InkHUD/Applet.h index 8f4466647..c6a8a8aad 100644 --- a/src/graphics/niche/InkHUD/Applet.h +++ b/src/graphics/niche/InkHUD/Applet.h @@ -133,12 +133,15 @@ class Applet : public GFX void drawLogo(int16_t centerX, int16_t centerY, uint16_t width, uint16_t height, Color color = BLACK); // Draw the Meshtastic logo - std::string hexifyNodeNum(NodeNum num); // Style as !0123abdc - SignalStrength getSignalStrength(float snr, float rssi); // Interpret SNR and RSSI, as an easy to understand value - std::string getTimeString(uint32_t epochSeconds); // Human readable - std::string getTimeString(); // Current time, human readable - uint16_t getActiveNodeCount(); // Duration determined by user, in onscreen menu - std::string localizeDistance(uint32_t meters); // Human readable distance, imperial or metric + std::string hexifyNodeNum(NodeNum num); // Style as !0123abdc + SignalStrength getSignalStrength(float snr, float rssi); // Interpret SNR and RSSI, as an easy to understand value + std::string getTimeString(uint32_t epochSeconds); // Human readable + std::string getTimeString(); // Current time, human readable + uint16_t getActiveNodeCount(); // Duration determined by user, in onscreen menu + std::string localizeDistance(uint32_t meters); // Human readable distance, imperial or metric + std::string parse(std::string text); // Handle text which might contain special chars + std::string parseShortName(meshtastic_NodeInfoLite *node); // Get the shortname, or a substitute if has unprintable chars + bool isPrintable(std::string); // Check for characters which the font can't print // Convenient references diff --git a/src/graphics/niche/InkHUD/AppletFont.cpp b/src/graphics/niche/InkHUD/AppletFont.cpp index 25597c9b9..88fb4054b 100644 --- a/src/graphics/niche/InkHUD/AppletFont.cpp +++ b/src/graphics/niche/InkHUD/AppletFont.cpp @@ -2,14 +2,17 @@ #include "./AppletFont.h" +#include + using namespace NicheGraphics; InkHUD::AppletFont::AppletFont() { - // Default constructor uses the in-built AdafruitGFX font + // Default constructor uses the in-built AdafruitGFX font (not recommended) } -InkHUD::AppletFont::AppletFont(const GFXfont &adafruitGFXFont) : gfxFont(&adafruitGFXFont) +InkHUD::AppletFont::AppletFont(const GFXfont &adafruitGFXFont, Encoding encoding, int8_t paddingTop, int8_t paddingBottom) + : gfxFont(&adafruitGFXFont), encoding(encoding) { // AdafruitGFX fonts are drawn relative to a "cursor line"; // they print as if the glyphs are resting on the line of piece of ruled paper. @@ -22,6 +25,10 @@ InkHUD::AppletFont::AppletFont(const GFXfont &adafruitGFXFont) : gfxFont(&adafru // AdafruitGFX fonts do declare a line-height, but this seems to include a certain amount of padding, // which we'd rather not deal with. If we want padding, we'll add it manually. + this->ascenderHeight = 0; + this->descenderHeight = 0; + this->height = 0; + // Scan each glyph in the AdafruitGFX font for (uint16_t i = 0; i <= (gfxFont->last - gfxFont->first); i++) { uint8_t glyphHeight = gfxFont->glyph[i].height; // Height of glyph @@ -33,10 +40,16 @@ InkHUD::AppletFont::AppletFont(const GFXfont &adafruitGFXFont) : gfxFont(&adafru int8_t glyphAscender = 0 - gfxFont->glyph[i].yOffset; if (glyphAscender > 0) this->ascenderHeight = max(this->ascenderHeight, (uint8_t)glyphAscender); + + int8_t glyphDescender = gfxFont->glyph[i].height + gfxFont->glyph[i].yOffset; + if (glyphDescender > 0) + this->descenderHeight = max(this->descenderHeight, (uint8_t)glyphDescender); } - // Determine how far characters may hang "below the line" - descenderHeight = height - ascenderHeight; + // Apply any manual padding to grow or shrink the line size + // Helpful if a font has one or two exceptionally large characters, which would make the lines ridiculously tall + ascenderHeight += paddingTop; + descenderHeight += paddingBottom; // Find how far the cursor advances when we "print" a space character spaceCharWidth = gfxFont->glyph[(uint8_t)' ' - gfxFont->first].xAdvance; @@ -83,139 +96,533 @@ uint8_t InkHUD::AppletFont::widthBetweenWords() return this->spaceCharWidth; } -// Add to the list of substituted glyphs -// This "find and replace" operation will be run before text is printed -// Used to swap out UTF8 special characters, either with a custom font, or with a suitable ASCII approximation -void InkHUD::AppletFont::addSubstitution(const char *from, const char *to) +// Convert a unicode char from set of UTF-8 bytes to UTF-32 +// Used by AppletFont::applyEncoding, which remaps unicode chars for extended ASCII fonts, based on their UTF-32 value +uint32_t InkHUD::AppletFont::toUtf32(std::string utf8) { - substitutions.push_back({.from = from, .to = to}); + uint32_t utf32 = 0; + + switch (utf8.length()) { + case 2: + // 5 bits + 6 bits + utf32 |= (utf8.at(0) & 0b00011111) << 6; + utf32 |= (utf8.at(1) & 0b00111111); + break; + + case 3: + // 4 bits + 6 bits + 6 bits + utf32 |= (utf8.at(0) & 0b00001111) << (6 + 6); + utf32 |= (utf8.at(1) & 0b00111111) << 6; + utf32 |= (utf8.at(2) & 0b00111111); + break; + + case 4: + // 3 bits + 6 bits + 6 bits + 6 bits + utf32 |= (utf8.at(0) & 0b00000111) << (6 + 6 + 6); + utf32 |= (utf8.at(1) & 0b00111111) << (6 + 6); + utf32 |= (utf8.at(2) & 0b00111111) << 6; + utf32 |= (utf8.at(3) & 0b00111111); + break; + default: + assert(false); + } + + return utf32; } -// Run all registered substitutions on a string -// Used to swap out UTF8 special chars -void InkHUD::AppletFont::applySubstitutions(std::string *text) +// Process a string, collating UTF-8 bytes, and sending them off for re-encoding to extended ASCII +// Not all InkHUD text is passed through here, only text which could potentially contain non-ASCII chars +std::string InkHUD::AppletFont::decodeUTF8(std::string encoded) { - // For each substitution - for (Substitution s : substitutions) { + // Final processed output + std::string decoded; - // Find and replace - // - search for Substitution::from - // - replace with Substitution::to - size_t i = text->find(s.from); - while (i != std::string::npos) { - text->replace(i, strlen(s.from), s.to); - i = text->find(s.from, i); // Continue looking from last position + // Holds bytes for one UTF-8 char during parsing + std::string utf8Char; + uint8_t utf8CharSize = 0; + + for (char &c : encoded) { + + // If first byte + if (utf8Char.empty()) { + // If MSB is unset, byte is an ASCII char + // If MSB is set, byte is part of a UTF-8 char. Counting number of higher-order bits tells how many bytes in char + if ((c & 0x80)) { + char c1 = c; + while (c1 & 0x80) { + c1 <<= 1; + utf8CharSize++; + } + } + } + + // Append the byte to the UTF-8 char we're building + utf8Char += c; + + // More bytes left to collect. Iterate. + if (utf8Char.length() < utf8CharSize) + continue; + + // Now collected all bytes for this char + // Remap the value to match the encoding of our 8-bit AppletFont + decoded += applyEncoding(utf8Char); + + // Reset, ready to build next UTF-8 char from the encoded bytes + utf8Char.clear(); + utf8CharSize = 0; + } // For each char + + // All chars processed, return result + return decoded; +} + +// Re-encode a single UTF-8 character to extended ASCII +// Target encoding depends on the font +char InkHUD::AppletFont::applyEncoding(std::string utf8) +{ + // ##################################################### Syntactic Sugar ##################################################### +#define REMAP(in, out) \ + case in: \ + return out; + // ########################################################################################################################### + + // Latin - Central Europe + // https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.TXT + if (encoding == WINDOWS_1250) { + // 1-Byte chars: no remapping + if (utf8.length() == 1) + return utf8.at(0); + + // Multi-byte chars: + switch (toUtf32(utf8)) { + REMAP(0x20AC, 0x80); // EURO SIGN + REMAP(0x201A, 0x82); // SINGLE LOW-9 QUOTATION MARK + REMAP(0x201E, 0x84); // DOUBLE LOW-9 QUOTATION MARK + REMAP(0x2026, 0x85); // HORIZONTAL ELLIPSIS + REMAP(0x2020, 0x86); // DAGGER + REMAP(0x2021, 0x87); // DOUBLE DAGGER + REMAP(0x2030, 0x89); // PER MILLE SIGN + REMAP(0x0160, 0x8A); // LATIN CAPITAL LETTER S WITH CARON + REMAP(0x2039, 0x8B); // SINGLE LEFT-POINTING ANGLE QUOTATION MARK + REMAP(0x015A, 0x8C); // LATIN CAPITAL LETTER S WITH ACUTE + REMAP(0x0164, 0x8D); // LATIN CAPITAL LETTER T WITH CARON + REMAP(0x017D, 0x8E); // LATIN CAPITAL LETTER Z WITH CARON + REMAP(0x0179, 0x8F); // LATIN CAPITAL LETTER Z WITH ACUTE + + REMAP(0x2018, 0x91); // LEFT SINGLE QUOTATION MARK + REMAP(0x2019, 0x92); // RIGHT SINGLE QUOTATION MARK + REMAP(0x201C, 0x93); // LEFT DOUBLE QUOTATION MARK + REMAP(0x201D, 0x94); // RIGHT DOUBLE QUOTATION MARK + REMAP(0x2022, 0x95); // BULLET + REMAP(0x2013, 0x96); // EN DASH + REMAP(0x2014, 0x97); // EM DASH + REMAP(0x2122, 0x99); // TRADE MARK SIGN + REMAP(0x0161, 0x9A); // LATIN SMALL LETTER S WITH CARON + REMAP(0x203A, 0x9B); // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK + REMAP(0x015B, 0x9C); // LATIN SMALL LETTER S WITH ACUTE + REMAP(0x0165, 0x9D); // LATIN SMALL LETTER T WITH CARON + REMAP(0x017E, 0x9E); // LATIN SMALL LETTER Z WITH CARON + REMAP(0x017A, 0x9F); // LATIN SMALL LETTER Z WITH ACUTE + + REMAP(0x00A0, 0xA0); // NO-BREAK SPACE + REMAP(0x02C7, 0xA1); // CARON + REMAP(0x02D8, 0xA2); // BREVE + REMAP(0x0141, 0xA3); // LATIN CAPITAL LETTER L WITH STROKE + REMAP(0x00A4, 0xA4); // CURRENCY SIGN + REMAP(0x0104, 0xA5); // LATIN CAPITAL LETTER A WITH OGONEK + REMAP(0x00A6, 0xA6); // BROKEN BAR + REMAP(0x00A7, 0xA7); // SECTION SIGN + REMAP(0x00A8, 0xA8); // DIAERESIS + REMAP(0x00A9, 0xA9); // COPYRIGHT SIGN + REMAP(0x015E, 0xAA); // LATIN CAPITAL LETTER S WITH CEDILLA + REMAP(0x00AB, 0xAB); // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + REMAP(0x00AC, 0xAC); // NOT SIGN + REMAP(0x00AD, 0xAD); // SOFT HYPHEN + REMAP(0x00AE, 0xAE); // REGISTERED SIGN + REMAP(0x017B, 0xAF); // LATIN CAPITAL LETTER Z WITH DOT ABOVE + + REMAP(0x00B0, 0xB0); // DEGREE SIGN + REMAP(0x00B1, 0xB1); // PLUS-MINUS SIGN + REMAP(0x02DB, 0xB2); // OGONEK + REMAP(0x0142, 0xB3); // LATIN SMALL LETTER L WITH STROKE + REMAP(0x00B4, 0xB4); // ACUTE ACCENT + REMAP(0x00B5, 0xB5); // MICRO SIGN + REMAP(0x00B6, 0xB6); // PILCROW SIGN + REMAP(0x00B7, 0xB7); // MIDDLE DOT + REMAP(0x00B8, 0xB8); // CEDILLA + REMAP(0x0105, 0xB9); // LATIN SMALL LETTER A WITH OGONEK + REMAP(0x015F, 0xBA); // LATIN SMALL LETTER S WITH CEDILLA + REMAP(0x00BB, 0xBB); // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + REMAP(0x013D, 0xBC); // LATIN CAPITAL LETTER L WITH CARON + REMAP(0x02DD, 0xBD); // DOUBLE ACUTE ACCENT + REMAP(0x013E, 0xBE); // LATIN SMALL LETTER L WITH CARON + REMAP(0x017C, 0xBF); // LATIN SMALL LETTER Z WITH DOT ABOVE + + REMAP(0x0154, 0xC0); // LATIN CAPITAL LETTER R WITH ACUTE + REMAP(0x00C1, 0xC1); // LATIN CAPITAL LETTER A WITH ACUTE + REMAP(0x00C2, 0xC2); // LATIN CAPITAL LETTER A WITH CIRCUMFLEX + REMAP(0x0102, 0xC3); // LATIN CAPITAL LETTER A WITH BREVE + REMAP(0x00C4, 0xC4); // LATIN CAPITAL LETTER A WITH DIAERESIS + REMAP(0x0139, 0xC5); // LATIN CAPITAL LETTER L WITH ACUTE + REMAP(0x0106, 0xC6); // LATIN CAPITAL LETTER C WITH ACUTE + REMAP(0x00C7, 0xC7); // LATIN CAPITAL LETTER C WITH CEDILLA + REMAP(0x010C, 0xC8); // LATIN CAPITAL LETTER C WITH CARON + REMAP(0x00C9, 0xC9); // LATIN CAPITAL LETTER E WITH ACUTE + REMAP(0x0118, 0xCA); // LATIN CAPITAL LETTER E WITH OGONEK + REMAP(0x00CB, 0xCB); // LATIN CAPITAL LETTER E WITH DIAERESIS + REMAP(0x011A, 0xCC); // LATIN CAPITAL LETTER E WITH CARON + REMAP(0x00CD, 0xCD); // LATIN CAPITAL LETTER I WITH ACUTE + REMAP(0x00CE, 0xCE); // LATIN CAPITAL LETTER I WITH CIRCUMFLEX + REMAP(0x010E, 0xCF); // LATIN CAPITAL LETTER D WITH CARON + + REMAP(0x0110, 0xD0); // LATIN CAPITAL LETTER D WITH STROKE + REMAP(0x0143, 0xD1); // LATIN CAPITAL LETTER N WITH ACUTE + REMAP(0x0147, 0xD2); // LATIN CAPITAL LETTER N WITH CARON + REMAP(0x00D3, 0xD3); // LATIN CAPITAL LETTER O WITH ACUTE + REMAP(0x00D4, 0xD4); // LATIN CAPITAL LETTER O WITH CIRCUMFLEX + REMAP(0x0150, 0xD5); // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE + REMAP(0x00D6, 0xD6); // LATIN CAPITAL LETTER O WITH DIAERESIS + REMAP(0x00D7, 0xD7); // MULTIPLICATION SIGN + REMAP(0x0158, 0xD8); // LATIN CAPITAL LETTER R WITH CARON + REMAP(0x016E, 0xD9); // LATIN CAPITAL LETTER U WITH RING ABOVE + REMAP(0x00DA, 0xDA); // LATIN CAPITAL LETTER U WITH ACUTE + REMAP(0x0170, 0xDB); // LATIN CAPITAL LETTER U WITH DOUBLE ACUTE + REMAP(0x00DC, 0xDC); // LATIN CAPITAL LETTER U WITH DIAERESIS + REMAP(0x00DD, 0xDD); // LATIN CAPITAL LETTER Y WITH ACUTE + REMAP(0x0162, 0xDE); // LATIN CAPITAL LETTER T WITH CEDILLA + REMAP(0x00DF, 0xDF); // LATIN SMALL LETTER SHARP S + + REMAP(0x0155, 0xE0); // LATIN SMALL LETTER R WITH ACUTE + REMAP(0x00E1, 0xE1); // LATIN SMALL LETTER A WITH ACUTE + REMAP(0x00E2, 0xE2); // LATIN SMALL LETTER A WITH CIRCUMFLEX + REMAP(0x0103, 0xE3); // LATIN SMALL LETTER A WITH BREVE + REMAP(0x00E4, 0xE4); // LATIN SMALL LETTER A WITH DIAERESIS + REMAP(0x013A, 0xE5); // LATIN SMALL LETTER L WITH ACUTE + REMAP(0x0107, 0xE6); // LATIN SMALL LETTER C WITH ACUTE + REMAP(0x00E7, 0xE7); // LATIN SMALL LETTER C WITH CEDILLA + REMAP(0x010D, 0xE8); // LATIN SMALL LETTER C WITH CARON + REMAP(0x00E9, 0xE9); // LATIN SMALL LETTER E WITH ACUTE + REMAP(0x0119, 0xEA); // LATIN SMALL LETTER E WITH OGONEK + REMAP(0x00EB, 0xEB); // LATIN SMALL LETTER E WITH DIAERESIS + REMAP(0x011B, 0xEC); // LATIN SMALL LETTER E WITH CARON + REMAP(0x00ED, 0xED); // LATIN SMALL LETTER I WITH ACUTE + REMAP(0x00EE, 0xEE); // LATIN SMALL LETTER I WITH CIRCUMFLEX + REMAP(0x010F, 0xEF); // LATIN SMALL LETTER D WITH CARON + + REMAP(0x0111, 0xF0); // LATIN SMALL LETTER D WITH STROKE + REMAP(0x0144, 0xF1); // LATIN SMALL LETTER N WITH ACUTE + REMAP(0x0148, 0xF2); // LATIN SMALL LETTER N WITH CARON + REMAP(0x00F3, 0xF3); // LATIN SMALL LETTER O WITH ACUTE + REMAP(0x00F4, 0xF4); // LATIN SMALL LETTER O WITH CIRCUMFLEX + REMAP(0x0151, 0xF5); // LATIN SMALL LETTER O WITH DOUBLE ACUTE + REMAP(0x00F6, 0xF6); // LATIN SMALL LETTER O WITH DIAERESIS + REMAP(0x00F7, 0xF7); // DIVISION SIGN + REMAP(0x0159, 0xF8); // LATIN SMALL LETTER R WITH CARON + REMAP(0x016F, 0xF9); // LATIN SMALL LETTER U WITH RING ABOVE + REMAP(0x00FA, 0xFA); // LATIN SMALL LETTER U WITH ACUTE + REMAP(0x0171, 0xFB); // LATIN SMALL LETTER U WITH DOUBLE ACUTE + REMAP(0x00FC, 0xFC); // LATIN SMALL LETTER U WITH DIAERESIS + REMAP(0x00FD, 0xFD); // LATIN SMALL LETTER Y WITH ACUTE + REMAP(0x0163, 0xFE); // LATIN SMALL LETTER T WITH CEDILLA + REMAP(0x02D9, 0xFF); // DOT ABOVE } } -} -// Apply a set of substitutions which remap UTF8 for a Windows-1251 font -// Windows-1251 is an 8-bit character encoding, suitable for several languages which use the Cyrillic script -void InkHUD::AppletFont::addSubstitutionsWin1251() -{ - addSubstitution("Ђ", "\x80"); - addSubstitution("Ѓ", "\x81"); - addSubstitution("ѓ", "\x83"); - addSubstitution("€", "\x88"); - addSubstitution("Љ", "\x8A"); - addSubstitution("Њ", "\x8C"); - addSubstitution("Ќ", "\x8D"); - addSubstitution("Ћ", "\x8E"); - addSubstitution("Џ", "\x8F"); + // Latin - Cyrillic + // https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT + else if (encoding == WINDOWS_1251) { + // 1-Byte chars: no remapping + if (utf8.length() == 1) + return utf8.at(0); - addSubstitution("ђ", "\x90"); - addSubstitution("љ", "\x9A"); - addSubstitution("њ", "\x9C"); - addSubstitution("ќ", "\x9D"); - addSubstitution("ћ", "\x9E"); - addSubstitution("џ", "\x9F"); + // Multi-byte chars: + switch (toUtf32(utf8)) { + REMAP(0x0402, 0x80); // CYRILLIC CAPITAL LETTER DJE + REMAP(0x0403, 0x81); // CYRILLIC CAPITAL LETTER GJE + REMAP(0x201A, 0x82); // SINGLE LOW-9 QUOTATION MARK + REMAP(0x0453, 0x83); // CYRILLIC SMALL LETTER GJE + REMAP(0x201E, 0x84); // DOUBLE LOW-9 QUOTATION MARK + REMAP(0x2026, 0x85); // HORIZONTAL ELLIPSIS + REMAP(0x2020, 0x86); // DAGGER + REMAP(0x2021, 0x87); // DOUBLE DAGGER + REMAP(0x20AC, 0x88); // EURO SIGN + REMAP(0x2030, 0x89); // PER MILLE SIGN + REMAP(0x0409, 0x8A); // CYRILLIC CAPITAL LETTER LJE + REMAP(0x2039, 0x8B); // SINGLE LEFT-POINTING ANGLE QUOTATION MARK + REMAP(0x040A, 0x8C); // CYRILLIC CAPITAL LETTER NJE + REMAP(0x040C, 0x8D); // CYRILLIC CAPITAL LETTER KJE + REMAP(0x040B, 0x8E); // CYRILLIC CAPITAL LETTER TSHE + REMAP(0x040F, 0x8F); // CYRILLIC CAPITAL LETTER DZHE - addSubstitution("Ў", "\xA1"); - addSubstitution("ў", "\xA2"); - addSubstitution("Ј", "\xA3"); - addSubstitution("Ґ", "\xA5"); - addSubstitution("Ё", "\xA8"); - addSubstitution("Є", "\xAA"); - addSubstitution("Ї", "\xAF"); + REMAP(0x0452, 0x90); // CYRILLIC SMALL LETTER DJE + REMAP(0x2018, 0x91); // LEFT SINGLE QUOTATION MARK + REMAP(0x2019, 0x92); // RIGHT SINGLE QUOTATION MARK + REMAP(0x201C, 0x93); // LEFT DOUBLE QUOTATION MARK + REMAP(0x201D, 0x94); // RIGHT DOUBLE QUOTATION MARK + REMAP(0x2022, 0x95); // BULLET + REMAP(0x2013, 0x96); // EN DASH + REMAP(0x2014, 0x97); // EM DASH + REMAP(0x2122, 0x99); // TRADE MARK SIGN + REMAP(0x0459, 0x9A); // CYRILLIC SMALL LETTER LJE + REMAP(0x203A, 0x9B); // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK + REMAP(0x045A, 0x9C); // CYRILLIC SMALL LETTER NJE + REMAP(0x045C, 0x9D); // CYRILLIC SMALL LETTER KJE + REMAP(0x045B, 0x9E); // CYRILLIC SMALL LETTER TSHE + REMAP(0x045F, 0x9F); // CYRILLIC SMALL LETTER DZHE - addSubstitution("І", "\xB2"); - addSubstitution("і", "\xB3"); - addSubstitution("ґ", "\xB4"); - addSubstitution("ё", "\xB8"); - addSubstitution("№", "\xB9"); - addSubstitution("є", "\xBA"); - addSubstitution("ј", "\xBC"); - addSubstitution("Ѕ", "\xBD"); - addSubstitution("ѕ", "\xBE"); - addSubstitution("ї", "\xBF"); + REMAP(0x00A0, 0xA0); // NO-BREAK SPACE + REMAP(0x040E, 0xA1); // CYRILLIC CAPITAL LETTER SHORT U + REMAP(0x045E, 0xA2); // CYRILLIC SMALL LETTER SHORT U + REMAP(0x0408, 0xA3); // CYRILLIC CAPITAL LETTER JE + REMAP(0x00A4, 0xA4); // CURRENCY SIGN + REMAP(0x0490, 0xA5); // CYRILLIC CAPITAL LETTER GHE WITH UPTURN + REMAP(0x00A6, 0xA6); // BROKEN BAR + REMAP(0x00A7, 0xA7); // SECTION SIGN + REMAP(0x0401, 0xA8); // CYRILLIC CAPITAL LETTER IO + REMAP(0x00A9, 0xA9); // COPYRIGHT SIGN + REMAP(0x0404, 0xAA); // CYRILLIC CAPITAL LETTER UKRAINIAN IE + REMAP(0x00AB, 0xAB); // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + REMAP(0x00AC, 0xAC); // NOT SIGN + REMAP(0x00AD, 0xAD); // SOFT HYPHEN + REMAP(0x00AE, 0xAE); // REGISTERED SIGN + REMAP(0x0407, 0xAF); // CYRILLIC CAPITAL LETTER YI - addSubstitution("А", "\xC0"); - addSubstitution("Б", "\xC1"); - addSubstitution("В", "\xC2"); - addSubstitution("Г", "\xC3"); - addSubstitution("Д", "\xC4"); - addSubstitution("Е", "\xC5"); - addSubstitution("Ж", "\xC6"); - addSubstitution("З", "\xC7"); - addSubstitution("И", "\xC8"); - addSubstitution("Й", "\xC9"); - addSubstitution("К", "\xCA"); - addSubstitution("Л", "\xCB"); - addSubstitution("М", "\xCC"); - addSubstitution("Н", "\xCD"); - addSubstitution("О", "\xCE"); - addSubstitution("П", "\xCF"); + REMAP(0x00B0, 0xB0); // DEGREE SIGN + REMAP(0x00B1, 0xB1); // PLUS-MINUS SIGN + REMAP(0x0406, 0xB2); // CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I + REMAP(0x0456, 0xB3); // CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I + REMAP(0x0491, 0xB4); // CYRILLIC SMALL LETTER GHE WITH UPTURN + REMAP(0x00B5, 0xB5); // MICRO SIGN + REMAP(0x00B6, 0xB6); // PILCROW SIGN + REMAP(0x00B7, 0xB7); // MIDDLE DOT + REMAP(0x0451, 0xB8); // CYRILLIC SMALL LETTER IO + REMAP(0x2116, 0xB9); // NUMERO SIGN + REMAP(0x0454, 0xBA); // CYRILLIC SMALL LETTER UKRAINIAN IE + REMAP(0x00BB, 0xBB); // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + REMAP(0x0458, 0xBC); // CYRILLIC SMALL LETTER JE + REMAP(0x0405, 0xBD); // CYRILLIC CAPITAL LETTER DZE + REMAP(0x0455, 0xBE); // CYRILLIC SMALL LETTER DZE + REMAP(0x0457, 0xBF); // CYRILLIC SMALL LETTER YI - addSubstitution("Р", "\xD0"); - addSubstitution("С", "\xD1"); - addSubstitution("Т", "\xD2"); - addSubstitution("У", "\xD3"); - addSubstitution("Ф", "\xD4"); - addSubstitution("Х", "\xD5"); - addSubstitution("Ц", "\xD6"); - addSubstitution("Ч", "\xD7"); - addSubstitution("Ш", "\xD8"); - addSubstitution("Щ", "\xD9"); - addSubstitution("Ъ", "\xDA"); - addSubstitution("Ы", "\xDB"); - addSubstitution("Ь", "\xDC"); - addSubstitution("Э", "\xDD"); - addSubstitution("Ю", "\xDE"); - addSubstitution("Я", "\xDF"); + REMAP(0x0410, 0xC0); // CYRILLIC CAPITAL LETTER A + REMAP(0x0411, 0xC1); // CYRILLIC CAPITAL LETTER BE + REMAP(0x0412, 0xC2); // CYRILLIC CAPITAL LETTER VE + REMAP(0x0413, 0xC3); // CYRILLIC CAPITAL LETTER GHE + REMAP(0x0414, 0xC4); // CYRILLIC CAPITAL LETTER DE + REMAP(0x0415, 0xC5); // CYRILLIC CAPITAL LETTER IE + REMAP(0x0416, 0xC6); // CYRILLIC CAPITAL LETTER ZHE + REMAP(0x0417, 0xC7); // CYRILLIC CAPITAL LETTER ZE + REMAP(0x0418, 0xC8); // CYRILLIC CAPITAL LETTER I + REMAP(0x0419, 0xC9); // CYRILLIC CAPITAL LETTER SHORT I + REMAP(0x041A, 0xCA); // CYRILLIC CAPITAL LETTER KA + REMAP(0x041B, 0xCB); // CYRILLIC CAPITAL LETTER EL + REMAP(0x041C, 0xCC); // CYRILLIC CAPITAL LETTER EM + REMAP(0x041D, 0xCD); // CYRILLIC CAPITAL LETTER EN + REMAP(0x041E, 0xCE); // CYRILLIC CAPITAL LETTER O + REMAP(0x041F, 0xCF); // CYRILLIC CAPITAL LETTER PE - addSubstitution("а", "\xE0"); - addSubstitution("б", "\xE1"); - addSubstitution("в", "\xE2"); - addSubstitution("г", "\xE3"); - addSubstitution("д", "\xE4"); - addSubstitution("е", "\xE5"); - addSubstitution("ж", "\xE6"); - addSubstitution("з", "\xE7"); - addSubstitution("и", "\xE8"); - addSubstitution("й", "\xE9"); - addSubstitution("к", "\xEA"); - addSubstitution("л", "\xEB"); - addSubstitution("м", "\xEC"); - addSubstitution("н", "\xED"); - addSubstitution("о", "\xEE"); - addSubstitution("п", "\xEF"); + REMAP(0x0420, 0xD0); // CYRILLIC CAPITAL LETTER ER + REMAP(0x0421, 0xD1); // CYRILLIC CAPITAL LETTER ES + REMAP(0x0422, 0xD2); // CYRILLIC CAPITAL LETTER TE + REMAP(0x0423, 0xD3); // CYRILLIC CAPITAL LETTER U + REMAP(0x0424, 0xD4); // CYRILLIC CAPITAL LETTER EF + REMAP(0x0425, 0xD5); // CYRILLIC CAPITAL LETTER HA + REMAP(0x0426, 0xD6); // CYRILLIC CAPITAL LETTER TSE + REMAP(0x0427, 0xD7); // CYRILLIC CAPITAL LETTER CHE + REMAP(0x0428, 0xD8); // CYRILLIC CAPITAL LETTER SHA + REMAP(0x0429, 0xD9); // CYRILLIC CAPITAL LETTER SHCHA + REMAP(0x042A, 0xDA); // CYRILLIC CAPITAL LETTER HARD SIGN + REMAP(0x042B, 0xDB); // CYRILLIC CAPITAL LETTER YERU + REMAP(0x042C, 0xDC); // CYRILLIC CAPITAL LETTER SOFT SIGN + REMAP(0x042D, 0xDD); // CYRILLIC CAPITAL LETTER E + REMAP(0x042E, 0xDE); // CYRILLIC CAPITAL LETTER YU + REMAP(0x042F, 0xDF); // CYRILLIC CAPITAL LETTER YA - addSubstitution("р", "\xF0"); - addSubstitution("с", "\xF1"); - addSubstitution("т", "\xF2"); - addSubstitution("у", "\xF3"); - addSubstitution("ф", "\xF4"); - addSubstitution("х", "\xF5"); - addSubstitution("ц", "\xF6"); - addSubstitution("ч", "\xF7"); - addSubstitution("ш", "\xF8"); - addSubstitution("щ", "\xF9"); - addSubstitution("ъ", "\xFA"); - addSubstitution("ы", "\xFB"); - addSubstitution("ь", "\xFC"); - addSubstitution("э", "\xFD"); - addSubstitution("ю", "\xFE"); - addSubstitution("я", "\xFF"); + REMAP(0x0430, 0xE0); // CYRILLIC SMALL LETTER A + REMAP(0x0431, 0xE1); // CYRILLIC SMALL LETTER BE + REMAP(0x0432, 0xE2); // CYRILLIC SMALL LETTER VE + REMAP(0x0433, 0xE3); // CYRILLIC SMALL LETTER GHE + REMAP(0x0434, 0xE4); // CYRILLIC SMALL LETTER DE + REMAP(0x0435, 0xE5); // CYRILLIC SMALL LETTER IE + REMAP(0x0436, 0xE6); // CYRILLIC SMALL LETTER ZHE + REMAP(0x0437, 0xE7); // CYRILLIC SMALL LETTER ZE + REMAP(0x0438, 0xE8); // CYRILLIC SMALL LETTER I + REMAP(0x0439, 0xE9); // CYRILLIC SMALL LETTER SHORT I + REMAP(0x043A, 0xEA); // CYRILLIC SMALL LETTER KA + REMAP(0x043B, 0xEB); // CYRILLIC SMALL LETTER EL + REMAP(0x043C, 0xEC); // CYRILLIC SMALL LETTER EM + REMAP(0x043D, 0xED); // CYRILLIC SMALL LETTER EN + REMAP(0x043E, 0xEE); // CYRILLIC SMALL LETTER O + REMAP(0x043F, 0xEF); // CYRILLIC SMALL LETTER PE + + REMAP(0x0440, 0xF0); // CYRILLIC SMALL LETTER ER + REMAP(0x0441, 0xF1); // CYRILLIC SMALL LETTER ES + REMAP(0x0442, 0xF2); // CYRILLIC SMALL LETTER TE + REMAP(0x0443, 0xF3); // CYRILLIC SMALL LETTER U + REMAP(0x0444, 0xF4); // CYRILLIC SMALL LETTER EF + REMAP(0x0445, 0xF5); // CYRILLIC SMALL LETTER HA + REMAP(0x0446, 0xF6); // CYRILLIC SMALL LETTER TSE + REMAP(0x0447, 0xF7); // CYRILLIC SMALL LETTER CHE + REMAP(0x0448, 0xF8); // CYRILLIC SMALL LETTER SHA + REMAP(0x0449, 0xF9); // CYRILLIC SMALL LETTER SHCHA + REMAP(0x044A, 0xFA); // CYRILLIC SMALL LETTER HARD SIGN + REMAP(0x044B, 0xFB); // CYRILLIC SMALL LETTER YERU + REMAP(0x044C, 0xFC); // CYRILLIC SMALL LETTER SOFT SIGN + REMAP(0x044D, 0xFD); // CYRILLIC SMALL LETTER E + REMAP(0x044E, 0xFE); // CYRILLIC SMALL LETTER YU + REMAP(0x044F, 0xFF); // CYRILLIC SMALL LETTER YA + } + } + + // Latin - Western Europe + // https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT + else if (encoding == WINDOWS_1252) { + // 1-Byte chars: no remapping + if (utf8.length() == 1) + return utf8.at(0); + + // Multi-byte chars: + switch (toUtf32(utf8)) { + REMAP(0x20AC, 0x80) // EURO SIGN + REMAP(0x201A, 0x82) // SINGLE LOW-9 QUOTATION MARK + REMAP(0x0192, 0x83) // LATIN SMALL LETTER F WITH HOOK + REMAP(0x201E, 0x84) // DOUBLE LOW-9 QUOTATION MARK + REMAP(0x2026, 0x85) // HORIZONTAL ELLIPSIS + REMAP(0x2020, 0x86) // DAGGER + REMAP(0x2021, 0x87) // DOUBLE DAGGER + REMAP(0x02C6, 0x88) // MODIFIER LETTER CIRCUMFLEX ACCENT + REMAP(0x2030, 0x89) // PER MILLE SIGN + REMAP(0x0160, 0x8A) // LATIN CAPITAL LETTER S WITH CARON + REMAP(0x2039, 0x8B) // SINGLE LEFT-POINTING ANGLE QUOTATION MARK + REMAP(0x0152, 0x8C) // LATIN CAPITAL LIGATURE OE + REMAP(0x017D, 0x8E) // LATIN CAPITAL LETTER Z WITH CARON + + REMAP(0x2018, 0x91) // LEFT SINGLE QUOTATION MARK + REMAP(0x2019, 0x92) // RIGHT SINGLE QUOTATION MARK + REMAP(0x201C, 0x93) // LEFT DOUBLE QUOTATION MARK + REMAP(0x201D, 0x94) // RIGHT DOUBLE QUOTATION MARK + REMAP(0x2022, 0x95) // BULLET + REMAP(0x2013, 0x96) // EN DASH + REMAP(0x2014, 0x97) // EM DASH + REMAP(0x02DC, 0x98) // SMALL TILDE + REMAP(0x2122, 0x99) // TRADE MARK SIGN + REMAP(0x0161, 0x9A) // LATIN SMALL LETTER S WITH CARON + REMAP(0x203A, 0x9B) // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK + REMAP(0x0153, 0x9C) // LATIN SMALL LIGATURE OE + REMAP(0x017E, 0x9E) // LATIN SMALL LETTER Z WITH CARON + REMAP(0x0178, 0x9F) // LATIN CAPITAL LETTER Y WITH DIAERESIS + + REMAP(0x00A0, 0xA0) // NO-BREAK SPACE + REMAP(0x00A1, 0xA1) // INVERTED EXCLAMATION MARK + REMAP(0x00A2, 0xA2) // CENT SIGN + REMAP(0x00A3, 0xA3) // POUND SIGN + REMAP(0x00A4, 0xA4) // CURRENCY SIGN + REMAP(0x00A5, 0xA5) // YEN SIGN + REMAP(0x00A6, 0xA6) // BROKEN BAR + REMAP(0x00A7, 0xA7) // SECTION SIGN + REMAP(0x00A8, 0xA8) // DIAERESIS + REMAP(0x00A9, 0xA9) // COPYRIGHT SIGN + REMAP(0x00AA, 0xAA) // FEMININE ORDINAL INDICATOR + REMAP(0x00AB, 0xAB) // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + REMAP(0x00AC, 0xAC) // NOT SIGN + REMAP(0x00AD, 0xAD) // SOFT HYPHEN + REMAP(0x00AE, 0xAE) // REGISTERED SIGN + REMAP(0x00AF, 0xAF) // MACRON + + REMAP(0x00B0, 0xB0) // DEGREE SIGN + REMAP(0x00B1, 0xB1) // PLUS-MINUS SIGN + REMAP(0x00B2, 0xB2) // SUPERSCRIPT TWO + REMAP(0x00B3, 0xB3) // SUPERSCRIPT THREE + REMAP(0x00B4, 0xB4) // ACUTE ACCENT + REMAP(0x00B5, 0xB5) // MICRO SIGN + REMAP(0x00B6, 0xB6) // PILCROW SIGN + REMAP(0x00B7, 0xB7) // MIDDLE DOT + REMAP(0x00B8, 0xB8) // CEDILLA + REMAP(0x00B9, 0xB9) // SUPERSCRIPT ONE + REMAP(0x00BA, 0xBA) // MASCULINE ORDINAL INDICATOR + REMAP(0x00BB, 0xBB) // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + REMAP(0x00BC, 0xBC) // VULGAR FRACTION ONE QUARTER + REMAP(0x00BD, 0xBD) // VULGAR FRACTION ONE HALF + REMAP(0x00BE, 0xBE) // VULGAR FRACTION THREE QUARTERS + REMAP(0x00BF, 0xBF) // INVERTED QUESTION MARK + + REMAP(0x00C0, 0xC0) // LATIN CAPITAL LETTER A WITH GRAVE + REMAP(0x00C1, 0xC1) // LATIN CAPITAL LETTER A WITH ACUTE + REMAP(0x00C2, 0xC2) // LATIN CAPITAL LETTER A WITH CIRCUMFLEX + REMAP(0x00C3, 0xC3) // LATIN CAPITAL LETTER A WITH TILDE + REMAP(0x00C4, 0xC4) // LATIN CAPITAL LETTER A WITH DIAERESIS + REMAP(0x00C5, 0xC5) // LATIN CAPITAL LETTER A WITH RING ABOVE + REMAP(0x00C6, 0xC6) // LATIN CAPITAL LETTER AE + REMAP(0x00C7, 0xC7) // LATIN CAPITAL LETTER C WITH CEDILLA + REMAP(0x00C8, 0xC8) // LATIN CAPITAL LETTER E WITH GRAVE + REMAP(0x00C9, 0xC9) // LATIN CAPITAL LETTER E WITH ACUTE + REMAP(0x00CA, 0xCA) // LATIN CAPITAL LETTER E WITH CIRCUMFLEX + REMAP(0x00CB, 0xCB) // LATIN CAPITAL LETTER E WITH DIAERESIS + REMAP(0x00CC, 0xCC) // LATIN CAPITAL LETTER I WITH GRAVE + REMAP(0x00CD, 0xCD) // LATIN CAPITAL LETTER I WITH ACUTE + REMAP(0x00CE, 0xCE) // LATIN CAPITAL LETTER I WITH CIRCUMFLEX + REMAP(0x00CF, 0xCF) // LATIN CAPITAL LETTER I WITH DIAERESIS + + REMAP(0x00D0, 0xD0) // LATIN CAPITAL LETTER ETH + REMAP(0x00D1, 0xD1) // LATIN CAPITAL LETTER N WITH TILDE + REMAP(0x00D2, 0xD2) // LATIN CAPITAL LETTER O WITH GRAVE + REMAP(0x00D3, 0xD3) // LATIN CAPITAL LETTER O WITH ACUTE + REMAP(0x00D4, 0xD4) // LATIN CAPITAL LETTER O WITH CIRCUMFLEX + REMAP(0x00D5, 0xD5) // LATIN CAPITAL LETTER O WITH TILDE + REMAP(0x00D6, 0xD6) // LATIN CAPITAL LETTER O WITH DIAERESIS + REMAP(0x00D7, 0xD7) // MULTIPLICATION SIGN + REMAP(0x00D8, 0xD8) // LATIN CAPITAL LETTER O WITH STROKE + REMAP(0x00D9, 0xD9) // LATIN CAPITAL LETTER U WITH GRAVE + REMAP(0x00DA, 0xDA) // LATIN CAPITAL LETTER U WITH ACUTE + REMAP(0x00DB, 0xDB) // LATIN CAPITAL LETTER U WITH CIRCUMFLEX + REMAP(0x00DC, 0xDC) // LATIN CAPITAL LETTER U WITH DIAERESIS + REMAP(0x00DD, 0xDD) // LATIN CAPITAL LETTER Y WITH ACUTE + REMAP(0x00DE, 0xDE) // LATIN CAPITAL LETTER THORN + REMAP(0x00DF, 0xDF) // LATIN SMALL LETTER SHARP S + + REMAP(0x00E0, 0xE0) // LATIN SMALL LETTER A WITH GRAVE + REMAP(0x00E1, 0xE1) // LATIN SMALL LETTER A WITH ACUTE + REMAP(0x00E2, 0xE2) // LATIN SMALL LETTER A WITH CIRCUMFLEX + REMAP(0x00E3, 0xE3) // LATIN SMALL LETTER A WITH TILDE + REMAP(0x00E4, 0xE4) // LATIN SMALL LETTER A WITH DIAERESIS + REMAP(0x00E5, 0xE5) // LATIN SMALL LETTER A WITH RING ABOVE + REMAP(0x00E6, 0xE6) // LATIN SMALL LETTER AE + REMAP(0x00E7, 0xE7) // LATIN SMALL LETTER C WITH CEDILLA + REMAP(0x00E8, 0xE8) // LATIN SMALL LETTER E WITH GRAVE + REMAP(0x00E9, 0xE9) // LATIN SMALL LETTER E WITH ACUTE + REMAP(0x00EA, 0xEA) // LATIN SMALL LETTER E WITH CIRCUMFLEX + REMAP(0x00EB, 0xEB) // LATIN SMALL LETTER E WITH DIAERESIS + REMAP(0x00EC, 0xEC) // LATIN SMALL LETTER I WITH GRAVE + REMAP(0x00ED, 0xED) // LATIN SMALL LETTER I WITH ACUTE + REMAP(0x00EE, 0xEE) // LATIN SMALL LETTER I WITH CIRCUMFLEX + REMAP(0x00EF, 0xEF) // LATIN SMALL LETTER I WITH DIAERESIS + + REMAP(0x00F0, 0xF0) // LATIN SMALL LETTER ETH + REMAP(0x00F1, 0xF1) // LATIN SMALL LETTER N WITH TILDE + REMAP(0x00F2, 0xF2) // LATIN SMALL LETTER O WITH GRAVE + REMAP(0x00F3, 0xF3) // LATIN SMALL LETTER O WITH ACUTE + REMAP(0x00F4, 0xF4) // LATIN SMALL LETTER O WITH CIRCUMFLEX + REMAP(0x00F5, 0xF5) // LATIN SMALL LETTER O WITH TILDE + REMAP(0x00F6, 0xF6) // LATIN SMALL LETTER O WITH DIAERESIS + REMAP(0x00F7, 0xF7) // DIVISION SIGN + REMAP(0x00F8, 0xF8) // LATIN SMALL LETTER O WITH STROKE + REMAP(0x00F9, 0xF9) // LATIN SMALL LETTER U WITH GRAVE + REMAP(0x00FA, 0xFA) // LATIN SMALL LETTER U WITH ACUTE + REMAP(0x00FB, 0xFB) // LATIN SMALL LETTER U WITH CIRCUMFLEX + REMAP(0x00FC, 0xFC) // LATIN SMALL LETTER U WITH DIAERESIS + REMAP(0x00FD, 0xFD) // LATIN SMALL LETTER Y WITH ACUTE + REMAP(0x00FE, 0xFE) // LATIN SMALL LETTER THORN + REMAP(0x00FF, 0xFF) // LATIN SMALL LETTER Y WITH DIAERESIS + } + } + + // If not handled, return DEL + // Todo: swap this to SUB, and modify the fonts + return '\x7F'; + +// Sweep up the syntactic sugar +// Don't want ants in the house +#undef REMAP } #endif \ No newline at end of file diff --git a/src/graphics/niche/InkHUD/AppletFont.h b/src/graphics/niche/InkHUD/AppletFont.h index 504bd12b3..67348b8d3 100644 --- a/src/graphics/niche/InkHUD/AppletFont.h +++ b/src/graphics/niche/InkHUD/AppletFont.h @@ -4,10 +4,7 @@ Wrapper class for an AdafruitGFX font Pre-calculates some font dimension info which InkHUD uses repeatedly - - Also contains an optional set of "substitutions". - These can be used to detect special UTF8 chars, and replace occurrences with a remapped char val to suit a custom font - These can also be used to swap UTF8 chars for a suitable ASCII substitution (e.g. German ö -> oe, etc) + Re-encodes UTF-8 characters to suit extended ASCII AdafruitGFX fonts */ @@ -24,36 +21,61 @@ namespace NicheGraphics::InkHUD class AppletFont { public: + enum Encoding { + ASCII, + WINDOWS_1250, + WINDOWS_1251, + WINDOWS_1252, + }; + AppletFont(); - explicit AppletFont(const GFXfont &adafruitGFXFont); + AppletFont(const GFXfont &adafruitGFXFont, Encoding encoding = ASCII, int8_t paddingTop = 0, int8_t paddingBottom = 0); uint8_t lineHeight(); uint8_t heightAboveCursor(); uint8_t heightBelowCursor(); uint8_t widthBetweenWords(); // Width of the space character - void applySubstitutions(std::string *text); // Run all char-substitution operations, prior to printing - void addSubstitution(const char *from, const char *to); // Register a find-replace action, for remapping UTF8 chars - void addSubstitutionsWin1251(); // Cyrillic fonts: remap UTF8 values to their Win-1251 equivalent - // Todo: Polish font + std::string decodeUTF8(std::string encoded); const GFXfont *gfxFont = NULL; // Default value: in-built AdafruitGFX font private: + uint32_t toUtf32(std::string utf8); + char applyEncoding(std::string utf8); + uint8_t height = 8; // Default value: in-built AdafruitGFX font uint8_t ascenderHeight = 0; // Default value: in-built AdafruitGFX font uint8_t descenderHeight = 8; // Default value: in-built AdafruitGFX font uint8_t spaceCharWidth = 8; // Default value: in-built AdafruitGFX font - // One pair of find-replace values, for substituting or remapping UTF8 chars - struct Substitution { - const char *from; - const char *to; - }; - - std::vector substitutions; // List of all character substitutions to run, prior to printing a string + Encoding encoding = ASCII; }; } // namespace NicheGraphics::InkHUD +// Macros for InkHUD's standard fonts +// -------------------------------------- + +// Use these once only, passing them to InkHUD::Applet::fontLarge and InkHUD::Applet:fontSmall +// Line padding has been adjusted manually, to compensate for a few *extra tall* diacritics + +// Central European +#include "graphics/niche/Fonts/FreeSans6pt_Win1250.h" +#include "graphics/niche/Fonts/FreeSans9pt_Win1250.h" +#define FREESANS_9PT_WIN1250 InkHUD::AppletFont(FreeSans9pt_Win1250, InkHUD::AppletFont::WINDOWS_1250, -1, -1) +#define FREESANS_6PT_WIN1250 InkHUD::AppletFont(FreeSans6pt_Win1250, InkHUD::AppletFont::WINDOWS_1250, -1, -2) + +// Cyrillic +#include "graphics/niche/Fonts/FreeSans6pt_Win1251.h" +#include "graphics/niche/Fonts/FreeSans9pt_Win1251.h" +#define FREESANS_9PT_WIN1251 InkHUD::AppletFont(FreeSans9pt_Win1251, InkHUD::AppletFont::WINDOWS_1251, -2, -1) +#define FREESANS_6PT_WIN1251 InkHUD::AppletFont(FreeSans6pt_Win1251, InkHUD::AppletFont::WINDOWS_1251, -1, -2) + +// Western European +#include "graphics/niche/Fonts/FreeSans6pt_Win1252.h" +#include "graphics/niche/Fonts/FreeSans9pt_Win1252.h" +#define FREESANS_9PT_WIN1252 InkHUD::AppletFont(FreeSans9pt_Win1252, InkHUD::AppletFont::WINDOWS_1252, -2, -1) +#define FREESANS_6PT_WIN1252 InkHUD::AppletFont(FreeSans6pt_Win1252, InkHUD::AppletFont::WINDOWS_1252, -1, -2) + #endif \ No newline at end of file diff --git a/src/graphics/niche/InkHUD/Applets/Bases/Map/MapApplet.cpp b/src/graphics/niche/InkHUD/Applets/Bases/Map/MapApplet.cpp index ea7b74262..db0805f4e 100644 --- a/src/graphics/niche/InkHUD/Applets/Bases/Map/MapApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/Bases/Map/MapApplet.cpp @@ -286,6 +286,10 @@ void InkHUD::MapApplet::drawLabeledMarker(meshtastic_NodeInfoLite *node) bool isOurNode = node->num == nodeDB->getNodeNum(); bool unknownHops = !node->has_hops_away && !isOurNode; + // Parse any non-ascii chars in the short name, + // and use last 4 instead if unknown / can't render + std::string shortName = parseShortName(node); + // We will draw a left or right hand variant, to place text towards screen center // Hopefully avoid text spilling off screen // Most values are the same, regardless of left-right handedness @@ -299,7 +303,7 @@ void InkHUD::MapApplet::drawLabeledMarker(meshtastic_NodeInfoLite *node) markerSize = map(node->hops_away, 0, config.lora.hop_limit, markerSizeMax, markerSizeMin); // Common dimensions (left or right variant) - textW = getTextWidth(node->user.short_name); + textW = getTextWidth(shortName); if (textW == 0) paddingInnerW = 0; // If no text, no padding for text textH = fontSmall.lineHeight(); @@ -325,7 +329,7 @@ void InkHUD::MapApplet::drawLabeledMarker(meshtastic_NodeInfoLite *node) drawRect(labelX, labelY, labelW, labelH, BLACK); // Short name - printAt(textX, textY, node->user.short_name, LEFT, MIDDLE); + printAt(textX, textY, shortName, LEFT, MIDDLE); // If the label is for our own node, // fade it by overdrawing partially with white diff --git a/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp b/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp index 8ede40780..7fa31b244 100644 --- a/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp @@ -142,16 +142,18 @@ void InkHUD::NodeListApplet::onRender() meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeNum); // -- Shortname -- - // use "?" if unknown - if (node && node->has_user) - shortName = node->user.short_name; + // Parse special chars in the short name + // Use "?" if unknown + if (node) + shortName = parseShortName(node); else shortName = "?"; // -- Longname -- - // use node id if unknown + // Parse special chars in long name + // Use node id if unknown if (node && node->has_user) - longName = node->user.long_name; // Found in nodeDB + longName = parse(node->user.long_name); // Found in nodeDB else { // Not found in nodeDB, show a hex nodeid instead longName = hexifyNodeNum(nodeNum); diff --git a/src/graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.cpp b/src/graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.cpp index b12ea4809..c52719e55 100644 --- a/src/graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.cpp @@ -9,6 +9,12 @@ using namespace NicheGraphics; void InkHUD::BasicExampleApplet::onRender() { printAt(0, 0, "Hello, World!"); + + // If text might contain "special characters", is needs parsing first + // This applies to data such as text-messages and and node names + + // std::string greeting = parse("Grüezi mitenand!"); + // printAt(0, 0, greeting); } #endif \ No newline at end of file diff --git a/src/graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h b/src/graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h index f280afcda..22670a0f0 100644 --- a/src/graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h +++ b/src/graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h @@ -5,7 +5,7 @@ An example of an InkHUD applet. Tells us when a new text message arrives. -This applet makes use of the MeshModule API to detect new messages, +This applet makes use of the Module API to detect new messages, which is a general part of the Meshtastic firmware, and not part of InkHUD. In variants//nicheGraphics.h: diff --git a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp index 5ca9692c8..9fdfad8ee 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp @@ -244,6 +244,7 @@ void InkHUD::MenuApplet::execute(MenuItem item) void InkHUD::MenuApplet::showPage(MenuPage page) { items.clear(); + items.shrink_to_fit(); switch (page) { case ROOT: diff --git a/src/graphics/niche/InkHUD/Applets/System/Notification/NotificationApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Notification/NotificationApplet.cpp index aa702c032..f9439fab8 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Notification/NotificationApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Notification/NotificationApplet.cpp @@ -33,11 +33,6 @@ int InkHUD::NotificationApplet::onReceiveTextMessage(const meshtastic_MeshPacket if (getFrom(p) == nodeDB->getNodeNum()) return 0; - // Abort if message was only an "emoji reaction" - // Possibly some implementation of this in future? - if (p->decoded.emoji) - return 0; - Notification n; n.timestamp = getValidTime(RTCQuality::RTCQualityDevice, true); // Current RTC time @@ -122,7 +117,7 @@ void InkHUD::NotificationApplet::onRender() int16_t textM = divX + padW + (getTextWidth(text) / 2); // Restrict area for printing - // - don't overlap border, or diveder + // - don't overlap border, or divider setCrop(divX + 1, 1, (width() - (divX + 1) - 1), height() - 2); // Drop shadow @@ -241,7 +236,8 @@ std::string InkHUD::NotificationApplet::getNotificationText(uint16_t widthAvaila } } - return text; + // Parse any non-ascii characters and return + return parse(text); } #endif \ No newline at end of file diff --git a/src/graphics/niche/InkHUD/Applets/System/Pairing/PairingApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Pairing/PairingApplet.cpp index 81de05b30..3f51c7f88 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Pairing/PairingApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Pairing/PairingApplet.cpp @@ -23,9 +23,9 @@ void InkHUD::PairingApplet::onRender() // Device's bluetooth name, if it will fit setFont(fontSmall); - std::string name = "Name: " + std::string(getDeviceName()); + std::string name = "Name: " + parse(getDeviceName()); if (getTextWidth(name) > width()) // Too wide, try without the leading "Name: " - name = std::string(getDeviceName()); + name = parse(getDeviceName()); if (getTextWidth(name) < width()) // Does it fit? printAt(X(0.5), Y(0.75), name, CENTER, MIDDLE); } diff --git a/src/graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.cpp b/src/graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.cpp index f7e2a8e9d..968775302 100644 --- a/src/graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.cpp @@ -27,11 +27,6 @@ int InkHUD::AllMessageApplet::onReceiveTextMessage(const meshtastic_MeshPacket * if (getFrom(p) == nodeDB->getNodeNum()) return 0; - // Abort if message was only an "emoji reaction" - // Possibly some implemetation of this in future? - if (p->decoded.emoji) - return 0; - requestAutoshow(); // Want to become foreground, if permitted requestUpdate(); // Want to update display, if applet is foreground @@ -100,19 +95,22 @@ void InkHUD::AllMessageApplet::onRender() // Print message text // =================== + // Parse any non-ascii chars in the message + std::string text = parse(message->text); + // Extra gap below the header int16_t textTop = headerDivY + padDivH; // Determine size if printed large setFont(fontLarge); - uint32_t textHeight = getWrappedTextHeight(0, width(), message->text); + uint32_t textHeight = getWrappedTextHeight(0, width(), text); // If too large, swap to small font if (textHeight + textTop > (uint32_t)height()) // (compare signed and unsigned) setFont(fontSmall); // Print text - printWrapped(0, textTop, width(), message->text); + printWrapped(0, textTop, width(), text); } // Don't show notifications for text messages when our applet is displayed diff --git a/src/graphics/niche/InkHUD/Applets/User/DM/DMApplet.cpp b/src/graphics/niche/InkHUD/Applets/User/DM/DMApplet.cpp index 7a1d14f32..3c69495ed 100644 --- a/src/graphics/niche/InkHUD/Applets/User/DM/DMApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/User/DM/DMApplet.cpp @@ -23,11 +23,6 @@ int InkHUD::DMApplet::onReceiveTextMessage(const meshtastic_MeshPacket *p) if (!isActive()) return 0; - // Abort if only an "emoji reactions" - // Possibly some implemetation of this in future? - if (p->decoded.emoji) - return 0; - // If DM (not broadcast) if (!isBroadcast(p->to)) { // Want to update display, if applet is foreground @@ -96,19 +91,22 @@ void InkHUD::DMApplet::onRender() // Print message text // =================== + // Parse any non-ascii chars in the message + std::string text = parse(latestMessage->dm.text); + // Extra gap below the header int16_t textTop = headerDivY + padDivH; // Determine size if printed large setFont(fontLarge); - uint32_t textHeight = getWrappedTextHeight(0, width(), latestMessage->dm.text); + uint32_t textHeight = getWrappedTextHeight(0, width(), text); // If too large, swap to small font if (textHeight + textTop > (uint32_t)height()) // (compare signed and unsigned) setFont(fontSmall); // Print text - printWrapped(0, textTop, width(), latestMessage->dm.text); + printWrapped(0, textTop, width(), text); } // Don't show notifications for direct messages when our applet is displayed diff --git a/src/graphics/niche/InkHUD/Applets/User/Heard/HeardApplet.cpp b/src/graphics/niche/InkHUD/Applets/User/Heard/HeardApplet.cpp index ceb9c01fe..5a659c606 100644 --- a/src/graphics/niche/InkHUD/Applets/User/Heard/HeardApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/User/Heard/HeardApplet.cpp @@ -16,7 +16,7 @@ void InkHUD::HeardApplet::onActivate() void InkHUD::HeardApplet::onDeactivate() { - // Avoid an unlikely situation where frquent activation / deactivation populated duplicate info from node DB + // Avoid an unlikely situation where frequent activation / deactivation populates duplicate info from node DB cards.clear(); } @@ -41,6 +41,7 @@ void InkHUD::HeardApplet::handleParsed(CardInfo c) cards.push_front(c); // Insert into base class' card collection cards.resize(min(maxCards(), (uint8_t)cards.size())); // Don't keep more cards than we could *ever* fit on screen + cards.shrink_to_fit(); // Our rendered image needs to change if: if (previous.nodeNum != c.nodeNum // Different node @@ -54,7 +55,7 @@ void InkHUD::HeardApplet::handleParsed(CardInfo c) } // When applet is activated, pre-fill with stale data from NodeDB -// We're sorting using the last_heard value. Succeptible to weirdness if node's RTC changes. +// We're sorting using the last_heard value. Susceptible to weirdness if node's RTC changes. // No SNR is available in node db, so we can't calculate signal either // These initial cards from node db will be gradually pushed out by new packets which originate from out base applet instead void InkHUD::HeardApplet::populateFromNodeDB() @@ -72,7 +73,7 @@ void InkHUD::HeardApplet::populateFromNodeDB() return (top->last_heard > bottom->last_heard); }); - // Keep the most recent entries onlyt + // Keep the most recent entries only // Just enough to fill the screen if (ordered.size() > maxCards()) ordered.resize(maxCards()); diff --git a/src/graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.cpp b/src/graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.cpp index 02aa4a721..1ccf7fc14 100644 --- a/src/graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.cpp @@ -53,6 +53,7 @@ void InkHUD::RecentsListApplet::handleParsed(CardInfo c) cards.push_front(c); // Store this CardInfo cards.resize(min(maxCards(), (uint8_t)cards.size())); // Don't keep more cards than we could *ever* fit on screen + cards.shrink_to_fit(); // Record the time of this observation // Used to count active nodes, and to know when to prune inactive nodes @@ -99,10 +100,12 @@ void InkHUD::RecentsListApplet::prune() if (!isActive(ages.at(i).seenAtMs)) { // Drop this item, and all others behind it ages.resize(i); + ages.shrink_to_fit(); cards.resize(i); + cards.shrink_to_fit(); // Request an update, if pruning did modify our data - // Required if pruning was scheduled. Redundent if pruning was prior to rendering. + // Required if pruning was scheduled. Redundant if pruning was prior to rendering. requestAutoshow(); requestUpdate(); diff --git a/src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.cpp b/src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.cpp index d7d2e79c8..d5d7f77f8 100644 --- a/src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.cpp @@ -71,27 +71,28 @@ void InkHUD::ThreadedMessageApplet::onRender() MessageStore::Message &m = store->messages.at(i); bool outgoing = (m.sender == 0); meshtastic_NodeInfoLite *sender = nodeDB->getMeshNode(m.sender); + std::string bodyText = parse(m.text); // Parse any non-ascii chars in the message // Cache bottom Y of message text // - Used when drawing vertical line alongside const int16_t dotsB = msgB; // Get dimensions for message text - uint16_t bodyH = getWrappedTextHeight(msgL, msgW, m.text); + uint16_t bodyH = getWrappedTextHeight(msgL, msgW, bodyText); int16_t bodyT = msgB - bodyH; // Print message // - if incoming if (!outgoing) - printWrapped(msgL, bodyT, msgW, m.text); + printWrapped(msgL, bodyT, msgW, bodyText); // Print message // - if outgoing else { - if (getTextWidth(m.text) < width()) // If short, - printAt(msgR, bodyT, m.text, RIGHT); // print right align - else // If long, - printWrapped(msgL, bodyT, msgW, m.text); // need printWrapped(), which doesn't support right align + if (getTextWidth(bodyText) < width()) // If short, + printAt(msgR, bodyT, bodyText, RIGHT); // print right align + else // If long, + printWrapped(msgL, bodyT, msgW, bodyText); // need printWrapped(), which doesn't support right align } // Move cursor up @@ -103,12 +104,16 @@ void InkHUD::ThreadedMessageApplet::onRender() // - shortname, if possible, or "me" // - time received, if possible std::string info; - if (sender && sender->has_user) - info += sender->user.short_name; - else if (outgoing) + if (outgoing) info += "Me"; - else - info += hexifyNodeNum(m.sender); + else { + // Check if sender is node db + meshtastic_NodeInfoLite *sender = nodeDB->getMeshNode(m.sender); + if (sender) + info += parseShortName(sender); // Handle any unprintable chars in short name + else + info += hexifyNodeNum(m.sender); // No node info at all. Print the node num + } std::string timeString = getTimeString(m.timestamp); if (timeString.length() > 0) { @@ -195,11 +200,6 @@ int InkHUD::ThreadedMessageApplet::onReceiveTextMessage(const meshtastic_MeshPac if (p->to != NODENUM_BROADCAST) return 0; - // Abort if messages was an "emoji reaction" - // Possibly some implemetation of this in future? - if (p->decoded.emoji) - return 0; - // Extract info into our slimmed-down "StoredMessage" type MessageStore::Message newMessage; newMessage.timestamp = getValidTime(RTCQuality::RTCQualityDevice, true); // Current RTC time diff --git a/src/graphics/niche/InkHUD/Events.cpp b/src/graphics/niche/InkHUD/Events.cpp index d0bd35250..ee6c04938 100644 --- a/src/graphics/niche/InkHUD/Events.cpp +++ b/src/graphics/niche/InkHUD/Events.cpp @@ -146,11 +146,6 @@ int InkHUD::Events::onReceiveTextMessage(const meshtastic_MeshPacket *packet) if (getFrom(packet) == nodeDB->getNodeNum()) return 0; - // Short circuit: don't store "emoji reactions" - // Possibly some implementation of this in future? - if (packet->decoded.emoji) - return 0; - // Determine whether the message is broadcast or a DM // Store this info to prevent confusion after a reboot // Avoids need to compare timestamps, because of situation where "future" messages block newly received, if time not set diff --git a/src/graphics/niche/InkHUD/docs/README.md b/src/graphics/niche/InkHUD/docs/README.md index c3082add1..b504d46c1 100644 --- a/src/graphics/niche/InkHUD/docs/README.md +++ b/src/graphics/niche/InkHUD/docs/README.md @@ -13,7 +13,7 @@ This document is intended as a reference for maintainers. A haphazard collection - [Non-interactive](#non-interactive) - [Customizable](#customizable) - [Event-Driven Rendering](#event-driven-rendering) - - [No `#ifdef` spaghetti](#no-ifdef-spaghetti) + - [Avoid the Preprocessor](#avoid-the-preprocessor) - [The Implementation](#the-implementation) - [The Rendering Process](#the-rendering-process) - [Concepts](#concepts) @@ -23,6 +23,10 @@ This document is intended as a reference for maintainers. A haphazard collection - [Adding a Variant](#adding-a-variant) - [platformio.ini](#platformioini) - [nicheGraphics.h](#nichegraphicsh) +- [Fonts](#fonts) + - [Parsing Unicode Text](#parsing-unicode-text) + - [Localization](#localization) + - [Creating / Modifying](#creating--modifying) - [Class Notes](#class-notes) - [`InkHUD::InkHUD`](#inkhudinkhud) - [`InkHUD::Persistence`](#inkhudpersistence) @@ -73,9 +77,11 @@ The user should be given the choice to decide which information they would like The display image does not update "automatically". Individual applets are responsible for deciding when they have new information to show, and then requesting a display update. -### No `#ifdef` spaghetti +### Avoid the Preprocessor -**Don't** use preprocessor macros for device-specific configuration. This should be achieved with config methods, in [`nicheGraphics.h`](#nichegraphicsh). +**Don't** use preprocessor macros to write code which targets individual devices. + +**Do** configure InkHUD to suit each device in [`nicheGraphics.h`](#nichegraphicsh). **Do** use preprocessor macros to guard all files @@ -103,7 +109,7 @@ The display image does not update "automatically". Individual applets are respon (animated diagram) -animated process diagram of InkHUD rendering +animated process diagram of InkHUD rendering An overview: @@ -281,11 +287,14 @@ ${esp32s3_base.lib_deps} ### nicheGraphics.h -⚠ Wrap this file in `#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS` +Should contain a `setupNicheGraphics` method, which creates and configures the various components for InkHUD. -`nicheGraphics.h` should be placed in the same folder as your variant's `platformio.ini`. If this is not possible, modify `build_src_filter`. +For well commented examples, see: -`nicheGraphics.h` should contain a `setupNicheGraphics` method, which creates and configures the various components for InkHUD. +- `/variants/heltec_vision_master_e290/nicheGraphics.h` (ESP32) +- `/variants/ELECROW-ThinkNode-M1/nicheGraphics.h` (NRF52) + +As a general overview: - Display - Start SPI @@ -301,10 +310,80 @@ ${esp32s3_base.lib_deps} - Setup `TwoButton` driver (user button, optional "auxiliary" button) - Connect to InkHUD handlers (use lambdas) -For well commented examples, see: +## Fonts -- `variants/heltec_vision_master_e290/nicheGraphics.h` (ESP32) -- `variants/t-echo/nicheGraphics.h` (NRF52) +InkHUD uses AdafruitGFX fonts. The large and small font which are shared by all applets are set in nicheGraphics.h. + +```cpp +// Prepare fonts +InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; +InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; + +// Using a generic AdafruitGFX font instead: +// InkHUD::Applet::fontLarge = FreeSerif9pt7b; +``` + +Any generic AdafruitGFX font may be used, but the fonts which are bundled with InkHUD have been customized with extended-ASCII character sets. + +### Parsing Unicode Text + +Text received by the firmware is encoded as UTF-8. + +Applets must manually parse any text which may contain non-ASCII characters. Strings like text-messages and node names should be parsed. + +```cpp +std::string greeting = "Góðan daginn!"; +std::string parsed = parse(greeting); +``` + +This will re-encode the characters to match whichever extended-ASCII font InkHUD has been built with. + +### Localization + +InkHUD is bundled with extended-ASCII fonts for: + +- Windows-1250 (Central European) +- Windows-1251 (Cyrillic) +- Windows-1252 (Western European) + +The default builds use Windows-1252 encoding. This can be changed in nicheGraphics.h. + +```cpp +InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1250; +InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1250; + +InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1251; +InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1251; +``` + +### Creating / Modifying + +For basic conversion and editing, online tools might be sufficient: + +- [https://rop.nl/truetype2gfx/](https://rop.nl/truetype2gfx/) - converting from ttf +- [https://tchapi.github.io/Adafruit-GFX-Font-Customiser/](https://tchapi.github.io/Adafruit-GFX-Font-Customiser/) - editing glyphs + +For heavy editing, this offline workflow is suggested: + +- [FontForge](https://fontforge.org/en-US/) + - re-ordering glyphs + - Encoding > Load Encoding + - Encoding > Reencode + - .ttf to .bdf conversion + - Element > Bitmap Strikes Available.. + - File > Generate Fonts +- [GFXFontEditor](https://github.com/ScottFerg56/GFXFontEditor) + - manual glyph correction + - .bdf to AdafruitGFX .h conversion + - File > Edit Font Properties + - right-click glyph list, flatten font + - File > Save As + - manually edit exported .h + - remove `#include ` + +If possible, custom Extended-ASCII fonts should use one of the encodings which InkHUD already supports. If this is not possible, a mapping for the new encoding will need to be added. + +See [Encoding](#encoding) for details on using an extended-ASCII font. ## Class Notes @@ -628,17 +707,30 @@ The default AdafruitGFX text handling places characters "upon a line", as if han The height of this box is `AppletFont::lineHeight`, which is the height of the tallest character in the font. This gives us a fixed-height for text, which is much tighter than with AdafruitGFX's default line spacing. -#### UTF-8 Substitutions +#### Encoding -To enable non-English text, the `AppletFont` class includes a mechanism to detect specific UTF-8 characters, and replace them with alternative glyphs from the AdafruitGFX font. This can be used to remap characters for a custom font, or to offer a suitable ASCII replacement. +An AppletFont may be constructed from a standard 7bit ASCII AdafruitGFX font, however InkHUD also supports 8bit extended-ASCII fonts. + +For this, the encoding must be specified when instantiating the AppletFont. ```cpp -// With a custom font -// ї is ASCII 0xBF, in Windows-1251 encoding -addSubstitution("ї", "\xBF"); - -// Substitution (with a default font) -addSubstitution("ö", "oe"); +InkHUD::AppletFont(FreeSans9pt_Win1250, InkHUD::AppletFont::WINDOWS_1250); ``` -These substitutions should be performed in a variant's `setupNicheGraphics` method. For convenience, some common ASCII encodings have ready-to-go sets of substitutions you can apply, for example `AppletFont::addSubstitutionsWin1251` +Currently supported encodings are: + +- ASCII +- Windows-1250 (Central European) +- Windows-1251 (Cyrillic) +- Windows-1252 (Western European) + +To add support for additional encodings, add to the `AppletFont::Encodings` enum, and then define the mapping from unicode in `AppletFont::applyEncoding`. + +#### Custom Line Height + +Some fonts may have a handful of especially tall characters, especially extended-ASCII fonts with diacritcs. Ideally, the font should be modified to help resolve this, but if the problem remains, manual offsets to the automatically determined line height can be specified in the constructor. + +```cpp +// -2 px of padding above, +1 px of padding below +InkHUD::AppletFont(FreeSans9pt7b, ASCII, -2, 1); +``` diff --git a/variants/ELECROW-ThinkNode-M1/nicheGraphics.h b/variants/ELECROW-ThinkNode-M1/nicheGraphics.h index f68ac9edd..c2c351925 100644 --- a/variants/ELECROW-ThinkNode-M1/nicheGraphics.h +++ b/variants/ELECROW-ThinkNode-M1/nicheGraphics.h @@ -22,10 +22,6 @@ #include "graphics/niche/Drivers/EInk/GDEY0154D67.h" #include "graphics/niche/Inputs/TwoButton.h" -#include "graphics/niche/Fonts/FreeSans6pt7b.h" -#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h" -#include - void setupNicheGraphics() { using namespace NicheGraphics; @@ -33,14 +29,13 @@ void setupNicheGraphics() // SPI // ----------------------------- - // For NRF52 platforms, SPI pins are defined in variant.h, not passed to begin() + // For NRF52 platforms, SPI pins are defined in variant.h SPI1.begin(); - // Driver + // E-Ink Driver // ----------------------------- - // Use E-Ink driver - Drivers::EInk *driver = new Drivers::GDEY0154D67; // Todo: confirm display model + Drivers::EInk *driver = new Drivers::GDEY0154D67; driver->begin(&SPI1, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); // InkHUD @@ -48,7 +43,7 @@ void setupNicheGraphics() InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance(); - // Set the driver + // Set the E-Ink driver inkhud->setDriver(driver); // Set how many FAST updates per FULL update @@ -57,33 +52,27 @@ void setupNicheGraphics() // Currently set to the values given by Elecrow for EInkDynamicDisplay. inkhud->setDisplayResilience(10, 1.5); - // Prepare fonts - InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b); - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b); - /* - // Font localization demo: Cyrillic - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic); - InkHUD::Applet::fontSmall.addSubstitutionsWin1251(); - */ + // Select fonts + InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Customize default settings inkhud->persistence->settings.userTiles.maxCount = 2; // Two applets side-by-side - inkhud->persistence->settings.rotation = 0; // To be confirmed? inkhud->persistence->settings.optionalFeatures.batteryIcon = true; // Device definitely has a battery - // Setup backlight - // Note: button mapping for this configured further down + // Setup backlight controller + // Note: button is attached further down Drivers::LatchingBacklight *backlight = Drivers::LatchingBacklight::getInstance(); backlight->setPin(PIN_EINK_EN); // 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); // Inactive - inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive - inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive + 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); // Inactive + 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 @@ -94,25 +83,25 @@ void setupNicheGraphics() Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component - // As labeled on Elecrow diagram: https://www.elecrow.com/download/product/CIL12901M/ThinkNode-M1_User_Manual.pdf - constexpr uint8_t PAGE_TURN_BUTTON = 0; - constexpr uint8_t FUNCTION_BUTTON = 1; + // Elecrow diagram: https://www.elecrow.com/download/product/CIL12901M/ThinkNode-M1_User_Manual.pdf - // Setup the main user button - buttons->setWiring(PAGE_TURN_BUTTON, PIN_BUTTON2); - buttons->setTiming(PAGE_TURN_BUTTON, 50, 500); // Todo: confirm 50ms is adequate debounce - buttons->setHandlerShortPress(PAGE_TURN_BUTTON, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); - buttons->setHandlerLongPress(PAGE_TURN_BUTTON, []() { InkHUD::InkHUD::getInstance()->longpress(); }); + // #0: Main User Button + // Labeled "Page Turn Button" by manual + buttons->setWiring(0, PIN_BUTTON2); + buttons->setTiming(0, 50, 500); // Todo: confirm 50ms is adequate debounce + buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); }); + buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); }); - // Setup the aux button - // Initial testing only: mapped to the backlight + // #1: Aux Button + // Labeled "Function Button" by manual // Todo: additional features - buttons->setWiring(FUNCTION_BUTTON, PIN_BUTTON1); - buttons->setTiming(FUNCTION_BUTTON, 50, 500); // 500ms before latch - buttons->setHandlerDown(FUNCTION_BUTTON, [backlight]() { backlight->peek(); }); - buttons->setHandlerLongPress(FUNCTION_BUTTON, [backlight]() { backlight->latch(); }); - buttons->setHandlerShortPress(FUNCTION_BUTTON, [backlight]() { backlight->off(); }); + buttons->setWiring(1, PIN_BUTTON1); + buttons->setTiming(1, 50, 500); // 500ms before latch + buttons->setHandlerDown(1, [backlight]() { backlight->peek(); }); + buttons->setHandlerLongPress(1, [backlight]() { backlight->latch(); }); + buttons->setHandlerShortPress(1, [backlight]() { backlight->off(); }); + // Begin handling button events buttons->start(); } diff --git a/variants/heltec_mesh_pocket/nicheGraphics.h b/variants/heltec_mesh_pocket/nicheGraphics.h index b697faa57..271a35d6d 100644 --- a/variants/heltec_mesh_pocket/nicheGraphics.h +++ b/variants/heltec_mesh_pocket/nicheGraphics.h @@ -16,54 +16,42 @@ #include "graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.h" #include "graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h" -// #include "graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.h" -// #include "graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h" - // Shared NicheGraphics components // -------------------------------- #include "graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h" #include "graphics/niche/Inputs/TwoButton.h" -#include "graphics/niche/Fonts/FreeSans6pt7b.h" -#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h" -#include - void setupNicheGraphics() { using namespace NicheGraphics; // SPI // ----------------------------- - SPIClass *spi1 = &SPI1; - spi1->begin(); - // Display is connected to SPI1 + + // For NRF52 platforms, SPI pins are defined in variant.h + SPI1.begin(); // E-Ink Driver // ----------------------------- - // Use E-Ink driver + Drivers::EInk *driver = new Drivers::LCMEN2R13ECC1; - driver->begin(spi1, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); + driver->begin(&SPI1, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); // InkHUD // ---------------------------- InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance(); - // Set the driver + // 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); - // Prepare fonts - InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b); - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b); - /* - // Font localization demo: Cyrillic - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic); - InkHUD::Applet::fontSmall.addSubstitutionsWin1251(); - */ + // Select fonts + InkHUD::Applet::fontLarge = 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? @@ -72,15 +60,14 @@ void setupNicheGraphics() 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); // Inactive - inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive - inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive + 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); // Inactive - inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, not autoshown, default on tile 0 - // inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet); - // inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet); + 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(); @@ -89,18 +76,13 @@ void setupNicheGraphics() // -------------------------- Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component - constexpr uint8_t MAIN_BUTTON = 0; - // constexpr uint8_t AUX_BUTTON = 1; - // Setup the main user button - buttons->setWiring(MAIN_BUTTON, Inputs::TwoButton::getUserButtonPin()); - buttons->setHandlerShortPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); - buttons->setHandlerLongPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->longpress(); }); + // #0: Main User Button + buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin()); + buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); }); + buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); }); - // Setup the aux button - // Bonus feature of VME213 - // buttons->setWiring(AUX_BUTTON, BUTTON_PIN_SECONDARY); - // buttons->setHandlerShortPress(AUX_BUTTON, []() { InkHUD::InkHUD::getInstance()->nextTile(); }); + // Begin handling button events buttons->start(); } diff --git a/variants/heltec_vision_master_e213/nicheGraphics.h b/variants/heltec_vision_master_e213/nicheGraphics.h index d6983bafe..7eccb2955 100644 --- a/variants/heltec_vision_master_e213/nicheGraphics.h +++ b/variants/heltec_vision_master_e213/nicheGraphics.h @@ -16,18 +16,11 @@ #include "graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.h" #include "graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h" -// #include "graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.h" -// #include "graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h" - // Shared NicheGraphics components // -------------------------------- #include "graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h" #include "graphics/niche/Inputs/TwoButton.h" -#include "graphics/niche/Fonts/FreeSans6pt7b.h" -#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h" -#include - void setupNicheGraphics() { using namespace NicheGraphics; @@ -42,7 +35,6 @@ void setupNicheGraphics() // E-Ink Driver // ----------------------------- - // Use E-Ink driver Drivers::EInk *driver = new Drivers::LCMEN213EFC1; driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); @@ -51,21 +43,16 @@ void setupNicheGraphics() InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance(); - // Set the driver + // 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); - // Prepare fonts - InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b); - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b); - /* - // Font localization demo: Cyrillic - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic); - InkHUD::Applet::fontSmall.addSubstitutionsWin1251(); - */ + // Select fonts + InkHUD::Applet::fontLarge = 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? @@ -74,15 +61,14 @@ void setupNicheGraphics() inkhud->persistence->settings.optionalMenuItems.nextTile = false; // Behavior handled by aux button instead // 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); // Inactive - inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive - inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive + 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); // Inactive + inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // - inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, not autoshown, default on tile 0 - // inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet); - // inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet); // Start running InkHUD inkhud->begin(); @@ -91,18 +77,17 @@ void setupNicheGraphics() // -------------------------- Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component - constexpr uint8_t MAIN_BUTTON = 0; - constexpr uint8_t AUX_BUTTON = 1; - // Setup the main user button - buttons->setWiring(MAIN_BUTTON, Inputs::TwoButton::getUserButtonPin()); - buttons->setHandlerShortPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); - buttons->setHandlerLongPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->longpress(); }); + // #0: Main User Button + buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin()); + buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); }); + buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); }); - // Setup the aux button - // Bonus feature of VME213 - buttons->setWiring(AUX_BUTTON, BUTTON_PIN_SECONDARY); - buttons->setHandlerShortPress(AUX_BUTTON, []() { InkHUD::InkHUD::getInstance()->nextTile(); }); + // #1: Aux Button + buttons->setWiring(1, BUTTON_PIN_SECONDARY); + buttons->setHandlerShortPress(1, [inkhud]() { inkhud->nextTile(); }); + + // Begin handling button events buttons->start(); } diff --git a/variants/heltec_vision_master_e290/nicheGraphics.h b/variants/heltec_vision_master_e290/nicheGraphics.h index c2f26c7ff..af78df746 100644 --- a/variants/heltec_vision_master_e290/nicheGraphics.h +++ b/variants/heltec_vision_master_e290/nicheGraphics.h @@ -29,18 +29,11 @@ Different NicheGraphics UIs and different hardware variants will each have their #include "graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.h" #include "graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h" -// #include "graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.h" -// #include "graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h" - // Shared NicheGraphics components // -------------------------------- #include "graphics/niche/Drivers/EInk/DEPG0290BNS800.h" #include "graphics/niche/Inputs/TwoButton.h" -#include "graphics/niche/Fonts/FreeSans6pt7b.h" -#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h" -#include - void setupNicheGraphics() { using namespace NicheGraphics; @@ -55,7 +48,6 @@ void setupNicheGraphics() // E-Ink Driver // ----------------------------- - // Use E-Ink driver Drivers::EInk *driver = new Drivers::DEPG0290BNS800; driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY); @@ -64,21 +56,16 @@ void setupNicheGraphics() InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance(); - // Set the driver + // 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(7, 1.5); - // Prepare fonts - InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b); - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b); - /* - // Font localization demo: Cyrillic - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic); - InkHUD::Applet::fontSmall.addSubstitutionsWin1251(); - */ + // Select fonts + InkHUD::Applet::fontLarge = 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? @@ -87,22 +74,14 @@ void setupNicheGraphics() inkhud->persistence->settings.optionalMenuItems.nextTile = false; // Behavior handled by aux button instead // Pick applets - - // Order of applets determines priority of "auto-show" feature. - // Optional arguments for default state: - // - is activated? - // - is autoshown? - // - is foreground on a specific tile (index)? - + // 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); // Inactive - inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive - inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive + 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); // Inactive + inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // - inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, not autoshown, default on tile 0 - // inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet); - // inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet); // Start running InkHUD inkhud->begin(); @@ -112,16 +91,16 @@ void setupNicheGraphics() Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // A shared NicheGraphics component - // Setup the main user button (0) + // #0: Main User Button buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin()); - buttons->setHandlerShortPress(0, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); - buttons->setHandlerLongPress(0, []() { InkHUD::InkHUD::getInstance()->longpress(); }); + buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); }); + buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); }); - // Setup the aux button (1) - // Bonus feature of VME290 + // #1: Aux Button buttons->setWiring(1, BUTTON_PIN_SECONDARY); - buttons->setHandlerShortPress(1, []() { InkHUD::InkHUD::getInstance()->nextTile(); }); + buttons->setHandlerShortPress(1, [inkhud]() { inkhud->nextTile(); }); + // Begin handling button events buttons->start(); } diff --git a/variants/heltec_wireless_paper/nicheGraphics.h b/variants/heltec_wireless_paper/nicheGraphics.h index 5e938fa64..c8994b7f1 100644 --- a/variants/heltec_wireless_paper/nicheGraphics.h +++ b/variants/heltec_wireless_paper/nicheGraphics.h @@ -16,18 +16,11 @@ #include "graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.h" #include "graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h" -// #include "graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.h" -// #include "graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h" - // Shared NicheGraphics components // -------------------------------- #include "graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h" #include "graphics/niche/Inputs/TwoButton.h" -#include "graphics/niche/Fonts/FreeSans6pt7b.h" -#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h" -#include - void setupNicheGraphics() { using namespace NicheGraphics; @@ -42,7 +35,6 @@ void setupNicheGraphics() // E-Ink Driver // ----------------------------- - // Use E-Ink driver Drivers::EInk *driver = new Drivers::LCMEN213EFC1; driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); @@ -51,21 +43,16 @@ void setupNicheGraphics() InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance(); - // Set the driver + // 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); - // Prepare fonts - InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b); - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b); - /* - // Font localization demo: Cyrillic - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic); - InkHUD::Applet::fontSmall.addSubstitutionsWin1251(); - */ + // Select fonts + InkHUD::Applet::fontLarge = 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? @@ -73,15 +60,14 @@ void setupNicheGraphics() inkhud->persistence->settings.userTiles.count = 1; // One tile only by default, keep things simple for new users // 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); // Inactive - inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive - inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive + 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); // Inactive + inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // - inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, not autoshown, default on tile 0 - // inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet); - // inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet); // Start running InkHUD inkhud->begin(); @@ -90,15 +76,15 @@ void setupNicheGraphics() // -------------------------- Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component - constexpr uint8_t MAIN_BUTTON = 0; - // Setup the main user button - buttons->setWiring(MAIN_BUTTON, Inputs::TwoButton::getUserButtonPin()); - buttons->setHandlerShortPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); - buttons->setHandlerLongPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->longpress(); }); + // #0: Main User Button + buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin()); + buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); }); + buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); }); // No aux button on this board + // Begin handling button events buttons->start(); } diff --git a/variants/t-echo/nicheGraphics.h b/variants/t-echo/nicheGraphics.h index af310db25..03185cf5b 100644 --- a/variants/t-echo/nicheGraphics.h +++ b/variants/t-echo/nicheGraphics.h @@ -16,19 +16,12 @@ #include "graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.h" #include "graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h" -// #include "graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.h" -// #include "graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h" - // Shared NicheGraphics components // -------------------------------- #include "graphics/niche/Drivers/Backlight/LatchingBacklight.h" #include "graphics/niche/Drivers/EInk/GDEY0154D67.h" #include "graphics/niche/Inputs/TwoButton.h" -#include "graphics/niche/Fonts/FreeSans6pt7b.h" -#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h" -#include - // Special case - fix T-Echo's touch button // ---------------------------------------- // On a handful of T-Echos, LoRa TX triggers the capacitive touch @@ -42,37 +35,30 @@ void setupNicheGraphics() // SPI // ----------------------------- - // For NRF52 platforms, SPI pins are defined in variant.h, not passed to begin() - SPIClass *inkSPI = &SPI1; - inkSPI->begin(); + // For NRF52 platforms, SPI pins are defined in variant.h + SPI1.begin(); - // Driver + // E-Ink Driver // ----------------------------- - // Use E-Ink driver Drivers::EInk *driver = new Drivers::GDEY0154D67; - driver->begin(inkSPI, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); + driver->begin(&SPI1, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); // InkHUD // ---------------------------- InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance(); - // Set the driver + // 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(20, 1.5); - // Prepare fonts - InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b); - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b); - /* - // Font localization demo: Cyrillic - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic); - InkHUD::Applet::fontSmall.addSubstitutionsWin1251(); - */ + // Select fonts + InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Customize default settings inkhud->persistence->settings.userTiles.maxCount = 2; // Two applets side-by-side @@ -80,22 +66,20 @@ void setupNicheGraphics() inkhud->persistence->settings.optionalFeatures.batteryIcon = true; // Device definitely has a battery inkhud->persistence->settings.optionalMenuItems.backlight = true; // Until proves capacitive button works by touching it - // Setup backlight - // Note: AUX button behavior configured further down + // Setup backlight controller + // Note: AUX button attached further down Drivers::LatchingBacklight *backlight = Drivers::LatchingBacklight::getInstance(); backlight->setPin(PIN_EINK_EN); // 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 - // inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet); - // inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet); + 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(); @@ -105,22 +89,19 @@ void setupNicheGraphics() Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component - // (To improve code readability only) - constexpr uint8_t MAIN_BUTTON = 0; - constexpr uint8_t TOUCH_BUTTON = 1; + // #0: Main User Button + buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin()); + buttons->setTiming(0, 75, 500); + buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); }); + buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); }); - // Setup the main user button - buttons->setWiring(MAIN_BUTTON, Inputs::TwoButton::getUserButtonPin()); - buttons->setTiming(MAIN_BUTTON, 75, 500); - buttons->setHandlerShortPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); - buttons->setHandlerLongPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->longpress(); }); - - // Setup the capacitive touch button + // #1: Aux Button (Capacitive Touch Button) // - short: momentary backlight // - long: latch backlight on - buttons->setWiring(TOUCH_BUTTON, PIN_BUTTON_TOUCH); - buttons->setTiming(TOUCH_BUTTON, 50, 5000); // 5 seconds before latch - limited by T-Echo's capacitive touch IC - buttons->setHandlerDown(TOUCH_BUTTON, [backlight]() { + buttons->setWiring(1, PIN_BUTTON_TOUCH); + buttons->setTiming(1, 50, 5000); // 5 seconds before latch - limited by T-Echo's capacitive touch IC + + buttons->setHandlerDown(1, [inkhud, backlight]() { // Discard the button press if radio is active // Rare hardware fault: LoRa activity triggers touch button if (!RadioLibInterface::instance || RadioLibInterface::instance->isSending()) @@ -131,10 +112,11 @@ void setupNicheGraphics() // Handler has run, which confirms touch button wasn't removed as part of DIY build. // No longer need the fallback backlight toggle in menu. - InkHUD::InkHUD::getInstance()->persistence->settings.optionalMenuItems.backlight = false; + inkhud->persistence->settings.optionalMenuItems.backlight = false; }); - buttons->setHandlerLongPress(TOUCH_BUTTON, [backlight]() { backlight->latch(); }); - buttons->setHandlerShortPress(TOUCH_BUTTON, [backlight]() { backlight->off(); }); + + buttons->setHandlerLongPress(1, [backlight]() { backlight->latch(); }); + buttons->setHandlerShortPress(1, [backlight]() { backlight->off(); }); // Begin handling button events buttons->start(); diff --git a/variants/tlora_t3s3_epaper/nicheGraphics.h b/variants/tlora_t3s3_epaper/nicheGraphics.h index 55bb9a203..5184037e8 100644 --- a/variants/tlora_t3s3_epaper/nicheGraphics.h +++ b/variants/tlora_t3s3_epaper/nicheGraphics.h @@ -16,18 +16,11 @@ #include "graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.h" #include "graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h" -// #include "graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.h" -// #include "graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h" - // Shared NicheGraphics components // -------------------------------- #include "graphics/niche/Drivers/EInk/DEPG0213BNS800.h" #include "graphics/niche/Inputs/TwoButton.h" -#include "graphics/niche/Fonts/FreeSans6pt7b.h" -#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h" -#include - void setupNicheGraphics() { using namespace NicheGraphics; @@ -42,7 +35,6 @@ void setupNicheGraphics() // E-Ink Driver // ----------------------------- - // Use E-Ink driver Drivers::EInk *driver = new Drivers::DEPG0213BNS800; driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); @@ -58,14 +50,9 @@ void setupNicheGraphics() // Set how unhealthy additional FAST updates beyond this number are inkhud->setDisplayResilience(15, 1.5); - // Prepare fonts - InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b); - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b); - /* - // Font localization demo: Cyrillic - InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic); - InkHUD::Applet::fontSmall.addSubstitutionsWin1251(); - */ + // Select fonts + InkHUD::Applet::fontLarge = 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? @@ -73,15 +60,14 @@ void setupNicheGraphics() inkhud->persistence->settings.userTiles.count = 1; // One tile only by default, keep things simple for new users // 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); // Inactive - inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive - inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive + 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); // Inactive + inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // - inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, not autoshown, default on tile 0 - // inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet); - // inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet); // Start running InkHUD inkhud->begin(); @@ -93,8 +79,8 @@ void setupNicheGraphics() // Setup the main user button buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin(), true); - buttons->setHandlerShortPress(0, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); - buttons->setHandlerLongPress(0, []() { InkHUD::InkHUD::getInstance()->longpress(); }); + buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); }); + buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); }); buttons->start(); } From beba1b4882391f841fa18495a8e3db1ead279745 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 22 May 2025 20:33:46 -0500 Subject: [PATCH 197/461] Added map report precision bounds (#6862) * Added map report precision bounds * Log warning * Precision range should be 12-15 * Missed commit * Update tests * That method was renamed * Removed now-defunct test call * Remove defunct test --- src/mqtt/MQTT.cpp | 29 +++++++++++++++-------------- test/test_mqtt/MQTT.cpp | 29 +++-------------------------- 2 files changed, 18 insertions(+), 40 deletions(-) diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 713077272..dca8a3b44 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -773,15 +773,20 @@ void MQTT::perhapsReportToMap() !(moduleConfig.mqtt.proxy_to_client_enabled || isConnectedDirectly())) return; + // Coerce the map position precision to be within the valid range + // This removes obtusely large radius and privacy problematic ones from the map + if (map_position_precision < 12 || map_position_precision > 15) { + LOG_WARN("MQTT Map report position precision %u is out of range, using default %u", map_position_precision, + default_map_position_precision); + map_position_precision = default_map_position_precision; + } + if (Throttle::isWithinTimespanMs(last_report_to_map, map_publish_interval_msecs)) return; - if (map_position_precision == 0 || (localPosition.latitude_i == 0 && localPosition.longitude_i == 0)) { + if (localPosition.latitude_i == 0 && localPosition.longitude_i == 0) { last_report_to_map = millis(); - if (map_position_precision == 0) - LOG_WARN("MQTT Map report enabled, but precision is 0"); - if (localPosition.latitude_i == 0 && localPosition.longitude_i == 0) - LOG_WARN("MQTT Map report enabled, but no position available"); + LOG_WARN("MQTT Map report enabled, but no position available"); return; } @@ -805,15 +810,11 @@ void MQTT::perhapsReportToMap() mapReport.has_opted_report_location = true; // Set position with precision (same as in PositionModule) - if (map_position_precision < 32 && map_position_precision > 0) { - mapReport.latitude_i = localPosition.latitude_i & (UINT32_MAX << (32 - map_position_precision)); - mapReport.longitude_i = localPosition.longitude_i & (UINT32_MAX << (32 - map_position_precision)); - mapReport.latitude_i += (1 << (31 - map_position_precision)); - mapReport.longitude_i += (1 << (31 - map_position_precision)); - } else { - mapReport.latitude_i = localPosition.latitude_i; - mapReport.longitude_i = localPosition.longitude_i; - } + mapReport.latitude_i = localPosition.latitude_i & (UINT32_MAX << (32 - map_position_precision)); + mapReport.longitude_i = localPosition.longitude_i & (UINT32_MAX << (32 - map_position_precision)); + mapReport.latitude_i += (1 << (31 - map_position_precision)); + mapReport.longitude_i += (1 << (31 - map_position_precision)); + mapReport.altitude = localPosition.altitude; mapReport.position_precision = map_position_precision; diff --git a/test/test_mqtt/MQTT.cpp b/test/test_mqtt/MQTT.cpp index c1f5da358..8047079ba 100644 --- a/test/test_mqtt/MQTT.cpp +++ b/test/test_mqtt/MQTT.cpp @@ -708,42 +708,21 @@ void test_reportToMapDefaultImprecise(void) TEST_ASSERT_EQUAL(1, pubsub->published_.size()); const auto &[topic, payload] = pubsub->published_.front(); TEST_ASSERT_EQUAL_STRING("msh/2/map/", topic.c_str()); - verifyLatLong(std::get(payload), 70123520, 30015488); -} - -// Precise location is reported when configured. -void test_reportToMapPrecise(void) -{ - unitTest->reportToMap(/*precision=*/32); - - TEST_ASSERT_EQUAL(1, pubsub->published_.size()); - const auto &[topic, payload] = pubsub->published_.front(); - TEST_ASSERT_EQUAL_STRING("msh/2/map/", topic.c_str()); - verifyLatLong(std::get(payload), localPosition.latitude_i, localPosition.longitude_i); } // Location is sent over the phone proxy. -void test_reportToMapPreciseProxied(void) +void test_reportToMapImpreciseProxied(void) { moduleConfig.mqtt.proxy_to_client_enabled = true; MQTTUnitTest::restart(); - unitTest->reportToMap(/*precision=*/32); + unitTest->reportToMap(/*precision=*/14); TEST_ASSERT_EQUAL(1, mockMeshService->messages_.size()); const meshtastic_MqttClientProxyMessage &message = mockMeshService->messages_.front(); TEST_ASSERT_EQUAL_STRING("msh/2/map/", message.topic); TEST_ASSERT_EQUAL(meshtastic_MqttClientProxyMessage_data_tag, message.which_payload_variant); const DecodedServiceEnvelope env(message.payload_variant.data.bytes, message.payload_variant.data.size); - verifyLatLong(env, localPosition.latitude_i, localPosition.longitude_i); -} - -// No location is reported when the precision is invalid. -void test_reportToMapInvalidPrecision(void) -{ - unitTest->reportToMap(/*precision=*/0); - - TEST_ASSERT_TRUE(pubsub->published_.empty()); } // isUsingDefaultServer returns true when using the default server. @@ -920,9 +899,7 @@ void setup() RUN_TEST(test_publishTextMessageDirect); RUN_TEST(test_publishTextMessageWithProxy); RUN_TEST(test_reportToMapDefaultImprecise); - RUN_TEST(test_reportToMapPrecise); - RUN_TEST(test_reportToMapPreciseProxied); - RUN_TEST(test_reportToMapInvalidPrecision); + RUN_TEST(test_reportToMapImpreciseProxied); RUN_TEST(test_usingDefaultServer); RUN_TEST(test_usingDefaultServerWithPort); RUN_TEST(test_usingDefaultServerWithInvalidPort); From c01db9881983200e2fc97fbf726a2e5f1f6fa2be Mon Sep 17 00:00:00 2001 From: dylanli Date: Fri, 23 May 2025 21:04:17 +0800 Subject: [PATCH 198/461] update seeed solar node led pin (#6871) --- variants/seeed_solar_node/variant.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/variants/seeed_solar_node/variant.h b/variants/seeed_solar_node/variant.h index 86682302b..30d5c5888 100644 --- a/variants/seeed_solar_node/variant.h +++ b/variants/seeed_solar_node/variant.h @@ -20,8 +20,8 @@ // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // LEDs // LEDs -#define PIN_LED1 (11) // LED P1.15 -#define PIN_LED2 (12) // +#define PIN_LED1 (12) // LED P1.15 +#define PIN_LED2 (11) // #define LED_BUILTIN PIN_LED1 #define LED_CONN PIN_LED2 @@ -154,4 +154,4 @@ extern "C" { } #endif -#endif // _SEEED_SOLAR_NODE_H_ \ No newline at end of file +#endif // _SEEED_SOLAR_NODE_H_ From 3aed7b4190fb98906715c2448e62401cd174d1d9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 23 May 2025 15:51:26 +0200 Subject: [PATCH 199/461] Update Adafruit PM25 AQI Sensor to v2 (#6778) --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index ae3cbd53b..458aabed2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -132,7 +132,7 @@ lib_deps = # renovate: datasource=custom.pio depName=Adafruit INA219 packageName=adafruit/library/Adafruit INA219 adafruit/Adafruit INA219@1.2.3 # renovate: datasource=custom.pio depName=Adafruit PM25 AQI Sensor packageName=adafruit/library/Adafruit PM25 AQI Sensor - adafruit/Adafruit PM25 AQI Sensor@1.2.0 + adafruit/Adafruit PM25 AQI Sensor@2.0.0 # renovate: datasource=custom.pio depName=Adafruit MPU6050 packageName=adafruit/library/Adafruit MPU6050 adafruit/Adafruit MPU6050@2.2.6 # renovate: datasource=custom.pio depName=Adafruit LIS3DH packageName=adafruit/library/Adafruit LIS3DH From 067d01b8324071ef0146a6d109ea66e3afe92947 Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 23 May 2025 16:35:13 -0400 Subject: [PATCH 200/461] Bosch bsec2: Switch back to official releases (#6870) --- platformio.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platformio.ini b/platformio.ini index 458aabed2..7502de0d7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -147,8 +147,6 @@ lib_deps = emotibit/EmotiBit MLX90632@1.0.8 # renovate: datasource=custom.pio depName=Adafruit MLX90614 packageName=adafruit/library/Adafruit MLX90614 Library adafruit/Adafruit MLX90614 Library@2.1.5 - # renovate: datasource=custom.pio depName=Bosch BME68x packageName=boschsensortec/library/BME68x Sensor Library - boschsensortec/BME68x Sensor Library@1.2.40408 # renovate: datasource=github-tags depName=INA3221 packageName=KodinLanewave/INA3221 https://github.com/KodinLanewave/INA3221/archive/1.0.1.zip # renovate: datasource=custom.pio depName=QMC5883L Compass packageName=mprograms/library/QMC5883LCompass @@ -185,7 +183,9 @@ lib_deps = sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6 # renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001 ClosedCube OPT3001@1.1.2 - # renovate: datasource=git-refs depName=Bosch BSEC2 packageName=https://github.com/meshtastic/Bosch-BSEC2-Library gitBranch=extra_script - https://github.com/meshtastic/Bosch-BSEC2-Library/archive/e16952dfe5addd4287e1eb8c4f6ecac0fa3dd3de.zip + # renovate: datasource=custom.pio depName=Bosch BSEC2 packageName=boschsensortec/library/bsec2 + boschsensortec/bsec2@1.10.2610 + # renovate: datasource=custom.pio depName=Bosch BME68x packageName=boschsensortec/library/BME68x Sensor Library + boschsensortec/BME68x Sensor Library@1.3.40408 # renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip From 2c9e1694514961791f93dca91ce857822f44d53a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 24 May 2025 11:33:21 +0200 Subject: [PATCH 201/461] Update meshtastic/device-ui digest to 0e9bb79 (#6880) fix bluetooth fixedPin during restart (#135) --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 7502de0d7..836b723af 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/405ca495322b7dc3b61f7588d28267d49b2ebc38.zip + https://github.com/meshtastic/device-ui/archive/0e9bb792bb4b015b487397427781eda2767c87e6.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 30e83d36b7474159524952bdef83f5e7a345a582 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 24 May 2025 19:55:19 -0500 Subject: [PATCH 202/461] Update meshtastic/device-ui digest to 2fba9de (#6882) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 836b723af..c1012c810 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/0e9bb792bb4b015b487397427781eda2767c87e6.zip + https://github.com/meshtastic/device-ui/archive/2fba9def30b52bbfd13cc5b76f61f257428325e7.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 9b69c2a9af7f950c825869000d908da17a12dd33 Mon Sep 17 00:00:00 2001 From: Chiho Sin Date: Sun, 25 May 2025 19:08:41 +0800 Subject: [PATCH 203/461] graphics: Add GDEY0213B74 E-Ink display driver (#6879) Implement the GDEY0213B74 driver with configuration methods for scanning, waveform, update sequence, and polling for refresh completion. This driver supports both fast and full update types for the 2.13 inch E-Ink display. Signed-off-by: ChihoSin chihosin@icloud.com Signed-off-by: ChihoSin chihosin@icloud.com --- .../niche/Drivers/EInk/GDEY0213B74.cpp | 61 +++++++++++++++++++ src/graphics/niche/Drivers/EInk/GDEY0213B74.h | 42 +++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 src/graphics/niche/Drivers/EInk/GDEY0213B74.cpp create mode 100644 src/graphics/niche/Drivers/EInk/GDEY0213B74.h diff --git a/src/graphics/niche/Drivers/EInk/GDEY0213B74.cpp b/src/graphics/niche/Drivers/EInk/GDEY0213B74.cpp new file mode 100644 index 000000000..a0ff63258 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/GDEY0213B74.cpp @@ -0,0 +1,61 @@ +#include "./GDEY0213B74.h" + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +using namespace NicheGraphics::Drivers; + +// Map the display controller IC's output to the connected panel +void GDEY0213B74::configScanning() +{ + // "Driver output control" + sendCommand(0x01); + sendData(0xF9); + sendData(0x00); + sendData(0x00); + + // To-do: delete this method? + // Values set here might be redundant: F9, 00, 00 seems to be default +} + +// Specify which information is used to control the sequence of voltages applied to move the pixels +// - For this display, configUpdateSequence() specifies that a suitable LUT will be loaded from +// the controller IC's OTP memory, when the update procedure begins. +void GDEY0213B74::configWaveform() +{ + sendCommand(0x3C); // Border waveform: + sendData(0x05); // Screen border should follow LUT1 waveform (actively drive pixels white) + + sendCommand(0x18); // Temperature sensor: + sendData(0x80); // Use internal temperature sensor to select an appropriate refresh waveform +} + +void GDEY0213B74::configUpdateSequence() +{ + switch (updateType) { + case FAST: + sendCommand(0x22); // Set "update sequence" + sendData(0xFF); // Will load LUT from OTP memory, Display mode 2 "differential refresh" + break; + + case FULL: + default: + sendCommand(0x22); // Set "update sequence" + sendData(0xF7); // Will load LUT from OTP memory + break; + } +} + +// Once the refresh operation has been started, +// begin periodically polling the display to check for completion, using the normal Meshtastic threading code +// Only used when refresh is "async" +void GDEY0213B74::detachFromUpdate() +{ + switch (updateType) { + case FAST: + return beginPolling(50, 500); // At least 500ms for fast refresh + case FULL: + default: + return beginPolling(100, 2000); // At least 2 seconds for full refresh + } +} +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/GDEY0213B74.h b/src/graphics/niche/Drivers/EInk/GDEY0213B74.h new file mode 100644 index 000000000..2212fe92a --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/GDEY0213B74.h @@ -0,0 +1,42 @@ +/* + +E-Ink display driver + - GDEY0213B74 + - Manufacturer: Goodisplay + - Size: 2.13 inch + - Resolution: 250px x 122px + - Flex connector marking: FPC-A002 + +*/ + +#pragma once + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +#include "configuration.h" + +#include "./SSD16XX.h" + +namespace NicheGraphics::Drivers +{ +class GDEY0213B74 : public SSD16XX +{ + // Display properties + private: + static constexpr uint32_t width = 122; + static constexpr uint32_t height = 250; + static constexpr UpdateTypes supported = (UpdateTypes)(FULL | FAST); + + public: + GDEY0213B74() : SSD16XX(width, height, supported) {} + + protected: + virtual void configScanning() override; + virtual void configWaveform() override; + virtual void configUpdateSequence() override; + void detachFromUpdate() override; +}; + +} // namespace NicheGraphics::Drivers + +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file From e29588d2e20acde737dc15e6137956efc72e7234 Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Sun, 25 May 2025 18:26:31 +0700 Subject: [PATCH 204/461] feat(RadioInterface): Tx power gain calculation rework (#6796) - Rename REGULATORY_GAIN_LORA to TX_GAIN_LORA - Move gain-based Tx power clamping from RadioInterface::applyModemConfig() to RadioInterface::limitPower() - User-configured Tx power now matches the Tx power out of the device connector - Re-order [LoRa Chip]Interface.cpp limitPower() to take place before the final Tx power clamping so we clamp based on the pre-PA Tx power rather than user-configured Tx power Tested on XIAO BLE variant. Signed-off-by: Andrew Yong Co-authored-by: Ben Meadors --- src/configuration.h | 8 ++++---- src/mesh/LR11x0Interface.cpp | 4 ++-- src/mesh/RF95Interface.cpp | 4 ++-- src/mesh/RadioInterface.cpp | 11 ++++++++--- src/mesh/STM32WLE5JCInterface.cpp | 4 ++-- src/mesh/SX126xInterface.cpp | 4 ++-- src/mesh/SX128xInterface.cpp | 4 ++-- variants/xiao_ble/variant.h | 4 ++-- 8 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/configuration.h b/src/configuration.h index d319ddb0a..5f6930646 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -80,10 +80,10 @@ along with this program. If not, see . // Override user saved region, for producing region-locked builds // #define REGULATORY_LORA_REGIONCODE meshtastic_Config_LoRaConfig_RegionCode_SG_923 -// Total system gain in dBm to subtract from Tx power to remain within regulatory ERP limit for non-licensed operators -// This value should be set in variant.h and is PA gain + antenna gain (if system ships with an antenna) -#ifndef REGULATORY_GAIN_LORA -#define REGULATORY_GAIN_LORA 0 +// Total system gain in dBm to subtract from Tx power to remain within regulatory and Tx PA limits +// This value should be set in variant.h and is PA gain + antenna gain (if variant has a non-removable antenna) +#ifndef TX_GAIN_LORA +#define TX_GAIN_LORA 0 #endif // ----------------------------------------------------------------------------- diff --git a/src/mesh/LR11x0Interface.cpp b/src/mesh/LR11x0Interface.cpp index aecc8f722..8cc05994c 100644 --- a/src/mesh/LR11x0Interface.cpp +++ b/src/mesh/LR11x0Interface.cpp @@ -71,6 +71,8 @@ template bool LR11x0Interface::init() RadioLibInterface::init(); + limitPower(); + if (power > LR1110_MAX_POWER) // Clamp power to maximum defined level power = LR1110_MAX_POWER; @@ -80,8 +82,6 @@ template bool LR11x0Interface::init() preambleLength = 12; // 12 is the default for operation above 2GHz } - limitPower(); - #ifdef LR11X0_RF_SWITCH_SUBGHZ pinMode(LR11X0_RF_SWITCH_SUBGHZ, OUTPUT); digitalWrite(LR11X0_RF_SWITCH_SUBGHZ, getFreq() < 1e9 ? HIGH : LOW); diff --git a/src/mesh/RF95Interface.cpp b/src/mesh/RF95Interface.cpp index 1dfc72708..943a79a5f 100644 --- a/src/mesh/RF95Interface.cpp +++ b/src/mesh/RF95Interface.cpp @@ -122,11 +122,11 @@ bool RF95Interface::init() power = dacDbValues.db; #endif + limitPower(); + if (power > RF95_MAX_POWER) // This chip has lower power limits than some power = RF95_MAX_POWER; - limitPower(); - iface = lora = new RadioLibRF95(&module); #ifdef RF95_TCXO diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 86903153b..06398e6c3 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -528,8 +528,8 @@ void RadioInterface::applyModemConfig() power = loraConfig.tx_power; - if ((power == 0) || ((power + REGULATORY_GAIN_LORA > myRegion->powerLimit) && !devicestate.owner.is_licensed)) - power = myRegion->powerLimit - REGULATORY_GAIN_LORA; + if ((power == 0) || ((power > myRegion->powerLimit) && !devicestate.owner.is_licensed)) + power = myRegion->powerLimit; if (power == 0) power = 17; // Default to this power level if we don't have a valid regional power limit (powerLimit of myRegion defaults @@ -616,7 +616,12 @@ void RadioInterface::limitPower() power = maxPower; } - LOG_INFO("Set radio: final power level=%d", power); + if (TX_GAIN_LORA > 0) { + LOG_INFO("Requested Tx power: %d dBm; Device LoRa Tx gain: %d dB", power, TX_GAIN_LORA); + power -= TX_GAIN_LORA; + } + + LOG_INFO("Final Tx power: %d dBm", power); } void RadioInterface::deliverToReceiver(meshtastic_MeshPacket *p) diff --git a/src/mesh/STM32WLE5JCInterface.cpp b/src/mesh/STM32WLE5JCInterface.cpp index 6a340dd28..3c8bf89c3 100644 --- a/src/mesh/STM32WLE5JCInterface.cpp +++ b/src/mesh/STM32WLE5JCInterface.cpp @@ -25,11 +25,11 @@ bool STM32WLE5JCInterface::init() lora.setRfSwitchTable(rfswitch_pins, rfswitch_table); + limitPower(); + if (power > STM32WLx_MAX_POWER) // This chip has lower power limits than some power = STM32WLx_MAX_POWER; - limitPower(); - int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage); LOG_INFO("STM32WLx init result %d", res); diff --git a/src/mesh/SX126xInterface.cpp b/src/mesh/SX126xInterface.cpp index c867466b7..e5ecd9302 100644 --- a/src/mesh/SX126xInterface.cpp +++ b/src/mesh/SX126xInterface.cpp @@ -69,11 +69,11 @@ template bool SX126xInterface::init() RadioLibInterface::init(); + limitPower(); + if (power > SX126X_MAX_POWER) // Clamp power to maximum defined level power = SX126X_MAX_POWER; - limitPower(); - int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage, useRegulatorLDO); // \todo Display actual typename of the adapter, not just `SX126x` LOG_INFO("SX126x init result %d", res); diff --git a/src/mesh/SX128xInterface.cpp b/src/mesh/SX128xInterface.cpp index 23a023d3f..2b17543fc 100644 --- a/src/mesh/SX128xInterface.cpp +++ b/src/mesh/SX128xInterface.cpp @@ -62,11 +62,11 @@ template bool SX128xInterface::init() RadioLibInterface::init(); + limitPower(); + if (power > SX128X_MAX_POWER) // This chip has lower power limits than some power = SX128X_MAX_POWER; - limitPower(); - preambleLength = 12; // 12 is the default for this chip, 32 does not RX at all int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength); diff --git a/variants/xiao_ble/variant.h b/variants/xiao_ble/variant.h index d00f8be89..b46aa96ae 100644 --- a/variants/xiao_ble/variant.h +++ b/variants/xiao_ble/variant.h @@ -145,12 +145,12 @@ static const uint8_t SCK = PIN_SPI_SCK; #ifdef EBYTE_E22_900M30S // 10dB PA gain and 30dB rated output; based on measurements from // https://github.com/S5NC/EBYTE_ESP32-S3/blob/main/E22-900M30S%20power%20output%20testing.txt -#define REGULATORY_GAIN_LORA 7 +#define TX_GAIN_LORA 7 #define SX126X_MAX_POWER 22 #endif #ifdef EBYTE_E22_900M33S // 25dB PA gain and 33dB rated output; based on TX Power Curve from E22-900M33S_UserManual_EN_v1.0.pdf -#define REGULATORY_GAIN_LORA 25 +#define TX_GAIN_LORA 25 #define SX126X_MAX_POWER 8 #endif #endif From d3b16c1e474519b3e51ad8fdc0d04e9ccb848ebd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 25 May 2025 06:29:00 -0500 Subject: [PATCH 205/461] Upgrade trunk (#6843) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 79bdf4778..bcb75d550 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -10,14 +10,14 @@ lint: enabled: - renovate@40.0.6 - prettier@3.5.3 - - trufflehog@3.88.29 + - trufflehog@3.88.32 - yamllint@1.37.1 - bandit@1.8.3 - trivy@0.62.1 - taplo@0.9.3 - - ruff@0.11.9 + - ruff@0.11.10 - isort@6.0.1 - - markdownlint@0.44.0 + - markdownlint@0.45.0 - oxipng@9.1.5 - svgo@3.3.2 - actionlint@1.7.7 From c47bdd11f9b17d1e81ee2377d1ee361e80ea869a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 25 May 2025 06:56:21 -0500 Subject: [PATCH 206/461] [create-pull-request] automated change (#6885) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/telemetry.pb.h | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/protobufs b/protobufs index 0b32ce24f..91484534a 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 0b32ce24f029f69635026aec9428b5c8176e2ce1 +Subproject commit 91484534a58cb4da8ab68ac046f1e76fd1936bf7 diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index 4071c611e..4fa673df8 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -277,6 +277,10 @@ typedef struct _meshtastic_LocalStats { /* Number of times we canceled a packet to be relayed, because someone else did it before us. This will always be zero for ROUTERs/REPEATERs. If this number is high, some other node(s) is/are relaying faster than you. */ uint32_t num_tx_relay_canceled; + /* Number of bytes used in the heap */ + uint32_t heap_total_bytes; + /* Number of bytes free in the heap */ + uint32_t heap_free_bytes; } meshtastic_LocalStats; /* Health telemetry metrics */ @@ -374,7 +378,7 @@ extern "C" { #define meshtastic_EnvironmentMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_PowerMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} -#define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0} #define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""} #define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}} @@ -383,7 +387,7 @@ extern "C" { #define meshtastic_EnvironmentMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_PowerMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} -#define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0} #define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""} #define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}} @@ -447,6 +451,8 @@ extern "C" { #define meshtastic_LocalStats_num_rx_dupe_tag 9 #define meshtastic_LocalStats_num_tx_relay_tag 10 #define meshtastic_LocalStats_num_tx_relay_canceled_tag 11 +#define meshtastic_LocalStats_heap_total_bytes_tag 12 +#define meshtastic_LocalStats_heap_free_bytes_tag 13 #define meshtastic_HealthMetrics_heart_bpm_tag 1 #define meshtastic_HealthMetrics_spO2_tag 2 #define meshtastic_HealthMetrics_temperature_tag 3 @@ -544,7 +550,9 @@ X(a, STATIC, SINGULAR, UINT32, num_online_nodes, 7) \ X(a, STATIC, SINGULAR, UINT32, num_total_nodes, 8) \ X(a, STATIC, SINGULAR, UINT32, num_rx_dupe, 9) \ X(a, STATIC, SINGULAR, UINT32, num_tx_relay, 10) \ -X(a, STATIC, SINGULAR, UINT32, num_tx_relay_canceled, 11) +X(a, STATIC, SINGULAR, UINT32, num_tx_relay_canceled, 11) \ +X(a, STATIC, SINGULAR, UINT32, heap_total_bytes, 12) \ +X(a, STATIC, SINGULAR, UINT32, heap_free_bytes, 13) #define meshtastic_LocalStats_CALLBACK NULL #define meshtastic_LocalStats_DEFAULT NULL @@ -621,7 +629,7 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg; #define meshtastic_EnvironmentMetrics_size 113 #define meshtastic_HealthMetrics_size 11 #define meshtastic_HostMetrics_size 264 -#define meshtastic_LocalStats_size 60 +#define meshtastic_LocalStats_size 72 #define meshtastic_Nau7802Config_size 16 #define meshtastic_PowerMetrics_size 30 #define meshtastic_Telemetry_size 272 From 5fbdf4b6dc5f2b01f380cddd74ba17e156ba7bd3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 25 May 2025 07:12:03 -0500 Subject: [PATCH 207/461] chore(deps): update meshtastic/device-ui digest to e63b219 (#6883) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index c1012c810..fc6c06162 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/2fba9def30b52bbfd13cc5b76f61f257428325e7.zip + https://github.com/meshtastic/device-ui/archive/e63b219e78e9655be10745b4037cefd2c608d258.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 2e72850d99a9d2546d69fe529b3025aed6aec12f Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 25 May 2025 07:24:28 -0500 Subject: [PATCH 208/461] Fix is_unmessagable plumbing (#6886) --- src/mesh/TypeConversions.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mesh/TypeConversions.cpp b/src/mesh/TypeConversions.cpp index c47a67e68..17cd92851 100644 --- a/src/mesh/TypeConversions.cpp +++ b/src/mesh/TypeConversions.cpp @@ -87,6 +87,8 @@ meshtastic_UserLite TypeConversions::ConvertToUserLite(meshtastic_User user) memcpy(lite.macaddr, user.macaddr, sizeof(lite.macaddr)); memcpy(lite.public_key.bytes, user.public_key.bytes, sizeof(lite.public_key.bytes)); lite.public_key.size = user.public_key.size; + lite.has_is_unmessagable = user.has_is_unmessagable; + lite.is_unmessagable = user.is_unmessagable; return lite; } @@ -103,6 +105,8 @@ meshtastic_User TypeConversions::ConvertToUser(uint32_t nodeNum, meshtastic_User memcpy(user.macaddr, lite.macaddr, sizeof(user.macaddr)); memcpy(user.public_key.bytes, lite.public_key.bytes, sizeof(user.public_key.bytes)); user.public_key.size = lite.public_key.size; + user.has_is_unmessagable = lite.has_is_unmessagable; + user.is_unmessagable = lite.is_unmessagable; return user; } \ No newline at end of file From 7d95b487efb4da5194e4e3ac66905ab18ffff894 Mon Sep 17 00:00:00 2001 From: Michael Cullen Date: Sun, 25 May 2025 14:29:02 +0200 Subject: [PATCH 209/461] Add PCT2075 Temperature Sensor (#6829) This is an I2C temperature sensor. It is intended to be a drop-in compatible sensor for the LM75, however it is more accurate. Co-authored-by: Ben Meadors --- platformio.ini | 2 ++ src/configuration.h | 1 + src/detect/ScanI2C.h | 1 + src/detect/ScanI2CTwoWire.cpp | 1 + src/main.cpp | 1 + .../Telemetry/EnvironmentTelemetry.cpp | 13 +++++++ .../Telemetry/Sensor/PCT2075Sensor.cpp | 35 +++++++++++++++++++ src/modules/Telemetry/Sensor/PCT2075Sensor.h | 24 +++++++++++++ 8 files changed, 78 insertions(+) create mode 100644 src/modules/Telemetry/Sensor/PCT2075Sensor.cpp create mode 100644 src/modules/Telemetry/Sensor/PCT2075Sensor.h diff --git a/platformio.ini b/platformio.ini index fc6c06162..d7504e6c5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -161,6 +161,8 @@ lib_deps = sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library@1.1.2 # renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.2 + # renovate: datasource=custom.pio depName=Adafruit PCT2075 packageName=adafruit/Adafruit PCT2075 + adafruit/Adafruit PCT2075@1.0.5 ; (not included in native / portduino) [environmental_extra] diff --git a/src/configuration.h b/src/configuration.h index 5f6930646..0c23e677d 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -153,6 +153,7 @@ along with this program. If not, see . #define CGRADSENS_ADDR 0x66 #define LTR390UV_ADDR 0x53 #define XPOWERS_AXP192_AXP2101_ADDRESS 0x34 // same adress as TCA8418 +#define PCT2075_ADDR 0x37 // ----------------------------------------------------------------------------- // ACCELEROMETER diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index c363db1b5..72184db69 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -71,6 +71,7 @@ class ScanI2C DPS310, LTR390UV, TCA8418KB, + PCT2075, } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 9781cbf56..e2ba78a92 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -434,6 +434,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) SCAN_SIMPLE_CASE(MAX1704X_ADDR, MAX17048, "MAX17048", (uint8_t)addr.address); SCAN_SIMPLE_CASE(DFROBOT_RAIN_ADDR, DFROBOT_RAIN, "DFRobot Rain Gauge", (uint8_t)addr.address); SCAN_SIMPLE_CASE(LTR390UV_ADDR, LTR390UV, "LTR390UV", (uint8_t)addr.address); + SCAN_SIMPLE_CASE(PCT2075_ADDR, PCT2075, "PCT2075", (uint8_t)addr.address); #ifdef HAS_TPS65233 SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233", (uint8_t)addr.address); #endif diff --git a/src/main.cpp b/src/main.cpp index 1e46d9db1..7a11ca2e0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -732,6 +732,7 @@ void setup() scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::DFROBOT_RAIN, meshtastic_TelemetrySensorType_DFROBOT_RAIN); scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::LTR390UV, meshtastic_TelemetrySensorType_LTR390UV); scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::DPS310, meshtastic_TelemetrySensorType_DPS310); + scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::PCT2075, meshtastic_TelemetrySensorType_PCT2075); i2cScanner.reset(); #endif diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index 56f9d7433..51f076552 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -157,6 +157,13 @@ BMP3XXSensor bmp3xxSensor; NullSensor bmp3xxSensor; #endif +#if __has_include() +#include "Sensor/PCT2075Sensor.h" +PCT2075Sensor pct2075Sensor; +#else +NullSensor pct2075Sensor; +#endif + RCWL9620Sensor rcwl9620Sensor; CGRadSensSensor cgRadSens; #endif @@ -264,6 +271,8 @@ int32_t EnvironmentTelemetryModule::runOnce() result = max17048Sensor.runOnce(); if (cgRadSens.hasSensor()) result = cgRadSens.runOnce(); + if (pct2075Sensor.hasSensor()) + result = pct2075Sensor.runOnce(); // this only works on the wismesh hub with the solar option. This is not an I2C sensor, so we don't need the // sensormap here. #ifdef HAS_RAKPROT @@ -595,6 +604,10 @@ bool EnvironmentTelemetryModule::getEnvironmentTelemetry(meshtastic_Telemetry *m valid = valid && cgRadSens.getMetrics(m); hasSensor = true; } + if (pct2075Sensor.hasSensor()) { + valid = valid && pct2075Sensor.getMetrics(m); + hasSensor = true; + } #ifdef HAS_RAKPROT valid = valid && rak9154Sensor.getMetrics(m); hasSensor = true; diff --git a/src/modules/Telemetry/Sensor/PCT2075Sensor.cpp b/src/modules/Telemetry/Sensor/PCT2075Sensor.cpp new file mode 100644 index 000000000..d2b50d983 --- /dev/null +++ b/src/modules/Telemetry/Sensor/PCT2075Sensor.cpp @@ -0,0 +1,35 @@ +#include "configuration.h" + +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() + +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "PCT2075Sensor.h" +#include "TelemetrySensor.h" +#include + +PCT2075Sensor::PCT2075Sensor() : TelemetrySensor(meshtastic_TelemetrySensorType_PCT2075, "PCT2075") {} + +int32_t PCT2075Sensor::runOnce() +{ + LOG_INFO("Init sensor: %s", sensorName); + if (!hasSensor()) { + return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; + } + + status = pct2075.begin(nodeTelemetrySensorsMap[sensorType].first, nodeTelemetrySensorsMap[sensorType].second); + + return initI2CSensor(); +} + +void PCT2075Sensor::setup() {} + +bool PCT2075Sensor::getMetrics(meshtastic_Telemetry *measurement) +{ + measurement->variant.environment_metrics.has_temperature = true; + + measurement->variant.environment_metrics.temperature = pct2075.getTemperature(); + + return true; +} + +#endif diff --git a/src/modules/Telemetry/Sensor/PCT2075Sensor.h b/src/modules/Telemetry/Sensor/PCT2075Sensor.h new file mode 100644 index 000000000..842c973d0 --- /dev/null +++ b/src/modules/Telemetry/Sensor/PCT2075Sensor.h @@ -0,0 +1,24 @@ +#pragma once +#include "configuration.h" + +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() + +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include + +class PCT2075Sensor : public TelemetrySensor +{ + private: + Adafruit_PCT2075 pct2075; + + protected: + virtual void setup() override; + + public: + PCT2075Sensor(); + virtual int32_t runOnce() override; + virtual bool getMetrics(meshtastic_Telemetry *measurement) override; +}; + +#endif From 75a49d348622ff537c99a0673f8a9b400448eb9d Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 25 May 2025 11:08:56 -0500 Subject: [PATCH 210/461] Add heap metrics to Local stats (#6887) --- src/modules/Telemetry/DeviceTelemetry.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/Telemetry/DeviceTelemetry.cpp b/src/modules/Telemetry/DeviceTelemetry.cpp index 251608641..43c2dd84c 100644 --- a/src/modules/Telemetry/DeviceTelemetry.cpp +++ b/src/modules/Telemetry/DeviceTelemetry.cpp @@ -9,6 +9,7 @@ #include "Router.h" #include "configuration.h" #include "main.h" +#include "memGet.h" #include #include #include @@ -133,6 +134,9 @@ meshtastic_Telemetry DeviceTelemetryModule::getLocalStatsTelemetry() telemetry.variant.local_stats.num_packets_rx_bad = SimRadio::instance->rxBad; telemetry.variant.local_stats.num_tx_relay = SimRadio::instance->txRelay; } +#else + telemetry.variant.local_stats.heap_total_bytes = memGet.getHeapSize(); + telemetry.variant.local_stats.heap_free_bytes = memGet.getFreeHeap(); #endif if (router) { telemetry.variant.local_stats.num_rx_dupe = router->rxDupe; From f223b8a55d1b6a04d2203d43a32bbb880b428af3 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Mon, 26 May 2025 06:12:52 +1200 Subject: [PATCH 211/461] Add missing parsing of UTF-8 chars (#6889) --- .../Applets/System/Notification/NotificationApplet.cpp | 4 ++-- .../InkHUD/Applets/User/AllMessage/AllMessageApplet.cpp | 6 +++--- src/graphics/niche/InkHUD/Applets/User/DM/DMApplet.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/graphics/niche/InkHUD/Applets/System/Notification/NotificationApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Notification/NotificationApplet.cpp index f9439fab8..ae0836d19 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Notification/NotificationApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Notification/NotificationApplet.cpp @@ -213,7 +213,7 @@ std::string InkHUD::NotificationApplet::getNotificationText(uint16_t widthAvaila // Sender id if (node && node->has_user) - text += node->user.short_name; + text += parseShortName(node); else text += hexifyNodeNum(message->sender); @@ -227,7 +227,7 @@ std::string InkHUD::NotificationApplet::getNotificationText(uint16_t widthAvaila // Sender id if (node && node->has_user) - text += node->user.short_name; + text += parseShortName(node); else text += hexifyNodeNum(message->sender); diff --git a/src/graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.cpp b/src/graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.cpp index 968775302..17d724aee 100644 --- a/src/graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.cpp @@ -67,13 +67,13 @@ void InkHUD::AllMessageApplet::onRender() } // Sender's id - // - shortname, if available, or + // - short name and long name, if available, or // - node id meshtastic_NodeInfoLite *sender = nodeDB->getMeshNode(message->sender); if (sender && sender->has_user) { - header += sender->user.short_name; + header += parseShortName(sender); // May be last-four of node if unprintable (emoji, etc) header += " ("; - header += sender->user.long_name; + header += parse(sender->user.long_name); header += ")"; } else header += hexifyNodeNum(message->sender); diff --git a/src/graphics/niche/InkHUD/Applets/User/DM/DMApplet.cpp b/src/graphics/niche/InkHUD/Applets/User/DM/DMApplet.cpp index 3c69495ed..dbf5c08fb 100644 --- a/src/graphics/niche/InkHUD/Applets/User/DM/DMApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/User/DM/DMApplet.cpp @@ -63,13 +63,13 @@ void InkHUD::DMApplet::onRender() } // Sender's id - // - shortname, if available, or + // - shortname and long name, if available, or // - node id meshtastic_NodeInfoLite *sender = nodeDB->getMeshNode(latestMessage->dm.sender); if (sender && sender->has_user) { - header += sender->user.short_name; + header += parseShortName(sender); // May be last-four of node if unprintable (emoji, etc) header += " ("; - header += sender->user.long_name; + header += parse(sender->user.long_name); header += ")"; } else header += hexifyNodeNum(latestMessage->dm.sender); From 106dd087104d67bc77a3f7c075b8baae996ee95d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 25 May 2025 16:53:02 -0500 Subject: [PATCH 212/461] automated bumps (#6890) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 7 +++++-- version.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 1a7ad284d..30f684fef 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.10 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.9 diff --git a/debian/changelog b/debian/changelog index ae27bc3e9..87e3aea9b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.6.9.0) UNRELEASED; urgency=medium +meshtasticd (2.6.10.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging @@ -13,4 +13,7 @@ meshtasticd (2.6.9.0) UNRELEASED; urgency=medium [ ] * GitHub Actions Automatic version bump - -- Thu, 15 May 2025 11:13:30 +0000 + [ ] + * GitHub Actions Automatic version bump + + -- Sun, 25 May 2025 20:46:49 +0000 diff --git a/version.properties b/version.properties index b0e960697..71de951f1 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 6 -build = 9 +build = 10 From baefda213a0dcb28196ecad4c92170ca6eef773e Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 26 May 2025 07:31:10 -0400 Subject: [PATCH 213/461] Linux: Adjust udev rules for gpio (#6891) --- bin/99-meshtasticd-udev.rules | 5 ++++- debian/meshtasticd.postinst | 7 ++++--- debian/meshtasticd.udev | 5 ++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/bin/99-meshtasticd-udev.rules b/bin/99-meshtasticd-udev.rules index 69a468d7a..1151efafd 100644 --- a/bin/99-meshtasticd-udev.rules +++ b/bin/99-meshtasticd-udev.rules @@ -1,4 +1,7 @@ -# Set spidev ownership to 'spi' group. +# Set spidev ownership to 'spi' group SUBSYSTEM=="spidev", KERNEL=="spidev*", GROUP="spi", MODE="0660" # Allow access to USB CH341 devices SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5512", MODE="0666" +# Set gpio ownership to 'gpio' group +SUBSYSTEM=="*gpiomem*", GROUP="gpio", MODE="0660" +SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660" diff --git a/debian/meshtasticd.postinst b/debian/meshtasticd.postinst index 324865718..fe0dbc332 100755 --- a/debian/meshtasticd.postinst +++ b/debian/meshtasticd.postinst @@ -20,16 +20,17 @@ set -e case "$1" in configure|reconfigure) - # create spi group (for udev rules) - # this group already exists on Raspberry Pi OS + # create spi, gpio groups (for udev rules) + # these groups already exist on Raspberry Pi OS getent group spi >/dev/null 2>/dev/null || addgroup --system spi + getent group gpio >/dev/null 2>/dev/null || addgroup --system gpio # create a meshtasticd group and user getent passwd meshtasticd >/dev/null 2>/dev/null || adduser --system --home /var/lib/meshtasticd --no-create-home meshtasticd getent group meshtasticd >/dev/null 2>/dev/null || addgroup --system meshtasticd adduser meshtasticd meshtasticd >/dev/null 2>/dev/null adduser meshtasticd spi >/dev/null 2>/dev/null + adduser meshtasticd gpio >/dev/null 2>/dev/null # add meshtasticd user to appropriate groups (if they exist) - getent group gpio >/dev/null 2>/dev/null && adduser meshtasticd gpio >/dev/null 2>/dev/null getent group plugdev >/dev/null 2>/dev/null && adduser meshtasticd plugdev >/dev/null 2>/dev/null getent group dialout >/dev/null 2>/dev/null && adduser meshtasticd dialout >/dev/null 2>/dev/null getent group i2c >/dev/null 2>/dev/null && adduser meshtasticd i2c >/dev/null 2>/dev/null diff --git a/debian/meshtasticd.udev b/debian/meshtasticd.udev index 69a468d7a..1151efafd 100644 --- a/debian/meshtasticd.udev +++ b/debian/meshtasticd.udev @@ -1,4 +1,7 @@ -# Set spidev ownership to 'spi' group. +# Set spidev ownership to 'spi' group SUBSYSTEM=="spidev", KERNEL=="spidev*", GROUP="spi", MODE="0660" # Allow access to USB CH341 devices SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5512", MODE="0666" +# Set gpio ownership to 'gpio' group +SUBSYSTEM=="*gpiomem*", GROUP="gpio", MODE="0660" +SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660" From 138dc89442cce81dc902fd057e2132be372206e7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 06:19:35 -0500 Subject: [PATCH 214/461] Upgrade trunk (#6898) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index bcb75d550..91bdf11cb 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -10,12 +10,12 @@ lint: enabled: - renovate@40.0.6 - prettier@3.5.3 - - trufflehog@3.88.32 + - trufflehog@3.88.34 - yamllint@1.37.1 - bandit@1.8.3 - trivy@0.62.1 - taplo@0.9.3 - - ruff@0.11.10 + - ruff@0.11.11 - isort@6.0.1 - markdownlint@0.45.0 - oxipng@9.1.5 From 158c88ddef9382acd2cbf4089f18aecb79745f5b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 15:41:35 -0500 Subject: [PATCH 215/461] [create-pull-request] automated change (#6905) Co-authored-by: jp-bennett <5630967+jp-bennett@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/admin.pb.cpp | 5 + src/mesh/generated/meshtastic/admin.pb.h | 53 +++++++ src/mesh/generated/meshtastic/config.pb.h | 14 +- src/mesh/generated/meshtastic/deviceonly.pb.h | 2 +- src/mesh/generated/meshtastic/localonly.pb.h | 2 +- src/mesh/generated/meshtastic/mesh.pb.cpp | 12 ++ src/mesh/generated/meshtastic/mesh.pb.h | 129 +++++++++++++++++- src/mesh/generated/meshtastic/portnums.pb.h | 2 + 9 files changed, 209 insertions(+), 12 deletions(-) diff --git a/protobufs b/protobufs index 91484534a..022ea79ba 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 91484534a58cb4da8ab68ac046f1e76fd1936bf7 +Subproject commit 022ea79bad79b70d0bee286cd9184916ab47c1b1 diff --git a/src/mesh/generated/meshtastic/admin.pb.cpp b/src/mesh/generated/meshtastic/admin.pb.cpp index 9bf40870f..a9c82f7c0 100644 --- a/src/mesh/generated/meshtastic/admin.pb.cpp +++ b/src/mesh/generated/meshtastic/admin.pb.cpp @@ -18,6 +18,11 @@ PB_BIND(meshtastic_NodeRemoteHardwarePinsResponse, meshtastic_NodeRemoteHardware PB_BIND(meshtastic_SharedContact, meshtastic_SharedContact, AUTO) +PB_BIND(meshtastic_KeyVerificationAdmin, meshtastic_KeyVerificationAdmin, AUTO) + + + + diff --git a/src/mesh/generated/meshtastic/admin.pb.h b/src/mesh/generated/meshtastic/admin.pb.h index 0a46e6275..2a5fd78b0 100644 --- a/src/mesh/generated/meshtastic/admin.pb.h +++ b/src/mesh/generated/meshtastic/admin.pb.h @@ -77,6 +77,19 @@ typedef enum _meshtastic_AdminMessage_BackupLocation { meshtastic_AdminMessage_BackupLocation_SD = 1 } meshtastic_AdminMessage_BackupLocation; +/* Three stages of this request. */ +typedef enum _meshtastic_KeyVerificationAdmin_MessageType { + /* This is the first stage, where a client initiates */ + meshtastic_KeyVerificationAdmin_MessageType_INITIATE_VERIFICATION = 0, + /* After the nonce has been returned over the mesh, the client prompts for the security number + And uses this message to provide it to the node. */ + meshtastic_KeyVerificationAdmin_MessageType_PROVIDE_SECURITY_NUMBER = 1, + /* Once the user has compared the verification message, this message notifies the node. */ + meshtastic_KeyVerificationAdmin_MessageType_DO_VERIFY = 2, + /* This is the cancel path, can be taken at any point */ + meshtastic_KeyVerificationAdmin_MessageType_DO_NOT_VERIFY = 3 +} meshtastic_KeyVerificationAdmin_MessageType; + /* Struct definitions */ /* Parameters for setting up Meshtastic for ameteur radio usage */ typedef struct _meshtastic_HamParameters { @@ -107,6 +120,18 @@ typedef struct _meshtastic_SharedContact { meshtastic_User user; } meshtastic_SharedContact; +/* This message is used by a client to initiate or complete a key verification */ +typedef struct _meshtastic_KeyVerificationAdmin { + meshtastic_KeyVerificationAdmin_MessageType message_type; + /* The nodenum we're requesting */ + uint32_t remote_nodenum; + /* The nonce is used to track the connection */ + uint64_t nonce; + /* The 4 digit code generated by the remote node, and communicated outside the mesh */ + bool has_security_number; + uint32_t security_number; +} meshtastic_KeyVerificationAdmin; + typedef PB_BYTES_ARRAY_T(8) meshtastic_AdminMessage_session_passkey_t; /* This message is handled by the Admin module and is responsible for all settings/channel read/write operations. This message is used to do settings operations to both remote AND local nodes. @@ -212,6 +237,8 @@ typedef struct _meshtastic_AdminMessage { bool commit_edit_settings; /* Add a contact (User) to the nodedb */ meshtastic_SharedContact add_contact; + /* Initiate or respond to a key verification request */ + meshtastic_KeyVerificationAdmin key_verification; /* Tell the node to factory reset config everything; all device state and configuration will be returned to factory defaults and BLE bonds will be cleared. */ int32_t factory_reset_device; /* Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot) @@ -253,6 +280,10 @@ extern "C" { #define _meshtastic_AdminMessage_BackupLocation_MAX meshtastic_AdminMessage_BackupLocation_SD #define _meshtastic_AdminMessage_BackupLocation_ARRAYSIZE ((meshtastic_AdminMessage_BackupLocation)(meshtastic_AdminMessage_BackupLocation_SD+1)) +#define _meshtastic_KeyVerificationAdmin_MessageType_MIN meshtastic_KeyVerificationAdmin_MessageType_INITIATE_VERIFICATION +#define _meshtastic_KeyVerificationAdmin_MessageType_MAX meshtastic_KeyVerificationAdmin_MessageType_DO_NOT_VERIFY +#define _meshtastic_KeyVerificationAdmin_MessageType_ARRAYSIZE ((meshtastic_KeyVerificationAdmin_MessageType)(meshtastic_KeyVerificationAdmin_MessageType_DO_NOT_VERIFY+1)) + #define meshtastic_AdminMessage_payload_variant_get_config_request_ENUMTYPE meshtastic_AdminMessage_ConfigType #define meshtastic_AdminMessage_payload_variant_get_module_config_request_ENUMTYPE meshtastic_AdminMessage_ModuleConfigType #define meshtastic_AdminMessage_payload_variant_backup_preferences_ENUMTYPE meshtastic_AdminMessage_BackupLocation @@ -262,16 +293,20 @@ extern "C" { +#define meshtastic_KeyVerificationAdmin_message_type_ENUMTYPE meshtastic_KeyVerificationAdmin_MessageType + /* Initializer values for message structs */ #define meshtastic_AdminMessage_init_default {0, {0}, {0, {0}}} #define meshtastic_HamParameters_init_default {"", 0, 0, ""} #define meshtastic_NodeRemoteHardwarePinsResponse_init_default {0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}} #define meshtastic_SharedContact_init_default {0, false, meshtastic_User_init_default} +#define meshtastic_KeyVerificationAdmin_init_default {_meshtastic_KeyVerificationAdmin_MessageType_MIN, 0, 0, false, 0} #define meshtastic_AdminMessage_init_zero {0, {0}, {0, {0}}} #define meshtastic_HamParameters_init_zero {"", 0, 0, ""} #define meshtastic_NodeRemoteHardwarePinsResponse_init_zero {0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}} #define meshtastic_SharedContact_init_zero {0, false, meshtastic_User_init_zero} +#define meshtastic_KeyVerificationAdmin_init_zero {_meshtastic_KeyVerificationAdmin_MessageType_MIN, 0, 0, false, 0} /* Field tags (for use in manual encoding/decoding) */ #define meshtastic_HamParameters_call_sign_tag 1 @@ -281,6 +316,10 @@ extern "C" { #define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_tag 1 #define meshtastic_SharedContact_node_num_tag 1 #define meshtastic_SharedContact_user_tag 2 +#define meshtastic_KeyVerificationAdmin_message_type_tag 1 +#define meshtastic_KeyVerificationAdmin_remote_nodenum_tag 2 +#define meshtastic_KeyVerificationAdmin_nonce_tag 3 +#define meshtastic_KeyVerificationAdmin_security_number_tag 4 #define meshtastic_AdminMessage_get_channel_request_tag 1 #define meshtastic_AdminMessage_get_channel_response_tag 2 #define meshtastic_AdminMessage_get_owner_request_tag 3 @@ -326,6 +365,7 @@ extern "C" { #define meshtastic_AdminMessage_begin_edit_settings_tag 64 #define meshtastic_AdminMessage_commit_edit_settings_tag 65 #define meshtastic_AdminMessage_add_contact_tag 66 +#define meshtastic_AdminMessage_key_verification_tag 67 #define meshtastic_AdminMessage_factory_reset_device_tag 94 #define meshtastic_AdminMessage_reboot_ota_seconds_tag 95 #define meshtastic_AdminMessage_exit_simulator_tag 96 @@ -382,6 +422,7 @@ X(a, STATIC, ONEOF, UINT32, (payload_variant,remove_ignored_node,remove_i X(a, STATIC, ONEOF, BOOL, (payload_variant,begin_edit_settings,begin_edit_settings), 64) \ X(a, STATIC, ONEOF, BOOL, (payload_variant,commit_edit_settings,commit_edit_settings), 65) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,add_contact,add_contact), 66) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,key_verification,key_verification), 67) \ X(a, STATIC, ONEOF, INT32, (payload_variant,factory_reset_device,factory_reset_device), 94) \ X(a, STATIC, ONEOF, INT32, (payload_variant,reboot_ota_seconds,reboot_ota_seconds), 95) \ X(a, STATIC, ONEOF, BOOL, (payload_variant,exit_simulator,exit_simulator), 96) \ @@ -408,6 +449,7 @@ X(a, STATIC, SINGULAR, BYTES, session_passkey, 101) #define meshtastic_AdminMessage_payload_variant_get_ui_config_response_MSGTYPE meshtastic_DeviceUIConfig #define meshtastic_AdminMessage_payload_variant_store_ui_config_MSGTYPE meshtastic_DeviceUIConfig #define meshtastic_AdminMessage_payload_variant_add_contact_MSGTYPE meshtastic_SharedContact +#define meshtastic_AdminMessage_payload_variant_key_verification_MSGTYPE meshtastic_KeyVerificationAdmin #define meshtastic_HamParameters_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, STRING, call_sign, 1) \ @@ -430,21 +472,32 @@ X(a, STATIC, OPTIONAL, MESSAGE, user, 2) #define meshtastic_SharedContact_DEFAULT NULL #define meshtastic_SharedContact_user_MSGTYPE meshtastic_User +#define meshtastic_KeyVerificationAdmin_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, message_type, 1) \ +X(a, STATIC, SINGULAR, UINT32, remote_nodenum, 2) \ +X(a, STATIC, SINGULAR, UINT64, nonce, 3) \ +X(a, STATIC, OPTIONAL, UINT32, security_number, 4) +#define meshtastic_KeyVerificationAdmin_CALLBACK NULL +#define meshtastic_KeyVerificationAdmin_DEFAULT NULL + extern const pb_msgdesc_t meshtastic_AdminMessage_msg; extern const pb_msgdesc_t meshtastic_HamParameters_msg; extern const pb_msgdesc_t meshtastic_NodeRemoteHardwarePinsResponse_msg; extern const pb_msgdesc_t meshtastic_SharedContact_msg; +extern const pb_msgdesc_t meshtastic_KeyVerificationAdmin_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ #define meshtastic_AdminMessage_fields &meshtastic_AdminMessage_msg #define meshtastic_HamParameters_fields &meshtastic_HamParameters_msg #define meshtastic_NodeRemoteHardwarePinsResponse_fields &meshtastic_NodeRemoteHardwarePinsResponse_msg #define meshtastic_SharedContact_fields &meshtastic_SharedContact_msg +#define meshtastic_KeyVerificationAdmin_fields &meshtastic_KeyVerificationAdmin_msg /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_ADMIN_PB_H_MAX_SIZE meshtastic_AdminMessage_size #define meshtastic_AdminMessage_size 511 #define meshtastic_HamParameters_size 31 +#define meshtastic_KeyVerificationAdmin_size 25 #define meshtastic_NodeRemoteHardwarePinsResponse_size 496 #define meshtastic_SharedContact_size 123 diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index edcd7b41c..9d7a96dc8 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -441,6 +441,8 @@ typedef struct _meshtastic_Config_NetworkConfig { char rsyslog_server[33]; /* Flags for enabling/disabling network protocols */ uint32_t enabled_protocols; + /* Enable/Disable ipv6 support */ + bool ipv6_enabled; } meshtastic_Config_NetworkConfig; /* Display Config */ @@ -693,7 +695,7 @@ extern "C" { #define meshtastic_Config_DeviceConfig_init_default {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0} #define meshtastic_Config_PositionConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN} #define meshtastic_Config_PowerConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_Config_NetworkConfig_init_default {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_default, "", 0} +#define meshtastic_Config_NetworkConfig_init_default {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_default, "", 0, 0} #define meshtastic_Config_NetworkConfig_IpV4Config_init_default {0, 0, 0, 0} #define meshtastic_Config_DisplayConfig_init_default {0, _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0, 0, _meshtastic_Config_DisplayConfig_CompassOrientation_MIN, 0} #define meshtastic_Config_LoRaConfig_init_default {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0} @@ -704,7 +706,7 @@ extern "C" { #define meshtastic_Config_DeviceConfig_init_zero {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0} #define meshtastic_Config_PositionConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN} #define meshtastic_Config_PowerConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_Config_NetworkConfig_init_zero {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_zero, "", 0} +#define meshtastic_Config_NetworkConfig_init_zero {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_zero, "", 0, 0} #define meshtastic_Config_NetworkConfig_IpV4Config_init_zero {0, 0, 0, 0} #define meshtastic_Config_DisplayConfig_init_zero {0, _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0, 0, _meshtastic_Config_DisplayConfig_CompassOrientation_MIN, 0} #define meshtastic_Config_LoRaConfig_init_zero {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0} @@ -759,6 +761,7 @@ extern "C" { #define meshtastic_Config_NetworkConfig_ipv4_config_tag 8 #define meshtastic_Config_NetworkConfig_rsyslog_server_tag 9 #define meshtastic_Config_NetworkConfig_enabled_protocols_tag 10 +#define meshtastic_Config_NetworkConfig_ipv6_enabled_tag 11 #define meshtastic_Config_DisplayConfig_screen_on_secs_tag 1 #define meshtastic_Config_DisplayConfig_gps_format_tag 2 #define meshtastic_Config_DisplayConfig_auto_screen_carousel_secs_tag 3 @@ -889,7 +892,8 @@ X(a, STATIC, SINGULAR, BOOL, eth_enabled, 6) \ X(a, STATIC, SINGULAR, UENUM, address_mode, 7) \ X(a, STATIC, OPTIONAL, MESSAGE, ipv4_config, 8) \ X(a, STATIC, SINGULAR, STRING, rsyslog_server, 9) \ -X(a, STATIC, SINGULAR, UINT32, enabled_protocols, 10) +X(a, STATIC, SINGULAR, UINT32, enabled_protocols, 10) \ +X(a, STATIC, SINGULAR, BOOL, ipv6_enabled, 11) #define meshtastic_Config_NetworkConfig_CALLBACK NULL #define meshtastic_Config_NetworkConfig_DEFAULT NULL #define meshtastic_Config_NetworkConfig_ipv4_config_MSGTYPE meshtastic_Config_NetworkConfig_IpV4Config @@ -995,12 +999,12 @@ extern const pb_msgdesc_t meshtastic_Config_SessionkeyConfig_msg; #define meshtastic_Config_DisplayConfig_size 32 #define meshtastic_Config_LoRaConfig_size 85 #define meshtastic_Config_NetworkConfig_IpV4Config_size 20 -#define meshtastic_Config_NetworkConfig_size 202 +#define meshtastic_Config_NetworkConfig_size 204 #define meshtastic_Config_PositionConfig_size 62 #define meshtastic_Config_PowerConfig_size 52 #define meshtastic_Config_SecurityConfig_size 178 #define meshtastic_Config_SessionkeyConfig_size 0 -#define meshtastic_Config_size 205 +#define meshtastic_Config_size 207 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index 2436098da..37f99d8b5 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -360,7 +360,7 @@ extern const pb_msgdesc_t meshtastic_BackupPreferences_msg; /* Maximum encoded size of messages (where known) */ /* meshtastic_NodeDatabase_size depends on runtime parameters */ #define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size -#define meshtastic_BackupPreferences_size 2267 +#define meshtastic_BackupPreferences_size 2269 #define meshtastic_ChannelFile_size 718 #define meshtastic_DeviceState_size 1722 #define meshtastic_NodeInfoLite_size 196 diff --git a/src/mesh/generated/meshtastic/localonly.pb.h b/src/mesh/generated/meshtastic/localonly.pb.h index 53d8d7d80..bb2eefc04 100644 --- a/src/mesh/generated/meshtastic/localonly.pb.h +++ b/src/mesh/generated/meshtastic/localonly.pb.h @@ -187,7 +187,7 @@ extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalConfig_size -#define meshtastic_LocalConfig_size 743 +#define meshtastic_LocalConfig_size 745 #define meshtastic_LocalModuleConfig_size 669 #ifdef __cplusplus diff --git a/src/mesh/generated/meshtastic/mesh.pb.cpp b/src/mesh/generated/meshtastic/mesh.pb.cpp index 6c5c7a4be..11875fadd 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.cpp +++ b/src/mesh/generated/meshtastic/mesh.pb.cpp @@ -21,6 +21,9 @@ PB_BIND(meshtastic_Routing, meshtastic_Routing, AUTO) PB_BIND(meshtastic_Data, meshtastic_Data, 2) +PB_BIND(meshtastic_KeyVerification, meshtastic_KeyVerification, AUTO) + + PB_BIND(meshtastic_Waypoint, meshtastic_Waypoint, AUTO) @@ -48,6 +51,15 @@ PB_BIND(meshtastic_FromRadio, meshtastic_FromRadio, 2) PB_BIND(meshtastic_ClientNotification, meshtastic_ClientNotification, 2) +PB_BIND(meshtastic_KeyVerificationNumberInform, meshtastic_KeyVerificationNumberInform, AUTO) + + +PB_BIND(meshtastic_KeyVerificationNumberRequest, meshtastic_KeyVerificationNumberRequest, AUTO) + + +PB_BIND(meshtastic_KeyVerificationFinal, meshtastic_KeyVerificationFinal, AUTO) + + PB_BIND(meshtastic_FileInfo, meshtastic_FileInfo, AUTO) diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index d6816eeef..c1ec607d6 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -247,6 +247,17 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_NOMADSTAR_METEOR_PRO = 96, /* Elecrow CrowPanel Advance models, ESP32-S3 and TFT with SX1262 radio plugin */ meshtastic_HardwareModel_CROWPANEL = 97, + /* * + Lilygo LINK32 board with sensors */ + meshtastic_HardwareModel_LINK_32 = 98, + /* * + Seeed Tracker L1 */ + meshtastic_HardwareModel_SEEED_TRACKER_L1 = 99, + /* * + Seeed Tracker L1 EINK driver */ + meshtastic_HardwareModel_SEEED_TRACKER_L1_EINK = 100, + /* Reserved ID for future and past use */ + meshtastic_HardwareModel_QWANTZ_TINY_ARMS = 101, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ @@ -680,6 +691,19 @@ typedef struct _meshtastic_Data { uint8_t bitfield; } meshtastic_Data; +typedef PB_BYTES_ARRAY_T(32) meshtastic_KeyVerification_hash1_t; +typedef PB_BYTES_ARRAY_T(32) meshtastic_KeyVerification_hash2_t; +/* The actual over-the-mesh message doing KeyVerification */ +typedef struct _meshtastic_KeyVerification { + /* random value Selected by the requesting node */ + uint64_t nonce; + /* The final authoritative hash, only to be sent by NodeA at the end of the handshake */ + meshtastic_KeyVerification_hash1_t hash1; + /* The intermediary hash (actually derived from hash1), + sent from NodeB to NodeA in response to the initial message. */ + meshtastic_KeyVerification_hash2_t hash2; +} meshtastic_KeyVerification; + /* Waypoint message, used to share arbitrary locations across the mesh */ typedef struct _meshtastic_Waypoint { /* Id of the waypoint */ @@ -907,6 +931,24 @@ typedef struct _meshtastic_QueueStatus { uint32_t mesh_packet_id; } meshtastic_QueueStatus; +typedef struct _meshtastic_KeyVerificationNumberInform { + uint64_t nonce; + char remote_longname[40]; + uint32_t security_number; +} meshtastic_KeyVerificationNumberInform; + +typedef struct _meshtastic_KeyVerificationNumberRequest { + uint64_t nonce; + char remote_longname[40]; +} meshtastic_KeyVerificationNumberRequest; + +typedef struct _meshtastic_KeyVerificationFinal { + uint64_t nonce; + char remote_longname[40]; + bool isSender; + char verification_characters[10]; +} meshtastic_KeyVerificationFinal; + /* A notification message from the device to the client To be used for important messages that should to be displayed to the user in the form of push notifications or validation messages when saving @@ -921,6 +963,12 @@ typedef struct _meshtastic_ClientNotification { meshtastic_LogRecord_Level level; /* The message body of the notification */ char message[400]; + pb_size_t which_payload_variant; + union { + meshtastic_KeyVerificationNumberInform key_verification_number_inform; + meshtastic_KeyVerificationNumberRequest key_verification_number_request; + meshtastic_KeyVerificationFinal key_verification_final; + } payload_variant; } meshtastic_ClientNotification; /* Individual File info for the device */ @@ -1183,6 +1231,7 @@ extern "C" { + #define meshtastic_MeshPacket_priority_ENUMTYPE meshtastic_MeshPacket_Priority #define meshtastic_MeshPacket_delayed_ENUMTYPE meshtastic_MeshPacket_Delayed @@ -1196,6 +1245,9 @@ extern "C" { + + + #define meshtastic_Compressed_portnum_ENUMTYPE meshtastic_PortNum @@ -1215,6 +1267,7 @@ extern "C" { #define meshtastic_RouteDiscovery_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}} #define meshtastic_Routing_init_default {0, {meshtastic_RouteDiscovery_init_default}} #define meshtastic_Data_init_default {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, 0} +#define meshtastic_KeyVerification_init_default {0, {0, {0}}, {0, {0}}} #define meshtastic_Waypoint_init_default {0, false, 0, false, 0, 0, 0, "", "", 0} #define meshtastic_MqttClientProxyMessage_init_default {"", 0, {{0, {0}}}, 0} #define meshtastic_MeshPacket_init_default {0, 0, 0, 0, {meshtastic_Data_init_default}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN, 0, 0, {0, {0}}, 0, 0, 0, 0} @@ -1223,7 +1276,10 @@ extern "C" { #define meshtastic_LogRecord_init_default {"", 0, "", _meshtastic_LogRecord_Level_MIN} #define meshtastic_QueueStatus_init_default {0, 0, 0, 0} #define meshtastic_FromRadio_init_default {0, 0, {meshtastic_MeshPacket_init_default}} -#define meshtastic_ClientNotification_init_default {false, 0, 0, _meshtastic_LogRecord_Level_MIN, ""} +#define meshtastic_ClientNotification_init_default {false, 0, 0, _meshtastic_LogRecord_Level_MIN, "", 0, {meshtastic_KeyVerificationNumberInform_init_default}} +#define meshtastic_KeyVerificationNumberInform_init_default {0, "", 0} +#define meshtastic_KeyVerificationNumberRequest_init_default {0, ""} +#define meshtastic_KeyVerificationFinal_init_default {0, "", 0, ""} #define meshtastic_FileInfo_init_default {"", 0} #define meshtastic_ToRadio_init_default {0, {meshtastic_MeshPacket_init_default}} #define meshtastic_Compressed_init_default {_meshtastic_PortNum_MIN, {0, {0}}} @@ -1240,6 +1296,7 @@ extern "C" { #define meshtastic_RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}} #define meshtastic_Routing_init_zero {0, {meshtastic_RouteDiscovery_init_zero}} #define meshtastic_Data_init_zero {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, 0} +#define meshtastic_KeyVerification_init_zero {0, {0, {0}}, {0, {0}}} #define meshtastic_Waypoint_init_zero {0, false, 0, false, 0, 0, 0, "", "", 0} #define meshtastic_MqttClientProxyMessage_init_zero {"", 0, {{0, {0}}}, 0} #define meshtastic_MeshPacket_init_zero {0, 0, 0, 0, {meshtastic_Data_init_zero}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN, 0, 0, {0, {0}}, 0, 0, 0, 0} @@ -1248,7 +1305,10 @@ extern "C" { #define meshtastic_LogRecord_init_zero {"", 0, "", _meshtastic_LogRecord_Level_MIN} #define meshtastic_QueueStatus_init_zero {0, 0, 0, 0} #define meshtastic_FromRadio_init_zero {0, 0, {meshtastic_MeshPacket_init_zero}} -#define meshtastic_ClientNotification_init_zero {false, 0, 0, _meshtastic_LogRecord_Level_MIN, ""} +#define meshtastic_ClientNotification_init_zero {false, 0, 0, _meshtastic_LogRecord_Level_MIN, "", 0, {meshtastic_KeyVerificationNumberInform_init_zero}} +#define meshtastic_KeyVerificationNumberInform_init_zero {0, "", 0} +#define meshtastic_KeyVerificationNumberRequest_init_zero {0, ""} +#define meshtastic_KeyVerificationFinal_init_zero {0, "", 0, ""} #define meshtastic_FileInfo_init_zero {"", 0} #define meshtastic_ToRadio_init_zero {0, {meshtastic_MeshPacket_init_zero}} #define meshtastic_Compressed_init_zero {_meshtastic_PortNum_MIN, {0, {0}}} @@ -1310,6 +1370,9 @@ extern "C" { #define meshtastic_Data_reply_id_tag 7 #define meshtastic_Data_emoji_tag 8 #define meshtastic_Data_bitfield_tag 9 +#define meshtastic_KeyVerification_nonce_tag 1 +#define meshtastic_KeyVerification_hash1_tag 2 +#define meshtastic_KeyVerification_hash2_tag 3 #define meshtastic_Waypoint_id_tag 1 #define meshtastic_Waypoint_latitude_i_tag 2 #define meshtastic_Waypoint_longitude_i_tag 3 @@ -1367,10 +1430,22 @@ extern "C" { #define meshtastic_QueueStatus_free_tag 2 #define meshtastic_QueueStatus_maxlen_tag 3 #define meshtastic_QueueStatus_mesh_packet_id_tag 4 +#define meshtastic_KeyVerificationNumberInform_nonce_tag 1 +#define meshtastic_KeyVerificationNumberInform_remote_longname_tag 2 +#define meshtastic_KeyVerificationNumberInform_security_number_tag 3 +#define meshtastic_KeyVerificationNumberRequest_nonce_tag 1 +#define meshtastic_KeyVerificationNumberRequest_remote_longname_tag 2 +#define meshtastic_KeyVerificationFinal_nonce_tag 1 +#define meshtastic_KeyVerificationFinal_remote_longname_tag 2 +#define meshtastic_KeyVerificationFinal_isSender_tag 3 +#define meshtastic_KeyVerificationFinal_verification_characters_tag 4 #define meshtastic_ClientNotification_reply_id_tag 1 #define meshtastic_ClientNotification_time_tag 2 #define meshtastic_ClientNotification_level_tag 3 #define meshtastic_ClientNotification_message_tag 4 +#define meshtastic_ClientNotification_key_verification_number_inform_tag 11 +#define meshtastic_ClientNotification_key_verification_number_request_tag 12 +#define meshtastic_ClientNotification_key_verification_final_tag 13 #define meshtastic_FileInfo_file_name_tag 1 #define meshtastic_FileInfo_size_bytes_tag 2 #define meshtastic_Compressed_portnum_tag 1 @@ -1501,6 +1576,13 @@ X(a, STATIC, OPTIONAL, UINT32, bitfield, 9) #define meshtastic_Data_CALLBACK NULL #define meshtastic_Data_DEFAULT NULL +#define meshtastic_KeyVerification_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT64, nonce, 1) \ +X(a, STATIC, SINGULAR, BYTES, hash1, 2) \ +X(a, STATIC, SINGULAR, BYTES, hash2, 3) +#define meshtastic_KeyVerification_CALLBACK NULL +#define meshtastic_KeyVerification_DEFAULT NULL + #define meshtastic_Waypoint_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, id, 1) \ X(a, STATIC, OPTIONAL, SFIXED32, latitude_i, 2) \ @@ -1629,9 +1711,36 @@ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,deviceuiConfig,deviceuiConfi X(a, STATIC, OPTIONAL, UINT32, reply_id, 1) \ X(a, STATIC, SINGULAR, FIXED32, time, 2) \ X(a, STATIC, SINGULAR, UENUM, level, 3) \ -X(a, STATIC, SINGULAR, STRING, message, 4) +X(a, STATIC, SINGULAR, STRING, message, 4) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,key_verification_number_inform,payload_variant.key_verification_number_inform), 11) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,key_verification_number_request,payload_variant.key_verification_number_request), 12) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,key_verification_final,payload_variant.key_verification_final), 13) #define meshtastic_ClientNotification_CALLBACK NULL #define meshtastic_ClientNotification_DEFAULT NULL +#define meshtastic_ClientNotification_payload_variant_key_verification_number_inform_MSGTYPE meshtastic_KeyVerificationNumberInform +#define meshtastic_ClientNotification_payload_variant_key_verification_number_request_MSGTYPE meshtastic_KeyVerificationNumberRequest +#define meshtastic_ClientNotification_payload_variant_key_verification_final_MSGTYPE meshtastic_KeyVerificationFinal + +#define meshtastic_KeyVerificationNumberInform_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT64, nonce, 1) \ +X(a, STATIC, SINGULAR, STRING, remote_longname, 2) \ +X(a, STATIC, SINGULAR, UINT32, security_number, 3) +#define meshtastic_KeyVerificationNumberInform_CALLBACK NULL +#define meshtastic_KeyVerificationNumberInform_DEFAULT NULL + +#define meshtastic_KeyVerificationNumberRequest_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT64, nonce, 1) \ +X(a, STATIC, SINGULAR, STRING, remote_longname, 2) +#define meshtastic_KeyVerificationNumberRequest_CALLBACK NULL +#define meshtastic_KeyVerificationNumberRequest_DEFAULT NULL + +#define meshtastic_KeyVerificationFinal_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT64, nonce, 1) \ +X(a, STATIC, SINGULAR, STRING, remote_longname, 2) \ +X(a, STATIC, SINGULAR, BOOL, isSender, 3) \ +X(a, STATIC, SINGULAR, STRING, verification_characters, 4) +#define meshtastic_KeyVerificationFinal_CALLBACK NULL +#define meshtastic_KeyVerificationFinal_DEFAULT NULL #define meshtastic_FileInfo_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, STRING, file_name, 1) \ @@ -1731,6 +1840,7 @@ extern const pb_msgdesc_t meshtastic_User_msg; extern const pb_msgdesc_t meshtastic_RouteDiscovery_msg; extern const pb_msgdesc_t meshtastic_Routing_msg; extern const pb_msgdesc_t meshtastic_Data_msg; +extern const pb_msgdesc_t meshtastic_KeyVerification_msg; extern const pb_msgdesc_t meshtastic_Waypoint_msg; extern const pb_msgdesc_t meshtastic_MqttClientProxyMessage_msg; extern const pb_msgdesc_t meshtastic_MeshPacket_msg; @@ -1740,6 +1850,9 @@ extern const pb_msgdesc_t meshtastic_LogRecord_msg; extern const pb_msgdesc_t meshtastic_QueueStatus_msg; extern const pb_msgdesc_t meshtastic_FromRadio_msg; extern const pb_msgdesc_t meshtastic_ClientNotification_msg; +extern const pb_msgdesc_t meshtastic_KeyVerificationNumberInform_msg; +extern const pb_msgdesc_t meshtastic_KeyVerificationNumberRequest_msg; +extern const pb_msgdesc_t meshtastic_KeyVerificationFinal_msg; extern const pb_msgdesc_t meshtastic_FileInfo_msg; extern const pb_msgdesc_t meshtastic_ToRadio_msg; extern const pb_msgdesc_t meshtastic_Compressed_msg; @@ -1758,6 +1871,7 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; #define meshtastic_RouteDiscovery_fields &meshtastic_RouteDiscovery_msg #define meshtastic_Routing_fields &meshtastic_Routing_msg #define meshtastic_Data_fields &meshtastic_Data_msg +#define meshtastic_KeyVerification_fields &meshtastic_KeyVerification_msg #define meshtastic_Waypoint_fields &meshtastic_Waypoint_msg #define meshtastic_MqttClientProxyMessage_fields &meshtastic_MqttClientProxyMessage_msg #define meshtastic_MeshPacket_fields &meshtastic_MeshPacket_msg @@ -1767,6 +1881,9 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; #define meshtastic_QueueStatus_fields &meshtastic_QueueStatus_msg #define meshtastic_FromRadio_fields &meshtastic_FromRadio_msg #define meshtastic_ClientNotification_fields &meshtastic_ClientNotification_msg +#define meshtastic_KeyVerificationNumberInform_fields &meshtastic_KeyVerificationNumberInform_msg +#define meshtastic_KeyVerificationNumberRequest_fields &meshtastic_KeyVerificationNumberRequest_msg +#define meshtastic_KeyVerificationFinal_fields &meshtastic_KeyVerificationFinal_msg #define meshtastic_FileInfo_fields &meshtastic_FileInfo_msg #define meshtastic_ToRadio_fields &meshtastic_ToRadio_msg #define meshtastic_Compressed_fields &meshtastic_Compressed_msg @@ -1784,13 +1901,17 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; /* meshtastic_ChunkedPayloadResponse_size depends on runtime parameters */ #define MESHTASTIC_MESHTASTIC_MESH_PB_H_MAX_SIZE meshtastic_FromRadio_size #define meshtastic_ChunkedPayload_size 245 -#define meshtastic_ClientNotification_size 415 +#define meshtastic_ClientNotification_size 482 #define meshtastic_Compressed_size 239 #define meshtastic_Data_size 269 #define meshtastic_DeviceMetadata_size 54 #define meshtastic_FileInfo_size 236 #define meshtastic_FromRadio_size 510 #define meshtastic_Heartbeat_size 0 +#define meshtastic_KeyVerificationFinal_size 65 +#define meshtastic_KeyVerificationNumberInform_size 58 +#define meshtastic_KeyVerificationNumberRequest_size 52 +#define meshtastic_KeyVerification_size 79 #define meshtastic_LogRecord_size 426 #define meshtastic_MeshPacket_size 378 #define meshtastic_MqttClientProxyMessage_size 501 diff --git a/src/mesh/generated/meshtastic/portnums.pb.h b/src/mesh/generated/meshtastic/portnums.pb.h index 4e7c43e58..5bd27ef7d 100644 --- a/src/mesh/generated/meshtastic/portnums.pb.h +++ b/src/mesh/generated/meshtastic/portnums.pb.h @@ -74,6 +74,8 @@ typedef enum _meshtastic_PortNum { meshtastic_PortNum_DETECTION_SENSOR_APP = 10, /* Same as Text Message but used for critical alerts. */ meshtastic_PortNum_ALERT_APP = 11, + /* Module/port for handling key verification requests. */ + meshtastic_PortNum_KEY_VERIFICATION_APP = 12, /* Provides a 'ping' service that replies to any packet it receives. Also serves as a small example module. ENCODING: ASCII Plaintext */ From 8908805894b73ea70b9de46000e34f0378ec556d Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Wed, 28 May 2025 01:10:14 +0200 Subject: [PATCH 216/461] Don't cancel sending ReTx for relayer if we're ROUTER(_LATE)/REPEATER (#6904) Co-authored-by: Ben Meadors --- src/mesh/NextHopRouter.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mesh/NextHopRouter.cpp b/src/mesh/NextHopRouter.cpp index f21974a2e..860250f75 100644 --- a/src/mesh/NextHopRouter.cpp +++ b/src/mesh/NextHopRouter.cpp @@ -165,10 +165,15 @@ bool NextHopRouter::stopRetransmission(GlobalPacketId key) /* Only when we already transmitted a packet via LoRa, we will cancel the packet in the Tx queue to avoid canceling a transmission if it was ACKed super fast via MQTT */ if (old->numRetransmissions < NUM_RELIABLE_RETX - 1) { - // remove the 'original' (identified by originator and packet->id) from the txqueue and free it - cancelSending(getFrom(p), p->id); - // now free the pooled copy for retransmission too - packetPool.release(p); + // We only cancel it if we are the original sender or if we're not a router(_late)/repeater + if (isFromUs(p) || (config.device.role != meshtastic_Config_DeviceConfig_Role_ROUTER && + config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER && + config.device.role != meshtastic_Config_DeviceConfig_Role_ROUTER_LATE)) { + // remove the 'original' (identified by originator and packet->id) from the txqueue and free it + cancelSending(getFrom(p), p->id); + // now free the pooled copy for retransmission too + packetPool.release(p); + } } auto numErased = pending.erase(key); assert(numErased == 1); From 96c18d990880b82fb9d391a558e50696a0c9001d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 28 May 2025 01:11:32 +0200 Subject: [PATCH 217/461] Add LINK32 (Lilygo) Board with Light+Environment sensors (#6899) * Add LINK32 (Lilygo) Board with Light+Environment sensors TODO: replace PRIVATE_HW with actual HWID * Add LINK32 (Lilygo) Board with Light+Environment sensors TODO: replace PRIVATE_HW with actual HWID * Update to real HWID and trunk fmt --- .trunk/trunk.yaml | 7 +++-- src/platform/esp32/architecture.h | 2 ++ variants/link32_s3_v1/pins_arduino.h | 19 +++++++++++++ variants/link32_s3_v1/platformio.ini | 11 ++++++++ variants/link32_s3_v1/variant.h | 42 ++++++++++++++++++++++++++++ 5 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 variants/link32_s3_v1/pins_arduino.h create mode 100644 variants/link32_s3_v1/platformio.ini create mode 100644 variants/link32_s3_v1/variant.h diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 91bdf11cb..162fdfd2d 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -4,11 +4,12 @@ cli: plugins: sources: - id: trunk - ref: v1.6.8 + ref: v1.7.0 uri: https://github.com/trunk-io/plugins lint: enabled: - - renovate@40.0.6 + - checkov@3.2.435 + - renovate@40.32.7 - prettier@3.5.3 - trufflehog@3.88.34 - yamllint@1.37.1 @@ -37,7 +38,7 @@ runtimes: enabled: - python@3.10.8 - go@1.21.0 - - node@18.20.5 + - node@22.16.0 actions: disabled: - trunk-announce diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index 68d06c6d7..3763bce1e 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -184,6 +184,8 @@ #define HW_VENDOR meshtastic_HardwareModel_HELTEC_SENSOR_HUB #elif defined(ELECROW_PANEL) #define HW_VENDOR meshtastic_HardwareModel_CROWPANEL +#elif defined(LINK_32) +#define HW_VENDOR meshtastic_HardwareModel_LINK_32 #endif // ----------------------------------------------------------------------------- diff --git a/variants/link32_s3_v1/pins_arduino.h b/variants/link32_s3_v1/pins_arduino.h new file mode 100644 index 000000000..010e5bf2e --- /dev/null +++ b/variants/link32_s3_v1/pins_arduino.h @@ -0,0 +1,19 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +// The default Wire will be mapped to PMU and RTC +static const uint8_t SDA = 47; +static const uint8_t SCL = 48; + +// Default SPI will be mapped to Radio +static const uint8_t SS = 21; +static const uint8_t MOSI = 34; +static const uint8_t MISO = 33; +static const uint8_t SCK = 16; + +#endif /* Pins_Arduino_h */ diff --git a/variants/link32_s3_v1/platformio.ini b/variants/link32_s3_v1/platformio.ini new file mode 100644 index 000000000..5a614a7af --- /dev/null +++ b/variants/link32_s3_v1/platformio.ini @@ -0,0 +1,11 @@ +[env:link32-s3-v1] +extends = esp32s3_base +board = esp32-s3-devkitc-1 +build_flags = + ${esp32_base.build_flags} -D LINK_32 -I variants/link32_s3_v1 + -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. + -DARDUINO_USB_CDC_ON_BOOT + -DARDUINO_USB_MODE=1 + -DRADIOLIB_EXCLUDE_SX128X=1 + -DRADIOLIB_EXCLUDE_SX127X=1 + -DRADIOLIB_EXCLUDE_LR11X0=1 diff --git a/variants/link32_s3_v1/variant.h b/variants/link32_s3_v1/variant.h new file mode 100644 index 000000000..1f8a7435a --- /dev/null +++ b/variants/link32_s3_v1/variant.h @@ -0,0 +1,42 @@ +#define BATTERY_PIN 15 +#define ADC_CHANNEL ADC2_GPIO15_CHANNEL // ADC channel for battery voltage measurement +#define BATTERY_SENSE_SAMPLES 30 +#define BAT_MEASURE_ADC_UNIT 2 // Use ADC2 for battery measurement + +#define USE_SSD1306 + +#define BUTTON_PIN 0 // Button pin for this board +#define BUTTON_PIN_ALT 36 + +#define HAS_NEOPIXEL // If defined, we will use the neopixel library +#define NEOPIXEL_DATA 35 // Neopixel pin for this board +#define NEOPIXEL_COUNT 1 // Number of neopixels on this board +#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use + +#define ADC_MULTIPLIER 2 + +#define I2C_SDA 47 // I2C pins for this board +#define I2C_SCL 48 + +#define USE_SX1262 + +#define LORA_SCK 16 +#define LORA_MISO 33 +#define LORA_MOSI 34 +#define LORA_CS 21 +#define LORA_RESET 18 + +#define LORA_DIO0 12 // a No connect on the SX1262 module +#define LORA_DIO1 13 +#define LORA_DIO2 14 // Not really used + +#define LORA_TCXO_GPIO 17 + +#define TCXO_OPTIONAL + +#define SX126X_CS LORA_CS +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_DIO2 +#define SX126X_RESET LORA_RESET +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 From da69d8879045bde87dd1600510fea9726498a4c2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 06:20:51 -0500 Subject: [PATCH 218/461] [create-pull-request] automated change (#6909) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/protobufs b/protobufs index 022ea79ba..24c7a3d28 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 022ea79bad79b70d0bee286cd9184916ab47c1b1 +Subproject commit 24c7a3d287a4bd269ce191827e5dabd8ce8f57a7 diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index c1ec607d6..5fc1cc4f5 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -252,10 +252,10 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_LINK_32 = 98, /* * Seeed Tracker L1 */ - meshtastic_HardwareModel_SEEED_TRACKER_L1 = 99, + meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1 = 99, /* * Seeed Tracker L1 EINK driver */ - meshtastic_HardwareModel_SEEED_TRACKER_L1_EINK = 100, + meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1_EINK = 100, /* Reserved ID for future and past use */ meshtastic_HardwareModel_QWANTZ_TINY_ARMS = 101, /* ------------------------------------------------------------------------------------------------------------------------------------------ From 42a80d8aeda556df7f30ec67a612273e48241502 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 28 May 2025 11:30:59 -0500 Subject: [PATCH 219/461] Coerce user.id to always be derive from the nodenum (#6906) * Coerce user.id to always be derive from the nodenum * Additionally null it out on send * Revert "Additionally null it out on send" This reverts commit 22a2d687237d9f49024bfb8641043cc8e99b32f0. --- src/modules/NodeInfoModule.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/NodeInfoModule.cpp b/src/modules/NodeInfoModule.cpp index 5142f2db0..e072fcb0f 100644 --- a/src/modules/NodeInfoModule.cpp +++ b/src/modules/NodeInfoModule.cpp @@ -14,6 +14,9 @@ bool NodeInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes { auto p = *pptr; + // Coerce user.id to be derived from the node number + snprintf(p.id, sizeof(p.id), "!%08x", getFrom(&mp)); + bool hasChanged = nodeDB->updateUser(getFrom(&mp), p, mp.channel); bool wasBroadcast = isBroadcast(mp.to); From 5195815df017e67ce6ee599367f2cd4ce52b5bed Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Thu, 29 May 2025 23:21:09 +1200 Subject: [PATCH 220/461] Parse own short name in LogoApplet (#6913) --- src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp index 89bdb0bc7..fa85deab3 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp @@ -111,9 +111,10 @@ void InkHUD::LogoApplet::onShutdown() // Prepare for the powered-off screen now // We can change these values because the initial "shutting down" screen has already rendered at this point + meshtastic_NodeInfoLite *ourNode = nodeDB->getMeshNode(nodeDB->getNodeNum()); textLeft = ""; textRight = ""; - textTitle = owner.short_name; + textTitle = parseShortName(ourNode); fontTitle = fontLarge; // This is then drawn by InkHUD::Events::onShutdown, with a blocking FULL update, after InkHUD's flash write is complete From e31cd0bc773901df844192d3edcdd42ce57f262e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 29 May 2025 06:27:36 -0500 Subject: [PATCH 221/461] chore(deps): update meshtastic/device-ui digest to 3dfcc97 (#6912) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index d7504e6c5..e5d36d862 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/e63b219e78e9655be10745b4037cefd2c608d258.zip + https://github.com/meshtastic/device-ui/archive/3dfcc973cdfec8b34719510952e160bbfb57d9df.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From c0c2ec195f53b3f2e51dc71df73957631af83a09 Mon Sep 17 00:00:00 2001 From: dylanli Date: Thu, 29 May 2025 19:33:22 +0800 Subject: [PATCH 222/461] add support for seeed wio tracker L1 (#6907) * add support for seeed wio tracker l1 * add support in nrf52 arch * fix ADC problem and comments incorrect * fix gps wakeup pin * fix gps pin --- boards/seeed_wio_tracker_L1.json | 54 ++++++ src/configuration.h | 6 +- src/platform/nrf52/architecture.h | 2 + variants/seeed_wio_tracker_L1/platformio.ini | 13 ++ variants/seeed_wio_tracker_L1/variant.cpp | 97 ++++++++++ variants/seeed_wio_tracker_L1/variant.h | 185 +++++++++++++++++++ 6 files changed, 356 insertions(+), 1 deletion(-) create mode 100644 boards/seeed_wio_tracker_L1.json create mode 100644 variants/seeed_wio_tracker_L1/platformio.ini create mode 100644 variants/seeed_wio_tracker_L1/variant.cpp create mode 100644 variants/seeed_wio_tracker_L1/variant.h diff --git a/boards/seeed_wio_tracker_L1.json b/boards/seeed_wio_tracker_L1.json new file mode 100644 index 000000000..7c7bc62fa --- /dev/null +++ b/boards/seeed_wio_tracker_L1.json @@ -0,0 +1,54 @@ +{ + "build": { + "arduino": { + "ldscript": "nrf52840_s140_v7.ld" + }, + "core": "nRF5", + "cpu": "cortex-m4", + "extra_flags": "-DARDUINO_MDBT50Q_RX -DNRF52840_XXAA", + "f_cpu": "64000000L", + "hwids": [["0x2886", "0x1668"]], + "usb_product": "TRACKER L1", + "mcu": "nrf52840", + "variant": "seeed_wio_tracker_L1", + "bsp": { + "name": "adafruit" + }, + "softdevice": { + "sd_flags": "-DS140", + "sd_name": "s140", + "sd_version": "7.3.0", + "sd_fwid": "0x0123" + }, + "bootloader": { + "settings_addr": "0xFF000" + } + }, + "connectivity": ["bluetooth"], + "debug": { + "jlink_device": "nRF52840_xxAA", + "svd_path": "nrf52840.svd", + "openocd_target": "nrf52840-mdk-rs" + }, + "frameworks": ["arduino"], + "name": "seeed_wio_tracker_L1", + "upload": { + "maximum_ram_size": 248832, + "maximum_size": 815104, + "speed": 115200, + "protocol": "nrfutil", + "protocols": [ + "jlink", + "nrfjprog", + "nrfutil", + "stlink", + "cmsis-dap", + "blackmagic" + ], + "use_1200bps_touch": true, + "require_upload_port": true, + "wait_for_upload_port": true + }, + "url": "https://www.seeedstudio.com/Wio-Tracker-L1-p-6477.html", + "vendor": "Seeed Studio" +} diff --git a/src/configuration.h b/src/configuration.h index 0c23e677d..32d99295e 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -99,8 +99,12 @@ along with this program. If not, see . // ----------------------------------------------------------------------------- // OLED & Input // ----------------------------------------------------------------------------- - +#if defined(SEEED_WIO_TRACKER_L1) +#define SSD1306_ADDRESS 0x3D +#define USE_SH1106 +#else #define SSD1306_ADDRESS 0x3C +#endif #define ST7567_ADDRESS 0x3F // The SH1106 controller is almost, but not quite, the same as SSD1306 diff --git a/src/platform/nrf52/architecture.h b/src/platform/nrf52/architecture.h index 9d1d48f1c..eea3aee45 100644 --- a/src/platform/nrf52/architecture.h +++ b/src/platform/nrf52/architecture.h @@ -85,6 +85,8 @@ #define HW_VENDOR meshtastic_HardwareModel_SEEED_SOLAR_NODE #elif defined(HELTEC_MESH_POCKET) #define HW_VENDOR meshtastic_HardwareModel_HELTEC_MESH_POCKET +#elif defined(SEEED_WIO_TRACKER_L1) +#define HW_VENDOR meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1 #else #define HW_VENDOR meshtastic_HardwareModel_NRF52_UNKNOWN #endif diff --git a/variants/seeed_wio_tracker_L1/platformio.ini b/variants/seeed_wio_tracker_L1/platformio.ini new file mode 100644 index 000000000..3c4653d7e --- /dev/null +++ b/variants/seeed_wio_tracker_L1/platformio.ini @@ -0,0 +1,13 @@ +[env:seeed_wio_tracker_L1] +board = seeed_wio_tracker_L1 +extends = nrf52840_base +;board_level = extra +build_flags = ${nrf52840_base.build_flags} + -I $PROJECT_DIR/variants/seeed_wio_tracker_L1 + -D SEEED_WIO_TRACKER_L1 + -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 +board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_wio_tracker_L1> +lib_deps = + ${nrf52840_base.lib_deps} +debug_tool = jlink diff --git a/variants/seeed_wio_tracker_L1/variant.cpp b/variants/seeed_wio_tracker_L1/variant.cpp new file mode 100644 index 000000000..3ff5688bb --- /dev/null +++ b/variants/seeed_wio_tracker_L1/variant.cpp @@ -0,0 +1,97 @@ +/* + * variant.cpp - Digital pin mapping for TRACKER L1 + * + * This file defines the pin mapping array that maps logical digital pins (D0-D17) + * to physical GPIO ports/pins on the Nordic nRF52 series microcontroller. + * + * Board: [Seeed Studio WIO TRACKER L1] + * Hardware Features: + * - LoRa module (CS/SCK/MISO/MOSI control pins) + * - GNSS module (TX/RX/Reset/Wakeup) + * - User LEDs (D11-D12) + * - User button (D13) + * - Grove/NFC interface (D14-D15) + * - Battery voltage monitoring (D16) + * + * Created [20250521] + * By [Dylan] + */ + +#include "variant.h" +#include "nrf.h" +#include "wiring_constants.h" +#include "wiring_digital.h" + +/** + * @brief Digital pin to GPIO port/pin mapping table + * + * Format: Logical Pin (Dx) -> nRF Port.Pin (Px.xx) + * + */ + +extern "C" { +const uint32_t g_ADigitalPinMap[] = { + // D0 .. D10 - Peripheral control pins + 41, // D0 P1.09 GNSS_WAKEUP + 7, // D1 P0.07 LORA_DIO1 + 39, // D2 P1,07 LORA_RESET + 42, // D3 P1.10 LORA_BUSY + 46, // D4 P1.14 (A4/SDA) LORA_CS + 40, // D5 P1.08 (A5/SCL) LORA_SW + 27, // D6 P0.27 (UART_TX) GNSS_TX + 26, // D7 P0.26 (UART_RX) GNSS_RX + 30, // D8 P0.30 (SPI_SCK) LORA_SCK + 3, // D9 P0.3 (SPI_MISO) LORA_MISO + 28, // D10 P0.28 (SPI_MOSI) LORA_MOSI + + // D11-D12 - LED outputs + 33, // D11 P1.1 User LED + // Buzzzer + 32, // D12 P1.0 Buzzer + + // D13 - User input + 8, // D13 P0.08 User Button + + // D14-D15 - Grove interface + 6, // D14 P0.06 OLED SDA + 5, // D15 P0.05 OLED SCL + + // D16 - Battery voltage ADC input + 31, // D16 P0.31 VBAT_ADC + // GROVE + 0, // D17 P0.00 GROVESDA + 1, // D18 P0.01 GROVESCL + + // FLASH + 21, // D19 P0.21 (QSPI_SCK) + 25, // D20 P0.25 (QSPI_CSN) + 20, // D21 P0.20 (QSPI_SIO_0 DI) + 24, // D22 P0.24 (QSPI_SIO_1 DO) + 22, // D23 P0.22 (QSPI_SIO_2 WP) + 23, // D24 P0.23 (QSPI_SIO_3 HOLD) + + + 36, // D25 TB_UP + 12, // D26 TB_DOWN + 11, // D27 TB_LEFT + 35, // D28 TB_RIGHT + 37, // D29 TB_PRESS + 4, // D30 BAT_CTL +}; +} + +void initVariant() +{ + pinMode(PIN_QSPI_CS, OUTPUT); + digitalWrite(PIN_QSPI_CS, HIGH); + // This setup is crucial for ensuring low power consumption and proper initialization of the hardware components. + // VBAT_ENABLE + pinMode(BAT_READ, OUTPUT); + digitalWrite(BAT_READ, HIGH); + + pinMode(PIN_LED1, OUTPUT); + digitalWrite(PIN_LED1, LOW); + pinMode(PIN_LED2, OUTPUT); + digitalWrite(PIN_LED2, LOW); + pinMode(PIN_LED2, OUTPUT); +} \ No newline at end of file diff --git a/variants/seeed_wio_tracker_L1/variant.h b/variants/seeed_wio_tracker_L1/variant.h new file mode 100644 index 000000000..23c788480 --- /dev/null +++ b/variants/seeed_wio_tracker_L1/variant.h @@ -0,0 +1,185 @@ +#ifndef _SEEED_TRACKER_L1_H_ +#define _SEEED_TRACKER_L1_H_ +#include "WVariant.h" +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Clock Configuration +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define VARIANT_MCK (64000000ul) // Master clock frequency +#define USE_LFXO // 32.768kHz crystal for LFCLK + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Pin Capacity Definitions +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define PINS_COUNT (33u) // Total GPIO pins +#define NUM_DIGITAL_PINS (33u) // Digital I/O pins +#define NUM_ANALOG_INPUTS (8u) // Analog inputs (A0-A5 + VBAT + AREF) +#define NUM_ANALOG_OUTPUTS (0u) + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// LED Configuration +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// LEDs +// LEDs +#define PIN_LED1 (11) // LED P1.15 +#define PIN_LED2 (12) // + +#define LED_BUILTIN PIN_LED1 +#define LED_CONN PIN_LED2 + +#define LED_GREEN PIN_LED1 +#define LED_BLUE PIN_LED2 +// #define LED_PIN PIN_LED2 +#define LED_STATE_ON 1 // State when LED is litted +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Button Configuration +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define BUTTON_PIN D13 // This is the Program Button +// #define BUTTON_NEED_PULLUP 1 +#define BUTTON_ACTIVE_LOW true +#define BUTTON_ACTIVE_PULLUP false + +#define BUTTON_PIN_TOUCH 13 // Touch button +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Digital Pin Mapping (D0-D10) +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define D0 0 // P1.06 GNSS_WAKEUP/IO0 +#define D1 1 // P0.07 LORA_DIO1 +#define D2 2 // P1.07 LORA_RESET +#define D3 3 // P1.10 LORA_BUSY +#define D4 4 // P1.14 LORA_CS +#define D5 5 // P1.08 LORA_SW +#define D6 6 // P0.27 GNSS_TX +#define D7 7 // P0.26 GNSS_RX +#define D8 8 // P0.30 SPI_SCK +#define D9 9 // P0.03 SPI_MISO +#define D10 10 // P0.28 SPI_MOSI +#define D12 12 // P1.00 Buzzer +#define D13 13 // P0.08 User Button +#define D14 14 // P0.05 OLED SCL +#define D15 15 // P0.06 OLED SDA +#define D16 16 // P0.31 VBAT_ADC +#define D17 17 // P0.00 GROVE SDA +#define D18 18 // P0.01 GROVE_SCL +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Analog Pin Definitions +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define PIN_A0 0 // P0.02 Analog Input 0 +#define PIN_A1 1 // P0.03 Analog Input 1 +#define PIN_A2 2 // P0.28 Analog Input 2 +#define PIN_A3 3 // P0.29 Analog Input 3 +#define PIN_A4 4 // P0.04 Analog Input 4 +#define PIN_A5 5 // P0.05 Analog Input 5 +#define PIN_VBAT D16 // P0.31 Battery voltage sense +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Communication Interfaces +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// I2C Configuration +#define HAS_WIRE 1 +#define PIN_WIRE_SDA D14 // P0.09 +#define PIN_WIRE_SCL D15 // P0.10 +#define WIRE_INTERFACES_COUNT 1 +#define I2C_NO_RESCAN + +static const uint8_t SDA = PIN_WIRE_SDA; +static const uint8_t SCL = PIN_WIRE_SCL; + +#define HAS_SCREEN 1 +#define USE_SSD1306 1 + +// SPI Configuration (SX1262) + +#define SPI_INTERFACES_COUNT 1 +#define PIN_SPI_MISO 9 // P0.03 (D9) +#define PIN_SPI_MOSI 10 // P0.28 (D10) +#define PIN_SPI_SCK 8 // P0.30 (D8) + +// SX1262 LoRa Module Pins +#define USE_SX1262 +#define SX126X_CS D4 // Chip select +#define SX126X_DIO1 D1 // Digital IO 1 (Interrupt) +#define SX126X_BUSY D3 // Busy status +#define SX126X_RESET D2 // Reset control +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 // TCXO supply voltage +#define SX126X_RXEN D5 // RX enable control +#define SX126X_TXEN RADIOLIB_NC +#define SX126X_DIO2_AS_RF_SWITCH // This Line is really necessary for SX1262 to work with RF switch or will loss TX power +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Power Management +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +#define BAT_READ \ + 30 // D30 = P0.04 Reads battery voltage from divider on signal board. +#define BATTERY_SENSE_RESOLUTION_BITS 12 +#define ADC_MULTIPLIER 2.0 +#define BATTERY_PIN PIN_VBAT // PIN_A7 +#define AREF_VOLTAGE 3.6 +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// GPS L76KB +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define GPS_L76K +#ifdef GPS_L76K +#define PIN_GPS_RX D6 // P0.26 +#define PIN_GPS_TX D7 +#define HAS_GPS 1 +#define GPS_BAUDRATE 9600 +#define GPS_THREAD_INTERVAL 50 +#define PIN_SERIAL1_RX PIN_GPS_TX +#define PIN_SERIAL1_TX PIN_GPS_RX + +#define GPS_RX_PIN PIN_GPS_TX +#define GPS_TX_PIN PIN_GPS_RX +#define PIN_GPS_STANDBY D0 + +// #define GPS_DEBUG +// #define GPS_EN D18 // P1.05 +#endif + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// On-board QSPI Flash +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// On-board QSPI Flash +#define PIN_QSPI_SCK (21) +#define PIN_QSPI_CS (22) +#define PIN_QSPI_IO0 (23) +#define PIN_QSPI_IO1 (24) +#define PIN_QSPI_IO2 (25) +#define PIN_QSPI_IO3 (26) + +#define EXTERNAL_FLASH_DEVICES P25Q16H +#define EXTERNAL_FLASH_USE_QSPI + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Buzzer +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Buzzer + +#define PIN_BUZZER D12 // P1.00, pwm output + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// joystick +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +#define CANNED_MESSAGE_MODULE_ENABLE 1 + +// trackball +#define HAS_TRACKBALL 1 +#define TB_UP 25 +#define TB_DOWN 26 +#define TB_LEFT 27 +#define TB_RIGHT 28 +#define TB_PRESS 29 +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Compatibility Definitions +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#ifdef __cplusplus +extern "C" { +#endif +// Serial port placeholders + +#define PIN_SERIAL2_RX (-1) +#define PIN_SERIAL2_TX (-1) +#ifdef __cplusplus +} +#endif + +#endif // _SEEED_SOLAR_NODE_H_ \ No newline at end of file From 7849a3d29119be7abef060bc99d7048997f13d03 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 29 May 2025 06:35:18 -0500 Subject: [PATCH 223/461] Trunk --- variants/seeed_wio_tracker_L1/variant.cpp | 3 +-- variants/seeed_wio_tracker_L1/variant.h | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/variants/seeed_wio_tracker_L1/variant.cpp b/variants/seeed_wio_tracker_L1/variant.cpp index 3ff5688bb..6c34d63e6 100644 --- a/variants/seeed_wio_tracker_L1/variant.cpp +++ b/variants/seeed_wio_tracker_L1/variant.cpp @@ -70,13 +70,12 @@ const uint32_t g_ADigitalPinMap[] = { 22, // D23 P0.22 (QSPI_SIO_2 WP) 23, // D24 P0.23 (QSPI_SIO_3 HOLD) - 36, // D25 TB_UP 12, // D26 TB_DOWN 11, // D27 TB_LEFT 35, // D28 TB_RIGHT 37, // D29 TB_PRESS - 4, // D30 BAT_CTL + 4, // D30 BAT_CTL }; } diff --git a/variants/seeed_wio_tracker_L1/variant.h b/variants/seeed_wio_tracker_L1/variant.h index 23c788480..b257fd9b6 100644 --- a/variants/seeed_wio_tracker_L1/variant.h +++ b/variants/seeed_wio_tracker_L1/variant.h @@ -107,10 +107,9 @@ static const uint8_t SCL = PIN_WIRE_SCL; // Power Management // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -#define BAT_READ \ - 30 // D30 = P0.04 Reads battery voltage from divider on signal board. +#define BAT_READ 30 // D30 = P0.04 Reads battery voltage from divider on signal board. #define BATTERY_SENSE_RESOLUTION_BITS 12 -#define ADC_MULTIPLIER 2.0 +#define ADC_MULTIPLIER 2.0 #define BATTERY_PIN PIN_VBAT // PIN_A7 #define AREF_VOLTAGE 3.6 // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ From f972b62d89420abdac781113747b2c40ac873b41 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 29 May 2025 09:06:52 -0500 Subject: [PATCH 224/461] Upgrade trunk to 1.24.0 (#6915) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 162fdfd2d..3a02034a6 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -1,6 +1,6 @@ version: 0.1 cli: - version: 1.22.15 + version: 1.24.0 plugins: sources: - id: trunk @@ -9,7 +9,7 @@ plugins: lint: enabled: - checkov@3.2.435 - - renovate@40.32.7 + - renovate@40.33.8 - prettier@3.5.3 - trufflehog@3.88.34 - yamllint@1.37.1 From cb9429e83e06b29679b5c85272b62615ce583bed Mon Sep 17 00:00:00 2001 From: dmarman Date: Thu, 29 May 2025 16:09:33 +0200 Subject: [PATCH 225/461] Added full support for LTR390UV readings of UV and Lux (#6872) * Added full support for LTR390UV readings of UV and Lux * Trunk formatting * Added full support for LTR390UV readings of UV and Lux * Trunk formatting * fix library check and unnecessary bit resolution change * fixed log info messages and removed unused dependency * Hopefully fixes git mess * fix variable scope and getMetrics returns * set metrics flags bavk to false in case something wrong happens while reading LTR390UV mode --------- Co-authored-by: Domingo Co-authored-by: Ben Meadors --- platformio.ini | 4 +- .../Telemetry/EnvironmentTelemetry.cpp | 18 +++++ .../Telemetry/Sensor/LTR390UVSensor.cpp | 73 +++++++++++++++++++ src/modules/Telemetry/Sensor/LTR390UVSensor.h | 25 +++++++ 4 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 src/modules/Telemetry/Sensor/LTR390UVSensor.cpp create mode 100644 src/modules/Telemetry/Sensor/LTR390UVSensor.h diff --git a/platformio.ini b/platformio.ini index e5d36d862..125dfb573 100644 --- a/platformio.ini +++ b/platformio.ini @@ -161,6 +161,8 @@ lib_deps = sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library@1.1.2 # renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.2 + # renovate: datasource=custom.pio depName=Adafruit LTR390 Library packageName=adafruit/library/Adafruit LTR390 Library + adafruit/Adafruit LTR390 Library@1.1.2 # renovate: datasource=custom.pio depName=Adafruit PCT2075 packageName=adafruit/Adafruit PCT2075 adafruit/Adafruit PCT2075@1.0.5 @@ -190,4 +192,4 @@ lib_deps = # renovate: datasource=custom.pio depName=Bosch BME68x packageName=boschsensortec/library/BME68x Sensor Library boschsensortec/BME68x Sensor Library@1.3.40408 # renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master - https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip + https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip \ No newline at end of file diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index 51f076552..6d29fecb2 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -52,6 +52,13 @@ BMP280Sensor bmp280Sensor; NullSensor bme280Sensor; #endif +#if __has_include() +#include "Sensor/LTR390UVSensor.h" +LTR390UVSensor ltr390uvSensor; +#else +NullSensor ltr390uvSensor; +#endif + #if __has_include() #include "Sensor/BME680Sensor.h" BME680Sensor bme680Sensor; @@ -231,6 +238,8 @@ int32_t EnvironmentTelemetryModule::runOnce() #endif if (bme280Sensor.hasSensor()) result = bme280Sensor.runOnce(); + if (ltr390uvSensor.hasSensor()) + result = ltr390uvSensor.runOnce(); if (bmp3xxSensor.hasSensor()) result = bmp3xxSensor.runOnce(); if (bme680Sensor.hasSensor()) @@ -524,6 +533,10 @@ bool EnvironmentTelemetryModule::getEnvironmentTelemetry(meshtastic_Telemetry *m valid = valid && bme280Sensor.getMetrics(m); hasSensor = true; } + if (ltr390uvSensor.hasSensor()) { + valid = valid && ltr390uvSensor.getMetrics(m); + hasSensor = true; + } if (bmp3xxSensor.hasSensor()) { valid = valid && bmp3xxSensor.getMetrics(m); hasSensor = true; @@ -752,6 +765,11 @@ AdminMessageHandleResult EnvironmentTelemetryModule::handleAdminMessageForModule if (result != AdminMessageHandleResult::NOT_HANDLED) return result; } + if (ltr390uvSensor.hasSensor()) { + result = ltr390uvSensor.handleAdminMessage(mp, request, response); + if (result != AdminMessageHandleResult::NOT_HANDLED) + return result; + } if (bmp3xxSensor.hasSensor()) { result = bmp3xxSensor.handleAdminMessage(mp, request, response); if (result != AdminMessageHandleResult::NOT_HANDLED) diff --git a/src/modules/Telemetry/Sensor/LTR390UVSensor.cpp b/src/modules/Telemetry/Sensor/LTR390UVSensor.cpp new file mode 100644 index 000000000..fb84700c4 --- /dev/null +++ b/src/modules/Telemetry/Sensor/LTR390UVSensor.cpp @@ -0,0 +1,73 @@ +#include "configuration.h" + +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() + +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "LTR390UVSensor.h" +#include "TelemetrySensor.h" +#include + +LTR390UVSensor::LTR390UVSensor() : TelemetrySensor(meshtastic_TelemetrySensorType_LTR390UV, "LTR390UV") {} + +int32_t LTR390UVSensor::runOnce() +{ + LOG_INFO("Init sensor: %s", sensorName); + if (!hasSensor()) { + return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; + } + + status = ltr390uv.begin(nodeTelemetrySensorsMap[sensorType].second); + ltr390uv.setMode(LTR390_MODE_UVS); + ltr390uv.setGain(LTR390_GAIN_18); // Datasheet default + ltr390uv.setResolution(LTR390_RESOLUTION_20BIT); // Datasheet default + + return initI2CSensor(); +} + +void LTR390UVSensor::setup() {} + +bool LTR390UVSensor::getMetrics(meshtastic_Telemetry *measurement) +{ + LOG_DEBUG("LTR390UV getMetrics"); + + // Because the sensor does not measure Lux and UV at the same time, we need to read them in two passes. + if (ltr390uv.newDataAvailable()) { + measurement->variant.environment_metrics.has_lux = true; + measurement->variant.environment_metrics.has_uv_lux = true; + + if (ltr390uv.getMode() == LTR390_MODE_ALS) { + lastLuxReading = 0.6 * ltr390uv.readALS() / (1 * 4); // Datasheet page 23 for gain x1 and 20bit resolution + LOG_DEBUG("LTR390UV Lux reading: %f", lastLuxReading); + + measurement->variant.environment_metrics.lux = lastLuxReading; + measurement->variant.environment_metrics.uv_lux = lastUVReading; + + ltr390uv.setGain( + LTR390_GAIN_18); // Recommended for UVI - x18. Do not change, 2300 UV Sensitivity only specified for x18 gain + ltr390uv.setMode(LTR390_MODE_UVS); + + return true; + + } else if (ltr390uv.getMode() == LTR390_MODE_UVS) { + lastUVReading = ltr390uv.readUVS() / + 2300.f; // Datasheet page 23 and page 6, only characterisation for gain x18 and 20bit resolution + LOG_DEBUG("LTR390UV UV reading: %f", lastUVReading); + + measurement->variant.environment_metrics.lux = lastLuxReading; + measurement->variant.environment_metrics.uv_lux = lastUVReading; + + ltr390uv.setGain( + LTR390_GAIN_1); // x1 gain will already max out the sensor at direct sunlight, so no need to increase it + ltr390uv.setMode(LTR390_MODE_ALS); + + return true; + } + } + + // In case we fail to read the sensor mode, set the has_lux and has_uv_lux back to false + measurement->variant.environment_metrics.has_lux = false; + measurement->variant.environment_metrics.has_uv_lux = false; + + return false; +} +#endif \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/LTR390UVSensor.h b/src/modules/Telemetry/Sensor/LTR390UVSensor.h new file mode 100644 index 000000000..40206bce8 --- /dev/null +++ b/src/modules/Telemetry/Sensor/LTR390UVSensor.h @@ -0,0 +1,25 @@ +#include "configuration.h" + +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() + +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include + +class LTR390UVSensor : public TelemetrySensor +{ + private: + Adafruit_LTR390 ltr390uv = Adafruit_LTR390(); + float lastLuxReading = 0; + float lastUVReading = 0; + + protected: + virtual void setup() override; + + public: + LTR390UVSensor(); + virtual int32_t runOnce() override; + virtual bool getMetrics(meshtastic_Telemetry *measurement) override; +}; + +#endif \ No newline at end of file From ba535433543f40b0e15280c7beb9e0afabe56142 Mon Sep 17 00:00:00 2001 From: Quency-D <55523105+Quency-D@users.noreply.github.com> Date: Thu, 29 May 2025 22:10:25 +0800 Subject: [PATCH 226/461] Add a new screen for heltec_wireless_paper. (#6894) Co-authored-by: Ben Meadors --- src/graphics/EInkDisplay2.cpp | 64 +++- src/graphics/EInkDisplay2.h | 6 +- src/graphics/EInkMultiWrapper.h | 327 ++++++++++++++++++ src/graphics/niche/Drivers/EInk/E0213A367.cpp | 126 +++++++ src/graphics/niche/Drivers/EInk/E0213A367.h | 44 +++ .../heltec_wireless_paper/nicheGraphics.h | 57 ++- variants/heltec_wireless_paper/platformio.ini | 6 +- 7 files changed, 624 insertions(+), 6 deletions(-) create mode 100644 src/graphics/EInkMultiWrapper.h create mode 100644 src/graphics/niche/Drivers/EInk/E0213A367.cpp create mode 100644 src/graphics/niche/Drivers/EInk/E0213A367.h diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 5a2749482..b518299f7 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -174,7 +174,7 @@ bool EInkDisplay::connect() } } -#elif defined(HELTEC_WIRELESS_PAPER_V1_0) || defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_VISION_MASTER_E213) || \ +#elif defined(HELTEC_WIRELESS_PAPER_V1_0) || defined(HELTEC_VISION_MASTER_E213) || \ defined(HELTEC_VISION_MASTER_E290) || defined(TLORA_T3S3_EPAPER) || defined(CROWPANEL_ESP32S3_5_EPAPER) || \ defined(CROWPANEL_ESP32S3_4_EPAPER) || defined(CROWPANEL_ESP32S3_2_EPAPER) { @@ -228,6 +228,68 @@ bool EInkDisplay::connect() auto lowLevel = new EINK_DISPLAY_MODEL(PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY, *spi1); adafruitDisplay = new GxEPD2_BW(*lowLevel); + // Init GxEPD2 + adafruitDisplay->init(); + adafruitDisplay->setRotation(3); + } +#elif defined(HELTEC_WIRELESS_PAPER) + { + uint8_t model; + pinMode(PIN_EINK_SCLK, OUTPUT); + pinMode(PIN_EINK_DC, OUTPUT); + pinMode(PIN_EINK_CS, OUTPUT); + pinMode(PIN_EINK_RES, OUTPUT); + + //rest e-ink + digitalWrite(PIN_EINK_RES, LOW); + delay(20); + digitalWrite(PIN_EINK_RES, HIGH); + delay(20); + + digitalWrite(PIN_EINK_DC, LOW); + digitalWrite(PIN_EINK_CS, LOW); + + // write cmd + uint8_t cmd = 0x2F; + pinMode(PIN_EINK_MOSI, OUTPUT); + digitalWrite(PIN_EINK_SCLK, LOW); + for (int i = 0; i < 8; i++) + { + digitalWrite(PIN_EINK_MOSI, (cmd & 0x80) ? HIGH : LOW); + cmd <<= 1; + digitalWrite(PIN_EINK_SCLK, HIGH); + delayMicroseconds(1); + digitalWrite(PIN_EINK_SCLK, LOW); + delayMicroseconds(1); + } + delay(10); + + digitalWrite(PIN_EINK_DC, HIGH); + pinMode(PIN_EINK_MOSI, INPUT_PULLUP); + + // read chip ID + uint8_t chipId = 0; + for (int8_t b = 7; b >= 0; b--) + { + digitalWrite(PIN_EINK_SCLK, LOW); + delayMicroseconds(1); + digitalWrite(PIN_EINK_SCLK, HIGH); + delayMicroseconds(1); + if (digitalRead(PIN_EINK_MOSI)) chipId |= (1 << b); + } + digitalWrite(PIN_EINK_CS, HIGH); + LOG_INFO("eink chipId: %02X", chipId); + model = ((chipId&0x03) !=0x01) ? 1 : 2; + + // Start HSPI + hspi = new SPIClass(HSPI); + hspi->begin(PIN_EINK_SCLK, -1, PIN_EINK_MOSI, PIN_EINK_CS); // SCLK, MISO, MOSI, SS + // VExt already enabled in setup() + // RTC GPIO hold disabled in setup() + + // Create GxEPD2 objects + adafruitDisplay = new EInkMultiWrapper(model, PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY, *hspi); + // Init GxEPD2 adafruitDisplay->init(); adafruitDisplay->setRotation(3); diff --git a/src/graphics/EInkDisplay2.h b/src/graphics/EInkDisplay2.h index 93be197b0..965a3307a 100644 --- a/src/graphics/EInkDisplay2.h +++ b/src/graphics/EInkDisplay2.h @@ -4,6 +4,7 @@ #include "GxEPD2_BW.h" #include +#include "EinkMultiWrapper.h" /** * An adapter class that allows using the GxEPD2 library as if it was an OLEDDisplay implementation. @@ -64,8 +65,11 @@ class EInkDisplay : public OLEDDisplay virtual bool connect() override; // AdafruitGFX display object - instantiated in connect(), variant specific +#if defined(HELTEC_WIRELESS_PAPER) + EInkMultiWrapper *adafruitDisplay; +#else GxEPD2_BW *adafruitDisplay = NULL; - +#endif // If display uses HSPI #if defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_WIRELESS_PAPER_V1_0) || defined(HELTEC_VISION_MASTER_E213) || \ defined(HELTEC_VISION_MASTER_E290) || defined(TLORA_T3S3_EPAPER) || defined(CROWPANEL_ESP32S3_5_EPAPER) || \ diff --git a/src/graphics/EInkMultiWrapper.h b/src/graphics/EInkMultiWrapper.h new file mode 100644 index 000000000..3ac0b194d --- /dev/null +++ b/src/graphics/EInkMultiWrapper.h @@ -0,0 +1,327 @@ +// Wrapper class for GxEPD2_BW + +// Generic signature at build time, allowing display model to be detected at run-time +// Workaround for issue of GxEPD2_BW objects not having a shared base class +// Only exposes methods which we are actually using +#ifndef _EINKMULTIWRAPPER_H_ +#define _EINKMULTIWRAPPER_H_ + +#include "GxEPD2_BW.h" +#include "GxEPD2_EPD.h" + +template +class EInkMultiWrapper +{ +public: + void drawPixel(int16_t x, int16_t y, uint16_t color) + { + if (model == 1) + model1->drawPixel(x, y, color); + else + model2->drawPixel(x, y, color); + } + void init(uint32_t serial_diag_bitrate = 0) // = 0 : disabled + { + if (model == 1) + model1->init(serial_diag_bitrate); + else + model2->init(serial_diag_bitrate); + } + + void init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration = 20, bool pulldown_rst_mode = false) + { + if (model == 1) + model1->init(serial_diag_bitrate, initial, reset_duration, pulldown_rst_mode); + else + model2->init(serial_diag_bitrate, initial, reset_duration, pulldown_rst_mode); + } + void fillScreen(uint16_t color) // 0x0 black, >0x0 white, to buffer + { + if (model == 1) + model1->fillScreen(color); + else + model2->fillScreen(color); + } + void display(bool partial_update_mode = false) + { + if (model == 1) + model1->display(partial_update_mode); + else + model2->display(partial_update_mode); + } + void displayWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h) + { + if (model == 1) + model1->displayWindow(x, y, w, h); + else + model2->displayWindow(x, y, w, h); + } + + void setFullWindow() + { + if (model == 1) + model1->setFullWindow(); + else + model2->setFullWindow(); + } + + void setPartialWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h) + { + if (model == 1) + model1->setPartialWindow(x, y, w, h); + else + model2->setPartialWindow(x, y, w, h); + } + + void firstPage() + { + if (model == 1) + model1->firstPage(); + else + model2->firstPage(); + } + void endAsyncFull() + { + if (model == 1) + model1->endAsyncFull(); + else + model2->endAsyncFull(); + } + + bool nextPage() + { + if (model == 1) + return model1->nextPage(); + else + return model2->nextPage(); + } + void drawPaged(void (*drawCallback)(const void*), const void* pv) + { + if (model == 1) + model1->drawPaged(drawCallback, pv); + else + model2->drawPaged(drawCallback, pv); + } + + void drawInvertedBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color) + { + if (model == 1) + model1->drawInvertedBitmap(x, y, bitmap, w, h, color); + else + model2->drawInvertedBitmap(x, y, bitmap, w, h, color); + } + + void clearScreen(uint8_t value = 0xFF) // init controller memory and screen (default white) + { + if (model == 1) + model1->clearScreen(value); + else + model2->clearScreen(value); + } + void writeScreenBuffer(uint8_t value = 0xFF) // init controller memory (default white) + { + if (model == 1) + model1->writeScreenBuffer(value); + else + model2->writeScreenBuffer(value); + } + // write to controller memory, without screen refresh; x and w should be multiple of 8 + void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) + { + if (model == 1) + model1->writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm); + else + model2->writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm); + } + void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) + { + if (model == 1) + model1->writeImagePart(x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + else + model2->writeImagePart(x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + } + void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) + { + if (model == 1) + model1->writeImage(black, color, x, y, w, h, invert, mirror_y, pgm); + else + model2->writeImage(black, color, x, y, w, h, invert, mirror_y, pgm); + } + void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h) + { + if (model == 1) + model1->writeImage(black, color, x, y, w, h); + else + model2->writeImage(black, color, x, y, w, h); + } + void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) + { + if (model == 1) + model1->writeImagePart( black, color, x_part, y_part, w_bitmap, h_bitmap,x, y, w, h, invert, mirror_y, pgm); + else + model2->writeImagePart( black, color, x_part, y_part, w_bitmap, h_bitmap,x, y, w, h, invert, mirror_y, pgm); + } + + void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h) + { + if (model == 1) + model1->writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap,x, y, w, h); + else + model2->writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap,x, y, w, h); + } + // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 + void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) + { + if (model == 1) + model1->writeNative(data1, data2, x, y, w, h, invert, mirror_y, pgm); + else + model2->writeNative(data1, data2, x, y, w, h, invert, mirror_y, pgm); + } + // write to controller memory, with screen refresh; x and w should be multiple of 8 + void drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) + { + if (model == 1) + model1->drawImage(bitmap, x, y, w, h, invert, mirror_y, pgm); + else + model2->drawImage(bitmap, x, y, w, h, invert, mirror_y, pgm); + } + void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) + { + if (model == 1) + model1->drawImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + else + model2->drawImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + } + void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) + { + if (model == 1) + model1->drawImage(black, color, x, y, w, h, invert, mirror_y, pgm); + else + model2->drawImage(black, color, x, y, w, h, invert, mirror_y, pgm); + } + void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h) + { + if (model == 1) + model1->drawImage(black, color, x, y, w, h); + else + model2->drawImage(black, color, x, y, w, h); + } + void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) + { + if (model == 1) + model1->drawImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + else + model2->drawImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + } + void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h) + { + if (model == 1) + model1->drawImagePart( black, color, x_part, y_part, w_bitmap, h_bitmap,x, y, w, h); + else + model2->drawImagePart( black, color, x_part, y_part, w_bitmap, h_bitmap,x, y, w, h); + } + // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 + void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) + { + if (model == 1) + model1->drawNative(data1, data2, x, y, w, h, invert, mirror_y, pgm); + else + model2->drawNative(data1, data2, x, y, w, h, invert, mirror_y, pgm); + } + void refresh(bool partial_update_mode = false) // screen refresh from controller memory to full screen + { + if (model == 1) + model1->refresh(partial_update_mode); + else + model2->refresh(partial_update_mode); + } + void refresh(int16_t x, int16_t y, int16_t w, int16_t h) // screen refresh from controller memory, partial screen + { + if (model == 1) + model1->refresh(x, y, w, h); + else + model2->refresh(x, y, w, h); + } + // turns off generation of panel driving voltages, avoids screen fading over time + void powerOff() + { + if (model == 1) + model1->powerOff(); + else + model2->powerOff(); + } + // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) + void hibernate() + { + if (model == 1) + model1->hibernate(); + else + model2->hibernate(); + } + + void setRotation(uint8_t x) + { + if (model == 1) + model1->setRotation(x); + else + model2->setRotation(x); + } + + int16_t width() + { + if (model == 1) + return model1->width(); + else + return model2->width(); + } + + int16_t height() + { + if (model == 1) + return model1->height(); + else + return model2->height(); + } + + + // Exposes methods of the GxEPD2_EPD object which is usually available as GxEPD2_BW::epd + class Epd2Wrapper + { + public: + bool isBusy() { return m_epd2->isBusy(); } + GxEPD2_EPD *m_epd2; + } epd2; + + // Constructor + // Select driver by passing whichModel as 1 or 2 + EInkMultiWrapper(uint8_t whichModel, int16_t cs, int16_t dc, int16_t rst, int16_t busy, SPIClass &spi) + { + assert(whichModel == 1 || whichModel == 2); + model = whichModel; + // LOG_DEBUG("GxEPD2_BW_MultiWrapper using driver %d", model); + + if (model == 1) + { + model1 = new GxEPD2_BW(DISPLAY_MODEL_1(cs, dc, rst, busy, spi)); + epd2.m_epd2 = &(model1->epd2); + } + else if (model == 2) + { + model2 = new GxEPD2_BW(DISPLAY_MODEL_2(cs, dc, rst, busy, spi)); + epd2.m_epd2 = &(model2->epd2); + } + } + +private: + uint8_t model; + GxEPD2_BW *model1; + GxEPD2_BW *model2; +}; + +#endif \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/E0213A367.cpp b/src/graphics/niche/Drivers/EInk/E0213A367.cpp new file mode 100644 index 000000000..4f2a50ba7 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/E0213A367.cpp @@ -0,0 +1,126 @@ +#include "./E0213A367.h" + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +using namespace NicheGraphics::Drivers; + +// Map the display controller IC's output to the connected panel +void E0213A367::configScanning() +{ + // "Driver output control" + sendCommand(0x01); + sendData(0xF9); + sendData(0x00); + // Values set here might be redundant: F9, 00 seems to be default +} + +// Specify which information is used to control the sequence of voltages applied to move the pixels +// - For this display, configUpdateSequence() specifies that a suitable LUT will be loaded from +// the controller IC's OTP memory, when the update procedure begins. +void E0213A367::configWaveform() +{ + sendCommand(0x37); // Waveform ID register + sendData(0x40); // ByteA + sendData(0x80); // ByteB DM[7:0] + sendData(0x03); // ByteC DM[[15:8] + sendData(0x0E); // ByteD DM[[23:16] + + switch (updateType) { + case FAST: + sendCommand(0x3C); // Border waveform: + sendData(0x81); + break; + case FULL: + sendCommand(0x3C); // Border waveform: + sendData(0x01); + default: + // From OTP memory + break; + } +} + +void E0213A367::configUpdateSequence() +{ + switch (updateType) { + case FAST: + sendCommand(0x22); + sendData(0xFF); + break; + case FULL: + default: + sendCommand(0x22); // Set "update sequence" + sendData(0xF7); + break; + } +} + +// Once the refresh operation has been started, +// begin periodically polling the display to check for completion, using the normal Meshtastic threading code +// Only used when refresh is "async" +void E0213A367::detachFromUpdate() +{ + switch (updateType) { + case FAST: + return beginPolling(50, 500); // At least 500ms for fast refresh + case FULL: + default: + return beginPolling(100, 2000); // At least 2 seconds for full refresh + } +} +void E0213A367::configFullscreen() +{ + // Placing this code in a separate method because it's probably pretty consistent between displays + // Should make it tidier to override SSD16XX::configure + + // Define the boundaries of the "fullscreen" region, for the controller IC + static const uint16_t sx = bufferOffsetX; // Notice the offset + static const uint16_t sy = 0; + static const uint16_t ex = bufferRowSize + bufferOffsetX - 1; // End is "max index", not "count". Minus 1 handles this + static const uint16_t ey = height; + + // Split into bytes + static const uint8_t sy1 = sy & 0xFF; + static const uint8_t ey1 = ey & 0xFF; + + // Data entry mode - Left to Right, Top to Bottom + sendCommand(0x11); + sendData(0x03); + + // Select controller IC memory region to display a fullscreen image + sendCommand(0x44); // Memory X start - end + sendData(sx); + sendData(ex); + sendCommand(0x45); // Memory Y start - end + sendData(sy1); + sendData(ey1); + + // Place the cursor at the start of this memory region, ready to send image data x=0 y=0 + sendCommand(0x4E); // Memory cursor X + sendData(sx); + sendCommand(0x4F); // Memory cursor y + sendData(sy1); +} +void E0213A367::finalizeUpdate() +{ + // Put a copy of the image into the "old memory". + // Used with differential refreshes (e.g. FAST update), to determine which px need to move, and which can remain in place + // We need to keep the "old memory" up to date, because don't know whether next refresh will be FULL or FAST etc. + if (updateType != FULL) { + writeNewImage(); // Only required by some controller variants. Todo: Override just for GDEY0154D678? + writeOldImage(); + sendCommand(0x7F); // Terminate image write without update + wait(); + } + + //After waking up from sleep mode, the local refresh is abnormal, which may be due to the loss of data in RAM. + // if ((pin_rst != 0xFF) && (updateType ==FULL)) + // deepSleep(); +} + +void E0213A367::deepSleep() +{ + sendCommand(0x10); // Enter deep sleep + sendData(0x03); // Will not retain image RAM +} + +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/E0213A367.h b/src/graphics/niche/Drivers/EInk/E0213A367.h new file mode 100644 index 000000000..c00d73378 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/E0213A367.h @@ -0,0 +1,44 @@ +/* + +E-Ink display driver + - SSD1682 + - Manufacturer: WISEVAST + - Size: 2.13 inch + - Resolution: 122px x 255px + - Flex connector marking: HINK-E0213A162-FPC-A0 (Hidden, printed on back-side) + +*/ + +#pragma once + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +#include "configuration.h" + +#include "./SSD16XX.h" + +namespace NicheGraphics::Drivers +{ +class E0213A367 : public SSD16XX +{ + // Display properties + private: + static constexpr uint32_t width = 122; + static constexpr uint32_t height = 250; + static constexpr UpdateTypes supported = (UpdateTypes)(FULL | FAST); + + public: + E0213A367() : SSD16XX(width, height, supported, 0) {} + + protected: + virtual void configScanning() override; + virtual void configWaveform() override; + virtual void configUpdateSequence() override; + virtual void detachFromUpdate() override; + virtual void configFullscreen() override; + virtual void deepSleep() override; + virtual void finalizeUpdate() override; +}; + +} // namespace NicheGraphics::Drivers +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/variants/heltec_wireless_paper/nicheGraphics.h b/variants/heltec_wireless_paper/nicheGraphics.h index c8994b7f1..e42a4df85 100644 --- a/variants/heltec_wireless_paper/nicheGraphics.h +++ b/variants/heltec_wireless_paper/nicheGraphics.h @@ -19,12 +19,58 @@ // Shared NicheGraphics components // -------------------------------- #include "graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h" +#include "graphics/niche/Drivers/EInk/E0213A367.h" #include "graphics/niche/Inputs/TwoButton.h" void setupNicheGraphics() { using namespace NicheGraphics; + pinMode(PIN_EINK_SCLK, OUTPUT); + pinMode(PIN_EINK_DC, OUTPUT); + pinMode(PIN_EINK_CS, OUTPUT); + pinMode(PIN_EINK_RES, OUTPUT); + + //rest e-ink + digitalWrite(PIN_EINK_RES, LOW); + delay(20); + digitalWrite(PIN_EINK_RES, HIGH); + delay(20); + + digitalWrite(PIN_EINK_DC, LOW); + digitalWrite(PIN_EINK_CS, LOW); + + // write cmd + uint8_t cmd = 0x2F; + pinMode(PIN_EINK_MOSI, OUTPUT); + digitalWrite(PIN_EINK_SCLK, LOW); + for (int i = 0; i < 8; i++) + { + digitalWrite(PIN_EINK_MOSI, (cmd & 0x80) ? HIGH : LOW); + cmd <<= 1; + digitalWrite(PIN_EINK_SCLK, HIGH); + delayMicroseconds(1); + digitalWrite(PIN_EINK_SCLK, LOW); + delayMicroseconds(1); + } + delay(10); + + digitalWrite(PIN_EINK_DC, HIGH); + pinMode(PIN_EINK_MOSI, INPUT_PULLUP); + + // read chip ID + uint8_t chipId = 0; + for (int8_t b = 7; b >= 0; b--) + { + digitalWrite(PIN_EINK_SCLK, LOW); + delayMicroseconds(1); + digitalWrite(PIN_EINK_SCLK, HIGH); + delayMicroseconds(1); + if (digitalRead(PIN_EINK_MOSI)) chipId |= (1 << b); + } + digitalWrite(PIN_EINK_CS, HIGH); + LOG_INFO("eink chipId: %02X", chipId); + // SPI // ----------------------------- @@ -34,8 +80,15 @@ void setupNicheGraphics() // E-Ink Driver // ----------------------------- - - Drivers::EInk *driver = new Drivers::LCMEN213EFC1; + Drivers::EInk *driver; + if((chipId &0x03) !=0x01) + { + driver = new Drivers::LCMEN213EFC1; + } + else + { + driver = new Drivers::E0213A367; + } driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); // InkHUD diff --git a/variants/heltec_wireless_paper/platformio.ini b/variants/heltec_wireless_paper/platformio.ini index 51430ebff..762b793cc 100644 --- a/variants/heltec_wireless_paper/platformio.ini +++ b/variants/heltec_wireless_paper/platformio.ini @@ -8,6 +8,8 @@ build_flags = -I variants/heltec_wireless_paper -D HELTEC_WIRELESS_PAPER -D EINK_DISPLAY_MODEL=GxEPD2_213_FC1 + -D EINK_DISPLAY_MODEL1=GxEPD2_213_FC1 + -D EINK_DISPLAY_MODEL2=GxEPD2_213_E0213A367 -D EINK_WIDTH=250 -D EINK_HEIGHT=122 -D USE_EINK @@ -17,9 +19,9 @@ build_flags = -D EINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting" lib_deps = ${esp32s3_base.lib_deps} - https://github.com/meshtastic/GxEPD2/archive/b202ebfec6a4821e098cf7a625ba0f6f2400292d.zip + https://github.com/Quency-D/GxEPD2/archive/0513405847b281d9dea400488714643ef84507ec.zip lewisxhe/PCF8563_Library@^1.0.1 -upload_speed = 115200 +upload_speed = 921600 [env:heltec-wireless-paper-inkhud] extends = esp32s3_base, inkhud From 7a7166d57555f42156eb15a8923667e63fdb6a95 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 29 May 2025 10:17:20 -0500 Subject: [PATCH 227/461] Revert "Add a new screen for heltec_wireless_paper. (#6894)" (#6918) This reverts commit ba535433543f40b0e15280c7beb9e0afabe56142. --- src/graphics/EInkDisplay2.cpp | 64 +--- src/graphics/EInkDisplay2.h | 6 +- src/graphics/EInkMultiWrapper.h | 327 ------------------ src/graphics/niche/Drivers/EInk/E0213A367.cpp | 126 ------- src/graphics/niche/Drivers/EInk/E0213A367.h | 44 --- .../heltec_wireless_paper/nicheGraphics.h | 57 +-- variants/heltec_wireless_paper/platformio.ini | 6 +- 7 files changed, 6 insertions(+), 624 deletions(-) delete mode 100644 src/graphics/EInkMultiWrapper.h delete mode 100644 src/graphics/niche/Drivers/EInk/E0213A367.cpp delete mode 100644 src/graphics/niche/Drivers/EInk/E0213A367.h diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index b518299f7..5a2749482 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -174,7 +174,7 @@ bool EInkDisplay::connect() } } -#elif defined(HELTEC_WIRELESS_PAPER_V1_0) || defined(HELTEC_VISION_MASTER_E213) || \ +#elif defined(HELTEC_WIRELESS_PAPER_V1_0) || defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_VISION_MASTER_E213) || \ defined(HELTEC_VISION_MASTER_E290) || defined(TLORA_T3S3_EPAPER) || defined(CROWPANEL_ESP32S3_5_EPAPER) || \ defined(CROWPANEL_ESP32S3_4_EPAPER) || defined(CROWPANEL_ESP32S3_2_EPAPER) { @@ -228,68 +228,6 @@ bool EInkDisplay::connect() auto lowLevel = new EINK_DISPLAY_MODEL(PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY, *spi1); adafruitDisplay = new GxEPD2_BW(*lowLevel); - // Init GxEPD2 - adafruitDisplay->init(); - adafruitDisplay->setRotation(3); - } -#elif defined(HELTEC_WIRELESS_PAPER) - { - uint8_t model; - pinMode(PIN_EINK_SCLK, OUTPUT); - pinMode(PIN_EINK_DC, OUTPUT); - pinMode(PIN_EINK_CS, OUTPUT); - pinMode(PIN_EINK_RES, OUTPUT); - - //rest e-ink - digitalWrite(PIN_EINK_RES, LOW); - delay(20); - digitalWrite(PIN_EINK_RES, HIGH); - delay(20); - - digitalWrite(PIN_EINK_DC, LOW); - digitalWrite(PIN_EINK_CS, LOW); - - // write cmd - uint8_t cmd = 0x2F; - pinMode(PIN_EINK_MOSI, OUTPUT); - digitalWrite(PIN_EINK_SCLK, LOW); - for (int i = 0; i < 8; i++) - { - digitalWrite(PIN_EINK_MOSI, (cmd & 0x80) ? HIGH : LOW); - cmd <<= 1; - digitalWrite(PIN_EINK_SCLK, HIGH); - delayMicroseconds(1); - digitalWrite(PIN_EINK_SCLK, LOW); - delayMicroseconds(1); - } - delay(10); - - digitalWrite(PIN_EINK_DC, HIGH); - pinMode(PIN_EINK_MOSI, INPUT_PULLUP); - - // read chip ID - uint8_t chipId = 0; - for (int8_t b = 7; b >= 0; b--) - { - digitalWrite(PIN_EINK_SCLK, LOW); - delayMicroseconds(1); - digitalWrite(PIN_EINK_SCLK, HIGH); - delayMicroseconds(1); - if (digitalRead(PIN_EINK_MOSI)) chipId |= (1 << b); - } - digitalWrite(PIN_EINK_CS, HIGH); - LOG_INFO("eink chipId: %02X", chipId); - model = ((chipId&0x03) !=0x01) ? 1 : 2; - - // Start HSPI - hspi = new SPIClass(HSPI); - hspi->begin(PIN_EINK_SCLK, -1, PIN_EINK_MOSI, PIN_EINK_CS); // SCLK, MISO, MOSI, SS - // VExt already enabled in setup() - // RTC GPIO hold disabled in setup() - - // Create GxEPD2 objects - adafruitDisplay = new EInkMultiWrapper(model, PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY, *hspi); - // Init GxEPD2 adafruitDisplay->init(); adafruitDisplay->setRotation(3); diff --git a/src/graphics/EInkDisplay2.h b/src/graphics/EInkDisplay2.h index 965a3307a..93be197b0 100644 --- a/src/graphics/EInkDisplay2.h +++ b/src/graphics/EInkDisplay2.h @@ -4,7 +4,6 @@ #include "GxEPD2_BW.h" #include -#include "EinkMultiWrapper.h" /** * An adapter class that allows using the GxEPD2 library as if it was an OLEDDisplay implementation. @@ -65,11 +64,8 @@ class EInkDisplay : public OLEDDisplay virtual bool connect() override; // AdafruitGFX display object - instantiated in connect(), variant specific -#if defined(HELTEC_WIRELESS_PAPER) - EInkMultiWrapper *adafruitDisplay; -#else GxEPD2_BW *adafruitDisplay = NULL; -#endif + // If display uses HSPI #if defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_WIRELESS_PAPER_V1_0) || defined(HELTEC_VISION_MASTER_E213) || \ defined(HELTEC_VISION_MASTER_E290) || defined(TLORA_T3S3_EPAPER) || defined(CROWPANEL_ESP32S3_5_EPAPER) || \ diff --git a/src/graphics/EInkMultiWrapper.h b/src/graphics/EInkMultiWrapper.h deleted file mode 100644 index 3ac0b194d..000000000 --- a/src/graphics/EInkMultiWrapper.h +++ /dev/null @@ -1,327 +0,0 @@ -// Wrapper class for GxEPD2_BW - -// Generic signature at build time, allowing display model to be detected at run-time -// Workaround for issue of GxEPD2_BW objects not having a shared base class -// Only exposes methods which we are actually using -#ifndef _EINKMULTIWRAPPER_H_ -#define _EINKMULTIWRAPPER_H_ - -#include "GxEPD2_BW.h" -#include "GxEPD2_EPD.h" - -template -class EInkMultiWrapper -{ -public: - void drawPixel(int16_t x, int16_t y, uint16_t color) - { - if (model == 1) - model1->drawPixel(x, y, color); - else - model2->drawPixel(x, y, color); - } - void init(uint32_t serial_diag_bitrate = 0) // = 0 : disabled - { - if (model == 1) - model1->init(serial_diag_bitrate); - else - model2->init(serial_diag_bitrate); - } - - void init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration = 20, bool pulldown_rst_mode = false) - { - if (model == 1) - model1->init(serial_diag_bitrate, initial, reset_duration, pulldown_rst_mode); - else - model2->init(serial_diag_bitrate, initial, reset_duration, pulldown_rst_mode); - } - void fillScreen(uint16_t color) // 0x0 black, >0x0 white, to buffer - { - if (model == 1) - model1->fillScreen(color); - else - model2->fillScreen(color); - } - void display(bool partial_update_mode = false) - { - if (model == 1) - model1->display(partial_update_mode); - else - model2->display(partial_update_mode); - } - void displayWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h) - { - if (model == 1) - model1->displayWindow(x, y, w, h); - else - model2->displayWindow(x, y, w, h); - } - - void setFullWindow() - { - if (model == 1) - model1->setFullWindow(); - else - model2->setFullWindow(); - } - - void setPartialWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h) - { - if (model == 1) - model1->setPartialWindow(x, y, w, h); - else - model2->setPartialWindow(x, y, w, h); - } - - void firstPage() - { - if (model == 1) - model1->firstPage(); - else - model2->firstPage(); - } - void endAsyncFull() - { - if (model == 1) - model1->endAsyncFull(); - else - model2->endAsyncFull(); - } - - bool nextPage() - { - if (model == 1) - return model1->nextPage(); - else - return model2->nextPage(); - } - void drawPaged(void (*drawCallback)(const void*), const void* pv) - { - if (model == 1) - model1->drawPaged(drawCallback, pv); - else - model2->drawPaged(drawCallback, pv); - } - - void drawInvertedBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color) - { - if (model == 1) - model1->drawInvertedBitmap(x, y, bitmap, w, h, color); - else - model2->drawInvertedBitmap(x, y, bitmap, w, h, color); - } - - void clearScreen(uint8_t value = 0xFF) // init controller memory and screen (default white) - { - if (model == 1) - model1->clearScreen(value); - else - model2->clearScreen(value); - } - void writeScreenBuffer(uint8_t value = 0xFF) // init controller memory (default white) - { - if (model == 1) - model1->writeScreenBuffer(value); - else - model2->writeScreenBuffer(value); - } - // write to controller memory, without screen refresh; x and w should be multiple of 8 - void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) - { - if (model == 1) - model1->writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm); - else - model2->writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm); - } - void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, - int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) - { - if (model == 1) - model1->writeImagePart(x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); - else - model2->writeImagePart(x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); - } - void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) - { - if (model == 1) - model1->writeImage(black, color, x, y, w, h, invert, mirror_y, pgm); - else - model2->writeImage(black, color, x, y, w, h, invert, mirror_y, pgm); - } - void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h) - { - if (model == 1) - model1->writeImage(black, color, x, y, w, h); - else - model2->writeImage(black, color, x, y, w, h); - } - void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, - int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) - { - if (model == 1) - model1->writeImagePart( black, color, x_part, y_part, w_bitmap, h_bitmap,x, y, w, h, invert, mirror_y, pgm); - else - model2->writeImagePart( black, color, x_part, y_part, w_bitmap, h_bitmap,x, y, w, h, invert, mirror_y, pgm); - } - - void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, - int16_t x, int16_t y, int16_t w, int16_t h) - { - if (model == 1) - model1->writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap,x, y, w, h); - else - model2->writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap,x, y, w, h); - } - // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 - void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) - { - if (model == 1) - model1->writeNative(data1, data2, x, y, w, h, invert, mirror_y, pgm); - else - model2->writeNative(data1, data2, x, y, w, h, invert, mirror_y, pgm); - } - // write to controller memory, with screen refresh; x and w should be multiple of 8 - void drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) - { - if (model == 1) - model1->drawImage(bitmap, x, y, w, h, invert, mirror_y, pgm); - else - model2->drawImage(bitmap, x, y, w, h, invert, mirror_y, pgm); - } - void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, - int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) - { - if (model == 1) - model1->drawImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); - else - model2->drawImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); - } - void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) - { - if (model == 1) - model1->drawImage(black, color, x, y, w, h, invert, mirror_y, pgm); - else - model2->drawImage(black, color, x, y, w, h, invert, mirror_y, pgm); - } - void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h) - { - if (model == 1) - model1->drawImage(black, color, x, y, w, h); - else - model2->drawImage(black, color, x, y, w, h); - } - void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, - int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) - { - if (model == 1) - model1->drawImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); - else - model2->drawImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); - } - void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, - int16_t x, int16_t y, int16_t w, int16_t h) - { - if (model == 1) - model1->drawImagePart( black, color, x_part, y_part, w_bitmap, h_bitmap,x, y, w, h); - else - model2->drawImagePart( black, color, x_part, y_part, w_bitmap, h_bitmap,x, y, w, h); - } - // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 - void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) - { - if (model == 1) - model1->drawNative(data1, data2, x, y, w, h, invert, mirror_y, pgm); - else - model2->drawNative(data1, data2, x, y, w, h, invert, mirror_y, pgm); - } - void refresh(bool partial_update_mode = false) // screen refresh from controller memory to full screen - { - if (model == 1) - model1->refresh(partial_update_mode); - else - model2->refresh(partial_update_mode); - } - void refresh(int16_t x, int16_t y, int16_t w, int16_t h) // screen refresh from controller memory, partial screen - { - if (model == 1) - model1->refresh(x, y, w, h); - else - model2->refresh(x, y, w, h); - } - // turns off generation of panel driving voltages, avoids screen fading over time - void powerOff() - { - if (model == 1) - model1->powerOff(); - else - model2->powerOff(); - } - // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) - void hibernate() - { - if (model == 1) - model1->hibernate(); - else - model2->hibernate(); - } - - void setRotation(uint8_t x) - { - if (model == 1) - model1->setRotation(x); - else - model2->setRotation(x); - } - - int16_t width() - { - if (model == 1) - return model1->width(); - else - return model2->width(); - } - - int16_t height() - { - if (model == 1) - return model1->height(); - else - return model2->height(); - } - - - // Exposes methods of the GxEPD2_EPD object which is usually available as GxEPD2_BW::epd - class Epd2Wrapper - { - public: - bool isBusy() { return m_epd2->isBusy(); } - GxEPD2_EPD *m_epd2; - } epd2; - - // Constructor - // Select driver by passing whichModel as 1 or 2 - EInkMultiWrapper(uint8_t whichModel, int16_t cs, int16_t dc, int16_t rst, int16_t busy, SPIClass &spi) - { - assert(whichModel == 1 || whichModel == 2); - model = whichModel; - // LOG_DEBUG("GxEPD2_BW_MultiWrapper using driver %d", model); - - if (model == 1) - { - model1 = new GxEPD2_BW(DISPLAY_MODEL_1(cs, dc, rst, busy, spi)); - epd2.m_epd2 = &(model1->epd2); - } - else if (model == 2) - { - model2 = new GxEPD2_BW(DISPLAY_MODEL_2(cs, dc, rst, busy, spi)); - epd2.m_epd2 = &(model2->epd2); - } - } - -private: - uint8_t model; - GxEPD2_BW *model1; - GxEPD2_BW *model2; -}; - -#endif \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/E0213A367.cpp b/src/graphics/niche/Drivers/EInk/E0213A367.cpp deleted file mode 100644 index 4f2a50ba7..000000000 --- a/src/graphics/niche/Drivers/EInk/E0213A367.cpp +++ /dev/null @@ -1,126 +0,0 @@ -#include "./E0213A367.h" - -#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS - -using namespace NicheGraphics::Drivers; - -// Map the display controller IC's output to the connected panel -void E0213A367::configScanning() -{ - // "Driver output control" - sendCommand(0x01); - sendData(0xF9); - sendData(0x00); - // Values set here might be redundant: F9, 00 seems to be default -} - -// Specify which information is used to control the sequence of voltages applied to move the pixels -// - For this display, configUpdateSequence() specifies that a suitable LUT will be loaded from -// the controller IC's OTP memory, when the update procedure begins. -void E0213A367::configWaveform() -{ - sendCommand(0x37); // Waveform ID register - sendData(0x40); // ByteA - sendData(0x80); // ByteB DM[7:0] - sendData(0x03); // ByteC DM[[15:8] - sendData(0x0E); // ByteD DM[[23:16] - - switch (updateType) { - case FAST: - sendCommand(0x3C); // Border waveform: - sendData(0x81); - break; - case FULL: - sendCommand(0x3C); // Border waveform: - sendData(0x01); - default: - // From OTP memory - break; - } -} - -void E0213A367::configUpdateSequence() -{ - switch (updateType) { - case FAST: - sendCommand(0x22); - sendData(0xFF); - break; - case FULL: - default: - sendCommand(0x22); // Set "update sequence" - sendData(0xF7); - break; - } -} - -// Once the refresh operation has been started, -// begin periodically polling the display to check for completion, using the normal Meshtastic threading code -// Only used when refresh is "async" -void E0213A367::detachFromUpdate() -{ - switch (updateType) { - case FAST: - return beginPolling(50, 500); // At least 500ms for fast refresh - case FULL: - default: - return beginPolling(100, 2000); // At least 2 seconds for full refresh - } -} -void E0213A367::configFullscreen() -{ - // Placing this code in a separate method because it's probably pretty consistent between displays - // Should make it tidier to override SSD16XX::configure - - // Define the boundaries of the "fullscreen" region, for the controller IC - static const uint16_t sx = bufferOffsetX; // Notice the offset - static const uint16_t sy = 0; - static const uint16_t ex = bufferRowSize + bufferOffsetX - 1; // End is "max index", not "count". Minus 1 handles this - static const uint16_t ey = height; - - // Split into bytes - static const uint8_t sy1 = sy & 0xFF; - static const uint8_t ey1 = ey & 0xFF; - - // Data entry mode - Left to Right, Top to Bottom - sendCommand(0x11); - sendData(0x03); - - // Select controller IC memory region to display a fullscreen image - sendCommand(0x44); // Memory X start - end - sendData(sx); - sendData(ex); - sendCommand(0x45); // Memory Y start - end - sendData(sy1); - sendData(ey1); - - // Place the cursor at the start of this memory region, ready to send image data x=0 y=0 - sendCommand(0x4E); // Memory cursor X - sendData(sx); - sendCommand(0x4F); // Memory cursor y - sendData(sy1); -} -void E0213A367::finalizeUpdate() -{ - // Put a copy of the image into the "old memory". - // Used with differential refreshes (e.g. FAST update), to determine which px need to move, and which can remain in place - // We need to keep the "old memory" up to date, because don't know whether next refresh will be FULL or FAST etc. - if (updateType != FULL) { - writeNewImage(); // Only required by some controller variants. Todo: Override just for GDEY0154D678? - writeOldImage(); - sendCommand(0x7F); // Terminate image write without update - wait(); - } - - //After waking up from sleep mode, the local refresh is abnormal, which may be due to the loss of data in RAM. - // if ((pin_rst != 0xFF) && (updateType ==FULL)) - // deepSleep(); -} - -void E0213A367::deepSleep() -{ - sendCommand(0x10); // Enter deep sleep - sendData(0x03); // Will not retain image RAM -} - -#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/E0213A367.h b/src/graphics/niche/Drivers/EInk/E0213A367.h deleted file mode 100644 index c00d73378..000000000 --- a/src/graphics/niche/Drivers/EInk/E0213A367.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - -E-Ink display driver - - SSD1682 - - Manufacturer: WISEVAST - - Size: 2.13 inch - - Resolution: 122px x 255px - - Flex connector marking: HINK-E0213A162-FPC-A0 (Hidden, printed on back-side) - -*/ - -#pragma once - -#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS - -#include "configuration.h" - -#include "./SSD16XX.h" - -namespace NicheGraphics::Drivers -{ -class E0213A367 : public SSD16XX -{ - // Display properties - private: - static constexpr uint32_t width = 122; - static constexpr uint32_t height = 250; - static constexpr UpdateTypes supported = (UpdateTypes)(FULL | FAST); - - public: - E0213A367() : SSD16XX(width, height, supported, 0) {} - - protected: - virtual void configScanning() override; - virtual void configWaveform() override; - virtual void configUpdateSequence() override; - virtual void detachFromUpdate() override; - virtual void configFullscreen() override; - virtual void deepSleep() override; - virtual void finalizeUpdate() override; -}; - -} // namespace NicheGraphics::Drivers -#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/variants/heltec_wireless_paper/nicheGraphics.h b/variants/heltec_wireless_paper/nicheGraphics.h index e42a4df85..c8994b7f1 100644 --- a/variants/heltec_wireless_paper/nicheGraphics.h +++ b/variants/heltec_wireless_paper/nicheGraphics.h @@ -19,58 +19,12 @@ // Shared NicheGraphics components // -------------------------------- #include "graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h" -#include "graphics/niche/Drivers/EInk/E0213A367.h" #include "graphics/niche/Inputs/TwoButton.h" void setupNicheGraphics() { using namespace NicheGraphics; - pinMode(PIN_EINK_SCLK, OUTPUT); - pinMode(PIN_EINK_DC, OUTPUT); - pinMode(PIN_EINK_CS, OUTPUT); - pinMode(PIN_EINK_RES, OUTPUT); - - //rest e-ink - digitalWrite(PIN_EINK_RES, LOW); - delay(20); - digitalWrite(PIN_EINK_RES, HIGH); - delay(20); - - digitalWrite(PIN_EINK_DC, LOW); - digitalWrite(PIN_EINK_CS, LOW); - - // write cmd - uint8_t cmd = 0x2F; - pinMode(PIN_EINK_MOSI, OUTPUT); - digitalWrite(PIN_EINK_SCLK, LOW); - for (int i = 0; i < 8; i++) - { - digitalWrite(PIN_EINK_MOSI, (cmd & 0x80) ? HIGH : LOW); - cmd <<= 1; - digitalWrite(PIN_EINK_SCLK, HIGH); - delayMicroseconds(1); - digitalWrite(PIN_EINK_SCLK, LOW); - delayMicroseconds(1); - } - delay(10); - - digitalWrite(PIN_EINK_DC, HIGH); - pinMode(PIN_EINK_MOSI, INPUT_PULLUP); - - // read chip ID - uint8_t chipId = 0; - for (int8_t b = 7; b >= 0; b--) - { - digitalWrite(PIN_EINK_SCLK, LOW); - delayMicroseconds(1); - digitalWrite(PIN_EINK_SCLK, HIGH); - delayMicroseconds(1); - if (digitalRead(PIN_EINK_MOSI)) chipId |= (1 << b); - } - digitalWrite(PIN_EINK_CS, HIGH); - LOG_INFO("eink chipId: %02X", chipId); - // SPI // ----------------------------- @@ -80,15 +34,8 @@ void setupNicheGraphics() // E-Ink Driver // ----------------------------- - Drivers::EInk *driver; - if((chipId &0x03) !=0x01) - { - driver = new Drivers::LCMEN213EFC1; - } - else - { - driver = new Drivers::E0213A367; - } + + Drivers::EInk *driver = new Drivers::LCMEN213EFC1; driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); // InkHUD diff --git a/variants/heltec_wireless_paper/platformio.ini b/variants/heltec_wireless_paper/platformio.ini index 762b793cc..51430ebff 100644 --- a/variants/heltec_wireless_paper/platformio.ini +++ b/variants/heltec_wireless_paper/platformio.ini @@ -8,8 +8,6 @@ build_flags = -I variants/heltec_wireless_paper -D HELTEC_WIRELESS_PAPER -D EINK_DISPLAY_MODEL=GxEPD2_213_FC1 - -D EINK_DISPLAY_MODEL1=GxEPD2_213_FC1 - -D EINK_DISPLAY_MODEL2=GxEPD2_213_E0213A367 -D EINK_WIDTH=250 -D EINK_HEIGHT=122 -D USE_EINK @@ -19,9 +17,9 @@ build_flags = -D EINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting" lib_deps = ${esp32s3_base.lib_deps} - https://github.com/Quency-D/GxEPD2/archive/0513405847b281d9dea400488714643ef84507ec.zip + https://github.com/meshtastic/GxEPD2/archive/b202ebfec6a4821e098cf7a625ba0f6f2400292d.zip lewisxhe/PCF8563_Library@^1.0.1 -upload_speed = 921600 +upload_speed = 115200 [env:heltec-wireless-paper-inkhud] extends = esp32s3_base, inkhud From b6cb0b148cdf2ed01f1a1dfd4f17ddb4e1838ece Mon Sep 17 00:00:00 2001 From: Austin Date: Thu, 29 May 2025 17:33:10 -0400 Subject: [PATCH 228/461] Fix renovate for Adafruit PCT2075 (#6919) --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 125dfb573..ac74a352a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -163,7 +163,7 @@ lib_deps = sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.2 # renovate: datasource=custom.pio depName=Adafruit LTR390 Library packageName=adafruit/library/Adafruit LTR390 Library adafruit/Adafruit LTR390 Library@1.1.2 - # renovate: datasource=custom.pio depName=Adafruit PCT2075 packageName=adafruit/Adafruit PCT2075 + # renovate: datasource=custom.pio depName=Adafruit PCT2075 packageName=adafruit/library/Adafruit PCT2075 adafruit/Adafruit PCT2075@1.0.5 ; (not included in native / portduino) From f9d4fdbb52440ee35fb597c2dc7695b6d1cada75 Mon Sep 17 00:00:00 2001 From: ArgoNavi <63644530+ArgoNavi@users.noreply.github.com> Date: Fri, 30 May 2025 07:00:20 -0400 Subject: [PATCH 229/461] Update TSL2591Sensor.cpp (#6921) Lower gain and timing to avoid saturation in bright light --- src/modules/Telemetry/Sensor/TSL2591Sensor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/Telemetry/Sensor/TSL2591Sensor.cpp b/src/modules/Telemetry/Sensor/TSL2591Sensor.cpp index beec3c70b..04443ebec 100644 --- a/src/modules/Telemetry/Sensor/TSL2591Sensor.cpp +++ b/src/modules/Telemetry/Sensor/TSL2591Sensor.cpp @@ -23,8 +23,8 @@ int32_t TSL2591Sensor::runOnce() void TSL2591Sensor::setup() { - tsl.setGain(TSL2591_GAIN_MED); // 25x gain - tsl.setTiming(TSL2591_INTEGRATIONTIME_300MS); + tsl.setGain(TSL2591_GAIN_LOW); // 1x gain + tsl.setTiming(TSL2591_INTEGRATIONTIME_100MS); } bool TSL2591Sensor::getMetrics(meshtastic_Telemetry *measurement) @@ -41,4 +41,4 @@ bool TSL2591Sensor::getMetrics(meshtastic_Telemetry *measurement) return true; } -#endif \ No newline at end of file +#endif From 9799f10e6363703bf64490044dbac813f0ddf2ea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 08:38:13 -0500 Subject: [PATCH 230/461] Upgrade trunk (#6922) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 3a02034a6..f45bba826 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,7 +9,7 @@ plugins: lint: enabled: - checkov@3.2.435 - - renovate@40.33.8 + - renovate@40.34.4 - prettier@3.5.3 - trufflehog@3.88.34 - yamllint@1.37.1 From 284b8bcff283b05d320c81c4dcc64a6fe6e47104 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 31 May 2025 06:15:37 -0500 Subject: [PATCH 231/461] chore(deps): update meshtastic/device-ui digest to 37e2fb8 (#6925) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index ac74a352a..40517eea0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/3dfcc973cdfec8b34719510952e160bbfb57d9df.zip + https://github.com/meshtastic/device-ui/archive/37e2fb84a8d1b7d8cc1e2ed00d34cfb1f284bd59.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 5cd74f4b53a70ce18303ccdee75260be2e689ea7 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 1 Jun 2025 21:03:38 -0500 Subject: [PATCH 232/461] Don't give LOG_INFO a null --- src/modules/Telemetry/HostMetrics.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/Telemetry/HostMetrics.cpp b/src/modules/Telemetry/HostMetrics.cpp index dc4315efa..9a9d8fecc 100644 --- a/src/modules/Telemetry/HostMetrics.cpp +++ b/src/modules/Telemetry/HostMetrics.cpp @@ -34,7 +34,8 @@ bool HostMetricsModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, sender, t->variant.host_metrics.uptime_seconds, t->variant.host_metrics.diskfree1_bytes, t->variant.host_metrics.freemem_bytes, static_cast(t->variant.host_metrics.load1) / 100, static_cast(t->variant.host_metrics.load5) / 100, - static_cast(t->variant.host_metrics.load15) / 100, t->variant.host_metrics.user_string); + static_cast(t->variant.host_metrics.load15) / 100, + t->variant.host_metrics.has_user_string ? t->variant.host_metrics.user_string : ""); #endif } return false; // Let others look at this message also if they want @@ -124,7 +125,8 @@ bool HostMetricsModule::sendMetrics() telemetry.variant.host_metrics.uptime_seconds, telemetry.variant.host_metrics.diskfree1_bytes, telemetry.variant.host_metrics.freemem_bytes, static_cast(telemetry.variant.host_metrics.load1) / 100, static_cast(telemetry.variant.host_metrics.load5) / 100, - static_cast(telemetry.variant.host_metrics.load15) / 100, telemetry.variant.host_metrics.user_string); + static_cast(telemetry.variant.host_metrics.load15) / 100, + telemetry.variant.host_metrics.has_user_string ? telemetry.variant.host_metrics.user_string : ""); meshtastic_MeshPacket *p = allocDataProtobuf(telemetry); p->to = NODENUM_BROADCAST; From d833a9ea61fcad0999944ff8879204fb8611e123 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 06:16:01 -0500 Subject: [PATCH 233/461] chore(deps): update meshtastic/device-ui digest to 04e3a07 (#6942) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 40517eea0..095cf3b9d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/37e2fb84a8d1b7d8cc1e2ed00d34cfb1f284bd59.zip + https://github.com/meshtastic/device-ui/archive/04e3a075dc848f49e1344c5404ccce03a1876017.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From be0c7d73a34c73b68ee1277bb17f17af970493bd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 06:16:24 -0500 Subject: [PATCH 234/461] Upgrade trunk (#6941) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> Co-authored-by: Ben Meadors --- .trunk/trunk.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index f45bba826..fd827e229 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,14 +9,14 @@ plugins: lint: enabled: - checkov@3.2.435 - - renovate@40.34.4 + - renovate@40.36.2 - prettier@3.5.3 - - trufflehog@3.88.34 + - trufflehog@3.88.35 - yamllint@1.37.1 - bandit@1.8.3 - - trivy@0.62.1 + - trivy@0.63.0 - taplo@0.9.3 - - ruff@0.11.11 + - ruff@0.11.12 - isort@6.0.1 - markdownlint@0.45.0 - oxipng@9.1.5 From 9ce44556ceaabaf1c6cd689d6390651dcc29d3de Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 06:29:41 -0500 Subject: [PATCH 235/461] chore(deps): update meshtastic/device-ui digest to 649e095 (#6943) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 095cf3b9d..ecde59de2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/04e3a075dc848f49e1344c5404ccce03a1876017.zip + https://github.com/meshtastic/device-ui/archive/649e0953508ee4aabf1171519ee2eb69fb125647.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 4d81280ac25a006fb66e2e954577e607de5b7e51 Mon Sep 17 00:00:00 2001 From: Kalle Lilja <15094562+ThatKalle@users.noreply.github.com> Date: Tue, 3 Jun 2025 03:35:26 +0200 Subject: [PATCH 236/461] Add --1200bps-reset param to device-install/update scripts (#6752) * add change-mode support * add change-mode support * tab to space * fix if check * change param name to 1200bps-reset * update help section * missed one in help seciton --------- Co-authored-by: Ben Meadors --- bin/device-install.bat | 21 +++++++++++++++++++-- bin/device-install.sh | 12 +++++++++++- bin/device-update.bat | 21 +++++++++++++++++++-- bin/device-update.sh | 16 +++++++++++++--- 4 files changed, 62 insertions(+), 8 deletions(-) diff --git a/bin/device-install.bat b/bin/device-install.bat index 3ffca0b63..816d2fbba 100755 --- a/bin/device-install.bat +++ b/bin/device-install.bat @@ -12,6 +12,7 @@ SET "BIGDB16=0" SET "ESPTOOL_BAUD=115200" SET "ESPTOOL_CMD=" SET "LOGCOUNTER=0" +SET "BPS_RESET=0" @REM FIXME: Determine mcu from PlatformIO variant, this is unmaintainable. SET "S3=s3 v3 t-deck wireless-paper wireless-tracker station-g2 unphone" @@ -24,7 +25,7 @@ GOTO getopts :help ECHO Flash image file to device, but first erasing and writing system information. ECHO. -ECHO Usage: %SCRIPT_NAME% -f filename [-p PORT] [-P python] (--web) +ECHO Usage: %SCRIPT_NAME% -f filename [-p PORT] [-P python] (--web) [--1200bps-reset] ECHO. ECHO Options: ECHO -f filename The firmware .bin file to flash. Custom to your device type and region. (required) @@ -35,13 +36,16 @@ ECHO -P python Specify alternate python interpreter to use to invoke ECHO If supplied the script will use python. ECHO If not supplied the script will try to find esptool in Path. ECHO --web Enable WebUI. (default: false) +ECHO --1200bps-reset Attempt to place the device in correct mode. (1200bps Reset) +ECHO Some hardware requires this twice. ECHO. +ECHO Example: %SCRIPT_NAME% -p COM17 --1200bps-reset ECHO Example: %SCRIPT_NAME% -f firmware-t-deck-tft-2.6.0.0b106d4.bin -p COM11 ECHO Example: %SCRIPT_NAME% -f firmware-unphone-2.6.0.0b106d4.bin -p COM11 --web GOTO eof :version -ECHO %SCRIPT_NAME% [Version 2.6.1] +ECHO %SCRIPT_NAME% [Version 2.6.2] ECHO Meshtastic GOTO eof @@ -58,10 +62,13 @@ IF "%~1"=="-p" SET "ESPTOOL_PORT=%~2" & SHIFT IF /I "%~1"=="--port" SET "ESPTOOL_PORT=%~2" & SHIFT IF "%~1"=="-P" SET "PYTHON=%~2" & SHIFT IF /I "%~1"=="--web" SET "WEB_APP=1" +IF /I "%~1"=="--1200bps-reset" SET "BPS_RESET=1" SHIFT GOTO getopts :endopts +IF %BPS_RESET% EQU 1 GOTO skip-filename + CALL :LOG_MESSAGE DEBUG "Checking FILENAME parameter..." IF "__!FILENAME!__"=="____" ( CALL :LOG_MESSAGE DEBUG "Missing -f filename input." @@ -95,6 +102,9 @@ IF NOT "!FILENAME:update=!"=="!FILENAME!" ( CALL :LOG_MESSAGE DEBUG "We are NOT working with a *update* file. !FILENAME!" ) +:skip-filename +SET "ESPTOOL_BAUD=1200" + CALL :LOG_MESSAGE DEBUG "Determine the correct esptool command to use..." IF NOT "__%PYTHON%__"=="____" ( SET "ESPTOOL_CMD=!PYTHON! -m esptool" @@ -133,6 +143,12 @@ IF "__!ESPTOOL_PORT!__" == "____" ( ) CALL :LOG_MESSAGE INFO "Using esptool baud: !ESPTOOL_BAUD!." +IF %BPS_RESET% EQU 1 ( + @REM Attempt to change mode via 1200bps Reset. + CALL :RUN_ESPTOOL !ESPTOOL_BAUD! --after no_reset read_flash_status + GOTO eof +) + @REM Check if FILENAME contains "-tft-" and set target partitionScheme accordingly. @REM https://github.com/meshtastic/web-flasher/blob/main/types/resources.ts#L3 IF NOT "!FILENAME:-tft-=!"=="!FILENAME!" ( @@ -254,6 +270,7 @@ EXIT /B %ERRORLEVEL% IF %DEBUG% EQU 1 CALL :LOG_MESSAGE DEBUG "About to run command: !ESPTOOL_CMD! --baud %~1 %~2 %~3 %~4" CALL :RESET_ERROR !ESPTOOL_CMD! --baud %~1 %~2 %~3 %~4 +IF %BPS_RESET% EQU 1 GOTO :eof IF %ERRORLEVEL% NEQ 0 ( CALL :LOG_MESSAGE ERROR "Error running command: !ESPTOOL_CMD! --baud %~1 %~2 %~3 %~4" EXIT /B %ERRORLEVEL% diff --git a/bin/device-install.sh b/bin/device-install.sh index 7fa5ffdbb..76765bb5f 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -2,6 +2,7 @@ PYTHON=${PYTHON:-$(which python3 python | head -n 1)} WEB_APP=false +BPS_RESET=false TFT_BUILD=false MCU="" @@ -72,7 +73,7 @@ set -e # Usage info show_help() { cat </dev/null 2>&1; then @@ -17,14 +18,15 @@ fi # Usage info show_help() { cat << EOF -Usage: $(basename $0) [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME] -Flash image file to device, leave existing system intact." +Usage: $(basename $0) [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME] [--change-mode] +Flash image file to device, leave existing system intact. -h Display this help and exit -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerous). -P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON") -f FILENAME The *update.bin file to flash. Custom to your device type. - + --change-mode Attempt to place the device in correct mode. Some hardware requires this twice. (1200bps Reset) + EOF } @@ -41,6 +43,9 @@ while getopts ":hp:P:f:" opt; do ;; f) FILENAME=${OPTARG} ;; + --change-mode) + CHANGE_MODE=true + ;; *) echo "Invalid flag." show_help >&2 @@ -50,6 +55,11 @@ while getopts ":hp:P:f:" opt; do done shift "$((OPTIND-1))" +if [[ $CHANGE_MODE == true ]]; then + $ESPTOOL_CMD --baud 1200 --after no_reset read_flash_status + exit 0 +fi + [ -z "$FILENAME" -a -n "$1" ] && { FILENAME=$1 shift From a5716cf25c6ad17a1473306fac5656669c351ad5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 07:08:46 -0500 Subject: [PATCH 237/461] automated bumps (#6944) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 7 +++++-- version.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 30f684fef..40f86fb0b 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.11 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.10 diff --git a/debian/changelog b/debian/changelog index 87e3aea9b..4b67eecd4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.6.10.0) UNRELEASED; urgency=medium +meshtasticd (2.6.11.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging @@ -16,4 +16,7 @@ meshtasticd (2.6.10.0) UNRELEASED; urgency=medium [ ] * GitHub Actions Automatic version bump - -- Sun, 25 May 2025 20:46:49 +0000 + [ ] + * GitHub Actions Automatic version bump + + -- Mon, 02 Jun 2025 20:00:55 +0000 diff --git a/version.properties b/version.properties index 71de951f1..e13094769 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 6 -build = 10 +build = 11 From 55b2bbf93756fc7bbbfdbc7cbf29f88e6b637f22 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 4 Jun 2025 12:16:37 -0500 Subject: [PATCH 238/461] Generate keys when Lora Region is set (#6951) * Generate keys when Lora Region changes * Nest the ifs * Even more entropy * Namespacing --- src/mesh/CryptoEngine.cpp | 13 +++++++++++++ src/mesh/NodeDB.cpp | 2 +- src/modules/AdminModule.cpp | 18 ++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/mesh/CryptoEngine.cpp b/src/mesh/CryptoEngine.cpp index d32b73855..82d0a9f57 100644 --- a/src/mesh/CryptoEngine.cpp +++ b/src/mesh/CryptoEngine.cpp @@ -3,12 +3,17 @@ #include "architecture.h" #if !(MESHTASTIC_EXCLUDE_PKI) +#include "NodeDB.h" #include "aes-ccm.h" #include "meshUtils.h" #include #include +#include #include #if !(MESHTASTIC_EXCLUDE_PKI_KEYGEN) +#if !defined(ARCH_STM32WL) +#define CryptRNG RNG +#endif /** * Create a public/private key pair with Curve25519. @@ -18,6 +23,14 @@ */ void CryptoEngine::generateKeyPair(uint8_t *pubKey, uint8_t *privKey) { + // Mix in any randomness we can, to make key generation stronger. + CryptRNG.begin(optstr(APP_VERSION)); + if (myNodeInfo.device_id.size == 16) { + CryptRNG.stir(myNodeInfo.device_id.bytes, myNodeInfo.device_id.size); + } + auto noise = random(); + CryptRNG.stir((uint8_t *)&noise, sizeof(noise)); + LOG_DEBUG("Generate Curve25519 keypair"); Curve25519::dh1(public_key, private_key); memcpy(pubKey, public_key, sizeof(public_key)); diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 28af7d308..0a79f94a8 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -261,7 +261,7 @@ NodeDB::NodeDB() #if !(MESHTASTIC_EXCLUDE_PKI_KEYGEN || MESHTASTIC_EXCLUDE_PKI) - if (!owner.is_licensed) { + if (!owner.is_licensed && config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_UNSET) { bool keygenSuccess = false; if (config.security.private_key.size == 32) { if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) { diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 3ff4fa74d..4005222dc 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -661,6 +661,24 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) config.lora = c.payload_variant.lora; // If we're setting region for the first time, init the region if (isRegionUnset && config.lora.region > meshtastic_Config_LoRaConfig_RegionCode_UNSET) { + if (!owner.is_licensed) { + bool keygenSuccess = false; + if (config.security.private_key.size == 32) { + if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) { + keygenSuccess = true; + } + } else { + LOG_INFO("Generate new PKI keys"); + crypto->generateKeyPair(config.security.public_key.bytes, config.security.private_key.bytes); + keygenSuccess = true; + } + if (keygenSuccess) { + config.security.public_key.size = 32; + config.security.private_key.size = 32; + owner.public_key.size = 32; + memcpy(owner.public_key.bytes, config.security.public_key.bytes, 32); + } + } config.lora.tx_enabled = true; initRegion(); if (myRegion->dutyCycle < 100) { From 76f72074632e0709c5f4f88c372c09129403e3f6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 15:15:51 -0500 Subject: [PATCH 239/461] chore(deps): update meshtastic/web to v2.6.4 (#6950) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- bin/web.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/web.version b/bin/web.version index a4db534a2..e46a05b19 100644 --- a/bin/web.version +++ b/bin/web.version @@ -1 +1 @@ -2.5.3 \ No newline at end of file +2.6.4 \ No newline at end of file From 070deb290f56735da581fb3d2225cde63d611f8d Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Thu, 5 Jun 2025 19:45:43 +0800 Subject: [PATCH 240/461] seeed_xiao_nrf52840_kit improvements (#6930) * feat: seeed_xiao_nrf52840_kit improvements - LEDs: - Change RGB LED to be active low as it is common anode - Remove re-definition of LED_PIN - Use red LED to indicate flash writes - Use blue LED as user LED (External Notification module) - GPIO: Re-word unused BUTTON_PIN comment - Wire: Set I2C pins to match XIAO nRF52840 Sense's LSM6DS3TR IMU - Battery: - Use charge LED to detect charging state - Move voltage divider boilerplate out of src/main.cpp and into initVariant() - Fix dependencies for above in related XIAO BLE DIY variants Build tested variants: - seeed_xiao_nrf52840_kit - xiao_ble - seeed-xiao-nrf52840-wio-sx1262 Flashed to and tested on hardware: - seeed_xiao_nrf52840_kit Signed-off-by: Andrew Yong * chore(seeed_xiao_nrf52840_kit): Re-order generic GPIO definitions Signed-off-by: Andrew Yong * chore: Use ADC_CTRL for XIAO nRF52840 Signed-off-by: Andrew Yong --------- Signed-off-by: Andrew Yong --- src/main.cpp | 13 --- .../variant.cpp | 9 +- .../seeed-xiao-nrf52840-wio-sx1262/variant.h | 3 +- variants/seeed_xiao_nrf52840_kit/variant.cpp | 28 ++--- variants/seeed_xiao_nrf52840_kit/variant.h | 101 +++++++++--------- variants/xiao_ble/variant.cpp | 9 +- variants/xiao_ble/variant.h | 5 +- 7 files changed, 88 insertions(+), 80 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7a11ca2e0..2d49b2fbe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -482,19 +482,6 @@ void setup() fsInit(); -#if defined(_SEEED_XIAO_NRF52840_SENSE_H_) - - pinMode(CHARGE_LED, INPUT); // sets to detect if charge LED is on or off to see if USB is plugged in - - pinMode(HICHG, OUTPUT); - digitalWrite(HICHG, LOW); // 100 mA charging current if set to LOW and 50mA (actually about 20mA) if set to HIGH - - pinMode(BAT_READ, OUTPUT); - digitalWrite(BAT_READ, LOW); // This is pin P0_14 = 14 and by pullling low to GND it provices path to read on pin 32 (P0,31) - // PIN_VBAT the voltage from divider on XIAO board - -#endif - #if !MESHTASTIC_EXCLUDE_I2C #if defined(I2C_SDA1) && defined(ARCH_RP2040) Wire1.setSDA(I2C_SDA1); diff --git a/variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.cpp b/variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.cpp index 2c6c3e539..300f69d0b 100644 --- a/variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.cpp +++ b/variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.cpp @@ -52,4 +52,11 @@ const uint32_t g_ADigitalPinMap[] = { // VBAT 31, // D32 is P0.10 (VBAT) -}; \ No newline at end of file +}; + +void initVariant() +{ + // Set BQ25101 ISET to 100mA instead of 50mA + pinMode(HICHG, OUTPUT); + digitalWrite(HICHG, LOW); +} diff --git a/variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.h b/variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.h index 7a76727f2..277377d71 100644 --- a/variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.h +++ b/variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.h @@ -164,7 +164,8 @@ static const uint8_t SCK = PIN_SPI_SCK; // ------- // P0_14 = 14 Reads battery voltage from divider on signal board. // PIN_VBAT is reading voltage divider on XIAO and is program pin 32 / or P0.31 -#define BAT_READ 14 +#define ADC_CTRL VBAT_ENABLE +#define ADC_CTRL_ENABLED LOW #define BATTERY_SENSE_RESOLUTION_BITS 10 #define CHARGE_LED 23 // P0_17 = 17 D23 YELLOW CHARGE LED #define HICHG 22 // P0_13 = 13 D22 Charge-select pin for Lipo for 100 mA instead of default 50mA charge diff --git a/variants/seeed_xiao_nrf52840_kit/variant.cpp b/variants/seeed_xiao_nrf52840_kit/variant.cpp index 22072312a..70cadf5db 100644 --- a/variants/seeed_xiao_nrf52840_kit/variant.cpp +++ b/variants/seeed_xiao_nrf52840_kit/variant.cpp @@ -34,9 +34,9 @@ const uint32_t g_ADigitalPinMap[] = { 11, // D18 is P0.11 (6D_INT1) // MIC - 42, // 17,//42, // D19 is P1.10 (MIC_PWR) - 32, // 26,//32, // D20 is P1.00 (PDM_CLK) - 16, // 25,//16, // D21 is P0.16 (PDM_DATA) + 42, // D19 is P1.10 (MIC_PWR) + 32, // D20 is P1.00 (PDM_CLK) + 16, // D21 is P0.16 (PDM_DATA) // BQ25100 13, // D22 is P0.13 (HICHG) @@ -80,13 +80,17 @@ const uint32_t g_ADigitalPinMap[] = { void initVariant() { - // LED1 & LED2 - pinMode(21, OUTPUT); - digitalWrite(21, LOW); - // LED1 & LED2 - pinMode(22, OUTPUT); - digitalWrite(22, LOW); + // Set BQ25101 ISET to 100mA instead of 50mA + pinMode(HICHG, OUTPUT); + digitalWrite(HICHG, LOW); - pinMode(PIN_WIRE_SDA, INPUT_PULLUP); - pinMode(PIN_WIRE_SCL, INPUT_PULLUP); -} \ No newline at end of file + // LEDs + pinMode(PIN_LED1, OUTPUT); + ledOff(PIN_LED1); + + pinMode(PIN_LED2, OUTPUT); + ledOff(PIN_LED2); + + pinMode(PIN_LED3, OUTPUT); + ledOff(PIN_LED3); +} diff --git a/variants/seeed_xiao_nrf52840_kit/variant.h b/variants/seeed_xiao_nrf52840_kit/variant.h index 869c3d405..e6ef74e2e 100644 --- a/variants/seeed_xiao_nrf52840_kit/variant.h +++ b/variants/seeed_xiao_nrf52840_kit/variant.h @@ -19,31 +19,12 @@ extern "C" { #define PINS_COUNT (33) #define NUM_DIGITAL_PINS (33) -#define NUM_ANALOG_INPUTS (8) // A6 is used for battery, A7 is analog reference +#define NUM_ANALOG_INPUTS (8) #define NUM_ANALOG_OUTPUTS (0) -// LEDs - -#define LED_RED 11 -#define LED_BLUE 12 -#define LED_GREEN 13 - -#define PIN_LED1 LED_GREEN -#define PIN_LED2 LED_BLUE -#define PIN_LED3 LED_RED - -#define PIN_LED PIN_LED1 -#define LED_PWR (PINS_COUNT) - -#define LED_BUILTIN PIN_LED - -#define LED_STATE_ON 1 // State when LED is lit - /* - * Buttons + * Digital Pins */ - -// Digital PINs #define D0 (0ul) #define D1 (1ul) #define D2 (2ul) @@ -56,15 +37,6 @@ extern "C" { #define D9 (9ul) #define D10 (10ul) -/*Due to the lack of pins,and have to make sure gps standby work well we have temporarily removed the button. -There are some technical solutions that can solve this problem, -and we are currently exploring and researching them*/ - -// #define BUTTON_PIN D0 // This is the Program Button -// // #define BUTTON_NEED_PULLUP 1 -// #define BUTTON_ACTIVE_LOW true -// #define BUTTON_ACTIVE_PULLUP false - /* * Analog pins */ @@ -85,6 +57,38 @@ static const uint8_t A4 = PIN_A4; static const uint8_t A5 = PIN_A5; #define ADC_RESOLUTION 12 +/* + * LEDs + */ +#define LED_STATE_ON (0) // RGB LED is common anode +#define LED_RED (11) +#define LED_GREEN (13) +#define LED_BLUE (12) + +#define PIN_LED1 LED_GREEN // PIN_LED1 is used in src/platform/nrf52/architecture.h to define LED_PIN +#define PIN_LED2 LED_BLUE +#define PIN_LED3 LED_RED + +#define LED_BUILTIN LED_RED // LED_BUILTIN is used by framework-arduinoadafruitnrf52 to indicate flash writes + +#define LED_PWR LED_RED +#define USER_LED LED_BLUE + +/* + * Buttons + */ + +/* + * D0 is shared with PIN_GPS_STANDBY on the L76K GNSS Module. + * There are some technical solutions that can solve this problem, and we are + * currently exploring and researching them. + */ + +// #define BUTTON_PIN D0 + +/* + * Serial Interfaces + */ #define PIN_SERIAL2_RX (-1) #define PIN_SERIAL2_TX (-1) @@ -102,11 +106,9 @@ static const uint8_t MOSI = PIN_SPI_MOSI; static const uint8_t MISO = PIN_SPI_MISO; static const uint8_t SCK = PIN_SPI_SCK; -// supported modules list #define USE_SX1262 -// common pinouts for SX126X modules - +// Pinout for SX126X #define SX126X_CS D4 #define SX126X_DIO1 D1 #define SX126X_BUSY D3 @@ -121,16 +123,19 @@ static const uint8_t SCK = PIN_SPI_SCK; /* * Wire Interfaces */ - #define I2C_NO_RESCAN // I2C is a bit finicky, don't scan too much #define WIRE_INTERFACES_COUNT 1 // 2 -#define PIN_WIRE_SDA (24) // change to use the correct pins if needed -#define PIN_WIRE_SCL (25) // change to use the correct pins if needed +// LSM6DS3TR on XIAO nRF52840 Series +#define PIN_WIRE_SDA (17) +#define PIN_WIRE_SCL (16) static const uint8_t SDA = PIN_WIRE_SDA; static const uint8_t SCL = PIN_WIRE_SCL; +/* + * GPS + */ // GPS L76KB #define GPS_L76K #ifdef GPS_L76K @@ -144,20 +149,18 @@ static const uint8_t SCL = PIN_WIRE_SCL; #define PIN_GPS_STANDBY D0 #endif -// Battery +/* + * Battery + */ +#define BATTERY_PIN PIN_VBAT // P0.31: VBAT voltage divider +#define ADC_MULTIPLIER (3) // ... R17=1M, R18=510k +#define ADC_CTRL VBAT_ENABLE // P0.14: VBAT voltage divider +#define ADC_CTRL_ENABLED LOW // ... sink +#define EXT_CHRG_DETECT (23) // P0.17: Charge LED +#define EXT_CHRG_DETECT_VALUE LOW // ... BQ25101 ~CHG indicates charging +#define HICHG (22) // P0.13: BQ25101 ISET 100mA instead of 50mA -#define BAT_READ \ - 14 // P0_14 = 14 Reads battery voltage from divider on signal board. (PIN_VBAT is reading voltage divider on XIAO and is - // program pin 32 / or P0.31) -#define BATTERY_SENSE_RESOLUTION_BITS 10 -#define CHARGE_LED 23 // P0_17 = 17 D23 YELLOW CHARGE LED -#define HICHG 22 // P0_13 = 13 D22 Charge-select pin for Lipo for 100 mA instead of default 50mA charge - -// The battery sense is hooked to pin A0 (5) -#define BATTERY_PIN PIN_VBAT // PIN_A0 - -// ratio of voltage divider = 3.0 (R17=1M, R18=510k) -#define ADC_MULTIPLIER 3 // 3.0 + a bit for being optimistic +#define BATTERY_SENSE_RESOLUTION_BITS (10) #ifdef __cplusplus } diff --git a/variants/xiao_ble/variant.cpp b/variants/xiao_ble/variant.cpp index 2c6c3e539..300f69d0b 100644 --- a/variants/xiao_ble/variant.cpp +++ b/variants/xiao_ble/variant.cpp @@ -52,4 +52,11 @@ const uint32_t g_ADigitalPinMap[] = { // VBAT 31, // D32 is P0.10 (VBAT) -}; \ No newline at end of file +}; + +void initVariant() +{ + // Set BQ25101 ISET to 100mA instead of 50mA + pinMode(HICHG, OUTPUT); + digitalWrite(HICHG, LOW); +} diff --git a/variants/xiao_ble/variant.h b/variants/xiao_ble/variant.h index b46aa96ae..e511c6869 100644 --- a/variants/xiao_ble/variant.h +++ b/variants/xiao_ble/variant.h @@ -189,9 +189,8 @@ static const uint8_t SCL = PIN_WIRE_SCL; // Battery -#define BAT_READ \ - 14 // P0_14 = 14 Reads battery voltage from divider on signal board. (PIN_VBAT is reading voltage divider on XIAO and is - // program pin 32 / or P0.31) +#define ADC_CTRL VBAT_ENABLE // P0.14: VBAT voltage divider +#define ADC_CTRL_ENABLED LOW // ... sink #define BATTERY_SENSE_RESOLUTION_BITS 10 #define CHARGE_LED 23 // P0_17 = 17 D23 YELLOW CHARGE LED #define HICHG 22 // P0_13 = 13 D22 Charge-select pin for Lipo for 100 mA instead of default 50mA charge From c0e1616382a5493881a798e26114ba0f687a1e2a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 10:11:43 -0500 Subject: [PATCH 241/461] Upgrade trunk (#6948) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index fd827e229..693a2284d 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,8 +8,8 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.435 - - renovate@40.36.2 + - checkov@3.2.436 + - renovate@40.41.0 - prettier@3.5.3 - trufflehog@3.88.35 - yamllint@1.37.1 @@ -28,7 +28,7 @@ lint: - shellcheck@0.10.0 - black@25.1.0 - git-diff-check - - gitleaks@8.26.0 + - gitleaks@8.27.0 - clang-format@16.0.3 ignore: - linters: [ALL] From ba296db701e8da6ea782fb46b567add4b112bf7e Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Fri, 6 Jun 2025 17:35:47 +1200 Subject: [PATCH 242/461] Add InkHUD driver for WeAct Studio 2.9" display module (#6963) * Driver for WeAct Studio 2.9" ePaper module * Clarify that flex connector marking is not a unique id --------- Co-authored-by: Ben Meadors --- .../niche/Drivers/EInk/DEPG0213BNS800.h | 2 +- .../niche/Drivers/EInk/DEPG0290BNS800.h | 2 +- src/graphics/niche/Drivers/EInk/GDEY0154D67.h | 2 +- src/graphics/niche/Drivers/EInk/GDEY0213B74.h | 4 +- .../niche/Drivers/EInk/HINK_E042A87.h | 2 +- .../niche/Drivers/EInk/LCMEN2R13ECC1.h | 1 - .../niche/Drivers/EInk/LCMEN2R13EFC1.h | 2 +- .../Drivers/EInk/ZJY128296_029EAAMFGN.cpp | 59 +++++++++++++++++++ .../niche/Drivers/EInk/ZJY128296_029EAAMFGN.h | 44 ++++++++++++++ 9 files changed, 111 insertions(+), 7 deletions(-) create mode 100644 src/graphics/niche/Drivers/EInk/ZJY128296_029EAAMFGN.cpp create mode 100644 src/graphics/niche/Drivers/EInk/ZJY128296_029EAAMFGN.h diff --git a/src/graphics/niche/Drivers/EInk/DEPG0213BNS800.h b/src/graphics/niche/Drivers/EInk/DEPG0213BNS800.h index e1bb96450..3ce16e473 100644 --- a/src/graphics/niche/Drivers/EInk/DEPG0213BNS800.h +++ b/src/graphics/niche/Drivers/EInk/DEPG0213BNS800.h @@ -5,7 +5,7 @@ E-Ink display driver - Manufacturer: DKE - Size: 2.13 inch - Resolution: 122px x 250px - - Flex connector marking: FPC-7528B + - Flex connector marking (not a unique identifier): FPC-7528B Note: this is from an older generation of DKE panels, which still used Solomon Systech controller ICs. DKE's website suggests that the latest DEPG0213BN displays may use Fitipower controllers instead. diff --git a/src/graphics/niche/Drivers/EInk/DEPG0290BNS800.h b/src/graphics/niche/Drivers/EInk/DEPG0290BNS800.h index 72062e0d6..257fed1a6 100644 --- a/src/graphics/niche/Drivers/EInk/DEPG0290BNS800.h +++ b/src/graphics/niche/Drivers/EInk/DEPG0290BNS800.h @@ -5,7 +5,7 @@ E-Ink display driver - Manufacturer: DKE - Size: 2.9 inch - Resolution: 128px x 296px - - Flex connector marking: FPC-7519 rev.b + - Flex connector marking (not a unique identifier): FPC-7519 rev.b */ diff --git a/src/graphics/niche/Drivers/EInk/GDEY0154D67.h b/src/graphics/niche/Drivers/EInk/GDEY0154D67.h index fc4d93d12..93c641e44 100644 --- a/src/graphics/niche/Drivers/EInk/GDEY0154D67.h +++ b/src/graphics/niche/Drivers/EInk/GDEY0154D67.h @@ -5,7 +5,7 @@ E-Ink display driver - Manufacturer: Goodisplay - Size: 1.54 inch - Resolution: 200px x 200px - - Flex connector marking: FPC-B001 + - Flex connector marking (not a unique identifier): FPC-B001 */ diff --git a/src/graphics/niche/Drivers/EInk/GDEY0213B74.h b/src/graphics/niche/Drivers/EInk/GDEY0213B74.h index 2212fe92a..1c36f295d 100644 --- a/src/graphics/niche/Drivers/EInk/GDEY0213B74.h +++ b/src/graphics/niche/Drivers/EInk/GDEY0213B74.h @@ -5,7 +5,9 @@ E-Ink display driver - Manufacturer: Goodisplay - Size: 2.13 inch - Resolution: 250px x 122px - - Flex connector marking: FPC-A002 + - Flex connector marking (not a unique identifier): + - FPC-A002 + - FPC-A005 20.06.15 TRX */ diff --git a/src/graphics/niche/Drivers/EInk/HINK_E042A87.h b/src/graphics/niche/Drivers/EInk/HINK_E042A87.h index ac03b65ef..612072b50 100644 --- a/src/graphics/niche/Drivers/EInk/HINK_E042A87.h +++ b/src/graphics/niche/Drivers/EInk/HINK_E042A87.h @@ -5,7 +5,7 @@ E-Ink display driver - Manufacturer: Holitech - Size: 4.2 inch - Resolution: 400px x 300px - - Flex connector marking: HINK-E042A07-FPC-A1 + - Flex connector marking (not a unique identifier): HINK-E042A07-FPC-A1 - Silver sticker with QR code, marked: HE042A87 Note: as of Feb. 2025, these panels are used for "WeActStudio 4.2in B&W" display modules diff --git a/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h index b78e3bcca..9fa6eaac9 100644 --- a/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h +++ b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h @@ -5,7 +5,6 @@ E-Ink display driver - Manufacturer: WISEVAST - Size: 2.13 inch - Resolution: 122px x 255px - - Flex connector marking: Soldering connector, no connector is needed */ diff --git a/src/graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h b/src/graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h index f9da202aa..499daef05 100644 --- a/src/graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h +++ b/src/graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h @@ -5,7 +5,7 @@ E-Ink display driver - Manufacturer: Wisevast - Size: 2.13 inch - Resolution: 122px x 250px - - Flex connector marking: HINK-E0213A162-FPC-A0 (Hidden, printed on back-side) + - Flex connector marking (not a unique identifier): HINK-E0213A162-FPC-A0 (Hidden, printed on back-side) Note: this display uses an uncommon controller IC, Fitipower JD79656. It is implemented as a "one-off", directly inheriting the EInk base class, unlike SSD16XX displays. diff --git a/src/graphics/niche/Drivers/EInk/ZJY128296_029EAAMFGN.cpp b/src/graphics/niche/Drivers/EInk/ZJY128296_029EAAMFGN.cpp new file mode 100644 index 000000000..a8f43420f --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/ZJY128296_029EAAMFGN.cpp @@ -0,0 +1,59 @@ +#include "./ZJY128296_029EAAMFGN.h" + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +using namespace NicheGraphics::Drivers; + +// Map the display controller IC's output to the connected panel +void ZJY128296_029EAAMFGN::configScanning() +{ + // "Driver output control" + // Scan gates from 0 to 295 (vertical resolution 296px) + sendCommand(0x01); + sendData(0x27); // Number of gates (295, bits 0-7) + sendData(0x01); // Number of gates (295, bit 8) + sendData(0x00); // (Do not invert scanning order) +} + +// Specify which information is used to control the sequence of voltages applied to move the pixels +// - For this display, configUpdateSequence() specifies that a suitable LUT will be loaded from +// the controller IC's OTP memory, when the update procedure begins. +void ZJY128296_029EAAMFGN::configWaveform() +{ + sendCommand(0x3C); // Border waveform: + sendData(0x05); // Screen border should follow LUT1 waveform (actively drive pixels white) + + sendCommand(0x18); // Temperature sensor: + sendData(0x80); // Use internal temperature sensor to select an appropriate refresh waveform +} + +void ZJY128296_029EAAMFGN::configUpdateSequence() +{ + switch (updateType) { + case FAST: + sendCommand(0x22); // Set "update sequence" + sendData(0xFF); // Will load LUT from OTP memory, Display mode 2 "differential refresh" + break; + + case FULL: + default: + sendCommand(0x22); // Set "update sequence" + sendData(0xF7); // Will load LUT from OTP memory + break; + } +} + +// Once the refresh operation has been started, +// begin periodically polling the display to check for completion, using the normal Meshtastic threading code +// Only used when refresh is "async" +void ZJY128296_029EAAMFGN::detachFromUpdate() +{ + switch (updateType) { + case FAST: + return beginPolling(50, 300); // At least 300ms for fast refresh + case FULL: + default: + return beginPolling(100, 2000); // At least 2 seconds for full refresh + } +} +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/ZJY128296_029EAAMFGN.h b/src/graphics/niche/Drivers/EInk/ZJY128296_029EAAMFGN.h new file mode 100644 index 000000000..27644e709 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/ZJY128296_029EAAMFGN.h @@ -0,0 +1,44 @@ +/* + +E-Ink display driver + - ZJY128296-029EAAMFGN + - Manufacturer: Zhongjingyuan + - Size: 2.9 inch + - Resolution: 128px x 296px + - Flex connector label (not a unique identifier): FPC-A005 20.06.15 TRX + + Note: as of Feb. 2025, these panels are used for "WeActStudio 2.9in B&W" display modules + +*/ + +#pragma once + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +#include "configuration.h" + +#include "./SSD16XX.h" + +namespace NicheGraphics::Drivers +{ +class ZJY128296_029EAAMFGN : public SSD16XX +{ + // Display properties + private: + static constexpr uint32_t width = 128; + static constexpr uint32_t height = 296; + static constexpr UpdateTypes supported = (UpdateTypes)(FULL | FAST); + + public: + ZJY128296_029EAAMFGN() : SSD16XX(width, height, supported) {} + + protected: + void configScanning() override; + void configWaveform() override; + void configUpdateSequence() override; + void detachFromUpdate() override; +}; + +} // namespace NicheGraphics::Drivers + +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file From 79b710a10846403827359af2e4e84747a4768308 Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Sat, 7 Jun 2025 19:44:54 +0800 Subject: [PATCH 243/461] fix: Respect LED_STATE_ON for power and user LED (#6976) Signed-off-by: Andrew Yong --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 2d49b2fbe..c12707cdb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -337,12 +337,12 @@ void setup() #ifdef LED_POWER pinMode(LED_POWER, OUTPUT); - digitalWrite(LED_POWER, HIGH); + digitalWrite(LED_POWER, LED_STATE_ON); #endif #ifdef USER_LED pinMode(USER_LED, OUTPUT); - digitalWrite(USER_LED, LOW); + digitalWrite(USER_LED, HIGH ^ LED_STATE_ON); #endif #if defined(T_DECK) From 91579c4650c0caeae5e1541c6c1f50c330b07b13 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 7 Jun 2025 06:55:25 -0500 Subject: [PATCH 244/461] [create-pull-request] automated change (#6980) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/config.pb.cpp | 2 ++ src/mesh/generated/meshtastic/config.pb.h | 35 ++++++++++++++++--- src/mesh/generated/meshtastic/device_ui.pb.h | 2 ++ src/mesh/generated/meshtastic/deviceonly.pb.h | 2 +- src/mesh/generated/meshtastic/localonly.pb.h | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 6 ++++ 7 files changed, 44 insertions(+), 7 deletions(-) diff --git a/protobufs b/protobufs index 24c7a3d28..db60f07ac 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 24c7a3d287a4bd269ce191827e5dabd8ce8f57a7 +Subproject commit db60f07ac298b6161ca553b3868b542cceadcac4 diff --git a/src/mesh/generated/meshtastic/config.pb.cpp b/src/mesh/generated/meshtastic/config.pb.cpp index 5512584a7..52a591f33 100644 --- a/src/mesh/generated/meshtastic/config.pb.cpp +++ b/src/mesh/generated/meshtastic/config.pb.cpp @@ -65,6 +65,8 @@ PB_BIND(meshtastic_Config_SessionkeyConfig, meshtastic_Config_SessionkeyConfig, + + diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index 9d7a96dc8..6851d42b1 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -88,6 +88,23 @@ typedef enum _meshtastic_Config_DeviceConfig_RebroadcastMode { meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY = 5 } meshtastic_Config_DeviceConfig_RebroadcastMode; +/* Defines buzzer behavior for audio feedback */ +typedef enum _meshtastic_Config_DeviceConfig_BuzzerMode { + /* Default behavior. + Buzzer is enabled for all audio feedback including button presses and alerts. */ + meshtastic_Config_DeviceConfig_BuzzerMode_ALL_ENABLED = 0, + /* Disabled. + All buzzer audio feedback is disabled. */ + meshtastic_Config_DeviceConfig_BuzzerMode_DISABLED = 1, + /* Notifications Only. + Buzzer is enabled only for notifications and alerts, but not for button presses. + External notification config determines the specifics of the notification behavior. */ + meshtastic_Config_DeviceConfig_BuzzerMode_NOTIFICATIONS_ONLY = 2, + /* Non-notification system buzzer tones only. + Buzzer is enabled only for non-notification tones such as button presses, startup, shutdown, but not for alerts. */ + meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY = 3 +} meshtastic_Config_DeviceConfig_BuzzerMode; + /* Bit field of boolean configuration options, indicating which optional fields to include when assembling POSITION messages. Longitude, latitude, altitude, speed, heading, and DOP @@ -335,6 +352,9 @@ typedef struct _meshtastic_Config_DeviceConfig { char tzdef[65]; /* If true, disable the default blinking LED (LED_PIN) behavior on the device */ bool led_heartbeat_disabled; + /* Controls buzzer behavior for audio feedback + Defaults to ENABLED */ + meshtastic_Config_DeviceConfig_BuzzerMode buzzer_mode; } meshtastic_Config_DeviceConfig; /* Position Config */ @@ -618,6 +638,10 @@ extern "C" { #define _meshtastic_Config_DeviceConfig_RebroadcastMode_MAX meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY #define _meshtastic_Config_DeviceConfig_RebroadcastMode_ARRAYSIZE ((meshtastic_Config_DeviceConfig_RebroadcastMode)(meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY+1)) +#define _meshtastic_Config_DeviceConfig_BuzzerMode_MIN meshtastic_Config_DeviceConfig_BuzzerMode_ALL_ENABLED +#define _meshtastic_Config_DeviceConfig_BuzzerMode_MAX meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY +#define _meshtastic_Config_DeviceConfig_BuzzerMode_ARRAYSIZE ((meshtastic_Config_DeviceConfig_BuzzerMode)(meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY+1)) + #define _meshtastic_Config_PositionConfig_PositionFlags_MIN meshtastic_Config_PositionConfig_PositionFlags_UNSET #define _meshtastic_Config_PositionConfig_PositionFlags_MAX meshtastic_Config_PositionConfig_PositionFlags_SPEED #define _meshtastic_Config_PositionConfig_PositionFlags_ARRAYSIZE ((meshtastic_Config_PositionConfig_PositionFlags)(meshtastic_Config_PositionConfig_PositionFlags_SPEED+1)) @@ -669,6 +693,7 @@ extern "C" { #define meshtastic_Config_DeviceConfig_role_ENUMTYPE meshtastic_Config_DeviceConfig_Role #define meshtastic_Config_DeviceConfig_rebroadcast_mode_ENUMTYPE meshtastic_Config_DeviceConfig_RebroadcastMode +#define meshtastic_Config_DeviceConfig_buzzer_mode_ENUMTYPE meshtastic_Config_DeviceConfig_BuzzerMode #define meshtastic_Config_PositionConfig_gps_mode_ENUMTYPE meshtastic_Config_PositionConfig_GpsMode @@ -692,7 +717,7 @@ extern "C" { /* Initializer values for message structs */ #define meshtastic_Config_init_default {0, {meshtastic_Config_DeviceConfig_init_default}} -#define meshtastic_Config_DeviceConfig_init_default {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0} +#define meshtastic_Config_DeviceConfig_init_default {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0, _meshtastic_Config_DeviceConfig_BuzzerMode_MIN} #define meshtastic_Config_PositionConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN} #define meshtastic_Config_PowerConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_Config_NetworkConfig_init_default {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_default, "", 0, 0} @@ -703,7 +728,7 @@ extern "C" { #define meshtastic_Config_SecurityConfig_init_default {{0, {0}}, {0, {0}}, 0, {{0, {0}}, {0, {0}}, {0, {0}}}, 0, 0, 0, 0} #define meshtastic_Config_SessionkeyConfig_init_default {0} #define meshtastic_Config_init_zero {0, {meshtastic_Config_DeviceConfig_init_zero}} -#define meshtastic_Config_DeviceConfig_init_zero {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0} +#define meshtastic_Config_DeviceConfig_init_zero {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0, _meshtastic_Config_DeviceConfig_BuzzerMode_MIN} #define meshtastic_Config_PositionConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN} #define meshtastic_Config_PowerConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_Config_NetworkConfig_init_zero {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_zero, "", 0, 0} @@ -726,6 +751,7 @@ extern "C" { #define meshtastic_Config_DeviceConfig_disable_triple_click_tag 10 #define meshtastic_Config_DeviceConfig_tzdef_tag 11 #define meshtastic_Config_DeviceConfig_led_heartbeat_disabled_tag 12 +#define meshtastic_Config_DeviceConfig_buzzer_mode_tag 13 #define meshtastic_Config_PositionConfig_position_broadcast_secs_tag 1 #define meshtastic_Config_PositionConfig_position_broadcast_smart_enabled_tag 2 #define meshtastic_Config_PositionConfig_fixed_position_tag 3 @@ -849,7 +875,8 @@ X(a, STATIC, SINGULAR, BOOL, double_tap_as_button_press, 8) \ X(a, STATIC, SINGULAR, BOOL, is_managed, 9) \ X(a, STATIC, SINGULAR, BOOL, disable_triple_click, 10) \ X(a, STATIC, SINGULAR, STRING, tzdef, 11) \ -X(a, STATIC, SINGULAR, BOOL, led_heartbeat_disabled, 12) +X(a, STATIC, SINGULAR, BOOL, led_heartbeat_disabled, 12) \ +X(a, STATIC, SINGULAR, UENUM, buzzer_mode, 13) #define meshtastic_Config_DeviceConfig_CALLBACK NULL #define meshtastic_Config_DeviceConfig_DEFAULT NULL @@ -995,7 +1022,7 @@ extern const pb_msgdesc_t meshtastic_Config_SessionkeyConfig_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_CONFIG_PB_H_MAX_SIZE meshtastic_Config_size #define meshtastic_Config_BluetoothConfig_size 10 -#define meshtastic_Config_DeviceConfig_size 98 +#define meshtastic_Config_DeviceConfig_size 100 #define meshtastic_Config_DisplayConfig_size 32 #define meshtastic_Config_LoRaConfig_size 85 #define meshtastic_Config_NetworkConfig_IpV4Config_size 20 diff --git a/src/mesh/generated/meshtastic/device_ui.pb.h b/src/mesh/generated/meshtastic/device_ui.pb.h index 5692a2749..3a8ddd3a4 100644 --- a/src/mesh/generated/meshtastic/device_ui.pb.h +++ b/src/mesh/generated/meshtastic/device_ui.pb.h @@ -55,6 +55,8 @@ typedef enum _meshtastic_Language { meshtastic_Language_SLOVENIAN = 15, /* Ukrainian */ meshtastic_Language_UKRAINIAN = 16, + /* Bulgarian */ + meshtastic_Language_BULGARIAN = 17, /* Simplified Chinese (experimental) */ meshtastic_Language_SIMPLIFIED_CHINESE = 30, /* Traditional Chinese (experimental) */ diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index 37f99d8b5..f78689cb2 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -360,7 +360,7 @@ extern const pb_msgdesc_t meshtastic_BackupPreferences_msg; /* Maximum encoded size of messages (where known) */ /* meshtastic_NodeDatabase_size depends on runtime parameters */ #define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size -#define meshtastic_BackupPreferences_size 2269 +#define meshtastic_BackupPreferences_size 2271 #define meshtastic_ChannelFile_size 718 #define meshtastic_DeviceState_size 1722 #define meshtastic_NodeInfoLite_size 196 diff --git a/src/mesh/generated/meshtastic/localonly.pb.h b/src/mesh/generated/meshtastic/localonly.pb.h index bb2eefc04..ca8dcd5fb 100644 --- a/src/mesh/generated/meshtastic/localonly.pb.h +++ b/src/mesh/generated/meshtastic/localonly.pb.h @@ -187,7 +187,7 @@ extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalConfig_size -#define meshtastic_LocalConfig_size 745 +#define meshtastic_LocalConfig_size 747 #define meshtastic_LocalModuleConfig_size 669 #ifdef __cplusplus diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 5fc1cc4f5..06bc706aa 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -258,6 +258,12 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1_EINK = 100, /* Reserved ID for future and past use */ meshtastic_HardwareModel_QWANTZ_TINY_ARMS = 101, + /* * + Lilygo T-Deck Pro */ + meshtastic_HardwareModel_T_DECK_PRO = 102, + /* * + Lilygo TLora Pager */ + meshtastic_HardwareModel_T_LORA_PAGER = 103, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ From 15d2ae17f898e12f90b1e547b1e05e6108359279 Mon Sep 17 00:00:00 2001 From: Tom <116762865+NomDeTom@users.noreply.github.com> Date: Sat, 7 Jun 2025 12:55:58 +0100 Subject: [PATCH 245/461] Add note to hydra to note that the button pin has no pull-up (#6979) Add note to hydra to note that the button pin has no pull-up. Use an external resistor or remove the `#define`. --- variants/diy/hydra/variant.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/variants/diy/hydra/variant.h b/variants/diy/hydra/variant.h index 60bb60beb..08e8cec05 100644 --- a/variants/diy/hydra/variant.h +++ b/variants/diy/hydra/variant.h @@ -9,6 +9,8 @@ #define GPS_POWER_TOGGLE // Moved definition from platformio.ini to here #define BUTTON_PIN 39 // The middle button GPIO on the T-Beam +// Note: On the ESP32 base version, gpio34-39 are input-only, and do not have internal pull-ups. +// If 39 is not being used for a button, it is suggested to remove the #define. #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define ADC_CHANNEL ADC1_GPIO35_CHANNEL #define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k) From 46c7d747608ec4e158b5055e386f055a4c2ed8d0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 7 Jun 2025 07:58:01 -0500 Subject: [PATCH 246/461] Upgrade trunk (#6968) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 693a2284d..1f13c1ee7 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,7 +9,7 @@ plugins: lint: enabled: - checkov@3.2.436 - - renovate@40.41.0 + - renovate@40.42.2 - prettier@3.5.3 - trufflehog@3.88.35 - yamllint@1.37.1 From f67aec40e8b544a6d90170b23f722275896b9288 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 8 Jun 2025 07:48:34 +1000 Subject: [PATCH 247/461] chore(deps): update platformio/espressif32 to v6.11.0 (#6900) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/esp32/esp32.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index a6eff7bf9..cba84181b 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -4,7 +4,7 @@ extends = arduino_base custom_esp32_kind = esp32 platform = # renovate: datasource=custom.pio depName=platformio/espressif32 packageName=platformio/platform/espressif32 - platformio/espressif32@6.10.0 + platformio/espressif32@6.11.0 build_src_filter = ${arduino_base.build_src_filter} - - - - - From 8bd7adca472fdfe21fe8e680e649de7c57b02693 Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 7 Jun 2025 17:49:24 -0400 Subject: [PATCH 248/461] Update Alpine to 3.22 (#6927) --- alpine.Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine.Dockerfile b/alpine.Dockerfile index bf7cad6d4..670736241 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -3,7 +3,7 @@ # trunk-ignore-all(hadolint/DL3018): Do not pin apk package versions # trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions -FROM python:3.13-alpine3.21 AS builder +FROM python:3.13-alpine3.22 AS builder ARG PIO_ENV=native ENV PIP_ROOT_USER_ACTION=ignore @@ -27,7 +27,7 @@ RUN bash ./bin/build-native.sh "$PIO_ENV" && \ # ##### PRODUCTION BUILD ############# -FROM alpine:3.21 +FROM alpine:3.22 LABEL org.opencontainers.image.title="Meshtastic" \ org.opencontainers.image.description="Alpine Meshtastic daemon" \ org.opencontainers.image.url="https://meshtastic.org" \ From e78033bb856c1fe5f8c6cbf5850419c50667068c Mon Sep 17 00:00:00 2001 From: Mario Murphy <152455+roens@users.noreply.github.com> Date: Sat, 7 Jun 2025 21:04:31 -0700 Subject: [PATCH 249/461] Clean up install & update shell scripts (#6839) Fixed quoting of the `FILENAME` variable to work when the path of the passed argument contains a space. Also fixed syntactical issues called out by `shellcheck` in multi-condition `if` statements. Also normalized indentation chars (was mix of tabs & spaces) and trailing whitespace. Co-authored-by: Tom Fifield --- bin/device-install.sh | 260 +++++++++++++++++++++--------------------- bin/device-update.sh | 20 ++-- 2 files changed, 140 insertions(+), 140 deletions(-) diff --git a/bin/device-install.sh b/bin/device-install.sh index 76765bb5f..2250db4fc 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -33,47 +33,47 @@ BIGDB_16MB=( "ESP32-S3-Pico" "m5stack-cores3" "station-g2" - "t-eth-elite" - "t-watch-s3" + "t-eth-elite" + "t-watch-s3" ) S3_VARIANTS=( - "s3" - "-v3" - "t-deck" - "wireless-paper" - "wireless-tracker" - "station-g2" - "unphone" - "t-eth-elite" - "mesh-tab" - "dreamcatcher" - "ESP32-S3-Pico" - "seeed-sensecap-indicator" - "heltec_capsule_sensor_v3" - "vision-master" - "icarus" - "tracksenger" - "elecrow-adv" + "s3" + "-v3" + "t-deck" + "wireless-paper" + "wireless-tracker" + "station-g2" + "unphone" + "t-eth-elite" + "mesh-tab" + "dreamcatcher" + "ESP32-S3-Pico" + "seeed-sensecap-indicator" + "heltec_capsule_sensor_v3" + "vision-master" + "icarus" + "tracksenger" + "elecrow-adv" ) # Determine the correct esptool command to use if "$PYTHON" -m esptool version >/dev/null 2>&1; then - ESPTOOL_CMD="$PYTHON -m esptool" + ESPTOOL_CMD="$PYTHON -m esptool" elif command -v esptool >/dev/null 2>&1; then - ESPTOOL_CMD="esptool" + ESPTOOL_CMD="esptool" elif command -v esptool.py >/dev/null 2>&1; then - ESPTOOL_CMD="esptool.py" + ESPTOOL_CMD="esptool.py" else - echo "Error: esptool not found" - exit 1 + echo "Error: esptool not found" + exit 1 fi set -e # Usage info show_help() { - cat <&2 - exit 1 - ;; - esac - shift # Move to the next argument + case "$1" in + -h | --help) + show_help + exit 0 + ;; + -p) + ESPTOOL_CMD="$ESPTOOL_CMD --port $2" + shift + ;; + -P) + PYTHON="$2" + shift + ;; + -f) + FILENAME="$2" + shift + ;; + --web) + WEB_APP=true + ;; + --1200bps-reset) + BPS_RESET=true + ;; + --) # Stop parsing options + shift + break + ;; + *) + echo "Unknown argument: $1" >&2 + exit 1 + ;; + esac + shift # Move to the next argument done if [[ $BPS_RESET == true ]]; then @@ -127,100 +127,100 @@ if [[ $BPS_RESET == true ]]; then exit 0 fi -[ -z "$FILENAME" -a -n "$1" ] && { - FILENAME=$1 - shift +[ -z "$FILENAME" ] && [ -n "$1" ] && { + FILENAME="$1" + shift } -if [[ $FILENAME != firmware-* ]]; then +if [[ "$FILENAME" != firmware-* ]]; then echo "Filename must be a firmware-* file." exit 1 fi # Check if FILENAME contains "-tft-" and prevent web/mui comingling. -if [[ ${FILENAME//-tft-/} != "$FILENAME" ]]; then - TFT_BUILD=true - if [[ $WEB_APP == true ]] && [[ $TFT_BUILD == true ]]; then - echo "Cannot enable WebUI (--web) and MUI." - exit 1 - fi +if [[ "${FILENAME//-tft-/}" != "$FILENAME" ]]; then + TFT_BUILD=true + if [[ $WEB_APP == true ]] && [[ $TFT_BUILD == true ]]; then + echo "Cannot enable WebUI (--web) and MUI." + exit 1 + fi fi # Extract BASENAME from %FILENAME% for later use. BASENAME="${FILENAME/firmware-/}" if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then - # Default littlefs* offset (--web). - OFFSET=0x300000 + # Default littlefs* offset (--web). + OFFSET=0x300000 - # Default OTA Offset - OTA_OFFSET=0x260000 + # Default OTA Offset + OTA_OFFSET=0x260000 - # littlefs* offset for BigDB 8mb and OTA OFFSET. - for variant in "${BIGDB_8MB[@]}"; do - if [ -z "${FILENAME##*"$variant"*}" ]; then - OFFSET=0x670000 - OTA_OFFSET=0x340000 - fi - done + # littlefs* offset for BigDB 8mb and OTA OFFSET. + for variant in "${BIGDB_8MB[@]}"; do + if [ -z "${FILENAME##*"$variant"*}" ]; then + OFFSET=0x670000 + OTA_OFFSET=0x340000 + fi + done - # littlefs* offset for BigDB 16mb and OTA OFFSET. - for variant in "${BIGDB_16MB[@]}"; do - if [ -z "${FILENAME##*"$variant"*}" ]; then - OFFSET=0xc90000 - OTA_OFFSET=0x650000 - fi - done + # littlefs* offset for BigDB 16mb and OTA OFFSET. + for variant in "${BIGDB_16MB[@]}"; do + if [ -z "${FILENAME##*"$variant"*}" ]; then + OFFSET=0xc90000 + OTA_OFFSET=0x650000 + fi + done - # Account for S3 board's different OTA partition - # FIXME: Use PlatformIO info to determine MCU type, this is unmaintainable - for variant in "${S3_VARIANTS[@]}"; do - if [ -z "${FILENAME##*"$variant"*}" ]; then - MCU="esp32s3" - fi - done + # Account for S3 board's different OTA partition + # FIXME: Use PlatformIO info to determine MCU type, this is unmaintainable + for variant in "${S3_VARIANTS[@]}"; do + if [ -z "${FILENAME##*"$variant"*}" ]; then + MCU="esp32s3" + fi + done - if [ "$MCU" != "esp32s3" ]; then - if [ -n "${FILENAME##*"esp32c3"*}" ]; then - OTAFILE=bleota.bin - else - OTAFILE=bleota-c3.bin - fi - else - OTAFILE=bleota-s3.bin - fi + if [ "$MCU" != "esp32s3" ]; then + if [ -n "${FILENAME##*"esp32c3"*}" ]; then + OTAFILE=bleota.bin + else + OTAFILE=bleota-c3.bin + fi + else + OTAFILE=bleota-s3.bin + fi - # Check if WEB_APP (--web) is enabled and add "littlefswebui-" to BASENAME else "littlefs-". - if [ "$WEB_APP" = true ]; then - SPIFFSFILE=littlefswebui-${BASENAME} - else - SPIFFSFILE=littlefs-${BASENAME} - fi + # Check if WEB_APP (--web) is enabled and add "littlefswebui-" to BASENAME else "littlefs-". + if [ "$WEB_APP" = true ]; then + SPIFFSFILE=littlefswebui-${BASENAME} + else + SPIFFSFILE=littlefs-${BASENAME} + fi - if [[ ! -f $FILENAME ]]; then - echo "Error: file ${FILENAME} wasn't found. Terminating." - exit 1 - fi - if [[ ! -f $OTAFILE ]]; then - echo "Error: file ${OTAFILE} wasn't found. Terminating." - exit 1 - fi - if [[ ! -f $SPIFFSFILE ]]; then - echo "Error: file ${SPIFFSFILE} wasn't found. Terminating." - exit 1 - fi + if [[ ! -f "$FILENAME" ]]; then + echo "Error: file ${FILENAME} wasn't found. Terminating." + exit 1 + fi + if [[ ! -f "$OTAFILE" ]]; then + echo "Error: file ${OTAFILE} wasn't found. Terminating." + exit 1 + fi + if [[ ! -f "$SPIFFSFILE" ]]; then + echo "Error: file ${SPIFFSFILE} wasn't found. Terminating." + exit 1 + fi - echo "Trying to flash ${FILENAME}, but first erasing and writing system information" - $ESPTOOL_CMD erase_flash - $ESPTOOL_CMD write_flash 0x00 "${FILENAME}" - echo "Trying to flash ${OTAFILE} at offset ${OTA_OFFSET}" - $ESPTOOL_CMD write_flash $OTA_OFFSET "${OTAFILE}" - echo "Trying to flash ${SPIFFSFILE}, at offset ${OFFSET}" - $ESPTOOL_CMD write_flash $OFFSET "${SPIFFSFILE}" + echo "Trying to flash ${FILENAME}, but first erasing and writing system information" + $ESPTOOL_CMD erase_flash + $ESPTOOL_CMD write_flash 0x00 "${FILENAME}" + echo "Trying to flash ${OTAFILE} at offset ${OTA_OFFSET}" + $ESPTOOL_CMD write_flash $OTA_OFFSET "${OTAFILE}" + echo "Trying to flash ${SPIFFSFILE}, at offset ${OFFSET}" + $ESPTOOL_CMD write_flash $OFFSET "${SPIFFSFILE}" else - show_help - echo "Invalid file: ${FILENAME}" + show_help + echo "Invalid file: ${FILENAME}" fi exit 0 diff --git a/bin/device-update.sh b/bin/device-update.sh index c32b953e6..6adfe4e0e 100755 --- a/bin/device-update.sh +++ b/bin/device-update.sh @@ -18,8 +18,8 @@ fi # Usage info show_help() { cat << EOF -Usage: $(basename $0) [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME] [--change-mode] -Flash image file to device, leave existing system intact. +Usage: $(basename "$0") [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME] [--change-mode] +Flash image file to device, leave existing system intact." -h Display this help and exit -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerous). @@ -38,7 +38,7 @@ while getopts ":hp:P:f:" opt; do exit 0 ;; p) ESPTOOL_CMD="$ESPTOOL_CMD --port ${OPTARG}" - ;; + ;; P) PYTHON=${OPTARG} ;; f) FILENAME=${OPTARG} @@ -47,7 +47,7 @@ while getopts ":hp:P:f:" opt; do CHANGE_MODE=true ;; *) - echo "Invalid flag." + echo "Invalid flag." show_help >&2 exit 1 ;; @@ -60,17 +60,17 @@ if [[ $CHANGE_MODE == true ]]; then exit 0 fi -[ -z "$FILENAME" -a -n "$1" ] && { - FILENAME=$1 +[ -z "$FILENAME" ] && [ -n "$1" ] && { + FILENAME="$1" shift } if [ -f "${FILENAME}" ] && [ -z "${FILENAME##*"update"*}" ]; then - printf "Trying to flash update ${FILENAME}" - $ESPTOOL_CMD --baud 115200 write_flash 0x10000 ${FILENAME} + echo "Trying to flash update ${FILENAME}" + $ESPTOOL_CMD --baud 115200 write_flash 0x10000 "${FILENAME}" else - show_help - echo "Invalid file: ${FILENAME}" + show_help + echo "Invalid file: ${FILENAME}" fi exit 0 From b8970d66a1094b3f366ec7dd704cfa5dd541288d Mon Sep 17 00:00:00 2001 From: Christian Crank Date: Sun, 8 Jun 2025 02:51:37 -0400 Subject: [PATCH 250/461] Addition of Device Role inside of userPrefs.jsonc (#6972) * addition of device.role via userprefs. USERPREFS_CONFIG_DEVICE_ROLE now usable, ROUTER*, LOST_AND_FOUND, and REPEATER disabled. * Removing added IS_ONE_OF macro definition since meshUtils.h exists - thanks Ben! * Fix clang-format issues in NodeDB.cpp utilizing Trunk --- src/mesh/NodeDB.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 0a79f94a8..d86630a37 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -499,6 +499,21 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) true; // FIXME: maybe false in the future, and setting region to enable it. (unset region forces it off) config.lora.override_duty_cycle = false; config.lora.config_ok_to_mqtt = false; + +#ifdef USERPREFS_CONFIG_DEVICE_ROLE + // Restrict ROUTER*, LOST AND FOUND, and REPEATER roles for security reasons + if (IS_ONE_OF(USERPREFS_CONFIG_DEVICE_ROLE, meshtastic_Config_DeviceConfig_Role_ROUTER, + meshtastic_Config_DeviceConfig_Role_ROUTER_LATE, meshtastic_Config_DeviceConfig_Role_REPEATER, + meshtastic_Config_DeviceConfig_Role_LOST_AND_FOUND)) { + LOG_WARN("ROUTER roles are restricted, falling back to CLIENT role"); + config.device.role = meshtastic_Config_DeviceConfig_Role_CLIENT; + } else { + config.device.role = USERPREFS_CONFIG_DEVICE_ROLE; + } +#else + config.device.role = meshtastic_Config_DeviceConfig_Role_CLIENT; // Default to client. +#endif + #ifdef USERPREFS_CONFIG_LORA_REGION config.lora.region = USERPREFS_CONFIG_LORA_REGION; #else @@ -671,6 +686,11 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) } #endif +#ifdef USERPREFS_CONFIG_DEVICE_ROLE + // Apply role-specific defaults when role is set via user preferences + installRoleDefaults(config.device.role); +#endif + initConfigIntervals(); } @@ -1822,4 +1842,4 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co LOG_ERROR("A critical failure occurred, portduino is exiting"); exit(2); #endif -} \ No newline at end of file +} From 484af8eb9f116158cc103a3b1df82e58684576bf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 8 Jun 2025 17:54:20 +1000 Subject: [PATCH 251/461] chore(deps): update platformio/ststm32 to v19.2.0 (#6901) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/stm32/stm32.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/stm32/stm32.ini b/arch/stm32/stm32.ini index dd190c9d4..e7a340f92 100644 --- a/arch/stm32/stm32.ini +++ b/arch/stm32/stm32.ini @@ -2,7 +2,7 @@ extends = arduino_base platform = # renovate: datasource=custom.pio depName=platformio/ststm32 packageName=platformio/platform/ststm32 - platformio/ststm32@19.1.0 + platformio/ststm32@19.2.0 platform_packages = # TODO renovate platformio/framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32/archive/2.10.1.zip From 57a33790ed53f09f8a2c2e698034bb131b63310b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 8 Jun 2025 04:02:47 -0500 Subject: [PATCH 252/461] chore(deps): update meshtastic/device-ui digest to 2fd19f8 (#6982) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index ecde59de2..42c27d226 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/649e0953508ee4aabf1171519ee2eb69fb125647.zip + https://github.com/meshtastic/device-ui/archive/2fd19f813dc7364fe6b899accdc9f48bf5640120.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 3dec521f75ef7172843232598bd798747ed3d495 Mon Sep 17 00:00:00 2001 From: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> Date: Mon, 9 Jun 2025 06:27:52 -0400 Subject: [PATCH 253/461] T-watch screen misalignment fix (#6996) * T-watch screen misalignment fix * Trunk fix --- src/graphics/TFTDisplay.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index 14787baff..76fe6b2d3 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -467,18 +467,27 @@ class LGFX : public lgfx::LGFX_Device // The following setting values ​​are general initial values ​​for each panel, so please comment out any // unknown items and try them. - - cfg.memory_width = TFT_WIDTH; // Maximum width supported by the driver IC - cfg.memory_height = TFT_HEIGHT; // Maximum height supported by the driver IC - cfg.panel_width = TFT_WIDTH; // actual displayable width - cfg.panel_height = TFT_HEIGHT; // actual displayable height - cfg.offset_x = TFT_OFFSET_X; // Panel offset amount in X direction - cfg.offset_y = TFT_OFFSET_Y; // Panel offset amount in Y direction - cfg.offset_rotation = TFT_OFFSET_ROTATION; // Rotation direction value offset 0~7 (4~7 is mirrored) +#if defined(T_WATCH_S3) + cfg.panel_width = 240; + cfg.panel_height = 240; + cfg.memory_width = 240; + cfg.memory_height = 320; + cfg.offset_x = 0; + cfg.offset_y = 0; // No vertical shift needed — panel is top-aligned + cfg.offset_rotation = 2; // Rotate 180° to correct upside-down layout +#else + cfg.memory_width = TFT_WIDTH; // Maximum width supported by the driver IC + cfg.memory_height = TFT_HEIGHT; // Maximum height supported by the driver IC + cfg.panel_width = TFT_WIDTH; // actual displayable width + cfg.panel_height = TFT_HEIGHT; // actual displayable height + cfg.offset_x = TFT_OFFSET_X; // Panel offset amount in X direction + cfg.offset_y = TFT_OFFSET_Y; // Panel offset amount in Y direction + cfg.offset_rotation = TFT_OFFSET_ROTATION; // Rotation direction value offset 0~7 (4~7 is mirrored) +#endif #ifdef TFT_DUMMY_READ_PIXELS cfg.dummy_read_pixel = TFT_DUMMY_READ_PIXELS; // Number of bits for dummy read before pixel readout #else - cfg.dummy_read_pixel = 9; // Number of bits for dummy read before pixel readout + cfg.dummy_read_pixel = 9; // Number of bits for dummy read before pixel readout #endif cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read cfg.readable = true; // Set to true if data can be read From 7924ef87b5a4576c9aa7ca8aa128e803675a6f3a Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Mon, 9 Jun 2025 12:41:41 +0200 Subject: [PATCH 254/461] enable custom driver (#6988) Co-authored-by: Ben Meadors --- variants/t-deck/platformio.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/variants/t-deck/platformio.ini b/variants/t-deck/platformio.ini index 14fbee6cf..0e644001e 100644 --- a/variants/t-deck/platformio.ini +++ b/variants/t-deck/platformio.ini @@ -67,7 +67,9 @@ build_flags = ; -D USE_DOUBLE_BUFFER -D USE_PACKET_API -D MAP_FULL_REDRAW + -D CUSTOM_TOUCH_DRIVER lib_deps = ${env:t-deck.lib_deps} ${device-ui_base.lib_deps} + https://github.com/bitbank2/bb_captouch/archive/refs/tags/1.3.1.zip From 67e3d574124e3c2f1a024912ea8f439f4e969574 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 05:56:48 -0500 Subject: [PATCH 255/461] chore(deps): update meshtastic/device-ui digest to 1b520fc (#6991) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 42c27d226..555879fb5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/2fd19f813dc7364fe6b899accdc9f48bf5640120.zip + https://github.com/meshtastic/device-ui/archive/1b520fcb168c7447a8d6a6ebc56954c9f472e964.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 1eacdd0629054587c1bb0499c7b3186957a767ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hampa=C3=AF?= Date: Mon, 9 Jun 2025 23:48:52 +0200 Subject: [PATCH 256/461] [Variant] nomadstar meteor pro (#6742) * Initial support for NomadStar Meteor Pro * Cleaned up Platformio variant comments * Removed RTC & ETH deps. * Removed RGB NCP5623 deps, Enabled AmbientLight by default * Added HWID mapping * Updated Armduino-Semihosting lib dep with archived version. * Fixed trunk linting in AmbientLightingThread.h and hydra variant --- src/AmbientLightingThread.h | 172 +++++------ src/platform/nrf52/architecture.h | 2 + variants/diy/hydra/variant.h | 2 +- .../platformio.ini | 51 ++++ .../rak4631_nomadstar_meteor_pro/variant.cpp | 45 +++ .../rak4631_nomadstar_meteor_pro/variant.h | 271 ++++++++++++++++++ 6 files changed, 457 insertions(+), 86 deletions(-) create mode 100644 variants/rak4631_nomadstar_meteor_pro/platformio.ini create mode 100644 variants/rak4631_nomadstar_meteor_pro/variant.cpp create mode 100644 variants/rak4631_nomadstar_meteor_pro/variant.h diff --git a/src/AmbientLightingThread.h b/src/AmbientLightingThread.h index bff8846d6..e4ef3b443 100644 --- a/src/AmbientLightingThread.h +++ b/src/AmbientLightingThread.h @@ -59,82 +59,82 @@ class AmbientLightingThread : public concurrency::OSThread return; } LOG_DEBUG("AmbientLighting init"); -#if defined(HAS_NCP5623) || defined(HAS_LP5562) +#ifdef HAS_NCP5623 if (_type == ScanI2C::NCP5623) { rgb.begin(); #endif #ifdef HAS_LP5562 - } else if (_type == ScanI2C::LP5562) { - rgbw.begin(); + if (_type == ScanI2C::LP5562) { + rgbw.begin(); #endif #ifdef RGBLED_RED - pinMode(RGBLED_RED, OUTPUT); - pinMode(RGBLED_GREEN, OUTPUT); - pinMode(RGBLED_BLUE, OUTPUT); + pinMode(RGBLED_RED, OUTPUT); + pinMode(RGBLED_GREEN, OUTPUT); + pinMode(RGBLED_BLUE, OUTPUT); #endif #ifdef HAS_NEOPIXEL - pixels.begin(); // Initialise the pixel(s) - pixels.clear(); // Set all pixel colors to 'off' - pixels.setBrightness(moduleConfig.ambient_lighting.current); + pixels.begin(); // Initialise the pixel(s) + pixels.clear(); // Set all pixel colors to 'off' + pixels.setBrightness(moduleConfig.ambient_lighting.current); #endif - setLighting(); + setLighting(); #endif #if defined(HAS_NCP5623) || defined(HAS_LP5562) - } + } #endif - } + } - protected: - int32_t runOnce() override - { + protected: + int32_t runOnce() override + { #ifdef HAS_RGB_LED #if defined(HAS_NCP5623) || defined(HAS_LP5562) - if ((_type == ScanI2C::NCP5623 || _type == ScanI2C::LP5562) && moduleConfig.ambient_lighting.led_state) { + if ((_type == ScanI2C::NCP5623 || _type == ScanI2C::LP5562) && moduleConfig.ambient_lighting.led_state) { #endif - setLighting(); - return 30000; // 30 seconds to reset from any animations that may have been running from Ext. Notification + setLighting(); + return 30000; // 30 seconds to reset from any animations that may have been running from Ext. Notification #if defined(HAS_NCP5623) || defined(HAS_LP5562) + } +#endif +#endif + return disable(); } -#endif -#endif - return disable(); - } - // When shutdown() is issued, setLightingOff will be called. - CallbackObserver notifyDeepSleepObserver = - CallbackObserver(this, &AmbientLightingThread::setLightingOff); + // When shutdown() is issued, setLightingOff will be called. + CallbackObserver notifyDeepSleepObserver = + CallbackObserver(this, &AmbientLightingThread::setLightingOff); - private: - ScanI2C::DeviceType _type = ScanI2C::DeviceType::NONE; + private: + ScanI2C::DeviceType _type = ScanI2C::DeviceType::NONE; - // Turn RGB lighting off, is used in junction to shutdown() - int setLightingOff(void *unused) - { + // Turn RGB lighting off, is used in junction to shutdown() + int setLightingOff(void *unused) + { #ifdef HAS_NCP5623 - rgb.setCurrent(0); - rgb.setRed(0); - rgb.setGreen(0); - rgb.setBlue(0); - LOG_INFO("OFF: NCP5623 Ambient lighting"); + rgb.setCurrent(0); + rgb.setRed(0); + rgb.setGreen(0); + rgb.setBlue(0); + LOG_INFO("OFF: NCP5623 Ambient lighting"); #endif #ifdef HAS_LP5562 - rgbw.setCurrent(0); - rgbw.setRed(0); - rgbw.setGreen(0); - rgbw.setBlue(0); - rgbw.setWhite(0); - LOG_INFO("OFF: LP5562 Ambient lighting"); + rgbw.setCurrent(0); + rgbw.setRed(0); + rgbw.setGreen(0); + rgbw.setBlue(0); + rgbw.setWhite(0); + LOG_INFO("OFF: LP5562 Ambient lighting"); #endif #ifdef HAS_NEOPIXEL - pixels.clear(); - pixels.show(); - LOG_INFO("OFF: NeoPixel Ambient lighting"); + pixels.clear(); + pixels.show(); + LOG_INFO("OFF: NeoPixel Ambient lighting"); #endif #ifdef RGBLED_CA - analogWrite(RGBLED_RED, 255 - 0); - analogWrite(RGBLED_GREEN, 255 - 0); - analogWrite(RGBLED_BLUE, 255 - 0); - LOG_INFO("OFF: Ambient light RGB Common Anode"); + analogWrite(RGBLED_RED, 255 - 0); + analogWrite(RGBLED_GREEN, 255 - 0); + analogWrite(RGBLED_BLUE, 255 - 0); + LOG_INFO("OFF: Ambient light RGB Common Anode"); #elif defined(RGBLED_RED) analogWrite(RGBLED_RED, 0); analogWrite(RGBLED_GREEN, 0); @@ -142,56 +142,57 @@ class AmbientLightingThread : public concurrency::OSThread LOG_INFO("OFF: Ambient light RGB Common Cathode"); #endif #ifdef UNPHONE - unphone.rgb(0, 0, 0); - LOG_INFO("OFF: unPhone Ambient lighting"); + unphone.rgb(0, 0, 0); + LOG_INFO("OFF: unPhone Ambient lighting"); #endif - return 0; - } + return 0; + } - void setLighting() - { + void setLighting() + { #ifdef HAS_NCP5623 - rgb.setCurrent(moduleConfig.ambient_lighting.current); - rgb.setRed(moduleConfig.ambient_lighting.red); - rgb.setGreen(moduleConfig.ambient_lighting.green); - rgb.setBlue(moduleConfig.ambient_lighting.blue); - LOG_DEBUG("Init NCP5623 Ambient light w/ current=%d, red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.current, - moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue); + rgb.setCurrent(moduleConfig.ambient_lighting.current); + rgb.setRed(moduleConfig.ambient_lighting.red); + rgb.setGreen(moduleConfig.ambient_lighting.green); + rgb.setBlue(moduleConfig.ambient_lighting.blue); + LOG_DEBUG("Init NCP5623 Ambient light w/ current=%d, red=%d, green=%d, blue=%d", + moduleConfig.ambient_lighting.current, moduleConfig.ambient_lighting.red, + moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue); #endif #ifdef HAS_LP5562 - rgbw.setCurrent(moduleConfig.ambient_lighting.current); - rgbw.setRed(moduleConfig.ambient_lighting.red); - rgbw.setGreen(moduleConfig.ambient_lighting.green); - rgbw.setBlue(moduleConfig.ambient_lighting.blue); - LOG_DEBUG("Init LP5562 Ambient light w/ current=%d, red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.current, - moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue); + rgbw.setCurrent(moduleConfig.ambient_lighting.current); + rgbw.setRed(moduleConfig.ambient_lighting.red); + rgbw.setGreen(moduleConfig.ambient_lighting.green); + rgbw.setBlue(moduleConfig.ambient_lighting.blue); + LOG_DEBUG("Init LP5562 Ambient light w/ current=%d, red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.current, + moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue); #endif #ifdef HAS_NEOPIXEL - pixels.fill(pixels.Color(moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, - moduleConfig.ambient_lighting.blue), - 0, NEOPIXEL_COUNT); + pixels.fill(pixels.Color(moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, + moduleConfig.ambient_lighting.blue), + 0, NEOPIXEL_COUNT); // RadioMaster Bandit has addressable LED at the two buttons // this allow us to set different lighting for them in variant.h file. #ifdef RADIOMASTER_900_BANDIT #if defined(BUTTON1_COLOR) && defined(BUTTON1_COLOR_INDEX) - pixels.fill(BUTTON1_COLOR, BUTTON1_COLOR_INDEX, 1); + pixels.fill(BUTTON1_COLOR, BUTTON1_COLOR_INDEX, 1); #endif #if defined(BUTTON2_COLOR) && defined(BUTTON2_COLOR_INDEX) - pixels.fill(BUTTON2_COLOR, BUTTON2_COLOR_INDEX, 1); + pixels.fill(BUTTON2_COLOR, BUTTON2_COLOR_INDEX, 1); #endif #endif - pixels.show(); - LOG_DEBUG("Init NeoPixel Ambient light w/ brightness(current)=%d, red=%d, green=%d, blue=%d", - moduleConfig.ambient_lighting.current, moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, - moduleConfig.ambient_lighting.blue); + pixels.show(); + LOG_DEBUG("Init NeoPixel Ambient light w/ brightness(current)=%d, red=%d, green=%d, blue=%d", + moduleConfig.ambient_lighting.current, moduleConfig.ambient_lighting.red, + moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue); #endif #ifdef RGBLED_CA - analogWrite(RGBLED_RED, 255 - moduleConfig.ambient_lighting.red); - analogWrite(RGBLED_GREEN, 255 - moduleConfig.ambient_lighting.green); - analogWrite(RGBLED_BLUE, 255 - moduleConfig.ambient_lighting.blue); - LOG_DEBUG("Init Ambient light RGB Common Anode w/ red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.red, - moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue); + analogWrite(RGBLED_RED, 255 - moduleConfig.ambient_lighting.red); + analogWrite(RGBLED_GREEN, 255 - moduleConfig.ambient_lighting.green); + analogWrite(RGBLED_BLUE, 255 - moduleConfig.ambient_lighting.blue); + LOG_DEBUG("Init Ambient light RGB Common Anode w/ red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.red, + moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue); #elif defined(RGBLED_RED) analogWrite(RGBLED_RED, moduleConfig.ambient_lighting.red); analogWrite(RGBLED_GREEN, moduleConfig.ambient_lighting.green); @@ -200,11 +201,12 @@ class AmbientLightingThread : public concurrency::OSThread moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue); #endif #ifdef UNPHONE - unphone.rgb(moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue); - LOG_DEBUG("Init unPhone Ambient light w/ red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.red, - moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue); + unphone.rgb(moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, + moduleConfig.ambient_lighting.blue); + LOG_DEBUG("Init unPhone Ambient light w/ red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.red, + moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue); #endif - } -}; + } + }; } // namespace concurrency diff --git a/src/platform/nrf52/architecture.h b/src/platform/nrf52/architecture.h index eea3aee45..8ea2c3829 100644 --- a/src/platform/nrf52/architecture.h +++ b/src/platform/nrf52/architecture.h @@ -85,6 +85,8 @@ #define HW_VENDOR meshtastic_HardwareModel_SEEED_SOLAR_NODE #elif defined(HELTEC_MESH_POCKET) #define HW_VENDOR meshtastic_HardwareModel_HELTEC_MESH_POCKET +#elif defined(NOMADSTAR_METEOR_PRO) +#define HW_VENDOR meshtastic_HardwareModel_NOMADSTAR_METEOR_PRO #elif defined(SEEED_WIO_TRACKER_L1) #define HW_VENDOR meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1 #else diff --git a/variants/diy/hydra/variant.h b/variants/diy/hydra/variant.h index 08e8cec05..4c809502e 100644 --- a/variants/diy/hydra/variant.h +++ b/variants/diy/hydra/variant.h @@ -8,7 +8,7 @@ #define PIN_GPS_EN 4 #define GPS_POWER_TOGGLE // Moved definition from platformio.ini to here -#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam +#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam // Note: On the ESP32 base version, gpio34-39 are input-only, and do not have internal pull-ups. // If 39 is not being used for a button, it is suggested to remove the #define. #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage diff --git a/variants/rak4631_nomadstar_meteor_pro/platformio.ini b/variants/rak4631_nomadstar_meteor_pro/platformio.ini new file mode 100644 index 000000000..d5fbe6a16 --- /dev/null +++ b/variants/rak4631_nomadstar_meteor_pro/platformio.ini @@ -0,0 +1,51 @@ +; NomadStar Meteor Pro based on RAK4631 with RGBW LED LP5562 support +[env:rak4631_nomadstar_meteor_pro] +extends = nrf52840_base +board = wiscore_rak4631 +board_check = true +build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_nomadstar_meteor_pro -D NOMADSTAR_METEOR_PRO + -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" + ;-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. + -DEINK_DISPLAY_MODEL=GxEPD2_213_BN + -DEINK_WIDTH=250 + -DEINK_HEIGHT=122 + -DRADIOLIB_EXCLUDE_SX128X=1 + -DRADIOLIB_EXCLUDE_SX127X=1 + -DRADIOLIB_EXCLUDE_LR11X0=1 +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631_nomadstar_meteor_pro> + + +lib_deps = + ${nrf52840_base.lib_deps} + https://github.com/NomadStar-outdoor/IOBoard-RGB-LP5562-Library.git#9c366c8 + +; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) +; Note: as of 6/2013 the serial/bootloader based programming takes approximately 30 seconds +;upload_protocol = jlink + +; Allows programming and debug via the RAK NanoDAP as the default debugger tool for the RAK4631 (it is only $10!) +; programming time is about the same as the bootloader version. +; For information on this see the meshtastic developers documentation for "Development on the NRF52" +[env:rak4631_nomadstar_meteor_pro_dbg] +extends = env:rak4631_nomadstar_meteor_pro +board_level = extra + +; if the builtin version of openocd has a buggy version of semihosting, so use the external version +; platform_packages = platformio/tool-openocd@^3.1200.0 + +build_flags = + ${env:rak4631.build_flags} + -D USE_SEMIHOSTING + +lib_deps = + ${env:rak4631.lib_deps} + https://github.com/geeksville/Armduino-Semihosting/archive/35b538fdf208c3530c1434cd099a08e486672ee4.zip + +; NOTE: the pyocd support for semihosting is buggy. So I switched to using the builtin platformio support for the stlink adapter which worked much better. +; However the built in openocd version in platformio has buggy support for TCP to semihosting. +; +; So I'm now trying the external openocd - but the openocd scripts for nrf52.cfg assume you are using a DAP adapter not an STLINK adapter. +; In theory I could change those scripts. But for now I'm trying going back to a DAP adapter but with the external openocd. + +upload_protocol = stlink +; eventually use platformio/tool-pyocd@^2.3600.0 instad +;upload_protocol = custom +;upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE \ No newline at end of file diff --git a/variants/rak4631_nomadstar_meteor_pro/variant.cpp b/variants/rak4631_nomadstar_meteor_pro/variant.cpp new file mode 100644 index 000000000..e84b60b3b --- /dev/null +++ b/variants/rak4631_nomadstar_meteor_pro/variant.cpp @@ -0,0 +1,45 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "variant.h" +#include "nrf.h" +#include "wiring_constants.h" +#include "wiring_digital.h" + +const uint32_t g_ADigitalPinMap[] = { + // P0 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + + // P1 + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}; + +void initVariant() +{ + // LED1 & LED2 + pinMode(PIN_LED1, OUTPUT); + ledOff(PIN_LED1); + + pinMode(PIN_LED2, OUTPUT); + ledOff(PIN_LED2); + + // 3V3 Power Rail + pinMode(PIN_3V3_EN, OUTPUT); + digitalWrite(PIN_3V3_EN, HIGH); +} diff --git a/variants/rak4631_nomadstar_meteor_pro/variant.h b/variants/rak4631_nomadstar_meteor_pro/variant.h new file mode 100644 index 000000000..51baf3ada --- /dev/null +++ b/variants/rak4631_nomadstar_meteor_pro/variant.h @@ -0,0 +1,271 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_RAK4630_ +#define _VARIANT_RAK4630_ + +#define RAK4630 + +/** Master clock frequency */ +#define VARIANT_MCK (64000000ul) + +#define USE_LFXO // Board uses 32khz crystal for LF +// define USE_LFRC // Board uses RC for LF + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// Number of pins defined in PinDescription array +#define PINS_COUNT (48) +#define NUM_DIGITAL_PINS (48) +#define NUM_ANALOG_INPUTS (6) +#define NUM_ANALOG_OUTPUTS (0) + +// LEDs +#define PIN_LED1 (35) +#define PIN_LED2 (36) + +#define LED_BUILTIN PIN_LED1 +#define LED_CONN PIN_LED2 + +#define LED_GREEN PIN_LED1 +#define LED_BLUE PIN_LED2 + +#define LED_STATE_ON 1 // State when LED is litted + +/* + * Buttons + */ + +#define PIN_BUTTON1 9 // Pin for button on E-ink button module or IO expansion +#define BUTTON_NEED_PULLUP +#define PIN_BUTTON2 12 +#define PIN_BUTTON3 24 +#define PIN_BUTTON4 25 + +/* + * Analog pins + */ +#define PIN_A0 (5) +#define PIN_A1 (31) +#define PIN_A2 (28) +#define PIN_A3 (29) +#define PIN_A4 (30) +#define PIN_A5 (31) +#define PIN_A6 (0xff) +#define PIN_A7 (0xff) + +static const uint8_t A0 = PIN_A0; +static const uint8_t A1 = PIN_A1; +static const uint8_t A2 = PIN_A2; +static const uint8_t A3 = PIN_A3; +static const uint8_t A4 = PIN_A4; +static const uint8_t A5 = PIN_A5; +static const uint8_t A6 = PIN_A6; +static const uint8_t A7 = PIN_A7; +#define ADC_RESOLUTION 14 + +// Other pins +#define PIN_AREF (2) +#define PIN_NFC1 (9) +#define PIN_NFC2 (10) + +static const uint8_t AREF = PIN_AREF; + +/* + * Serial interfaces + */ +#define PIN_SERIAL1_RX (15) +#define PIN_SERIAL1_TX (16) + +// Connected to Jlink CDC +#define PIN_SERIAL2_RX (8) +#define PIN_SERIAL2_TX (6) + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 2 + +#define PIN_SPI_MISO (45) +#define PIN_SPI_MOSI (44) +#define PIN_SPI_SCK (43) + +#define PIN_SPI1_MISO (29) // (0 + 29) +#define PIN_SPI1_MOSI (30) // (0 + 30) +#define PIN_SPI1_SCK (3) // (0 + 3) + +static const uint8_t SS = 42; +static const uint8_t MOSI = PIN_SPI_MOSI; +static const uint8_t MISO = PIN_SPI_MISO; +static const uint8_t SCK = PIN_SPI_SCK; + +/* + * eink display pins + */ + +#define PIN_EINK_CS (0 + 26) +#define PIN_EINK_BUSY (0 + 4) +#define PIN_EINK_DC (0 + 17) +#define PIN_EINK_RES (-1) +#define PIN_EINK_SCLK (0 + 3) +#define PIN_EINK_MOSI (0 + 30) // also called SDI + +// #define USE_EINK + +// Texas Instrument LP5562 +#define HAS_LP5562 +#define ENABLE_AMBIENTLIGHTING + +/* + * Wire Interfaces + */ +#define WIRE_INTERFACES_COUNT 1 + +#define PIN_WIRE_SDA (13) +#define PIN_WIRE_SCL (14) + +// QSPI Pins +#define PIN_QSPI_SCK 3 +#define PIN_QSPI_CS 26 +#define PIN_QSPI_IO0 30 +#define PIN_QSPI_IO1 29 +#define PIN_QSPI_IO2 28 +#define PIN_QSPI_IO3 2 + +// On-board QSPI Flash +#define EXTERNAL_FLASH_DEVICES IS25LP080D +#define EXTERNAL_FLASH_USE_QSPI + +/* @note RAK5005-O GPIO mapping to RAK4631 GPIO ports + RAK5005-O <-> nRF52840 + IO1 <-> P0.17 (Arduino GPIO number 17) + IO2 <-> P1.02 (Arduino GPIO number 34) + IO3 <-> P0.21 (Arduino GPIO number 21) + IO4 <-> P0.04 (Arduino GPIO number 4) + IO5 <-> P0.09 (Arduino GPIO number 9) + IO6 <-> P0.10 (Arduino GPIO number 10) + IO7 <-> P0.28 (Arduino GPIO number 28) + SW1 <-> P0.01 (Arduino GPIO number 1) + A0 <-> P0.04/AIN2 (Arduino Analog A2 + A1 <-> P0.31/AIN7 (Arduino Analog A7 + SPI_CS <-> P0.26 (Arduino GPIO number 26) + */ + +// RAK4630 LoRa module + +/* Setup of the SX1262 LoRa module ( https://docs.rakwireless.com/Product-Categories/WisBlock/RAK4631/Datasheet/ ) + +P1.10 NSS SPI NSS (Arduino GPIO number 42) +P1.11 SCK SPI CLK (Arduino GPIO number 43) +P1.12 MOSI SPI MOSI (Arduino GPIO number 44) +P1.13 MISO SPI MISO (Arduino GPIO number 45) +P1.14 BUSY BUSY signal (Arduino GPIO number 46) +P1.15 DIO1 DIO1 event interrupt (Arduino GPIO number 47) +P1.06 NRESET NRESET manual reset of the SX1262 (Arduino GPIO number 38) + +Important for successful SX1262 initialization: + +* Setup DIO2 to control the antenna switch +* Setup DIO3 to control the TCXO power supply +* Setup the SX1262 to use it's DCDC regulator and not the LDO +* RAK4630 schematics show GPIO P1.07 connected to the antenna switch, but it should not be initialized, as DIO2 will do the +control of the antenna switch + +SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG + +*/ + +#define DETECTION_SENSOR_EN 4 + +#define USE_SX1262 +#define SX126X_CS (42) +#define SX126X_DIO1 (47) +#define SX126X_BUSY (46) +#define SX126X_RESET (38) +// #define SX126X_TXEN (39) +// #define SX126X_RXEN (37) +#define SX126X_POWER_EN (37) +// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3 +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 + +// Testing USB detection +#define NRF_APM + +// enables 3.3V periphery like GPS or IO Module +// Do not toggle this for GPS power savings +#define PIN_3V3_EN (34) + +// RAK1910 GPS module +// If using the wisblock GPS module and pluged into Port A on WisBlock base +// IO1 is hooked to PPS (pin 12 on header) = gpio 17 +// IO2 is hooked to GPS RESET = gpio 34, but it can not be used to this because IO2 is ALSO used to control 3V3_S power (1 is on). +// Therefore must be 1 to keep peripherals powered +// Power is on the controllable 3V3_S rail +// #define PIN_GPS_RESET (34) +// #define PIN_GPS_EN PIN_3V3_EN +#define PIN_GPS_PPS (17) // Pulse per second input from the GPS + +#define GPS_RX_PIN PIN_SERIAL1_RX +#define GPS_TX_PIN PIN_SERIAL1_TX + +// Define pin to enable GPS toggle (set GPIO to LOW) via user button triple press + +// RAK18001 Buzzer in Slot C +// #define PIN_BUZZER 21 // IO3 is PWM2 +// NEW: set this via protobuf instead! + +// Battery +// The battery sense is hooked to pin A0 (5) +#define BATTERY_PIN PIN_A0 +// and has 12 bit resolution +#define BATTERY_SENSE_RESOLUTION_BITS 12 +#define BATTERY_SENSE_RESOLUTION 4096.0 +#undef AREF_VOLTAGE +#define AREF_VOLTAGE 3.0 +#define VBAT_AR_INTERNAL AR_INTERNAL_3_0 +#define ADC_MULTIPLIER 1.73 + +#define HAS_RTC 0 + +#define HAS_ETHERNET 0 + +#define RAK_4631 1 + +#define PIN_ETHERNET_RESET 21 +#define PIN_ETHERNET_SS PIN_EINK_CS +#define ETH_SPI_PORT SPI1 +#define AQ_SET_PIN 10 + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#endif \ No newline at end of file From 22cb20d2942a2f8445f407052e9eb04747f2517c Mon Sep 17 00:00:00 2001 From: Travis Hardiman Date: Mon, 9 Jun 2025 23:51:37 -0400 Subject: [PATCH 257/461] Update heltec t114 URL (#7004) --- boards/heltec_mesh_node_t114.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/heltec_mesh_node_t114.json b/boards/heltec_mesh_node_t114.json index 2bd306eb9..d516c9701 100644 --- a/boards/heltec_mesh_node_t114.json +++ b/boards/heltec_mesh_node_t114.json @@ -48,6 +48,6 @@ "require_upload_port": true, "wait_for_upload_port": true }, - "url": "FIXME", + "url": "https://heltec.org/project/mesh-node-t114/", "vendor": "Heltec" } From cf4f088337fc08517defaec9b93cc22d91f4e5b6 Mon Sep 17 00:00:00 2001 From: Travis Hardiman Date: Mon, 9 Jun 2025 23:52:30 -0400 Subject: [PATCH 258/461] Update URL for ThinkNode M1 (#7005) --- boards/ThinkNode-M1.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/ThinkNode-M1.json b/boards/ThinkNode-M1.json index e55da3ec7..2d6dbc352 100644 --- a/boards/ThinkNode-M1.json +++ b/boards/ThinkNode-M1.json @@ -48,6 +48,6 @@ "require_upload_port": true, "wait_for_upload_port": true }, - "url": "FIXME", + "url": "https://www.elecrow.com/thinknode-m1-meshtastic-lora-signal-transceiver-powered-by-nrf52840-with-154-screen-support-gps.html", "vendor": "ELECROW" } From 79b8e7b1cffb3a8d64738185b5357777e4d56eb1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 13:53:04 +1000 Subject: [PATCH 259/461] Upgrade trunk (#6998) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 1f13c1ee7..5217ae181 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,7 +8,7 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.436 + - checkov@3.2.437 - renovate@40.42.2 - prettier@3.5.3 - trufflehog@3.88.35 @@ -16,7 +16,7 @@ lint: - bandit@1.8.3 - trivy@0.63.0 - taplo@0.9.3 - - ruff@0.11.12 + - ruff@0.11.13 - isort@6.0.1 - markdownlint@0.45.0 - oxipng@9.1.5 From c6c2a4d4dd4171d4e62d95c11fabb143574bbcde Mon Sep 17 00:00:00 2001 From: Andreas 'count' Kotes Date: Tue, 10 Jun 2025 05:54:07 +0200 Subject: [PATCH 260/461] Improve support for Heltec Wireless Bridge (#6647) * Use BLE_LED where present for CONNECTED/DISCONNECTED * Use WIFI_LED where present for WiFi started/stopped (as AP) or connected/disconnected (as Station) * improve support for Heltec Wireless Bridge * satisfy 'trunk fmt' --- src/BluetoothStatus.h | 8 ++- src/main.cpp | 10 ++++ src/mesh/wifi/WiFiAPClient.cpp | 14 ++++- src/nimble/NimbleBluetooth.cpp | 5 ++ src/sleep.cpp | 4 +- .../heltec_wireless_bridge/platformio.ini | 19 ++++++- variants/heltec_wireless_bridge/variant.h | 54 +++++++++++-------- 7 files changed, 88 insertions(+), 26 deletions(-) diff --git a/src/BluetoothStatus.h b/src/BluetoothStatus.h index 526b6f243..f6bb43cc2 100644 --- a/src/BluetoothStatus.h +++ b/src/BluetoothStatus.h @@ -88,10 +88,16 @@ class BluetoothStatus : public Status break; case ConnectionState::CONNECTED: LOG_DEBUG("BluetoothStatus CONNECTED"); +#ifdef BLE_LED + digitalWrite(BLE_LED, HIGH); +#endif break; case ConnectionState::DISCONNECTED: LOG_DEBUG("BluetoothStatus DISCONNECTED"); +#ifdef BLE_LED + digitalWrite(BLE_LED, LOW); +#endif break; } } @@ -102,4 +108,4 @@ class BluetoothStatus : public Status } // namespace meshtastic -extern meshtastic::BluetoothStatus *bluetoothStatus; \ No newline at end of file +extern meshtastic::BluetoothStatus *bluetoothStatus; diff --git a/src/main.cpp b/src/main.cpp index c12707cdb..7ecd634c9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -345,6 +345,16 @@ void setup() digitalWrite(USER_LED, HIGH ^ LED_STATE_ON); #endif +#ifdef WIFI_LED + pinMode(WIFI_LED, OUTPUT); + digitalWrite(WIFI_LED, LOW); +#endif + +#ifdef BLE_LED + pinMode(BLE_LED, OUTPUT); + digitalWrite(BLE_LED, LOW); +#endif + #if defined(T_DECK) // GPIO10 manages all peripheral power supplies // Turn on peripheral power immediately after MUC starts. diff --git a/src/mesh/wifi/WiFiAPClient.cpp b/src/mesh/wifi/WiFiAPClient.cpp index 789f8ac44..945460c28 100644 --- a/src/mesh/wifi/WiFiAPClient.cpp +++ b/src/mesh/wifi/WiFiAPClient.cpp @@ -327,9 +327,15 @@ static void WiFiEvent(WiFiEvent_t event) break; case ARDUINO_EVENT_WIFI_STA_CONNECTED: LOG_INFO("Connected to access point"); +#ifdef WIFI_LED + digitalWrite(WIFI_LED, HIGH); +#endif break; case ARDUINO_EVENT_WIFI_STA_DISCONNECTED: LOG_INFO("Disconnected from WiFi access point"); +#ifdef WIFI_LED + digitalWrite(WIFI_LED, LOW); +#endif if (!isReconnecting) { WiFi.disconnect(false, true); syslog.disable(); @@ -378,9 +384,15 @@ static void WiFiEvent(WiFiEvent_t event) break; case ARDUINO_EVENT_WIFI_AP_START: LOG_INFO("WiFi access point started"); +#ifdef WIFI_LED + digitalWrite(WIFI_LED, HIGH); +#endif break; case ARDUINO_EVENT_WIFI_AP_STOP: LOG_INFO("WiFi access point stopped"); +#ifdef WIFI_LED + digitalWrite(WIFI_LED, LOW); +#endif break; case ARDUINO_EVENT_WIFI_AP_STACONNECTED: LOG_INFO("Client connected"); @@ -474,4 +486,4 @@ uint8_t getWifiDisconnectReason() { return wifiDisconnectReason; } -#endif \ No newline at end of file +#endif diff --git a/src/nimble/NimbleBluetooth.cpp b/src/nimble/NimbleBluetooth.cpp index 009439f25..177a07eb4 100644 --- a/src/nimble/NimbleBluetooth.cpp +++ b/src/nimble/NimbleBluetooth.cpp @@ -171,6 +171,11 @@ void NimbleBluetooth::deinit() { #ifdef ARCH_ESP32 LOG_INFO("Disable bluetooth until reboot"); + +#ifdef BLE_LED + digitalWrite(BLE_LED, LOW); +#endif + NimBLEDevice::deinit(); #endif } diff --git a/src/sleep.cpp b/src/sleep.cpp index 8ffb08b04..6d1b2f348 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -332,7 +332,7 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false, bool skipSaveN } #endif -#if defined(ARCH_ESP32) && defined(I2C_SDA) +#if !MESHTASTIC_EXCLUDE_I2C && defined(ARCH_ESP32) && defined(I2C_SDA) // Added by https://github.com/meshtastic/firmware/pull/4418 // Possibly to support Heltec Capsule Sensor? Wire.end(); @@ -542,4 +542,4 @@ void enableLoraInterrupt() } #endif } -#endif \ No newline at end of file +#endif diff --git a/variants/heltec_wireless_bridge/platformio.ini b/variants/heltec_wireless_bridge/platformio.ini index 45c3aba74..ab30eb744 100644 --- a/variants/heltec_wireless_bridge/platformio.ini +++ b/variants/heltec_wireless_bridge/platformio.ini @@ -3,4 +3,21 @@ extends = esp32_base board = heltec_wifi_lora_32 build_flags = - ${esp32_base.build_flags} -D HELTEC_WIRELESS_BRIDGE -I variants/heltec_wireless_bridge \ No newline at end of file + ${esp32_base.build_flags} + -I variants/heltec_wireless_bridge + -D HELTEC_WIRELESS_BRIDGE + -D BOARD_HAS_PSRAM + -D RADIOLIB_EXCLUDE_LR11X0=1 + -D RADIOLIB_EXCLUDE_SX128X=1 + -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 + -D MESHTASTIC_EXCLUDE_DETECTIONSENSOR=1 + -D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1 + -D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL=1 + -D MESHTASTIC_EXCLUDE_EXTERNALNOTIFICATION=1 + -D MESHTASTIC_EXCLUDE_GPS=1 + -D MESHTASTIC_EXCLUDE_I2C=1 + -D MESHTASTIC_EXCLUDE_INPUTBROKER=1 + -D MESHTASTIC_EXCLUDE_POWER_FSM=1 + -D MESHTASTIC_EXCLUDE_SERIAL=1 + -D MESHTASTIC_EXCLUDE_SCREEN=1 + -D MESHTASTIC_EXCLUDE_WAYPOINT=1 diff --git a/variants/heltec_wireless_bridge/variant.h b/variants/heltec_wireless_bridge/variant.h index 7c4f41660..5ad16d0e2 100644 --- a/variants/heltec_wireless_bridge/variant.h +++ b/variants/heltec_wireless_bridge/variant.h @@ -1,29 +1,41 @@ -// the default ESP32 Pin of 15 is the Oled SCL, set to 36 and 37 and works fine. -// Tested on Neo6m module. + +// updated variant 20250420 berlincount, tested with HTIT-TB +// +// connections in HTIT-WB +// per https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf +// md5: a0e6ae10ff76611aa61433366b2e4f5c esp32_datasheet_en.pdf +// per https://resource.heltec.cn/download/Wireless_Bridge/Schematic_Diagram_HTIT-WB_V0.2.pdf +// md5: d5c1b0219ece347dd8cee866d7d3ab0a Schematic_Diagram_HTIT-WB_V0.2.pdf + +#define NO_EXT_GPIO 1 +#define NO_GPS 1 + +#define HAS_GPS 0 // GPS is not equipped #undef GPS_RX_PIN #undef GPS_TX_PIN -#define GPS_RX_PIN 36 -#define GPS_TX_PIN 33 -#ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag -#define I2C_SDA 4 // I2C pins for this board -#define I2C_SCL 15 -#endif - -#define LED_PIN 25 // If defined we will blink this LED -#define BUTTON_PIN 0 // If defined, this will be used for user button presses +// Green / Lora = PIN 22 / GPIO2, Yellow / Wifi = PIN 23 / GPIO0, Blue / BLE = PIN 25 / GPIO16 +#define LED_PIN 22 +#define WIFI_LED 23 +#define BLE_LED 25 +// ESP32-D0WDQ6 direct pins SX1276 #define USE_RF95 -#define LORA_DIO0 26 // a No connect on the SX1262 module -#ifndef USE_JTAG -#define LORA_RESET 14 -#endif +#define LORA_DIO0 26 #define LORA_DIO1 35 -#define LORA_DIO2 34 // Not really used +#define LORA_DIO2 34 +#define LORA_SCK 05 +#define LORA_MISO 19 +#define LORA_MOSI 27 +#define LORA_CS 18 -// ratio of voltage divider = 3.20 (R1=100k, R2=220k) -#define ADC_MULTIPLIER 3.2 +// several things are not possible with JTAG enabled +#ifndef USE_JTAG +#define LORA_RESET 14 // LoRa Reset shares a pin with MTMS +#define I2C_SDA 4 // SD_DATA1 going to W25Q64, but +#define I2C_SCL 15 // SD_CMD shared a pin with MTD0 +#endif -#define BATTERY_PIN 13 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC2_GPIO13_CHANNEL -#define BAT_MEASURE_ADC_UNIT 2 \ No newline at end of file +// user button is present on device, but currently untested & unconfigured - couldn't figure out how it's connected + +// battery support is present within device, but currently untested & unconfigured - couldn't find reliable information yet From 4bf2dd04aeeccc4ba20c79bcaad7a572aabdecad Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 10 Jun 2025 06:33:13 -0500 Subject: [PATCH 261/461] Warn users about low entropy keys (#7003) Co-authored-by: Ben Meadors --- src/mesh/NodeDB.cpp | 44 ++++++++++++++++++++++++++++++++++++++++- src/mesh/NodeDB.h | 48 +++++++++++++++++++++++++++++++++++++++++++++ src/mesh/Router.cpp | 13 ++++++++++++ 3 files changed, 104 insertions(+), 1 deletion(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index d86630a37..9a19f98a8 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -8,6 +8,7 @@ #include "Default.h" #include "FSCommon.h" #include "MeshRadio.h" +#include "MeshService.h" #include "NodeDB.h" #include "PacketHistory.h" #include "PowerFSM.h" @@ -277,6 +278,7 @@ NodeDB::NodeDB() config.security.private_key.size = 32; owner.public_key.size = 32; memcpy(owner.public_key.bytes, config.security.public_key.bytes, 32); + keyIsLowEntropy = checkLowEntropyPublicKey(owner.public_key); } } #elif !(MESHTASTIC_EXCLUDE_PKI) @@ -285,8 +287,12 @@ NodeDB::NodeDB() owner.public_key.size = config.security.public_key.size; memcpy(owner.public_key.bytes, config.security.public_key.bytes, config.security.public_key.size); crypto->setDHPrivateKey(config.security.private_key.bytes); + keyIsLowEntropy = checkLowEntropyPublicKey(owner.public_key); } #endif + if (keyIsLowEntropy) { + LOG_WARN(LOW_ENTROPY_WARNING); + } // Include our owner in the node db under our nodenum meshtastic_NodeInfoLite *info = getOrCreateMeshNode(getNodeNum()); info->user = TypeConversions::ConvertToUserLite(owner); @@ -1556,8 +1562,20 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde } #if !(MESHTASTIC_EXCLUDE_PKI) - if (p.public_key.size > 0) { + if (p.public_key.size == 32) { printBytes("Incoming Pubkey: ", p.public_key.bytes, 32); + + // Alert the user if a remote node is advertising public key that matches our own + if (owner.public_key.size == 32 && memcmp(p.public_key.bytes, owner.public_key.bytes, 32) == 0) { + char warning[] = "Remote device %s has advertised your public key. This may indicate a low-entropy key. You may need " + "to regenerate your public keys."; + LOG_WARN(warning, p.long_name); + meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->level = meshtastic_LogRecord_Level_WARNING; + cn->time = getValidTime(RTCQualityFromNet); + sprintf(cn->message, warning, p.long_name); + service->sendClientNotification(cn); + } } if (info->user.public_key.size > 0) { // if we have a key for this user already, don't overwrite with a new one LOG_INFO("Public Key set for node, not updating!"); @@ -1732,6 +1750,30 @@ UserLicenseStatus NodeDB::getLicenseStatus(uint32_t nodeNum) return info->user.is_licensed ? UserLicenseStatus::Licensed : UserLicenseStatus::NotLicensed; } +bool NodeDB::checkLowEntropyPublicKey(const meshtastic_User_public_key_t keyToTest) +{ + uint8_t keyHash[32] = {0}; + memcpy(keyHash, keyToTest.bytes, keyToTest.size); + crypto->hash(keyHash, 32); + if (memcmp(keyHash, LOW_ENTROPY_HASH1, sizeof(LOW_ENTROPY_HASH1)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH2, sizeof(LOW_ENTROPY_HASH2)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH3, sizeof(LOW_ENTROPY_HASH3)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH4, sizeof(LOW_ENTROPY_HASH4)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH5, sizeof(LOW_ENTROPY_HASH5)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH6, sizeof(LOW_ENTROPY_HASH6)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH7, sizeof(LOW_ENTROPY_HASH7)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH8, sizeof(LOW_ENTROPY_HASH8)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH9, sizeof(LOW_ENTROPY_HASH9)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH10, sizeof(LOW_ENTROPY_HASH10)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH11, sizeof(LOW_ENTROPY_HASH11)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH12, sizeof(LOW_ENTROPY_HASH12)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH13, sizeof(LOW_ENTROPY_HASH13)) == 0) { + return true; + } else { + return false; + } +} + bool NodeDB::backupPreferences(meshtastic_AdminMessage_BackupLocation location) { bool success = false; diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 16159d380..0464ae535 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -17,6 +17,49 @@ #include "PortduinoGlue.h" #endif +#if !defined(MESHTASTIC_EXCLUDE_PKI) + +static const uint8_t LOW_ENTROPY_HASH1[] = {0xf4, 0x7e, 0xcc, 0x17, 0xe6, 0xb4, 0xa3, 0x22, 0xec, 0xee, 0xd9, + 0x08, 0x4f, 0x39, 0x63, 0xea, 0x80, 0x75, 0xe1, 0x24, 0xce, 0x05, + 0x36, 0x69, 0x63, 0xb2, 0xcb, 0xc0, 0x28, 0xd3, 0x34, 0x8b}; +static const uint8_t LOW_ENTROPY_HASH2[] = {0x5a, 0x9e, 0xa2, 0xa6, 0x8a, 0xa6, 0x66, 0xc1, 0x5f, 0x55, 0x00, + 0x64, 0xa3, 0xa6, 0xfe, 0x71, 0xc0, 0xbb, 0x82, 0xc3, 0x32, 0x3d, + 0x7a, 0x7a, 0xe3, 0x6e, 0xfd, 0xdd, 0xad, 0x3a, 0x66, 0xb9}; +static const uint8_t LOW_ENTROPY_HASH3[] = {0xb3, 0xdf, 0x3b, 0x2e, 0x67, 0xb6, 0xd5, 0xf8, 0xdf, 0x76, 0x2c, + 0x45, 0x5e, 0x2e, 0xbd, 0x16, 0xc5, 0xf8, 0x67, 0xaa, 0x15, 0xf8, + 0x92, 0x0b, 0xdf, 0x5a, 0x66, 0x50, 0xac, 0x0d, 0xbb, 0x2f}; +static const uint8_t LOW_ENTROPY_HASH4[] = {0x3b, 0x8f, 0x86, 0x3a, 0x38, 0x1f, 0x77, 0x39, 0xa9, 0x4e, 0xef, + 0x91, 0x18, 0x5a, 0x62, 0xe1, 0xaa, 0x9d, 0x36, 0xea, 0xce, 0x60, + 0x35, 0x8d, 0x9d, 0x1f, 0xf4, 0xb8, 0xc9, 0x13, 0x6a, 0x5d}; +static const uint8_t LOW_ENTROPY_HASH5[] = {0x36, 0x7e, 0x2d, 0xe1, 0x84, 0x5f, 0x42, 0x52, 0x29, 0x11, 0x0a, + 0x25, 0x64, 0x54, 0x6a, 0x6b, 0xfd, 0xb6, 0x65, 0xff, 0x15, 0x1a, + 0x51, 0x71, 0x22, 0x40, 0x57, 0xf6, 0x91, 0x9b, 0x64, 0x58}; +static const uint8_t LOW_ENTROPY_HASH6[] = {0x16, 0x77, 0xeb, 0xa4, 0x52, 0x91, 0xfb, 0x26, 0xcf, 0x8f, 0xd7, + 0xd9, 0xd1, 0x5d, 0xc4, 0x68, 0x73, 0x75, 0xed, 0xc5, 0x95, 0x58, + 0xee, 0x90, 0x56, 0xd4, 0x2f, 0x31, 0x29, 0xf7, 0x8c, 0x1f}; +static const uint8_t LOW_ENTROPY_HASH7[] = {0x31, 0x8c, 0xa9, 0x5e, 0xed, 0x3c, 0x12, 0xbf, 0x97, 0x9c, 0x47, + 0x8e, 0x98, 0x9d, 0xc2, 0x3e, 0x86, 0x23, 0x90, 0x29, 0xc8, 0xb0, + 0x20, 0xf8, 0xb1, 0xb0, 0xaa, 0x19, 0x2a, 0xcf, 0x0a, 0x54}; +static const uint8_t LOW_ENTROPY_HASH8[] = {0xa4, 0x8a, 0x99, 0x0e, 0x51, 0xdc, 0x12, 0x20, 0xf3, 0x13, 0xf5, + 0x2b, 0x3a, 0xe2, 0x43, 0x42, 0xc6, 0x52, 0x98, 0xcd, 0xbb, 0xca, + 0xb1, 0x31, 0xa0, 0xd4, 0xd6, 0x30, 0xf3, 0x27, 0xfb, 0x49}; +static const uint8_t LOW_ENTROPY_HASH9[] = {0xd2, 0x3f, 0x13, 0x8d, 0x22, 0x04, 0x8d, 0x07, 0x59, 0x58, 0xa0, + 0xf9, 0x55, 0xcf, 0x30, 0xa0, 0x2e, 0x2f, 0xca, 0x80, 0x20, 0xe4, + 0xde, 0xa1, 0xad, 0xd9, 0x58, 0xb3, 0x43, 0x2b, 0x22, 0x70}; +static const uint8_t LOW_ENTROPY_HASH10[] = {0x40, 0x41, 0xec, 0x6a, 0xd2, 0xd6, 0x03, 0xe4, 0x9a, 0x9e, 0xbd, + 0x6c, 0x0a, 0x9b, 0x75, 0xa4, 0xbc, 0xab, 0x6f, 0xa7, 0x95, 0xff, + 0x2d, 0xf6, 0xe9, 0xb9, 0xab, 0x4c, 0x0c, 0x1c, 0xd0, 0x3b}; +static const uint8_t LOW_ENTROPY_HASH11[] = {0x22, 0x49, 0x32, 0x2b, 0x00, 0xf9, 0x22, 0xfa, 0x17, 0x02, 0xe9, + 0x64, 0x82, 0xf0, 0x4d, 0x1b, 0xc7, 0x04, 0xfc, 0xdc, 0x8c, 0x5e, + 0xb6, 0xd9, 0x16, 0xd6, 0x37, 0xce, 0x59, 0xaa, 0x09, 0x49}; +static const uint8_t LOW_ENTROPY_HASH12[] = {0x48, 0x6f, 0x1e, 0x48, 0x97, 0x88, 0x64, 0xac, 0xe8, 0xeb, 0x30, + 0xa3, 0xc3, 0xe1, 0xcf, 0x97, 0x39, 0xa6, 0x55, 0x5b, 0x5f, 0xbf, + 0x18, 0xb7, 0x3a, 0xdf, 0xa8, 0x75, 0xe7, 0x9d, 0xe0, 0x1e}; +static const uint8_t LOW_ENTROPY_HASH13[] = {0x09, 0xb4, 0xe2, 0x6d, 0x28, 0x98, 0xc9, 0x47, 0x66, 0x46, 0xbf, + 0xff, 0x58, 0x17, 0x91, 0xaa, 0xc3, 0xbf, 0x4a, 0x9d, 0x0b, 0x88, + 0xb1, 0xf1, 0x03, 0xdd, 0x61, 0xd7, 0xba, 0x9e, 0x64, 0x98}; +static const char LOW_ENTROPY_WARNING[] = "Your Device is configured with a low entropy key. Suggest regenerating DM keys"; +#endif /* DeviceState versions used to be defined in the .proto file but really only this function cares. So changed to a #define here. @@ -87,6 +130,9 @@ class NodeDB Observable newStatus; pb_size_t numMeshNodes; + bool keyIsLowEntropy = false; + bool hasWarned = false; + /// don't do mesh based algorithm for node id assignment (initially) /// instead just store in flash - possibly even in the initial alpha release do this hack NodeDB(); @@ -205,6 +251,8 @@ class NodeDB bool hasValidPosition(const meshtastic_NodeInfoLite *n); + bool checkLowEntropyPublicKey(const meshtastic_User_public_key_t keyToTest); + bool backupPreferences(meshtastic_AdminMessage_BackupLocation location); bool restorePreferences(meshtastic_AdminMessage_BackupLocation location, int restoreWhat = SEGMENT_CONFIG | SEGMENT_MODULECONFIG | SEGMENT_DEVICESTATE | SEGMENT_CHANNELS); diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index fef29388e..b7206c020 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -548,6 +548,19 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p) numbytes += MESHTASTIC_PKC_OVERHEAD; p->channel = 0; p->pki_encrypted = true; + + // warn the user about a low entropy key + if (nodeDB->keyIsLowEntropy) { + LOG_WARN(LOW_ENTROPY_WARNING); + if (!nodeDB->hasWarned) { + meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->level = meshtastic_LogRecord_Level_WARNING; + cn->time = getValidTime(RTCQualityFromNet); + sprintf(cn->message, LOW_ENTROPY_WARNING); + service->sendClientNotification(cn); + nodeDB->hasWarned = true; + } + } } else { if (p->pki_encrypted == true) { // Client specifically requested PKI encryption From 693b11db1d277c13f58fcc0e29f35f793256aaec Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 06:47:41 -0500 Subject: [PATCH 262/461] [create-pull-request] automated change (#7007) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/protobufs b/protobufs index db60f07ac..b448d4a94 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit db60f07ac298b6161ca553b3868b542cceadcac4 +Subproject commit b448d4a94fa4b15fbea8421074ac2a943795601f diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 06bc706aa..8abf82150 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -264,6 +264,9 @@ typedef enum _meshtastic_HardwareModel { /* * Lilygo TLora Pager */ meshtastic_HardwareModel_T_LORA_PAGER = 103, + /* * + GAT562 Mesh Trial Tracker */ + meshtastic_HardwareModel_GAT562_MESH_TRIAL_TRACKER = 104, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ From 720add72b238cf4f4bab541f79ccf730b36b05f0 Mon Sep 17 00:00:00 2001 From: Mark Trevor Birss Date: Tue, 10 Jun 2025 16:07:24 +0200 Subject: [PATCH 263/461] Create lora-lyra-picocalc-wio-sx1262.yaml (#7010) --- .../lora-lyra-picocalc-wio-sx1262.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 bin/config.d/lora-lyra-picocalc-wio-sx1262.yaml diff --git a/bin/config.d/lora-lyra-picocalc-wio-sx1262.yaml b/bin/config.d/lora-lyra-picocalc-wio-sx1262.yaml new file mode 100644 index 000000000..2fd128ce8 --- /dev/null +++ b/bin/config.d/lora-lyra-picocalc-wio-sx1262.yaml @@ -0,0 +1,18 @@ +Lora: + Module: sx1262 + DIO2_AS_RF_SWITCH: true + DIO3_TCXO_VOLTAGE: true + gpiochip: 0 + MOSI: 12 + MISO: 13 + IRQ: 1 + Busy: 23 + Reset: 22 + RXen: 0 + gpiochip: 1 + CS: 9 + SCK: 11 +# TXen: bridge to DIO2 on E22 module + SX126X_MAX_POWER: 22 + spidev: spidev1.0 + spiSpeed: 2000000 From e5f6804421ac4b76dd31980250a505dba24c2aa6 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 10 Jun 2025 13:28:36 -0500 Subject: [PATCH 264/461] Add boolean to only warn a user of a duplicated key once per boot --- src/mesh/NodeDB.cpp | 3 ++- src/mesh/NodeDB.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 9a19f98a8..477629342 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1566,7 +1566,8 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde printBytes("Incoming Pubkey: ", p.public_key.bytes, 32); // Alert the user if a remote node is advertising public key that matches our own - if (owner.public_key.size == 32 && memcmp(p.public_key.bytes, owner.public_key.bytes, 32) == 0) { + if (owner.public_key.size == 32 && memcmp(p.public_key.bytes, owner.public_key.bytes, 32) == 0 && !duplicateWarned) { + duplicateWarned = true; char warning[] = "Remote device %s has advertised your public key. This may indicate a low-entropy key. You may need " "to regenerate your public keys."; LOG_WARN(warning, p.long_name); diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 0464ae535..f03cdd6b6 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -258,6 +258,7 @@ class NodeDB int restoreWhat = SEGMENT_CONFIG | SEGMENT_MODULECONFIG | SEGMENT_DEVICESTATE | SEGMENT_CHANNELS); private: + bool duplicateWarned = false; uint32_t lastNodeDbSave = 0; // when we last saved our db to flash uint32_t lastBackupAttempt = 0; // when we last tried a backup automatically or manually /// Find a node in our DB, create an empty NodeInfoLite if missing From 0ad9758cfd8f23619133174f5789f36c6f318402 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 10 Jun 2025 18:51:54 -0500 Subject: [PATCH 265/461] Revert "chore(deps): update meshtastic/web to v2.6.4 (#6950)" (#7015) This reverts commit 76f72074632e0709c5f4f88c372c09129403e3f6. --- bin/web.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/web.version b/bin/web.version index e46a05b19..a4db534a2 100644 --- a/bin/web.version +++ b/bin/web.version @@ -1 +1 @@ -2.6.4 \ No newline at end of file +2.5.3 \ No newline at end of file From 8304cae01057fdf1311de967a8f18319f51dc2f0 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 11 Jun 2025 06:09:25 -0500 Subject: [PATCH 266/461] Fix issue with CI not picking up elecrow panels due to confusing env --- bin/generate_ci_matrix.py | 2 +- variants/elecrow_panel/platformio.ini | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/generate_ci_matrix.py b/bin/generate_ci_matrix.py index 7513ccff5..0ce6b0f6b 100755 --- a/bin/generate_ci_matrix.py +++ b/bin/generate_ci_matrix.py @@ -27,7 +27,7 @@ for subdir, dirs, files in os.walk(rootdir): if c.startswith("env:"): section = config[c].name[4:] if "extends" in config[config[c].name]: - if config[config[c].name]["extends"] == options[0] + "_base": + if options[0] + "_base" in config[config[c].name]["extends"]: if "board_level" in config[config[c].name]: if ( config[config[c].name]["board_level"] == "extra" diff --git a/variants/elecrow_panel/platformio.ini b/variants/elecrow_panel/platformio.ini index 963174560..d15aa969a 100644 --- a/variants/elecrow_panel/platformio.ini +++ b/variants/elecrow_panel/platformio.ini @@ -48,7 +48,7 @@ lib_deps = ${esp32s3_base.lib_deps} lovyan03/LovyanGFX@1.2.0 ; note: v1.2.7 breaks the elecrow 7" display functionality hideakitai/TCA9534@0.1.1 -[crowpanel_small] ; 2.4, 2.8, 3.5 inch +[crowpanel_large_esp32s3_base_esp32s3_base] ; 2.4, 2.8, 3.5 inch extends = crowpanel_base build_flags = ${crowpanel_base.build_flags} @@ -73,9 +73,9 @@ build_flags = -D DISPLAY_SET_RESOLUTION [env:elecrow-adv-24-28-tft] -extends = crowpanel_small +extends = crowpanel_large_esp32s3_base_esp32s3_base build_flags = - ${crowpanel_small.build_flags} + ${crowpanel_large_esp32s3_base_esp32s3_base.build_flags} -D SPI_FREQUENCY=80000000 -D LGFX_SCREEN_WIDTH=240 -D LGFX_SCREEN_HEIGHT=320 @@ -96,9 +96,9 @@ build_flags = -D LGFX_TOUCH_ROTATION=0 [env:elecrow-adv-35-tft] -extends = crowpanel_small +extends = crowpanel_large_esp32s3_base_esp32s3_base build_flags = - ${crowpanel_small.build_flags} + ${crowpanel_large_esp32s3_base_esp32s3_base.build_flags} -D LV_CACHE_DEF_SIZE=2097152 -D SPI_FREQUENCY=60000000 -D LGFX_SCREEN_WIDTH=320 From 6549b0477c3381a90c3fcf2bc71be5fabdd13414 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 11 Jun 2025 06:10:34 -0500 Subject: [PATCH 267/461] Missed a spot --- variants/elecrow_panel/platformio.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/variants/elecrow_panel/platformio.ini b/variants/elecrow_panel/platformio.ini index d15aa969a..fbd6b7ff6 100644 --- a/variants/elecrow_panel/platformio.ini +++ b/variants/elecrow_panel/platformio.ini @@ -122,7 +122,7 @@ build_flags = ; 4.3, 5.0, 7.0 inch 800x480 IPS (V1) [env:elecrow-adv1-43-50-70-tft] -extends = crowpanel_large +extends = crowpanel_large_esp32s3_base_esp32s3_base build_flags = - ${crowpanel_large.build_flags} + ${crowpanel_large_esp32s3_base_esp32s3_base.build_flags} -D VIEW_320x240 From 730cd388d66add6c636ccd8fdd0647b9d4edf76e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 11 Jun 2025 08:49:20 -0500 Subject: [PATCH 268/461] Fix pio --- variants/elecrow_panel/platformio.ini | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/variants/elecrow_panel/platformio.ini b/variants/elecrow_panel/platformio.ini index fbd6b7ff6..bb10cc35b 100644 --- a/variants/elecrow_panel/platformio.ini +++ b/variants/elecrow_panel/platformio.ini @@ -48,7 +48,7 @@ lib_deps = ${esp32s3_base.lib_deps} lovyan03/LovyanGFX@1.2.0 ; note: v1.2.7 breaks the elecrow 7" display functionality hideakitai/TCA9534@0.1.1 -[crowpanel_large_esp32s3_base_esp32s3_base] ; 2.4, 2.8, 3.5 inch +[crowpanel_small_esp32s3_base] ; 2.4, 2.8, 3.5 inch extends = crowpanel_base build_flags = ${crowpanel_base.build_flags} @@ -62,7 +62,7 @@ build_flags = -D VIEW_320x240 -D MAP_FULL_REDRAW -[crowpanel_large] ; 4.3, 5.0, 7.0 inch +[crowpanel_large_esp32s3_base] ; 4.3, 5.0, 7.0 inch extends = crowpanel_base build_flags = ${crowpanel_base.build_flags} @@ -73,9 +73,9 @@ build_flags = -D DISPLAY_SET_RESOLUTION [env:elecrow-adv-24-28-tft] -extends = crowpanel_large_esp32s3_base_esp32s3_base +extends = crowpanel_small_esp32s3_base build_flags = - ${crowpanel_large_esp32s3_base_esp32s3_base.build_flags} + ${crowpanel_small_esp32s3_base.build_flags} -D SPI_FREQUENCY=80000000 -D LGFX_SCREEN_WIDTH=240 -D LGFX_SCREEN_HEIGHT=320 @@ -96,9 +96,10 @@ build_flags = -D LGFX_TOUCH_ROTATION=0 [env:elecrow-adv-35-tft] -extends = crowpanel_large_esp32s3_base_esp32s3_base +board_level = extra +extends = crowpanel_small_esp32s3_base build_flags = - ${crowpanel_large_esp32s3_base_esp32s3_base.build_flags} + ${crowpanel_small_esp32s3_base.build_flags} -D LV_CACHE_DEF_SIZE=2097152 -D SPI_FREQUENCY=60000000 -D LGFX_SCREEN_WIDTH=320 @@ -122,7 +123,7 @@ build_flags = ; 4.3, 5.0, 7.0 inch 800x480 IPS (V1) [env:elecrow-adv1-43-50-70-tft] -extends = crowpanel_large_esp32s3_base_esp32s3_base +extends = crowpanel_large_esp32s3_base build_flags = - ${crowpanel_large_esp32s3_base_esp32s3_base.build_flags} + ${crowpanel_large_esp32s3_base.build_flags} -D VIEW_320x240 From 60ec05e53693535aaf616162d4f970cfca6a5d58 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 11 Jun 2025 10:54:08 -0500 Subject: [PATCH 269/461] elecrow-adv-35-tft --- variants/elecrow_panel/platformio.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/variants/elecrow_panel/platformio.ini b/variants/elecrow_panel/platformio.ini index bb10cc35b..5bce58208 100644 --- a/variants/elecrow_panel/platformio.ini +++ b/variants/elecrow_panel/platformio.ini @@ -96,7 +96,6 @@ build_flags = -D LGFX_TOUCH_ROTATION=0 [env:elecrow-adv-35-tft] -board_level = extra extends = crowpanel_small_esp32s3_base build_flags = ${crowpanel_small_esp32s3_base.build_flags} From 68a28a177f6399ee6eb1164b9817642f4aa3e1ae Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 11 Jun 2025 16:11:32 -0500 Subject: [PATCH 270/461] Add elecrow panels to BIGDB_16MB --- bin/device-install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/device-install.sh b/bin/device-install.sh index 2250db4fc..613696d2f 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -35,6 +35,9 @@ BIGDB_16MB=( "station-g2" "t-eth-elite" "t-watch-s3" + "elecrow-adv-35-tft" + "elecrow-adv-24-28-tft" + "elecrow-adv1-43-50-70-tft" ) S3_VARIANTS=( "s3" From f9d17cdee0c107d65ea643c4dadf1665c0406ce5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 20:18:28 -0500 Subject: [PATCH 271/461] chore(deps): update platform-native digest to 49634e9 (#7020) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/portduino/portduino.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index a19c50319..885511b2b 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/622341c6de8a239704318b10c3dbb00c21a3eab3.zip + https://github.com/meshtastic/platform-native/archive/49634e9c133a815e8962a24d8395561f38df0e0b.zip framework = arduino build_src_filter = From 5f0c8863fd0b187ef14585813fe20b13a77875c5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 20:18:47 -0500 Subject: [PATCH 272/461] [create-pull-request] automated change (#7019) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> Co-authored-by: Ben Meadors --- protobufs | 2 +- src/mesh/generated/meshtastic/admin.pb.cpp | 3 ++ src/mesh/generated/meshtastic/admin.pb.h | 36 +++++++++++++++++++ src/mesh/generated/meshtastic/mesh.pb.cpp | 6 ++++ src/mesh/generated/meshtastic/mesh.pb.h | 40 +++++++++++++++++++++- 5 files changed, 85 insertions(+), 2 deletions(-) diff --git a/protobufs b/protobufs index b448d4a94..0c112881d 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit b448d4a94fa4b15fbea8421074ac2a943795601f +Subproject commit 0c112881dfb4aa24a61ee55dd4c46abbfc093717 diff --git a/src/mesh/generated/meshtastic/admin.pb.cpp b/src/mesh/generated/meshtastic/admin.pb.cpp index a9c82f7c0..4c4d0e3d1 100644 --- a/src/mesh/generated/meshtastic/admin.pb.cpp +++ b/src/mesh/generated/meshtastic/admin.pb.cpp @@ -9,6 +9,9 @@ PB_BIND(meshtastic_AdminMessage, meshtastic_AdminMessage, 2) +PB_BIND(meshtastic_AdminMessage_InputEvent, meshtastic_AdminMessage_InputEvent, AUTO) + + PB_BIND(meshtastic_HamParameters, meshtastic_HamParameters, AUTO) diff --git a/src/mesh/generated/meshtastic/admin.pb.h b/src/mesh/generated/meshtastic/admin.pb.h index 2a5fd78b0..c111d3993 100644 --- a/src/mesh/generated/meshtastic/admin.pb.h +++ b/src/mesh/generated/meshtastic/admin.pb.h @@ -91,6 +91,18 @@ typedef enum _meshtastic_KeyVerificationAdmin_MessageType { } meshtastic_KeyVerificationAdmin_MessageType; /* Struct definitions */ +/* Input event message to be sent to the node. */ +typedef struct _meshtastic_AdminMessage_InputEvent { + /* The input event code */ + uint8_t event_code; + /* Keyboard character code */ + uint8_t kb_char; + /* The touch X coordinate */ + uint16_t touch_x; + /* The touch Y coordinate */ + uint16_t touch_y; +} meshtastic_AdminMessage_InputEvent; + /* Parameters for setting up Meshtastic for ameteur radio usage */ typedef struct _meshtastic_HamParameters { /* Amateur radio call sign, eg. KD2ABC */ @@ -191,6 +203,9 @@ typedef struct _meshtastic_AdminMessage { meshtastic_AdminMessage_BackupLocation restore_preferences; /* Remove backups of the node's preferences */ meshtastic_AdminMessage_BackupLocation remove_backup_preferences; + /* Send an input event to the node. + This is used to trigger physical input events like button presses, touch events, etc. */ + meshtastic_AdminMessage_InputEvent send_input_event; /* Set the owner for this node */ meshtastic_User set_owner; /* Set channels (using the new API). @@ -293,22 +308,29 @@ extern "C" { + #define meshtastic_KeyVerificationAdmin_message_type_ENUMTYPE meshtastic_KeyVerificationAdmin_MessageType /* Initializer values for message structs */ #define meshtastic_AdminMessage_init_default {0, {0}, {0, {0}}} +#define meshtastic_AdminMessage_InputEvent_init_default {0, 0, 0, 0} #define meshtastic_HamParameters_init_default {"", 0, 0, ""} #define meshtastic_NodeRemoteHardwarePinsResponse_init_default {0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}} #define meshtastic_SharedContact_init_default {0, false, meshtastic_User_init_default} #define meshtastic_KeyVerificationAdmin_init_default {_meshtastic_KeyVerificationAdmin_MessageType_MIN, 0, 0, false, 0} #define meshtastic_AdminMessage_init_zero {0, {0}, {0, {0}}} +#define meshtastic_AdminMessage_InputEvent_init_zero {0, 0, 0, 0} #define meshtastic_HamParameters_init_zero {"", 0, 0, ""} #define meshtastic_NodeRemoteHardwarePinsResponse_init_zero {0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}} #define meshtastic_SharedContact_init_zero {0, false, meshtastic_User_init_zero} #define meshtastic_KeyVerificationAdmin_init_zero {_meshtastic_KeyVerificationAdmin_MessageType_MIN, 0, 0, false, 0} /* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_AdminMessage_InputEvent_event_code_tag 1 +#define meshtastic_AdminMessage_InputEvent_kb_char_tag 2 +#define meshtastic_AdminMessage_InputEvent_touch_x_tag 3 +#define meshtastic_AdminMessage_InputEvent_touch_y_tag 4 #define meshtastic_HamParameters_call_sign_tag 1 #define meshtastic_HamParameters_tx_power_tag 2 #define meshtastic_HamParameters_frequency_tag 3 @@ -345,6 +367,7 @@ extern "C" { #define meshtastic_AdminMessage_backup_preferences_tag 24 #define meshtastic_AdminMessage_restore_preferences_tag 25 #define meshtastic_AdminMessage_remove_backup_preferences_tag 26 +#define meshtastic_AdminMessage_send_input_event_tag 27 #define meshtastic_AdminMessage_set_owner_tag 32 #define meshtastic_AdminMessage_set_channel_tag 33 #define meshtastic_AdminMessage_set_config_tag 34 @@ -402,6 +425,7 @@ X(a, STATIC, ONEOF, UINT32, (payload_variant,set_scale,set_scale), 23) \ X(a, STATIC, ONEOF, UENUM, (payload_variant,backup_preferences,backup_preferences), 24) \ X(a, STATIC, ONEOF, UENUM, (payload_variant,restore_preferences,restore_preferences), 25) \ X(a, STATIC, ONEOF, UENUM, (payload_variant,remove_backup_preferences,remove_backup_preferences), 26) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,send_input_event,send_input_event), 27) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_owner,set_owner), 32) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_channel,set_channel), 33) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_config,set_config), 34) \ @@ -441,6 +465,7 @@ X(a, STATIC, SINGULAR, BYTES, session_passkey, 101) #define meshtastic_AdminMessage_payload_variant_get_device_connection_status_response_MSGTYPE meshtastic_DeviceConnectionStatus #define meshtastic_AdminMessage_payload_variant_set_ham_mode_MSGTYPE meshtastic_HamParameters #define meshtastic_AdminMessage_payload_variant_get_node_remote_hardware_pins_response_MSGTYPE meshtastic_NodeRemoteHardwarePinsResponse +#define meshtastic_AdminMessage_payload_variant_send_input_event_MSGTYPE meshtastic_AdminMessage_InputEvent #define meshtastic_AdminMessage_payload_variant_set_owner_MSGTYPE meshtastic_User #define meshtastic_AdminMessage_payload_variant_set_channel_MSGTYPE meshtastic_Channel #define meshtastic_AdminMessage_payload_variant_set_config_MSGTYPE meshtastic_Config @@ -451,6 +476,14 @@ X(a, STATIC, SINGULAR, BYTES, session_passkey, 101) #define meshtastic_AdminMessage_payload_variant_add_contact_MSGTYPE meshtastic_SharedContact #define meshtastic_AdminMessage_payload_variant_key_verification_MSGTYPE meshtastic_KeyVerificationAdmin +#define meshtastic_AdminMessage_InputEvent_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, event_code, 1) \ +X(a, STATIC, SINGULAR, UINT32, kb_char, 2) \ +X(a, STATIC, SINGULAR, UINT32, touch_x, 3) \ +X(a, STATIC, SINGULAR, UINT32, touch_y, 4) +#define meshtastic_AdminMessage_InputEvent_CALLBACK NULL +#define meshtastic_AdminMessage_InputEvent_DEFAULT NULL + #define meshtastic_HamParameters_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, STRING, call_sign, 1) \ X(a, STATIC, SINGULAR, INT32, tx_power, 2) \ @@ -481,6 +514,7 @@ X(a, STATIC, OPTIONAL, UINT32, security_number, 4) #define meshtastic_KeyVerificationAdmin_DEFAULT NULL extern const pb_msgdesc_t meshtastic_AdminMessage_msg; +extern const pb_msgdesc_t meshtastic_AdminMessage_InputEvent_msg; extern const pb_msgdesc_t meshtastic_HamParameters_msg; extern const pb_msgdesc_t meshtastic_NodeRemoteHardwarePinsResponse_msg; extern const pb_msgdesc_t meshtastic_SharedContact_msg; @@ -488,6 +522,7 @@ extern const pb_msgdesc_t meshtastic_KeyVerificationAdmin_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ #define meshtastic_AdminMessage_fields &meshtastic_AdminMessage_msg +#define meshtastic_AdminMessage_InputEvent_fields &meshtastic_AdminMessage_InputEvent_msg #define meshtastic_HamParameters_fields &meshtastic_HamParameters_msg #define meshtastic_NodeRemoteHardwarePinsResponse_fields &meshtastic_NodeRemoteHardwarePinsResponse_msg #define meshtastic_SharedContact_fields &meshtastic_SharedContact_msg @@ -495,6 +530,7 @@ extern const pb_msgdesc_t meshtastic_KeyVerificationAdmin_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_ADMIN_PB_H_MAX_SIZE meshtastic_AdminMessage_size +#define meshtastic_AdminMessage_InputEvent_size 14 #define meshtastic_AdminMessage_size 511 #define meshtastic_HamParameters_size 31 #define meshtastic_KeyVerificationAdmin_size 25 diff --git a/src/mesh/generated/meshtastic/mesh.pb.cpp b/src/mesh/generated/meshtastic/mesh.pb.cpp index 11875fadd..361d01b9a 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.cpp +++ b/src/mesh/generated/meshtastic/mesh.pb.cpp @@ -60,6 +60,12 @@ PB_BIND(meshtastic_KeyVerificationNumberRequest, meshtastic_KeyVerificationNumbe PB_BIND(meshtastic_KeyVerificationFinal, meshtastic_KeyVerificationFinal, AUTO) +PB_BIND(meshtastic_DuplicatedPublicKey, meshtastic_DuplicatedPublicKey, AUTO) + + +PB_BIND(meshtastic_LowEntropyKey, meshtastic_LowEntropyKey, AUTO) + + PB_BIND(meshtastic_FileInfo, meshtastic_FileInfo, AUTO) diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 8abf82150..b07c59625 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -958,6 +958,14 @@ typedef struct _meshtastic_KeyVerificationFinal { char verification_characters[10]; } meshtastic_KeyVerificationFinal; +typedef struct _meshtastic_DuplicatedPublicKey { + char dummy_field; +} meshtastic_DuplicatedPublicKey; + +typedef struct _meshtastic_LowEntropyKey { + char dummy_field; +} meshtastic_LowEntropyKey; + /* A notification message from the device to the client To be used for important messages that should to be displayed to the user in the form of push notifications or validation messages when saving @@ -977,6 +985,8 @@ typedef struct _meshtastic_ClientNotification { meshtastic_KeyVerificationNumberInform key_verification_number_inform; meshtastic_KeyVerificationNumberRequest key_verification_number_request; meshtastic_KeyVerificationFinal key_verification_final; + meshtastic_DuplicatedPublicKey duplicated_public_key; + meshtastic_LowEntropyKey low_entropy_key; } payload_variant; } meshtastic_ClientNotification; @@ -1257,6 +1267,8 @@ extern "C" { + + #define meshtastic_Compressed_portnum_ENUMTYPE meshtastic_PortNum @@ -1289,6 +1301,8 @@ extern "C" { #define meshtastic_KeyVerificationNumberInform_init_default {0, "", 0} #define meshtastic_KeyVerificationNumberRequest_init_default {0, ""} #define meshtastic_KeyVerificationFinal_init_default {0, "", 0, ""} +#define meshtastic_DuplicatedPublicKey_init_default {0} +#define meshtastic_LowEntropyKey_init_default {0} #define meshtastic_FileInfo_init_default {"", 0} #define meshtastic_ToRadio_init_default {0, {meshtastic_MeshPacket_init_default}} #define meshtastic_Compressed_init_default {_meshtastic_PortNum_MIN, {0, {0}}} @@ -1318,6 +1332,8 @@ extern "C" { #define meshtastic_KeyVerificationNumberInform_init_zero {0, "", 0} #define meshtastic_KeyVerificationNumberRequest_init_zero {0, ""} #define meshtastic_KeyVerificationFinal_init_zero {0, "", 0, ""} +#define meshtastic_DuplicatedPublicKey_init_zero {0} +#define meshtastic_LowEntropyKey_init_zero {0} #define meshtastic_FileInfo_init_zero {"", 0} #define meshtastic_ToRadio_init_zero {0, {meshtastic_MeshPacket_init_zero}} #define meshtastic_Compressed_init_zero {_meshtastic_PortNum_MIN, {0, {0}}} @@ -1455,6 +1471,8 @@ extern "C" { #define meshtastic_ClientNotification_key_verification_number_inform_tag 11 #define meshtastic_ClientNotification_key_verification_number_request_tag 12 #define meshtastic_ClientNotification_key_verification_final_tag 13 +#define meshtastic_ClientNotification_duplicated_public_key_tag 14 +#define meshtastic_ClientNotification_low_entropy_key_tag 15 #define meshtastic_FileInfo_file_name_tag 1 #define meshtastic_FileInfo_size_bytes_tag 2 #define meshtastic_Compressed_portnum_tag 1 @@ -1723,12 +1741,16 @@ X(a, STATIC, SINGULAR, UENUM, level, 3) \ X(a, STATIC, SINGULAR, STRING, message, 4) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,key_verification_number_inform,payload_variant.key_verification_number_inform), 11) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,key_verification_number_request,payload_variant.key_verification_number_request), 12) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,key_verification_final,payload_variant.key_verification_final), 13) +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,key_verification_final,payload_variant.key_verification_final), 13) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,duplicated_public_key,payload_variant.duplicated_public_key), 14) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,low_entropy_key,payload_variant.low_entropy_key), 15) #define meshtastic_ClientNotification_CALLBACK NULL #define meshtastic_ClientNotification_DEFAULT NULL #define meshtastic_ClientNotification_payload_variant_key_verification_number_inform_MSGTYPE meshtastic_KeyVerificationNumberInform #define meshtastic_ClientNotification_payload_variant_key_verification_number_request_MSGTYPE meshtastic_KeyVerificationNumberRequest #define meshtastic_ClientNotification_payload_variant_key_verification_final_MSGTYPE meshtastic_KeyVerificationFinal +#define meshtastic_ClientNotification_payload_variant_duplicated_public_key_MSGTYPE meshtastic_DuplicatedPublicKey +#define meshtastic_ClientNotification_payload_variant_low_entropy_key_MSGTYPE meshtastic_LowEntropyKey #define meshtastic_KeyVerificationNumberInform_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT64, nonce, 1) \ @@ -1751,6 +1773,16 @@ X(a, STATIC, SINGULAR, STRING, verification_characters, 4) #define meshtastic_KeyVerificationFinal_CALLBACK NULL #define meshtastic_KeyVerificationFinal_DEFAULT NULL +#define meshtastic_DuplicatedPublicKey_FIELDLIST(X, a) \ + +#define meshtastic_DuplicatedPublicKey_CALLBACK NULL +#define meshtastic_DuplicatedPublicKey_DEFAULT NULL + +#define meshtastic_LowEntropyKey_FIELDLIST(X, a) \ + +#define meshtastic_LowEntropyKey_CALLBACK NULL +#define meshtastic_LowEntropyKey_DEFAULT NULL + #define meshtastic_FileInfo_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, STRING, file_name, 1) \ X(a, STATIC, SINGULAR, UINT32, size_bytes, 2) @@ -1862,6 +1894,8 @@ extern const pb_msgdesc_t meshtastic_ClientNotification_msg; extern const pb_msgdesc_t meshtastic_KeyVerificationNumberInform_msg; extern const pb_msgdesc_t meshtastic_KeyVerificationNumberRequest_msg; extern const pb_msgdesc_t meshtastic_KeyVerificationFinal_msg; +extern const pb_msgdesc_t meshtastic_DuplicatedPublicKey_msg; +extern const pb_msgdesc_t meshtastic_LowEntropyKey_msg; extern const pb_msgdesc_t meshtastic_FileInfo_msg; extern const pb_msgdesc_t meshtastic_ToRadio_msg; extern const pb_msgdesc_t meshtastic_Compressed_msg; @@ -1893,6 +1927,8 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; #define meshtastic_KeyVerificationNumberInform_fields &meshtastic_KeyVerificationNumberInform_msg #define meshtastic_KeyVerificationNumberRequest_fields &meshtastic_KeyVerificationNumberRequest_msg #define meshtastic_KeyVerificationFinal_fields &meshtastic_KeyVerificationFinal_msg +#define meshtastic_DuplicatedPublicKey_fields &meshtastic_DuplicatedPublicKey_msg +#define meshtastic_LowEntropyKey_fields &meshtastic_LowEntropyKey_msg #define meshtastic_FileInfo_fields &meshtastic_FileInfo_msg #define meshtastic_ToRadio_fields &meshtastic_ToRadio_msg #define meshtastic_Compressed_fields &meshtastic_Compressed_msg @@ -1914,6 +1950,7 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; #define meshtastic_Compressed_size 239 #define meshtastic_Data_size 269 #define meshtastic_DeviceMetadata_size 54 +#define meshtastic_DuplicatedPublicKey_size 0 #define meshtastic_FileInfo_size 236 #define meshtastic_FromRadio_size 510 #define meshtastic_Heartbeat_size 0 @@ -1922,6 +1959,7 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; #define meshtastic_KeyVerificationNumberRequest_size 52 #define meshtastic_KeyVerification_size 79 #define meshtastic_LogRecord_size 426 +#define meshtastic_LowEntropyKey_size 0 #define meshtastic_MeshPacket_size 378 #define meshtastic_MqttClientProxyMessage_size 501 #define meshtastic_MyNodeInfo_size 77 From f29944721680c08c228d037fc10f37df9ecd7f47 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 05:55:51 -0500 Subject: [PATCH 273/461] chore(deps): update platform-native digest to 681ee02 (#7022) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/portduino/portduino.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 885511b2b..429e010f5 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/49634e9c133a815e8962a24d8395561f38df0e0b.zip + https://github.com/meshtastic/platform-native/archive/681ee029207e9fd040afa223df6e54074cbbe084.zip framework = arduino build_src_filter = From 3b94981e5606ce75d423f80c42b0955856675569 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 12 Jun 2025 12:13:39 -0500 Subject: [PATCH 274/461] Key erase (#7018) * Wipe keys if low entropy * Client Notification Payload variant * Don't call service before it's created * Lucky Number 14 * Catch for low-entropy keys even before region is set --- src/main.cpp | 5 +++++ src/mesh/NodeDB.cpp | 54 ++++++++++++++++++++++++++------------------- src/mesh/NodeDB.h | 5 ++++- src/mesh/Router.cpp | 1 + 4 files changed, 41 insertions(+), 24 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7ecd634c9..a35a5007f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -928,6 +928,11 @@ void setup() service = new MeshService(); service->init(); + if (nodeDB->keyIsLowEntropy) { + service->reloadConfig(SEGMENT_CONFIG); + rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); + } + // Now that the mesh service is created, create any modules setupModules(); diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 477629342..43b36cd90 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -278,7 +278,6 @@ NodeDB::NodeDB() config.security.private_key.size = 32; owner.public_key.size = 32; memcpy(owner.public_key.bytes, config.security.public_key.bytes, 32); - keyIsLowEntropy = checkLowEntropyPublicKey(owner.public_key); } } #elif !(MESHTASTIC_EXCLUDE_PKI) @@ -287,11 +286,17 @@ NodeDB::NodeDB() owner.public_key.size = config.security.public_key.size; memcpy(owner.public_key.bytes, config.security.public_key.bytes, config.security.public_key.size); crypto->setDHPrivateKey(config.security.private_key.bytes); - keyIsLowEntropy = checkLowEntropyPublicKey(owner.public_key); } #endif + keyIsLowEntropy = checkLowEntropyPublicKey(config.security.public_key); if (keyIsLowEntropy) { - LOG_WARN(LOW_ENTROPY_WARNING); + LOG_WARN("Erasing low entropy keys"); + config.security.private_key.size = 0; + memfll(config.security.private_key.bytes, '\0', sizeof(config.security.private_key.bytes)); + config.security.public_key.size = 0; + memfll(config.security.public_key.bytes, '\0', sizeof(config.security.public_key.bytes)); + owner.public_key.size = 0; + memfll(owner.public_key.bytes, '\0', sizeof(owner.public_key.bytes)); } // Include our owner in the node db under our nodenum meshtastic_NodeInfoLite *info = getOrCreateMeshNode(getNodeNum()); @@ -1572,6 +1577,7 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde "to regenerate your public keys."; LOG_WARN(warning, p.long_name); meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->which_payload_variant = meshtastic_ClientNotification_duplicated_public_key_tag; cn->level = meshtastic_LogRecord_Level_WARNING; cn->time = getValidTime(RTCQualityFromNet); sprintf(cn->message, warning, p.long_name); @@ -1751,28 +1757,30 @@ UserLicenseStatus NodeDB::getLicenseStatus(uint32_t nodeNum) return info->user.is_licensed ? UserLicenseStatus::Licensed : UserLicenseStatus::NotLicensed; } -bool NodeDB::checkLowEntropyPublicKey(const meshtastic_User_public_key_t keyToTest) +bool NodeDB::checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_public_key_t keyToTest) { - uint8_t keyHash[32] = {0}; - memcpy(keyHash, keyToTest.bytes, keyToTest.size); - crypto->hash(keyHash, 32); - if (memcmp(keyHash, LOW_ENTROPY_HASH1, sizeof(LOW_ENTROPY_HASH1)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH2, sizeof(LOW_ENTROPY_HASH2)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH3, sizeof(LOW_ENTROPY_HASH3)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH4, sizeof(LOW_ENTROPY_HASH4)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH5, sizeof(LOW_ENTROPY_HASH5)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH6, sizeof(LOW_ENTROPY_HASH6)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH7, sizeof(LOW_ENTROPY_HASH7)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH8, sizeof(LOW_ENTROPY_HASH8)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH9, sizeof(LOW_ENTROPY_HASH9)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH10, sizeof(LOW_ENTROPY_HASH10)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH11, sizeof(LOW_ENTROPY_HASH11)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH12, sizeof(LOW_ENTROPY_HASH12)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH13, sizeof(LOW_ENTROPY_HASH13)) == 0) { - return true; - } else { - return false; + if (keyToTest.size == 32) { + uint8_t keyHash[32] = {0}; + memcpy(keyHash, keyToTest.bytes, keyToTest.size); + crypto->hash(keyHash, 32); + if (memcmp(keyHash, LOW_ENTROPY_HASH1, sizeof(LOW_ENTROPY_HASH1)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH2, sizeof(LOW_ENTROPY_HASH2)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH3, sizeof(LOW_ENTROPY_HASH3)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH4, sizeof(LOW_ENTROPY_HASH4)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH5, sizeof(LOW_ENTROPY_HASH5)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH6, sizeof(LOW_ENTROPY_HASH6)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH7, sizeof(LOW_ENTROPY_HASH7)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH8, sizeof(LOW_ENTROPY_HASH8)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH9, sizeof(LOW_ENTROPY_HASH9)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH10, sizeof(LOW_ENTROPY_HASH10)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH11, sizeof(LOW_ENTROPY_HASH11)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH12, sizeof(LOW_ENTROPY_HASH12)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH13, sizeof(LOW_ENTROPY_HASH13)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH14, sizeof(LOW_ENTROPY_HASH14)) == 0) { + return true; + } } + return false; } bool NodeDB::backupPreferences(meshtastic_AdminMessage_BackupLocation location) diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index f03cdd6b6..534e8d4d3 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -58,6 +58,9 @@ static const uint8_t LOW_ENTROPY_HASH12[] = {0x48, 0x6f, 0x1e, 0x48, 0x97, 0x88, static const uint8_t LOW_ENTROPY_HASH13[] = {0x09, 0xb4, 0xe2, 0x6d, 0x28, 0x98, 0xc9, 0x47, 0x66, 0x46, 0xbf, 0xff, 0x58, 0x17, 0x91, 0xaa, 0xc3, 0xbf, 0x4a, 0x9d, 0x0b, 0x88, 0xb1, 0xf1, 0x03, 0xdd, 0x61, 0xd7, 0xba, 0x9e, 0x64, 0x98}; +static const uint8_t LOW_ENTROPY_HASH14[] = {0x39, 0x39, 0x84, 0xe0, 0x22, 0x2f, 0x7d, 0x78, 0x45, 0x18, 0x72, + 0xb4, 0x13, 0xd2, 0x01, 0x2f, 0x3c, 0xa1, 0xb0, 0xfe, 0x39, 0xd0, + 0xf1, 0x3c, 0x72, 0xd6, 0xef, 0x54, 0xd5, 0x77, 0x22, 0xa0}; static const char LOW_ENTROPY_WARNING[] = "Your Device is configured with a low entropy key. Suggest regenerating DM keys"; #endif /* @@ -251,7 +254,7 @@ class NodeDB bool hasValidPosition(const meshtastic_NodeInfoLite *n); - bool checkLowEntropyPublicKey(const meshtastic_User_public_key_t keyToTest); + bool checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_public_key_t keyToTest); bool backupPreferences(meshtastic_AdminMessage_BackupLocation location); bool restorePreferences(meshtastic_AdminMessage_BackupLocation location, diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index b7206c020..02968513c 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -554,6 +554,7 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p) LOG_WARN(LOW_ENTROPY_WARNING); if (!nodeDB->hasWarned) { meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->which_payload_variant = meshtastic_ClientNotification_low_entropy_key_tag; cn->level = meshtastic_LogRecord_Level_WARNING; cn->time = getValidTime(RTCQualityFromNet); sprintf(cn->message, LOW_ENTROPY_WARNING); From a1a5503fe9f34e0bd1b75cfafadd29466c26ff84 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 12 Jun 2025 15:18:26 -0500 Subject: [PATCH 275/461] Another known key --- src/mesh/NodeDB.cpp | 3 ++- src/mesh/NodeDB.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 43b36cd90..9ee430242 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1776,7 +1776,8 @@ bool NodeDB::checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_pub memcmp(keyHash, LOW_ENTROPY_HASH11, sizeof(LOW_ENTROPY_HASH11)) == 0 || memcmp(keyHash, LOW_ENTROPY_HASH12, sizeof(LOW_ENTROPY_HASH12)) == 0 || memcmp(keyHash, LOW_ENTROPY_HASH13, sizeof(LOW_ENTROPY_HASH13)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH14, sizeof(LOW_ENTROPY_HASH14)) == 0) { + memcmp(keyHash, LOW_ENTROPY_HASH14, sizeof(LOW_ENTROPY_HASH14)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH15, sizeof(LOW_ENTROPY_HASH15)) == 0) { return true; } } diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 534e8d4d3..7e294f5b8 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -61,6 +61,9 @@ static const uint8_t LOW_ENTROPY_HASH13[] = {0x09, 0xb4, 0xe2, 0x6d, 0x28, 0x98, static const uint8_t LOW_ENTROPY_HASH14[] = {0x39, 0x39, 0x84, 0xe0, 0x22, 0x2f, 0x7d, 0x78, 0x45, 0x18, 0x72, 0xb4, 0x13, 0xd2, 0x01, 0x2f, 0x3c, 0xa1, 0xb0, 0xfe, 0x39, 0xd0, 0xf1, 0x3c, 0x72, 0xd6, 0xef, 0x54, 0xd5, 0x77, 0x22, 0xa0}; +static const uint8_t LOW_ENTROPY_HASH15[] = {0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, + 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, + 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}; static const char LOW_ENTROPY_WARNING[] = "Your Device is configured with a low entropy key. Suggest regenerating DM keys"; #endif /* From 4e6418b63540683bc5d22555fac3329a0c972be4 Mon Sep 17 00:00:00 2001 From: Chloe Bethel Date: Fri, 13 Jun 2025 01:55:35 +0100 Subject: [PATCH 276/461] Don't use assert() with side effects in a couple more places (#7009) * Don't use assert for Lock * Don't use assert for MQTT messages * Split assert in getMacAddr to always run the function --------- Co-authored-by: Ben Meadors --- src/concurrency/Lock.cpp | 12 +++++++++--- src/mqtt/MQTT.cpp | 5 ++++- src/platform/esp32/main-esp32.cpp | 6 ++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/concurrency/Lock.cpp b/src/concurrency/Lock.cpp index 11501359b..0fe80e455 100644 --- a/src/concurrency/Lock.cpp +++ b/src/concurrency/Lock.cpp @@ -9,17 +9,23 @@ namespace concurrency Lock::Lock() : handle(xSemaphoreCreateBinary()) { assert(handle); - assert(xSemaphoreGive(handle)); + if (xSemaphoreGive(handle) == false) { + abort(); + } } void Lock::lock() { - assert(xSemaphoreTake(handle, portMAX_DELAY)); + if (xSemaphoreTake(handle, portMAX_DELAY) == false) { + abort(); + } } void Lock::unlock() { - assert(xSemaphoreGive(handle)); + if (xSemaphoreGive(handle) == false) { + abort(); + } } #else Lock::Lock() {} diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index dca8a3b44..894579a2f 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -763,7 +763,10 @@ void MQTT::onSend(const meshtastic_MeshPacket &mp_encrypted, const meshtastic_Me } entry->topic = std::move(topic); entry->envBytes.assign(bytes, numBytes); - assert(mqttQueue.enqueue(entry, 0)); + if (mqttQueue.enqueue(entry, 0) == false) { + LOG_CRIT("Failed to add a message to mqttQueue!"); + abort(); + } } } diff --git a/src/platform/esp32/main-esp32.cpp b/src/platform/esp32/main-esp32.cpp index 3c4faac3e..cdea53c9a 100644 --- a/src/platform/esp32/main-esp32.cpp +++ b/src/platform/esp32/main-esp32.cpp @@ -56,9 +56,11 @@ void updateBatteryLevel(uint8_t level) {} void getMacAddr(uint8_t *dmac) { #if defined(CONFIG_IDF_TARGET_ESP32C6) && defined(CONFIG_SOC_IEEE802154_SUPPORTED) - assert(esp_base_mac_addr_get(dmac) == ESP_OK); + auto res = esp_base_mac_addr_get(dmac); + assert(res == ESP_OK); #else - assert(esp_efuse_mac_get_default(dmac) == ESP_OK); + auto res = esp_efuse_mac_get_default(dmac); + assert(res == ESP_OK); #endif } From 8557bd031d17515cd060ccece25f4a35989a520e Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Fri, 13 Jun 2025 10:56:40 +1000 Subject: [PATCH 277/461] Remove GPS Baudrate locking for Seeed Xiao NRF52840 Kit (#7016) The Seeed Xiao NRF52840 Kit's default GPS is an L76K which operates at 9600 baud, so when this variant was defined that baud rate was specified. However, this is a development board and it is expected that users can attach their own devices. This includes GPS, which may operate at a different baud rate. The current fixed baud rate prevents this, so this patch removes that setting. This will revert to the regular automatic probe method. This will sucessfully detect the L76K as before (probably the same as before since 9600 baud is the first baud rate checked), but also allow other GPSes at other baud rates to be detected. Fixes https://github.com/meshtastic/firmware/issues/7012 Co-authored-by: Ben Meadors --- variants/seeed_xiao_nrf52840_kit/variant.h | 1 - 1 file changed, 1 deletion(-) diff --git a/variants/seeed_xiao_nrf52840_kit/variant.h b/variants/seeed_xiao_nrf52840_kit/variant.h index e6ef74e2e..5d45d6ea1 100644 --- a/variants/seeed_xiao_nrf52840_kit/variant.h +++ b/variants/seeed_xiao_nrf52840_kit/variant.h @@ -142,7 +142,6 @@ static const uint8_t SCL = PIN_WIRE_SCL; #define PIN_GPS_RX D6 #define PIN_GPS_TX D7 #define HAS_GPS 1 -#define GPS_BAUDRATE 9600 #define GPS_THREAD_INTERVAL 50 #define PIN_SERIAL1_RX PIN_GPS_TX #define PIN_SERIAL1_TX PIN_GPS_RX From fede1b8597fe9acd5d1908eda953686cb1d876af Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 19:56:53 -0500 Subject: [PATCH 278/461] Upgrade trunk (#7006) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 5217ae181..5f931270c 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,10 +8,10 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.437 - - renovate@40.42.2 + - checkov@3.2.440 + - renovate@40.49.10 - prettier@3.5.3 - - trufflehog@3.88.35 + - trufflehog@3.89.1 - yamllint@1.37.1 - bandit@1.8.3 - trivy@0.63.0 @@ -28,7 +28,7 @@ lint: - shellcheck@0.10.0 - black@25.1.0 - git-diff-check - - gitleaks@8.27.0 + - gitleaks@8.27.2 - clang-format@16.0.3 ignore: - linters: [ALL] From 8faa04afdb15d0f6f8ce330c135badd2263207c1 Mon Sep 17 00:00:00 2001 From: Christian Crank Date: Thu, 12 Jun 2025 20:58:15 -0400 Subject: [PATCH 279/461] Validate short and long names so whitespace or empty names cannot be used (#6993) * Say issue #6867 about adding validation for long_name and short_name. Firmware should expect at least 1 non-whitespace character for both long_name and short_name. added the USERPREFS_CONFIG_DEVICE_ROLE example to userPrefs.jsonc * Validation for user long_name and short_name implemented. No longer can use whitespace characters. Return BAD_REQUEST error responses when validation fails and warning logs when validation rejects invalid names. * Improve whitespace validation for user names with ctype.h, ensure logging works * Add whitespace validation to ham mode to prevent validation bypass and to match python cli command * punctuation change --------- Co-authored-by: Ben Meadors --- src/modules/AdminModule.cpp | 44 +++++++++++++++++++++++++++++++++++++ userPrefs.jsonc | 1 + 2 files changed, 45 insertions(+) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 4005222dc..ea4c46949 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -7,6 +7,7 @@ #include "SPILock.h" #include "meshUtils.h" #include +#include // for better whitespace handling #if defined(ARCH_ESP32) && !MESHTASTIC_EXCLUDE_BLUETOOTH #include "BleOta.h" #endif @@ -155,6 +156,28 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta */ case meshtastic_AdminMessage_set_owner_tag: LOG_DEBUG("Client set owner"); + // Validate names + if (*r->set_owner.long_name) { + const char *start = r->set_owner.long_name; + // Skip all whitespace (space, tab, newline, etc) + while (*start && isspace((unsigned char)*start)) + start++; + if (*start == '\0') { + LOG_WARN("Rejected long_name: must contain at least 1 non-whitespace character"); + myReply = allocErrorResponse(meshtastic_Routing_Error_BAD_REQUEST, &mp); + break; + } + } + if (*r->set_owner.short_name) { + const char *start = r->set_owner.short_name; + while (*start && isspace((unsigned char)*start)) + start++; + if (*start == '\0') { + LOG_WARN("Rejected short_name: must contain at least 1 non-whitespace character"); + myReply = allocErrorResponse(meshtastic_Routing_Error_BAD_REQUEST, &mp); + break; + } + } handleSetOwner(r->set_owner); break; @@ -1153,6 +1176,27 @@ void AdminModule::handleStoreDeviceUIConfig(const meshtastic_DeviceUIConfig &uic void AdminModule::handleSetHamMode(const meshtastic_HamParameters &p) { + // Validate ham parameters before setting since this would bypass validation in the owner struct + if (*p.call_sign) { + const char *start = p.call_sign; + // Skip all whitespace + while (*start && isspace((unsigned char)*start)) + start++; + if (*start == '\0') { + LOG_WARN("Rejected ham call_sign: must contain at least 1 non-whitespace character"); + return; + } + } + if (*p.short_name) { + const char *start = p.short_name; + while (*start && isspace((unsigned char)*start)) + start++; + if (*start == '\0') { + LOG_WARN("Rejected ham short_name: must contain at least 1 non-whitespace character"); + return; + } + } + // Set call sign and override lora limitations for licensed use strncpy(owner.long_name, p.call_sign, sizeof(owner.long_name)); strncpy(owner.short_name, p.short_name, sizeof(owner.short_name)); diff --git a/userPrefs.jsonc b/userPrefs.jsonc index a349a5700..497327478 100644 --- a/userPrefs.jsonc +++ b/userPrefs.jsonc @@ -21,6 +21,7 @@ // "USERPREFS_CONFIG_LORA_REGION": "meshtastic_Config_LoRaConfig_RegionCode_US", // "USERPREFS_CONFIG_OWNER_LONG_NAME": "My Long Name", // "USERPREFS_CONFIG_OWNER_SHORT_NAME": "MLN", + // "USERPREFS_CONFIG_DEVICE_ROLE": "meshtastic_Config_DeviceConfig_Role_CLIENT", // Defaults to CLIENT. ROUTER*, LOST AND FOUND, and REPEATER roles are restricted. // "USERPREFS_EVENT_MODE": "1", // "USERPREFS_FIXED_BLUETOOTH": "121212", // "USERPREFS_FIXED_GPS": "", From de098cca4c0a1ebc3df78c526e925868352eb030 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Fri, 13 Jun 2025 12:58:38 +1200 Subject: [PATCH 280/461] E-Ink driver for WEAct 2.13" BW (#7001) --- .../niche/Drivers/EInk/HINK_E0213A289.cpp | 61 +++++++++++++++++++ .../niche/Drivers/EInk/HINK_E0213A289.h | 44 +++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 src/graphics/niche/Drivers/EInk/HINK_E0213A289.cpp create mode 100644 src/graphics/niche/Drivers/EInk/HINK_E0213A289.h diff --git a/src/graphics/niche/Drivers/EInk/HINK_E0213A289.cpp b/src/graphics/niche/Drivers/EInk/HINK_E0213A289.cpp new file mode 100644 index 000000000..0509b0502 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/HINK_E0213A289.cpp @@ -0,0 +1,61 @@ +#include "./HINK_E0213A289.h" + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +using namespace NicheGraphics::Drivers; + +// Map the display controller IC's output to the connected panel +void HINK_E0213A289::configScanning() +{ + // "Driver output control" + // Scan gates from 0 to 249 (vertical resolution 250px) + sendCommand(0x01); + sendData(0xF9); // Maximum gate # (249, bits 0-7) + sendData(0x00); // Maximum gate # (bit 8) + sendData(0x00); // (Do not invert scanning order) +} + +// Specify which information is used to control the sequence of voltages applied to move the pixels +// - For this display, configUpdateSequence() specifies that a suitable LUT will be loaded from +// the controller IC's OTP memory, when the update procedure begins. +void HINK_E0213A289::configWaveform() +{ + sendCommand(0x3C); // Border waveform: + sendData(0x05); // Screen border should follow LUT1 waveform (actively drive pixels white) + + sendCommand(0x18); // Temperature sensor: + sendData(0x80); // Use internal temperature sensor to select an appropriate refresh waveform +} + +// Describes the sequence of events performed by the displays controller IC during a refresh +// Includes "power up", "load settings from memory", "update the pixels", etc +void HINK_E0213A289::configUpdateSequence() +{ + switch (updateType) { + case FAST: + sendCommand(0x22); // Set "update sequence" + sendData(0xFF); // Will load LUT from OTP memory, Display mode 2 "differential refresh" + break; + + case FULL: + default: + sendCommand(0x22); // Set "update sequence" + sendData(0xF7); // Will load LUT from OTP memory + break; + } +} + +// Once the refresh operation has been started, +// begin periodically polling the display to check for completion, using the normal Meshtastic threading code +// Only used when refresh is "async" +void HINK_E0213A289::detachFromUpdate() +{ + switch (updateType) { + case FAST: + return beginPolling(50, 500); // At least 500ms for fast refresh + case FULL: + default: + return beginPolling(100, 1000); // At least 1 second for full refresh (quick; display only blinks pixels once) + } +} +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/HINK_E0213A289.h b/src/graphics/niche/Drivers/EInk/HINK_E0213A289.h new file mode 100644 index 000000000..eab0bf59d --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/HINK_E0213A289.h @@ -0,0 +1,44 @@ +/* + +E-Ink display driver + - HINK_E0213A289 + - Manufacturer: Holitech + - Size: 2.13 inch + - Resolution: 122px x 250px + - Flex connector label (not a unique identifier): FPC-7528B + + Note: as of Feb. 2025, these panels are used for "WeActStudio 2.13in B&W" display modules + +*/ + +#pragma once + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +#include "configuration.h" + +#include "./SSD16XX.h" + +namespace NicheGraphics::Drivers +{ +class HINK_E0213A289 : public SSD16XX +{ + // Display properties + private: + static constexpr uint32_t width = 122; + static constexpr uint32_t height = 250; + static constexpr UpdateTypes supported = (UpdateTypes)(FULL | FAST); + + public: + HINK_E0213A289() : SSD16XX(width, height, supported, 1) {} + + protected: + void configScanning() override; + void configWaveform() override; + void configUpdateSequence() override; + void detachFromUpdate() override; +}; + +} // namespace NicheGraphics::Drivers + +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file From ba93097bb7c378278cc096c06cc56540bd15cd0c Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Fri, 13 Jun 2025 12:59:28 +1200 Subject: [PATCH 281/461] Add InkHUD driver for WeAct Studio 1.54" display module (#7000) * Strip redundant code from E-Ink driver * Begin polling for E-Ink update completion sooner In some cases, we might be waiting longer than we need to. * E-Ink driver for WeAct 1.54" display Currently identical to the popular GDEY0154D67 model. Kept separate now in case the drivers need to diverge in future. * Put back code which sets the number of gate lines --- .../niche/Drivers/EInk/GDEY0154D67.cpp | 9 ++---- src/graphics/niche/Drivers/EInk/GDEY0154D67.h | 6 ++-- .../niche/Drivers/EInk/GDEY0213B74.cpp | 3 -- .../Drivers/EInk/ZJY200200_0154DAAMFGN.h | 32 +++++++++++++++++++ 4 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 src/graphics/niche/Drivers/EInk/ZJY200200_0154DAAMFGN.h diff --git a/src/graphics/niche/Drivers/EInk/GDEY0154D67.cpp b/src/graphics/niche/Drivers/EInk/GDEY0154D67.cpp index 2cab179b9..9a06fa841 100644 --- a/src/graphics/niche/Drivers/EInk/GDEY0154D67.cpp +++ b/src/graphics/niche/Drivers/EInk/GDEY0154D67.cpp @@ -9,12 +9,9 @@ void GDEY0154D67::configScanning() { // "Driver output control" sendCommand(0x01); - sendData(0xC7); + sendData(0xC7); // Scan until gate 199 (200px vertical res.) sendData(0x00); sendData(0x00); - - // To-do: delete this method? - // Values set here might be redundant: C7, 00, 00 seems to be default } // Specify which information is used to control the sequence of voltages applied to move the pixels @@ -52,10 +49,10 @@ void GDEY0154D67::detachFromUpdate() { switch (updateType) { case FAST: - return beginPolling(50, 500); // At least 500ms for fast refresh + return beginPolling(50, 300); // At least 300ms for fast refresh case FULL: default: - return beginPolling(100, 2000); // At least 2 seconds for full refresh + return beginPolling(100, 1500); // At least 1.5 seconds for full refresh } } #endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/GDEY0154D67.h b/src/graphics/niche/Drivers/EInk/GDEY0154D67.h index 93c641e44..e391eea50 100644 --- a/src/graphics/niche/Drivers/EInk/GDEY0154D67.h +++ b/src/graphics/niche/Drivers/EInk/GDEY0154D67.h @@ -31,9 +31,9 @@ class GDEY0154D67 : public SSD16XX GDEY0154D67() : SSD16XX(width, height, supported) {} protected: - virtual void configScanning() override; - virtual void configWaveform() override; - virtual void configUpdateSequence() override; + void configScanning() override; + void configWaveform() override; + void configUpdateSequence() override; void detachFromUpdate() override; }; diff --git a/src/graphics/niche/Drivers/EInk/GDEY0213B74.cpp b/src/graphics/niche/Drivers/EInk/GDEY0213B74.cpp index a0ff63258..b3a585eb7 100644 --- a/src/graphics/niche/Drivers/EInk/GDEY0213B74.cpp +++ b/src/graphics/niche/Drivers/EInk/GDEY0213B74.cpp @@ -12,9 +12,6 @@ void GDEY0213B74::configScanning() sendData(0xF9); sendData(0x00); sendData(0x00); - - // To-do: delete this method? - // Values set here might be redundant: F9, 00, 00 seems to be default } // Specify which information is used to control the sequence of voltages applied to move the pixels diff --git a/src/graphics/niche/Drivers/EInk/ZJY200200_0154DAAMFGN.h b/src/graphics/niche/Drivers/EInk/ZJY200200_0154DAAMFGN.h new file mode 100644 index 000000000..fb16bcf2f --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/ZJY200200_0154DAAMFGN.h @@ -0,0 +1,32 @@ +/* + +E-Ink display driver + - ZJY200200-0154DAAMFGN + - Manufacturer: Zhongjingyuan + - Size: 1.54 inch + - Resolution: 200px x 200px + - Flex connector marking: FPC-B001 + + Note: as of Feb. 2025, these panels are used for "WeActStudio 1.54in B&W" display modules + + This *is* a distinct panel, however the driver is currently identical to GDEY0154D67 + We recognize it as separate now, to avoid breaking any custom builds if the drivers do need to diverge in future. + +*/ + +#pragma once + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +#include "configuration.h" + +#include "./GDEY0154D67.h" + +namespace NicheGraphics::Drivers +{ + +typedef GDEY0154D67 ZJY200200_0154DAAMFGN; + +} // namespace NicheGraphics::Drivers + +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file From 8ff99437cb27fc2cc5a0c3f05a1f6e968fdf40dc Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 12 Jun 2025 22:56:40 -0500 Subject: [PATCH 282/461] Don't include the blank hash --- src/mesh/NodeDB.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 7e294f5b8..df1e8a7f6 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -61,9 +61,9 @@ static const uint8_t LOW_ENTROPY_HASH13[] = {0x09, 0xb4, 0xe2, 0x6d, 0x28, 0x98, static const uint8_t LOW_ENTROPY_HASH14[] = {0x39, 0x39, 0x84, 0xe0, 0x22, 0x2f, 0x7d, 0x78, 0x45, 0x18, 0x72, 0xb4, 0x13, 0xd2, 0x01, 0x2f, 0x3c, 0xa1, 0xb0, 0xfe, 0x39, 0xd0, 0xf1, 0x3c, 0x72, 0xd6, 0xef, 0x54, 0xd5, 0x77, 0x22, 0xa0}; -static const uint8_t LOW_ENTROPY_HASH15[] = {0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, - 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, - 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}; +static const uint8_t LOW_ENTROPY_HASH15[] = {0x0a, 0xda, 0x5f, 0xec, 0xff, 0x5c, 0xc0, 0x2e, 0x5f, 0xc4, 0x8d, + 0x03, 0xe5, 0x80, 0x59, 0xd3, 0x5d, 0x49, 0x86, 0xe9, 0x8d, 0xf6, + 0xf6, 0x16, 0x35, 0x3d, 0xf9, 0x9b, 0x29, 0x55, 0x9e, 0x64}; static const char LOW_ENTROPY_WARNING[] = "Your Device is configured with a low entropy key. Suggest regenerating DM keys"; #endif /* From 5d0bf03b017905a7ac24a8c78beb699fb53bca6b Mon Sep 17 00:00:00 2001 From: Csrutil Date: Fri, 13 Jun 2025 15:27:48 +0800 Subject: [PATCH 283/461] add support for GAT562 Mesh Trial Tracker (#6984) * add support for GAT562 Mesh Trial Tracker * Hardware Model Definition for GAT562_MESH_TRIAL_TRACKER * Added RAK4630 for led pin 2 (blue) * Added RAK4630 for led pin 2 (blue) comment * don't touch src/mesh/NodeDB.cpp * set fixed baudrate for gat562_mesh_trial_tracker * adjust the order of the HW_VENDOR defines --------- Co-authored-by: Ben Meadors Co-authored-by: Tom Fifield --- boards/gat562_mesh_trial_tracker.json | 52 ++++ src/platform/nrf52/architecture.h | 4 +- .../gat562_mesh_trial_tracker/platformio.ini | 13 + .../gat562_mesh_trial_tracker/variant.cpp | 45 +++ variants/gat562_mesh_trial_tracker/variant.h | 288 ++++++++++++++++++ 5 files changed, 401 insertions(+), 1 deletion(-) create mode 100644 boards/gat562_mesh_trial_tracker.json create mode 100644 variants/gat562_mesh_trial_tracker/platformio.ini create mode 100644 variants/gat562_mesh_trial_tracker/variant.cpp create mode 100644 variants/gat562_mesh_trial_tracker/variant.h diff --git a/boards/gat562_mesh_trial_tracker.json b/boards/gat562_mesh_trial_tracker.json new file mode 100644 index 000000000..a3fb8a264 --- /dev/null +++ b/boards/gat562_mesh_trial_tracker.json @@ -0,0 +1,52 @@ +{ + "build": { + "arduino": { + "ldscript": "nrf52840_s140_v6.ld" + }, + "core": "nRF5", + "cpu": "cortex-m4", + "extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA", + "f_cpu": "64000000L", + "hwids": [ + ["0x239A", "0x8029"], + ["0x239A", "0x0029"], + ["0x239A", "0x002A"], + ["0x239A", "0x802A"] + ], + "usb_product": "GAT562 Mesh Trial Tracker", + "mcu": "nrf52840", + "variant": "gat562_mesh_trial_tracker", + "bsp": { + "name": "adafruit" + }, + "softdevice": { + "sd_flags": "-DS140", + "sd_name": "s140", + "sd_version": "6.1.1", + "sd_fwid": "0x00B6" + }, + "bootloader": { + "settings_addr": "0xFF000" + } + }, + "connectivity": ["bluetooth"], + "debug": { + "jlink_device": "nRF52840_xxAA", + "svd_path": "nrf52840.svd", + "openocd_target": "nrf52840-mdk-rs" + }, + "frameworks": ["arduino", "freertos"], + "name": "GAT562 Mesh Trial Tracker", + "upload": { + "maximum_ram_size": 248832, + "maximum_size": 815104, + "speed": 115200, + "protocol": "nrfutil", + "protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"], + "use_1200bps_touch": true, + "require_upload_port": true, + "wait_for_upload_port": true + }, + "url": "http://www.gat-iot.com/", + "vendor": "GAT-IOT" +} diff --git a/src/platform/nrf52/architecture.h b/src/platform/nrf52/architecture.h index 8ea2c3829..a69816d0b 100644 --- a/src/platform/nrf52/architecture.h +++ b/src/platform/nrf52/architecture.h @@ -49,6 +49,8 @@ #define HW_VENDOR meshtastic_HardwareModel_RAK2560 #elif defined(WISMESH_TAP) #define HW_VENDOR meshtastic_HardwareModel_WISMESH_TAP +#elif defined(GAT562_MESH_TRIAL_TRACKER) +#define HW_VENDOR meshtastic_HardwareModel_GAT562_MESH_TRIAL_TRACKER #elif defined(RAK4630) #define HW_VENDOR meshtastic_HardwareModel_RAK4631 #elif defined(TTGO_T_ECHO) @@ -141,4 +143,4 @@ #if !defined(PIN_SERIAL_RX) && !defined(NRF52840_XXAA) // No serial ports on this board - ONLY use segger in memory console #define USE_SEGGER -#endif \ No newline at end of file +#endif diff --git a/variants/gat562_mesh_trial_tracker/platformio.ini b/variants/gat562_mesh_trial_tracker/platformio.ini new file mode 100644 index 000000000..e67f3ec8d --- /dev/null +++ b/variants/gat562_mesh_trial_tracker/platformio.ini @@ -0,0 +1,13 @@ +; The very slick RAK wireless RAK 4631 / 4630 board - Unified firmware for 5005/19003, with or without OLED RAK 1921 +[env:gat562_mesh_trial_tracker] +extends = nrf52840_base +board = gat562_mesh_trial_tracker +board_check = true +build_flags = ${nrf52840_base.build_flags} -Ivariants/gat562_mesh_trial_tracker -D GAT562_MESH_TRIAL_TRACKER + -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. + -DRADIOLIB_EXCLUDE_SX128X=1 + -DRADIOLIB_EXCLUDE_SX127X=1 + -DRADIOLIB_EXCLUDE_LR11X0=1 +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/gat562_mesh_trial_tracker> +lib_deps = + ${nrf52840_base.lib_deps} diff --git a/variants/gat562_mesh_trial_tracker/variant.cpp b/variants/gat562_mesh_trial_tracker/variant.cpp new file mode 100644 index 000000000..e84b60b3b --- /dev/null +++ b/variants/gat562_mesh_trial_tracker/variant.cpp @@ -0,0 +1,45 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "variant.h" +#include "nrf.h" +#include "wiring_constants.h" +#include "wiring_digital.h" + +const uint32_t g_ADigitalPinMap[] = { + // P0 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + + // P1 + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}; + +void initVariant() +{ + // LED1 & LED2 + pinMode(PIN_LED1, OUTPUT); + ledOff(PIN_LED1); + + pinMode(PIN_LED2, OUTPUT); + ledOff(PIN_LED2); + + // 3V3 Power Rail + pinMode(PIN_3V3_EN, OUTPUT); + digitalWrite(PIN_3V3_EN, HIGH); +} diff --git a/variants/gat562_mesh_trial_tracker/variant.h b/variants/gat562_mesh_trial_tracker/variant.h new file mode 100644 index 000000000..2af0bc76d --- /dev/null +++ b/variants/gat562_mesh_trial_tracker/variant.h @@ -0,0 +1,288 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_GAT562_MESH_TRIAL_TRACKER_ +#define _VARIANT_GAT562_MESH_TRIAL_TRACKER_ + +#define GAT562_MESH_TRIAL_TRACKER + +// led pin 2 (blue), see https://github.com/meshtastic/firmware/blob/master/src/mesh/NodeDB.cpp#L723 +#define RAK4630 + +/** Master clock frequency */ +#define VARIANT_MCK (64000000ul) + +#define USE_LFXO // Board uses 32khz crystal for LF +// define USE_LFRC // Board uses RC for LF + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// Number of pins defined in PinDescription array +#define PINS_COUNT (48) +#define NUM_DIGITAL_PINS (48) +#define NUM_ANALOG_INPUTS (6) +#define NUM_ANALOG_OUTPUTS (0) + +// LEDs +#define PIN_LED1 (35) +#define PIN_LED2 (36) + +#define LED_BUILTIN PIN_LED1 +#define LED_CONN PIN_LED2 + +#define LED_GREEN PIN_LED1 +#define LED_BLUE PIN_LED2 + +#define LED_STATE_ON 1 // State when LED is litted + +/* + * Buttons + */ + +#define PIN_BUTTON1 9 // Pin for button on E-ink button module or IO expansion +#define BUTTON_NEED_PULLUP +#define PIN_BUTTON2 12 +#define PIN_BUTTON3 24 +#define PIN_BUTTON4 25 + +/* + * Analog pins + */ +#define PIN_A0 (5) +#define PIN_A1 (31) +#define PIN_A2 (28) +#define PIN_A3 (29) +#define PIN_A4 (30) +#define PIN_A5 (31) +#define PIN_A6 (0xff) +#define PIN_A7 (0xff) + +static const uint8_t A0 = PIN_A0; +static const uint8_t A1 = PIN_A1; +static const uint8_t A2 = PIN_A2; +static const uint8_t A3 = PIN_A3; +static const uint8_t A4 = PIN_A4; +static const uint8_t A5 = PIN_A5; +static const uint8_t A6 = PIN_A6; +static const uint8_t A7 = PIN_A7; +#define ADC_RESOLUTION 14 + +// Other pins +#define PIN_AREF (2) +#define PIN_NFC1 (9) +#define PIN_NFC2 (10) + +static const uint8_t AREF = PIN_AREF; + +/* + * Serial interfaces + */ +#define PIN_SERIAL1_RX (15) +#define PIN_SERIAL1_TX (16) + +// Connected to Jlink CDC +#define PIN_SERIAL2_RX (8) +#define PIN_SERIAL2_TX (6) + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 2 + +#define PIN_SPI_MISO (45) +#define PIN_SPI_MOSI (44) +#define PIN_SPI_SCK (43) + +#define PIN_SPI1_MISO (29) // (0 + 29) +#define PIN_SPI1_MOSI (30) // (0 + 30) +#define PIN_SPI1_SCK (3) // (0 + 3) + +static const uint8_t SS = 42; +static const uint8_t MOSI = PIN_SPI_MOSI; +static const uint8_t MISO = PIN_SPI_MISO; +static const uint8_t SCK = PIN_SPI_SCK; + +/* + * eink display pins + */ + +// #define PIN_EINK_CS (0 + 26) +// #define PIN_EINK_BUSY (0 + 4) +// #define PIN_EINK_DC (0 + 17) +// #define PIN_EINK_RES (-1) +// #define PIN_EINK_SCLK (0 + 3) +// #define PIN_EINK_MOSI (0 + 30) // also called SDI + +// #define USE_EINK + +// Display - OLED connected via I2C +#define HAS_SCREEN 1 +#define USE_SSD1306 + +// RAKRGB +// #define HAS_NCP5623 + +/* + * Wire Interfaces + */ +#define WIRE_INTERFACES_COUNT 1 + +#define PIN_WIRE_SDA (13) +#define PIN_WIRE_SCL (14) + +// QSPI Pins +#define PIN_QSPI_SCK 3 +#define PIN_QSPI_CS 26 +#define PIN_QSPI_IO0 30 +#define PIN_QSPI_IO1 29 +#define PIN_QSPI_IO2 28 +#define PIN_QSPI_IO3 2 + +// On-board QSPI Flash +#define EXTERNAL_FLASH_DEVICES IS25LP080D +#define EXTERNAL_FLASH_USE_QSPI + +/* @note RAK5005-O GPIO mapping to RAK4631 GPIO ports + RAK5005-O <-> nRF52840 + IO1 <-> P0.17 (Arduino GPIO number 17) + IO2 <-> P1.02 (Arduino GPIO number 34) + IO3 <-> P0.21 (Arduino GPIO number 21) + IO4 <-> P0.04 (Arduino GPIO number 4) + IO5 <-> P0.09 (Arduino GPIO number 9) + IO6 <-> P0.10 (Arduino GPIO number 10) + IO7 <-> P0.28 (Arduino GPIO number 28) + SW1 <-> P0.01 (Arduino GPIO number 1) + A0 <-> P0.04/AIN2 (Arduino Analog A2 + A1 <-> P0.31/AIN7 (Arduino Analog A7 + SPI_CS <-> P0.26 (Arduino GPIO number 26) + */ + +// RAK4630 LoRa module + +/* Setup of the SX1262 LoRa module ( https://docs.rakwireless.com/Product-Categories/WisBlock/RAK4631/Datasheet/ ) + +P1.10 NSS SPI NSS (Arduino GPIO number 42) +P1.11 SCK SPI CLK (Arduino GPIO number 43) +P1.12 MOSI SPI MOSI (Arduino GPIO number 44) +P1.13 MISO SPI MISO (Arduino GPIO number 45) +P1.14 BUSY BUSY signal (Arduino GPIO number 46) +P1.15 DIO1 DIO1 event interrupt (Arduino GPIO number 47) +P1.06 NRESET NRESET manual reset of the SX1262 (Arduino GPIO number 38) + +Important for successful SX1262 initialization: + +* Setup DIO2 to control the antenna switch +* Setup DIO3 to control the TCXO power supply +* Setup the SX1262 to use it's DCDC regulator and not the LDO +* RAK4630 schematics show GPIO P1.07 connected to the antenna switch, but it should not be initialized, as DIO2 will do the +control of the antenna switch + +SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG + +*/ + +// configure the SET pin on the RAK12039 sensor board to disable the sensor while not reading +// air quality telemetry. PIN_NFC2 doesn't seem to be used anywhere else in the codebase, but if +// you're having problems with your node behaving weirdly when a RAK12039 board isn't connected, +// try disabling this. +// #define PMSA003I_ENABLE_PIN PIN_NFC2 + +// #define DETECTION_SENSOR_EN 4 + +#define USE_SX1262 +#define SX126X_CS (42) +#define SX126X_DIO1 (47) +#define SX126X_BUSY (46) +#define SX126X_RESET (38) +// #define SX126X_TXEN (39) +// #define SX126X_RXEN (37) +#define SX126X_POWER_EN (37) +// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3 +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 + +// Testing USB detection +#define NRF_APM + +// enables 3.3V periphery like GPS or IO Module +// Do not toggle this for GPS power savings +#define PIN_3V3_EN (34) + +// RAK1910 GPS module +// If using the wisblock GPS module and pluged into Port A on WisBlock base +// IO1 is hooked to PPS (pin 12 on header) = gpio 17 +// IO2 is hooked to GPS RESET = gpio 34, but it can not be used to this because IO2 is ALSO used to control 3V3_S power (1 is on). +// Therefore must be 1 to keep peripherals powered +// Power is on the controllable 3V3_S rail +// #define PIN_GPS_RESET (34) +// #define PIN_GPS_EN PIN_3V3_EN +#define PIN_GPS_PPS (17) // Pulse per second input from the GPS + +#define GPS_BAUDRATE 9600 + +#define GPS_RX_PIN PIN_SERIAL1_RX +#define GPS_TX_PIN PIN_SERIAL1_TX + +// Define pin to enable GPS toggle (set GPIO to LOW) via user button triple press + +// RAK12002 RTC Module +// #define RV3028_RTC (uint8_t)0b1010010 + +// RAK18001 Buzzer in Slot C +// #define PIN_BUZZER 21 // IO3 is PWM2 +// NEW: set this via protobuf instead! + +// Battery +// The battery sense is hooked to pin A0 (5) +#define BATTERY_PIN PIN_A0 +// and has 12 bit resolution +#define BATTERY_SENSE_RESOLUTION_BITS 12 +#define BATTERY_SENSE_RESOLUTION 4096.0 +#undef AREF_VOLTAGE +#define AREF_VOLTAGE 3.0 +#define VBAT_AR_INTERNAL AR_INTERNAL_3_0 +#define ADC_MULTIPLIER 1.73 + +// #define HAS_RTC 1 + +// #define HAS_ETHERNET 1 + +// #define RAK_4631 1 + +// #define PIN_ETHERNET_RESET 21 +// #define PIN_ETHERNET_SS PIN_EINK_CS +// #define ETH_SPI_PORT SPI1 +// #define AQ_SET_PIN 10 + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#endif From cc0fbfbd21354115d2eb5b0c2b5a66438dca248f Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 13 Jun 2025 06:59:05 -0500 Subject: [PATCH 284/461] Fixed breaking of inkhud / tft suffix convention --- variants/heltec_mesh_pocket/platformio.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/variants/heltec_mesh_pocket/platformio.ini b/variants/heltec_mesh_pocket/platformio.ini index 6632c10fe..2f3886887 100644 --- a/variants/heltec_mesh_pocket/platformio.ini +++ b/variants/heltec_mesh_pocket/platformio.ini @@ -28,7 +28,7 @@ lib_deps = https://github.com/meshtastic/GxEPD2#b202ebfec6a4821e098cf7a625ba0f6f2400292d -[env:heltec-mesh-pocket-inkhud-5000] +[env:heltec-mesh-pocket-5000-inkhud] extends = nrf52840_base, inkhud board = heltec_mesh_pocket build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket> ${inkhud.build_src_filter} @@ -73,7 +73,7 @@ lib_deps = https://github.com/meshtastic/GxEPD2#b202ebfec6a4821e098cf7a625ba0f6f2400292d -[env:heltec-mesh-pocket-inkhud-10000] +[env:heltec-mesh-pocket-10000-inkhud] extends = nrf52840_base, inkhud board = heltec_mesh_pocket build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket> ${inkhud.build_src_filter} From 691917b956d3cfc349063542447585ce645bf8ab Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 14 Jun 2025 09:59:25 -0500 Subject: [PATCH 285/461] Add config for RAK 13300 on RAK6421 (#7037) --- bin/config.d/lora-RAK6421.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 bin/config.d/lora-RAK6421.yaml diff --git a/bin/config.d/lora-RAK6421.yaml b/bin/config.d/lora-RAK6421.yaml new file mode 100644 index 000000000..bbf38a474 --- /dev/null +++ b/bin/config.d/lora-RAK6421.yaml @@ -0,0 +1,21 @@ +Lora: + + ### RAK13300in Slot 1 + Module: sx1262 + IRQ: 22 #IO6 + Reset: 16 # IO4 + Busy: 24 # IO5 + # Ant_sw: 13 # IO3 + DIO3_TCXO_VOLTAGE: true + DIO2_AS_RF_SWITCH: true + spidev: spidev0.0 + # CS: 8 + + + ### RAK13300in Slot 2 pins +# IRQ: 18 #IO6 +# Reset: 24 # IO4 +# Busy: 19 # IO5 +# # Ant_sw: 23 # IO3 +# spidev: spidev0.1 +# # CS: 7 \ No newline at end of file From 1557219bad0249fc5745657716ac8826cf033c0b Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 14 Jun 2025 17:09:22 -0500 Subject: [PATCH 286/461] =?UTF-8?q?More=20low-entropy=20keys,=20and=20don'?= =?UTF-8?q?t=20issue=20a=20false=20warning=20when=20changing=20=E2=80=A6?= =?UTF-8?q?=20(#7041)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * More low-entropy keys, and don't issue a false warning when changing node name * CopyPasta Wasn't Tasty * When the phone sets the publickey size to 0, regenerate right away --- src/mesh/NodeDB.cpp | 12 +++++++++--- src/mesh/NodeDB.h | 15 +++++++++++++++ src/modules/AdminModule.cpp | 15 ++++++++++----- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 9ee430242..f923c210d 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1567,7 +1567,7 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde } #if !(MESHTASTIC_EXCLUDE_PKI) - if (p.public_key.size == 32) { + if (p.public_key.size == 32 && nodeId != nodeDB->getNodeNum()) { printBytes("Incoming Pubkey: ", p.public_key.bytes, 32); // Alert the user if a remote node is advertising public key that matches our own @@ -1763,7 +1763,8 @@ bool NodeDB::checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_pub uint8_t keyHash[32] = {0}; memcpy(keyHash, keyToTest.bytes, keyToTest.size); crypto->hash(keyHash, 32); - if (memcmp(keyHash, LOW_ENTROPY_HASH1, sizeof(LOW_ENTROPY_HASH1)) == 0 || + if (memcmp(keyHash, LOW_ENTROPY_HASH1, sizeof(LOW_ENTROPY_HASH1)) == + 0 || // should become an array that gets looped through rather than this abomination memcmp(keyHash, LOW_ENTROPY_HASH2, sizeof(LOW_ENTROPY_HASH2)) == 0 || memcmp(keyHash, LOW_ENTROPY_HASH3, sizeof(LOW_ENTROPY_HASH3)) == 0 || memcmp(keyHash, LOW_ENTROPY_HASH4, sizeof(LOW_ENTROPY_HASH4)) == 0 || @@ -1777,7 +1778,12 @@ bool NodeDB::checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_pub memcmp(keyHash, LOW_ENTROPY_HASH12, sizeof(LOW_ENTROPY_HASH12)) == 0 || memcmp(keyHash, LOW_ENTROPY_HASH13, sizeof(LOW_ENTROPY_HASH13)) == 0 || memcmp(keyHash, LOW_ENTROPY_HASH14, sizeof(LOW_ENTROPY_HASH14)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH15, sizeof(LOW_ENTROPY_HASH15)) == 0) { + memcmp(keyHash, LOW_ENTROPY_HASH15, sizeof(LOW_ENTROPY_HASH15)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH16, sizeof(LOW_ENTROPY_HASH16)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH17, sizeof(LOW_ENTROPY_HASH17)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH18, sizeof(LOW_ENTROPY_HASH18)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH19, sizeof(LOW_ENTROPY_HASH19)) == 0 || + memcmp(keyHash, LOW_ENTROPY_HASH20, sizeof(LOW_ENTROPY_HASH20)) == 0) { return true; } } diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index df1e8a7f6..9e77844f0 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -64,6 +64,21 @@ static const uint8_t LOW_ENTROPY_HASH14[] = {0x39, 0x39, 0x84, 0xe0, 0x22, 0x2f, static const uint8_t LOW_ENTROPY_HASH15[] = {0x0a, 0xda, 0x5f, 0xec, 0xff, 0x5c, 0xc0, 0x2e, 0x5f, 0xc4, 0x8d, 0x03, 0xe5, 0x80, 0x59, 0xd3, 0x5d, 0x49, 0x86, 0xe9, 0x8d, 0xf6, 0xf6, 0x16, 0x35, 0x3d, 0xf9, 0x9b, 0x29, 0x55, 0x9e, 0x64}; +static const uint8_t LOW_ENTROPY_HASH16[] = {0x08, 0x56, 0xF0, 0xD7, 0xEF, 0x77, 0xD6, 0x11, 0x1C, 0x8F, 0x95, + 0x2D, 0x3C, 0xDF, 0xB1, 0x22, 0xBF, 0x60, 0x9B, 0xE5, 0xA9, 0xC0, + 0x6E, 0x4B, 0x01, 0xDC, 0xD1, 0x57, 0x44, 0xB2, 0xA5, 0xCF}; +static const uint8_t LOW_ENTROPY_HASH17[] = {0x2C, 0xB2, 0x77, 0x85, 0xD6, 0xB7, 0x48, 0x9C, 0xFE, 0xBC, 0x80, + 0x26, 0x60, 0xF4, 0x6D, 0xCE, 0x11, 0x31, 0xA2, 0x1E, 0x33, 0x0A, + 0x6D, 0x2B, 0x00, 0xFA, 0x0C, 0x90, 0x95, 0x8F, 0x5C, 0x6B}; +static const uint8_t LOW_ENTROPY_HASH18[] = {0xFA, 0x59, 0xC8, 0x6E, 0x94, 0xEE, 0x75, 0xC9, 0x9A, 0xB0, 0xFE, + 0x89, 0x36, 0x40, 0xC9, 0x99, 0x4A, 0x3B, 0xF4, 0xAA, 0x12, 0x24, + 0xA2, 0x0F, 0xF9, 0xD1, 0x08, 0xCB, 0x78, 0x19, 0xAA, 0xE5}; +static const uint8_t LOW_ENTROPY_HASH19[] = {0x6E, 0x42, 0x7A, 0x4A, 0x8C, 0x61, 0x62, 0x22, 0xA1, 0x89, 0xD3, + 0xA4, 0xC2, 0x19, 0xA3, 0x83, 0x53, 0xA7, 0x7A, 0x0A, 0x89, 0xE2, + 0x54, 0x52, 0x62, 0x3D, 0xE7, 0xCA, 0x8C, 0xF6, 0x6A, 0x60}; +static const uint8_t LOW_ENTROPY_HASH20[] = {0x20, 0x27, 0x2F, 0xBA, 0x0C, 0x99, 0xD7, 0x29, 0xF3, 0x11, 0x35, + 0x89, 0x9D, 0x0E, 0x24, 0xA1, 0xC3, 0xCB, 0xDF, 0x8A, 0xF1, 0xC6, + 0xFE, 0xD0, 0xD7, 0x9F, 0x92, 0xD6, 0x8F, 0x59, 0xBF, 0xE4}; static const char LOW_ENTROPY_WARNING[] = "Your Device is configured with a low entropy key. Suggest regenerating DM keys"; #endif /* diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index ea4c46949..551602f00 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -722,11 +722,16 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) LOG_INFO("Set config: Security"); config.security = c.payload_variant.security; #if !(MESHTASTIC_EXCLUDE_PKI_KEYGEN) && !(MESHTASTIC_EXCLUDE_PKI) - // We check for a potentially valid private key, and a blank public key, and regen the public key if needed. - if (config.security.private_key.size == 32 && !memfll(config.security.private_key.bytes, 0, 32) && - (config.security.public_key.size == 0 || memfll(config.security.public_key.bytes, 0, 32))) { - if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) { - config.security.public_key.size = 32; + // If the client set the key to blank, go ahead and regenerate so long as we're not in ham mode + if (!owner.is_licensed && config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_UNSET) { + if (config.security.private_key.size != 32) { + crypto->generateKeyPair(config.security.public_key.bytes, config.security.private_key.bytes); + + } else if (config.security.public_key.size != 32) { + // We check for a potentially valid private key, and a blank public key, and regen the public key if needed. + if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) { + config.security.public_key.size = 32; + } } } #endif From 425f384b1fe0e107ec517f8b177b4ee6560d8ae6 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Sun, 15 Jun 2025 11:39:46 +1200 Subject: [PATCH 287/461] InkHUD DIY builds for ProMicro & Heltec T114 (#7039) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * DIY InkHUD variants (ProMicro & T114) * Fix file encoding > We’ve detected the file encoding as ISO-8859-1. When you commit changes we will transcode it to UTF-8. * Update comment justifying trunk suppression --- .../custom_build_tasks.py | 62 +++++++ .../nrf52_promicro_diy_tcxo/nicheGraphics.h | 94 ++++++++++ .../diy/nrf52_promicro_diy_tcxo/variant.h | 44 +++-- variants/diy/platformio.ini | 21 +++ .../custom_build_tasks.py | 62 +++++++ .../nicheGraphics.h | 94 ++++++++++ .../platformio.ini | 19 ++ .../heltec_mesh_node_t114-inkhud/variant.cpp | 38 ++++ .../heltec_mesh_node_t114-inkhud/variant.h | 175 ++++++++++++++++++ 9 files changed, 590 insertions(+), 19 deletions(-) create mode 100644 variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py create mode 100644 variants/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h create mode 100644 variants/heltec_mesh_node_t114-inkhud/custom_build_tasks.py create mode 100644 variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h create mode 100644 variants/heltec_mesh_node_t114-inkhud/platformio.ini create mode 100644 variants/heltec_mesh_node_t114-inkhud/variant.cpp create mode 100644 variants/heltec_mesh_node_t114-inkhud/variant.h diff --git a/variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py b/variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py new file mode 100644 index 000000000..00896e21f --- /dev/null +++ b/variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py @@ -0,0 +1,62 @@ +# Simplifies DIY InkHUD builds, with presets for several common E-Ink displays +# - build using custom task in Platformio's "Project Tasks" panel +# - build with `pio run -e -t build_weact_154` (or similar) + +# Silence trunk's objections to the import statements +# trunk-ignore-all(ruff/F821) +# trunk-ignore-all(flake8/F821) + +from SCons.Script import COMMAND_LINE_TARGETS + +Import("env") +Import("projenv") + +# Custom targets +# These wrappers just run the normal build task under a different target name +# We intercept the build later on, based on the target name +env.AddTarget( + name="build_weact_154", + dependencies=["buildprog"], + actions=None, + title='Build (WeAct 1.54")', +) +env.AddTarget( + name="build_weact_213", + dependencies=["buildprog"], + actions=None, + title='Build (WeAct 2.13")', +) +env.AddTarget( + name="build_weact_290", + dependencies=["buildprog"], + actions=None, + title='Build (WeAct 2.9")', +) +env.AddTarget( + name="build_weact_420", + dependencies=["buildprog"], + actions=None, + title='Build (WeAct 4.2")', +) + +# Check whether a build was started via one of our custom targets above + +if "build_weact_154" in COMMAND_LINE_TARGETS: + print('Building for WeAct 1.54" Display') + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "ZJY200200_0154DAAMFGN")) + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15")) + +elif "build_weact_213" in COMMAND_LINE_TARGETS: + print('Building for WeAct 2.13" Display') + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "HINK_E0213A289")) + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "10")) + +elif "build_weact_290" in COMMAND_LINE_TARGETS: + print('Building for WeAct 2.9" Display') + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "ZJY128296_029EAAMFGN")) + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15")) + +elif "build_weact_420" in COMMAND_LINE_TARGETS: + print('Building for WeAct 4.2" Display') + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "HINK_E042A87")) + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15")) diff --git a/variants/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h b/variants/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h new file mode 100644 index 000000000..bbd530595 --- /dev/null +++ b/variants/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h @@ -0,0 +1,94 @@ +#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/HINK_E0213A289.h" // WeAct 2.13" +#include "graphics/niche/Drivers/EInk/HINK_E042A87.h" // WeAct 4.2" +#include "graphics/niche/Drivers/EInk/ZJY128296_029EAAMFGN.h" // WeAct 2.9" +#include "graphics/niche/Drivers/EInk/ZJY200200_0154DAAMFGN.h" // WeACt 1.54" + +#include "graphics/niche/Inputs/TwoButton.h" + +#if !defined(INKHUD_BUILDCONF_DRIVER) || !defined(INKHUD_BUILDCONF_DISPLAYRESILIENCE) +#error If not using a DIY preset, display model and resilience must be set manually +#endif + +void setupNicheGraphics() +{ + using namespace NicheGraphics; + + // SPI + // ----------------------------- + SPI.begin(); + + // Driver + // ----------------------------- + + // Use E-Ink driver + Drivers::EInk *driver = new Drivers::INKHUD_BUILDCONF_DRIVER; + driver->begin(&SPI, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); + + // InkHUD + // ---------------------------- + + InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance(); + + // Set the driver + inkhud->setDriver(driver); + + // Set how many FAST updates per FULL update. + inkhud->setDisplayResilience(INKHUD_BUILDCONF_DISPLAYRESILIENCE); // Suggest roughly ten + + // Prepare fonts + InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; + + // Init settings, and customize defaults + // Values ignored individually if found saved to flash + inkhud->persistence->settings.rotation = (driver->height > driver->width ? 1 : 0); // Rotate 90deg to landscape, if needed + inkhud->persistence->settings.userTiles.maxCount = 4; + inkhud->persistence->settings.optionalFeatures.batteryIcon = true; + + // Pick applets + // Note: order of applets determines priority of "auto-show" feature + inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet); + inkhud->addApplet("DMs", new InkHUD::DMApplet, true, false, 3); // Default on tile 3 + inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0), true, false, 2); // Default on tile 2 + inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); + inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true, false, 1); // Default on tile 1 + inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet, true, false, 0); // Default on tile 0 + inkhud->addApplet("Heard", new InkHUD::HeardApplet, true); // Background + + // Start running InkHUD + inkhud->begin(); + + // Buttons + // -------------------------- + + Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component + + // Setup the main user button + buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin(), true); // Internal pull up + buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); }); + buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); }); + + buttons->start(); +} + +#endif \ No newline at end of file diff --git a/variants/diy/nrf52_promicro_diy_tcxo/variant.h b/variants/diy/nrf52_promicro_diy_tcxo/variant.h index de49018f4..e93442c7e 100644 --- a/variants/diy/nrf52_promicro_diy_tcxo/variant.h +++ b/variants/diy/nrf52_promicro_diy_tcxo/variant.h @@ -22,26 +22,26 @@ extern "C" { /* NRF52 PRO MICRO PIN ASSIGNMENT -| Pin | Function | | Pin | Function | RF95 | +| Pin   | Function   |   | Pin     | Function     | RF95 | | ----- | ----------- | --- | -------- | ------------ | ----- | -| Gnd | | | vbat | | | -| P0.06 | Serial2 RX | | vbat | | | -| P0.08 | Serial2 TX | | Gnd | | | -| Gnd | | | reset | | | -| Gnd | | | ext_vcc | *see 0.13 | | -| P0.17 | RXEN | | P0.31 | BATTERY_PIN | | -| P0.20 | GPS_RX | | P0.29 | BUSY | DIO0 | -| P0.22 | GPS_TX | | P0.02 | MISO | MISO | -| P0.24 | GPS_EN | | P1.15 | MOSI | MOSI | -| P1.00 | BUTTON_PIN | | P1.13 | CS | CS | -| P0.11 | SCL | | P1.11 | SCK | SCK | -| P1.04 | SDA | | P0.10 | DIO1/IRQ | DIO1 | -| P1.06 | Free pin | | P0.09 | RESET | RST | -| | | | | | | -| | Mid board | | | Internal | | -| P1.01 | Free pin | | 0.15 | LED | | -| P1.02 | Free pin | | 0.13 | 3V3_EN | | -| P1.07 | Free pin | | | | | +| Gnd   |             |   | vbat     |             | | +| P0.06 | Serial2 RX |   | vbat     |             | | +| P0.08 | Serial2 TX |   | Gnd     |             | | +| Gnd   |             |   | reset   |             | | +| Gnd   |             |   | ext_vcc | *see 0.13   | | +| P0.17 | RXEN       |   | P0.31   | BATTERY_PIN | | +| P0.20 | GPS_RX     |   | P0.29   | BUSY         | DIO0 | +| P0.22 | GPS_TX     |   | P0.02   | MISO | MISO | +| P0.24 | GPS_EN     |   | P1.15   | MOSI         | MOSI | +| P1.00 | BUTTON_PIN |   | P1.13   | CS           | CS   | +| P0.11 | SCL         |   | P1.11   | SCK         | SCK | +| P1.04 | SDA         |   | P0.10   | DIO1/IRQ     | DIO1 | +| P1.06 | Free pin   |   | P0.09   | RESET       | RST | +|       |             |   |         |             | | +|       | Mid board   |   |         | Internal     | | +| P1.01 | Free pin   |   | 0.15     | LED         | | +| P1.02 | Free pin   |   | 0.13     | 3V3_EN       | | +| P1.07 | Free pin   |   |         |             | | */ // Number of pins defined in PinDescription array @@ -185,6 +185,12 @@ settings. #define SX126X_DIO3_TCXO_VOLTAGE 1.8 #define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL +// E-Ink DIY +#define PIN_EINK_CS (32 + 7) +#define PIN_EINK_DC (32 + 2) +#define PIN_EINK_RES (32 + 1) +#define PIN_EINK_BUSY (32 + 6) + #ifdef __cplusplus } #endif diff --git a/variants/diy/platformio.ini b/variants/diy/platformio.ini index d8ceee9cc..24ea9cc9d 100644 --- a/variants/diy/platformio.ini +++ b/variants/diy/platformio.ini @@ -68,6 +68,27 @@ lib_deps = ${nrf52840_base.lib_deps} debug_tool = jlink +; NRF52 ProMicro w/ E-Ink display +[env:nrf52_promicro_diy-inkhud] +board_level = extra +extends = nrf52840_base, inkhud +board = promicro-nrf52840 +build_flags = + ${nrf52840_base.build_flags} + ${inkhud.build_flags} + -I variants/diy/nrf52_promicro_diy_tcxo + -D NRF52_PROMICRO_DIY +build_src_filter = + ${nrf52_base.build_src_filter} + ${inkhud.build_src_filter} + +<../variants/diy/nrf52_promicro_diy_tcxo> +lib_deps = + ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX + ${nrf52840_base.lib_deps} +extra_scripts = + ${env.extra_scripts} + variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py ; Add to PIO's Project Tasks pane: preset builds for common displays + ; Seeed XIAO nRF52840 + XIAO Wio SX1262 DIY [env:seeed-xiao-nrf52840-wio-sx1262] board = xiao_ble_sense diff --git a/variants/heltec_mesh_node_t114-inkhud/custom_build_tasks.py b/variants/heltec_mesh_node_t114-inkhud/custom_build_tasks.py new file mode 100644 index 000000000..00896e21f --- /dev/null +++ b/variants/heltec_mesh_node_t114-inkhud/custom_build_tasks.py @@ -0,0 +1,62 @@ +# Simplifies DIY InkHUD builds, with presets for several common E-Ink displays +# - build using custom task in Platformio's "Project Tasks" panel +# - build with `pio run -e -t build_weact_154` (or similar) + +# Silence trunk's objections to the import statements +# trunk-ignore-all(ruff/F821) +# trunk-ignore-all(flake8/F821) + +from SCons.Script import COMMAND_LINE_TARGETS + +Import("env") +Import("projenv") + +# Custom targets +# These wrappers just run the normal build task under a different target name +# We intercept the build later on, based on the target name +env.AddTarget( + name="build_weact_154", + dependencies=["buildprog"], + actions=None, + title='Build (WeAct 1.54")', +) +env.AddTarget( + name="build_weact_213", + dependencies=["buildprog"], + actions=None, + title='Build (WeAct 2.13")', +) +env.AddTarget( + name="build_weact_290", + dependencies=["buildprog"], + actions=None, + title='Build (WeAct 2.9")', +) +env.AddTarget( + name="build_weact_420", + dependencies=["buildprog"], + actions=None, + title='Build (WeAct 4.2")', +) + +# Check whether a build was started via one of our custom targets above + +if "build_weact_154" in COMMAND_LINE_TARGETS: + print('Building for WeAct 1.54" Display') + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "ZJY200200_0154DAAMFGN")) + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15")) + +elif "build_weact_213" in COMMAND_LINE_TARGETS: + print('Building for WeAct 2.13" Display') + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "HINK_E0213A289")) + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "10")) + +elif "build_weact_290" in COMMAND_LINE_TARGETS: + print('Building for WeAct 2.9" Display') + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "ZJY128296_029EAAMFGN")) + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15")) + +elif "build_weact_420" in COMMAND_LINE_TARGETS: + print('Building for WeAct 4.2" Display') + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "HINK_E042A87")) + projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15")) diff --git a/variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h b/variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h new file mode 100644 index 000000000..339ec3353 --- /dev/null +++ b/variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h @@ -0,0 +1,94 @@ +#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/HINK_E0213A289.h" // WeAct 2.13" +#include "graphics/niche/Drivers/EInk/HINK_E042A87.h" // WeAct 4.2" +#include "graphics/niche/Drivers/EInk/ZJY128296_029EAAMFGN.h" // WeAct 2.9" +#include "graphics/niche/Drivers/EInk/ZJY200200_0154DAAMFGN.h" // WeACt 1.54" + +#include "graphics/niche/Inputs/TwoButton.h" + +#if !defined(INKHUD_BUILDCONF_DRIVER) || !defined(INKHUD_BUILDCONF_DISPLAYRESILIENCE) +#error If not using a DIY preset, display model and resilience must be set manually +#endif + +void setupNicheGraphics() +{ + using namespace NicheGraphics; + + // SPI + // ----------------------------- + SPI1.begin(); + + // Driver + // ----------------------------- + + // Use E-Ink driver + Drivers::EInk *driver = new Drivers::INKHUD_BUILDCONF_DRIVER; + driver->begin(&SPI1, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); + + // InkHUD + // ---------------------------- + + InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance(); + + // Set the driver + inkhud->setDriver(driver); + + // Set how many FAST updates per FULL update. + inkhud->setDisplayResilience(INKHUD_BUILDCONF_DISPLAYRESILIENCE); // Suggest roughly ten + + // Prepare fonts + InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; + + // Init settings, and customize defaults + // Values ignored individually if found saved to flash + inkhud->persistence->settings.rotation = (driver->height > driver->width ? 1 : 0); // Rotate 90deg to landscape, if needed + inkhud->persistence->settings.userTiles.maxCount = 4; + inkhud->persistence->settings.optionalFeatures.batteryIcon = true; + + // Pick applets + // Note: order of applets determines priority of "auto-show" feature + inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet); + inkhud->addApplet("DMs", new InkHUD::DMApplet, true, false, 3); // Default on tile 3 + inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0), true, false, 2); // Default on tile 2 + inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); + inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true, false, 1); // Default on tile 1 + inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet, true, false, 0); // Default on tile 0 + inkhud->addApplet("Heard", new InkHUD::HeardApplet, true); // Background + + // 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(); }); + + buttons->start(); +} + +#endif \ No newline at end of file diff --git a/variants/heltec_mesh_node_t114-inkhud/platformio.ini b/variants/heltec_mesh_node_t114-inkhud/platformio.ini new file mode 100644 index 000000000..9a5673040 --- /dev/null +++ b/variants/heltec_mesh_node_t114-inkhud/platformio.ini @@ -0,0 +1,19 @@ +[env:heltec-mesh-node-t114-inkhud] +board_level = extra +extends = nrf52840_base, inkhud +board = heltec_mesh_node_t114 +board_check = true +build_flags = + ${nrf52840_base.build_flags} + ${inkhud.build_flags} + -I variants/heltec_mesh_node_t114-inkhud +build_src_filter = + ${nrf52_base.build_src_filter} + ${inkhud.build_src_filter} +lib_deps = + ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX + ${nrf52840_base.lib_deps} + lewisxhe/PCF8563_Library@^1.0.1 +extra_scripts = + ${env.extra_scripts} + variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py ; Add to PIO's Project Tasks pane: preset builds for common displays \ No newline at end of file diff --git a/variants/heltec_mesh_node_t114-inkhud/variant.cpp b/variants/heltec_mesh_node_t114-inkhud/variant.cpp new file mode 100644 index 000000000..85c9f4a72 --- /dev/null +++ b/variants/heltec_mesh_node_t114-inkhud/variant.cpp @@ -0,0 +1,38 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "variant.h" +#include "nrf.h" +#include "wiring_constants.h" +#include "wiring_digital.h" + +const uint32_t g_ADigitalPinMap[] = { + // P0 - pins 0 and 1 are hardwired for xtal and should never be enabled + 0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + + // P1 + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}; + +void initVariant() +{ + // LED1 + pinMode(PIN_LED1, OUTPUT); + ledOff(PIN_LED1); +} diff --git a/variants/heltec_mesh_node_t114-inkhud/variant.h b/variants/heltec_mesh_node_t114-inkhud/variant.h new file mode 100644 index 000000000..39cbc8f01 --- /dev/null +++ b/variants/heltec_mesh_node_t114-inkhud/variant.h @@ -0,0 +1,175 @@ +// Unlike many other InkHUD variants, this environment does require its own variant.h file +// This is because the default T114 variant maps SPI1 pins to the optional TFT display, and those pins are not broken out + +#ifndef _VARIANT_HELTEC_NRF_ +#define _VARIANT_HELTEC_NRF_ +/** Master clock frequency */ +#define VARIANT_MCK (64000000ul) + +#define USE_LFXO // Board uses 32khz crystal for LF + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +#define HELTEC_MESH_NODE_T114 + +// Number of pins defined in PinDescription array +#define PINS_COUNT (48) +#define NUM_DIGITAL_PINS (48) +#define NUM_ANALOG_INPUTS (1) +#define NUM_ANALOG_OUTPUTS (0) + +// LEDs +#define PIN_LED1 (32 + 3) // green (confirmed on 1.0 board) +#define LED_BLUE PIN_LED1 // fake for bluefruit library +#define LED_GREEN PIN_LED1 +#define LED_BUILTIN LED_GREEN +#define LED_STATE_ON 0 // State when LED is lit + +#define HAS_NEOPIXEL // Enable the use of neopixels +#define NEOPIXEL_COUNT 2 // How many neopixels are connected +#define NEOPIXEL_DATA 14 // gpio pin used to send data to the neopixels +#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use + +/* + * Buttons + */ +#define PIN_BUTTON1 (32 + 10) +// #define PIN_BUTTON2 (0 + 18) // 0.18 is labeled on the board as RESET but we configure it in the bootloader as a regular +// GPIO + +/* +No longer populated on PCB +*/ +#define PIN_SERIAL2_RX (0 + 9) +#define PIN_SERIAL2_TX (0 + 10) +// #define PIN_SERIAL2_EN (0 + 17) + +/* + * I2C + */ + +#define WIRE_INTERFACES_COUNT 2 + +// I2C bus 0 +// Routed to footprint for PCF8563TS RTC +// Not populated on T114 V1, maybe in future? +#define PIN_WIRE_SDA (0 + 26) // P0.26 +#define PIN_WIRE_SCL (0 + 27) // P0.27 + +// I2C bus 1 +// Available on header pins, for general use +#define PIN_WIRE1_SDA (0 + 16) // P0.16 +#define PIN_WIRE1_SCL (0 + 13) // P0.13 + +/* + * Lora radio + */ + +#define USE_SX1262 +// #define USE_SX1268 +#define SX126X_CS (0 + 24) // FIXME - we really should define LORA_CS instead +#define LORA_CS (0 + 24) +#define SX126X_DIO1 (0 + 20) +// Note DIO2 is attached internally to the module to an analog switch for TX/RX switching +// #define SX1262_DIO3 (0 + 21) +// This is used as an *output* from the sx1262 and connected internally to power the tcxo, do not drive from the +// main +// CPU? +#define SX126X_BUSY (0 + 17) +#define SX126X_RESET (0 + 25) +// Not really an E22 but TTGO seems to be trying to clone that +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 + +/* + * E-Ink DIY + */ +#define PIN_EINK_MOSI (0 + 8) // also called SDA +#define PIN_EINK_SCLK (0 + 7) +#define PIN_EINK_CS (32 + 12) +#define PIN_EINK_DC (32 + 14) +#define PIN_EINK_RES (0 + 5) +#define PIN_EINK_BUSY (32 + 15) + +/* + * GPS pins + */ + +#define GPS_L76K + +// #define PIN_GPS_RESET (32 + 6) // An output to reset L76K GPS. As per datasheet, low for > 100ms will reset the L76K +#define GPS_RESET_MODE LOW +// #define PIN_GPS_EN (21) +#define VEXT_ENABLE (0 + 21) +#define PERIPHERAL_WARMUP_MS 1000 // Make sure I2C QuickLink has stable power before continuing +#define VEXT_ON_VALUE HIGH +// #define GPS_EN_ACTIVE HIGH +#define PIN_GPS_STANDBY (32 + 2) // An output to wake GPS, low means allow sleep, high means force wake +#define PIN_GPS_PPS (32 + 4) +// Seems to be missing on this new board +// #define PIN_GPS_PPS (32 + 4) // Pulse per second input from the GPS +#define GPS_TX_PIN (32 + 5) // This is for bits going TOWARDS the CPU +#define GPS_RX_PIN (32 + 7) // This is for bits going TOWARDS the GPS + +#define GPS_THREAD_INTERVAL 50 + +#define PIN_SERIAL1_RX GPS_TX_PIN +#define PIN_SERIAL1_TX GPS_RX_PIN + +// PCF8563 RTC Module +#define PCF8563_RTC 0x51 + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 2 + +// For LORA, spi 0 +#define PIN_SPI_MISO (0 + 23) +#define PIN_SPI_MOSI (0 + 22) +#define PIN_SPI_SCK (0 + 19) + +#define PIN_SPI1_MISO -1 +#define PIN_SPI1_MOSI PIN_EINK_MOSI +#define PIN_SPI1_SCK PIN_EINK_SCLK + +// #define PIN_PWR_EN (0 + 6) + +// To debug via the segger JLINK console rather than the CDC-ACM serial device +// #define USE_SEGGER + +// Battery +// The battery sense is hooked to pin A0 (4) +// it is defined in the anlaolgue pin section of this file +// and has 12 bit resolution + +#define ADC_CTRL 6 +#define ADC_CTRL_ENABLED HIGH +#define BATTERY_PIN 4 +#define ADC_RESOLUTION 14 + +#define BATTERY_SENSE_RESOLUTION_BITS 12 +#define BATTERY_SENSE_RESOLUTION 4096.0 +#undef AREF_VOLTAGE +#define AREF_VOLTAGE 3.0 +#define VBAT_AR_INTERNAL AR_INTERNAL_3_0 +#define ADC_MULTIPLIER (4.90F) + +#define HAS_RTC 0 +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#endif From e623c70bd0c2ab9db9baf04888e19d1428310bb9 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 14 Jun 2025 19:35:57 -0500 Subject: [PATCH 288/461] More clear key warning messages. --- src/mesh/NodeDB.cpp | 2 +- src/mesh/NodeDB.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index f923c210d..c978709d5 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1573,7 +1573,7 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde // Alert the user if a remote node is advertising public key that matches our own if (owner.public_key.size == 32 && memcmp(p.public_key.bytes, owner.public_key.bytes, 32) == 0 && !duplicateWarned) { duplicateWarned = true; - char warning[] = "Remote device %s has advertised your public key. This may indicate a low-entropy key. You may need " + char warning[] = "Remote device %s has advertised your public key. This may indicate a compromised key. You may need " "to regenerate your public keys."; LOG_WARN(warning, p.long_name); meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 9e77844f0..90ca5aefd 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -79,7 +79,7 @@ static const uint8_t LOW_ENTROPY_HASH19[] = {0x6E, 0x42, 0x7A, 0x4A, 0x8C, 0x61, static const uint8_t LOW_ENTROPY_HASH20[] = {0x20, 0x27, 0x2F, 0xBA, 0x0C, 0x99, 0xD7, 0x29, 0xF3, 0x11, 0x35, 0x89, 0x9D, 0x0E, 0x24, 0xA1, 0xC3, 0xCB, 0xDF, 0x8A, 0xF1, 0xC6, 0xFE, 0xD0, 0xD7, 0x9F, 0x92, 0xD6, 0x8F, 0x59, 0xBF, 0xE4}; -static const char LOW_ENTROPY_WARNING[] = "Your Device is configured with a low entropy key. Suggest regenerating DM keys"; +static const char LOW_ENTROPY_WARNING[] = "Compromised keys detected, please regenerate."; #endif /* DeviceState versions used to be defined in the .proto file but really only this function cares. So changed to a From 28244148a20ddf59bbdef6f57c1c70cf8f4f6852 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 15 Jun 2025 06:14:53 -0500 Subject: [PATCH 289/461] chore(deps): update meshtastic/device-ui digest to 301f11e (#7042) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 555879fb5..c2d65ec02 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/1b520fcb168c7447a8d6a6ebc56954c9f472e964.zip + https://github.com/meshtastic/device-ui/archive/301f11e584cbeccf08af923bb2a0e02b669bda0b.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 7dfbcc8f1db8fbe93995b7cf09372e2bcec7d15b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 15 Jun 2025 06:16:59 -0500 Subject: [PATCH 290/461] Upgrade trunk (#7030) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 5f931270c..8bf5c6748 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,7 +9,7 @@ plugins: lint: enabled: - checkov@3.2.440 - - renovate@40.49.10 + - renovate@40.51.0 - prettier@3.5.3 - trufflehog@3.89.1 - yamllint@1.37.1 From 66d5dde9569ce961de0afb33d6a921f429f6a820 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 15 Jun 2025 06:45:00 -0500 Subject: [PATCH 291/461] [create-pull-request] automated change (#7043) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/admin.pb.h | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/protobufs b/protobufs index 0c112881d..c758376d0 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 0c112881dfb4aa24a61ee55dd4c46abbfc093717 +Subproject commit c758376d04cf5d3d42de24f9388836a18bae9a76 diff --git a/src/mesh/generated/meshtastic/admin.pb.h b/src/mesh/generated/meshtastic/admin.pb.h index c111d3993..071640b0d 100644 --- a/src/mesh/generated/meshtastic/admin.pb.h +++ b/src/mesh/generated/meshtastic/admin.pb.h @@ -130,6 +130,8 @@ typedef struct _meshtastic_SharedContact { /* The User of the contact */ bool has_user; meshtastic_User user; + /* Add this contact to the blocked / ignored list */ + bool should_ignore; } meshtastic_SharedContact; /* This message is used by a client to initiate or complete a key verification */ @@ -317,13 +319,13 @@ extern "C" { #define meshtastic_AdminMessage_InputEvent_init_default {0, 0, 0, 0} #define meshtastic_HamParameters_init_default {"", 0, 0, ""} #define meshtastic_NodeRemoteHardwarePinsResponse_init_default {0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}} -#define meshtastic_SharedContact_init_default {0, false, meshtastic_User_init_default} +#define meshtastic_SharedContact_init_default {0, false, meshtastic_User_init_default, 0} #define meshtastic_KeyVerificationAdmin_init_default {_meshtastic_KeyVerificationAdmin_MessageType_MIN, 0, 0, false, 0} #define meshtastic_AdminMessage_init_zero {0, {0}, {0, {0}}} #define meshtastic_AdminMessage_InputEvent_init_zero {0, 0, 0, 0} #define meshtastic_HamParameters_init_zero {"", 0, 0, ""} #define meshtastic_NodeRemoteHardwarePinsResponse_init_zero {0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}} -#define meshtastic_SharedContact_init_zero {0, false, meshtastic_User_init_zero} +#define meshtastic_SharedContact_init_zero {0, false, meshtastic_User_init_zero, 0} #define meshtastic_KeyVerificationAdmin_init_zero {_meshtastic_KeyVerificationAdmin_MessageType_MIN, 0, 0, false, 0} /* Field tags (for use in manual encoding/decoding) */ @@ -338,6 +340,7 @@ extern "C" { #define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_tag 1 #define meshtastic_SharedContact_node_num_tag 1 #define meshtastic_SharedContact_user_tag 2 +#define meshtastic_SharedContact_should_ignore_tag 3 #define meshtastic_KeyVerificationAdmin_message_type_tag 1 #define meshtastic_KeyVerificationAdmin_remote_nodenum_tag 2 #define meshtastic_KeyVerificationAdmin_nonce_tag 3 @@ -500,7 +503,8 @@ X(a, STATIC, REPEATED, MESSAGE, node_remote_hardware_pins, 1) #define meshtastic_SharedContact_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, node_num, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, user, 2) +X(a, STATIC, OPTIONAL, MESSAGE, user, 2) \ +X(a, STATIC, SINGULAR, BOOL, should_ignore, 3) #define meshtastic_SharedContact_CALLBACK NULL #define meshtastic_SharedContact_DEFAULT NULL #define meshtastic_SharedContact_user_MSGTYPE meshtastic_User @@ -535,7 +539,7 @@ extern const pb_msgdesc_t meshtastic_KeyVerificationAdmin_msg; #define meshtastic_HamParameters_size 31 #define meshtastic_KeyVerificationAdmin_size 25 #define meshtastic_NodeRemoteHardwarePinsResponse_size 496 -#define meshtastic_SharedContact_size 123 +#define meshtastic_SharedContact_size 125 #ifdef __cplusplus } /* extern "C" */ From ac52edd11a36ee9976329387e6fb6e9cd36cca95 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 15 Jun 2025 07:34:03 -0500 Subject: [PATCH 292/461] Add the ability to share ignored contacts (for blacklisting problematic nodes) (#7044) --- src/mesh/NodeDB.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index c978709d5..b1ec7b347 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1545,15 +1545,25 @@ void NodeDB::addFromContact(meshtastic_SharedContact contact) return; } info->num = contact.node_num; - info->last_heard = getValidTime(RTCQualityNTP); info->has_user = true; info->user = TypeConversions::ConvertToUserLite(contact.user); - info->is_favorite = true; - // Mark the node's key as manually verified to indicate trustworthiness. - info->bitfield |= NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK; - updateGUIforNode = info; - powerFSM.trigger(EVENT_NODEDB_UPDATED); - notifyObservers(true); // Force an update whether or not our node counts have changed + if (contact.should_ignore) { + // If should_ignore is set, + // we need to clear the public key and other cruft, in addition to setting the node as ignored + info->is_ignored = true; + info->has_device_metrics = false; + info->has_position = false; + info->user.public_key.size = 0; + info->user.public_key.bytes[0] = 0; + } else { + info->last_heard = getValidTime(RTCQualityNTP); + info->is_favorite = true; + info->bitfield |= NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK; + // Mark the node's key as manually verified to indicate trustworthiness. + updateGUIforNode = info; + powerFSM.trigger(EVENT_NODEDB_UPDATED); + notifyObservers(true); // Force an update whether or not our node counts have changed + } saveNodeDatabaseToDisk(); } From f1dd623ce95bf5d116488c363ddf71b15a6f02d5 Mon Sep 17 00:00:00 2001 From: Andy Shinn Date: Sun, 15 Jun 2025 07:39:49 -0500 Subject: [PATCH 293/461] allow overriding INA3221 channels (#7035) Co-authored-by: Jonathan Bennett --- src/modules/Telemetry/Sensor/INA3221Sensor.h | 12 ++++++++++-- variants/rak4631/variant.h | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/modules/Telemetry/Sensor/INA3221Sensor.h b/src/modules/Telemetry/Sensor/INA3221Sensor.h index 69edf8c50..0581f92f6 100644 --- a/src/modules/Telemetry/Sensor/INA3221Sensor.h +++ b/src/modules/Telemetry/Sensor/INA3221Sensor.h @@ -8,16 +8,24 @@ #include "VoltageSensor.h" #include +#ifndef INA3221_ENV_CH +#define INA3221_ENV_CH INA3221_CH1 +#endif + +#ifndef INA3221_BAT_CH +#define INA3221_BAT_CH INA3221_CH1 +#endif + class INA3221Sensor : public TelemetrySensor, VoltageSensor, CurrentSensor { private: INA3221 ina3221 = INA3221(INA3221_ADDR42_SDA); // channel to report voltage/current for environment metrics - ina3221_ch_t ENV_CH = INA3221_CH1; + static const ina3221_ch_t ENV_CH = INA3221_ENV_CH; // channel to report battery voltage for device_battery_ina_address - ina3221_ch_t BAT_CH = INA3221_CH1; + static const ina3221_ch_t BAT_CH = INA3221_BAT_CH; // get a single measurement for a channel struct _INA3221Measurement getMeasurement(ina3221_ch_t ch); diff --git a/variants/rak4631/variant.h b/variants/rak4631/variant.h index 0da1c04ea..82c914892 100644 --- a/variants/rak4631/variant.h +++ b/variants/rak4631/variant.h @@ -219,6 +219,10 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG // Testing USB detection #define NRF_APM +// If using a power chip like the INA3221 you can override the default battery voltage channel below +// and comment out NRF_APM to use the INA3221 instead of the USB detection for charging +// #define INA3221_BAT_CH INA3221_CH2 +// #define INA3221_ENV_CH INA3221_CH1 // enables 3.3V periphery like GPS or IO Module // Do not toggle this for GPS power savings From b0c53275852dc1419f4506849f9da852421671ac Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 15 Jun 2025 07:40:45 -0500 Subject: [PATCH 294/461] Trunk --- .github/pull_request_template.md | 5 +++-- boards/seeed_xiao_nrf52840_kit.json | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a15b34aae..0142c57a2 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,7 @@ ## 🙏 Thank you for sending in a pull request, here's some tips to get started! ### ❌ (Please delete all these tips and replace them with your text) ❌ + - Before starting on some new big chunk of code, it it is optional but highly recommended to open an issue first to say "Hey, I think this idea X should be implemented and I'm starting work on it. My general plan is Y, any feedback is appreciated." This will allow other devs to potentially save you time by not accidentially duplicating work etc... @@ -15,12 +16,12 @@ - If you do not have the affected hardware to test your code changes adequately against regressions, please indicate this, so that contributors and commnunity members can help test your changes. - If your PR gets accepted you can request a "Contributor" role in the Meshtastic Discord - ## 🤝 Attestations + - [ ] I have tested that my proposed changes behave as described. - [ ] I have tested that my proposed changes do not cause any obvious regressions on the following devices: - [ ] Heltec (Lora32) V3 - - [ ] LilyGo T-Deck + - [ ] LilyGo T-Deck - [ ] LilyGo T-Beam - [ ] RAK WisBlock 4631 - [ ] Seeed Studio T-1000E tracker card diff --git a/boards/seeed_xiao_nrf52840_kit.json b/boards/seeed_xiao_nrf52840_kit.json index 4c5fdbeda..676733874 100644 --- a/boards/seeed_xiao_nrf52840_kit.json +++ b/boards/seeed_xiao_nrf52840_kit.json @@ -7,9 +7,7 @@ "cpu": "cortex-m4", "extra_flags": "-DARDUINO_MDBT50Q_RX -DNRF52840_XXAA", "f_cpu": "64000000L", - "hwids": [ - ["0x2886", "0x0166"] - ], + "hwids": [["0x2886", "0x0166"]], "usb_product": "XIAO-BOOT", "mcu": "nrf52840", "variant": "seeed_xiao_nrf52840_kit", From 8f9e569825b673a21c644d3b398a8afea1ac222e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 15 Jun 2025 07:52:38 -0500 Subject: [PATCH 295/461] Create FUNDING.yml --- .github/FUNDING.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..8529eb7fc --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +open_collective: meshtastic From 8a8a7cdefc429dbf168e04f10fe31cb416ff7ab4 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 15 Jun 2025 16:36:53 -0500 Subject: [PATCH 296/461] cppcheck-supress to ignore intentional error --- bin/check-all.sh | 2 +- variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/check-all.sh b/bin/check-all.sh index d1b50a8aa..29d6b5532 100755 --- a/bin/check-all.sh +++ b/bin/check-all.sh @@ -23,4 +23,4 @@ for BOARD in $BOARDS; do CHECK="${CHECK} -e ${BOARD}" done -pio check --flags "-DAPP_VERSION=${APP_VERSION} --suppressions-list=suppressions.txt" $CHECK --skip-packages --pattern="src/" --fail-on-defect=medium --fail-on-defect=high +pio check --flags "-DAPP_VERSION=${APP_VERSION} --suppressions-list=suppressions.txt --inline-suppr" $CHECK --skip-packages --pattern="src/" --fail-on-defect=medium --fail-on-defect=high diff --git a/variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h b/variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h index 339ec3353..fe1c281bf 100644 --- a/variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h +++ b/variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h @@ -26,6 +26,7 @@ #include "graphics/niche/Inputs/TwoButton.h" #if !defined(INKHUD_BUILDCONF_DRIVER) || !defined(INKHUD_BUILDCONF_DISPLAYRESILIENCE) +// cppcheck-suppress preprocessorErrorDirective #error If not using a DIY preset, display model and resilience must be set manually #endif From fcefd592e28c3c3e34547f1dc09e413f2b299fc7 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 15 Jun 2025 19:27:17 -0500 Subject: [PATCH 297/461] Update version.properties --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index e13094769..c079fbe59 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 6 -build = 11 +build = 12 From 9861e82f0a1681a7b1c9764ddeba61250a4f4f41 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 15 Jun 2025 21:16:33 -0400 Subject: [PATCH 298/461] Manual bump metainfo version (#7049) --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 40f86fb0b..92c0384f4 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.12 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.11 From bd0e25f3f5e79c76c114117587ce352eee128c25 Mon Sep 17 00:00:00 2001 From: Taha Date: Mon, 16 Jun 2025 05:32:28 +0200 Subject: [PATCH 299/461] Fix Critical Error #3 for LilyGo T-Echo (#6791) * Fix Critical Error #3 * clang format --- variants/t-echo/variant.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/variants/t-echo/variant.h b/variants/t-echo/variant.h index 38b7f4743..3f96ffc83 100644 --- a/variants/t-echo/variant.h +++ b/variants/t-echo/variant.h @@ -139,6 +139,7 @@ External serial flash WP25R1635FZUIL0 // Not really an E22 but TTGO seems to be trying to clone that #define SX126X_DIO2_AS_RF_SWITCH #define SX126X_DIO3_TCXO_VOLTAGE 1.8 +#define TCXO_OPTIONAL // Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface // code) @@ -214,7 +215,7 @@ External serial flash WP25R1635FZUIL0 #define VBAT_AR_INTERNAL AR_INTERNAL_3_0 #define ADC_MULTIPLIER (2.0F) -#define NO_EXT_GPIO 1 +// #define NO_EXT_GPIO 1 #define HAS_RTC 1 From 465fe18a895f9f4e6d9b0cf5654257acee077419 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Mon, 16 Jun 2025 23:09:55 +1200 Subject: [PATCH 300/461] Dismiss ExternalNotification nagging on InkHUD button press (#7056) * Expose ExternalNotification::isNagging * Dismiss external notification on button press --- src/graphics/niche/InkHUD/Events.cpp | 27 +++++++++++++++++++++- src/graphics/niche/InkHUD/Events.h | 3 +++ src/modules/ExternalNotificationModule.cpp | 6 +++++ src/modules/ExternalNotificationModule.h | 2 ++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/graphics/niche/InkHUD/Events.cpp b/src/graphics/niche/InkHUD/Events.cpp index ee6c04938..109f75df5 100644 --- a/src/graphics/niche/InkHUD/Events.cpp +++ b/src/graphics/niche/InkHUD/Events.cpp @@ -4,6 +4,7 @@ #include "RTC.h" #include "modules/AdminModule.h" +#include "modules/ExternalNotificationModule.h" #include "modules/TextMessageModule.h" #include "sleep.h" @@ -37,6 +38,10 @@ void InkHUD::Events::begin() void InkHUD::Events::onButtonShort() { + // Cancel any beeping, buzzing, blinking + // Some button handling suppressed if we are dismissing an external notification (see below) + bool dismissedExt = dismissExternalNotification(); + // Check which system applet wants to handle the button press (if any) SystemApplet *consumer = nullptr; for (SystemApplet *sa : inkhud->systemApplets) { @@ -49,7 +54,7 @@ void InkHUD::Events::onButtonShort() // If no system applet is handling input, default behavior instead is to cycle applets if (consumer) consumer->onButtonShortPress(); - else + else if (!dismissedExt) // Don't change applet if this button press silenced the external notification module inkhud->nextApplet(); } @@ -204,4 +209,24 @@ int InkHUD::Events::beforeLightSleep(void *unused) } #endif +// Silence all ongoing beeping, blinking, buzzing, coming from the external notification module +// Returns true if an external notification was active, and we dismissed it +// Button handling changes depending on our result +bool InkHUD::Events::dismissExternalNotification() +{ + // Abort if not using external notifications + if (!moduleConfig.external_notification.enabled) + return false; + + // Abort if nothing to dismiss + if (!externalNotificationModule->nagging()) + return false; + + // Stop the beep buzz blink + externalNotificationModule->stopNow(); + + // Inform that we did indeed dismiss an external notification + return true; +} + #endif \ No newline at end of file diff --git a/src/graphics/niche/InkHUD/Events.h b/src/graphics/niche/InkHUD/Events.h index 489135ea3..2a2dad5dc 100644 --- a/src/graphics/niche/InkHUD/Events.h +++ b/src/graphics/niche/InkHUD/Events.h @@ -62,6 +62,9 @@ class Events CallbackObserver lightSleepObserver = CallbackObserver(this, &Events::beforeLightSleep); #endif + // End any externalNotification beeping, buzzing, blinking etc + bool dismissExternalNotification(); + // If set, InkHUD's data will be erased during onReboot bool eraseOnReboot = false; }; diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index dc17460f6..615c3590b 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -293,6 +293,12 @@ bool ExternalNotificationModule::getExternal(uint8_t index) return externalCurrentState[index]; } +// Allow other firmware components to determine whether a notification is ongoing +bool ExternalNotificationModule::nagging() +{ + return isNagging; +} + void ExternalNotificationModule::stopNow() { rtttl::stop(); diff --git a/src/modules/ExternalNotificationModule.h b/src/modules/ExternalNotificationModule.h index 841ca6de9..85950464d 100644 --- a/src/modules/ExternalNotificationModule.h +++ b/src/modules/ExternalNotificationModule.h @@ -40,6 +40,8 @@ class ExternalNotificationModule : public SinglePortModule, private concurrency: void setMute(bool mute) { isMuted = mute; } bool getMute() { return isMuted; } + bool nagging(); + void stopNow(); void handleGetRingtone(const meshtastic_MeshPacket &req, meshtastic_AdminMessage *response); From a81b41cbfb6ade220351fefecb816bae34c88b82 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 06:11:10 -0500 Subject: [PATCH 301/461] automated bumps (#7050) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 7 +++++-- version.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 92c0384f4..35a39e570 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.13 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.12 diff --git a/debian/changelog b/debian/changelog index 4b67eecd4..f7786e939 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.6.11.0) UNRELEASED; urgency=medium +meshtasticd (2.6.13.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging @@ -19,4 +19,7 @@ meshtasticd (2.6.11.0) UNRELEASED; urgency=medium [ ] * GitHub Actions Automatic version bump - -- Mon, 02 Jun 2025 20:00:55 +0000 + [ ] + * GitHub Actions Automatic version bump + + -- Mon, 16 Jun 2025 02:10:49 +0000 diff --git a/version.properties b/version.properties index c079fbe59..384df78ba 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 6 -build = 12 +build = 13 From 4f0b95e9104b86b13bf631bb7896590ac418f8d8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 06:24:26 -0500 Subject: [PATCH 302/461] Upgrade trunk (#7053) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 8bf5c6748..627e1ff0a 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,8 +8,8 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.440 - - renovate@40.51.0 + - checkov@3.2.441 + - renovate@40.53.1 - prettier@3.5.3 - trufflehog@3.89.1 - yamllint@1.37.1 From 1a6bb97f168a30c1910bbbb748335e7900670c58 Mon Sep 17 00:00:00 2001 From: Nivek-domo <123359286+Nivek-domo@users.noreply.github.com> Date: Mon, 16 Jun 2025 13:54:55 +0200 Subject: [PATCH 303/461] Fix RCWL9620Sensor for rak11310 support (#6617) * Update RCWL9620Sensor.cpp test on rak11310, work very wel now * Update RCWL9620Sensor.cpp * Trunk --------- Co-authored-by: Ben Meadors --- .../Telemetry/Sensor/RCWL9620Sensor.cpp | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/src/modules/Telemetry/Sensor/RCWL9620Sensor.cpp b/src/modules/Telemetry/Sensor/RCWL9620Sensor.cpp index e352dda8d..9f7a55cc5 100644 --- a/src/modules/Telemetry/Sensor/RCWL9620Sensor.cpp +++ b/src/modules/Telemetry/Sensor/RCWL9620Sensor.cpp @@ -41,21 +41,36 @@ void RCWL9620Sensor::begin(TwoWire *wire, uint8_t addr, uint8_t sda, uint8_t scl float RCWL9620Sensor::getDistance() { - uint32_t data; - _wire->beginTransmission(_addr); // Transfer data to addr. - _wire->write(0x01); - _wire->endTransmission(); // Stop data transmission with the Ultrasonic - // Unit. + uint32_t data = 0; + uint8_t b1 = 0, b2 = 0, b3 = 0; - _wire->requestFrom(_addr, - (uint8_t)3); // Request 3 bytes from Ultrasonic Unit. + LOG_DEBUG("[RCWL9620] Start measure command"); + + _wire->beginTransmission(_addr); + _wire->write(0x01); // À tester aussi sans cette ligne si besoin + uint8_t result = _wire->endTransmission(); + LOG_DEBUG("[RCWL9620] endTransmission result = %d", result); + delay(100); // délai pour laisser le capteur répondre + + LOG_DEBUG("[RCWL9620] Read i2c data:"); + _wire->requestFrom(_addr, (uint8_t)3); + + if (_wire->available() < 3) { + LOG_DEBUG("[RCWL9620] less than 3 octets !"); + return 0.0; + } + + b1 = _wire->read(); + b2 = _wire->read(); + b3 = _wire->read(); + + data = ((uint32_t)b1 << 16) | ((uint32_t)b2 << 8) | b3; + + float Distance = float(data) / 1000.0; + + LOG_DEBUG("[RCWL9620] Bytes readed = %02X %02X %02X", b1, b2, b3); + LOG_DEBUG("[RCWL9620] data=%.2f, level=%.2f", (double)data, (double)Distance); - data = _wire->read(); - data <<= 8; - data |= _wire->read(); - data <<= 8; - data |= _wire->read(); - float Distance = float(data) / 1000; if (Distance > 4500.00) { return 4500.00; } else { @@ -63,4 +78,4 @@ float RCWL9620Sensor::getDistance() } } -#endif \ No newline at end of file +#endif From 6374ffea35fbd598337631ad471aee830f8032ae Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 16 Jun 2025 08:52:20 -0400 Subject: [PATCH 304/461] Run daily packaging earlier (PPA) (#7057) --- .github/workflows/daily_packaging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/daily_packaging.yml b/.github/workflows/daily_packaging.yml index 11fe2043a..18939d567 100644 --- a/.github/workflows/daily_packaging.yml +++ b/.github/workflows/daily_packaging.yml @@ -1,7 +1,7 @@ name: Daily Packaging on: schedule: - - cron: 0 9 * * * + - cron: 0 2 * * * workflow_dispatch: push: branches: From cbdd7eae70ab626f92ef3888c2ed4101c3374f49 Mon Sep 17 00:00:00 2001 From: Dylanliacc Date: Mon, 16 Jun 2025 11:44:04 +0800 Subject: [PATCH 305/461] fix IIC port --- variants/seeed_wio_tracker_L1/variant.cpp | 4 ++-- variants/seeed_wio_tracker_L1/variant.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/variants/seeed_wio_tracker_L1/variant.cpp b/variants/seeed_wio_tracker_L1/variant.cpp index 6c34d63e6..a045b0cf9 100644 --- a/variants/seeed_wio_tracker_L1/variant.cpp +++ b/variants/seeed_wio_tracker_L1/variant.cpp @@ -59,8 +59,8 @@ const uint32_t g_ADigitalPinMap[] = { // D16 - Battery voltage ADC input 31, // D16 P0.31 VBAT_ADC // GROVE - 0, // D17 P0.00 GROVESDA - 1, // D18 P0.01 GROVESCL + 43, // D17 P0.00 GROVESDA + 44, // D18 P0.01 GROVESCL // FLASH 21, // D19 P0.21 (QSPI_SCK) diff --git a/variants/seeed_wio_tracker_L1/variant.h b/variants/seeed_wio_tracker_L1/variant.h index b257fd9b6..57cefa4bb 100644 --- a/variants/seeed_wio_tracker_L1/variant.h +++ b/variants/seeed_wio_tracker_L1/variant.h @@ -74,10 +74,12 @@ // Communication Interfaces // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // I2C Configuration -#define HAS_WIRE 1 +//#define HAS_WIRE 1 #define PIN_WIRE_SDA D14 // P0.09 #define PIN_WIRE_SCL D15 // P0.10 -#define WIRE_INTERFACES_COUNT 1 +#define WIRE_INTERFACES_COUNT 2 +#define PIN_WIRE1_SDA D18 +#define PIN_WIRE1_SCL D17 #define I2C_NO_RESCAN static const uint8_t SDA = PIN_WIRE_SDA; From afcd97c1547f1a42bcf191089192d8b4c6ec35f7 Mon Sep 17 00:00:00 2001 From: dylanliacc Date: Sun, 15 Jun 2025 23:28:34 -0700 Subject: [PATCH 306/461] trunk fmt --- variants/seeed_wio_tracker_L1/variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/seeed_wio_tracker_L1/variant.h b/variants/seeed_wio_tracker_L1/variant.h index 57cefa4bb..38f2b71ff 100644 --- a/variants/seeed_wio_tracker_L1/variant.h +++ b/variants/seeed_wio_tracker_L1/variant.h @@ -74,7 +74,7 @@ // Communication Interfaces // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // I2C Configuration -//#define HAS_WIRE 1 +// #define HAS_WIRE 1 #define PIN_WIRE_SDA D14 // P0.09 #define PIN_WIRE_SCL D15 // P0.10 #define WIRE_INTERFACES_COUNT 2 From aabc5b7cf2a9ae68755266d4f4308d54db511d95 Mon Sep 17 00:00:00 2001 From: Marek <118679709+Marek-mk@users.noreply.github.com> Date: Tue, 17 Jun 2025 14:18:59 +0200 Subject: [PATCH 307/461] PacketHistory debloat RAM allocations (#7034) * PacketHistory debloat RAM allocations * Removed FLOOD_EXPIRE_TIME option. We have static buffer now. * Remove mx_ prefix from recentPackets * Remember no less than 100 packet not to make reflood hell * Cleanup * PacketHistory max no less than 100 * no less than 100 means max of 100 or a given value of course. * Care to not do duplicate entries. Cleanups. --------- Co-authored-by: Ben Meadors --- src/mesh/PacketHistory.cpp | 360 +++++++++++++++++++++++++++++-------- src/mesh/PacketHistory.h | 67 ++++--- 2 files changed, 319 insertions(+), 108 deletions(-) diff --git a/src/mesh/PacketHistory.cpp b/src/mesh/PacketHistory.cpp index 15fa9cdcd..fd2218d94 100644 --- a/src/mesh/PacketHistory.cpp +++ b/src/mesh/PacketHistory.cpp @@ -7,152 +7,366 @@ #endif #include "Throttle.h" -PacketHistory::PacketHistory() +#define PACKETHISTORY_MAX \ + max((int)(MAX_NUM_NODES * 2.0), 100) // x2..3 Should suffice. Empirical setup. 16B per record malloc'ed, but no less than 100 + +#define RECENT_WARN_AGE (10 * 60 * 1000L) // Warn if the packet that gets removed was more recent than 10 min + +#define VERBOSE_PACKET_HISTORY 0 // Set to 1 for verbose logging, 2 for heavy debugging + +PacketHistory::PacketHistory(uint32_t size) : recentPacketsCapacity(0), recentPackets(NULL) // Initialize members { - recentPackets.reserve(MAX_NUM_NODES); // Prealloc the worst case # of records - to prevent heap fragmentation - // setup our periodic task + if (size < 4 || size > PACKETHISTORY_MAX) { // Copilot suggested - makes sense + LOG_WARN("Packet History - Invalid size %d, using default %d", size, PACKETHISTORY_MAX); + size = PACKETHISTORY_MAX; // Use default size if invalid + } + + // Allocate memory for the recent packets array + recentPacketsCapacity = size; + recentPackets = new PacketRecord[recentPacketsCapacity]; + if (!recentPackets) { // No logging here, console/log probably uninitialized yet. + LOG_ERROR("Packet History - Memory allocation failed for size=%d entries / %d Bytes", size, + sizeof(PacketRecord) * recentPacketsCapacity); + recentPacketsCapacity = 0; // mark allocation fail + return; // return early + } + + // Initialize the recent packets array to zero + memset(recentPackets, 0, sizeof(PacketRecord) * recentPacketsCapacity); } -/** - * Update recentBroadcasts and return true if we have already seen this packet - */ +PacketHistory::~PacketHistory() +{ + recentPacketsCapacity = 0; + delete[] recentPackets; + recentPackets = NULL; +} + +/** Update recentPackets and return true if we have already seen this packet */ bool PacketHistory::wasSeenRecently(const meshtastic_MeshPacket *p, bool withUpdate, bool *wasFallback, bool *weWereNextHop) { + if (!initOk()) { + LOG_ERROR("Packet History - Was Seen Recently: NOT INITIALIZED!"); + return false; + } + if (p->id == 0) { - LOG_DEBUG("Ignore message with zero id"); +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - Was Seen Recently: ID is 0, not a floodable message"); +#endif return false; // Not a floodable message ID, so we don't care } PacketRecord r; + memset(&r, 0, sizeof(PacketRecord)); // Initialize the record to zero + + // Save basic info from checked packet r.id = p->id; - r.sender = getFrom(p); - r.rxTimeMsec = millis(); + r.sender = getFrom(p); // If 0 then use our ID r.next_hop = p->next_hop; r.relayed_by[0] = p->relay_node; - // LOG_INFO("Add relayed_by 0x%x for id=0x%x", p->relay_node, r.id); - auto found = recentPackets.find(r); - bool seenRecently = (found != recentPackets.end()); // found not equal to .end() means packet was seen recently + r.rxTimeMsec = millis(); // + if (r.rxTimeMsec == 0) // =0 every 49.7 days? 0 is special + r.rxTimeMsec = 1; - if (seenRecently && - !Throttle::isWithinTimespanMs(found->rxTimeMsec, FLOOD_EXPIRE_TIME)) { // Check whether found packet has already expired - recentPackets.erase(found); // Erase and pretend packet has not been seen recently - found = recentPackets.end(); - seenRecently = false; - } +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - Was Seen Recently: @start s=%08x id=%08x / to=%08x nh=%02x rn=%02x / wUpd=%s / wasFb?%d wWNH?%d", + r.sender, r.id, p->to, p->next_hop, p->relay_node, withUpdate ? "YES" : "NO", wasFallback ? *wasFallback : -1, + weWereNextHop ? *weWereNextHop : -1); +#endif + + PacketRecord *found = find(r.sender, r.id); // Find the packet record in the recentPackets array + bool seenRecently = (found != NULL); // If found -> the packet was seen recently if (seenRecently) { - LOG_DEBUG("Found existing packet record for fr=0x%x,to=0x%x,id=0x%x", p->from, p->to, p->id); - uint8_t ourRelayID = nodeDB->getLastByteOfNodeNum(nodeDB->getNodeNum()); + uint8_t ourRelayID = nodeDB->getLastByteOfNodeNum(nodeDB->getNodeNum()); // Get our relay ID from our node number + if (wasFallback) { // If it was seen with a next-hop not set to us and now it's NO_NEXT_HOP_PREFERENCE, and the relayer relayed already // before, it's a fallback to flooding. If we didn't already relay and the next-hop neither, we might need to handle // it now. if (found->sender != nodeDB->getNodeNum() && found->next_hop != NO_NEXT_HOP_PREFERENCE && - found->next_hop != ourRelayID && p->next_hop == NO_NEXT_HOP_PREFERENCE && wasRelayer(p->relay_node, found) && - !wasRelayer(ourRelayID, found) && !wasRelayer(found->next_hop, found)) { + found->next_hop != ourRelayID && p->next_hop == NO_NEXT_HOP_PREFERENCE && wasRelayer(p->relay_node, *found) && + !wasRelayer(ourRelayID, *found) && + !wasRelayer( + found->next_hop, + *found)) { // If we were not the next hop and the next hop is not us, and we are not relaying this packet +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - Was Seen Recently: f=%08x id=%08x nh=%02x rn=%02x oID=%02x, wasFbk=%d-set TRUE", + p->from, p->id, p->next_hop, p->relay_node, ourRelayID, wasFallback ? *wasFallback : -1); +#endif *wasFallback = true; + } else { + // debug log only +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - Was Seen Recently: f=%08x id=%08x nh=%02x rn=%02x oID=%02x, wasFbk=%d-no change", + p->from, p->id, p->next_hop, p->relay_node, ourRelayID, wasFallback ? *wasFallback : -1); +#endif } } // Check if we were the next hop for this packet if (weWereNextHop) { - *weWereNextHop = found->next_hop == ourRelayID; + *weWereNextHop = (found->next_hop == ourRelayID); +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - Was Seen Recently: f=%08x id=%08x nh=%02x rn=%02x foundnh=%02x oID=%02x -> wWNH=%s", + p->from, p->id, p->next_hop, p->relay_node, found->next_hop, ourRelayID, (*weWereNextHop) ? "YES" : "NO"); +#endif } } if (withUpdate) { - if (found != recentPackets.end()) { // delete existing to updated timestamp and relayed_by (re-insert) + if (found != NULL) { +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - Was Seen Recently: s=%08x id=%08x nh=%02x rby=%02x %02x %02x age=%d wUpd BEFORE", + found->sender, found->id, found->next_hop, found->relayed_by[0], found->relayed_by[1], found->relayed_by[2], + millis() - found->rxTimeMsec); +#endif + // Add the existing relayed_by to the new record - for (uint8_t i = 0; i < NUM_RELAYERS - 1; i++) { - if (found->relayed_by[i]) + for (uint8_t i = 0; i < (NUM_RELAYERS - 1); i++) { + if (found->relayed_by[i] != 0) r.relayed_by[i + 1] = found->relayed_by[i]; } r.next_hop = found->next_hop; // keep the original next_hop (such that we check whether we were originally asked) - recentPackets.erase(found); // as unsorted_set::iterator is const (can't update - so re-insert..) +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - Was Seen Recently: s=%08x id=%08x nh=%02x rby=%02x %02x %02x age=%d wUpd AFTER", r.sender, + r.id, r.next_hop, r.relayed_by[0], r.relayed_by[1], r.relayed_by[2], millis() - r.rxTimeMsec); +#endif + // TODO: have direct *found entry - can modify directly without local copy _vs_ not convolute the code by this } - recentPackets.insert(r); - LOG_DEBUG("Add packet record fr=0x%x, id=0x%x", p->from, p->id); - } - - // Capacity is reerved, so only purge expired packets if recentPackets fills past 90% capacity - // Expiry is normally dealt with after having searched/found a packet (above) - if (recentPackets.size() > (MAX_NUM_NODES * 0.9)) { - clearExpiredRecentPackets(); + insert(r); // Insert or update the packet record in the history } +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - Was Seen Recently: @exit s=%08x id=%08x (to=%08x) relby=%02x %02x %02x nxthop=%02x rxT=%d " + "found?%s seenRecently?%s wUpd?%s", + r.sender, r.id, p->to, r.relayed_by[0], r.relayed_by[1], r.relayed_by[2], r.next_hop, r.rxTimeMsec, + found ? "YES" : "NO ", seenRecently ? "YES" : "NO ", withUpdate ? "YES" : "NO "); +#endif return seenRecently; } -/** - * Iterate through all recent packets, and remove all older than FLOOD_EXPIRE_TIME - */ -void PacketHistory::clearExpiredRecentPackets() +/** Find a packet record in history. + * @return pointer to PacketRecord if found, NULL if not found */ +PacketHistory::PacketRecord *PacketHistory::find(NodeNum sender, PacketId id) { - LOG_DEBUG("recentPackets size=%ld", recentPackets.size()); + if (sender == 0 || id == 0) { +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - find: s=%08x id=%08x sender/id=0->NOT FOUND", sender, id); +#endif + return NULL; + } - for (auto it = recentPackets.begin(); it != recentPackets.end();) { - if (!Throttle::isWithinTimespanMs(it->rxTimeMsec, FLOOD_EXPIRE_TIME)) { - it = recentPackets.erase(it); // erase returns iterator pointing to element immediately following the one erased - } else { - ++it; + PacketRecord *it = NULL; + for (it = recentPackets; it < (recentPackets + recentPacketsCapacity); ++it) { + if (it->id == id && it->sender == sender) { +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - find: s=%08x id=%08x FOUND nh=%02x rby=%02x %02x %02x age=%d slot=%d/%d", it->sender, + it->id, it->next_hop, it->relayed_by[0], it->relayed_by[1], it->relayed_by[2], millis() - (it->rxTimeMsec), + it - recentPackets, recentPacketsCapacity); +#endif + // only the first match is returned, so be careful not to create duplicate entries + return it; // Return pointer to the found record } } - LOG_DEBUG("recentPackets size=%ld (after clearing expired packets)", recentPackets.size()); +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - find: s=%08x id=%08x NOT FOUND", sender, id); +#endif + return NULL; // Not found +} + +/** Insert/Replace oldest PacketRecord in recentPackets. */ +void PacketHistory::insert(PacketRecord &r) +{ + uint32_t now_millis = millis(); // Should not jump with time changes + uint32_t OldtrxTimeMsec = 0; + PacketRecord *tu = NULL; // Will insert here. + PacketRecord *it = NULL; + + // Find a free, matching or oldest used slot in the recentPackets array + for (it = recentPackets; it < (recentPackets + recentPacketsCapacity); ++it) { + if (it->id == 0 && it->sender == 0 /*&& rxTimeMsec == 0*/) { // Record is empty + tu = it; // Remember the free slot +#if VERBOSE_PACKET_HISTORY >= 2 + LOG_DEBUG("Packet History - insert: Free slot@ %d/%d", tu - recentPackets, recentPacketsCapacity); +#endif + // We have that, Exit the loop + it = (recentPackets + recentPacketsCapacity); + } else if (it->id == r.id && it->sender == r.sender) { // Record matches the packet we want to insert + tu = it; // Remember the matching slot + OldtrxTimeMsec = now_millis - it->rxTimeMsec; // ..and save current entry's age +#if VERBOSE_PACKET_HISTORY >= 2 + LOG_DEBUG("Packet History - insert: Matched slot@ %d/%d age=%d", tu - recentPackets, recentPacketsCapacity, + OldtrxTimeMsec); +#endif + // We have that, Exit the loop + it = (recentPackets + recentPacketsCapacity); + } else { + if (it->rxTimeMsec == 0) { + LOG_WARN( + "Packet History - insert: Found packet s=%08x id=%08x with rxTimeMsec = 0, slot %d/%d. Should never happen!", + it->sender, it->id, it - recentPackets, recentPacketsCapacity); + } + if ((now_millis - it->rxTimeMsec) > OldtrxTimeMsec) { // 49.7 days rollover friendly + OldtrxTimeMsec = now_millis - it->rxTimeMsec; + tu = it; // remember the oldest packet +#if VERBOSE_PACKET_HISTORY >= 2 + LOG_DEBUG("Packet History - insert: Older slot@ %d/%d age=%d", tu - recentPackets, recentPacketsCapacity, + OldtrxTimeMsec); +#endif + } + // keep looking for oldest till entire array is checked + } + } + + if (tu == NULL) { + LOG_ERROR("Packet History - insert: No free slot, no matched packet, no oldest to reuse. Something leaked."); // mx + // assert(false); // This should never happen, we should always have at least one packet to clear + return; // Return early if we can't update the history + } + +#if VERBOSE_PACKET_HISTORY + if (tu->id == 0 && tu->sender == 0) { + LOG_DEBUG("Packet History - insert: slot@ %d/%d is NEW", tu - recentPackets, recentPacketsCapacity); + } else if (tu->id == r.id && tu->sender == r.sender) { + LOG_DEBUG("Packet History - insert: slot@ %d/%d MATCHED, age=%d", tu - recentPackets, recentPacketsCapacity, + OldtrxTimeMsec); + } else { + LOG_DEBUG("Packet History - insert: slot@ %d/%d REUSE OLDEST, age=%d", tu - recentPackets, recentPacketsCapacity, + OldtrxTimeMsec); + } +#endif + + // If we are reusing a slot, we should warn if the packet is too recent +#if RECENT_WARN_AGE > 0 + if (tu->rxTimeMsec && (OldtrxTimeMsec < RECENT_WARN_AGE)) { + if (!(tu->id == r.id && tu->sender == r.sender)) { + LOG_WARN("Packet History - insert: Reusing slot aged %ds < %ds RECENT_WARN_AGE", OldtrxTimeMsec / 1000, + RECENT_WARN_AGE / 1000); + } else { + // debug only +#if VERBOSE_PACKET_HISTORY + LOG_WARN("Packet History - insert: Reusing slot aged %.3fs < %ds with MATCHED PACKET - this is normal", + OldtrxTimeMsec / 1000., RECENT_WARN_AGE / 1000); +#endif + } + } +#endif + +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - insert: Store slot@ %d/%d s=%08x id=%08x nh=%02x rby=%02x %02x %02x rxT=%d BEFORE", + tu - recentPackets, recentPacketsCapacity, tu->sender, tu->id, tu->next_hop, tu->relayed_by[0], tu->relayed_by[1], + tu->relayed_by[2], tu->rxTimeMsec); +#endif + + if (r.rxTimeMsec == 0) { + LOG_WARN("Packet History - insert: I will not store packet with rxTimeMsec = 0."); + return; // Return early if we can't update the history + } + + *tu = r; // store the packet + +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - insert: Store slot@ %d/%d s=%08x id=%08x nh=%02x rby=%02x %02x %02x rxT=%d AFTER", + tu - recentPackets, recentPacketsCapacity, tu->sender, tu->id, tu->next_hop, tu->relayed_by[0], tu->relayed_by[1], + tu->relayed_by[2], tu->rxTimeMsec); +#endif } /* Check if a certain node was a relayer of a packet in the history given an ID and sender * @return true if node was indeed a relayer, false if not */ bool PacketHistory::wasRelayer(const uint8_t relayer, const uint32_t id, const NodeNum sender) { - if (relayer == 0) - return false; - - PacketRecord r = {.sender = sender, .id = id, .rxTimeMsec = 0, .next_hop = 0}; - auto found = recentPackets.find(r); - - if (found == recentPackets.end()) { + if (!initOk()) { + LOG_ERROR("PacketHistory - wasRelayer: NOT INITIALIZED!"); return false; } - return wasRelayer(relayer, found); + if (relayer == 0) { +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - was relayer: s=%08x id=%08x / rl=%02x=zero. NO", sender, id, relayer); +#endif + return false; + } + + PacketRecord *found = find(sender, id); + + if (found == NULL) { +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - was relayer: s=%08x id=%08x / rl=%02x / PR not found. NO", sender, id, relayer); +#endif + return false; + } + +#if VERBOSE_PACKET_HISTORY >= 2 + LOG_DEBUG("Packet History - was relayer: s=%08x id=%08x nh=%02x age=%d rls=%02x %02x %02x InHistory,check:%02x", + found->sender, found->id, found->next_hop, millis() - found->rxTimeMsec, found->relayed_by[0], found->relayed_by[1], + found->relayed_by[2], relayer); +#endif + return wasRelayer(relayer, *found); } /* Check if a certain node was a relayer of a packet in the history given iterator * @return true if node was indeed a relayer, false if not */ -bool PacketHistory::wasRelayer(const uint8_t relayer, std::unordered_set::iterator r) +bool PacketHistory::wasRelayer(const uint8_t relayer, PacketRecord &r) { for (uint8_t i = 0; i < NUM_RELAYERS; i++) { - if (r->relayed_by[i] == relayer) { + if (r.relayed_by[i] == relayer) { +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - was rel.PR.: s=%08x id=%08x rls=%02x %02x %02x / rl=%02x? YES", r.sender, r.id, + r.relayed_by[0], r.relayed_by[1], r.relayed_by[2], relayer); +#endif return true; } } +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - was rel.PR.: s=%08x id=%08x rls=%02x %02x %02x / rl=%02x? NO", r.sender, r.id, r.relayed_by[0], + r.relayed_by[1], r.relayed_by[2], relayer); +#endif return false; } // Remove a relayer from the list of relayers of a packet in the history given an ID and sender void PacketHistory::removeRelayer(const uint8_t relayer, const uint32_t id, const NodeNum sender) { - PacketRecord r = {.sender = sender, .id = id, .rxTimeMsec = 0, .next_hop = 0}; - auto found = recentPackets.find(r); - - if (found == recentPackets.end()) { + if (!initOk()) { + LOG_ERROR("Packet History - remove Relayer: NOT INITIALIZED!"); return; } - // Make a copy of the found record - r.next_hop = found->next_hop; - r.rxTimeMsec = found->rxTimeMsec; - // Only add the relayers that are not the one we want to remove - uint8_t j = 0; - for (uint8_t i = 0; i < NUM_RELAYERS; i++) { - if (found->relayed_by[i] != relayer) { - r.relayed_by[j] = found->relayed_by[i]; - j++; - } + PacketRecord *found = find(sender, id); + if (found == NULL) { +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - remove Relayer s=%08x id=%08x (rl=%02x) NOT FOUND", sender, id, relayer); +#endif + return; // Nothing to remove } - recentPackets.erase(found); - recentPackets.insert(r); -} \ No newline at end of file +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - remove Relayer s=%08x id=%08x rby=%02x %02x %02x, rl:%02x BEFORE", found->sender, found->id, + found->relayed_by[0], found->relayed_by[1], found->relayed_by[2], relayer); +#endif + + // nexthop and rxTimeMsec too stay in found entry + + uint8_t j = 0; + uint8_t i = 0; + for (; i < NUM_RELAYERS; i++) { + if (found->relayed_by[i] != relayer) { + found->relayed_by[j] = found->relayed_by[i]; + j++; + } else + found->relayed_by[i] = 0; + } + for (; j < NUM_RELAYERS; j++) { // Clear the rest of the relayed_by array + found->relayed_by[j] = 0; + } + +#if VERBOSE_PACKET_HISTORY + LOG_DEBUG("Packet History - remove Relayer s=%08x id=%08x rby=%02x %02x %02x rl:%02x AFTER - removed?%d", found->sender, + found->id, found->relayed_by[0], found->relayed_by[1], found->relayed_by[2], relayer, i != j); +#endif +} diff --git a/src/mesh/PacketHistory.h b/src/mesh/PacketHistory.h index db7698f5b..d06c9bd2f 100644 --- a/src/mesh/PacketHistory.h +++ b/src/mesh/PacketHistory.h @@ -1,49 +1,47 @@ #pragma once #include "NodeDB.h" -#include - -/// We clear our old flood record 10 minutes after we see the last of it -#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -#define FLOOD_EXPIRE_TIME (5 * 1000L) // Don't allow too many packets to accumulate when fuzzing. -#else -#define FLOOD_EXPIRE_TIME (10 * 60 * 1000L) -#endif #define NUM_RELAYERS \ 3 // Number of relayer we keep track of. Use 3 to be efficient with memory alignment of PacketRecord to 16 bytes -/** - * A record of a recent message broadcast - */ -struct PacketRecord { - NodeNum sender; - PacketId id; - uint32_t rxTimeMsec; // Unix time in msecs - the time we received it - uint8_t next_hop; // The next hop asked for this packet - uint8_t relayed_by[NUM_RELAYERS]; // Array of nodes that relayed this packet - - bool operator==(const PacketRecord &p) const { return sender == p.sender && id == p.id; } -}; - -class PacketRecordHashFunction -{ - public: - size_t operator()(const PacketRecord &p) const { return (std::hash()(p.sender)) ^ (std::hash()(p.id)); } -}; - /** * This is a mixin that adds a record of past packets we have seen */ class PacketHistory { private: - std::unordered_set recentPackets; + struct PacketRecord { // A record of a recent message broadcast, no need to be visible outside this class. + NodeNum sender; + PacketId id; + uint32_t rxTimeMsec; // Unix time in msecs - the time we received it, 0 means empty + uint8_t next_hop; // The next hop asked for this packet + uint8_t relayed_by[NUM_RELAYERS]; // Array of nodes that relayed this packet + }; // 4B + 4B + 4B + 1B + 3B = 16B - void clearExpiredRecentPackets(); // clear all recentPackets older than FLOOD_EXPIRE_TIME + uint32_t recentPacketsCapacity = + 0; // Can be set in constructor, no need to recompile. Used to allocate memory for mx_recentPackets. + PacketRecord *recentPackets = NULL; // Simple and fixed in size. Debloat. + /** Find a packet record in history. + * @param sender NodeNum + * @param id PacketId + * @return pointer to PacketRecord if found, NULL if not found */ + PacketRecord *find(NodeNum sender, PacketId id); + + /** Insert/Replace oldest PacketRecord in mx_recentPackets. + * @param r PacketRecord to insert or replace */ + void insert(PacketRecord &r); // Insert or replace a packet record in the history + + /* Check if a certain node was a relayer of a packet in the history given iterator + * @return true if node was indeed a relayer, false if not */ + bool wasRelayer(const uint8_t relayer, PacketRecord &r); + + PacketHistory(const PacketHistory &); // non construction-copyable + PacketHistory &operator=(const PacketHistory &); // non copyable public: - PacketHistory(); + explicit PacketHistory(uint32_t size = -1); // Constructor with size parameter, default is PACKETHISTORY_MAX + ~PacketHistory(); /** * Update recentBroadcasts and return true if we have already seen this packet @@ -59,10 +57,9 @@ class PacketHistory * @return true if node was indeed a relayer, false if not */ bool wasRelayer(const uint8_t relayer, const uint32_t id, const NodeNum sender); - /* Check if a certain node was a relayer of a packet in the history given iterator - * @return true if node was indeed a relayer, false if not */ - bool wasRelayer(const uint8_t relayer, std::unordered_set::iterator r); - // Remove a relayer from the list of relayers of a packet in the history given an ID and sender void removeRelayer(const uint8_t relayer, const uint32_t id, const NodeNum sender); -}; \ No newline at end of file + + // To check if the PacketHistory was initialized correctly by constructor + bool initOk(void) { return recentPackets != NULL && recentPacketsCapacity != 0; } +}; From 3ab9005b2f20a5b36a94da6c4be7e1b037f5cda8 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 17 Jun 2025 11:11:36 -0500 Subject: [PATCH 308/461] Make sure host_metrics user_string is null terminated --- src/modules/Telemetry/HostMetrics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/Telemetry/HostMetrics.cpp b/src/modules/Telemetry/HostMetrics.cpp index 9a9d8fecc..2ac8cd03f 100644 --- a/src/modules/Telemetry/HostMetrics.cpp +++ b/src/modules/Telemetry/HostMetrics.cpp @@ -111,7 +111,8 @@ meshtastic_Telemetry HostMetricsModule::getHostMetrics() if (settingsStrings[hostMetrics_user_command] != "") { std::string userCommandResult = exec(settingsStrings[hostMetrics_user_command].c_str()); if (userCommandResult.length() > 1) { - strncpy(t.variant.host_metrics.user_string, userCommandResult.c_str(), 200); + strncpy(t.variant.host_metrics.user_string, userCommandResult.c_str(), sizeof(t.variant.host_metrics.user_string)); + t.variant.host_metrics.user_string[ sizeof(t.variant.host_metrics.user_string) - 1] = '\0'; t.variant.host_metrics.has_user_string = true; } } From 20991d8b531d9ab6dbdcb2a56540febdd43e178e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Vesel=C3=BD?= Date: Wed, 18 Jun 2025 13:19:52 +0200 Subject: [PATCH 309/461] Add recognition for SHT40 with serial number starting with 0xc8d (#7061) * Add recognition for SHT40 with serial number starting with 0xc8d * fix a dumb typo :/ --- src/detect/ScanI2CTwoWire.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index e2ba78a92..22370ff4c 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -358,7 +358,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) case SHT31_4x_ADDR: // same as OPT3001_ADDR_ALT case SHT31_4x_ADDR_ALT: // same as OPT3001_ADDR registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x89), 2); - if (registerValue == 0x11a2 || registerValue == 0x11da || registerValue == 0xe9c) { + if (registerValue == 0x11a2 || registerValue == 0x11da || registerValue == 0xe9c || registerValue == 0xc8d) { type = SHT4X; logFoundDevice("SHT4X", (uint8_t)addr.address); } else if (getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x7E), 2) == 0x5449) { From 89a4589b68e12089a13fbb797fdf9d8aec8acce1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 06:20:10 -0500 Subject: [PATCH 310/461] Upgrade trunk (#7060) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 627e1ff0a..6e99077c1 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,12 +8,12 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.441 - - renovate@40.53.1 + - checkov@3.2.442 + - renovate@40.59.4 - prettier@3.5.3 - - trufflehog@3.89.1 + - trufflehog@3.89.2 - yamllint@1.37.1 - - bandit@1.8.3 + - bandit@1.8.5 - trivy@0.63.0 - taplo@0.9.3 - ruff@0.11.13 From 5e921453240b2d1be6a85c2dbaa35b5f1b1493c4 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 18 Jun 2025 16:41:43 -0500 Subject: [PATCH 311/461] Ensure incoming hostMetrics userstring is null terminated (#7068) * Ensure incoming hostMetrics userstring is null terminated * Only null terminate user_string when has_user_string is true --- src/modules/Telemetry/HostMetrics.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/Telemetry/HostMetrics.cpp b/src/modules/Telemetry/HostMetrics.cpp index 2ac8cd03f..b53932deb 100644 --- a/src/modules/Telemetry/HostMetrics.cpp +++ b/src/modules/Telemetry/HostMetrics.cpp @@ -29,6 +29,8 @@ bool HostMetricsModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, if (t->which_variant == meshtastic_Telemetry_host_metrics_tag) { #ifdef DEBUG_PORT const char *sender = getSenderShortName(mp); + if (t->variant.host_metrics.has_user_string) + t->variant.host_metrics.user_string[sizeof(t->variant.host_metrics.user_string) - 1] = '\0'; LOG_INFO("(Received Host Metrics from %s): uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f, %s", sender, t->variant.host_metrics.uptime_seconds, t->variant.host_metrics.diskfree1_bytes, @@ -112,7 +114,7 @@ meshtastic_Telemetry HostMetricsModule::getHostMetrics() std::string userCommandResult = exec(settingsStrings[hostMetrics_user_command].c_str()); if (userCommandResult.length() > 1) { strncpy(t.variant.host_metrics.user_string, userCommandResult.c_str(), sizeof(t.variant.host_metrics.user_string)); - t.variant.host_metrics.user_string[ sizeof(t.variant.host_metrics.user_string) - 1] = '\0'; + t.variant.host_metrics.user_string[sizeof(t.variant.host_metrics.user_string) - 1] = '\0'; t.variant.host_metrics.has_user_string = true; } } From f71fdef3fda0a918cfdb23eb2131db3ca299acfd Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 19 Jun 2025 17:05:22 -0500 Subject: [PATCH 312/461] Update HostMetrics.cpp - don't try to print the user string (#7081) * Update HostMetrics.cpp - don't try to print the user string * Make Trunk Happy --- src/modules/Telemetry/HostMetrics.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/Telemetry/HostMetrics.cpp b/src/modules/Telemetry/HostMetrics.cpp index b53932deb..6a92b15f8 100644 --- a/src/modules/Telemetry/HostMetrics.cpp +++ b/src/modules/Telemetry/HostMetrics.cpp @@ -32,12 +32,12 @@ bool HostMetricsModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, if (t->variant.host_metrics.has_user_string) t->variant.host_metrics.user_string[sizeof(t->variant.host_metrics.user_string) - 1] = '\0'; - LOG_INFO("(Received Host Metrics from %s): uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f, %s", - sender, t->variant.host_metrics.uptime_seconds, t->variant.host_metrics.diskfree1_bytes, + LOG_INFO("(Received Host Metrics from %s): uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f", sender, + t->variant.host_metrics.uptime_seconds, t->variant.host_metrics.diskfree1_bytes, t->variant.host_metrics.freemem_bytes, static_cast(t->variant.host_metrics.load1) / 100, static_cast(t->variant.host_metrics.load5) / 100, - static_cast(t->variant.host_metrics.load15) / 100, - t->variant.host_metrics.has_user_string ? t->variant.host_metrics.user_string : ""); + static_cast(t->variant.host_metrics.load15) / 100); + // t->variant.host_metrics.has_user_string ? t->variant.host_metrics.user_string : ""); #endif } return false; // Let others look at this message also if they want @@ -124,12 +124,12 @@ meshtastic_Telemetry HostMetricsModule::getHostMetrics() bool HostMetricsModule::sendMetrics() { meshtastic_Telemetry telemetry = getHostMetrics(); - LOG_INFO("Send: uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f %s", + LOG_INFO("Send: uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f", telemetry.variant.host_metrics.uptime_seconds, telemetry.variant.host_metrics.diskfree1_bytes, telemetry.variant.host_metrics.freemem_bytes, static_cast(telemetry.variant.host_metrics.load1) / 100, static_cast(telemetry.variant.host_metrics.load5) / 100, - static_cast(telemetry.variant.host_metrics.load15) / 100, - telemetry.variant.host_metrics.has_user_string ? telemetry.variant.host_metrics.user_string : ""); + static_cast(telemetry.variant.host_metrics.load15) / 100); + // telemetry.variant.host_metrics.has_user_string ? telemetry.variant.host_metrics.user_string : ""); meshtastic_MeshPacket *p = allocDataProtobuf(telemetry); p->to = NODENUM_BROADCAST; @@ -140,4 +140,4 @@ bool HostMetricsModule::sendMetrics() service->sendToMesh(p, RX_SRC_LOCAL, true); return true; } -#endif \ No newline at end of file +#endif From e9d5e3673855cc38e9b2ba1d6818b64d07145b67 Mon Sep 17 00:00:00 2001 From: Matt Smith Date: Thu, 19 Jun 2025 19:18:55 -0400 Subject: [PATCH 313/461] Replace blocking delay for wifi reconnect with non-blocking to keep button/display interactivity (#6983) * Update WiFiAPClient.cpp to replace blocking delay() with non-blocking * Update WiFiAPClient.cpp - fix extra endif * Update WiFiAPClient.cpp remove duplicate section * Update WiFiAPClient.cpp * Update trunk_annotate_pr.yml * Update trunk_annotate_pr.yml * Update trunk_check.yml * Update trunk_check.yml * Update trunk_format_pr.yml * Update trunk_annotate_pr.yml * Attempted to address comments, and fix my other mess. Thanks for your patience. * Revert "Update trunk_annotate_pr.yml" This reverts commit 7db4ff6444df0a5271d3d5df49ebfb54024ac18f. * Last mess cleanups (hopefully) * Undid trunk.yaml changes * Trunk format --------- Co-authored-by: Ben Meadors Co-authored-by: Tom Fifield --- src/mesh/wifi/WiFiAPClient.cpp | 35 ++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/mesh/wifi/WiFiAPClient.cpp b/src/mesh/wifi/WiFiAPClient.cpp index 945460c28..115817aab 100644 --- a/src/mesh/wifi/WiFiAPClient.cpp +++ b/src/mesh/wifi/WiFiAPClient.cpp @@ -46,6 +46,10 @@ uint8_t wifiDisconnectReason = 0; // Stores our hostname char ourHost[16]; +// To replace blocking wifi connect delay with a non-blocking sleep +static unsigned long wifiReconnectStartMillis = 0; +static bool wifiReconnectPending = false; + bool APStartupComplete = 0; unsigned long lastrun_ntp = 0; @@ -160,17 +164,30 @@ static int32_t reconnectWiFi() #endif LOG_INFO("Reconnecting to WiFi access point %s", wifiName); - delay(5000); + // Start the non-blocking wait for 5 seconds + wifiReconnectStartMillis = millis(); + wifiReconnectPending = true; + // Do not attempt to connect yet, wait for the next invocation + return 5000; // Schedule next check soon + } - if (!WiFi.isConnected()) { + // Check if we are ready to proceed with the WiFi connection after the 5s wait + if (wifiReconnectPending) { + if (millis() - wifiReconnectStartMillis >= 5000) { + if (!WiFi.isConnected()) { #ifdef CONFIG_IDF_TARGET_ESP32C3 - WiFi.mode(WIFI_MODE_NULL); - WiFi.useStaticBuffers(true); - WiFi.mode(WIFI_STA); + WiFi.mode(WIFI_MODE_NULL); + WiFi.useStaticBuffers(true); + WiFi.mode(WIFI_STA); #endif - WiFi.begin(wifiName, wifiPsw); + WiFi.begin(wifiName, wifiPsw); + } + isReconnecting = false; + wifiReconnectPending = false; + } else { + // Still waiting for 5s to elapse + return 100; // Check again soon } - isReconnecting = false; } #ifndef DISABLE_NTP @@ -193,8 +210,6 @@ static int32_t reconnectWiFi() if (config.network.wifi_enabled && !WiFi.isConnected()) { #ifdef ARCH_RP2040 // (ESP32 handles this in WiFiEvent) - /* If APStartupComplete, but we're not connected, try again. - Shouldn't try again before APStartupComplete. */ needReconnect = APStartupComplete; #endif return 1000; // check once per second @@ -486,4 +501,4 @@ uint8_t getWifiDisconnectReason() { return wifiDisconnectReason; } -#endif +#endif // HAS_WIFI \ No newline at end of file From 56e67cb434ffb156b6b29b2091300d978e279049 Mon Sep 17 00:00:00 2001 From: Jeremiah K <17190268+jeremiah-k@users.noreply.github.com> Date: Thu, 19 Jun 2025 18:20:20 -0500 Subject: [PATCH 314/461] Fix position exchange throttling issue (#7079) * Fix position exchange throttling race condition Separate tracking of position broadcasts vs replies to fix exchange position functionality. Previously, allocReply() would refuse to send position replies if any position packet (broadcast or reply) was sent within the last 3 minutes. This caused the exchange position feature to fail when a device had recently sent a position broadcast. Changes: - Add lastSentReply member to track position reply timestamps separately - Update allocReply() to only throttle based on previous replies, not broadcasts - This allows position exchange to work even after recent position broadcasts The fix maintains the 3-minute throttling for replies to prevent spam while allowing legitimate position exchange functionality to work properly. * Remove unused lastSentToMesh variable Variable was no longer used after separating reply throttling logic. --- src/modules/PositionModule.cpp | 14 +++++++++----- src/modules/PositionModule.h | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index 0b1bdcc46..c34c725c0 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -265,7 +265,6 @@ meshtastic_MeshPacket *PositionModule::allocPositionPacket() } LOG_INFO("Position packet: time=%i lat=%i lon=%i", p.time, p.latitude_i, p.longitude_i); - lastSentToMesh = millis(); // TAK Tracker devices should send their position in a TAK packet over the ATAK port if (config.device.role == meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) @@ -276,13 +275,18 @@ meshtastic_MeshPacket *PositionModule::allocPositionPacket() meshtastic_MeshPacket *PositionModule::allocReply() { - if (config.device.role != meshtastic_Config_DeviceConfig_Role_LOST_AND_FOUND && lastSentToMesh && - Throttle::isWithinTimespanMs(lastSentToMesh, 3 * 60 * 1000)) { - LOG_DEBUG("Skip Position reply since we sent it <3min ago"); + if (config.device.role != meshtastic_Config_DeviceConfig_Role_LOST_AND_FOUND && lastSentReply && + Throttle::isWithinTimespanMs(lastSentReply, 3 * 60 * 1000)) { + LOG_DEBUG("Skip Position reply since we sent a reply <3min ago"); ignoreRequest = true; // Mark it as ignored for MeshModule return nullptr; } - return allocPositionPacket(); + + meshtastic_MeshPacket *reply = allocPositionPacket(); + if (reply) { + lastSentReply = millis(); // Track when we sent this reply + } + return reply; } meshtastic_MeshPacket *PositionModule::allocAtakPli() diff --git a/src/modules/PositionModule.h b/src/modules/PositionModule.h index dc732a3db..b9fd527c9 100644 --- a/src/modules/PositionModule.h +++ b/src/modules/PositionModule.h @@ -63,7 +63,7 @@ class PositionModule : public ProtobufModule, private concu void sendLostAndFoundText(); bool hasQualityTimesource(); bool hasGPS(); - uint32_t lastSentToMesh = 0; // Last time we sent our position to the mesh + uint32_t lastSentReply = 0; // Last time we sent a position reply (used for reply throttling only) const uint32_t minimumTimeThreshold = Default::getConfiguredOrDefaultMs(config.position.broadcast_smart_minimum_interval_secs, 30); From db1eac12af97379e5a3c428bf06b52c87080944f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Jun 2025 09:22:03 +1000 Subject: [PATCH 315/461] Upgrade trunk (#7073) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 6e99077c1..b40f9458b 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,14 +9,14 @@ plugins: lint: enabled: - checkov@3.2.442 - - renovate@40.59.4 + - renovate@40.60.3 - prettier@3.5.3 - trufflehog@3.89.2 - yamllint@1.37.1 - bandit@1.8.5 - trivy@0.63.0 - taplo@0.9.3 - - ruff@0.11.13 + - ruff@0.12.0 - isort@6.0.1 - markdownlint@0.45.0 - oxipng@9.1.5 From 2c206febab7b1af6de031056166190d149f5043a Mon Sep 17 00:00:00 2001 From: Hannes Fuchs Date: Fri, 20 Jun 2025 01:48:22 +0200 Subject: [PATCH 316/461] Fix nugget s3 lora variant issues (#7070) * Fix serial communication for nugget s3 lora Without setting `ARDUINO_USB_CDC_ON_BOOT=1` the serial interface on the nugget s3 lora board does not work. * Fix nugget s3 lora variant definitions --- variants/nugget_s3_lora/platformio.ini | 4 ++-- variants/nugget_s3_lora/variant.h | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/variants/nugget_s3_lora/platformio.ini b/variants/nugget_s3_lora/platformio.ini index 729a3ef23..1085d633b 100644 --- a/variants/nugget_s3_lora/platformio.ini +++ b/variants/nugget_s3_lora/platformio.ini @@ -2,5 +2,5 @@ extends = esp32s3_base board = lolin_s3_mini board_level = extra -build_flags = - ${esp32s3_base.build_flags} -D PRIVATE_HW -I variants/nugget_s3_lora \ No newline at end of file +build_flags = + ${esp32s3_base.build_flags} -D ARDUINO_USB_CDC_ON_BOOT=1 -D PRIVATE_HW -I variants/nugget_s3_lora diff --git a/variants/nugget_s3_lora/variant.h b/variants/nugget_s3_lora/variant.h index 488fe4e44..8e6057d5b 100644 --- a/variants/nugget_s3_lora/variant.h +++ b/variants/nugget_s3_lora/variant.h @@ -1,5 +1,8 @@ -#define I2C_SDA 34 // I2C pins for this board -#define I2C_SCL 38 +#define I2C_SDA 35 // I2C pins for this board +#define I2C_SCL 36 + +#define USE_SSD1306 +#define DISPLAY_FLIP_SCREEN #define LED_PIN 15 // If defined we will blink this LED @@ -8,7 +11,8 @@ #define NEOPIXEL_DATA 10 // gpio pin used to send data to the neopixels #define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use -#define BUTTON_PIN 0 // If defined, this will be used for user button presses +// Button A (44), B (43), R (12), U (13), L (11), D (18) +#define BUTTON_PIN 44 // If defined, this will be used for user button presses #define BUTTON_NEED_PULLUP #define USE_RF95 From 8be76a56c7a9ec8d9455539a9c43d6676a5d2495 Mon Sep 17 00:00:00 2001 From: Marek <118679709+Marek-mk@users.noreply.github.com> Date: Fri, 20 Jun 2025 01:48:35 +0200 Subject: [PATCH 317/461] PacketHistory - option to track entries' aging to log (#7067) * PacketHistory debloat RAM allocations * Removed FLOOD_EXPIRE_TIME option. We have static buffer now. * Remove mx_ prefix from recentPackets * Remember no less than 100 packet not to make reflood hell * Cleanup * PacketHistory max no less than 100 * no less than 100 means max of 100 or a given value of course. * Care to not do duplicate entries. Cleanups. * Packet History - option to log aging of entries * Update comments for PACKET_HISTORY_TRACE_AGING and VERBOSE_PACKET_HISTORY definitions --------- Co-authored-by: Ben Meadors --- src/mesh/PacketHistory.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mesh/PacketHistory.cpp b/src/mesh/PacketHistory.cpp index fd2218d94..6b8ccde76 100644 --- a/src/mesh/PacketHistory.cpp +++ b/src/mesh/PacketHistory.cpp @@ -12,7 +12,8 @@ #define RECENT_WARN_AGE (10 * 60 * 1000L) // Warn if the packet that gets removed was more recent than 10 min -#define VERBOSE_PACKET_HISTORY 0 // Set to 1 for verbose logging, 2 for heavy debugging +#define VERBOSE_PACKET_HISTORY 0 // Set to 1 for verbose logging, 2 for heavy debugging +#define PACKET_HISTORY_TRACE_AGING 1 // Set to 1 to enable logging of the age of re/used history slots PacketHistory::PacketHistory(uint32_t size) : recentPacketsCapacity(0), recentPackets(NULL) // Initialize members { @@ -254,6 +255,16 @@ void PacketHistory::insert(PacketRecord &r) #endif } } + +#if PACKET_HISTORY_TRACE_AGING + if (tu->rxTimeMsec != 0) { + LOG_INFO("Packet History - insert: Reusing slot aged %.3fs TRACE %s", OldtrxTimeMsec / 1000., + (tu->id == r.id && tu->sender == r.sender) ? "MATCHED PACKET" : "OLDEST SLOT"); + } else { + LOG_INFO("Packet History - insert: Using new slot @uptime %.3fs TRACE NEW", millis() / 1000.); + } +#endif + #endif #if VERBOSE_PACKET_HISTORY From 2fb46ce5d54d3dc91f1b960254f512a47b1166bf Mon Sep 17 00:00:00 2001 From: "Justin E. Mann" Date: Thu, 19 Jun 2025 17:51:03 -0600 Subject: [PATCH 318/461] Add rak12035 VB Soil Monitor Tested & Working (#6741) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [WIP] Add RAK12035VB Soil Moisture Sensor support Introduce the RAK12035 sensor as an environmental telemetry sensor, including necessary calibration checks and default values. Update relevant files to integrate the sensor into the existing telemetry system. This hardware is not just one module, but a couple.. RAK12023 and RAK12035 is the component stack, the RAK12023 does not seem to matter much and allows for multiple RAK12035 devices to be used. Co-Authored-By: @Justin-Mann * [WIP] Add RAK12035VB Soil Moisture Sensor support Introduce the RAK12035 sensor as an environmental telemetry sensor, including necessary calibration checks and default values. Update relevant files to integrate the sensor into the existing telemetry system. This hardware is not just one module, but a couple.. RAK12023 and RAK12035 is the component stack, the RAK12023 does not seem to matter much and allows for multiple RAK12035 devices to be used. Co-Authored-By: @Justin-Mann * [WIP] Add RAK12035VB Soil Moisture Sensor support Introduce the RAK12035 sensor as an environmental telemetry sensor, including necessary calibration checks and default values. Update relevant files to integrate the sensor into the existing telemetry system. This hardware is not just one module, but a couple.. RAK12023 and RAK12035 is the component stack, the RAK12023 does not seem to matter much and allows for multiple RAK12035 devices to be used. Co-Authored-By: @Justin-Mann * [WIP] Add RAK12035VB Soil Moisture Sensor support Introduce the RAK12035 sensor as an environmental telemetry sensor, including necessary calibration checks and default values. Update relevant files to integrate the sensor into the existing telemetry system. This hardware is not just one module, but a couple.. RAK12023 and RAK12035 is the component stack, the RAK12023 does not seem to matter much and allows for multiple RAK12035 devices to be used. Co-Authored-By: @Justin-Mann * Update to 1.0.4 release of RAK12035_SoilMoisture * cleanup * cool * . * .. * little bit of cleanup and recompile/upload/test on RAK WISBLAOCK STACK: RAK19007/RAK4631/RAK12035VB/RAK12500 looks like soil monitor is working correctly, new environmental metrics are comming thru [new protos soil_moisture, soil_temperature] and GPS is working again with the RAK 12500. improvements could be made around the configuration of the monitor. next steps include updating the client(s) to react to, log and display the new proto metrics for soil temp and humidity. * . comments about current limitations and TODOs * trunk update * trying to autoformat.. * fix formatting attempt 2 * .. * ... * ... * . * some corrections and local build success * correction in temp code * grr formatting * cleanup after a few experiments * remove temp code to overwrite values for temp and humidity protos.. next step just update the clients to know about soil_temperature and soil_humidity protos. * update some values in varient for rak wistap * working out trunk formatting.. * wip . corrections to other build variants * . * protobuffs? * protobufs? * Update protobufs ref * Protobufs ref * Trunk * Update RAK12035Sensor.cpp * Fmt * comment changes * dumb mistakes... resolved, actually built and tested.. all good.. * Update src/modules/Telemetry/Sensor/RAK12035Sensor.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/modules/Telemetry/Sensor/RAK12035Sensor.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * . proto submod * proto * proto * merge master * mabe a fix for GPS pin conflict, waiting on a new gps module to try * merge master, attempt to fix gps (RAK12500) pin conflict with RAK12023/12035 * . * . --------- Co-authored-by: Tom Fifield Co-authored-by: Thomas Göttgens Co-authored-by: Ben Meadors Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/configuration.h | 9 ++ src/detect/ScanI2C.h | 1 + src/detect/ScanI2CTwoWire.cpp | 14 ++- src/main.cpp | 1 + .../Telemetry/EnvironmentTelemetry.cpp | 38 +++++- .../Telemetry/Sensor/RAK12035Sensor.cpp | 109 ++++++++++++++++++ src/modules/Telemetry/Sensor/RAK12035Sensor.h | 28 +++++ src/platform/nrf52/main-nrf52.cpp | 3 + variants/rak4631/platformio.ini | 3 +- variants/rak4631/variant.h | 12 +- variants/rak4631_epaper/platformio.ini | 1 + variants/rak4631_epaper/variant.h | 5 +- variants/rak4631_epaper_onrxtx/platformio.ini | 1 + variants/rak4631_epaper_onrxtx/variant.h | 7 +- variants/rak4631_eth_gw/variant.h | 5 +- variants/rak_wismeshtap/platformio.ini | 1 + variants/rak_wismeshtap/variant.h | 14 ++- 17 files changed, 235 insertions(+), 17 deletions(-) create mode 100644 src/modules/Telemetry/Sensor/RAK12035Sensor.cpp create mode 100644 src/modules/Telemetry/Sensor/RAK12035Sensor.h diff --git a/src/configuration.h b/src/configuration.h index 32d99295e..1615600f6 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -193,6 +193,15 @@ along with this program. If not, see . // ----------------------------------------------------------------------------- #define FT6336U_ADDR 0x48 +// ----------------------------------------------------------------------------- +// RAK12035VB Soil Monitor (using RAK12023 up to 3 RAK12035 monitors can be connected) +// - the default i2c address for this sensor is 0x20, and users are instructed to +// set 0x21 and 0x22 for the second and third sensor if present. +// ----------------------------------------------------------------------------- +#define RAK120351_ADDR 0x20 +#define RAK120352_ADDR 0x21 +#define RAK120353_ADDR 0x22 + // ----------------------------------------------------------------------------- // BIAS-T Generator // ----------------------------------------------------------------------------- diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index 72184db69..1e91933a9 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -70,6 +70,7 @@ class ScanI2C DFROBOT_RAIN, DPS310, LTR390UV, + RAK12035, TCA8418KB, PCT2075, } DeviceType; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 22370ff4c..09f320908 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -423,9 +423,21 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) logFoundDevice("BMA423", (uint8_t)addr.address); } break; + case TCA9535_ADDR: + case RAK120352_ADDR: + case RAK120353_ADDR: + registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x02), 1); + if (registerValue == addr.address) { // RAK12035 returns its I2C address at 0x02 (eg 0x20) + type = RAK12035; + logFoundDevice("RAK12035", (uint8_t)addr.address); + } else { + type = TCA9535; + logFoundDevice("TCA9535", (uint8_t)addr.address); + } + + break; SCAN_SIMPLE_CASE(LSM6DS3_ADDR, LSM6DS3, "LSM6DS3", (uint8_t)addr.address); - SCAN_SIMPLE_CASE(TCA9535_ADDR, TCA9535, "TCA9535", (uint8_t)addr.address); SCAN_SIMPLE_CASE(TCA9555_ADDR, TCA9555, "TCA9555", (uint8_t)addr.address); SCAN_SIMPLE_CASE(VEML7700_ADDR, VEML7700, "VEML7700", (uint8_t)addr.address); SCAN_SIMPLE_CASE(TSL25911_ADDR, TSL2591, "TSL2591", (uint8_t)addr.address); diff --git a/src/main.cpp b/src/main.cpp index a35a5007f..2c30d4718 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -729,6 +729,7 @@ void setup() scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::DFROBOT_RAIN, meshtastic_TelemetrySensorType_DFROBOT_RAIN); scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::LTR390UV, meshtastic_TelemetrySensorType_LTR390UV); scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::DPS310, meshtastic_TelemetrySensorType_DPS310); + scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::RAK12035, meshtastic_TelemetrySensorType_RAK12035); scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::PCT2075, meshtastic_TelemetrySensorType_PCT2075); i2cScanner.reset(); diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index 6d29fecb2..aaab8d0e6 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -19,8 +19,8 @@ #include #if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL -// Sensors +// Sensors #include "Sensor/CGRadSensSensor.h" #include "Sensor/RCWL9620Sensor.h" #include "Sensor/nullSensor.h" @@ -101,6 +101,13 @@ SHTC3Sensor shtc3Sensor; NullSensor shtc3Sensor; #endif +#if __has_include("RAK12035_SoilMoisture.h") && defined(RAK_4631) && RAK_4631 == 1 +#include "Sensor/RAK12035Sensor.h" +RAK12035Sensor rak12035Sensor; +#else +NullSensor rak12035Sensor; +#endif + #if __has_include() #include "Sensor/VEML7700Sensor.h" VEML7700Sensor veml7700Sensor; @@ -173,6 +180,7 @@ NullSensor pct2075Sensor; RCWL9620Sensor rcwl9620Sensor; CGRadSensSensor cgRadSens; + #endif #ifdef T1000X_SENSOR_EN #include "Sensor/T1000xSensor.h" @@ -182,6 +190,7 @@ T1000xSensor t1000xSensor; #include "Sensor/IndicatorSensor.h" IndicatorSensor indicatorSensor; #endif + #define FAILED_STATE_SENSOR_READ_MULTIPLIER 10 #define DISPLAY_RECEIVEID_MEASUREMENTS_ON_SCREEN true @@ -288,6 +297,11 @@ int32_t EnvironmentTelemetryModule::runOnce() result = rak9154Sensor.runOnce(); #endif +#if __has_include("RAK12035_SoilMoisture.h") && defined(RAK_4631) && RAK_4631 == 1 + if (rak12035Sensor.hasSensor()) { + result = rak12035Sensor.runOnce(); + } +#endif #endif } // it's possible to have this module enabled, only for displaying values on the screen. @@ -625,6 +639,14 @@ bool EnvironmentTelemetryModule::getEnvironmentTelemetry(meshtastic_Telemetry *m valid = valid && rak9154Sensor.getMetrics(m); hasSensor = true; #endif +#if __has_include("RAK12035_SoilMoisture.h") && defined(RAK_4631) && \ + RAK_4631 == \ + 1 // Not really needed, but may as well just skip at a lower level it if no library or not a RAK_4631 + if (rak12035Sensor.hasSensor()) { + valid = valid && rak12035Sensor.getMetrics(m); + hasSensor = true; + } +#endif #endif return valid && hasSensor; } @@ -679,6 +701,9 @@ bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly) LOG_INFO("Send: radiation=%fµR/h", m.variant.environment_metrics.radiation); + LOG_INFO("Send: soil_temperature=%f, soil_moisture=%u", m.variant.environment_metrics.soil_temperature, + m.variant.environment_metrics.soil_moisture); + sensor_read_error_count = 0; meshtastic_MeshPacket *p = allocDataProtobuf(m); @@ -850,8 +875,17 @@ AdminMessageHandleResult EnvironmentTelemetryModule::handleAdminMessageForModule if (result != AdminMessageHandleResult::NOT_HANDLED) return result; } +#if __has_include("RAK12035_SoilMoisture.h") && defined(RAK_4631) && \ + RAK_4631 == \ + 1 // Not really needed, but may as well just skip it at a lower level if no library or not a RAK_4631 + if (rak12035Sensor.hasSensor()) { + result = rak12035Sensor.handleAdminMessage(mp, request, response); + if (result != AdminMessageHandleResult::NOT_HANDLED) + return result; + } +#endif #endif return result; } -#endif \ No newline at end of file +#endif diff --git a/src/modules/Telemetry/Sensor/RAK12035Sensor.cpp b/src/modules/Telemetry/Sensor/RAK12035Sensor.cpp new file mode 100644 index 000000000..7a1bb01ce --- /dev/null +++ b/src/modules/Telemetry/Sensor/RAK12035Sensor.cpp @@ -0,0 +1,109 @@ +#include "configuration.h" +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include("RAK12035_SoilMoisture.h") && defined(RAK_4631) && RAK_4631 == 1 + +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "RAK12035Sensor.h" + +RAK12035Sensor::RAK12035Sensor() : TelemetrySensor(meshtastic_TelemetrySensorType_RAK12035, "RAK12035") {} + +int32_t RAK12035Sensor::runOnce() +{ + if (!hasSensor()) { + return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; + } + + // TODO:: check for up to 2 additional sensors and start them if present. + sensor.set_sensor_addr(RAK120351_ADDR); + delay(100); + sensor.begin(nodeTelemetrySensorsMap[sensorType].first); + + // Get sensor firmware version + uint8_t data = 0; + sensor.get_sensor_version(&data); + if (data != 0) { + LOG_INFO("Init sensor: %s", sensorName); + LOG_INFO("RAK12035Sensor Init Succeed \nSensor1 Firmware version: %i, Sensor Name: %s", data, sensorName); + status = true; + sensor.sensor_sleep(); + } else { + // If we reach here, it means the sensor did not initialize correctly. + LOG_INFO("Init sensor: %s", sensorName); + LOG_ERROR("RAK12035Sensor Init Failed"); + status = false; + } + + return initI2CSensor(); +} + +void RAK12035Sensor::setup() +{ + // Set the calibration values + // Reading the saved calibration values from the sensor. + // TODO:: Check for and run calibration check for up to 2 additional sensors if present. + uint16_t zero_val = 0; + uint16_t hundred_val = 0; + uint16_t default_zero_val = 550; + uint16_t default_hundred_val = 420; + sensor.sensor_on(); + delay(200); + sensor.get_dry_cal(&zero_val); + sensor.get_wet_cal(&hundred_val); + delay(200); + if (zero_val == 0 || zero_val <= hundred_val) { + LOG_INFO("Dry calibration value is %d", zero_val); + LOG_INFO("Wet calibration value is %d", hundred_val); + LOG_INFO("This does not make sense. You can recalibrate this sensor using the calibration sketch included here: " + "https://github.com/RAKWireless/RAK12035_SoilMoisture."); + LOG_INFO("For now, setting default calibration value for Dry Calibration: %d", default_zero_val); + sensor.set_dry_cal(default_zero_val); + sensor.get_dry_cal(&zero_val); + LOG_INFO("Dry calibration reset complete. New value is %d", zero_val); + } + if (hundred_val == 0 || hundred_val >= zero_val) { + LOG_INFO("Dry calibration value is %d", zero_val); + LOG_INFO("Wet calibration value is %d", hundred_val); + LOG_INFO("This does not make sense. You can recalibrate this sensor using the calibration sketch included here: " + "https://github.com/RAKWireless/RAK12035_SoilMoisture."); + LOG_INFO("For now, setting default calibration value for Wet Calibration: %d", default_hundred_val); + sensor.set_wet_cal(default_hundred_val); + sensor.get_wet_cal(&hundred_val); + LOG_INFO("Wet calibration reset complete. New value is %d", hundred_val); + } + sensor.sensor_sleep(); + delay(200); + LOG_INFO("Dry calibration value is %d", zero_val); + LOG_INFO("Wet calibration value is %d", hundred_val); +} + +bool RAK12035Sensor::getMetrics(meshtastic_Telemetry *measurement) +{ + // TODO:: read and send metrics for up to 2 additional soil monitors if present. + // -- how to do this.. this could get a little complex.. + // ie - 1> we combine them into an average and send that, 2> we send them as separate metrics + // ^-- these scenarios would require different handling of the metrics in the receiving end and maybe a setting in the + // device ui and an additional proto for that? + measurement->variant.environment_metrics.has_soil_temperature = true; + measurement->variant.environment_metrics.has_soil_moisture = true; + + uint8_t moisture = 0; + uint16_t temp = 0; + bool success = false; + + sensor.sensor_on(); + delay(200); + success = sensor.get_sensor_moisture(&moisture); + delay(200); + success &= sensor.get_sensor_temperature(&temp); + delay(200); + sensor.sensor_sleep(); + + if (success == false) { + LOG_ERROR("Failed to read sensor data"); + return false; + } + measurement->variant.environment_metrics.soil_temperature = ((float)temp / 10.0f); + measurement->variant.environment_metrics.soil_moisture = moisture; + + return true; +} +#endif diff --git a/src/modules/Telemetry/Sensor/RAK12035Sensor.h b/src/modules/Telemetry/Sensor/RAK12035Sensor.h new file mode 100644 index 000000000..2c32a840d --- /dev/null +++ b/src/modules/Telemetry/Sensor/RAK12035Sensor.h @@ -0,0 +1,28 @@ +#pragma once + +#include "configuration.h" + +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() && defined(RAK_4631) +#ifndef _MT_RAK12035VBSENSOR_H +#define _MT_RAK12035VBSENSOR_H +#endif + +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "RAK12035_SoilMoisture.h" +#include "TelemetrySensor.h" +#include + +class RAK12035Sensor : public TelemetrySensor +{ + private: + RAK12035 sensor; + + protected: + virtual void setup() override; + + public: + RAK12035Sensor(); + virtual int32_t runOnce() override; + virtual bool getMetrics(meshtastic_Telemetry *measurement) override; +}; +#endif diff --git a/src/platform/nrf52/main-nrf52.cpp b/src/platform/nrf52/main-nrf52.cpp index 9accd2a02..1bf9a39fd 100644 --- a/src/platform/nrf52/main-nrf52.cpp +++ b/src/platform/nrf52/main-nrf52.cpp @@ -308,6 +308,9 @@ void cpuDeepSleep(uint32_t msecToWake) nrf_gpio_cfg_default(SCREEN_TOUCH_INT); nrf_gpio_cfg_default(WB_I2C1_SCL); nrf_gpio_cfg_default(WB_I2C1_SDA); + + // nrf_gpio_cfg_default(WB_I2C2_SCL); + // nrf_gpio_cfg_default(WB_I2C2_SDA); #endif #endif #ifdef MESHLINK diff --git a/variants/rak4631/platformio.ini b/variants/rak4631/platformio.ini index f2d68e704..ee134e87a 100644 --- a/variants/rak4631/platformio.ini +++ b/variants/rak4631/platformio.ini @@ -18,6 +18,7 @@ lib_deps = melopero/Melopero RV3028@^1.1.0 https://github.com/RAKWireless/RAK13800-W5100S/archive/1.0.2.zip rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2 + beegee-tokyo/RAK12035_SoilMoisture@^1.0.4 https://github.com/RAKWireless/RAK12034-BMX160/archive/dcead07ffa267d3c906e9ca4a1330ab989e957e2.zip ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) @@ -51,4 +52,4 @@ lib_deps = upload_protocol = stlink ; eventually use platformio/tool-pyocd@^2.3600.0 instad ;upload_protocol = custom -;upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE \ No newline at end of file +;upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE diff --git a/variants/rak4631/variant.h b/variants/rak4631/variant.h index 82c914892..cd8f46153 100644 --- a/variants/rak4631/variant.h +++ b/variants/rak4631/variant.h @@ -88,8 +88,13 @@ static const uint8_t A7 = PIN_A7; #define ADC_RESOLUTION 14 // Other pins + #define WB_I2C1_SDA (13) // SENSOR_SLOT IO_SLOT + #define WB_I2C1_SCL (14) // SENSOR_SLOT IO_SLOT + #define PIN_AREF (2) #define PIN_NFC1 (9) +#define WB_IO5 PIN_NFC1 +#define WB_IO4 (4) #define PIN_NFC2 (10) static const uint8_t AREF = PIN_AREF; @@ -143,8 +148,8 @@ static const uint8_t SCK = PIN_SPI_SCK; */ #define WIRE_INTERFACES_COUNT 1 -#define PIN_WIRE_SDA (13) -#define PIN_WIRE_SCL (14) +#define PIN_WIRE_SDA (WB_I2C1_SDA) +#define PIN_WIRE_SCL (WB_I2C1_SCL) // QSPI Pins #define PIN_QSPI_SCK 3 @@ -227,6 +232,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG // enables 3.3V periphery like GPS or IO Module // Do not toggle this for GPS power savings #define PIN_3V3_EN (34) +#define WB_IO2 PIN_3V3_EN // RAK1910 GPS module // If using the wisblock GPS module and pluged into Port A on WisBlock base @@ -280,4 +286,4 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG * Arduino objects - C++ only *----------------------------------------------------------------------------*/ -#endif \ No newline at end of file +#endif diff --git a/variants/rak4631_epaper/platformio.ini b/variants/rak4631_epaper/platformio.ini index 7c8a299bb..47e4451c7 100644 --- a/variants/rak4631_epaper/platformio.ini +++ b/variants/rak4631_epaper/platformio.ini @@ -16,6 +16,7 @@ lib_deps = melopero/Melopero RV3028@^1.1.0 rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2 beegee-tokyo/RAKwireless RAK12034@^1.0.0 + beegee-tokyo/RAK12035_SoilMoisture@^1.0.4 debug_tool = jlink ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) ;upload_protocol = jlink diff --git a/variants/rak4631_epaper/variant.h b/variants/rak4631_epaper/variant.h index 0bb97498c..c1e11bee5 100644 --- a/variants/rak4631_epaper/variant.h +++ b/variants/rak4631_epaper/variant.h @@ -90,6 +90,8 @@ static const uint8_t A7 = PIN_A7; // Other pins #define PIN_AREF (2) #define PIN_NFC1 (9) +#define WB_IO5 PIN_NFC1 +#define WB_IO4 (4) #define PIN_NFC2 (10) static const uint8_t AREF = PIN_AREF; @@ -188,6 +190,7 @@ static const uint8_t SCK = PIN_SPI_SCK; // enables 3.3V periphery like GPS or IO Module #define PIN_3V3_EN (34) +#define WB_IO2 PIN_3V3_EN // RAK1910 GPS module // If using the wisblock GPS module and pluged into Port A on WisBlock base @@ -231,4 +234,4 @@ static const uint8_t SCK = PIN_SPI_SCK; * Arduino objects - C++ only *----------------------------------------------------------------------------*/ -#endif \ No newline at end of file +#endif diff --git a/variants/rak4631_epaper_onrxtx/platformio.ini b/variants/rak4631_epaper_onrxtx/platformio.ini index c749fc686..52a13f2a7 100644 --- a/variants/rak4631_epaper_onrxtx/platformio.ini +++ b/variants/rak4631_epaper_onrxtx/platformio.ini @@ -18,6 +18,7 @@ lib_deps = melopero/Melopero RV3028@^1.1.0 rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2 beegee-tokyo/RAKwireless RAK12034@^1.0.0 + beegee-tokyo/RAK12035_SoilMoisture@^1.0.4 debug_tool = jlink ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) ;upload_protocol = jlink diff --git a/variants/rak4631_epaper_onrxtx/variant.h b/variants/rak4631_epaper_onrxtx/variant.h index 5888cff33..1f8257e8e 100644 --- a/variants/rak4631_epaper_onrxtx/variant.h +++ b/variants/rak4631_epaper_onrxtx/variant.h @@ -69,7 +69,9 @@ static const uint8_t A7 = PIN_A7; // Other pins #define PIN_AREF (2) -// #define PIN_NFC1 (9) +#define PIN_NFC1 (9) +#define WB_IO5 PIN_NFC1 +#define WB_IO4 (4) // #define PIN_NFC2 (10) static const uint8_t AREF = PIN_AREF; @@ -160,6 +162,7 @@ static const uint8_t SCK = PIN_SPI_SCK; // enables 3.3V periphery like GPS or IO Module #define PIN_3V3_EN (34) +#define WB_IO2 PIN_3V3_EN // NO GPS #undef GPS_RX_PIN @@ -202,4 +205,4 @@ static const uint8_t SCK = PIN_SPI_SCK; * Arduino objects - C++ only *----------------------------------------------------------------------------*/ -#endif \ No newline at end of file +#endif diff --git a/variants/rak4631_eth_gw/variant.h b/variants/rak4631_eth_gw/variant.h index bc5541336..c8a2f83ae 100644 --- a/variants/rak4631_eth_gw/variant.h +++ b/variants/rak4631_eth_gw/variant.h @@ -90,6 +90,8 @@ static const uint8_t A7 = PIN_A7; // Other pins #define PIN_AREF (2) #define PIN_NFC1 (9) +#define WB_IO5 PIN_NFC1 +#define WB_IO4 (4) #define PIN_NFC2 (10) static const uint8_t AREF = PIN_AREF; @@ -217,6 +219,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG // enables 3.3V periphery like GPS or IO Module // Do not toggle this for GPS power savings #define PIN_3V3_EN (34) +#define WB_IO2 PIN_3V3_EN // RAK1910 GPS module // If using the wisblock GPS module and pluged into Port A on WisBlock base @@ -270,4 +273,4 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG * Arduino objects - C++ only *----------------------------------------------------------------------------*/ -#endif \ No newline at end of file +#endif diff --git a/variants/rak_wismeshtap/platformio.ini b/variants/rak_wismeshtap/platformio.ini index 6ed97c7ad..bfb3ea927 100644 --- a/variants/rak_wismeshtap/platformio.ini +++ b/variants/rak_wismeshtap/platformio.ini @@ -22,6 +22,7 @@ lib_deps = bodmer/TFT_eSPI beegee-tokyo/RAKwireless RAK12034@^1.0.0 beegee-tokyo/RAK14014-FT6336U @ 1.0.1 + beegee-tokyo/RAK12035_SoilMoisture@^1.0.4 debug_tool = jlink ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) ;upload_protocol = jlink diff --git a/variants/rak_wismeshtap/variant.h b/variants/rak_wismeshtap/variant.h index 1980dc4a1..f961ddf6e 100644 --- a/variants/rak_wismeshtap/variant.h +++ b/variants/rak_wismeshtap/variant.h @@ -90,6 +90,8 @@ static const uint8_t A7 = PIN_A7; // Other pins #define PIN_AREF (2) #define PIN_NFC1 (9) +#define WB_IO5 PIN_NFC1 +#define WB_IO4 (4) #define PIN_NFC2 (10) static const uint8_t AREF = PIN_AREF; @@ -176,11 +178,11 @@ static const uint8_t SCK = PIN_SPI_SCK; // No reason not to have the RAK Wireless pin defs here too. This allows code from example RAK sketches to run without // modification. -static const uint8_t WB_IO1 = 17; // SLOT_A SLOT_B -static const uint8_t WB_IO2 = 34; // SLOT_A SLOT_B -static const uint8_t WB_IO3 = 21; // SLOT_C -static const uint8_t WB_IO4 = 4; // SLOT_C -static const uint8_t WB_IO5 = 9; // SLOT_D +static const uint8_t WB_IO1 = 17; // SLOT_A SLOT_B +static const uint8_t WB_IO2 = 34; // SLOT_A SLOT_B +static const uint8_t WB_IO3 = 21; // SLOT_C +// static const uint8_t WB_IO4 = 4; // SLOT_C <- already defined above (ln. 94) +// static const uint8_t WB_IO5 = 9; // SLOT_D <- already defined above (ln. 93) static const uint8_t WB_IO6 = 10; // SLOT_D static const uint8_t WB_SW1 = 33; // IO_SLOT static const uint8_t WB_A0 = 5; // IO_SLOT @@ -314,4 +316,4 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG * Arduino objects - C++ only *----------------------------------------------------------------------------*/ -#endif \ No newline at end of file +#endif From 58743021c82df8f46118ae32a587102874f43185 Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Fri, 20 Jun 2025 07:51:33 +0800 Subject: [PATCH 319/461] XIAO BLE cleanup (supporting changes to seeed_xiao_nrf52840_kit too) (#7024) * chore(seeed_xiao_nrf52840_kit): Use build flag for L76K GNSS, rename variant.h ifdef Signed-off-by: Andrew Yong * feat(seeed_xiao_nrf52840_kit): Support multiple SX126x pinouts via build flags Signed-off-by: Andrew Yong * feat(seeed_xiao_nrf52840_kit): Pin D0 as user button if pin is unused Signed-off-by: Andrew Yong * feat: EBYTE E22 and NiceRF gain and SX1262 max power defines Signed-off-by: Andrew Yong * chore(xiao_ble): Move variant to DIY and extend from seeed_xiao_nrf52840_kit Signed-off-by: Andrew Yong * feat(seeed_xiao_nrf52840_kit): Pin D6, D7 as I2C SDA, SCL if pins are unused Signed-off-by: Andrew Yong --------- Signed-off-by: Andrew Yong --- src/configuration.h | 38 +++- variants/diy/platformio.ini | 7 + variants/{ => diy}/xiao_ble/README.md | 0 .../seeed_xiao_nrf52840_kit/platformio.ini | 2 +- variants/seeed_xiao_nrf52840_kit/variant.h | 104 ++++++--- variants/xiao_ble/platformio.ini | 13 -- variants/xiao_ble/variant.cpp | 62 ----- variants/xiao_ble/variant.h | 212 ------------------ .../xiao_ble/xiao-ble-internal-format.uf2 | Bin 122880 -> 0 bytes variants/xiao_ble/xiao_ble.sh | 15 -- ...ootloader-0.7.0-22-g277a0c8_s140_7.3.0.zip | Bin 192586 -> 0 bytes 11 files changed, 119 insertions(+), 334 deletions(-) rename variants/{ => diy}/xiao_ble/README.md (100%) delete mode 100644 variants/xiao_ble/platformio.ini delete mode 100644 variants/xiao_ble/variant.cpp delete mode 100644 variants/xiao_ble/variant.h delete mode 100644 variants/xiao_ble/xiao-ble-internal-format.uf2 delete mode 100755 variants/xiao_ble/xiao_ble.sh delete mode 100644 variants/xiao_ble/xiao_nrf52840_ble_bootloader-0.7.0-22-g277a0c8_s140_7.3.0.zip diff --git a/src/configuration.h b/src/configuration.h index 1615600f6..33e014c5e 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -81,7 +81,43 @@ along with this program. If not, see . // #define REGULATORY_LORA_REGIONCODE meshtastic_Config_LoRaConfig_RegionCode_SG_923 // Total system gain in dBm to subtract from Tx power to remain within regulatory and Tx PA limits -// This value should be set in variant.h and is PA gain + antenna gain (if variant has a non-removable antenna) +// The value consists of PA gain + antenna gain (if variant has a non-removable antenna) +// TX_GAIN_LORA should be set with definitions below for common modules, or in variant.h. + +// Gain for common modules with transmit PAs +#ifdef EBYTE_E22_900M30S +// 10dB PA gain and 30dB rated output; based on measurements from +// https://github.com/S5NC/EBYTE_ESP32-S3/blob/main/E22-900M30S%20power%20output%20testing.txt +#define TX_GAIN_LORA 7 +#define SX126X_MAX_POWER 22 +#endif + +#ifdef EBYTE_E22_900M33S +// 25dB PA gain and 33dB rated output; based on TX Power Curve from E22-900M33S_UserManual_EN_v1.0.pdf +#define TX_GAIN_LORA 25 +#define SX126X_MAX_POWER 8 +#endif + +#ifdef NICERF_MINIF27 +// Note that datasheet power level of 9 corresponds with SX1262 at 22dBm +// Maximum output power of 29dBm with VCC_PA = 5V +#define TX_GAIN_LORA 7 +#define SX126X_MAX_POWER 22 +#endif + +#ifdef NICERF_F30_HF +// Maximum output power of 29.6dBm with VCC = 5V and SX1262 at 22dBm +#define TX_GAIN_LORA 8 +#define SX126X_MAX_POWER 22 +#endif + +#ifdef NICERF_F30_LF +// Maximum output power of 32.0dBm with VCC = 5V and SX1262 at 22dBm +#define TX_GAIN_LORA 10 +#define SX126X_MAX_POWER 22 +#endif + +// Default system gain to 0 if not defined #ifndef TX_GAIN_LORA #define TX_GAIN_LORA 0 #endif diff --git a/variants/diy/platformio.ini b/variants/diy/platformio.ini index 24ea9cc9d..153796daf 100644 --- a/variants/diy/platformio.ini +++ b/variants/diy/platformio.ini @@ -89,6 +89,13 @@ extra_scripts = ${env.extra_scripts} variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py ; Add to PIO's Project Tasks pane: preset builds for common displays +; Seeed Xiao BLE: https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/102010448/16652893 +[env:xiao_ble] +extends = env:seeed_xiao_nrf52840_kit +board_level = extra +build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -D PRIVATE_HW -DXIAO_BLE_LEGACY_PINOUT -DEBYTE_E22 -DEBYTE_E22_900M30S +build_unflags = -DGPS_L76K + ; Seeed XIAO nRF52840 + XIAO Wio SX1262 DIY [env:seeed-xiao-nrf52840-wio-sx1262] board = xiao_ble_sense diff --git a/variants/xiao_ble/README.md b/variants/diy/xiao_ble/README.md similarity index 100% rename from variants/xiao_ble/README.md rename to variants/diy/xiao_ble/README.md diff --git a/variants/seeed_xiao_nrf52840_kit/platformio.ini b/variants/seeed_xiao_nrf52840_kit/platformio.ini index 0a8bee31c..8c4c5a57b 100644 --- a/variants/seeed_xiao_nrf52840_kit/platformio.ini +++ b/variants/seeed_xiao_nrf52840_kit/platformio.ini @@ -2,7 +2,7 @@ [env:seeed_xiao_nrf52840_kit] extends = nrf52840_base board = xiao_ble_sense -build_flags = ${nrf52840_base.build_flags} -Ivariants/seeed_xiao_nrf52840_kit -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DSEEED_XIAO_NRF52840_KIT +build_flags = ${nrf52840_base.build_flags} -Ivariants/seeed_xiao_nrf52840_kit -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DSEEED_XIAO_NRF52840_KIT -DGPS_L76K board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_xiao_nrf52840_kit> lib_deps = diff --git a/variants/seeed_xiao_nrf52840_kit/variant.h b/variants/seeed_xiao_nrf52840_kit/variant.h index 5d45d6ea1..48967d1f8 100644 --- a/variants/seeed_xiao_nrf52840_kit/variant.h +++ b/variants/seeed_xiao_nrf52840_kit/variant.h @@ -1,5 +1,5 @@ -#ifndef _SEEED_XIAO_NRF52840_SENSE_H_ -#define _SEEED_XIAO_NRF52840_SENSE_H_ +#ifndef _SEEED_XIAO_NRF52840_KIT_H_ +#define _SEEED_XIAO_NRF52840_KIT_H_ /** Master clock frequency */ #define VARIANT_MCK (64000000ul) @@ -79,9 +79,8 @@ static const uint8_t A5 = PIN_A5; */ /* - * D0 is shared with PIN_GPS_STANDBY on the L76K GNSS Module. - * There are some technical solutions that can solve this problem, and we are - * currently exploring and researching them. + * D0 is shared with PIN_GPS_STANDBY on the L76K GNSS Module, so refer to + * GPS_L76K definition preventing this conflict */ // #define BUTTON_PIN D0 @@ -93,51 +92,60 @@ static const uint8_t A5 = PIN_A5; #define PIN_SERIAL2_TX (-1) /* - * SPI Interfaces + * Pinout for SX126x */ -#define SPI_INTERFACES_COUNT 1 - -#define PIN_SPI_MISO (9) -#define PIN_SPI_MOSI (10) -#define PIN_SPI_SCK (8) - -static const uint8_t SS = D4; -static const uint8_t MOSI = PIN_SPI_MOSI; -static const uint8_t MISO = PIN_SPI_MISO; -static const uint8_t SCK = PIN_SPI_SCK; - #define USE_SX1262 -// Pinout for SX126X +#ifdef XIAO_BLE_LEGACY_PINOUT +// Legacy xiao_ble variant pinout for third-party SX126x modules e.g. EBYTE E22 +#define SX126X_CS D0 +#define SX126X_DIO1 D1 +#define SX126X_BUSY D2 +#define SX126X_RESET D3 +#define SX126X_RXEN D7 + +#elif defined(SEEED_XIAO_WIO_BTB) +// Wio-SX1262 for XIAO with 30-pin board-to-board connector +// https://files.seeedstudio.com/products/SenseCAP/Wio_SX1262/Schematic_Diagram_Wio-SX1262_for_XIAO.pdf +#define SX126X_CS D3 +#define SX126X_DIO1 D0 +#define SX126X_BUSY D1 +#define SX126X_RESET D2 +#define SX126X_RXEN D4 +#else +// Wio-SX1262 for XIAO (standalone SKU 113010003 or nRF52840 kit SKU 102010710) +// https://files.seeedstudio.com/products/SenseCAP/Wio_SX1262/Wio-SX1262%20for%20XIAO%20V1.0_SCH.pdf #define SX126X_CS D4 #define SX126X_DIO1 D1 #define SX126X_BUSY D3 #define SX126X_RESET D2 +#define SX126X_RXEN D5 +#endif +// Common pinouts for all SX126x pinouts above #define SX126X_TXEN RADIOLIB_NC - -#define SX126X_RXEN D5 // This is used to control the RX side of the RF switch #define SX126X_DIO2_AS_RF_SWITCH // DIO2 is used to control the TX side of the RF switch #define SX126X_DIO3_TCXO_VOLTAGE 1.8 /* - * Wire Interfaces + * SPI Interfaces + * Defined after pinout for SX1262x to factor in CS pinout variations */ -#define I2C_NO_RESCAN // I2C is a bit finicky, don't scan too much -#define WIRE_INTERFACES_COUNT 1 // 2 +#define SPI_INTERFACES_COUNT 1 -// LSM6DS3TR on XIAO nRF52840 Series -#define PIN_WIRE_SDA (17) -#define PIN_WIRE_SCL (16) +#define PIN_SPI_MISO D9 +#define PIN_SPI_MOSI D10 +#define PIN_SPI_SCK D8 -static const uint8_t SDA = PIN_WIRE_SDA; -static const uint8_t SCL = PIN_WIRE_SCL; +static const uint8_t SS = SX126X_CS; +static const uint8_t MOSI = PIN_SPI_MOSI; +static const uint8_t MISO = PIN_SPI_MISO; +static const uint8_t SCK = PIN_SPI_SCK; /* * GPS */ -// GPS L76KB -#define GPS_L76K +// GPS L76K #ifdef GPS_L76K #define PIN_GPS_RX D6 #define PIN_GPS_TX D7 @@ -146,6 +154,9 @@ static const uint8_t SCL = PIN_WIRE_SCL; #define PIN_SERIAL1_RX PIN_GPS_TX #define PIN_SERIAL1_TX PIN_GPS_RX #define PIN_GPS_STANDBY D0 +#else +#define PIN_SERIAL1_RX (-1) +#define PIN_SERIAL1_TX (-1) #endif /* @@ -161,6 +172,39 @@ static const uint8_t SCL = PIN_WIRE_SCL; #define BATTERY_SENSE_RESOLUTION_BITS (10) +/* + * Wire Interfaces + * Keep this section after potentially conflicting pin definitions + */ +#define I2C_NO_RESCAN // I2C is a bit finicky, don't scan too much +#define WIRE_INTERFACES_COUNT 1 + +#if !defined(XIAO_BLE_LEGACY_PINOUT) && !defined(GPS_L76K) +// If D6 and D7 are free, I2C is probably the most versatile assignment +#define PIN_WIRE_SDA D6 +#define PIN_WIRE_SCL D7 +#else +// Internal LSM6DS3TR on XIAO nRF52840 Series +#define PIN_WIRE_SDA (17) +#define PIN_WIRE_SCL (16) +#endif + +static const uint8_t SDA = PIN_WIRE_SDA; +static const uint8_t SCL = PIN_WIRE_SCL; + +/* + * Buttons + * Keep this section after potentially conflicting pin definitions + * because D0 has multiple possible conflicts with various XIAO modules: + * - PIN_GPS_STANDBY on the L76K GNSS Module + * - DIO1 on the Wio-SX1262 - 30-pin board-to-board connector version + * - SX1262X CS on XIAO BLE legacy pinout + */ + +#if !defined(GPS_L76K) && !defined(SEEED_XIAO_WIO_BTB) && !defined(XIAO_BLE_OLD_PINOUT) +#define BUTTON_PIN D0 +#endif + #ifdef __cplusplus } #endif diff --git a/variants/xiao_ble/platformio.ini b/variants/xiao_ble/platformio.ini deleted file mode 100644 index 6fa1dd611..000000000 --- a/variants/xiao_ble/platformio.ini +++ /dev/null @@ -1,13 +0,0 @@ -; Seeed Xiao BLE: https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/102010448/16652893 -[env:xiao_ble] -extends = nrf52840_base -board = xiao_ble_sense -board_level = extra -build_flags = ${nrf52840_base.build_flags} -Ivariants/xiao_ble -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -D EBYTE_E22 -DEBYTE_E22_900M30S -DPRIVATE_HW -board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/xiao_ble> -lib_deps = - ${nrf52840_base.lib_deps} -debug_tool = jlink -; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) -;upload_protocol = jlink diff --git a/variants/xiao_ble/variant.cpp b/variants/xiao_ble/variant.cpp deleted file mode 100644 index 300f69d0b..000000000 --- a/variants/xiao_ble/variant.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "variant.h" -#include "nrf.h" -#include "wiring_constants.h" -#include "wiring_digital.h" - -const uint32_t g_ADigitalPinMap[] = { - // D0 .. D13 - 2, // D0 is P0.02 (A0) - 3, // D1 is P0.03 (A1) - 28, // D2 is P0.28 (A2) - 29, // D3 is P0.29 (A3) - 4, // D4 is P0.04 (A4,SDA) - 5, // D5 is P0.05 (A5,SCL) - 43, // D6 is P1.11 (TX) - 44, // D7 is P1.12 (RX) - 45, // D8 is P1.13 (SCK) - 46, // D9 is P1.14 (MISO) - 47, // D10 is P1.15 (MOSI) - - // LEDs - 26, // D11 is P0.26 (LED RED) - 6, // D12 is P0.06 (LED BLUE) - 30, // D13 is P0.30 (LED GREEN) - 14, // D14 is P0.14 (READ_BAT) - - // LSM6DS3TR - 40, // D15 is P1.08 (6D_PWR) - 27, // D16 is P0.27 (6D_I2C_SCL) - 7, // D17 is P0.07 (6D_I2C_SDA) - 11, // D18 is P0.11 (6D_INT1) - - // MIC - 42, // 17,//42, // D19 is P1.10 (MIC_PWR) - 32, // 26,//32, // D20 is P1.00 (PDM_CLK) - 16, // 25,//16, // D21 is P0.16 (PDM_DATA) - - // BQ25100 - 13, // D22 is P0.13 (HICHG) - 17, // D23 is P0.17 (~CHG) - - // - 21, // D24 is P0.21 (QSPI_SCK) - 25, // D25 is P0.25 (QSPI_CSN) - 20, // D26 is P0.20 (QSPI_SIO_0 DI) - 24, // D27 is P0.24 (QSPI_SIO_1 DO) - 22, // D28 is P0.22 (QSPI_SIO_2 WP) - 23, // D29 is P0.23 (QSPI_SIO_3 HOLD) - - // NFC - 9, // D30 is P0.09 (NFC1) - 10, // D31 is P0.10 (NFC2) - - // VBAT - 31, // D32 is P0.10 (VBAT) -}; - -void initVariant() -{ - // Set BQ25101 ISET to 100mA instead of 50mA - pinMode(HICHG, OUTPUT); - digitalWrite(HICHG, LOW); -} diff --git a/variants/xiao_ble/variant.h b/variants/xiao_ble/variant.h deleted file mode 100644 index e511c6869..000000000 --- a/variants/xiao_ble/variant.h +++ /dev/null @@ -1,212 +0,0 @@ -#ifndef _SEEED_XIAO_NRF52840_SENSE_H_ -#define _SEEED_XIAO_NRF52840_SENSE_H_ - -/** Master clock frequency */ -#define VARIANT_MCK (64000000ul) - -#define USE_LFXO // Board uses 32khz crystal for LF -// #define USE_LFRC // Board uses RC for LF - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "WVariant.h" - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -#define PINS_COUNT (33) -#define NUM_DIGITAL_PINS (33) -#define NUM_ANALOG_INPUTS (8) // A6 is used for battery, A7 is analog reference -#define NUM_ANALOG_OUTPUTS (0) - -// LEDs - -#define LED_RED 11 -#define LED_BLUE 12 -#define LED_GREEN 13 - -#define PIN_LED1 LED_GREEN -#define PIN_LED2 LED_BLUE -#define PIN_LED3 LED_RED - -#define PIN_LED PIN_LED1 -#define LED_PWR (PINS_COUNT) - -#define LED_BUILTIN PIN_LED - -#define LED_STATE_ON 1 // State when LED is lit - -/* - * Buttons - */ -#define PIN_BUTTON1 (PINS_COUNT) - -// Digital PINs -#define D0 (0ul) -#define D1 (1ul) -#define D2 (2ul) -#define D3 (3ul) -#define D4 (4ul) -#define D5 (5ul) -#define D6 (6ul) -#define D7 (7ul) -#define D8 (8ul) -#define D9 (9ul) -#define D10 (10ul) - -/* - * Analog pins - */ -#define PIN_A0 (0) -#define PIN_A1 (1) -#define PIN_A2 (2) -#define PIN_A3 (3) -#define PIN_A4 (4) -#define PIN_A5 (5) -#define PIN_VBAT (32) -#define VBAT_ENABLE (14) - -static const uint8_t A0 = PIN_A0; -static const uint8_t A1 = PIN_A1; -static const uint8_t A2 = PIN_A2; -static const uint8_t A3 = PIN_A3; -static const uint8_t A4 = PIN_A4; -static const uint8_t A5 = PIN_A5; -#define ADC_RESOLUTION 12 - -// Other pins -#define PIN_NFC1 (30) -#define PIN_NFC2 (31) - -/* - * Serial interfaces - */ -#define PIN_SERIAL1_RX (-1) // (7) -#define PIN_SERIAL1_TX (-1) // (6) - -#define PIN_SERIAL2_RX (-1) -#define PIN_SERIAL2_TX (-1) - -/* - * SPI Interfaces - */ -#define SPI_INTERFACES_COUNT 1 - -#define PIN_SPI_MISO (9) -#define PIN_SPI_MOSI (10) -#define PIN_SPI_SCK (8) - -static const uint8_t SS = D0; -static const uint8_t MOSI = PIN_SPI_MOSI; -static const uint8_t MISO = PIN_SPI_MISO; -static const uint8_t SCK = PIN_SPI_SCK; - -// supported modules list -#define USE_SX1262 - -// common pinouts for SX126X modules -#define SX126X_CS D0 -#define SX126X_DIO1 D1 -#define SX126X_BUSY D2 -#define SX126X_RESET D3 - -// ---------------------------------------------------------------- - -// E22 Tx/Rx control options: - -// 1. Let the E22 control Tx and Rx automagically via DIO2. - -// * The E22's TXEN and DIO2 pins are connected to each other, but not to the MCU. -// * The E22's RXEN pin *is* connected to the MCU. -// * E22_TXEN_CONNECTED_TO_DIO2 is defined so the logic in SX126XInterface.cpp handles this configuration correctly. - -#define SX126X_TXEN RADIOLIB_NC -#define SX126X_RXEN D7 - -// ------------------------------ OR ------------------------------ - -// 2. Control Tx and Rx manually. - -// * The E22's TXEN and RXEN pins are both connected to the MCU. - -// #define SX126X_TXEN D6 -// #define SX126X_RXEN D7 - -// ---------------------------------------------------------------- - -#ifdef EBYTE_E22 -// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch -// (which is the default for the sx1262interface code) -#define SX126X_DIO2_AS_RF_SWITCH -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 -#ifdef EBYTE_E22_900M30S -// 10dB PA gain and 30dB rated output; based on measurements from -// https://github.com/S5NC/EBYTE_ESP32-S3/blob/main/E22-900M30S%20power%20output%20testing.txt -#define TX_GAIN_LORA 7 -#define SX126X_MAX_POWER 22 -#endif -#ifdef EBYTE_E22_900M33S -// 25dB PA gain and 33dB rated output; based on TX Power Curve from E22-900M33S_UserManual_EN_v1.0.pdf -#define TX_GAIN_LORA 25 -#define SX126X_MAX_POWER 8 -#endif -#endif - -/* - * Wire Interfaces - */ -#define WIRE_INTERFACES_COUNT 1 // 2 - -#define PIN_WIRE_SDA (4) -#define PIN_WIRE_SCL (5) - -static const uint8_t SDA = PIN_WIRE_SDA; -static const uint8_t SCL = PIN_WIRE_SCL; - -#define PIN_LSM6DS3TR_C_POWER (15) -#define PIN_LSM6DS3TR_C_INT1 (18) - -// PDM Interfaces -// --------------- -#define PIN_PDM_PWR (19) -#define PIN_PDM_CLK (20) -#define PIN_PDM_DIN (21) - -// QSPI Pins -#define PIN_QSPI_SCK (24) -#define PIN_QSPI_CS (25) -#define PIN_QSPI_IO0 (26) -#define PIN_QSPI_IO1 (27) -#define PIN_QSPI_IO2 (28) -#define PIN_QSPI_IO3 (29) - -// On-board QSPI Flash -#define EXTERNAL_FLASH_DEVICES P25Q16H -#define EXTERNAL_FLASH_USE_QSPI - -// Battery - -#define ADC_CTRL VBAT_ENABLE // P0.14: VBAT voltage divider -#define ADC_CTRL_ENABLED LOW // ... sink -#define BATTERY_SENSE_RESOLUTION_BITS 10 -#define CHARGE_LED 23 // P0_17 = 17 D23 YELLOW CHARGE LED -#define HICHG 22 // P0_13 = 13 D22 Charge-select pin for Lipo for 100 mA instead of default 50mA charge - -// The battery sense is hooked to pin A0 (5) -#define BATTERY_PIN PIN_VBAT // PIN_A0 - -// ratio of voltage divider = 3.0 (R17=1M, R18=510k) -#define ADC_MULTIPLIER 3 // 3.0 + a bit for being optimistic - -#ifdef __cplusplus -} -#endif - -/*---------------------------------------------------------------------------- - * Arduino objects - C++ only - *----------------------------------------------------------------------------*/ - -#endif diff --git a/variants/xiao_ble/xiao-ble-internal-format.uf2 b/variants/xiao_ble/xiao-ble-internal-format.uf2 deleted file mode 100644 index 59de2c68a6a49b308f77a83bb278e89e720860c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122880 zcmd?Sd0bOh-amfs&CSLd78L?&NCYEs31C}XDlvu&f-Pt_t(|Frb|%2g6l>do+KvIV zqSh9{1wpM!ZCxsBX{#2Yt=((q2JH-JeTub`B3*72J=pa|u`x(?PCVObip7~kJE3je1C{Nev?{2jk2<}YEbYp=j>P6BFDG>DgJa$`)`A`!Lt|qrxCvO2F}~CdD&Iwc$Y# zIsj`stQNp(0Diq567e`G8YtR>&0(`<4dr-{ zAXGB;!G6_~Dmu0iHHG5q;aVRW{WXPkMakHQ2g36nI{8ZN8|EmQa(E$<{dlOR-`ew6 zdH5QnQT~7||9W~`Nh-rL1`m2n+Ye1JbR=U+(XF{`pVi5xY^=H5>65H@Egvv0rl-(oP6qRy1Nn-WRu1XwjZ2v} z4k4Xoz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8H{zpg?EhE9VMX8QBw1y@)nFBXdI5#GA7x>GTF;NM{??#xc<+xeulq>j=ZJ zGKP?TY(Kicxg`TP!ps9+GRsm^!xz_9RfGS~-|6GEWO+>qYDnL9z3^WU!v9-*b{K#8 zz)6IS*T_lsZqTAzKc?BU-MSW?<4 zl|5;BlO+XBELjd(wwop6-lC8YvV1>F)`Fe@je3_QcN_?XH|=4``=D0P6MI3wyBvQX z!a&`iaqqAs9YkIFhb;Lu=nc^7orwQYD4b@E`tUU*5kwm?2as z1&A7Ziw32F566c`cT9mfBE zya?*rZ(jMH&M>r6-qf^blW^|B^wTm^_N+>jgk zeOu_7`gcM})jpvrC4dgOTWXsXDKbvrmf&5|i zUCZ8m%|NC;YW{k`7lzzlHLV!FJpIQVj=SP6hwCH<#^1|@BIqT@{(z(R zdF1BWbG`6i6vF?nD2g8Z|M$w}>$u=5RKF{3Eyj&@&{R-5s1A3+)PC8I%T;dVOBfTp zi17gEZV-l#L3J77rH(=xny6?MCodBfVR7Ap9!y4lRxlfb)1HJLz<5E4e$Utw)CYaN z@V_I3|9AM-F#c9@53!R{VkHHnlGNf_P0EQy3dtw)5o#ngh+jm0P9~9?Nfx$DC*aSB zU*pi}8bR6cO(2=LV}vi8=;6lf6p+`=9upfAyq#;eTfc|Gy#QVf_EQ-(dKO1pd|U|3voxPv7o^|Kbq- z-{Y&o`2Q3>O^_K~M&(A~$}xT@1JU!?e~Kty?s0V3p({2N6iDg(@V}qBk2I=Tk_9@6 SzGBepAo%~^{dfsb{Qnd2oeWg~ diff --git a/variants/xiao_ble/xiao_ble.sh b/variants/xiao_ble/xiao_ble.sh deleted file mode 100755 index 2f3cc5390..000000000 --- a/variants/xiao_ble/xiao_ble.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# adapted from the script linked in this very helpful article: https://enzolombardi.net/low-power-bluetooth-advertising-with-xiao-ble-and-platformio-e8e7d0da80d2 - -# source: https://gist.githubusercontent.com/turing-complete-labs/b3105ee653782183c54b4fdbe18f411f/raw/d86779ba7702775d3b79781da63d85442acd9de6/xiao_ble.sh -# download the core for arduino from seeedstudio. Softdevice 7.3.0, linker and variants folder are what we need -curl https://files.seeedstudio.com/arduino/core/nRF52840/Arduino_core_nRF52840.tar.bz2 -o arduino.core.1.0.0.tar.bz2 -tar -xjf arduino.core.1.0.0.tar.bz2 -rm arduino.core.1.0.0.tar.bz2 - -# copy the needed files -cp 1.0.0/cores/nRF5/linker/nrf52840_s140_v7.ld ~/.platformio/packages/framework-arduinoadafruitnrf52/cores/nRF5/linker -cp -r 1.0.0/cores/nRF5/nordic/softdevice/s140_nrf52_7.3.0_API ~/.platformio/packages/framework-arduinoadafruitnrf52/cores/nRF5/nordic/softdevice - -rm -rf 1.0.0 -echo done! diff --git a/variants/xiao_ble/xiao_nrf52840_ble_bootloader-0.7.0-22-g277a0c8_s140_7.3.0.zip b/variants/xiao_ble/xiao_nrf52840_ble_bootloader-0.7.0-22-g277a0c8_s140_7.3.0.zip deleted file mode 100644 index 40b966bafe77aaca21d5408973ae8128e5040e01..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 192586 zcmbrndwdkt`9FSUc6N7mvq@%?2nY$8&4o-N=mt@PQrrX_64VlJt+rM-h<2k^mW#UK zVm1+RgHnTq3R=G|UTT7+W`p^Zs9S@VdTDKExmdKe41R z`^S&hYqDqN+@ABC=RD`RokRWACN7WAe~TXa^AGNSb;3PaNYlrLXT_4+7vFo~l7^Mn z6W^ax_{WfBD!ZxvTa|vf@tSY)SVHKNiAq0fxUcc9J6Ei{@a`2$?^|sb@vmt7ThZlW z`it>($zAu~{=l8fS2QlY4;k(YFPUzXHu6?1y=&!?J0EDgPE4}jrZMtSL3~RBBv+~Exr_;Z6{sm-rH9+uA*fwp6zzKzmtpMeWwY0`EC=9_cgA( z-QRG>J$J6W9oY^40}`X72EYH_#yc8TVnF8%Y}U-#vu0m<+05DJjE@$l|BA-OxEwlcT`?V$LpRwyYfF2JO{hW z?_7q0K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8{3J ztJz1=RmR-7lD{+$uH--MJgypq|I^<>GsnjZ@lvz}KmE%?8(tr^YB-)KMBI`1Xq d;a^LvLT2F-S5zRGTtOKN_& Date: Thu, 19 Jun 2025 18:57:18 -0500 Subject: [PATCH 320/461] [create-pull-request] automated change (#7082) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/config.pb.h | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/protobufs b/protobufs index c758376d0..b818a000e 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit c758376d04cf5d3d42de24f9388836a18bae9a76 +Subproject commit b818a000ef50e8a2cfb28d33f63717dcae1ace2f diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index 6851d42b1..ed1849be8 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -283,7 +283,9 @@ typedef enum _meshtastic_Config_LoRaConfig_RegionCode { /* Philippines 868mhz */ meshtastic_Config_LoRaConfig_RegionCode_PH_868 = 20, /* Philippines 915mhz */ - meshtastic_Config_LoRaConfig_RegionCode_PH_915 = 21 + meshtastic_Config_LoRaConfig_RegionCode_PH_915 = 21, + /* Australia / New Zealand 433MHz */ + meshtastic_Config_LoRaConfig_RegionCode_ANZ_433 = 22 } meshtastic_Config_LoRaConfig_RegionCode; /* Standard predefined channel settings @@ -679,8 +681,8 @@ extern "C" { #define _meshtastic_Config_DisplayConfig_CompassOrientation_ARRAYSIZE ((meshtastic_Config_DisplayConfig_CompassOrientation)(meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270_INVERTED+1)) #define _meshtastic_Config_LoRaConfig_RegionCode_MIN meshtastic_Config_LoRaConfig_RegionCode_UNSET -#define _meshtastic_Config_LoRaConfig_RegionCode_MAX meshtastic_Config_LoRaConfig_RegionCode_PH_915 -#define _meshtastic_Config_LoRaConfig_RegionCode_ARRAYSIZE ((meshtastic_Config_LoRaConfig_RegionCode)(meshtastic_Config_LoRaConfig_RegionCode_PH_915+1)) +#define _meshtastic_Config_LoRaConfig_RegionCode_MAX meshtastic_Config_LoRaConfig_RegionCode_ANZ_433 +#define _meshtastic_Config_LoRaConfig_RegionCode_ARRAYSIZE ((meshtastic_Config_LoRaConfig_RegionCode)(meshtastic_Config_LoRaConfig_RegionCode_ANZ_433+1)) #define _meshtastic_Config_LoRaConfig_ModemPreset_MIN meshtastic_Config_LoRaConfig_ModemPreset_LONG_FAST #define _meshtastic_Config_LoRaConfig_ModemPreset_MAX meshtastic_Config_LoRaConfig_ModemPreset_SHORT_TURBO From 12680ad9cdef4065f8f69f1039e13ef1958eb64c Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 19 Jun 2025 20:35:40 -0500 Subject: [PATCH 321/461] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f34bf1839..a53fe9646 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,4 @@ Join our community and help improve Meshtastic! 🚀 ## Stats ![Alt](https://repobeats.axiom.co/api/embed/8025e56c482ec63541593cc5bd322c19d5c0bdcf.svg "Repobeats analytics image") + From c914a62d93cc0c7169f8540cf169c7545fa238da Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Jun 2025 08:24:02 +1000 Subject: [PATCH 322/461] Update meshtastic/device-ui digest to d99edaf (#7088) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index c2d65ec02..2350716cc 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/301f11e584cbeccf08af923bb2a0e02b669bda0b.zip + https://github.com/meshtastic/device-ui/archive/d99edaf43775c9b235aab20521b034c99e04e4a8.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 7fd12782a15dacb75c207cf0d289b9208145fd60 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Jun 2025 19:33:31 -0500 Subject: [PATCH 323/461] Bump release version (#7083) * automated bumps * Update version.properties * Update changelog * Update org.meshtastic.meshtasticd.metainfo.xml * Update bin/org.meshtastic.meshtasticd.metainfo.xml Co-authored-by: Austin --------- Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> Co-authored-by: Ben Meadors Co-authored-by: Austin --- protobufs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protobufs b/protobufs index b818a000e..6791138f0 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit b818a000ef50e8a2cfb28d33f63717dcae1ace2f +Subproject commit 6791138f0ba2b7c471072bd4bba6cbb8bacffe2d From 2cf7e51061caab0359109442f7121ca24f9f83aa Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 20 Jun 2025 20:55:57 -0500 Subject: [PATCH 324/461] Version bump the old fashion way --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 2 +- version.properties | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 35a39e570..4b07f6388 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.0 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.13 diff --git a/debian/changelog b/debian/changelog index f7786e939..d607be68c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.6.13.0) UNRELEASED; urgency=medium +meshtasticd (2.7.0.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging diff --git a/version.properties b/version.properties index 384df78ba..91c81a0c9 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 -minor = 6 -build = 13 +minor = 7 +build = 0 From 14421c36096c5d3944a28f3e3314a2fb6ae082a8 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Sat, 21 Jun 2025 12:39:42 +1000 Subject: [PATCH 325/461] Add ANZ_433 Region (#7036) As reported by @monkeypants, the MY_433 region is not legal in ANZ due to power limits being too high. This patch introduced an ANZ_433 region to match the requirements in Australia and New Zealand. 433.05 - 434.79 MHz, 25mW EIRP max, No duty cycle restrictions AU Low Interference Potential https://www.acma.gov.au/licences/low-interference-potential-devices-lipd-class-licence NZ General User Radio Licence for Short Range Devices https://gazette.govt.nz/notice/id/2022-go3100 Fixes https://github.com/meshtastic/firmware/issues/7032#issuecomment-2972013077 Co-authored-by: Jonathan Bennett --- src/mesh/RadioInterface.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 06398e6c3..f7cd6f4c1 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -64,6 +64,13 @@ const RegionInfo regions[] = { */ RDEF(ANZ, 915.0f, 928.0f, 100, 0, 30, true, false, false), + /* + 433.05 - 434.79 MHz, 25mW EIRP max, No duty cycle restrictions + AU Low Interference Potential https://www.acma.gov.au/licences/low-interference-potential-devices-lipd-class-licence + NZ General User Radio Licence for Short Range Devices https://gazette.govt.nz/notice/id/2022-go3100 + */ + RDEF(ANZ_433, 433.05f, 434.79f, 100, 0, 14, true, false, false), + /* https://digital.gov.ru/uploaded/files/prilozhenie-12-k-reshenyu-gkrch-18-46-03-1.pdf From 30bbb449dbdb76e0bceaab12effae40299cffd0f Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 20 Jun 2025 23:59:45 -0400 Subject: [PATCH 326/461] Specify branch for create-pull-request (#7090) --- .github/workflows/release_channels.yml | 1 + .github/workflows/update_protobufs.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/release_channels.yml b/.github/workflows/release_channels.yml index 6f216b411..aac57fcbf 100644 --- a/.github/workflows/release_channels.yml +++ b/.github/workflows/release_channels.yml @@ -98,6 +98,7 @@ jobs: uses: peter-evans/create-pull-request@v7 with: base: ${{ github.event.repository.default_branch }} + branch: create-pull-request/bump-version title: Bump release version commit-message: automated bumps add-paths: | diff --git a/.github/workflows/update_protobufs.yml b/.github/workflows/update_protobufs.yml index 5aa295b89..ccdcc19ae 100644 --- a/.github/workflows/update_protobufs.yml +++ b/.github/workflows/update_protobufs.yml @@ -33,6 +33,7 @@ jobs: - name: Create pull request uses: peter-evans/create-pull-request@v7 with: + branch: create-pull-request/update-protobufs title: Update protobufs and classes add-paths: | protobufs From 82b7cb5dd0344ce0161e033158a6271d8054c827 Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Sat, 21 Jun 2025 19:17:46 +0800 Subject: [PATCH 327/461] fix(xiao_ble): Typo preventing SX1262 init (SX126X_CS gets stuck) (#7094) Signed-off-by: Andrew Yong --- variants/seeed_xiao_nrf52840_kit/variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/seeed_xiao_nrf52840_kit/variant.h b/variants/seeed_xiao_nrf52840_kit/variant.h index 48967d1f8..d2bbfdda9 100644 --- a/variants/seeed_xiao_nrf52840_kit/variant.h +++ b/variants/seeed_xiao_nrf52840_kit/variant.h @@ -201,7 +201,7 @@ static const uint8_t SCL = PIN_WIRE_SCL; * - SX1262X CS on XIAO BLE legacy pinout */ -#if !defined(GPS_L76K) && !defined(SEEED_XIAO_WIO_BTB) && !defined(XIAO_BLE_OLD_PINOUT) +#if !defined(GPS_L76K) && !defined(SEEED_XIAO_WIO_BTB) && !defined(XIAO_BLE_LEGACY_PINOUT) #define BUTTON_PIN D0 #endif From 4feaec651f9addde16c1b299c693faba670bb058 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 21 Jun 2025 06:36:04 -0500 Subject: [PATCH 328/461] Unify the native display config between legacy display and MUI (#6838) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add missed include * Another Warning fix * Add another HAS_SCREEN * Namespace fixes * Removed depricated destination types and re-factored destination screen * Get rid of Arduino Strings * Clean up after Copilot * SixthLine Def, Screen Rename Added Sixth Line Definition Screen Rename, and Automatic Line Adjustment * Consistency is hard - fixed "Sixth" * System Frame Updates Adjusted line construction to ensure we fit maximum content per screen. * Fix up notifications * Add a couple more ifdef HAS_SCREEN lines * Add screen->isOverlayBannerShowing() * Don't forget the invert! * Adjust Nodelist Center Divider Adjust Nodelist Center Divider * Fix variable casting * Fix entryText variable as empty before update to fix validation * Altitude is int32_t * Update PowerTelemetry to have correct data type * Fix cppcheck warnings (#6945) * Fix cppcheck warnings * Adjust logic in Power.cpp for power sensor --------- Co-authored-by: Jason P * More pixel wrangling so things line up NodeList edition * Adjust NodeList alignments and plumb some background padding for a possible title fix * Better alignment for banner notifications * Move title into drawCommonHeader; initial screen tested * Fonts make spacing items difficult * Improved beeping booping and other buzzer based feedback (#6947) * Improved beeping booping and other buzzer based feedback * audible button feedback (#6949) * Refactor --------- Co-authored-by: todd-herbert * Sandpapered the corners of the notification popup * Finalize drawCommonHeader migration * Update Title of Favorite Node Screens * Update node metric alignment on LoRa screen * Update the border for popups to separate it from background * Update PaxcounterModule.cpp with CommonHeader * Update WiFi screen with CommonHeader and related data reflow * It was not, in fact, pointing up * Fix build on wismeshtap * T-deck trackball debounce * Fix uptime on Device Focused page to actually detail * Update Sys screen for new uptime, add label to Freq/Chan on LoRa * Don't display DOP any longer, make Uptime consistent * Revert Uptime change on Favorites, Apply to Device Focused * Label the satelite number to avoid confusion * Boop boop boop boop * Correct GPS positioning and string consistency across strings for GPS * Fix GPS text alignment * Enable canned messages by default * Don't wake screen on new nodes * Cannedmessage list emote support added * Fn+e emote picker for freetext screen * Actually block CannedInput actions while display is shown * Add selection menu to bannerOverlay * Off by one * Move to unified text layouts and spacing * Still my Fav without an "e" * Fully remove EVENT_NODEDB_UPDATED * Simply LoRa screen * Make some char pointers const to fix compilation on native targets * Update drawCompassNorth to include radius * Fix warning * button thread cleanup * Pull OneButton handling from PowerFSM and add MUI switch (#6973) * Trunk * Onebutton Menu Support * Add temporary clock icon * Add gps location to fsi * Banner message state reset * Cast to char to satisfy compiler * Better fast handling of input during banner * Fix warning * Derp * oops * Update ref * Wire buzzer_mode * remove legacy string->print() * Only init screen if one found * Unsigned Char * More buttonThread cleaning * screen.cpp button handling cleanup * The Great Event Rename of 2025 * Fix the Radiomaster * Missed trackball type change * Remove unused function * Make ButtonThread an InputBroker * Coffee hadn't kicked in yet * Add clock icon for Navigation Bar * Restore clock screen definition code - whoops * ExternalNotifications now observe inputBroker * Clock rework (#6992) * Move Clock bits into ClockRenderer space * Rework clock into all device navigation * T-Watch Actually Builds Different * Compile fix --------- Co-authored-by: Jonathan Bennett * Add AM/PM to Digital Clock * Flip Seconds and AM/PM on Clock Display * Tik-tok pixels are hard * Fix builds on Thinknode M1 * Check for GPS and don't crash * Don't endif til the end * Rework the OneButton thread to be much less of a mess. (#6997) * Rework the OneButton thread to be much less of a mess. And break lots of targets temporarily * Update src/input/ButtonThread.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix GPS toggle * Send the shutdown event, not just the kbchar * Honor the back button in a notificaiton popup * Draw the right size box for popup with options * Try to un-break all the things --------- Co-authored-by: Ben Meadors Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * 24-hour Clock Should have leading zero, but not 12-hour * Fixup some compile errors * Add intRoutine to ButtonThread init, to get more responsive user button back * Add Timezone picker * Fix Warning * Optionally set the initial selection for the chooser popup * Make back buttons work in canned messages * Drop the wrapper classes * LonPressTime now configurable * Clock Frame can not longer be blank; just add valid time * Back buttons everywhere! * Key Verification confirm banner * Make Elecrow M* top button a back button * Add settings saves * EInk responsiveness fixes * Linux Input Fixes * Add Native Trackball/Joystick support, and move UserButton to Input * No Flight Stick Mode * Send input event * Add Channel Utilization to Device Focused frame * Don't shift screens when we draw new ones * Add showOverlayBanner arguments to no-op * trunk * Default Native trackball to NC * Fix crash in simulator mode * Add longLong button press * Get the args right * Adjust Bluetooth Pairing Screen to account for bottom navigation. * Trackball everywhere, and unPhone buttons * Remap visionmaster secondary button to TB_UP * Kill ScanAndSelect * trunk * No longer need the canned messages input filter * All Canned All the time * Fix stm32 compile error regarding inputBroker * Unify tft lineheights (#7033) * Create variable line heights based upon SCREEN_HEIGHT * Refactor textPositions into method -> getTextPositions * Update SharedUIDisplay.h --------- Co-authored-by: Jason P * Adjust top distance for larger displays * Adjust icon sizes for larger displays * Fix Paxcounter compile errors after code updates * Pixel wrangling to make larger screens fit better * Alert frame has precedence over banner -- for now * Unify on ALT_BUTTON * Align AM/PM to the digit, not the segment on larger displays * Move some global pin defines into configuration.h * Scaffolding for BMM150 9-axis gyro * Alt button behavior * Don't add the blank GPS frames without HAS_GPS * EVENT_NODEDB_UPDATED has been retired * Clean out LOG_WARN messages from debugging * Add dismiss message function * Minor buttonThread cleanup * Add BMM150 support * Clean up last warning from dev * Simplify bmm150 init return logic * Add option to reply to messages * Add minimal menu upon selecting home screen * Move Messages to slot 2, rename GPS to Position, move variables nearer functional usage in Screen.cpp * Properly dismiss message * T-Deck Trackball press is not user button * Add select on favorite frame to launch cannedMessage DM * Minor wording change * Less capital letters * Fix empty message check, time isn't reliable * drop dead code * Make UIRenderer a static class instead of namespace * Fix the select on favorite * Check if message is empty early and then 'return' * Add kb_found, and show the option to launch freetype if appropriate * Ignore impossible touchscreen touches * Auto scroll fix * Move linebreak after "from" for banners to maximize screen usage. * Center "No messages to show" on Message frame * Start consolidating buzzer behavior * Fixed signed / unsigned warning * Cast second parameter of max() to make some targets happy * Cast kbchar to (char) to make arduino string happy * Shorten the notice of "No messages" * Add buzzer mode chooser * Add regionPicker to Lora icon * Reduce line spacing and reorder Position screen to resolve overlapping issues * Update message titles, fix GPS icons, add Back options * Leftover boops * Remove chirp * Make the region selection dismissable when a region is already set * Add read-aloud functionality on messages w/ esp8266sam * "Last Heard" is a better label * tweak the beep * 5 options * properly tear down freetext upon cancel * de-convelute canned messages just a bit * Correct height of Mail icon in navigation bar * Remove unused warning * Consolidate time methods into TimeFormatters * Oops * Change LoRa Picker Cancel to Back * Tweak selection characters on Banner * Message render not scrolling on 5th line * More fixes for message scrolling * Remove the safety next on text overflow - we found that root cause * Add pin definitions to fix compilation for obscure target * Don't let the touchscreen send unitialized kbchar values * Make virtual KB just a bit quicker * No more double tap, swipe! * Left is left, and Right is right * Update horizontal lightning bolt design * Move from solid to dashed separator for Message Frame * Single emote feature fix * Manually sort overlapping elements for now * Freetext and clearer choices * Fix ESP32 InkHUD builds on the unify-tft branch (#7087) * Remove BaseUI branding * Capitalization is fun * Revert Meshtastic Boot Frame Changes * Add ANZ_433 LoRa region to picker * Update settings.json --------- Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> Co-authored-by: Ben Meadors Co-authored-by: Jason P Co-authored-by: todd-herbert Co-authored-by: Thomas Göttgens Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- bin/config-dist.yaml | 25 +- bin/config.d/display-waveshare-1-44.yaml | 26 + platformio.ini | 2 + src/AudioThread.h | 14 + src/ButtonThread.cpp | 467 ---- src/ButtonThread.h | 91 - src/Power.cpp | 17 +- src/PowerFSM.cpp | 53 +- src/PowerFSM.h | 2 +- src/buzz/BuzzerFeedbackThread.cpp | 79 + src/buzz/BuzzerFeedbackThread.h | 24 + src/buzz/buzz.cpp | 76 +- src/buzz/buzz.h | 8 +- src/commands.h | 1 - src/configuration.h | 31 + src/detect/ScanI2C.cpp | 4 +- src/detect/ScanI2C.h | 1 + src/detect/ScanI2CTwoWire.cpp | 1 + src/graphics/Screen.cpp | 2460 ++++------------- src/graphics/Screen.h | 152 +- src/graphics/ScreenGlobals.cpp | 6 + src/graphics/SharedUIDisplay.cpp | 323 +++ src/graphics/SharedUIDisplay.h | 53 + src/graphics/TFTDisplay.cpp | 19 +- src/graphics/TimeFormatters.cpp | 103 + src/graphics/TimeFormatters.h | 26 + src/graphics/draw/ClockRenderer.cpp | 473 ++++ src/graphics/draw/ClockRenderer.h | 33 + src/graphics/draw/CompassRenderer.cpp | 140 + src/graphics/draw/CompassRenderer.h | 36 + src/graphics/draw/DebugRenderer.cpp | 634 +++++ src/graphics/draw/DebugRenderer.h | 38 + src/graphics/draw/DrawRenderers.h | 38 + src/graphics/draw/MessageRenderer.cpp | 392 +++ src/graphics/draw/MessageRenderer.h | 18 + src/graphics/draw/NodeListRenderer.cpp | 595 ++++ src/graphics/draw/NodeListRenderer.h | 69 + src/graphics/draw/NotificationRenderer.cpp | 265 ++ src/graphics/draw/NotificationRenderer.h | 28 + src/graphics/draw/UIRenderer.cpp | 1240 +++++++++ src/graphics/draw/UIRenderer.h | 93 + src/graphics/emotes.cpp | 225 ++ src/graphics/emotes.h | 86 + src/graphics/images.h | 375 ++- src/graphics/niche/InkHUD/Events.cpp | 12 + .../niche/InkHUD/PlatformioConfig.ini | 1 + src/input/ButtonThread.cpp | 318 +++ src/input/ButtonThread.h | 113 + src/input/ExpressLRSFiveWay.cpp | 26 +- src/input/ExpressLRSFiveWay.h | 16 +- src/input/InputBroker.cpp | 2 +- src/input/InputBroker.h | 36 +- src/input/LinuxInput.cpp | 28 +- src/input/RotaryEncoderInterruptBase.cpp | 7 +- src/input/RotaryEncoderInterruptBase.h | 9 +- src/input/RotaryEncoderInterruptImpl1.cpp | 6 +- src/input/ScanAndSelect.cpp | 230 -- src/input/ScanAndSelect.h | 50 - src/input/SerialKeyboard.cpp | 22 +- src/input/TCA8418Keyboard.cpp | 1 - src/input/TCA8418Keyboard.h | 1 - src/input/TouchScreenBase.cpp | 6 +- src/input/TouchScreenBase.h | 1 - src/input/TouchScreenImpl1.cpp | 22 +- src/input/TrackballInterruptBase.cpp | 63 +- src/input/TrackballInterruptBase.h | 18 +- src/input/TrackballInterruptImpl1.cpp | 23 +- src/input/TrackballInterruptImpl1.h | 2 +- src/input/UpDownInterruptBase.cpp | 11 +- src/input/UpDownInterruptBase.h | 10 +- src/input/UpDownInterruptImpl1.cpp | 6 +- src/input/kbI2cBase.cpp | 194 +- src/input/kbMatrixBase.cpp | 28 +- src/main.cpp | 255 +- src/main.h | 2 +- src/mesh/MeshPacketQueue.cpp | 4 +- src/mesh/MeshPacketQueue.h | 2 +- src/mesh/NodeDB.cpp | 19 +- src/mesh/PacketHistory.cpp | 3 +- src/mesh/eth/ethClient.cpp | 4 +- src/mesh/http/ContentHandler.cpp | 3 +- src/mesh/http/WebServer.cpp | 3 +- src/mesh/wifi/WiFiAPClient.cpp | 8 +- src/meshUtils.h | 8 + src/modules/AdminModule.cpp | 60 +- src/modules/AdminModule.h | 1 + src/modules/CannedMessageModule.cpp | 2049 +++++++++----- src/modules/CannedMessageModule.h | 185 +- src/modules/ExternalNotificationModule.cpp | 32 +- src/modules/ExternalNotificationModule.h | 7 + src/modules/KeyVerificationModule.cpp | 310 +++ src/modules/KeyVerificationModule.h | 64 + src/modules/Modules.cpp | 84 +- src/modules/NodeInfoModule.cpp | 7 - src/modules/PositionModule.cpp | 13 +- src/modules/RemoteHardwareModule.cpp | 7 - src/modules/ReplyModule.cpp | 2 - src/modules/SerialModule.cpp | 70 +- src/modules/SystemCommandsModule.cpp | 118 + src/modules/SystemCommandsModule.h | 19 + src/modules/Telemetry/AirQualityTelemetry.cpp | 2 +- .../Telemetry/EnvironmentTelemetry.cpp | 231 +- src/modules/Telemetry/HealthTelemetry.cpp | 25 +- src/modules/Telemetry/PowerTelemetry.cpp | 53 +- src/modules/Telemetry/Sensor/BME680Sensor.cpp | 10 +- src/modules/Telemetry/Sensor/BME680Sensor.h | 2 +- src/modules/WaypointModule.cpp | 22 +- src/modules/esp32/PaxcounterModule.cpp | 21 +- src/motion/AccelerometerThread.h | 4 + src/motion/BMM150Sensor.cpp | 93 + src/motion/BMM150Sensor.h | 57 + src/motion/BMX160Sensor.cpp | 13 +- src/motion/ICM20948Sensor.cpp | 13 +- src/motion/MotionSensor.cpp | 7 +- src/mqtt/MQTT.cpp | 6 +- src/nimble/NimbleBluetooth.cpp | 49 +- src/platform/esp32/WiFiOTA.cpp | 8 +- src/platform/esp32/WiFiOTA.h | 2 +- src/platform/nrf52/NRF52Bluetooth.cpp | 2 +- src/platform/nrf52/architecture.h | 4 - src/platform/portduino/PortduinoGlue.cpp | 70 +- src/platform/portduino/PortduinoGlue.h | 7 +- src/platform/portduino/architecture.h | 11 + src/power.h | 2 +- src/shutdown.h | 4 +- src/sleep.cpp | 4 +- suppressions.txt | 6 +- variants/ELECROW-ThinkNode-M1/nicheGraphics.h | 13 +- variants/ELECROW-ThinkNode-M1/variant.h | 3 + variants/ELECROW-ThinkNode-M2/variant.h | 4 +- variants/heltec_capsule_sensor_v3/variant.h | 2 + variants/heltec_mesh_node_t114/variant.h | 1 + variants/heltec_sensor_hub/variant.h | 2 + .../heltec_vision_master_e213/nicheGraphics.h | 10 +- variants/heltec_vision_master_e213/variant.h | 4 +- .../heltec_vision_master_e290/nicheGraphics.h | 10 +- variants/heltec_vision_master_e290/variant.h | 4 +- variants/heltec_vision_master_t190/variant.h | 8 +- variants/link32_s3_v1/variant.h | 4 +- variants/nano-g1-explorer/variant.h | 4 +- variants/nano-g1/variant.h | 4 +- variants/picomputer-s3/platformio.ini | 18 +- variants/portduino/platformio.ini | 7 +- .../seeed-sensecap-indicator/platformio.ini | 10 +- variants/seeed-sensecap-indicator/variant.h | 5 +- variants/seeed_wio_tracker_L1/variant.h | 14 +- variants/station-g1/variant.h | 4 +- variants/t-deck/platformio.ini | 7 +- variants/t-deck/variant.h | 11 +- variants/t-echo/variant.h | 4 + variants/tbeam-s3-core/variant.h | 2 - variants/tbeam/variant.h | 4 +- variants/unphone/platformio.ini | 13 +- variants/unphone/variant.h | 10 +- 154 files changed, 9852 insertions(+), 4501 deletions(-) create mode 100644 bin/config.d/display-waveshare-1-44.yaml delete mode 100644 src/ButtonThread.cpp delete mode 100644 src/ButtonThread.h create mode 100644 src/buzz/BuzzerFeedbackThread.cpp create mode 100644 src/buzz/BuzzerFeedbackThread.h create mode 100644 src/graphics/ScreenGlobals.cpp create mode 100644 src/graphics/SharedUIDisplay.cpp create mode 100644 src/graphics/SharedUIDisplay.h create mode 100644 src/graphics/TimeFormatters.cpp create mode 100644 src/graphics/TimeFormatters.h create mode 100644 src/graphics/draw/ClockRenderer.cpp create mode 100644 src/graphics/draw/ClockRenderer.h create mode 100644 src/graphics/draw/CompassRenderer.cpp create mode 100644 src/graphics/draw/CompassRenderer.h create mode 100644 src/graphics/draw/DebugRenderer.cpp create mode 100644 src/graphics/draw/DebugRenderer.h create mode 100644 src/graphics/draw/DrawRenderers.h create mode 100644 src/graphics/draw/MessageRenderer.cpp create mode 100644 src/graphics/draw/MessageRenderer.h create mode 100644 src/graphics/draw/NodeListRenderer.cpp create mode 100644 src/graphics/draw/NodeListRenderer.h create mode 100644 src/graphics/draw/NotificationRenderer.cpp create mode 100644 src/graphics/draw/NotificationRenderer.h create mode 100644 src/graphics/draw/UIRenderer.cpp create mode 100644 src/graphics/draw/UIRenderer.h create mode 100644 src/graphics/emotes.cpp create mode 100644 src/graphics/emotes.h create mode 100644 src/input/ButtonThread.cpp create mode 100644 src/input/ButtonThread.h delete mode 100644 src/input/ScanAndSelect.cpp delete mode 100644 src/input/ScanAndSelect.h create mode 100644 src/modules/KeyVerificationModule.cpp create mode 100644 src/modules/KeyVerificationModule.h create mode 100644 src/modules/SystemCommandsModule.cpp create mode 100644 src/modules/SystemCommandsModule.h create mode 100644 src/motion/BMM150Sensor.cpp create mode 100644 src/motion/BMM150Sensor.h diff --git a/bin/config-dist.yaml b/bin/config-dist.yaml index 55e8648d9..b40fb85a5 100644 --- a/bin/config-dist.yaml +++ b/bin/config-dist.yaml @@ -96,9 +96,9 @@ Lora: ### Some devices, like the pinedio, may require spidev0.1 as a workaround. # spidev: spidev0.0 -### Define GPIO buttons here: +### Deprecated location for User Button: -GPIO: +#GPIO: # User: 6 ### Define GPS @@ -115,17 +115,6 @@ I2C: Display: -### Waveshare 1.44inch LCD HAT -# Panel: ST7735S -# CS: 8 #Chip Select -# DC: 25 # Data/Command pin -# Backlight: 24 -# Width: 128 -# Height: 128 -# Reset: 27 -# OffsetX: 0 -# OffsetY: 0 - ### Adafruit PiTFT 2.8 TFT+Touchscreen # Panel: ILI9341 # CS: 8 @@ -180,6 +169,16 @@ Input: # KeyboardDevice: /dev/input/by-id/usb-_Raspberry_Pi_Internal_Keyboard-event-kbd +### Standard User Button Config +# UserButton: 6 + +### Trackball/Joystick input +# TrackballUp: 6 +# TrackballDown: 19 +# TrackballLeft: 5 +# TrackballRight: 26 +# TrackballPress: 13 + ### Logging: diff --git a/bin/config.d/display-waveshare-1-44.yaml b/bin/config.d/display-waveshare-1-44.yaml new file mode 100644 index 000000000..1d85a4a3b --- /dev/null +++ b/bin/config.d/display-waveshare-1-44.yaml @@ -0,0 +1,26 @@ +### Waveshare 1.44inch LCD HAT +Display: + Panel: ST7735S + spidev: spidev0.0 # Specify either the spidev here, or the CS below +# CS: 8 #Chip Select # Optional, as this is the default pin for spidev0.0 + DC: 25 # Data/Command pin + Backlight: 24 + Width: 128 + Height: 128 + Reset: 27 + OffsetX: 2 + OffsetY: 1 + + +# OffsetY: 31 # These two options are used to properly flip the screen 180 degrees +# OffsetRotate: 3 + + +Input: + TrackballUp: 6 + TrackballDown: 19 + TrackballLeft: 5 + TrackballRight: 26 + TrackballPress: 13 + +# User: 21 diff --git a/platformio.ini b/platformio.ini index 2350716cc..debc77a92 100644 --- a/platformio.ini +++ b/platformio.ini @@ -165,6 +165,8 @@ lib_deps = adafruit/Adafruit LTR390 Library@1.1.2 # renovate: datasource=custom.pio depName=Adafruit PCT2075 packageName=adafruit/library/Adafruit PCT2075 adafruit/Adafruit PCT2075@1.0.5 + # renovate: datasource=custom.pio depName=DFRobot_BMM150 packageName=dfrobot/library/DFRobot_BMM150 + dfrobot/DFRobot_BMM150@1.0.0 ; (not included in native / portduino) [environmental_extra] diff --git a/src/AudioThread.h b/src/AudioThread.h index 04ff64a6e..286729909 100644 --- a/src/AudioThread.h +++ b/src/AudioThread.h @@ -47,6 +47,20 @@ class AudioThread : public concurrency::OSThread setCPUFast(false); } + void readAloud(const char *text) + { + if (i2sRtttl != nullptr) { + i2sRtttl->stop(); + delete i2sRtttl; + i2sRtttl = nullptr; + } + + ESP8266SAM *sam = new ESP8266SAM; + sam->Say(audioOut, text); + delete sam; + setCPUFast(false); + } + protected: int32_t runOnce() override { diff --git a/src/ButtonThread.cpp b/src/ButtonThread.cpp deleted file mode 100644 index 8db52c074..000000000 --- a/src/ButtonThread.cpp +++ /dev/null @@ -1,467 +0,0 @@ -#include "ButtonThread.h" - -#include "configuration.h" -#if !MESHTASTIC_EXCLUDE_GPS -#include "GPS.h" -#endif -#include "MeshService.h" -#include "PowerFSM.h" -#include "RadioLibInterface.h" -#include "buzz.h" -#include "main.h" -#include "modules/ExternalNotificationModule.h" -#include "power.h" -#include "sleep.h" -#ifdef ARCH_PORTDUINO -#include "platform/portduino/PortduinoGlue.h" -#endif - -#define DEBUG_BUTTONS 0 -#if DEBUG_BUTTONS -#define LOG_BUTTON(...) LOG_DEBUG(__VA_ARGS__) -#else -#define LOG_BUTTON(...) -#endif - -using namespace concurrency; - -ButtonThread *buttonThread; // Declared extern in header -volatile ButtonThread::ButtonEventType ButtonThread::btnEvent = ButtonThread::BUTTON_EVENT_NONE; - -#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO) || defined(USERPREFS_BUTTON_PIN) -OneButton ButtonThread::userButton; // Get reference to static member -#endif -ButtonThread::ButtonThread() : OSThread("Button") -{ -#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO) || defined(USERPREFS_BUTTON_PIN) - -#if defined(ARCH_PORTDUINO) - if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC) { - this->userButton = OneButton(settingsMap[user], true, true); - LOG_DEBUG("Use GPIO%02d for button", settingsMap[user]); - } -#elif defined(BUTTON_PIN) -#if !defined(USERPREFS_BUTTON_PIN) - int pin = config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN; // Resolved button pin -#endif -#ifdef USERPREFS_BUTTON_PIN - int pin = config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN; // Resolved button pin -#endif -#if defined(HELTEC_CAPSULE_SENSOR_V3) || defined(HELTEC_SENSOR_HUB) - this->userButton = OneButton(pin, false, false); -#elif defined(BUTTON_ACTIVE_LOW) - this->userButton = OneButton(pin, BUTTON_ACTIVE_LOW, BUTTON_ACTIVE_PULLUP); -#else - this->userButton = OneButton(pin, true, true); -#endif - LOG_DEBUG("Use GPIO%02d for button", pin); -#endif - -#ifdef INPUT_PULLUP_SENSE - // Some platforms (nrf52) have a SENSE variant which allows wake from sleep - override what OneButton did -#ifdef BUTTON_SENSE_TYPE - pinMode(pin, BUTTON_SENSE_TYPE); -#else - pinMode(pin, INPUT_PULLUP_SENSE); -#endif -#endif - -#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO) || defined(USERPREFS_BUTTON_PIN) - userButton.attachClick(userButtonPressed); - userButton.setClickMs(BUTTON_CLICK_MS); - userButton.setPressMs(BUTTON_LONGPRESS_MS); - userButton.setDebounceMs(1); - userButton.attachDoubleClick(userButtonDoublePressed); - userButton.attachMultiClick(userButtonMultiPressed, this); // Reference to instance: get click count from non-static OneButton -#if !defined(T_DECK) && \ - !defined( \ - ELECROW_ThinkNode_M2) // T-Deck immediately wakes up after shutdown, Thinknode M2 has this on the smaller ALT button - userButton.attachLongPressStart(userButtonPressedLongStart); - userButton.attachLongPressStop(userButtonPressedLongStop); -#endif -#endif - -#ifdef BUTTON_PIN_ALT -#if defined(ELECROW_ThinkNode_M2) - this->userButtonAlt = OneButton(BUTTON_PIN_ALT, false, false); -#else - this->userButtonAlt = OneButton(BUTTON_PIN_ALT, true, true); -#endif -#ifdef INPUT_PULLUP_SENSE - // Some platforms (nrf52) have a SENSE variant which allows wake from sleep - override what OneButton did - pinMode(BUTTON_PIN_ALT, INPUT_PULLUP_SENSE); -#endif - userButtonAlt.attachClick(userButtonPressedScreen); - userButtonAlt.setClickMs(BUTTON_CLICK_MS); - userButtonAlt.setPressMs(BUTTON_LONGPRESS_MS); - userButtonAlt.setDebounceMs(1); - userButtonAlt.attachLongPressStart(userButtonPressedLongStart); - userButtonAlt.attachLongPressStop(userButtonPressedLongStop); -#endif - -#ifdef BUTTON_PIN_TOUCH - userButtonTouch = OneButton(BUTTON_PIN_TOUCH, true, true); - userButtonTouch.setPressMs(BUTTON_TOUCH_MS); - userButtonTouch.attachLongPressStart(touchPressedLongStart); // Better handling with longpress than click? -#endif - -#ifdef ARCH_ESP32 - // Register callbacks for before and after lightsleep - // Used to detach and reattach interrupts - lsObserver.observe(¬ifyLightSleep); - lsEndObserver.observe(¬ifyLightSleepEnd); -#endif - - attachButtonInterrupts(); -#endif -} - -void ButtonThread::switchPage() -{ -#ifdef BUTTON_PIN -#if !defined(USERPREFS_BUTTON_PIN) - if (((config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN) != - moduleConfig.canned_message.inputbroker_pin_press) || - !(moduleConfig.canned_message.updown1_enabled || moduleConfig.canned_message.rotary1_enabled) || - !moduleConfig.canned_message.enabled) { - powerFSM.trigger(EVENT_PRESS); - } -#endif -#if defined(USERPREFS_BUTTON_PIN) - if (((config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN) != - moduleConfig.canned_message.inputbroker_pin_press) || - !(moduleConfig.canned_message.updown1_enabled || moduleConfig.canned_message.rotary1_enabled) || - !moduleConfig.canned_message.enabled) { - powerFSM.trigger(EVENT_PRESS); - } -#endif - -#endif -#if defined(ARCH_PORTDUINO) - if ((settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC) && - (settingsMap[user] != moduleConfig.canned_message.inputbroker_pin_press) || - !moduleConfig.canned_message.enabled) { - powerFSM.trigger(EVENT_PRESS); - } -#endif -} - -void ButtonThread::sendAdHocPosition() -{ - service->refreshLocalMeshNode(); - auto sentPosition = service->trySendPosition(NODENUM_BROADCAST, true); - if (screen) { - if (sentPosition) - screen->print("Sent ad-hoc position\n"); - else - screen->print("Sent ad-hoc nodeinfo\n"); - screen->forceDisplay(true); // Force a new UI frame, then force an EInk update - } -} - -int32_t ButtonThread::runOnce() -{ - // If the button is pressed we suppress CPU sleep until release - canSleep = true; // Assume we should not keep the board awake - -#if defined(BUTTON_PIN) || defined(USERPREFS_BUTTON_PIN) - userButton.tick(); - canSleep &= userButton.isIdle(); -#elif defined(ARCH_PORTDUINO) - if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC) { - userButton.tick(); - canSleep &= userButton.isIdle(); - } -#endif -#ifdef BUTTON_PIN_ALT - userButtonAlt.tick(); - canSleep &= userButtonAlt.isIdle(); -#endif -#ifdef BUTTON_PIN_TOUCH - userButtonTouch.tick(); - canSleep &= userButtonTouch.isIdle(); -#endif - - if (btnEvent != BUTTON_EVENT_NONE) { - switch (btnEvent) { - case BUTTON_EVENT_PRESSED: { - LOG_BUTTON("press!"); - // If a nag notification is running, stop it and prevent other actions - if (moduleConfig.external_notification.enabled && (externalNotificationModule->nagCycleCutoff != UINT32_MAX)) { - externalNotificationModule->stopNow(); - break; - } -#ifdef ELECROW_ThinkNode_M1 - sendAdHocPosition(); - break; -#endif - switchPage(); - break; - } - - case BUTTON_EVENT_PRESSED_SCREEN: { - LOG_BUTTON("AltPress!"); -#ifdef ELECROW_ThinkNode_M1 - // If a nag notification is running, stop it and prevent other actions - if (moduleConfig.external_notification.enabled && (externalNotificationModule->nagCycleCutoff != UINT32_MAX)) { - externalNotificationModule->stopNow(); - break; - } - switchPage(); - break; -#endif - // turn screen on or off - screen_flag = !screen_flag; - if (screen) - screen->setOn(screen_flag); - break; - } - - case BUTTON_EVENT_DOUBLE_PRESSED: { - LOG_BUTTON("Double press!"); -#ifdef ELECROW_ThinkNode_M1 - digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW); - break; -#endif - sendAdHocPosition(); - break; - } - - case BUTTON_EVENT_MULTI_PRESSED: { - LOG_BUTTON("Mulitipress! %hux", multipressClickCount); - switch (multipressClickCount) { -#if HAS_GPS && !defined(ELECROW_ThinkNode_M1) - // 3 clicks: toggle GPS - case 3: - if (!config.device.disable_triple_click && (gps != nullptr)) { - gps->toggleGpsMode(); - if (screen) - screen->forceDisplay(true); // Force a new UI frame, then force an EInk update - } - break; -#elif defined(ELECROW_ThinkNode_M1) || defined(ELECROW_ThinkNode_M2) - case 3: - LOG_INFO("3 clicks: toggle buzzer"); - buzzer_flag = !buzzer_flag; - if (!buzzer_flag) - noTone(PIN_BUZZER); - break; - -#endif - -#if defined(USE_EINK) && defined(PIN_EINK_EN) && !defined(ELECROW_ThinkNode_M1) // i.e. T-Echo - // 4 clicks: toggle backlight - case 4: - digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW); - break; -#endif -#if !MESHTASTIC_EXCLUDE_SCREEN && HAS_SCREEN - // 5 clicks: start accelerometer/magenetometer calibration for 30 seconds - case 5: - if (accelerometerThread) { - accelerometerThread->calibrate(30); - } - break; - // 6 clicks: start accelerometer/magenetometer calibration for 60 seconds - case 6: - if (accelerometerThread) { - accelerometerThread->calibrate(60); - } - break; -#endif - // No valid multipress action - default: - break; - } // end switch: click count - - break; - } // end multipress event - - case BUTTON_EVENT_LONG_PRESSED: { - LOG_BUTTON("Long press!"); - powerFSM.trigger(EVENT_PRESS); - if (screen) { - screen->startAlert("Shutting down..."); - } - playBeep(); - break; - } - - // Do actual shutdown when button released, otherwise the button release - // may wake the board immediatedly. - case BUTTON_EVENT_LONG_RELEASED: { - LOG_INFO("Shutdown from long press"); - playShutdownMelody(); - delay(3000); - power->shutdown(); - break; - } - -#ifdef BUTTON_PIN_TOUCH - case BUTTON_EVENT_TOUCH_LONG_PRESSED: { - LOG_BUTTON("Touch press!"); - // Ignore if: no screen - if (!screen) - break; - -#ifdef TTGO_T_ECHO - // Ignore if: TX in progress - // Uncommon T-Echo hardware bug, LoRa TX triggers touch button - if (!RadioLibInterface::instance || RadioLibInterface::instance->isSending()) - break; -#endif - - // Wake if asleep - if (powerFSM.getState() == &stateDARK) - powerFSM.trigger(EVENT_PRESS); - - // Update display (legacy behaviour) - screen->forceDisplay(); - break; - } -#endif // BUTTON_PIN_TOUCH - - default: - break; - } - btnEvent = BUTTON_EVENT_NONE; - } - - return 50; -} - -/* - * Attach (or re-attach) hardware interrupts for buttons - * Public method. Used outside class when waking from MCU sleep - */ -void ButtonThread::attachButtonInterrupts() -{ -#if defined(ARCH_PORTDUINO) - if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC) - wakeOnIrq(settingsMap[user], FALLING); -#elif defined(BUTTON_PIN) - // Interrupt for user button, during normal use. Improves responsiveness. - attachInterrupt( -#if !defined(USERPREFS_BUTTON_PIN) - config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, -#endif -#if defined(USERPREFS_BUTTON_PIN) - config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN, -#endif - []() { - ButtonThread::userButton.tick(); - runASAP = true; - BaseType_t higherWake = 0; - mainDelay.interruptFromISR(&higherWake); - }, - CHANGE); -#endif - -#ifdef BUTTON_PIN_ALT -#ifdef ELECROW_ThinkNode_M2 - wakeOnIrq(BUTTON_PIN_ALT, RISING); -#else - wakeOnIrq(BUTTON_PIN_ALT, FALLING); -#endif -#endif - -#ifdef BUTTON_PIN_TOUCH - wakeOnIrq(BUTTON_PIN_TOUCH, FALLING); -#endif -} - -/* - * Detach the "normal" button interrupts. - * Public method. Used before attaching a "wake-on-button" interrupt for MCU sleep - */ -void ButtonThread::detachButtonInterrupts() -{ -#if defined(ARCH_PORTDUINO) - if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC) - detachInterrupt(settingsMap[user]); -#elif defined(BUTTON_PIN) -#if !defined(USERPREFS_BUTTON_PIN) - detachInterrupt(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN); -#endif -#if defined(USERPREFS_BUTTON_PIN) - detachInterrupt(config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN); -#endif -#endif - -#ifdef BUTTON_PIN_ALT - detachInterrupt(BUTTON_PIN_ALT); -#endif - -#ifdef BUTTON_PIN_TOUCH - detachInterrupt(BUTTON_PIN_TOUCH); -#endif -} - -#ifdef ARCH_ESP32 - -// Detach our class' interrupts before lightsleep -// Allows sleep.cpp to configure its own interrupts, which wake the device on user-button press -int ButtonThread::beforeLightSleep(void *unused) -{ - detachButtonInterrupts(); - return 0; // Indicates success -} - -// Reconfigure our interrupts -// Our class' interrupts were disconnected during sleep, to allow the user button to wake the device from sleep -int ButtonThread::afterLightSleep(esp_sleep_wakeup_cause_t cause) -{ - attachButtonInterrupts(); - return 0; // Indicates success -} - -#endif - -/** - * Watch a GPIO and if we get an IRQ, wake the main thread. - * Use to add wake on button press - */ -void ButtonThread::wakeOnIrq(int irq, int mode) -{ - attachInterrupt( - irq, - [] { - BaseType_t higherWake = 0; - mainDelay.interruptFromISR(&higherWake); - runASAP = true; - }, - FALLING); -} - -// Static callback -void ButtonThread::userButtonMultiPressed(void *callerThread) -{ - // Grab click count from non-static button, while the info is still valid - ButtonThread *thread = (ButtonThread *)callerThread; - thread->storeClickCount(); - - // Then handle later, in the usual way - btnEvent = BUTTON_EVENT_MULTI_PRESSED; -} - -// Non-static method, runs during callback. Grabs info while still valid -void ButtonThread::storeClickCount() -{ -#if defined(BUTTON_PIN) || defined(USERPREFS_BUTTON_PIN) - multipressClickCount = userButton.getNumberClicks(); -#endif -} - -void ButtonThread::userButtonPressedLongStart() -{ - if (millis() > c_holdOffTime) { - btnEvent = BUTTON_EVENT_LONG_PRESSED; - } -} - -void ButtonThread::userButtonPressedLongStop() -{ - if (millis() > c_holdOffTime) { - btnEvent = BUTTON_EVENT_LONG_RELEASED; - } -} \ No newline at end of file diff --git a/src/ButtonThread.h b/src/ButtonThread.h deleted file mode 100644 index 3af700dd0..000000000 --- a/src/ButtonThread.h +++ /dev/null @@ -1,91 +0,0 @@ -#pragma once - -#include "OneButton.h" -#include "concurrency/OSThread.h" -#include "configuration.h" - -#ifndef BUTTON_CLICK_MS -#define BUTTON_CLICK_MS 250 -#endif - -#ifndef BUTTON_LONGPRESS_MS -#define BUTTON_LONGPRESS_MS 5000 -#endif - -#ifndef BUTTON_TOUCH_MS -#define BUTTON_TOUCH_MS 400 -#endif - -class ButtonThread : public concurrency::OSThread -{ - public: - static const uint32_t c_holdOffTime = 30000; // hold off 30s after boot - - enum ButtonEventType { - BUTTON_EVENT_NONE, - BUTTON_EVENT_PRESSED, - BUTTON_EVENT_PRESSED_SCREEN, - BUTTON_EVENT_DOUBLE_PRESSED, - BUTTON_EVENT_MULTI_PRESSED, - BUTTON_EVENT_LONG_PRESSED, - BUTTON_EVENT_LONG_RELEASED, - BUTTON_EVENT_TOUCH_LONG_PRESSED, - }; - - ButtonThread(); - int32_t runOnce() override; - void attachButtonInterrupts(); - void detachButtonInterrupts(); - void storeClickCount(); - bool isBuzzing() { return buzzer_flag; } - void setScreenFlag(bool flag) { screen_flag = flag; } - bool getScreenFlag() { return screen_flag; } - - // Disconnect and reconnect interrupts for light sleep -#ifdef ARCH_ESP32 - int beforeLightSleep(void *unused); - int afterLightSleep(esp_sleep_wakeup_cause_t cause); -#endif - private: -#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO) || defined(USERPREFS_BUTTON_PIN) - static OneButton userButton; // Static - accessed from an interrupt -#endif -#ifdef BUTTON_PIN_ALT - OneButton userButtonAlt; -#endif -#ifdef BUTTON_PIN_TOUCH - OneButton userButtonTouch; -#endif - -#ifdef ARCH_ESP32 - // Get notified when lightsleep begins and ends - CallbackObserver lsObserver = - CallbackObserver(this, &ButtonThread::beforeLightSleep); - CallbackObserver lsEndObserver = - CallbackObserver(this, &ButtonThread::afterLightSleep); -#endif - - // set during IRQ - static volatile ButtonEventType btnEvent; - bool buzzer_flag = false; - bool screen_flag = true; - - // Store click count during callback, for later use - volatile int multipressClickCount = 0; - - static void wakeOnIrq(int irq, int mode); - - static void sendAdHocPosition(); - static void switchPage(); - - // IRQ callbacks - static void userButtonPressed() { btnEvent = BUTTON_EVENT_PRESSED; } - static void userButtonPressedScreen() { btnEvent = BUTTON_EVENT_PRESSED_SCREEN; } - static void userButtonDoublePressed() { btnEvent = BUTTON_EVENT_DOUBLE_PRESSED; } - static void userButtonMultiPressed(void *callerThread); // Retrieve click count from non-static Onebutton while still valid - static void userButtonPressedLongStart(); - static void userButtonPressedLongStop(); - static void touchPressedLongStart() { btnEvent = BUTTON_EVENT_TOUCH_LONG_PRESSED; } -}; - -extern ButtonThread *buttonThread; diff --git a/src/Power.cpp b/src/Power.cpp index a9ed6360e..400b6c6eb 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -661,12 +661,14 @@ bool Power::analogInit() */ bool Power::setup() { - // initialise one power sensor (only) - bool found = axpChipInit(); - if (!found) - found = lipoInit(); - if (!found) - found = analogInit(); + bool found = false; + if (axpChipInit()) { + found = true; + } else if (lipoInit()) { + found = true; + } else if (analogInit()) { + found = true; + } #ifdef NRF_APM found = true; @@ -853,7 +855,8 @@ int32_t Power::runOnce() #ifndef T_WATCH_S3 // FIXME - why is this triggering on the T-Watch S3? if (PMU->isPekeyLongPressIrq()) { LOG_DEBUG("PEK long button press"); - screen->setOn(false); + if (screen) + screen->setOn(false); } #endif diff --git a/src/PowerFSM.cpp b/src/PowerFSM.cpp index dbe4796cf..b3a6b17ef 100644 --- a/src/PowerFSM.cpp +++ b/src/PowerFSM.cpp @@ -82,7 +82,8 @@ static uint32_t secsSlept; static void lsEnter() { LOG_INFO("lsEnter begin, ls_secs=%u", config.power.ls_secs); - screen->setOn(false); + if (screen) + screen->setOn(false); secsSlept = 0; // How long have we been sleeping this time // LOG_INFO("lsEnter end"); @@ -160,7 +161,8 @@ static void lsExit() static void nbEnter() { LOG_DEBUG("State: NB"); - screen->setOn(false); + if (screen) + screen->setOn(false); #ifdef ARCH_ESP32 // Only ESP32 should turn off bluetooth setBluetoothEnable(false); @@ -172,22 +174,23 @@ static void nbEnter() static void darkEnter() { setBluetoothEnable(true); - screen->setOn(false); + if (screen) + screen->setOn(false); } static void serialEnter() { LOG_DEBUG("State: SERIAL"); setBluetoothEnable(false); - screen->setOn(true); - screen->print("Serial connected\n"); + if (screen) { + screen->setOn(true); + } } static void serialExit() { // Turn bluetooth back on when we leave serial stream API setBluetoothEnable(true); - screen->print("Serial disconnected\n"); } static void powerEnter() @@ -198,15 +201,10 @@ static void powerEnter() LOG_INFO("Loss of power in Powered"); powerFSM.trigger(EVENT_POWER_DISCONNECTED); } else { - screen->setOn(true); + if (screen) + screen->setOn(true); setBluetoothEnable(true); // within enter() the function getState() returns the state we came from - - // Mothballed: print change of power-state to device screen - /* if (strcmp(powerFSM.getState()->name, "BOOT") != 0 && strcmp(powerFSM.getState()->name, "POWER") != 0 && - strcmp(powerFSM.getState()->name, "DARK") != 0) { - screen->print("Powered...\n"); - }*/ } } @@ -221,18 +219,16 @@ static void powerIdle() static void powerExit() { - screen->setOn(true); + if (screen) + screen->setOn(true); setBluetoothEnable(true); - - // Mothballed: print change of power-state to device screen - /*if (!isPowered()) - screen->print("Unpowered...\n");*/ } static void onEnter() { LOG_DEBUG("State: ON"); - screen->setOn(true); + if (screen) + screen->setOn(true); setBluetoothEnable(true); } @@ -244,11 +240,6 @@ static void onIdle() } } -static void screenPress() -{ - screen->onPress(); -} - static void bootEnter() { LOG_DEBUG("State: BOOT"); @@ -292,9 +283,9 @@ void PowerFSM_setup() powerFSM.add_transition(&stateLS, &stateON, EVENT_PRESS, NULL, "Press"); powerFSM.add_transition(&stateNB, &stateON, EVENT_PRESS, NULL, "Press"); powerFSM.add_transition(&stateDARK, isPowered() ? &statePOWER : &stateON, EVENT_PRESS, NULL, "Press"); - powerFSM.add_transition(&statePOWER, &statePOWER, EVENT_PRESS, screenPress, "Press"); - powerFSM.add_transition(&stateON, &stateON, EVENT_PRESS, screenPress, "Press"); // reenter On to restart our timers - powerFSM.add_transition(&stateSERIAL, &stateSERIAL, EVENT_PRESS, screenPress, + powerFSM.add_transition(&statePOWER, &statePOWER, EVENT_PRESS, NULL, "Press"); + powerFSM.add_transition(&stateON, &stateON, EVENT_PRESS, NULL, "Press"); // reenter On to restart our timers + powerFSM.add_transition(&stateSERIAL, &stateSERIAL, EVENT_PRESS, NULL, "Press"); // Allow button to work while in serial API // Handle critically low power battery by forcing deep sleep @@ -328,10 +319,10 @@ void PowerFSM_setup() // if any packet destined for phone arrives, turn on bluetooth at least powerFSM.add_transition(&stateNB, &stateDARK, EVENT_PACKET_FOR_PHONE, NULL, "Packet for phone"); - // show the latest node when we get a new node db update - powerFSM.add_transition(&stateNB, &stateON, EVENT_NODEDB_UPDATED, NULL, "NodeDB update"); - powerFSM.add_transition(&stateDARK, &stateON, EVENT_NODEDB_UPDATED, NULL, "NodeDB update"); - powerFSM.add_transition(&stateON, &stateON, EVENT_NODEDB_UPDATED, NULL, "NodeDB update"); + // Removed 2.7: we don't show the nodes individually for every node on the screen anymore + // powerFSM.add_transition(&stateNB, &stateON, EVENT_NODEDB_UPDATED, NULL, "NodeDB update"); + // powerFSM.add_transition(&stateDARK, &stateON, EVENT_NODEDB_UPDATED, NULL, "NodeDB update"); + // powerFSM.add_transition(&stateON, &stateON, EVENT_NODEDB_UPDATED, NULL, "NodeDB update"); // Show the received text message powerFSM.add_transition(&stateLS, &stateON, EVENT_RECEIVED_MSG, NULL, "Received text"); diff --git a/src/PowerFSM.h b/src/PowerFSM.h index 13dfdc4cc..beb233f11 100644 --- a/src/PowerFSM.h +++ b/src/PowerFSM.h @@ -11,7 +11,7 @@ #define EVENT_RECEIVED_MSG 5 // #define EVENT_BOOT 6 // now done with a timed transition #define EVENT_BLUETOOTH_PAIR 7 -#define EVENT_NODEDB_UPDATED 8 // NodeDB has a big enough change that we think you should turn on the screen +// #define EVENT_NODEDB_UPDATED 8 // Now defunct: NodeDB has a big enough change that we think you should turn on the screen #define EVENT_CONTACT_FROM_PHONE 9 // the phone just talked to us over bluetooth #define EVENT_LOW_BATTERY 10 // Battery is critically low, go to sleep #define EVENT_SERIAL_CONNECTED 11 diff --git a/src/buzz/BuzzerFeedbackThread.cpp b/src/buzz/BuzzerFeedbackThread.cpp new file mode 100644 index 000000000..2bd3158a3 --- /dev/null +++ b/src/buzz/BuzzerFeedbackThread.cpp @@ -0,0 +1,79 @@ +#include "BuzzerFeedbackThread.h" +#include "NodeDB.h" +#include "buzz.h" +#include "configuration.h" + +BuzzerFeedbackThread *buzzerFeedbackThread; + +BuzzerFeedbackThread::BuzzerFeedbackThread() : OSThread("BuzzerFeedback") +{ + if (inputBroker) + inputObserver.observe(inputBroker); +} + +int BuzzerFeedbackThread::handleInputEvent(const InputEvent *event) +{ + // Only provide feedback if buzzer is enabled for notifications + if (config.device.buzzer_mode == meshtastic_Config_DeviceConfig_BuzzerMode_DISABLED || + config.device.buzzer_mode == meshtastic_Config_DeviceConfig_BuzzerMode_NOTIFICATIONS_ONLY) { + return 0; // Let other handlers process the event + } + + // Track last event time for potential future use + lastEventTime = millis(); + needsUpdate = true; + + // Handle different input events with appropriate buzzer feedback + switch (event->inputEvent) { + case INPUT_BROKER_USER_PRESS: + case INPUT_BROKER_ALT_PRESS: + case INPUT_BROKER_SELECT: + playBeep(); // Confirmation feedback + break; + + case INPUT_BROKER_UP: + case INPUT_BROKER_DOWN: + case INPUT_BROKER_LEFT: + case INPUT_BROKER_RIGHT: + playChirp(); // Navigation feedback + break; + + case INPUT_BROKER_CANCEL: + case INPUT_BROKER_BACK: + playBoop(); // Cancel/back feedback + break; + + case INPUT_BROKER_SEND_PING: + playComboTune(); // Ping sent feedback + break; + + case INPUT_BROKER_SHUTDOWN: + playShutdownMelody(); // Shutdown feedback + break; + + default: + // For other events, check if it's a printable character + if (event->kbchar >= 32 && event->kbchar <= 126) { + // Typing feedback - very short boop + // Removing this for now, too chatty + // playChirp(); + } + break; + } + + return 0; // Allow other handlers to process the event +} + +int32_t BuzzerFeedbackThread::runOnce() +{ + // This thread is primarily event-driven, but we can use runOnce + // for any periodic tasks if needed in the future + + if (needsUpdate) { + needsUpdate = false; + // Could add any periodic processing here + } + + // Run every 100ms when active, less frequently when idle + return needsUpdate ? 100 : 1000; +} diff --git a/src/buzz/BuzzerFeedbackThread.h b/src/buzz/BuzzerFeedbackThread.h new file mode 100644 index 000000000..dedea9860 --- /dev/null +++ b/src/buzz/BuzzerFeedbackThread.h @@ -0,0 +1,24 @@ +#pragma once + +#include "Observer.h" +#include "concurrency/OSThread.h" +#include "input/InputBroker.h" + +class BuzzerFeedbackThread : public concurrency::OSThread +{ + CallbackObserver inputObserver = + CallbackObserver(this, &BuzzerFeedbackThread::handleInputEvent); + + public: + BuzzerFeedbackThread(); + int handleInputEvent(const InputEvent *event); + + protected: + virtual int32_t runOnce() override; + + private: + uint32_t lastEventTime = 0; + bool needsUpdate = false; +}; + +extern BuzzerFeedbackThread *buzzerFeedbackThread; diff --git a/src/buzz/buzz.cpp b/src/buzz/buzz.cpp index 6ba2f4140..b09d7a82c 100644 --- a/src/buzz/buzz.cpp +++ b/src/buzz/buzz.cpp @@ -38,6 +38,11 @@ const int DURATION_1_1 = 1000; // 1/1 note void playTones(const ToneDuration *tone_durations, int size) { + if (config.device.buzzer_mode == meshtastic_Config_DeviceConfig_BuzzerMode_DISABLED || + config.device.buzzer_mode == meshtastic_Config_DeviceConfig_BuzzerMode_NOTIFICATIONS_ONLY) { + // Buzzer is disabled or not set to system tones + return; + } #ifdef PIN_BUZZER if (!config.device.buzzer_gpio) config.device.buzzer_gpio = PIN_BUZZER; @@ -54,7 +59,7 @@ void playTones(const ToneDuration *tone_durations, int size) void playBeep() { - ToneDuration melody[] = {{NOTE_B3, DURATION_1_4}}; + ToneDuration melody[] = {{NOTE_B3, DURATION_1_8}}; playTones(melody, sizeof(melody) / sizeof(ToneDuration)); } @@ -87,3 +92,72 @@ void playShutdownMelody() ToneDuration melody[] = {{NOTE_CS4, DURATION_1_8}, {NOTE_AS3, DURATION_1_8}, {NOTE_FS3, DURATION_1_4}}; playTones(melody, sizeof(melody) / sizeof(ToneDuration)); } + +void playChirp() +{ + // A short, friendly "chirp" sound for key presses + ToneDuration melody[] = {{NOTE_AS3, 20}}; // Very short AS3 note + playTones(melody, sizeof(melody) / sizeof(ToneDuration)); +} + +void playBoop() +{ + // A short, friendly "boop" sound for button presses + ToneDuration melody[] = {{NOTE_A3, 50}}; // Very short A3 note + playTones(melody, sizeof(melody) / sizeof(ToneDuration)); +} + +void playLongPressLeadUp() +{ + // An ascending lead-up sequence for long press - builds anticipation + ToneDuration melody[] = { + {NOTE_C3, 100}, // Start low + {NOTE_E3, 100}, // Step up + {NOTE_G3, 100}, // Keep climbing + {NOTE_B3, 150} // Peak with longer note for emphasis + }; + playTones(melody, sizeof(melody) / sizeof(ToneDuration)); +} + +// Static state for progressive lead-up notes +static int leadUpNoteIndex = 0; +static const ToneDuration leadUpNotes[] = { + {NOTE_C3, 100}, // Start low + {NOTE_E3, 100}, // Step up + {NOTE_G3, 100}, // Keep climbing + {NOTE_B3, 150} // Peak with longer note for emphasis +}; +static const int leadUpNotesCount = sizeof(leadUpNotes) / sizeof(ToneDuration); + +bool playNextLeadUpNote() +{ + if (leadUpNoteIndex >= leadUpNotesCount) { + return false; // All notes have been played + } + + // Use playTones to handle buzzer logic consistently + const auto ¬e = leadUpNotes[leadUpNoteIndex]; + playTones(¬e, 1); // Play single note using existing playTones function + + leadUpNoteIndex++; + return true; // Note was played (playTones handles buzzer availability internally) +} + +void resetLeadUpSequence() +{ + leadUpNoteIndex = 0; +} + +void playComboTune() +{ + // Quick high-pitched notes with trills + ToneDuration melody[] = { + {NOTE_G3, 80}, // Quick chirp + {NOTE_B3, 60}, // Higher chirp + {NOTE_CS4, 80}, // Even higher + {NOTE_G3, 60}, // Quick trill down + {NOTE_CS4, 60}, // Quick trill up + {NOTE_B3, 120} // Ending chirp + }; + playTones(melody, sizeof(melody) / sizeof(ToneDuration)); +} diff --git a/src/buzz/buzz.h b/src/buzz/buzz.h index adeaca73d..c25a54a5b 100644 --- a/src/buzz/buzz.h +++ b/src/buzz/buzz.h @@ -5,4 +5,10 @@ void playLongBeep(); void playStartMelody(); void playShutdownMelody(); void playGPSEnableBeep(); -void playGPSDisableBeep(); \ No newline at end of file +void playGPSDisableBeep(); +void playComboTune(); +void playBoop(); +void playChirp(); +void playLongPressLeadUp(); +bool playNextLeadUpNote(); // Play the next note in the lead-up sequence +void resetLeadUpSequence(); // Reset the lead-up sequence to start from beginning \ No newline at end of file diff --git a/src/commands.h b/src/commands.h index f2b783010..e0bfab330 100644 --- a/src/commands.h +++ b/src/commands.h @@ -12,7 +12,6 @@ enum class Cmd { STOP_ALERT_FRAME, START_FIRMWARE_UPDATE_SCREEN, STOP_BOOT_SCREEN, - PRINT, SHOW_PREV_FRAME, SHOW_NEXT_FRAME }; \ No newline at end of file diff --git a/src/configuration.h b/src/configuration.h index 33e014c5e..89257ff2f 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -207,6 +207,7 @@ along with this program. If not, see . #define BMX160_ADDR 0x69 #define ICM20948_ADDR 0x69 #define ICM20948_ADDR_ALT 0x68 +#define BMM150_ADDR 0x13 // ----------------------------------------------------------------------------- // LED @@ -347,11 +348,41 @@ along with this program. If not, see . #error HW_VENDOR must be defined #endif +#ifndef TB_DOWN +#define TB_DOWN 255 +#endif +#ifndef TB_UP +#define TB_UP 255 +#endif +#ifndef TB_LEFT +#define TB_LEFT 255 +#endif +#ifndef TB_RIGHT +#define TB_RIGHT 255 +#endif +#ifndef TB_PRESS +#define TB_PRESS 255 +#endif + // Support multiple RGB LED configuration #if defined(HAS_NCP5623) || defined(HAS_LP5562) || defined(RGBLED_RED) || defined(HAS_NEOPIXEL) || defined(UNPHONE) #define HAS_RGB_LED #endif +// default mapping of pins +#if defined(PIN_BUTTON2) && !defined(CANCEL_BUTTON_PIN) +#define ALT_BUTTON_PIN PIN_BUTTON2 +#endif +#if defined ALT_BUTTON_PIN + +#ifndef ALT_BUTTON_ACTIVE_LOW +#define ALT_BUTTON_ACTIVE_LOW true +#endif +#ifndef ALT_BUTTON_ACTIVE_PULLUP +#define ALT_BUTTON_ACTIVE_PULLUP true +#endif +#endif + // ----------------------------------------------------------------------------- // Global switches to turn off features for a minimized build // ----------------------------------------------------------------------------- diff --git a/src/detect/ScanI2C.cpp b/src/detect/ScanI2C.cpp index 5bd5c0d12..e6236251c 100644 --- a/src/detect/ScanI2C.cpp +++ b/src/detect/ScanI2C.cpp @@ -37,8 +37,8 @@ ScanI2C::FoundDevice ScanI2C::firstKeyboard() const ScanI2C::FoundDevice ScanI2C::firstAccelerometer() const { - ScanI2C::DeviceType types[] = {MPU6050, LIS3DH, BMA423, LSM6DS3, BMX160, STK8BAXX, ICM20948, QMA6100P}; - return firstOfOrNONE(8, types); + ScanI2C::DeviceType types[] = {MPU6050, LIS3DH, BMA423, LSM6DS3, BMX160, STK8BAXX, ICM20948, QMA6100P, BMM150}; + return firstOfOrNONE(9, types); } ScanI2C::FoundDevice ScanI2C::firstRGBLED() const diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index 1e91933a9..90467abd0 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -73,6 +73,7 @@ class ScanI2C RAK12035, TCA8418KB, PCT2075, + BMM150, } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 09f320908..fd3d1c80b 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -447,6 +447,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) SCAN_SIMPLE_CASE(DFROBOT_RAIN_ADDR, DFROBOT_RAIN, "DFRobot Rain Gauge", (uint8_t)addr.address); SCAN_SIMPLE_CASE(LTR390UV_ADDR, LTR390UV, "LTR390UV", (uint8_t)addr.address); SCAN_SIMPLE_CASE(PCT2075_ADDR, PCT2075, "PCT2075", (uint8_t)addr.address); + SCAN_SIMPLE_CASE(BMM150_ADDR, BMM150, "BMM150", (uint8_t)addr.address); #ifdef HAS_TPS65233 SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233", (uint8_t)addr.address); #endif diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 61999ee79..975cf71a9 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1,9 +1,10 @@ /* +BaseUI -SSD1306 - Screen module - -Copyright (C) 2018 by Xose Pérez - +Developed and Maintained By: +- Ronald Garcia (HarukiToreda) – Lead development and implementation. +- JasonP (Xaositek) – Screen layout and icon design, UI improvements and testing. +- TonyG (Tropho) – Project management, structural planning, and testing This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,18 +28,30 @@ along with this program. If not, see . #include #include "DisplayFormatters.h" +#include "TimeFormatters.h" +#include "draw/ClockRenderer.h" +#include "draw/DebugRenderer.h" +#include "draw/MessageRenderer.h" +#include "draw/NodeListRenderer.h" +#include "draw/NotificationRenderer.h" +#include "draw/UIRenderer.h" +#include "modules/CannedMessageModule.h" + #if !MESHTASTIC_EXCLUDE_GPS #include "GPS.h" +#include "buzz.h" #endif -#include "ButtonThread.h" +#include "FSCommon.h" #include "MeshService.h" #include "NodeDB.h" +#include "RadioLibInterface.h" #include "error.h" #include "gps/GeoCoord.h" #include "gps/RTC.h" #include "graphics/ScreenFonts.h" +#include "graphics/SharedUIDisplay.h" +#include "graphics/emotes.h" #include "graphics/images.h" -#include "input/ScanAndSelect.h" #include "input/TouchScreenImpl1.h" #include "main.h" #include "mesh-pb-constants.h" @@ -52,13 +65,15 @@ along with this program. If not, see . #include "sleep.h" #include "target_specific.h" +using graphics::Emote; +using graphics::emotes; +using graphics::numEmotes; + #if HAS_WIFI && !defined(ARCH_PORTDUINO) #include "mesh/wifi/WiFiAPClient.h" #endif #ifdef ARCH_ESP32 -#include "esp_task_wdt.h" -#include "modules/StoreForwardModule.h" #endif #if ARCH_PORTDUINO @@ -82,14 +97,10 @@ namespace graphics // A text message frame + debug frame + all the node infos FrameCallback *normalFrames; static uint32_t targetFramerate = IDLE_FRAMERATE; +// Global variables for alert banner - explicitly define with extern "C" linkage to prevent optimization uint32_t logo_timeout = 5000; // 4 seconds for EACH logo -uint32_t hours_in_month = 730; - -// This image definition is here instead of images.h because it's modified dynamically by the drawBattery function -uint8_t imgBattery[16] = {0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xE7, 0x3C}; - // Threshold values for the GPS lock accuracy bar display uint32_t dopThresholds[5] = {2000, 1000, 500, 200, 100}; @@ -97,13 +108,9 @@ uint32_t dopThresholds[5] = {2000, 1000, 500, 200, 100}; // we'll need to hold onto pointers for the modules that can draw a frame. std::vector moduleFrames; -// Stores the last 4 of our hardware ID, to make finding the device for pairing easier -static char ourId[5]; - -// vector where symbols (string) are displayed in bottom corner of display. +// Global variables for screen function overlay symbols std::vector functionSymbol; -// string displayed in bottom right corner of display. Created from elements in functionSymbol vector -std::string functionSymbolString = ""; +std::string functionSymbolString; #if HAS_GPS // GeoCoord object for the screen @@ -114,258 +121,38 @@ GeoCoord geoCoord; static bool heartbeat = false; #endif -// Quick access to screen dimensions from static drawing functions -// DEPRECATED. To-do: move static functions inside Screen class -#define SCREEN_WIDTH display->getWidth() -#define SCREEN_HEIGHT display->getHeight() - #include "graphics/ScreenFonts.h" #include -#define getStringCenteredX(s) ((SCREEN_WIDTH - display->getStringWidth(s)) / 2) +// Usage: int stringWidth = formatDateTime(datetimeStr, sizeof(datetimeStr), rtc_sec, display); +// End Functions to write date/time to the screen -// Check if the display can render a string (detect special chars; emoji) -static bool haveGlyphs(const char *str) +extern bool hasUnreadMessage; + +// ============================== +// Overlay Alert Banner Renderer +// ============================== +// Displays a temporary centered banner message (e.g., warning, status, etc.) +// The banner appears in the center of the screen and disappears after the specified duration + +// Called to trigger a banner with custom message and duration +void Screen::showOverlayBanner(const char *message, uint32_t durationMs, uint8_t options, std::function bannerCallback, + int8_t InitialSelected) { -#if defined(OLED_PL) || defined(OLED_UA) || defined(OLED_RU) || defined(OLED_CS) - // Don't want to make any assumptions about custom language support - return true; -#endif - - // Check each character with the lookup function for the OLED library - // We're not really meant to use this directly.. - bool have = true; - for (uint16_t i = 0; i < strlen(str); i++) { - uint8_t result = Screen::customFontTableLookup((uint8_t)str[i]); - // If font doesn't support a character, it is substituted for ¿ - if (result == 191 && (uint8_t)str[i] != 191) { - have = false; - break; - } - } - - LOG_DEBUG("haveGlyphs=%d", have); - return have; + // Store the message and set the expiration timestamp + strncpy(NotificationRenderer::alertBannerMessage, message, 255); + NotificationRenderer::alertBannerMessage[255] = '\0'; // Ensure null termination + NotificationRenderer::alertBannerUntil = (durationMs == 0) ? 0 : millis() + durationMs; + NotificationRenderer::alertBannerOptions = options; + NotificationRenderer::alertBannerCallback = bannerCallback; + NotificationRenderer::curSelected = InitialSelected; + NotificationRenderer::pauseBanner = false; + static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawAlertBannerOverlay}; + ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); + setFastFramerate(); // Draw ASAP + ui->update(); } -/** - * Draw the icon with extra info printed around the corners - */ -static void drawIconScreen(const char *upperMsg, OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - // draw an xbm image. - // Please note that everything that should be transitioned - // needs to be drawn relative to x and y - - // draw centered icon left to right and centered above the one line of app text - display->drawXbm(x + (SCREEN_WIDTH - icon_width) / 2, y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - icon_height) / 2 + 2, - icon_width, icon_height, icon_bits); - - display->setFont(FONT_MEDIUM); - display->setTextAlignment(TEXT_ALIGN_LEFT); - const char *title = "meshtastic.org"; - display->drawString(x + getStringCenteredX(title), y + SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM, title); - display->setFont(FONT_SMALL); - - // Draw region in upper left - if (upperMsg) - display->drawString(x + 0, y + 0, upperMsg); - - // Draw version and short name in upper right - char buf[25]; - snprintf(buf, sizeof(buf), "%s\n%s", xstr(APP_VERSION_SHORT), haveGlyphs(owner.short_name) ? owner.short_name : ""); - - display->setTextAlignment(TEXT_ALIGN_RIGHT); - display->drawString(x + SCREEN_WIDTH, y + 0, buf); - screen->forceDisplay(); - - display->setTextAlignment(TEXT_ALIGN_LEFT); // Restore left align, just to be kind to any other unsuspecting code -} - -#ifdef USERPREFS_OEM_TEXT - -static void drawOEMIconScreen(const char *upperMsg, OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - static const uint8_t xbm[] = USERPREFS_OEM_IMAGE_DATA; - display->drawXbm(x + (SCREEN_WIDTH - USERPREFS_OEM_IMAGE_WIDTH) / 2, - y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - USERPREFS_OEM_IMAGE_HEIGHT) / 2 + 2, USERPREFS_OEM_IMAGE_WIDTH, - USERPREFS_OEM_IMAGE_HEIGHT, xbm); - - switch (USERPREFS_OEM_FONT_SIZE) { - case 0: - display->setFont(FONT_SMALL); - break; - case 2: - display->setFont(FONT_LARGE); - break; - default: - display->setFont(FONT_MEDIUM); - break; - } - - display->setTextAlignment(TEXT_ALIGN_LEFT); - const char *title = USERPREFS_OEM_TEXT; - display->drawString(x + getStringCenteredX(title), y + SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM, title); - display->setFont(FONT_SMALL); - - // Draw region in upper left - if (upperMsg) - display->drawString(x + 0, y + 0, upperMsg); - - // Draw version and shortname in upper right - char buf[25]; - snprintf(buf, sizeof(buf), "%s\n%s", xstr(APP_VERSION_SHORT), haveGlyphs(owner.short_name) ? owner.short_name : ""); - - display->setTextAlignment(TEXT_ALIGN_RIGHT); - display->drawString(x + SCREEN_WIDTH, y + 0, buf); - screen->forceDisplay(); - - display->setTextAlignment(TEXT_ALIGN_LEFT); // Restore left align, just to be kind to any other unsuspecting code -} - -static void drawOEMBootScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - // Draw region in upper left - const char *region = myRegion ? myRegion->name : NULL; - drawOEMIconScreen(region, display, state, x, y); -} - -#endif - -void Screen::drawFrameText(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y, const char *message) -{ - uint16_t x_offset = display->width() / 2; - display->setTextAlignment(TEXT_ALIGN_CENTER); - display->setFont(FONT_MEDIUM); - display->drawString(x_offset + x, 26 + y, message); -} - -// Used on boot when a certificate is being created -static void drawSSLScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - display->setTextAlignment(TEXT_ALIGN_CENTER); - display->setFont(FONT_SMALL); - display->drawString(64 + x, y, "Creating SSL certificate"); - -#ifdef ARCH_ESP32 - yield(); - esp_task_wdt_reset(); -#endif - - display->setFont(FONT_SMALL); - if ((millis() / 1000) % 2) { - display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Please wait . . ."); - } else { - display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Please wait . . "); - } -} - -// Used when booting without a region set -static void drawWelcomeScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - display->setFont(FONT_SMALL); - display->setTextAlignment(TEXT_ALIGN_CENTER); - display->drawString(64 + x, y, "//\\ E S H T /\\ S T / C"); - display->drawString(64 + x, y + FONT_HEIGHT_SMALL, getDeviceName()); - display->setTextAlignment(TEXT_ALIGN_LEFT); - - if ((millis() / 10000) % 2) { - display->drawString(x, y + FONT_HEIGHT_SMALL * 2 - 3, "Set the region using the"); - display->drawString(x, y + FONT_HEIGHT_SMALL * 3 - 3, "Meshtastic Android, iOS,"); - display->drawString(x, y + FONT_HEIGHT_SMALL * 4 - 3, "Web or CLI clients."); - } else { - display->drawString(x, y + FONT_HEIGHT_SMALL * 2 - 3, "Visit meshtastic.org"); - display->drawString(x, y + FONT_HEIGHT_SMALL * 3 - 3, "for more information."); - display->drawString(x, y + FONT_HEIGHT_SMALL * 4 - 3, ""); - } - -#ifdef ARCH_ESP32 - yield(); - esp_task_wdt_reset(); -#endif -} - -// draw overlay in bottom right corner of screen to show when notifications are muted or modifier key is active -static void drawFunctionOverlay(OLEDDisplay *display, OLEDDisplayUiState *state) -{ - // LOG_DEBUG("Draw function overlay"); - if (functionSymbol.begin() != functionSymbol.end()) { - char buf[64]; - display->setFont(FONT_SMALL); - snprintf(buf, sizeof(buf), "%s", functionSymbolString.c_str()); - display->drawString(SCREEN_WIDTH - display->getStringWidth(buf), SCREEN_HEIGHT - FONT_HEIGHT_SMALL, buf); - } -} - -#ifdef USE_EINK -/// Used on eink displays while in deep sleep -static void drawDeepSleepScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - - // Next frame should use full-refresh, and block while running, else device will sleep before async callback - EINK_ADD_FRAMEFLAG(display, COSMETIC); - EINK_ADD_FRAMEFLAG(display, BLOCKING); - - LOG_DEBUG("Draw deep sleep screen"); - - // Display displayStr on the screen - drawIconScreen("Sleeping", display, state, x, y); -} - -/// Used on eink displays when screen updates are paused -static void drawScreensaverOverlay(OLEDDisplay *display, OLEDDisplayUiState *state) -{ - LOG_DEBUG("Draw screensaver overlay"); - - EINK_ADD_FRAMEFLAG(display, COSMETIC); // Take the opportunity for a full-refresh - - // Config - display->setFont(FONT_SMALL); - display->setTextAlignment(TEXT_ALIGN_LEFT); - const char *pauseText = "Screen Paused"; - const char *idText = owner.short_name; - const bool useId = haveGlyphs(idText); // This bool is used to hide the idText box if we can't render the short name - constexpr uint16_t padding = 5; - constexpr uint8_t dividerGap = 1; - constexpr uint8_t imprecision = 5; // How far the box origins can drift from center. Combat burn-in. - - // Dimensions - const uint16_t idTextWidth = display->getStringWidth(idText, strlen(idText), true); // "true": handle utf8 chars - const uint16_t pauseTextWidth = display->getStringWidth(pauseText, strlen(pauseText)); - const uint16_t boxWidth = padding + (useId ? idTextWidth + padding + padding : 0) + pauseTextWidth + padding; - const uint16_t boxHeight = padding + FONT_HEIGHT_SMALL + padding; - - // Position - const int16_t boxLeft = (display->width() / 2) - (boxWidth / 2) + random(-imprecision, imprecision + 1); - // const int16_t boxRight = boxLeft + boxWidth - 1; - const int16_t boxTop = (display->height() / 2) - (boxHeight / 2 + random(-imprecision, imprecision + 1)); - const int16_t boxBottom = boxTop + boxHeight - 1; - const int16_t idTextLeft = boxLeft + padding; - const int16_t idTextTop = boxTop + padding; - const int16_t pauseTextLeft = boxLeft + (useId ? padding + idTextWidth + padding : 0) + padding; - const int16_t pauseTextTop = boxTop + padding; - const int16_t dividerX = boxLeft + padding + idTextWidth + padding; - const int16_t dividerTop = boxTop + 1 + dividerGap; - const int16_t dividerBottom = boxBottom - 1 - dividerGap; - - // Draw: box - display->setColor(EINK_WHITE); - display->fillRect(boxLeft - 1, boxTop - 1, boxWidth + 2, boxHeight + 2); // Clear a slightly oversized area for the box - display->setColor(EINK_BLACK); - display->drawRect(boxLeft, boxTop, boxWidth, boxHeight); - - // Draw: Text - if (useId) - display->drawString(idTextLeft, idTextTop, idText); - display->drawString(pauseTextLeft, pauseTextTop, pauseText); - display->drawString(pauseTextLeft + 1, pauseTextTop, pauseText); // Faux bold - - // Draw: divider - if (useId) - display->drawLine(dividerX, dividerTop, dividerX, dividerBottom); -} -#endif - static void drawModuleFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { uint8_t module_frame; @@ -388,875 +175,12 @@ static void drawModuleFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int pi.drawFrame(display, state, x, y); } -static void drawFrameFirmware(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - display->setTextAlignment(TEXT_ALIGN_CENTER); - display->setFont(FONT_MEDIUM); - display->drawString(64 + x, y, "Updating"); - - display->setFont(FONT_SMALL); - display->setTextAlignment(TEXT_ALIGN_LEFT); - display->drawStringMaxWidth(0 + x, 2 + y + FONT_HEIGHT_SMALL * 2, x + display->getWidth(), - "Please be patient and do not power off."); -} - -/// Draw the last text message we received -static void drawCriticalFaultFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - display->setTextAlignment(TEXT_ALIGN_LEFT); - display->setFont(FONT_MEDIUM); - - char tempBuf[24]; - snprintf(tempBuf, sizeof(tempBuf), "Critical fault #%d", error_code); - display->drawString(0 + x, 0 + y, tempBuf); - display->setTextAlignment(TEXT_ALIGN_LEFT); - display->setFont(FONT_SMALL); - display->drawString(0 + x, FONT_HEIGHT_MEDIUM + y, "For help, please visit \nmeshtastic.org"); -} - // Ignore messages originating from phone (from the current node 0x0) unless range test or store and forward module are enabled static bool shouldDrawMessage(const meshtastic_MeshPacket *packet) { return packet->from != 0 && !moduleConfig.store_forward.enabled; } -// Draw power bars or a charging indicator on an image of a battery, determined by battery charge voltage or percentage. -static void drawBattery(OLEDDisplay *display, int16_t x, int16_t y, uint8_t *imgBuffer, const PowerStatus *powerStatus) -{ - static const uint8_t powerBar[3] = {0x81, 0xBD, 0xBD}; - static const uint8_t lightning[8] = {0xA1, 0xA1, 0xA5, 0xAD, 0xB5, 0xA5, 0x85, 0x85}; - // Clear the bar area on the battery image - for (int i = 1; i < 14; i++) { - imgBuffer[i] = 0x81; - } - // If charging, draw a charging indicator - if (powerStatus->getIsCharging()) { - memcpy(imgBuffer + 3, lightning, 8); - // If not charging, Draw power bars - } else { - for (int i = 0; i < 4; i++) { - if (powerStatus->getBatteryChargePercent() >= 25 * i) - memcpy(imgBuffer + 1 + (i * 3), powerBar, 3); - } - } - display->drawFastImage(x, y, 16, 8, imgBuffer); -} - -#if defined(DISPLAY_CLOCK_FRAME) - -void Screen::drawWatchFaceToggleButton(OLEDDisplay *display, int16_t x, int16_t y, bool digitalMode, float scale) -{ - uint16_t segmentWidth = SEGMENT_WIDTH * scale; - uint16_t segmentHeight = SEGMENT_HEIGHT * scale; - - if (digitalMode) { - uint16_t radius = (segmentWidth + (segmentHeight * 2) + 4) / 2; - uint16_t centerX = (x + segmentHeight + 2) + (radius / 2); - uint16_t centerY = (y + segmentHeight + 2) + (radius / 2); - - display->drawCircle(centerX, centerY, radius); - display->drawCircle(centerX, centerY, radius + 1); - display->drawLine(centerX, centerY, centerX, centerY - radius + 3); - display->drawLine(centerX, centerY, centerX + radius - 3, centerY); - } else { - uint16_t segmentOneX = x + segmentHeight + 2; - uint16_t segmentOneY = y; - - uint16_t segmentTwoX = segmentOneX + segmentWidth + 2; - uint16_t segmentTwoY = segmentOneY + segmentHeight + 2; - - uint16_t segmentThreeX = segmentOneX; - uint16_t segmentThreeY = segmentTwoY + segmentWidth + 2; - - uint16_t segmentFourX = x; - uint16_t segmentFourY = y + segmentHeight + 2; - - drawHorizontalSegment(display, segmentOneX, segmentOneY, segmentWidth, segmentHeight); - drawVerticalSegment(display, segmentTwoX, segmentTwoY, segmentWidth, segmentHeight); - drawHorizontalSegment(display, segmentThreeX, segmentThreeY, segmentWidth, segmentHeight); - drawVerticalSegment(display, segmentFourX, segmentFourY, segmentWidth, segmentHeight); - } -} - -// Draw a digital clock -void Screen::drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - display->setTextAlignment(TEXT_ALIGN_LEFT); - - drawBattery(display, x, y + 7, imgBattery, powerStatus); - - if (powerStatus->getHasBattery()) { - String batteryPercent = String(powerStatus->getBatteryChargePercent()) + "%"; - - display->setFont(FONT_SMALL); - - display->drawString(x + 20, y + 2, batteryPercent); - } - - if (nimbleBluetooth && nimbleBluetooth->isConnected()) { - drawBluetoothConnectedIcon(display, display->getWidth() - 18, y + 2); - } - - drawWatchFaceToggleButton(display, display->getWidth() - 36, display->getHeight() - 36, screen->digitalWatchFace, 1); - - display->setColor(OLEDDISPLAY_COLOR::WHITE); - - uint32_t rtc_sec = getValidTime(RTCQuality::RTCQualityDevice, true); // Display local timezone - if (rtc_sec > 0) { - long hms = rtc_sec % SEC_PER_DAY; - hms = (hms + SEC_PER_DAY) % SEC_PER_DAY; - - int hour = hms / SEC_PER_HOUR; - int minute = (hms % SEC_PER_HOUR) / SEC_PER_MIN; - int second = (hms % SEC_PER_HOUR) % SEC_PER_MIN; // or hms % SEC_PER_MIN - - hour = hour > 12 ? hour - 12 : hour; - - if (hour == 0) { - hour = 12; - } - - // hours string - String hourString = String(hour); - - // minutes string - String minuteString = minute < 10 ? "0" + String(minute) : String(minute); - - String timeString = hourString + ":" + minuteString; - - // seconds string - String secondString = second < 10 ? "0" + String(second) : String(second); - - float scale = 1.5; - - uint16_t segmentWidth = SEGMENT_WIDTH * scale; - uint16_t segmentHeight = SEGMENT_HEIGHT * scale; - - // calculate hours:minutes string width - uint16_t timeStringWidth = timeString.length() * 5; - - for (uint8_t i = 0; i < timeString.length(); i++) { - String character = String(timeString[i]); - - if (character == ":") { - timeStringWidth += segmentHeight; - } else { - timeStringWidth += segmentWidth + (segmentHeight * 2) + 4; - } - } - - // calculate seconds string width - uint16_t secondStringWidth = (secondString.length() * 12) + 4; - - // sum these to get total string width - uint16_t totalWidth = timeStringWidth + secondStringWidth; - - uint16_t hourMinuteTextX = (display->getWidth() / 2) - (totalWidth / 2); - - uint16_t startingHourMinuteTextX = hourMinuteTextX; - - uint16_t hourMinuteTextY = (display->getHeight() / 2) - (((segmentWidth * 2) + (segmentHeight * 3) + 8) / 2); - - // iterate over characters in hours:minutes string and draw segmented characters - for (uint8_t i = 0; i < timeString.length(); i++) { - String character = String(timeString[i]); - - if (character == ":") { - drawSegmentedDisplayColon(display, hourMinuteTextX, hourMinuteTextY, scale); - - hourMinuteTextX += segmentHeight + 6; - } else { - drawSegmentedDisplayCharacter(display, hourMinuteTextX, hourMinuteTextY, character.toInt(), scale); - - hourMinuteTextX += segmentWidth + (segmentHeight * 2) + 4; - } - - hourMinuteTextX += 5; - } - - // draw seconds string - display->setFont(FONT_MEDIUM); - display->drawString(startingHourMinuteTextX + timeStringWidth + 4, - (display->getHeight() - hourMinuteTextY) - FONT_HEIGHT_MEDIUM + 6, secondString); - } -} - -void Screen::drawSegmentedDisplayColon(OLEDDisplay *display, int x, int y, float scale) -{ - uint16_t segmentWidth = SEGMENT_WIDTH * scale; - uint16_t segmentHeight = SEGMENT_HEIGHT * scale; - - uint16_t cellHeight = (segmentWidth * 2) + (segmentHeight * 3) + 8; - - uint16_t topAndBottomX = x + (4 * scale); - - uint16_t quarterCellHeight = cellHeight / 4; - - uint16_t topY = y + quarterCellHeight; - uint16_t bottomY = y + (quarterCellHeight * 3); - - display->fillRect(topAndBottomX, topY, segmentHeight, segmentHeight); - display->fillRect(topAndBottomX, bottomY, segmentHeight, segmentHeight); -} - -void Screen::drawSegmentedDisplayCharacter(OLEDDisplay *display, int x, int y, uint8_t number, float scale) -{ - // the numbers 0-9, each expressed as an array of seven boolean (0|1) values encoding the on/off state of - // segment {innerIndex + 1} - // e.g., to display the numeral '0', segments 1-6 are on, and segment 7 is off. - uint8_t numbers[10][7] = { - {1, 1, 1, 1, 1, 1, 0}, // 0 Display segment key - {0, 1, 1, 0, 0, 0, 0}, // 1 1 - {1, 1, 0, 1, 1, 0, 1}, // 2 ___ - {1, 1, 1, 1, 0, 0, 1}, // 3 6 | | 2 - {0, 1, 1, 0, 0, 1, 1}, // 4 |_7̲_| - {1, 0, 1, 1, 0, 1, 1}, // 5 5 | | 3 - {1, 0, 1, 1, 1, 1, 1}, // 6 |___| - {1, 1, 1, 0, 0, 1, 0}, // 7 - {1, 1, 1, 1, 1, 1, 1}, // 8 4 - {1, 1, 1, 1, 0, 1, 1}, // 9 - }; - - // the width and height of each segment's central rectangle: - // _____________________ - // ⋰| (only this part, |⋱ - // ⋰ | not including | ⋱ - // ⋱ | the triangles | ⋰ - // ⋱| on the ends) |⋰ - // ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - - uint16_t segmentWidth = SEGMENT_WIDTH * scale; - uint16_t segmentHeight = SEGMENT_HEIGHT * scale; - - // segment x and y coordinates - uint16_t segmentOneX = x + segmentHeight + 2; - uint16_t segmentOneY = y; - - uint16_t segmentTwoX = segmentOneX + segmentWidth + 2; - uint16_t segmentTwoY = segmentOneY + segmentHeight + 2; - - uint16_t segmentThreeX = segmentTwoX; - uint16_t segmentThreeY = segmentTwoY + segmentWidth + 2 + segmentHeight + 2; - - uint16_t segmentFourX = segmentOneX; - uint16_t segmentFourY = segmentThreeY + segmentWidth + 2; - - uint16_t segmentFiveX = x; - uint16_t segmentFiveY = segmentThreeY; - - uint16_t segmentSixX = x; - uint16_t segmentSixY = segmentTwoY; - - uint16_t segmentSevenX = segmentOneX; - uint16_t segmentSevenY = segmentTwoY + segmentWidth + 2; - - if (numbers[number][0]) { - drawHorizontalSegment(display, segmentOneX, segmentOneY, segmentWidth, segmentHeight); - } - - if (numbers[number][1]) { - drawVerticalSegment(display, segmentTwoX, segmentTwoY, segmentWidth, segmentHeight); - } - - if (numbers[number][2]) { - drawVerticalSegment(display, segmentThreeX, segmentThreeY, segmentWidth, segmentHeight); - } - - if (numbers[number][3]) { - drawHorizontalSegment(display, segmentFourX, segmentFourY, segmentWidth, segmentHeight); - } - - if (numbers[number][4]) { - drawVerticalSegment(display, segmentFiveX, segmentFiveY, segmentWidth, segmentHeight); - } - - if (numbers[number][5]) { - drawVerticalSegment(display, segmentSixX, segmentSixY, segmentWidth, segmentHeight); - } - - if (numbers[number][6]) { - drawHorizontalSegment(display, segmentSevenX, segmentSevenY, segmentWidth, segmentHeight); - } -} - -void Screen::drawHorizontalSegment(OLEDDisplay *display, int x, int y, int width, int height) -{ - int halfHeight = height / 2; - - // draw central rectangle - display->fillRect(x, y, width, height); - - // draw end triangles - display->fillTriangle(x, y, x, y + height - 1, x - halfHeight, y + halfHeight); - - display->fillTriangle(x + width, y, x + width + halfHeight, y + halfHeight, x + width, y + height - 1); -} - -void Screen::drawVerticalSegment(OLEDDisplay *display, int x, int y, int width, int height) -{ - int halfHeight = height / 2; - - // draw central rectangle - display->fillRect(x, y, height, width); - - // draw end triangles - display->fillTriangle(x + halfHeight, y - halfHeight, x + height - 1, y, x, y); - - display->fillTriangle(x, y + width, x + height - 1, y + width, x + halfHeight, y + width + halfHeight); -} - -void Screen::drawBluetoothConnectedIcon(OLEDDisplay *display, int16_t x, int16_t y) -{ - display->drawFastImage(x, y, 18, 14, bluetoothConnectedIcon); -} - -// Draw an analog clock -void Screen::drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - display->setTextAlignment(TEXT_ALIGN_LEFT); - - drawBattery(display, x, y + 7, imgBattery, powerStatus); - - if (powerStatus->getHasBattery()) { - String batteryPercent = String(powerStatus->getBatteryChargePercent()) + "%"; - - display->setFont(FONT_SMALL); - - display->drawString(x + 20, y + 2, batteryPercent); - } - - if (nimbleBluetooth && nimbleBluetooth->isConnected()) { - drawBluetoothConnectedIcon(display, display->getWidth() - 18, y + 2); - } - - drawWatchFaceToggleButton(display, display->getWidth() - 36, display->getHeight() - 36, screen->digitalWatchFace, 1); - - // clock face center coordinates - int16_t centerX = display->getWidth() / 2; - int16_t centerY = display->getHeight() / 2; - - // clock face radius - int16_t radius = (display->getWidth() / 2) * 0.8; - - // noon (0 deg) coordinates (outermost circle) - int16_t noonX = centerX; - int16_t noonY = centerY - radius; - - // second hand radius and y coordinate (outermost circle) - int16_t secondHandNoonY = noonY + 1; - - // tick mark outer y coordinate; (first nested circle) - int16_t tickMarkOuterNoonY = secondHandNoonY; - - // seconds tick mark inner y coordinate; (second nested circle) - double secondsTickMarkInnerNoonY = (double)noonY + 8; - - // hours tick mark inner y coordinate; (third nested circle) - double hoursTickMarkInnerNoonY = (double)noonY + 16; - - // minute hand y coordinate - int16_t minuteHandNoonY = secondsTickMarkInnerNoonY + 4; - - // hour string y coordinate - int16_t hourStringNoonY = minuteHandNoonY + 18; - - // hour hand radius and y coordinate - int16_t hourHandRadius = radius * 0.55; - int16_t hourHandNoonY = centerY - hourHandRadius; - - display->setColor(OLEDDISPLAY_COLOR::WHITE); - display->drawCircle(centerX, centerY, radius); - - uint32_t rtc_sec = getValidTime(RTCQuality::RTCQualityDevice, true); // Display local timezone - if (rtc_sec > 0) { - long hms = rtc_sec % SEC_PER_DAY; - hms = (hms + SEC_PER_DAY) % SEC_PER_DAY; - - // Tear apart hms into h:m:s - int hour = hms / SEC_PER_HOUR; - int minute = (hms % SEC_PER_HOUR) / SEC_PER_MIN; - int second = (hms % SEC_PER_HOUR) % SEC_PER_MIN; // or hms % SEC_PER_MIN - - hour = hour > 12 ? hour - 12 : hour; - - int16_t degreesPerHour = 30; - int16_t degreesPerMinuteOrSecond = 6; - - double hourBaseAngle = hour * degreesPerHour; - double hourAngleOffset = ((double)minute / 60) * degreesPerHour; - double hourAngle = radians(hourBaseAngle + hourAngleOffset); - - double minuteBaseAngle = minute * degreesPerMinuteOrSecond; - double minuteAngleOffset = ((double)second / 60) * degreesPerMinuteOrSecond; - double minuteAngle = radians(minuteBaseAngle + minuteAngleOffset); - - double secondAngle = radians(second * degreesPerMinuteOrSecond); - - double hourX = sin(-hourAngle) * (hourHandNoonY - centerY) + noonX; - double hourY = cos(-hourAngle) * (hourHandNoonY - centerY) + centerY; - - double minuteX = sin(-minuteAngle) * (minuteHandNoonY - centerY) + noonX; - double minuteY = cos(-minuteAngle) * (minuteHandNoonY - centerY) + centerY; - - double secondX = sin(-secondAngle) * (secondHandNoonY - centerY) + noonX; - double secondY = cos(-secondAngle) * (secondHandNoonY - centerY) + centerY; - - display->setFont(FONT_MEDIUM); - - // draw minute and hour tick marks and hour numbers - for (uint16_t angle = 0; angle < 360; angle += 6) { - double angleInRadians = radians(angle); - - double sineAngleInRadians = sin(-angleInRadians); - double cosineAngleInRadians = cos(-angleInRadians); - - double endX = sineAngleInRadians * (tickMarkOuterNoonY - centerY) + noonX; - double endY = cosineAngleInRadians * (tickMarkOuterNoonY - centerY) + centerY; - - if (angle % degreesPerHour == 0) { - double startX = sineAngleInRadians * (hoursTickMarkInnerNoonY - centerY) + noonX; - double startY = cosineAngleInRadians * (hoursTickMarkInnerNoonY - centerY) + centerY; - - // draw hour tick mark - display->drawLine(startX, startY, endX, endY); - - static char buffer[2]; - - uint8_t hourInt = (angle / 30); - - if (hourInt == 0) { - hourInt = 12; - } - - // hour number x offset needs to be adjusted for some cases - int8_t hourStringXOffset; - int8_t hourStringYOffset = 13; - - switch (hourInt) { - case 3: - hourStringXOffset = 5; - break; - case 9: - hourStringXOffset = 7; - break; - case 10: - case 11: - hourStringXOffset = 8; - break; - case 12: - hourStringXOffset = 13; - break; - default: - hourStringXOffset = 6; - break; - } - - double hourStringX = (sineAngleInRadians * (hourStringNoonY - centerY) + noonX) - hourStringXOffset; - double hourStringY = (cosineAngleInRadians * (hourStringNoonY - centerY) + centerY) - hourStringYOffset; - - // draw hour number - display->drawStringf(hourStringX, hourStringY, buffer, "%d", hourInt); - } - - if (angle % degreesPerMinuteOrSecond == 0) { - double startX = sineAngleInRadians * (secondsTickMarkInnerNoonY - centerY) + noonX; - double startY = cosineAngleInRadians * (secondsTickMarkInnerNoonY - centerY) + centerY; - - // draw minute tick mark - display->drawLine(startX, startY, endX, endY); - } - } - - // draw hour hand - display->drawLine(centerX, centerY, hourX, hourY); - - // draw minute hand - display->drawLine(centerX, centerY, minuteX, minuteY); - - // draw second hand - display->drawLine(centerX, centerY, secondX, secondY); - } -} - -#endif - -// Get an absolute time from "seconds ago" info. Returns false if no valid timestamp possible -bool deltaToTimestamp(uint32_t secondsAgo, uint8_t *hours, uint8_t *minutes, int32_t *daysAgo) -{ - // Cache the result - avoid frequent recalculation - static uint8_t hoursCached = 0, minutesCached = 0; - static uint32_t daysAgoCached = 0; - static uint32_t secondsAgoCached = 0; - static bool validCached = false; - - // Abort: if timezone not set - if (strlen(config.device.tzdef) == 0) { - validCached = false; - return validCached; - } - - // Abort: if invalid pointers passed - if (hours == nullptr || minutes == nullptr || daysAgo == nullptr) { - validCached = false; - return validCached; - } - - // Abort: if time seems invalid.. (> 6 months ago, probably seen before RTC set) - if (secondsAgo > SEC_PER_DAY * 30UL * 6) { - validCached = false; - return validCached; - } - - // If repeated request, don't bother recalculating - if (secondsAgo - secondsAgoCached < 60 && secondsAgoCached != 0) { - if (validCached) { - *hours = hoursCached; - *minutes = minutesCached; - *daysAgo = daysAgoCached; - } - return validCached; - } - - // Get local time - uint32_t secondsRTC = getValidTime(RTCQuality::RTCQualityDevice, true); // Get local time - - // Abort: if RTC not set - if (!secondsRTC) { - validCached = false; - return validCached; - } - - // Get absolute time when last seen - uint32_t secondsSeenAt = secondsRTC - secondsAgo; - - // Calculate daysAgo - *daysAgo = (secondsRTC / SEC_PER_DAY) - (secondsSeenAt / SEC_PER_DAY); // How many "midnights" have passed - - // Get seconds since midnight - uint32_t hms = (secondsRTC - secondsAgo) % SEC_PER_DAY; - hms = (hms + SEC_PER_DAY) % SEC_PER_DAY; - - // Tear apart hms into hours and minutes - *hours = hms / SEC_PER_HOUR; - *minutes = (hms % SEC_PER_HOUR) / SEC_PER_MIN; - - // Cache the result - daysAgoCached = *daysAgo; - hoursCached = *hours; - minutesCached = *minutes; - secondsAgoCached = secondsAgo; - - validCached = true; - return validCached; -} - -/// Draw the last text message we received -static void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - // the max length of this buffer is much longer than we can possibly print - static char tempBuf[237]; - - const meshtastic_MeshPacket &mp = devicestate.rx_text_message; - meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(getFrom(&mp)); - // LOG_DEBUG("Draw text message from 0x%x: %s", mp.from, - // mp.decoded.variant.data.decoded.bytes); - - // Demo for drawStringMaxWidth: - // with the third parameter you can define the width after which words will - // be wrapped. Currently only spaces and "-" are allowed for wrapping - display->setTextAlignment(TEXT_ALIGN_LEFT); - display->setFont(FONT_SMALL); - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { - display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL); - display->setColor(BLACK); - } - - // For time delta - uint32_t seconds = sinceReceived(&mp); - uint32_t minutes = seconds / 60; - uint32_t hours = minutes / 60; - uint32_t days = hours / 24; - - // For timestamp - uint8_t timestampHours, timestampMinutes; - int32_t daysAgo; - bool useTimestamp = deltaToTimestamp(seconds, ×tampHours, ×tampMinutes, &daysAgo); - - // If bold, draw twice, shifting right by one pixel - for (uint8_t xOff = 0; xOff <= (config.display.heading_bold ? 1 : 0); xOff++) { - // Show a timestamp if received today, but longer than 15 minutes ago - if (useTimestamp && minutes >= 15 && daysAgo == 0) { - display->drawStringf(xOff + x, 0 + y, tempBuf, "At %02hu:%02hu from %s", timestampHours, timestampMinutes, - (node && node->has_user) ? node->user.short_name : "???"); - } - // Timestamp yesterday (if display is wide enough) - else if (useTimestamp && daysAgo == 1 && display->width() >= 200) { - display->drawStringf(xOff + x, 0 + y, tempBuf, "Yesterday %02hu:%02hu from %s", timestampHours, timestampMinutes, - (node && node->has_user) ? node->user.short_name : "???"); - } - // Otherwise, show a time delta - else { - display->drawStringf(xOff + x, 0 + y, tempBuf, "%s ago from %s", - screen->drawTimeDelta(days, hours, minutes, seconds).c_str(), - (node && node->has_user) ? node->user.short_name : "???"); - } - } - - display->setColor(WHITE); -#ifndef EXCLUDE_EMOJI - const char *msg = reinterpret_cast(mp.decoded.payload.bytes); - if (strcmp(msg, "\U0001F44D") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - thumbs_width) / 2, - y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - thumbs_height) / 2 + 2 + 5, thumbs_width, thumbs_height, - thumbup); - } else if (strcmp(msg, "\U0001F44E") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - thumbs_width) / 2, - y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - thumbs_height) / 2 + 2 + 5, thumbs_width, thumbs_height, - thumbdown); - } else if (strcmp(msg, "\U0001F60A") == 0 || strcmp(msg, "\U0001F600") == 0 || strcmp(msg, "\U0001F642") == 0 || - strcmp(msg, "\U0001F609") == 0 || - strcmp(msg, "\U0001F601") == 0) { // matches 5 different common smileys, so that the phone user doesn't have to - // remember which one is compatible - display->drawXbm(x + (SCREEN_WIDTH - smiley_width) / 2, - y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - smiley_height) / 2 + 2 + 5, smiley_width, smiley_height, - smiley); - } else if (strcmp(msg, "❓") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - question_width) / 2, - y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - question_height) / 2 + 2 + 5, question_width, question_height, - question); - } else if (strcmp(msg, "‼️") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - bang_width) / 2, y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - bang_height) / 2 + 2 + 5, - bang_width, bang_height, bang); - } else if (strcmp(msg, "\U0001F4A9") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - poo_width) / 2, y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - poo_height) / 2 + 2 + 5, - poo_width, poo_height, poo); - } else if (strcmp(msg, "\U0001F923") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - haha_width) / 2, y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - haha_height) / 2 + 2 + 5, - haha_width, haha_height, haha); - } else if (strcmp(msg, "\U0001F44B") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - wave_icon_width) / 2, - y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - wave_icon_height) / 2 + 2 + 5, wave_icon_width, - wave_icon_height, wave_icon); - } else if (strcmp(msg, "\U0001F920") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - cowboy_width) / 2, - y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - cowboy_height) / 2 + 2 + 5, cowboy_width, cowboy_height, - cowboy); - } else if (strcmp(msg, "\U0001F42D") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - deadmau5_width) / 2, - y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - deadmau5_height) / 2 + 2 + 5, deadmau5_width, deadmau5_height, - deadmau5); - } else if (strcmp(msg, "\xE2\x98\x80\xEF\xB8\x8F") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - sun_width) / 2, y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - sun_height) / 2 + 2 + 5, - sun_width, sun_height, sun); - } else if (strcmp(msg, "\u2614") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - rain_width) / 2, y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - rain_height) / 2 + 2 + 10, - rain_width, rain_height, rain); - } else if (strcmp(msg, "☁️") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - cloud_width) / 2, - y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - cloud_height) / 2 + 2 + 5, cloud_width, cloud_height, cloud); - } else if (strcmp(msg, "🌫️") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - fog_width) / 2, y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - fog_height) / 2 + 2 + 5, - fog_width, fog_height, fog); - } else if (strcmp(msg, "\U0001F608") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - devil_width) / 2, - y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - devil_height) / 2 + 2 + 5, devil_width, devil_height, devil); - } else if (strcmp(msg, "♥️") == 0 || strcmp(msg, "\U0001F9E1") == 0 || strcmp(msg, "\U00002763") == 0 || - strcmp(msg, "\U00002764") == 0 || strcmp(msg, "\U0001F495") == 0 || strcmp(msg, "\U0001F496") == 0 || - strcmp(msg, "\U0001F497") == 0 || strcmp(msg, "\U0001F498") == 0) { - display->drawXbm(x + (SCREEN_WIDTH - heart_width) / 2, - y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - heart_height) / 2 + 2 + 5, heart_width, heart_height, heart); - } else { - snprintf(tempBuf, sizeof(tempBuf), "%s", mp.decoded.payload.bytes); - display->drawStringMaxWidth(0 + x, 0 + y + FONT_HEIGHT_SMALL, x + display->getWidth(), tempBuf); - } -#else - snprintf(tempBuf, sizeof(tempBuf), "%s", mp.decoded.payload.bytes); - display->drawStringMaxWidth(0 + x, 0 + y + FONT_HEIGHT_SMALL, x + display->getWidth(), tempBuf); -#endif -} - -/// Draw a series of fields in a column, wrapping to multiple columns if needed -void Screen::drawColumns(OLEDDisplay *display, int16_t x, int16_t y, const char **fields) -{ - // The coordinates define the left starting point of the text - display->setTextAlignment(TEXT_ALIGN_LEFT); - - const char **f = fields; - int xo = x, yo = y; - while (*f) { - display->drawString(xo, yo, *f); - if ((display->getColor() == BLACK) && config.display.heading_bold) - display->drawString(xo + 1, yo, *f); - - display->setColor(WHITE); - yo += FONT_HEIGHT_SMALL; - if (yo > SCREEN_HEIGHT - FONT_HEIGHT_SMALL) { - xo += SCREEN_WIDTH / 2; - yo = 0; - } - f++; - } -} - -// Draw nodes status -static void drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const NodeStatus *nodeStatus) -{ - char usersString[20]; - snprintf(usersString, sizeof(usersString), "%d/%d", nodeStatus->getNumOnline(), nodeStatus->getNumTotal()); -#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS)) && \ - !defined(DISPLAY_FORCE_SMALL_FONTS) - display->drawFastImage(x, y + 3, 8, 8, imgUser); -#else - display->drawFastImage(x, y, 8, 8, imgUser); -#endif - display->drawString(x + 10, y - 2, usersString); - if (config.display.heading_bold) - display->drawString(x + 11, y - 2, usersString); -} -#if HAS_GPS -// Draw GPS status summary -static void drawGPS(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus *gps) -{ - if (config.position.fixed_position) { - // GPS coordinates are currently fixed - display->drawString(x - 1, y - 2, "Fixed GPS"); - if (config.display.heading_bold) - display->drawString(x, y - 2, "Fixed GPS"); - return; - } - if (!gps->getIsConnected()) { - display->drawString(x, y - 2, "No GPS"); - if (config.display.heading_bold) - display->drawString(x + 1, y - 2, "No GPS"); - return; - } - display->drawFastImage(x, y, 6, 8, gps->getHasLock() ? imgPositionSolid : imgPositionEmpty); - if (!gps->getHasLock()) { - display->drawString(x + 8, y - 2, "No sats"); - if (config.display.heading_bold) - display->drawString(x + 9, y - 2, "No sats"); - return; - } else { - char satsString[3]; - uint8_t bar[2] = {0}; - - // Draw DOP signal bars - for (int i = 0; i < 5; i++) { - if (gps->getDOP() <= dopThresholds[i]) - bar[0] = ~((1 << (5 - i)) - 1); - else - bar[0] = 0b10000000; - // bar[1] = bar[0]; - display->drawFastImage(x + 9 + (i * 2), y, 2, 8, bar); - } - - // Draw satellite image - display->drawFastImage(x + 24, y, 8, 8, imgSatellite); - - // Draw the number of satellites - snprintf(satsString, sizeof(satsString), "%u", gps->getNumSatellites()); - display->drawString(x + 34, y - 2, satsString); - if (config.display.heading_bold) - display->drawString(x + 35, y - 2, satsString); - } -} - -// Draw status when GPS is disabled or not present -static void drawGPSpowerstat(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus *gps) -{ - String displayLine; - int pos; - if (y < FONT_HEIGHT_SMALL) { // Line 1: use short string - displayLine = config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT ? "No GPS" : "GPS off"; - pos = SCREEN_WIDTH - display->getStringWidth(displayLine); - } else { - displayLine = config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT ? "GPS not present" - : "GPS is disabled"; - pos = (SCREEN_WIDTH - display->getStringWidth(displayLine)) / 2; - } - display->drawString(x + pos, y, displayLine); -} - -static void drawGPSAltitude(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus *gps) -{ - String displayLine = ""; - if (!gps->getIsConnected() && !config.position.fixed_position) { - // displayLine = "No GPS Module"; - // display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine); - } else if (!gps->getHasLock() && !config.position.fixed_position) { - // displayLine = "No GPS Lock"; - // display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine); - } else { - geoCoord.updateCoords(int32_t(gps->getLatitude()), int32_t(gps->getLongitude()), int32_t(gps->getAltitude())); - displayLine = "Altitude: " + String(geoCoord.getAltitude()) + "m"; - if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) - displayLine = "Altitude: " + String(geoCoord.getAltitude() * METERS_TO_FEET) + "ft"; - display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine); - } -} - -// Draw GPS status coordinates -static void drawGPScoordinates(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus *gps) -{ - auto gpsFormat = config.display.gps_format; - String displayLine = ""; - - if (!gps->getIsConnected() && !config.position.fixed_position) { - displayLine = "No GPS present"; - display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine); - } else if (!gps->getHasLock() && !config.position.fixed_position) { - displayLine = "No GPS Lock"; - display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine); - } else { - - geoCoord.updateCoords(int32_t(gps->getLatitude()), int32_t(gps->getLongitude()), int32_t(gps->getAltitude())); - - if (gpsFormat != meshtastic_Config_DisplayConfig_GpsCoordinateFormat_DMS) { - char coordinateLine[22]; - if (gpsFormat == meshtastic_Config_DisplayConfig_GpsCoordinateFormat_DEC) { // Decimal Degrees - snprintf(coordinateLine, sizeof(coordinateLine), "%f %f", geoCoord.getLatitude() * 1e-7, - geoCoord.getLongitude() * 1e-7); - } else if (gpsFormat == meshtastic_Config_DisplayConfig_GpsCoordinateFormat_UTM) { // Universal Transverse Mercator - snprintf(coordinateLine, sizeof(coordinateLine), "%2i%1c %06u %07u", geoCoord.getUTMZone(), geoCoord.getUTMBand(), - geoCoord.getUTMEasting(), geoCoord.getUTMNorthing()); - } else if (gpsFormat == meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MGRS) { // Military Grid Reference System - snprintf(coordinateLine, sizeof(coordinateLine), "%2i%1c %1c%1c %05u %05u", geoCoord.getMGRSZone(), - geoCoord.getMGRSBand(), geoCoord.getMGRSEast100k(), geoCoord.getMGRSNorth100k(), - geoCoord.getMGRSEasting(), geoCoord.getMGRSNorthing()); - } else if (gpsFormat == meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OLC) { // Open Location Code - geoCoord.getOLCCode(coordinateLine); - } else if (gpsFormat == meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OSGR) { // Ordnance Survey Grid Reference - if (geoCoord.getOSGRE100k() == 'I' || geoCoord.getOSGRN100k() == 'I') // OSGR is only valid around the UK region - snprintf(coordinateLine, sizeof(coordinateLine), "%s", "Out of Boundary"); - else - snprintf(coordinateLine, sizeof(coordinateLine), "%1c%1c %05u %05u", geoCoord.getOSGRE100k(), - geoCoord.getOSGRN100k(), geoCoord.getOSGREasting(), geoCoord.getOSGRNorthing()); - } - - // If fixed position, display text "Fixed GPS" alternating with the coordinates. - if (config.position.fixed_position) { - if ((millis() / 10000) % 2) { - display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(coordinateLine))) / 2, y, coordinateLine); - } else { - display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth("Fixed GPS"))) / 2, y, "Fixed GPS"); - } - } else { - display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(coordinateLine))) / 2, y, coordinateLine); - } - } else { - char latLine[22]; - char lonLine[22]; - snprintf(latLine, sizeof(latLine), "%2i° %2i' %2u\" %1c", geoCoord.getDMSLatDeg(), geoCoord.getDMSLatMin(), - geoCoord.getDMSLatSec(), geoCoord.getDMSLatCP()); - snprintf(lonLine, sizeof(lonLine), "%3i° %2i' %2u\" %1c", geoCoord.getDMSLonDeg(), geoCoord.getDMSLonMin(), - geoCoord.getDMSLonSec(), geoCoord.getDMSLonCP()); - display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(latLine))) / 2, y - FONT_HEIGHT_SMALL * 1, latLine); - display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(lonLine))) / 2, y, lonLine); - } - } -} -#endif /** * Given a recent lat/lon return a guess of the heading the user is walking on. * @@ -1289,239 +213,10 @@ float Screen::estimatedHeading(double lat, double lon) /// We will skip one node - the one for us, so we just blindly loop over all /// nodes -static size_t nodeIndex; static int8_t prevFrame = -1; -// Draw the arrow pointing to a node's location -void Screen::drawNodeHeading(OLEDDisplay *display, int16_t compassX, int16_t compassY, uint16_t compassDiam, float headingRadian) -{ - Point tip(0.0f, 0.5f), tail(0.0f, -0.35f); // pointing up initially - float arrowOffsetX = 0.14f, arrowOffsetY = 1.0f; - Point leftArrow(tip.x - arrowOffsetX, tip.y - arrowOffsetY), rightArrow(tip.x + arrowOffsetX, tip.y - arrowOffsetY); - - Point *arrowPoints[] = {&tip, &tail, &leftArrow, &rightArrow}; - - for (int i = 0; i < 4; i++) { - arrowPoints[i]->rotate(headingRadian); - arrowPoints[i]->scale(compassDiam * 0.6); - arrowPoints[i]->translate(compassX, compassY); - } - /* Old arrow - display->drawLine(tip.x, tip.y, tail.x, tail.y); - display->drawLine(leftArrow.x, leftArrow.y, tip.x, tip.y); - display->drawLine(rightArrow.x, rightArrow.y, tip.x, tip.y); - display->drawLine(leftArrow.x, leftArrow.y, tail.x, tail.y); - display->drawLine(rightArrow.x, rightArrow.y, tail.x, tail.y); - */ -#ifdef USE_EINK - display->drawTriangle(tip.x, tip.y, rightArrow.x, rightArrow.y, tail.x, tail.y); -#else - display->fillTriangle(tip.x, tip.y, rightArrow.x, rightArrow.y, tail.x, tail.y); -#endif - display->drawTriangle(tip.x, tip.y, leftArrow.x, leftArrow.y, tail.x, tail.y); -} - -// Get a string representation of the time passed since something happened -void Screen::getTimeAgoStr(uint32_t agoSecs, char *timeStr, uint8_t maxLength) -{ - // Use an absolute timestamp in some cases. - // Particularly useful with E-Ink displays. Static UI, fewer refreshes. - uint8_t timestampHours, timestampMinutes; - int32_t daysAgo; - bool useTimestamp = deltaToTimestamp(agoSecs, ×tampHours, ×tampMinutes, &daysAgo); - - if (agoSecs < 120) // last 2 mins? - snprintf(timeStr, maxLength, "%u seconds ago", agoSecs); - // -- if suitable for timestamp -- - else if (useTimestamp && agoSecs < 15 * SECONDS_IN_MINUTE) // Last 15 minutes - snprintf(timeStr, maxLength, "%u minutes ago", agoSecs / SECONDS_IN_MINUTE); - else if (useTimestamp && daysAgo == 0) // Today - snprintf(timeStr, maxLength, "Last seen: %02u:%02u", (unsigned int)timestampHours, (unsigned int)timestampMinutes); - else if (useTimestamp && daysAgo == 1) // Yesterday - snprintf(timeStr, maxLength, "Seen yesterday"); - else if (useTimestamp && daysAgo > 1) // Last six months (capped by deltaToTimestamp method) - snprintf(timeStr, maxLength, "%li days ago", (long)daysAgo); - // -- if using time delta instead -- - else if (agoSecs < 120 * 60) // last 2 hrs - snprintf(timeStr, maxLength, "%u minutes ago", agoSecs / 60); - // Only show hours ago if it's been less than 6 months. Otherwise, we may have bad data. - else if ((agoSecs / 60 / 60) < (hours_in_month * 6)) - snprintf(timeStr, maxLength, "%u hours ago", agoSecs / 60 / 60); - else - snprintf(timeStr, maxLength, "unknown age"); -} - -void Screen::drawCompassNorth(OLEDDisplay *display, int16_t compassX, int16_t compassY, float myHeading) -{ - // If north is supposed to be at the top of the compass we want rotation to be +0 - if (config.display.compass_north_top) - myHeading = -0; - /* N sign points currently not deleted*/ - Point N1(-0.04f, 0.65f), N2(0.04f, 0.65f); // N sign points (N1-N4) - Point N3(-0.04f, 0.55f), N4(0.04f, 0.55f); - Point NC1(0.00f, 0.50f); // north circle center point - Point *rosePoints[] = {&N1, &N2, &N3, &N4, &NC1}; - - uint16_t compassDiam = Screen::getCompassDiam(SCREEN_WIDTH, SCREEN_HEIGHT); - - for (int i = 0; i < 5; i++) { - // North on compass will be negative of heading - rosePoints[i]->rotate(-myHeading); - rosePoints[i]->scale(compassDiam); - rosePoints[i]->translate(compassX, compassY); - } - - /* changed the N sign to a small circle on the compass circle. - display->drawLine(N1.x, N1.y, N3.x, N3.y); - display->drawLine(N2.x, N2.y, N4.x, N4.y); - display->drawLine(N1.x, N1.y, N4.x, N4.y); - */ - display->drawCircle(NC1.x, NC1.y, 4); // North sign circle, 4px radius is sufficient for all displays. -} - -uint16_t Screen::getCompassDiam(uint32_t displayWidth, uint32_t displayHeight) -{ - uint16_t diam = 0; - uint16_t offset = 0; - - if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) - offset = FONT_HEIGHT_SMALL; - - // get the smaller of the 2 dimensions and subtract 20 - if (displayWidth > (displayHeight - offset)) { - diam = displayHeight - offset; - // if 2/3 of the other size would be smaller, use that - if (diam > (displayWidth * 2 / 3)) { - diam = displayWidth * 2 / 3; - } - } else { - diam = displayWidth; - if (diam > ((displayHeight - offset) * 2 / 3)) { - diam = (displayHeight - offset) * 2 / 3; - } - } - - return diam - 20; -}; - -static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - // We only advance our nodeIndex if the frame # has changed - because - // drawNodeInfo will be called repeatedly while the frame is shown - if (state->currentFrame != prevFrame) { - prevFrame = state->currentFrame; - - nodeIndex = (nodeIndex + 1) % nodeDB->getNumMeshNodes(); - meshtastic_NodeInfoLite *n = nodeDB->getMeshNodeByIndex(nodeIndex); - if (n->num == nodeDB->getNodeNum()) { - // Don't show our node, just skip to next - nodeIndex = (nodeIndex + 1) % nodeDB->getNumMeshNodes(); - n = nodeDB->getMeshNodeByIndex(nodeIndex); - } - } - - meshtastic_NodeInfoLite *node = nodeDB->getMeshNodeByIndex(nodeIndex); - - display->setFont(FONT_SMALL); - - // The coordinates define the left starting point of the text - display->setTextAlignment(TEXT_ALIGN_LEFT); - - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { - display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL); - } - - const char *username = node->has_user ? node->user.long_name : "Unknown Name"; - - static char signalStr[20]; - - // section here to choose whether to display hops away rather than signal strength if more than 0 hops away. - if (node->hops_away > 0) { - snprintf(signalStr, sizeof(signalStr), "Hops Away: %d", node->hops_away); - } else { - snprintf(signalStr, sizeof(signalStr), "Signal: %d%%", clamp((int)((node->snr + 10) * 5), 0, 100)); - } - - static char lastStr[20]; - screen->getTimeAgoStr(sinceLastSeen(node), lastStr, sizeof(lastStr)); - - static char distStr[20]; - if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) { - strncpy(distStr, "? mi ?°", sizeof(distStr)); // might not have location data - } else { - strncpy(distStr, "? km ?°", sizeof(distStr)); - } - meshtastic_NodeInfoLite *ourNode = nodeDB->getMeshNode(nodeDB->getNodeNum()); - const char *fields[] = {username, lastStr, signalStr, distStr, NULL}; - int16_t compassX = 0, compassY = 0; - uint16_t compassDiam = Screen::getCompassDiam(SCREEN_WIDTH, SCREEN_HEIGHT); - - // coordinates for the center of the compass/circle - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { - compassX = x + SCREEN_WIDTH - compassDiam / 2 - 5; - compassY = y + SCREEN_HEIGHT / 2; - } else { - compassX = x + SCREEN_WIDTH - compassDiam / 2 - 5; - compassY = y + FONT_HEIGHT_SMALL + (SCREEN_HEIGHT - FONT_HEIGHT_SMALL) / 2; - } - bool hasNodeHeading = false; - - if (ourNode && (nodeDB->hasValidPosition(ourNode) || screen->hasHeading())) { - const meshtastic_PositionLite &op = ourNode->position; - float myHeading; - if (screen->hasHeading()) - myHeading = (screen->getHeading()) * PI / 180; // gotta convert compass degrees to Radians - else - myHeading = screen->estimatedHeading(DegD(op.latitude_i), DegD(op.longitude_i)); - screen->drawCompassNorth(display, compassX, compassY, myHeading); - - if (nodeDB->hasValidPosition(node)) { - // display direction toward node - hasNodeHeading = true; - const meshtastic_PositionLite &p = node->position; - float d = - GeoCoord::latLongToMeter(DegD(p.latitude_i), DegD(p.longitude_i), DegD(op.latitude_i), DegD(op.longitude_i)); - - float bearingToOther = - GeoCoord::bearing(DegD(op.latitude_i), DegD(op.longitude_i), DegD(p.latitude_i), DegD(p.longitude_i)); - // If the top of the compass is a static north then bearingToOther can be drawn on the compass directly - // If the top of the compass is not a static north we need adjust bearingToOther based on heading - if (!config.display.compass_north_top) - bearingToOther -= myHeading; - screen->drawNodeHeading(display, compassX, compassY, compassDiam, bearingToOther); - - float bearingToOtherDegrees = (bearingToOther < 0) ? bearingToOther + 2 * PI : bearingToOther; - bearingToOtherDegrees = bearingToOtherDegrees * 180 / PI; - - if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) { - if (d < (2 * MILES_TO_FEET)) - snprintf(distStr, sizeof(distStr), "%.0fft %.0f°", d * METERS_TO_FEET, bearingToOtherDegrees); - else - snprintf(distStr, sizeof(distStr), "%.1fmi %.0f°", d * METERS_TO_FEET / MILES_TO_FEET, - bearingToOtherDegrees); - } else { - if (d < 2000) - snprintf(distStr, sizeof(distStr), "%.0fm %.0f°", d, bearingToOtherDegrees); - else - snprintf(distStr, sizeof(distStr), "%.1fkm %.0f°", d / 1000, bearingToOtherDegrees); - } - } - } - if (!hasNodeHeading) { - // direction to node is unknown so display question mark - // Debug info for gps lock errors - // LOG_DEBUG("ourNode %d, ourPos %d, theirPos %d", !!ourNode, ourNode && hasValidPosition(ourNode), - // hasValidPosition(node)); - display->drawString(compassX - FONT_HEIGHT_SMALL / 4, compassY - FONT_HEIGHT_SMALL / 2, "?"); - } - display->drawCircle(compassX, compassY, compassDiam / 2); - - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { - display->setColor(BLACK); - } - // Must be after distStr is populated - screen->drawColumns(display, x, y, fields); -} +// Combined dynamic node list frame cycling through LastHeard, HopSignal, and Distance modes +// Uses a single frame and changes data every few seconds (E-Ink variant is separate) #if defined(ESP_PLATFORM) && defined(USE_ST7789) SPIClass SPI1(HSPI); @@ -1540,6 +235,7 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O ST7789_MISO, ST7789_SCK); #else dispdev = new ST7789Spi(&SPI1, ST7789_RESET, ST7789_RS, ST7789_NSS, GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT); + static_cast(dispdev)->setRGB(COLOR565(255, 255, 128)); #endif #elif defined(USE_SSD1306) dispdev = new SSD1306Wire(address.address, -1, -1, geometry, @@ -1557,15 +253,17 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O #elif defined(USE_ST7567) dispdev = new ST7567Wire(address.address, -1, -1, geometry, (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); -#elif ARCH_PORTDUINO && !HAS_TFT - if (settingsMap[displayPanel] != no_screen) { - LOG_DEBUG("Make TFTDisplay!"); - dispdev = new TFTDisplay(address.address, -1, -1, geometry, - (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); - } else { - dispdev = new AutoOLEDWire(address.address, -1, -1, geometry, - (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); - isAUTOOled = true; +#elif ARCH_PORTDUINO + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + if (settingsMap[displayPanel] != no_screen) { + LOG_DEBUG("Make TFTDisplay!"); + dispdev = new TFTDisplay(address.address, -1, -1, geometry, + (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); + } else { + dispdev = new AutoOLEDWire(address.address, -1, -1, geometry, + (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); + isAUTOOled = true; + } } #else dispdev = new AutoOLEDWire(address.address, -1, -1, geometry, @@ -1589,7 +287,7 @@ Screen::~Screen() void Screen::doDeepSleep() { #ifdef USE_EINK - setOn(false, drawDeepSleepScreen); + setOn(false, graphics::UIRenderer::drawDeepSleepFrame); #ifdef PIN_EINK_EN digitalWrite(PIN_EINK_EN, LOW); // power off backlight #endif @@ -1607,7 +305,6 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) if (on != screenOn) { if (on) { LOG_INFO("Turn on screen"); - buttonThread->setScreenFlag(true); powerMon->setState(meshtastic_PowerMon_State_Screen_On); #ifdef T_WATCH_S3 PMU->enablePowerOutput(XPOWERS_ALDO2); @@ -1651,8 +348,6 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) // eInkScreensaver parameter is usually NULL (default argument), default frame used instead setScreensaverFrames(einkScreensaver); #endif - LOG_INFO("Turn off screen"); - buttonThread->setScreenFlag(false); #ifdef ELECROW_ThinkNode_M1 if (digitalRead(PIN_EINK_EN) == HIGH) { digitalWrite(PIN_EINK_EN, LOW); @@ -1687,10 +382,10 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) void Screen::setup() { - // We don't set useDisplay until setup() is called, because some boards have a declaration of this object but the device - // is never found when probing i2c and therefore we don't call setup and never want to do (invalid) accesses to this device. + // === Enable display rendering === useDisplay = true; + // === Detect OLED subtype (if supported by board variant) === #ifdef AutoOLEDWire_h if (isAUTOOled) static_cast(dispdev)->setDetected(model); @@ -1701,66 +396,62 @@ void Screen::setup() #endif #if defined(USE_ST7789) && defined(TFT_MESH) - // Heltec T114 and T190: honor a custom text color, if defined in variant.h + // Apply custom RGB color (e.g. Heltec T114/T190) static_cast(dispdev)->setRGB(TFT_MESH); #endif - // Initialising the UI will init the display too. + // === Initialize display and UI system === ui->init(); - displayWidth = dispdev->width(); displayHeight = dispdev->height(); - ui->setTimePerTransition(0); + ui->setTimePerTransition(0); // Disable animation delays + ui->setIndicatorPosition(BOTTOM); // Not used (indicators disabled below) + ui->setIndicatorDirection(LEFT_RIGHT); // Not used (indicators disabled below) + ui->setFrameAnimation(SLIDE_LEFT); // Used only when indicators are active + ui->disableAllIndicators(); // Disable page indicator dots + ui->getUiState()->userData = this; // Allow static callbacks to access Screen instance - ui->setIndicatorPosition(BOTTOM); - // Defines where the first frame is located in the bar. - ui->setIndicatorDirection(LEFT_RIGHT); - ui->setFrameAnimation(SLIDE_LEFT); - // Don't show the page swipe dots while in boot screen. - ui->disableAllIndicators(); - // Store a pointer to Screen so we can get to it from static functions. - ui->getUiState()->userData = this; + // === Set custom overlay callbacks === + static OverlayCallback overlays[] = { + graphics::UIRenderer::drawFunctionOverlay, // For mute/buzzer modifiers etc. + graphics::UIRenderer::drawNavigationBar // Custom indicator icons for each frame + }; + ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); - // Set the utf8 conversion function + // === Enable UTF-8 to display mapping === dispdev->setFontTableLookupFunction(customFontTableLookup); #ifdef USERPREFS_OEM_TEXT - logo_timeout *= 2; // Double the time if we have a custom logo + logo_timeout *= 2; // Give more time for branded boot logos #endif - // Add frames. - EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); - alertFrames[0] = [this](OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -> void { + // === Configure alert frames (e.g., "Resuming..." or region name) === + EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip slow refresh + alertFrames[0] = [this](OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { #ifdef ARCH_ESP32 - if (wakeCause == ESP_SLEEP_WAKEUP_TIMER || wakeCause == ESP_SLEEP_WAKEUP_EXT1) { - drawFrameText(display, state, x, y, "Resuming..."); - } else + if (wakeCause == ESP_SLEEP_WAKEUP_TIMER || wakeCause == ESP_SLEEP_WAKEUP_EXT1) + graphics::UIRenderer::drawFrameText(display, state, x, y, "Resuming..."); + else #endif { - // Draw region in upper left - const char *region = myRegion ? myRegion->name : NULL; - drawIconScreen(region, display, state, x, y); + const char *region = myRegion ? myRegion->name : nullptr; + graphics::UIRenderer::drawIconScreen(region, display, state, x, y); } }; ui->setFrames(alertFrames, 1); - // No overlays. - ui->setOverlays(nullptr, 0); + ui->disableAutoTransition(); // Require manual navigation between frames - // Require presses to switch between frames. - ui->disableAutoTransition(); - - // Set up a log buffer with 3 lines, 32 chars each. + // === Log buffer for on-screen logs (3 lines max) === dispdev->setLogBuffer(3, 32); + // === Optional screen mirroring or flipping (e.g. for T-Beam orientation) === #ifdef SCREEN_MIRROR dispdev->mirrorScreen(); #else - // Standard behaviour is to FLIP the screen (needed on T-Beam). If this config item is set, unflip it, and thereby logically - // flip it. If you have a headache now, you're welcome. if (!config.display.flip_screen) { -#if defined(ST7701_CS) || defined(ST7735_CS) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || \ - defined(ST7789_CS) || defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) +#if defined(ST7701_CS) || defined(ST7735_CS) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7789_CS) || \ + defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) static_cast(dispdev)->flipScreenVertically(); #elif defined(USE_ST7789) static_cast(dispdev)->flipScreenVertically(); @@ -1770,30 +461,30 @@ void Screen::setup() } #endif - // Get our hardware ID + // === Generate device ID from MAC address === uint8_t dmac[6]; getMacAddr(dmac); - snprintf(ourId, sizeof(ourId), "%02x%02x", dmac[4], dmac[5]); + snprintf(screen->ourId, sizeof(screen->ourId), "%02x%02x", dmac[4], dmac[5]); + #if ARCH_PORTDUINO - handleSetOn(false); // force clean init + handleSetOn(false); // Ensure proper init for Arduino targets #endif - // Turn on the display. + // === Turn on display and trigger first draw === handleSetOn(true); - - // On some ssd1306 clones, the first draw command is discarded, so draw it - // twice initially. Skip this for EINK Displays to save a few seconds during boot ui->update(); #ifndef USE_EINK - ui->update(); + ui->update(); // Some SSD1306 clones drop the first draw, so run twice #endif serialSinceMsec = millis(); -#if ARCH_PORTDUINO && !HAS_TFT - if (settingsMap[touchscreenModule]) { - touchScreenImpl1 = - new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast(dispdev)->getTouch); - touchScreenImpl1->init(); +#if ARCH_PORTDUINO + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + if (settingsMap[touchscreenModule]) { + touchScreenImpl1 = + new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast(dispdev)->getTouch); + touchScreenImpl1->init(); + } } #elif HAS_TOUCHSCREEN touchScreenImpl1 = @@ -1801,10 +492,11 @@ void Screen::setup() touchScreenImpl1->init(); #endif - // Subscribe to status updates + // === Subscribe to device status updates === powerStatusObserver.observe(&powerStatus->onNewStatus); gpsStatusObserver.observe(&gpsStatus->onNewStatus); nodeStatusObserver.observe(&nodeStatus->onNewStatus); + #if !MESHTASTIC_EXCLUDE_ADMIN adminMessageObserver.observe(adminModule); #endif @@ -1813,7 +505,7 @@ void Screen::setup() if (inputBroker) inputObserver.observe(inputBroker); - // Modules can notify screen about refresh + // === Notify modules that support UI events === MeshModule::observeUIEvents(&uiFrameEventObserver); } @@ -1881,7 +573,7 @@ int32_t Screen::runOnce() if (showingOEMBootScreen && (millis() > ((logo_timeout / 2) + serialSinceMsec))) { LOG_INFO("Switch to OEM screen..."); // Change frames. - static FrameCallback bootOEMFrames[] = {drawOEMBootScreen}; + static FrameCallback bootOEMFrames[] = {graphics::UIRenderer::drawOEMBootScreen}; static const int bootOEMFrameCount = sizeof(bootOEMFrames) / sizeof(bootOEMFrames[0]); ui->setFrames(bootOEMFrames, bootOEMFrameCount); ui->update(); @@ -1893,10 +585,13 @@ int32_t Screen::runOnce() #endif #ifndef DISABLE_WELCOME_UNSET - if (showingNormalScreen && config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_UNSET) { - setWelcomeFrames(); + if (!NotificationRenderer::isOverlayBannerShowing() && config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_UNSET) { + LoraRegionPicker(0); } #endif + if (!NotificationRenderer::isOverlayBannerShowing() && rebootAtMsec != 0) { + showOverlayBanner("Rebooting...", 0); + } // Process incoming commands. for (;;) { @@ -1923,6 +618,7 @@ int32_t Screen::runOnce() case Cmd::START_ALERT_FRAME: { showingBootScreen = false; // this should avoid the edge case where an alert triggers before the boot screen goes away showingNormalScreen = false; + NotificationRenderer::pauseBanner = true; alertFrames[0] = alertFrame; #ifdef USE_EINK EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Use fast-refresh for next frame, no skip please @@ -1936,14 +632,11 @@ int32_t Screen::runOnce() handleStartFirmwareUpdateScreen(); break; case Cmd::STOP_ALERT_FRAME: + NotificationRenderer::pauseBanner = false; case Cmd::STOP_BOOT_SCREEN: EINK_ADD_FRAMEFLAG(dispdev, COSMETIC); // E-Ink: Explicitly use full-refresh for next frame setFrames(); break; - case Cmd::PRINT: - handlePrint(cmd.print_text); - free(cmd.print_text); - break; default: LOG_ERROR("Invalid screen cmd"); } @@ -1962,6 +655,7 @@ int32_t Screen::runOnce() // Switch to a low framerate (to save CPU) when we are not in transition // but we should only call setTargetFPS when framestate changes, because // otherwise that breaks animations. + if (targetFramerate != IDLE_FRAMERATE && ui->getUiState()->frameState == FIXED) { // oldFrameState = ui->getUiState()->frameState; targetFramerate = IDLE_FRAMERATE; @@ -1977,8 +671,8 @@ int32_t Screen::runOnce() if (config.display.auto_screen_carousel_secs > 0 && !Throttle::isWithinTimespanMs(lastScreenTransition, config.display.auto_screen_carousel_secs * 1000)) { -// If an E-Ink display struggles with fast refresh, force carousel to use full refresh instead -// Carousel is potentially a major source of E-Ink display wear + // If an E-Ink display struggles with fast refresh, force carousel to use full refresh instead + // Carousel is potentially a major source of E-Ink display wear #if !defined(EINK_BACKGROUND_USES_FAST) EINK_ADD_FRAMEFLAG(dispdev, COSMETIC); #endif @@ -1996,47 +690,18 @@ int32_t Screen::runOnce() return (1000 / targetFramerate); } -void Screen::drawDebugInfoTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - Screen *screen2 = reinterpret_cast(state->userData); - screen2->debugInfo.drawFrame(display, state, x, y); -} - -void Screen::drawDebugInfoSettingsTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - Screen *screen2 = reinterpret_cast(state->userData); - screen2->debugInfo.drawFrameSettings(display, state, x, y); -} - -void Screen::drawDebugInfoWiFiTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - Screen *screen2 = reinterpret_cast(state->userData); - screen2->debugInfo.drawFrameWiFi(display, state, x, y); -} - /* show a message that the SSL cert is being built * it is expected that this will be used during the boot phase */ void Screen::setSSLFrames() { if (address_found.address) { // LOG_DEBUG("Show SSL frames"); - static FrameCallback sslFrames[] = {drawSSLScreen}; + static FrameCallback sslFrames[] = {NotificationRenderer::drawSSLScreen}; ui->setFrames(sslFrames, 1); ui->update(); } } -/* show a message that the SSL cert is being built - * it is expected that this will be used during the boot phase */ -void Screen::setWelcomeFrames() -{ - if (address_found.address) { - // LOG_DEBUG("Show Welcome frames"); - static FrameCallback frames[] = {drawWelcomeScreen}; - setFrameImmediateDraw(frames); - } -} - #ifdef USE_EINK /// Determine which screensaver frame to use, then set the FrameCallback void Screen::setScreensaverFrames(FrameCallback einkScreensaver) @@ -2059,7 +724,7 @@ void Screen::setScreensaverFrames(FrameCallback einkScreensaver) // Else, display the usual "overlay" screensaver else { - screensaverOverlay = drawScreensaverOverlay; + screensaverOverlay = graphics::UIRenderer::drawScreensaverOverlay; ui->setOverlays(&screensaverOverlay, 1); } @@ -2095,33 +760,17 @@ void Screen::setScreensaverFrames(FrameCallback einkScreensaver) void Screen::setFrames(FrameFocus focus) { uint8_t originalPosition = ui->getUiState()->currentFrame; + uint8_t previousFrameCount = framesetInfo.frameCount; FramesetInfo fsi; // Location of specific frames, for applying focus parameter LOG_DEBUG("Show standard frames"); showingNormalScreen = true; -#ifdef USE_EINK - // If user has disabled the screensaver, warn them after boot - static bool warnedScreensaverDisabled = false; - if (config.display.screen_on_secs == 0 && !warnedScreensaverDisabled) { - screen->print("Screensaver disabled\n"); - warnedScreensaverDisabled = true; - } -#endif - - moduleFrames = MeshModule::GetMeshModulesWithUIFrames(); - LOG_DEBUG("Show %d module frames", moduleFrames.size()); -#ifdef DEBUG_PORT - int totalFrameCount = MAX_NUM_NODES + NUM_EXTRA_FRAMES + moduleFrames.size(); - LOG_DEBUG("Total frame count: %d", totalFrameCount); -#endif - - // We don't show the node info of our node (if we have it yet - we should) - size_t numMeshNodes = nodeDB->getNumMeshNodes(); - if (numMeshNodes > 0) - numMeshNodes--; + indicatorIcons.clear(); size_t numframes = 0; + moduleFrames = MeshModule::GetMeshModulesWithUIFrames(); + LOG_DEBUG("Show %d module frames", moduleFrames.size()); // put all of the module frames first. // this is a little bit of a dirty hack; since we're going to call @@ -2136,14 +785,12 @@ void Screen::setFrames(FrameFocus focus) // Check if the module being drawn has requested focus // We will honor this request later, if setFrames was triggered by a UIFrameEvent MeshModule *m = *i; - if (m->isRequestingFocus()) { + if (m->isRequestingFocus()) fsi.positions.focusedModule = numframes; - } - - // Identify the position of specific modules, if we need to know this later if (m == waypointModule) fsi.positions.waypoint = numframes; + indicatorIcons.push_back(icon_module); numframes++; } @@ -2152,55 +799,103 @@ void Screen::setFrames(FrameFocus focus) // If we have a critical fault, show it first fsi.positions.fault = numframes; if (error_code) { - normalFrames[numframes++] = drawCriticalFaultFrame; + normalFrames[numframes++] = NotificationRenderer::drawCriticalFaultFrame; + indicatorIcons.push_back(icon_error); focus = FOCUS_FAULT; // Change our "focus" parameter, to ensure we show the fault frame } #if defined(DISPLAY_CLOCK_FRAME) - normalFrames[numframes++] = screen->digitalWatchFace ? &Screen::drawDigitalClockFrame : &Screen::drawAnalogClockFrame; + fsi.positions.clock = numframes; + normalFrames[numframes++] = graphics::ClockRenderer::digitalWatchFace ? graphics::ClockRenderer::drawDigitalClockFrame + : &graphics::ClockRenderer::drawAnalogClockFrame; + indicatorIcons.push_back(icon_clock); #endif - // If we have a text message - show it next, unless it's a phone message and we aren't using any special modules - if (devicestate.has_rx_text_message && shouldDrawMessage(&devicestate.rx_text_message)) { - fsi.positions.textMessage = numframes; - normalFrames[numframes++] = drawTextMessageFrame; + // Declare this early so it’s available in FOCUS_PRESERVE block + bool willInsertTextMessage = shouldDrawMessage(&devicestate.rx_text_message); + + fsi.positions.home = numframes; + normalFrames[numframes++] = graphics::UIRenderer::drawDeviceFocused; + indicatorIcons.push_back(icon_home); + + fsi.positions.textMessage = numframes; + normalFrames[numframes++] = graphics::MessageRenderer::drawTextMessageFrame; + indicatorIcons.push_back(icon_mail); + +#ifndef USE_EINK + normalFrames[numframes++] = graphics::NodeListRenderer::drawDynamicNodeListScreen; + indicatorIcons.push_back(icon_nodes); +#endif + +// Show detailed node views only on E-Ink builds +#ifdef USE_EINK + normalFrames[numframes++] = graphics::NodeListRenderer::drawLastHeardScreen; + indicatorIcons.push_back(icon_nodes); + + normalFrames[numframes++] = graphics::NodeListRenderer::drawHopSignalScreen; + indicatorIcons.push_back(icon_signal); + + normalFrames[numframes++] = graphics::NodeListRenderer::drawDistanceScreen; + indicatorIcons.push_back(icon_distance); +#endif +#if HAS_GPS + normalFrames[numframes++] = graphics::NodeListRenderer::drawNodeListWithCompasses; + indicatorIcons.push_back(icon_list); + + fsi.positions.gps = numframes; + normalFrames[numframes++] = graphics::UIRenderer::drawCompassAndLocationScreen; + indicatorIcons.push_back(icon_compass); +#endif + if (RadioLibInterface::instance) { + fsi.positions.lora = numframes; + normalFrames[numframes++] = graphics::DebugRenderer::drawLoRaFocused; + indicatorIcons.push_back(icon_radio); + } + if (!dismissedFrames.memory) { + fsi.positions.memory = numframes; + normalFrames[numframes++] = graphics::DebugRenderer::drawMemoryUsage; + indicatorIcons.push_back(icon_memory); + } +#if !defined(DISPLAY_CLOCK_FRAME) + fsi.positions.clock = numframes; + normalFrames[numframes++] = graphics::ClockRenderer::drawDigitalClockFrame; + indicatorIcons.push_back(icon_clock); +#endif + + // We don't show the node info of our node (if we have it yet - we should) + size_t numMeshNodes = nodeDB->getNumMeshNodes(); + if (numMeshNodes > 0) + numMeshNodes--; + + for (size_t i = 0; i < nodeDB->getNumMeshNodes(); i++) { + const meshtastic_NodeInfoLite *n = nodeDB->getMeshNodeByIndex(i); + if (n && n->num != nodeDB->getNodeNum() && n->is_favorite) { + if (fsi.positions.firstFavorite == 255) + fsi.positions.firstFavorite = numframes; + fsi.positions.lastFavorite = numframes; + normalFrames[numframes++] = graphics::UIRenderer::drawNodeInfo; + indicatorIcons.push_back(icon_node); + } } - // then all the nodes - // We only show a few nodes in our scrolling list - because meshes with many nodes would have too many screens - size_t numToShow = min(numMeshNodes, 4U); - for (size_t i = 0; i < numToShow; i++) - normalFrames[numframes++] = drawNodeInfo; - - // then the debug info - // - // Since frames are basic function pointers, we have to use a helper to - // call a method on debugInfo object. - fsi.positions.log = numframes; - normalFrames[numframes++] = &Screen::drawDebugInfoTrampoline; - - // call a method on debugInfoScreen object (for more details) - fsi.positions.settings = numframes; - normalFrames[numframes++] = &Screen::drawDebugInfoSettingsTrampoline; - - fsi.positions.wifi = numframes; #if HAS_WIFI && !defined(ARCH_PORTDUINO) - if (isWifiAvailable()) { - // call a method on debugInfoScreen object (for more details) - normalFrames[numframes++] = &Screen::drawDebugInfoWiFiTrampoline; + if (!dismissedFrames.wifi && isWifiAvailable()) { + fsi.positions.wifi = numframes; + normalFrames[numframes++] = graphics::DebugRenderer::drawDebugInfoWiFiTrampoline; + indicatorIcons.push_back(icon_wifi); } #endif - fsi.frameCount = numframes; // Total framecount is used to apply FOCUS_PRESERVE + fsi.frameCount = numframes; // Total framecount is used to apply FOCUS_PRESERVE + this->frameCount = numframes; // ✅ Save frame count for use in custom overlay LOG_DEBUG("Finished build frames. numframes: %d", numframes); ui->setFrames(normalFrames, numframes); - ui->enableAllIndicators(); + ui->disableAllIndicators(); - // Add function overlay here. This can show when notifications muted, modifier key is active etc - static OverlayCallback functionOverlay[] = {drawFunctionOverlay}; - static const int functionOverlayCount = sizeof(functionOverlay) / sizeof(functionOverlay[0]); - ui->setOverlays(functionOverlay, functionOverlayCount); + // Add overlays: frame icons and alert banner) + static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawAlertBannerOverlay}; + ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); prevFrame = -1; // Force drawNodeInfo to pick a new node (because our list // just changed) @@ -2208,12 +903,13 @@ void Screen::setFrames(FrameFocus focus) // Focus on a specific frame, in the frame set we just created switch (focus) { case FOCUS_DEFAULT: - ui->switchToFrame(0); // First frame + ui->switchToFrame(fsi.positions.deviceFocused); break; case FOCUS_FAULT: ui->switchToFrame(fsi.positions.fault); break; case FOCUS_TEXTMESSAGE: + hasUnreadMessage = false; // ✅ Clear when message is *viewed* ui->switchToFrame(fsi.positions.textMessage); break; case FOCUS_MODULE: @@ -2223,31 +919,14 @@ void Screen::setFrames(FrameFocus focus) break; case FOCUS_PRESERVE: - // If we can identify which type of frame "originalPosition" was, can move directly to it in the new frameset - const FramesetInfo &oldFsi = this->framesetInfo; - if (originalPosition == oldFsi.positions.log) - ui->switchToFrame(fsi.positions.log); - else if (originalPosition == oldFsi.positions.settings) - ui->switchToFrame(fsi.positions.settings); - else if (originalPosition == oldFsi.positions.wifi) - ui->switchToFrame(fsi.positions.wifi); - - // If frame count has decreased - else if (fsi.frameCount < oldFsi.frameCount) { - uint8_t numDropped = oldFsi.frameCount - fsi.frameCount; - // Move n frames backwards - if (numDropped <= originalPosition) - ui->switchToFrame(originalPosition - numDropped); - // Unless that would put us "out of bounds" (< 0) - else - ui->switchToFrame(0); - } - - // If we're not sure exactly which frame we were on, at least return to the same frame number - // (node frames; module frames) - else + // No more adjustment — force stay on same index + if (previousFrameCount > fsi.frameCount) { + ui->switchToFrame(originalPosition - 1); + } else if (previousFrameCount < fsi.frameCount) { + ui->switchToFrame(originalPosition + 1); + } else { ui->switchToFrame(originalPosition); - + } break; } @@ -2275,18 +954,25 @@ void Screen::dismissCurrentFrame() if (currentFrame == framesetInfo.positions.textMessage && devicestate.has_rx_text_message) { LOG_INFO("Dismiss Text Message"); devicestate.has_rx_text_message = false; - dismissed = true; - } - - else if (currentFrame == framesetInfo.positions.waypoint && devicestate.has_rx_waypoint) { + memset(&devicestate.rx_text_message, 0, sizeof(devicestate.rx_text_message)); + } else if (currentFrame == framesetInfo.positions.waypoint && devicestate.has_rx_waypoint) { LOG_DEBUG("Dismiss Waypoint"); devicestate.has_rx_waypoint = false; + dismissedFrames.waypoint = true; + dismissed = true; + } else if (currentFrame == framesetInfo.positions.wifi) { + LOG_DEBUG("Dismiss WiFi Screen"); + dismissedFrames.wifi = true; + dismissed = true; + } else if (currentFrame == framesetInfo.positions.memory) { + LOG_INFO("Dismiss Memory"); + dismissedFrames.memory = true; dismissed = true; } - // If we did make changes to dismiss, we now need to regenerate the frameset - if (dismissed) - setFrames(); + if (dismissed) { + setFrames(FOCUS_DEFAULT); // You could also use FOCUS_PRESERVE + } } void Screen::handleStartFirmwareUpdateScreen() @@ -2295,7 +981,7 @@ void Screen::handleStartFirmwareUpdateScreen() showingNormalScreen = false; EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // E-Ink: Explicitly use fast-refresh for next frame - static FrameCallback frames[] = {drawFrameFirmware}; + static FrameCallback frames[] = {graphics::NotificationRenderer::drawFrameFirmware}; setFrameImmediateDraw(frames); } @@ -2362,41 +1048,8 @@ void Screen::removeFunctionSymbol(std::string sym) setFastFramerate(); } -std::string Screen::drawTimeDelta(uint32_t days, uint32_t hours, uint32_t minutes, uint32_t seconds) -{ - std::string uptime; - - if (days > (hours_in_month * 6)) - uptime = "?"; - else if (days >= 2) - uptime = std::to_string(days) + "d"; - else if (hours >= 2) - uptime = std::to_string(hours) + "h"; - else if (minutes >= 1) - uptime = std::to_string(minutes) + "m"; - else - uptime = std::to_string(seconds) + "s"; - return uptime; -} - -void Screen::handlePrint(const char *text) -{ - // the string passed into us probably has a newline, but that would confuse the logging system - // so strip it - LOG_DEBUG("Screen: %.*s", strlen(text) - 1, text); - if (!useDisplay || !showingNormalScreen) - return; - - dispdev->print(text); -} - void Screen::handleOnPress() { - // If Canned Messages is using the "Scan and Select" input, dismiss the canned message frame when user button is pressed - // Minimize impact as a courtesy, as "scan and select" may be used as default config for some boards - if (scanAndSelectInput != nullptr && scanAndSelectInput->dismissCannedMessageFrame()) - return; - // If screen was off, just wake it, otherwise advance to next frame // If we are in a transition, the press must have bounced, drop it. if (ui->getUiState()->frameState == FIXED) { @@ -2442,321 +1095,6 @@ void Screen::setFastFramerate() runASAP = true; } -void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - display->setFont(FONT_SMALL); - - // The coordinates define the left starting point of the text - display->setTextAlignment(TEXT_ALIGN_LEFT); - - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { - display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL); - display->setColor(BLACK); - } - - char channelStr[20]; - { - concurrency::LockGuard guard(&lock); - snprintf(channelStr, sizeof(channelStr), "#%s", channels.getName(channels.getPrimaryIndex())); - } - - // Display power status - if (powerStatus->getHasBattery()) { - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { - drawBattery(display, x, y + 2, imgBattery, powerStatus); - } else { - drawBattery(display, x + 1, y + 3, imgBattery, powerStatus); - } - } else if (powerStatus->knowsUSB()) { - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { - display->drawFastImage(x, y + 2, 16, 8, powerStatus->getHasUSB() ? imgUSB : imgPower); - } else { - display->drawFastImage(x + 1, y + 3, 16, 8, powerStatus->getHasUSB() ? imgUSB : imgPower); - } - } - // Display nodes status - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { - drawNodes(display, x + (SCREEN_WIDTH * 0.25), y + 2, nodeStatus); - } else { - drawNodes(display, x + (SCREEN_WIDTH * 0.25), y + 3, nodeStatus); - } -#if HAS_GPS - // Display GPS status - if (config.position.gps_mode != meshtastic_Config_PositionConfig_GpsMode_ENABLED) { - drawGPSpowerstat(display, x, y + 2, gpsStatus); - } else { - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { - drawGPS(display, x + (SCREEN_WIDTH * 0.63), y + 2, gpsStatus); - } else { - drawGPS(display, x + (SCREEN_WIDTH * 0.63), y + 3, gpsStatus); - } - } -#endif - display->setColor(WHITE); - // Draw the channel name - display->drawString(x, y + FONT_HEIGHT_SMALL, channelStr); - // Draw our hardware ID to assist with bluetooth pairing. Either prefix with Info or S&F Logo - if (moduleConfig.store_forward.enabled) { -#ifdef ARCH_ESP32 - if (!Throttle::isWithinTimespanMs(storeForwardModule->lastHeartbeat, - (storeForwardModule->heartbeatInterval * 1200))) { // no heartbeat, overlap a bit -#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || ARCH_PORTDUINO) && \ - !defined(DISPLAY_FORCE_SMALL_FONTS) - display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, - imgQuestionL1); - display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 12, 8, - imgQuestionL2); -#else - display->drawFastImage(x + SCREEN_WIDTH - 10 - display->getStringWidth(ourId), y + 2 + FONT_HEIGHT_SMALL, 8, 8, - imgQuestion); -#endif - } else { -#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS)) && \ - !defined(DISPLAY_FORCE_SMALL_FONTS) - display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 16, 8, - imgSFL1); - display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 16, 8, - imgSFL2); -#else - display->drawFastImage(x + SCREEN_WIDTH - 13 - display->getStringWidth(ourId), y + 2 + FONT_HEIGHT_SMALL, 11, 8, - imgSF); -#endif - } -#endif - } else { - // TODO: Raspberry Pi supports more than just the one screen size -#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || ARCH_PORTDUINO) && \ - !defined(DISPLAY_FORCE_SMALL_FONTS) - display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, - imgInfoL1); - display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 12, 8, - imgInfoL2); -#else - display->drawFastImage(x + SCREEN_WIDTH - 10 - display->getStringWidth(ourId), y + 2 + FONT_HEIGHT_SMALL, 8, 8, imgInfo); -#endif - } - - display->drawString(x + SCREEN_WIDTH - display->getStringWidth(ourId), y + FONT_HEIGHT_SMALL, ourId); - - // Draw any log messages - display->drawLogBuffer(x, y + (FONT_HEIGHT_SMALL * 2)); - - /* Display a heartbeat pixel that blinks every time the frame is redrawn */ -#ifdef SHOW_REDRAWS - if (heartbeat) - display->setPixel(0, 0); - heartbeat = !heartbeat; -#endif -} - -// Jm -void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ -#if HAS_WIFI && !defined(ARCH_PORTDUINO) - const char *wifiName = config.network.wifi_ssid; - - display->setFont(FONT_SMALL); - - // The coordinates define the left starting point of the text - display->setTextAlignment(TEXT_ALIGN_LEFT); - - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { - display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL); - display->setColor(BLACK); - } - - if (WiFi.status() != WL_CONNECTED) { - display->drawString(x, y, String("WiFi: Not Connected")); - if (config.display.heading_bold) - display->drawString(x + 1, y, String("WiFi: Not Connected")); - } else { - display->drawString(x, y, String("WiFi: Connected")); - if (config.display.heading_bold) - display->drawString(x + 1, y, String("WiFi: Connected")); - - display->drawString(x + SCREEN_WIDTH - display->getStringWidth("RSSI " + String(WiFi.RSSI())), y, - "RSSI " + String(WiFi.RSSI())); - if (config.display.heading_bold) { - display->drawString(x + SCREEN_WIDTH - display->getStringWidth("RSSI " + String(WiFi.RSSI())) - 1, y, - "RSSI " + String(WiFi.RSSI())); - } - } - - display->setColor(WHITE); - - /* - - WL_CONNECTED: assigned when connected to a WiFi network; - - WL_NO_SSID_AVAIL: assigned when no SSID are available; - - WL_CONNECT_FAILED: assigned when the connection fails for all the attempts; - - WL_CONNECTION_LOST: assigned when the connection is lost; - - WL_DISCONNECTED: assigned when disconnected from a network; - - WL_IDLE_STATUS: it is a temporary status assigned when WiFi.begin() is called and remains active until the number of - attempts expires (resulting in WL_CONNECT_FAILED) or a connection is established (resulting in WL_CONNECTED); - - WL_SCAN_COMPLETED: assigned when the scan networks is completed; - - WL_NO_SHIELD: assigned when no WiFi shield is present; - - */ - if (WiFi.status() == WL_CONNECTED) { - display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "IP: " + String(WiFi.localIP().toString().c_str())); - } else if (WiFi.status() == WL_NO_SSID_AVAIL) { - display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "SSID Not Found"); - } else if (WiFi.status() == WL_CONNECTION_LOST) { - display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Connection Lost"); - } else if (WiFi.status() == WL_CONNECT_FAILED) { - display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Connection Failed"); - } else if (WiFi.status() == WL_IDLE_STATUS) { - display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Idle ... Reconnecting"); - } -#ifdef ARCH_ESP32 - else { - // Codes: - // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/wifi.html#wi-fi-reason-code - display->drawString(x, y + FONT_HEIGHT_SMALL * 1, - WiFi.disconnectReasonName(static_cast(getWifiDisconnectReason()))); - } -#else - else { - display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Unkown status: " + String(WiFi.status())); - } -#endif - - display->drawString(x, y + FONT_HEIGHT_SMALL * 2, "SSID: " + String(wifiName)); - - display->drawString(x, y + FONT_HEIGHT_SMALL * 3, "http://meshtastic.local"); - - /* Display a heartbeat pixel that blinks every time the frame is redrawn */ -#ifdef SHOW_REDRAWS - if (heartbeat) - display->setPixel(0, 0); - heartbeat = !heartbeat; -#endif -#endif -} - -void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -{ - display->setFont(FONT_SMALL); - - // The coordinates define the left starting point of the text - display->setTextAlignment(TEXT_ALIGN_LEFT); - - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { - display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL); - display->setColor(BLACK); - } - - char batStr[20]; - if (powerStatus->getHasBattery()) { - int batV = powerStatus->getBatteryVoltageMv() / 1000; - int batCv = (powerStatus->getBatteryVoltageMv() % 1000) / 10; - - snprintf(batStr, sizeof(batStr), "B %01d.%02dV %3d%% %c%c", batV, batCv, powerStatus->getBatteryChargePercent(), - powerStatus->getIsCharging() ? '+' : ' ', powerStatus->getHasUSB() ? 'U' : ' '); - - // Line 1 - display->drawString(x, y, batStr); - if (config.display.heading_bold) - display->drawString(x + 1, y, batStr); - } else { - // Line 1 - display->drawString(x, y, String("USB")); - if (config.display.heading_bold) - display->drawString(x + 1, y, String("USB")); - } - - // auto mode = DisplayFormatters::getModemPresetDisplayName(config.lora.modem_preset, true); - - // display->drawString(x + SCREEN_WIDTH - display->getStringWidth(mode), y, mode); - // if (config.display.heading_bold) - // display->drawString(x + SCREEN_WIDTH - display->getStringWidth(mode) - 1, y, mode); - - uint32_t currentMillis = millis(); - uint32_t seconds = currentMillis / 1000; - uint32_t minutes = seconds / 60; - uint32_t hours = minutes / 60; - uint32_t days = hours / 24; - // currentMillis %= 1000; - // seconds %= 60; - // minutes %= 60; - // hours %= 24; - - // Show uptime as days, hours, minutes OR seconds - std::string uptime = screen->drawTimeDelta(days, hours, minutes, seconds); - - // Line 1 (Still) - display->drawString(x + SCREEN_WIDTH - display->getStringWidth(uptime.c_str()), y, uptime.c_str()); - if (config.display.heading_bold) - display->drawString(x - 1 + SCREEN_WIDTH - display->getStringWidth(uptime.c_str()), y, uptime.c_str()); - - display->setColor(WHITE); - - // Setup string to assemble analogClock string - std::string analogClock = ""; - - uint32_t rtc_sec = getValidTime(RTCQuality::RTCQualityDevice, true); // Display local timezone - if (rtc_sec > 0) { - long hms = rtc_sec % SEC_PER_DAY; - // hms += tz.tz_dsttime * SEC_PER_HOUR; - // hms -= tz.tz_minuteswest * SEC_PER_MIN; - // mod `hms` to ensure in positive range of [0...SEC_PER_DAY) - hms = (hms + SEC_PER_DAY) % SEC_PER_DAY; - - // Tear apart hms into h:m:s - int hour = hms / SEC_PER_HOUR; - int min = (hms % SEC_PER_HOUR) / SEC_PER_MIN; - int sec = (hms % SEC_PER_HOUR) % SEC_PER_MIN; // or hms % SEC_PER_MIN - - char timebuf[12]; - - if (config.display.use_12h_clock) { - std::string meridiem = "am"; - if (hour >= 12) { - if (hour > 12) - hour -= 12; - meridiem = "pm"; - } - if (hour == 00) { - hour = 12; - } - snprintf(timebuf, sizeof(timebuf), "%d:%02d:%02d%s", hour, min, sec, meridiem.c_str()); - } else { - snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d", hour, min, sec); - } - analogClock += timebuf; - } - - // Line 2 - display->drawString(x, y + FONT_HEIGHT_SMALL * 1, analogClock.c_str()); - - // Display Channel Utilization - char chUtil[13]; - snprintf(chUtil, sizeof(chUtil), "ChUtil %2.0f%%", airTime->channelUtilizationPercent()); - display->drawString(x + SCREEN_WIDTH - display->getStringWidth(chUtil), y + FONT_HEIGHT_SMALL * 1, chUtil); - -#if HAS_GPS - if (config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED) { - // Line 3 - if (config.display.gps_format != - meshtastic_Config_DisplayConfig_GpsCoordinateFormat_DMS) // if DMS then don't draw altitude - drawGPSAltitude(display, x, y + FONT_HEIGHT_SMALL * 2, gpsStatus); - - // Line 4 - drawGPScoordinates(display, x, y + FONT_HEIGHT_SMALL * 3, gpsStatus); - } else { - drawGPSpowerstat(display, x, y + FONT_HEIGHT_SMALL * 2, gpsStatus); - } -#endif -/* Display a heartbeat pixel that blinks every time the frame is redrawn */ -#ifdef SHOW_REDRAWS - if (heartbeat) - display->setPixel(0, 0); - heartbeat = !heartbeat; -#endif -} - int Screen::handleStatusUpdate(const meshtastic::Status *arg) { // LOG_DEBUG("Screen got status update %d", arg->getStatusType()); @@ -2772,16 +1110,58 @@ int Screen::handleStatusUpdate(const meshtastic::Status *arg) return 0; } +// Handles when message is received; will jump to text message frame. int Screen::handleTextMessage(const meshtastic_MeshPacket *packet) { if (showingNormalScreen) { - // Outgoing message - if (packet->from == 0) - setFrames(FOCUS_PRESERVE); // Return to same frame (quietly hiding the rx text message frame) + if (packet->from == 0) { + // Outgoing message (likely sent from phone) + devicestate.has_rx_text_message = false; + memset(&devicestate.rx_text_message, 0, sizeof(devicestate.rx_text_message)); + dismissedFrames.textMessage = true; + hasUnreadMessage = false; // Clear unread state when user replies - // Incoming message - else - setFrames(FOCUS_TEXTMESSAGE); // Focus on the new message + setFrames(FOCUS_PRESERVE); // Stay on same frame, silently update frame list + } else { + // Incoming message + devicestate.has_rx_text_message = true; // Needed to include the message frame + hasUnreadMessage = true; // Enables mail icon in the header + setFrames(FOCUS_PRESERVE); // Refresh frame list without switching view + forceDisplay(); // Forces screen redraw + + // === Prepare banner content === + const meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(packet->from); + const char *longName = (node && node->has_user) ? node->user.long_name : nullptr; + + const char *msgRaw = reinterpret_cast(packet->decoded.payload.bytes); + + char banner[256]; + + // Check for bell character in message to determine alert type + bool isAlert = false; + for (size_t i = 0; i < packet->decoded.payload.size && i < 100; i++) { + if (msgRaw[i] == '\x07') { + isAlert = true; + break; + } + } + + if (isAlert) { + if (longName && longName[0]) { + snprintf(banner, sizeof(banner), "Alert Received from\n%s", longName); + } else { + strcpy(banner, "Alert Received"); + } + } else { + if (longName && longName[0]) { + snprintf(banner, sizeof(banner), "New Message from\n%s", longName); + } else { + strcpy(banner, "New Message"); + } + } + + screen->showOverlayBanner(banner, 3000); + } } return 0; @@ -2809,20 +1189,39 @@ int Screen::handleUIFrameEvent(const UIFrameEvent *event) int Screen::handleInputEvent(const InputEvent *event) { + if (!screenOn) + return 0; -#if defined(DISPLAY_CLOCK_FRAME) - // For the T-Watch, intercept touches to the 'toggle digital/analog watch face' button - uint8_t watchFaceFrame = error_code ? 1 : 0; - - if (this->ui->getUiState()->currentFrame == watchFaceFrame && event->touchX >= 204 && event->touchX <= 240 && - event->touchY >= 204 && event->touchY <= 240) { - screen->digitalWatchFace = !screen->digitalWatchFace; - - setFrames(); - +#ifdef USE_EINK // the screen is the last input handler, so if an event makes it here, we can assume it will prompt a screen draw. + EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Use fast-refresh for next frame, no skip please + EINK_ADD_FRAMEFLAG(dispdev, BLOCKING); // Edge case: if this frame is promoted to COSMETIC, wait for update + handleSetOn(true); // Ensure power-on to receive deep-sleep screensaver (PowerFSM should handle?) + setFastFramerate(); // Draw ASAP +#endif + if (NotificationRenderer::isOverlayBannerShowing()) { + NotificationRenderer::inEvent = event->inputEvent; + static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, + NotificationRenderer::drawAlertBannerOverlay}; + ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); + setFastFramerate(); // Draw ASAP + ui->update(); return 0; } -#endif + /* + #if defined(DISPLAY_CLOCK_FRAME) + // For the T-Watch, intercept touches to the 'toggle digital/analog watch face' button + uint8_t watchFaceFrame = error_code ? 1 : 0; + + if (this->ui->getUiState()->currentFrame == watchFaceFrame && event->touchX >= 204 && event->touchX <= 240 && + event->touchY >= 204 && event->touchY <= 240) { + screen->digitalWatchFace = !screen->digitalWatchFace; + + setFrames(); + + return 0; + } + #endif + */ // Use left or right input from a keyboard to move between frames, // so long as a mesh module isn't using these events for some other purpose @@ -2837,10 +1236,140 @@ int Screen::handleInputEvent(const InputEvent *event) // If no modules are using the input, move between frames if (!inputIntercepted) { - if (event->inputEvent == static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT)) + if (event->inputEvent == INPUT_BROKER_LEFT || event->inputEvent == INPUT_BROKER_ALT_PRESS) { showPrevFrame(); - else if (event->inputEvent == static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT)) + } else if (event->inputEvent == INPUT_BROKER_RIGHT || event->inputEvent == INPUT_BROKER_USER_PRESS) { showNextFrame(); + } else if (event->inputEvent == INPUT_BROKER_SELECT) { + if (this->ui->getUiState()->currentFrame == framesetInfo.positions.home) { + const char *banner_message; + int options; + if (kb_found) { + banner_message = "Action?\nBack\nSleep Screen\nNew Preset Msg\nNew Freetext Msg"; + options = 4; + } else { + banner_message = "Action?\nBack\nSleep Screen\nNew Preset Msg"; + options = 3; + } + showOverlayBanner(banner_message, 30000, options, [](int selected) -> void { + if (selected == 1) { + screen->setOn(false); + } else if (selected == 2) { + cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST); + } else if (selected == 3) { + cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST); + } + }); +#if HAS_TFT + } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.memory) { + showOverlayBanner("Switch to MUI?\nYes\nNo", 30000, 2, [](int selected) -> void { + if (selected == 0) { + config.display.displaymode = meshtastic_Config_DisplayConfig_DisplayMode_COLOR; + config.bluetooth.enabled = false; + service->reloadConfig(SEGMENT_CONFIG); + rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); + } + }); +#else + } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.memory) { + showOverlayBanner( + "Beeps Mode\nAll Enabled\nDisabled\nNotifications\nSystem Only", 30000, 4, + [](int selected) -> void { + config.device.buzzer_mode = (meshtastic_Config_DeviceConfig_BuzzerMode)selected; + service->reloadConfig(SEGMENT_CONFIG); + }, + config.device.buzzer_mode); +#endif +#if HAS_GPS + } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.gps && gps) { + showOverlayBanner( + "Toggle GPS\nBack\nEnabled\nDisabled", 30000, 3, + [](int selected) -> void { + if (selected == 1) { + config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_ENABLED; + playGPSEnableBeep(); + gps->enable(); + } else if (selected == 2) { + config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_DISABLED; + playGPSDisableBeep(); + gps->disable(); + } + service->reloadConfig(SEGMENT_CONFIG); + }, + config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED ? 1 + : 2); // set inital selection +#endif + } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.clock) { + TZPicker(); + } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.lora) { + LoraRegionPicker(); + } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.textMessage && + devicestate.rx_text_message.from) { + const char *banner_message; + int options; + if (kb_found) { + banner_message = "Message Action?\nBack\nDismiss\nReply via Preset\nReply via Freetext"; + options = 4; + } else { + banner_message = "Message Action?\nBack\nDismiss\nReply via Preset"; + options = 3; + } +#ifdef HAS_I2S + banner_message = "Message Action?\nBack\nDismiss\nReply via Preset\nReply via Freetext\nRead Aloud"; + options = 5; +#endif + showOverlayBanner(banner_message, 30000, options, [](int selected) -> void { + if (selected == 1) { + screen->dismissCurrentFrame(); + } else if (selected == 2) { + if (devicestate.rx_text_message.to == NODENUM_BROADCAST) { + cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST, + devicestate.rx_text_message.channel); + } else { + cannedMessageModule->LaunchWithDestination(devicestate.rx_text_message.from); + } + } else if (selected == 3) { + if (devicestate.rx_text_message.to == NODENUM_BROADCAST) { + cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST, + devicestate.rx_text_message.channel); + } else { + cannedMessageModule->LaunchFreetextWithDestination(devicestate.rx_text_message.from); + } + } +#ifdef HAS_I2S + else if (selected == 4) { + const meshtastic_MeshPacket &mp = devicestate.rx_text_message; + const char *msg = reinterpret_cast(mp.decoded.payload.bytes); + + audioThread->readAloud(msg); + } +#endif + }); + } else if (framesetInfo.positions.firstFavorite != 255 && + this->ui->getUiState()->currentFrame >= framesetInfo.positions.firstFavorite && + this->ui->getUiState()->currentFrame <= framesetInfo.positions.lastFavorite) { + const char *banner_message; + int options; + if (kb_found) { + banner_message = "Message Node?\nCancel\nNew Preset Msg\nNew Freetext Msg"; + options = 3; + } else { + banner_message = "Message Node?\nCancel\nConfirm"; + options = 2; + } + showOverlayBanner(banner_message, 30000, options, [](int selected) -> void { + if (selected == 1) { + cannedMessageModule->LaunchWithDestination(graphics::UIRenderer::currentFavoriteNodeNum); + } else if (selected == 2) { + cannedMessageModule->LaunchFreetextWithDestination(graphics::UIRenderer::currentFavoriteNodeNum); + } + }); + } + } else if (event->inputEvent == INPUT_BROKER_BACK) { + showPrevFrame(); + } else if (event->inputEvent == INPUT_BROKER_CANCEL) { + setOn(false); + } } } @@ -2862,7 +1391,102 @@ int Screen::handleAdminMessage(const meshtastic_AdminMessage *arg) return 0; } +bool Screen::isOverlayBannerShowing() +{ + return NotificationRenderer::isOverlayBannerShowing(); +} + +void Screen::LoraRegionPicker(uint32_t duration) +{ + showOverlayBanner( + "Set the LoRa " + "region\nBack\nUS\nEU_433\nEU_868\nCN\nJP\nANZ\nKR\nTW\nRU\nIN\nNZ_865\nTH\nLORA_24\nUA_433\nUA_868\nMY_433\nMY_" + "919\nSG_" + "923\nPH_433\nPH_868\nPH_915\nANZ_433", + duration, 23, + [](int selected) -> void { + if (selected != 0 && config.lora.region != _meshtastic_Config_LoRaConfig_RegionCode(selected)) { + config.lora.region = _meshtastic_Config_LoRaConfig_RegionCode(selected); + // This is needed as we wait til picking the LoRa region to generate keys for the first time. + if (!owner.is_licensed) { + bool keygenSuccess = false; + if (config.security.private_key.size == 32) { + // public key is derived from private, so this will always have the same result. + if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) { + keygenSuccess = true; + } + } else { + LOG_INFO("Generate new PKI keys"); + crypto->generateKeyPair(config.security.public_key.bytes, config.security.private_key.bytes); + keygenSuccess = true; + } + if (keygenSuccess) { + config.security.public_key.size = 32; + config.security.private_key.size = 32; + owner.public_key.size = 32; + memcpy(owner.public_key.bytes, config.security.public_key.bytes, 32); + } + } + config.lora.tx_enabled = true; + initRegion(); + if (myRegion->dutyCycle < 100) { + config.lora.ignore_mqtt = true; // Ignore MQTT by default if region has a duty cycle limit + } + service->reloadConfig(SEGMENT_CONFIG); + rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); + } + }, + 0); +} + +void Screen::TZPicker() +{ + showOverlayBanner( + "Pick " + "Timezone\nBack\nUS/Hawaii\nUS/Alaska\nUS/Pacific\nUS/Mountain\nUS/Central\nUS/Eastern\nUTC\nEU/Western\nEU/" + "Central\nEU/Eastern\nAsia/Kolkata\nAsia/Hong_Kong\nAU/AWST\nAU/ACST\nAU/AEST\nPacific/NZ", + 30000, 17, [](int selected) -> void { + if (selected == 1) { // Hawaii + strncpy(config.device.tzdef, "HST10", sizeof(config.device.tzdef)); + } else if (selected == 2) { // Alaska + strncpy(config.device.tzdef, "AKST9AKDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); + } else if (selected == 3) { // Pacific + strncpy(config.device.tzdef, "PST8PDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); + } else if (selected == 4) { // Mountain + strncpy(config.device.tzdef, "MST7MDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); + } else if (selected == 5) { // Central + strncpy(config.device.tzdef, "CST6CDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); + } else if (selected == 6) { // Eastern + strncpy(config.device.tzdef, "EST5EDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); + } else if (selected == 7) { // UTC + strncpy(config.device.tzdef, "UTC", sizeof(config.device.tzdef)); + } else if (selected == 8) { // EU/Western + strncpy(config.device.tzdef, "GMT0BST,M3.5.0/1,M10.5.0", sizeof(config.device.tzdef)); + } else if (selected == 9) { // EU/Central + strncpy(config.device.tzdef, "CET-1CEST,M3.5.0,M10.5.0/3", sizeof(config.device.tzdef)); + } else if (selected == 10) { // EU/Eastern + strncpy(config.device.tzdef, "EET-2EEST,M3.5.0/3,M10.5.0/4", sizeof(config.device.tzdef)); + } else if (selected == 11) { // Asia/Kolkata + strncpy(config.device.tzdef, "IST-5:30", sizeof(config.device.tzdef)); + } else if (selected == 12) { // China + strncpy(config.device.tzdef, "HKT-8", sizeof(config.device.tzdef)); + } else if (selected == 13) { // AU/AWST + strncpy(config.device.tzdef, "AWST-8", sizeof(config.device.tzdef)); + } else if (selected == 14) { // AU/ACST + strncpy(config.device.tzdef, "ACST-9:30ACDT,M10.1.0,M4.1.0/3", sizeof(config.device.tzdef)); + } else if (selected == 15) { // AU/AEST + strncpy(config.device.tzdef, "AEST-10AEDT,M10.1.0,M4.1.0/3", sizeof(config.device.tzdef)); + } else if (selected == 16) { // NZ + strncpy(config.device.tzdef, "NZST-12NZDT,M9.5.0,M4.1.0/3", sizeof(config.device.tzdef)); + } + + setenv("TZ", config.device.tzdef, 1); + service->reloadConfig(SEGMENT_CONFIG); + }); +} + } // namespace graphics + #else graphics::Screen::Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY) {} #endif // HAS_SCREEN diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index ce416156f..c264f0f07 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -5,6 +5,10 @@ #include "detect/ScanI2C.h" #include "mesh/generated/meshtastic/config.pb.h" #include +#include +#include + +#define getStringCenteredX(s) ((SCREEN_WIDTH - display->getStringWidth(s)) / 2) #if !HAS_SCREEN #include "power.h" @@ -14,11 +18,18 @@ namespace graphics class Screen { public: + enum FrameFocus : uint8_t { + FOCUS_DEFAULT, // No specific frame + FOCUS_PRESERVE, // Return to the previous frame + FOCUS_FAULT, + FOCUS_TEXTMESSAGE, + FOCUS_MODULE, // Note: target module should call requestFocus(), otherwise no info about which module to focus + }; + explicit Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY); void onPress() {} void setup() {} void setOn(bool) {} - void print(const char *) {} void doDeepSleep() {} void forceDisplay(bool forceUiUpdate = false) {} void startFirmwareUpdateScreen() {} @@ -27,6 +38,11 @@ class Screen void setFunctionSymbol(std::string) {} void removeFunctionSymbol(std::string) {} void startAlert(const char *) {} + void showOverlayBanner(const char *message, uint32_t durationMs = 3000, uint8_t options = 0, + std::function bannerCallback = NULL, int8_t InitialSelected = 0) + { + } + void setFrames(FrameFocus focus) {} void endAlert() {} }; } // namespace graphics @@ -64,6 +80,7 @@ class Screen #include "mesh/MeshModule.h" #include "power.h" #include +#include // 0 to 255, though particular variants might define different defaults #ifndef BRIGHTNESS_DEFAULT @@ -90,7 +107,7 @@ class Screen /// Convert an integer GPS coords to a floating point #define DegD(i) (i * 1e-7) - +extern bool hasUnreadMessage; namespace { /// A basic 2D point class for drawing @@ -181,9 +198,23 @@ class Screen : public concurrency::OSThread public: explicit Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY); - + size_t frameCount = 0; // Total number of active frames ~Screen(); + // Which frame we want to be displayed, after we regen the frameset by calling setFrames + enum FrameFocus : uint8_t { + FOCUS_DEFAULT, // No specific frame + FOCUS_PRESERVE, // Return to the previous frame + FOCUS_FAULT, + FOCUS_TEXTMESSAGE, + FOCUS_MODULE, // Note: target module should call requestFocus(), otherwise no info about which module to focus + }; + + // Regenerate the normal set of frames, focusing a specific frame if requested + // Call when a frame should be added / removed, or custom frames should be cleared + void setFrames(FrameFocus focus = FOCUS_DEFAULT); + + std::vector indicatorIcons; // Per-frame custom icon pointers Screen(const Screen &) = delete; Screen &operator=(const Screen &) = delete; @@ -191,6 +222,12 @@ class Screen : public concurrency::OSThread meshtastic_Config_DisplayConfig_OledType model; OLEDDISPLAY_GEOMETRY geometry; + bool isOverlayBannerShowing(); + + // Stores the last 4 of our hardware ID, to make finding the device for pairing easier + // FIXME: Needs refactoring and getMacAddr needs to be moved to a utility class + char ourId[5]; + /// Initializes the UI, turns on the display, starts showing boot screen. // // Not thread safe - must be called before any other methods are called. @@ -214,21 +251,9 @@ class Screen : public concurrency::OSThread void blink(); - void drawFrameText(OLEDDisplay *, OLEDDisplayUiState *, int16_t, int16_t, const char *); - - void getTimeAgoStr(uint32_t agoSecs, char *timeStr, uint8_t maxLength); - // Draw north - void drawCompassNorth(OLEDDisplay *display, int16_t compassX, int16_t compassY, float myHeading); - - static uint16_t getCompassDiam(uint32_t displayWidth, uint32_t displayHeight); - float estimatedHeading(double lat, double lon); - void drawNodeHeading(OLEDDisplay *display, int16_t compassX, int16_t compassY, uint16_t compassDiam, float headingRadian); - - void drawColumns(OLEDDisplay *display, int16_t x, int16_t y, const char **fields); - /// Handle button press, trackball or swipe action) void onPress() { enqueueCmd(ScreenCmd{.cmd = Cmd::ON_PRESS}); } void showPrevFrame() { enqueueCmd(ScreenCmd{.cmd = Cmd::SHOW_PREV_FRAME}); } @@ -260,6 +285,9 @@ class Screen : public concurrency::OSThread enqueueCmd(cmd); } + void showOverlayBanner(const char *message, uint32_t durationMs = 3000, uint8_t options = 0, + std::function bannerCallback = NULL, int8_t InitialSelected = 0); + void startFirmwareUpdateScreen() { ScreenCmd cmd; @@ -292,23 +320,6 @@ class Screen : public concurrency::OSThread /// Stops showing the boot screen. void stopBootScreen() { enqueueCmd(ScreenCmd{.cmd = Cmd::STOP_BOOT_SCREEN}); } - /// Writes a string to the screen. - void print(const char *text) - { - ScreenCmd cmd; - cmd.cmd = Cmd::PRINT; - // TODO(girts): strdup() here is scary, but we can't use std::string as - // FreeRTOS queue is just dumbly copying memory contents. It would be - // nice if we had a queue that could copy objects by value. - cmd.print_text = strdup(text); - if (!enqueueCmd(cmd)) { - free(cmd.print_text); - } - } - - /// generates a very brief time delta display - std::string drawTimeDelta(uint32_t days, uint32_t hours, uint32_t minutes, uint32_t seconds); - /// Overrides the default utf8 character conversion, to replace empty space with question marks static char customFontTableLookup(const uint8_t ch) { @@ -541,8 +552,6 @@ class Screen : public concurrency::OSThread /// Draws our SSL cert screen during boot (called from WebServer) void setSSLFrames(); - void setWelcomeFrames(); - // Dismiss the currently focussed frame, if possible (e.g. text message, waypoint) void dismissCurrentFrame(); @@ -591,8 +600,9 @@ class Screen : public concurrency::OSThread void handleOnPress(); void handleShowNextFrame(); void handleShowPrevFrame(); - void handlePrint(const char *text); void handleStartFirmwareUpdateScreen(); + void TZPicker(); + void LoraRegionPicker(uint32_t duration = 30000); // Info collected by setFrames method. // Index location of specific frames. @@ -600,30 +610,32 @@ class Screen : public concurrency::OSThread // - Used to dismiss the currently shown frame (txt; waypoint) by CardKB combo struct FramesetInfo { struct FramePositions { - uint8_t fault = 0; - uint8_t textMessage = 0; - uint8_t waypoint = 0; - uint8_t focusedModule = 0; - uint8_t log = 0; - uint8_t settings = 0; - uint8_t wifi = 0; + uint8_t fault = 255; + uint8_t textMessage = 255; + uint8_t waypoint = 255; + uint8_t focusedModule = 255; + uint8_t log = 255; + uint8_t settings = 255; + uint8_t wifi = 255; + uint8_t deviceFocused = 255; + uint8_t memory = 255; + uint8_t gps = 255; + uint8_t home = 255; + uint8_t clock = 255; + uint8_t firstFavorite = 255; + uint8_t lastFavorite = 255; + uint8_t lora = 255; } positions; uint8_t frameCount = 0; } framesetInfo; - // Which frame we want to be displayed, after we regen the frameset by calling setFrames - enum FrameFocus : uint8_t { - FOCUS_DEFAULT, // No specific frame - FOCUS_PRESERVE, // Return to the previous frame - FOCUS_FAULT, - FOCUS_TEXTMESSAGE, - FOCUS_MODULE, // Note: target module should call requestFocus(), otherwise no info about which module to focus - }; - - // Regenerate the normal set of frames, focusing a specific frame if requested - // Call when a frame should be added / removed, or custom frames should be cleared - void setFrames(FrameFocus focus = FOCUS_DEFAULT); + struct DismissedFrames { + bool textMessage = false; + bool waypoint = false; + bool wifi = false; + bool memory = false; + } dismissedFrames; /// Try to start drawing ASAP void setFastFramerate(); @@ -631,34 +643,6 @@ class Screen : public concurrency::OSThread // Sets frame up for immediate drawing void setFrameImmediateDraw(FrameCallback *drawFrames); - /// Called when debug screen is to be drawn, calls through to debugInfo.drawFrame. - static void drawDebugInfoTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); - - static void drawDebugInfoSettingsTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); - - static void drawDebugInfoWiFiTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); - -#if defined(DISPLAY_CLOCK_FRAME) - static void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); - - static void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); - - static void drawSegmentedDisplayCharacter(OLEDDisplay *display, int x, int y, uint8_t number, float scale = 1); - - static void drawHorizontalSegment(OLEDDisplay *display, int x, int y, int width, int height); - - static void drawVerticalSegment(OLEDDisplay *display, int x, int y, int width, int height); - - static void drawSegmentedDisplayColon(OLEDDisplay *display, int x, int y, float scale = 1); - - static void drawWatchFaceToggleButton(OLEDDisplay *display, int16_t x, int16_t y, bool digitalMode = true, float scale = 1); - - static void drawBluetoothConnectedIcon(OLEDDisplay *display, int16_t x, int16_t y); - - // Whether we are showing the digital watch face or the analog one - bool digitalWatchFace = true; -#endif - /// callback for current alert frame FrameCallback alertFrame; @@ -691,4 +675,8 @@ class Screen : public concurrency::OSThread } // namespace graphics +// Extern declarations for function symbols used in UIRenderer +extern std::vector functionSymbol; +extern std::string functionSymbolString; + #endif \ No newline at end of file diff --git a/src/graphics/ScreenGlobals.cpp b/src/graphics/ScreenGlobals.cpp new file mode 100644 index 000000000..bc139faaf --- /dev/null +++ b/src/graphics/ScreenGlobals.cpp @@ -0,0 +1,6 @@ +#include +#include + +// Global variables for screen function overlay +std::vector functionSymbol; +std::string functionSymbolString; diff --git a/src/graphics/SharedUIDisplay.cpp b/src/graphics/SharedUIDisplay.cpp new file mode 100644 index 000000000..af427cae4 --- /dev/null +++ b/src/graphics/SharedUIDisplay.cpp @@ -0,0 +1,323 @@ +#include "graphics/SharedUIDisplay.h" +#include "RTC.h" +#include "graphics/ScreenFonts.h" +#include "main.h" +#include "meshtastic/config.pb.h" +#include "power.h" +#include +#include + +namespace graphics +{ + +// === Shared External State === +bool hasUnreadMessage = false; +bool isMuted = false; + +// === Internal State === +bool isBoltVisibleShared = true; +uint32_t lastBlinkShared = 0; +bool isMailIconVisible = true; +uint32_t lastMailBlink = 0; + +// ********************************* +// * Rounded Header when inverted * +// ********************************* +void drawRoundedHighlight(OLEDDisplay *display, int16_t x, int16_t y, int16_t w, int16_t h, int16_t r) +{ + // Draw the center and side rectangles + display->fillRect(x + r, y, w - 2 * r, h); // center bar + display->fillRect(x, y + r, r, h - 2 * r); // left edge + display->fillRect(x + w - r, y + r, r, h - 2 * r); // right edge + + // Draw the rounded corners using filled circles + display->fillCircle(x + r + 1, y + r, r); // top-left + display->fillCircle(x + w - r - 1, y + r, r); // top-right + display->fillCircle(x + r + 1, y + h - r - 1, r); // bottom-left + display->fillCircle(x + w - r - 1, y + h - r - 1, r); // bottom-right +} + +// ************************* +// * Common Header Drawing * +// ************************* +void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *titleStr) +{ + constexpr int HEADER_OFFSET_Y = 1; + y += HEADER_OFFSET_Y; + + display->setFont(FONT_SMALL); + display->setTextAlignment(TEXT_ALIGN_LEFT); + + const int xOffset = 4; + const int highlightHeight = FONT_HEIGHT_SMALL - 1; + const bool isInverted = (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_INVERTED); + const bool isBold = config.display.heading_bold; + + const int screenW = display->getWidth(); + const int screenH = display->getHeight(); + + const bool useBigIcons = (screenW > 128); + + // === Inverted Header Background === + if (isInverted) { + drawRoundedHighlight(display, x, y, screenW, highlightHeight, 2); + display->setColor(BLACK); + } else { + display->setColor(BLACK); + display->fillRect(0, 0, screenW, highlightHeight + 3); + display->setColor(WHITE); + if (screenW > 128) { + display->drawLine(0, 20, screenW, 20); + } else { + display->drawLine(0, 14, screenW, 14); + } + } + + // === Screen Title === + display->setTextAlignment(TEXT_ALIGN_CENTER); + display->drawString(SCREEN_WIDTH / 2, y, titleStr); + if (config.display.heading_bold) { + display->drawString((SCREEN_WIDTH / 2) + 1, y, titleStr); + } + display->setTextAlignment(TEXT_ALIGN_LEFT); + + // === Battery State === + int chargePercent = powerStatus->getBatteryChargePercent(); + bool isCharging = powerStatus->getIsCharging() == meshtastic::OptionalBool::OptTrue; + uint32_t now = millis(); + +#ifndef USE_EINK + if (isCharging && now - lastBlinkShared > 500) { + isBoltVisibleShared = !isBoltVisibleShared; + lastBlinkShared = now; + } +#endif + + bool useHorizontalBattery = (screenW > 128 && screenW >= screenH); + const int textY = y + (highlightHeight - FONT_HEIGHT_SMALL) / 2; + + // === Battery Icons === + if (useHorizontalBattery) { + int batteryX = 2; + int batteryY = HEADER_OFFSET_Y + 2; + display->drawXbm(batteryX, batteryY, 29, 15, batteryBitmap_h); + if (isCharging && isBoltVisibleShared) + display->drawXbm(batteryX + 9, batteryY + 1, 9, 13, lightning_bolt_h); + else { + display->drawXbm(batteryX + 8, batteryY, 12, 15, batteryBitmap_sidegaps_h); + int fillWidth = 24 * chargePercent / 100; + display->fillRect(batteryX + 1, batteryY + 1, fillWidth, 13); + } + } else { + int batteryX = 1; + int batteryY = HEADER_OFFSET_Y + 1; +#ifdef USE_EINK + batteryY += 2; +#endif + display->drawXbm(batteryX, batteryY, 7, 11, batteryBitmap_v); + if (isCharging && isBoltVisibleShared) + display->drawXbm(batteryX + 1, batteryY + 3, 5, 5, lightning_bolt_v); + else { + display->drawXbm(batteryX - 1, batteryY + 4, 8, 3, batteryBitmap_sidegaps_v); + int fillHeight = 8 * chargePercent / 100; + int fillY = batteryY - fillHeight; + display->fillRect(batteryX + 1, fillY + 10, 5, fillHeight); + } + } + + // === Battery % Display === + char chargeStr[4]; + snprintf(chargeStr, sizeof(chargeStr), "%d", chargePercent); + int chargeNumWidth = display->getStringWidth(chargeStr); + const int batteryOffset = useHorizontalBattery ? 28 : 6; +#ifdef USE_EINK + const int percentX = x + xOffset + batteryOffset - 2; +#else + const int percentX = x + xOffset + batteryOffset; +#endif + display->drawString(percentX, textY, chargeStr); + display->drawString(percentX + chargeNumWidth - 1, textY, "%"); + if (isBold) { + display->drawString(percentX + 1, textY, chargeStr); + display->drawString(percentX + chargeNumWidth, textY, "%"); + } + + // === Time and Right-aligned Icons === + uint32_t rtc_sec = getValidTime(RTCQuality::RTCQualityDevice, true); + char timeStr[10] = "--:--"; // Fallback display + int timeStrWidth = display->getStringWidth("12:34"); // Default alignment + int timeX = screenW - xOffset - timeStrWidth + 4; + + if (rtc_sec > 0) { + // === Build Time String === + long hms = (rtc_sec % SEC_PER_DAY + SEC_PER_DAY) % SEC_PER_DAY; + int hour = hms / SEC_PER_HOUR; + int minute = (hms % SEC_PER_HOUR) / SEC_PER_MIN; + snprintf(timeStr, sizeof(timeStr), "%d:%02d", hour, minute); + + if (config.display.use_12h_clock) { + bool isPM = hour >= 12; + hour %= 12; + if (hour == 0) + hour = 12; + snprintf(timeStr, sizeof(timeStr), "%d:%02d%s", hour, minute, isPM ? "p" : "a"); + } + + timeStrWidth = display->getStringWidth(timeStr); + timeX = screenW - xOffset - timeStrWidth + 4; + + // === Show Mail or Mute Icon to the Left of Time === + int iconRightEdge = timeX - 1; + + bool showMail = false; + +#ifndef USE_EINK + if (hasUnreadMessage) { + if (now - lastMailBlink > 500) { + isMailIconVisible = !isMailIconVisible; + lastMailBlink = now; + } + showMail = isMailIconVisible; + } +#else + if (hasUnreadMessage) { + showMail = true; + } +#endif + + if (showMail) { + if (useHorizontalBattery) { + int iconW = 16, iconH = 12; + int iconX = iconRightEdge - iconW; + int iconY = textY + (FONT_HEIGHT_SMALL - iconH) / 2 - 1; + if (isInverted) { + display->setColor(WHITE); + display->fillRect(iconX - 1, iconY - 1, iconW + 3, iconH + 2); + display->setColor(BLACK); + } else { + display->setColor(BLACK); + display->fillRect(iconX - 1, iconY - 1, iconW + 3, iconH + 2); + display->setColor(WHITE); + } + display->drawRect(iconX, iconY, iconW + 1, iconH); + display->drawLine(iconX, iconY, iconX + iconW / 2, iconY + iconH - 4); + display->drawLine(iconX + iconW, iconY, iconX + iconW / 2, iconY + iconH - 4); + } else { + int iconX = iconRightEdge - (mail_width - 2); + int iconY = textY + (FONT_HEIGHT_SMALL - mail_height) / 2; + if (isInverted) { + display->setColor(WHITE); + display->fillRect(iconX - 1, iconY - 1, mail_width + 2, mail_height + 2); + display->setColor(BLACK); + } else { + display->setColor(BLACK); + display->fillRect(iconX - 1, iconY - 1, mail_width + 2, mail_height + 2); + display->setColor(WHITE); + } + display->drawXbm(iconX, iconY, mail_width, mail_height, mail); + } + } else if (isMuted) { + if (useBigIcons) { + int iconX = iconRightEdge - mute_symbol_big_width; + int iconY = textY + (FONT_HEIGHT_SMALL - mute_symbol_big_height) / 2; + + if (isInverted) { + display->setColor(WHITE); + display->fillRect(iconX - 1, iconY - 1, mute_symbol_big_width + 2, mute_symbol_big_height + 2); + display->setColor(BLACK); + } else { + display->setColor(BLACK); + display->fillRect(iconX - 1, iconY - 1, mute_symbol_big_width + 2, mute_symbol_big_height + 2); + display->setColor(WHITE); + } + display->drawXbm(iconX, iconY, mute_symbol_big_width, mute_symbol_big_height, mute_symbol_big); + } else { + int iconX = iconRightEdge - mute_symbol_width; + int iconY = textY + (FONT_HEIGHT_SMALL - mail_height) / 2; + + if (isInverted) { + display->setColor(WHITE); + display->fillRect(iconX - 1, iconY - 1, mute_symbol_width + 2, mute_symbol_height + 2); + display->setColor(BLACK); + } else { + display->setColor(BLACK); + display->fillRect(iconX - 1, iconY - 1, mute_symbol_width + 2, mute_symbol_height + 2); + display->setColor(WHITE); + } + display->drawXbm(iconX, iconY, mute_symbol_width, mute_symbol_height, mute_symbol); + } + } + + // === Draw Time === + display->drawString(timeX, textY, timeStr); + if (isBold) + display->drawString(timeX - 1, textY, timeStr); + + } else { + // === No Time Available: Mail/Mute Icon Moves to Far Right === + int iconRightEdge = screenW - xOffset; + + bool showMail = false; + + if (hasUnreadMessage) { + if (now - lastMailBlink > 500) { + isMailIconVisible = !isMailIconVisible; + lastMailBlink = now; + } + showMail = isMailIconVisible; + } + + if (showMail) { + if (useHorizontalBattery) { + int iconW = 16, iconH = 12; + int iconX = iconRightEdge - iconW; + int iconY = textY + (FONT_HEIGHT_SMALL - iconH) / 2 - 1; + display->drawRect(iconX, iconY, iconW + 1, iconH); + display->drawLine(iconX, iconY, iconX + iconW / 2, iconY + iconH - 4); + display->drawLine(iconX + iconW, iconY, iconX + iconW / 2, iconY + iconH - 4); + } else { + int iconX = iconRightEdge - mail_width; + int iconY = textY + (FONT_HEIGHT_SMALL - mail_height) / 2; + display->drawXbm(iconX, iconY, mail_width, mail_height, mail); + } + } else if (isMuted) { + if (useBigIcons) { + int iconX = iconRightEdge - mute_symbol_big_width; + int iconY = textY + (FONT_HEIGHT_SMALL - mute_symbol_big_height) / 2; + display->drawXbm(iconX, iconY, mute_symbol_big_width, mute_symbol_big_height, mute_symbol_big); + } else { + int iconX = iconRightEdge - mute_symbol_width; + int iconY = textY + (FONT_HEIGHT_SMALL - mail_height) / 2; + display->drawXbm(iconX, iconY, mute_symbol_width, mute_symbol_height, mute_symbol); + } + } + } + + display->setColor(WHITE); // Reset for other UI +} + +const int *getTextPositions(OLEDDisplay *display) +{ + static int textPositions[7]; // Static array that persists beyond function scope + + if (display->getHeight() > 64) { + textPositions[0] = textZeroLine; + textPositions[1] = textFirstLine_medium; + textPositions[2] = textSecondLine_medium; + textPositions[3] = textThirdLine_medium; + textPositions[4] = textFourthLine_medium; + textPositions[5] = textFifthLine_medium; + textPositions[6] = textSixthLine_medium; + } else { + textPositions[0] = textZeroLine; + textPositions[1] = textFirstLine; + textPositions[2] = textSecondLine; + textPositions[3] = textThirdLine; + textPositions[4] = textFourthLine; + textPositions[5] = textFifthLine; + textPositions[6] = textSixthLine; + } + return textPositions; +} + +} // namespace graphics diff --git a/src/graphics/SharedUIDisplay.h b/src/graphics/SharedUIDisplay.h new file mode 100644 index 000000000..41411ba7f --- /dev/null +++ b/src/graphics/SharedUIDisplay.h @@ -0,0 +1,53 @@ +#pragma once + +#include + +namespace graphics +{ + +// ======================= +// Shared UI Helpers +// ======================= + +#define textZeroLine 0 +// Consistent Line Spacing - this is standard for all display and the fall-back spacing +#define textFirstLine (FONT_HEIGHT_SMALL - 1) +#define textSecondLine (textFirstLine + (FONT_HEIGHT_SMALL - 5)) +#define textThirdLine (textSecondLine + (FONT_HEIGHT_SMALL - 5)) +#define textFourthLine (textThirdLine + (FONT_HEIGHT_SMALL - 5)) +#define textFifthLine (textFourthLine + (FONT_HEIGHT_SMALL - 5)) +#define textSixthLine (textFifthLine + (FONT_HEIGHT_SMALL - 5)) + +// Consistent Line Spacing for devices like T114 and TEcho/ThinkNode M1 of devices +#define textFirstLine_medium (FONT_HEIGHT_SMALL + 1) +#define textSecondLine_medium (textFirstLine_medium + FONT_HEIGHT_SMALL) +#define textThirdLine_medium (textSecondLine_medium + FONT_HEIGHT_SMALL) +#define textFourthLine_medium (textThirdLine_medium + FONT_HEIGHT_SMALL) +#define textFifthLine_medium (textFourthLine_medium + FONT_HEIGHT_SMALL) +#define textSixthLine_medium (textFifthLine_medium + FONT_HEIGHT_SMALL) + +// Consistent Line Spacing for devices like VisionMaster T190 +#define textFirstLine_large (FONT_HEIGHT_SMALL + 1) +#define textSecondLine_large (textFirstLine_large + (FONT_HEIGHT_SMALL + 5)) +#define textThirdLine_large (textSecondLine_large + (FONT_HEIGHT_SMALL + 5)) +#define textFourthLine_large (textThirdLine_large + (FONT_HEIGHT_SMALL + 5)) +#define textFifthLine_large (textFourthLine_large + (FONT_HEIGHT_SMALL + 5)) +#define textSixthLine_large (textFifthLine_large + (FONT_HEIGHT_SMALL + 5)) + +// Quick screen access +#define SCREEN_WIDTH display->getWidth() +#define SCREEN_HEIGHT display->getHeight() + +// Shared state (declare inside namespace) +extern bool hasUnreadMessage; +extern bool isMuted; + +// Rounded highlight (used for inverted headers) +void drawRoundedHighlight(OLEDDisplay *display, int16_t x, int16_t y, int16_t w, int16_t h, int16_t r); + +// Shared battery/time/mail header +void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *titleStr = ""); + +const int *getTextPositions(OLEDDisplay *display); + +} // namespace graphics diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index 76fe6b2d3..92b2c3d02 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -662,7 +662,7 @@ static LGFX *tft = nullptr; #include // Graphics and font library for ILI9342 driver chip static TFT_eSPI *tft = nullptr; // Invoke library, pins defined in User_Setup.h -#elif ARCH_PORTDUINO && HAS_SCREEN != 0 && !HAS_TFT +#elif ARCH_PORTDUINO #include // Graphics and font library for ST7735 driver chip class LGFX : public lgfx::LGFX_Device @@ -706,11 +706,16 @@ class LGFX : public lgfx::LGFX_Device _panel_instance->setBus(&_bus_instance); // set the bus on the panel. auto cfg = _panel_instance->config(); // Gets a structure for display panel settings. - LOG_DEBUG("Height: %d, Width: %d ", settingsMap[displayHeight], settingsMap[displayWidth]); + LOG_DEBUG("Width: %d, Height: %d", settingsMap[displayWidth], settingsMap[displayHeight]); cfg.pin_cs = settingsMap[displayCS]; // Pin number where CS is connected (-1 = disable) cfg.pin_rst = settingsMap[displayReset]; - cfg.panel_width = settingsMap[displayWidth]; // actual displayable width - cfg.panel_height = settingsMap[displayHeight]; // actual displayable height + if (settingsMap[displayRotate]) { + cfg.panel_width = settingsMap[displayHeight]; // actual displayable width + cfg.panel_height = settingsMap[displayWidth]; // actual displayable height + } else { + cfg.panel_width = settingsMap[displayWidth]; // actual displayable width + cfg.panel_height = settingsMap[displayHeight]; // actual displayable height + } cfg.offset_x = settingsMap[displayOffsetX]; // Panel offset amount in X direction cfg.offset_y = settingsMap[displayOffsetY]; // Panel offset amount in Y direction cfg.offset_rotation = settingsMap[displayOffsetRotate]; // Rotation direction value offset 0~7 (4~7 is mirrored) @@ -987,9 +992,9 @@ TFTDisplay::TFTDisplay(uint8_t address, int sda, int scl, OLEDDISPLAY_GEOMETRY g #if ARCH_PORTDUINO if (settingsMap[displayRotate]) { - setGeometry(GEOMETRY_RAWMODE, settingsMap[configNames::displayHeight], settingsMap[configNames::displayWidth]); - } else { setGeometry(GEOMETRY_RAWMODE, settingsMap[configNames::displayWidth], settingsMap[configNames::displayHeight]); + } else { + setGeometry(GEOMETRY_RAWMODE, settingsMap[configNames::displayHeight], settingsMap[configNames::displayWidth]); } #elif defined(SCREEN_ROTATE) @@ -1178,6 +1183,8 @@ bool TFTDisplay::connect() tft->setRotation(1); // T-Deck has the TFT in landscape #elif defined(T_WATCH_S3) || defined(SENSECAP_INDICATOR) tft->setRotation(2); // T-Watch S3 left-handed orientation +#elif ARCH_PORTDUINO + tft->setRotation(0); // use config.yaml to set rotation #else tft->setRotation(3); // Orient horizontal and wide underneath the silkscreen name label #endif diff --git a/src/graphics/TimeFormatters.cpp b/src/graphics/TimeFormatters.cpp new file mode 100644 index 000000000..47036078b --- /dev/null +++ b/src/graphics/TimeFormatters.cpp @@ -0,0 +1,103 @@ +#include "TimeFormatters.h" +#include "configuration.h" +#include "gps/RTC.h" +#include "mesh/NodeDB.h" +#include + +bool deltaToTimestamp(uint32_t secondsAgo, uint8_t *hours, uint8_t *minutes, int32_t *daysAgo) +{ + // Cache the result - avoid frequent recalculation + static uint8_t hoursCached = 0, minutesCached = 0; + static uint32_t daysAgoCached = 0; + static uint32_t secondsAgoCached = 0; + static bool validCached = false; + + // Abort: if timezone not set + if (strlen(config.device.tzdef) == 0) { + validCached = false; + return validCached; + } + + // Abort: if invalid pointers passed + if (hours == nullptr || minutes == nullptr || daysAgo == nullptr) { + validCached = false; + return validCached; + } + + // Abort: if time seems invalid.. (> 6 months ago, probably seen before RTC set) + if (secondsAgo > SEC_PER_DAY * 30UL * 6) { + validCached = false; + return validCached; + } + + // If repeated request, don't bother recalculating + if (secondsAgo - secondsAgoCached < 60 && secondsAgoCached != 0) { + if (validCached) { + *hours = hoursCached; + *minutes = minutesCached; + *daysAgo = daysAgoCached; + } + return validCached; + } + + // Get local time + uint32_t secondsRTC = getValidTime(RTCQuality::RTCQualityDevice, true); // Get local time + + // Abort: if RTC not set + if (!secondsRTC) { + validCached = false; + return validCached; + } + + // Get absolute time when last seen + uint32_t secondsSeenAt = secondsRTC - secondsAgo; + + // Calculate daysAgo + *daysAgo = (secondsRTC / SEC_PER_DAY) - (secondsSeenAt / SEC_PER_DAY); // How many "midnights" have passed + + // Get seconds since midnight + uint32_t hms = (secondsRTC - secondsAgo) % SEC_PER_DAY; + hms = (hms + SEC_PER_DAY) % SEC_PER_DAY; + + // Tear apart hms into hours and minutes + *hours = hms / SEC_PER_HOUR; + *minutes = (hms % SEC_PER_HOUR) / SEC_PER_MIN; + + // Cache the result + daysAgoCached = *daysAgo; + hoursCached = *hours; + minutesCached = *minutes; + secondsAgoCached = secondsAgo; + + validCached = true; + return validCached; +} + +void getTimeAgoStr(uint32_t agoSecs, char *timeStr, uint8_t maxLength) +{ + // Use an absolute timestamp in some cases. + // Particularly useful with E-Ink displays. Static UI, fewer refreshes. + uint8_t timestampHours, timestampMinutes; + int32_t daysAgo; + bool useTimestamp = deltaToTimestamp(agoSecs, ×tampHours, ×tampMinutes, &daysAgo); + + if (agoSecs < 120) // last 2 mins? + snprintf(timeStr, maxLength, "%u seconds ago", agoSecs); + // -- if suitable for timestamp -- + else if (useTimestamp && agoSecs < 15 * SECONDS_IN_MINUTE) // Last 15 minutes + snprintf(timeStr, maxLength, "%u minutes ago", agoSecs / SECONDS_IN_MINUTE); + else if (useTimestamp && daysAgo == 0) // Today + snprintf(timeStr, maxLength, "Last seen: %02u:%02u", (unsigned int)timestampHours, (unsigned int)timestampMinutes); + else if (useTimestamp && daysAgo == 1) // Yesterday + snprintf(timeStr, maxLength, "Seen yesterday"); + else if (useTimestamp && daysAgo > 1) // Last six months (capped by deltaToTimestamp method) + snprintf(timeStr, maxLength, "%li days ago", (long)daysAgo); + // -- if using time delta instead -- + else if (agoSecs < 120 * 60) // last 2 hrs + snprintf(timeStr, maxLength, "%u minutes ago", agoSecs / 60); + // Only show hours ago if it's been less than 6 months. Otherwise, we may have bad data. + else if ((agoSecs / 60 / 60) < (730 * 6)) + snprintf(timeStr, maxLength, "%u hours ago", agoSecs / 60 / 60); + else + snprintf(timeStr, maxLength, "unknown age"); +} diff --git a/src/graphics/TimeFormatters.h b/src/graphics/TimeFormatters.h new file mode 100644 index 000000000..b3d8413a2 --- /dev/null +++ b/src/graphics/TimeFormatters.h @@ -0,0 +1,26 @@ +#pragma once + +#include "configuration.h" +#include "gps/RTC.h" +#include +#include + +/** + * Convert a delta in seconds ago to timestamp information (hours, minutes, days ago). + * + * @param secondsAgo Number of seconds ago to convert + * @param hours Pointer to store the hours (0-23) + * @param minutes Pointer to store the minutes (0-59) + * @param daysAgo Pointer to store the number of days ago + * @return true if conversion was successful, false if invalid input or time not available + */ +bool deltaToTimestamp(uint32_t secondsAgo, uint8_t *hours, uint8_t *minutes, int32_t *daysAgo); + +/** + * Get a human-readable string representing the time ago in a format like "2 days, 3 hours, 15 minutes". + * + * @param agoSecs Number of seconds ago to convert + * @param timeStr Pointer to store the resulting string + * @param maxLength Maximum length of the resulting string buffer + */ +void getTimeAgoStr(uint32_t agoSecs, char *timeStr, uint8_t maxLength); diff --git a/src/graphics/draw/ClockRenderer.cpp b/src/graphics/draw/ClockRenderer.cpp new file mode 100644 index 000000000..2e301b4e1 --- /dev/null +++ b/src/graphics/draw/ClockRenderer.cpp @@ -0,0 +1,473 @@ +#include "configuration.h" +#if HAS_SCREEN +#include "ClockRenderer.h" +#include "NodeDB.h" +#include "UIRenderer.h" +#include "configuration.h" +#include "gps/GeoCoord.h" +#include "gps/RTC.h" +#include "graphics/ScreenFonts.h" +#include "graphics/SharedUIDisplay.h" +#include "graphics/emotes.h" +#include "graphics/images.h" +#include "main.h" + +#if !MESHTASTIC_EXCLUDE_BLUETOOTH +#include "nimble/NimbleBluetooth.h" +#endif + +namespace graphics +{ + +namespace ClockRenderer +{ + +void drawSegmentedDisplayColon(OLEDDisplay *display, int x, int y, float scale) +{ + uint16_t segmentWidth = SEGMENT_WIDTH * scale; + uint16_t segmentHeight = SEGMENT_HEIGHT * scale; + + uint16_t cellHeight = (segmentWidth * 2) + (segmentHeight * 3) + 8; + + uint16_t topAndBottomX = x + (4 * scale); + + uint16_t quarterCellHeight = cellHeight / 4; + + uint16_t topY = y + quarterCellHeight; + uint16_t bottomY = y + (quarterCellHeight * 3); + + display->fillRect(topAndBottomX, topY, segmentHeight, segmentHeight); + display->fillRect(topAndBottomX, bottomY, segmentHeight, segmentHeight); +} + +void drawSegmentedDisplayCharacter(OLEDDisplay *display, int x, int y, uint8_t number, float scale) +{ + // the numbers 0-9, each expressed as an array of seven boolean (0|1) values encoding the on/off state of + // segment {innerIndex + 1} + // e.g., to display the numeral '0', segments 1-6 are on, and segment 7 is off. + uint8_t numbers[10][7] = { + {1, 1, 1, 1, 1, 1, 0}, // 0 Display segment key + {0, 1, 1, 0, 0, 0, 0}, // 1 1 + {1, 1, 0, 1, 1, 0, 1}, // 2 ___ + {1, 1, 1, 1, 0, 0, 1}, // 3 6 | | 2 + {0, 1, 1, 0, 0, 1, 1}, // 4 |_7̲_| + {1, 0, 1, 1, 0, 1, 1}, // 5 5 | | 3 + {1, 0, 1, 1, 1, 1, 1}, // 6 |___| + {1, 1, 1, 0, 0, 1, 0}, // 7 + {1, 1, 1, 1, 1, 1, 1}, // 8 4 + {1, 1, 1, 1, 0, 1, 1}, // 9 + }; + + // the width and height of each segment's central rectangle: + // _____________________ + // ⋰| (only this part, |⋱ + // ⋰ | not including | ⋱ + // ⋱ | the triangles | ⋰ + // ⋱| on the ends) |⋰ + // ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + + uint16_t segmentWidth = SEGMENT_WIDTH * scale; + uint16_t segmentHeight = SEGMENT_HEIGHT * scale; + + // segment x and y coordinates + uint16_t segmentOneX = x + segmentHeight + 2; + uint16_t segmentOneY = y; + + uint16_t segmentTwoX = segmentOneX + segmentWidth + 2; + uint16_t segmentTwoY = segmentOneY + segmentHeight + 2; + + uint16_t segmentThreeX = segmentTwoX; + uint16_t segmentThreeY = segmentTwoY + segmentWidth + 2 + segmentHeight + 2; + + uint16_t segmentFourX = segmentOneX; + uint16_t segmentFourY = segmentThreeY + segmentWidth + 2; + + uint16_t segmentFiveX = x; + uint16_t segmentFiveY = segmentThreeY; + + uint16_t segmentSixX = x; + uint16_t segmentSixY = segmentTwoY; + + uint16_t segmentSevenX = segmentOneX; + uint16_t segmentSevenY = segmentTwoY + segmentWidth + 2; + + if (numbers[number][0]) { + graphics::ClockRenderer::drawHorizontalSegment(display, segmentOneX, segmentOneY, segmentWidth, segmentHeight); + } + + if (numbers[number][1]) { + graphics::ClockRenderer::drawVerticalSegment(display, segmentTwoX, segmentTwoY, segmentWidth, segmentHeight); + } + + if (numbers[number][2]) { + graphics::ClockRenderer::drawVerticalSegment(display, segmentThreeX, segmentThreeY, segmentWidth, segmentHeight); + } + + if (numbers[number][3]) { + graphics::ClockRenderer::drawHorizontalSegment(display, segmentFourX, segmentFourY, segmentWidth, segmentHeight); + } + + if (numbers[number][4]) { + graphics::ClockRenderer::drawVerticalSegment(display, segmentFiveX, segmentFiveY, segmentWidth, segmentHeight); + } + + if (numbers[number][5]) { + graphics::ClockRenderer::drawVerticalSegment(display, segmentSixX, segmentSixY, segmentWidth, segmentHeight); + } + + if (numbers[number][6]) { + graphics::ClockRenderer::drawHorizontalSegment(display, segmentSevenX, segmentSevenY, segmentWidth, segmentHeight); + } +} + +void drawHorizontalSegment(OLEDDisplay *display, int x, int y, int width, int height) +{ + int halfHeight = height / 2; + + // draw central rectangle + display->fillRect(x, y, width, height); + + // draw end triangles + display->fillTriangle(x, y, x, y + height - 1, x - halfHeight, y + halfHeight); + + display->fillTriangle(x + width, y, x + width + halfHeight, y + halfHeight, x + width, y + height - 1); +} + +void drawVerticalSegment(OLEDDisplay *display, int x, int y, int width, int height) +{ + int halfHeight = height / 2; + + // draw central rectangle + display->fillRect(x, y, height, width); + + // draw end triangles + display->fillTriangle(x + halfHeight, y - halfHeight, x + height - 1, y, x, y); + + display->fillTriangle(x, y + width, x + height - 1, y + width, x + halfHeight, y + width + halfHeight); +} + +void drawWatchFaceToggleButton(OLEDDisplay *display, int16_t x, int16_t y, bool digitalMode, float scale) +{ + uint16_t segmentWidth = SEGMENT_WIDTH * scale; + uint16_t segmentHeight = SEGMENT_HEIGHT * scale; + + if (digitalMode) { + uint16_t radius = (segmentWidth + (segmentHeight * 2) + 4) / 2; + uint16_t centerX = (x + segmentHeight + 2) + (radius / 2); + uint16_t centerY = (y + segmentHeight + 2) + (radius / 2); + + display->drawCircle(centerX, centerY, radius); + display->drawCircle(centerX, centerY, radius + 1); + display->drawLine(centerX, centerY, centerX, centerY - radius + 3); + display->drawLine(centerX, centerY, centerX + radius - 3, centerY); + } else { + uint16_t segmentOneX = x + segmentHeight + 2; + uint16_t segmentOneY = y; + + uint16_t segmentTwoX = segmentOneX + segmentWidth + 2; + uint16_t segmentTwoY = segmentOneY + segmentHeight + 2; + + uint16_t segmentThreeX = segmentOneX; + uint16_t segmentThreeY = segmentTwoY + segmentWidth + 2; + + uint16_t segmentFourX = x; + uint16_t segmentFourY = y + segmentHeight + 2; + + drawHorizontalSegment(display, segmentOneX, segmentOneY, segmentWidth, segmentHeight); + drawVerticalSegment(display, segmentTwoX, segmentTwoY, segmentWidth, segmentHeight); + drawHorizontalSegment(display, segmentThreeX, segmentThreeY, segmentWidth, segmentHeight); + drawVerticalSegment(display, segmentFourX, segmentFourY, segmentWidth, segmentHeight); + } +} + +// Draw a digital clock +void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + display->clear(); + display->setTextAlignment(TEXT_ALIGN_LEFT); + int line = 1; + +#ifdef T_WATCH_S3 + if (nimbleBluetooth && nimbleBluetooth->isConnected()) { + graphics::ClockRenderer::drawBluetoothConnectedIcon(display, display->getWidth() - 18, y + 2); + } + + drawWatchFaceToggleButton(display, display->getWidth() - 36, display->getHeight() - 36, + graphics::ClockRenderer::digitalWatchFace, 1); +#endif + + uint32_t rtc_sec = getValidTime(RTCQuality::RTCQualityDevice, true); // Display local timezone + char timeString[16]; + int hour = 0; + int minute = 0; + int second = 0; + if (rtc_sec > 0) { + long hms = rtc_sec % SEC_PER_DAY; + hms = (hms + SEC_PER_DAY) % SEC_PER_DAY; + + hour = hms / SEC_PER_HOUR; + minute = (hms % SEC_PER_HOUR) / SEC_PER_MIN; + second = (hms % SEC_PER_HOUR) % SEC_PER_MIN; // or hms % SEC_PER_MIN + } + + bool isPM = hour >= 12; + // hour = hour > 12 ? hour - 12 : hour; + if (config.display.use_12h_clock) { + hour %= 12; + if (hour == 0) + hour = 12; + bool isPM = hour >= 12; + snprintf(timeString, sizeof(timeString), "%d:%02d", hour, minute); + } else { + snprintf(timeString, sizeof(timeString), "%02d:%02d", hour, minute); + } + + // Format seconds string + char secondString[8]; + snprintf(secondString, sizeof(secondString), "%02d", second); + +#ifdef T_WATCH_S3 + float scale = 1.5; +#else + float scale = 0.75; + if (SCREEN_WIDTH > 128) { + scale = 1.5; + } +#endif + + uint16_t segmentWidth = SEGMENT_WIDTH * scale; + uint16_t segmentHeight = SEGMENT_HEIGHT * scale; + + // calculate hours:minutes string width + uint16_t timeStringWidth = strlen(timeString) * 5; + + for (uint8_t i = 0; i < strlen(timeString); i++) { + char character = timeString[i]; + + if (character == ':') { + timeStringWidth += segmentHeight; + } else { + timeStringWidth += segmentWidth + (segmentHeight * 2) + 4; + } + } + + uint16_t hourMinuteTextX = (display->getWidth() / 2) - (timeStringWidth / 2); + + uint16_t startingHourMinuteTextX = hourMinuteTextX; + + uint16_t hourMinuteTextY = (display->getHeight() / 2) - (((segmentWidth * 2) + (segmentHeight * 3) + 8) / 2); + + // iterate over characters in hours:minutes string and draw segmented characters + for (uint8_t i = 0; i < strlen(timeString); i++) { + char character = timeString[i]; + + if (character == ':') { + drawSegmentedDisplayColon(display, hourMinuteTextX, hourMinuteTextY, scale); + + hourMinuteTextX += segmentHeight + 6; + } else { + drawSegmentedDisplayCharacter(display, hourMinuteTextX, hourMinuteTextY, character - '0', scale); + + hourMinuteTextX += segmentWidth + (segmentHeight * 2) + 4; + } + + hourMinuteTextX += 5; + } + + // draw seconds string + display->setFont(FONT_SMALL); + int xOffset = (SCREEN_WIDTH > 128) ? 0 : -1; + if (hour >= 10) { + xOffset += (SCREEN_WIDTH > 128) ? 32 : 18; + } + int yOffset = (SCREEN_WIDTH > 128) ? 3 : 1; + if (config.display.use_12h_clock) { + display->drawString(startingHourMinuteTextX + xOffset, (display->getHeight() - hourMinuteTextY) - yOffset - 2, + isPM ? "pm" : "am"); + } +#ifndef USE_EINK + xOffset = (SCREEN_WIDTH > 128) ? 18 : 10; + display->drawString(startingHourMinuteTextX + timeStringWidth - xOffset, (display->getHeight() - hourMinuteTextY) - yOffset, + secondString); +#endif +} + +void drawBluetoothConnectedIcon(OLEDDisplay *display, int16_t x, int16_t y) +{ + display->drawFastImage(x, y, 18, 14, bluetoothConnectedIcon); +} + +// Draw an analog clock +void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + display->setTextAlignment(TEXT_ALIGN_LEFT); + + graphics::UIRenderer::drawBattery(display, x, y + 7, imgBattery, powerStatus); + + if (powerStatus->getHasBattery()) { + char batteryPercent[8]; + snprintf(batteryPercent, sizeof(batteryPercent), "%d%%", powerStatus->getBatteryChargePercent()); + + display->setFont(FONT_SMALL); + + display->drawString(x + 20, y + 2, batteryPercent); + } +#ifdef T_WATCH_S3 + if (nimbleBluetooth && nimbleBluetooth->isConnected()) { + drawBluetoothConnectedIcon(display, display->getWidth() - 18, y + 2); + } +#endif + drawWatchFaceToggleButton(display, display->getWidth() - 36, display->getHeight() - 36, + graphics::ClockRenderer::digitalWatchFace, 1); + + // clock face center coordinates + int16_t centerX = display->getWidth() / 2; + int16_t centerY = display->getHeight() / 2; + + // clock face radius + int16_t radius = (display->getWidth() / 2) * 0.8; + + // noon (0 deg) coordinates (outermost circle) + int16_t noonX = centerX; + int16_t noonY = centerY - radius; + + // second hand radius and y coordinate (outermost circle) + int16_t secondHandNoonY = noonY + 1; + + // tick mark outer y coordinate; (first nested circle) + int16_t tickMarkOuterNoonY = secondHandNoonY; + + // seconds tick mark inner y coordinate; (second nested circle) + double secondsTickMarkInnerNoonY = (double)noonY + 8; + + // hours tick mark inner y coordinate; (third nested circle) + double hoursTickMarkInnerNoonY = (double)noonY + 16; + + // minute hand y coordinate + int16_t minuteHandNoonY = secondsTickMarkInnerNoonY + 4; + + // hour string y coordinate + int16_t hourStringNoonY = minuteHandNoonY + 18; + + // hour hand radius and y coordinate + int16_t hourHandRadius = radius * 0.55; + int16_t hourHandNoonY = centerY - hourHandRadius; + + display->setColor(OLEDDISPLAY_COLOR::WHITE); + display->drawCircle(centerX, centerY, radius); + + uint32_t rtc_sec = getValidTime(RTCQuality::RTCQualityDevice, true); // Display local timezone + if (rtc_sec > 0) { + long hms = rtc_sec % SEC_PER_DAY; + hms = (hms + SEC_PER_DAY) % SEC_PER_DAY; + + // Tear apart hms into h:m:s + int hour = hms / SEC_PER_HOUR; + int minute = (hms % SEC_PER_HOUR) / SEC_PER_MIN; + int second = (hms % SEC_PER_HOUR) % SEC_PER_MIN; // or hms % SEC_PER_MIN + + hour = hour > 12 ? hour - 12 : hour; + + int16_t degreesPerHour = 30; + int16_t degreesPerMinuteOrSecond = 6; + + double hourBaseAngle = hour * degreesPerHour; + double hourAngleOffset = ((double)minute / 60) * degreesPerHour; + double hourAngle = radians(hourBaseAngle + hourAngleOffset); + + double minuteBaseAngle = minute * degreesPerMinuteOrSecond; + double minuteAngleOffset = ((double)second / 60) * degreesPerMinuteOrSecond; + double minuteAngle = radians(minuteBaseAngle + minuteAngleOffset); + + double secondAngle = radians(second * degreesPerMinuteOrSecond); + + double hourX = sin(-hourAngle) * (hourHandNoonY - centerY) + noonX; + double hourY = cos(-hourAngle) * (hourHandNoonY - centerY) + centerY; + + double minuteX = sin(-minuteAngle) * (minuteHandNoonY - centerY) + noonX; + double minuteY = cos(-minuteAngle) * (minuteHandNoonY - centerY) + centerY; + + double secondX = sin(-secondAngle) * (secondHandNoonY - centerY) + noonX; + double secondY = cos(-secondAngle) * (secondHandNoonY - centerY) + centerY; + + display->setFont(FONT_MEDIUM); + + // draw minute and hour tick marks and hour numbers + for (uint16_t angle = 0; angle < 360; angle += 6) { + double angleInRadians = radians(angle); + + double sineAngleInRadians = sin(-angleInRadians); + double cosineAngleInRadians = cos(-angleInRadians); + + double endX = sineAngleInRadians * (tickMarkOuterNoonY - centerY) + noonX; + double endY = cosineAngleInRadians * (tickMarkOuterNoonY - centerY) + centerY; + + if (angle % degreesPerHour == 0) { + double startX = sineAngleInRadians * (hoursTickMarkInnerNoonY - centerY) + noonX; + double startY = cosineAngleInRadians * (hoursTickMarkInnerNoonY - centerY) + centerY; + + // draw hour tick mark + display->drawLine(startX, startY, endX, endY); + + static char buffer[2]; + + uint8_t hourInt = (angle / 30); + + if (hourInt == 0) { + hourInt = 12; + } + + // hour number x offset needs to be adjusted for some cases + int8_t hourStringXOffset; + int8_t hourStringYOffset = 13; + + switch (hourInt) { + case 3: + hourStringXOffset = 5; + break; + case 9: + hourStringXOffset = 7; + break; + case 10: + case 11: + hourStringXOffset = 8; + break; + case 12: + hourStringXOffset = 13; + break; + default: + hourStringXOffset = 6; + break; + } + + double hourStringX = (sineAngleInRadians * (hourStringNoonY - centerY) + noonX) - hourStringXOffset; + double hourStringY = (cosineAngleInRadians * (hourStringNoonY - centerY) + centerY) - hourStringYOffset; + + // draw hour number + display->drawStringf(hourStringX, hourStringY, buffer, "%d", hourInt); + } + + if (angle % degreesPerMinuteOrSecond == 0) { + double startX = sineAngleInRadians * (secondsTickMarkInnerNoonY - centerY) + noonX; + double startY = cosineAngleInRadians * (secondsTickMarkInnerNoonY - centerY) + centerY; + + // draw minute tick mark + display->drawLine(startX, startY, endX, endY); + } + } + + // draw hour hand + display->drawLine(centerX, centerY, hourX, hourY); + + // draw minute hand + display->drawLine(centerX, centerY, minuteX, minuteY); + + // draw second hand + display->drawLine(centerX, centerY, secondX, secondY); + } +} + +} // namespace ClockRenderer + +} // namespace graphics +#endif \ No newline at end of file diff --git a/src/graphics/draw/ClockRenderer.h b/src/graphics/draw/ClockRenderer.h new file mode 100644 index 000000000..4660dcc35 --- /dev/null +++ b/src/graphics/draw/ClockRenderer.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include + +namespace graphics +{ + +/// Forward declarations +class Screen; + +namespace ClockRenderer +{ +// Whether we are showing the digital watch face or the analog one +static bool digitalWatchFace = true; + +// Clock frame functions +void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); +void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + +// Segmented display functions +void drawSegmentedDisplayCharacter(OLEDDisplay *display, int x, int y, uint8_t number, float scale = 1); +void drawSegmentedDisplayColon(OLEDDisplay *display, int x, int y, float scale = 1); +void drawHorizontalSegment(OLEDDisplay *display, int x, int y, int width, int height); +void drawVerticalSegment(OLEDDisplay *display, int x, int y, int width, int height); + +// UI elements for clock displays +void drawWatchFaceToggleButton(OLEDDisplay *display, int16_t x, int16_t y, bool digitalMode = true, float scale = 1); +void drawBluetoothConnectedIcon(OLEDDisplay *display, int16_t x, int16_t y); + +} // namespace ClockRenderer + +} // namespace graphics diff --git a/src/graphics/draw/CompassRenderer.cpp b/src/graphics/draw/CompassRenderer.cpp new file mode 100644 index 000000000..fef993e2d --- /dev/null +++ b/src/graphics/draw/CompassRenderer.cpp @@ -0,0 +1,140 @@ +#include "CompassRenderer.h" +#include "NodeDB.h" +#include "UIRenderer.h" +#include "configuration.h" +#include "gps/GeoCoord.h" +#include "graphics/ScreenFonts.h" +#include + +namespace graphics +{ +namespace CompassRenderer +{ + +// Point helper class for compass calculations +struct Point { + float x, y; + Point(float x, float y) : x(x), y(y) {} + + void rotate(float angle) + { + float cos_a = cos(angle); + float sin_a = sin(angle); + float new_x = x * cos_a - y * sin_a; + float new_y = x * sin_a + y * cos_a; + x = new_x; + y = new_y; + } + + void scale(float factor) + { + x *= factor; + y *= factor; + } + + void translate(float dx, float dy) + { + x += dx; + y += dy; + } +}; + +void drawCompassNorth(OLEDDisplay *display, int16_t compassX, int16_t compassY, float myHeading, int16_t radius) +{ + // Show the compass heading (not implemented in original) + // This could draw a "N" indicator or north arrow + // For now, we'll draw a simple north indicator + // const float radius = 17.0f; + if (display->width() > 128) { + radius += 4; + } + Point north(0, -radius); + north.rotate(-myHeading); + north.translate(compassX, compassY); + + display->setFont(FONT_SMALL); + display->setTextAlignment(TEXT_ALIGN_CENTER); + display->setColor(BLACK); + if (display->width() > 128) { + display->fillRect(north.x - 8, north.y - 1, display->getStringWidth("N") + 3, FONT_HEIGHT_SMALL - 6); + } else { + display->fillRect(north.x - 4, north.y - 1, display->getStringWidth("N") + 2, FONT_HEIGHT_SMALL - 6); + } + display->setColor(WHITE); + display->drawString(north.x, north.y - 3, "N"); +} + +void drawNodeHeading(OLEDDisplay *display, int16_t compassX, int16_t compassY, uint16_t compassDiam, float headingRadian) +{ + Point tip(0.0f, -0.5f), tail(0.0f, 0.35f); // pointing up initially + float arrowOffsetX = 0.14f, arrowOffsetY = 0.9f; + Point leftArrow(tip.x - arrowOffsetX, tip.y + arrowOffsetY), rightArrow(tip.x + arrowOffsetX, tip.y + arrowOffsetY); + + Point *arrowPoints[] = {&tip, &tail, &leftArrow, &rightArrow}; + + for (int i = 0; i < 4; i++) { + arrowPoints[i]->rotate(headingRadian); + arrowPoints[i]->scale(compassDiam * 0.6); + arrowPoints[i]->translate(compassX, compassY); + } + +#ifdef USE_EINK + display->drawTriangle(tip.x, tip.y, rightArrow.x, rightArrow.y, tail.x, tail.y); +#else + display->fillTriangle(tip.x, tip.y, rightArrow.x, rightArrow.y, tail.x, tail.y); +#endif + display->drawTriangle(tip.x, tip.y, leftArrow.x, leftArrow.y, tail.x, tail.y); +} + +void drawArrowToNode(OLEDDisplay *display, int16_t x, int16_t y, int16_t size, float bearing) +{ + float radians = bearing * DEG_TO_RAD; + + Point tip(0, -size / 2); + Point left(-size / 4, size / 4); + Point right(size / 4, size / 4); + + tip.rotate(radians); + left.rotate(radians); + right.rotate(radians); + + tip.translate(x, y); + left.translate(x, y); + right.translate(x, y); + + display->drawTriangle(tip.x, tip.y, left.x, left.y, right.x, right.y); +} + +float estimatedHeading(double lat, double lon) +{ + // Simple magnetic declination estimation + // This is a very basic implementation - the original might be more sophisticated + return 0.0f; // Return 0 for now, indicating no heading available +} + +uint16_t getCompassDiam(uint32_t displayWidth, uint32_t displayHeight) +{ + // Calculate appropriate compass diameter based on display size + uint16_t minDimension = (displayWidth < displayHeight) ? displayWidth : displayHeight; + uint16_t maxDiam = minDimension / 3; // Use 1/3 of the smaller dimension + + // Ensure minimum and maximum bounds + if (maxDiam < 16) + maxDiam = 16; + if (maxDiam > 64) + maxDiam = 64; + + return maxDiam; +} + +float calculateBearing(double lat1, double lon1, double lat2, double lon2) +{ + double dLon = (lon2 - lon1) * DEG_TO_RAD; + double y = sin(dLon) * cos(lat2 * DEG_TO_RAD); + double x = cos(lat1 * DEG_TO_RAD) * sin(lat2 * DEG_TO_RAD) - sin(lat1 * DEG_TO_RAD) * cos(lat2 * DEG_TO_RAD) * cos(dLon); + double bearing = atan2(y, x) * RAD_TO_DEG; + return fmod(bearing + 360.0, 360.0); +} + +} // namespace CompassRenderer +} // namespace graphics diff --git a/src/graphics/draw/CompassRenderer.h b/src/graphics/draw/CompassRenderer.h new file mode 100644 index 000000000..4b26e6463 --- /dev/null +++ b/src/graphics/draw/CompassRenderer.h @@ -0,0 +1,36 @@ +#pragma once + +#include "graphics/Screen.h" +#include "mesh/generated/meshtastic/mesh.pb.h" +#include +#include + +namespace graphics +{ + +/// Forward declarations +class Screen; + +/** + * @brief Compass and navigation drawing functions + * + * Contains all functions related to drawing compass elements, headings, + * navigation arrows, and location-based UI components. + */ +namespace CompassRenderer +{ +// Compass drawing functions +void drawCompassNorth(OLEDDisplay *display, int16_t compassX, int16_t compassY, float myHeading, int16_t radius); +void drawNodeHeading(OLEDDisplay *display, int16_t compassX, int16_t compassY, uint16_t compassDiam, float headingRadian); +void drawArrowToNode(OLEDDisplay *display, int16_t x, int16_t y, int16_t size, float bearing); + +// Navigation and location functions +float estimatedHeading(double lat, double lon); +uint16_t getCompassDiam(uint32_t displayWidth, uint32_t displayHeight); + +// Utility functions for bearing calculations +float calculateBearing(double lat1, double lon1, double lat2, double lon2); + +} // namespace CompassRenderer + +} // namespace graphics diff --git a/src/graphics/draw/DebugRenderer.cpp b/src/graphics/draw/DebugRenderer.cpp new file mode 100644 index 000000000..2c3a3a3a8 --- /dev/null +++ b/src/graphics/draw/DebugRenderer.cpp @@ -0,0 +1,634 @@ +#include "configuration.h" +#if HAS_SCREEN +#include "../Screen.h" +#include "DebugRenderer.h" +#include "FSCommon.h" +#include "NodeDB.h" +#include "Throttle.h" +#include "UIRenderer.h" +#include "airtime.h" +#include "gps/RTC.h" +#include "graphics/ScreenFonts.h" +#include "graphics/SharedUIDisplay.h" +#include "graphics/images.h" +#include "main.h" +#include "mesh/Channels.h" +#include "mesh/generated/meshtastic/deviceonly.pb.h" +#include "sleep.h" + +#if HAS_WIFI && !defined(ARCH_PORTDUINO) +#include "mesh/wifi/WiFiAPClient.h" +#include +#ifdef ARCH_ESP32 +#include "mesh/wifi/WiFiAPClient.h" +#endif +#endif + +#ifdef ARCH_ESP32 +#include "modules/StoreForwardModule.h" +#endif +#include +#include +#include + +using namespace meshtastic; + +// External variables +extern graphics::Screen *screen; +extern PowerStatus *powerStatus; +extern NodeStatus *nodeStatus; +extern GPSStatus *gpsStatus; +extern Channels channels; +extern AirTime *airTime; + +// External functions from Screen.cpp +extern bool heartbeat; + +#ifdef ARCH_ESP32 +extern StoreForwardModule *storeForwardModule; +#endif + +namespace graphics +{ +namespace DebugRenderer +{ + +void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + display->setFont(FONT_SMALL); + + // The coordinates define the left starting point of the text + display->setTextAlignment(TEXT_ALIGN_LEFT); + + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { + display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL); + display->setColor(BLACK); + } + + char channelStr[20]; + snprintf(channelStr, sizeof(channelStr), "#%s", channels.getName(channels.getPrimaryIndex())); + + // Display power status + if (powerStatus->getHasBattery()) { + if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { + UIRenderer::drawBattery(display, x, y + 2, imgBattery, powerStatus); + } else { + UIRenderer::drawBattery(display, x + 1, y + 3, imgBattery, powerStatus); + } + } else if (powerStatus->knowsUSB()) { + if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { + display->drawFastImage(x, y + 2, 16, 8, powerStatus->getHasUSB() ? imgUSB : imgPower); + } else { + display->drawFastImage(x + 1, y + 3, 16, 8, powerStatus->getHasUSB() ? imgUSB : imgPower); + } + } + // Display nodes status + if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { + UIRenderer::drawNodes(display, x + (SCREEN_WIDTH * 0.25), y + 2, nodeStatus); + } else { + UIRenderer::drawNodes(display, x + (SCREEN_WIDTH * 0.25), y + 3, nodeStatus); + } +#if HAS_GPS + // Display GPS status + if (config.position.gps_mode != meshtastic_Config_PositionConfig_GpsMode_ENABLED) { + UIRenderer::drawGpsPowerStatus(display, x, y + 2, gpsStatus); + } else { + if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { + UIRenderer::drawGps(display, x + (SCREEN_WIDTH * 0.63), y + 2, gpsStatus); + } else { + UIRenderer::drawGps(display, x + (SCREEN_WIDTH * 0.63), y + 3, gpsStatus); + } + } +#endif + display->setColor(WHITE); + // Draw the channel name + display->drawString(x, y + FONT_HEIGHT_SMALL, channelStr); + // Draw our hardware ID to assist with bluetooth pairing. Either prefix with Info or S&F Logo + if (moduleConfig.store_forward.enabled) { +#ifdef ARCH_ESP32 + if (!Throttle::isWithinTimespanMs(storeForwardModule->lastHeartbeat, + (storeForwardModule->heartbeatInterval * 1200))) { // no heartbeat, overlap a bit +#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || ARCH_PORTDUINO) && \ + !defined(DISPLAY_FORCE_SMALL_FONTS) + display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(screen->ourId), y + 3 + FONT_HEIGHT_SMALL, 12, + 8, imgQuestionL1); + display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(screen->ourId), y + 11 + FONT_HEIGHT_SMALL, 12, + 8, imgQuestionL2); +#else + display->drawFastImage(x + SCREEN_WIDTH - 10 - display->getStringWidth(screen->ourId), y + 2 + FONT_HEIGHT_SMALL, 8, + 8, imgQuestion); +#endif + } else { +#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS)) && \ + !defined(DISPLAY_FORCE_SMALL_FONTS) + display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(screen->ourId), y + 3 + FONT_HEIGHT_SMALL, 16, + 8, imgSFL1); + display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(screen->ourId), y + 11 + FONT_HEIGHT_SMALL, 16, + 8, imgSFL2); +#else + display->drawFastImage(x + SCREEN_WIDTH - 13 - display->getStringWidth(screen->ourId), y + 2 + FONT_HEIGHT_SMALL, 11, + 8, imgSF); +#endif + } +#endif + } else { + // TODO: Raspberry Pi supports more than just the one screen size +#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || ARCH_PORTDUINO) && \ + !defined(DISPLAY_FORCE_SMALL_FONTS) + display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(screen->ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, + imgInfoL1); + display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(screen->ourId), y + 11 + FONT_HEIGHT_SMALL, 12, 8, + imgInfoL2); +#else + display->drawFastImage(x + SCREEN_WIDTH - 10 - display->getStringWidth(screen->ourId), y + 2 + FONT_HEIGHT_SMALL, 8, 8, + imgInfo); +#endif + } + + display->drawString(x + SCREEN_WIDTH - display->getStringWidth(screen->ourId), y + FONT_HEIGHT_SMALL, screen->ourId); + + // Draw any log messages + display->drawLogBuffer(x, y + (FONT_HEIGHT_SMALL * 2)); + + /* Display a heartbeat pixel that blinks every time the frame is redrawn */ +#ifdef SHOW_REDRAWS + if (heartbeat) + display->setPixel(0, 0); + heartbeat = !heartbeat; +#endif +} + +// **************************** +// * WiFi Screen * +// **************************** +void drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ +#if HAS_WIFI && !defined(ARCH_PORTDUINO) + display->clear(); + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + int line = 1; + + // === Set Title + const char *titleStr = "WiFi"; + + // === Header === + graphics::drawCommonHeader(display, x, y, titleStr); + + const char *wifiName = config.network.wifi_ssid; + + if (WiFi.status() != WL_CONNECTED) { + display->drawString(x, getTextPositions(display)[line++], "WiFi: Not Connected"); + } else { + display->drawString(x, getTextPositions(display)[line++], "WiFi: Connected"); + + char rssiStr[32]; + snprintf(rssiStr, sizeof(rssiStr), "RSSI: %d", WiFi.RSSI()); + display->drawString(x, getTextPositions(display)[line++], rssiStr); + } + + /* + - WL_CONNECTED: assigned when connected to a WiFi network; + - WL_NO_SSID_AVAIL: assigned when no SSID are available; + - WL_CONNECT_FAILED: assigned when the connection fails for all the attempts; + - WL_CONNECTION_LOST: assigned when the connection is lost; + - WL_DISCONNECTED: assigned when disconnected from a network; + - WL_IDLE_STATUS: it is a temporary status assigned when WiFi.begin() is called and remains active until the number of + attempts expires (resulting in WL_CONNECT_FAILED) or a connection is established (resulting in WL_CONNECTED); + - WL_SCAN_COMPLETED: assigned when the scan networks is completed; + - WL_NO_SHIELD: assigned when no WiFi shield is present; + + */ + if (WiFi.status() == WL_CONNECTED) { + char ipStr[64]; + snprintf(ipStr, sizeof(ipStr), "IP: %s", WiFi.localIP().toString().c_str()); + display->drawString(x, getTextPositions(display)[line++], ipStr); + } else if (WiFi.status() == WL_NO_SSID_AVAIL) { + display->drawString(x, getTextPositions(display)[line++], "SSID Not Found"); + } else if (WiFi.status() == WL_CONNECTION_LOST) { + display->drawString(x, getTextPositions(display)[line++], "Connection Lost"); + } else if (WiFi.status() == WL_IDLE_STATUS) { + display->drawString(x, getTextPositions(display)[line++], "Idle ... Reconnecting"); + } else if (WiFi.status() == WL_CONNECT_FAILED) { + display->drawString(x, getTextPositions(display)[line++], "Connection Failed"); + } +#ifdef ARCH_ESP32 + else { + // Codes: + // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/wifi.html#wi-fi-reason-code + display->drawString(x, getTextPositions(display)[line++], + WiFi.disconnectReasonName(static_cast(getWifiDisconnectReason()))); + } +#else + else { + char statusStr[32]; + snprintf(statusStr, sizeof(statusStr), "Unknown status: %d", WiFi.status()); + display->drawString(x, getTextPositions(display)[line++], statusStr); + } +#endif + + char ssidStr[64]; + snprintf(ssidStr, sizeof(ssidStr), "SSID: %s", wifiName); + display->drawString(x, getTextPositions(display)[line++], ssidStr); + + display->drawString(x, getTextPositions(display)[line++], "URL: http://meshtastic.local"); + + /* Display a heartbeat pixel that blinks every time the frame is redrawn */ +#ifdef SHOW_REDRAWS + if (heartbeat) + display->setPixel(0, 0); + heartbeat = !heartbeat; +#endif +#endif +} + +void drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + display->setFont(FONT_SMALL); + + // The coordinates define the left starting point of the text + display->setTextAlignment(TEXT_ALIGN_LEFT); + + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { + display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL); + display->setColor(BLACK); + } + + char batStr[20]; + if (powerStatus->getHasBattery()) { + int batV = powerStatus->getBatteryVoltageMv() / 1000; + int batCv = (powerStatus->getBatteryVoltageMv() % 1000) / 10; + + snprintf(batStr, sizeof(batStr), "B %01d.%02dV %3d%% %c%c", batV, batCv, powerStatus->getBatteryChargePercent(), + powerStatus->getIsCharging() ? '+' : ' ', powerStatus->getHasUSB() ? 'U' : ' '); + + // Line 1 + display->drawString(x, y, batStr); + if (config.display.heading_bold) + display->drawString(x + 1, y, batStr); + } else { + // Line 1 + display->drawString(x, y, "USB"); + if (config.display.heading_bold) + display->drawString(x + 1, y, "USB"); + } + + // auto mode = DisplayFormatters::getModemPresetDisplayName(config.lora.modem_preset, true); + + // display->drawString(x + SCREEN_WIDTH - display->getStringWidth(mode), y, mode); + // if (config.display.heading_bold) + // display->drawString(x + SCREEN_WIDTH - display->getStringWidth(mode) - 1, y, mode); + + uint32_t currentMillis = millis(); + uint32_t seconds = currentMillis / 1000; + uint32_t minutes = seconds / 60; + uint32_t hours = minutes / 60; + uint32_t days = hours / 24; + // currentMillis %= 1000; + // seconds %= 60; + // minutes %= 60; + // hours %= 24; + + // Show uptime as days, hours, minutes OR seconds + std::string uptime = UIRenderer::drawTimeDelta(days, hours, minutes, seconds); + + // Line 1 (Still) + display->drawString(x + SCREEN_WIDTH - display->getStringWidth(uptime.c_str()), y, uptime.c_str()); + if (config.display.heading_bold) + display->drawString(x - 1 + SCREEN_WIDTH - display->getStringWidth(uptime.c_str()), y, uptime.c_str()); + + display->setColor(WHITE); + + // Setup string to assemble analogClock string + std::string analogClock = ""; + + uint32_t rtc_sec = getValidTime(RTCQuality::RTCQualityDevice, true); // Display local timezone + if (rtc_sec > 0) { + long hms = rtc_sec % SEC_PER_DAY; + // hms += tz.tz_dsttime * SEC_PER_HOUR; + // hms -= tz.tz_minuteswest * SEC_PER_MIN; + // mod `hms` to ensure in positive range of [0...SEC_PER_DAY) + hms = (hms + SEC_PER_DAY) % SEC_PER_DAY; + + // Tear apart hms into h:m:s + int hour = hms / SEC_PER_HOUR; + int min = (hms % SEC_PER_HOUR) / SEC_PER_MIN; + int sec = (hms % SEC_PER_HOUR) % SEC_PER_MIN; // or hms % SEC_PER_MIN + + char timebuf[12]; + + if (config.display.use_12h_clock) { + std::string meridiem = "am"; + if (hour >= 12) { + if (hour > 12) + hour -= 12; + meridiem = "pm"; + } + if (hour == 00) { + hour = 12; + } + snprintf(timebuf, sizeof(timebuf), "%d:%02d:%02d%s", hour, min, sec, meridiem.c_str()); + } else { + snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d", hour, min, sec); + } + analogClock += timebuf; + } + + // Line 2 + display->drawString(x, y + FONT_HEIGHT_SMALL * 1, analogClock.c_str()); + + // Display Channel Utilization + char chUtil[13]; + snprintf(chUtil, sizeof(chUtil), "ChUtil %2.0f%%", airTime->channelUtilizationPercent()); + display->drawString(x + SCREEN_WIDTH - display->getStringWidth(chUtil), y + FONT_HEIGHT_SMALL * 1, chUtil); + +#if HAS_GPS + if (config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED) { + // Line 3 + if (config.display.gps_format != + meshtastic_Config_DisplayConfig_GpsCoordinateFormat_DMS) // if DMS then don't draw altitude + UIRenderer::drawGpsAltitude(display, x, y + FONT_HEIGHT_SMALL * 2, gpsStatus); + + // Line 4 + UIRenderer::drawGpsCoordinates(display, x, y + FONT_HEIGHT_SMALL * 3, gpsStatus); + } else { + UIRenderer::drawGpsPowerStatus(display, x, y + FONT_HEIGHT_SMALL * 2, gpsStatus); + } +#endif +/* Display a heartbeat pixel that blinks every time the frame is redrawn */ +#ifdef SHOW_REDRAWS + if (heartbeat) + display->setPixel(0, 0); + heartbeat = !heartbeat; +#endif +} + +// Trampoline functions for DebugInfo class access +void drawDebugInfoTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + drawFrame(display, state, x, y); +} + +void drawDebugInfoSettingsTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + drawFrameSettings(display, state, x, y); +} + +void drawDebugInfoWiFiTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + drawFrameWiFi(display, state, x, y); +} + +// **************************** +// * LoRa Focused Screen * +// **************************** +void drawLoRaFocused(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + display->clear(); + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + int line = 1; + + // === Set Title + const char *titleStr = (SCREEN_WIDTH > 128) ? "LoRa Info" : "LoRa"; + + // === Header === + graphics::drawCommonHeader(display, x, y, titleStr); + + // === First Row: Region / BLE Name === + graphics::UIRenderer::drawNodes(display, x, getTextPositions(display)[line] + 2, nodeStatus, 0, true, ""); + + uint8_t dmac[6]; + char shortnameble[35]; + getMacAddr(dmac); + snprintf(screen->ourId, sizeof(screen->ourId), "%02x%02x", dmac[4], dmac[5]); + snprintf(shortnameble, sizeof(shortnameble), "BLE: %s", screen->ourId); + int textWidth = display->getStringWidth(shortnameble); + int nameX = (SCREEN_WIDTH - textWidth); + display->drawString(nameX, getTextPositions(display)[line++], shortnameble); + + // === Second Row: Radio Preset === + auto mode = DisplayFormatters::getModemPresetDisplayName(config.lora.modem_preset, false); + char regionradiopreset[25]; + const char *region = myRegion ? myRegion->name : NULL; + if (region != nullptr) { + snprintf(regionradiopreset, sizeof(regionradiopreset), "%s/%s", region, mode); + } + textWidth = display->getStringWidth(regionradiopreset); + nameX = (SCREEN_WIDTH - textWidth) / 2; + display->drawString(nameX, getTextPositions(display)[line++], regionradiopreset); + + // === Third Row: Frequency / ChanNum === + char frequencyslot[35]; + char freqStr[16]; + float freq = RadioLibInterface::instance->getFreq(); + snprintf(freqStr, sizeof(freqStr), "%.3f", freq); + if (config.lora.channel_num == 0) { + snprintf(frequencyslot, sizeof(frequencyslot), "Freq: %smhz", freqStr); + } else { + snprintf(frequencyslot, sizeof(frequencyslot), "Freq/Ch: %smhz (%d)", freqStr, config.lora.channel_num); + } + size_t len = strlen(frequencyslot); + if (len >= 4 && strcmp(frequencyslot + len - 4, " (0)") == 0) { + frequencyslot[len - 4] = '\0'; // Remove the last three characters + } + textWidth = display->getStringWidth(frequencyslot); + nameX = (SCREEN_WIDTH - textWidth) / 2; + display->drawString(nameX, getTextPositions(display)[line++], frequencyslot); + + // === Fourth Row: Channel Utilization === + const char *chUtil = "ChUtil:"; + char chUtilPercentage[10]; + snprintf(chUtilPercentage, sizeof(chUtilPercentage), "%2.0f%%", airTime->channelUtilizationPercent()); + + int chUtil_x = (SCREEN_WIDTH > 128) ? display->getStringWidth(chUtil) + 10 : display->getStringWidth(chUtil) + 5; + int chUtil_y = getTextPositions(display)[line] + 3; + + int chutil_bar_width = (SCREEN_WIDTH > 128) ? 100 : 50; + int chutil_bar_height = (SCREEN_WIDTH > 128) ? 12 : 7; + int extraoffset = (SCREEN_WIDTH > 128) ? 6 : 3; + int chutil_percent = airTime->channelUtilizationPercent(); + + int centerofscreen = SCREEN_WIDTH / 2; + int total_line_content_width = (chUtil_x + chutil_bar_width + display->getStringWidth(chUtilPercentage) + extraoffset) / 2; + int starting_position = centerofscreen - total_line_content_width; + + display->drawString(starting_position, getTextPositions(display)[line++], chUtil); + + // Force 56% or higher to show a full 100% bar, text would still show related percent. + if (chutil_percent >= 61) { + chutil_percent = 100; + } + + // Weighting for nonlinear segments + float milestone1 = 25; + float milestone2 = 40; + float weight1 = 0.45; // Weight for 0–25% + float weight2 = 0.35; // Weight for 25–40% + float weight3 = 0.20; // Weight for 40–100% + float totalWeight = weight1 + weight2 + weight3; + + int seg1 = chutil_bar_width * (weight1 / totalWeight); + int seg2 = chutil_bar_width * (weight2 / totalWeight); + int seg3 = chutil_bar_width * (weight3 / totalWeight); + + int fillRight = 0; + + if (chutil_percent <= milestone1) { + fillRight = (seg1 * (chutil_percent / milestone1)); + } else if (chutil_percent <= milestone2) { + fillRight = seg1 + (seg2 * ((chutil_percent - milestone1) / (milestone2 - milestone1))); + } else { + fillRight = seg1 + seg2 + (seg3 * ((chutil_percent - milestone2) / (100 - milestone2))); + } + + // Draw outline + display->drawRect(starting_position + chUtil_x, chUtil_y, chutil_bar_width, chutil_bar_height); + + // Fill progress + if (fillRight > 0) { + display->fillRect(starting_position + chUtil_x, chUtil_y, fillRight, chutil_bar_height); + } + + display->drawString(starting_position + chUtil_x + chutil_bar_width + extraoffset, getTextPositions(display)[4], + chUtilPercentage); +} + +// **************************** +// * Memory Screen * +// **************************** +void drawMemoryUsage(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + display->clear(); + display->setFont(FONT_SMALL); + display->setTextAlignment(TEXT_ALIGN_LEFT); + + // === Set Title + const char *titleStr = "System"; + + // === Header === + graphics::drawCommonHeader(display, x, y, titleStr); + + // === Layout === + int line = 1; + const int barHeight = 6; + const int labelX = x; + const int barsOffset = (SCREEN_WIDTH > 128) ? 24 : 0; + const int barX = x + 40 + barsOffset; + + auto drawUsageRow = [&](const char *label, uint32_t used, uint32_t total, bool isHeap = false) { + if (total == 0) + return; + + int percent = (used * 100) / total; + + char combinedStr[24]; + if (SCREEN_WIDTH > 128) { + snprintf(combinedStr, sizeof(combinedStr), "%s%3d%% %u/%uKB", (percent > 80) ? "! " : "", percent, used / 1024, + total / 1024); + } else { + snprintf(combinedStr, sizeof(combinedStr), "%s%3d%%", (percent > 80) ? "! " : "", percent); + } + + int textWidth = display->getStringWidth(combinedStr); + int adjustedBarWidth = SCREEN_WIDTH - barX - textWidth - 6; + if (adjustedBarWidth < 10) + adjustedBarWidth = 10; + + int fillWidth = (used * adjustedBarWidth) / total; + + // Label + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->drawString(labelX, getTextPositions(display)[line], label); + + // Bar + int barY = getTextPositions(display)[line] + (FONT_HEIGHT_SMALL - barHeight) / 2; + display->setColor(WHITE); + display->drawRect(barX, barY, adjustedBarWidth, barHeight); + + display->fillRect(barX, barY, fillWidth, barHeight); + display->setColor(WHITE); + + // Value string + display->setTextAlignment(TEXT_ALIGN_RIGHT); + display->drawString(SCREEN_WIDTH - 2, getTextPositions(display)[line], combinedStr); + }; + + // === Memory values === + uint32_t heapUsed = memGet.getHeapSize() - memGet.getFreeHeap(); + uint32_t heapTotal = memGet.getHeapSize(); + + uint32_t psramUsed = memGet.getPsramSize() - memGet.getFreePsram(); + uint32_t psramTotal = memGet.getPsramSize(); + + uint32_t flashUsed = 0, flashTotal = 0; +#ifdef ESP32 + flashUsed = FSCom.usedBytes(); + flashTotal = FSCom.totalBytes(); +#endif + + uint32_t sdUsed = 0, sdTotal = 0; + bool hasSD = false; + /* + #ifdef HAS_SDCARD + hasSD = SD.cardType() != CARD_NONE; + if (hasSD) { + sdUsed = SD.usedBytes(); + sdTotal = SD.totalBytes(); + } + #endif + */ + // === Draw memory rows + drawUsageRow("Heap:", heapUsed, heapTotal, true); +#ifdef ESP32 + if (psramUsed > 0) { + line += 1; + drawUsageRow("PSRAM:", psramUsed, psramTotal); + } + if (flashTotal > 0) { + line += 1; + drawUsageRow("Flash:", flashUsed, flashTotal); + } +#endif + if (hasSD && sdTotal > 0) { + line += 1; + drawUsageRow("SD:", sdUsed, sdTotal); + } + + display->setTextAlignment(TEXT_ALIGN_LEFT); + // System Uptime + if (line < 2) { + line += 1; + } + line += 1; + char appversionstr[35]; + snprintf(appversionstr, sizeof(appversionstr), "Ver.: %s", optstr(APP_VERSION)); + int textWidth = display->getStringWidth(appversionstr); + int nameX = (SCREEN_WIDTH - textWidth) / 2; + display->drawString(nameX, getTextPositions(display)[line], appversionstr); + + if (SCREEN_HEIGHT > 64 || (SCREEN_HEIGHT <= 64 && line < 4)) { // Only show uptime if the screen can show it + line += 1; + char uptimeStr[32] = ""; + uint32_t uptime = millis() / 1000; + uint32_t days = uptime / 86400; + uint32_t hours = (uptime % 86400) / 3600; + uint32_t mins = (uptime % 3600) / 60; + // Show as "Up: 2d 3h", "Up: 5h 14m", or "Up: 37m" + if (days) + snprintf(uptimeStr, sizeof(uptimeStr), " Up: %ud %uh", days, hours); + else if (hours) + snprintf(uptimeStr, sizeof(uptimeStr), " Up: %uh %um", hours, mins); + else + snprintf(uptimeStr, sizeof(uptimeStr), " Uptime: %um", mins); + textWidth = display->getStringWidth(uptimeStr); + nameX = (SCREEN_WIDTH - textWidth) / 2; + display->drawString(nameX, getTextPositions(display)[line], uptimeStr); + } +} +} // namespace DebugRenderer +} // namespace graphics +#endif \ No newline at end of file diff --git a/src/graphics/draw/DebugRenderer.h b/src/graphics/draw/DebugRenderer.h new file mode 100644 index 000000000..f4d484f58 --- /dev/null +++ b/src/graphics/draw/DebugRenderer.h @@ -0,0 +1,38 @@ +#pragma once + +#include +#include + +namespace graphics +{ + +/// Forward declarations +class Screen; +class DebugInfo; + +/** + * @brief Debug and diagnostic drawing functions + * + * Contains all functions related to drawing debug information, + * WiFi status, settings screens, and diagnostic data. + */ +namespace DebugRenderer +{ +// Debug frame functions +void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); +void drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); +void drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + +// Trampoline functions for framework callback compatibility +void drawDebugInfoTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); +void drawDebugInfoSettingsTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); +void drawDebugInfoWiFiTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + +// LoRa information display +void drawLoRaFocused(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + +// Memory screen display +void drawMemoryUsage(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); +} // namespace DebugRenderer + +} // namespace graphics diff --git a/src/graphics/draw/DrawRenderers.h b/src/graphics/draw/DrawRenderers.h new file mode 100644 index 000000000..6f1929ebd --- /dev/null +++ b/src/graphics/draw/DrawRenderers.h @@ -0,0 +1,38 @@ +#pragma once + +/** + * @brief Master include file for all Screen draw renderers + * + * This file includes all the individual renderer headers to provide + * a convenient single include for accessing all draw functions. + */ + +#include "graphics/draw/ClockRenderer.h" +#include "graphics/draw/CompassRenderer.h" +#include "graphics/draw/DebugRenderer.h" +#include "graphics/draw/NodeListRenderer.h" +#include "graphics/draw/ScreenRenderer.h" +#include "graphics/draw/UIRenderer.h" + +namespace graphics +{ + +/** + * @brief Collection of all draw renderers + * + * This namespace provides access to all the specialized rendering + * functions organized by category. + */ +namespace DrawRenderers +{ +// Re-export all renderer namespaces for convenience +using namespace ClockRenderer; +using namespace CompassRenderer; +using namespace DebugRenderer; +using namespace NodeListRenderer; +using namespace ScreenRenderer; +using namespace UIRenderer; + +} // namespace DrawRenderers + +} // namespace graphics diff --git a/src/graphics/draw/MessageRenderer.cpp b/src/graphics/draw/MessageRenderer.cpp new file mode 100644 index 000000000..707517d82 --- /dev/null +++ b/src/graphics/draw/MessageRenderer.cpp @@ -0,0 +1,392 @@ +/* +BaseUI + +Developed and Maintained By: +- Ronald Garcia (HarukiToreda) – Lead development and implementation. +- JasonP (Xaositek) – Screen layout and icon design, UI improvements and testing. +- TonyG (Tropho) – Project management, structural planning, and testing + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +*/ + +#include "configuration.h" +#if HAS_SCREEN +#include "MessageRenderer.h" + +// Core includes +#include "NodeDB.h" +#include "configuration.h" +#include "gps/RTC.h" +#include "graphics/ScreenFonts.h" +#include "graphics/SharedUIDisplay.h" +#include "graphics/emotes.h" +#include "main.h" +#include "meshUtils.h" + +// Additional includes for UI rendering +#include "UIRenderer.h" +#include "graphics/TimeFormatters.h" + +// Additional includes for dependencies +#include +#include + +// External declarations +extern bool hasUnreadMessage; +extern meshtastic_DeviceState devicestate; + +using graphics::Emote; +using graphics::emotes; +using graphics::numEmotes; + +namespace graphics +{ +namespace MessageRenderer +{ + +void drawStringWithEmotes(OLEDDisplay *display, int x, int y, const std::string &line, const Emote *emotes, int emoteCount) +{ + int cursorX = x; + const int fontHeight = FONT_HEIGHT_SMALL; + + // === Step 1: Find tallest emote in the line === + int maxIconHeight = fontHeight; + for (size_t i = 0; i < line.length();) { + bool matched = false; + for (int e = 0; e < emoteCount; ++e) { + size_t emojiLen = strlen(emotes[e].label); + if (line.compare(i, emojiLen, emotes[e].label) == 0) { + if (emotes[e].height > maxIconHeight) + maxIconHeight = emotes[e].height; + i += emojiLen; + matched = true; + break; + } + } + if (!matched) { + uint8_t c = static_cast(line[i]); + if ((c & 0xE0) == 0xC0) + i += 2; + else if ((c & 0xF0) == 0xE0) + i += 3; + else if ((c & 0xF8) == 0xF0) + i += 4; + else + i += 1; + } + } + + // === Step 2: Baseline alignment === + int lineHeight = std::max(fontHeight, maxIconHeight); + int baselineOffset = (lineHeight - fontHeight) / 2; + int fontY = y + baselineOffset; + int fontMidline = fontY + fontHeight / 2; + + // === Step 3: Render line in segments === + size_t i = 0; + bool inBold = false; + + while (i < line.length()) { + // Check for ** start/end for faux bold + if (line.compare(i, 2, "**") == 0) { + inBold = !inBold; + i += 2; + continue; + } + + // Look ahead for the next emote match + size_t nextEmotePos = std::string::npos; + const Emote *matchedEmote = nullptr; + size_t emojiLen = 0; + + for (int e = 0; e < emoteCount; ++e) { + size_t pos = line.find(emotes[e].label, i); + if (pos != std::string::npos && (nextEmotePos == std::string::npos || pos < nextEmotePos)) { + nextEmotePos = pos; + matchedEmote = &emotes[e]; + emojiLen = strlen(emotes[e].label); + } + } + + // Render normal text segment up to the emote or bold toggle + size_t nextControl = std::min(nextEmotePos, line.find("**", i)); + if (nextControl == std::string::npos) + nextControl = line.length(); + + if (nextControl > i) { + std::string textChunk = line.substr(i, nextControl - i); + if (inBold) { + // Faux bold: draw twice, offset by 1px + display->drawString(cursorX + 1, fontY, textChunk.c_str()); + } + display->drawString(cursorX, fontY, textChunk.c_str()); + cursorX += display->getStringWidth(textChunk.c_str()); + i = nextControl; + continue; + } + + // Render the emote (if found) + if (matchedEmote && i == nextEmotePos) { + int iconY = fontMidline - matchedEmote->height / 2 - 1; + display->drawXbm(cursorX, iconY, matchedEmote->width, matchedEmote->height, matchedEmote->bitmap); + cursorX += matchedEmote->width + 1; + i += emojiLen; + } else { + // No more emotes — render the rest of the line + std::string remaining = line.substr(i); + if (inBold) { + display->drawString(cursorX + 1, fontY, remaining.c_str()); + } + display->drawString(cursorX, fontY, remaining.c_str()); + cursorX += display->getStringWidth(remaining.c_str()); + break; + } + } +} + +void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + // Clear the unread message indicator when viewing the message + hasUnreadMessage = false; + + const meshtastic_MeshPacket &mp = devicestate.rx_text_message; + const char *msg = reinterpret_cast(mp.decoded.payload.bytes); + + display->clear(); + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + + const int navHeight = FONT_HEIGHT_SMALL; + const int scrollBottom = SCREEN_HEIGHT - navHeight; + const int usableHeight = scrollBottom; + const int textWidth = SCREEN_WIDTH; + + bool isInverted = (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_INVERTED); + bool isBold = config.display.heading_bold; + + // === Set Title + const char *titleStr = "Messages"; + + // Check if we have more than an empty message to show + char messageBuf[237]; + snprintf(messageBuf, sizeof(messageBuf), "%s", msg); + if (strlen(messageBuf) == 0) { + // === Header === + graphics::drawCommonHeader(display, x, y, titleStr); + const char *messageString = "No messages"; + int center_text = (SCREEN_WIDTH / 2) - (display->getStringWidth(messageString) / 2); + display->drawString(center_text, getTextPositions(display)[2], messageString); + return; + } + + // === Header Construction === + meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(getFrom(&mp)); + char headerStr[80]; + const char *sender = "???"; + if (node && node->has_user) { + if (SCREEN_WIDTH >= 200 && strlen(node->user.long_name) > 0) { + sender = node->user.long_name; + } else { + sender = node->user.short_name; + } + } + uint32_t seconds = sinceReceived(&mp), minutes = seconds / 60, hours = minutes / 60, days = hours / 24; + uint8_t timestampHours, timestampMinutes; + int32_t daysAgo; + bool useTimestamp = deltaToTimestamp(seconds, ×tampHours, ×tampMinutes, &daysAgo); + + if (useTimestamp && minutes >= 15 && daysAgo == 0) { + std::string prefix = (daysAgo == 1 && SCREEN_WIDTH >= 200) ? "Yesterday" : "At"; + if (config.display.use_12h_clock) { + bool isPM = timestampHours >= 12; + timestampHours = timestampHours % 12; + if (timestampHours == 0) + timestampHours = 12; + snprintf(headerStr, sizeof(headerStr), "%s %d:%02d%s from %s", prefix.c_str(), timestampHours, timestampMinutes, + isPM ? "p" : "a", sender); + } else { + snprintf(headerStr, sizeof(headerStr), "%s %d:%02d from %s", prefix.c_str(), timestampHours, timestampMinutes, + sender); + } + } else { + snprintf(headerStr, sizeof(headerStr), "%s ago from %s", UIRenderer::drawTimeDelta(days, hours, minutes, seconds).c_str(), + sender); + } + +#ifndef EXCLUDE_EMOJI + // === Bounce animation setup === + static uint32_t lastBounceTime = 0; + static int bounceY = 0; + const int bounceRange = 2; // Max pixels to bounce up/down + const int bounceInterval = 10; // How quickly to change bounce direction (ms) + + uint32_t now = millis(); + if (now - lastBounceTime >= bounceInterval) { + lastBounceTime = now; + bounceY = (bounceY + 1) % (bounceRange * 2); + } + for (int i = 0; i < numEmotes; ++i) { + const Emote &e = emotes[i]; + if (strcmp(msg, e.label) == 0) { + int headerY = getTextPositions(display)[1]; // same as scrolling header line + display->drawString(x + 3, headerY, headerStr); + if (isInverted && isBold) + display->drawString(x + 4, headerY, headerStr); + + // Draw separator (same as scroll version) + for (int separatorX = 0; separatorX <= (display->getStringWidth(headerStr) + 3); separatorX += 2) { + display->setPixel(separatorX, headerY + ((SCREEN_WIDTH > 128) ? 19 : 13)); + } + + // Center the emote below the header line + separator + nav + int remainingHeight = SCREEN_HEIGHT - (headerY + FONT_HEIGHT_SMALL) - navHeight; + int emoteY = headerY + FONT_HEIGHT_SMALL + (remainingHeight - e.height) / 2 + bounceY - bounceRange; + display->drawXbm((SCREEN_WIDTH - e.width) / 2, emoteY, e.width, e.height, e.bitmap); + return; + } + } +#endif + + // === Word-wrap and build line list === + std::vector lines; + lines.push_back(std::string(headerStr)); // Header line is always first + + std::string line, word; + for (int i = 0; messageBuf[i]; ++i) { + char ch = messageBuf[i]; + if (ch == '\n') { + if (!word.empty()) + line += word; + if (!line.empty()) + lines.push_back(line); + line.clear(); + word.clear(); + } else if (ch == ' ') { + line += word + ' '; + word.clear(); + } else { + word += ch; + std::string test = line + word; + if (display->getStringWidth(test.c_str()) > textWidth) { + if (!line.empty()) + lines.push_back(line); + line = word; + word.clear(); + } + } + } + if (!word.empty()) + line += word; + if (!line.empty()) + lines.push_back(line); + + // === Scrolling logic === + std::vector rowHeights; + + for (const auto &_line : lines) { + int lineHeight = FONT_HEIGHT_SMALL; + bool hasEmote = false; + + for (int i = 0; i < numEmotes; ++i) { + const Emote &e = emotes[i]; + if (_line.find(e.label) != std::string::npos) { + lineHeight = std::max(lineHeight, e.height); + hasEmote = true; + } + } + + // Apply tighter spacing if no emotes on this line + if (!hasEmote) { + lineHeight -= 2; // reduce by 2px for tighter spacing + if (lineHeight < 8) + lineHeight = 8; // minimum safety + } + + rowHeights.push_back(lineHeight); + } + int totalHeight = 0; + for (size_t i = 1; i < rowHeights.size(); ++i) { + totalHeight += rowHeights[i]; + } + int usableScrollHeight = usableHeight - rowHeights[0]; // remove header height + int scrollStop = std::max(0, totalHeight - usableScrollHeight + rowHeights.back()); + + static float scrollY = 0.0f; + static uint32_t lastTime = 0, scrollStartDelay = 0, pauseStart = 0; + static bool waitingToReset = false, scrollStarted = false; + + // === Smooth scrolling adjustment === + // You can tweak this divisor to change how smooth it scrolls. + // Lower = smoother, but can feel slow. + float delta = (now - lastTime) / 400.0f; + lastTime = now; + + const float scrollSpeed = 2.0f; // pixels per second + + // Delay scrolling start by 2 seconds + if (scrollStartDelay == 0) + scrollStartDelay = now; + if (!scrollStarted && now - scrollStartDelay > 2000) + scrollStarted = true; + + if (totalHeight > usableScrollHeight) { + if (scrollStarted) { + if (!waitingToReset) { + scrollY += delta * scrollSpeed; + if (scrollY >= scrollStop) { + scrollY = scrollStop; + waitingToReset = true; + pauseStart = lastTime; + } + } else if (lastTime - pauseStart > 3000) { + scrollY = 0; + waitingToReset = false; + scrollStarted = false; + scrollStartDelay = lastTime; + } + } + } else { + scrollY = 0; + } + + int scrollOffset = static_cast(scrollY); + int yOffset = -scrollOffset + getTextPositions(display)[1]; + for (int separatorX = 0; separatorX <= (display->getStringWidth(headerStr) + 3); separatorX += 2) { + display->setPixel(separatorX, yOffset + ((SCREEN_WIDTH > 128) ? 19 : 13)); + } + + // === Render visible lines === + for (size_t i = 0; i < lines.size(); ++i) { + int lineY = yOffset; + for (size_t j = 0; j < i; ++j) + lineY += rowHeights[j]; + if (lineY > -rowHeights[i] && lineY < scrollBottom) { + if (i == 0 && isInverted) { + display->drawString(x + 3, lineY, lines[i].c_str()); + if (isBold) + display->drawString(x + 4, lineY, lines[i].c_str()); + } else { + drawStringWithEmotes(display, x, lineY, lines[i], emotes, numEmotes); + } + } + } + + // Draw header at the end to sort out overlapping elements + graphics::drawCommonHeader(display, x, y, titleStr); +} + +} // namespace MessageRenderer +} // namespace graphics +#endif \ No newline at end of file diff --git a/src/graphics/draw/MessageRenderer.h b/src/graphics/draw/MessageRenderer.h new file mode 100644 index 000000000..d92b96014 --- /dev/null +++ b/src/graphics/draw/MessageRenderer.h @@ -0,0 +1,18 @@ +#pragma once +#include "OLEDDisplay.h" +#include "OLEDDisplayUi.h" +#include "graphics/emotes.h" + +namespace graphics +{ +namespace MessageRenderer +{ + +// Text and emote rendering +void drawStringWithEmotes(OLEDDisplay *display, int x, int y, const std::string &line, const Emote *emotes, int emoteCount); + +/// Draws the text message frame for displaying received messages +void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + +} // namespace MessageRenderer +} // namespace graphics diff --git a/src/graphics/draw/NodeListRenderer.cpp b/src/graphics/draw/NodeListRenderer.cpp new file mode 100644 index 000000000..13b71546e --- /dev/null +++ b/src/graphics/draw/NodeListRenderer.cpp @@ -0,0 +1,595 @@ +#include "configuration.h" +#if HAS_SCREEN +#include "CompassRenderer.h" +#include "NodeDB.h" +#include "NodeListRenderer.h" +#include "UIRenderer.h" +#include "gps/GeoCoord.h" +#include "gps/RTC.h" // for getTime() function +#include "graphics/ScreenFonts.h" +#include "graphics/SharedUIDisplay.h" +#include "graphics/images.h" +#include "meshUtils.h" +#include + +// Forward declarations for functions defined in Screen.cpp +namespace graphics +{ +extern bool haveGlyphs(const char *str); +} // namespace graphics + +// Global screen instance +extern graphics::Screen *screen; + +namespace graphics +{ +namespace NodeListRenderer +{ + +// Function moved from Screen.cpp to NodeListRenderer.cpp since it's primarily used here +void drawScaledXBitmap16x16(int x, int y, int width, int height, const uint8_t *bitmapXBM, OLEDDisplay *display) +{ + for (int row = 0; row < height; row++) { + uint8_t rowMask = (1 << row); + for (int col = 0; col < width; col++) { + uint8_t colData = pgm_read_byte(&bitmapXBM[col]); + if (colData & rowMask) { + // Note: rows become X, columns become Y after transpose + display->fillRect(x + row * 2, y + col * 2, 2, 2); + } + } + } +} + +// Static variables for dynamic cycling +static NodeListMode currentMode = MODE_LAST_HEARD; +static int scrollIndex = 0; + +// ============================= +// Utility Functions +// ============================= + +const char *getSafeNodeName(meshtastic_NodeInfoLite *node) +{ + static char nodeName[16] = "?"; + if (node->has_user && strlen(node->user.short_name) > 0) { + bool valid = true; + const char *name = node->user.short_name; + for (size_t i = 0; i < strlen(name); i++) { + uint8_t c = (uint8_t)name[i]; + if (c < 32 || c > 126) { + valid = false; + break; + } + } + if (valid) { + strncpy(nodeName, name, sizeof(nodeName) - 1); + nodeName[sizeof(nodeName) - 1] = '\0'; + } else { + snprintf(nodeName, sizeof(nodeName), "%04X", (uint16_t)(node->num & 0xFFFF)); + } + } else { + strcpy(nodeName, "?"); + } + return nodeName; +} + +const char *getCurrentModeTitle(int screenWidth) +{ + switch (currentMode) { + case MODE_LAST_HEARD: + return "Last Heard"; + case MODE_HOP_SIGNAL: + return (screenWidth > 128) ? "Hops/Signal" : "Hops/Sig"; + case MODE_DISTANCE: + return "Distance"; + default: + return "Nodes"; + } +} + +// Use dynamic timing based on mode +unsigned long getModeCycleIntervalMs() +{ + return 3000; +} + +// Calculate bearing between two lat/lon points +float calculateBearing(double lat1, double lon1, double lat2, double lon2) +{ + double dLon = (lon2 - lon1) * DEG_TO_RAD; + double y = sin(dLon) * cos(lat2 * DEG_TO_RAD); + double x = cos(lat1 * DEG_TO_RAD) * sin(lat2 * DEG_TO_RAD) - sin(lat1 * DEG_TO_RAD) * cos(lat2 * DEG_TO_RAD) * cos(dLon); + double bearing = atan2(y, x) * RAD_TO_DEG; + return fmod(bearing + 360.0, 360.0); +} + +int calculateMaxScroll(int totalEntries, int visibleRows) +{ + return std::max(0, (totalEntries - 1) / (visibleRows * 2)); +} + +void retrieveAndSortNodes(std::vector &nodeList) +{ + size_t numNodes = nodeDB->getNumMeshNodes(); + for (size_t i = 0; i < numNodes; i++) { + meshtastic_NodeInfoLite *node = nodeDB->getMeshNodeByIndex(i); + if (!node || node->num == nodeDB->getNodeNum()) + continue; + + NodeEntry entry; + entry.node = node; + entry.sortValue = sinceLastSeen(node); + + nodeList.push_back(entry); + } + + // Sort nodes: favorites first, then by last heard (most recent first) + std::sort(nodeList.begin(), nodeList.end(), [](const NodeEntry &a, const NodeEntry &b) { + bool aFav = a.node->is_favorite; + bool bFav = b.node->is_favorite; + if (aFav != bFav) + return aFav; + if (a.sortValue == 0 || a.sortValue == UINT32_MAX) + return false; + if (b.sortValue == 0 || b.sortValue == UINT32_MAX) + return true; + return a.sortValue < b.sortValue; + }); +} + +void drawColumnSeparator(OLEDDisplay *display, int16_t x, int16_t yStart, int16_t yEnd) +{ + int columnWidth = display->getWidth() / 2; + int separatorX = x + columnWidth - 2; + for (int y = yStart; y <= yEnd; y += 2) { + display->setPixel(separatorX, y); + } +} + +void drawScrollbar(OLEDDisplay *display, int visibleNodeRows, int totalEntries, int scrollIndex, int columns, int scrollStartY) +{ + if (totalEntries <= visibleNodeRows * columns) + return; + + int scrollbarX = display->getWidth() - 2; + int scrollbarHeight = display->getHeight() - scrollStartY - 10; + int thumbHeight = std::max(4, (scrollbarHeight * visibleNodeRows * columns) / totalEntries); + int maxScroll = calculateMaxScroll(totalEntries, visibleNodeRows); + int thumbY = scrollStartY + (scrollIndex * (scrollbarHeight - thumbHeight)) / std::max(1, maxScroll); + + for (int i = 0; i < thumbHeight; i++) { + display->setPixel(scrollbarX, thumbY + i); + } +} + +// ============================= +// Entry Renderers +// ============================= + +void drawEntryLastHeard(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth) +{ + bool isLeftCol = (x < SCREEN_WIDTH / 2); + int timeOffset = (SCREEN_WIDTH > 128) ? (isLeftCol ? 7 : 10) : (isLeftCol ? 3 : 7); + + const char *nodeName = getSafeNodeName(node); + + char timeStr[10]; + uint32_t seconds = sinceLastSeen(node); + if (seconds == 0 || seconds == UINT32_MAX) { + snprintf(timeStr, sizeof(timeStr), "?"); + } else { + uint32_t minutes = seconds / 60, hours = minutes / 60, days = hours / 24; + snprintf(timeStr, sizeof(timeStr), (days > 365 ? "?" : "%d%c"), + (days ? days + : hours ? hours + : minutes), + (days ? 'd' + : hours ? 'h' + : 'm')); + } + + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + display->drawString(x + ((SCREEN_WIDTH > 128) ? 6 : 3), y, nodeName); + if (node->is_favorite) { + if (SCREEN_WIDTH > 128) { + drawScaledXBitmap16x16(x, y + 6, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint, display); + } else { + display->drawXbm(x, y + 5, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint); + } + } + + int rightEdge = x + columnWidth - timeOffset; + if (timeStr[strlen(timeStr) - 1] == 'm') // Fix the fact that our fonts don't line up well all the time + rightEdge -= 1; + int textWidth = display->getStringWidth(timeStr); + display->drawString(rightEdge - textWidth, y, timeStr); +} + +void drawEntryHopSignal(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth) +{ + bool isLeftCol = (x < SCREEN_WIDTH / 2); + + int nameMaxWidth = columnWidth - 25; + int barsOffset = (SCREEN_WIDTH > 128) ? (isLeftCol ? 20 : 24) : (isLeftCol ? 15 : 19); + int hopOffset = (SCREEN_WIDTH > 128) ? (isLeftCol ? 21 : 29) : (isLeftCol ? 13 : 17); + + int barsXOffset = columnWidth - barsOffset; + + const char *nodeName = getSafeNodeName(node); + + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + + display->drawStringMaxWidth(x + ((SCREEN_WIDTH > 128) ? 6 : 3), y, nameMaxWidth, nodeName); + if (node->is_favorite) { + if (SCREEN_WIDTH > 128) { + drawScaledXBitmap16x16(x, y + 6, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint, display); + } else { + display->drawXbm(x, y + 5, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint); + } + } + + // Draw signal strength bars + int bars = (node->snr > 5) ? 4 : (node->snr > 0) ? 3 : (node->snr > -5) ? 2 : (node->snr > -10) ? 1 : 0; + int barWidth = 2; + int barStartX = x + barsXOffset; + int barStartY = y + 1 + (FONT_HEIGHT_SMALL / 2) + 2; + + for (int b = 0; b < 4; b++) { + if (b < bars) { + int height = (b * 2); + display->fillRect(barStartX + (b * (barWidth + 1)), barStartY - height, barWidth, height); + } + } + + // Draw hop count + char hopStr[6] = ""; + if (node->has_hops_away && node->hops_away > 0) + snprintf(hopStr, sizeof(hopStr), "[%d]", node->hops_away); + + if (hopStr[0] != '\0') { + int rightEdge = x + columnWidth - hopOffset; + int textWidth = display->getStringWidth(hopStr); + display->drawString(rightEdge - textWidth, y, hopStr); + } +} + +void drawNodeDistance(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth) +{ + bool isLeftCol = (x < SCREEN_WIDTH / 2); + int nameMaxWidth = columnWidth - (SCREEN_WIDTH > 128 ? (isLeftCol ? 25 : 28) : (isLeftCol ? 20 : 22)); + + const char *nodeName = getSafeNodeName(node); + char distStr[10] = ""; + + meshtastic_NodeInfoLite *ourNode = nodeDB->getMeshNode(nodeDB->getNodeNum()); + if (nodeDB->hasValidPosition(ourNode) && nodeDB->hasValidPosition(node)) { + double lat1 = ourNode->position.latitude_i * 1e-7; + double lon1 = ourNode->position.longitude_i * 1e-7; + double lat2 = node->position.latitude_i * 1e-7; + double lon2 = node->position.longitude_i * 1e-7; + + double earthRadiusKm = 6371.0; + double dLat = (lat2 - lat1) * DEG_TO_RAD; + double dLon = (lon2 - lon1) * DEG_TO_RAD; + + double a = + sin(dLat / 2) * sin(dLat / 2) + cos(lat1 * DEG_TO_RAD) * cos(lat2 * DEG_TO_RAD) * sin(dLon / 2) * sin(dLon / 2); + double c = 2 * atan2(sqrt(a), sqrt(1 - a)); + double distanceKm = earthRadiusKm * c; + + if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) { + double miles = distanceKm * 0.621371; + if (miles < 0.1) { + int feet = (int)(miles * 5280); + if (feet < 1000) + snprintf(distStr, sizeof(distStr), "%dft", feet); + else + snprintf(distStr, sizeof(distStr), "¼mi"); // 4-char max + } else { + int roundedMiles = (int)(miles + 0.5); + if (roundedMiles < 1000) + snprintf(distStr, sizeof(distStr), "%dmi", roundedMiles); + else + snprintf(distStr, sizeof(distStr), "999"); // Max display cap + } + } else { + if (distanceKm < 1.0) { + int meters = (int)(distanceKm * 1000); + if (meters < 1000) + snprintf(distStr, sizeof(distStr), "%dm", meters); + else + snprintf(distStr, sizeof(distStr), "1k"); + } else { + int km = (int)(distanceKm + 0.5); + if (km < 1000) + snprintf(distStr, sizeof(distStr), "%dk", km); + else + snprintf(distStr, sizeof(distStr), "999"); + } + } + } + + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + display->drawStringMaxWidth(x + ((SCREEN_WIDTH > 128) ? 6 : 3), y, nameMaxWidth, nodeName); + if (node->is_favorite) { + if (SCREEN_WIDTH > 128) { + drawScaledXBitmap16x16(x, y + 6, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint, display); + } else { + display->drawXbm(x, y + 5, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint); + } + } + + if (strlen(distStr) > 0) { + int offset = (SCREEN_WIDTH > 128) ? (isLeftCol ? 7 : 10) // Offset for Wide Screens (Left Column:Right Column) + : (isLeftCol ? 4 : 7); // Offset for Narrow Screens (Left Column:Right Column) + int rightEdge = x + columnWidth - offset; + int textWidth = display->getStringWidth(distStr); + display->drawString(rightEdge - textWidth, y, distStr); + } +} + +void drawEntryDynamic(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth) +{ + switch (currentMode) { + case MODE_LAST_HEARD: + drawEntryLastHeard(display, node, x, y, columnWidth); + break; + case MODE_HOP_SIGNAL: + drawEntryHopSignal(display, node, x, y, columnWidth); + break; + case MODE_DISTANCE: + drawNodeDistance(display, node, x, y, columnWidth); + break; + default: + break; + } +} + +void drawEntryCompass(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth) +{ + bool isLeftCol = (x < SCREEN_WIDTH / 2); + + // Adjust max text width depending on column and screen width + int nameMaxWidth = columnWidth - (SCREEN_WIDTH > 128 ? (isLeftCol ? 25 : 28) : (isLeftCol ? 20 : 22)); + + const char *nodeName = getSafeNodeName(node); + + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + display->drawStringMaxWidth(x + ((SCREEN_WIDTH > 128) ? 6 : 3), y, nameMaxWidth, nodeName); + if (node->is_favorite) { + if (SCREEN_WIDTH > 128) { + drawScaledXBitmap16x16(x, y + 6, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint, display); + } else { + display->drawXbm(x, y + 5, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint); + } + } +} + +void drawCompassArrow(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth, float myHeading, + double userLat, double userLon) +{ + if (!nodeDB->hasValidPosition(node)) + return; + + bool isLeftCol = (x < SCREEN_WIDTH / 2); + int arrowXOffset = (SCREEN_WIDTH > 128) ? (isLeftCol ? 22 : 24) : (isLeftCol ? 12 : 18); + + int centerX = x + columnWidth - arrowXOffset; + int centerY = y + FONT_HEIGHT_SMALL / 2; + + double nodeLat = node->position.latitude_i * 1e-7; + double nodeLon = node->position.longitude_i * 1e-7; + float bearingToNode = calculateBearing(userLat, userLon, nodeLat, nodeLon); + float relativeBearing = fmod((bearingToNode - myHeading + 360), 360); + float angle = relativeBearing * DEG_TO_RAD; + + // Shrink size by 2px + int size = FONT_HEIGHT_SMALL - 5; + float halfSize = size / 2.0; + + // Point of the arrow + int tipX = centerX + halfSize * cos(angle); + int tipY = centerY - halfSize * sin(angle); + + float baseAngle = radians(35); + float sideLen = halfSize * 0.95; + float notchInset = halfSize * 0.35; + + // Left and right corners + int leftX = centerX + sideLen * cos(angle + PI - baseAngle); + int leftY = centerY - sideLen * sin(angle + PI - baseAngle); + + int rightX = centerX + sideLen * cos(angle + PI + baseAngle); + int rightY = centerY - sideLen * sin(angle + PI + baseAngle); + + // Center notch (cut-in) + int notchX = centerX - notchInset * cos(angle); + int notchY = centerY + notchInset * sin(angle); + + // Draw the chevron-style arrowhead + display->fillTriangle(tipX, tipY, leftX, leftY, notchX, notchY); + display->fillTriangle(tipX, tipY, notchX, notchY, rightX, rightY); +} + +// ============================= +// Main Screen Functions +// ============================= + +void drawNodeListScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y, const char *title, + EntryRenderer renderer, NodeExtrasRenderer extras, float heading, double lat, double lon) +{ + const int COMMON_HEADER_HEIGHT = FONT_HEIGHT_SMALL - 1; + const int rowYOffset = FONT_HEIGHT_SMALL - 3; + + int columnWidth = display->getWidth() / 2; + + display->clear(); + + // Draw the battery/time header + graphics::drawCommonHeader(display, x, y, title); + + // Space below header + y += COMMON_HEADER_HEIGHT; + + // Fetch and display sorted node list + std::vector nodeList; + retrieveAndSortNodes(nodeList); + + int totalEntries = nodeList.size(); + int totalRowsAvailable = (display->getHeight() - y) / rowYOffset; +#ifdef USE_EINK + totalRowsAvailable -= 1; +#endif + int visibleNodeRows = totalRowsAvailable; + int totalColumns = 2; + + int startIndex = scrollIndex * visibleNodeRows * totalColumns; + int endIndex = std::min(startIndex + visibleNodeRows * totalColumns, totalEntries); + + int yOffset = 0; + int col = 0; + int lastNodeY = y; + int shownCount = 0; + int rowCount = 0; + + for (int i = startIndex; i < endIndex; ++i) { + int xPos = x + (col * columnWidth); + int yPos = y + yOffset; + renderer(display, nodeList[i].node, xPos, yPos, columnWidth); + + if (extras) { + extras(display, nodeList[i].node, xPos, yPos, columnWidth, heading, lat, lon); + } + + lastNodeY = std::max(lastNodeY, yPos + FONT_HEIGHT_SMALL); + yOffset += rowYOffset; + shownCount++; + rowCount++; + + if (rowCount >= totalRowsAvailable) { + yOffset = 0; + rowCount = 0; + col++; + if (col > (totalColumns - 1)) + break; + } + } + + // Draw column separator + if (shownCount > 0) { + const int firstNodeY = y + 3; + drawColumnSeparator(display, x, firstNodeY, lastNodeY); + } + + const int scrollStartY = y + 3; + drawScrollbar(display, visibleNodeRows, totalEntries, scrollIndex, 2, scrollStartY); +} + +// ============================= +// Screen Frame Functions +// ============================= + +#ifndef USE_EINK +void drawDynamicNodeListScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + // Static variables to track mode and duration + static NodeListMode lastRenderedMode = MODE_COUNT; + static unsigned long modeStartTime = 0; + + unsigned long now = millis(); + + // On very first call (on boot or state enter) + if (lastRenderedMode == MODE_COUNT) { + currentMode = MODE_LAST_HEARD; + modeStartTime = now; + } + + // Time to switch to next mode? + if (now - modeStartTime >= getModeCycleIntervalMs()) { + currentMode = static_cast((currentMode + 1) % MODE_COUNT); + modeStartTime = now; + } + + // Render screen based on currentMode + const char *title = getCurrentModeTitle(display->getWidth()); + drawNodeListScreen(display, state, x, y, title, drawEntryDynamic); + + // Track the last mode to avoid reinitializing modeStartTime + lastRenderedMode = currentMode; +} +#endif + +#ifdef USE_EINK +void drawLastHeardScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + const char *title = "Last Heard"; + drawNodeListScreen(display, state, x, y, title, drawEntryLastHeard); +} + +void drawHopSignalScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + const char *title = "Hops/Signal"; + drawNodeListScreen(display, state, x, y, title, drawEntryHopSignal); +} + +void drawDistanceScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + const char *title = "Distance"; + drawNodeListScreen(display, state, x, y, title, drawNodeDistance); +} +#endif + +void drawNodeListWithCompasses(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + float heading = 0; + bool validHeading = false; + double lat = 0; + double lon = 0; + +#if HAS_GPS + if (screen->hasHeading()) { + heading = screen->getHeading(); // degrees + validHeading = true; + } else { + heading = screen->estimatedHeading(lat, lon); + validHeading = !isnan(heading); + } +#endif + + if (!validHeading) + return; + + drawNodeListScreen(display, state, x, y, "Bearings", drawEntryCompass, drawCompassArrow, heading, lat, lon); +} + +/// Draw a series of fields in a column, wrapping to multiple columns if needed +void drawColumns(OLEDDisplay *display, int16_t x, int16_t y, const char **fields) +{ + // The coordinates define the left starting point of the text + display->setTextAlignment(TEXT_ALIGN_LEFT); + + const char **f = fields; + int xo = x, yo = y; + while (*f) { + display->drawString(xo, yo, *f); + if ((display->getColor() == BLACK) && config.display.heading_bold) + display->drawString(xo + 1, yo, *f); + + display->setColor(WHITE); + yo += FONT_HEIGHT_SMALL; + if (yo > SCREEN_HEIGHT - FONT_HEIGHT_SMALL) { + xo += SCREEN_WIDTH / 2; + yo = 0; + } + f++; + } +} + +} // namespace NodeListRenderer +} // namespace graphics +#endif \ No newline at end of file diff --git a/src/graphics/draw/NodeListRenderer.h b/src/graphics/draw/NodeListRenderer.h new file mode 100644 index 000000000..63f0d1c69 --- /dev/null +++ b/src/graphics/draw/NodeListRenderer.h @@ -0,0 +1,69 @@ +#pragma once + +#include "graphics/Screen.h" +#include "mesh/generated/meshtastic/mesh.pb.h" +#include +#include + +namespace graphics +{ + +/// Forward declarations +class Screen; + +/** + * @brief Node list and entry rendering functions + * + * Contains all functions related to drawing node lists and individual node entries + * including last heard, hop signal, distance, and compass views. + */ +namespace NodeListRenderer +{ +// Entry renderer function types +typedef void (*EntryRenderer)(OLEDDisplay *, meshtastic_NodeInfoLite *, int16_t, int16_t, int); +typedef void (*NodeExtrasRenderer)(OLEDDisplay *, meshtastic_NodeInfoLite *, int16_t, int16_t, int, float, double, double); + +// Node entry structure +struct NodeEntry { + meshtastic_NodeInfoLite *node; + uint32_t sortValue; +}; + +// Node list mode enumeration +enum NodeListMode { MODE_LAST_HEARD = 0, MODE_HOP_SIGNAL = 1, MODE_DISTANCE = 2, MODE_COUNT = 3 }; + +// Main node list screen function +void drawNodeListScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y, const char *title, + EntryRenderer renderer, NodeExtrasRenderer extras = nullptr, float heading = 0, double lat = 0, + double lon = 0); + +// Entry renderers +void drawEntryLastHeard(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth); +void drawEntryHopSignal(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth); +void drawNodeDistance(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth); +void drawEntryDynamic(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth); +void drawEntryCompass(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth); + +// Extras renderers +void drawCompassArrow(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth, float myHeading, + double userLat, double userLon); + +// Screen frame functions +void drawLastHeardScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); +void drawHopSignalScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); +void drawDistanceScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); +void drawDynamicNodeListScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); +void drawNodeListWithCompasses(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + +// Utility functions +const char *getCurrentModeTitle(int screenWidth); +void retrieveAndSortNodes(std::vector &nodeList); +const char *getSafeNodeName(meshtastic_NodeInfoLite *node); +void drawColumns(OLEDDisplay *display, int16_t x, int16_t y, const char **fields); + +// Bitmap drawing function +void drawScaledXBitmap16x16(int x, int y, int width, int height, const uint8_t *bitmapXBM, OLEDDisplay *display); + +} // namespace NodeListRenderer + +} // namespace graphics diff --git a/src/graphics/draw/NotificationRenderer.cpp b/src/graphics/draw/NotificationRenderer.cpp new file mode 100644 index 000000000..ed5257012 --- /dev/null +++ b/src/graphics/draw/NotificationRenderer.cpp @@ -0,0 +1,265 @@ +#include "configuration.h" +#if HAS_SCREEN + +#include "DisplayFormatters.h" +#include "NodeDB.h" +#include "NotificationRenderer.h" +#include "graphics/ScreenFonts.h" +#include "graphics/SharedUIDisplay.h" +#include "graphics/images.h" +#include "main.h" +#include +#include +#include + +#ifdef ARCH_ESP32 +#include "esp_task_wdt.h" +#endif + +using namespace meshtastic; + +// External references to global variables from Screen.cpp +extern std::vector functionSymbol; +extern std::string functionSymbolString; +extern bool hasUnreadMessage; + +namespace graphics +{ + +char NotificationRenderer::inEvent = INPUT_BROKER_NONE; +int8_t NotificationRenderer::curSelected = 0; +char NotificationRenderer::alertBannerMessage[256] = {0}; +uint32_t NotificationRenderer::alertBannerUntil = 0; // 0 is a special case meaning forever +uint8_t NotificationRenderer::alertBannerOptions = 0; // last x lines are seelctable options +std::function NotificationRenderer::alertBannerCallback = NULL; +bool NotificationRenderer::pauseBanner = false; + +// Used on boot when a certificate is being created +void NotificationRenderer::drawSSLScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + display->setTextAlignment(TEXT_ALIGN_CENTER); + display->setFont(FONT_SMALL); + display->drawString(64 + x, y, "Creating SSL certificate"); + +#ifdef ARCH_ESP32 + yield(); + esp_task_wdt_reset(); +#endif + + display->setFont(FONT_SMALL); + if ((millis() / 1000) % 2) { + display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Please wait . . ."); + } else { + display->drawString(64 + x, FONT_HEIGHT_SMALL + y + 2, "Please wait . . "); + } +} + +void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisplayUiState *state) +{ + // Exit if no message is active or duration has passed + if (!isOverlayBannerShowing()) + return; + + if (pauseBanner) + return; + + // === Layout Configuration === + constexpr uint16_t padding = 5; // Padding around text inside the box + constexpr uint16_t vPadding = 2; // Padding around text inside the box + constexpr uint8_t lineSpacing = 1; // Extra space between lines + + // Search the message to determine if we need the bell added + bool needs_bell = (strstr(alertBannerMessage, "Alert Received") != nullptr); + + uint8_t firstOption = 0; + uint8_t firstOptionToShow = 0; + + // Setup font and alignment + display->setFont(FONT_SMALL); + display->setTextAlignment(TEXT_ALIGN_LEFT); // We will manually center per line + const int MAX_LINES = 24; + + uint16_t maxWidth = 0; + uint16_t arrowsWidth = display->getStringWidth("> <", 4, true); + uint16_t lineWidths[MAX_LINES] = {0}; + uint16_t lineLengths[MAX_LINES] = {0}; + char *lineStarts[MAX_LINES + 1]; + uint16_t lineCount = 0; + char lineBuffer[40] = {0}; + // pointer to the terminating null + char *alertEnd = alertBannerMessage + strnlen(alertBannerMessage, sizeof(alertBannerMessage)); + lineStarts[lineCount] = alertBannerMessage; + + // loop through lines finding \n characters + while ((lineCount < MAX_LINES) && (lineStarts[lineCount] < alertEnd)) { + lineStarts[lineCount + 1] = std::find(lineStarts[lineCount], alertEnd, '\n'); + lineLengths[lineCount] = lineStarts[lineCount + 1] - lineStarts[lineCount]; + if (lineStarts[lineCount + 1][0] == '\n') { + lineStarts[lineCount + 1] += 1; // Move the start pointer beyond the \n + } + lineWidths[lineCount] = display->getStringWidth(lineStarts[lineCount], lineLengths[lineCount], true); + if (lineWidths[lineCount] > maxWidth) { + maxWidth = lineWidths[lineCount]; + } + if (alertBannerOptions > 0 && lineCount > 0 && lineWidths[lineCount] + arrowsWidth > maxWidth) { + maxWidth = lineWidths[lineCount] + arrowsWidth; + } + lineCount++; + // if we are doing a selection, add extra width for arrows + } + + if (alertBannerOptions > 0) { + // respond to input + if (inEvent == INPUT_BROKER_UP || inEvent == INPUT_BROKER_ALT_PRESS) { + curSelected--; + } else if (inEvent == INPUT_BROKER_DOWN || inEvent == INPUT_BROKER_USER_PRESS) { + curSelected++; + } else if (inEvent == INPUT_BROKER_SELECT) { + alertBannerCallback(curSelected); + alertBannerMessage[0] = '\0'; + } else if ((inEvent == INPUT_BROKER_CANCEL || inEvent == INPUT_BROKER_ALT_LONG) && alertBannerUntil != 0) { + alertBannerMessage[0] = '\0'; + } + if (curSelected == -1) + curSelected = alertBannerOptions - 1; + if (curSelected == alertBannerOptions) + curSelected = 0; + // compare number of options to number of lines + if (lineCount < alertBannerOptions) + return; + firstOption = lineCount - alertBannerOptions; + if (curSelected > 1 && alertBannerOptions > 3) { + firstOptionToShow = curSelected + firstOption - 1; + // put the selected option in the middle + } else { + firstOptionToShow = firstOption; + } + } else { // not in an alert with a callback + // TODO: check that at least a second has passed since the alert started + if (inEvent == INPUT_BROKER_SELECT || inEvent == INPUT_BROKER_ALT_LONG || inEvent == INPUT_BROKER_CANCEL) { + alertBannerMessage[0] = '\0'; // end the alert early + } + } + inEvent = INPUT_BROKER_NONE; + if (alertBannerMessage[0] == '\0') + return; + + // set width from longest line + uint16_t boxWidth = padding * 2 + maxWidth; + if (needs_bell) { + if (SCREEN_WIDTH > 128 && boxWidth <= 150) { + boxWidth += 26; + } + if (SCREEN_WIDTH <= 128 && boxWidth <= 100) { + boxWidth += 20; + } + } + // calculate max lines on screen? for now it's 4 + // set height from line count + uint16_t boxHeight; + if (lineCount <= 4) { + boxHeight = vPadding * 2 + lineCount * FONT_HEIGHT_SMALL + (lineCount - 1) * lineSpacing; + } else { + boxHeight = vPadding * 2 + 4 * FONT_HEIGHT_SMALL + 4 * lineSpacing; + } + + int16_t boxLeft = (display->width() / 2) - (boxWidth / 2); + int16_t boxTop = (display->height() / 2) - (boxHeight / 2); + // === Draw background box === + display->setColor(BLACK); + display->fillRect(boxLeft - 1, boxTop - 1, boxWidth + 2, boxHeight + 2); // Slightly oversized box + display->fillRect(boxLeft, boxTop - 2, boxWidth, 1); // Top Line + display->fillRect(boxLeft, boxTop + boxHeight + 1, boxWidth, 1); // Bottom Line + display->fillRect(boxLeft - 2, boxTop, 1, boxHeight); // Left Line + display->fillRect(boxLeft + boxWidth + 1, boxTop, 1, boxHeight); // Right Line + display->setColor(WHITE); + display->drawRect(boxLeft, boxTop, boxWidth, boxHeight); // Border + display->setColor(BLACK); + display->fillRect(boxLeft, boxTop, 1, 1); // Top Left + display->fillRect(boxLeft + boxWidth - 1, boxTop, 1, 1); // Top Right + display->fillRect(boxLeft, boxTop + boxHeight - 1, 1, 1); // Bottom Left + display->fillRect(boxLeft + boxWidth - 1, boxTop + boxHeight - 1, 1, 1); // Bottom Right + display->setColor(WHITE); + + // === Draw each line centered in the box === + int16_t lineY = boxTop + vPadding; + + for (int i = 0; i < lineCount; i++) { + // is this line selected? + // if so, start the buffer with -> and strncpy to the 4th location + if (i < lineCount - alertBannerOptions || alertBannerOptions == 0) { + strncpy(lineBuffer, lineStarts[i], 40); + if (lineLengths[i] > 39) + lineBuffer[39] = '\0'; + else + lineBuffer[lineLengths[i]] = '\0'; + } else if (i >= firstOptionToShow && i < firstOptionToShow + 3) { + if (i == curSelected + firstOption) { + if (lineLengths[i] > 35) + lineLengths[i] = 35; + strncpy(lineBuffer, "> ", 3); + strncpy(lineBuffer + 2, lineStarts[i], 36); + strncpy(lineBuffer + lineLengths[i] + 2, " <", 3); + lineLengths[i] += 4; + lineWidths[i] += display->getStringWidth("> <", 4, true); + if (lineLengths[i] > 35) + lineBuffer[39] = '\0'; + else + lineBuffer[lineLengths[i]] = '\0'; + } else { + strncpy(lineBuffer, lineStarts[i], 40); + if (lineLengths[i] > 39) + lineBuffer[39] = '\0'; + else + lineBuffer[lineLengths[i]] = '\0'; + } + } else { // add break for the additional lines + continue; + } + + int16_t textX = boxLeft + (boxWidth - lineWidths[i]) / 2; + + if (needs_bell && i == 0) { + int bellY = lineY + (FONT_HEIGHT_SMALL - 8) / 2; + display->drawXbm(textX - 10, bellY, 8, 8, bell_alert); + display->drawXbm(textX + lineWidths[i] + 2, bellY, 8, 8, bell_alert); + } + + display->drawString(textX, lineY, lineBuffer); + lineY += FONT_HEIGHT_SMALL + lineSpacing; + } +} + +/// Draw the last text message we received +void NotificationRenderer::drawCriticalFaultFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_MEDIUM); + + char tempBuf[24]; + snprintf(tempBuf, sizeof(tempBuf), "Critical fault #%d", error_code); + display->drawString(0 + x, 0 + y, tempBuf); + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + display->drawString(0 + x, FONT_HEIGHT_MEDIUM + y, "For help, please visit \nmeshtastic.org"); +} + +void NotificationRenderer::drawFrameFirmware(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + display->setTextAlignment(TEXT_ALIGN_CENTER); + display->setFont(FONT_MEDIUM); + display->drawString(64 + x, y, "Updating"); + + display->setFont(FONT_SMALL); + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->drawStringMaxWidth(0 + x, 2 + y + FONT_HEIGHT_SMALL * 2, x + display->getWidth(), + "Please be patient and do not power off."); +} + +bool NotificationRenderer::isOverlayBannerShowing() +{ + return strlen(alertBannerMessage) > 0 && (alertBannerUntil == 0 || millis() <= alertBannerUntil); +} + +} // namespace graphics +#endif \ No newline at end of file diff --git a/src/graphics/draw/NotificationRenderer.h b/src/graphics/draw/NotificationRenderer.h new file mode 100644 index 000000000..3ed931dc6 --- /dev/null +++ b/src/graphics/draw/NotificationRenderer.h @@ -0,0 +1,28 @@ +#pragma once + +#include "OLEDDisplay.h" +#include "OLEDDisplayUi.h" + +namespace graphics +{ + +class NotificationRenderer +{ + public: + static char inEvent; + static int8_t curSelected; + static char alertBannerMessage[256]; + static uint32_t alertBannerUntil; // 0 is a special case meaning forever + static uint8_t alertBannerOptions; // last x lines are seelctable options + static std::function alertBannerCallback; + + static bool pauseBanner; + + static void drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisplayUiState *state); + static void drawCriticalFaultFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + static void drawSSLScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + static void drawFrameFirmware(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + static bool isOverlayBannerShowing(); +}; + +} // namespace graphics diff --git a/src/graphics/draw/UIRenderer.cpp b/src/graphics/draw/UIRenderer.cpp new file mode 100644 index 000000000..a77d5b44b --- /dev/null +++ b/src/graphics/draw/UIRenderer.cpp @@ -0,0 +1,1240 @@ +#include "configuration.h" +#if HAS_SCREEN +#include "CompassRenderer.h" +#include "GPSStatus.h" +#include "NodeDB.h" +#include "NodeListRenderer.h" +#include "UIRenderer.h" +#include "airtime.h" +#include "configuration.h" +#include "gps/GeoCoord.h" +#include "graphics/Screen.h" +#include "graphics/ScreenFonts.h" +#include "graphics/SharedUIDisplay.h" +#include "graphics/images.h" +#include "main.h" +#include "target_specific.h" +#include +#include +#include + +#if !MESHTASTIC_EXCLUDE_GPS + +// External variables +extern graphics::Screen *screen; + +namespace graphics +{ + +// GeoCoord object for coordinate conversions +extern GeoCoord geoCoord; + +// Threshold values for the GPS lock accuracy bar display +extern uint32_t dopThresholds[5]; + +NodeNum UIRenderer::currentFavoriteNodeNum = 0; + +// Draw GPS status summary +void UIRenderer::drawGps(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::GPSStatus *gps) +{ + // Draw satellite image + if (SCREEN_WIDTH > 128) { + NodeListRenderer::drawScaledXBitmap16x16(x, y - 2, imgSatellite_width, imgSatellite_height, imgSatellite, display); + } else { + display->drawXbm(x + 1, y + 1, imgSatellite_width, imgSatellite_height, imgSatellite); + } + char textString[10]; + + if (config.position.fixed_position) { + // GPS coordinates are currently fixed + snprintf(textString, sizeof(textString), "Fixed"); + } + if (!gps->getIsConnected()) { + snprintf(textString, sizeof(textString), "No Lock"); + } + if (!gps->getHasLock()) { + // Draw "No sats" to the right of the icon with slightly more gap + snprintf(textString, sizeof(textString), "No Sats"); + } else { + snprintf(textString, sizeof(textString), "%u sats", gps->getNumSatellites()); + } + if (SCREEN_WIDTH > 128) { + display->drawString(x + 18, y, textString); + } else { + display->drawString(x + 11, y, textString); + } +} + +// Draw status when GPS is disabled or not present +void UIRenderer::drawGpsPowerStatus(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::GPSStatus *gps) +{ + const char *displayLine; + int pos; + if (y < FONT_HEIGHT_SMALL) { // Line 1: use short string + displayLine = config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT ? "No GPS" : "GPS off"; + pos = display->getWidth() - display->getStringWidth(displayLine); + } else { + displayLine = config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT ? "GPS not present" + : "GPS is disabled"; + pos = (display->getWidth() - display->getStringWidth(displayLine)) / 2; + } + display->drawString(x + pos, y, displayLine); +} + +void UIRenderer::drawGpsAltitude(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::GPSStatus *gps) +{ + char displayLine[32]; + if (!gps->getIsConnected() && !config.position.fixed_position) { + // displayLine = "No GPS Module"; + // display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine); + } else if (!gps->getHasLock() && !config.position.fixed_position) { + // displayLine = "No GPS Lock"; + // display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine); + } else { + geoCoord.updateCoords(int32_t(gps->getLatitude()), int32_t(gps->getLongitude()), int32_t(gps->getAltitude())); + if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) + snprintf(displayLine, sizeof(displayLine), "Altitude: %.0fft", geoCoord.getAltitude() * METERS_TO_FEET); + else + snprintf(displayLine, sizeof(displayLine), "Altitude: %.0im", geoCoord.getAltitude()); + display->drawString(x + (display->getWidth() - (display->getStringWidth(displayLine))) / 2, y, displayLine); + } +} + +// Draw GPS status coordinates +void UIRenderer::drawGpsCoordinates(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::GPSStatus *gps) +{ + auto gpsFormat = config.display.gps_format; + char displayLine[32]; + + if (!gps->getIsConnected() && !config.position.fixed_position) { + strcpy(displayLine, "No GPS present"); + display->drawString(x + (display->getWidth() - (display->getStringWidth(displayLine))) / 2, y, displayLine); + } else if (!gps->getHasLock() && !config.position.fixed_position) { + strcpy(displayLine, "No GPS Lock"); + display->drawString(x + (display->getWidth() - (display->getStringWidth(displayLine))) / 2, y, displayLine); + } else { + + geoCoord.updateCoords(int32_t(gps->getLatitude()), int32_t(gps->getLongitude()), int32_t(gps->getAltitude())); + + if (gpsFormat != meshtastic_Config_DisplayConfig_GpsCoordinateFormat_DMS) { + char coordinateLine[22]; + if (gpsFormat == meshtastic_Config_DisplayConfig_GpsCoordinateFormat_DEC) { // Decimal Degrees + snprintf(coordinateLine, sizeof(coordinateLine), "%f %f", geoCoord.getLatitude() * 1e-7, + geoCoord.getLongitude() * 1e-7); + } else if (gpsFormat == meshtastic_Config_DisplayConfig_GpsCoordinateFormat_UTM) { // Universal Transverse Mercator + snprintf(coordinateLine, sizeof(coordinateLine), "%2i%1c %06u %07u", geoCoord.getUTMZone(), geoCoord.getUTMBand(), + geoCoord.getUTMEasting(), geoCoord.getUTMNorthing()); + } else if (gpsFormat == meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MGRS) { // Military Grid Reference System + snprintf(coordinateLine, sizeof(coordinateLine), "%2i%1c %1c%1c %05u %05u", geoCoord.getMGRSZone(), + geoCoord.getMGRSBand(), geoCoord.getMGRSEast100k(), geoCoord.getMGRSNorth100k(), + geoCoord.getMGRSEasting(), geoCoord.getMGRSNorthing()); + } else if (gpsFormat == meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OLC) { // Open Location Code + geoCoord.getOLCCode(coordinateLine); + } else if (gpsFormat == meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OSGR) { // Ordnance Survey Grid Reference + if (geoCoord.getOSGRE100k() == 'I' || geoCoord.getOSGRN100k() == 'I') // OSGR is only valid around the UK region + snprintf(coordinateLine, sizeof(coordinateLine), "%s", "Out of Boundary"); + else + snprintf(coordinateLine, sizeof(coordinateLine), "%1c%1c %05u %05u", geoCoord.getOSGRE100k(), + geoCoord.getOSGRN100k(), geoCoord.getOSGREasting(), geoCoord.getOSGRNorthing()); + } + + // If fixed position, display text "Fixed GPS" alternating with the coordinates. + if (config.position.fixed_position) { + if ((millis() / 10000) % 2) { + display->drawString(x + (display->getWidth() - (display->getStringWidth(coordinateLine))) / 2, y, + coordinateLine); + } else { + display->drawString(x + (display->getWidth() - (display->getStringWidth("Fixed GPS"))) / 2, y, "Fixed GPS"); + } + } else { + display->drawString(x + (display->getWidth() - (display->getStringWidth(coordinateLine))) / 2, y, coordinateLine); + } + } else { + char latLine[22]; + char lonLine[22]; + snprintf(latLine, sizeof(latLine), "%2i° %2i' %2u\" %1c", geoCoord.getDMSLatDeg(), geoCoord.getDMSLatMin(), + geoCoord.getDMSLatSec(), geoCoord.getDMSLatCP()); + snprintf(lonLine, sizeof(lonLine), "%3i° %2i' %2u\" %1c", geoCoord.getDMSLonDeg(), geoCoord.getDMSLonMin(), + geoCoord.getDMSLonSec(), geoCoord.getDMSLonCP()); + display->drawString(x + (display->getWidth() - (display->getStringWidth(latLine))) / 2, y - FONT_HEIGHT_SMALL * 1, + latLine); + display->drawString(x + (display->getWidth() - (display->getStringWidth(lonLine))) / 2, y, lonLine); + } + } +} + +void UIRenderer::drawBattery(OLEDDisplay *display, int16_t x, int16_t y, uint8_t *imgBuffer, + const meshtastic::PowerStatus *powerStatus) +{ + static const uint8_t powerBar[3] = {0x81, 0xBD, 0xBD}; + static const uint8_t lightning[8] = {0xA1, 0xA1, 0xA5, 0xAD, 0xB5, 0xA5, 0x85, 0x85}; + + // Clear the bar area inside the battery image + for (int i = 1; i < 14; i++) { + imgBuffer[i] = 0x81; + } + + // Fill with lightning or power bars + if (powerStatus->getIsCharging()) { + memcpy(imgBuffer + 3, lightning, 8); + } else { + for (int i = 0; i < 4; i++) { + if (powerStatus->getBatteryChargePercent() >= 25 * i) + memcpy(imgBuffer + 1 + (i * 3), powerBar, 3); + } + } + + // Slightly more conservative scaling based on screen width + int scale = 1; + + if (SCREEN_WIDTH >= 200) + scale = 2; + if (SCREEN_WIDTH >= 300) + scale = 2; // Do NOT go higher than 2 + + // Draw scaled battery image (16 columns × 8 rows) + for (int col = 0; col < 16; col++) { + uint8_t colBits = imgBuffer[col]; + for (int row = 0; row < 8; row++) { + if (colBits & (1 << row)) { + display->fillRect(x + col * scale, y + row * scale, scale, scale); + } + } + } +} + +// Draw nodes status +void UIRenderer::drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::NodeStatus *nodeStatus, int node_offset, + bool show_total, String additional_words) +{ + char usersString[20]; + int nodes_online = (nodeStatus->getNumOnline() > 0) ? nodeStatus->getNumOnline() + node_offset : 0; + + snprintf(usersString, sizeof(usersString), "%d %s", nodes_online, additional_words.c_str()); + + if (show_total) { + int nodes_total = (nodeStatus->getNumTotal() > 0) ? nodeStatus->getNumTotal() + node_offset : 0; + snprintf(usersString, sizeof(usersString), "%d/%d %s", nodes_online, nodes_total, additional_words.c_str()); + } + +#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS)) && \ + !defined(DISPLAY_FORCE_SMALL_FONTS) + + if (SCREEN_WIDTH > 128) { + NodeListRenderer::drawScaledXBitmap16x16(x, y - 1, 8, 8, imgUser, display); + } else { + display->drawFastImage(x, y + 3, 8, 8, imgUser); + } +#else + if (SCREEN_WIDTH > 128) { + NodeListRenderer::drawScaledXBitmap16x16(x, y - 1, 8, 8, imgUser, display); + } else { + display->drawFastImage(x, y + 1, 8, 8, imgUser); + } +#endif + int string_offset = (SCREEN_WIDTH > 128) ? 9 : 0; + display->drawString(x + 10 + string_offset, y - 2, usersString); +} + +// ********************** +// * Favorite Node Info * +// ********************** +void UIRenderer::drawNodeInfo(OLEDDisplay *display, const OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + // --- Cache favorite nodes for the current frame only, to save computation --- + static std::vector favoritedNodes; + static int prevFrame = -1; + + // --- Only rebuild favorites list if we're on a new frame --- + if (state->currentFrame != prevFrame) { + prevFrame = state->currentFrame; + favoritedNodes.clear(); + size_t total = nodeDB->getNumMeshNodes(); + for (size_t i = 0; i < total; i++) { + meshtastic_NodeInfoLite *n = nodeDB->getMeshNodeByIndex(i); + // Skip nulls and ourself + if (!n || n->num == nodeDB->getNodeNum()) + continue; + if (n->is_favorite) + favoritedNodes.push_back(n); + } + // Keep a stable, consistent display order + std::sort(favoritedNodes.begin(), favoritedNodes.end(), + [](const meshtastic_NodeInfoLite *a, const meshtastic_NodeInfoLite *b) { return a->num < b->num; }); + } + if (favoritedNodes.empty()) + return; + + // --- Only display if index is valid --- + int nodeIndex = state->currentFrame - (screen->frameCount - favoritedNodes.size()); + if (nodeIndex < 0 || nodeIndex >= (int)favoritedNodes.size()) + return; + + meshtastic_NodeInfoLite *node = favoritedNodes[nodeIndex]; + if (!node || node->num == nodeDB->getNodeNum() || !node->is_favorite) + return; + + display->clear(); + currentFavoriteNodeNum = node->num; + // === Create the shortName and title string === + const char *shortName = (node->has_user && haveGlyphs(node->user.short_name)) ? node->user.short_name : "Node"; + char titlestr[32] = {0}; + snprintf(titlestr, sizeof(titlestr), "Fav: %s", shortName); + + // === Draw battery/time/mail header (common across screens) === + graphics::drawCommonHeader(display, x, y, titlestr); + + // ===== DYNAMIC ROW STACKING WITH YOUR MACROS ===== + // 1. Each potential info row has a macro-defined Y position (not regular increments!). + // 2. Each row is only shown if it has valid data. + // 3. Each row "moves up" if previous are empty, so there are never any blank rows. + // 4. The first line is ALWAYS at your macro position; subsequent lines use the next available macro slot. + + // List of available macro Y positions in order, from top to bottom. + int line = 1; // which slot to use next + + // === 1. Long Name (always try to show first) === + const char *username = (node->has_user && node->user.long_name[0]) ? node->user.long_name : nullptr; + if (username && line < 5) { + // Print node's long name (e.g. "Backpack Node") + display->drawString(x, getTextPositions(display)[line++], username); + } + + // === 2. Signal and Hops (combined on one line, if available) === + // If both are present: "Sig: 97% [2hops]" + // If only one: show only that one + char signalHopsStr[32] = ""; + bool haveSignal = false; + int percentSignal = clamp((int)((node->snr + 10) * 5), 0, 100); + + // Always use "Sig" for the label + const char *signalLabel = " Sig"; + + // --- Build the Signal/Hops line --- + // If SNR looks reasonable, show signal + if ((int)((node->snr + 10) * 5) >= 0 && node->snr > -100) { + snprintf(signalHopsStr, sizeof(signalHopsStr), "%s: %d%%", signalLabel, percentSignal); + haveSignal = true; + } + // If hops is valid (>0), show right after signal + if (node->hops_away > 0) { + size_t len = strlen(signalHopsStr); + // Decide between "1 Hop" and "N Hops" + if (haveSignal) { + snprintf(signalHopsStr + len, sizeof(signalHopsStr) - len, " [%d %s]", node->hops_away, + (node->hops_away == 1 ? "Hop" : "Hops")); + } else { + snprintf(signalHopsStr, sizeof(signalHopsStr), "[%d %s]", node->hops_away, (node->hops_away == 1 ? "Hop" : "Hops")); + } + } + if (signalHopsStr[0] && line < 5) { + display->drawString(x, getTextPositions(display)[line++], signalHopsStr); + } + + // === 3. Heard (last seen, skip if node never seen) === + char seenStr[20] = ""; + uint32_t seconds = sinceLastSeen(node); + if (seconds != 0 && seconds != UINT32_MAX) { + uint32_t minutes = seconds / 60, hours = minutes / 60, days = hours / 24; + // Format as "Heard: Xm ago", "Heard: Xh ago", or "Heard: Xd ago" + snprintf(seenStr, sizeof(seenStr), (days > 365 ? " Heard: ?" : " Heard: %d%c ago"), + (days ? days + : hours ? hours + : minutes), + (days ? 'd' + : hours ? 'h' + : 'm')); + } + if (seenStr[0] && line < 5) { + display->drawString(x, getTextPositions(display)[line++], seenStr); + } + + // === 4. Uptime (only show if metric is present) === + char uptimeStr[32] = ""; + if (node->has_device_metrics && node->device_metrics.has_uptime_seconds) { + uint32_t uptime = node->device_metrics.uptime_seconds; + uint32_t days = uptime / 86400; + uint32_t hours = (uptime % 86400) / 3600; + uint32_t mins = (uptime % 3600) / 60; + // Show as "Up: 2d 3h", "Up: 5h 14m", or "Up: 37m" + if (days) + snprintf(uptimeStr, sizeof(uptimeStr), " Uptime: %ud %uh", days, hours); + else if (hours) + snprintf(uptimeStr, sizeof(uptimeStr), " Uptime: %uh %um", hours, mins); + else + snprintf(uptimeStr, sizeof(uptimeStr), " Uptime: %um", mins); + } + if (uptimeStr[0] && line < 5) { + display->drawString(x, getTextPositions(display)[line++], uptimeStr); + } + + // === 5. Distance (only if both nodes have GPS position) === + meshtastic_NodeInfoLite *ourNode = nodeDB->getMeshNode(nodeDB->getNodeNum()); + char distStr[24] = ""; // Make buffer big enough for any string + bool haveDistance = false; + + if (nodeDB->hasValidPosition(ourNode) && nodeDB->hasValidPosition(node)) { + double lat1 = ourNode->position.latitude_i * 1e-7; + double lon1 = ourNode->position.longitude_i * 1e-7; + double lat2 = node->position.latitude_i * 1e-7; + double lon2 = node->position.longitude_i * 1e-7; + double earthRadiusKm = 6371.0; + double dLat = (lat2 - lat1) * DEG_TO_RAD; + double dLon = (lon2 - lon1) * DEG_TO_RAD; + double a = + sin(dLat / 2) * sin(dLat / 2) + cos(lat1 * DEG_TO_RAD) * cos(lat2 * DEG_TO_RAD) * sin(dLon / 2) * sin(dLon / 2); + double c = 2 * atan2(sqrt(a), sqrt(1 - a)); + double distanceKm = earthRadiusKm * c; + + if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) { + double miles = distanceKm * 0.621371; + if (miles < 0.1) { + int feet = (int)(miles * 5280); + if (feet > 0 && feet < 1000) { + snprintf(distStr, sizeof(distStr), " Distance: %dft", feet); + haveDistance = true; + } else if (feet >= 1000) { + snprintf(distStr, sizeof(distStr), " Distance: ¼mi"); + haveDistance = true; + } + } else { + int roundedMiles = (int)(miles + 0.5); + if (roundedMiles > 0 && roundedMiles < 1000) { + snprintf(distStr, sizeof(distStr), " Distance: %dmi", roundedMiles); + haveDistance = true; + } + } + } else { + if (distanceKm < 1.0) { + int meters = (int)(distanceKm * 1000); + if (meters > 0 && meters < 1000) { + snprintf(distStr, sizeof(distStr), " Distance: %dm", meters); + haveDistance = true; + } else if (meters >= 1000) { + snprintf(distStr, sizeof(distStr), " Distance: 1km"); + haveDistance = true; + } + } else { + int km = (int)(distanceKm + 0.5); + if (km > 0 && km < 1000) { + snprintf(distStr, sizeof(distStr), " Distance: %dkm", km); + haveDistance = true; + } + } + } + } + // Only display if we actually have a value! + if (haveDistance && distStr[0] && line < 5) { + display->drawString(x, getTextPositions(display)[line++], distStr); + } + + // --- Compass Rendering: landscape (wide) screens use the original side-aligned logic --- + if (SCREEN_WIDTH > SCREEN_HEIGHT) { + bool showCompass = false; + if (ourNode && (nodeDB->hasValidPosition(ourNode) || screen->hasHeading()) && nodeDB->hasValidPosition(node)) { + showCompass = true; + } + if (showCompass) { + const int16_t topY = getTextPositions(display)[1]; + const int16_t bottomY = SCREEN_HEIGHT - (FONT_HEIGHT_SMALL - 1); + const int16_t usableHeight = bottomY - topY - 5; + int16_t compassRadius = usableHeight / 2; + if (compassRadius < 8) + compassRadius = 8; + const int16_t compassDiam = compassRadius * 2; + const int16_t compassX = x + SCREEN_WIDTH - compassRadius - 8; + const int16_t compassY = topY + (usableHeight / 2) + ((FONT_HEIGHT_SMALL - 1) / 2) + 2; + + const auto &op = ourNode->position; + float myHeading = screen->hasHeading() ? screen->getHeading() * PI / 180 + : screen->estimatedHeading(DegD(op.latitude_i), DegD(op.longitude_i)); + + const auto &p = node->position; + /* unused + float d = + GeoCoord::latLongToMeter(DegD(p.latitude_i), DegD(p.longitude_i), DegD(op.latitude_i), DegD(op.longitude_i)); + */ + float bearing = GeoCoord::bearing(DegD(op.latitude_i), DegD(op.longitude_i), DegD(p.latitude_i), DegD(p.longitude_i)); + if (!config.display.compass_north_top) + bearing -= myHeading; + + display->drawCircle(compassX, compassY, compassRadius); + CompassRenderer::drawCompassNorth(display, compassX, compassY, myHeading, compassRadius); + CompassRenderer::drawNodeHeading(display, compassX, compassY, compassDiam, bearing); + } + // else show nothing + } else { + // Portrait or square: put compass at the bottom and centered, scaled to fit available space + bool showCompass = false; + if (ourNode && (nodeDB->hasValidPosition(ourNode) || screen->hasHeading()) && nodeDB->hasValidPosition(node)) { + showCompass = true; + } + if (showCompass) { + int yBelowContent = (line > 0 && line <= 5) ? (getTextPositions(display)[line - 1] + FONT_HEIGHT_SMALL + 2) + : getTextPositions(display)[1]; + const int margin = 4; +// --------- PATCH FOR EINK NAV BAR (ONLY CHANGE BELOW) ----------- +#if defined(USE_EINK) + const int iconSize = (SCREEN_WIDTH > 128) ? 16 : 8; + const int navBarHeight = iconSize + 6; +#else + const int navBarHeight = 0; +#endif + int availableHeight = SCREEN_HEIGHT - yBelowContent - navBarHeight - margin; + // --------- END PATCH FOR EINK NAV BAR ----------- + + if (availableHeight < FONT_HEIGHT_SMALL * 2) + return; + + int compassRadius = availableHeight / 2; + if (compassRadius < 8) + compassRadius = 8; + if (compassRadius * 2 > SCREEN_WIDTH - 16) + compassRadius = (SCREEN_WIDTH - 16) / 2; + + int compassX = x + SCREEN_WIDTH / 2; + int compassY = yBelowContent + availableHeight / 2; + + const auto &op = ourNode->position; + float myHeading = screen->hasHeading() ? screen->getHeading() * PI / 180 + : screen->estimatedHeading(DegD(op.latitude_i), DegD(op.longitude_i)); + graphics::CompassRenderer::drawCompassNorth(display, compassX, compassY, myHeading, compassRadius); + + const auto &p = node->position; + /* unused + float d = + GeoCoord::latLongToMeter(DegD(p.latitude_i), DegD(p.longitude_i), DegD(op.latitude_i), DegD(op.longitude_i)); + */ + float bearing = GeoCoord::bearing(DegD(op.latitude_i), DegD(op.longitude_i), DegD(p.latitude_i), DegD(p.longitude_i)); + if (!config.display.compass_north_top) + bearing -= myHeading; + graphics::CompassRenderer::drawNodeHeading(display, compassX, compassY, compassRadius * 2, bearing); + + display->drawCircle(compassX, compassY, compassRadius); + } + // else show nothing + } +} + +// **************************** +// * Device Focused Screen * +// **************************** +void UIRenderer::drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + display->clear(); + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + int line = 1; + + // === Header === + graphics::drawCommonHeader(display, x, y, ""); + + // === Content below header === + + // Determine if we need to show 4 or 5 rows on the screen + int rows = 4; + if (!config.bluetooth.enabled) { + rows = 5; + } + + // === First Row: Region / Channel Utilization and Uptime === + bool origBold = config.display.heading_bold; + config.display.heading_bold = false; + + // Display Region and Channel Utilization + drawNodes(display, x + 1, getTextPositions(display)[line] + 2, nodeStatus, -1, false, "online"); + + char uptimeStr[32] = ""; + uint32_t uptime = millis() / 1000; + uint32_t days = uptime / 86400; + uint32_t hours = (uptime % 86400) / 3600; + uint32_t mins = (uptime % 3600) / 60; + // Show as "Up: 2d 3h", "Up: 5h 14m", or "Up: 37m" + if (days) + snprintf(uptimeStr, sizeof(uptimeStr), "Up: %ud %uh", days, hours); + else if (hours) + snprintf(uptimeStr, sizeof(uptimeStr), "Up: %uh %um", hours, mins); + else + snprintf(uptimeStr, sizeof(uptimeStr), "Up: %um", mins); + display->drawString(SCREEN_WIDTH - display->getStringWidth(uptimeStr), getTextPositions(display)[line++], uptimeStr); + + // === Second Row: Satellites and Voltage === + config.display.heading_bold = false; + +#if HAS_GPS + if (config.position.gps_mode != meshtastic_Config_PositionConfig_GpsMode_ENABLED) { + const char *displayLine; + if (config.position.fixed_position) { + displayLine = "Fixed GPS"; + } else { + displayLine = config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT ? "No GPS" : "GPS off"; + } + int yOffset = (SCREEN_WIDTH > 128) ? 3 : 1; + if (SCREEN_WIDTH > 128) { + NodeListRenderer::drawScaledXBitmap16x16(x, getTextPositions(display)[line] + yOffset - 5, imgSatellite_width, + imgSatellite_height, imgSatellite, display); + } else { + display->drawXbm(x + 1, getTextPositions(display)[line] + yOffset, imgSatellite_width, imgSatellite_height, + imgSatellite); + } + int xOffset = (SCREEN_WIDTH > 128) ? 6 : 0; + display->drawString(x + 11 + xOffset, getTextPositions(display)[line], displayLine); + } else { + UIRenderer::drawGps(display, 0, getTextPositions(display)[line], gpsStatus); + } +#endif + + if (powerStatus->getHasBattery()) { + char batStr[20]; + int batV = powerStatus->getBatteryVoltageMv() / 1000; + int batCv = (powerStatus->getBatteryVoltageMv() % 1000) / 10; + snprintf(batStr, sizeof(batStr), "%01d.%02dV", batV, batCv); + display->drawString(x + SCREEN_WIDTH - display->getStringWidth(batStr), getTextPositions(display)[line++], batStr); + } else { + display->drawString(x + SCREEN_WIDTH - display->getStringWidth("USB"), getTextPositions(display)[line++], "USB"); + } + + config.display.heading_bold = origBold; + + // === Third Row: Channel Utilization Bluetooth Off (Only If Actually Off) === + const char *chUtil = "ChUtil:"; + char chUtilPercentage[10]; + snprintf(chUtilPercentage, sizeof(chUtilPercentage), "%2.0f%%", airTime->channelUtilizationPercent()); + + int chUtil_x = (SCREEN_WIDTH > 128) ? display->getStringWidth(chUtil) + 10 : display->getStringWidth(chUtil) + 5; + int chUtil_y = getTextPositions(display)[line] + 3; + + int chutil_bar_width = (SCREEN_WIDTH > 128) ? 100 : 50; + if (!config.bluetooth.enabled) { + chutil_bar_width = (SCREEN_WIDTH > 128) ? 80 : 40; + } + int chutil_bar_height = (SCREEN_WIDTH > 128) ? 12 : 7; + int extraoffset = (SCREEN_WIDTH > 128) ? 6 : 3; + if (!config.bluetooth.enabled) { + extraoffset = (SCREEN_WIDTH > 128) ? 6 : 1; + } + int chutil_percent = airTime->channelUtilizationPercent(); + + int centerofscreen = SCREEN_WIDTH / 2; + int total_line_content_width = (chUtil_x + chutil_bar_width + display->getStringWidth(chUtilPercentage) + extraoffset) / 2; + int starting_position = centerofscreen - total_line_content_width; + if (!config.bluetooth.enabled) { + starting_position = 0; + } + + display->drawString(starting_position, getTextPositions(display)[line], chUtil); + + // Force 56% or higher to show a full 100% bar, text would still show related percent. + if (chutil_percent >= 61) { + chutil_percent = 100; + } + + // Weighting for nonlinear segments + float milestone1 = 25; + float milestone2 = 40; + float weight1 = 0.45; // Weight for 0–25% + float weight2 = 0.35; // Weight for 25–40% + float weight3 = 0.20; // Weight for 40–100% + float totalWeight = weight1 + weight2 + weight3; + + int seg1 = chutil_bar_width * (weight1 / totalWeight); + int seg2 = chutil_bar_width * (weight2 / totalWeight); + int seg3 = chutil_bar_width * (weight3 / totalWeight); + + int fillRight = 0; + + if (chutil_percent <= milestone1) { + fillRight = (seg1 * (chutil_percent / milestone1)); + } else if (chutil_percent <= milestone2) { + fillRight = seg1 + (seg2 * ((chutil_percent - milestone1) / (milestone2 - milestone1))); + } else { + fillRight = seg1 + seg2 + (seg3 * ((chutil_percent - milestone2) / (100 - milestone2))); + } + + // Draw outline + display->drawRect(starting_position + chUtil_x, chUtil_y, chutil_bar_width, chutil_bar_height); + + // Fill progress + if (fillRight > 0) { + display->fillRect(starting_position + chUtil_x, chUtil_y, fillRight, chutil_bar_height); + } + + display->drawString(starting_position + chUtil_x + chutil_bar_width + extraoffset, getTextPositions(display)[line], + chUtilPercentage); + + if (!config.bluetooth.enabled) { + display->drawString(SCREEN_WIDTH - display->getStringWidth("BT off"), getTextPositions(display)[line], "BT off"); + } + + line += 1; + + // === Fourth & Fifth Rows: Node Identity === + int textWidth = 0; + int nameX = 0; + int yOffset = (SCREEN_WIDTH > 128) ? 0 : 5; + const char *longName = nullptr; + meshtastic_NodeInfoLite *ourNode = nodeDB->getMeshNode(nodeDB->getNodeNum()); + if (ourNode && ourNode->has_user && strlen(ourNode->user.long_name) > 0) { + longName = ourNode->user.long_name; + } + uint8_t dmac[6]; + char shortnameble[35]; + getMacAddr(dmac); + snprintf(screen->ourId, sizeof(screen->ourId), "%02x%02x", dmac[4], dmac[5]); + snprintf(shortnameble, sizeof(shortnameble), "%s", + graphics::UIRenderer::haveGlyphs(owner.short_name) ? owner.short_name : ""); + + char combinedName[50]; + snprintf(combinedName, sizeof(combinedName), "%s (%s)", longName, shortnameble); + if (SCREEN_WIDTH - (display->getStringWidth(longName) + display->getStringWidth(shortnameble)) > 10) { + size_t len = strlen(combinedName); + if (len >= 3 && strcmp(combinedName + len - 3, " ()") == 0) { + combinedName[len - 3] = '\0'; // Remove the last three characters + } + textWidth = display->getStringWidth(combinedName); + nameX = (SCREEN_WIDTH - textWidth) / 2; + display->drawString( + nameX, ((rows == 4) ? getTextPositions(display)[line++] : getTextPositions(display)[line++]) + yOffset, combinedName); + } else { + // === LongName Centered === + textWidth = display->getStringWidth(longName); + nameX = (SCREEN_WIDTH - textWidth) / 2; + display->drawString(nameX, getTextPositions(display)[line++], longName); + + // === ShortName Centered === + textWidth = display->getStringWidth(shortnameble); + nameX = (SCREEN_WIDTH - textWidth) / 2; + display->drawString(nameX, getTextPositions(display)[line++], shortnameble); + } +} + +// Start Functions to write date/time to the screen +// Helper function to check if a year is a leap year +bool isLeapYear(int year) +{ + return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); +} + +// Array of days in each month (non-leap year) +const int daysInMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + +// Fills the buffer with a formatted date/time string and returns pixel width +int UIRenderer::formatDateTime(char *buf, size_t bufSize, uint32_t rtc_sec, OLEDDisplay *display, bool includeTime) +{ + int sec = rtc_sec % 60; + rtc_sec /= 60; + int min = rtc_sec % 60; + rtc_sec /= 60; + int hour = rtc_sec % 24; + rtc_sec /= 24; + + int year = 1970; + while (true) { + int daysInYear = isLeapYear(year) ? 366 : 365; + if (rtc_sec >= (uint32_t)daysInYear) { + rtc_sec -= daysInYear; + year++; + } else { + break; + } + } + + int month = 0; + while (month < 12) { + int dim = daysInMonth[month]; + if (month == 1 && isLeapYear(year)) + dim++; + if (rtc_sec >= (uint32_t)dim) { + rtc_sec -= dim; + month++; + } else { + break; + } + } + + int day = rtc_sec + 1; + + if (includeTime) { + snprintf(buf, bufSize, "%04d-%02d-%02d %02d:%02d:%02d", year, month + 1, day, hour, min, sec); + } else { + snprintf(buf, bufSize, "%04d-%02d-%02d", year, month + 1, day); + } + + return display->getStringWidth(buf); +} + +// Check if the display can render a string (detect special chars; emoji) +bool UIRenderer::haveGlyphs(const char *str) +{ +#if defined(OLED_PL) || defined(OLED_UA) || defined(OLED_RU) || defined(OLED_CS) + // Don't want to make any assumptions about custom language support + return true; +#endif + + // Check each character with the lookup function for the OLED library + // We're not really meant to use this directly.. + bool have = true; + for (uint16_t i = 0; i < strlen(str); i++) { + uint8_t result = Screen::customFontTableLookup((uint8_t)str[i]); + // If font doesn't support a character, it is substituted for ¿ + if (result == 191 && (uint8_t)str[i] != 191) { + have = false; + break; + } + } + + // LOG_DEBUG("haveGlyphs=%d", have); + return have; +} + +#ifdef USE_EINK +/// Used on eink displays while in deep sleep +void UIRenderer::drawDeepSleepFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + + // Next frame should use full-refresh, and block while running, else device will sleep before async callback + EINK_ADD_FRAMEFLAG(display, COSMETIC); + EINK_ADD_FRAMEFLAG(display, BLOCKING); + + LOG_DEBUG("Draw deep sleep screen"); + + // Display displayStr on the screen + graphics::UIRenderer::drawIconScreen("Sleeping", display, state, x, y); +} + +/// Used on eink displays when screen updates are paused +void UIRenderer::drawScreensaverOverlay(OLEDDisplay *display, OLEDDisplayUiState *state) +{ + LOG_DEBUG("Draw screensaver overlay"); + + EINK_ADD_FRAMEFLAG(display, COSMETIC); // Take the opportunity for a full-refresh + + // Config + display->setFont(FONT_SMALL); + display->setTextAlignment(TEXT_ALIGN_LEFT); + const char *pauseText = "Screen Paused"; + const char *idText = owner.short_name; + const bool useId = haveGlyphs(idText); // This bool is used to hide the idText box if we can't render the short name + constexpr uint16_t padding = 5; + constexpr uint8_t dividerGap = 1; + constexpr uint8_t imprecision = 5; // How far the box origins can drift from center. Combat burn-in. + + // Dimensions + const uint16_t idTextWidth = display->getStringWidth(idText, strlen(idText), true); // "true": handle utf8 chars + const uint16_t pauseTextWidth = display->getStringWidth(pauseText, strlen(pauseText)); + const uint16_t boxWidth = padding + (useId ? idTextWidth + padding + padding : 0) + pauseTextWidth + padding; + const uint16_t boxHeight = padding + FONT_HEIGHT_SMALL + padding; + + // Position + const int16_t boxLeft = (display->width() / 2) - (boxWidth / 2) + random(-imprecision, imprecision + 1); + // const int16_t boxRight = boxLeft + boxWidth - 1; + const int16_t boxTop = (display->height() / 2) - (boxHeight / 2 + random(-imprecision, imprecision + 1)); + const int16_t boxBottom = boxTop + boxHeight - 1; + const int16_t idTextLeft = boxLeft + padding; + const int16_t idTextTop = boxTop + padding; + const int16_t pauseTextLeft = boxLeft + (useId ? padding + idTextWidth + padding : 0) + padding; + const int16_t pauseTextTop = boxTop + padding; + const int16_t dividerX = boxLeft + padding + idTextWidth + padding; + const int16_t dividerTop = boxTop + 1 + dividerGap; + const int16_t dividerBottom = boxBottom - 1 - dividerGap; + + // Draw: box + display->setColor(EINK_WHITE); + display->fillRect(boxLeft - 1, boxTop - 1, boxWidth + 2, boxHeight + 2); // Clear a slightly oversized area for the box + display->setColor(EINK_BLACK); + display->drawRect(boxLeft, boxTop, boxWidth, boxHeight); + + // Draw: Text + if (useId) + display->drawString(idTextLeft, idTextTop, idText); + display->drawString(pauseTextLeft, pauseTextTop, pauseText); + display->drawString(pauseTextLeft + 1, pauseTextTop, pauseText); // Faux bold + + // Draw: divider + if (useId) + display->drawLine(dividerX, dividerTop, dividerX, dividerBottom); +} +#endif + +/** + * Draw the icon with extra info printed around the corners + */ +void UIRenderer::drawIconScreen(const char *upperMsg, OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + // draw an xbm image. + // Please note that everything that should be transitioned + // needs to be drawn relative to x and y + + // draw centered icon left to right and centered above the one line of app text + display->drawXbm(x + (SCREEN_WIDTH - icon_width) / 2, y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - icon_height) / 2 + 2, + icon_width, icon_height, icon_bits); + + display->setFont(FONT_MEDIUM); + display->setTextAlignment(TEXT_ALIGN_LEFT); + const char *title = "meshtastic.org"; + display->drawString(x + getStringCenteredX(title), y + SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM, title); + display->setFont(FONT_SMALL); + + // Draw region in upper left + if (upperMsg) + display->drawString(x + 0, y + 0, upperMsg); + + // Draw version and short name in upper right + char buf[25]; + snprintf(buf, sizeof(buf), "%s\n%s", xstr(APP_VERSION_SHORT), + graphics::UIRenderer::haveGlyphs(owner.short_name) ? owner.short_name : ""); + + display->setTextAlignment(TEXT_ALIGN_RIGHT); + display->drawString(x + SCREEN_WIDTH, y + 0, buf); + screen->forceDisplay(); + + display->setTextAlignment(TEXT_ALIGN_LEFT); // Restore left align, just to be kind to any other unsuspecting code +} + +// **************************** +// * My Position Screen * +// **************************** +void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + display->clear(); + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + int line = 1; + + // === Set Title + const char *titleStr = "Position"; + + // === Header === + graphics::drawCommonHeader(display, x, y, titleStr); + + // === First Row: My Location === +#if HAS_GPS + bool origBold = config.display.heading_bold; + config.display.heading_bold = false; + + const char *displayLine = ""; // Initialize to empty string by default + if (config.position.gps_mode != meshtastic_Config_PositionConfig_GpsMode_ENABLED) { + if (config.position.fixed_position) { + displayLine = "Fixed GPS"; + } else { + displayLine = config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT ? "No GPS" : "GPS off"; + } + int yOffset = (SCREEN_WIDTH > 128) ? 3 : 1; + if (SCREEN_WIDTH > 128) { + NodeListRenderer::drawScaledXBitmap16x16(x, getTextPositions(display)[line] + yOffset - 5, imgSatellite_width, + imgSatellite_height, imgSatellite, display); + } else { + display->drawXbm(x + 1, getTextPositions(display)[line] + yOffset, imgSatellite_width, imgSatellite_height, + imgSatellite); + } + int xOffset = (SCREEN_WIDTH > 128) ? 6 : 0; + display->drawString(x + 11 + xOffset, getTextPositions(display)[line++], displayLine); + } else { + UIRenderer::drawGps(display, 0, getTextPositions(display)[line++], gpsStatus); + } + + config.display.heading_bold = origBold; + + // === Update GeoCoord === + geoCoord.updateCoords(int32_t(gpsStatus->getLatitude()), int32_t(gpsStatus->getLongitude()), + int32_t(gpsStatus->getAltitude())); + + // === Determine Compass Heading === + float heading; + bool validHeading = false; + + if (screen->hasHeading()) { + heading = radians(screen->getHeading()); + validHeading = true; + } else { + heading = screen->estimatedHeading(geoCoord.getLatitude() * 1e-7, geoCoord.getLongitude() * 1e-7); + validHeading = !isnan(heading); + } + + // If GPS is off, no need to display these parts + if (strcmp(displayLine, "GPS off") != 0 && strcmp(displayLine, "No GPS") != 0) { + + // === Second Row: Date === + uint32_t rtc_sec = getValidTime(RTCQuality::RTCQualityDevice, true); + char datetimeStr[25]; + bool showTime = false; // set to true for full datetime + UIRenderer::formatDateTime(datetimeStr, sizeof(datetimeStr), rtc_sec, display, showTime); + char fullLine[40]; + snprintf(fullLine, sizeof(fullLine), " Date: %s", datetimeStr); + display->drawString(0, getTextPositions(display)[line++], fullLine); + + // === Third Row: Latitude === + char latStr[32]; + snprintf(latStr, sizeof(latStr), " Lat: %.5f", geoCoord.getLatitude() * 1e-7); + display->drawString(x, getTextPositions(display)[line++], latStr); + + // === Fourth Row: Longitude === + char lonStr[32]; + snprintf(lonStr, sizeof(lonStr), " Lon: %.5f", geoCoord.getLongitude() * 1e-7); + display->drawString(x, getTextPositions(display)[line++], lonStr); + + // === Fifth Row: Altitude === + char DisplayLineTwo[32] = {0}; + if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) { + snprintf(DisplayLineTwo, sizeof(DisplayLineTwo), " Alt: %.0fft", geoCoord.getAltitude() * METERS_TO_FEET); + } else { + snprintf(DisplayLineTwo, sizeof(DisplayLineTwo), " Alt: %.0im", geoCoord.getAltitude()); + } + display->drawString(x, getTextPositions(display)[line++], DisplayLineTwo); + } + + // === Draw Compass if heading is valid === + if (validHeading) { + // --- Compass Rendering: landscape (wide) screens use original side-aligned logic --- + if (SCREEN_WIDTH > SCREEN_HEIGHT) { + const int16_t topY = getTextPositions(display)[1]; + const int16_t bottomY = SCREEN_HEIGHT - (FONT_HEIGHT_SMALL - 1); // nav row height + const int16_t usableHeight = bottomY - topY - 5; + + int16_t compassRadius = usableHeight / 2; + if (compassRadius < 8) + compassRadius = 8; + const int16_t compassDiam = compassRadius * 2; + const int16_t compassX = x + SCREEN_WIDTH - compassRadius - 8; + + // Center vertically and nudge down slightly to keep "N" clear of header + const int16_t compassY = topY + (usableHeight / 2) + ((FONT_HEIGHT_SMALL - 1) / 2) + 2; + + CompassRenderer::drawNodeHeading(display, compassX, compassY, compassDiam, -heading); + display->drawCircle(compassX, compassY, compassRadius); + + // "N" label + float northAngle = -heading; + float radius = compassRadius; + int16_t nX = compassX + (radius - 1) * sin(northAngle); + int16_t nY = compassY - (radius - 1) * cos(northAngle); + int16_t nLabelWidth = display->getStringWidth("N") + 2; + int16_t nLabelHeightBox = FONT_HEIGHT_SMALL + 1; + + display->setColor(BLACK); + display->fillRect(nX - nLabelWidth / 2, nY - nLabelHeightBox / 2, nLabelWidth, nLabelHeightBox); + display->setColor(WHITE); + display->setFont(FONT_SMALL); + display->setTextAlignment(TEXT_ALIGN_CENTER); + display->drawString(nX, nY - FONT_HEIGHT_SMALL / 2, "N"); + } else { + // Portrait or square: put compass at the bottom and centered, scaled to fit available space + // For E-Ink screens, account for navigation bar at the bottom! + int yBelowContent = getTextPositions(display)[5] + FONT_HEIGHT_SMALL + 2; + const int margin = 4; + int availableHeight = +#if defined(USE_EINK) + SCREEN_HEIGHT - yBelowContent - 24; // Leave extra space for nav bar on E-Ink +#else + SCREEN_HEIGHT - yBelowContent - margin; +#endif + + if (availableHeight < FONT_HEIGHT_SMALL * 2) + return; + + int compassRadius = availableHeight / 2; + if (compassRadius < 8) + compassRadius = 8; + if (compassRadius * 2 > SCREEN_WIDTH - 16) + compassRadius = (SCREEN_WIDTH - 16) / 2; + + int compassX = x + SCREEN_WIDTH / 2; + int compassY = yBelowContent + availableHeight / 2; + + CompassRenderer::drawNodeHeading(display, compassX, compassY, compassRadius * 2, -heading); + display->drawCircle(compassX, compassY, compassRadius); + + // "N" label + float northAngle = -heading; + float radius = compassRadius; + int16_t nX = compassX + (radius - 1) * sin(northAngle); + int16_t nY = compassY - (radius - 1) * cos(northAngle); + int16_t nLabelWidth = display->getStringWidth("N") + 2; + int16_t nLabelHeightBox = FONT_HEIGHT_SMALL + 1; + + display->setColor(BLACK); + display->fillRect(nX - nLabelWidth / 2, nY - nLabelHeightBox / 2, nLabelWidth, nLabelHeightBox); + display->setColor(WHITE); + display->setFont(FONT_SMALL); + display->setTextAlignment(TEXT_ALIGN_CENTER); + display->drawString(nX, nY - FONT_HEIGHT_SMALL / 2, "N"); + } + } +#endif +} + +#ifdef USERPREFS_OEM_TEXT + +void UIRenderer::drawOEMIconScreen(const char *upperMsg, OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + static const uint8_t xbm[] = USERPREFS_OEM_IMAGE_DATA; + display->drawXbm(x + (SCREEN_WIDTH - USERPREFS_OEM_IMAGE_WIDTH) / 2, + y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - USERPREFS_OEM_IMAGE_HEIGHT) / 2 + 2, USERPREFS_OEM_IMAGE_WIDTH, + USERPREFS_OEM_IMAGE_HEIGHT, xbm); + + switch (USERPREFS_OEM_FONT_SIZE) { + case 0: + display->setFont(FONT_SMALL); + break; + case 2: + display->setFont(FONT_LARGE); + break; + default: + display->setFont(FONT_MEDIUM); + break; + } + + display->setTextAlignment(TEXT_ALIGN_LEFT); + const char *title = USERPREFS_OEM_TEXT; + display->drawString(x + getStringCenteredX(title), y + SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM, title); + display->setFont(FONT_SMALL); + + // Draw region in upper left + if (upperMsg) + display->drawString(x + 0, y + 0, upperMsg); + + // Draw version and shortname in upper right + char buf[25]; + snprintf(buf, sizeof(buf), "%s\n%s", xstr(APP_VERSION_SHORT), haveGlyphs(owner.short_name) ? owner.short_name : ""); + + display->setTextAlignment(TEXT_ALIGN_RIGHT); + display->drawString(x + SCREEN_WIDTH, y + 0, buf); + screen->forceDisplay(); + + display->setTextAlignment(TEXT_ALIGN_LEFT); // Restore left align, just to be kind to any other unsuspecting code +} + +void UIRenderer::drawOEMBootScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + // Draw region in upper left + const char *region = myRegion ? myRegion->name : NULL; + drawOEMIconScreen(region, display, state, x, y); +} + +#endif + +// Function overlay for showing mute/buzzer modifiers etc. +void UIRenderer::drawFunctionOverlay(OLEDDisplay *display, OLEDDisplayUiState *state) +{ + // LOG_DEBUG("Draw function overlay"); + if (functionSymbol.begin() != functionSymbol.end()) { + char buf[64]; + display->setFont(FONT_SMALL); + snprintf(buf, sizeof(buf), "%s", functionSymbolString.c_str()); + display->drawString(SCREEN_WIDTH - display->getStringWidth(buf), SCREEN_HEIGHT - FONT_HEIGHT_SMALL, buf); + } +} + +// Navigation bar overlay implementation +static int8_t lastFrameIndex = -1; +static uint32_t lastFrameChangeTime = 0; +constexpr uint32_t ICON_DISPLAY_DURATION_MS = 2000; + +void UIRenderer::drawNavigationBar(OLEDDisplay *display, OLEDDisplayUiState *state) +{ + int currentFrame = state->currentFrame; + + // Detect frame change and record time + if (currentFrame != lastFrameIndex) { + lastFrameIndex = currentFrame; + lastFrameChangeTime = millis(); + } + + const bool useBigIcons = (SCREEN_WIDTH > 128); + const int iconSize = useBigIcons ? 16 : 8; + const int spacing = useBigIcons ? 8 : 4; + const int bigOffset = useBigIcons ? 1 : 0; + + const size_t totalIcons = screen->indicatorIcons.size(); + if (totalIcons == 0) + return; + + const size_t iconsPerPage = (SCREEN_WIDTH + spacing) / (iconSize + spacing); + const size_t currentPage = currentFrame / iconsPerPage; + const size_t pageStart = currentPage * iconsPerPage; + const size_t pageEnd = min(pageStart + iconsPerPage, totalIcons); + + const int totalWidth = (pageEnd - pageStart) * iconSize + (pageEnd - pageStart - 1) * spacing; + const int xStart = (SCREEN_WIDTH - totalWidth) / 2; + + // Only show bar briefly after switching frames (unless on E-Ink) +#if defined(USE_EINK) + int y = SCREEN_HEIGHT - iconSize - 1; +#else + int y = SCREEN_HEIGHT - iconSize - 1; + if (millis() - lastFrameChangeTime > ICON_DISPLAY_DURATION_MS) { + y = SCREEN_HEIGHT; + } +#endif + + // Pre-calculate bounding rect + const int rectX = xStart - 2 - bigOffset; + const int rectWidth = totalWidth + 4 + (bigOffset * 2); + const int rectHeight = iconSize + 6; + + // Clear background and draw border + display->setColor(BLACK); + display->fillRect(rectX + 1, y - 2, rectWidth - 2, rectHeight - 2); + display->setColor(WHITE); + display->drawRect(rectX, y - 2, rectWidth, rectHeight); + + // Icon drawing loop for the current page + for (size_t i = pageStart; i < pageEnd; ++i) { + const uint8_t *icon = screen->indicatorIcons[i]; + const int x = xStart + (i - pageStart) * (iconSize + spacing); + const bool isActive = (i == static_cast(currentFrame)); + + if (isActive) { + display->setColor(WHITE); + display->fillRect(x - 2, y - 2, iconSize + 4, iconSize + 4); + display->setColor(BLACK); + } + + if (useBigIcons) { + NodeListRenderer::drawScaledXBitmap16x16(x, y, 8, 8, icon, display); + } else { + display->drawXbm(x, y, iconSize, iconSize, icon); + } + + if (isActive) { + display->setColor(WHITE); + } + } + + // Knock the corners off the square + display->setColor(BLACK); + display->drawRect(rectX, y - 2, 1, 1); + display->drawRect(rectX + rectWidth - 1, y - 2, 1, 1); + display->setColor(WHITE); +} + +void UIRenderer::drawFrameText(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y, const char *message) +{ + uint16_t x_offset = display->width() / 2; + display->setTextAlignment(TEXT_ALIGN_CENTER); + display->setFont(FONT_MEDIUM); + display->drawString(x_offset + x, 26 + y, message); +} + +std::string UIRenderer::drawTimeDelta(uint32_t days, uint32_t hours, uint32_t minutes, uint32_t seconds) +{ + std::string uptime; + + if (days > (HOURS_IN_MONTH * 6)) + uptime = "?"; + else if (days >= 2) + uptime = std::to_string(days) + "d"; + else if (hours >= 2) + uptime = std::to_string(hours) + "h"; + else if (minutes >= 1) + uptime = std::to_string(minutes) + "m"; + else + uptime = std::to_string(seconds) + "s"; + return uptime; +} + +} // namespace graphics + +#endif // !MESHTASTIC_EXCLUDE_GPS +#endif // HAS_SCREEN \ No newline at end of file diff --git a/src/graphics/draw/UIRenderer.h b/src/graphics/draw/UIRenderer.h new file mode 100644 index 000000000..21e4aef61 --- /dev/null +++ b/src/graphics/draw/UIRenderer.h @@ -0,0 +1,93 @@ +#pragma once + +#include "graphics/Screen.h" +#include "graphics/emotes.h" +#include +#include +#include + +#define HOURS_IN_MONTH 730 + +// Forward declarations for status types +namespace meshtastic +{ +class PowerStatus; +class NodeStatus; +class GPSStatus; +} // namespace meshtastic + +namespace graphics +{ + +/// Forward declarations +class Screen; + +/** + * @brief UI utility drawing functions + * + * Contains utility functions for drawing common UI elements, overlays, + * battery indicators, and other shared graphical components. + */ +class UIRenderer +{ + public: + // Common UI elements + static void drawBattery(OLEDDisplay *display, int16_t x, int16_t y, uint8_t *imgBuffer, + const meshtastic::PowerStatus *powerStatus); + static void drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::NodeStatus *nodeStatus, + int node_offset = 0, bool show_total = true, String additional_words = ""); + + // GPS status functions + static void drawGps(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::GPSStatus *gpsStatus); + static void drawGpsCoordinates(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::GPSStatus *gpsStatus); + static void drawGpsAltitude(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::GPSStatus *gpsStatus); + static void drawGpsPowerStatus(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::GPSStatus *gpsStatus); + + // Layout and utility functions + static void drawScrollbar(OLEDDisplay *display, int visibleItems, int totalItems, int scrollIndex, int x, int startY); + + // Overlay and special screens + static void drawFrameText(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y, const char *text); + + // Function overlay for showing mute/buzzer modifiers etc. + static void drawFunctionOverlay(OLEDDisplay *display, OLEDDisplayUiState *state); + + // Navigation bar overlay + static void drawNavigationBar(OLEDDisplay *display, OLEDDisplayUiState *state); + + static void drawNodeInfo(OLEDDisplay *display, const OLEDDisplayUiState *state, int16_t x, int16_t y); + + static void drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + + // Icon and screen drawing functions + static void drawIconScreen(const char *upperMsg, OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + + // Compass and location screen + static void drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + + static NodeNum currentFavoriteNodeNum; + +// OEM screens +#ifdef USERPREFS_OEM_TEXT + static void drawOEMIconScreen(const char *upperMsg, OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + static void drawOEMBootScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); +#endif + +#ifdef USE_EINK + /// Used on eink displays while in deep sleep + static void drawDeepSleepFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + + /// Used on eink displays when screen updates are paused + static void drawScreensaverOverlay(OLEDDisplay *display, OLEDDisplayUiState *state); +#endif + + static std::string drawTimeDelta(uint32_t days, uint32_t hours, uint32_t minutes, uint32_t seconds); + static int formatDateTime(char *buffer, size_t bufferSize, uint32_t rtc_sec, OLEDDisplay *display, bool showTime); + + // Message filtering + static bool shouldDrawMessage(const meshtastic_MeshPacket *packet); + // Check if the display can render a string (detect special chars; emoji) + static bool haveGlyphs(const char *str); +}; // namespace UIRenderer + +} // namespace graphics diff --git a/src/graphics/emotes.cpp b/src/graphics/emotes.cpp new file mode 100644 index 000000000..205d5c660 --- /dev/null +++ b/src/graphics/emotes.cpp @@ -0,0 +1,225 @@ +#include "emotes.h" + +namespace graphics +{ + +// Always define Emote list and count +const Emote emotes[] = { +#ifndef EXCLUDE_EMOJI + // --- Thumbs --- + {"\U0001F44D", thumbup, thumbs_width, thumbs_height}, // 👍 Thumbs Up + {"\U0001F44E", thumbdown, thumbs_width, thumbs_height}, // 👎 Thumbs Down + + // --- Smileys (Multiple Unicode Aliases) --- + {"\U0001F60A", smiley, smiley_width, smiley_height}, // 😊 Smiling Face with Smiling Eyes + {"\U0001F600", smiley, smiley_width, smiley_height}, // 😀 Grinning Face + {"\U0001F642", smiley, smiley_width, smiley_height}, // 🙂 Slightly Smiling Face + {"\U0001F609", smiley, smiley_width, smiley_height}, // 😉 Winking Face + {"\U0001F601", smiley, smiley_width, smiley_height}, // 😁 Grinning Face with Smiling Eyes + + // --- Question/Alert --- + {"\u2753", question, question_width, question_height}, // ❓ Question Mark + {"\u203C\uFE0F", bang, bang_width, bang_height}, // ‼️ Double Exclamation Mark + + // --- Laughing Faces --- + {"\U0001F602", haha, haha_width, haha_height}, // 😂 Face with Tears of Joy + {"\U0001F923", haha, haha_width, haha_height}, // 🤣 Rolling on the Floor Laughing + {"\U0001F606", haha, haha_width, haha_height}, // 😆 Smiling with Open Mouth and Closed Eyes + {"\U0001F605", haha, haha_width, haha_height}, // 😅 Smiling with Sweat + {"\U0001F604", haha, haha_width, haha_height}, // 😄 Grinning Face with Smiling Eyes + + // --- Gestures and People --- + {"\U0001F44B", wave_icon, wave_icon_width, wave_icon_height}, // 👋 Waving Hand + {"\U0001F920", cowboy, cowboy_width, cowboy_height}, // 🤠 Cowboy Hat Face + {"\U0001F3A7", deadmau5, deadmau5_width, deadmau5_height}, // 🎧 Headphones + + // --- Weather --- + {"\u2600", sun, sun_width, sun_height}, // ☀ Sun (without variation selector) + {"\u2600\uFE0F", sun, sun_width, sun_height}, // ☀️ Sun (with variation selector) + {"\U0001F327\uFE0F", rain, rain_width, rain_height}, // 🌧️ Cloud with Rain + {"\u2601\uFE0F", cloud, cloud_width, cloud_height}, // ☁️ Cloud + {"\U0001F32B\uFE0F", fog, fog_width, fog_height}, // 🌫️ Fog + + // --- Misc Faces --- + {"\U0001F608", devil, devil_width, devil_height}, // 😈 Smiling Face with Horns + + // --- Hearts (Multiple Unicode Aliases) --- + {"\u2764\uFE0F", heart, heart_width, heart_height}, // ❤️ Red Heart + {"\U0001F9E1", heart, heart_width, heart_height}, // 🧡 Orange Heart + {"\U00002763", heart, heart_width, heart_height}, // ❣ Heart Exclamation + {"\U00002764", heart, heart_width, heart_height}, // ❤ Red Heart (legacy) + {"\U0001F495", heart, heart_width, heart_height}, // 💕 Two Hearts + {"\U0001F496", heart, heart_width, heart_height}, // 💖 Sparkling Heart + {"\U0001F497", heart, heart_width, heart_height}, // 💗 Growing Heart + {"\U0001F498", heart, heart_width, heart_height}, // 💘 Heart with Arrow + + // --- Objects --- + {"\U0001F4A9", poo, poo_width, poo_height}, // 💩 Pile of Poo + {"\U0001F514", bell_icon, bell_icon_width, bell_icon_height} // 🔔 Bell +#endif +}; + +const int numEmotes = sizeof(emotes) / sizeof(emotes[0]); + +#ifndef EXCLUDE_EMOJI +const unsigned char thumbup[] PROGMEM = { + 0x00, 0x1C, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x80, 0x09, 0x00, 0x00, + 0xC0, 0x08, 0x00, 0x00, 0x40, 0x08, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, + 0x0C, 0xCE, 0x7F, 0x00, 0x04, 0x20, 0x80, 0x00, 0x02, 0x20, 0x80, 0x00, 0x02, 0x60, 0xC0, 0x00, 0x01, 0xF8, 0xFF, 0x01, + 0x01, 0x08, 0x00, 0x01, 0x01, 0x08, 0x00, 0x01, 0x01, 0xF8, 0xFF, 0x00, 0x01, 0x10, 0x80, 0x00, 0x01, 0x18, 0x80, 0x00, + 0x02, 0x30, 0xC0, 0x00, 0x06, 0xE0, 0x3F, 0x00, 0x0C, 0x20, 0x30, 0x00, 0x38, 0x20, 0x10, 0x00, 0xE0, 0xCF, 0x1F, 0x00, +}; + +const unsigned char thumbdown[] PROGMEM = { + 0xE0, 0xCF, 0x1F, 0x00, 0x38, 0x20, 0x10, 0x00, 0x0C, 0x20, 0x30, 0x00, 0x06, 0xE0, 0x3F, 0x00, 0x02, 0x30, 0xC0, 0x00, + 0x01, 0x18, 0x80, 0x00, 0x01, 0x10, 0x80, 0x00, 0x01, 0xF8, 0xFF, 0x00, 0x01, 0x08, 0x00, 0x01, 0x01, 0x08, 0x00, 0x01, + 0x01, 0xF8, 0xFF, 0x01, 0x02, 0x60, 0xC0, 0x00, 0x02, 0x20, 0x80, 0x00, 0x04, 0x20, 0x80, 0x00, 0x0C, 0xCE, 0x7F, 0x00, + 0x18, 0x02, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x40, 0x08, 0x00, 0x00, 0xC0, 0x08, 0x00, 0x00, + 0x80, 0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, +}; + +const unsigned char smiley[] PROGMEM = { + 0x00, 0xfe, 0x0f, 0x00, 0x80, 0x01, 0x30, 0x00, 0x40, 0x00, 0xc0, 0x00, 0x20, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x02, + 0x08, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x10, 0x02, 0x0e, 0x0e, 0x10, 0x02, 0x09, 0x12, 0x10, + 0x01, 0x09, 0x12, 0x20, 0x01, 0x0f, 0x1e, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, + 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x81, 0x00, 0x20, 0x20, + 0x82, 0x00, 0x20, 0x10, 0x02, 0x01, 0x10, 0x10, 0x04, 0x02, 0x08, 0x08, 0x04, 0xfc, 0x07, 0x08, 0x08, 0x00, 0x00, 0x04, + 0x10, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00, 0x01, 0x40, 0x00, 0xc0, 0x00, 0x80, 0x01, 0x30, 0x00, 0x00, 0xfe, 0x0f, 0x00}; + +const unsigned char question[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x80, 0xFF, 0x01, 0x00, 0xC0, 0xFF, 0x07, 0x00, 0xE0, 0xFF, 0x07, 0x00, + 0xE0, 0xC3, 0x0F, 0x00, 0xF0, 0x81, 0x0F, 0x00, 0xF0, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x80, 0x0F, 0x00, + 0x00, 0xC0, 0x0F, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x7C, 0x00, 0x00, + 0x00, 0x3C, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const unsigned char bang[] PROGMEM = { + 0xFF, 0x0F, 0xFC, 0x3F, 0xFF, 0x0F, 0xFC, 0x3F, 0xFF, 0x0F, 0xFC, 0x3F, 0xFF, 0x07, 0xF8, 0x3F, 0xFF, 0x07, 0xF8, 0x3F, + 0xFE, 0x07, 0xF8, 0x1F, 0xFE, 0x07, 0xF8, 0x1F, 0xFE, 0x07, 0xF8, 0x1F, 0xFE, 0x07, 0xF8, 0x1F, 0xFE, 0x07, 0xF8, 0x1F, + 0xFE, 0x03, 0xF0, 0x1F, 0xFE, 0x03, 0xF0, 0x1F, 0xFC, 0x03, 0xF0, 0x0F, 0xFC, 0x03, 0xF0, 0x0F, 0xFC, 0x03, 0xF0, 0x0F, + 0xFC, 0x03, 0xF0, 0x0F, 0xFC, 0x03, 0xF0, 0x0F, 0xFC, 0x03, 0xF0, 0x0F, 0xFC, 0x01, 0xE0, 0x0F, 0xFC, 0x01, 0xE0, 0x0F, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0xC0, 0x03, 0xFC, 0x03, 0xF0, 0x0F, 0xFE, 0x03, 0xF0, 0x1F, + 0xFE, 0x07, 0xF8, 0x1F, 0xFE, 0x07, 0xF8, 0x1F, 0xFE, 0x07, 0xF8, 0x1F, 0xFC, 0x03, 0xF0, 0x0F, 0xF8, 0x01, 0xE0, 0x07, +}; + +const unsigned char haha[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, + 0x00, 0xFC, 0x0F, 0x00, 0x00, 0x1F, 0x3E, 0x00, 0x80, 0x03, 0x70, 0x00, 0xC0, 0x01, 0xE0, 0x00, 0xC0, 0x00, 0xC2, 0x00, + 0x60, 0x00, 0x03, 0x00, 0x60, 0x00, 0xC1, 0x1F, 0x60, 0x80, 0x8F, 0x31, 0x30, 0x0E, 0x80, 0x31, 0x30, 0x10, 0x30, 0x1F, + 0x30, 0x08, 0x58, 0x00, 0x30, 0x04, 0x6C, 0x03, 0x60, 0x00, 0xF3, 0x01, 0x60, 0xC0, 0xFC, 0x01, 0x80, 0x38, 0xBF, 0x01, + 0xE0, 0xC5, 0xDF, 0x00, 0xB0, 0xF9, 0xEF, 0x00, 0x30, 0xF1, 0x73, 0x00, 0xB0, 0x1D, 0x3E, 0x00, 0xF0, 0xFD, 0x0F, 0x00, + 0xE0, 0xE0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const unsigned char wave_icon[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xC0, 0x00, + 0x00, 0x0C, 0x9C, 0x01, 0x80, 0x17, 0x20, 0x01, 0x80, 0x26, 0x46, 0x02, 0x80, 0x44, 0x88, 0x02, 0xC0, 0x89, 0x8A, 0x02, + 0x40, 0x93, 0x8B, 0x02, 0x40, 0x26, 0x13, 0x00, 0x80, 0x44, 0x16, 0x00, 0xC0, 0x89, 0x24, 0x00, 0x40, 0x93, 0x60, 0x00, + 0x40, 0x26, 0x40, 0x00, 0x80, 0x0C, 0x80, 0x00, 0x00, 0x09, 0x80, 0x00, 0x00, 0x02, 0x80, 0x00, 0x40, 0x06, 0x80, 0x00, + 0x50, 0x0C, 0x80, 0x00, 0x50, 0x08, 0x40, 0x00, 0x90, 0x10, 0x20, 0x00, 0xB0, 0x21, 0x10, 0x00, 0x20, 0x47, 0x18, 0x00, + 0x40, 0x80, 0x0F, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const unsigned char cowboy[] PROGMEM = { + 0x00, 0xF0, 0x03, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x00, 0xFE, 0x1F, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x3C, 0xFE, 0x1F, 0x0F, + 0xFE, 0xFE, 0xDF, 0x1F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, + 0x3E, 0xC0, 0x00, 0x1F, 0x1E, 0x00, 0x00, 0x1E, 0x0C, 0x0C, 0x0C, 0x0C, 0x08, 0x0E, 0x1C, 0x04, 0x00, 0x0E, 0x1C, 0x00, + 0x04, 0x0E, 0x1C, 0x08, 0x04, 0x0E, 0x1C, 0x08, 0x04, 0x04, 0x08, 0x08, 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x08, + 0x8C, 0x07, 0x70, 0x0C, 0x88, 0xFC, 0x4F, 0x04, 0x88, 0x01, 0x40, 0x04, 0x90, 0xFF, 0x7F, 0x02, 0x30, 0x03, 0x30, 0x03, + 0x60, 0x0E, 0x9C, 0x01, 0xC0, 0xF8, 0xC7, 0x00, 0x80, 0x01, 0x60, 0x00, 0x00, 0x0E, 0x1C, 0x00, 0x00, 0xF8, 0x07, 0x00, +}; + +const unsigned char deadmau5[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00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 0x00, 0x00, 0x80, 0x07, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const unsigned char sun[] PROGMEM = { + 0x00, 0xC0, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x30, 0xC0, 0x00, 0x03, + 0x70, 0x00, 0x80, 0x03, 0xF0, 0x00, 0xC0, 0x03, 0xF0, 0xF8, 0xC7, 0x03, 0xE0, 0xFC, 0xCF, 0x01, 0x00, 0xFE, 0x1F, 0x00, + 0x00, 0xFF, 0x3F, 0x00, 0x80, 0xFF, 0x7F, 0x00, 0x80, 0xFF, 0x7F, 0x00, 0x8E, 0xFF, 0x7F, 0x1C, 0x9F, 0xFF, 0x7F, 0x3E, + 0x9F, 0xFF, 0x7F, 0x3E, 0x8E, 0xFF, 0x7F, 0x1C, 0x80, 0xFF, 0x7F, 0x00, 0x80, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0x3F, 0x00, + 0x00, 0xFE, 0x1F, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0xC0, 0xF9, 0xE7, 0x00, 0xE0, 0x01, 0xE0, 0x01, 0xF0, 0x01, 0xE0, 0x03, + 0xF0, 0xC0, 0xC0, 0x03, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xC0, 0x00, 0x00, +}; + +const unsigned char rain[] PROGMEM = { + 0xC0, 0x0F, 0xC0, 0x00, 0x40, 0x00, 0x80, 0x00, 0x20, 0x00, 0x80, 0x00, 0x20, 0x00, 0x80, 0x03, 0x38, 0x00, + 0x00, 0x0E, 0x0C, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00, 0x20, + 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x03, 0x00, 0x00, 0x30, 0x02, 0x00, + 0x00, 0x10, 0x06, 0x00, 0x00, 0x08, 0xFC, 0xFF, 0xFF, 0x07, 0xF0, 0xFF, 0xFF, 0x01, 0x80, 0x00, 0x01, 0x00, + 0xC0, 0xC0, 0x81, 0x03, 0xA0, 0x60, 0xC1, 0x03, 0x90, 0x20, 0x41, 0x01, 0xF0, 0xE0, 0xC0, 0x01, 0x60, 0x4C, + 0x98, 0x00, 0x00, 0x0E, 0x1C, 0x00, 0x00, 0x0B, 0x12, 0x00, 0x00, 0x09, 0x1A, 0x00, 0x00, 0x06, 0x0E, 0x00, +}; + +const unsigned char cloud[] PROGMEM = { + 0x00, 0x80, 0x07, 0x00, 0x00, 0xE0, 0x1F, 0x00, 0x00, 0x70, 0x30, 0x00, 0x00, 0x10, 0x60, 0x00, 0x80, 0x1F, 0x40, 0x00, + 0xC0, 0x0F, 0xC0, 0x00, 0xC0, 0x00, 0x80, 0x00, 0x60, 0x00, 0x80, 0x00, 0x20, 0x00, 0x80, 0x00, 0x20, 0x00, 0x80, 0x01, + 0x20, 0x00, 0x00, 0x07, 0x38, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x08, 0x06, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x10, + 0x02, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, + 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x10, + 0x02, 0x00, 0x00, 0x10, 0x06, 0x00, 0x00, 0x18, 0x0C, 0x00, 0x00, 0x0C, 0xFC, 0xFF, 0xFF, 0x07, 0xF0, 0xFF, 0xFF, 0x03, +}; + +const unsigned char fog[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x3C, 0x00, 0xFE, 0x01, 0xFF, 0x00, 0x87, 0xC7, 0xC3, 0x01, 0x03, 0xFE, 0x80, 0x01, + 0x00, 0x38, 0x00, 0x00, 0xFC, 0x00, 0x7E, 0x00, 0xFF, 0x83, 0xFF, 0x01, 0x03, 0xFF, 0x81, 0x01, 0x00, 0x7C, 0x00, 0x00, + 0xF8, 0x00, 0x3E, 0x00, 0xFE, 0x01, 0xFF, 0x00, 0x87, 0xC7, 0xC3, 0x01, 0x03, 0xFE, 0x80, 0x01, 0x00, 0x38, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const unsigned char devil[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x10, 0x03, 0xC0, 0x01, 0x38, 0x07, 0x7C, 0x0F, 0x38, 0x1F, 0x03, 0x30, 0x1E, + 0xFE, 0x01, 0xE0, 0x1F, 0x7E, 0x00, 0x80, 0x1F, 0x3C, 0x00, 0x00, 0x0F, 0x1C, 0x00, 0x00, 0x0E, 0x18, 0x00, 0x00, 0x06, + 0x08, 0x00, 0x00, 0x04, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x0E, 0x1C, 0x0C, + 0x0C, 0x18, 0x06, 0x0C, 0x0C, 0x1C, 0x06, 0x0C, 0x0C, 0x1C, 0x0E, 0x0C, 0x0C, 0x1C, 0x0E, 0x0C, 0x0C, 0x0C, 0x06, 0x0C, + 0x08, 0x00, 0x00, 0x06, 0x18, 0x02, 0x10, 0x06, 0x10, 0x0C, 0x0C, 0x03, 0x30, 0xF8, 0x07, 0x03, 0x60, 0xE0, 0x80, 0x01, + 0xC0, 0x00, 0xC0, 0x00, 0x80, 0x01, 0x70, 0x00, 0x00, 0x06, 0x1C, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const unsigned char heart[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0xF0, 0x00, 0xF8, 0x0F, 0xFC, 0x07, 0xFC, 0x1F, 0x06, 0x0E, 0xFE, 0x3F, 0x03, 0x18, + 0xFE, 0xFF, 0x7F, 0x10, 0xFF, 0xFF, 0xFF, 0x31, 0xFF, 0xFF, 0xFF, 0x33, 0xFF, 0xFF, 0xFF, 0x37, 0xFF, 0xFF, 0xFF, 0x37, + 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFE, 0xFF, 0xFF, 0x1F, 0xFE, 0xFF, 0xFF, 0x1F, + 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xF8, 0xFF, 0xFF, 0x07, 0xF0, 0xFF, 0xFF, 0x03, 0xF0, 0xFF, 0xFF, 0x03, + 0xE0, 0xFF, 0xFF, 0x01, 0xC0, 0xFF, 0xFF, 0x00, 0x80, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x00, 0xFE, 0x1F, 0x00, + 0x00, 0xFC, 0x0F, 0x00, 0x00, 0xF8, 0x07, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, +}; + +const unsigned char poo[] PROGMEM = { + 0x00, 0x1C, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xEC, 0x01, 0x00, 0x00, 0x8C, 0x07, 0x00, 0x00, 0x0C, 0x06, 0x00, + 0x00, 0x24, 0x0C, 0x00, 0x00, 0x34, 0x08, 0x00, 0x00, 0x1F, 0x08, 0x00, 0xC0, 0x0F, 0x08, 0x00, 0xC0, 0x00, 0x3C, 0x00, + 0x60, 0x00, 0x7C, 0x00, 0x60, 0x00, 0xC6, 0x00, 0x20, 0x00, 0xCB, 0x00, 0xA0, 0xC7, 0xFF, 0x00, 0xE0, 0x7F, 0xF7, 0x00, + 0xF0, 0x18, 0xE3, 0x03, 0x78, 0x18, 0x41, 0x03, 0x6C, 0x9B, 0x5D, 0x06, 0x64, 0x9B, 0x5D, 0x04, 0x44, 0x1A, 0x41, 0x04, + 0x4C, 0xD8, 0x63, 0x06, 0xF8, 0xFC, 0x36, 0x06, 0xFE, 0x0F, 0x9C, 0x1F, 0x07, 0x03, 0xC0, 0x30, 0x03, 0x00, 0x78, 0x20, + 0x01, 0x00, 0x1F, 0x20, 0x03, 0xE0, 0x03, 0x20, 0x07, 0x7E, 0x04, 0x30, 0xFE, 0x0F, 0xFC, 0x1F, 0xF0, 0x00, 0xF0, 0x0F, +}; + +const unsigned char bell_icon[] PROGMEM = { + 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b11110000, + 0b00000011, 0b00000000, 0b00000000, 0b11111100, 0b00001111, 0b00000000, 0b00000000, 0b00001111, 0b00111100, 0b00000000, + 0b00000000, 0b00000011, 0b00110000, 0b00000000, 0b10000000, 0b00000001, 0b01100000, 0b00000000, 0b11000000, 0b00000000, + 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b11000000, 0b00000000, + 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b11000000, 0b00000000, + 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b11000000, 0b00000000, + 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b01000000, 0b00000000, 0b10000000, 0b00000000, 0b01100000, 0b00000000, + 0b10000000, 0b00000001, 0b01110000, 0b00000000, 0b10000000, 0b00000011, 0b00110000, 0b00000000, 0b00000000, 0b00000011, + 0b00011000, 0b00000000, 0b00000000, 0b00000110, 0b11110000, 0b11111111, 0b11111111, 0b00000011, 0b00000000, 0b00001100, + 0b00001100, 0b00000000, 0b00000000, 0b00011000, 0b00000110, 0b00000000, 0b00000000, 0b11111000, 0b00000111, 0b00000000, + 0b00000000, 0b11100000, 0b00000001, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, + 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000}; +#endif + +} // namespace graphics diff --git a/src/graphics/emotes.h b/src/graphics/emotes.h new file mode 100644 index 000000000..5640ac04a --- /dev/null +++ b/src/graphics/emotes.h @@ -0,0 +1,86 @@ +#pragma once +#include + +namespace graphics +{ + +// === Emote List === +struct Emote { + const char *label; + const unsigned char *bitmap; + int width; + int height; +}; + +extern const Emote emotes[/* numEmotes */]; +extern const int numEmotes; + +#ifndef EXCLUDE_EMOJI +// === Emote Bitmaps === +#define thumbs_height 25 +#define thumbs_width 25 +extern const unsigned char thumbup[] PROGMEM; +extern const unsigned char thumbdown[] PROGMEM; + +#define smiley_height 30 +#define smiley_width 30 +extern const unsigned char smiley[] PROGMEM; + +#define question_height 25 +#define question_width 25 +extern const unsigned char question[] PROGMEM; + +#define bang_height 30 +#define bang_width 30 +extern const unsigned char bang[] PROGMEM; + +#define haha_height 30 +#define haha_width 30 +extern const unsigned char haha[] PROGMEM; + +#define wave_icon_height 30 +#define wave_icon_width 30 +extern const unsigned char wave_icon[] PROGMEM; + +#define cowboy_height 30 +#define cowboy_width 30 +extern const unsigned char cowboy[] PROGMEM; + +#define deadmau5_height 30 +#define deadmau5_width 60 +extern const unsigned char deadmau5[] PROGMEM; + +#define sun_height 30 +#define sun_width 30 +extern const unsigned char sun[] PROGMEM; + +#define rain_height 30 +#define rain_width 30 +extern const unsigned char rain[] PROGMEM; + +#define cloud_height 30 +#define cloud_width 30 +extern const unsigned char cloud[] PROGMEM; + +#define fog_height 25 +#define fog_width 25 +extern const unsigned char fog[] PROGMEM; + +#define devil_height 30 +#define devil_width 30 +extern const unsigned char devil[] PROGMEM; + +#define heart_height 30 +#define heart_width 30 +extern const unsigned char heart[] PROGMEM; + +#define poo_height 30 +#define poo_width 30 +extern const unsigned char poo[] PROGMEM; + +#define bell_icon_width 30 +#define bell_icon_height 30 +extern const unsigned char bell_icon[] PROGMEM; +#endif // EXCLUDE_EMOJI + +} // namespace graphics diff --git a/src/graphics/images.h b/src/graphics/images.h index 069839a16..e9c2f00ea 100644 --- a/src/graphics/images.h +++ b/src/graphics/images.h @@ -6,7 +6,12 @@ const uint8_t SATELLITE_IMAGE[] PROGMEM = {0x00, 0x08, 0x00, 0x1C, 0x00, 0x0E, 0 0xF8, 0x00, 0xF0, 0x01, 0xE0, 0x03, 0xC8, 0x01, 0x9C, 0x54, 0x0E, 0x52, 0x07, 0x48, 0x02, 0x26, 0x00, 0x10, 0x00, 0x0E}; -const uint8_t imgSatellite[] PROGMEM = {0x70, 0x71, 0x22, 0xFA, 0xFA, 0x22, 0x71, 0x70}; +#define imgSatellite_width 8 +#define imgSatellite_height 8 +const uint8_t imgSatellite[] PROGMEM = { + 0b00000000, 0b00000000, 0b00000000, 0b00011000, 0b11011011, 0b11111111, 0b11011011, 0b00011000, +}; + const uint8_t imgUSB[] PROGMEM = {0x60, 0x60, 0x30, 0x18, 0x18, 0x18, 0x24, 0x42, 0x42, 0x42, 0x42, 0x7E, 0x24, 0x24, 0x24, 0x3C}; const uint8_t imgPower[] PROGMEM = {0x40, 0x40, 0x40, 0x58, 0x48, 0x08, 0x08, 0x08, 0x1C, 0x22, 0x22, 0x41, 0x7F, 0x22, 0x22, 0x22}; @@ -14,11 +19,12 @@ const uint8_t imgUser[] PROGMEM = {0x3C, 0x42, 0x99, 0xA5, 0xA5, 0x99, 0x42, 0x3 const uint8_t imgPositionEmpty[] PROGMEM = {0x20, 0x30, 0x28, 0x24, 0x42, 0xFF}; const uint8_t imgPositionSolid[] PROGMEM = {0x20, 0x30, 0x38, 0x3C, 0x7E, 0xFF}; -#if defined(DISPLAY_CLOCK_FRAME) const uint8_t bluetoothConnectedIcon[36] PROGMEM = {0xfe, 0x01, 0xff, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0xe3, 0x1f, 0xf3, 0x3f, 0x33, 0x30, 0x33, 0x33, 0x33, 0x33, 0x03, 0x33, 0xff, 0x33, 0xfe, 0x31, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0x3f, 0xe0, 0x1f}; -#endif + +// This image definition is here instead of images.h because it's modified dynamically by the drawBattery function +static uint8_t imgBattery[16] = {0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xE7, 0x3C}; #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || ARCH_PORTDUINO) && \ @@ -37,181 +43,248 @@ const uint8_t imgQuestion[] PROGMEM = {0xbf, 0x41, 0xc0, 0x8b, 0xdb, 0x70, 0xa1, const uint8_t imgSF[] PROGMEM = {0xd2, 0xb7, 0xad, 0xbb, 0x92, 0x01, 0xfd, 0xfd, 0x15, 0x85, 0xf5}; #endif -#ifndef EXCLUDE_EMOJI -#define thumbs_height 25 -#define thumbs_width 25 -static unsigned char thumbup[] PROGMEM = { - 0x00, 0x1C, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x80, 0x09, 0x00, 0x00, - 0xC0, 0x08, 0x00, 0x00, 0x40, 0x08, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, - 0x0C, 0xCE, 0x7F, 0x00, 0x04, 0x20, 0x80, 0x00, 0x02, 0x20, 0x80, 0x00, 0x02, 0x60, 0xC0, 0x00, 0x01, 0xF8, 0xFF, 0x01, - 0x01, 0x08, 0x00, 0x01, 0x01, 0x08, 0x00, 0x01, 0x01, 0xF8, 0xFF, 0x00, 0x01, 0x10, 0x80, 0x00, 0x01, 0x18, 0x80, 0x00, - 0x02, 0x30, 0xC0, 0x00, 0x06, 0xE0, 0x3F, 0x00, 0x0C, 0x20, 0x30, 0x00, 0x38, 0x20, 0x10, 0x00, 0xE0, 0xCF, 0x1F, 0x00, +// === Horizontal battery === +// Basic battery design and all related pieces +const unsigned char batteryBitmap_h[] PROGMEM = { + 0b11111110, 0b00000000, 0b11110000, 0b00000111, 0b00000001, 0b00000000, 0b00000000, 0b00001000, 0b00000001, 0b00000000, + 0b00000000, 0b00001000, 0b00000001, 0b00000000, 0b00000000, 0b00001000, 0b00000001, 0b00000000, 0b00000000, 0b00001000, + 0b00000001, 0b00000000, 0b00000000, 0b00011000, 0b00000001, 0b00000000, 0b00000000, 0b00011000, 0b00000001, 0b00000000, + 0b00000000, 0b00011000, 0b00000001, 0b00000000, 0b00000000, 0b00011000, 0b00000001, 0b00000000, 0b00000000, 0b00011000, + 0b00000001, 0b00000000, 0b00000000, 0b00001000, 0b00000001, 0b00000000, 0b00000000, 0b00001000, 0b00000001, 0b00000000, + 0b00000000, 0b00001000, 0b00000001, 0b00000000, 0b00000000, 0b00001000, 0b11111110, 0b00000000, 0b11110000, 0b00000111}; + +// This is the left and right bars for the fill in +const unsigned char batteryBitmap_sidegaps_h[] PROGMEM = { + 0b11111111, 0b00001111, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, + 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, + 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b11111111, 0b00001111}; + +// Lightning Bolt +const unsigned char lightning_bolt_h[] PROGMEM = { + 0b00000000, 0b00000000, 0b00100000, 0b00000000, 0b00110000, 0b00000000, 0b00111000, 0b00000000, 0b00111100, + 0b00000000, 0b00011110, 0b00000000, 0b11111111, 0b00000000, 0b01111000, 0b00000000, 0b00111100, 0b00000000, + 0b00011100, 0b00000000, 0b00001100, 0b00000000, 0b00000100, 0b00000000, 0b00000000, 0b00000000}; + +// === Vertical battery === +// Basic battery design and all related pieces +const unsigned char batteryBitmap_v[] PROGMEM = {0b00011100, 0b00111110, 0b01000001, 0b01000001, 0b00000000, 0b00000000, + 0b00000000, 0b01000001, 0b01000001, 0b01000001, 0b00111110}; +// This is the left and right bars for the fill in +const unsigned char batteryBitmap_sidegaps_v[] PROGMEM = {0b10000010, 0b10000010, 0b10000010}; +// Lightning Bolt +const unsigned char lightning_bolt_v[] PROGMEM = {0b00000100, 0b00000110, 0b00011111, 0b00001100, 0b00000100}; + +#define mail_width 10 +#define mail_height 7 +static const unsigned char mail[] PROGMEM = { + 0b11111111, 0b00, // Top line + 0b10000001, 0b00, // Edges + 0b11000011, 0b00, // Diagonals start + 0b10100101, 0b00, // Inner M part + 0b10011001, 0b00, // Inner M part + 0b10000001, 0b00, // Edges + 0b11111111, 0b00 // Bottom line }; -static unsigned char thumbdown[] PROGMEM = { - 0xE0, 0xCF, 0x1F, 0x00, 0x38, 0x20, 0x10, 0x00, 0x0C, 0x20, 0x30, 0x00, 0x06, 0xE0, 0x3F, 0x00, 0x02, 0x30, 0xC0, 0x00, - 0x01, 0x18, 0x80, 0x00, 0x01, 0x10, 0x80, 0x00, 0x01, 0xF8, 0xFF, 0x00, 0x01, 0x08, 0x00, 0x01, 0x01, 0x08, 0x00, 0x01, - 0x01, 0xF8, 0xFF, 0x01, 0x02, 0x60, 0xC0, 0x00, 0x02, 0x20, 0x80, 0x00, 0x04, 0x20, 0x80, 0x00, 0x0C, 0xCE, 0x7F, 0x00, - 0x18, 0x02, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x40, 0x08, 0x00, 0x00, 0xC0, 0x08, 0x00, 0x00, - 0x80, 0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, +// 📬 Mail / Message +const uint8_t icon_mail[] PROGMEM = { + 0b11111111, // ████████ top border + 0b10000001, // █ █ sides + 0b11000011, // ██ ██ diagonal + 0b10100101, // █ █ █ █ inner M + 0b10011001, // █ ██ █ inner M + 0b10000001, // █ █ sides + 0b10000001, // █ █ sides + 0b11111111 // ████████ bottom }; -#define smiley_height 30 -#define smiley_width 30 -static unsigned char smiley[] PROGMEM = { - 0x00, 0xfe, 0x0f, 0x00, 0x80, 0x01, 0x30, 0x00, 0x40, 0x00, 0xc0, 0x00, 0x20, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x02, - 0x08, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x10, 0x02, 0x0e, 0x0e, 0x10, 0x02, 0x09, 0x12, 0x10, - 0x01, 0x09, 0x12, 0x20, 0x01, 0x0f, 0x1e, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, - 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x81, 0x00, 0x20, 0x20, - 0x82, 0x00, 0x20, 0x10, 0x02, 0x01, 0x10, 0x10, 0x04, 0x02, 0x08, 0x08, 0x04, 0xfc, 0x07, 0x08, 0x08, 0x00, 0x00, 0x04, - 0x10, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00, 0x01, 0x40, 0x00, 0xc0, 0x00, 0x80, 0x01, 0x30, 0x00, 0x00, 0xfe, 0x0f, 0x00}; - -#define question_height 25 -#define question_width 25 -static unsigned char question[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x80, 0xFF, 0x01, 0x00, 0xC0, 0xFF, 0x07, 0x00, 0xE0, 0xFF, 0x07, 0x00, - 0xE0, 0xC3, 0x0F, 0x00, 0xF0, 0x81, 0x0F, 0x00, 0xF0, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x80, 0x0F, 0x00, - 0x00, 0xC0, 0x0F, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x7C, 0x00, 0x00, - 0x00, 0x3C, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +// 📍 GPS Screen / Location Pin +const unsigned char icon_compass[] PROGMEM = { + 0x3C, // Row 0: ..####.. + 0x52, // Row 1: .#..#.#. + 0x91, // Row 2: #...#..# + 0x91, // Row 3: #...#..# + 0x91, // Row 4: #...#..# + 0x81, // Row 5: #......# + 0x42, // Row 6: .#....#. + 0x3C // Row 7: ..####.. }; -#define bang_height 30 -#define bang_width 30 -static unsigned char bang[] PROGMEM = { - 0xFF, 0x0F, 0xFC, 0x3F, 0xFF, 0x0F, 0xFC, 0x3F, 0xFF, 0x0F, 0xFC, 0x3F, 0xFF, 0x07, 0xF8, 0x3F, 0xFF, 0x07, 0xF8, 0x3F, - 0xFE, 0x07, 0xF8, 0x1F, 0xFE, 0x07, 0xF8, 0x1F, 0xFE, 0x07, 0xF8, 0x1F, 0xFE, 0x07, 0xF8, 0x1F, 0xFE, 0x07, 0xF8, 0x1F, - 0xFE, 0x03, 0xF0, 0x1F, 0xFE, 0x03, 0xF0, 0x1F, 0xFC, 0x03, 0xF0, 0x0F, 0xFC, 0x03, 0xF0, 0x0F, 0xFC, 0x03, 0xF0, 0x0F, - 0xFC, 0x03, 0xF0, 0x0F, 0xFC, 0x03, 0xF0, 0x0F, 0xFC, 0x03, 0xF0, 0x0F, 0xFC, 0x01, 0xE0, 0x0F, 0xFC, 0x01, 0xE0, 0x0F, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0xC0, 0x03, 0xFC, 0x03, 0xF0, 0x0F, 0xFE, 0x03, 0xF0, 0x1F, - 0xFE, 0x07, 0xF8, 0x1F, 0xFE, 0x07, 0xF8, 0x1F, 0xFE, 0x07, 0xF8, 0x1F, 0xFC, 0x03, 0xF0, 0x0F, 0xF8, 0x01, 0xE0, 0x07, +const uint8_t icon_radio[] PROGMEM = { + 0x0F, // Row 0: ####.... + 0x10, // Row 1: ....#... + 0x27, // Row 2: ###..#.. + 0x48, // Row 3: ...#..#. + 0x93, // Row 4: ##..#..# + 0xA4, // Row 5: ..#..#.# + 0xA8, // Row 6: ...#.#.# + 0xA9 // Row 7: #..#.#.# }; -#define haha_height 30 -#define haha_width 30 -static unsigned char haha[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, - 0x00, 0xFC, 0x0F, 0x00, 0x00, 0x1F, 0x3E, 0x00, 0x80, 0x03, 0x70, 0x00, 0xC0, 0x01, 0xE0, 0x00, 0xC0, 0x00, 0xC2, 0x00, - 0x60, 0x00, 0x03, 0x00, 0x60, 0x00, 0xC1, 0x1F, 0x60, 0x80, 0x8F, 0x31, 0x30, 0x0E, 0x80, 0x31, 0x30, 0x10, 0x30, 0x1F, - 0x30, 0x08, 0x58, 0x00, 0x30, 0x04, 0x6C, 0x03, 0x60, 0x00, 0xF3, 0x01, 0x60, 0xC0, 0xFC, 0x01, 0x80, 0x38, 0xBF, 0x01, - 0xE0, 0xC5, 0xDF, 0x00, 0xB0, 0xF9, 0xEF, 0x00, 0x30, 0xF1, 0x73, 0x00, 0xB0, 0x1D, 0x3E, 0x00, 0xF0, 0xFD, 0x0F, 0x00, - 0xE0, 0xE0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +// 🪙 Memory Icon +const uint8_t icon_memory[] PROGMEM = { + 0x24, // Row 0: ..#..#.. + 0x3C, // Row 1: ..####.. + 0xC3, // Row 2: ##....## + 0x5A, // Row 3: .#.##.#. + 0x5A, // Row 4: .#.##.#. + 0xC3, // Row 5: ##....## + 0x3C, // Row 6: ..####.. + 0x24 // Row 7: ..#..#.. }; -#define wave_icon_height 30 -#define wave_icon_width 30 -static unsigned char wave_icon[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xC0, 0x00, - 0x00, 0x0C, 0x9C, 0x01, 0x80, 0x17, 0x20, 0x01, 0x80, 0x26, 0x46, 0x02, 0x80, 0x44, 0x88, 0x02, 0xC0, 0x89, 0x8A, 0x02, - 0x40, 0x93, 0x8B, 0x02, 0x40, 0x26, 0x13, 0x00, 0x80, 0x44, 0x16, 0x00, 0xC0, 0x89, 0x24, 0x00, 0x40, 0x93, 0x60, 0x00, - 0x40, 0x26, 0x40, 0x00, 0x80, 0x0C, 0x80, 0x00, 0x00, 0x09, 0x80, 0x00, 0x00, 0x02, 0x80, 0x00, 0x40, 0x06, 0x80, 0x00, - 0x50, 0x0C, 0x80, 0x00, 0x50, 0x08, 0x40, 0x00, 0x90, 0x10, 0x20, 0x00, 0xB0, 0x21, 0x10, 0x00, 0x20, 0x47, 0x18, 0x00, - 0x40, 0x80, 0x0F, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +// 🌐 Wi-Fi +const uint8_t icon_wifi[] PROGMEM = {0b00000000, 0b00011000, 0b00111100, 0b01111110, + 0b11011011, 0b00011000, 0b00011000, 0b00000000}; + +const uint8_t icon_nodes[] PROGMEM = { + 0xF9, // Row 0 #..####### + 0x00, // Row 1 + 0xF9, // Row 2 #..####### + 0x00, // Row 3 + 0xF9, // Row 4 #..####### + 0x00, // Row 5 + 0xF9, // Row 6 #..####### + 0x00 // Row 7 }; -#define cowboy_height 30 -#define cowboy_width 30 -static unsigned char cowboy[] PROGMEM = { - 0x00, 0xF0, 0x03, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x00, 0xFE, 0x1F, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x3C, 0xFE, 0x1F, 0x0F, - 0xFE, 0xFE, 0xDF, 0x1F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, - 0x3E, 0xC0, 0x00, 0x1F, 0x1E, 0x00, 0x00, 0x1E, 0x0C, 0x0C, 0x0C, 0x0C, 0x08, 0x0E, 0x1C, 0x04, 0x00, 0x0E, 0x1C, 0x00, - 0x04, 0x0E, 0x1C, 0x08, 0x04, 0x0E, 0x1C, 0x08, 0x04, 0x04, 0x08, 0x08, 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x08, - 0x8C, 0x07, 0x70, 0x0C, 0x88, 0xFC, 0x4F, 0x04, 0x88, 0x01, 0x40, 0x04, 0x90, 0xFF, 0x7F, 0x02, 0x30, 0x03, 0x30, 0x03, - 0x60, 0x0E, 0x9C, 0x01, 0xC0, 0xF8, 0xC7, 0x00, 0x80, 0x01, 0x60, 0x00, 0x00, 0x0E, 0x1C, 0x00, 0x00, 0xF8, 0x07, 0x00, +// ➤ Chevron Triangle Arrow Icon (8x8) +const uint8_t icon_list[] PROGMEM = { + 0x10, // Row 0: ...#.... + 0x10, // Row 1: ...#.... + 0x38, // Row 2: ..###... + 0x38, // Row 3: ..###... + 0x7C, // Row 4: .#####.. + 0x6C, // Row 5: .##.##.. + 0xC6, // Row 6: ##...##. + 0x82 // Row 7: #.....#. }; -#define deadmau5_height 30 -#define deadmau5_width 60 -static unsigned char deadmau5[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x07, 0x00, - 0x00, 0xFC, 0x03, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x80, 0xFF, 0x0F, 0x00, 0xC0, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0x3F, 0x00, - 0xE0, 0xFF, 0xFF, 0x01, 0xF0, 0xFF, 0x7F, 0x00, 0xF0, 0xFF, 0xFF, 0x03, 0xF8, 0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0x07, - 0xFC, 0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x00, - 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0x3F, 0xFC, - 0x0F, 0xFF, 0x7F, 0x00, 0xC0, 0xFF, 0x1F, 0xF8, 0x0F, 0xFC, 0x3F, 0x00, 0x80, 0xFF, 0x0F, 0xF8, 0x1F, 0xFC, 0x1F, 0x00, - 0x00, 0xFF, 0x0F, 0xFC, 0x3F, 0xFC, 0x0F, 0x00, 0x00, 0xF8, 0x1F, 0xFF, 0xFF, 0xFE, 0x01, 0x00, 0x00, 0x00, 0xFC, 0xFF, - 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0xC0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x07, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +// 📶 Signal Bars Icon (left to right, small to large with spacing) +const uint8_t icon_signal[] PROGMEM = { + 0b00000000, // ░░░░░░░ + 0b10000000, // ░░░░░░░ + 0b10100000, // ░░░░█░█ + 0b10100000, // ░░░░█░█ + 0b10101000, // ░░█░█░█ + 0b10101000, // ░░█░█░█ + 0b10101010, // █░█░█░█ + 0b11111111 // ███████ }; -#define sun_width 30 -#define sun_height 30 -static unsigned char sun[] PROGMEM = { - 0x00, 0xC0, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x30, 0xC0, 0x00, 0x03, - 0x70, 0x00, 0x80, 0x03, 0xF0, 0x00, 0xC0, 0x03, 0xF0, 0xF8, 0xC7, 0x03, 0xE0, 0xFC, 0xCF, 0x01, 0x00, 0xFE, 0x1F, 0x00, - 0x00, 0xFF, 0x3F, 0x00, 0x80, 0xFF, 0x7F, 0x00, 0x80, 0xFF, 0x7F, 0x00, 0x8E, 0xFF, 0x7F, 0x1C, 0x9F, 0xFF, 0x7F, 0x3E, - 0x9F, 0xFF, 0x7F, 0x3E, 0x8E, 0xFF, 0x7F, 0x1C, 0x80, 0xFF, 0x7F, 0x00, 0x80, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0x3F, 0x00, - 0x00, 0xFE, 0x1F, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0xC0, 0xF9, 0xE7, 0x00, 0xE0, 0x01, 0xE0, 0x01, 0xF0, 0x01, 0xE0, 0x03, - 0xF0, 0xC0, 0xC0, 0x03, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xC0, 0x00, 0x00, +// ↔️ Distance / Measurement Icon (double-ended arrow) +const uint8_t icon_distance[] PROGMEM = { + 0b00000000, // ░░░░░░░░ + 0b10000001, // █░░░░░█ arrowheads + 0b01000010, // ░█░░░█░ + 0b00100100, // ░░█░█░░ + 0b00011000, // ░░░██░░ center + 0b00100100, // ░░█░█░░ + 0b01000010, // ░█░░░█░ + 0b10000001 // █░░░░░█ }; -#define rain_width 30 -#define rain_height 30 -static unsigned char rain[] PROGMEM = { - 0xC0, 0x0F, 0xC0, 0x00, 0x40, 0x00, 0x80, 0x00, 0x20, 0x00, 0x80, 0x00, 0x20, 0x00, 0x80, 0x03, 0x38, 0x00, - 0x00, 0x0E, 0x0C, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00, 0x20, - 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x03, 0x00, 0x00, 0x30, 0x02, 0x00, - 0x00, 0x10, 0x06, 0x00, 0x00, 0x08, 0xFC, 0xFF, 0xFF, 0x07, 0xF0, 0xFF, 0xFF, 0x01, 0x80, 0x00, 0x01, 0x00, - 0xC0, 0xC0, 0x81, 0x03, 0xA0, 0x60, 0xC1, 0x03, 0x90, 0x20, 0x41, 0x01, 0xF0, 0xE0, 0xC0, 0x01, 0x60, 0x4C, - 0x98, 0x00, 0x00, 0x0E, 0x1C, 0x00, 0x00, 0x0B, 0x12, 0x00, 0x00, 0x09, 0x1A, 0x00, 0x00, 0x06, 0x0E, 0x00, +// ⚠️ Error / Fault +const uint8_t icon_error[] PROGMEM = { + 0b00011000, // ░░░██░░░ + 0b00011000, // ░░░██░░░ + 0b00011000, // ░░░██░░░ + 0b00011000, // ░░░██░░░ + 0b00000000, // ░░░░░░░░ + 0b00011000, // ░░░██░░░ + 0b00000000, // ░░░░░░░░ + 0b00000000 // ░░░░░░░░ }; -#define cloud_height 30 -#define cloud_width 30 -static unsigned char cloud[] PROGMEM = { - 0x00, 0x80, 0x07, 0x00, 0x00, 0xE0, 0x1F, 0x00, 0x00, 0x70, 0x30, 0x00, 0x00, 0x10, 0x60, 0x00, 0x80, 0x1F, 0x40, 0x00, - 0xC0, 0x0F, 0xC0, 0x00, 0xC0, 0x00, 0x80, 0x00, 0x60, 0x00, 0x80, 0x00, 0x20, 0x00, 0x80, 0x00, 0x20, 0x00, 0x80, 0x01, - 0x20, 0x00, 0x00, 0x07, 0x38, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x08, 0x06, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x10, - 0x02, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, - 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x10, - 0x02, 0x00, 0x00, 0x10, 0x06, 0x00, 0x00, 0x18, 0x0C, 0x00, 0x00, 0x0C, 0xFC, 0xFF, 0xFF, 0x07, 0xF0, 0xFF, 0xFF, 0x03, +// 🏠 Optimized Home Icon (8x8) +const uint8_t icon_home[] PROGMEM = { + 0b00011000, // ██ + 0b00111100, // ████ + 0b01111110, // ██████ + 0b11111111, // ███████ + 0b11000011, // ██ ██ + 0b11011011, // ██ ██ ██ + 0b11011011, // ██ ██ ██ + 0b11111111 // ███████ }; -#define fog_height 25 -#define fog_width 25 -static unsigned char fog[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x3C, 0x00, 0xFE, 0x01, 0xFF, 0x00, 0x87, 0xC7, 0xC3, 0x01, 0x03, 0xFE, 0x80, 0x01, - 0x00, 0x38, 0x00, 0x00, 0xFC, 0x00, 0x7E, 0x00, 0xFF, 0x83, 0xFF, 0x01, 0x03, 0xFF, 0x81, 0x01, 0x00, 0x7C, 0x00, 0x00, - 0xF8, 0x00, 0x3E, 0x00, 0xFE, 0x01, 0xFF, 0x00, 0x87, 0xC7, 0xC3, 0x01, 0x03, 0xFE, 0x80, 0x01, 0x00, 0x38, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +// 🔧 Generic module (gear-like shape) +const uint8_t icon_module[] PROGMEM = { + 0b00011000, // ░░░██░░░ + 0b00111100, // ░░████░░ + 0b01111110, // ░██████░ + 0b11011011, // ██░██░██ + 0b11011011, // ██░██░██ + 0b01111110, // ░██████░ + 0b00111100, // ░░████░░ + 0b00011000 // ░░░██░░░ }; -#define devil_height 30 -#define devil_width 30 -static unsigned char devil[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x10, 0x03, 0xC0, 0x01, 0x38, 0x07, 0x7C, 0x0F, 0x38, 0x1F, 0x03, 0x30, 0x1E, - 0xFE, 0x01, 0xE0, 0x1F, 0x7E, 0x00, 0x80, 0x1F, 0x3C, 0x00, 0x00, 0x0F, 0x1C, 0x00, 0x00, 0x0E, 0x18, 0x00, 0x00, 0x06, - 0x08, 0x00, 0x00, 0x04, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x0E, 0x1C, 0x0C, - 0x0C, 0x18, 0x06, 0x0C, 0x0C, 0x1C, 0x06, 0x0C, 0x0C, 0x1C, 0x0E, 0x0C, 0x0C, 0x1C, 0x0E, 0x0C, 0x0C, 0x0C, 0x06, 0x0C, - 0x08, 0x00, 0x00, 0x06, 0x18, 0x02, 0x10, 0x06, 0x10, 0x0C, 0x0C, 0x03, 0x30, 0xF8, 0x07, 0x03, 0x60, 0xE0, 0x80, 0x01, - 0xC0, 0x00, 0xC0, 0x00, 0x80, 0x01, 0x70, 0x00, 0x00, 0x06, 0x1C, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, +#define mute_symbol_width 8 +#define mute_symbol_height 8 +const uint8_t mute_symbol[] PROGMEM = { + 0b00011001, // █ + 0b00100110, // █ + 0b00100100, // ████ + 0b01001010, // █ █ █ + 0b01010010, // █ █ █ + 0b01100010, // ████████ + 0b11111111, // █ █ + 0b10011000, // █ }; -#define heart_height 30 -#define heart_width 30 -static unsigned char heart[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0xF0, 0x00, 0xF8, 0x0F, 0xFC, 0x07, 0xFC, 0x1F, 0x06, 0x0E, 0xFE, 0x3F, 0x03, 0x18, - 0xFE, 0xFF, 0x7F, 0x10, 0xFF, 0xFF, 0xFF, 0x31, 0xFF, 0xFF, 0xFF, 0x33, 0xFF, 0xFF, 0xFF, 0x37, 0xFF, 0xFF, 0xFF, 0x37, - 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFE, 0xFF, 0xFF, 0x1F, 0xFE, 0xFF, 0xFF, 0x1F, - 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xF8, 0xFF, 0xFF, 0x07, 0xF0, 0xFF, 0xFF, 0x03, 0xF0, 0xFF, 0xFF, 0x03, - 0xE0, 0xFF, 0xFF, 0x01, 0xC0, 0xFF, 0xFF, 0x00, 0x80, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x00, 0xFE, 0x1F, 0x00, - 0x00, 0xFC, 0x0F, 0x00, 0x00, 0xF8, 0x07, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, +#define mute_symbol_big_width 16 +#define mute_symbol_big_height 16 +const uint8_t mute_symbol_big[] PROGMEM = {0b00000001, 0b00000000, 0b11000010, 0b00000011, 0b00110100, 0b00001100, 0b00011000, + 0b00001000, 0b00011000, 0b00010000, 0b00101000, 0b00010000, 0b01001000, 0b00010000, + 0b10001000, 0b00010000, 0b00001000, 0b00010001, 0b00001000, 0b00010010, 0b00001000, + 0b00010100, 0b00000100, 0b00101000, 0b11111100, 0b00111111, 0b01000000, 0b00100010, + 0b10000000, 0b01000001, 0b00000000, 0b10000000}; + +// Bell icon for Alert Message +#define bell_alert_width 8 +#define bell_alert_height 8 +const unsigned char bell_alert[] PROGMEM = {0b00011000, 0b00100100, 0b00100100, 0b01000010, + 0b01000010, 0b01000010, 0b11111111, 0b00011000}; + +#define key_symbol_width 8 +#define key_symbol_height 8 +const uint8_t key_symbol[] PROGMEM = {0b00000000, 0b00000000, 0b00000110, 0b11111001, + 0b10101001, 0b10000110, 0b00000000, 0b00000000}; + +#define placeholder_width 8 +#define placeholder_height 8 +const uint8_t placeholder[] PROGMEM = {0b11111111, 0b11111111, 0b11111111, 0b11111111, + 0b11111111, 0b11111111, 0b11111111, 0b11111111}; + +#define icon_node_width 8 +#define icon_node_height 8 +static const uint8_t icon_node[] PROGMEM = { + 0x10, // # + 0x10, // # ← antenna + 0x10, // # + 0xFE, // ####### ← device top + 0x82, // # # + 0xAA, // # # # # ← body with pattern + 0x92, // # # # + 0xFE // ####### ← device base }; -#define poo_width 30 -#define poo_height 30 -static unsigned char poo[] PROGMEM = { - 0x00, 0x1C, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xEC, 0x01, 0x00, 0x00, 0x8C, 0x07, 0x00, 0x00, 0x0C, 0x06, 0x00, - 0x00, 0x24, 0x0C, 0x00, 0x00, 0x34, 0x08, 0x00, 0x00, 0x1F, 0x08, 0x00, 0xC0, 0x0F, 0x08, 0x00, 0xC0, 0x00, 0x3C, 0x00, - 0x60, 0x00, 0x7C, 0x00, 0x60, 0x00, 0xC6, 0x00, 0x20, 0x00, 0xCB, 0x00, 0xA0, 0xC7, 0xFF, 0x00, 0xE0, 0x7F, 0xF7, 0x00, - 0xF0, 0x18, 0xE3, 0x03, 0x78, 0x18, 0x41, 0x03, 0x6C, 0x9B, 0x5D, 0x06, 0x64, 0x9B, 0x5D, 0x04, 0x44, 0x1A, 0x41, 0x04, - 0x4C, 0xD8, 0x63, 0x06, 0xF8, 0xFC, 0x36, 0x06, 0xFE, 0x0F, 0x9C, 0x1F, 0x07, 0x03, 0xC0, 0x30, 0x03, 0x00, 0x78, 0x20, - 0x01, 0x00, 0x1F, 0x20, 0x03, 0xE0, 0x03, 0x20, 0x07, 0x7E, 0x04, 0x30, 0xFE, 0x0F, 0xFC, 0x1F, 0xF0, 0x00, 0xF0, 0x0F, -}; -#endif +#define bluetoothdisabled_width 8 +#define bluetoothdisabled_height 8 +const uint8_t bluetoothdisabled[] PROGMEM = {0b11101100, 0b01010100, 0b01001100, 0b01010100, + 0b01001100, 0b00000000, 0b00000000, 0b00000000}; + +#define smallbulletpoint_width 8 +#define smallbulletpoint_height 8 +const uint8_t smallbulletpoint[] PROGMEM = {0b00000011, 0b00000011, 0b00000000, 0b00000000, + 0b00000000, 0b00000000, 0b00000000, 0b00000000}; + +// Clock +#define icon_clock_width 8 +#define icon_clock_height 8 +const uint8_t icon_clock[] PROGMEM = {0b00111100, 0b01000010, 0b10000101, 0b10101001, + 0b10010001, 0b10000001, 0b01000010, 0b00111100}; #include "img/icon.xbm" +static_assert(sizeof(icon_bits) >= 0, "Silence unused variable warning"); \ No newline at end of file diff --git a/src/graphics/niche/InkHUD/Events.cpp b/src/graphics/niche/InkHUD/Events.cpp index 109f75df5..f07645989 100644 --- a/src/graphics/niche/InkHUD/Events.cpp +++ b/src/graphics/niche/InkHUD/Events.cpp @@ -3,6 +3,7 @@ #include "./Events.h" #include "RTC.h" +#include "buzz.h" #include "modules/AdminModule.h" #include "modules/ExternalNotificationModule.h" #include "modules/TextMessageModule.h" @@ -38,6 +39,9 @@ void InkHUD::Events::begin() void InkHUD::Events::onButtonShort() { + // Audio feedback (via buzzer) + // Short low tone + playBoop(); // Cancel any beeping, buzzing, blinking // Some button handling suppressed if we are dismissing an external notification (see below) bool dismissedExt = dismissExternalNotification(); @@ -60,6 +64,10 @@ void InkHUD::Events::onButtonShort() void InkHUD::Events::onButtonLong() { + // Audio feedback (via buzzer) + // Low tone, longer than playBoop + playBeep(); + // Check which system applet wants to handle the button press (if any) SystemApplet *consumer = nullptr; for (SystemApplet *sa : inkhud->systemApplets) { @@ -107,6 +115,10 @@ int InkHUD::Events::beforeDeepSleep(void *unused) inkhud->forceUpdate(Drivers::EInk::UpdateTypes::FULL, false); delay(1000); // Cooldown, before potentially yanking display power + // InkHUD shutdown complete + // Firmware shutdown continues for several seconds more; flash write still pending + playShutdownMelody(); + return 0; // We agree: deep sleep now } diff --git a/src/graphics/niche/InkHUD/PlatformioConfig.ini b/src/graphics/niche/InkHUD/PlatformioConfig.ini index cab0ea7bc..e5a0e67df 100644 --- a/src/graphics/niche/InkHUD/PlatformioConfig.ini +++ b/src/graphics/niche/InkHUD/PlatformioConfig.ini @@ -6,6 +6,7 @@ build_flags = -D MESHTASTIC_INCLUDE_NICHE_GRAPHICS ; Use NicheGraphics -D MESHTASTIC_INCLUDE_INKHUD ; Use InkHUD (a NicheGraphics UI) -D MESHTASTIC_EXCLUDE_SCREEN ; Suppress default Screen class + -D MESHTASTIC_EXCLUDE_INPUTBROKER ; Suppress default input handling -D HAS_BUTTON=0 ; Suppress default ButtonThread lib_deps = https://github.com/ZinggJM/GFX_Root#2.0.0 ; Used by InkHUD as a "slimmer" version of AdafruitGFX \ No newline at end of file diff --git a/src/input/ButtonThread.cpp b/src/input/ButtonThread.cpp new file mode 100644 index 000000000..bc75e0a54 --- /dev/null +++ b/src/input/ButtonThread.cpp @@ -0,0 +1,318 @@ +#include "ButtonThread.h" +#include "meshUtils.h" + +#include "configuration.h" +#if !MESHTASTIC_EXCLUDE_GPS +#include "GPS.h" +#endif +#include "MeshService.h" +#include "RadioLibInterface.h" +#include "buzz.h" +#include "input/InputBroker.h" +#include "main.h" +#include "modules/CannedMessageModule.h" +#include "modules/ExternalNotificationModule.h" +#include "power.h" +#include "sleep.h" +#ifdef ARCH_PORTDUINO +#include "platform/portduino/PortduinoGlue.h" +#endif + +using namespace concurrency; + +#if HAS_BUTTON +#endif +ButtonThread::ButtonThread(const char *name) : OSThread(name) +{ + _originName = name; +} + +bool ButtonThread::initButton(uint8_t pinNumber, bool activeLow, bool activePullup, uint32_t pullupSense, voidFuncPtr intRoutine, + input_broker_event singlePress, input_broker_event longPress, uint16_t longPressTime, + input_broker_event doublePress, input_broker_event longLongPress, uint16_t longLongPressTime, + input_broker_event triplePress, input_broker_event shortLong, bool touchQuirk) +{ + if (inputBroker) + inputBroker->registerSource(this); + _longPressTime = longPressTime; + _longLongPressTime = longLongPressTime; + _pinNum = pinNumber; + _activeLow = activeLow; + _touchQuirk = touchQuirk; + _intRoutine = intRoutine; + _longLongPress = longLongPress; + + userButton = OneButton(pinNumber, activeLow, activePullup); + + if (pullupSense != 0) { + pinMode(pinNumber, pullupSense); + } + + _singlePress = singlePress; + userButton.attachClick( + [](void *callerThread) -> void { + ButtonThread *thread = (ButtonThread *)callerThread; + thread->btnEvent = BUTTON_EVENT_PRESSED; + }, + this); + + if (longPress != INPUT_BROKER_NONE) { + _longPress = longPress; + userButton.attachLongPressStart( + [](void *callerThread) -> void { + ButtonThread *thread = (ButtonThread *)callerThread; + if (millis() > 30000) // hold off 30s after boot + thread->btnEvent = BUTTON_EVENT_LONG_PRESSED; + }, + this); + userButton.attachLongPressStop( + [](void *callerThread) -> void { + ButtonThread *thread = (ButtonThread *)callerThread; + if (millis() > 30000) // hold off 30s after boot + thread->btnEvent = BUTTON_EVENT_LONG_RELEASED; + }, + this); + } + + if (doublePress != INPUT_BROKER_NONE) { + _doublePress = doublePress; + userButton.attachDoubleClick( + [](void *callerThread) -> void { + ButtonThread *thread = (ButtonThread *)callerThread; + thread->btnEvent = BUTTON_EVENT_DOUBLE_PRESSED; + }, + this); + } + + if (triplePress != INPUT_BROKER_NONE) { + _triplePress = triplePress; + userButton.attachMultiClick( + [](void *callerThread) -> void { + ButtonThread *thread = (ButtonThread *)callerThread; + thread->storeClickCount(); + thread->btnEvent = BUTTON_EVENT_MULTI_PRESSED; + }, + this); + } + if (shortLong != INPUT_BROKER_NONE) { + _shortLong = shortLong; + } + + userButton.setDebounceMs(1); + userButton.setPressMs(_longPressTime); + + if (screen) { + userButton.setClickMs(20); + } else { + userButton.setClickMs(BUTTON_CLICK_MS); + } + attachButtonInterrupts(); +#ifdef ARCH_ESP32 + // Register callbacks for before and after lightsleep + // Used to detach and reattach interrupts + lsObserver.observe(¬ifyLightSleep); + lsEndObserver.observe(¬ifyLightSleepEnd); +#endif + return true; +} + +int32_t ButtonThread::runOnce() +{ + // If the button is pressed we suppress CPU sleep until release + canSleep = true; // Assume we should not keep the board awake + + // Check for combination timeout + if (waitingForLongPress && (millis() - shortPressTime) > BUTTON_COMBO_TIMEOUT_MS) { + waitingForLongPress = false; + } + + userButton.tick(); + canSleep &= userButton.isIdle(); + + // Check if we should play lead-up sound during long press + // Play lead-up when button has been held for BUTTON_LEADUP_MS but before long press triggers + bool buttonCurrentlyPressed = isButtonPressed(_pinNum); + + // Detect start of button press + if (buttonCurrentlyPressed && !buttonWasPressed) { + buttonPressStartTime = millis(); + leadUpPlayed = false; + leadUpSequenceActive = false; + resetLeadUpSequence(); + } + + // Progressive lead-up sound system + if (buttonCurrentlyPressed && (millis() - buttonPressStartTime) >= BUTTON_LEADUP_MS && + (millis() - buttonPressStartTime) < _longLongPressTime) { + + // Start the progressive sequence if not already active + if (!leadUpSequenceActive) { + leadUpSequenceActive = true; + lastLeadUpNoteTime = millis(); + playNextLeadUpNote(); // Play the first note immediately + } + // Continue playing notes at intervals + else if ((millis() - lastLeadUpNoteTime) >= 400) { // 400ms interval between notes + if (playNextLeadUpNote()) { + lastLeadUpNoteTime = millis(); + } + } + } + + // Reset when button is released + if (!buttonCurrentlyPressed && buttonWasPressed) { + leadUpPlayed = false; + leadUpSequenceActive = false; + resetLeadUpSequence(); + } + + buttonWasPressed = buttonCurrentlyPressed; + + // new behavior + if (btnEvent != BUTTON_EVENT_NONE) { + InputEvent evt; + evt.source = _originName; + evt.kbchar = 0; + evt.touchX = 0; + evt.touchY = 0; + switch (btnEvent) { + case BUTTON_EVENT_PRESSED: { + // Forward single press to InputBroker (but NOT as DOWN/SELECT, just forward a "button press" event) + evt.inputEvent = _singlePress; + // evt.kbchar = _singlePress; // todo: fix this. Some events are kb characters rather than event types + this->notifyObservers(&evt); + + // Start tracking for potential combination + waitingForLongPress = true; + shortPressTime = millis(); + + break; + } + case BUTTON_EVENT_LONG_PRESSED: { + // Ignore if: TX in progress + // Uncommon T-Echo hardware bug, LoRa TX triggers touch button + if (_touchQuirk && RadioLibInterface::instance && RadioLibInterface::instance->isSending()) + break; + + // Check if this is part of a short-press + long-press combination + if (_shortLong != INPUT_BROKER_NONE && waitingForLongPress && + (millis() - shortPressTime) <= BUTTON_COMBO_TIMEOUT_MS) { + evt.inputEvent = _shortLong; + // evt.kbchar = _shortLong; + this->notifyObservers(&evt); + // Play the combination tune + playComboTune(); + + break; + } + + // Forward long press to InputBroker (but NOT as DOWN/SELECT, just forward a "button long press" event) + evt.inputEvent = _longPress; + this->notifyObservers(&evt); + + // Reset combination tracking + waitingForLongPress = false; + + break; + } + + case BUTTON_EVENT_DOUBLE_PRESSED: { // not wired in if screen detected + LOG_INFO("Double press!"); + + // Reset combination tracking + waitingForLongPress = false; + + evt.inputEvent = _doublePress; + // evt.kbchar = _doublePress; + this->notifyObservers(&evt); + playComboTune(); + + break; + } + + case BUTTON_EVENT_MULTI_PRESSED: { // not wired in when screen is present + LOG_INFO("Mulitipress! %hux", multipressClickCount); + + // Reset combination tracking + waitingForLongPress = false; + + switch (multipressClickCount) { + case 3: + evt.inputEvent = _triplePress; + // evt.kbchar = _triplePress; + this->notifyObservers(&evt); + playComboTune(); + break; + + // No valid multipress action + default: + break; + } // end switch: click count + + break; + } // end multipress event + + // Do actual shutdown when button released, otherwise the button release + // may wake the board immediatedly. + case BUTTON_EVENT_LONG_RELEASED: { + + LOG_INFO("LONG PRESS RELEASE"); + if (_longLongPress != INPUT_BROKER_NONE && (millis() - buttonPressStartTime) >= _longLongPressTime) { + evt.inputEvent = _longLongPress; + this->notifyObservers(&evt); + } + // Reset combination tracking + waitingForLongPress = false; + + break; + } + } + } + btnEvent = BUTTON_EVENT_NONE; + return 50; +} + +/* + * Attach (or re-attach) hardware interrupts for buttons + * Public method. Used outside class when waking from MCU sleep + */ +void ButtonThread::attachButtonInterrupts() +{ + // Interrupt for user button, during normal use. Improves responsiveness. + attachInterrupt(_pinNum, _intRoutine, CHANGE); +} + +/* + * Detach the "normal" button interrupts. + * Public method. Used before attaching a "wake-on-button" interrupt for MCU sleep + */ +void ButtonThread::detachButtonInterrupts() +{ + detachInterrupt(_pinNum); +} + +#ifdef ARCH_ESP32 + +// Detach our class' interrupts before lightsleep +// Allows sleep.cpp to configure its own interrupts, which wake the device on user-button press +int ButtonThread::beforeLightSleep(void *unused) +{ + detachButtonInterrupts(); + return 0; // Indicates success +} + +// Reconfigure our interrupts +// Our class' interrupts were disconnected during sleep, to allow the user button to wake the device from sleep +int ButtonThread::afterLightSleep(esp_sleep_wakeup_cause_t cause) +{ + attachButtonInterrupts(); + return 0; // Indicates success +} + +#endif + +// Non-static method, runs during callback. Grabs info while still valid +void ButtonThread::storeClickCount() +{ + multipressClickCount = userButton.getNumberClicks(); +} \ No newline at end of file diff --git a/src/input/ButtonThread.h b/src/input/ButtonThread.h new file mode 100644 index 000000000..033f92b8b --- /dev/null +++ b/src/input/ButtonThread.h @@ -0,0 +1,113 @@ +#pragma once + +#include "InputBroker.h" +#include "OneButton.h" +#include "concurrency/OSThread.h" +#include "configuration.h" + +typedef void (*voidFuncPtr)(void); + +#ifndef BUTTON_CLICK_MS +#define BUTTON_CLICK_MS 250 +#endif + +#ifndef BUTTON_TOUCH_MS +#define BUTTON_TOUCH_MS 400 +#endif + +#ifndef BUTTON_COMBO_TIMEOUT_MS +#define BUTTON_COMBO_TIMEOUT_MS 1000 // 1 second to complete the combination -- tap faster +#endif + +#ifndef BUTTON_LEADUP_MS +#define BUTTON_LEADUP_MS 2200 // Play lead-up sound after 2.5 seconds of holding +#endif + +class ButtonThread : public Observable, public concurrency::OSThread +{ + public: + const char *_originName; + static const uint32_t c_holdOffTime = 30000; // hold off 30s after boot + bool initButton(uint8_t pinNumber, bool activeLow, bool activePullup, uint32_t pullupSense, voidFuncPtr intRoutine, + input_broker_event singlePress, input_broker_event longPress = INPUT_BROKER_NONE, + uint16_t longPressTime = 500, input_broker_event doublePress = INPUT_BROKER_NONE, + input_broker_event longLongPress = INPUT_BROKER_NONE, uint16_t longLongPressTime = 5000, + input_broker_event triplePress = INPUT_BROKER_NONE, input_broker_event shortLong = INPUT_BROKER_NONE, + bool touchQuirk = false); + + enum ButtonEventType { + BUTTON_EVENT_NONE, + BUTTON_EVENT_PRESSED, + BUTTON_EVENT_PRESSED_SCREEN, + BUTTON_EVENT_DOUBLE_PRESSED, + BUTTON_EVENT_MULTI_PRESSED, + BUTTON_EVENT_LONG_PRESSED, + BUTTON_EVENT_LONG_RELEASED, + BUTTON_EVENT_TOUCH_LONG_PRESSED, + BUTTON_EVENT_COMBO_SHORT_LONG, + }; + + ButtonThread(const char *name); + int32_t runOnce() override; + OneButton userButton; + void attachButtonInterrupts(); + void detachButtonInterrupts(); + void storeClickCount(); + bool isButtonPressed(int buttonPin) + { + if (_activeLow) + return !digitalRead(buttonPin); // Active low: pressed = LOW + else + return digitalRead(buttonPin); // Most buttons are active low by default + } + + // Disconnect and reconnect interrupts for light sleep +#ifdef ARCH_ESP32 + int beforeLightSleep(void *unused); + int afterLightSleep(esp_sleep_wakeup_cause_t cause); +#endif + private: + input_broker_event _singlePress = INPUT_BROKER_NONE; + input_broker_event _longPress = INPUT_BROKER_NONE; + input_broker_event _longLongPress = INPUT_BROKER_NONE; + + input_broker_event _doublePress = INPUT_BROKER_NONE; + input_broker_event _triplePress = INPUT_BROKER_NONE; + input_broker_event _shortLong = INPUT_BROKER_NONE; + + voidFuncPtr _intRoutine = nullptr; + uint16_t _longPressTime = 500; + uint16_t _longLongPressTime = 5000; + int _pinNum = 0; + bool _activeLow = true; + bool _touchQuirk = false; + + uint32_t buttonPressStartTime = 0; + bool buttonWasPressed = false; + +#ifdef ARCH_ESP32 + // Get notified when lightsleep begins and ends + CallbackObserver lsObserver = + CallbackObserver(this, &ButtonThread::beforeLightSleep); + CallbackObserver lsEndObserver = + CallbackObserver(this, &ButtonThread::afterLightSleep); +#endif + + volatile ButtonEventType btnEvent = BUTTON_EVENT_NONE; + + // Store click count during callback, for later use + volatile int multipressClickCount = 0; + + // Combination tracking state + bool waitingForLongPress = false; + uint32_t shortPressTime = 0; + + // Long press lead-up tracking + bool leadUpPlayed = false; + uint32_t lastLeadUpNoteTime = 0; + bool leadUpSequenceActive = false; + + static void wakeOnIrq(int irq, int mode); +}; + +extern ButtonThread *buttonThread; diff --git a/src/input/ExpressLRSFiveWay.cpp b/src/input/ExpressLRSFiveWay.cpp index 56413bd55..1981a45d4 100644 --- a/src/input/ExpressLRSFiveWay.cpp +++ b/src/input/ExpressLRSFiveWay.cpp @@ -146,31 +146,31 @@ void ExpressLRSFiveWay::determineAction(KeyType key, PressLength length) { switch (key) { case LEFT: - if (inCannedMessageMenu()) // If in canned message menu - sendKey(CANCEL); // exit the menu (press imaginary cancel key) + if (inCannedMessageMenu()) // If in canned message menu + sendKey(INPUT_BROKER_CANCEL); // exit the menu (press imaginary cancel key) else - sendKey(LEFT); + sendKey(INPUT_BROKER_LEFT); break; case RIGHT: - if (inCannedMessageMenu()) // If in canned message menu: - sendKey(CANCEL); // exit the menu (press imaginary cancel key) + if (inCannedMessageMenu()) // If in canned message menu: + sendKey(INPUT_BROKER_CANCEL); // exit the menu (press imaginary cancel key) else - sendKey(RIGHT); + sendKey(INPUT_BROKER_RIGHT); break; case UP: if (length == LONG) toggleGPS(); else - sendKey(UP); + sendKey(INPUT_BROKER_UP); break; case DOWN: if (length == LONG) sendAdhocPing(); else - sendKey(DOWN); + sendKey(INPUT_BROKER_DOWN); break; case OK: @@ -186,7 +186,7 @@ void ExpressLRSFiveWay::determineAction(KeyType key, PressLength length) } // Feed input to the canned messages module -void ExpressLRSFiveWay::sendKey(KeyType key) +void ExpressLRSFiveWay::sendKey(input_broker_event key) { InputEvent e; e.source = inputSourceName; @@ -243,15 +243,9 @@ void ExpressLRSFiveWay::shutdown() shutdownAtMsec = millis() + 3000; } -// Emulate user button, or canned message SELECT -// This is necessary as canned message module doesn't translate SELECT to user button presses if the module is disabled -// Contained as one method for easier remapping of buttons by user void ExpressLRSFiveWay::click() { - if (!moduleConfig.canned_message.enabled) - powerFSM.trigger(EVENT_PRESS); - else - sendKey(OK); + sendKey(INPUT_BROKER_SELECT); } ExpressLRSFiveWay *expressLRSFiveWayInput = nullptr; diff --git a/src/input/ExpressLRSFiveWay.h b/src/input/ExpressLRSFiveWay.h index c53aa9c09..7c7f210f8 100644 --- a/src/input/ExpressLRSFiveWay.h +++ b/src/input/ExpressLRSFiveWay.h @@ -40,13 +40,13 @@ class ExpressLRSFiveWay : public Observable, public concurre // This merged an enum used by the ExpressLRS code, with meshtastic canned message values // Key names are kept simple, to allow user customizaton typedef enum { - UP = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP, - DOWN = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN, - LEFT = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT, - RIGHT = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT, - OK = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT, - CANCEL = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL, - NO_PRESS = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE + UP = INPUT_BROKER_UP, + DOWN = INPUT_BROKER_DOWN, + LEFT = INPUT_BROKER_LEFT, + RIGHT = INPUT_BROKER_RIGHT, + OK = INPUT_BROKER_SELECT, + CANCEL = INPUT_BROKER_CANCEL, + NO_PRESS = INPUT_BROKER_NONE } KeyType; typedef enum { SHORT, LONG } PressLength; @@ -63,7 +63,7 @@ class ExpressLRSFiveWay : public Observable, public concurre // Meshtastic code void determineAction(KeyType key, PressLength length); - void sendKey(KeyType key); + void sendKey(input_broker_event key); inline bool inCannedMessageMenu() { return cannedMessageModule->shouldDraw(); } int32_t runOnce() override; diff --git a/src/input/InputBroker.cpp b/src/input/InputBroker.cpp index cb73e32ba..ef6d8df91 100644 --- a/src/input/InputBroker.cpp +++ b/src/input/InputBroker.cpp @@ -12,7 +12,7 @@ void InputBroker::registerSource(Observable *source) int InputBroker::handleInputEvent(const InputEvent *event) { - powerFSM.trigger(EVENT_INPUT); + powerFSM.trigger(EVENT_INPUT); // todo: not every input should wake, like long hold release this->notifyObservers(event); return 0; } \ No newline at end of file diff --git a/src/input/InputBroker.h b/src/input/InputBroker.h index db7524bb0..4487fa662 100644 --- a/src/input/InputBroker.h +++ b/src/input/InputBroker.h @@ -1,29 +1,40 @@ #pragma once #include "Observer.h" -#define ANYKEY 0xFF -#define MATRIXKEY 0xFE +enum input_broker_event { + INPUT_BROKER_NONE = 0, + INPUT_BROKER_SELECT = 10, + INPUT_BROKER_UP = 17, + INPUT_BROKER_DOWN = 18, + INPUT_BROKER_LEFT = 19, + INPUT_BROKER_RIGHT = 20, + INPUT_BROKER_CANCEL = 24, + INPUT_BROKER_BACK = 27, + INPUT_BROKER_USER_PRESS, + INPUT_BROKER_ALT_PRESS, + INPUT_BROKER_ALT_LONG, + INPUT_BROKER_SHUTDOWN = 0x9b, + INPUT_BROKER_GPS_TOGGLE = 0x9e, + INPUT_BROKER_SEND_PING = 0xaf, + INPUT_BROKER_MATRIXKEY = 0xFE, + INPUT_BROKER_ANYKEY = 0xff + +}; #define INPUT_BROKER_MSG_BRIGHTNESS_UP 0x11 #define INPUT_BROKER_MSG_BRIGHTNESS_DOWN 0x12 #define INPUT_BROKER_MSG_REBOOT 0x90 -#define INPUT_BROKER_MSG_SHUTDOWN 0x9b -#define INPUT_BROKER_MSG_GPS_TOGGLE 0x9e #define INPUT_BROKER_MSG_MUTE_TOGGLE 0xac -#define INPUT_BROKER_MSG_SEND_PING 0xaf -#define INPUT_BROKER_MSG_DISMISS_FRAME 0x8b -#define INPUT_BROKER_MSG_LEFT 0xb4 -#define INPUT_BROKER_MSG_UP 0xb5 -#define INPUT_BROKER_MSG_DOWN 0xb6 -#define INPUT_BROKER_MSG_RIGHT 0xb7 #define INPUT_BROKER_MSG_FN_SYMBOL_ON 0xf1 #define INPUT_BROKER_MSG_FN_SYMBOL_OFF 0xf2 #define INPUT_BROKER_MSG_BLUETOOTH_TOGGLE 0xAA +#define INPUT_BROKER_MSG_TAB 0x09 +#define INPUT_BROKER_MSG_EMOTE_LIST 0x8F typedef struct _InputEvent { const char *source; - char inputEvent; - char kbchar; + input_broker_event inputEvent; + unsigned char kbchar; uint16_t touchX; uint16_t touchY; } InputEvent; @@ -35,6 +46,7 @@ class InputBroker : public Observable public: InputBroker(); void registerSource(Observable *source); + void injectInputEvent(const InputEvent *event) { handleInputEvent(event); } protected: int handleInputEvent(const InputEvent *event); diff --git a/src/input/LinuxInput.cpp b/src/input/LinuxInput.cpp index 57a87b0ef..90f06ecc9 100644 --- a/src/input/LinuxInput.cpp +++ b/src/input/LinuxInput.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -50,6 +51,7 @@ int32_t LinuxInput::runOnce() perror("unable to epoll add"); return disable(); } + kb_found = true; // This is the first time the OSThread library has called this function, so do port setup firstTime = 0; } @@ -72,7 +74,7 @@ int32_t LinuxInput::runOnce() assert(rd > ((signed int)sizeof(struct input_event))); for (int j = 0; j < rd / ((signed int)sizeof(struct input_event)); j++) { InputEvent e; - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; e.source = this->_originName; e.kbchar = 0; unsigned int type, code; @@ -131,36 +133,36 @@ int32_t LinuxInput::runOnce() mod = 0x08; break; case KEY_ESC: // ESC - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL; + e.inputEvent = INPUT_BROKER_CANCEL; break; case KEY_BACK: // Back - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK; + e.inputEvent = INPUT_BROKER_BACK; // e.kbchar = key; break; case KEY_UP: // Up - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP; + e.inputEvent = INPUT_BROKER_UP; break; case KEY_DOWN: // Down - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN; + e.inputEvent = INPUT_BROKER_DOWN; break; case KEY_LEFT: // Left - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT; + e.inputEvent = INPUT_BROKER_LEFT; break; - e.kbchar = INPUT_BROKER_MSG_LEFT; + e.kbchar = INPUT_BROKER_LEFT; case KEY_RIGHT: // Right - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT; + e.inputEvent = INPUT_BROKER_RIGHT; break; - e.kbchar = INPUT_BROKER_MSG_RIGHT; + e.kbchar = 0; case KEY_ENTER: // Enter - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT; + e.inputEvent = INPUT_BROKER_SELECT; break; case KEY_POWER: system("poweroff"); break; default: // all other keys if (keymap[code]) { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = keymap[code]; } break; @@ -173,8 +175,8 @@ int32_t LinuxInput::runOnce() } report[0] = modifiers; } - if (e.inputEvent != meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE) { - if (e.inputEvent == ANYKEY && (modifiers && 0x22)) + if (e.inputEvent != INPUT_BROKER_NONE) { + if (e.inputEvent == INPUT_BROKER_ANYKEY && (modifiers && 0x22)) e.kbchar = uppers[e.kbchar]; // doesn't get punctuation. Meh. this->notifyObservers(&e); } diff --git a/src/input/RotaryEncoderInterruptBase.cpp b/src/input/RotaryEncoderInterruptBase.cpp index 785d98ebe..0557bc180 100644 --- a/src/input/RotaryEncoderInterruptBase.cpp +++ b/src/input/RotaryEncoderInterruptBase.cpp @@ -7,7 +7,8 @@ RotaryEncoderInterruptBase::RotaryEncoderInterruptBase(const char *name) : concu } void RotaryEncoderInterruptBase::init( - uint8_t pinA, uint8_t pinB, uint8_t pinPress, char eventCw, char eventCcw, char eventPressed, + uint8_t pinA, uint8_t pinB, uint8_t pinPress, input_broker_event eventCw, input_broker_event eventCcw, + input_broker_event eventPressed, // std::function onIntA, std::function onIntB, std::function onIntPress) : void (*onIntA)(), void (*onIntB)(), void (*onIntPress)()) { @@ -34,7 +35,7 @@ void RotaryEncoderInterruptBase::init( int32_t RotaryEncoderInterruptBase::runOnce() { InputEvent e; - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; e.source = this->_originName; if (this->action == ROTARY_ACTION_PRESSED) { @@ -48,7 +49,7 @@ int32_t RotaryEncoderInterruptBase::runOnce() e.inputEvent = this->_eventCcw; } - if (e.inputEvent != meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE) { + if (e.inputEvent != INPUT_BROKER_NONE) { this->notifyObservers(&e); } diff --git a/src/input/RotaryEncoderInterruptBase.h b/src/input/RotaryEncoderInterruptBase.h index 9bcf25a69..9bdab4730 100644 --- a/src/input/RotaryEncoderInterruptBase.h +++ b/src/input/RotaryEncoderInterruptBase.h @@ -12,7 +12,8 @@ class RotaryEncoderInterruptBase : public Observable, public { public: explicit RotaryEncoderInterruptBase(const char *name); - void init(uint8_t pinA, uint8_t pinB, uint8_t pinPress, char eventCw, char eventCcw, char eventPressed, + void init(uint8_t pinA, uint8_t pinB, uint8_t pinPress, input_broker_event eventCw, input_broker_event eventCcw, + input_broker_event eventPressed, // std::function onIntA, std::function onIntB, std::function onIntPress); void (*onIntA)(), void (*onIntB)(), void (*onIntPress)()); void intPressHandler(); @@ -34,8 +35,8 @@ class RotaryEncoderInterruptBase : public Observable, public private: uint8_t _pinA = 0; uint8_t _pinB = 0; - char _eventCw = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; - char _eventCcw = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; - char _eventPressed = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + input_broker_event _eventCw = INPUT_BROKER_NONE; + input_broker_event _eventCcw = INPUT_BROKER_NONE; + input_broker_event _eventPressed = INPUT_BROKER_NONE; const char *_originName; }; diff --git a/src/input/RotaryEncoderInterruptImpl1.cpp b/src/input/RotaryEncoderInterruptImpl1.cpp index 7e79289e5..4f19c8b0b 100644 --- a/src/input/RotaryEncoderInterruptImpl1.cpp +++ b/src/input/RotaryEncoderInterruptImpl1.cpp @@ -16,9 +16,9 @@ bool RotaryEncoderInterruptImpl1::init() uint8_t pinA = moduleConfig.canned_message.inputbroker_pin_a; uint8_t pinB = moduleConfig.canned_message.inputbroker_pin_b; uint8_t pinPress = moduleConfig.canned_message.inputbroker_pin_press; - char eventCw = static_cast(moduleConfig.canned_message.inputbroker_event_cw); - char eventCcw = static_cast(moduleConfig.canned_message.inputbroker_event_ccw); - char eventPressed = static_cast(moduleConfig.canned_message.inputbroker_event_press); + input_broker_event eventCw = static_cast(moduleConfig.canned_message.inputbroker_event_cw); + input_broker_event eventCcw = static_cast(moduleConfig.canned_message.inputbroker_event_ccw); + input_broker_event eventPressed = static_cast(moduleConfig.canned_message.inputbroker_event_press); // moduleConfig.canned_message.ext_notification_module_output RotaryEncoderInterruptBase::init(pinA, pinB, pinPress, eventCw, eventCcw, eventPressed, diff --git a/src/input/ScanAndSelect.cpp b/src/input/ScanAndSelect.cpp deleted file mode 100644 index 1262f99b4..000000000 --- a/src/input/ScanAndSelect.cpp +++ /dev/null @@ -1,230 +0,0 @@ -#include "configuration.h" - -// Normally these input methods are protected by guarding in setupModules -// In order to have the user button dismiss the canned message frame, this class lightly interacts with the Screen class -#if HAS_SCREEN - -#include "ScanAndSelect.h" -#include "modules/CannedMessageModule.h" -#include -#ifdef ARCH_PORTDUINO // Only to check for pin conflict with user button -#include "platform/portduino/PortduinoGlue.h" -#endif - -// Config -static const char name[] = "scanAndSelect"; // should match "allow input source" string -static constexpr uint32_t durationShortMs = 50; -static constexpr uint32_t durationLongMs = 1500; -static constexpr uint32_t durationAlertMs = 2000; - -// Constructor: init base class -ScanAndSelectInput::ScanAndSelectInput() : concurrency::OSThread(name) {} - -// Attempt to setup class; true if success. -// Called by setupModules method. Instance deleted if setup fails. -bool ScanAndSelectInput::init() -{ - // Short circuit: Canned messages enabled? - if (!moduleConfig.canned_message.enabled) - return false; - - // Short circuit: Using correct "input source"? - // Todo: protobuf enum instead of string? - if (strcasecmp(moduleConfig.canned_message.allow_input_source, name) != 0) - return false; - - // Determine which pin to use for the single scan-and-select button - // User can specify this by setting any of the inputbroker pins - // If all values are zero, we'll assume the user *does* want GPIO0 - if (moduleConfig.canned_message.inputbroker_pin_press) - pin = moduleConfig.canned_message.inputbroker_pin_press; - else if (moduleConfig.canned_message.inputbroker_pin_a) - pin = moduleConfig.canned_message.inputbroker_pin_a; - else if (moduleConfig.canned_message.inputbroker_pin_b) - pin = moduleConfig.canned_message.inputbroker_pin_b; - else - pin = 0; // GPIO 0 then - - // Short circuit: if selected pin conficts with the user button -#if defined(ARCH_PORTDUINO) - int pinUserButton = 0; - if (settingsMap.count(user) != 0) { - pinUserButton = settingsMap[user]; - } -#elif defined(USERPREFS_BUTTON_PIN) - int pinUserButton = config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN; -#elif defined(BUTTON_PIN) - int pinUserButton = config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN; -#else - int pinUserButton = config.device.button_gpio; -#endif - if (pin == pinUserButton) { - LOG_ERROR("ScanAndSelect conflict with user button"); - return false; - } - - // Set-up the button - pinMode(pin, INPUT_PULLUP); - attachInterrupt(pin, handleChangeInterrupt, CHANGE); - - // Connect our class to the canned message module - inputBroker->registerSource(this); - - LOG_INFO("Initialized 'Scan and Select' input for Canned Messages, using pin %d", pin); - return true; // Init succeded -} - -// Runs periodically, unless sleeping between presses -int32_t ScanAndSelectInput::runOnce() -{ - uint32_t now = millis(); - - // If: "no messages added" alert screen currently shown - if (alertingNoMessage) { - // Dismiss the alert screen several seconds after it appears - if (!Throttle::isWithinTimespanMs(alertingSinceMs, durationAlertMs)) { - alertingNoMessage = false; - screen->endAlert(); - } - } - - // If: Button is pressed - if (digitalRead(pin) == LOW) { - // New press - if (!held) { - downSinceMs = now; - } - - // Existing press - else { - // Longer than shortpress window - // Long press not yet fired (prevent repeat firing while held) - if (!longPressFired && !Throttle::isWithinTimespanMs(downSinceMs, durationLongMs)) { - longPressFired = true; - longPress(); - } - } - - // Record the change of state: button is down - held = true; - } - - // If: Button is not pressed - else { - // Button newly released - // Long press event didn't already fire - if (held && !longPressFired) { - // Duration within shortpress window - // - longer than durationShortPress (debounce) - // - shorter than durationLongPress - if (!Throttle::isWithinTimespanMs(downSinceMs, durationShortMs)) { - shortPress(); - } - } - - // Record the change of state: button is up - held = false; - longPressFired = false; // Re-Arm: allow another long press - } - - // If thread's job is done, let it sleep - if (!held && !alertingNoMessage) { - Thread::canSleep = true; - return OSThread::disable(); - } - - // Run this method again is a few ms - return durationShortMs; -} - -void ScanAndSelectInput::longPress() -{ - // (If canned messages set) - if (cannedMessageModule->hasMessages()) { - // If module frame displayed already, send the current message - if (cannedMessageModule->shouldDraw()) - raiseEvent(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT); - - // Otherwise, initial long press opens the module frame - else - raiseEvent(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN); - } - - // (If canned messages not set) tell the user - else - alertNoMessage(); -} - -void ScanAndSelectInput::shortPress() -{ - // (If canned messages set) scroll to next message - if (cannedMessageModule->hasMessages()) - raiseEvent(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN); - - // (If canned messages not yet set) tell the user - else - alertNoMessage(); -} - -// Begin running runOnce at regular intervals -// Called from pin change interrupt -void ScanAndSelectInput::enableThread() -{ - Thread::canSleep = false; - OSThread::enabled = true; - OSThread::setIntervalFromNow(0); -} - -// Inform user (screen) that no canned messages have been added -// Automatically dismissed after several seconds -void ScanAndSelectInput::alertNoMessage() -{ - alertingNoMessage = true; - alertingSinceMs = millis(); - - // Graphics code: the alert frame to show on screen - screen->startAlert([](OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -> void { - display->setTextAlignment(TEXT_ALIGN_CENTER_BOTH); - display->setFont(FONT_SMALL); - int16_t textX = display->getWidth() / 2; - int16_t textY = display->getHeight() / 2; - display->drawString(textX + x, textY + y, "No Canned Messages"); - }); -} - -// Remove the canned message frame from screen -// Used to dismiss the module frame when user button pressed -// Returns true if the frame was previously displayed, and has now been closed -// Return value consumed by Screen class when determining how to handle user button -bool ScanAndSelectInput::dismissCannedMessageFrame() -{ - if (cannedMessageModule->shouldDraw()) { - raiseEvent(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL); - return true; - } - - return false; -} - -// Feed input to the canned messages module -void ScanAndSelectInput::raiseEvent(_meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar key) -{ - InputEvent e; - e.source = name; - e.inputEvent = key; - notifyObservers(&e); -} - -// Pin change interrupt -void ScanAndSelectInput::handleChangeInterrupt() -{ - // Because we need to detect both press and release (rising and falling edge), the interrupt itself can't determine the - // action. Instead, we start up the thread and get it to read the button for us - - // The instance we're referring to here is created in setupModules() - scanAndSelectInput->enableThread(); -} - -ScanAndSelectInput *scanAndSelectInput = nullptr; // Instantiated in setupModules method. Deleted if unused, or init() fails - -#endif \ No newline at end of file diff --git a/src/input/ScanAndSelect.h b/src/input/ScanAndSelect.h deleted file mode 100644 index 0b3e2716e..000000000 --- a/src/input/ScanAndSelect.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - A "single button" input method for Canned Messages - - - Short press to cycle through messages - - Long Press to send - - To use: - - set "allow input source" to "scanAndSelect" - - set the single button's GPIO as either pin A, pin B, or pin Press - - Originally designed to make use of "extra" built-in button on some boards. - Non-intrusive; suitable for use as a default module config. -*/ - -#pragma once -#include "concurrency/OSThread.h" -#include "main.h" - -// Normally these input methods are protected by guarding in setupModules -// In order to have the user button dismiss the canned message frame, this class lightly interacts with the Screen class -#if HAS_SCREEN - -class ScanAndSelectInput : public Observable, public concurrency::OSThread -{ - public: - ScanAndSelectInput(); // No-op constructor, only initializes OSThread base class - bool init(); // Attempt to setup class; true if success. Instance deleted if setup fails - bool dismissCannedMessageFrame(); // Remove the canned message frame from screen. True if frame was open, and now closed. - void alertNoMessage(); // Inform user (screen) that no canned messages have been added - - protected: - int32_t runOnce() override; // Runs at regular intervals, when enabled - void enableThread(); // Begin running runOnce at regular intervals - static void handleChangeInterrupt(); // Calls enableThread from pin change interrupt - void shortPress(); // Code to run when short press fires - void longPress(); // Code to run when long press fires - void raiseEvent(_meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar key); // Feed input to canned message module - - bool held = false; // Have we handled a change in button state? - bool longPressFired = false; // Long press fires while button still held. This bool ensures the release is no-op - uint32_t downSinceMs = 0; // Debouncing for short press, timing for long press - uint8_t pin = -1; // Read from cannned message config during init - - bool alertingNoMessage = false; // Is the "no canned messages" alert shown on screen? - uint32_t alertingSinceMs = 0; // Used to dismiss the "no canned message" alert several seconds -}; - -extern ScanAndSelectInput *scanAndSelectInput; // Instantiated in setupModules method. Deleted if unused, or init() fails - -#endif \ No newline at end of file diff --git a/src/input/SerialKeyboard.cpp b/src/input/SerialKeyboard.cpp index 8d0730418..63501bda5 100644 --- a/src/input/SerialKeyboard.cpp +++ b/src/input/SerialKeyboard.cpp @@ -30,7 +30,7 @@ SerialKeyboard::SerialKeyboard(const char *name) : concurrency::OSThread(name) void SerialKeyboard::erase() { InputEvent e; - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK; + e.inputEvent = INPUT_BROKER_BACK; e.kbchar = 0x08; e.source = this->_originName; this->notifyObservers(&e); @@ -81,18 +81,18 @@ int32_t SerialKeyboard::runOnce() if (keys < prevKeys) { // a new key has been pressed (and not released), doesn't works for multiple presses at once but // shouldn't be a limitation InputEvent e; - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; e.source = this->_originName; // SELECT OR SEND OR CANCEL EVENT if (!(shiftRegister2 & (1 << 3))) { - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP; + e.inputEvent = INPUT_BROKER_UP; } else if (!(shiftRegister2 & (1 << 2))) { - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT; - e.kbchar = INPUT_BROKER_MSG_RIGHT; + e.inputEvent = INPUT_BROKER_RIGHT; + e.kbchar = 0; } else if (!(shiftRegister2 & (1 << 1))) { - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT; + e.inputEvent = INPUT_BROKER_SELECT; } else if (!(shiftRegister2 & (1 << 0))) { - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL; + e.inputEvent = INPUT_BROKER_CANCEL; } // TEXT INPUT EVENT @@ -120,10 +120,10 @@ int32_t SerialKeyboard::runOnce() // BACKSPACE or TAB else if (!(shiftRegister1 & (1 << 7))) { if (shift == 0 || shift == 2) { // BACKSPACE - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK; + e.inputEvent = INPUT_BROKER_BACK; e.kbchar = 0x08; } else { // shift = 1 => TAB - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = 0x09; } } @@ -146,7 +146,7 @@ int32_t SerialKeyboard::runOnce() if (keyPressed == lastKeyPressed && millis() - lastPressTime < 500) { erase(); } - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = char(KeyMap[shift][quickPress][keyPressed]); } else { // then it's shift shift += 1; @@ -159,7 +159,7 @@ int32_t SerialKeyboard::runOnce() keyPressed = 13; } - if (e.inputEvent != meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE) { + if (e.inputEvent != INPUT_BROKER_NONE) { this->notifyObservers(&e); } } diff --git a/src/input/TCA8418Keyboard.cpp b/src/input/TCA8418Keyboard.cpp index 21cd7b2d5..d99379b23 100644 --- a/src/input/TCA8418Keyboard.cpp +++ b/src/input/TCA8418Keyboard.cpp @@ -147,7 +147,6 @@ TCA8418Keyboard::TCA8418Keyboard() : m_wire(nullptr), m_addr(0), readCallback(nu { state = Init; last_key = -1; - next_key = -1; should_backspace = false; last_tap = 0L; char_idx = 0; diff --git a/src/input/TCA8418Keyboard.h b/src/input/TCA8418Keyboard.h index c7f3c1f28..5c53452a4 100644 --- a/src/input/TCA8418Keyboard.h +++ b/src/input/TCA8418Keyboard.h @@ -21,7 +21,6 @@ class TCA8418Keyboard KeyState state; int8_t last_key; - int8_t next_key; bool should_backspace; uint32_t last_tap; uint8_t char_idx; diff --git a/src/input/TouchScreenBase.cpp b/src/input/TouchScreenBase.cpp index d2f7b54f8..c2755980e 100644 --- a/src/input/TouchScreenBase.cpp +++ b/src/input/TouchScreenBase.cpp @@ -43,6 +43,8 @@ int32_t TouchScreenBase::runOnce() // process touch events int16_t x, y; bool touched = getTouch(x, y); + if (x < 0 || y < 0) // T-deck can emit phantom touch events with a negative value when turing off the screen + touched = false; if (touched) { this->setInterval(20); _last_x = x; @@ -93,8 +95,6 @@ int32_t TouchScreenBase::runOnce() if (duration > 0 && duration < TIME_LONG_PRESS) { if (_tapped) { _tapped = false; - e.touchEvent = static_cast(TOUCH_ACTION_DOUBLE_TAP); - LOG_DEBUG("action DOUBLE TAP(%d/%d)", x, y); } else { _tapped = true; } @@ -124,7 +124,7 @@ int32_t TouchScreenBase::runOnce() } #else // fire TAP event when no 2nd tap occured within time - if (_tapped && (time_t(millis()) - _start) > TIME_LONG_PRESS - 50) { + if (_tapped) { _tapped = false; e.touchEvent = static_cast(TOUCH_ACTION_TAP); LOG_DEBUG("action TAP(%d/%d)", _last_x, _last_y); diff --git a/src/input/TouchScreenBase.h b/src/input/TouchScreenBase.h index 0b2002551..90314cf02 100644 --- a/src/input/TouchScreenBase.h +++ b/src/input/TouchScreenBase.h @@ -28,7 +28,6 @@ class TouchScreenBase : public Observable, public concurrenc TOUCH_ACTION_LEFT, TOUCH_ACTION_RIGHT, TOUCH_ACTION_TAP, - TOUCH_ACTION_DOUBLE_TAP, TOUCH_ACTION_LONG_PRESS }; diff --git a/src/input/TouchScreenImpl1.cpp b/src/input/TouchScreenImpl1.cpp index 20196278d..cea47faeb 100644 --- a/src/input/TouchScreenImpl1.cpp +++ b/src/input/TouchScreenImpl1.cpp @@ -49,41 +49,33 @@ void TouchScreenImpl1::onEvent(const TouchEvent &event) { InputEvent e; e.source = event.source; - + e.kbchar = 0; e.touchX = event.x; e.touchY = event.y; switch (event.touchEvent) { case TOUCH_ACTION_LEFT: { - e.inputEvent = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT); + e.inputEvent = INPUT_BROKER_LEFT; break; } case TOUCH_ACTION_RIGHT: { - e.inputEvent = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT); + e.inputEvent = INPUT_BROKER_RIGHT; break; } case TOUCH_ACTION_UP: { - e.inputEvent = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP); + e.inputEvent = INPUT_BROKER_UP; break; } case TOUCH_ACTION_DOWN: { - e.inputEvent = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN); - break; - } - case TOUCH_ACTION_DOUBLE_TAP: { - e.inputEvent = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT); + e.inputEvent = INPUT_BROKER_DOWN; break; } case TOUCH_ACTION_LONG_PRESS: { - e.inputEvent = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL); + e.inputEvent = INPUT_BROKER_SELECT; break; } case TOUCH_ACTION_TAP: { - if (moduleConfig.external_notification.enabled && (externalNotificationModule->nagCycleCutoff != UINT32_MAX)) { - externalNotificationModule->stopNow(); - } else { - powerFSM.trigger(EVENT_INPUT); - } + e.inputEvent = INPUT_BROKER_USER_PRESS; break; } default: diff --git a/src/input/TrackballInterruptBase.cpp b/src/input/TrackballInterruptBase.cpp index e35da3622..41045ee8e 100644 --- a/src/input/TrackballInterruptBase.cpp +++ b/src/input/TrackballInterruptBase.cpp @@ -4,9 +4,9 @@ TrackballInterruptBase::TrackballInterruptBase(const char *name) : concurrency::OSThread(name), _originName(name) {} void TrackballInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLeft, uint8_t pinRight, uint8_t pinPress, - char eventDown, char eventUp, char eventLeft, char eventRight, char eventPressed, - void (*onIntDown)(), void (*onIntUp)(), void (*onIntLeft)(), void (*onIntRight)(), - void (*onIntPress)()) + input_broker_event eventDown, input_broker_event eventUp, input_broker_event eventLeft, + input_broker_event eventRight, input_broker_event eventPressed, void (*onIntDown)(), + void (*onIntUp)(), void (*onIntLeft)(), void (*onIntRight)(), void (*onIntPress)()) { this->_pinDown = pinDown; this->_pinUp = pinUp; @@ -18,17 +18,26 @@ void TrackballInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLef this->_eventRight = eventRight; this->_eventPressed = eventPressed; - pinMode(pinPress, INPUT_PULLUP); - pinMode(this->_pinDown, INPUT_PULLUP); - pinMode(this->_pinUp, INPUT_PULLUP); - pinMode(this->_pinLeft, INPUT_PULLUP); - pinMode(this->_pinRight, INPUT_PULLUP); - - attachInterrupt(pinPress, onIntPress, RISING); - attachInterrupt(this->_pinDown, onIntDown, RISING); - attachInterrupt(this->_pinUp, onIntUp, RISING); - attachInterrupt(this->_pinLeft, onIntLeft, RISING); - attachInterrupt(this->_pinRight, onIntRight, RISING); + if (pinPress != 255) { + pinMode(pinPress, INPUT_PULLUP); + attachInterrupt(pinPress, onIntPress, RISING); + } + if (this->_pinDown != 255) { + pinMode(this->_pinDown, INPUT_PULLUP); + attachInterrupt(this->_pinDown, onIntDown, RISING); + } + if (this->_pinUp != 255) { + pinMode(this->_pinUp, INPUT_PULLUP); + attachInterrupt(this->_pinUp, onIntUp, RISING); + } + if (this->_pinLeft != 255) { + pinMode(this->_pinLeft, INPUT_PULLUP); + attachInterrupt(this->_pinLeft, onIntLeft, RISING); + } + if (this->_pinRight != 255) { + pinMode(this->_pinRight, INPUT_PULLUP); + attachInterrupt(this->_pinRight, onIntRight, RISING); + } LOG_DEBUG("Trackball GPIO initialized (%d, %d, %d, %d, %d)", this->_pinUp, this->_pinDown, this->_pinLeft, this->_pinRight, pinPress); @@ -39,8 +48,25 @@ void TrackballInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLef int32_t TrackballInterruptBase::runOnce() { InputEvent e; - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; - + e.inputEvent = INPUT_BROKER_NONE; +#if defined(T_DECK) // T-deck gets a super-simple debounce on trackball + if (this->action == TB_ACTION_PRESSED) { + // LOG_DEBUG("Trackball event Press"); + e.inputEvent = this->_eventPressed; + } else if (this->action == TB_ACTION_UP && lastEvent == TB_ACTION_UP) { + // LOG_DEBUG("Trackball event UP"); + e.inputEvent = this->_eventUp; + } else if (this->action == TB_ACTION_DOWN && lastEvent == TB_ACTION_DOWN) { + // LOG_DEBUG("Trackball event DOWN"); + e.inputEvent = this->_eventDown; + } else if (this->action == TB_ACTION_LEFT && lastEvent == TB_ACTION_LEFT) { + // LOG_DEBUG("Trackball event LEFT"); + e.inputEvent = this->_eventLeft; + } else if (this->action == TB_ACTION_RIGHT && lastEvent == TB_ACTION_RIGHT) { + // LOG_DEBUG("Trackball event RIGHT"); + e.inputEvent = this->_eventRight; + } +#else if (this->action == TB_ACTION_PRESSED) { // LOG_DEBUG("Trackball event Press"); e.inputEvent = this->_eventPressed; @@ -57,13 +83,14 @@ int32_t TrackballInterruptBase::runOnce() // LOG_DEBUG("Trackball event RIGHT"); e.inputEvent = this->_eventRight; } +#endif - if (e.inputEvent != meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE) { + if (e.inputEvent != INPUT_BROKER_NONE) { e.source = this->_originName; e.kbchar = 0x00; this->notifyObservers(&e); } - + lastEvent = action; this->action = TB_ACTION_NONE; return 100; diff --git a/src/input/TrackballInterruptBase.h b/src/input/TrackballInterruptBase.h index e7fc99f54..dac31a137 100644 --- a/src/input/TrackballInterruptBase.h +++ b/src/input/TrackballInterruptBase.h @@ -7,9 +7,10 @@ class TrackballInterruptBase : public Observable, public con { public: explicit TrackballInterruptBase(const char *name); - void init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLeft, uint8_t pinRight, uint8_t pinPress, char eventDown, char eventUp, - char eventLeft, char eventRight, char eventPressed, void (*onIntDown)(), void (*onIntUp)(), void (*onIntLeft)(), - void (*onIntRight)(), void (*onIntPress)()); + void init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLeft, uint8_t pinRight, uint8_t pinPress, input_broker_event eventDown, + input_broker_event eventUp, input_broker_event eventLeft, input_broker_event eventRight, + input_broker_event eventPressed, void (*onIntDown)(), void (*onIntUp)(), void (*onIntLeft)(), void (*onIntRight)(), + void (*onIntPress)()); void intPressHandler(); void intDownHandler(); void intUpHandler(); @@ -35,10 +36,11 @@ class TrackballInterruptBase : public Observable, public con uint8_t _pinUp = 0; uint8_t _pinLeft = 0; uint8_t _pinRight = 0; - char _eventDown = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; - char _eventUp = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; - char _eventLeft = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; - char _eventRight = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; - char _eventPressed = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + input_broker_event _eventDown = INPUT_BROKER_NONE; + input_broker_event _eventUp = INPUT_BROKER_NONE; + input_broker_event _eventLeft = INPUT_BROKER_NONE; + input_broker_event _eventRight = INPUT_BROKER_NONE; + input_broker_event _eventPressed = INPUT_BROKER_NONE; const char *_originName; + TrackballInterruptBaseActionType lastEvent = TB_ACTION_NONE; }; diff --git a/src/input/TrackballInterruptImpl1.cpp b/src/input/TrackballInterruptImpl1.cpp index 0a73b83b6..c6d21ac2b 100644 --- a/src/input/TrackballInterruptImpl1.cpp +++ b/src/input/TrackballInterruptImpl1.cpp @@ -6,30 +6,19 @@ TrackballInterruptImpl1 *trackballInterruptImpl1; TrackballInterruptImpl1::TrackballInterruptImpl1() : TrackballInterruptBase("trackball1") {} -void TrackballInterruptImpl1::init() +void TrackballInterruptImpl1::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLeft, uint8_t pinRight, uint8_t pinPress) { -#if !HAS_TRACKBALL - // Input device is disabled. - return; -#else - uint8_t pinUp = TB_UP; - uint8_t pinDown = TB_DOWN; - uint8_t pinLeft = TB_LEFT; - uint8_t pinRight = TB_RIGHT; - uint8_t pinPress = TB_PRESS; - - char eventDown = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN); - char eventUp = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP); - char eventLeft = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT); - char eventRight = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT); - char eventPressed = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT); + input_broker_event eventDown = INPUT_BROKER_DOWN; + input_broker_event eventUp = INPUT_BROKER_UP; + input_broker_event eventLeft = INPUT_BROKER_LEFT; + input_broker_event eventRight = INPUT_BROKER_RIGHT; + input_broker_event eventPressed = INPUT_BROKER_SELECT; TrackballInterruptBase::init(pinDown, pinUp, pinLeft, pinRight, pinPress, eventDown, eventUp, eventLeft, eventRight, eventPressed, TrackballInterruptImpl1::handleIntDown, TrackballInterruptImpl1::handleIntUp, TrackballInterruptImpl1::handleIntLeft, TrackballInterruptImpl1::handleIntRight, TrackballInterruptImpl1::handleIntPressed); inputBroker->registerSource(this); -#endif } void TrackballInterruptImpl1::handleIntDown() diff --git a/src/input/TrackballInterruptImpl1.h b/src/input/TrackballInterruptImpl1.h index 36efac6a6..4683efa41 100644 --- a/src/input/TrackballInterruptImpl1.h +++ b/src/input/TrackballInterruptImpl1.h @@ -5,7 +5,7 @@ class TrackballInterruptImpl1 : public TrackballInterruptBase { public: TrackballInterruptImpl1(); - void init(); + void init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLeft, uint8_t pinRight, uint8_t pinPress); static void handleIntDown(); static void handleIntUp(); static void handleIntLeft(); diff --git a/src/input/UpDownInterruptBase.cpp b/src/input/UpDownInterruptBase.cpp index 979489c57..9a95323fe 100644 --- a/src/input/UpDownInterruptBase.cpp +++ b/src/input/UpDownInterruptBase.cpp @@ -6,8 +6,9 @@ UpDownInterruptBase::UpDownInterruptBase(const char *name) : concurrency::OSThre this->_originName = name; } -void UpDownInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinPress, char eventDown, char eventUp, char eventPressed, - void (*onIntDown)(), void (*onIntUp)(), void (*onIntPress)()) +void UpDownInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinPress, input_broker_event eventDown, + input_broker_event eventUp, input_broker_event eventPressed, void (*onIntDown)(), + void (*onIntUp)(), void (*onIntPress)()) { this->_pinDown = pinDown; this->_pinUp = pinUp; @@ -31,7 +32,7 @@ void UpDownInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinPress, int32_t UpDownInterruptBase::runOnce() { InputEvent e; - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; if (this->action == UPDOWN_ACTION_PRESSED) { LOG_DEBUG("GPIO event Press"); @@ -44,9 +45,9 @@ int32_t UpDownInterruptBase::runOnce() e.inputEvent = this->_eventDown; } - if (e.inputEvent != meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE) { + if (e.inputEvent != INPUT_BROKER_NONE) { e.source = this->_originName; - e.kbchar = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.kbchar = INPUT_BROKER_NONE; this->notifyObservers(&e); } diff --git a/src/input/UpDownInterruptBase.h b/src/input/UpDownInterruptBase.h index 7060a0d80..4e9f591b9 100644 --- a/src/input/UpDownInterruptBase.h +++ b/src/input/UpDownInterruptBase.h @@ -7,8 +7,8 @@ class UpDownInterruptBase : public Observable, public concur { public: explicit UpDownInterruptBase(const char *name); - void init(uint8_t pinDown, uint8_t pinUp, uint8_t pinPress, char eventDown, char eventUp, char eventPressed, - void (*onIntDown)(), void (*onIntUp)(), void (*onIntPress)()); + void init(uint8_t pinDown, uint8_t pinUp, uint8_t pinPress, input_broker_event eventDown, input_broker_event eventUp, + input_broker_event eventPressed, void (*onIntDown)(), void (*onIntUp)(), void (*onIntPress)()); void intPressHandler(); void intDownHandler(); void intUpHandler(); @@ -23,8 +23,8 @@ class UpDownInterruptBase : public Observable, public concur private: uint8_t _pinDown = 0; uint8_t _pinUp = 0; - char _eventDown = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; - char _eventUp = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; - char _eventPressed = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + input_broker_event _eventDown = INPUT_BROKER_NONE; + input_broker_event _eventUp = INPUT_BROKER_NONE; + input_broker_event _eventPressed = INPUT_BROKER_NONE; const char *_originName; }; diff --git a/src/input/UpDownInterruptImpl1.cpp b/src/input/UpDownInterruptImpl1.cpp index 7dd1f76b2..761b92348 100644 --- a/src/input/UpDownInterruptImpl1.cpp +++ b/src/input/UpDownInterruptImpl1.cpp @@ -17,9 +17,9 @@ bool UpDownInterruptImpl1::init() uint8_t pinDown = moduleConfig.canned_message.inputbroker_pin_b; uint8_t pinPress = moduleConfig.canned_message.inputbroker_pin_press; - char eventDown = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN); - char eventUp = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP); - char eventPressed = static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT); + input_broker_event eventDown = INPUT_BROKER_DOWN; + input_broker_event eventUp = INPUT_BROKER_UP; + input_broker_event eventPressed = INPUT_BROKER_SELECT; UpDownInterruptBase::init(pinDown, pinUp, pinPress, eventDown, eventUp, eventPressed, UpDownInterruptImpl1::handleIntDown, UpDownInterruptImpl1::handleIntUp, UpDownInterruptImpl1::handleIntPressed); diff --git a/src/input/kbI2cBase.cpp b/src/input/kbI2cBase.cpp index 70e9e4365..5cc069816 100644 --- a/src/input/kbI2cBase.cpp +++ b/src/input/kbI2cBase.cpp @@ -75,94 +75,94 @@ int32_t KbI2cBase::runOnce() const BBQ10Keyboard::KeyEvent key = Q10keyboard.keyEvent(); if ((key.key != 0x00) && (key.state == BBQ10Keyboard::StateRelease)) { InputEvent e; - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; e.source = this->_originName; switch (key.key) { case 'p': // TAB case 't': // TAB as well if (is_sym) { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = 0x09; // TAB Scancode is_sym = false; // reset sym state after second keypress } else { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = key.key; } break; case 'q': // ESC if (is_sym) { - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL; - e.kbchar = 0x1b; + e.inputEvent = INPUT_BROKER_CANCEL; + e.kbchar = 0; is_sym = false; // reset sym state after second keypress } else { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = key.key; } break; case 0x08: // Back - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK; + e.inputEvent = INPUT_BROKER_BACK; e.kbchar = key.key; break; case 'e': // sym e if (is_sym) { - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP; - e.kbchar = INPUT_BROKER_MSG_UP; + e.inputEvent = INPUT_BROKER_UP; + e.kbchar = INPUT_BROKER_UP; is_sym = false; // reset sym state after second keypress } else { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = key.key; } break; case 'x': // sym x if (is_sym) { - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN; - e.kbchar = INPUT_BROKER_MSG_DOWN; + e.inputEvent = INPUT_BROKER_DOWN; + e.kbchar = 0; is_sym = false; // reset sym state after second keypress } else { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = key.key; } break; case 's': // sym s if (is_sym) { - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT; + e.inputEvent = INPUT_BROKER_LEFT; e.kbchar = 0x00; // tweak for destSelect is_sym = false; // reset sym state after second keypress } else { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = key.key; } break; case 'f': // sym f if (is_sym) { - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT; + e.inputEvent = INPUT_BROKER_RIGHT; e.kbchar = 0x00; // tweak for destSelect is_sym = false; // reset sym state after second keypress } else { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = key.key; } break; case 0x13: // Code scanner says the SYM key is 0x13 is_sym = !is_sym; - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = is_sym ? INPUT_BROKER_MSG_FN_SYMBOL_ON // send 0xf1 to tell CannedMessages to display that : INPUT_BROKER_MSG_FN_SYMBOL_OFF; // the modifier key is active break; case 0x0a: // apparently Enter on Q10 is a line feed instead of carriage return - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT; + e.inputEvent = INPUT_BROKER_SELECT; break; case 0x00: // nopress - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; break; default: // all other keys - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = key.key; is_sym = false; // reset sym state after second keypress break; } - if (e.inputEvent != meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE) { + if (e.inputEvent != INPUT_BROKER_NONE) { this->notifyObservers(&e); } } @@ -175,57 +175,57 @@ int32_t KbI2cBase::runOnce() while (MPRkeyboard.hasEvent()) { char nextEvent = MPRkeyboard.dequeueEvent(); - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = 0x00; e.source = this->_originName; switch (nextEvent) { case 0x00: // MPR121_NONE - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; e.kbchar = 0x00; break; case 0x90: // MPR121_REBOOT - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = INPUT_BROKER_MSG_REBOOT; break; case 0xb4: // MPR121_LEFT - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT; + e.inputEvent = INPUT_BROKER_LEFT; e.kbchar = 0x00; break; case 0xb5: // MPR121_UP - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP; + e.inputEvent = INPUT_BROKER_UP; e.kbchar = 0x00; break; case 0xb6: // MPR121_DOWN - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN; + e.inputEvent = INPUT_BROKER_DOWN; e.kbchar = 0x00; break; case 0xb7: // MPR121_RIGHT - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT; + e.inputEvent = INPUT_BROKER_RIGHT; e.kbchar = 0x00; break; case 0x1b: // MPR121_ESC - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL; - e.kbchar = 0x1b; + e.inputEvent = INPUT_BROKER_CANCEL; + e.kbchar = 0; break; case 0x08: // MPR121_BSP - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK; + e.inputEvent = INPUT_BROKER_BACK; e.kbchar = 0x08; break; case 0x0d: // MPR121_SELECT - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT; - e.kbchar = 0x0d; + e.inputEvent = INPUT_BROKER_SELECT; + e.kbchar = 0x00; break; default: if (nextEvent > 127) { - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; e.kbchar = 0x00; break; } - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = nextEvent; break; } - if (e.inputEvent != meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE) { + if (e.inputEvent != INPUT_BROKER_NONE) { LOG_DEBUG("MP121 Notifying: %i Char: %i", e.inputEvent, e.kbchar); this->notifyObservers(&e); } @@ -237,57 +237,57 @@ int32_t KbI2cBase::runOnce() InputEvent e; while (TCAKeyboard.hasEvent()) { char nextEvent = TCAKeyboard.dequeueEvent(); - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = 0x00; e.source = this->_originName; switch (nextEvent) { case _TCA8418_NONE: - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; e.kbchar = 0x00; break; case _TCA8418_REBOOT: - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = INPUT_BROKER_MSG_REBOOT; break; case _TCA8418_LEFT: - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT; + e.inputEvent = INPUT_BROKER_LEFT; e.kbchar = 0x00; break; case _TCA8418_UP: - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP; + e.inputEvent = INPUT_BROKER_UP; e.kbchar = 0x00; break; case _TCA8418_DOWN: - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN; + e.inputEvent = INPUT_BROKER_DOWN; e.kbchar = 0x00; break; case _TCA8418_RIGHT: - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT; + e.inputEvent = INPUT_BROKER_RIGHT; e.kbchar = 0x00; break; case _TCA8418_BSP: - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK; + e.inputEvent = INPUT_BROKER_BACK; e.kbchar = 0x08; break; case _TCA8418_SELECT: - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT; - e.kbchar = 0x0d; + e.inputEvent = INPUT_BROKER_SELECT; + e.kbchar = 0x00; break; case _TCA8418_ESC: - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL; - e.kbchar = 0x1b; + e.inputEvent = INPUT_BROKER_CANCEL; + e.kbchar = 0; break; default: if (nextEvent > 127) { - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; e.kbchar = 0x00; break; } - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = nextEvent; break; } - if (e.inputEvent != meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE) { + if (e.inputEvent != INPUT_BROKER_NONE) { LOG_DEBUG("TCA8418 Notifying: %i Char: %c", e.inputEvent, e.kbchar); this->notifyObservers(&e); } @@ -310,7 +310,7 @@ int32_t KbI2cBase::runOnce() if (PrintDataBuf != 0) { LOG_DEBUG("RAK14004 key 0x%x pressed", PrintDataBuf); InputEvent e; - e.inputEvent = MATRIXKEY; + e.inputEvent = INPUT_BROKER_MATRIXKEY; e.source = this->_originName; e.kbchar = PrintDataBuf; this->notifyObservers(&e); @@ -325,138 +325,150 @@ int32_t KbI2cBase::runOnce() if (i2cBus->available()) { char c = i2cBus->read(); InputEvent e; - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; e.source = this->_originName; switch (c) { case 0x71: // This is the button q. If modifier and q pressed, it cancels the input if (is_sym) { is_sym = false; - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL; + e.inputEvent = INPUT_BROKER_CANCEL; } else { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = c; } break; case 0x74: // letter t. if modifier and t pressed call 'tab' if (is_sym) { is_sym = false; - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = 0x09; // TAB Scancode } else { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = c; } break; case 0x6d: // letter m. Modifier makes it mute notifications if (is_sym) { is_sym = false; - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = INPUT_BROKER_MSG_MUTE_TOGGLE; // mute notifications } else { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = c; } break; case 0x6f: // letter o(+). Modifier makes screen increase in brightness if (is_sym) { is_sym = false; - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = INPUT_BROKER_MSG_BRIGHTNESS_UP; // Increase Brightness code } else { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = c; } break; case 0x69: // letter i(-). Modifier makes screen decrease in brightness if (is_sym) { is_sym = false; - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = INPUT_BROKER_MSG_BRIGHTNESS_DOWN; // Decrease Brightness code } else { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = c; } break; case 0x20: // Space. Send network ping like double press does if (is_sym) { is_sym = false; - e.inputEvent = ANYKEY; - e.kbchar = INPUT_BROKER_MSG_SEND_PING; // (fn + space) + e.inputEvent = INPUT_BROKER_ANYKEY; + e.kbchar = INPUT_BROKER_SEND_PING; // (fn + space) } else { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = c; } break; case 0x67: // letter g. toggle gps if (is_sym) { is_sym = false; - e.inputEvent = ANYKEY; - e.kbchar = INPUT_BROKER_MSG_GPS_TOGGLE; + e.inputEvent = INPUT_BROKER_GPS_TOGGLE; + e.kbchar = INPUT_BROKER_GPS_TOGGLE; } else { - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = c; } break; case 0x1b: // ESC - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL; + e.inputEvent = INPUT_BROKER_CANCEL; break; case 0x08: // Back - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK; - e.kbchar = c; + e.inputEvent = INPUT_BROKER_BACK; + e.kbchar = 0; break; case 0xb5: // Up - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP; - e.kbchar = INPUT_BROKER_MSG_UP; + e.inputEvent = INPUT_BROKER_UP; + e.kbchar = 0; break; case 0xb6: // Down - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN; - e.kbchar = INPUT_BROKER_MSG_DOWN; + e.inputEvent = INPUT_BROKER_DOWN; + e.kbchar = 0; break; case 0xb4: // Left - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT; - e.kbchar = INPUT_BROKER_MSG_LEFT; + e.inputEvent = INPUT_BROKER_LEFT; + e.kbchar = 0; break; case 0xb7: // Right - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT; - e.kbchar = INPUT_BROKER_MSG_RIGHT; + e.inputEvent = INPUT_BROKER_RIGHT; + e.kbchar = 0; break; case 0xc: // Modifier key: 0xc is alt+c (Other options could be: 0xea = shift+mic button or 0x4 shift+$(speaker)) // toggle moddifiers button. is_sym = !is_sym; - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = is_sym ? INPUT_BROKER_MSG_FN_SYMBOL_ON // send 0xf1 to tell CannedMessages to display that the : INPUT_BROKER_MSG_FN_SYMBOL_OFF; // modifier key is active break; + case 0x9e: // fn+g INPUT_BROKER_GPS_TOGGLE + e.inputEvent = INPUT_BROKER_GPS_TOGGLE; + e.kbchar = c; + break; + case 0xaf: // fn+space INPUT_BROKER_SEND_PING + e.inputEvent = INPUT_BROKER_SEND_PING; + e.kbchar = c; + break; + case 0x9b: // fn+s INPUT_BROKER_MSG_SHUTDOWN + e.inputEvent = INPUT_BROKER_SHUTDOWN; + e.kbchar = c; + break; + case 0x90: // fn+r INPUT_BROKER_MSG_REBOOT case 0x91: // fn+t - case 0x9b: // fn+s INPUT_BROKER_MSG_SHUTDOWN case 0xac: // fn+m INPUT_BROKER_MSG_MUTE_TOGGLE - case 0x9e: // fn+g INPUT_BROKER_MSG_GPS_TOGGLE - case 0xaf: // fn+space INPUT_BROKER_MSG_SEND_PING + case 0x8b: // fn+del INPUT_BROKEN_MSG_DISMISS_FRAME case 0xAA: // fn+b INPUT_BROKER_MSG_BLUETOOTH_TOGGLE + case 0x8F: // fn+e INPUT_BROKER_MSG_EMOTE_LIST // just pass those unmodified - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = c; break; case 0x0d: // Enter - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT; + e.inputEvent = INPUT_BROKER_SELECT; break; case 0x00: // nopress - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; break; default: // all other keys if (c > 127) { // bogus key value - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; break; } - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = c; is_sym = false; break; } - if (e.inputEvent != meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE) { + if (e.inputEvent != INPUT_BROKER_NONE) { this->notifyObservers(&e); } } diff --git a/src/input/kbMatrixBase.cpp b/src/input/kbMatrixBase.cpp index 51815b525..05f4d8177 100644 --- a/src/input/kbMatrixBase.cpp +++ b/src/input/kbMatrixBase.cpp @@ -73,35 +73,35 @@ int32_t KbMatrixBase::runOnce() LOG_DEBUG("Key 0x%x pressed", key); // reset shift now that we have a keypress InputEvent e; - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; e.source = this->_originName; switch (key) { case 0x1b: // ESC - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL; + e.inputEvent = INPUT_BROKER_CANCEL; break; case 0x08: // Back - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK; - e.kbchar = key; + e.inputEvent = INPUT_BROKER_BACK; + e.kbchar = 0; break; case 0xb5: // Up - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP; + e.inputEvent = INPUT_BROKER_UP; break; case 0xb6: // Down - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN; + e.inputEvent = INPUT_BROKER_DOWN; break; case 0xb4: // Left - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT; - e.kbchar = key; + e.inputEvent = INPUT_BROKER_LEFT; + e.kbchar = 0; break; case 0xb7: // Right - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT; - e.kbchar = key; + e.inputEvent = INPUT_BROKER_RIGHT; + e.kbchar = 0; break; case 0x0d: // Enter - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT; + e.inputEvent = INPUT_BROKER_SELECT; break; case 0x00: // nopress - e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE; + e.inputEvent = INPUT_BROKER_NONE; break; case 0x1a: // Shift shift++; @@ -110,11 +110,11 @@ int32_t KbMatrixBase::runOnce() } break; default: // all other keys - e.inputEvent = ANYKEY; + e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = key; break; } - if (e.inputEvent != meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE) { + if (e.inputEvent != INPUT_BROKER_NONE) { this->notifyObservers(&e); } } diff --git a/src/main.cpp b/src/main.cpp index 2c30d4718..17214b13f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -99,7 +99,24 @@ NRF52Bluetooth *nrf52Bluetooth = nullptr; #endif #if HAS_BUTTON || defined(ARCH_PORTDUINO) -#include "ButtonThread.h" +#include "input/ButtonThread.h" + +#if defined(BUTTON_PIN_TOUCH) +ButtonThread *TouchButtonThread = nullptr; +#endif + +#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO) +ButtonThread *UserButtonThread = nullptr; +#endif + +#if defined(ALT_BUTTON_PIN) +ButtonThread *BackButtonThread = nullptr; +#endif + +#if defined(CANCEL_BUTTON_PIN) +ButtonThread *CancelButtonThread = nullptr; +#endif + #endif #include "AmbientLightingThread.h" @@ -169,6 +186,8 @@ ScanI2C::DeviceAddress screen_found = ScanI2C::ADDRESS_NONE; ScanI2C::DeviceAddress cardkb_found = ScanI2C::ADDRESS_NONE; // 0x02 for RAK14004, 0x00 for cardkb, 0x10 for T-Deck uint8_t kb_model; +// global bool to record that a kb is present +bool kb_found = false; // The I2C address of the RTC Module (if found) ScanI2C::DeviceAddress rtc_found = ScanI2C::ADDRESS_NONE; @@ -220,64 +239,6 @@ const char *getDeviceName() return name; } -#if defined(ELECROW_ThinkNode_M1) || defined(ELECROW_ThinkNode_M2) -static int32_t ledBlinkCount = 0; - -static int32_t elecrowLedBlinker() -{ - // are we in alert buzzer mode? -#if HAS_BUTTON - if (buttonThread->isBuzzing()) { - // blink LED three times for 3 seconds, then 3 times for a second, with one second pause - if (ledBlinkCount % 2) { // odd means LED OFF - ledBlink.set(false); - ledBlinkCount++; - if (ledBlinkCount >= 12) - ledBlinkCount = 0; - noTone(PIN_BUZZER); - return 1000; - } else { - if (ledBlinkCount < 6) { - ledBlink.set(true); - tone(PIN_BUZZER, 4000, 3000); - ledBlinkCount++; - return 3000; - } else { - ledBlink.set(true); - tone(PIN_BUZZER, 4000, 1000); - ledBlinkCount++; - return 1000; - } - } - } else { -#endif - ledBlinkCount = 0; - if (config.device.led_heartbeat_disabled) - return 1000; - - static bool ledOn; - // remain on when fully charged or discharging above 10% - if ((powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() >= 100) || - (!powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() >= 10)) { - ledOn = true; - } else { - ledOn ^= 1; - } - ledBlink.set(ledOn); - // when charging, blink 0.5Hz square wave rate to indicate that - if (powerStatus->getIsCharging()) { - return 500; - } - // Blink rapidly when almost empty or if battery is not connected - if ((!powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() < 10) || !powerStatus->getHasBattery()) { - return 250; - } -#if HAS_BUTTON - } -#endif - return 1000; -} -#else static int32_t ledBlinker() { // Still set up the blinking (heartbeat) interval but skip code path below, so LED will blink if @@ -293,7 +254,6 @@ static int32_t ledBlinker() // have a very sparse duty cycle of LED being on, unless charging, then blink 0.5Hz square wave rate to indicate that return powerStatus->getIsCharging() ? 1000 : (ledOn ? 1 : 1000); } -#endif uint32_t timeLastPowered = 0; @@ -382,11 +342,9 @@ void setup() SPISettings spiSettings(4000000, MSBFIRST, SPI_MODE0); #endif -#if !HAS_TFT meshtastic_Config_DisplayConfig_OledType screen_model = meshtastic_Config_DisplayConfig_OledType::meshtastic_Config_DisplayConfig_OledType_OLED_AUTO; OLEDDISPLAY_GEOMETRY screen_geometry = GEOMETRY_128_64; -#endif #ifdef USE_SEGGER auto mode = false ? SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL : SEGGER_RTT_MODE_NO_BLOCK_TRIM; @@ -475,6 +433,10 @@ void setup() gpio_pullup_en((gpio_num_t)(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN)); delay(10); #endif +#ifdef BUTTON_NEED_PULLUP2 + gpio_pullup_en((gpio_num_t)BUTTON_NEED_PULLUP2); + delay(10); +#endif #endif #endif #endif @@ -485,7 +447,7 @@ void setup() #if defined(ELECROW_ThinkNode_M1) || defined(ELECROW_ThinkNode_M2) // The ThinkNodes have their own blink logic - ledPeriodic = new Periodic("Blink", elecrowLedBlinker); + // ledPeriodic = new Periodic("Blink", elecrowLedBlinker); #else ledPeriodic = new Periodic("Blink", ledBlinker); #endif @@ -536,10 +498,6 @@ void setup() digitalWrite(AQ_SET_PIN, HIGH); #endif -#if HAS_TFT - tftSetup(); -#endif - // Currently only the tbeam has a PMU // PMU initialization needs to be placed before i2c scanning power = new Power(); @@ -602,7 +560,6 @@ void setup() } #endif -#if !HAS_TFT auto screenInfo = i2cScanner->firstScreen(); screen_found = screenInfo.type != ScanI2C::DeviceType::NONE ? screenInfo.address : ScanI2C::ADDRESS_NONE; @@ -620,16 +577,18 @@ void setup() screen_model = meshtastic_Config_DisplayConfig_OledType::meshtastic_Config_DisplayConfig_OledType_OLED_AUTO; } } -#endif #define UPDATE_FROM_SCANNER(FIND_FN) - +#if defined(USE_VIRTUAL_KEYBOARD) + kb_found = true; +#endif auto rtc_info = i2cScanner->firstRTC(); rtc_found = rtc_info.type != ScanI2C::DeviceType::NONE ? rtc_info.address : rtc_found; auto kb_info = i2cScanner->firstKeyboard(); if (kb_info.type != ScanI2C::DeviceType::NONE) { + kb_found = true; cardkb_found = kb_info.address; switch (kb_info.type) { case ScanI2C::DeviceType::RAK14004: @@ -768,6 +727,12 @@ void setup() // but we need to do this after main cpu init (esp32setup), because we need the random seed set nodeDB = new NodeDB; +#if HAS_TFT + if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + tftSetup(); + } +#endif + // If we're taking on the repeater role, use NextHopRouter and turn off 3V3_S rail because peripherals are not needed if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) { router = new NextHopRouter(); @@ -777,11 +742,6 @@ void setup() } else router = new ReliableRouter(); -#if HAS_BUTTON || defined(ARCH_PORTDUINO) - // Buttons. Moved here cause we need NodeDB to be initialized - buttonThread = new ButtonThread(); -#endif - // only play start melody when role is not tracker or sensor if (config.power.is_power_saving == true && IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_TRACKER, @@ -790,11 +750,9 @@ void setup() else playStartMelody(); -#if !HAS_TFT // fixed screen override? if (config.display.oled != meshtastic_Config_DisplayConfig_OledType_OLED_AUTO) screen_model = config.display.oled; -#endif #if defined(USE_SH1107) screen_model = meshtastic_Config_DisplayConfig_OledType_OLED_SH1107; // set dimension of 128x128 @@ -864,8 +822,23 @@ void setup() // Initialize the screen first so we can show the logo while we start up everything else. #if HAS_SCREEN - screen = new graphics::Screen(screen_found, screen_model, screen_geometry); + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + +#if defined(ST7701_CS) || defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \ + defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) + screen = new graphics::Screen(screen_found, screen_model, screen_geometry); +#elif defined(ARCH_PORTDUINO) + if ((screen_found.port != ScanI2C::I2CPort::NO_I2C || settingsMap[displayPanel]) && + config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + screen = new graphics::Screen(screen_found, screen_model, screen_geometry); + } +#else + if (screen_found.port != ScanI2C::I2CPort::NO_I2C) + screen = new graphics::Screen(screen_found, screen_model, screen_geometry); #endif + } +#endif // HAS_SCREEN + // setup TZ prior to time actions. #if !MESHTASTIC_EXCLUDE_TZ LOG_DEBUG("Use compiled/slipstreamed %s", slipstreamTZString); // important, removing this clobbers our magic string @@ -937,6 +910,117 @@ void setup() // Now that the mesh service is created, create any modules setupModules(); +// buttons are now inputBroker, so have to come after setupModules +#if HAS_BUTTON + int pullup_sense = 0; +#ifdef INPUT_PULLUP_SENSE + // Some platforms (nrf52) have a SENSE variant which allows wake from sleep - override what OneButton did +#ifdef BUTTON_SENSE_TYPE + pullup_sense = BUTTON_SENSE_TYPE; +#else + pullup_sense = INPUT_PULLUP_SENSE; +#endif +#endif +#if defined(ARCH_PORTDUINO) + + if (settingsMap.count(userButtonPin) != 0 && settingsMap[userButtonPin] != RADIOLIB_NC) { + + LOG_DEBUG("Use GPIO%02d for button", settingsMap[userButtonPin]); + UserButtonThread = new ButtonThread("UserButton"); + if (screen) + UserButtonThread->initButton( + settingsMap[userButtonPin], true, true, INPUT_PULLUP, // pull up bias + []() { + UserButtonThread->userButton.tick(); + runASAP = true; + BaseType_t higherWake = 0; + mainDelay.interruptFromISR(&higherWake); + }, + INPUT_BROKER_USER_PRESS, INPUT_BROKER_SELECT); + } +#endif + +#ifdef BUTTON_PIN_TOUCH + TouchButtonThread = new ButtonThread("BackButton"); + TouchButtonThread->initButton( + BUTTON_PIN_TOUCH, true, true, pullup_sense, + []() { + TouchButtonThread->userButton.tick(); + runASAP = true; + BaseType_t higherWake = 0; + mainDelay.interruptFromISR(&higherWake); + }, + INPUT_BROKER_NONE, INPUT_BROKER_BACK); +#endif + +#if defined(CANCEL_BUTTON_PIN) + // Buttons. Moved here cause we need NodeDB to be initialized + CancelButtonThread = new ButtonThread("CancelButton"); + CancelButtonThread->initButton( + CANCEL_BUTTON_PIN, CANCEL_BUTTON_ACTIVE_LOW, CANCEL_BUTTON_ACTIVE_PULLUP, pullup_sense, + []() { + CancelButtonThread->userButton.tick(); + runASAP = true; + BaseType_t higherWake = 0; + mainDelay.interruptFromISR(&higherWake); + }, + INPUT_BROKER_CANCEL, INPUT_BROKER_SHUTDOWN, 4000); +#endif + +#if defined(ALT_BUTTON_PIN) + // Buttons. Moved here cause we need NodeDB to be initialized + BackButtonThread = new ButtonThread("BackButton"); + BackButtonThread->initButton( + ALT_BUTTON_PIN, ALT_BUTTON_ACTIVE_LOW, ALT_BUTTON_ACTIVE_PULLUP, pullup_sense, + []() { + BackButtonThread->userButton.tick(); + runASAP = true; + BaseType_t higherWake = 0; + mainDelay.interruptFromISR(&higherWake); + }, + INPUT_BROKER_ALT_PRESS, INPUT_BROKER_ALT_LONG, 500); +#endif + +#if defined(BUTTON_PIN) +#if defined(USERPREFS_BUTTON_PIN) + int _pinNum = config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN; +#else + int _pinNum = config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN; +#endif +#ifndef BUTTON_ACTIVE_LOW +#define BUTTON_ACTIVE_LOW true +#endif +#ifndef BUTTON_ACTIVE_PULLUP +#define BUTTON_ACTIVE_PULLUP true +#endif + + // Buttons. Moved here cause we need NodeDB to be initialized + // If your variant.h has a BUTTON_PIN defined, go ahead and define BUTTON_ACTIVE_LOW and BUTTON_ACTIVE_PULLUP + UserButtonThread = new ButtonThread("UserButton"); + if (screen) + UserButtonThread->initButton( + _pinNum, BUTTON_ACTIVE_LOW, BUTTON_ACTIVE_PULLUP, pullup_sense, + []() { + UserButtonThread->userButton.tick(); + runASAP = true; + BaseType_t higherWake = 0; + mainDelay.interruptFromISR(&higherWake); + }, + INPUT_BROKER_USER_PRESS, INPUT_BROKER_SELECT, 500, INPUT_BROKER_NONE, INPUT_BROKER_SHUTDOWN); + else + UserButtonThread->initButton( + _pinNum, BUTTON_ACTIVE_LOW, BUTTON_ACTIVE_PULLUP, pullup_sense, + []() { + UserButtonThread->userButton.tick(); + runASAP = true; + BaseType_t higherWake = 0; + mainDelay.interruptFromISR(&higherWake); + }, + INPUT_BROKER_USER_PRESS, INPUT_BROKER_SHUTDOWN, 5000, INPUT_BROKER_SEND_PING, INPUT_BROKER_GPS_TOGGLE); +#endif + +#endif + #ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS // After modules are setup, so we can observe modules setupNicheGraphics(); @@ -959,19 +1043,19 @@ void setup() // the current region name) #if defined(ST7701_CS) || defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \ defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) - screen->setup(); + if (screen) + screen->setup(); #elif defined(ARCH_PORTDUINO) - if (screen_found.port != ScanI2C::I2CPort::NO_I2C || settingsMap[displayPanel]) { + if ((screen_found.port != ScanI2C::I2CPort::NO_I2C || settingsMap[displayPanel]) && + config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { screen->setup(); } #else - if (screen_found.port != ScanI2C::I2CPort::NO_I2C) + if (screen_found.port != ScanI2C::I2CPort::NO_I2C && screen) screen->setup(); #endif #endif - screen->print("Started...\n"); - #ifdef PIN_PWR_DELAY_MS // This may be required to give the peripherals time to power up. delay(PIN_PWR_DELAY_MS); @@ -1230,9 +1314,12 @@ void setup() LOG_WARN("LoRa chip does not support 2.4GHz. Revert to unset"); config.lora.region = meshtastic_Config_LoRaConfig_RegionCode_UNSET; nodeDB->saveToDisk(SEGMENT_CONFIG); + if (!rIf->reconfigure()) { LOG_WARN("Reconfigure failed, rebooting"); - screen->startAlert("Rebooting..."); + if (screen) { + screen->showOverlayBanner("Rebooting..."); + } rebootAtMsec = millis() + 5000; } } diff --git a/src/main.h b/src/main.h index beeb1f940..79094e2d3 100644 --- a/src/main.h +++ b/src/main.h @@ -31,13 +31,13 @@ extern HardwareSPI *LoraSPI; extern ScanI2C::DeviceAddress screen_found; extern ScanI2C::DeviceAddress cardkb_found; extern uint8_t kb_model; +extern bool kb_found; extern ScanI2C::DeviceAddress rtc_found; extern ScanI2C::DeviceAddress accelerometer_found; extern ScanI2C::FoundDevice rgb_found; extern bool eink_found; extern bool pmu_found; -extern bool isCharging; extern bool isUSBPowered; #ifdef T_WATCH_S3 diff --git a/src/mesh/MeshPacketQueue.cpp b/src/mesh/MeshPacketQueue.cpp index 0c312fd1e..f8af81321 100644 --- a/src/mesh/MeshPacketQueue.cpp +++ b/src/mesh/MeshPacketQueue.cpp @@ -118,10 +118,10 @@ meshtastic_MeshPacket *MeshPacketQueue::remove(NodeNum from, PacketId id, bool t } /* Attempt to find a packet from this queue. Return true if it was found. */ -bool MeshPacketQueue::find(NodeNum from, PacketId id) +bool MeshPacketQueue::find(const NodeNum from, const PacketId id) { for (auto it = queue.begin(); it != queue.end(); it++) { - auto p = (*it); + const auto p = (*it); if (getFrom(p) == from && p->id == id) { return true; } diff --git a/src/mesh/MeshPacketQueue.h b/src/mesh/MeshPacketQueue.h index 6b2c3998a..1b338f9ed 100644 --- a/src/mesh/MeshPacketQueue.h +++ b/src/mesh/MeshPacketQueue.h @@ -39,5 +39,5 @@ class MeshPacketQueue meshtastic_MeshPacket *remove(NodeNum from, PacketId id, bool tx_normal = true, bool tx_late = true); /* Attempt to find a packet from this queue. Return true if it was found. */ - bool find(NodeNum from, PacketId id); + bool find(const NodeNum from, const PacketId id); }; \ No newline at end of file diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index b1ec7b347..d13864bd9 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -511,6 +511,10 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) config.lora.override_duty_cycle = false; config.lora.config_ok_to_mqtt = false; +#if HAS_TFT // For the devices that support MUI, default to that + config.display.displaymode = meshtastic_Config_DisplayConfig_DisplayMode_COLOR; +#endif + #ifdef USERPREFS_CONFIG_DEVICE_ROLE // Restrict ROUTER*, LOST AND FOUND, and REPEATER roles for security reasons if (IS_ONE_OF(USERPREFS_CONFIG_DEVICE_ROLE, meshtastic_Config_DeviceConfig_Role_ROUTER, @@ -788,15 +792,7 @@ void NodeDB::installDefaultModuleConfig() moduleConfig.external_notification.output_ms = 1000; moduleConfig.external_notification.nag_timeout = 60; #endif -#ifdef BUTTON_SECONDARY_CANNEDMESSAGES - // Use a board's second built-in button as input source for canned messages - moduleConfig.canned_message.enabled = true; - moduleConfig.canned_message.inputbroker_pin_press = BUTTON_PIN_SECONDARY; - strcpy(moduleConfig.canned_message.allow_input_source, "scanAndSelect"); -#endif - moduleConfig.has_canned_message = true; - #if USERPREFS_MQTT_ENABLED && !MESHTASTIC_EXCLUDE_MQTT moduleConfig.mqtt.enabled = true; #endif @@ -1561,7 +1557,7 @@ void NodeDB::addFromContact(meshtastic_SharedContact contact) info->bitfield |= NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK; // Mark the node's key as manually verified to indicate trustworthiness. updateGUIforNode = info; - powerFSM.trigger(EVENT_NODEDB_UPDATED); + // powerFSM.trigger(EVENT_NODEDB_UPDATED); This event has been retired notifyObservers(true); // Force an update whether or not our node counts have changed } saveNodeDatabaseToDisk(); @@ -1620,7 +1616,6 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde if (changed) { updateGUIforNode = info; - powerFSM.trigger(EVENT_NODEDB_UPDATED); notifyObservers(true); // Force an update whether or not our node counts have changed // We just changed something about a User, @@ -1891,10 +1886,6 @@ bool NodeDB::restorePreferences(meshtastic_AdminMessage_BackupLocation location, /// Record an error that should be reported via analytics void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, const char *filename) { - // Print error to screen and serial port - String lcd = String("Critical error ") + code + "!\n"; - if (screen) - screen->print(lcd.c_str()); if (filename) { LOG_ERROR("NOTE! Record critical error %d at %s:%lu", code, filename, address); } else { diff --git a/src/mesh/PacketHistory.cpp b/src/mesh/PacketHistory.cpp index 6b8ccde76..f42b151c8 100644 --- a/src/mesh/PacketHistory.cpp +++ b/src/mesh/PacketHistory.cpp @@ -8,7 +8,8 @@ #include "Throttle.h" #define PACKETHISTORY_MAX \ - max((int)(MAX_NUM_NODES * 2.0), 100) // x2..3 Should suffice. Empirical setup. 16B per record malloc'ed, but no less than 100 + max((u_int32_t)(MAX_NUM_NODES * 2.0), \ + (u_int32_t)100) // x2..3 Should suffice. Empirical setup. 16B per record malloc'ed, but no less than 100 #define RECENT_WARN_AGE (10 * 60 * 1000L) // Warn if the packet that gets removed was more recent than 10 min diff --git a/src/mesh/eth/ethClient.cpp b/src/mesh/eth/ethClient.cpp index 70c6e3fe4..9c92a6c27 100644 --- a/src/mesh/eth/ethClient.cpp +++ b/src/mesh/eth/ethClient.cpp @@ -64,7 +64,9 @@ static int32_t reconnectETH() } #if !MESHTASTIC_EXCLUDE_SOCKETAPI - initApiServer(); + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + initApiServer(); + } #endif ethStartupComplete = true; diff --git a/src/mesh/http/ContentHandler.cpp b/src/mesh/http/ContentHandler.cpp index 5841fe478..42ebb8417 100644 --- a/src/mesh/http/ContentHandler.cpp +++ b/src/mesh/http/ContentHandler.cpp @@ -903,7 +903,8 @@ void handleBlinkLED(HTTPRequest *req, HTTPResponse *res) } } else { #if HAS_SCREEN - screen->blink(); + if (screen) + screen->blink(); #endif } diff --git a/src/mesh/http/WebServer.cpp b/src/mesh/http/WebServer.cpp index 5f6ad9eb3..bf170de59 100644 --- a/src/mesh/http/WebServer.cpp +++ b/src/mesh/http/WebServer.cpp @@ -154,7 +154,8 @@ void createSSLCert() esp_task_wdt_reset(); #if HAS_SCREEN if (millis() / 1000 >= 3) { - screen->setSSLFrames(); + if (screen) + screen->setSSLFrames(); } #endif } diff --git a/src/mesh/wifi/WiFiAPClient.cpp b/src/mesh/wifi/WiFiAPClient.cpp index 115817aab..24be97ad7 100644 --- a/src/mesh/wifi/WiFiAPClient.cpp +++ b/src/mesh/wifi/WiFiAPClient.cpp @@ -128,10 +128,14 @@ static void onNetworkConnected() } #if defined(ARCH_ESP32) && !MESHTASTIC_EXCLUDE_WEBSERVER - initWebServer(); + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + initWebServer(); + } #endif #if !MESHTASTIC_EXCLUDE_SOCKETAPI - initApiServer(); + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + initApiServer(); + } #endif APStartupComplete = true; } diff --git a/src/meshUtils.h b/src/meshUtils.h index 47d42b41b..35b88e8b2 100644 --- a/src/meshUtils.h +++ b/src/meshUtils.h @@ -11,6 +11,14 @@ template constexpr const T &clamp(const T &v, const T &lo, const T &hi return (v < lo) ? lo : (hi < v) ? hi : v; } +#if HAS_SCREEN +#define IF_SCREEN(X) \ + if (screen) \ + X; +#else +#define IF_SCREEN(...) +#endif + #if (defined(ARCH_PORTDUINO) && !defined(STRNSTR)) #define STRNSTR #include diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 551602f00..b68a3a1a4 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -5,6 +5,7 @@ #include "PowerFSM.h" #include "RTC.h" #include "SPILock.h" +#include "input/InputBroker.h" #include "meshUtils.h" #include #include // for better whitespace handling @@ -223,14 +224,16 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta #if defined(ARCH_ESP32) #if !MESHTASTIC_EXCLUDE_BLUETOOTH if (!BleOta::getOtaAppVersion().isEmpty()) { - screen->startFirmwareUpdateScreen(); + if (screen) + screen->startFirmwareUpdateScreen(); BleOta::switchToOtaApp(); LOG_INFO("Rebooting to BLE OTA"); } #endif #if !MESHTASTIC_EXCLUDE_WIFI if (WiFiOTA::trySwitchToOTA()) { - screen->startFirmwareUpdateScreen(); + if (screen) + screen->startFirmwareUpdateScreen(); WiFiOTA::saveConfig(&config.network); LOG_INFO("Rebooting to WiFi OTA"); } @@ -320,6 +323,8 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta if (node != NULL) { node->is_favorite = true; saveChanges(SEGMENT_NODEDATABASE, false); + if (screen) + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); // <-- Rebuild screens } break; } @@ -329,6 +334,8 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta if (node != NULL) { node->is_favorite = false; saveChanges(SEGMENT_NODEDATABASE, false); + if (screen) + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); // <-- Rebuild screens } break; } @@ -443,6 +450,11 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta #endif break; } + case meshtastic_AdminMessage_send_input_event_tag: { + LOG_INFO("Client requesting to send input event"); + handleSendInputEvent(r->send_input_event); + break; + } #ifdef ARCH_PORTDUINO case meshtastic_AdminMessage_exit_simulator_tag: LOG_INFO("Exiting simulator"); @@ -530,7 +542,7 @@ void AdminModule::handleSetOwner(const meshtastic_User &o) if (owner.has_is_unmessagable != o.has_is_unmessagable || (o.has_is_unmessagable && owner.is_unmessagable != o.is_unmessagable)) { changed = 1; - owner.has_is_unmessagable = o.has_is_unmessagable || o.has_is_unmessagable; + owner.has_is_unmessagable = owner.has_is_unmessagable || o.has_is_unmessagable; owner.is_unmessagable = o.is_unmessagable; } @@ -643,8 +655,12 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) config.has_display = true; if (config.display.screen_on_secs == c.payload_variant.display.screen_on_secs && config.display.flip_screen == c.payload_variant.display.flip_screen && - config.display.oled == c.payload_variant.display.oled) { + config.display.oled == c.payload_variant.display.oled && + config.display.displaymode == c.payload_variant.display.displaymode) { requiresReboot = false; + } else if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR && + c.payload_variant.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + config.bluetooth.enabled = false; } #if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR if (config.display.wake_on_tap_or_motion == false && c.payload_variant.display.wake_on_tap_or_motion == true && @@ -1157,7 +1173,8 @@ void AdminModule::handleGetDeviceUIConfig(const meshtastic_MeshPacket &req) void AdminModule::reboot(int32_t seconds) { LOG_INFO("Reboot in %d seconds", seconds); - screen->startAlert("Rebooting..."); + if (screen) + screen->showOverlayBanner("Rebooting...", 0); // stays on screen rebootAtMsec = (seconds < 0) ? 0 : (millis() + seconds * 1000); } @@ -1288,6 +1305,39 @@ bool AdminModule::messageIsRequest(const meshtastic_AdminMessage *r) return false; } +void AdminModule::handleSendInputEvent(const meshtastic_AdminMessage_InputEvent &inputEvent) +{ + LOG_DEBUG("Processing input event: event_code=%u, kb_char=%u, touch_x=%u, touch_y=%u", inputEvent.event_code, + inputEvent.kb_char, inputEvent.touch_x, inputEvent.touch_y); + + // Validate input parameters + if (inputEvent.event_code > INPUT_BROKER_ANYKEY) { + LOG_WARN("Invalid input event code: %u", inputEvent.event_code); + return; + } + + // Create InputEvent for injection + InputEvent event = {.inputEvent = (input_broker_event)inputEvent.event_code, + .kbchar = (unsigned char)inputEvent.kb_char, + .touchX = inputEvent.touch_x, + .touchY = inputEvent.touch_y}; + + // Log the event being injected + LOG_INFO("Injecting input event from admin: source=%s, event=%u, char=%c(%u), touch=(%u,%u)", event.source, event.inputEvent, + (event.kbchar >= 32 && event.kbchar <= 126) ? event.kbchar : '?', event.kbchar, event.touchX, event.touchY); + + // Wake the device if asleep + powerFSM.trigger(EVENT_INPUT); +#if !defined(MESHTASTIC_EXCLUDE_INPUTBROKER) + // Inject the event through InputBroker + if (inputBroker) { + inputBroker->injectInputEvent(&event); + } else { + LOG_ERROR("InputBroker not available for event injection"); + } +#endif +} + void AdminModule::sendWarning(const char *message) { meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); diff --git a/src/modules/AdminModule.h b/src/modules/AdminModule.h index 246d39e37..5638e57e7 100644 --- a/src/modules/AdminModule.h +++ b/src/modules/AdminModule.h @@ -54,6 +54,7 @@ class AdminModule : public ProtobufModule, public Obser void handleSetChannel(); void handleSetHamMode(const meshtastic_HamParameters &req); void handleStoreDeviceUIConfig(const meshtastic_DeviceUIConfig &uicfg); + void handleSendInputEvent(const meshtastic_AdminMessage_InputEvent &inputEvent); void reboot(int32_t seconds); void setPassKey(meshtastic_AdminMessage *res); diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index c16c0e4b3..b24f3ca00 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -8,14 +8,16 @@ #include "FSCommon.h" #include "MeshService.h" #include "NodeDB.h" -#include "PowerFSM.h" // needed for button bypass #include "SPILock.h" +#include "buzz.h" #include "detect/ScanI2C.h" -#include "input/ScanAndSelect.h" +#include "graphics/Screen.h" +#include "graphics/SharedUIDisplay.h" +#include "graphics/emotes.h" +#include "graphics/images.h" +#include "main.h" // for cardkb_found #include "mesh/generated/meshtastic/cannedmessages.pb.h" #include "modules/AdminModule.h" - -#include "main.h" // for cardkb_found #include "modules/ExternalNotificationModule.h" // for buzzer control #if !MESHTASTIC_EXCLUDE_GPS #include "GPS.h" @@ -35,6 +37,7 @@ #define INACTIVATE_AFTER_MS 20000 extern ScanI2C::DeviceAddress cardkb_found; +extern bool graphics::isMuted; static const char *cannedMessagesConfigFile = "/prefs/cannedConf.proto"; @@ -45,358 +48,763 @@ CannedMessageModule *cannedMessageModule; CannedMessageModule::CannedMessageModule() : SinglePortModule("canned", meshtastic_PortNum_TEXT_MESSAGE_APP), concurrency::OSThread("CannedMessage") { - if (moduleConfig.canned_message.enabled || CANNED_MESSAGE_MODULE_ENABLE) { - this->loadProtoForModule(); - if ((this->splitConfiguredMessages() <= 0) && (cardkb_found.address == 0x00) && !INPUTBROKER_MATRIX_TYPE && - !CANNED_MESSAGE_MODULE_ENABLE) { - LOG_INFO("CannedMessageModule: No messages are configured. Module is disabled"); - this->runState = CANNED_MESSAGE_RUN_STATE_DISABLED; - disable(); - } else { - LOG_INFO("CannedMessageModule is enabled"); - - // T-Watch interface currently has no way to select destination type, so default to 'node' -#if defined(USE_VIRTUAL_KEYBOARD) - this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NODE; -#endif - - this->inputObserver.observe(inputBroker); - } - } else { + this->loadProtoForModule(); + if ((this->splitConfiguredMessages() <= 0) && (cardkb_found.address == 0x00) && !INPUTBROKER_MATRIX_TYPE && + !CANNED_MESSAGE_MODULE_ENABLE) { + LOG_INFO("CannedMessageModule: No messages are configured. Module is disabled"); this->runState = CANNED_MESSAGE_RUN_STATE_DISABLED; disable(); + } else { + LOG_INFO("CannedMessageModule is enabled"); + this->inputObserver.observe(inputBroker); } } +void CannedMessageModule::LaunchWithDestination(NodeNum newDest, uint8_t newChannel) +{ + dest = newDest; + channel = newChannel; + // Always select the first real canned message on activation + int firstRealMsgIdx = 0; + for (int i = 0; i < messagesCount; ++i) { + if (strcmp(messages[i], "[Select Destination]") != 0 && strcmp(messages[i], "[Exit]") != 0 && + strcmp(messages[i], "[---- Free Text ----]") != 0) { + firstRealMsgIdx = i; + break; + } + } + currentMessageIndex = firstRealMsgIdx; + + // This triggers the canned message list + runState = CANNED_MESSAGE_RUN_STATE_ACTIVE; + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); +} + +void CannedMessageModule::LaunchFreetextWithDestination(NodeNum newDest, uint8_t newChannel) +{ + dest = newDest; + channel = newChannel; + runState = CANNED_MESSAGE_RUN_STATE_FREETEXT; + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); +} + +static bool returnToCannedList = false; +bool hasKeyForNode(const meshtastic_NodeInfoLite *node) +{ + return node && node->has_user && node->user.public_key.size > 0; +} /** * @brief Items in array this->messages will be set to be pointing on the right * starting points of the string this->messageStore * * @return int Returns the number of messages found. */ -// FIXME: This is just one set of messages now + int CannedMessageModule::splitConfiguredMessages() { - int messageIndex = 0; int i = 0; String canned_messages = cannedMessageModuleConfig.messages; -#if defined(USE_VIRTUAL_KEYBOARD) - String separator = canned_messages.length() ? "|" : ""; - - canned_messages = "[---- Free Text ----]" + separator + canned_messages; -#endif - - // collect all the message parts + // Copy all message parts into the buffer strncpy(this->messageStore, canned_messages.c_str(), sizeof(this->messageStore)); - // The first message points to the beginning of the store. - this->messages[messageIndex++] = this->messageStore; + // Temporary array to allow for insertion + const char *tempMessages[CANNED_MESSAGE_MODULE_MESSAGE_MAX_COUNT + 3] = {0}; + int tempCount = 0; + // Insert at position 0 (top) + tempMessages[tempCount++] = "[Select Destination]"; + +#if defined(USE_VIRTUAL_KEYBOARD) + // Add a "Free Text" entry at the top if using a keyboard + tempMessages[tempCount++] = "[-- Free Text --]"; +#endif + + // First message always starts at buffer start + tempMessages[tempCount++] = this->messageStore; int upTo = strlen(this->messageStore) - 1; + // Walk buffer, splitting on '|' while (i < upTo) { if (this->messageStore[i] == '|') { - // Message ending found, replace it with string-end character. - this->messageStore[i] = '\0'; - - // hit our max messages, bail - if (messageIndex >= CANNED_MESSAGE_MODULE_MESSAGE_MAX_COUNT) { - this->messagesCount = messageIndex; - return this->messagesCount; - } - - // Next message starts after pipe (|) just found. - this->messages[messageIndex++] = (this->messageStore + i + 1); + this->messageStore[i] = '\0'; // End previous message + if (tempCount >= CANNED_MESSAGE_MODULE_MESSAGE_MAX_COUNT) + break; + tempMessages[tempCount++] = (this->messageStore + i + 1); } i += 1; } - if (strlen(this->messages[messageIndex - 1]) > 0) { - // We have a last message. - LOG_DEBUG("CannedMessage %d is: '%s'", messageIndex - 1, this->messages[messageIndex - 1]); - this->messagesCount = messageIndex; - } else { - this->messagesCount = messageIndex - 1; + + // Add [Exit] as the last entry + tempMessages[tempCount++] = "[Exit]"; + + // Copy to the member array + for (int k = 0; k < tempCount; ++k) { + this->messages[k] = (char *)tempMessages[k]; } + this->messagesCount = tempCount; return this->messagesCount; } +void CannedMessageModule::drawHeader(OLEDDisplay *display, int16_t x, int16_t y, char *buffer) +{ + if (display->getWidth() > 128) { + if (this->dest == NODENUM_BROADCAST) { + display->drawStringf(x, y, buffer, "To: Broadcast@%s", channels.getName(this->channel)); + } else { + display->drawStringf(x, y, buffer, "To: %s", getNodeName(this->dest)); + } + } else { + if (this->dest == NODENUM_BROADCAST) { + display->drawStringf(x, y, buffer, "To: Broadc@%.5s", channels.getName(this->channel)); + } else { + display->drawStringf(x, y, buffer, "To: %s", getNodeName(this->dest)); + } + } +} +void CannedMessageModule::resetSearch() +{ + LOG_INFO("Resetting search, restoring full destination list"); + + int previousDestIndex = destIndex; + + searchQuery = ""; + updateDestinationSelectionList(); + + // Adjust scrollIndex so previousDestIndex is still visible + int totalEntries = activeChannelIndices.size() + filteredNodes.size(); + this->visibleRows = (displayHeight - FONT_HEIGHT_SMALL * 2) / FONT_HEIGHT_SMALL; + if (this->visibleRows < 1) + this->visibleRows = 1; + int maxScrollIndex = std::max(0, totalEntries - visibleRows); + scrollIndex = std::min(std::max(previousDestIndex - (visibleRows / 2), 0), maxScrollIndex); + + lastUpdateMillis = millis(); + requestFocus(); +} +void CannedMessageModule::updateDestinationSelectionList() +{ + static size_t lastNumMeshNodes = 0; + static String lastSearchQuery = ""; + + size_t numMeshNodes = nodeDB->getNumMeshNodes(); + bool nodesChanged = (numMeshNodes != lastNumMeshNodes); + lastNumMeshNodes = numMeshNodes; + + // Early exit if nothing changed + if (searchQuery == lastSearchQuery && !nodesChanged) + return; + lastSearchQuery = searchQuery; + needsUpdate = false; + + this->filteredNodes.clear(); + this->activeChannelIndices.clear(); + + NodeNum myNodeNum = nodeDB->getNodeNum(); + String lowerSearchQuery = searchQuery; + lowerSearchQuery.toLowerCase(); + + // Preallocate space to reduce reallocation + this->filteredNodes.reserve(numMeshNodes); + + for (size_t i = 0; i < numMeshNodes; ++i) { + meshtastic_NodeInfoLite *node = nodeDB->getMeshNodeByIndex(i); + if (!node || node->num == myNodeNum) + continue; + + const String &nodeName = node->user.long_name; + + if (searchQuery.length() == 0) { + this->filteredNodes.push_back({node, sinceLastSeen(node)}); + } else { + // Avoid unnecessary lowercase conversion if already matched + String lowerNodeName = nodeName; + lowerNodeName.toLowerCase(); + + if (lowerNodeName.indexOf(lowerSearchQuery) != -1) { + this->filteredNodes.push_back({node, sinceLastSeen(node)}); + } + } + } + + // Populate active channels + std::vector seenChannels; + seenChannels.reserve(channels.getNumChannels()); + for (uint8_t i = 0; i < channels.getNumChannels(); ++i) { + String name = channels.getName(i); + if (name.length() > 0 && std::find(seenChannels.begin(), seenChannels.end(), name) == seenChannels.end()) { + this->activeChannelIndices.push_back(i); + seenChannels.push_back(name); + } + } + + // Sort by favorite, then last heard + std::sort(this->filteredNodes.begin(), this->filteredNodes.end(), [](const NodeEntry &a, const NodeEntry &b) { + if (a.node->is_favorite != b.node->is_favorite) + return a.node->is_favorite > b.node->is_favorite; + return a.lastHeard < b.lastHeard; + }); + scrollIndex = 0; // Show first result at the top + destIndex = 0; // Highlight the first entry + if (nodesChanged && runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION) { + LOG_INFO("Nodes changed, forcing UI refresh."); + screen->forceDisplay(); + } +} + +// Returns true if character input is currently allowed (used for search/freetext states) +bool CannedMessageModule::isCharInputAllowed() const +{ + return runState == CANNED_MESSAGE_RUN_STATE_FREETEXT || runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION; +} +/** + * Main input event dispatcher for CannedMessageModule. + * Routes keyboard/button/touch input to the correct handler based on the current runState. + * Only one handler (per state) processes each event, eliminating redundancy. + */ int CannedMessageModule::handleInputEvent(const InputEvent *event) { - if ((strlen(moduleConfig.canned_message.allow_input_source) > 0) && - (strcasecmp(moduleConfig.canned_message.allow_input_source, event->source) != 0) && - (strcasecmp(moduleConfig.canned_message.allow_input_source, "_any") != 0)) { - // Event source is not accepted. - // Event only accepted if source matches the configured one, or - // the configured one is "_any" (or if there is no configured - // source at all) + // Block ALL input if an alert banner is active + if (screen && screen->isOverlayBannerShowing()) { return 0; } - if (this->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE) { - return 0; // Ignore input while sending - } - bool validEvent = false; - if (event->inputEvent == static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP)) { - if (this->messagesCount > 0) { - this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_UP; - validEvent = true; - } - } - if (event->inputEvent == static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN)) { - if (this->messagesCount > 0) { - this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_DOWN; - validEvent = true; - } - } - if (event->inputEvent == static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT)) { -#if defined(USE_VIRTUAL_KEYBOARD) - if (this->currentMessageIndex == 0) { - this->runState = CANNED_MESSAGE_RUN_STATE_FREETEXT; + // Tab key: Always allow switching between canned/destination screens + if (event->kbchar == INPUT_BROKER_MSG_TAB && handleTabSwitch(event)) + return 1; - requestFocus(); // Tell Screen::setFrames to move to our module's frame, next time it runs + // Matrix keypad: If matrix key, trigger action select for canned message + if (event->inputEvent == INPUT_BROKER_MATRIXKEY) { + runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT; + payload = INPUT_BROKER_MATRIXKEY; + currentMessageIndex = event->kbchar - 1; + lastTouchMillis = millis(); + requestFocus(); + return 1; + } + + // Always normalize navigation/select buttons for further handlers + bool isUp = isUpEvent(event); + bool isDown = isDownEvent(event); + bool isSelect = isSelectEvent(event); + + // Route event to handler for current UI state (no double-handling) + switch (runState) { + // Node/Channel destination selection mode: Handles character search, arrows, select, cancel, backspace + case CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION: + if (handleDestinationSelectionInput(event, isUp, isDown, isSelect)) + return 1; + return 0; // prevent fall-through to selector input + + // Free text input mode: Handles character input, cancel, backspace, select, etc. + case CANNED_MESSAGE_RUN_STATE_FREETEXT: + return handleFreeTextInput(event); // All allowed input for this state + + // If sending, block all input except global/system (handled above) + case CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE: + return 1; + + // If sending, block all input except global/system (handled above) + case CANNED_MESSAGE_RUN_STATE_EMOTE_PICKER: + return handleEmotePickerInput(event); + + case CANNED_MESSAGE_RUN_STATE_INACTIVE: + if (isSelect) { + return 0; // Main button press no longer runs through powerFSM + } + // Let LEFT/RIGHT pass through so frame navigation works + if (event->inputEvent == INPUT_BROKER_LEFT || event->inputEvent == INPUT_BROKER_RIGHT) { + break; + } + // Handle UP/DOWN: activate canned message list! + if (event->inputEvent == INPUT_BROKER_UP || event->inputEvent == INPUT_BROKER_DOWN || + event->inputEvent == INPUT_BROKER_ALT_LONG) { + LaunchWithDestination(NODENUM_BROADCAST); + return 1; + } + // Printable char (ASCII) opens free text compose + if (event->kbchar >= 32 && event->kbchar <= 126) { + runState = CANNED_MESSAGE_RUN_STATE_FREETEXT; + requestFocus(); UIFrameEvent e; - e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; // We want to change the list of frames shown on-screen - this->notifyObservers(&e); - - return 0; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + // Immediately process the input in the new state (freetext) + return handleFreeTextInput(event); } -#endif + break; - // when inactive, call the onebutton shortpress instead. Activate Module only on up/down - if ((this->runState == CANNED_MESSAGE_RUN_STATE_INACTIVE) || (this->runState == CANNED_MESSAGE_RUN_STATE_DISABLED)) { - powerFSM.trigger(EVENT_PRESS); - } else { - this->payload = this->runState; - this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT; - validEvent = true; - } + // (Other states can be added here as needed) + default: + break; } - if (event->inputEvent == static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL)) { - UIFrameEvent e; - e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; // We want to change the list of frames shown on-screen - this->currentMessageIndex = -1; -#if !defined(T_WATCH_S3) && !defined(RAK14014) && !defined(USE_VIRTUAL_KEYBOARD) - this->freetext = ""; // clear freetext - this->cursor = 0; - this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE; -#endif + // If no state handler above processed the event, let the message selector try to handle it + // (Handles up/down/select on canned message list, exit/return) + if (handleMessageSelectorInput(event, isUp, isDown, isSelect)) + return 1; - this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; - this->notifyObservers(&e); - } - if ((event->inputEvent == static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK)) || - (event->inputEvent == static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT)) || - (event->inputEvent == static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT))) { + // Default: event not handled by canned message system, allow others to process + return 0; +} -#if defined(USE_VIRTUAL_KEYBOARD) - if (event->inputEvent == static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT)) { - this->payload = INPUT_BROKER_MSG_LEFT; - } else if (event->inputEvent == static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT)) { - this->payload = INPUT_BROKER_MSG_RIGHT; - } -#else - // tweak for left/right events generated via trackball/touch with empty kbchar - if (!event->kbchar) { - if (event->inputEvent == static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT)) { - this->payload = INPUT_BROKER_MSG_LEFT; - } else if (event->inputEvent == static_cast(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT)) { - this->payload = INPUT_BROKER_MSG_RIGHT; - } - } else { - // pass the pressed key - this->payload = event->kbchar; - } -#endif +bool CannedMessageModule::isUpEvent(const InputEvent *event) +{ + return event->inputEvent == INPUT_BROKER_UP || + ((runState == CANNED_MESSAGE_RUN_STATE_ACTIVE || runState == CANNED_MESSAGE_RUN_STATE_EMOTE_PICKER || + runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION) && + event->inputEvent == INPUT_BROKER_ALT_PRESS); +} +bool CannedMessageModule::isDownEvent(const InputEvent *event) +{ + return event->inputEvent == INPUT_BROKER_DOWN || + ((runState == CANNED_MESSAGE_RUN_STATE_ACTIVE || runState == CANNED_MESSAGE_RUN_STATE_EMOTE_PICKER || + runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION) && + event->inputEvent == INPUT_BROKER_USER_PRESS); +} +bool CannedMessageModule::isSelectEvent(const InputEvent *event) +{ + return event->inputEvent == INPUT_BROKER_SELECT; +} - this->lastTouchMillis = millis(); - validEvent = true; - } - if (event->inputEvent == static_cast(ANYKEY)) { - // when inactive, this will switch to the freetext mode - if ((this->runState == CANNED_MESSAGE_RUN_STATE_INACTIVE) || (this->runState == CANNED_MESSAGE_RUN_STATE_ACTIVE) || - (this->runState == CANNED_MESSAGE_RUN_STATE_DISABLED)) { - this->runState = CANNED_MESSAGE_RUN_STATE_FREETEXT; - } +bool CannedMessageModule::handleTabSwitch(const InputEvent *event) +{ + if (event->kbchar != 0x09) + return false; - validEvent = false; // If key is normal than it will be set to true. + runState = (runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION) ? CANNED_MESSAGE_RUN_STATE_FREETEXT + : CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION; - // Run modifier key code below, (doesnt inturrupt typing or reset to start screen page) - switch (event->kbchar) { - case INPUT_BROKER_MSG_BRIGHTNESS_UP: // make screen brighter - if (screen) - screen->increaseBrightness(); - LOG_DEBUG("Increase Screen Brightness"); - break; - case INPUT_BROKER_MSG_BRIGHTNESS_DOWN: // make screen dimmer - if (screen) - screen->decreaseBrightness(); - LOG_DEBUG("Decrease Screen Brightness"); - break; - case INPUT_BROKER_MSG_FN_SYMBOL_ON: // draw modifier (function) symbol - if (screen) - screen->setFunctionSymbol("Fn"); - break; - case INPUT_BROKER_MSG_FN_SYMBOL_OFF: // remove modifier (function) symbol - if (screen) - screen->removeFunctionSymbol("Fn"); - break; - // mute (switch off/toggle) external notifications on fn+m - case INPUT_BROKER_MSG_MUTE_TOGGLE: - if (moduleConfig.external_notification.enabled == true) { - if (externalNotificationModule->getMute()) { - externalNotificationModule->setMute(false); - showTemporaryMessage("Notifications \nEnabled"); - if (screen) - screen->removeFunctionSymbol("M"); // remove the mute symbol from the bottom right corner - } else { - externalNotificationModule->stopNow(); // this will turn off all GPIO and sounds and idle the loop - externalNotificationModule->setMute(true); - showTemporaryMessage("Notifications \nDisabled"); - if (screen) - screen->setFunctionSymbol("M"); // add the mute symbol to the bottom right corner - } - } - break; - case INPUT_BROKER_MSG_GPS_TOGGLE: // toggle GPS like triple press does -#if !MESHTASTIC_EXCLUDE_GPS - if (gps != nullptr) { - gps->toggleGpsMode(); - } - if (screen) - screen->forceDisplay(); - showTemporaryMessage("GPS Toggled"); -#endif - break; - case INPUT_BROKER_MSG_BLUETOOTH_TOGGLE: // toggle Bluetooth on/off - if (config.bluetooth.enabled == true) { - config.bluetooth.enabled = false; - LOG_INFO("User toggled Bluetooth"); - nodeDB->saveToDisk(); - disableBluetooth(); - showTemporaryMessage("Bluetooth OFF"); - } else if (config.bluetooth.enabled == false) { - config.bluetooth.enabled = true; - LOG_INFO("User toggled Bluetooth"); - nodeDB->saveToDisk(); - rebootAtMsec = millis() + 2000; - showTemporaryMessage("Bluetooth ON\nReboot"); - } - break; - case INPUT_BROKER_MSG_SEND_PING: // fn+space send network ping like double press does - service->refreshLocalMeshNode(); - if (service->trySendPosition(NODENUM_BROADCAST, true)) { - showTemporaryMessage("Position \nUpdate Sent"); - } else { - showTemporaryMessage("Node Info \nUpdate Sent"); - } - break; - case INPUT_BROKER_MSG_DISMISS_FRAME: // fn+del: dismiss screen frames like text or waypoint - // Avoid opening the canned message screen frame - // We're only handling the keypress here by convention, this has nothing to do with canned messages - this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; - // Attempt to close whatever frame is currently shown on display - screen->dismissCurrentFrame(); - return 0; - default: - // pass the pressed key - // LOG_DEBUG("Canned message ANYKEY (%x)", event->kbchar); - this->payload = event->kbchar; - this->lastTouchMillis = millis(); - validEvent = true; - break; - } - if (screen && (event->kbchar != INPUT_BROKER_MSG_FN_SYMBOL_ON)) { - screen->removeFunctionSymbol("Fn"); // remove modifier (function) symbol + destIndex = 0; + scrollIndex = 0; + // RESTORE THIS! + if (runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION) + updateDestinationSelectionList(); + + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + screen->forceDisplay(); + return true; +} + +int CannedMessageModule::handleDestinationSelectionInput(const InputEvent *event, bool isUp, bool isDown, bool isSelect) +{ + // Override isDown and isSelect ONLY for destination selector behavior + if (runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION) { + if (event->inputEvent == INPUT_BROKER_USER_PRESS) { + isDown = true; + } else if (event->inputEvent == INPUT_BROKER_SELECT) { + isSelect = true; } } -#if defined(USE_VIRTUAL_KEYBOARD) - if (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) { - String keyTapped = keyForCoordinates(event->touchX, event->touchY); - - if (keyTapped == "⇧") { - this->highlight = -1; - - this->payload = 0x00; - - validEvent = true; - - this->shift = !this->shift; - } else if (keyTapped == "⌫") { -#ifndef RAK14014 - this->highlight = keyTapped[0]; -#endif - - this->payload = 0x08; - - validEvent = true; - - this->shift = false; - } else if (keyTapped == "123" || keyTapped == "ABC") { - this->highlight = -1; - - this->payload = 0x00; - - this->charSet = this->charSet == 0 ? 1 : 0; - - validEvent = true; - } else if (keyTapped == " ") { -#ifndef RAK14014 - this->highlight = keyTapped[0]; -#endif - - this->payload = keyTapped[0]; - - validEvent = true; - - this->shift = false; - } else if (keyTapped == "↵") { - this->highlight = 0x00; - - this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT; - - this->payload = CANNED_MESSAGE_RUN_STATE_FREETEXT; - - this->currentMessageIndex = event->kbchar - 1; - - validEvent = true; - - this->shift = false; - } else if (keyTapped != "") { -#ifndef RAK14014 - this->highlight = keyTapped[0]; -#endif - - this->payload = this->shift ? keyTapped[0] : std::tolower(keyTapped[0]); - - validEvent = true; - - this->shift = false; + if (event->kbchar >= 32 && event->kbchar <= 126 && !isUp && !isDown && event->inputEvent != INPUT_BROKER_LEFT && + event->inputEvent != INPUT_BROKER_RIGHT && event->inputEvent != INPUT_BROKER_SELECT) { + this->searchQuery += (char)event->kbchar; + needsUpdate = true; + if ((millis() - lastFilterUpdate) > filterDebounceMs) { + runOnce(); // update filter immediately + lastFilterUpdate = millis(); } - } -#endif - - if (event->inputEvent == static_cast(MATRIXKEY)) { - // this will send the text immediately on matrix press - this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT; - this->payload = MATRIXKEY; - this->currentMessageIndex = event->kbchar - 1; - this->lastTouchMillis = millis(); - validEvent = true; + return 1; } - if (validEvent) { - requestFocus(); // Tell Screen::setFrames to move to our module's frame, next time it runs + size_t numMeshNodes = filteredNodes.size(); + int totalEntries = numMeshNodes + activeChannelIndices.size(); + int columns = 1; + int totalRows = totalEntries; + int maxScrollIndex = std::max(0, totalRows - visibleRows); + scrollIndex = clamp(scrollIndex, 0, maxScrollIndex); - // Let runOnce to be called immediately. - if (this->runState == CANNED_MESSAGE_RUN_STATE_ACTION_SELECT) { - setIntervalFromNow(0); // on fast keypresses, this isn't fast enough. - } else { + // Handle backspace + if (event->inputEvent == INPUT_BROKER_BACK) { + if (searchQuery.length() > 0) { + searchQuery.remove(searchQuery.length() - 1); + needsUpdate = true; runOnce(); } + if (searchQuery.length() == 0) { + resetSearch(); + needsUpdate = false; + } + return 1; + } + + // UP + if (isUp && destIndex > 0) { + destIndex--; + if ((destIndex / columns) < scrollIndex) + scrollIndex = destIndex / columns; + else if ((destIndex / columns) >= (scrollIndex + visibleRows)) + scrollIndex = (destIndex / columns) - visibleRows + 1; + + screen->forceDisplay(); + return 1; + } + + // DOWN + if (isDown && destIndex + 1 < totalEntries) { + destIndex++; + if ((destIndex / columns) >= (scrollIndex + visibleRows)) + scrollIndex = (destIndex / columns) - visibleRows + 1; + + screen->forceDisplay(); + return 1; + } + + // SELECT + if (isSelect) { + if (destIndex < static_cast(activeChannelIndices.size())) { + dest = NODENUM_BROADCAST; + channel = activeChannelIndices[destIndex]; + } else { + int nodeIndex = destIndex - static_cast(activeChannelIndices.size()); + if (nodeIndex >= 0 && nodeIndex < static_cast(filteredNodes.size())) { + const meshtastic_NodeInfoLite *selectedNode = filteredNodes[nodeIndex].node; + if (selectedNode) { + dest = selectedNode->num; + channel = selectedNode->channel; + } + } + } + + runState = returnToCannedList ? CANNED_MESSAGE_RUN_STATE_ACTIVE : CANNED_MESSAGE_RUN_STATE_FREETEXT; + returnToCannedList = false; + screen->forceDisplay(); + return 1; + } + + // CANCEL + if (event->inputEvent == INPUT_BROKER_CANCEL || event->inputEvent == INPUT_BROKER_ALT_LONG) { + runState = returnToCannedList ? CANNED_MESSAGE_RUN_STATE_ACTIVE : CANNED_MESSAGE_RUN_STATE_FREETEXT; + returnToCannedList = false; + searchQuery = ""; + + // UIFrameEvent e; + // e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + // notifyObservers(&e); + screen->forceDisplay(); + return 1; + } + + return 0; +} + +bool CannedMessageModule::handleMessageSelectorInput(const InputEvent *event, bool isUp, bool isDown, bool isSelect) +{ + // Override isDown and isSelect ONLY for canned message list behavior + if (runState == CANNED_MESSAGE_RUN_STATE_ACTIVE) { + if (event->inputEvent == INPUT_BROKER_USER_PRESS) { + isDown = true; + } else if (event->inputEvent == INPUT_BROKER_SELECT) { + isSelect = true; + } + } + + if (runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION) + return false; + + // === Handle Cancel key: go inactive, clear UI state === + if (runState != CANNED_MESSAGE_RUN_STATE_INACTIVE && + (event->inputEvent == INPUT_BROKER_CANCEL || event->inputEvent == INPUT_BROKER_ALT_LONG)) { + runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + freetext = ""; + cursor = 0; + payload = 0; + currentMessageIndex = -1; + + // Notify UI that we want to redraw/close this screen + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + screen->forceDisplay(); + return true; + } + + bool handled = false; + + // Handle up/down navigation + if (isUp && messagesCount > 0) { + runState = CANNED_MESSAGE_RUN_STATE_ACTION_UP; + handled = true; + } else if (isDown && messagesCount > 0) { + runState = CANNED_MESSAGE_RUN_STATE_ACTION_DOWN; + handled = true; + } else if (isSelect) { + const char *current = messages[currentMessageIndex]; + + // === [Select Destination] triggers destination selection UI === + if (strcmp(current, "[Select Destination]") == 0) { + returnToCannedList = true; + runState = CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION; + destIndex = 0; + scrollIndex = 0; + updateDestinationSelectionList(); // Make sure list is fresh + screen->forceDisplay(); + return true; + } + + // === [Exit] returns to the main/inactive screen === + if (strcmp(current, "[Exit]") == 0) { + // Set runState to inactive so we return to main UI + runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + currentMessageIndex = -1; + + // Notify UI to regenerate frame set and redraw + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + screen->forceDisplay(); + return true; + } + + // === [Free Text] triggers the free text input (virtual keyboard) === +#if defined(USE_VIRTUAL_KEYBOARD) + if (strcmp(current, "[-- Free Text --]") == 0) { + runState = CANNED_MESSAGE_RUN_STATE_FREETEXT; + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + return true; + } +#endif + + // Normal canned message selection + if (runState == CANNED_MESSAGE_RUN_STATE_INACTIVE || runState == CANNED_MESSAGE_RUN_STATE_DISABLED) { + } else { + payload = runState; + runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT; + handled = true; + } + } + + if (handled) { + requestFocus(); + if (runState == CANNED_MESSAGE_RUN_STATE_ACTION_SELECT) + setIntervalFromNow(0); + else + runOnce(); + } + + return handled; +} +bool CannedMessageModule::handleFreeTextInput(const InputEvent *event) +{ + // Always process only if in FREETEXT mode + if (runState != CANNED_MESSAGE_RUN_STATE_FREETEXT) + return false; + +#if defined(USE_VIRTUAL_KEYBOARD) + // Cancel (dismiss freetext screen) + if (event->inputEvent == INPUT_BROKER_LEFT) { + runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + freetext = ""; + cursor = 0; + payload = 0; + currentMessageIndex = -1; + + // Notify UI that we want to redraw/close this screen + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + screen->forceDisplay(); + return true; + } + // Touch input (virtual keyboard) handling + // Only handle if touch coordinates present (CardKB won't set these) + if (event->touchX != 0 || event->touchY != 0) { + String keyTapped = keyForCoordinates(event->touchX, event->touchY); + bool valid = false; + + if (keyTapped == "⇧") { + highlight = -1; + payload = 0x00; + shift = !shift; + valid = true; + } else if (keyTapped == "⌫") { +#ifndef RAK14014 + highlight = keyTapped[0]; +#endif + payload = 0x08; + shift = false; + valid = true; + } else if (keyTapped == "123" || keyTapped == "ABC") { + highlight = -1; + payload = 0x00; + charSet = (charSet == 0 ? 1 : 0); + valid = true; + } else if (keyTapped == " ") { +#ifndef RAK14014 + highlight = keyTapped[0]; +#endif + payload = keyTapped[0]; + shift = false; + valid = true; + } + // Touch enter/submit + else if (keyTapped == "↵") { + runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT; // Send the message! + payload = CANNED_MESSAGE_RUN_STATE_FREETEXT; + currentMessageIndex = -1; + shift = false; + valid = true; + } else if (!(keyTapped == "")) { +#ifndef RAK14014 + highlight = keyTapped[0]; +#endif + payload = shift ? keyTapped[0] : std::tolower(keyTapped[0]); + shift = false; + valid = true; + } + + if (valid) { + lastTouchMillis = millis(); + runOnce(); + payload = 0; + return true; // STOP: We handled a VKB touch + } + } +#endif // USE_VIRTUAL_KEYBOARD + + // ---- All hardware keys fall through to here (CardKB, physical, etc.) ---- + + if (event->kbchar == INPUT_BROKER_MSG_EMOTE_LIST) { + runState = CANNED_MESSAGE_RUN_STATE_EMOTE_PICKER; + requestFocus(); + screen->forceDisplay(); + return true; + } + // Confirm select (Enter) + bool isSelect = isSelectEvent(event); + if (isSelect) { + LOG_DEBUG("[SELECT] handleFreeTextInput: runState=%d, dest=%u, channel=%d, freetext='%s'", (int)runState, dest, channel, + freetext.c_str()); + if (dest == 0) + dest = NODENUM_BROADCAST; + // Defensive: If channel isn't valid, pick the first available channel + if (channel >= channels.getNumChannels()) + channel = 0; + + payload = CANNED_MESSAGE_RUN_STATE_FREETEXT; + currentMessageIndex = -1; + runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT; + lastTouchMillis = millis(); + runOnce(); + return true; + } + + // Backspace + if (event->inputEvent == INPUT_BROKER_BACK) { + payload = 0x08; + lastTouchMillis = millis(); + runOnce(); + return true; + } + + // Move cursor left + if (event->inputEvent == INPUT_BROKER_LEFT) { + payload = INPUT_BROKER_LEFT; + lastTouchMillis = millis(); + runOnce(); + return true; + } + // Move cursor right + if (event->inputEvent == INPUT_BROKER_RIGHT) { + payload = INPUT_BROKER_RIGHT; + lastTouchMillis = millis(); + runOnce(); + return true; + } + + // Cancel (dismiss freetext screen) + if (event->inputEvent == INPUT_BROKER_CANCEL || event->inputEvent == INPUT_BROKER_ALT_LONG) { + runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + freetext = ""; + cursor = 0; + payload = 0; + currentMessageIndex = -1; + + // Notify UI that we want to redraw/close this screen + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + screen->forceDisplay(); + return true; + } + + // Tab (switch destination) + if (event->kbchar == INPUT_BROKER_MSG_TAB) { + return handleTabSwitch(event); // Reuse tab logic + } + + // Printable ASCII (add char to draft) + if (event->kbchar >= 32 && event->kbchar <= 126) { + payload = event->kbchar; + lastTouchMillis = millis(); + runOnce(); + return true; + } + + return false; +} + +int CannedMessageModule::handleEmotePickerInput(const InputEvent *event) +{ + int numEmotes = graphics::numEmotes; + + // Override isDown and isSelect ONLY for emote picker behavior + bool isUp = isUpEvent(event); + bool isDown = isDownEvent(event); + bool isSelect = isSelectEvent(event); + if (runState == CANNED_MESSAGE_RUN_STATE_EMOTE_PICKER) { + if (event->inputEvent == INPUT_BROKER_USER_PRESS) { + isDown = true; + } else if (event->inputEvent == INPUT_BROKER_SELECT) { + isSelect = true; + } + } + + // Scroll emote list + if (isUp && emotePickerIndex > 0) { + emotePickerIndex--; + screen->forceDisplay(); + return 1; + } + if (isDown && emotePickerIndex < numEmotes - 1) { + emotePickerIndex++; + screen->forceDisplay(); + return 1; + } + + // Select emote: insert into freetext at cursor and return to freetext + if (isSelect) { + String label = graphics::emotes[emotePickerIndex].label; + String emoteInsert = label; // Just the text label, e.g., ":thumbsup:" + if (cursor == freetext.length()) { + freetext += emoteInsert; + } else { + freetext = freetext.substring(0, cursor) + emoteInsert + freetext.substring(cursor); + } + cursor += emoteInsert.length(); + runState = CANNED_MESSAGE_RUN_STATE_FREETEXT; + screen->forceDisplay(); + return 1; + } + + // Cancel returns to freetext + if (event->inputEvent == INPUT_BROKER_CANCEL || event->inputEvent == INPUT_BROKER_ALT_LONG) { + runState = CANNED_MESSAGE_RUN_STATE_FREETEXT; + screen->forceDisplay(); + return 1; } return 0; @@ -404,278 +812,196 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) void CannedMessageModule::sendText(NodeNum dest, ChannelIndex channel, const char *message, bool wantReplies) { + // === Prepare packet === meshtastic_MeshPacket *p = allocDataPacket(); p->to = dest; p->channel = channel; p->want_ack = true; + + // Save destination for ACK/NACK UI fallback + this->lastSentNode = dest; + this->incoming = dest; + + // Copy message payload p->decoded.payload.size = strlen(message); memcpy(p->decoded.payload.bytes, message, p->decoded.payload.size); + + // Optionally add bell character if (moduleConfig.canned_message.send_bell && p->decoded.payload.size < meshtastic_Constants_DATA_PAYLOAD_LEN) { - p->decoded.payload.bytes[p->decoded.payload.size] = 7; // Bell character - p->decoded.payload.bytes[p->decoded.payload.size + 1] = '\0'; // Bell character - p->decoded.payload.size++; + p->decoded.payload.bytes[p->decoded.payload.size++] = 7; // Bell + p->decoded.payload.bytes[p->decoded.payload.size] = '\0'; // Null-terminate } - // Only receive routing messages when expecting ACK for a canned message - // Prevents the canned message module from regenerating the screen's frameset at unexpected times, - // or raising a UIFrameEvent before another module has the chance + // Mark as waiting for ACK to trigger ACK/NACK screen this->waitingForAck = true; + // Log outgoing message LOG_INFO("Send message id=%d, dest=%x, msg=%.*s", p->id, p->to, p->decoded.payload.size, p->decoded.payload.bytes); - service->sendToMesh( - p, RX_SRC_LOCAL, - true); // send to mesh, cc to phone. Even if there's no phone connected, this stores the message to match ACKs -} + // Send to mesh and phone (even if no phone connected, to track ACKs) + service->sendToMesh(p, RX_SRC_LOCAL, true); + // === Simulate local message to clear unread UI === + if (screen) { + meshtastic_MeshPacket simulatedPacket = {}; + simulatedPacket.from = 0; // Local device + screen->handleTextMessage(&simulatedPacket); + } + playComboTune(); +} int32_t CannedMessageModule::runOnce() { - if (((!moduleConfig.canned_message.enabled) && !CANNED_MESSAGE_MODULE_ENABLE) || - (this->runState == CANNED_MESSAGE_RUN_STATE_DISABLED) || (this->runState == CANNED_MESSAGE_RUN_STATE_INACTIVE)) { + if (this->runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION && needsUpdate) { + updateDestinationSelectionList(); + needsUpdate = false; + } + + // If we're in node selection, do nothing except keep alive + if (this->runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION) { + return INACTIVATE_AFTER_MS; + } + + // Normal module disable/idle handling + if ((this->runState == CANNED_MESSAGE_RUN_STATE_DISABLED) || (this->runState == CANNED_MESSAGE_RUN_STATE_INACTIVE)) { temporaryMessage = ""; return INT32_MAX; } - // LOG_DEBUG("Check status"); + UIFrameEvent e; if ((this->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE) || - (this->runState == CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED) || (this->runState == CANNED_MESSAGE_RUN_STATE_MESSAGE)) { - // TODO: might have some feedback of sending state + (this->runState == CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED) || + (this->runState == CANNED_MESSAGE_RUN_STATE_MESSAGE_SELECTION)) { this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; temporaryMessage = ""; - e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; // We want to change the list of frames shown on-screen + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; this->currentMessageIndex = -1; - this->freetext = ""; // clear freetext + this->freetext = ""; this->cursor = 0; - -#if !defined(T_WATCH_S3) && !defined(RAK14014) && !defined(SENSECAP_INDICATOR) - this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE; -#endif - this->notifyObservers(&e); } else if (((this->runState == CANNED_MESSAGE_RUN_STATE_ACTIVE) || (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT)) && !Throttle::isWithinTimespanMs(this->lastTouchMillis, INACTIVATE_AFTER_MS)) { - // Reset module - e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; // We want to change the list of frames shown on-screen + // Reset module on inactivity + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; this->currentMessageIndex = -1; - this->freetext = ""; // clear freetext + this->freetext = ""; this->cursor = 0; - -#if !defined(T_WATCH_S3) && !defined(RAK14014) && !defined(USE_VIRTUAL_KEYBOARD) - this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE; -#endif - this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; this->notifyObservers(&e); } else if (this->runState == CANNED_MESSAGE_RUN_STATE_ACTION_SELECT) { if (this->payload == CANNED_MESSAGE_RUN_STATE_FREETEXT) { if (this->freetext.length() > 0) { - sendText(this->dest, indexChannels[this->channel], this->freetext.c_str(), true); + sendText(this->dest, this->channel, this->freetext.c_str(), true); this->runState = CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE; } else { this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; } } else { + if (strcmp(this->messages[this->currentMessageIndex], "[Select Destination]") == 0) { + this->runState = CANNED_MESSAGE_RUN_STATE_ACTIVE; + return INT32_MAX; + } if ((this->messagesCount > this->currentMessageIndex) && (strlen(this->messages[this->currentMessageIndex]) > 0)) { if (strcmp(this->messages[this->currentMessageIndex], "~") == 0) { - powerFSM.trigger(EVENT_PRESS); return INT32_MAX; } else { -#if defined(USE_VIRTUAL_KEYBOARD) - sendText(this->dest, indexChannels[this->channel], this->messages[this->currentMessageIndex], true); -#else - sendText(this->dest, indexChannels[this->channel], this->messages[this->currentMessageIndex], true); -#endif + sendText(this->dest, this->channel, this->messages[this->currentMessageIndex], true); } this->runState = CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE; } else { - // LOG_DEBUG("Reset message is empty"); this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; } } - e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; // We want to change the list of frames shown on-screen + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; this->currentMessageIndex = -1; - this->freetext = ""; // clear freetext + this->freetext = ""; this->cursor = 0; - -#if !defined(T_WATCH_S3) && !defined(RAK14014) && !defined(USE_VIRTUAL_KEYBOARD) - this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE; -#endif - this->notifyObservers(&e); return 2000; - } else if ((this->runState != CANNED_MESSAGE_RUN_STATE_FREETEXT) && (this->currentMessageIndex == -1)) { - this->currentMessageIndex = 0; - LOG_DEBUG("First touch (%d):%s", this->currentMessageIndex, this->getCurrentMessage()); - e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; // We want to change the list of frames shown on-screen + } + // Always highlight the first real canned message when entering the message list + else if ((this->runState != CANNED_MESSAGE_RUN_STATE_FREETEXT) && (this->currentMessageIndex == -1)) { + int firstRealMsgIdx = 0; + for (int i = 0; i < this->messagesCount; ++i) { + if (strcmp(this->messages[i], "[Select Destination]") != 0 && strcmp(this->messages[i], "[Exit]") != 0 && + strcmp(this->messages[i], "[---- Free Text ----]") != 0) { + firstRealMsgIdx = i; + break; + } + } + this->currentMessageIndex = firstRealMsgIdx; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; this->runState = CANNED_MESSAGE_RUN_STATE_ACTIVE; } else if (this->runState == CANNED_MESSAGE_RUN_STATE_ACTION_UP) { if (this->messagesCount > 0) { this->currentMessageIndex = getPrevIndex(); - this->freetext = ""; // clear freetext + this->freetext = ""; this->cursor = 0; - -#if !defined(T_WATCH_S3) && !defined(RAK14014) && !defined(USE_VIRTUAL_KEYBOARD) - this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE; -#endif - this->runState = CANNED_MESSAGE_RUN_STATE_ACTIVE; LOG_DEBUG("MOVE UP (%d):%s", this->currentMessageIndex, this->getCurrentMessage()); } } else if (this->runState == CANNED_MESSAGE_RUN_STATE_ACTION_DOWN) { if (this->messagesCount > 0) { this->currentMessageIndex = this->getNextIndex(); - this->freetext = ""; // clear freetext + this->freetext = ""; this->cursor = 0; - -#if !defined(T_WATCH_S3) && !defined(RAK14014) && !defined(USE_VIRTUAL_KEYBOARD) - this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE; -#endif - this->runState = CANNED_MESSAGE_RUN_STATE_ACTIVE; LOG_DEBUG("MOVE DOWN (%d):%s", this->currentMessageIndex, this->getCurrentMessage()); } } else if (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT || this->runState == CANNED_MESSAGE_RUN_STATE_ACTIVE) { switch (this->payload) { - case INPUT_BROKER_MSG_LEFT: - if (this->destSelect == CANNED_MESSAGE_DESTINATION_TYPE_NODE) { - size_t numMeshNodes = nodeDB->getNumMeshNodes(); - if (this->dest == NODENUM_BROADCAST) { - this->dest = nodeDB->getNodeNum(); - } - for (unsigned int i = 0; i < numMeshNodes; i++) { - if (nodeDB->getMeshNodeByIndex(i)->num == this->dest) { - this->dest = - (i > 0) ? nodeDB->getMeshNodeByIndex(i - 1)->num : nodeDB->getMeshNodeByIndex(numMeshNodes - 1)->num; - break; - } - } - if (this->dest == nodeDB->getNodeNum()) { - this->dest = NODENUM_BROADCAST; - } - } else if (this->destSelect == CANNED_MESSAGE_DESTINATION_TYPE_CHANNEL) { - for (unsigned int i = 0; i < channels.getNumChannels(); i++) { - if ((channels.getByIndex(i).role == meshtastic_Channel_Role_SECONDARY) || - (channels.getByIndex(i).role == meshtastic_Channel_Role_PRIMARY)) { - indexChannels[numChannels] = i; - numChannels++; - } - } - if (this->channel == 0) { - this->channel = numChannels - 1; - } else { - this->channel--; - } - } else { - if (this->cursor > 0) { - this->cursor--; - } + case INPUT_BROKER_LEFT: + if (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT && this->cursor > 0) { + this->cursor--; } break; - case INPUT_BROKER_MSG_RIGHT: - if (this->destSelect == CANNED_MESSAGE_DESTINATION_TYPE_NODE) { - size_t numMeshNodes = nodeDB->getNumMeshNodes(); - if (this->dest == NODENUM_BROADCAST) { - this->dest = nodeDB->getNodeNum(); - } - for (unsigned int i = 0; i < numMeshNodes; i++) { - if (nodeDB->getMeshNodeByIndex(i)->num == this->dest) { - this->dest = - (i < numMeshNodes - 1) ? nodeDB->getMeshNodeByIndex(i + 1)->num : nodeDB->getMeshNodeByIndex(0)->num; - break; - } - } - if (this->dest == nodeDB->getNodeNum()) { - this->dest = NODENUM_BROADCAST; - } - } else if (this->destSelect == CANNED_MESSAGE_DESTINATION_TYPE_CHANNEL) { - for (unsigned int i = 0; i < channels.getNumChannels(); i++) { - if ((channels.getByIndex(i).role == meshtastic_Channel_Role_SECONDARY) || - (channels.getByIndex(i).role == meshtastic_Channel_Role_PRIMARY)) { - indexChannels[numChannels] = i; - numChannels++; - } - } - if (this->channel == numChannels - 1) { - this->channel = 0; - } else { - this->channel++; - } - } else { - if (this->cursor < this->freetext.length()) { - this->cursor++; - } + case INPUT_BROKER_RIGHT: + if (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT && this->cursor < this->freetext.length()) { + this->cursor++; } break; default: break; } if (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) { - e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; // We want to change the list of frames shown on-screen - switch (this->payload) { // code below all trigger the freetext window (where you type to send a message) or reset the - // display back to the default window - case 0x08: // backspace - if (this->freetext.length() > 0 && this->highlight == 0x00) { - if (this->cursor == this->freetext.length()) { - this->freetext = this->freetext.substring(0, this->freetext.length() - 1); - } else { - this->freetext = this->freetext.substring(0, this->cursor - 1) + - this->freetext.substring(this->cursor, this->freetext.length()); + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + switch (this->payload) { + case 0x08: // backspace + if (this->freetext.length() > 0) { + if (this->cursor > 0) { + if (this->cursor == this->freetext.length()) { + this->freetext = this->freetext.substring(0, this->freetext.length() - 1); + } else { + this->freetext = this->freetext.substring(0, this->cursor - 1) + + this->freetext.substring(this->cursor, this->freetext.length()); + } + this->cursor--; } - this->cursor--; } break; - case 0x09: // tab - if (this->destSelect == CANNED_MESSAGE_DESTINATION_TYPE_CHANNEL) { - this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE; - } else if (this->destSelect == CANNED_MESSAGE_DESTINATION_TYPE_NODE) { - this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_CHANNEL; - } else { - this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NODE; - } - break; - case INPUT_BROKER_MSG_LEFT: - case INPUT_BROKER_MSG_RIGHT: - // already handled above - break; - // handle fn+s for shutdown - case INPUT_BROKER_MSG_SHUTDOWN: - if (screen) - screen->startAlert("Shutting down..."); - shutdownAtMsec = millis() + DEFAULT_SHUTDOWN_SECONDS * 1000; - runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; - break; - // and fn+r for reboot - case INPUT_BROKER_MSG_REBOOT: - if (screen) - screen->startAlert("Rebooting..."); - rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000; - runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + case INPUT_BROKER_MSG_TAB: // Tab key: handled by input handler + return 0; + case INPUT_BROKER_LEFT: + case INPUT_BROKER_RIGHT: break; default: - if (this->highlight != 0x00) { - break; - } - - if (this->cursor == this->freetext.length()) { - this->freetext += this->payload; - } else { - this->freetext = - this->freetext.substring(0, this->cursor) + this->payload + this->freetext.substring(this->cursor); - } - - this->cursor += 1; - - uint16_t maxChars = meshtastic_Constants_DATA_PAYLOAD_LEN - (moduleConfig.canned_message.send_bell ? 1 : 0); - if (this->freetext.length() > maxChars) { - this->cursor = maxChars; - this->freetext = this->freetext.substring(0, maxChars); + // Only insert ASCII printable characters (32–126) + if (this->payload >= 32 && this->payload <= 126) { + if (this->cursor == this->freetext.length()) { + this->freetext += (char)this->payload; + } else { + this->freetext = this->freetext.substring(0, this->cursor) + (char)this->payload + + this->freetext.substring(this->cursor); + } + this->cursor++; + uint16_t maxChars = meshtastic_Constants_DATA_PAYLOAD_LEN - (moduleConfig.canned_message.send_bell ? 1 : 0); + if (this->freetext.length() > maxChars) { + this->cursor = maxChars; + this->freetext = this->freetext.substring(0, maxChars); + } } break; } - if (screen) - screen->removeFunctionSymbol("Fn"); } - this->lastTouchMillis = millis(); this->notifyObservers(&e); return INACTIVATE_AFTER_MS; @@ -686,7 +1012,6 @@ int32_t CannedMessageModule::runOnce() this->notifyObservers(&e); return INACTIVATE_AFTER_MS; } - return INT32_MAX; } @@ -709,29 +1034,21 @@ const char *CannedMessageModule::getMessageByIndex(int index) const char *CannedMessageModule::getNodeName(NodeNum node) { - if (node == NODENUM_BROADCAST) { + if (node == NODENUM_BROADCAST) return "Broadcast"; - } else { - meshtastic_NodeInfoLite *info = nodeDB->getMeshNode(node); - if (info != NULL) { - return info->user.long_name; - } else { - return "Unknown"; - } + + meshtastic_NodeInfoLite *info = nodeDB->getMeshNode(node); + if (info && info->has_user && strlen(info->user.long_name) > 0) { + return info->user.long_name; } + + static char fallback[12]; + snprintf(fallback, sizeof(fallback), "0x%08x", node); + return fallback; } bool CannedMessageModule::shouldDraw() { - if (!moduleConfig.canned_message.enabled && !CANNED_MESSAGE_MODULE_ENABLE) { - return false; - } - - // If using "scan and select" input, don't draw the module frame just to say "disabled" - // The scanAndSelectInput class will draw its own temporary alert for user, when the input button is pressed - else if (scanAndSelectInput != nullptr && !hasMessages()) - return false; - return (currentMessageIndex != -1) || (this->runState != CANNED_MESSAGE_RUN_STATE_INACTIVE); } @@ -765,7 +1082,7 @@ void CannedMessageModule::showTemporaryMessage(const String &message) UIFrameEvent e; e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; // We want to change the list of frames shown on-screen notifyObservers(&e); - runState = CANNED_MESSAGE_RUN_STATE_MESSAGE; + runState = CANNED_MESSAGE_RUN_STATE_MESSAGE_SELECTION; // run this loop again in 2 seconds, next iteration will clear the display setIntervalFromNow(2000); } @@ -983,188 +1300,656 @@ bool CannedMessageModule::interceptingKeyboardInput() } } -#if !HAS_TFT +// Draw the node/channel selection screen +void CannedMessageModule::drawDestinationSelectionScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + requestFocus(); + display->setColor(WHITE); // Always draw cleanly + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + + // === Header === + int titleY = 2; + String titleText = "Select Destination"; + titleText += searchQuery.length() > 0 ? " [" + searchQuery + "]" : " [ ]"; + display->setTextAlignment(TEXT_ALIGN_CENTER); + display->drawString(display->getWidth() / 2, titleY, titleText); + display->setTextAlignment(TEXT_ALIGN_LEFT); + + // === List Items === + int rowYOffset = titleY + (FONT_HEIGHT_SMALL - 4); + int numActiveChannels = this->activeChannelIndices.size(); + int totalEntries = numActiveChannels + this->filteredNodes.size(); + int columns = 1; + this->visibleRows = (display->getHeight() - (titleY + FONT_HEIGHT_SMALL)) / (FONT_HEIGHT_SMALL - 4); + if (this->visibleRows < 1) + this->visibleRows = 1; + + // === Clamp scrolling === + if (scrollIndex > totalEntries / columns) + scrollIndex = totalEntries / columns; + if (scrollIndex < 0) + scrollIndex = 0; + + for (int row = 0; row < visibleRows; row++) { + int itemIndex = scrollIndex + row; + if (itemIndex >= totalEntries) + break; + + int xOffset = 0; + int yOffset = row * (FONT_HEIGHT_SMALL - 4) + rowYOffset; + char entryText[64] = ""; + + // Draw Channels First + if (itemIndex < numActiveChannels) { + uint8_t channelIndex = this->activeChannelIndices[itemIndex]; + snprintf(entryText, sizeof(entryText), "@%s", channels.getName(channelIndex)); + } + // Then Draw Nodes + else { + int nodeIndex = itemIndex - numActiveChannels; + if (nodeIndex >= 0 && nodeIndex < static_cast(this->filteredNodes.size())) { + meshtastic_NodeInfoLite *node = this->filteredNodes[nodeIndex].node; + if (node) { + if (node->is_favorite) { + snprintf(entryText, sizeof(entryText), "* %s", node->user.long_name); + } else { + snprintf(entryText, sizeof(entryText), "%s", node->user.long_name); + } + } + } + } + + if (strlen(entryText) == 0 || strcmp(entryText, "Unknown") == 0) + strcpy(entryText, "?"); + + // === Highlight background (if selected) === + if (itemIndex == destIndex) { + int scrollPadding = 8; // Reserve space for scrollbar + display->fillRect(0, yOffset + 2, display->getWidth() - scrollPadding, FONT_HEIGHT_SMALL - 5); + display->setColor(BLACK); + } + + // === Draw entry text === + display->drawString(xOffset + 2, yOffset, entryText); + display->setColor(WHITE); + + // === Draw key icon (after highlight) === + if (itemIndex >= numActiveChannels) { + int nodeIndex = itemIndex - numActiveChannels; + if (nodeIndex >= 0 && nodeIndex < static_cast(this->filteredNodes.size())) { + const meshtastic_NodeInfoLite *node = this->filteredNodes[nodeIndex].node; + if (node && hasKeyForNode(node)) { + int iconX = display->getWidth() - key_symbol_width - 15; + int iconY = yOffset + (FONT_HEIGHT_SMALL - key_symbol_height) / 2; + + if (itemIndex == destIndex) { + display->setColor(INVERSE); + } else { + display->setColor(WHITE); + } + display->drawXbm(iconX, iconY, key_symbol_width, key_symbol_height, key_symbol); + } + } + } + } + + // Scrollbar + if (totalEntries > visibleRows) { + int scrollbarHeight = visibleRows * (FONT_HEIGHT_SMALL - 4); + int totalScrollable = totalEntries; + int scrollTrackX = display->getWidth() - 6; + display->drawRect(scrollTrackX, rowYOffset, 4, scrollbarHeight); + int scrollHeight = (scrollbarHeight * visibleRows) / totalScrollable; + int scrollPos = rowYOffset + (scrollbarHeight * scrollIndex) / totalScrollable; + display->fillRect(scrollTrackX, scrollPos, 4, scrollHeight); + } +} + +void CannedMessageModule::drawEmotePickerScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + const int headerFontHeight = FONT_HEIGHT_SMALL; // Make sure this matches your actual small font height + const int headerMargin = 2; // Extra pixels below header + const int labelGap = 6; + const int bitmapGapX = 4; + + // Find max emote height (assume all same, or precalculated) + int maxEmoteHeight = 0; + for (int i = 0; i < graphics::numEmotes; ++i) + if (graphics::emotes[i].height > maxEmoteHeight) + maxEmoteHeight = graphics::emotes[i].height; + + const int rowHeight = maxEmoteHeight + 2; + + // Place header at top, then compute start of emote list + int headerY = y; + int listTop = headerY + headerFontHeight + headerMargin; + + int visibleRows = (display->getHeight() - listTop - 2) / rowHeight; + int numEmotes = graphics::numEmotes; + + // Clamp highlight index + if (emotePickerIndex < 0) + emotePickerIndex = 0; + if (emotePickerIndex >= numEmotes) + emotePickerIndex = numEmotes - 1; + + // Determine which emote is at the top + int topIndex = emotePickerIndex - visibleRows / 2; + if (topIndex < 0) + topIndex = 0; + if (topIndex > numEmotes - visibleRows) + topIndex = std::max(0, numEmotes - visibleRows); + + // Draw header/title + display->setFont(FONT_SMALL); + display->setTextAlignment(TEXT_ALIGN_CENTER); + display->drawString(display->getWidth() / 2, headerY, "Select Emote"); + + // Draw emote rows + display->setTextAlignment(TEXT_ALIGN_LEFT); + + for (int vis = 0; vis < visibleRows; ++vis) { + int emoteIdx = topIndex + vis; + if (emoteIdx >= numEmotes) + break; + const graphics::Emote &emote = graphics::emotes[emoteIdx]; + int rowY = listTop + vis * rowHeight; + + // Draw highlight box 2px taller than emote (1px margin above and below) + if (emoteIdx == emotePickerIndex) { + display->fillRect(x, rowY, display->getWidth() - 8, emote.height + 2); + display->setColor(BLACK); + } + + // Emote bitmap (left), 1px margin from highlight bar top + int emoteY = rowY + 1; + display->drawXbm(x + bitmapGapX, emoteY, emote.width, emote.height, emote.bitmap); + + // Emote label (right of bitmap) + display->setFont(FONT_MEDIUM); + int labelY = rowY + ((rowHeight - FONT_HEIGHT_MEDIUM) / 2); + display->drawString(x + bitmapGapX + emote.width + labelGap, labelY, emote.label); + + if (emoteIdx == emotePickerIndex) + display->setColor(WHITE); + } + + // Draw scrollbar if needed + if (numEmotes > visibleRows) { + int scrollbarHeight = visibleRows * rowHeight; + int scrollTrackX = display->getWidth() - 6; + display->drawRect(scrollTrackX, listTop, 4, scrollbarHeight); + int scrollBarLen = std::max(6, (scrollbarHeight * visibleRows) / numEmotes); + int scrollBarPos = listTop + (scrollbarHeight * topIndex) / numEmotes; + display->fillRect(scrollTrackX, scrollBarPos, 4, scrollBarLen); + } +} + void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { + this->displayHeight = display->getHeight(); // Store display height for later use char buffer[50]; + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + // === Draw temporary message if available === if (temporaryMessage.length() != 0) { requestFocus(); // Tell Screen::setFrames to move to our module's frame LOG_DEBUG("Draw temporary message: %s", temporaryMessage.c_str()); display->setTextAlignment(TEXT_ALIGN_CENTER); display->setFont(FONT_MEDIUM); display->drawString(display->getWidth() / 2 + x, 0 + y + 12, temporaryMessage); - } else if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED) { - requestFocus(); // Tell Screen::setFrames to move to our module's frame - EINK_ADD_FRAMEFLAG(display, COSMETIC); // Clean after this popup. Layout makes ghosting particularly obvious + return; + } -#ifdef USE_EINK - display->setFont(FONT_SMALL); // No chunky text -#else - display->setFont(FONT_MEDIUM); // Chunky text -#endif + // === Emote Picker Screen === + if (this->runState == CANNED_MESSAGE_RUN_STATE_EMOTE_PICKER) { + drawEmotePickerScreen(display, state, x, y); // <-- Call your emote picker drawer here + return; + } - String displayString; - display->setTextAlignment(TEXT_ALIGN_CENTER); - if (this->ack) { - displayString = "Delivered to\n%s"; - } else { - displayString = "Delivery failed\nto %s"; - } - display->drawStringf(display->getWidth() / 2 + x, 0 + y + 12, buffer, displayString, - cannedMessageModule->getNodeName(this->incoming)); + // === Destination Selection === + if (this->runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION) { + drawDestinationSelectionScreen(display, state, x, y); + return; + } - display->setFont(FONT_SMALL); - - String snrString = "Last Rx SNR: %f"; - String rssiString = "Last Rx RSSI: %d"; - - // Don't bother drawing snr and rssi for tiny displays - if (display->getHeight() > 100) { - - // Original implementation used constants of y = 100 and y = 130. Shrink this if screen is *slightly* small - int16_t snrY = 100; - int16_t rssiY = 130; - - // If dislay is *slighly* too small for the original consants, squish up a bit - if (display->getHeight() < rssiY + FONT_HEIGHT_SMALL) { - snrY = display->getHeight() - ((1.5) * FONT_HEIGHT_SMALL); - rssiY = display->getHeight() - ((2.5) * FONT_HEIGHT_SMALL); - } - - if (this->ack) { - display->drawStringf(display->getWidth() / 2 + x, snrY + y, buffer, snrString, this->lastRxSnr); - display->drawStringf(display->getWidth() / 2 + x, rssiY + y, buffer, rssiString, this->lastRxRssi); - } - } - } else if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE) { - // E-Ink: clean the screen *after* this pop-up + // === ACK/NACK Screen === + if (this->runState == CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED) { + requestFocus(); EINK_ADD_FRAMEFLAG(display, COSMETIC); - - requestFocus(); // Tell Screen::setFrames to move to our module's frame + display->setTextAlignment(TEXT_ALIGN_CENTER); #ifdef USE_EINK - display->setFont(FONT_SMALL); // No chunky text + display->setFont(FONT_SMALL); + int yOffset = y + 10; #else - display->setFont(FONT_MEDIUM); // Chunky text + display->setFont(FONT_MEDIUM); + int yOffset = y + 10; #endif + // --- Delivery Status Message --- + if (this->ack) { + if (this->lastSentNode == NODENUM_BROADCAST) { + snprintf(buffer, sizeof(buffer), "Broadcast Sent to\n%s", channels.getName(this->channel)); + } else if (this->lastAckHopLimit > this->lastAckHopStart) { + snprintf(buffer, sizeof(buffer), "Delivered (%d hops)\nto %s", this->lastAckHopLimit - this->lastAckHopStart, + getNodeName(this->incoming)); + } else { + snprintf(buffer, sizeof(buffer), "Delivered\nto %s", getNodeName(this->incoming)); + } + } else { + snprintf(buffer, sizeof(buffer), "Delivery failed\nto %s", getNodeName(this->incoming)); + } + + // Draw delivery message and compute y-offset after text height + int lineCount = 1; + for (const char *ptr = buffer; *ptr; ptr++) { + if (*ptr == '\n') + lineCount++; + } + + display->drawString(display->getWidth() / 2 + x, yOffset, buffer); + yOffset += lineCount * FONT_HEIGHT_MEDIUM; // only 1 line gap, no extra padding + +#ifndef USE_EINK + // --- SNR + RSSI Compact Line --- + if (this->ack) { + display->setFont(FONT_SMALL); + snprintf(buffer, sizeof(buffer), "SNR: %.1f dB RSSI: %d", this->lastRxSnr, this->lastRxRssi); + display->drawString(display->getWidth() / 2 + x, yOffset, buffer); + } +#endif + + return; + } + + // === Sending Screen === + if (this->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE) { + EINK_ADD_FRAMEFLAG(display, COSMETIC); + requestFocus(); +#ifdef USE_EINK + display->setFont(FONT_SMALL); +#else + display->setFont(FONT_MEDIUM); +#endif display->setTextAlignment(TEXT_ALIGN_CENTER); display->drawString(display->getWidth() / 2 + x, 0 + y + 12, "Sending..."); - } else if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_DISABLED) { + return; + } + + // === Disabled Screen === + if (this->runState == CANNED_MESSAGE_RUN_STATE_DISABLED) { display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); display->drawString(10 + x, 0 + y + FONT_HEIGHT_SMALL, "Canned Message\nModule disabled."); - } else if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) { - requestFocus(); // Tell Screen::setFrames to move to our module's frame + return; + } + + // === Free Text Input Screen === + if (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) { + requestFocus(); #if defined(USE_EINK) && defined(USE_EINK_DYNAMICDISPLAY) EInkDynamicDisplay *einkDisplay = static_cast(display); - einkDisplay->enableUnlimitedFastMode(); // Enable unlimited fast refresh while typing + einkDisplay->enableUnlimitedFastMode(); #endif - #if defined(USE_VIRTUAL_KEYBOARD) drawKeyboard(display, state, 0, 0); #else - display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); - if (this->destSelect != CANNED_MESSAGE_DESTINATION_TYPE_NONE) { - display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL); - display->setColor(BLACK); - } - switch (this->destSelect) { - case CANNED_MESSAGE_DESTINATION_TYPE_NODE: - display->drawStringf(1 + x, 0 + y, buffer, "To: >%s<@%s", cannedMessageModule->getNodeName(this->dest), - channels.getName(indexChannels[this->channel])); - display->drawStringf(0 + x, 0 + y, buffer, "To: >%s<@%s", cannedMessageModule->getNodeName(this->dest), - channels.getName(indexChannels[this->channel])); - break; - case CANNED_MESSAGE_DESTINATION_TYPE_CHANNEL: - display->drawStringf(1 + x, 0 + y, buffer, "To: %s@>%s<", cannedMessageModule->getNodeName(this->dest), - channels.getName(indexChannels[this->channel])); - display->drawStringf(0 + x, 0 + y, buffer, "To: %s@>%s<", cannedMessageModule->getNodeName(this->dest), - channels.getName(indexChannels[this->channel])); - break; - default: - if (display->getWidth() > 128) { - display->drawStringf(0 + x, 0 + y, buffer, "To: %s@%s", cannedMessageModule->getNodeName(this->dest), - channels.getName(indexChannels[this->channel])); - } else { - display->drawStringf(0 + x, 0 + y, buffer, "To: %.5s@%.5s", cannedMessageModule->getNodeName(this->dest), - channels.getName(indexChannels[this->channel])); - } - break; - } - // used chars right aligned, only when not editing the destination - if (this->destSelect == CANNED_MESSAGE_DESTINATION_TYPE_NONE) { + + // --- Draw node/channel header at the top --- + drawHeader(display, x, y, buffer); + + // --- Char count right-aligned --- + if (runState != CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION) { uint16_t charsLeft = meshtastic_Constants_DATA_PAYLOAD_LEN - this->freetext.length() - (moduleConfig.canned_message.send_bell ? 1 : 0); snprintf(buffer, sizeof(buffer), "%d left", charsLeft); display->drawString(x + display->getWidth() - display->getStringWidth(buffer), y + 0, buffer); } + + // --- Draw Free Text input with multi-emote support and proper line wrapping --- display->setColor(WHITE); - display->drawStringMaxWidth( - 0 + x, 0 + y + FONT_HEIGHT_SMALL, x + display->getWidth(), - cannedMessageModule->drawWithCursor(cannedMessageModule->freetext, cannedMessageModule->cursor)); -#endif - } else { - if (this->messagesCount > 0) { - display->setTextAlignment(TEXT_ALIGN_LEFT); - display->setFont(FONT_SMALL); - display->drawStringf(0 + x, 0 + y, buffer, "To: %s", cannedMessageModule->getNodeName(this->dest)); - int lines = (display->getHeight() / FONT_HEIGHT_SMALL) - 1; - if (lines == 3) { - display->fillRect(0 + x, 0 + y + FONT_HEIGHT_SMALL * 2, x + display->getWidth(), y + FONT_HEIGHT_SMALL); - display->setColor(BLACK); - display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL * 2, cannedMessageModule->getCurrentMessage()); - display->setColor(WHITE); - if (this->messagesCount > 1) { - display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL, cannedMessageModule->getPrevMessage()); - display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL * 3, cannedMessageModule->getNextMessage()); + { + int inputY = 0 + y + FONT_HEIGHT_SMALL; + String msgWithCursor = this->drawWithCursor(this->freetext, this->cursor); + + // Tokenize input into (isEmote, token) pairs + std::vector> tokens; + const char *msg = msgWithCursor.c_str(); + int msgLen = strlen(msg); + int pos = 0; + while (pos < msgLen) { + const graphics::Emote *foundEmote = nullptr; + int foundLen = 0; + for (int j = 0; j < graphics::numEmotes; j++) { + const char *label = graphics::emotes[j].label; + int labelLen = strlen(label); + if (labelLen == 0) + continue; + if (strncmp(msg + pos, label, labelLen) == 0) { + if (!foundEmote || labelLen > foundLen) { + foundEmote = &graphics::emotes[j]; + foundLen = labelLen; + } + } } - } else { - int topMsg = (messagesCount > lines && currentMessageIndex >= lines - 1) ? currentMessageIndex - lines + 2 : 0; - for (int i = 0; i < std::min(messagesCount, lines); i++) { - if (i == currentMessageIndex - topMsg) { -#ifdef USE_EINK - display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL * (i + 1), ">"); - display->drawString(12 + x, 0 + y + FONT_HEIGHT_SMALL * (i + 1), - cannedMessageModule->getCurrentMessage()); -#else - display->fillRect(0 + x, 0 + y + FONT_HEIGHT_SMALL * (i + 1), x + display->getWidth(), - y + FONT_HEIGHT_SMALL); - display->setColor(BLACK); - display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL * (i + 1), cannedMessageModule->getCurrentMessage()); - display->setColor(WHITE); -#endif - } else if (messagesCount > 1) { // Only draw others if there are multiple messages - display->drawString(0 + x, 0 + y + FONT_HEIGHT_SMALL * (i + 1), - cannedMessageModule->getMessageByIndex(topMsg + i)); + if (foundEmote) { + tokens.emplace_back(true, String(foundEmote->label)); + pos += foundLen; + } else { + // Find next emote + int nextEmote = msgLen; + for (int j = 0; j < graphics::numEmotes; j++) { + const char *label = graphics::emotes[j].label; + if (!label || !*label) + continue; + const char *found = strstr(msg + pos, label); + if (found && (found - msg) < nextEmote) { + nextEmote = found - msg; + } + } + int textLen = (nextEmote > pos) ? (nextEmote - pos) : (msgLen - pos); + if (textLen > 0) { + tokens.emplace_back(false, String(msg + pos).substring(0, textLen)); + pos += textLen; + } else { + break; } } } + + // ===== Advanced word-wrapping (emotes + text, split by word, wrap by char if needed) ===== + std::vector>> lines; + std::vector> currentLine; + int lineWidth = 0; + int maxWidth = display->getWidth(); + for (auto &token : tokens) { + if (token.first) { + // Emote + int tokenWidth = 0; + for (int j = 0; j < graphics::numEmotes; j++) { + if (token.second == graphics::emotes[j].label) { + tokenWidth = graphics::emotes[j].width + 2; + break; + } + } + if (lineWidth + tokenWidth > maxWidth && !currentLine.empty()) { + lines.push_back(currentLine); + currentLine.clear(); + lineWidth = 0; + } + currentLine.push_back(token); + lineWidth += tokenWidth; + } else { + // Text: split by words and wrap inside word if needed + String text = token.second; + uint16_t pos = 0; + while (pos < text.length()) { + // Find next space (or end) + int spacePos = text.indexOf(' ', pos); + int endPos = (spacePos == -1) ? text.length() : spacePos + 1; // Include space + String word = text.substring(pos, endPos); + int wordWidth = display->getStringWidth(word); + + if (lineWidth + wordWidth > maxWidth && lineWidth > 0) { + lines.push_back(currentLine); + currentLine.clear(); + lineWidth = 0; + } + // If word itself too big, split by character + if (wordWidth > maxWidth) { + uint16_t charPos = 0; + while (charPos < word.length()) { + String oneChar = word.substring(charPos, charPos + 1); + int charWidth = display->getStringWidth(oneChar); + if (lineWidth + charWidth > maxWidth && lineWidth > 0) { + lines.push_back(currentLine); + currentLine.clear(); + lineWidth = 0; + } + currentLine.push_back({false, oneChar}); + lineWidth += charWidth; + charPos++; + } + } else { + currentLine.push_back({false, word}); + lineWidth += wordWidth; + } + pos = endPos; + } + } + } + if (!currentLine.empty()) + lines.push_back(currentLine); + + // Draw lines with emotes + int rowHeight = FONT_HEIGHT_SMALL; + int yLine = inputY; + for (auto &line : lines) { + int nextX = x; + for (auto &token : line) { + if (token.first) { + const graphics::Emote *emote = nullptr; + for (int j = 0; j < graphics::numEmotes; j++) { + if (token.second == graphics::emotes[j].label) { + emote = &graphics::emotes[j]; + break; + } + } + if (emote) { + int emoteYOffset = (rowHeight - emote->height) / 2; + display->drawXbm(nextX, yLine + emoteYOffset, emote->width, emote->height, emote->bitmap); + nextX += emote->width + 2; + } + } else { + display->drawString(nextX, yLine, token.second); + nextX += display->getStringWidth(token.second); + } + } + yLine += rowHeight; + } + } +#endif + return; + } + + // === Canned Messages List === + if (this->messagesCount > 0) { + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + + // ====== Precompute per-row heights based on emotes (centered if present) ====== + const int baseRowSpacing = FONT_HEIGHT_SMALL - 4; + + int topMsg; + std::vector rowHeights; + int visibleRows; + + // Draw header (To: ...) + drawHeader(display, x, y, buffer); + + // Shift message list upward by 3 pixels to reduce spacing between header and first message + const int listYOffset = y + FONT_HEIGHT_SMALL - 3; + visibleRows = (display->getHeight() - listYOffset) / baseRowSpacing; + + // Figure out which messages are visible and their needed heights + topMsg = + (messagesCount > visibleRows && currentMessageIndex >= visibleRows - 1) ? currentMessageIndex - visibleRows + 2 : 0; + int countRows = std::min(messagesCount, visibleRows); + + // --- Build per-row max height based on all emotes in line --- + for (int i = 0; i < countRows; i++) { + const char *msg = getMessageByIndex(topMsg + i); + int maxEmoteHeight = 0; + for (int j = 0; j < graphics::numEmotes; j++) { + const char *label = graphics::emotes[j].label; + if (!label || !*label) + continue; + const char *search = msg; + while ((search = strstr(search, label))) { + if (graphics::emotes[j].height > maxEmoteHeight) + maxEmoteHeight = graphics::emotes[j].height; + search += strlen(label); // Advance past this emote + } + } + rowHeights.push_back(std::max(baseRowSpacing, maxEmoteHeight + 2)); + } + + // --- Draw all message rows with multi-emote support --- + int yCursor = listYOffset; + for (int vis = 0; vis < countRows; vis++) { + int msgIdx = topMsg + vis; + int lineY = yCursor; + const char *msg = getMessageByIndex(msgIdx); + int rowHeight = rowHeights[vis]; + bool highlight = (msgIdx == currentMessageIndex); + + // --- Multi-emote tokenization --- + std::vector> tokens; // (isEmote, token) + int pos = 0; + int msgLen = strlen(msg); + while (pos < msgLen) { + const graphics::Emote *foundEmote = nullptr; + int foundLen = 0; + + // Look for any emote label at this pos (prefer longest match) + for (int j = 0; j < graphics::numEmotes; j++) { + const char *label = graphics::emotes[j].label; + int labelLen = strlen(label); + if (labelLen == 0) + continue; + if (strncmp(msg + pos, label, labelLen) == 0) { + if (!foundEmote || labelLen > foundLen) { + foundEmote = &graphics::emotes[j]; + foundLen = labelLen; + } + } + } + if (foundEmote) { + tokens.emplace_back(true, String(foundEmote->label)); + pos += foundLen; + } else { + // Find next emote + int nextEmote = msgLen; + for (int j = 0; j < graphics::numEmotes; j++) { + const char *label = graphics::emotes[j].label; + if (label[0] == 0) + continue; + const char *found = strstr(msg + pos, label); + if (found && (found - msg) < nextEmote) { + nextEmote = found - msg; + } + } + int textLen = (nextEmote > pos) ? (nextEmote - pos) : (msgLen - pos); + if (textLen > 0) { + tokens.emplace_back(false, String(msg + pos).substring(0, textLen)); + pos += textLen; + } else { + break; + } + } + } + // --- End multi-emote tokenization --- + + // Vertically center based on rowHeight + int textYOffset = (rowHeight - FONT_HEIGHT_SMALL) / 2; + +#ifdef USE_EINK + int nextX = x + (highlight ? 12 : 0); + if (highlight) + display->drawString(x + 0, lineY + textYOffset, ">"); +#else + int scrollPadding = 8; + if (highlight) { + display->fillRect(x + 0, lineY, display->getWidth() - scrollPadding, rowHeight); + display->setColor(BLACK); + } + int nextX = x + (highlight ? 2 : 0); +#endif + + // Draw all tokens left to right + for (auto &token : tokens) { + if (token.first) { + // Emote + const graphics::Emote *emote = nullptr; + for (int j = 0; j < graphics::numEmotes; j++) { + if (token.second == graphics::emotes[j].label) { + emote = &graphics::emotes[j]; + break; + } + } + if (emote) { + int emoteYOffset = (rowHeight - emote->height) / 2; + display->drawXbm(nextX, lineY + emoteYOffset, emote->width, emote->height, emote->bitmap); + nextX += emote->width + 2; + } + } else { + // Text + display->drawString(nextX, lineY + textYOffset, token.second); + nextX += display->getStringWidth(token.second); + } + } +#ifndef USE_EINK + if (highlight) + display->setColor(WHITE); +#endif + + yCursor += rowHeight; + } + + // Scrollbar + if (messagesCount > visibleRows) { + int scrollHeight = display->getHeight() - listYOffset; + int scrollTrackX = display->getWidth() - 6; + display->drawRect(scrollTrackX, listYOffset, 4, scrollHeight); + int barHeight = (scrollHeight * visibleRows) / messagesCount; + int scrollPos = listYOffset + (scrollHeight * topMsg) / messagesCount; + display->fillRect(scrollTrackX, scrollPos, 4, barHeight); } } } -#endif //! HAS_TFT ProcessMessage CannedMessageModule::handleReceived(const meshtastic_MeshPacket &mp) { if (mp.decoded.portnum == meshtastic_PortNum_ROUTING_APP && waitingForAck) { - // look for a request_id if (mp.decoded.request_id != 0) { + // Trigger screen refresh for ACK/NACK feedback UIFrameEvent e; - e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; // We want to change the list of frames shown on-screen - requestFocus(); // Tell Screen::setFrames that our module's frame should be shown, even if not "first" in the frameset + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + requestFocus(); this->runState = CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED; - this->incoming = service->getNodenumFromRequestId(mp.decoded.request_id); + + // Decode the routing response meshtastic_Routing decoded = meshtastic_Routing_init_default; pb_decode_from_bytes(mp.decoded.payload.bytes, mp.decoded.payload.size, meshtastic_Routing_fields, &decoded); - this->ack = decoded.error_reason == meshtastic_Routing_Error_NONE; - waitingForAck = false; // No longer want routing packets + + // Track hop metadata + this->lastAckWasRelayed = (mp.hop_limit != mp.hop_start); + this->lastAckHopStart = mp.hop_start; + this->lastAckHopLimit = mp.hop_limit; + + // Determine ACK status + bool isAck = (decoded.error_reason == meshtastic_Routing_Error_NONE); + bool isFromDest = (mp.from == this->lastSentNode); + bool wasBroadcast = (this->lastSentNode == NODENUM_BROADCAST); + + // Identify the responding node + if (wasBroadcast && mp.from != nodeDB->getNodeNum()) { + this->incoming = mp.from; // Relayed by another node + } else { + this->incoming = this->lastSentNode; // Direct reply + } + + // Final ACK confirmation logic + this->ack = isAck && (wasBroadcast || isFromDest); + + waitingForAck = false; this->notifyObservers(&e); - // run the next time 2 seconds later - setIntervalFromNow(2000); + setIntervalFromNow(3000); // Time to show ACK/NACK screen } } @@ -1206,7 +1991,7 @@ bool CannedMessageModule::saveProtoForModule() */ void CannedMessageModule::installDefaultCannedMessageModuleConfig() { - memset(cannedMessageModuleConfig.messages, 0, sizeof(cannedMessageModuleConfig.messages)); + strncpy(cannedMessageModuleConfig.messages, "Hi|Bye|Yes|No|Ok", sizeof(cannedMessageModuleConfig.messages)); } /** @@ -1276,4 +2061,4 @@ String CannedMessageModule::drawWithCursor(String text, int cursor) return result; } -#endif +#endif \ No newline at end of file diff --git a/src/modules/CannedMessageModule.h b/src/modules/CannedMessageModule.h index a91933a0f..55a0a1185 100644 --- a/src/modules/CannedMessageModule.h +++ b/src/modules/CannedMessageModule.h @@ -3,27 +3,38 @@ #include "ProtobufModule.h" #include "input/InputBroker.h" +// ============================ +// Enums & Defines +// ============================ + enum cannedMessageModuleRunState { CANNED_MESSAGE_RUN_STATE_DISABLED, CANNED_MESSAGE_RUN_STATE_INACTIVE, CANNED_MESSAGE_RUN_STATE_ACTIVE, - CANNED_MESSAGE_RUN_STATE_FREETEXT, CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE, CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED, - CANNED_MESSAGE_RUN_STATE_MESSAGE, CANNED_MESSAGE_RUN_STATE_ACTION_SELECT, CANNED_MESSAGE_RUN_STATE_ACTION_UP, CANNED_MESSAGE_RUN_STATE_ACTION_DOWN, -}; - -enum cannedMessageDestinationType { - CANNED_MESSAGE_DESTINATION_TYPE_NONE, - CANNED_MESSAGE_DESTINATION_TYPE_NODE, - CANNED_MESSAGE_DESTINATION_TYPE_CHANNEL + CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION, + CANNED_MESSAGE_RUN_STATE_FREETEXT, + CANNED_MESSAGE_RUN_STATE_MESSAGE_SELECTION, + CANNED_MESSAGE_RUN_STATE_EMOTE_PICKER }; enum CannedMessageModuleIconType { shift, backspace, space, enter }; +#define CANNED_MESSAGE_MODULE_MESSAGE_MAX_COUNT 50 +#define CANNED_MESSAGE_MODULE_MESSAGES_SIZE 800 + +#ifndef CANNED_MESSAGE_MODULE_ENABLE +#define CANNED_MESSAGE_MODULE_ENABLE 0 +#endif + +// ============================ +// Data Structures +// ============================ + struct Letter { String character; float width; @@ -33,71 +44,72 @@ struct Letter { int rectHeight; }; -#define CANNED_MESSAGE_MODULE_MESSAGE_MAX_COUNT 50 -/** - * Sum of CannedMessageModuleConfig part sizes. - */ -#define CANNED_MESSAGE_MODULE_MESSAGES_SIZE 800 +struct NodeEntry { + meshtastic_NodeInfoLite *node; + uint32_t lastHeard; +}; -#ifndef CANNED_MESSAGE_MODULE_ENABLE -#define CANNED_MESSAGE_MODULE_ENABLE 0 -#endif +// ============================ +// Main Class +// ============================ class CannedMessageModule : public SinglePortModule, public Observable, private concurrency::OSThread { - CallbackObserver inputObserver = - CallbackObserver(this, &CannedMessageModule::handleInputEvent); - public: CannedMessageModule(); + + void LaunchWithDestination(NodeNum, uint8_t newChannel = 0); + void LaunchFreetextWithDestination(NodeNum, uint8_t newChannel = 0); + + // === Emote Picker navigation === + int emotePickerIndex = 0; // Tracks currently selected emote in the picker + + // === Message navigation === const char *getCurrentMessage(); const char *getPrevMessage(); const char *getNextMessage(); const char *getMessageByIndex(int index); const char *getNodeName(NodeNum node); + + // === State/UI === bool shouldDraw(); bool hasMessages(); - // void eventUp(); - // void eventDown(); - // void eventSelect(); + void showTemporaryMessage(const String &message); + void resetSearch(); + void updateDestinationSelectionList(); + void drawDestinationSelectionScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + bool isCharInputAllowed() const; + String drawWithCursor(String text, int cursor); + // === Emote Picker === + int handleEmotePickerInput(const InputEvent *event); + void drawEmotePickerScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); + + // === Admin Handlers === void handleGetCannedMessageModuleMessages(const meshtastic_MeshPacket &req, meshtastic_AdminMessage *response); void handleSetCannedMessageModuleMessages(const char *from_msg); - void showTemporaryMessage(const String &message); - - String drawWithCursor(String text, int cursor); - #ifdef RAK14014 cannedMessageModuleRunState getRunState() const { return runState; } #endif - /* - -Override the wantPacket method. We need the Routing Messages to look for ACKs. - */ + // === Packet Interest Filter === virtual bool wantPacket(const meshtastic_MeshPacket *p) override { - if (p->rx_rssi != 0) { - this->lastRxRssi = p->rx_rssi; - } - - if (p->rx_snr > 0) { - this->lastRxSnr = p->rx_snr; - } - - switch (p->decoded.portnum) { - case meshtastic_PortNum_ROUTING_APP: - return waitingForAck; - default: - return false; - } + if (p->rx_rssi != 0) + lastRxRssi = p->rx_rssi; + if (p->rx_snr > 0) + lastRxSnr = p->rx_snr; + return (p->decoded.portnum == meshtastic_PortNum_ROUTING_APP) ? waitingForAck : false; } protected: + // === Thread Entry Point === virtual int32_t runOnce() override; + // === Transmission === void sendText(NodeNum dest, ChannelIndex channel, const char *message, bool wantReplies); - + void drawHeader(OLEDDisplay *display, int16_t x, int16_t y, char *buffer); int splitConfiguredMessages(); int getNextIndex(); int getPrevIndex(); @@ -105,58 +117,87 @@ class CannedMessageModule : public SinglePortModule, public ObservableshouldDraw(); } + virtual bool wantUIFrame() override { return shouldDraw(); } virtual Observable *getUIFrameObservable() override { return this; } virtual bool interceptingKeyboardInput() override; -#if !HAS_TFT virtual void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) override; -#endif virtual AdminMessageHandleResult handleAdminMessageForModule(const meshtastic_MeshPacket &mp, meshtastic_AdminMessage *request, meshtastic_AdminMessage *response) override; - /** Called to handle a particular incoming message - * @return ProcessMessage::STOP if you've guaranteed you've handled this message and no other handlers should be considered - * for it - */ virtual ProcessMessage handleReceived(const meshtastic_MeshPacket &mp) override; void loadProtoForModule(); bool saveProtoForModule(); - void installDefaultCannedMessageModuleConfig(); - int currentMessageIndex = -1; - cannedMessageModuleRunState runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; - char payload = 0x00; - unsigned int cursor = 0; - String freetext = ""; // Text Buffer for Freetext Editor - NodeNum dest = NODENUM_BROADCAST; - ChannelIndex channel = 0; - cannedMessageDestinationType destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE; - uint8_t numChannels = 0; - ChannelIndex indexChannels[MAX_NUM_CHANNELS] = {0}; - NodeNum incoming = NODENUM_BROADCAST; - bool ack = false; // True means ACK, false means NAK (error_reason != NONE) - bool waitingForAck = false; // Are currently interested in routing packets? - float lastRxSnr = 0; - int32_t lastRxRssi = 0; + private: + // === Input Observers === + CallbackObserver inputObserver = + CallbackObserver(this, &CannedMessageModule::handleInputEvent); + // === Display and UI === + int displayHeight = 64; + int destIndex = 0; + int scrollIndex = 0; + int visibleRows = 0; + bool needsUpdate = true; + unsigned long lastUpdateMillis = 0; + String searchQuery; + String freetext; + String temporaryMessage; + + // === Message Storage === char messageStore[CANNED_MESSAGE_MODULE_MESSAGES_SIZE + 1]; char *messages[CANNED_MESSAGE_MODULE_MESSAGE_MAX_COUNT]; int messagesCount = 0; + int currentMessageIndex = -1; + + // === Routing & Acknowledgment === + NodeNum dest = NODENUM_BROADCAST; // Destination node for outgoing messages (default: broadcast) + NodeNum incoming = NODENUM_BROADCAST; // Source node from which last ACK/NACK was received + NodeNum lastSentNode = 0; // Tracks the most recent node we sent a message to (for UI display) + ChannelIndex channel = 0; // Channel index used when sending a message + + bool ack = false; // True = ACK received, False = NACK or failed + bool waitingForAck = false; // True if we're expecting an ACK and should monitor routing packets + bool lastAckWasRelayed = false; // True if the ACK was relayed through intermediate nodes + uint8_t lastAckHopStart = 0; // Hop start value from the received ACK packet + uint8_t lastAckHopLimit = 0; // Hop limit value from the received ACK packet + + float lastRxSnr = 0; // SNR from last received ACK (used for diagnostics/UI) + int32_t lastRxRssi = 0; // RSSI from last received ACK (used for diagnostics/UI) + + // === State Tracking === + cannedMessageModuleRunState runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + char highlight = 0x00; + char payload = 0x00; + unsigned int cursor = 0; unsigned long lastTouchMillis = 0; - String temporaryMessage; + uint32_t lastFilterUpdate = 0; + static constexpr uint32_t filterDebounceMs = 30; + std::vector activeChannelIndices; + std::vector filteredNodes; + +#if defined(USE_VIRTUAL_KEYBOARD) + bool shift = false; + int charSet = 0; // 0=ABC, 1=123 +#endif + + bool isUpEvent(const InputEvent *event); + bool isDownEvent(const InputEvent *event); + bool isSelectEvent(const InputEvent *event); + bool handleTabSwitch(const InputEvent *event); + int handleDestinationSelectionInput(const InputEvent *event, bool isUp, bool isDown, bool isSelect); + bool handleMessageSelectorInput(const InputEvent *event, bool isUp, bool isDown, bool isSelect); + bool handleFreeTextInput(const InputEvent *event); #if defined(USE_VIRTUAL_KEYBOARD) Letter keyboard[2][4][10] = {{{{"Q", 20, 0, 0, 0, 0}, diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index 615c3590b..956508ce5 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -188,7 +188,7 @@ int32_t ExternalNotificationModule::runOnce() // Play RTTTL over i2s audio interface if enabled as buzzer #ifdef HAS_I2S - if (moduleConfig.external_notification.use_i2s_as_buzzer) { + if (moduleConfig.external_notification.use_i2s_as_buzzer && canBuzz()) { if (audioThread->isPlaying()) { // Continue playing } else if (isNagging && (nagCycleCutoff >= millis())) { @@ -197,7 +197,7 @@ int32_t ExternalNotificationModule::runOnce() } #endif // now let the PWM buzzer play - if (moduleConfig.external_notification.use_pwm && config.device.buzzer_gpio) { + if (moduleConfig.external_notification.use_pwm && config.device.buzzer_gpio && canBuzz()) { if (rtttl::isPlaying()) { rtttl::play(); } else if (isNagging && (nagCycleCutoff >= millis())) { @@ -210,6 +210,18 @@ int32_t ExternalNotificationModule::runOnce() } } +/** + * Based on buzzer mode, return true if we can buzz. + */ +bool ExternalNotificationModule::canBuzz() +{ + if (config.device.buzzer_mode != meshtastic_Config_DeviceConfig_BuzzerMode_DISABLED && + config.device.buzzer_mode != meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY) { + return true; + } + return false; +} + bool ExternalNotificationModule::wantPacket(const meshtastic_MeshPacket *p) { return MeshService::isTextPayload(p); @@ -344,6 +356,9 @@ ExternalNotificationModule::ExternalNotificationModule() // moduleConfig.external_notification.alert_message_buzzer = true; if (moduleConfig.external_notification.enabled) { + if (inputBroker) // put our callback in the inputObserver list + inputObserver.observe(inputBroker); + if (nodeDB->loadProto(rtttlConfigFile, meshtastic_RTTTLConfig_size, sizeof(meshtastic_RTTTLConfig), &meshtastic_RTTTLConfig_msg, &rtttlConfig) != LoadFileResult::LOAD_SUCCESS) { memset(rtttlConfig.ringtone, 0, sizeof(rtttlConfig.ringtone)); @@ -370,7 +385,7 @@ ExternalNotificationModule::ExternalNotificationModule() setExternalState(1, false); externalTurnedOn[1] = 0; } - if (moduleConfig.external_notification.output_buzzer) { + if (moduleConfig.external_notification.output_buzzer && canBuzz()) { if (!moduleConfig.external_notification.use_pwm) { LOG_INFO("Use Pin %i for buzzer", moduleConfig.external_notification.output_buzzer); pinMode(moduleConfig.external_notification.output_buzzer, OUTPUT); @@ -460,7 +475,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP } } - if (moduleConfig.external_notification.alert_bell_buzzer) { + if (moduleConfig.external_notification.alert_bell_buzzer && canBuzz()) { if (containsBell) { LOG_INFO("externalNotificationModule - Notification Bell (Buzzer)"); isNagging = true; @@ -589,4 +604,13 @@ void ExternalNotificationModule::handleSetRingtone(const char *from_msg) if (changed) { nodeDB->saveProto(rtttlConfigFile, meshtastic_RTTTLConfig_size, &meshtastic_RTTTLConfig_msg, &rtttlConfig); } +} + +int ExternalNotificationModule::handleInputEvent(const InputEvent *event) +{ + if (nagCycleCutoff != UINT32_MAX) { + stopNow(); + return 1; + } + return 0; } \ No newline at end of file diff --git a/src/modules/ExternalNotificationModule.h b/src/modules/ExternalNotificationModule.h index 85950464d..19cf9eb7b 100644 --- a/src/modules/ExternalNotificationModule.h +++ b/src/modules/ExternalNotificationModule.h @@ -3,6 +3,8 @@ #include "SinglePortModule.h" #include "concurrency/OSThread.h" #include "configuration.h" +#include "input/InputBroker.h" + #if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(CONFIG_IDF_TARGET_ESP32C6) #include #else @@ -27,11 +29,15 @@ class rtttl */ class ExternalNotificationModule : public SinglePortModule, private concurrency::OSThread { + CallbackObserver inputObserver = + CallbackObserver(this, &ExternalNotificationModule::handleInputEvent); uint32_t output = 0; public: ExternalNotificationModule(); + int handleInputEvent(const InputEvent *arg); + uint32_t nagCycleCutoff = 1; void setExternalState(uint8_t index = 0, bool on = false); @@ -40,6 +46,7 @@ class ExternalNotificationModule : public SinglePortModule, private concurrency: void setMute(bool mute) { isMuted = mute; } bool getMute() { return isMuted; } + bool canBuzz(); bool nagging(); void stopNow(); diff --git a/src/modules/KeyVerificationModule.cpp b/src/modules/KeyVerificationModule.cpp new file mode 100644 index 000000000..f5a9f2359 --- /dev/null +++ b/src/modules/KeyVerificationModule.cpp @@ -0,0 +1,310 @@ +#if !MESHTASTIC_EXCLUDE_PKI +#include "KeyVerificationModule.h" +#include "MeshService.h" +#include "RTC.h" +#include "main.h" +#include "modules/AdminModule.h" +#include + +KeyVerificationModule *keyVerificationModule; + +KeyVerificationModule::KeyVerificationModule() + : ProtobufModule("KeyVerification", meshtastic_PortNum_KEY_VERIFICATION_APP, &meshtastic_KeyVerification_msg) +{ + ourPortNum = meshtastic_PortNum_KEY_VERIFICATION_APP; +} + +AdminMessageHandleResult KeyVerificationModule::handleAdminMessageForModule(const meshtastic_MeshPacket &mp, + meshtastic_AdminMessage *request, + meshtastic_AdminMessage *response) +{ + updateState(); + if (request->which_payload_variant == meshtastic_AdminMessage_key_verification_tag && mp.from == 0) { + LOG_WARN("Handling Key Verification Admin Message type %u", request->key_verification.message_type); + + if (request->key_verification.message_type == meshtastic_KeyVerificationAdmin_MessageType_INITIATE_VERIFICATION && + currentState == KEY_VERIFICATION_IDLE) { + sendInitialRequest(request->key_verification.remote_nodenum); + + } else if (request->key_verification.message_type == + meshtastic_KeyVerificationAdmin_MessageType_PROVIDE_SECURITY_NUMBER && + request->key_verification.has_security_number && currentState == KEY_VERIFICATION_SENDER_AWAITING_NUMBER && + request->key_verification.nonce == currentNonce) { + processSecurityNumber(request->key_verification.security_number); + + } else if (request->key_verification.message_type == meshtastic_KeyVerificationAdmin_MessageType_DO_VERIFY && + request->key_verification.nonce == currentNonce) { + auto remoteNodePtr = nodeDB->getMeshNode(currentRemoteNode); + remoteNodePtr->bitfield |= NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK; + resetToIdle(); + } else if (request->key_verification.message_type == meshtastic_KeyVerificationAdmin_MessageType_DO_NOT_VERIFY) { + resetToIdle(); + } + return AdminMessageHandleResult::HANDLED; + } + return AdminMessageHandleResult::NOT_HANDLED; +} + +bool KeyVerificationModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_KeyVerification *r) +{ + updateState(); + if (mp.pki_encrypted == false) + return false; + if (mp.from != currentRemoteNode) // because the inital connection request is handled in allocReply() + return false; + if (currentState == KEY_VERIFICATION_IDLE) { + return false; // if we're idle, the only acceptable message is an init, which should be handled by allocReply() + + } else if (currentState == KEY_VERIFICATION_SENDER_HAS_INITIATED && r->nonce == currentNonce && r->hash2.size == 32 && + r->hash1.size == 0) { + memcpy(hash2, r->hash2.bytes, 32); + if (screen) + screen->showOverlayBanner("Enter Security Number", 30000); + + meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->level = meshtastic_LogRecord_Level_WARNING; + sprintf(cn->message, "Enter Security Number for Key Verification"); + cn->which_payload_variant = meshtastic_ClientNotification_key_verification_number_request_tag; + cn->payload_variant.key_verification_number_request.nonce = currentNonce; + strncpy(cn->payload_variant.key_verification_number_request.remote_longname, // should really check for nulls, etc + nodeDB->getMeshNode(currentRemoteNode)->user.long_name, + sizeof(cn->payload_variant.key_verification_number_request.remote_longname)); + service->sendClientNotification(cn); + LOG_INFO("Received hash2"); + currentState = KEY_VERIFICATION_SENDER_AWAITING_NUMBER; + return true; + + } else if (currentState == KEY_VERIFICATION_RECEIVER_AWAITING_HASH1 && r->hash1.size == 32 && r->nonce == currentNonce) { + if (memcmp(hash1, r->hash1.bytes, 32) == 0) { + memset(message, 0, sizeof(message)); + sprintf(message, "Verification: \n"); + generateVerificationCode(message + 15); + sprintf(message + 24, "\nACCEPT\nREJECT"); + LOG_INFO("Hash1 matches!"); + if (screen) { + screen->showOverlayBanner(message, 30000, 2, [=](int selected) { + if (selected == 0) { + auto remoteNodePtr = nodeDB->getMeshNode(currentRemoteNode); + remoteNodePtr->bitfield |= NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK; + } + }); + } + meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->level = meshtastic_LogRecord_Level_WARNING; + sprintf(cn->message, "Final confirmation for incoming manual key verification %s", message); + cn->which_payload_variant = meshtastic_ClientNotification_key_verification_final_tag; + cn->payload_variant.key_verification_final.nonce = currentNonce; + strncpy(cn->payload_variant.key_verification_final.remote_longname, // should really check for nulls, etc + nodeDB->getMeshNode(currentRemoteNode)->user.long_name, + sizeof(cn->payload_variant.key_verification_final.remote_longname)); + cn->payload_variant.key_verification_final.isSender = false; + service->sendClientNotification(cn); + + currentState = KEY_VERIFICATION_RECEIVER_AWAITING_USER; + return true; + } + } + return false; +} + +bool KeyVerificationModule::sendInitialRequest(NodeNum remoteNode) +{ + LOG_DEBUG("keyVerification start"); + // generate nonce + updateState(); + if (currentState != KEY_VERIFICATION_IDLE) { + return false; + } + currentNonce = random(); + currentNonceTimestamp = getTime(); + currentRemoteNode = remoteNode; + meshtastic_KeyVerification KeyVerification = meshtastic_KeyVerification_init_zero; + KeyVerification.nonce = currentNonce; + KeyVerification.hash2.size = 0; + KeyVerification.hash1.size = 0; + meshtastic_MeshPacket *p = allocDataProtobuf(KeyVerification); + p->to = remoteNode; + p->channel = 0; + p->pki_encrypted = true; + p->decoded.want_response = true; + p->priority = meshtastic_MeshPacket_Priority_HIGH; + service->sendToMesh(p, RX_SRC_LOCAL, true); + + currentState = KEY_VERIFICATION_SENDER_HAS_INITIATED; + return true; +} + +meshtastic_MeshPacket *KeyVerificationModule::allocReply() +{ + SHA256 hash; + NodeNum ourNodeNum = nodeDB->getNodeNum(); + updateState(); + if (currentState != KEY_VERIFICATION_IDLE) { // TODO: cooldown period + LOG_WARN("Key Verification requested, but already in a request"); + return nullptr; + } else if (!currentRequest->pki_encrypted) { + LOG_WARN("Key Verification requested, but not in a PKI packet"); + return nullptr; + } + currentState = KEY_VERIFICATION_RECEIVER_AWAITING_HASH1; + + auto req = *currentRequest; + const auto &p = req.decoded; + meshtastic_KeyVerification scratch; + meshtastic_KeyVerification response; + meshtastic_MeshPacket *responsePacket = nullptr; + pb_decode_from_bytes(p.payload.bytes, p.payload.size, &meshtastic_KeyVerification_msg, &scratch); + + currentNonce = scratch.nonce; + response.nonce = scratch.nonce; + currentRemoteNode = req.from; + currentNonceTimestamp = getTime(); + currentSecurityNumber = random(1, 999999); + + // generate hash1 + hash.reset(); + hash.update(¤tSecurityNumber, sizeof(currentSecurityNumber)); + hash.update(¤tNonce, sizeof(currentNonce)); + hash.update(¤tRemoteNode, sizeof(currentRemoteNode)); + hash.update(&ourNodeNum, sizeof(ourNodeNum)); + hash.update(currentRequest->public_key.bytes, currentRequest->public_key.size); + hash.update(owner.public_key.bytes, owner.public_key.size); + hash.finalize(hash1, 32); + + // generate hash2 + hash.reset(); + hash.update(¤tNonce, sizeof(currentNonce)); + hash.update(hash1, 32); + hash.finalize(hash2, 32); + response.hash1.size = 0; + response.hash2.size = 32; + memcpy(response.hash2.bytes, hash2, 32); + + responsePacket = allocDataProtobuf(response); + + responsePacket->pki_encrypted = true; + if (screen) { + snprintf(message, 25, "Security Number \n%03u %03u", currentSecurityNumber / 1000, currentSecurityNumber % 1000); + screen->showOverlayBanner(message, 30000); + LOG_WARN("%s", message); + } + meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->level = meshtastic_LogRecord_Level_WARNING; + sprintf(cn->message, "Incoming Key Verification.\nSecurity Number\n%03u %03u", currentSecurityNumber / 1000, + currentSecurityNumber % 1000); + cn->which_payload_variant = meshtastic_ClientNotification_key_verification_number_inform_tag; + cn->payload_variant.key_verification_number_inform.nonce = currentNonce; + strncpy(cn->payload_variant.key_verification_number_inform.remote_longname, // should really check for nulls, etc + nodeDB->getMeshNode(currentRemoteNode)->user.long_name, + sizeof(cn->payload_variant.key_verification_number_inform.remote_longname)); + cn->payload_variant.key_verification_number_inform.security_number = currentSecurityNumber; + service->sendClientNotification(cn); + LOG_WARN("Security Number %04u, nonce %llu", currentSecurityNumber, currentNonce); + return responsePacket; +} + +void KeyVerificationModule::processSecurityNumber(uint32_t incomingNumber) +{ + SHA256 hash; + NodeNum ourNodeNum = nodeDB->getNodeNum(); + uint8_t scratch_hash[32] = {0}; + LOG_WARN("received security number: %u", incomingNumber); + meshtastic_NodeInfoLite *remoteNodePtr = nullptr; + remoteNodePtr = nodeDB->getMeshNode(currentRemoteNode); + if (remoteNodePtr == nullptr || !remoteNodePtr->has_user || remoteNodePtr->user.public_key.size != 32) { + currentState = KEY_VERIFICATION_IDLE; + return; // should we throw an error here? + } + LOG_WARN("hashing "); + // calculate hash1 + hash.reset(); + hash.update(&incomingNumber, sizeof(incomingNumber)); + hash.update(¤tNonce, sizeof(currentNonce)); + hash.update(&ourNodeNum, sizeof(ourNodeNum)); + hash.update(¤tRemoteNode, sizeof(currentRemoteNode)); + hash.update(owner.public_key.bytes, owner.public_key.size); + + hash.update(remoteNodePtr->user.public_key.bytes, remoteNodePtr->user.public_key.size); + hash.finalize(hash1, 32); + + hash.reset(); + hash.update(¤tNonce, sizeof(currentNonce)); + hash.update(hash1, 32); + hash.finalize(scratch_hash, 32); + + if (memcmp(scratch_hash, hash2, 32) != 0) { + LOG_WARN("Hash2 did not match"); + return; // should probably throw an error of some sort + } + currentSecurityNumber = incomingNumber; + + meshtastic_KeyVerification KeyVerification = meshtastic_KeyVerification_init_zero; + KeyVerification.nonce = currentNonce; + KeyVerification.hash2.size = 0; + KeyVerification.hash1.size = 32; + memcpy(KeyVerification.hash1.bytes, hash1, 32); + meshtastic_MeshPacket *p = allocDataProtobuf(KeyVerification); + p->to = currentRemoteNode; + p->channel = 0; + p->pki_encrypted = true; + p->decoded.want_response = true; + p->priority = meshtastic_MeshPacket_Priority_HIGH; + service->sendToMesh(p, RX_SRC_LOCAL, true); + currentState = KEY_VERIFICATION_SENDER_AWAITING_USER; + memset(message, 0, sizeof(message)); + sprintf(message, "Verification: \n"); + generateVerificationCode(message + 15); // send the toPhone packet + if (screen) { + screen->showOverlayBanner(message, 30000); + } + meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->level = meshtastic_LogRecord_Level_WARNING; + sprintf(cn->message, "Final confirmation for outgoing manual key verification %s", message); + cn->which_payload_variant = meshtastic_ClientNotification_key_verification_final_tag; + cn->payload_variant.key_verification_final.nonce = currentNonce; + strncpy(cn->payload_variant.key_verification_final.remote_longname, // should really check for nulls, etc + nodeDB->getMeshNode(currentRemoteNode)->user.long_name, + sizeof(cn->payload_variant.key_verification_final.remote_longname)); + cn->payload_variant.key_verification_final.isSender = true; + service->sendClientNotification(cn); + LOG_INFO(message); + + return; +} + +void KeyVerificationModule::updateState() +{ + if (currentState != KEY_VERIFICATION_IDLE) { + // check for the 30 second timeout + if (currentNonceTimestamp < getTime() - 60) { + resetToIdle(); + } else { + currentNonceTimestamp = getTime(); + } + } +} + +void KeyVerificationModule::resetToIdle() +{ + memset(hash1, 0, 32); + memset(hash2, 0, 32); + currentNonce = 0; + currentNonceTimestamp = 0; + currentSecurityNumber = 0; + currentRemoteNode = 0; + currentState = KEY_VERIFICATION_IDLE; +} + +void KeyVerificationModule::generateVerificationCode(char *readableCode) +{ + for (int i = 0; i < 4; i++) { + // drop the two highest significance bits, then encode as a base64 + readableCode[i] = (hash1[i] >> 2) + 48; // not a standardized base64, but workable and avoids having a dictionary. + } + readableCode[4] = ' '; + for (int i = 5; i < 9; i++) { + // drop the two highest significance bits, then encode as a base64 + readableCode[i] = (hash1[i] >> 2) + 48; // not a standardized base64, but workable and avoids having a dictionary. + } +} +#endif \ No newline at end of file diff --git a/src/modules/KeyVerificationModule.h b/src/modules/KeyVerificationModule.h new file mode 100644 index 000000000..f659e961a --- /dev/null +++ b/src/modules/KeyVerificationModule.h @@ -0,0 +1,64 @@ +#pragma once + +#include "ProtobufModule.h" +#include "SinglePortModule.h" + +enum KeyVerificationState { + KEY_VERIFICATION_IDLE, + KEY_VERIFICATION_SENDER_HAS_INITIATED, + KEY_VERIFICATION_SENDER_AWAITING_NUMBER, + KEY_VERIFICATION_SENDER_AWAITING_USER, + KEY_VERIFICATION_RECEIVER_AWAITING_USER, + KEY_VERIFICATION_RECEIVER_AWAITING_HASH1, +}; + +class KeyVerificationModule : public ProtobufModule //, private concurrency::OSThread // +{ + // CallbackObserver nodeStatusObserver = + // CallbackObserver(this, &KeyVerificationModule::handleStatusUpdate); + + public: + KeyVerificationModule(); + /* : concurrency::OSThread("KeyVerification"), + ProtobufModule("KeyVerification", meshtastic_PortNum_KEY_VERIFICATION_APP, &meshtastic_KeyVerification_msg) + { + nodeStatusObserver.observe(&nodeStatus->onNewStatus); + setIntervalFromNow(setStartDelay()); // Wait until NodeInfo is sent + }*/ + virtual bool wantUIFrame() { return false; }; + bool sendInitialRequest(NodeNum remoteNode); + + protected: + /* Called to handle a particular incoming message + @return true if you've guaranteed you've handled this message and no other handlers should be considered for it + */ + virtual bool handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_KeyVerification *p); + // virtual meshtastic_MeshPacket *allocReply() override; + + // rather than add to the craziness that is the admin module, just handle those requests here. + virtual AdminMessageHandleResult handleAdminMessageForModule(const meshtastic_MeshPacket &mp, + meshtastic_AdminMessage *request, + meshtastic_AdminMessage *response) override; + /* + * Send our Telemetry into the mesh + */ + bool sendMetrics(); + virtual meshtastic_MeshPacket *allocReply() override; + + private: + uint64_t currentNonce = 0; + uint32_t currentNonceTimestamp = 0; + NodeNum currentRemoteNode = 0; + uint32_t currentSecurityNumber = 0; + KeyVerificationState currentState = KEY_VERIFICATION_IDLE; + uint8_t hash1[32] = {0}; // + uint8_t hash2[32] = {0}; // + char message[40] = {0}; + + void processSecurityNumber(uint32_t); + void updateState(); // check the timeouts and maybe reset the state to idle + void resetToIdle(); // Zero out module state + void generateVerificationCode(char *); // fills char with the user readable verification code +}; + +extern KeyVerificationModule *keyVerificationModule; \ No newline at end of file diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp index fac2ca976..783c08b9f 100644 --- a/src/modules/Modules.cpp +++ b/src/modules/Modules.cpp @@ -1,17 +1,21 @@ #include "configuration.h" #if !MESHTASTIC_EXCLUDE_INPUTBROKER +#include "buzz/BuzzerFeedbackThread.h" #include "input/ExpressLRSFiveWay.h" #include "input/InputBroker.h" #include "input/RotaryEncoderInterruptImpl1.h" -#include "input/ScanAndSelect.h" #include "input/SerialKeyboardImpl.h" #include "input/TrackballInterruptImpl1.h" #include "input/UpDownInterruptImpl1.h" +#include "modules/SystemCommandsModule.h" #if !MESHTASTIC_EXCLUDE_I2C #include "input/cardKbI2cImpl.h" #endif #include "input/kbMatrixImpl.h" #endif +#if !MESHTASTIC_EXCLUDE_PKI +#include "KeyVerificationModule.h" +#endif #if !MESHTASTIC_EXCLUDE_ADMIN #include "modules/AdminModule.h" #endif @@ -62,6 +66,7 @@ #include "modules/Telemetry/AirQualityTelemetry.h" #include "modules/Telemetry/EnvironmentTelemetry.h" #include "modules/Telemetry/HealthTelemetry.h" +#include "modules/Telemetry/Sensor/TelemetrySensor.h" #endif #if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_POWER_TELEMETRY #include "modules/Telemetry/PowerTelemetry.h" @@ -104,7 +109,11 @@ void setupModules() { if (config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER) { #if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER - inputBroker = new InputBroker(); + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + inputBroker = new InputBroker(); + systemCommandsModule = new SystemCommandsModule(); + buzzerFeedbackThread = new BuzzerFeedbackThread(); + } #endif #if !MESHTASTIC_EXCLUDE_ADMIN adminModule = new AdminModule(); @@ -133,7 +142,9 @@ void setupModules() #if !MESHTASTIC_EXCLUDE_ATAK atakPluginModule = new AtakPluginModule(); #endif - +#if !MESHTASTIC_EXCLUDE_PKI + keyVerificationModule = new KeyVerificationModule(); +#endif #if !MESHTASTIC_EXCLUDE_DROPZONE dropzoneModule = new DropzoneModule(); #endif @@ -152,50 +163,49 @@ void setupModules() // Example: Put your module here // new ReplyModule(); #if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER - rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1(); - if (!rotaryEncoderInterruptImpl1->init()) { - delete rotaryEncoderInterruptImpl1; - rotaryEncoderInterruptImpl1 = nullptr; - } - upDownInterruptImpl1 = new UpDownInterruptImpl1(); - if (!upDownInterruptImpl1->init()) { - delete upDownInterruptImpl1; - upDownInterruptImpl1 = nullptr; - } -#if HAS_SCREEN - // In order to have the user button dismiss the canned message frame, this class lightly interacts with the Screen class - scanAndSelectInput = new ScanAndSelectInput(); - if (!scanAndSelectInput->init()) { - delete scanAndSelectInput; - scanAndSelectInput = nullptr; - } -#endif - - cardKbI2cImpl = new CardKbI2cImpl(); - cardKbI2cImpl->init(); + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1(); + if (!rotaryEncoderInterruptImpl1->init()) { + delete rotaryEncoderInterruptImpl1; + rotaryEncoderInterruptImpl1 = nullptr; + } + upDownInterruptImpl1 = new UpDownInterruptImpl1(); + if (!upDownInterruptImpl1->init()) { + delete upDownInterruptImpl1; + upDownInterruptImpl1 = nullptr; + } + cardKbI2cImpl = new CardKbI2cImpl(); + cardKbI2cImpl->init(); #ifdef INPUTBROKER_MATRIX_TYPE - kbMatrixImpl = new KbMatrixImpl(); - kbMatrixImpl->init(); + kbMatrixImpl = new KbMatrixImpl(); + kbMatrixImpl->init(); #endif // INPUTBROKER_MATRIX_TYPE #ifdef INPUTBROKER_SERIAL_TYPE - aSerialKeyboardImpl = new SerialKeyboardImpl(); - aSerialKeyboardImpl->init(); + aSerialKeyboardImpl = new SerialKeyboardImpl(); + aSerialKeyboardImpl->init(); #endif // INPUTBROKER_MATRIX_TYPE + } #endif // HAS_BUTTON -#if ARCH_PORTDUINO && !HAS_TFT - aLinuxInputImpl = new LinuxInputImpl(); - aLinuxInputImpl->init(); +#if ARCH_PORTDUINO + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + aLinuxInputImpl = new LinuxInputImpl(); + aLinuxInputImpl->init(); + } #endif -#if HAS_TRACKBALL && !MESHTASTIC_EXCLUDE_INPUTBROKER - trackballInterruptImpl1 = new TrackballInterruptImpl1(); - trackballInterruptImpl1->init(); +#if !MESHTASTIC_EXCLUDE_INPUTBROKER + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + trackballInterruptImpl1 = new TrackballInterruptImpl1(); + trackballInterruptImpl1->init(TB_DOWN, TB_UP, TB_LEFT, TB_RIGHT, TB_PRESS); + } #endif #ifdef INPUTBROKER_EXPRESSLRSFIVEWAY_TYPE expressLRSFiveWayInput = new ExpressLRSFiveWay(); #endif #if HAS_SCREEN && !MESHTASTIC_EXCLUDE_CANNEDMESSAGES - cannedMessageModule = new CannedMessageModule(); + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + cannedMessageModule = new CannedMessageModule(); + } #endif #if ARCH_PORTDUINO new HostMetricsModule(); @@ -221,7 +231,9 @@ void setupModules() #if (defined(ARCH_ESP32) || defined(ARCH_NRF52) || defined(ARCH_RP2040)) && !defined(CONFIG_IDF_TARGET_ESP32S2) && \ !defined(CONFIG_IDF_TARGET_ESP32C3) #if !MESHTASTIC_EXCLUDE_SERIAL - new SerialModule(); + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + new SerialModule(); + } #endif #endif #ifdef ARCH_ESP32 diff --git a/src/modules/NodeInfoModule.cpp b/src/modules/NodeInfoModule.cpp index e072fcb0f..cf9940e25 100644 --- a/src/modules/NodeInfoModule.cpp +++ b/src/modules/NodeInfoModule.cpp @@ -21,13 +21,6 @@ bool NodeInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes bool wasBroadcast = isBroadcast(mp.to); - // Show new nodes on LCD screen - if (wasBroadcast) { - String lcd = String("Joined: ") + p.long_name + "\n"; - if (screen) - screen->print(lcd.c_str()); - } - // if user has changed while packet was not for us, inform phone if (hasChanged && !wasBroadcast && !isToUs(&mp)) service->sendToPhone(packetPool.allocCopy(mp)); diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index c34c725c0..93c65ecc1 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -332,7 +332,13 @@ void PositionModule::sendOurPosition() // If we changed channels, ask everyone else for their latest info LOG_INFO("Send pos@%x:6 to mesh (wantReplies=%d)", localPosition.timestamp, requestReplies); - sendOurPosition(NODENUM_BROADCAST, requestReplies); + for (uint8_t channelNum = 0; channelNum < 8; channelNum++) { + if (channels.getByIndex(channelNum).settings.has_module_settings && + channels.getByIndex(channelNum).settings.module_settings.position_precision != 0) { + sendOurPosition(NODENUM_BROADCAST, requestReplies, channelNum); + return; + } + } } void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t channel) @@ -344,11 +350,6 @@ void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t cha // Set's the class precision value for this particular packet if (channels.getByIndex(channel).settings.has_module_settings) { precision = channels.getByIndex(channel).settings.module_settings.position_precision; - } else if (channels.getByIndex(channel).role == meshtastic_Channel_Role_PRIMARY) { - // backwards compatibility for Primary channels created before position_precision was set by default - precision = 13; - } else { - precision = 0; } meshtastic_MeshPacket *p = allocPositionPacket(); diff --git a/src/modules/RemoteHardwareModule.cpp b/src/modules/RemoteHardwareModule.cpp index 9bc8512b6..04cfeb651 100644 --- a/src/modules/RemoteHardwareModule.cpp +++ b/src/modules/RemoteHardwareModule.cpp @@ -83,9 +83,6 @@ bool RemoteHardwareModule::handleReceivedProtobuf(const meshtastic_MeshPacket &r switch (p.type) { case meshtastic_HardwareMessage_Type_WRITE_GPIOS: { - // Print notification to LCD screen - screen->print("Write GPIOs\n"); - pinModes(p.gpio_mask, OUTPUT, availablePins); for (uint8_t i = 0; i < NUM_GPIOS; i++) { uint64_t mask = 1ULL << i; @@ -98,10 +95,6 @@ bool RemoteHardwareModule::handleReceivedProtobuf(const meshtastic_MeshPacket &r } case meshtastic_HardwareMessage_Type_READ_GPIOS: { - // Print notification to LCD screen - if (screen) - screen->print("Read GPIOs\n"); - uint64_t res = digitalReads(p.gpio_mask, availablePins); // Send the reply diff --git a/src/modules/ReplyModule.cpp b/src/modules/ReplyModule.cpp index c4f63c6b1..8892aaa97 100644 --- a/src/modules/ReplyModule.cpp +++ b/src/modules/ReplyModule.cpp @@ -15,8 +15,6 @@ meshtastic_MeshPacket *ReplyModule::allocReply() LOG_INFO("Received message from=0x%0x, id=%d, msg=%.*s", req.from, req.id, p.payload.size, p.payload.bytes); #endif - screen->print("Send reply\n"); - const char *replyStr = "Message Received"; auto reply = allocDataPacket(); // Allocate a packet for sending reply->decoded.payload.size = strlen(replyStr); // You must specify how many bytes are in the reply diff --git a/src/modules/SerialModule.cpp b/src/modules/SerialModule.cpp index 8d280581c..f3921ef19 100644 --- a/src/modules/SerialModule.cpp +++ b/src/modules/SerialModule.cpp @@ -341,7 +341,7 @@ ProcessMessage SerialModuleRadio::handleReceived(const meshtastic_MeshPacket &mp serialPrint->write(p.payload.bytes, p.payload.size); } else if (moduleConfig.serial.mode == meshtastic_ModuleConfig_SerialConfig_Serial_Mode_TEXTMSG) { meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(getFrom(&mp)); - String sender = (node && node->has_user) ? node->user.short_name : "???"; + const char *sender = (node && node->has_user) ? node->user.short_name : "???"; serialPrint->println(); serialPrint->printf("%s: %s", sender, p.payload.bytes); serialPrint->println(); @@ -410,8 +410,8 @@ uint32_t SerialModule::getBaudRate() // Add this structure to help with parsing WindGust = 24.4 serial lines. struct ParsedLine { - String name; - String value; + char name[64]; + char value[128]; }; /** @@ -438,16 +438,30 @@ ParsedLine parseLine(const char *line) strncpy(nameBuf, line, nameLen); nameBuf[nameLen] = '\0'; - // Create trimmed name string - String name = String(nameBuf); - name.trim(); + // Trim whitespace from name + char *nameStart = nameBuf; + while (*nameStart && isspace(*nameStart)) + nameStart++; + char *nameEnd = nameStart + strlen(nameStart) - 1; + while (nameEnd > nameStart && isspace(*nameEnd)) + *nameEnd-- = '\0'; - // Extract value after equals sign - String value = String(equals + 1); - value.trim(); + // Copy trimmed name + strncpy(result.name, nameStart, sizeof(result.name) - 1); + result.name[sizeof(result.name) - 1] = '\0'; + + // Extract value part (after equals) + const char *valueStart = equals + 1; + while (*valueStart && isspace(*valueStart)) + valueStart++; + strncpy(result.value, valueStart, sizeof(result.value) - 1); + result.value[sizeof(result.value) - 1] = '\0'; + + // Trim trailing whitespace from value + char *valueEnd = result.value + strlen(result.value) - 1; + while (valueEnd > result.value && isspace(*valueEnd)) + *valueEnd-- = '\0'; - result.name = name; - result.value = value; return result; } @@ -517,16 +531,16 @@ void SerialModule::processWXSerial() memcpy(line, &serialBytes[lineStart], lineEnd - lineStart); ParsedLine parsed = parseLine(line); - if (parsed.name.length() > 0) { - if (parsed.name == "WindDir") { - strlcpy(windDir, parsed.value.c_str(), sizeof(windDir)); + if (strlen(parsed.name) > 0) { + if (strcmp(parsed.name, "WindDir") == 0) { + strlcpy(windDir, parsed.value, sizeof(windDir)); double radians = GeoCoord::toRadians(strtof(windDir, nullptr)); dir_sum_sin += sin(radians); dir_sum_cos += cos(radians); dirCount++; gotwind = true; - } else if (parsed.name == "WindSpeed") { - strlcpy(windVel, parsed.value.c_str(), sizeof(windVel)); + } else if (strcmp(parsed.name, "WindSpeed") == 0) { + strlcpy(windVel, parsed.value, sizeof(windVel)); float newv = strtof(windVel, nullptr); velSum += newv; velCount++; @@ -534,28 +548,28 @@ void SerialModule::processWXSerial() lull = newv; } gotwind = true; - } else if (parsed.name == "WindGust") { - strlcpy(windGust, parsed.value.c_str(), sizeof(windGust)); + } else if (strcmp(parsed.name, "WindGust") == 0) { + strlcpy(windGust, parsed.value, sizeof(windGust)); float newg = strtof(windGust, nullptr); if (newg > gust) { gust = newg; } gotwind = true; - } else if (parsed.name == "BatVoltage") { - strlcpy(batVoltage, parsed.value.c_str(), sizeof(batVoltage)); + } else if (strcmp(parsed.name, "BatVoltage") == 0) { + strlcpy(batVoltage, parsed.value, sizeof(batVoltage)); batVoltageF = strtof(batVoltage, nullptr); break; // last possible data we want so break - } else if (parsed.name == "CapVoltage") { - strlcpy(capVoltage, parsed.value.c_str(), sizeof(capVoltage)); + } else if (strcmp(parsed.name, "CapVoltage") == 0) { + strlcpy(capVoltage, parsed.value, sizeof(capVoltage)); capVoltageF = strtof(capVoltage, nullptr); - } else if (parsed.name == "GXTS04Temp" || parsed.name == "Temperature") { - strlcpy(temperature, parsed.value.c_str(), sizeof(temperature)); + } else if (strcmp(parsed.name, "GXTS04Temp") == 0 || strcmp(parsed.name, "Temperature") == 0) { + strlcpy(temperature, parsed.value, sizeof(temperature)); temperatureF = strtof(temperature, nullptr); - } else if (parsed.name == "RainIntSum") { - strlcpy(rainStr, parsed.value.c_str(), sizeof(rainStr)); + } else if (strcmp(parsed.name, "RainIntSum") == 0) { + strlcpy(rainStr, parsed.value, sizeof(rainStr)); rainSum = int(strtof(rainStr, nullptr)); - } else if (parsed.name == "Rain") { - strlcpy(rainStr, parsed.value.c_str(), sizeof(rainStr)); + } else if (strcmp(parsed.name, "Rain") == 0) { + strlcpy(rainStr, parsed.value, sizeof(rainStr)); rain = strtof(rainStr, nullptr); } } diff --git a/src/modules/SystemCommandsModule.cpp b/src/modules/SystemCommandsModule.cpp new file mode 100644 index 000000000..a6b01d68a --- /dev/null +++ b/src/modules/SystemCommandsModule.cpp @@ -0,0 +1,118 @@ +#include "SystemCommandsModule.h" +#include "meshUtils.h" +#if HAS_SCREEN +#include "graphics/Screen.h" +#include "graphics/SharedUIDisplay.h" +#endif +#include "GPS.h" +#include "MeshService.h" +#include "Module.h" +#include "NodeDB.h" +#include "main.h" +#include "modules/AdminModule.h" +#include "modules/ExternalNotificationModule.h" + +SystemCommandsModule *systemCommandsModule; + +SystemCommandsModule::SystemCommandsModule() +{ + if (inputBroker) + inputObserver.observe(inputBroker); +} + +int SystemCommandsModule::handleInputEvent(const InputEvent *event) +{ + LOG_INFO("Input event %u! kb %u", event->inputEvent, event->kbchar); + // System commands (all others fall through) + switch (event->kbchar) { + // Fn key symbols + case INPUT_BROKER_MSG_FN_SYMBOL_ON: + IF_SCREEN(screen->setFunctionSymbol("Fn")); + return 0; + case INPUT_BROKER_MSG_FN_SYMBOL_OFF: + IF_SCREEN(screen->removeFunctionSymbol("Fn")); + return 0; + // Brightness + case INPUT_BROKER_MSG_BRIGHTNESS_UP: + IF_SCREEN(screen->increaseBrightness()); + LOG_DEBUG("Increase Screen Brightness"); + return 0; + case INPUT_BROKER_MSG_BRIGHTNESS_DOWN: + IF_SCREEN(screen->decreaseBrightness()); + LOG_DEBUG("Decrease Screen Brightness"); + return 0; + // Mute + case INPUT_BROKER_MSG_MUTE_TOGGLE: + if (moduleConfig.external_notification.enabled && externalNotificationModule) { + bool isMuted = externalNotificationModule->getMute(); + externalNotificationModule->setMute(!isMuted); + IF_SCREEN(graphics::isMuted = !isMuted; if (!isMuted) externalNotificationModule->stopNow(); + screen->showOverlayBanner(isMuted ? "Notifications\nEnabled" : "Notifications\nDisabled", 3000);) + } + return 0; + // Bluetooth + case INPUT_BROKER_MSG_BLUETOOTH_TOGGLE: + config.bluetooth.enabled = !config.bluetooth.enabled; + LOG_INFO("User toggled Bluetooth"); + nodeDB->saveToDisk(); +#if defined(ARDUINO_ARCH_NRF52) + if (!config.bluetooth.enabled) { + disableBluetooth(); + IF_SCREEN(screen->showOverlayBanner("Bluetooth OFF\nRebooting", 3000)); + rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 2000; + } else { + IF_SCREEN(screen->showOverlayBanner("Bluetooth ON\nRebooting", 3000)); + rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000; + } +#else + if (!config.bluetooth.enabled) { + disableBluetooth(); + IF_SCREEN(screen->showOverlayBanner("Bluetooth OFF", 3000)); + } else { + IF_SCREEN(screen->showOverlayBanner("Bluetooth ON\nRebooting", 3000)); + rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000; + } +#endif + return 0; + case INPUT_BROKER_MSG_REBOOT: + IF_SCREEN(screen->showOverlayBanner("Rebooting...", 0)); + nodeDB->saveToDisk(); + rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000; + // runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + return true; + } + + switch (event->inputEvent) { + // GPS + case INPUT_BROKER_GPS_TOGGLE: + LOG_WARN("GPS Toggle"); +#if !MESHTASTIC_EXCLUDE_GPS + if (gps) { + LOG_WARN("GPS Toggle2"); + gps->toggleGpsMode(); + const char *msg = + (config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED) ? "GPS Enabled" : "GPS Disabled"; + IF_SCREEN(screen->forceDisplay(); screen->showOverlayBanner(msg, 3000);) + } +#endif + return true; + // Mesh ping + case INPUT_BROKER_SEND_PING: + service->refreshLocalMeshNode(); + if (service->trySendPosition(NODENUM_BROADCAST, true)) { + IF_SCREEN(screen->showOverlayBanner("Position\nUpdate Sent", 3000)); + } else { + IF_SCREEN(screen->showOverlayBanner("Node Info\nUpdate Sent", 3000)); + } + return true; + // Power control + case INPUT_BROKER_SHUTDOWN: + LOG_ERROR("Shutting down"); + IF_SCREEN(screen->showOverlayBanner("Shutting down...")); + nodeDB->saveToDisk(); + shutdownAtMsec = millis() + DEFAULT_SHUTDOWN_SECONDS * 1000; + // runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + return true; + } + return false; +} \ No newline at end of file diff --git a/src/modules/SystemCommandsModule.h b/src/modules/SystemCommandsModule.h new file mode 100644 index 000000000..44910f443 --- /dev/null +++ b/src/modules/SystemCommandsModule.h @@ -0,0 +1,19 @@ +#pragma once + +#include "MeshModule.h" +#include "configuration.h" +#include "input/InputBroker.h" +#include +#include + +class SystemCommandsModule +{ + CallbackObserver inputObserver = + CallbackObserver(this, &SystemCommandsModule::handleInputEvent); + + public: + SystemCommandsModule(); + int handleInputEvent(const InputEvent *event); +}; + +extern SystemCommandsModule *systemCommandsModule; \ No newline at end of file diff --git a/src/modules/Telemetry/AirQualityTelemetry.cpp b/src/modules/Telemetry/AirQualityTelemetry.cpp index fafb28699..2472b95b1 100644 --- a/src/modules/Telemetry/AirQualityTelemetry.cpp +++ b/src/modules/Telemetry/AirQualityTelemetry.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include("Adafruit_PM25AQI.h") +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include("Adafruit_PM25AQI.h") #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "AirQualityTelemetry.h" diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index aaab8d0e6..375d1e596 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "Default.h" @@ -11,12 +11,15 @@ #include "RTC.h" #include "Router.h" #include "UnitConversions.h" +#include "buzz.h" +#include "graphics/SharedUIDisplay.h" +#include "graphics/images.h" #include "main.h" +#include "modules/ExternalNotificationModule.h" #include "power.h" #include "sleep.h" #include "target_specific.h" #include -#include #if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL @@ -25,6 +28,10 @@ #include "Sensor/RCWL9620Sensor.h" #include "Sensor/nullSensor.h" +namespace graphics +{ +extern void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *titleStr); +} #if __has_include() #include "Sensor/AHT10.h" AHT10Sensor aht10Sensor; @@ -344,120 +351,152 @@ bool EnvironmentTelemetryModule::wantUIFrame() void EnvironmentTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { - display->setTextAlignment(TEXT_ALIGN_LEFT); + // === Setup display === + display->clear(); display->setFont(FONT_SMALL); + display->setTextAlignment(TEXT_ALIGN_LEFT); + int line = 1; - if (lastMeasurementPacket == nullptr) { - // If there's no valid packet, display "Environment" - display->drawString(x, y, "Environment"); - display->drawString(x, y += _fontHeight(FONT_SMALL), "No measurement"); + // === Set Title + const char *titleStr = (SCREEN_WIDTH > 128) ? "Environment" : "Env."; + + // === Header === + graphics::drawCommonHeader(display, x, y, titleStr); + + // === Row spacing setup === + const int rowHeight = FONT_HEIGHT_SMALL - 4; + int currentY = graphics::getTextPositions(display)[line++]; + + // === Show "No Telemetry" if no data available === + if (!lastMeasurementPacket) { + display->drawString(x, currentY, "No Telemetry"); return; } - // Decode the last measurement packet - meshtastic_Telemetry lastMeasurement; - uint32_t agoSecs = service->GetTimeSinceMeshPacket(lastMeasurementPacket); - const char *lastSender = getSenderShortName(*lastMeasurementPacket); - + // Decode the telemetry message from the latest received packet const meshtastic_Data &p = lastMeasurementPacket->decoded; - if (!pb_decode_from_bytes(p.payload.bytes, p.payload.size, &meshtastic_Telemetry_msg, &lastMeasurement)) { - display->drawString(x, y, "Measurement Error"); - LOG_ERROR("Unable to decode last packet"); + meshtastic_Telemetry telemetry; + if (!pb_decode_from_bytes(p.payload.bytes, p.payload.size, &meshtastic_Telemetry_msg, &telemetry)) { + display->drawString(x, currentY, "No Telemetry"); return; } - // Display "Env. From: ..." on its own - display->drawString(x, y, "Env. From: " + String(lastSender) + " (" + String(agoSecs) + "s)"); + const auto &m = telemetry.variant.environment_metrics; - // Prepare sensor data strings - String sensorData[10]; - int sensorCount = 0; + // Check if any telemetry field has valid data + bool hasAny = m.has_temperature || m.has_relative_humidity || m.barometric_pressure != 0 || m.iaq != 0 || m.voltage != 0 || + m.current != 0 || m.lux != 0 || m.white_lux != 0 || m.weight != 0 || m.distance != 0 || m.radiation != 0; - if (lastMeasurement.variant.environment_metrics.has_temperature || - lastMeasurement.variant.environment_metrics.has_relative_humidity) { - String last_temp = String(lastMeasurement.variant.environment_metrics.temperature, 0) + "°C"; - if (moduleConfig.telemetry.environment_display_fahrenheit) { - last_temp = - String(UnitConversions::CelsiusToFahrenheit(lastMeasurement.variant.environment_metrics.temperature), 0) + "°F"; + if (!hasAny) { + display->drawString(x, currentY, "No Telemetry"); + return; + } + + // === First line: Show sender name + time since received (left), and first metric (right) === + const char *sender = getSenderShortName(*lastMeasurementPacket); + uint32_t agoSecs = service->GetTimeSinceMeshPacket(lastMeasurementPacket); + String agoStr = (agoSecs > 864000) ? "?" + : (agoSecs > 3600) ? String(agoSecs / 3600) + "h" + : (agoSecs > 60) ? String(agoSecs / 60) + "m" + : String(agoSecs) + "s"; + + String leftStr = String(sender) + " (" + agoStr + ")"; + display->drawString(x, currentY, leftStr); // Left side: who and when + + // === Collect sensor readings as label strings (no icons) === + std::vector entries; + + if (m.has_temperature) { + String tempStr = moduleConfig.telemetry.environment_display_fahrenheit + ? "Tmp: " + String(UnitConversions::CelsiusToFahrenheit(m.temperature), 1) + "°F" + : "Tmp: " + String(m.temperature, 1) + "°C"; + entries.push_back(tempStr); + } + if (m.has_relative_humidity) + entries.push_back("Hum: " + String(m.relative_humidity, 0) + "%"); + if (m.barometric_pressure != 0) + entries.push_back("Prss: " + String(m.barometric_pressure, 0) + " hPa"); + if (m.iaq != 0) { + String aqi = "IAQ: " + String(m.iaq); + const char *bannerMsg = nullptr; // Default: no banner + + if (m.iaq <= 25) + aqi += " (Excellent)"; + else if (m.iaq <= 50) + aqi += " (Good)"; + else if (m.iaq <= 100) + aqi += " (Moderate)"; + else if (m.iaq <= 150) + aqi += " (Poor)"; + else if (m.iaq <= 200) { + aqi += " (Unhealthy)"; + bannerMsg = "Unhealthy IAQ"; + } else if (m.iaq <= 300) { + aqi += " (Very Unhealthy)"; + bannerMsg = "Very Unhealthy IAQ"; + } else { + aqi += " (Hazardous)"; + bannerMsg = "Hazardous IAQ"; } - sensorData[sensorCount++] = - "Temp/Hum: " + last_temp + " / " + String(lastMeasurement.variant.environment_metrics.relative_humidity, 0) + "%"; - } + entries.push_back(aqi); - if (lastMeasurement.variant.environment_metrics.barometric_pressure != 0) { - sensorData[sensorCount++] = - "Press: " + String(lastMeasurement.variant.environment_metrics.barometric_pressure, 0) + "hPA"; - } + // === IAQ alert logic === + static uint32_t lastAlertTime = 0; + uint32_t now = millis(); - if (lastMeasurement.variant.environment_metrics.voltage != 0) { - sensorData[sensorCount++] = "Volt/Cur: " + String(lastMeasurement.variant.environment_metrics.voltage, 0) + "V / " + - String(lastMeasurement.variant.environment_metrics.current, 0) + "mA"; - } + bool isOwnTelemetry = lastMeasurementPacket->from == nodeDB->getNodeNum(); + bool isCooldownOver = (now - lastAlertTime > 60000); - if (lastMeasurement.variant.environment_metrics.iaq != 0) { - sensorData[sensorCount++] = "IAQ: " + String(lastMeasurement.variant.environment_metrics.iaq); - } + if (isOwnTelemetry && bannerMsg && isCooldownOver) { + LOG_INFO("drawFrame: IAQ %d (own) — showing banner: %s", m.iaq, bannerMsg); + screen->showOverlayBanner(bannerMsg, 3000); - if (lastMeasurement.variant.environment_metrics.distance != 0) { - sensorData[sensorCount++] = "Water Level: " + String(lastMeasurement.variant.environment_metrics.distance, 0) + "mm"; - } - - if (lastMeasurement.variant.environment_metrics.weight != 0) { - sensorData[sensorCount++] = "Weight: " + String(lastMeasurement.variant.environment_metrics.weight, 0) + "kg"; - } - - if (lastMeasurement.variant.environment_metrics.radiation != 0) { - sensorData[sensorCount++] = "Rad: " + String(lastMeasurement.variant.environment_metrics.radiation, 2) + "µR/h"; - } - - if (lastMeasurement.variant.environment_metrics.lux != 0) { - sensorData[sensorCount++] = "Illuminance: " + String(lastMeasurement.variant.environment_metrics.lux, 2) + "lx"; - } - - if (lastMeasurement.variant.environment_metrics.white_lux != 0) { - sensorData[sensorCount++] = "W_Lux: " + String(lastMeasurement.variant.environment_metrics.white_lux, 2) + "lx"; - } - - static int scrollOffset = 0; - static bool scrollingDown = true; - static uint32_t lastScrollTime = millis(); - - // Determine how many lines we can fit on display - // Calculated once only: display dimensions don't change during runtime. - static int maxLines = 0; - if (!maxLines) { - const int16_t paddingTop = _fontHeight(FONT_SMALL); // Heading text - const int16_t paddingBottom = 8; // Indicator dots - maxLines = (display->getHeight() - paddingTop - paddingBottom) / _fontHeight(FONT_SMALL); - assert(maxLines > 0); - } - - // Draw as many lines of data as we can fit - int linesToShow = min(maxLines, sensorCount); - for (int i = 0; i < linesToShow; i++) { - int index = (scrollOffset + i) % sensorCount; - display->drawString(x, y += _fontHeight(FONT_SMALL), sensorData[index]); - } - - // Only scroll if there are more than 3 sensor data lines - if (sensorCount > 3) { - // Update scroll offset every 5 seconds - if (millis() - lastScrollTime > 5000) { - if (scrollingDown) { - scrollOffset++; - if (scrollOffset + linesToShow >= sensorCount) { - scrollingDown = false; - } - } else { - scrollOffset--; - if (scrollOffset <= 0) { - scrollingDown = true; - } + // Only buzz if IAQ is over 200 + if (m.iaq > 200 && moduleConfig.external_notification.enabled && !externalNotificationModule->getMute()) { + playLongBeep(); } - lastScrollTime = millis(); + + lastAlertTime = now; } } + if (m.voltage != 0 || m.current != 0) + entries.push_back(String(m.voltage, 1) + "V / " + String(m.current, 0) + "mA"); + if (m.lux != 0) + entries.push_back("Light: " + String(m.lux, 0) + "lx"); + if (m.white_lux != 0) + entries.push_back("White: " + String(m.white_lux, 0) + "lx"); + if (m.weight != 0) + entries.push_back("Weight: " + String(m.weight, 0) + "kg"); + if (m.distance != 0) + entries.push_back("Level: " + String(m.distance, 0) + "mm"); + if (m.radiation != 0) + entries.push_back("Rad: " + String(m.radiation, 2) + " µR/h"); + + // === Show first available metric on top-right of first line === + if (!entries.empty()) { + String valueStr = entries.front(); + int rightX = SCREEN_WIDTH - display->getStringWidth(valueStr); + display->drawString(rightX, currentY, valueStr); + entries.erase(entries.begin()); // Remove from queue + } + + // === Advance to next line for remaining telemetry entries === + currentY += rowHeight; + + // === Draw remaining entries in 2-column format (left and right) === + for (size_t i = 0; i < entries.size(); i += 2) { + // Left column + display->drawString(x, currentY, entries[i]); + + // Right column if it exists + if (i + 1 < entries.size()) { + int rightX = SCREEN_WIDTH / 2; + display->drawString(rightX, currentY, entries[i + 1]); + } + + currentY += rowHeight; + } } bool EnvironmentTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Telemetry *t) diff --git a/src/modules/Telemetry/HealthTelemetry.cpp b/src/modules/Telemetry/HealthTelemetry.cpp index a2a18ba03..3a735b1fa 100644 --- a/src/modules/Telemetry/HealthTelemetry.cpp +++ b/src/modules/Telemetry/HealthTelemetry.cpp @@ -118,22 +118,31 @@ void HealthTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState * } // Display "Health From: ..." on its own - display->drawString(x, y, "Health From: " + String(lastSender) + "(" + String(agoSecs) + "s)"); + char headerStr[64]; + snprintf(headerStr, sizeof(headerStr), "Health From: %s(%ds)", lastSender, (int)agoSecs); + display->drawString(x, y, headerStr); - String last_temp = String(lastMeasurement.variant.health_metrics.temperature, 0) + "°C"; + char last_temp[16]; if (moduleConfig.telemetry.environment_display_fahrenheit) { - last_temp = String(UnitConversions::CelsiusToFahrenheit(lastMeasurement.variant.health_metrics.temperature), 0) + "°F"; + snprintf(last_temp, sizeof(last_temp), "%.0f°F", + UnitConversions::CelsiusToFahrenheit(lastMeasurement.variant.health_metrics.temperature)); + } else { + snprintf(last_temp, sizeof(last_temp), "%.0f°C", lastMeasurement.variant.health_metrics.temperature); } // Continue with the remaining details - display->drawString(x, y += _fontHeight(FONT_SMALL), "Temp: " + last_temp); + char tempStr[32]; + snprintf(tempStr, sizeof(tempStr), "Temp: %s", last_temp); + display->drawString(x, y += _fontHeight(FONT_SMALL), tempStr); if (lastMeasurement.variant.health_metrics.has_heart_bpm) { - display->drawString(x, y += _fontHeight(FONT_SMALL), - "Heart Rate: " + String(lastMeasurement.variant.health_metrics.heart_bpm, 0) + " bpm"); + char heartStr[32]; + snprintf(heartStr, sizeof(heartStr), "Heart Rate: %.0f bpm", lastMeasurement.variant.health_metrics.heart_bpm); + display->drawString(x, y += _fontHeight(FONT_SMALL), heartStr); } if (lastMeasurement.variant.health_metrics.has_spO2) { - display->drawString(x, y += _fontHeight(FONT_SMALL), - "spO2: " + String(lastMeasurement.variant.health_metrics.spO2, 0) + " %"); + char spo2Str[32]; + snprintf(spo2Str, sizeof(spo2Str), "spO2: %.0f %%", lastMeasurement.variant.health_metrics.spO2); + display->drawString(x, y += _fontHeight(FONT_SMALL), spo2Str); } } diff --git a/src/modules/Telemetry/PowerTelemetry.cpp b/src/modules/Telemetry/PowerTelemetry.cpp index 54ec90dae..df1505226 100644 --- a/src/modules/Telemetry/PowerTelemetry.cpp +++ b/src/modules/Telemetry/PowerTelemetry.cpp @@ -10,6 +10,7 @@ #include "PowerTelemetry.h" #include "RTC.h" #include "Router.h" +#include "graphics/SharedUIDisplay.h" #include "main.h" #include "power.h" #include "sleep.h" @@ -21,6 +22,11 @@ #include "graphics/ScreenFonts.h" #include +namespace graphics +{ +extern void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *titleStr); +} + int32_t PowerTelemetryModule::runOnce() { if (sleepOnNextExecution == true) { @@ -103,13 +109,20 @@ bool PowerTelemetryModule::wantUIFrame() void PowerTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { + display->clear(); display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); + int line = 1; + + // === Set Title + const char *titleStr = (SCREEN_WIDTH > 128) ? "Power Telem." : "Power"; + + // === Header === + graphics::drawCommonHeader(display, x, y, titleStr); if (lastMeasurementPacket == nullptr) { - // In case of no valid packet, display "Power Telemetry", "No measurement" - display->drawString(x, y, "Power Telemetry"); - display->drawString(x, y += _fontHeight(FONT_SMALL), "No measurement"); + // In case of no valid packet, display "Power Telemetry", "No measurement" + display->drawString(x, graphics::getTextPositions(display)[line++], "No measurement"); return; } @@ -120,29 +133,35 @@ void PowerTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *s const meshtastic_Data &p = lastMeasurementPacket->decoded; if (!pb_decode_from_bytes(p.payload.bytes, p.payload.size, &meshtastic_Telemetry_msg, &lastMeasurement)) { - display->drawString(x, y, "Measurement Error"); + display->drawString(x, graphics::getTextPositions(display)[line++], "Measurement Error"); LOG_ERROR("Unable to decode last packet"); return; } // Display "Pow. From: ..." - display->drawString(x, y, "Pow. From: " + String(lastSender) + "(" + String(agoSecs) + "s)"); + char fromStr[64]; + snprintf(fromStr, sizeof(fromStr), "Pow. From: %s (%us)", lastSender, agoSecs); + display->drawString(x, graphics::getTextPositions(display)[line++], fromStr); // Display current and voltage based on ...power_metrics.has_[channel/voltage/current]... flags - if (lastMeasurement.variant.power_metrics.has_ch1_voltage || lastMeasurement.variant.power_metrics.has_ch1_current) { - display->drawString(x, y += _fontHeight(FONT_SMALL), - "Ch1: " + String(lastMeasurement.variant.power_metrics.ch1_voltage, 2) + "V " + - String(lastMeasurement.variant.power_metrics.ch1_current, 0) + "mA"); + const auto &m = lastMeasurement.variant.power_metrics; + int lineY = textSecondLine; + + auto drawLine = [&](const char *label, float voltage, float current) { + char lineStr[64]; + snprintf(lineStr, sizeof(lineStr), "%s: %.2fV %.0fmA", label, voltage, current); + display->drawString(x, lineY, lineStr); + lineY += _fontHeight(FONT_SMALL); + }; + + if (m.has_ch1_voltage || m.has_ch1_current) { + drawLine("Ch1", m.ch1_voltage, m.ch1_current); } - if (lastMeasurement.variant.power_metrics.has_ch2_voltage || lastMeasurement.variant.power_metrics.has_ch2_current) { - display->drawString(x, y += _fontHeight(FONT_SMALL), - "Ch2: " + String(lastMeasurement.variant.power_metrics.ch2_voltage, 2) + "V " + - String(lastMeasurement.variant.power_metrics.ch2_current, 0) + "mA"); + if (m.has_ch2_voltage || m.has_ch2_current) { + drawLine("Ch2", m.ch2_voltage, m.ch2_current); } - if (lastMeasurement.variant.power_metrics.has_ch3_voltage || lastMeasurement.variant.power_metrics.has_ch3_current) { - display->drawString(x, y += _fontHeight(FONT_SMALL), - "Ch3: " + String(lastMeasurement.variant.power_metrics.ch3_voltage, 2) + "V " + - String(lastMeasurement.variant.power_metrics.ch3_current, 0) + "mA"); + if (m.has_ch3_voltage || m.has_ch3_current) { + drawLine("Ch3", m.ch3_voltage, m.ch3_current); } } diff --git a/src/modules/Telemetry/Sensor/BME680Sensor.cpp b/src/modules/Telemetry/Sensor/BME680Sensor.cpp index 0e0212bc5..fce029deb 100644 --- a/src/modules/Telemetry/Sensor/BME680Sensor.cpp +++ b/src/modules/Telemetry/Sensor/BME680Sensor.cpp @@ -137,17 +137,17 @@ void BME680Sensor::updateState() #endif } -void BME680Sensor::checkStatus(String functionName) +void BME680Sensor::checkStatus(const char *functionName) { if (bme680.status < BSEC_OK) - LOG_ERROR("%s BSEC2 code: %s", functionName.c_str(), String(bme680.status).c_str()); + LOG_ERROR("%s BSEC2 code: %d", functionName, bme680.status); else if (bme680.status > BSEC_OK) - LOG_WARN("%s BSEC2 code: %s", functionName.c_str(), String(bme680.status).c_str()); + LOG_WARN("%s BSEC2 code: %d", functionName, bme680.status); if (bme680.sensor.status < BME68X_OK) - LOG_ERROR("%s BME68X code: %s", functionName.c_str(), String(bme680.sensor.status).c_str()); + LOG_ERROR("%s BME68X code: %d", functionName, bme680.sensor.status); else if (bme680.sensor.status > BME68X_OK) - LOG_WARN("%s BME68X code: %s", functionName.c_str(), String(bme680.sensor.status).c_str()); + LOG_WARN("%s BME68X code: %d", functionName, bme680.sensor.status); } #endif diff --git a/src/modules/Telemetry/Sensor/BME680Sensor.h b/src/modules/Telemetry/Sensor/BME680Sensor.h index 249c4b3e7..ce1fa4f3b 100644 --- a/src/modules/Telemetry/Sensor/BME680Sensor.h +++ b/src/modules/Telemetry/Sensor/BME680Sensor.h @@ -34,7 +34,7 @@ class BME680Sensor : public TelemetrySensor BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY}; void loadState(); void updateState(); - void checkStatus(String functionName); + void checkStatus(const char *functionName); public: BME680Sensor(); diff --git a/src/modules/WaypointModule.cpp b/src/modules/WaypointModule.cpp index 479a973c2..578e7183a 100644 --- a/src/modules/WaypointModule.cpp +++ b/src/modules/WaypointModule.cpp @@ -2,9 +2,13 @@ #include "NodeDB.h" #include "PowerFSM.h" #include "configuration.h" +#include "graphics/draw/CompassRenderer.h" + #if HAS_SCREEN #include "gps/RTC.h" #include "graphics/Screen.h" +#include "graphics/TimeFormatters.h" +#include "graphics/draw/NodeListRenderer.h" #include "main.h" #endif @@ -48,6 +52,8 @@ ProcessMessage WaypointModule::handleReceived(const meshtastic_MeshPacket &mp) bool WaypointModule::shouldDraw() { #if !MESHTASTIC_EXCLUDE_WAYPOINT + if (screen == nullptr) + return false; // If no waypoint to show if (!devicestate.has_rx_waypoint) return false; @@ -79,13 +85,15 @@ bool WaypointModule::shouldDraw() /// Draw the last waypoint we received void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { + if (screen == nullptr) + return; // Prepare to draw display->setFont(FONT_SMALL); display->setTextAlignment(TEXT_ALIGN_LEFT); // Handle inverted display // Unsure of expected behavior: for now, copy drawNodeInfo - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL); // Decode the waypoint @@ -101,7 +109,7 @@ void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, // Get timestamp info. Will pass as a field to drawColumns static char lastStr[20]; - screen->getTimeAgoStr(sinceReceived(&mp), lastStr, sizeof(lastStr)); + getTimeAgoStr(sinceReceived(&mp), lastStr, sizeof(lastStr)); // Will contain distance information, passed as a field to drawColumns static char distStr[20]; @@ -115,7 +123,7 @@ void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, // Dimensions / co-ordinates for the compass/circle int16_t compassX = 0, compassY = 0; - uint16_t compassDiam = graphics::Screen::getCompassDiam(display->getWidth(), display->getHeight()); + uint16_t compassDiam = graphics::CompassRenderer::getCompassDiam(display->getWidth(), display->getHeight()); if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { compassX = x + display->getWidth() - compassDiam / 2 - 5; @@ -133,7 +141,7 @@ void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, myHeading = (screen->getHeading()) * PI / 180; // gotta convert compass degrees to Radians else myHeading = screen->estimatedHeading(DegD(op.latitude_i), DegD(op.longitude_i)); - screen->drawCompassNorth(display, compassX, compassY, myHeading); + graphics::CompassRenderer::drawCompassNorth(display, compassX, compassY, myHeading, (compassDiam / 2)); // Compass bearing to waypoint float bearingToOther = @@ -142,7 +150,7 @@ void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, // If the top of the compass is not a static north we need adjust bearingToOther based on heading if (!config.display.compass_north_top) bearingToOther -= myHeading; - screen->drawNodeHeading(display, compassX, compassY, compassDiam, bearingToOther); + graphics::CompassRenderer::drawNodeHeading(display, compassX, compassY, compassDiam, bearingToOther); float bearingToOtherDegrees = (bearingToOther < 0) ? bearingToOther + 2 * PI : bearingToOther; bearingToOtherDegrees = bearingToOtherDegrees * 180 / PI; @@ -180,11 +188,11 @@ void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, // Undo color-inversion, if set prior to drawing header // Unsure of expected behavior? For now: copy drawNodeInfo - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { display->setColor(BLACK); } // Must be after distStr is populated - screen->drawColumns(display, x, y, fields); + graphics::NodeListRenderer::drawColumns(display, x, y, fields); } #endif diff --git a/src/modules/esp32/PaxcounterModule.cpp b/src/modules/esp32/PaxcounterModule.cpp index b27586771..8b1fc5302 100644 --- a/src/modules/esp32/PaxcounterModule.cpp +++ b/src/modules/esp32/PaxcounterModule.cpp @@ -3,6 +3,9 @@ #include "Default.h" #include "MeshService.h" #include "PaxcounterModule.h" +#include "graphics/ScreenFonts.h" +#include "graphics/SharedUIDisplay.h" +#include "graphics/images.h" #include PaxcounterModule *paxcounterModule; @@ -112,20 +115,32 @@ int32_t PaxcounterModule::runOnce() #if HAS_SCREEN #include "graphics/ScreenFonts.h" +#include "graphics/SharedUIDisplay.h" void PaxcounterModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { + display->clear(); + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + int line = 1; + + // === Set Title + const char *titleStr = "Pax"; + + // === Header === + graphics::drawCommonHeader(display, x, y, titleStr); + char buffer[50]; display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); - display->drawString(x + 0, y + 0, "PAX"); libpax_counter_count(&count_from_libpax); display->setTextAlignment(TEXT_ALIGN_CENTER); display->setFont(FONT_SMALL); - display->drawStringf(display->getWidth() / 2 + x, 0 + y + 12, buffer, "WiFi: %d\nBLE: %d\nuptime: %ds", - count_from_libpax.wifi_count, count_from_libpax.ble_count, millis() / 1000); + display->drawStringf(display->getWidth() / 2 + x, graphics::getTextPositions(display)[line++], buffer, + "WiFi: %d\nBLE: %d\nUptime: %ds", count_from_libpax.wifi_count, count_from_libpax.ble_count, + millis() / 1000); } #endif // HAS_SCREEN diff --git a/src/motion/AccelerometerThread.h b/src/motion/AccelerometerThread.h index 02e5b0bd4..f08ee00f9 100755 --- a/src/motion/AccelerometerThread.h +++ b/src/motion/AccelerometerThread.h @@ -10,6 +10,7 @@ #ifdef HAS_BMA423 #include "BMA423Sensor.h" #endif +#include "BMM150Sensor.h" #include "BMX160Sensor.h" #include "ICM20948Sensor.h" #include "LIS3DHSensor.h" @@ -107,6 +108,9 @@ class AccelerometerThread : public concurrency::OSThread case ScanI2C::DeviceType::ICM20948: sensor = new ICM20948Sensor(device); break; + case ScanI2C::DeviceType::BMM150: + sensor = new BMM150Sensor(device); + break; #ifdef HAS_QMA6100P case ScanI2C::DeviceType::QMA6100P: sensor = new QMA6100PSensor(device); diff --git a/src/motion/BMM150Sensor.cpp b/src/motion/BMM150Sensor.cpp new file mode 100644 index 000000000..4b3a1215c --- /dev/null +++ b/src/motion/BMM150Sensor.cpp @@ -0,0 +1,93 @@ +#include "BMM150Sensor.h" + +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include() +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) + +// screen is defined in main.cpp +extern graphics::Screen *screen; +#endif + +// Flag when an interrupt has been detected +volatile static bool BMM150_IRQ = false; + +BMM150Sensor::BMM150Sensor(ScanI2C::FoundDevice foundDevice) : MotionSensor::MotionSensor(foundDevice) {} + +bool BMM150Sensor::init() +{ + // Initialise the sensor + sensor = BMM150Singleton::GetInstance(device); + return sensor->init(device); +} + +int32_t BMM150Sensor::runOnce() +{ +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN + float heading = sensor->getCompassDegree(); + + switch (config.display.compass_orientation) { + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_0_INVERTED: + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_0: + break; + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_90: + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_90_INVERTED: + heading += 90; + break; + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_180: + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_180_INVERTED: + heading += 180; + break; + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270: + case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270_INVERTED: + heading += 270; + break; + } + if (screen) + screen->setHeading(heading); +#endif + return MOTION_SENSOR_CHECK_INTERVAL_MS; +} + +// ---------------------------------------------------------------------- +// BMM150Singleton +// ---------------------------------------------------------------------- + +// Get a singleton wrapper for an Sparkfun BMM_150_I2C +BMM150Singleton *BMM150Singleton::GetInstance(ScanI2C::FoundDevice device) +{ +#if defined(WIRE_INTERFACES_COUNT) && (WIRE_INTERFACES_COUNT > 1) + TwoWire &bus = (device.address.port == ScanI2C::I2CPort::WIRE1 ? Wire1 : Wire); +#else + TwoWire &bus = Wire; // fallback if only one I2C interface +#endif + if (pinstance == nullptr) { + pinstance = new BMM150Singleton(&bus, device.address.address); + } + return pinstance; +} + +BMM150Singleton::~BMM150Singleton() {} + +BMM150Singleton *BMM150Singleton::pinstance{nullptr}; + +// Initialise the BMM150 Sensor +// https://github.com/DFRobot/DFRobot_BMM150/blob/master/examples/getGeomagneticData/getGeomagneticData.ino +bool BMM150Singleton::init(ScanI2C::FoundDevice device) +{ + + // startup + LOG_DEBUG("BMM150 begin on addr 0x%02X (port=%d)", device.address.address, device.address.port); + uint8_t status = begin(); + if (status != 0) { + LOG_DEBUG("BMM150 init error %u", status); + return false; + } + + // SW reset to make sure the device starts in a known state + setOperationMode(BMM150_POWERMODE_NORMAL); + setPresetMode(BMM150_PRESETMODE_LOWPOWER); + setRate(BMM150_DATA_RATE_02HZ); + setMeasurementXYZ(); + return true; +} + +#endif \ No newline at end of file diff --git a/src/motion/BMM150Sensor.h b/src/motion/BMM150Sensor.h new file mode 100644 index 000000000..879045400 --- /dev/null +++ b/src/motion/BMM150Sensor.h @@ -0,0 +1,57 @@ +#pragma once +#ifndef _BMM_150_SENSOR_H_ +#define _BMM_150_SENSOR_H_ + +#include "MotionSensor.h" + +#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include() + +#include "Fusion/Fusion.h" +#include + +// The I2C address of the Accelerometer (if found) from main.cpp +extern ScanI2C::DeviceAddress accelerometer_found; + +// Singleton wrapper +class BMM150Singleton : public DFRobot_BMM150_I2C +{ + private: + static BMM150Singleton *pinstance; + + protected: + BMM150Singleton(TwoWire *tw, uint8_t addr) : DFRobot_BMM150_I2C(tw, addr) {} + ~BMM150Singleton(); + + public: + // Create a singleton instance (not thread safe) + static BMM150Singleton *GetInstance(ScanI2C::FoundDevice device); + + // Singletons should not be cloneable. + BMM150Singleton(BMM150Singleton &other) = delete; + + // Singletons should not be assignable. + void operator=(const BMM150Singleton &) = delete; + + // Initialise the motion sensor singleton for normal operation + bool init(ScanI2C::FoundDevice device); +}; + +class BMM150Sensor : public MotionSensor +{ + private: + BMM150Singleton *sensor = nullptr; + bool showingScreen = false; + + public: + explicit BMM150Sensor(ScanI2C::FoundDevice foundDevice); + + // Initialise the motion sensor + virtual bool init() override; + + // Called each time our sensor gets a chance to run + virtual int32_t runOnce() override; +}; + +#endif + +#endif \ No newline at end of file diff --git a/src/motion/BMX160Sensor.cpp b/src/motion/BMX160Sensor.cpp index a3909ea3a..003ee850c 100755 --- a/src/motion/BMX160Sensor.cpp +++ b/src/motion/BMX160Sensor.cpp @@ -37,7 +37,8 @@ int32_t BMX160Sensor::runOnce() if (!showingScreen) { powerFSM.trigger(EVENT_PRESS); // keep screen alive during calibration showingScreen = true; - screen->startAlert((FrameCallback)drawFrameCalibration); + if (screen) + screen->startAlert((FrameCallback)drawFrameCalibration); } if (magAccel.x > highestX) @@ -58,7 +59,8 @@ int32_t BMX160Sensor::runOnce() doCalibration = false; endCalibrationAt = 0; showingScreen = false; - screen->endAlert(); + if (screen) + screen->endAlert(); } // LOG_DEBUG("BMX160 min_x: %.4f, max_X: %.4f, min_Y: %.4f, max_Y: %.4f, min_Z: %.4f, max_Z: %.4f", lowestX, highestX, @@ -103,8 +105,8 @@ int32_t BMX160Sensor::runOnce() heading += 270; break; } - - screen->setHeading(heading); + if (screen) + screen->setHeading(heading); #endif return MOTION_SENSOR_CHECK_INTERVAL_MS; @@ -118,7 +120,8 @@ void BMX160Sensor::calibrate(uint16_t forSeconds) doCalibration = true; uint16_t calibrateFor = forSeconds * 1000; // calibrate for seconds provided endCalibrationAt = millis() + calibrateFor; - screen->setEndCalibration(endCalibrationAt); + if (screen) + screen->setEndCalibration(endCalibrationAt); #endif } diff --git a/src/motion/ICM20948Sensor.cpp b/src/motion/ICM20948Sensor.cpp index ecc48d39b..76ba8e8cf 100755 --- a/src/motion/ICM20948Sensor.cpp +++ b/src/motion/ICM20948Sensor.cpp @@ -60,7 +60,8 @@ int32_t ICM20948Sensor::runOnce() if (!showingScreen) { powerFSM.trigger(EVENT_PRESS); // keep screen alive during calibration showingScreen = true; - screen->startAlert((FrameCallback)drawFrameCalibration); + if (screen) + screen->startAlert((FrameCallback)drawFrameCalibration); } if (magX > highestX) @@ -81,7 +82,8 @@ int32_t ICM20948Sensor::runOnce() doCalibration = false; endCalibrationAt = 0; showingScreen = false; - screen->endAlert(); + if (screen) + screen->endAlert(); } // LOG_DEBUG("ICM20948 min_x: %.4f, max_X: %.4f, min_Y: %.4f, max_Y: %.4f, min_Z: %.4f, max_Z: %.4f", lowestX, highestX, @@ -124,8 +126,8 @@ int32_t ICM20948Sensor::runOnce() heading += 270; break; } - - screen->setHeading(heading); + if (screen) + screen->setHeading(heading); #endif // Wake on motion using polling - this is not as efficient as using hardware interrupt pin (see above) @@ -159,7 +161,8 @@ void ICM20948Sensor::calibrate(uint16_t forSeconds) doCalibration = true; uint16_t calibrateFor = forSeconds * 1000; // calibrate for seconds provided endCalibrationAt = millis() + calibrateFor; - screen->setEndCalibration(endCalibrationAt); + if (screen) + screen->setEndCalibration(endCalibrationAt); #endif } // ---------------------------------------------------------------------- diff --git a/src/motion/MotionSensor.cpp b/src/motion/MotionSensor.cpp index 56738d355..b00460aff 100755 --- a/src/motion/MotionSensor.cpp +++ b/src/motion/MotionSensor.cpp @@ -1,4 +1,5 @@ #include "MotionSensor.h" +#include "graphics/draw/CompassRenderer.h" #if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C @@ -34,6 +35,8 @@ ScanI2C::I2CPort MotionSensor::devicePort() #if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN void MotionSensor::drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { + if (screen == nullptr) + return; // int x_offset = display->width() / 2; // int y_offset = display->height() <= 80 ? 0 : 32; display->setTextAlignment(TEXT_ALIGN_LEFT); @@ -46,7 +49,7 @@ void MotionSensor::drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState display->drawString(x, y + 40, timeRemainingBuffer); int16_t compassX = 0, compassY = 0; - uint16_t compassDiam = graphics::Screen::getCompassDiam(display->getWidth(), display->getHeight()); + uint16_t compassDiam = graphics::CompassRenderer::getCompassDiam(display->getWidth(), display->getHeight()); // coordinates for the center of the compass/circle if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { @@ -57,7 +60,7 @@ void MotionSensor::drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState compassY = y + FONT_HEIGHT_SMALL + (display->getHeight() - FONT_HEIGHT_SMALL) / 2; } display->drawCircle(compassX, compassY, compassDiam / 2); - screen->drawCompassNorth(display, compassX, compassY, screen->getHeading() * PI / 180); + graphics::CompassRenderer::drawCompassNorth(display, compassX, compassY, screen->getHeading() * PI / 180, (compassDiam / 2)); } #endif diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 894579a2f..137c92056 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -355,7 +355,7 @@ void MQTT::onReceive(char *topic, byte *payload, size_t length) // if another "/" was added, parse string up to that character channelName = strtok(channelName, "/") ? strtok(channelName, "/") : channelName; // We allow downlink JSON packets only on a channel named "mqtt" - meshtastic_Channel &sendChannel = channels.getByName(channelName); + const meshtastic_Channel &sendChannel = channels.getByName(channelName); if (!(strncasecmp(channels.getGlobalId(sendChannel.index), Channels::mqttChannel, strlen(Channels::mqttChannel)) == 0 && sendChannel.settings.downlink_enabled)) { LOG_WARN("JSON downlink received on channel not called 'mqtt' or without downlink enabled"); @@ -491,7 +491,7 @@ void MQTT::reconnect() return; // Don't try to connect directly to the server } #if HAS_NETWORKING - const PubSubConfig config(moduleConfig.mqtt); + const PubSubConfig ps_config(moduleConfig.mqtt); MQTTClient *clientConnection = mqttClient.get(); #if MQTT_SUPPORTS_TLS if (moduleConfig.mqtt.tls_enabled) { @@ -502,7 +502,7 @@ void MQTT::reconnect() LOG_INFO("Use non-TLS-encrypted session"); } #endif - if (connectPubSub(config, pubSub, *clientConnection)) { + if (connectPubSub(ps_config, pubSub, *clientConnection)) { enabled = true; // Start running background process again runASAP = true; reconnectCount = 0; diff --git a/src/nimble/NimbleBluetooth.cpp b/src/nimble/NimbleBluetooth.cpp index 177a07eb4..3ab06695b 100644 --- a/src/nimble/NimbleBluetooth.cpp +++ b/src/nimble/NimbleBluetooth.cpp @@ -94,31 +94,33 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks bluetoothStatus->updateStatus(new meshtastic::BluetoothStatus(std::to_string(passkey))); #if HAS_SCREEN // Todo: migrate this display code back into Screen class, and observe bluetoothStatus - screen->startAlert([passkey](OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -> void { - char btPIN[16] = "888888"; - snprintf(btPIN, sizeof(btPIN), "%06u", passkey); - int x_offset = display->width() / 2; - int y_offset = display->height() <= 80 ? 0 : 32; - display->setTextAlignment(TEXT_ALIGN_CENTER); - display->setFont(FONT_MEDIUM); - display->drawString(x_offset + x, y_offset + y, "Bluetooth"); + if (screen) { + screen->startAlert([passkey](OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -> void { + char btPIN[16] = "888888"; + snprintf(btPIN, sizeof(btPIN), "%06u", passkey); + int x_offset = display->width() / 2; + int y_offset = display->height() <= 80 ? 0 : 12; + display->setTextAlignment(TEXT_ALIGN_CENTER); + display->setFont(FONT_MEDIUM); + display->drawString(x_offset + x, y_offset + y, "Bluetooth"); - display->setFont(FONT_SMALL); - 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->setFont(FONT_SMALL); + 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->setFont(FONT_LARGE); - String displayPin(btPIN); - String pin = displayPin.substring(0, 3) + " " + displayPin.substring(3, 6); - y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_SMALL - 5 : y_offset + FONT_HEIGHT_SMALL + 5; - display->drawString(x_offset + x, y_offset + y, pin); + display->setFont(FONT_LARGE); + char pin[8]; + snprintf(pin, sizeof(pin), "%.3s %.3s", btPIN, btPIN + 3); + y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_SMALL - 5 : y_offset + FONT_HEIGHT_SMALL + 5; + display->drawString(x_offset + x, y_offset + y, pin); - display->setFont(FONT_SMALL); - String deviceName = "Name: "; - deviceName.concat(getDeviceName()); - y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_LARGE - 6 : y_offset + FONT_HEIGHT_LARGE + 5; - display->drawString(x_offset + x, y_offset + y, deviceName); - }); + display->setFont(FONT_SMALL); + char deviceName[64]; + snprintf(deviceName, sizeof(deviceName), "Name: %s", getDeviceName()); + y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_LARGE - 6 : y_offset + FONT_HEIGHT_LARGE + 5; + display->drawString(x_offset + x, y_offset + y, deviceName); + }); + } #endif passkeyShowing = true; @@ -134,7 +136,8 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks // Todo: migrate this display code back into Screen class, and observe bluetoothStatus if (passkeyShowing) { passkeyShowing = false; - screen->endAlert(); + if (screen) + screen->endAlert(); } } diff --git a/src/platform/esp32/WiFiOTA.cpp b/src/platform/esp32/WiFiOTA.cpp index eac124dda..4cf157b4c 100644 --- a/src/platform/esp32/WiFiOTA.cpp +++ b/src/platform/esp32/WiFiOTA.cpp @@ -80,13 +80,13 @@ bool trySwitchToOTA() return true; } -String getVersion() +const char *getVersion() { const esp_partition_t *part = getAppPartition(); - esp_app_desc_t app_desc; + static esp_app_desc_t app_desc; if (!getAppDesc(part, &app_desc)) - return String(); - return String(app_desc.version); + return ""; + return app_desc.version; } } // namespace WiFiOTA diff --git a/src/platform/esp32/WiFiOTA.h b/src/platform/esp32/WiFiOTA.h index 61860ed5e..5a7ee348a 100644 --- a/src/platform/esp32/WiFiOTA.h +++ b/src/platform/esp32/WiFiOTA.h @@ -12,7 +12,7 @@ bool isUpdated(); void recoverConfig(meshtastic_Config_NetworkConfig *network); void saveConfig(meshtastic_Config_NetworkConfig *network); bool trySwitchToOTA(); -String getVersion(); +const char *getVersion(); } // namespace WiFiOTA #endif // WIFIOTA_H diff --git a/src/platform/nrf52/NRF52Bluetooth.cpp b/src/platform/nrf52/NRF52Bluetooth.cpp index 4f6fe7c6b..89e92afc6 100644 --- a/src/platform/nrf52/NRF52Bluetooth.cpp +++ b/src/platform/nrf52/NRF52Bluetooth.cpp @@ -331,7 +331,7 @@ bool NRF52Bluetooth::onPairingPasskey(uint16_t conn_handle, uint8_t const passke char btPIN[16] = "888888"; snprintf(btPIN, sizeof(btPIN), "%06u", configuredPasskey); int x_offset = display->width() / 2; - int y_offset = display->height() <= 80 ? 0 : 32; + int y_offset = display->height() <= 80 ? 0 : 12; display->setTextAlignment(TEXT_ALIGN_CENTER); display->setFont(FONT_MEDIUM); display->drawString(x_offset + x, y_offset + y, "Bluetooth"); diff --git a/src/platform/nrf52/architecture.h b/src/platform/nrf52/architecture.h index a69816d0b..684d20e84 100644 --- a/src/platform/nrf52/architecture.h +++ b/src/platform/nrf52/architecture.h @@ -121,10 +121,6 @@ #define BUTTON_PIN PIN_BUTTON1 #endif -#ifdef PIN_BUTTON2 -#define BUTTON_PIN_ALT PIN_BUTTON2 -#endif - #ifdef PIN_BUTTON_TOUCH #define BUTTON_PIN_TOUCH PIN_BUTTON_TOUCH #endif diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index cc0c417d3..f582a116d 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -143,10 +143,26 @@ void portduinoSetup() { printf("Set up Meshtastic on Portduino...\n"); int max_GPIO = 0; - const configNames GPIO_lines[] = { - cs_pin, irq_pin, busy_pin, reset_pin, sx126x_ant_sw_pin, txen_pin, - rxen_pin, displayDC, displayCS, displayBacklight, displayBacklightPWMChannel, displayReset, - touchscreenCS, touchscreenIRQ, user}; + const configNames GPIO_lines[] = {cs_pin, + irq_pin, + busy_pin, + reset_pin, + sx126x_ant_sw_pin, + txen_pin, + rxen_pin, + displayDC, + displayCS, + displayBacklight, + displayBacklightPWMChannel, + displayReset, + touchscreenCS, + touchscreenIRQ, + userButtonPin, + tbUpPin, + tbDownPin, + tbLeftPin, + tbRightPin, + tbPressPin}; std::string gpioChipName = "gpiochip"; settingsStrings[i2cdev] = ""; @@ -159,6 +175,11 @@ void portduinoSetup() settingsMap[ascii_logs] = !isatty(1); settingsMap[displayPanel] = no_screen; settingsMap[touchscreenModule] = no_touchscreen; + settingsMap[tbUpPin] = RADIOLIB_NC; + settingsMap[tbDownPin] = RADIOLIB_NC; + settingsMap[tbLeftPin] = RADIOLIB_NC; + settingsMap[tbRightPin] = RADIOLIB_NC; + settingsMap[tbPressPin] = RADIOLIB_NC; YAML::Node yamlConfig; @@ -313,9 +334,34 @@ void portduinoSetup() // Need to bind all the configured GPIO pins so they're not simulated // TODO: If one of these fails, we should log and terminate - if (settingsMap.count(user) > 0 && settingsMap[user] != RADIOLIB_NC) { - if (initGPIOPin(settingsMap[user], defaultGpioChipName, settingsMap[user]) != ERRNO_OK) { - settingsMap[user] = RADIOLIB_NC; + if (settingsMap.count(userButtonPin) > 0 && settingsMap[userButtonPin] != RADIOLIB_NC) { + if (initGPIOPin(settingsMap[userButtonPin], defaultGpioChipName, settingsMap[userButtonPin]) != ERRNO_OK) { + settingsMap[userButtonPin] = RADIOLIB_NC; + } + } + if (settingsMap.count(tbUpPin) > 0 && settingsMap[tbUpPin] != RADIOLIB_NC) { + if (initGPIOPin(settingsMap[tbUpPin], defaultGpioChipName, settingsMap[tbUpPin]) != ERRNO_OK) { + settingsMap[tbUpPin] = RADIOLIB_NC; + } + } + if (settingsMap.count(tbDownPin) > 0 && settingsMap[tbDownPin] != RADIOLIB_NC) { + if (initGPIOPin(settingsMap[tbDownPin], defaultGpioChipName, settingsMap[tbDownPin]) != ERRNO_OK) { + settingsMap[tbDownPin] = RADIOLIB_NC; + } + } + if (settingsMap.count(tbLeftPin) > 0 && settingsMap[tbLeftPin] != RADIOLIB_NC) { + if (initGPIOPin(settingsMap[tbLeftPin], defaultGpioChipName, settingsMap[tbLeftPin]) != ERRNO_OK) { + settingsMap[tbLeftPin] = RADIOLIB_NC; + } + } + if (settingsMap.count(tbRightPin) > 0 && settingsMap[tbRightPin] != RADIOLIB_NC) { + if (initGPIOPin(settingsMap[tbRightPin], defaultGpioChipName, settingsMap[tbRightPin]) != ERRNO_OK) { + settingsMap[tbRightPin] = RADIOLIB_NC; + } + } + if (settingsMap.count(tbPressPin) > 0 && settingsMap[tbPressPin] != RADIOLIB_NC) { + if (initGPIOPin(settingsMap[tbPressPin], defaultGpioChipName, settingsMap[tbPressPin]) != ERRNO_OK) { + settingsMap[tbPressPin] = RADIOLIB_NC; } } if (settingsMap[displayPanel] != no_screen) { @@ -377,6 +423,8 @@ int initGPIOPin(int pinNum, const std::string gpioChipName, int line) { #ifdef PORTDUINO_LINUX_HARDWARE std::string gpio_name = "GPIO" + std::to_string(pinNum); + std::cout << gpio_name; + printf("\n"); try { GPIOPin *csPin; csPin = new LinuxGPIOPin(pinNum, gpioChipName.c_str(), line, gpio_name.c_str()); @@ -498,7 +546,7 @@ bool loadConfig(const char *configPath) } } if (yamlConfig["GPIO"]) { - settingsMap[user] = yamlConfig["GPIO"]["User"].as(RADIOLIB_NC); + settingsMap[userButtonPin] = yamlConfig["GPIO"]["User"].as(RADIOLIB_NC); } if (yamlConfig["GPS"]) { std::string serialPath = yamlConfig["GPS"]["SerialPath"].as(""); @@ -588,6 +636,12 @@ bool loadConfig(const char *configPath) if (yamlConfig["Input"]) { settingsStrings[keyboardDevice] = (yamlConfig["Input"]["KeyboardDevice"]).as(""); settingsStrings[pointerDevice] = (yamlConfig["Input"]["PointerDevice"]).as(""); + settingsMap[userButtonPin] = yamlConfig["Input"]["User"].as(RADIOLIB_NC); + settingsMap[tbUpPin] = yamlConfig["Input"]["TrackballUp"].as(RADIOLIB_NC); + settingsMap[tbDownPin] = yamlConfig["Input"]["TrackballDown"].as(RADIOLIB_NC); + settingsMap[tbLeftPin] = yamlConfig["Input"]["TrackballLeft"].as(RADIOLIB_NC); + settingsMap[tbRightPin] = yamlConfig["Input"]["TrackballRight"].as(RADIOLIB_NC); + settingsMap[tbPressPin] = yamlConfig["Input"]["TrackballPress"].as(RADIOLIB_NC); } if (yamlConfig["Webserver"]) { diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index d324aaf47..43aea4218 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -57,7 +57,12 @@ enum configNames { lora_usb_serial_num, lora_usb_pid, lora_usb_vid, - user, + userButtonPin, + tbUpPin, + tbDownPin, + tbLeftPin, + tbRightPin, + tbPressPin, spidev, spiSpeed, i2cdev, diff --git a/src/platform/portduino/architecture.h b/src/platform/portduino/architecture.h index a5e263d5a..07d0aeee0 100644 --- a/src/platform/portduino/architecture.h +++ b/src/platform/portduino/architecture.h @@ -8,6 +8,9 @@ #define HW_VENDOR meshtastic_HardwareModel_PORTDUINO +#ifndef HAS_BUTTON +#define HAS_BUTTON 1 +#endif #ifndef HAS_WIFI #define HAS_WIFI 1 #endif @@ -22,4 +25,12 @@ #endif #ifndef HAS_SENSOR #define HAS_SENSOR 1 +#endif +#ifndef HAS_TRACKBALL +#define HAS_TRACKBALL 1 +#define TB_DOWN (uint8_t) settingsMap[tbDownPin] +#define TB_UP (uint8_t) settingsMap[tbUpPin] +#define TB_LEFT (uint8_t) settingsMap[tbLeftPin] +#define TB_RIGHT (uint8_t) settingsMap[tbRightPin] +#define TB_PRESS (uint8_t) settingsMap[tbPressPin] #endif \ No newline at end of file diff --git a/src/power.h b/src/power.h index d7fa7f8a9..33a356d92 100644 --- a/src/power.h +++ b/src/power.h @@ -78,8 +78,8 @@ extern NullSensor ina3221Sensor; #endif #if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_STM32WL) -#include "modules/Telemetry/Sensor/MAX17048Sensor.h" #if __has_include() +#include "modules/Telemetry/Sensor/MAX17048Sensor.h" extern MAX17048Sensor max17048Sensor; #else extern NullSensor max17048Sensor; diff --git a/src/shutdown.h b/src/shutdown.h index f02cb7964..998944677 100644 --- a/src/shutdown.h +++ b/src/shutdown.h @@ -41,8 +41,8 @@ void powerCommandsCheck() } #if defined(ARCH_ESP32) || defined(ARCH_NRF52) - if (shutdownAtMsec) { - screen->startAlert("Shutting down..."); + if (shutdownAtMsec && screen) { + screen->showOverlayBanner("Shutting Down...", 0); // stays on screen } #endif diff --git a/src/sleep.cpp b/src/sleep.cpp index 6d1b2f348..09484f46e 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -221,8 +221,8 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false, bool skipSaveN #endif powerMon->setState(meshtastic_PowerMon_State_CPU_DeepSleep); - - screen->doDeepSleep(); // datasheet says this will draw only 10ua + if (screen) + screen->doDeepSleep(); // datasheet says this will draw only 10ua if (!skipSaveNodeDb) { nodeDB->saveToDisk(); diff --git a/suppressions.txt b/suppressions.txt index 04937523d..ab57c9298 100644 --- a/suppressions.txt +++ b/suppressions.txt @@ -53,4 +53,8 @@ internalAstError:*/CrossPlatformCryptoEngine.cpp uninitMemberVar:*/AudioThread.h // False positive constVariableReference:*/Channels.cpp -constParameterPointer:*/unishox2.c \ No newline at end of file +constParameterPointer:*/unishox2.c + +useStlAlgorithm + +variableScope \ No newline at end of file diff --git a/variants/ELECROW-ThinkNode-M1/nicheGraphics.h b/variants/ELECROW-ThinkNode-M1/nicheGraphics.h index c2c351925..f3b709261 100644 --- a/variants/ELECROW-ThinkNode-M1/nicheGraphics.h +++ b/variants/ELECROW-ThinkNode-M1/nicheGraphics.h @@ -22,6 +22,9 @@ #include "graphics/niche/Drivers/EInk/GDEY0154D67.h" #include "graphics/niche/Inputs/TwoButton.h" +// Button feedback +#include "buzz.h" + void setupNicheGraphics() { using namespace NicheGraphics; @@ -98,8 +101,14 @@ void setupNicheGraphics() buttons->setWiring(1, PIN_BUTTON1); buttons->setTiming(1, 50, 500); // 500ms before latch buttons->setHandlerDown(1, [backlight]() { backlight->peek(); }); - buttons->setHandlerLongPress(1, [backlight]() { backlight->latch(); }); - buttons->setHandlerShortPress(1, [backlight]() { backlight->off(); }); + buttons->setHandlerLongPress(1, [backlight]() { + backlight->latch(); + playBeep(); + }); + buttons->setHandlerShortPress(1, [backlight]() { + backlight->off(); + playBoop(); + }); // Begin handling button events buttons->start(); diff --git a/variants/ELECROW-ThinkNode-M1/variant.h b/variants/ELECROW-ThinkNode-M1/variant.h index 2e91e378d..79e31c54a 100644 --- a/variants/ELECROW-ThinkNode-M1/variant.h +++ b/variants/ELECROW-ThinkNode-M1/variant.h @@ -63,6 +63,9 @@ extern "C" { * Buttons */ #define PIN_BUTTON2 (32 + 10) +#define ALT_BUTTON_PIN PIN_BUTTON2 +#define ALT_BUTTON_ACTIVE_LOW true +#define ALT_BUTTON_ACTIVE_PULLUP true #define PIN_BUTTON1 (32 + 7) // #define PIN_BUTTON1 (0 + 11) diff --git a/variants/ELECROW-ThinkNode-M2/variant.h b/variants/ELECROW-ThinkNode-M2/variant.h index a6bb40f1a..cd8d43555 100644 --- a/variants/ELECROW-ThinkNode-M2/variant.h +++ b/variants/ELECROW-ThinkNode-M2/variant.h @@ -3,6 +3,9 @@ #define PIN_BUTTON1 47 // 功能键 #define PIN_BUTTON2 4 // 电源键 +#define ALT_BUTTON_PIN PIN_BUTTON2 +#define ALT_BUTTON_ACTIVE_LOW false +#define ALT_BUTTON_ACTIVE_PULLUP false #define LED_POWER 6 #define ADC_V 42 @@ -60,4 +63,3 @@ #define HAS_GPS 0 #define BUTTON_PIN PIN_BUTTON1 -#define BUTTON_PIN_ALT PIN_BUTTON2 diff --git a/variants/heltec_capsule_sensor_v3/variant.h b/variants/heltec_capsule_sensor_v3/variant.h index 415de0559..b30b7fc3e 100644 --- a/variants/heltec_capsule_sensor_v3/variant.h +++ b/variants/heltec_capsule_sensor_v3/variant.h @@ -3,6 +3,8 @@ #define EXT_PWR_DETECT 35 #define BUTTON_PIN 18 +#define BUTTON_ACTIVE_LOW false +#define BUTTON_ACTIVE_PULLUP false #define BATTERY_PIN 7 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define ADC_CHANNEL ADC1_GPIO7_CHANNEL diff --git a/variants/heltec_mesh_node_t114/variant.h b/variants/heltec_mesh_node_t114/variant.h index 426085a26..798c3538a 100644 --- a/variants/heltec_mesh_node_t114/variant.h +++ b/variants/heltec_mesh_node_t114/variant.h @@ -56,6 +56,7 @@ extern "C" { #define TFT_WIDTH 240 #define TFT_OFFSET_X 0 #define TFT_OFFSET_Y 0 + // #define TFT_OFFSET_ROTATION 0 // #define SCREEN_ROTATE // #define SCREEN_TRANSITION_FRAMERATE 5 diff --git a/variants/heltec_sensor_hub/variant.h b/variants/heltec_sensor_hub/variant.h index 771cefee3..8c5d31c9a 100644 --- a/variants/heltec_sensor_hub/variant.h +++ b/variants/heltec_sensor_hub/variant.h @@ -1,6 +1,8 @@ #define EXT_PWR_DETECT 20 #define BUTTON_PIN 17 +#define BUTTON_ACTIVE_LOW false +#define BUTTON_ACTIVE_PULLUP false #define BATTERY_PIN 7 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define ADC_CHANNEL ADC1_GPIO7_CHANNEL diff --git a/variants/heltec_vision_master_e213/nicheGraphics.h b/variants/heltec_vision_master_e213/nicheGraphics.h index 7eccb2955..26f393f6c 100644 --- a/variants/heltec_vision_master_e213/nicheGraphics.h +++ b/variants/heltec_vision_master_e213/nicheGraphics.h @@ -21,6 +21,9 @@ #include "graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h" #include "graphics/niche/Inputs/TwoButton.h" +// Button feedback +#include "buzz.h" + void setupNicheGraphics() { using namespace NicheGraphics; @@ -84,8 +87,11 @@ void setupNicheGraphics() buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); }); // #1: Aux Button - buttons->setWiring(1, BUTTON_PIN_SECONDARY); - buttons->setHandlerShortPress(1, [inkhud]() { inkhud->nextTile(); }); + buttons->setWiring(1, PIN_BUTTON2); + buttons->setHandlerShortPress(1, [inkhud]() { + inkhud->nextTile(); + playBoop(); + }); // Begin handling button events buttons->start(); diff --git a/variants/heltec_vision_master_e213/variant.h b/variants/heltec_vision_master_e213/variant.h index ebb2c341f..60f4e00cc 100644 --- a/variants/heltec_vision_master_e213/variant.h +++ b/variants/heltec_vision_master_e213/variant.h @@ -1,7 +1,7 @@ #define LED_PIN 45 // LED is not populated on earliest board variant #define BUTTON_PIN 0 -#define BUTTON_PIN_SECONDARY 21 // Second built-in button -#define BUTTON_SECONDARY_CANNEDMESSAGES // By default, use the secondary button as canned message input +#define PIN_BUTTON2 21 // Second built-in button +#define ALT_BUTTON_PIN PIN_BUTTON2 // Send the up event // I2C #define I2C_SDA SDA diff --git a/variants/heltec_vision_master_e290/nicheGraphics.h b/variants/heltec_vision_master_e290/nicheGraphics.h index af78df746..f3cf6355e 100644 --- a/variants/heltec_vision_master_e290/nicheGraphics.h +++ b/variants/heltec_vision_master_e290/nicheGraphics.h @@ -34,6 +34,9 @@ Different NicheGraphics UIs and different hardware variants will each have their #include "graphics/niche/Drivers/EInk/DEPG0290BNS800.h" #include "graphics/niche/Inputs/TwoButton.h" +// Button feedback +#include "buzz.h" + void setupNicheGraphics() { using namespace NicheGraphics; @@ -97,8 +100,11 @@ void setupNicheGraphics() buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); }); // #1: Aux Button - buttons->setWiring(1, BUTTON_PIN_SECONDARY); - buttons->setHandlerShortPress(1, [inkhud]() { inkhud->nextTile(); }); + buttons->setWiring(1, PIN_BUTTON2); + buttons->setHandlerShortPress(1, [inkhud]() { + inkhud->nextTile(); + playBoop(); + }); // Begin handling button events buttons->start(); diff --git a/variants/heltec_vision_master_e290/variant.h b/variants/heltec_vision_master_e290/variant.h index 02986d26b..d7bae7dc2 100644 --- a/variants/heltec_vision_master_e290/variant.h +++ b/variants/heltec_vision_master_e290/variant.h @@ -1,7 +1,7 @@ #define LED_PIN 45 // LED is not populated on earliest board variant #define BUTTON_PIN 0 -#define BUTTON_PIN_SECONDARY 21 // Second built-in button -#define BUTTON_SECONDARY_CANNEDMESSAGES // By default, use the secondary button as canned message input +#define PIN_BUTTON2 21 // Second built-in button +#define ALT_BUTTON_PIN PIN_BUTTON2 // Send the up event // I2C #define I2C_SDA SDA diff --git a/variants/heltec_vision_master_t190/variant.h b/variants/heltec_vision_master_t190/variant.h index 788466919..a6a809207 100644 --- a/variants/heltec_vision_master_t190/variant.h +++ b/variants/heltec_vision_master_t190/variant.h @@ -1,6 +1,7 @@ +#ifndef HAS_TFT #define BUTTON_PIN 0 -#define BUTTON_PIN_SECONDARY 21 // Second built-in button -#define BUTTON_SECONDARY_CANNEDMESSAGES // By default, use the secondary button as canned message input +#define PIN_BUTTON2 21 // Second built-in button +#define ALT_BUTTON_PIN PIN_BUTTON2 // Send the up event // I2C #define I2C_SDA SDA @@ -68,4 +69,5 @@ #define SX126X_RESET LORA_RESET #define SX126X_DIO2_AS_RF_SWITCH -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 \ No newline at end of file +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 +#endif // HAS_TFT \ No newline at end of file diff --git a/variants/link32_s3_v1/variant.h b/variants/link32_s3_v1/variant.h index 1f8a7435a..a16c0ff68 100644 --- a/variants/link32_s3_v1/variant.h +++ b/variants/link32_s3_v1/variant.h @@ -6,7 +6,9 @@ #define USE_SSD1306 #define BUTTON_PIN 0 // Button pin for this board -#define BUTTON_PIN_ALT 36 +#define CANCEL_BUTTON_PIN 36 +#define CANCEL_BUTTON_ACTIVE_LOW true +#define CANCEL_BUTTON_ACTIVE_PULLUP true #define HAS_NEOPIXEL // If defined, we will use the neopixel library #define NEOPIXEL_DATA 35 // Neopixel pin for this board diff --git a/variants/nano-g1-explorer/variant.h b/variants/nano-g1-explorer/variant.h index 3d5d71acc..f3640241a 100644 --- a/variants/nano-g1-explorer/variant.h +++ b/variants/nano-g1-explorer/variant.h @@ -3,9 +3,7 @@ #define I2C_SDA 21 #define I2C_SCL 22 -#define BUTTON_PIN 36 // The user button (information button) GPIO on the Nano G1 explorer -// #define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented -// anywhere. +#define BUTTON_PIN 36 // The user button (information button) GPIO on the Nano G1 explorer #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module. // common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if diff --git a/variants/nano-g1/variant.h b/variants/nano-g1/variant.h index dd8355492..2521c3ffe 100644 --- a/variants/nano-g1/variant.h +++ b/variants/nano-g1/variant.h @@ -3,9 +3,7 @@ #define I2C_SDA 21 #define I2C_SCL 22 -#define BUTTON_PIN 36 // The middle button GPIO on the Nano G1 -// #define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented -// anywhere. +#define BUTTON_PIN 36 // The middle button GPIO on the Nano G1 #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module. // common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if diff --git a/variants/picomputer-s3/platformio.ini b/variants/picomputer-s3/platformio.ini index df2d0dfdc..b861b5496 100644 --- a/variants/picomputer-s3/platformio.ini +++ b/variants/picomputer-s3/platformio.ini @@ -26,21 +26,15 @@ extends = env:picomputer-s3 build_flags = ${env:picomputer-s3.build_flags} - -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 - -D MESHTASTIC_EXCLUDE_INPUTBROKER=1 - -D MESHTASTIC_EXCLUDE_BLUETOOTH=1 - -D MESHTASTIC_EXCLUDE_WEBSERVER=1 - -D MESHTASTIC_EXCLUDE_SERIAL=1 - -D MESHTASTIC_EXCLUDE_SOCKETAPI=1 -D INPUTDRIVER_MATRIX_TYPE=1 -D USE_PIN_BUZZER=PIN_BUZZER -D USE_SX127x - -D HAS_SCREEN=0 + -D HAS_SCREEN=1 -D HAS_TFT=1 - -D RAM_SIZE=1024 - -D LV_LVGL_H_INCLUDE_SIMPLE - -D LV_CONF_INCLUDE_SIMPLE - -D LV_COMP_CONF_INCLUDE_SIMPLE + -D RAM_SIZE=1560 + -D LV_LVGL_H_INCLUDE_SIMPLE + -D LV_CONF_INCLUDE_SIMPLE + -D LV_COMP_CONF_INCLUDE_SIMPLE -D LV_USE_SYSMON=0 -D LV_USE_PROFILER=0 -D LV_USE_PERF_MONITOR=0 @@ -51,7 +45,7 @@ build_flags = -D LGFX_DRIVER=LGFX_PICOMPUTER_S3 -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_PICOMPUTER_S3.h\" -D VIEW_320x240 -; -D USE_DOUBLE_BUFFER +; -D USE_DOUBLE_BUFFER -D USE_PACKET_API lib_deps = diff --git a/variants/portduino/platformio.ini b/variants/portduino/platformio.ini index fe89ad6e6..6da827508 100644 --- a/variants/portduino/platformio.ini +++ b/variants/portduino/platformio.ini @@ -26,7 +26,8 @@ build_flags = ${native_base.build_flags} -Os -lX11 -linput -lxkbcommon -ffunctio -D RAM_SIZE=16384 -D USE_X11=1 -D HAS_TFT=1 - -D HAS_SCREEN=0 + -D HAS_SCREEN=1 + -D LV_CACHE_DEF_SIZE=6291456 -D LV_BUILD_TEST=0 -D LV_USE_LIBINPUT=1 @@ -41,7 +42,6 @@ build_flags = ${native_base.build_flags} -Os -lX11 -linput -lxkbcommon -ffunctio !pkg-config --libs openssl --silence-errors || : build_src_filter = ${native_base.build_src_filter} - - [env:native-fb] extends = native_base @@ -56,7 +56,7 @@ build_flags = ${native_base.build_flags} -Os -ffunction-sections -fdata-sections -D USE_FRAMEBUFFER=1 -D LV_COLOR_DEPTH=32 -D HAS_TFT=1 - -D HAS_SCREEN=0 + -D HAS_SCREEN=1 -D LV_BUILD_TEST=0 -D LV_USE_LOG=0 -D LV_USE_EVDEV=1 @@ -72,7 +72,6 @@ build_flags = ${native_base.build_flags} -Os -ffunction-sections -fdata-sections !pkg-config --libs openssl --silence-errors || : build_src_filter = ${native_base.build_src_filter} - - [env:native-tft-debug] extends = native_base diff --git a/variants/seeed-sensecap-indicator/platformio.ini b/variants/seeed-sensecap-indicator/platformio.ini index b643288a6..2187ebd8a 100644 --- a/variants/seeed-sensecap-indicator/platformio.ini +++ b/variants/seeed-sensecap-indicator/platformio.ini @@ -36,17 +36,9 @@ upload_speed = 460800 build_flags = ${env:seeed-sensecap-indicator.build_flags} - -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 - -D MESHTASTIC_EXCLUDE_INPUTBROKER=1 - -D MESHTASTIC_EXCLUDE_SCREEN=1 - -D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1 - -D MESHTASTIC_EXCLUDE_WEBSERVER=1 - -D MESHTASTIC_EXCLUDE_SERIAL=1 - -D MESHTASTIC_EXCLUDE_SOCKETAPI=1 -D INPUTDRIVER_BUTTON_TYPE=38 - -D HAS_TELEMETRY=0 -D CONFIG_DISABLE_HAL_LOCKS=1 - -D HAS_SCREEN=0 + -D HAS_SCREEN=1 -D HAS_TFT=1 -D DISPLAY_SET_RESOLUTION -D RAM_SIZE=4096 diff --git a/variants/seeed-sensecap-indicator/variant.h b/variants/seeed-sensecap-indicator/variant.h index 1010e04c8..8915395f3 100644 --- a/variants/seeed-sensecap-indicator/variant.h +++ b/variants/seeed-sensecap-indicator/variant.h @@ -7,9 +7,10 @@ #define SENSOR_PORT_NUM 2 #define SENSOR_BAUD_RATE 115200 -#if !HAS_TFT #define BUTTON_PIN 38 -#endif +#define BUTTON_ACTIVE_LOW true +#define BUTTON_ACTIVE_PULLUP true + // #define BUTTON_NEED_PULLUP // #define BATTERY_PIN 27 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage diff --git a/variants/seeed_wio_tracker_L1/variant.h b/variants/seeed_wio_tracker_L1/variant.h index 38f2b71ff..daa6afb8e 100644 --- a/variants/seeed_wio_tracker_L1/variant.h +++ b/variants/seeed_wio_tracker_L1/variant.h @@ -33,15 +33,15 @@ // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // Button Configuration // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -#define BUTTON_PIN D13 // This is the Program Button +#define CANCEL_BUTTON_PIN D13 // This is the Program Button // #define BUTTON_NEED_PULLUP 1 -#define BUTTON_ACTIVE_LOW true -#define BUTTON_ACTIVE_PULLUP false +#define CANCEL_BUTTON_ACTIVE_LOW true +#define CANCEL_BUTTON_ACTIVE_PULLUP false -#define BUTTON_PIN_TOUCH 13 // Touch button -// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -// Digital Pin Mapping (D0-D10) -// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// #define BUTTON_PIN_TOUCH 13 // Touch button +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Digital Pin Mapping (D0-D10) +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ #define D0 0 // P1.06 GNSS_WAKEUP/IO0 #define D1 1 // P0.07 LORA_DIO1 #define D2 2 // P1.07 LORA_RESET diff --git a/variants/station-g1/variant.h b/variants/station-g1/variant.h index 9a3c37b73..6c3a39261 100644 --- a/variants/station-g1/variant.h +++ b/variants/station-g1/variant.h @@ -6,9 +6,7 @@ #define I2C_SDA1 14 // Second i2c channel on external IO connector #define I2C_SCL1 15 // Second i2c channel on external IO connector -#define BUTTON_PIN 36 // The middle button GPIO on the Nano G1 -// #define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented -// anywhere. +#define BUTTON_PIN 36 // The middle button GPIO on the Nano G1 #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module. // common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if diff --git a/variants/t-deck/platformio.ini b/variants/t-deck/platformio.ini index 0e644001e..c00ab5e04 100644 --- a/variants/t-deck/platformio.ini +++ b/variants/t-deck/platformio.ini @@ -25,11 +25,6 @@ extends = env:t-deck build_flags = ${env:t-deck.build_flags} -D CONFIG_DISABLE_HAL_LOCKS=1 ; "feels" to be a bit more stable without locks - -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 - -D MESHTASTIC_EXCLUDE_INPUTBROKER=1 - -D MESHTASTIC_EXCLUDE_WEBSERVER=1 - -D MESHTASTIC_EXCLUDE_SERIAL=1 - -D MESHTASTIC_EXCLUDE_SOCKETAPI=1 -D INPUTDRIVER_I2C_KBD_TYPE=0x55 -D INPUTDRIVER_ENCODER_TYPE=3 -D INPUTDRIVER_ENCODER_LEFT=1 @@ -39,7 +34,7 @@ build_flags = -D INPUTDRIVER_ENCODER_BTN=0 -D INPUTDRIVER_BUTTON_TYPE=0 -D HAS_SDCARD - -D HAS_SCREEN=0 + -D HAS_SCREEN=1 -D HAS_TFT=1 -D USE_I2S_BUZZER -D RAM_SIZE=5120 diff --git a/variants/t-deck/variant.h b/variants/t-deck/variant.h index a21c786b3..9fa0018ec 100644 --- a/variants/t-deck/variant.h +++ b/variants/t-deck/variant.h @@ -1,7 +1,5 @@ #define TFT_CS 12 -#ifndef HAS_TFT // for TFT-UI the definitions are in device-ui -#define BUTTON_PIN 0 // ST7789 TFT LCD #define ST7789_CS TFT_CS @@ -24,7 +22,6 @@ #define SCREEN_ROTATE #define SCREEN_TRANSITION_FRAMERATE 5 #define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness -#endif #define HAS_TOUCHSCREEN 1 #define SCREEN_TOUCH_INT 16 @@ -34,10 +31,10 @@ #define USE_POWERSAVE #define SLEEP_TIME 120 -#ifndef HAS_TFT -#define BUTTON_PIN 0 -// #define BUTTON_NEED_PULLUP -#endif +#define TB_PRESS 0 +#define BUTTON_ACTIVE_LOW true +#define BUTTON_ACTIVE_PULLUP true + #define GPS_DEFAULT_NOT_PRESENT 1 #define GPS_RX_PIN 44 #define GPS_TX_PIN 43 diff --git a/variants/t-echo/variant.h b/variants/t-echo/variant.h index 3f96ffc83..4f3a53ebf 100644 --- a/variants/t-echo/variant.h +++ b/variants/t-echo/variant.h @@ -61,8 +61,12 @@ extern "C" { * Buttons */ #define PIN_BUTTON1 (32 + 10) +#define BUTTON_ACTIVE_LOW true +#define BUTTON_ACTIVE_PULLUP true #define PIN_BUTTON2 (0 + 18) // 0.18 is labeled on the board as RESET but we configure it in the bootloader as a regular GPIO #define PIN_BUTTON_TOUCH (0 + 11) // 0.11 is the soft touch button on T-Echo +#define BUTTON_TOUCH_ACTIVE_LOW true +#define BUTTON_TOUCH_ACTIVE_PULLUP true #define BUTTON_CLICK_MS 400 #define BUTTON_TOUCH_MS 200 diff --git a/variants/tbeam-s3-core/variant.h b/variants/tbeam-s3-core/variant.h index cc706459f..dabd52980 100644 --- a/variants/tbeam-s3-core/variant.h +++ b/variants/tbeam-s3-core/variant.h @@ -7,8 +7,6 @@ #define I2C_SCL 18 // For QMC6310 sensors and screens #define BUTTON_PIN 0 // The middle button GPIO on the T-Beam S3 -// #define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented -// anywhere. // #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module. #define LED_STATE_ON 0 // State when LED is lit diff --git a/variants/tbeam/variant.h b/variants/tbeam/variant.h index 8771c20d2..5b521a2de 100644 --- a/variants/tbeam/variant.h +++ b/variants/tbeam/variant.h @@ -4,8 +4,8 @@ #define I2C_SCL 22 #define BUTTON_PIN 38 // The middle button GPIO on the T-Beam -// #define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented -// anywhere. +#define BUTTON_ACTIVE_LOW true +#define BUTTON_ACTIVE_PULLUP true #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module. #define LED_STATE_ON 0 // State when LED is lit diff --git a/variants/unphone/platformio.ini b/variants/unphone/platformio.ini index 399d65b03..ef0f62b60 100644 --- a/variants/unphone/platformio.ini +++ b/variants/unphone/platformio.ini @@ -36,21 +36,16 @@ extends = env:unphone build_flags = ${env:unphone.build_flags} -D CONFIG_DISABLE_HAL_LOCKS=1 - -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 - -D MESHTASTIC_EXCLUDE_INPUTBROKER=1 - -D MESHTASTIC_EXCLUDE_WEBSERVER=1 - -D MESHTASTIC_EXCLUDE_SERIAL=1 - -D MESHTASTIC_EXCLUDE_SOCKETAPI=1 -D INPUTDRIVER_BUTTON_TYPE=21 - -D HAS_SCREEN=0 + -D HAS_SCREEN=1 -D HAS_TFT=1 -D HAS_SDCARD -D DISPLAY_SET_RESOLUTION -D RAM_SIZE=6144 -D LV_CACHE_DEF_SIZE=2097152 - -D LV_LVGL_H_INCLUDE_SIMPLE - -D LV_CONF_INCLUDE_SIMPLE - -D LV_COMP_CONF_INCLUDE_SIMPLE + -D LV_LVGL_H_INCLUDE_SIMPLE + -D LV_CONF_INCLUDE_SIMPLE + -D LV_COMP_CONF_INCLUDE_SIMPLE -D LV_BUILD_TEST=0 -D LV_USE_SYSMON=0 -D LV_USE_PROFILER=0 diff --git a/variants/unphone/variant.h b/variants/unphone/variant.h index eaf142721..aef650278 100644 --- a/variants/unphone/variant.h +++ b/variants/unphone/variant.h @@ -57,9 +57,13 @@ #define LED_PIN 13 // the red part of the RGB LED #define LED_STATE_ON 0 // State when LED is lit -#define BUTTON_PIN 21 // Button 3 - square - top button in landscape mode -#define BUTTON_NEED_PULLUP // we do need a helping hand up -#define BUTTON_PIN_ALT 45 // Button 1 - triangle - bottom button in landscape mode +#define ALT_BUTTON_PIN 21 // Button 3 - square - top button in landscape mode +#define BUTTON_NEED_PULLUP2 TB_UP +#define BUTTON_PIN 0 // Circle button +#define BUTTON_NEED_PULLUP // we do need a helping hand up +#define CANCEL_BUTTON_PIN 45 // Button 1 - triangle - bottom button in landscape mode +#define CANCEL_BUTTON_ACTIVE_LOW true +#define CANCEL_BUTTON_ACTIVE_PULLUP true #define I2C_SDA 3 // I2C pins for this board #define I2C_SCL 4 From 195b7cc30a4337877e1e81a800820eca71d19a79 Mon Sep 17 00:00:00 2001 From: oscgonfer Date: Sat, 21 Jun 2025 13:44:07 +0200 Subject: [PATCH 329/461] Do not add variables to json if not present (#7048) --- src/serialization/MeshPacketSerializer.cpp | 111 +++++++++++++----- .../MeshPacketSerializer_nRF52.cpp | 110 ++++++++++++----- 2 files changed, 167 insertions(+), 54 deletions(-) diff --git a/src/serialization/MeshPacketSerializer.cpp b/src/serialization/MeshPacketSerializer.cpp index 2c1dc0ca7..fc8531298 100644 --- a/src/serialization/MeshPacketSerializer.cpp +++ b/src/serialization/MeshPacketSerializer.cpp @@ -61,40 +61,97 @@ std::string MeshPacketSerializer::JsonSerialize(const meshtastic_MeshPacket *mp, if (pb_decode_from_bytes(mp->decoded.payload.bytes, mp->decoded.payload.size, &meshtastic_Telemetry_msg, &scratch)) { decoded = &scratch; if (decoded->which_variant == meshtastic_Telemetry_device_metrics_tag) { - msgPayload["battery_level"] = new JSONValue((unsigned int)decoded->variant.device_metrics.battery_level); + // If battery is present, encode the battery level value + // TODO - Add a condition to send a code for a non-present value + if (decoded->variant.device_metrics.has_battery_level) { + msgPayload["battery_level"] = new JSONValue((int)decoded->variant.device_metrics.battery_level); + } msgPayload["voltage"] = new JSONValue(decoded->variant.device_metrics.voltage); msgPayload["channel_utilization"] = new JSONValue(decoded->variant.device_metrics.channel_utilization); msgPayload["air_util_tx"] = new JSONValue(decoded->variant.device_metrics.air_util_tx); msgPayload["uptime_seconds"] = new JSONValue((unsigned int)decoded->variant.device_metrics.uptime_seconds); } else if (decoded->which_variant == meshtastic_Telemetry_environment_metrics_tag) { - msgPayload["temperature"] = new JSONValue(decoded->variant.environment_metrics.temperature); - msgPayload["relative_humidity"] = new JSONValue(decoded->variant.environment_metrics.relative_humidity); - msgPayload["barometric_pressure"] = new JSONValue(decoded->variant.environment_metrics.barometric_pressure); - msgPayload["gas_resistance"] = new JSONValue(decoded->variant.environment_metrics.gas_resistance); - msgPayload["voltage"] = new JSONValue(decoded->variant.environment_metrics.voltage); - msgPayload["current"] = new JSONValue(decoded->variant.environment_metrics.current); - msgPayload["lux"] = new JSONValue(decoded->variant.environment_metrics.lux); - msgPayload["white_lux"] = new JSONValue(decoded->variant.environment_metrics.white_lux); - msgPayload["iaq"] = new JSONValue((uint)decoded->variant.environment_metrics.iaq); - msgPayload["wind_speed"] = new JSONValue(decoded->variant.environment_metrics.wind_speed); - msgPayload["wind_direction"] = new JSONValue((uint)decoded->variant.environment_metrics.wind_direction); - msgPayload["wind_gust"] = new JSONValue(decoded->variant.environment_metrics.wind_gust); - msgPayload["wind_lull"] = new JSONValue(decoded->variant.environment_metrics.wind_lull); - msgPayload["radiation"] = new JSONValue(decoded->variant.environment_metrics.radiation); + // Avoid sending 0s for sensors that could be 0 + if (decoded->variant.environment_metrics.has_temperature) { + msgPayload["temperature"] = new JSONValue(decoded->variant.environment_metrics.temperature); + } + if (decoded->variant.environment_metrics.has_relative_humidity) { + msgPayload["relative_humidity"] = new JSONValue(decoded->variant.environment_metrics.relative_humidity); + } + if (decoded->variant.environment_metrics.has_barometric_pressure) { + msgPayload["barometric_pressure"] = new JSONValue(decoded->variant.environment_metrics.barometric_pressure); + } + if (decoded->variant.environment_metrics.has_gas_resistance) { + msgPayload["gas_resistance"] = new JSONValue(decoded->variant.environment_metrics.gas_resistance); + } + if (decoded->variant.environment_metrics.has_voltage) { + msgPayload["voltage"] = new JSONValue(decoded->variant.environment_metrics.voltage); + } + if (decoded->variant.environment_metrics.has_current) { + msgPayload["current"] = new JSONValue(decoded->variant.environment_metrics.current); + } + if (decoded->variant.environment_metrics.has_lux) { + msgPayload["lux"] = new JSONValue(decoded->variant.environment_metrics.lux); + } + if (decoded->variant.environment_metrics.has_white_lux) { + msgPayload["white_lux"] = new JSONValue(decoded->variant.environment_metrics.white_lux); + } + if (decoded->variant.environment_metrics.has_iaq) { + msgPayload["iaq"] = new JSONValue((uint)decoded->variant.environment_metrics.iaq); + } + if (decoded->variant.environment_metrics.has_wind_speed) { + msgPayload["wind_speed"] = new JSONValue(decoded->variant.environment_metrics.wind_speed); + } + if (decoded->variant.environment_metrics.has_wind_direction) { + msgPayload["wind_direction"] = new JSONValue((uint)decoded->variant.environment_metrics.wind_direction); + } + if (decoded->variant.environment_metrics.has_wind_gust) { + msgPayload["wind_gust"] = new JSONValue(decoded->variant.environment_metrics.wind_gust); + } + if (decoded->variant.environment_metrics.has_wind_lull) { + msgPayload["wind_lull"] = new JSONValue(decoded->variant.environment_metrics.wind_lull); + } + if (decoded->variant.environment_metrics.has_radiation) { + msgPayload["radiation"] = new JSONValue(decoded->variant.environment_metrics.radiation); + } } else if (decoded->which_variant == meshtastic_Telemetry_air_quality_metrics_tag) { - msgPayload["pm10"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm10_standard); - msgPayload["pm25"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm25_standard); - msgPayload["pm100"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm100_standard); - msgPayload["pm10_e"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm10_environmental); - msgPayload["pm25_e"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm25_environmental); - msgPayload["pm100_e"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm100_environmental); + if (decoded->variant.air_quality_metrics.has_pm10_standard) { + msgPayload["pm10"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm10_standard); + } + if (decoded->variant.air_quality_metrics.has_pm25_standard) { + msgPayload["pm25"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm25_standard); + } + if (decoded->variant.air_quality_metrics.has_pm100_standard) { + msgPayload["pm100"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm100_standard); + } + if (decoded->variant.air_quality_metrics.has_pm10_environmental) { + msgPayload["pm10_e"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm10_environmental); + } + if (decoded->variant.air_quality_metrics.has_pm25_environmental) { + msgPayload["pm25_e"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm25_environmental); + } + if (decoded->variant.air_quality_metrics.has_pm100_environmental) { + msgPayload["pm100_e"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm100_environmental); + } } else if (decoded->which_variant == meshtastic_Telemetry_power_metrics_tag) { - msgPayload["voltage_ch1"] = new JSONValue(decoded->variant.power_metrics.ch1_voltage); - msgPayload["current_ch1"] = new JSONValue(decoded->variant.power_metrics.ch1_current); - msgPayload["voltage_ch2"] = new JSONValue(decoded->variant.power_metrics.ch2_voltage); - msgPayload["current_ch2"] = new JSONValue(decoded->variant.power_metrics.ch2_current); - msgPayload["voltage_ch3"] = new JSONValue(decoded->variant.power_metrics.ch3_voltage); - msgPayload["current_ch3"] = new JSONValue(decoded->variant.power_metrics.ch3_current); + if (decoded->variant.power_metrics.has_ch1_voltage) { + msgPayload["voltage_ch1"] = new JSONValue(decoded->variant.power_metrics.ch1_voltage); + } + if (decoded->variant.power_metrics.has_ch1_current) { + msgPayload["current_ch1"] = new JSONValue(decoded->variant.power_metrics.ch1_current); + } + if (decoded->variant.power_metrics.has_ch2_voltage) { + msgPayload["voltage_ch2"] = new JSONValue(decoded->variant.power_metrics.ch2_voltage); + } + if (decoded->variant.power_metrics.has_ch2_current) { + msgPayload["current_ch2"] = new JSONValue(decoded->variant.power_metrics.ch2_current); + } + if (decoded->variant.power_metrics.has_ch3_voltage) { + msgPayload["voltage_ch3"] = new JSONValue(decoded->variant.power_metrics.ch3_voltage); + } + if (decoded->variant.power_metrics.has_ch3_current) { + msgPayload["current_ch3"] = new JSONValue(decoded->variant.power_metrics.ch3_current); + } } jsonObj["payload"] = new JSONValue(msgPayload); } else if (shouldLog) { diff --git a/src/serialization/MeshPacketSerializer_nRF52.cpp b/src/serialization/MeshPacketSerializer_nRF52.cpp index 89ecddfad..e0daa1a88 100644 --- a/src/serialization/MeshPacketSerializer_nRF52.cpp +++ b/src/serialization/MeshPacketSerializer_nRF52.cpp @@ -58,40 +58,96 @@ std::string MeshPacketSerializer::JsonSerialize(const meshtastic_MeshPacket *mp, if (pb_decode_from_bytes(mp->decoded.payload.bytes, mp->decoded.payload.size, &meshtastic_Telemetry_msg, &scratch)) { decoded = &scratch; if (decoded->which_variant == meshtastic_Telemetry_device_metrics_tag) { - jsonObj["payload"]["battery_level"] = (unsigned int)decoded->variant.device_metrics.battery_level; + // If battery is present, encode the battery level value + // TODO - Add a condition to send a code for a non-present value + if (decoded->variant.device_metrics.has_battery_level) { + jsonObj["payload"]["battery_level"] = (int)decoded->variant.device_metrics.battery_level; + } jsonObj["payload"]["voltage"] = decoded->variant.device_metrics.voltage; jsonObj["payload"]["channel_utilization"] = decoded->variant.device_metrics.channel_utilization; jsonObj["payload"]["air_util_tx"] = decoded->variant.device_metrics.air_util_tx; jsonObj["payload"]["uptime_seconds"] = (unsigned int)decoded->variant.device_metrics.uptime_seconds; } else if (decoded->which_variant == meshtastic_Telemetry_environment_metrics_tag) { - jsonObj["payload"]["temperature"] = decoded->variant.environment_metrics.temperature; - jsonObj["payload"]["relative_humidity"] = decoded->variant.environment_metrics.relative_humidity; - jsonObj["payload"]["barometric_pressure"] = decoded->variant.environment_metrics.barometric_pressure; - jsonObj["payload"]["gas_resistance"] = decoded->variant.environment_metrics.gas_resistance; - jsonObj["payload"]["voltage"] = decoded->variant.environment_metrics.voltage; - jsonObj["payload"]["current"] = decoded->variant.environment_metrics.current; - jsonObj["payload"]["lux"] = decoded->variant.environment_metrics.lux; - jsonObj["payload"]["white_lux"] = decoded->variant.environment_metrics.white_lux; - jsonObj["payload"]["iaq"] = (uint)decoded->variant.environment_metrics.iaq; - jsonObj["payload"]["wind_speed"] = decoded->variant.environment_metrics.wind_speed; - jsonObj["payload"]["wind_direction"] = (uint)decoded->variant.environment_metrics.wind_direction; - jsonObj["payload"]["wind_gust"] = decoded->variant.environment_metrics.wind_gust; - jsonObj["payload"]["wind_lull"] = decoded->variant.environment_metrics.wind_lull; - jsonObj["payload"]["radiation"] = decoded->variant.environment_metrics.radiation; + if (decoded->variant.environment_metrics.has_temperature) { + jsonObj["payload"]["temperature"] = decoded->variant.environment_metrics.temperature; + } + if (decoded->variant.environment_metrics.has_relative_humidity) { + jsonObj["payload"]["relative_humidity"] = decoded->variant.environment_metrics.relative_humidity; + } + if (decoded->variant.environment_metrics.has_barometric_pressure) { + jsonObj["payload"]["barometric_pressure"] = decoded->variant.environment_metrics.barometric_pressure; + } + if (decoded->variant.environment_metrics.has_gas_resistance) { + jsonObj["payload"]["gas_resistance"] = decoded->variant.environment_metrics.gas_resistance; + } + if (decoded->variant.environment_metrics.has_voltage) { + jsonObj["payload"]["voltage"] = decoded->variant.environment_metrics.voltage; + } + if (decoded->variant.environment_metrics.has_current) { + jsonObj["payload"]["current"] = decoded->variant.environment_metrics.current; + } + if (decoded->variant.environment_metrics.has_lux) { + jsonObj["payload"]["lux"] = decoded->variant.environment_metrics.lux; + } + if (decoded->variant.environment_metrics.has_white_lux) { + jsonObj["payload"]["white_lux"] = decoded->variant.environment_metrics.white_lux; + } + if (decoded->variant.environment_metrics.has_iaq) { + jsonObj["payload"]["iaq"] = (uint)decoded->variant.environment_metrics.iaq; + } + if (decoded->variant.environment_metrics.has_wind_speed) { + jsonObj["payload"]["wind_speed"] = decoded->variant.environment_metrics.wind_speed; + } + if (decoded->variant.environment_metrics.has_wind_direction) { + jsonObj["payload"]["wind_direction"] = (uint)decoded->variant.environment_metrics.wind_direction; + } + if (decoded->variant.environment_metrics.has_wind_gust) { + jsonObj["payload"]["wind_gust"] = decoded->variant.environment_metrics.wind_gust; + } + if (decoded->variant.environment_metrics.has_wind_lull) { + jsonObj["payload"]["wind_lull"] = decoded->variant.environment_metrics.wind_lull; + } + if (decoded->variant.environment_metrics.has_radiation) { + jsonObj["payload"]["radiation"] = decoded->variant.environment_metrics.radiation; + } } else if (decoded->which_variant == meshtastic_Telemetry_air_quality_metrics_tag) { - jsonObj["payload"]["pm10"] = (unsigned int)decoded->variant.air_quality_metrics.pm10_standard; - jsonObj["payload"]["pm25"] = (unsigned int)decoded->variant.air_quality_metrics.pm25_standard; - jsonObj["payload"]["pm100"] = (unsigned int)decoded->variant.air_quality_metrics.pm100_standard; - jsonObj["payload"]["pm10_e"] = (unsigned int)decoded->variant.air_quality_metrics.pm10_environmental; - jsonObj["payload"]["pm25_e"] = (unsigned int)decoded->variant.air_quality_metrics.pm25_environmental; - jsonObj["payload"]["pm100_e"] = (unsigned int)decoded->variant.air_quality_metrics.pm100_environmental; + if (decoded->variant.air_quality_metrics.has_pm10_standard) { + jsonObj["payload"]["pm10"] = (unsigned int)decoded->variant.air_quality_metrics.pm10_standard; + } + if (decoded->variant.air_quality_metrics.has_pm25_standard) { + jsonObj["payload"]["pm25"] = (unsigned int)decoded->variant.air_quality_metrics.pm25_standard; + } + if (decoded->variant.air_quality_metrics.has_pm100_standard) { + jsonObj["payload"]["pm100"] = (unsigned int)decoded->variant.air_quality_metrics.pm100_standard; + } + if (decoded->variant.air_quality_metrics.has_pm10_environmental) { + jsonObj["payload"]["pm10_e"] = (unsigned int)decoded->variant.air_quality_metrics.pm10_environmental; + } + if (decoded->variant.air_quality_metrics.has_pm25_environmental) { + jsonObj["payload"]["pm25_e"] = (unsigned int)decoded->variant.air_quality_metrics.pm25_environmental; + } + if (decoded->variant.air_quality_metrics.has_pm100_environmental) { + jsonObj["payload"]["pm100_e"] = (unsigned int)decoded->variant.air_quality_metrics.pm100_environmental; + } } else if (decoded->which_variant == meshtastic_Telemetry_power_metrics_tag) { - jsonObj["payload"]["voltage_ch1"] = decoded->variant.power_metrics.ch1_voltage; - jsonObj["payload"]["current_ch1"] = decoded->variant.power_metrics.ch1_current; - jsonObj["payload"]["voltage_ch2"] = decoded->variant.power_metrics.ch2_voltage; - jsonObj["payload"]["current_ch2"] = decoded->variant.power_metrics.ch2_current; - jsonObj["payload"]["voltage_ch3"] = decoded->variant.power_metrics.ch3_voltage; - jsonObj["payload"]["current_ch3"] = decoded->variant.power_metrics.ch3_current; + if (decoded->variant.power_metrics.has_ch1_voltage) { + jsonObj["payload"]["voltage_ch1"] = decoded->variant.power_metrics.ch1_voltage; + } + if (decoded->variant.power_metrics.has_ch1_current) { + jsonObj["payload"]["current_ch1"] = decoded->variant.power_metrics.ch1_current; + } + if (decoded->variant.power_metrics.has_ch2_voltage) { + jsonObj["payload"]["voltage_ch2"] = decoded->variant.power_metrics.ch2_voltage; + } + if (decoded->variant.power_metrics.has_ch2_current) { + jsonObj["payload"]["current_ch2"] = decoded->variant.power_metrics.ch2_current; + } + if (decoded->variant.power_metrics.has_ch3_voltage) { + jsonObj["payload"]["voltage_ch3"] = decoded->variant.power_metrics.ch3_voltage; + } + if (decoded->variant.power_metrics.has_ch3_current) { + jsonObj["payload"]["current_ch3"] = decoded->variant.power_metrics.ch3_current; + } } } else if (shouldLog) { LOG_ERROR("Error decoding proto for telemetry message!"); From 7a38368494b7daa45a5326fd4bd74b46e142f8e8 Mon Sep 17 00:00:00 2001 From: whywilson Date: Mon, 16 Jun 2025 23:18:45 +0800 Subject: [PATCH 330/461] Optimize key event processing and add debounce logic. --- src/input/UpDownInterruptBase.cpp | 24 ++++++++++++++++-------- src/input/UpDownInterruptBase.h | 6 ++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/input/UpDownInterruptBase.cpp b/src/input/UpDownInterruptBase.cpp index 9a95323fe..44eae5dbb 100644 --- a/src/input/UpDownInterruptBase.cpp +++ b/src/input/UpDownInterruptBase.cpp @@ -33,16 +33,25 @@ int32_t UpDownInterruptBase::runOnce() { InputEvent e; e.inputEvent = INPUT_BROKER_NONE; - + unsigned long now = millis(); if (this->action == UPDOWN_ACTION_PRESSED) { - LOG_DEBUG("GPIO event Press"); - e.inputEvent = this->_eventPressed; + if (now - lastPressKeyTime >= PRESS_DEBOUNCE_MS) { + lastPressKeyTime = now; + LOG_DEBUG("GPIO event Press"); + e.inputEvent = this->_eventPressed; + } } else if (this->action == UPDOWN_ACTION_UP) { - LOG_DEBUG("GPIO event Up"); - e.inputEvent = this->_eventUp; + if (now - lastUpKeyTime >= UPDOWN_DEBOUNCE_MS) { + lastUpKeyTime = now; + LOG_DEBUG("GPIO event Up"); + e.inputEvent = this->_eventUp; + } } else if (this->action == UPDOWN_ACTION_DOWN) { - LOG_DEBUG("GPIO event Down"); - e.inputEvent = this->_eventDown; + if (now - lastDownKeyTime >= UPDOWN_DEBOUNCE_MS) { + lastDownKeyTime = now; + LOG_DEBUG("GPIO event Down"); + e.inputEvent = this->_eventDown; + } } if (e.inputEvent != INPUT_BROKER_NONE) { @@ -52,7 +61,6 @@ int32_t UpDownInterruptBase::runOnce() } this->action = UPDOWN_ACTION_NONE; - return 100; } diff --git a/src/input/UpDownInterruptBase.h b/src/input/UpDownInterruptBase.h index 4e9f591b9..57e42a76a 100644 --- a/src/input/UpDownInterruptBase.h +++ b/src/input/UpDownInterruptBase.h @@ -27,4 +27,10 @@ class UpDownInterruptBase : public Observable, public concur input_broker_event _eventUp = INPUT_BROKER_NONE; input_broker_event _eventPressed = INPUT_BROKER_NONE; const char *_originName; + + unsigned long lastUpKeyTime = 0; + unsigned long lastDownKeyTime = 0; + unsigned long lastPressKeyTime = 0; + const unsigned long UPDOWN_DEBOUNCE_MS = 300; + const unsigned long PRESS_DEBOUNCE_MS = 500; }; From 8ba98ae8733556af45c741835b1a0f6284e9736a Mon Sep 17 00:00:00 2001 From: whywilson Date: Tue, 17 Jun 2025 06:05:45 +0800 Subject: [PATCH 331/461] Add a debounce time parameter and use it in the runOnce method to debounce the key. --- src/input/UpDownInterruptBase.cpp | 8 ++++---- src/input/UpDownInterruptBase.h | 6 +++--- src/input/UpDownInterruptImpl1.cpp | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/input/UpDownInterruptBase.cpp b/src/input/UpDownInterruptBase.cpp index 44eae5dbb..c66eb13d0 100644 --- a/src/input/UpDownInterruptBase.cpp +++ b/src/input/UpDownInterruptBase.cpp @@ -8,7 +8,7 @@ UpDownInterruptBase::UpDownInterruptBase(const char *name) : concurrency::OSThre void UpDownInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinPress, input_broker_event eventDown, input_broker_event eventUp, input_broker_event eventPressed, void (*onIntDown)(), - void (*onIntUp)(), void (*onIntPress)()) + void (*onIntUp)(), void (*onIntPress)(), unsigned long updownDebounceMs) { this->_pinDown = pinDown; this->_pinUp = pinUp; @@ -35,19 +35,19 @@ int32_t UpDownInterruptBase::runOnce() e.inputEvent = INPUT_BROKER_NONE; unsigned long now = millis(); if (this->action == UPDOWN_ACTION_PRESSED) { - if (now - lastPressKeyTime >= PRESS_DEBOUNCE_MS) { + if (now - lastPressKeyTime >= pressDebounceMs) { lastPressKeyTime = now; LOG_DEBUG("GPIO event Press"); e.inputEvent = this->_eventPressed; } } else if (this->action == UPDOWN_ACTION_UP) { - if (now - lastUpKeyTime >= UPDOWN_DEBOUNCE_MS) { + if (now - lastUpKeyTime >= updownDebounceMs) { lastUpKeyTime = now; LOG_DEBUG("GPIO event Up"); e.inputEvent = this->_eventUp; } } else if (this->action == UPDOWN_ACTION_DOWN) { - if (now - lastDownKeyTime >= UPDOWN_DEBOUNCE_MS) { + if (now - lastDownKeyTime >= updownDebounceMs) { lastDownKeyTime = now; LOG_DEBUG("GPIO event Down"); e.inputEvent = this->_eventDown; diff --git a/src/input/UpDownInterruptBase.h b/src/input/UpDownInterruptBase.h index 57e42a76a..d4a39a0e4 100644 --- a/src/input/UpDownInterruptBase.h +++ b/src/input/UpDownInterruptBase.h @@ -8,7 +8,7 @@ class UpDownInterruptBase : public Observable, public concur public: explicit UpDownInterruptBase(const char *name); void init(uint8_t pinDown, uint8_t pinUp, uint8_t pinPress, input_broker_event eventDown, input_broker_event eventUp, - input_broker_event eventPressed, void (*onIntDown)(), void (*onIntUp)(), void (*onIntPress)()); + input_broker_event eventPressed, void (*onIntDown)(), void (*onIntUp)(), void (*onIntPress)(), unsigned long updownDebounceMs = 300); void intPressHandler(); void intDownHandler(); void intUpHandler(); @@ -31,6 +31,6 @@ class UpDownInterruptBase : public Observable, public concur unsigned long lastUpKeyTime = 0; unsigned long lastDownKeyTime = 0; unsigned long lastPressKeyTime = 0; - const unsigned long UPDOWN_DEBOUNCE_MS = 300; - const unsigned long PRESS_DEBOUNCE_MS = 500; + unsigned long updownDebounceMs = 300; + const unsigned long pressDebounceMs = 500; }; diff --git a/src/input/UpDownInterruptImpl1.cpp b/src/input/UpDownInterruptImpl1.cpp index 761b92348..847724ec7 100644 --- a/src/input/UpDownInterruptImpl1.cpp +++ b/src/input/UpDownInterruptImpl1.cpp @@ -21,8 +21,9 @@ bool UpDownInterruptImpl1::init() input_broker_event eventUp = INPUT_BROKER_UP; input_broker_event eventPressed = INPUT_BROKER_SELECT; + unsigned long debounceMs = moduleConfig.canned_message.rotary1_enabled ? 100 : 300; UpDownInterruptBase::init(pinDown, pinUp, pinPress, eventDown, eventUp, eventPressed, UpDownInterruptImpl1::handleIntDown, - UpDownInterruptImpl1::handleIntUp, UpDownInterruptImpl1::handleIntPressed); + UpDownInterruptImpl1::handleIntUp, UpDownInterruptImpl1::handleIntPressed, debounceMs); inputBroker->registerSource(this); return true; } From e1df4e19e5c9c1cd5670123a58b8d292af6ee237 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 21 Jun 2025 20:47:11 -0500 Subject: [PATCH 332/461] Default to very short updownDebounce values --- src/input/UpDownInterruptBase.h | 9 +++++---- src/input/UpDownInterruptImpl1.cpp | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/input/UpDownInterruptBase.h b/src/input/UpDownInterruptBase.h index d4a39a0e4..789ba2310 100644 --- a/src/input/UpDownInterruptBase.h +++ b/src/input/UpDownInterruptBase.h @@ -8,7 +8,8 @@ class UpDownInterruptBase : public Observable, public concur public: explicit UpDownInterruptBase(const char *name); void init(uint8_t pinDown, uint8_t pinUp, uint8_t pinPress, input_broker_event eventDown, input_broker_event eventUp, - input_broker_event eventPressed, void (*onIntDown)(), void (*onIntUp)(), void (*onIntPress)(), unsigned long updownDebounceMs = 300); + input_broker_event eventPressed, void (*onIntDown)(), void (*onIntUp)(), void (*onIntPress)(), + unsigned long updownDebounceMs = 50); void intPressHandler(); void intDownHandler(); void intUpHandler(); @@ -27,10 +28,10 @@ class UpDownInterruptBase : public Observable, public concur input_broker_event _eventUp = INPUT_BROKER_NONE; input_broker_event _eventPressed = INPUT_BROKER_NONE; const char *_originName; - + unsigned long lastUpKeyTime = 0; unsigned long lastDownKeyTime = 0; unsigned long lastPressKeyTime = 0; - unsigned long updownDebounceMs = 300; - const unsigned long pressDebounceMs = 500; + unsigned long updownDebounceMs; + const unsigned long pressDebounceMs = 200; }; diff --git a/src/input/UpDownInterruptImpl1.cpp b/src/input/UpDownInterruptImpl1.cpp index 847724ec7..761b92348 100644 --- a/src/input/UpDownInterruptImpl1.cpp +++ b/src/input/UpDownInterruptImpl1.cpp @@ -21,9 +21,8 @@ bool UpDownInterruptImpl1::init() input_broker_event eventUp = INPUT_BROKER_UP; input_broker_event eventPressed = INPUT_BROKER_SELECT; - unsigned long debounceMs = moduleConfig.canned_message.rotary1_enabled ? 100 : 300; UpDownInterruptBase::init(pinDown, pinUp, pinPress, eventDown, eventUp, eventPressed, UpDownInterruptImpl1::handleIntDown, - UpDownInterruptImpl1::handleIntUp, UpDownInterruptImpl1::handleIntPressed, debounceMs); + UpDownInterruptImpl1::handleIntUp, UpDownInterruptImpl1::handleIntPressed); inputBroker->registerSource(this); return true; } From 0108ad79924ce7e4127bcff65767d7544ecaa10c Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 21 Jun 2025 23:17:10 -0500 Subject: [PATCH 333/461] Don't write the config unless the setting changed --- src/graphics/Screen.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 975cf71a9..b2087bf4e 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1289,12 +1289,13 @@ int Screen::handleInputEvent(const InputEvent *event) config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_ENABLED; playGPSEnableBeep(); gps->enable(); + service->reloadConfig(SEGMENT_CONFIG); } else if (selected == 2) { config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_DISABLED; playGPSDisableBeep(); gps->disable(); + service->reloadConfig(SEGMENT_CONFIG); } - service->reloadConfig(SEGMENT_CONFIG); }, config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED ? 1 : 2); // set inital selection @@ -1479,9 +1480,10 @@ void Screen::TZPicker() } else if (selected == 16) { // NZ strncpy(config.device.tzdef, "NZST-12NZDT,M9.5.0,M4.1.0/3", sizeof(config.device.tzdef)); } - - setenv("TZ", config.device.tzdef, 1); - service->reloadConfig(SEGMENT_CONFIG); + if (selected != 0) { + setenv("TZ", config.device.tzdef, 1); + service->reloadConfig(SEGMENT_CONFIG); + } }); } From ce1480df98c5edbcb1bd6ba66ef871a97efd2807 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 21 Jun 2025 23:56:14 -0500 Subject: [PATCH 334/461] Initialize value to fix warning --- src/input/UpDownInterruptBase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input/UpDownInterruptBase.h b/src/input/UpDownInterruptBase.h index 789ba2310..a83a298f2 100644 --- a/src/input/UpDownInterruptBase.h +++ b/src/input/UpDownInterruptBase.h @@ -32,6 +32,6 @@ class UpDownInterruptBase : public Observable, public concur unsigned long lastUpKeyTime = 0; unsigned long lastDownKeyTime = 0; unsigned long lastPressKeyTime = 0; - unsigned long updownDebounceMs; + unsigned long updownDebounceMs = 50; const unsigned long pressDebounceMs = 200; }; From 4308bbc156c81a240f31c1860fd792264f5b755f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 22 Jun 2025 05:54:32 -0500 Subject: [PATCH 335/461] automated bumps (#7097) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 7 +++++-- version.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 4b07f6388..f9f647dae 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.1 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.0 diff --git a/debian/changelog b/debian/changelog index d607be68c..4629e8c3a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.7.0.0) UNRELEASED; urgency=medium +meshtasticd (2.7.1.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging @@ -22,4 +22,7 @@ meshtasticd (2.7.0.0) UNRELEASED; urgency=medium [ ] * GitHub Actions Automatic version bump - -- Mon, 16 Jun 2025 02:10:49 +0000 + [ ] + * GitHub Actions Automatic version bump + + -- Sat, 21 Jun 2025 15:51:49 +0000 diff --git a/version.properties b/version.properties index 91c81a0c9..3fe1aa385 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 7 -build = 0 +build = 1 From 247e05bb10ff93520b17b44b0705381ef48ff4bc Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 22 Jun 2025 16:59:04 -0500 Subject: [PATCH 336/461] Get the unphone to stop bootlooping: increase MAX_THREADS everywhere (#7106) --- platformio.ini | 1 + variants/heltec_vision_master_e213/platformio.ini | 1 - variants/heltec_vision_master_e290/platformio.ini | 1 - variants/heltec_wireless_paper/platformio.ini | 1 - variants/mesh-tab/platformio.ini | 1 - variants/t-deck/platformio.ini | 1 - variants/tlora_t3s3_epaper/platformio.ini | 1 - variants/unphone/variant.h | 3 +-- 8 files changed, 2 insertions(+), 8 deletions(-) diff --git a/platformio.ini b/platformio.ini index debc77a92..5a95648bc 100644 --- a/platformio.ini +++ b/platformio.ini @@ -51,6 +51,7 @@ build_flags = -Wno-missing-field-initializers -DMESHTASTIC_EXCLUDE_HEALTH_TELEMETRY=1 -DMESHTASTIC_EXCLUDE_POWERSTRESS=1 ; exclude power stress test module from main firmware -DMESHTASTIC_EXCLUDE_GENERIC_THREAD_MODULE=1 + -D MAX_THREADS=40 ; As we've split modules, we have more threads to manage #-DBUILD_EPOCH=$UNIX_TIME #-D OLED_PL=1 diff --git a/variants/heltec_vision_master_e213/platformio.ini b/variants/heltec_vision_master_e213/platformio.ini index 037d10168..34cebb6e3 100644 --- a/variants/heltec_vision_master_e213/platformio.ini +++ b/variants/heltec_vision_master_e213/platformio.ini @@ -32,7 +32,6 @@ build_flags = ${inkhud.build_flags} -I variants/heltec_vision_master_e213 -D HELTEC_VISION_MASTER_E213 - -D MAX_THREADS=40 ; Required if used with WiFi lib_deps = ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX ${esp32s3_base.lib_deps} diff --git a/variants/heltec_vision_master_e290/platformio.ini b/variants/heltec_vision_master_e290/platformio.ini index 6952e9f9e..cda3fde00 100644 --- a/variants/heltec_vision_master_e290/platformio.ini +++ b/variants/heltec_vision_master_e290/platformio.ini @@ -36,7 +36,6 @@ build_flags = ${inkhud.build_flags} -I variants/heltec_vision_master_e290 -D HELTEC_VISION_MASTER_E290 - -D MAX_THREADS=40 ; Required if used with WiFi lib_deps = ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX ${esp32s3_base.lib_deps} diff --git a/variants/heltec_wireless_paper/platformio.ini b/variants/heltec_wireless_paper/platformio.ini index 51430ebff..ce5b5e533 100644 --- a/variants/heltec_wireless_paper/platformio.ini +++ b/variants/heltec_wireless_paper/platformio.ini @@ -33,7 +33,6 @@ build_flags = ${inkhud.build_flags} -I variants/heltec_wireless_paper -D HELTEC_WIRELESS_PAPER - -D MAX_THREADS=40 ; Required if used with WiFi lib_deps = ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX ${esp32s3_base.lib_deps} diff --git a/variants/mesh-tab/platformio.ini b/variants/mesh-tab/platformio.ini index 728fa5100..beeb58a48 100644 --- a/variants/mesh-tab/platformio.ini +++ b/variants/mesh-tab/platformio.ini @@ -28,7 +28,6 @@ build_flags = ${esp32s3_base.build_flags} -D USE_LOG_DEBUG -D LOG_DEBUG_INC=\"DebugConfiguration.h\" -D RADIOLIB_SPI_PARANOID=0 - -D MAX_THREADS=40 -D HAS_SCREEN=0 -D HAS_TFT=1 -D USE_PIN_BUZZER diff --git a/variants/t-deck/platformio.ini b/variants/t-deck/platformio.ini index c00ab5e04..04e305abb 100644 --- a/variants/t-deck/platformio.ini +++ b/variants/t-deck/platformio.ini @@ -9,7 +9,6 @@ upload_protocol = esptool build_flags = ${esp32s3_base.build_flags} -DT_DECK -DBOARD_HAS_PSRAM - -DMAX_THREADS=40 -DGPS_POWER_TOGGLE -Ivariants/t-deck diff --git a/variants/tlora_t3s3_epaper/platformio.ini b/variants/tlora_t3s3_epaper/platformio.ini index 957c37b95..0750b5bbb 100644 --- a/variants/tlora_t3s3_epaper/platformio.ini +++ b/variants/tlora_t3s3_epaper/platformio.ini @@ -31,7 +31,6 @@ build_flags = ${inkhud.build_flags} -I variants/tlora_t3s3_epaper -D TLORA_T3S3_EPAPER - -D MAX_THREADS=40 ; Required if used with WiFi lib_deps = ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX ${esp32s3_base.lib_deps} \ No newline at end of file diff --git a/variants/unphone/variant.h b/variants/unphone/variant.h index aef650278..e186b5740 100644 --- a/variants/unphone/variant.h +++ b/variants/unphone/variant.h @@ -57,8 +57,7 @@ #define LED_PIN 13 // the red part of the RGB LED #define LED_STATE_ON 0 // State when LED is lit -#define ALT_BUTTON_PIN 21 // Button 3 - square - top button in landscape mode -#define BUTTON_NEED_PULLUP2 TB_UP +#define ALT_BUTTON_PIN 21 // Button 3 - square - top button in landscape mode #define BUTTON_PIN 0 // Circle button #define BUTTON_NEED_PULLUP // we do need a helping hand up #define CANCEL_BUTTON_PIN 45 // Button 1 - triangle - bottom button in landscape mode From 0808f5215ffa3beb8240349170eca65dfadb5b24 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 22 Jun 2025 18:48:16 -0500 Subject: [PATCH 337/461] fix mismatch between Exclude FSM include names (#7107) --- src/PowerFSM.cpp | 2 +- src/PowerFSM.h | 2 +- src/PowerFSMThread.h | 2 +- src/modules/AdminModule.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PowerFSM.cpp b/src/PowerFSM.cpp index b3a6b17ef..3b3f8080d 100644 --- a/src/PowerFSM.cpp +++ b/src/PowerFSM.cpp @@ -26,7 +26,7 @@ #ifndef SLEEP_TIME #define SLEEP_TIME 30 #endif -#if EXCLUDE_POWER_FSM +#if MESHTASTIC_EXCLUDE_POWER_FSM FakeFsm powerFSM; void PowerFSM_setup(){}; #else diff --git a/src/PowerFSM.h b/src/PowerFSM.h index beb233f11..6330a5fc6 100644 --- a/src/PowerFSM.h +++ b/src/PowerFSM.h @@ -22,7 +22,7 @@ #define EVENT_SHUTDOWN 16 // force a full shutdown now (not just sleep) #define EVENT_INPUT 17 // input broker wants something, we need to wake up and enable screen -#if EXCLUDE_POWER_FSM +#if MESHTASTIC_EXCLUDE_POWER_FSM class FakeFsm { public: diff --git a/src/PowerFSMThread.h b/src/PowerFSMThread.h index c842f4515..135f53298 100644 --- a/src/PowerFSMThread.h +++ b/src/PowerFSMThread.h @@ -18,7 +18,7 @@ class PowerFSMThread : public OSThread protected: int32_t runOnce() override { -#if !EXCLUDE_POWER_FSM +#if !MESHTASTIC_EXCLUDE_POWER_FSM powerFSM.run_machine(); /// If we are in power state we force the CPU to wake every 10ms to check for serial characters (we don't yet wake diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index b68a3a1a4..d489231ad 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -1137,7 +1137,7 @@ void AdminModule::handleGetDeviceConnectionStatus(const meshtastic_MeshPacket &r #endif #endif conn.has_serial = true; // No serial-less devices -#if !EXCLUDE_POWER_FSM +#if !MESHTASTIC_EXCLUDE_POWER_FSM conn.serial.is_connected = powerFSM.getState() == &stateSERIAL; #else conn.serial.is_connected = powerFSM.getState(); From 012f88e56fa13c36a9fee5c0a7d4a680f9db77cb Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 22 Jun 2025 20:57:39 -0500 Subject: [PATCH 338/461] Make the 4-way on the L1 work on press instead of release (#7108) --- src/input/TrackballInterruptBase.cpp | 21 ++++++++--------- src/input/TrackballInterruptBase.h | 14 ++++++++---- src/input/TrackballInterruptImpl1.cpp | 30 ++++++++++++++++++++----- variants/seeed_wio_tracker_L1/variant.h | 1 + 4 files changed, 47 insertions(+), 19 deletions(-) diff --git a/src/input/TrackballInterruptBase.cpp b/src/input/TrackballInterruptBase.cpp index 41045ee8e..d41ad2fd6 100644 --- a/src/input/TrackballInterruptBase.cpp +++ b/src/input/TrackballInterruptBase.cpp @@ -12,6 +12,7 @@ void TrackballInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLef this->_pinUp = pinUp; this->_pinLeft = pinLeft; this->_pinRight = pinRight; + this->_pinPress = pinPress; this->_eventDown = eventDown; this->_eventUp = eventUp; this->_eventLeft = eventLeft; @@ -20,23 +21,23 @@ void TrackballInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLef if (pinPress != 255) { pinMode(pinPress, INPUT_PULLUP); - attachInterrupt(pinPress, onIntPress, RISING); + attachInterrupt(pinPress, onIntPress, TB_DIRECTION); } if (this->_pinDown != 255) { pinMode(this->_pinDown, INPUT_PULLUP); - attachInterrupt(this->_pinDown, onIntDown, RISING); + attachInterrupt(this->_pinDown, onIntDown, TB_DIRECTION); } if (this->_pinUp != 255) { pinMode(this->_pinUp, INPUT_PULLUP); - attachInterrupt(this->_pinUp, onIntUp, RISING); + attachInterrupt(this->_pinUp, onIntUp, TB_DIRECTION); } if (this->_pinLeft != 255) { pinMode(this->_pinLeft, INPUT_PULLUP); - attachInterrupt(this->_pinLeft, onIntLeft, RISING); + attachInterrupt(this->_pinLeft, onIntLeft, TB_DIRECTION); } if (this->_pinRight != 255) { pinMode(this->_pinRight, INPUT_PULLUP); - attachInterrupt(this->_pinRight, onIntRight, RISING); + attachInterrupt(this->_pinRight, onIntRight, TB_DIRECTION); } LOG_DEBUG("Trackball GPIO initialized (%d, %d, %d, %d, %d)", this->_pinUp, this->_pinDown, this->_pinLeft, this->_pinRight, @@ -67,19 +68,19 @@ int32_t TrackballInterruptBase::runOnce() e.inputEvent = this->_eventRight; } #else - if (this->action == TB_ACTION_PRESSED) { + if (this->action == TB_ACTION_PRESSED && !digitalRead(_pinPress)) { // LOG_DEBUG("Trackball event Press"); e.inputEvent = this->_eventPressed; - } else if (this->action == TB_ACTION_UP) { + } else if (this->action == TB_ACTION_UP && !digitalRead(_pinUp)) { // LOG_DEBUG("Trackball event UP"); e.inputEvent = this->_eventUp; - } else if (this->action == TB_ACTION_DOWN) { + } else if (this->action == TB_ACTION_DOWN && !digitalRead(_pinDown)) { // LOG_DEBUG("Trackball event DOWN"); e.inputEvent = this->_eventDown; - } else if (this->action == TB_ACTION_LEFT) { + } else if (this->action == TB_ACTION_LEFT && !digitalRead(_pinLeft)) { // LOG_DEBUG("Trackball event LEFT"); e.inputEvent = this->_eventLeft; - } else if (this->action == TB_ACTION_RIGHT) { + } else if (this->action == TB_ACTION_RIGHT && !digitalRead(_pinRight)) { // LOG_DEBUG("Trackball event RIGHT"); e.inputEvent = this->_eventRight; } diff --git a/src/input/TrackballInterruptBase.h b/src/input/TrackballInterruptBase.h index dac31a137..2397839b9 100644 --- a/src/input/TrackballInterruptBase.h +++ b/src/input/TrackballInterruptBase.h @@ -3,6 +3,10 @@ #include "InputBroker.h" #include "mesh/NodeDB.h" +#ifndef TB_DIRECTION +#define TB_DIRECTION RISING +#endif + class TrackballInterruptBase : public Observable, public concurrency::OSThread { public: @@ -16,6 +20,7 @@ class TrackballInterruptBase : public Observable, public con void intUpHandler(); void intLeftHandler(); void intRightHandler(); + uint32_t lastTime = 0; virtual int32_t runOnce() override; @@ -28,14 +33,15 @@ class TrackballInterruptBase : public Observable, public con TB_ACTION_LEFT, TB_ACTION_RIGHT }; - - volatile TrackballInterruptBaseActionType action = TB_ACTION_NONE; - - private: uint8_t _pinDown = 0; uint8_t _pinUp = 0; uint8_t _pinLeft = 0; uint8_t _pinRight = 0; + uint8_t _pinPress = 0; + + volatile TrackballInterruptBaseActionType action = TB_ACTION_NONE; + + private: input_broker_event _eventDown = INPUT_BROKER_NONE; input_broker_event _eventUp = INPUT_BROKER_NONE; input_broker_event _eventLeft = INPUT_BROKER_NONE; diff --git a/src/input/TrackballInterruptImpl1.cpp b/src/input/TrackballInterruptImpl1.cpp index c6d21ac2b..896238f38 100644 --- a/src/input/TrackballInterruptImpl1.cpp +++ b/src/input/TrackballInterruptImpl1.cpp @@ -23,21 +23,41 @@ void TrackballInterruptImpl1::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLe void TrackballInterruptImpl1::handleIntDown() { - trackballInterruptImpl1->intDownHandler(); + if (TB_DIRECTION == RISING || millis() > trackballInterruptImpl1->lastTime + 10) { + trackballInterruptImpl1->lastTime = millis(); + trackballInterruptImpl1->intDownHandler(); + trackballInterruptImpl1->setIntervalFromNow(20); + } } void TrackballInterruptImpl1::handleIntUp() { - trackballInterruptImpl1->intUpHandler(); + if (TB_DIRECTION == RISING || millis() > trackballInterruptImpl1->lastTime + 10) { + trackballInterruptImpl1->lastTime = millis(); + trackballInterruptImpl1->intUpHandler(); + trackballInterruptImpl1->setIntervalFromNow(20); + } } void TrackballInterruptImpl1::handleIntLeft() { - trackballInterruptImpl1->intLeftHandler(); + if (TB_DIRECTION == RISING || millis() > trackballInterruptImpl1->lastTime + 10) { + trackballInterruptImpl1->lastTime = millis(); + trackballInterruptImpl1->intLeftHandler(); + trackballInterruptImpl1->setIntervalFromNow(20); + } } void TrackballInterruptImpl1::handleIntRight() { - trackballInterruptImpl1->intRightHandler(); + if (TB_DIRECTION == RISING || millis() > trackballInterruptImpl1->lastTime + 10) { + trackballInterruptImpl1->lastTime = millis(); + trackballInterruptImpl1->intRightHandler(); + trackballInterruptImpl1->setIntervalFromNow(20); + } } void TrackballInterruptImpl1::handleIntPressed() { - trackballInterruptImpl1->intPressHandler(); + if (TB_DIRECTION == RISING || millis() > trackballInterruptImpl1->lastTime + 10) { + trackballInterruptImpl1->lastTime = millis(); + trackballInterruptImpl1->intPressHandler(); + trackballInterruptImpl1->setIntervalFromNow(20); + } } diff --git a/variants/seeed_wio_tracker_L1/variant.h b/variants/seeed_wio_tracker_L1/variant.h index daa6afb8e..0c5964c5a 100644 --- a/variants/seeed_wio_tracker_L1/variant.h +++ b/variants/seeed_wio_tracker_L1/variant.h @@ -169,6 +169,7 @@ static const uint8_t SCL = PIN_WIRE_SCL; #define TB_LEFT 27 #define TB_RIGHT 28 #define TB_PRESS 29 +#define TB_DIRECTION FALLING // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // Compatibility Definitions // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ From 38896198f2c5291da4bf8e47d385053b0bbd83ab Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 12:04:55 -0500 Subject: [PATCH 339/461] chore(deps): update meshtastic/device-ui digest to cdc6e5b (#7112) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 5a95648bc..abb23fb22 100644 --- a/platformio.ini +++ b/platformio.ini @@ -109,7 +109,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/d99edaf43775c9b235aab20521b034c99e04e4a8.zip + https://github.com/meshtastic/device-ui/archive/cdc6e5bdeedb8293d10e4a02be6ca64e95a7c515.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 4802cef3ca890cf8315b3b8bb4429c164a86774b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 15:56:02 +1000 Subject: [PATCH 340/461] chore(deps): update radiolib to v7.2.0 (#7098) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index abb23fb22..693fdc9c3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -104,7 +104,7 @@ lib_deps = [radiolib_base] lib_deps = # renovate: datasource=custom.pio depName=RadioLib packageName=jgromes/library/RadioLib - jgromes/RadioLib@7.1.2 + jgromes/RadioLib@7.2.0 [device-ui_base] lib_deps = From 91bcf072a080b071a30f90d49b54d24c0264ed11 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 24 Jun 2025 05:27:40 -0500 Subject: [PATCH 341/461] Tweak interval trottling (#7113) --- src/mesh/Default.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mesh/Default.h b/src/mesh/Default.h index 208f992c8..fd3f10668 100644 --- a/src/mesh/Default.h +++ b/src/mesh/Default.h @@ -61,12 +61,17 @@ class Default throttlingFactor = 0.04; else if (config.lora.use_preset && config.lora.modem_preset == meshtastic_Config_LoRaConfig_ModemPreset_MEDIUM_FAST) throttlingFactor = 0.02; - else if (config.lora.use_preset && config.lora.modem_preset == meshtastic_Config_LoRaConfig_ModemPreset_SHORT_SLOW) - throttlingFactor = 0.01; else if (config.lora.use_preset && IS_ONE_OF(config.lora.modem_preset, meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST, - meshtastic_Config_LoRaConfig_ModemPreset_SHORT_TURBO)) - return 1.0; // Don't bother throttling for highest bandwidth presets + meshtastic_Config_LoRaConfig_ModemPreset_SHORT_TURBO, + meshtastic_Config_LoRaConfig_ModemPreset_SHORT_SLOW)) + throttlingFactor = 0.01; + +#if USERPREFS_EVENT_MODE + // If we are in event mode, scale down the throttling factor + throttlingFactor = 0.04; +#endif + // Scaling up traffic based on number of nodes over 40 int nodesOverForty = (numOnlineNodes - 40); return 1.0 + (nodesOverForty * throttlingFactor); // Each number of online node scales by 0.075 (default) From ecfaf3a095b352021eb7731667284863f18d2ce4 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Wed, 25 Jun 2025 23:04:18 +1200 Subject: [PATCH 342/461] Canned Messages via InkHUD menu (#7096) * Allow observers to respond to AdminMessage requests Ground work for CannedMessage getters and setters * Enable CannedMessage config in apps for InkHUD devices * Migrate the InkHUD::Events AdminModule observer Use the new AdminModule_ObserverData struct * Bare-bones NicheGraphics util to access canned messages Handles loading and parsing. Handle admin messages for setting and getting. * Send canned messages via on-screen menu * Change ThreadedMessageApplet from Observer to Module API Allows us to intercept locally generated packets ('loopbackOK = true'), to handle outgoing canned messages. * Fix: crash getting empty canned message string via Client API * Move file into Utils subdir * Move an include statement from .cpp to .h * Limit strncpy size of dest, not source Wasn't critical in ths specific case, but definitely a mistake. --- src/graphics/Screen.cpp | 6 +- src/graphics/Screen.h | 7 +- .../InkHUD/Applets/System/Menu/MenuAction.h | 2 + .../InkHUD/Applets/System/Menu/MenuApplet.cpp | 170 +++++++++++++++++- .../InkHUD/Applets/System/Menu/MenuApplet.h | 41 ++++- .../InkHUD/Applets/System/Menu/MenuPage.h | 1 + .../ThreadedMessage/ThreadedMessageApplet.cpp | 40 ++--- .../ThreadedMessage/ThreadedMessageApplet.h | 9 +- src/graphics/niche/InkHUD/Events.cpp | 10 +- src/graphics/niche/InkHUD/Events.h | 8 +- src/graphics/niche/InkHUD/Persistence.h | 2 +- .../niche/Utils/CannedMessageStore.cpp | 163 +++++++++++++++++ src/graphics/niche/Utils/CannedMessageStore.h | 54 ++++++ src/graphics/niche/{ => Utils}/FlashData.h | 0 src/main.cpp | 2 +- src/modules/AdminModule.cpp | 26 ++- src/modules/AdminModule.h | 11 +- 17 files changed, 498 insertions(+), 54 deletions(-) create mode 100644 src/graphics/niche/Utils/CannedMessageStore.cpp create mode 100644 src/graphics/niche/Utils/CannedMessageStore.h rename src/graphics/niche/{ => Utils}/FlashData.h (100%) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index b2087bf4e..0818619a6 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -58,7 +58,6 @@ along with this program. If not, see . #include "mesh/Channels.h" #include "mesh/generated/meshtastic/deviceonly.pb.h" #include "meshUtils.h" -#include "modules/AdminModule.h" #include "modules/ExternalNotificationModule.h" #include "modules/TextMessageModule.h" #include "modules/WaypointModule.h" @@ -1377,12 +1376,13 @@ int Screen::handleInputEvent(const InputEvent *event) return 0; } -int Screen::handleAdminMessage(const meshtastic_AdminMessage *arg) +int Screen::handleAdminMessage(AdminModule_ObserverData *arg) { - switch (arg->which_payload_variant) { + switch (arg->request->which_payload_variant) { // Node removed manually (i.e. via app) case meshtastic_AdminMessage_remove_by_nodenum_tag: setFrames(FOCUS_PRESERVE); + *arg->result = AdminMessageHandleResult::HANDLED; break; // Default no-op, in case the admin message observable gets used by other classes in future diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index c264f0f07..8a836edfc 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -78,6 +78,7 @@ class Screen #include "concurrency/OSThread.h" #include "input/InputBroker.h" #include "mesh/MeshModule.h" +#include "modules/AdminModule.h" #include "power.h" #include #include @@ -193,8 +194,8 @@ class Screen : public concurrency::OSThread CallbackObserver(this, &Screen::handleUIFrameEvent); // Sent by Mesh Modules CallbackObserver inputObserver = CallbackObserver(this, &Screen::handleInputEvent); - CallbackObserver adminMessageObserver = - CallbackObserver(this, &Screen::handleAdminMessage); + CallbackObserver adminMessageObserver = + CallbackObserver(this, &Screen::handleAdminMessage); public: explicit Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY); @@ -544,7 +545,7 @@ class Screen : public concurrency::OSThread int handleTextMessage(const meshtastic_MeshPacket *arg); int handleUIFrameEvent(const UIFrameEvent *arg); int handleInputEvent(const InputEvent *arg); - int handleAdminMessage(const meshtastic_AdminMessage *arg); + int handleAdminMessage(AdminModule_ObserverData *arg); /// Used to force (super slow) eink displays to draw critical frames void forceDisplay(bool forceUiUpdate = false); diff --git a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h index f162aa385..f42b9dc2c 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h +++ b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h @@ -19,6 +19,8 @@ namespace NicheGraphics::InkHUD enum MenuAction { NO_ACTION, SEND_PING, + STORE_CANNEDMESSAGE_SELECTION, + SEND_CANNEDMESSAGE, SHUTDOWN, NEXT_TILE, TOGGLE_BACKLIGHT, diff --git a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp index 9fdfad8ee..69965972f 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp @@ -5,6 +5,7 @@ #include "RTC.h" #include "MeshService.h" +#include "Router.h" #include "airtime.h" #include "main.h" #include "power.h" @@ -31,6 +32,12 @@ InkHUD::MenuApplet::MenuApplet() : concurrency::OSThread("MenuApplet") if (settings->optionalMenuItems.backlight) { backlight = Drivers::LatchingBacklight::getInstance(); } + + // Initialize the Canned Message store + // This is a shared nicheGraphics component + // - handles loading & parsing the canned messages + // - handles setting / getting of canned messages via apps (Client API Admin Messages) + cm.store = CannedMessageStore::getInstance(); } void InkHUD::MenuApplet::onForeground() @@ -65,6 +72,10 @@ void InkHUD::MenuApplet::onForeground() void InkHUD::MenuApplet::onBackground() { + // Discard any data we generated while selecting a canned message + // Frees heap mem + freeCannedMessageResources(); + // If device has a backlight which isn't controlled by aux button: // Item in options submenu allows keeping backlight on after menu is closed // If this item is deselected we will turn backlight off again, now that menu is closing @@ -153,6 +164,16 @@ void InkHUD::MenuApplet::execute(MenuItem item) inkhud->forceUpdate(Drivers::EInk::UpdateTypes::FULL); break; + case STORE_CANNEDMESSAGE_SELECTION: + cm.selectedMessageItem = &cm.messageItems.at(cursor - 1); // Minus one: offset for the initial "Send Ping" entry + break; + + case SEND_CANNEDMESSAGE: + cm.selectedRecipientItem = &cm.recipientItems.at(cursor); + sendText(cm.selectedRecipientItem->dest, cm.selectedRecipientItem->channelIndex, cm.selectedMessageItem->rawText.c_str()); + inkhud->forceUpdate(Drivers::EInk::UpdateTypes::FULL); // Next refresh should be FULL. Lots of button pressing to get here + break; + case ROTATE: inkhud->rotate(); break; @@ -260,9 +281,11 @@ void InkHUD::MenuApplet::showPage(MenuPage page) break; case SEND: - items.push_back(MenuItem("Ping", MenuAction::SEND_PING, MenuPage::EXIT)); - // Todo: canned messages - items.push_back(MenuItem("Exit", MenuPage::EXIT)); + populateSendPage(); + break; + + case CANNEDMESSAGE_RECIPIENT: + populateRecipientPage(); break; case OPTIONS: @@ -497,6 +520,8 @@ void InkHUD::MenuApplet::populateAutoshowPage() } } +// Create MenuItem entries to select our definition of "Recent" +// Controls how long data will remain in any "Recents" flavored applets void InkHUD::MenuApplet::populateRecentsPage() { // How many values are shown for use to choose from @@ -510,6 +535,112 @@ void InkHUD::MenuApplet::populateRecentsPage() } } +// MenuItem entries for the "send" page +// Dynamically creates menu items based on available canned messages +void InkHUD::MenuApplet::populateSendPage() +{ + // Position / NodeInfo packet + items.push_back(MenuItem("Ping", MenuAction::SEND_PING, MenuPage::EXIT)); + + // One menu item for each canned message + uint8_t count = cm.store->size(); + for (uint8_t i = 0; i < count; i++) { + // Gather the information for this item + CannedMessages::MessageItem messageItem; + messageItem.rawText = cm.store->at(i); + messageItem.label = parse(messageItem.rawText); + + // Store the item (until the menu closes) + cm.messageItems.push_back(messageItem); + + // Create a menu item + const char *itemText = cm.messageItems.back().label.c_str(); + items.push_back(MenuItem(itemText, MenuAction::STORE_CANNEDMESSAGE_SELECTION, MenuPage::CANNEDMESSAGE_RECIPIENT)); + } + + items.push_back(MenuItem("Exit", MenuPage::EXIT)); +} + +// Dynamically create MenuItem entries for possible canned message destinations +// All available channels are shown +// Favorite nodes are shown, provided we don't have an *excessive* amount +void InkHUD::MenuApplet::populateRecipientPage() +{ + // Create recipient data (and menu items) for any channels + // -------------------------------------------------------- + + for (uint8_t i = 0; i < MAX_NUM_CHANNELS; i++) { + // Get the channel, and check if it's enabled + meshtastic_Channel &channel = channels.getByIndex(i); + if (!channel.has_settings || channel.role == meshtastic_Channel_Role_DISABLED) + continue; + + CannedMessages::RecipientItem r; + + // Set index + r.channelIndex = channel.index; + + // Set a label for the menu item + r.label = "Ch " + to_string(i) + ": "; + if (channel.role == meshtastic_Channel_Role_PRIMARY) + r.label += "Primary"; + else + r.label += parse(channel.settings.name); + + // Add to the list of recipients + cm.recipientItems.push_back(r); + + // Add a menu item for this recipient + const char *itemText = cm.recipientItems.back().label.c_str(); + items.push_back(MenuItem(itemText, SEND_CANNEDMESSAGE, MenuPage::EXIT)); + } + + // Create recipient data (and menu items) for favorite nodes + // --------------------------------------------------------- + + uint32_t nodeCount = nodeDB->getNumMeshNodes(); + uint32_t favoriteCount = 0; + + // Count favorites + for (uint32_t i = 0; i < nodeCount; i++) { + if (nodeDB->getMeshNodeByIndex(i)->is_favorite) + favoriteCount++; + } + + // Only add favorites if the number is reasonable + // Don't want some monstrous list that takes 100 clicks to reach exit + if (favoriteCount < 20) { + for (uint32_t i = 0; i < nodeCount; i++) { + meshtastic_NodeInfoLite *node = nodeDB->getMeshNodeByIndex(i); + + // Skip node if not a favorite + if (!node->is_favorite) + continue; + + CannedMessages::RecipientItem r; + + r.dest = node->num; + r.channelIndex = nodeDB->getMeshNodeChannel(node->num); // Channel index only relevant if encrypted DM not possible(?) + + // Set a label for the menu item + r.label = "DM: "; + if (node->has_user) + r.label += parse(node->user.long_name); + else + r.label += hexifyNodeNum(node->num); // Unsure if it's possible to favorite a node without NodeInfo? + + // Add to the list of recipients + cm.recipientItems.push_back(r); + + // Add a menu item for this recipient + const char *itemText = cm.recipientItems.back().label.c_str(); + items.push_back(MenuItem(itemText, SEND_CANNEDMESSAGE, MenuPage::EXIT)); + } + } + + items.push_back(MenuItem("Exit", MenuPage::EXIT)); +} + // Renders the panel shown at the top of the root menu. // Displays the clock, and several other pieces of instantaneous system info, // which we'd prefer not to have displayed in a normal applet, as they update too frequently. @@ -619,4 +750,37 @@ uint16_t InkHUD::MenuApplet::getSystemInfoPanelHeight() return height; } +// Send a text message to the mesh +// Used to send our canned messages +void InkHUD::MenuApplet::sendText(NodeNum dest, ChannelIndex channel, const char *message) +{ + meshtastic_MeshPacket *p = router->allocForSending(); + p->decoded.portnum = meshtastic_PortNum_TEXT_MESSAGE_APP; + p->to = dest; + p->channel = channel; + p->want_ack = true; + p->decoded.payload.size = strlen(message); + memcpy(p->decoded.payload.bytes, message, p->decoded.payload.size); + + // Tack on a bell character if requested + if (moduleConfig.canned_message.send_bell && p->decoded.payload.size < meshtastic_Constants_DATA_PAYLOAD_LEN) { + p->decoded.payload.bytes[p->decoded.payload.size] = 7; // Bell character + p->decoded.payload.bytes[p->decoded.payload.size + 1] = '\0'; // Append Null Terminator + p->decoded.payload.size++; + } + + LOG_INFO("Send message id=%d, dest=%x, msg=%.*s", p->id, p->to, p->decoded.payload.size, p->decoded.payload.bytes); + + service->sendToMesh(p, RX_SRC_LOCAL, true); // Send to mesh, cc to phone +} + +// Free up any heap mmemory we'd used while selecting / sending canned messages +void InkHUD::MenuApplet::freeCannedMessageResources() +{ + cm.selectedMessageItem = nullptr; + cm.selectedRecipientItem = nullptr; + cm.messageItems.clear(); + cm.recipientItems.clear(); +} + #endif \ No newline at end of file diff --git a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.h b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.h index d9297c8ed..4c974672a 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.h +++ b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.h @@ -6,10 +6,12 @@ #include "graphics/niche/InkHUD/InkHUD.h" #include "graphics/niche/InkHUD/Persistence.h" #include "graphics/niche/InkHUD/SystemApplet.h" +#include "graphics/niche/Utils/CannedMessageStore.h" #include "./MenuItem.h" #include "./MenuPage.h" +#include "Channels.h" #include "concurrency/OSThread.h" namespace NicheGraphics::InkHUD @@ -36,12 +38,18 @@ class MenuApplet : public SystemApplet, public concurrency::OSThread void execute(MenuItem item); // Perform the MenuAction associated with a MenuItem, if any void showPage(MenuPage page); // Load and display a MenuPage + + void populateSendPage(); // Dynamically create MenuItems including canned messages + void populateRecipientPage(); // Dynamically create a page of possible destinations for a canned message void populateAppletPage(); // Dynamically create MenuItems for toggling loaded applets void populateAutoshowPage(); // Dynamically create MenuItems for selecting which applets can autoshow void populateRecentsPage(); // Create menu items: a choice of values for settings.recentlyActiveSeconds + uint16_t getSystemInfoPanelHeight(); void drawSystemInfoPanel(int16_t left, int16_t top, uint16_t width, - uint16_t *height = nullptr); // Info panel at top of root menu + uint16_t *height = nullptr); // Info panel at top of root menu + void sendText(NodeNum dest, ChannelIndex channel, const char *message); // Send a text message to mesh + void freeCannedMessageResources(); // Clear MenuApplet's canned message processing data MenuPage currentPage = MenuPage::ROOT; uint8_t cursor = 0; // Which menu item is currently highlighted @@ -51,6 +59,37 @@ class MenuApplet : public SystemApplet, public concurrency::OSThread std::vector items; // MenuItems for the current page. Filled by ShowPage + // Data for selecting and sending canned messages via the menu + // Placed into a sub-class for organization only + class CannedMessages + { + public: + // Share NicheGraphics component + // Handles loading, getting, setting + CannedMessageStore *store; + + // One canned message + // Links the menu item to the true message text + struct MessageItem { + std::string label; // Shown in menu. Prefixed, and UTF-8 chars parsed + std::string rawText; // The message which will be sent, if this item is selected + } *selectedMessageItem; + + // One possible destination for a canned message + // Links the menu item to the intended recipient + // May represent either broadcast or DM + struct RecipientItem { + std::string label; // Shown in menu + NodeNum dest = NODENUM_BROADCAST; + uint8_t channelIndex = 0; + } *selectedRecipientItem; + + // These lists are generated when the menu page is populated + // Cleared onBackground (when MenuApplet closes) + std::vector messageItems; + std::vector recipientItems; + } cm; + Applet *borrowedTileOwner = nullptr; // Which applet we have temporarily replaced while displaying menu }; diff --git a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuPage.h b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuPage.h index d2314e83b..389e411c3 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuPage.h +++ b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuPage.h @@ -18,6 +18,7 @@ namespace NicheGraphics::InkHUD enum MenuPage : uint8_t { ROOT, // Initial menu page SEND, + CANNEDMESSAGE_RECIPIENT, // Select destination for a canned message OPTIONS, APPLETS, AUTOSHOW, diff --git a/src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.cpp b/src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.cpp index d5d7f77f8..fdb5a168d 100644 --- a/src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.cpp @@ -13,7 +13,8 @@ using namespace NicheGraphics; constexpr uint8_t MAX_MESSAGES_SAVED = 10; constexpr uint32_t MAX_MESSAGE_SIZE = 250; -InkHUD::ThreadedMessageApplet::ThreadedMessageApplet(uint8_t channelIndex) : channelIndex(channelIndex) +InkHUD::ThreadedMessageApplet::ThreadedMessageApplet(uint8_t channelIndex) + : SinglePortModule("ThreadedMessageApplet", meshtastic_PortNum_TEXT_MESSAGE_APP), channelIndex(channelIndex) { // Create the message store // Will shortly attempt to load messages from RAM, if applet is active @@ -69,9 +70,8 @@ void InkHUD::ThreadedMessageApplet::onRender() // Grab data for message MessageStore::Message &m = store->messages.at(i); - bool outgoing = (m.sender == 0); - meshtastic_NodeInfoLite *sender = nodeDB->getMeshNode(m.sender); - std::string bodyText = parse(m.text); // Parse any non-ascii chars in the message + bool outgoing = (m.sender == 0) || (m.sender == myNodeInfo.my_node_num); // Own NodeNum if canned message + std::string bodyText = parse(m.text); // Parse any non-ascii chars in the message // Cache bottom Y of message text // - Used when drawing vertical line alongside @@ -171,54 +171,54 @@ void InkHUD::ThreadedMessageApplet::onRender() void InkHUD::ThreadedMessageApplet::onActivate() { loadMessagesFromFlash(); - textMessageObserver.observe(textMessageModule); // Begin handling any new text messages with onReceiveTextMessage + loopbackOk = true; // Allow us to handle messages generated on the node (canned messages) } // Code which runs when the applet stop running -// This might be happen at shutdown, or if user disables the applet at run-time +// This might be at shutdown, or if the user disables the applet at run-time, via the menu void InkHUD::ThreadedMessageApplet::onDeactivate() { - textMessageObserver.unobserve(textMessageModule); // Stop handling any new text messages with onReceiveTextMessage + loopbackOk = false; // Slightly reduce our impact if the applet is disabled } // Handle new text messages // These might be incoming, from the mesh, or outgoing from phone // Each instance of the ThreadMessageApplet will only listen on one specific channel -// Method should return 0, to indicate general success to TextMessageModule -int InkHUD::ThreadedMessageApplet::onReceiveTextMessage(const meshtastic_MeshPacket *p) +ProcessMessage InkHUD::ThreadedMessageApplet::handleReceived(const meshtastic_MeshPacket &mp) { // Abort if applet fully deactivated - // Already handled by onActivate and onDeactivate, but good practice for all applets if (!isActive()) - return 0; + return ProcessMessage::CONTINUE; // Abort if wrong channel - if (p->channel != this->channelIndex) - return 0; + if (mp.channel != this->channelIndex) + return ProcessMessage::CONTINUE; // Abort if message was a DM - if (p->to != NODENUM_BROADCAST) - return 0; + if (mp.to != NODENUM_BROADCAST) + return ProcessMessage::CONTINUE; // Extract info into our slimmed-down "StoredMessage" type MessageStore::Message newMessage; newMessage.timestamp = getValidTime(RTCQuality::RTCQualityDevice, true); // Current RTC time - newMessage.sender = p->from; - newMessage.channelIndex = p->channel; - newMessage.text = std::string(&p->decoded.payload.bytes[0], &p->decoded.payload.bytes[p->decoded.payload.size]); + newMessage.sender = mp.from; + newMessage.channelIndex = mp.channel; + newMessage.text = std::string((const char *)mp.decoded.payload.bytes, mp.decoded.payload.size); // Store newest message at front // These records are used when rendering, and also stored in flash at shutdown store->messages.push_front(newMessage); // If this was an incoming message, suggest that our applet becomes foreground, if permitted - if (getFrom(p) != nodeDB->getNodeNum()) + if (getFrom(&mp) != nodeDB->getNodeNum()) requestAutoshow(); // Redraw the applet, perhaps. requestUpdate(); // Want to update display, if applet is foreground - return 0; + // Tell Module API to continue informing other firmware components about this message + // We're not the only component which is interested in new text messages + return ProcessMessage::CONTINUE; } // Don't show notifications for text messages broadcast to our channel, when the applet is displayed diff --git a/src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h b/src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h index 3e11a25f2..c986539b3 100644 --- a/src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h +++ b/src/graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h @@ -30,7 +30,7 @@ namespace NicheGraphics::InkHUD class Applet; -class ThreadedMessageApplet : public Applet +class ThreadedMessageApplet : public Applet, public SinglePortModule { public: explicit ThreadedMessageApplet(uint8_t channelIndex); @@ -41,16 +41,11 @@ class ThreadedMessageApplet : public Applet void onActivate() override; void onDeactivate() override; void onShutdown() override; - int onReceiveTextMessage(const meshtastic_MeshPacket *p); + ProcessMessage handleReceived(const meshtastic_MeshPacket &mp) override; bool approveNotification(Notification &n) override; // Which notifications to suppress protected: - // Used to register our text message callback - CallbackObserver textMessageObserver = - CallbackObserver(this, - &ThreadedMessageApplet::onReceiveTextMessage); - void saveMessagesToFlash(); void loadMessagesFromFlash(); diff --git a/src/graphics/niche/InkHUD/Events.cpp b/src/graphics/niche/InkHUD/Events.cpp index f07645989..2abe30793 100644 --- a/src/graphics/niche/InkHUD/Events.cpp +++ b/src/graphics/niche/InkHUD/Events.cpp @@ -4,14 +4,13 @@ #include "RTC.h" #include "buzz.h" -#include "modules/AdminModule.h" #include "modules/ExternalNotificationModule.h" #include "modules/TextMessageModule.h" #include "sleep.h" #include "./Applet.h" #include "./SystemApplet.h" -#include "graphics/niche/FlashData.h" +#include "graphics/niche/Utils/FlashData.h" using namespace NicheGraphics; @@ -30,7 +29,7 @@ void InkHUD::Events::begin() rebootObserver.observe(¬ifyReboot); textMessageObserver.observe(textMessageModule); #if !MESHTASTIC_EXCLUDE_ADMIN - adminMessageObserver.observe(adminModule); + adminMessageObserver.observe((Observable *)adminModule); #endif #ifdef ARCH_ESP32 lightSleepObserver.observe(¬ifyLightSleep); @@ -193,14 +192,15 @@ int InkHUD::Events::onReceiveTextMessage(const meshtastic_MeshPacket *packet) return 0; // Tell caller to continue notifying other observers. (No reason to abort this event) } -int InkHUD::Events::onAdminMessage(const meshtastic_AdminMessage *message) +int InkHUD::Events::onAdminMessage(AdminModule_ObserverData *data) { - switch (message->which_payload_variant) { + switch (data->request->which_payload_variant) { // Factory reset // Two possible messages. One preserves BLE bonds, other wipes. Both should clear InkHUD data. case meshtastic_AdminMessage_factory_reset_device_tag: case meshtastic_AdminMessage_factory_reset_config_tag: eraseOnReboot = true; + *data->result = AdminMessageHandleResult::HANDLED; break; default: diff --git a/src/graphics/niche/InkHUD/Events.h b/src/graphics/niche/InkHUD/Events.h index 2a2dad5dc..df68f368c 100644 --- a/src/graphics/niche/InkHUD/Events.h +++ b/src/graphics/niche/InkHUD/Events.h @@ -13,7 +13,7 @@ however this class handles general events which concern InkHUD as a whole, e.g. #include "configuration.h" -#include "Observer.h" +#include "modules/AdminModule.h" #include "./InkHUD.h" #include "./Persistence.h" @@ -33,7 +33,7 @@ class Events int beforeDeepSleep(void *unused); // Prepare for shutdown int beforeReboot(void *unused); // Prepare for reboot int onReceiveTextMessage(const meshtastic_MeshPacket *packet); // Store most recent text message - int onAdminMessage(const meshtastic_AdminMessage *message); // Handle incoming admin messages + int onAdminMessage(AdminModule_ObserverData *data); // Handle incoming admin messages #ifdef ARCH_ESP32 int beforeLightSleep(void *unused); // Prepare for light sleep #endif @@ -54,8 +54,8 @@ class Events CallbackObserver(this, &Events::onReceiveTextMessage); // Get notified of incoming admin messages, and handle any which are relevant to InkHUD - CallbackObserver adminMessageObserver = - CallbackObserver(this, &Events::onAdminMessage); + CallbackObserver adminMessageObserver = + CallbackObserver(this, &Events::onAdminMessage); #ifdef ARCH_ESP32 // Get notified when the system is entering light sleep diff --git a/src/graphics/niche/InkHUD/Persistence.h b/src/graphics/niche/InkHUD/Persistence.h index 40f1dd521..b85274c87 100644 --- a/src/graphics/niche/InkHUD/Persistence.h +++ b/src/graphics/niche/InkHUD/Persistence.h @@ -15,8 +15,8 @@ The save / load mechanism is a shared NicheGraphics feature. #include "configuration.h" #include "./InkHUD.h" -#include "graphics/niche/FlashData.h" #include "graphics/niche/InkHUD/MessageStore.h" +#include "graphics/niche/Utils/FlashData.h" namespace NicheGraphics::InkHUD { diff --git a/src/graphics/niche/Utils/CannedMessageStore.cpp b/src/graphics/niche/Utils/CannedMessageStore.cpp new file mode 100644 index 000000000..50998930d --- /dev/null +++ b/src/graphics/niche/Utils/CannedMessageStore.cpp @@ -0,0 +1,163 @@ +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +#include "./CannedMessageStore.h" + +#include "FSCommon.h" +#include "NodeDB.h" +#include "SPILock.h" +#include "generated/meshtastic/cannedmessages.pb.h" + +using namespace NicheGraphics; + +// Location of the file which stores the canned messages on flash +static const char *cannedMessagesConfigFile = "/prefs/cannedConf.proto"; + +CannedMessageStore::CannedMessageStore() +{ +#if !MESHTASTIC_EXCLUDE_ADMIN + adminMessageObserver.observe(adminModule); +#endif + + // Load & parse messages from flash + load(); +} + +// Get access to (or create) the singleton instance of this class +CannedMessageStore *CannedMessageStore::getInstance() +{ + // Instantiate the class the first time this method is called + static CannedMessageStore *const singletonInstance = new CannedMessageStore; + + return singletonInstance; +} + +// Access canned messages by index +// Consumer should check CannedMessageStore::size to avoid accessing out of bounds +const std::string &CannedMessageStore::at(uint8_t i) +{ + assert(i < messages.size()); + return messages.at(i); +} + +// Number of canned message strings available +uint8_t CannedMessageStore::size() +{ + return messages.size(); +} + +// Load canned message data from flash, and parse into the individual strings +void CannedMessageStore::load() +{ + // In case we're reloading + messages.clear(); + + // Attempt to load the bulk canned message data from flash + meshtastic_CannedMessageModuleConfig cannedMessageModuleConfig; + LoadFileResult result = nodeDB->loadProto("/prefs/cannedConf.proto", meshtastic_CannedMessageModuleConfig_size, + sizeof(meshtastic_CannedMessageModuleConfig), + &meshtastic_CannedMessageModuleConfig_msg, &cannedMessageModuleConfig); + + // Abort if nothing to load + if (result != LoadFileResult::LOAD_SUCCESS || strlen(cannedMessageModuleConfig.messages) == 0) + return; + + // Split into individual canned messages + // These are concatenated when stored in flash, using '|' as a delimiter + std::string s; + for (char c : cannedMessageModuleConfig.messages) { // Character by character + + // If found end of a string + if (c == '|' || c == '\0') { + // Copy into the vector (if non-empty) + if (!s.empty()) + messages.push_back(s); + + // Reset the string builder + s.clear(); + + // End of data, all strings processed + if (c == 0) + break; + } + + // Otherwise, append char (continue building string) + else + s.push_back(c); + } +} + +// Handle incoming admin messages +// We get these as an observer of AdminModule +// It's our responsibility to handle setting and getting of canned messages via the client API +// Ordinarily, this would be handled by the CannedMessageModule, but it is bound to Screen.cpp, so not suitable for NicheGraphics +int CannedMessageStore::onAdminMessage(AdminModule_ObserverData *data) +{ + switch (data->request->which_payload_variant) { + + // Client API changing the canned messages + case meshtastic_AdminMessage_set_canned_message_module_messages_tag: + handleSet(data->request); + *data->result = AdminMessageHandleResult::HANDLED; + break; + + // Client API wants to know the current canned messages + case meshtastic_AdminMessage_get_canned_message_module_messages_request_tag: + handleGet(data->response); + *data->result = AdminMessageHandleResult::HANDLED_WITH_RESPONSE; + break; + + default: + break; + } + + return 0; // Tell caller to continue notifying other observers. (No reason to abort this event) +} + +// Client API changing the canned messages +void CannedMessageStore::handleSet(const meshtastic_AdminMessage *request) +{ + // Copy into the correct struct (for writing to flash as protobuf) + meshtastic_CannedMessageModuleConfig cannedMessageModuleConfig; + strncpy(cannedMessageModuleConfig.messages, request->set_canned_message_module_messages, + sizeof(cannedMessageModuleConfig.messages)); + + // Ensure the directory exists +#ifdef FSCom + spiLock->lock(); + FSCom.mkdir("/prefs"); + spiLock->unlock(); +#endif + + // Write to flash + nodeDB->saveProto(cannedMessagesConfigFile, meshtastic_CannedMessageModuleConfig_size, + &meshtastic_CannedMessageModuleConfig_msg, &cannedMessageModuleConfig); + + // Reload from flash, to update the canned messages in RAM + // (This is a lazy way to handle it) + load(); +} + +// Client API wants to know the current canned messages +// We're reconstructing the monolithic canned message string from our copy of the messages in RAM +// Lazy, but more convenient that reloading the monolithic string from flash just for this +void CannedMessageStore::handleGet(meshtastic_AdminMessage *response) +{ + // Merge the canned messages back into the delimited format expected + std::string merged; + if (!messages.empty()) { // Don't run if no messages: error on pop_back with size=0 + merged.reserve(201); + for (std::string &s : messages) { + merged += s; + merged += '|'; + } + merged.pop_back(); // Drop the final delimiter (loop added one too many) + } + + // Place the data into the response + // This response is scoped to AdminModule::handleReceivedProtobuf + // We were passed reference to it via the observable + response->which_payload_variant = meshtastic_AdminMessage_get_canned_message_module_messages_response_tag; + strncpy(response->get_canned_message_module_messages_response, merged.c_str(), strlen(merged.c_str()) + 1); +} + +#endif \ No newline at end of file diff --git a/src/graphics/niche/Utils/CannedMessageStore.h b/src/graphics/niche/Utils/CannedMessageStore.h new file mode 100644 index 000000000..c00e1cf5c --- /dev/null +++ b/src/graphics/niche/Utils/CannedMessageStore.h @@ -0,0 +1,54 @@ +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +/* + +Re-usable NicheGraphics tool + +Makes canned message data accessible to any NicheGraphics UI. + - handles loading & parsing from flash + - handles the admin messages for setting & getting canned messages via client API (phone apps, etc) + +The original CannedMessageModule class is bound to Screen.cpp, +making it incompatible with the NicheGraphics framework, which suppresses Screen.cpp + +This implementation aims to be self-contained. +The necessary interaction with the AdminModule is done as an observer. + +*/ + +#pragma once + +#include "configuration.h" + +#include "modules/AdminModule.h" + +namespace NicheGraphics +{ + +class CannedMessageStore +{ + public: + static CannedMessageStore *getInstance(); // Create or get the singleton instance + const std::string &at(uint8_t i); // Get canned message at index + uint8_t size(); // Get total number of canned messages + + int onAdminMessage(AdminModule_ObserverData *data); // Handle incoming admin messages + + private: + CannedMessageStore(); // Constructor made private: force use of CannedMessageStore::instance() + + void load(); // Load from flash, and parse + + void handleSet(const meshtastic_AdminMessage *request); // Client API changing the canned messages + void handleGet(meshtastic_AdminMessage *response); // Client API wants to know current canned messages + + std::vector messages; + + // Get notified of incoming admin messages, to get / set canned messages + CallbackObserver adminMessageObserver = + CallbackObserver(this, &CannedMessageStore::onAdminMessage); +}; + +}; // namespace NicheGraphics + +#endif \ No newline at end of file diff --git a/src/graphics/niche/FlashData.h b/src/graphics/niche/Utils/FlashData.h similarity index 100% rename from src/graphics/niche/FlashData.h rename to src/graphics/niche/Utils/FlashData.h diff --git a/src/main.cpp b/src/main.cpp index 17214b13f..f3147520f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1422,7 +1422,7 @@ extern meshtastic_DeviceMetadata getDeviceMetadata() deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_AUDIO_CONFIG; #endif // Option to explicitly include canned messages for edge cases, e.g. niche graphics -#if (!HAS_SCREEN || NO_EXT_GPIO) || MESHTASTIC_EXCLUDE_CANNEDMESSAGES +#if ((!HAS_SCREEN || NO_EXT_GPIO) || MESHTASTIC_EXCLUDE_CANNEDMESSAGES) && !defined(MESHTASTIC_INCLUDE_NICHE_GRAPHICS) deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_CANNEDMSG_CONFIG; #endif #if NO_EXT_GPIO diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index d489231ad..aad7f5f06 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -470,22 +470,38 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta setPassKey(&res); myReply = allocDataProtobuf(res); } else if (mp.decoded.want_response) { - LOG_DEBUG("Did not responded to a request that wanted a respond. req.variant=%d", r->which_payload_variant); + LOG_DEBUG("Module API did not respond to admin message. req.variant=%d", r->which_payload_variant); } else if (handleResult != AdminMessageHandleResult::HANDLED) { // Probably a message sent by us or sent to our local node. FIXME, we should avoid scanning these messages - LOG_DEBUG("Ignore irrelevant admin %d", r->which_payload_variant); + LOG_DEBUG("Module API did not handle admin message %d", r->which_payload_variant); } break; } + // Allow any observers (e.g. the UI) to handle/respond + AdminMessageHandleResult observerResult = AdminMessageHandleResult::NOT_HANDLED; + meshtastic_AdminMessage observerResponse = meshtastic_AdminMessage_init_default; + AdminModule_ObserverData observerData = { + .request = r, + .response = &observerResponse, + .result = &observerResult, + }; + + notifyObservers(&observerData); + + if (observerResult == AdminMessageHandleResult::HANDLED_WITH_RESPONSE) { + setPassKey(&observerResponse); + myReply = allocDataProtobuf(observerResponse); + LOG_DEBUG("Observer responded to admin message"); + } else if (observerResult == AdminMessageHandleResult::HANDLED) { + LOG_DEBUG("Observer handled admin message"); + } + // If asked for a response and it is not yet set, generate an 'ACK' response if (mp.decoded.want_response && !myReply) { myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp); } - // Allow any observers (e.g. the UI) to respond to this event - notifyObservers(r); - return handled; } diff --git a/src/modules/AdminModule.h b/src/modules/AdminModule.h index 5638e57e7..867751f49 100644 --- a/src/modules/AdminModule.h +++ b/src/modules/AdminModule.h @@ -6,10 +6,19 @@ #include "mesh/wifi/WiFiAPClient.h" #endif +/** + * Datatype passed to Observers by AdminModule, to allow external handling of admin messages + */ +struct AdminModule_ObserverData { + const meshtastic_AdminMessage *request; + meshtastic_AdminMessage *response; + AdminMessageHandleResult *result; +}; + /** * Admin module for admin messages */ -class AdminModule : public ProtobufModule, public Observable +class AdminModule : public ProtobufModule, public Observable { public: /** Constructor From a7dcf580ad6275d3ff730e1b192ec2a410bc5875 Mon Sep 17 00:00:00 2001 From: Kongduino Date: Thu, 26 Jun 2025 01:54:57 +0800 Subject: [PATCH 343/461] Update RedirectablePrint.cpp (#7114) Bug fix to my hexDump code. Because `log()` adds a carriage return, hexdump lines were split over 3 lines. This fixes it. --- src/RedirectablePrint.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/RedirectablePrint.cpp b/src/RedirectablePrint.cpp index 07f873864..7c8d77651 100644 --- a/src/RedirectablePrint.cpp +++ b/src/RedirectablePrint.cpp @@ -352,8 +352,8 @@ void RedirectablePrint::hexDump(const char *logLevel, unsigned char *buf, uint16 for (uint16_t i = 0; i < len; i += 16) { if (i % 128 == 0) log(logLevel, " +------------------------------------------------+ +----------------+"); - char s[] = "| | | |\n"; - uint8_t ix = 1, iy = 52; + char s[] = " | | | |\n"; + uint8_t ix = 5, iy = 56; for (uint8_t j = 0; j < 16; j++) { if (i + j < len) { uint8_t c = buf[i + j]; @@ -367,10 +367,8 @@ void RedirectablePrint::hexDump(const char *logLevel, unsigned char *buf, uint16 } } uint8_t index = i / 16; - if (i < 256) - log(logLevel, " "); - log(logLevel, "%02x", index); - log(logLevel, "."); + sprintf(s, "%03x", index); + s[3] = '.'; log(logLevel, s); } log(logLevel, " +------------------------------------------------+ +----------------+"); @@ -393,4 +391,4 @@ std::string RedirectablePrint::mt_sprintf(const std::string fmt_str, ...) break; } return std::string(formatted.get()); -} \ No newline at end of file +} From 3870d81bf6a1b0b1c5a4a9855cfa3196b9cab53b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 20:18:55 +0200 Subject: [PATCH 344/461] [create-pull-request] automated change (#7134) Co-authored-by: caveman99 <25002+caveman99@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/telemetry.pb.h | 66 +++++++++++++++++--- 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/protobufs b/protobufs index 6791138f0..386fa53c1 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 6791138f0ba2b7c471072bd4bba6cbb8bacffe2d +Subproject commit 386fa53c1596c8dfc547521f08df107f4cb3a275 diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index 4fa673df8..90b0d9d10 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -91,7 +91,9 @@ typedef enum _meshtastic_TelemetrySensorType { /* MAX17261 lipo battery gauge */ meshtastic_TelemetrySensorType_MAX17261 = 38, /* PCT2075 Temperature Sensor */ - meshtastic_TelemetrySensorType_PCT2075 = 39 + meshtastic_TelemetrySensorType_PCT2075 = 39, + /* ADS1X15 ADC */ + meshtastic_TelemetrySensorType_ADS1X15 = 40 } meshtastic_TelemetrySensorType; /* Struct definitions */ @@ -206,6 +208,36 @@ typedef struct _meshtastic_PowerMetrics { /* Current (Ch3) */ bool has_ch3_current; float ch3_current; + /* Voltage (Ch4) */ + bool has_ch4_voltage; + float ch4_voltage; + /* Current (Ch4) */ + bool has_ch4_current; + float ch4_current; + /* Voltage (Ch5) */ + bool has_ch5_voltage; + float ch5_voltage; + /* Current (Ch5) */ + bool has_ch5_current; + float ch5_current; + /* Voltage (Ch6) */ + bool has_ch6_voltage; + float ch6_voltage; + /* Current (Ch6) */ + bool has_ch6_current; + float ch6_current; + /* Voltage (Ch7) */ + bool has_ch7_voltage; + float ch7_voltage; + /* Current (Ch7) */ + bool has_ch7_current; + float ch7_current; + /* Voltage (Ch8) */ + bool has_ch8_voltage; + float ch8_voltage; + /* Current (Ch8) */ + bool has_ch8_current; + float ch8_current; } meshtastic_PowerMetrics; /* Air quality metrics */ @@ -360,8 +392,8 @@ extern "C" { /* Helper constants for enums */ #define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET -#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_PCT2075 -#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_PCT2075+1)) +#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_ADS1X15 +#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_ADS1X15+1)) @@ -376,7 +408,7 @@ extern "C" { /* Initializer values for message structs */ #define meshtastic_DeviceMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_EnvironmentMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} -#define meshtastic_PowerMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} +#define meshtastic_PowerMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0} @@ -385,7 +417,7 @@ extern "C" { #define meshtastic_Nau7802Config_init_default {0, 0} #define meshtastic_DeviceMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_EnvironmentMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} -#define meshtastic_PowerMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} +#define meshtastic_PowerMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0} @@ -427,6 +459,16 @@ extern "C" { #define meshtastic_PowerMetrics_ch2_current_tag 4 #define meshtastic_PowerMetrics_ch3_voltage_tag 5 #define meshtastic_PowerMetrics_ch3_current_tag 6 +#define meshtastic_PowerMetrics_ch4_voltage_tag 7 +#define meshtastic_PowerMetrics_ch4_current_tag 8 +#define meshtastic_PowerMetrics_ch5_voltage_tag 9 +#define meshtastic_PowerMetrics_ch5_current_tag 10 +#define meshtastic_PowerMetrics_ch6_voltage_tag 11 +#define meshtastic_PowerMetrics_ch6_current_tag 12 +#define meshtastic_PowerMetrics_ch7_voltage_tag 13 +#define meshtastic_PowerMetrics_ch7_current_tag 14 +#define meshtastic_PowerMetrics_ch8_voltage_tag 15 +#define meshtastic_PowerMetrics_ch8_current_tag 16 #define meshtastic_AirQualityMetrics_pm10_standard_tag 1 #define meshtastic_AirQualityMetrics_pm25_standard_tag 2 #define meshtastic_AirQualityMetrics_pm100_standard_tag 3 @@ -518,7 +560,17 @@ X(a, STATIC, OPTIONAL, FLOAT, ch1_current, 2) \ X(a, STATIC, OPTIONAL, FLOAT, ch2_voltage, 3) \ X(a, STATIC, OPTIONAL, FLOAT, ch2_current, 4) \ X(a, STATIC, OPTIONAL, FLOAT, ch3_voltage, 5) \ -X(a, STATIC, OPTIONAL, FLOAT, ch3_current, 6) +X(a, STATIC, OPTIONAL, FLOAT, ch3_current, 6) \ +X(a, STATIC, OPTIONAL, FLOAT, ch4_voltage, 7) \ +X(a, STATIC, OPTIONAL, FLOAT, ch4_current, 8) \ +X(a, STATIC, OPTIONAL, FLOAT, ch5_voltage, 9) \ +X(a, STATIC, OPTIONAL, FLOAT, ch5_current, 10) \ +X(a, STATIC, OPTIONAL, FLOAT, ch6_voltage, 11) \ +X(a, STATIC, OPTIONAL, FLOAT, ch6_current, 12) \ +X(a, STATIC, OPTIONAL, FLOAT, ch7_voltage, 13) \ +X(a, STATIC, OPTIONAL, FLOAT, ch7_current, 14) \ +X(a, STATIC, OPTIONAL, FLOAT, ch8_voltage, 15) \ +X(a, STATIC, OPTIONAL, FLOAT, ch8_current, 16) #define meshtastic_PowerMetrics_CALLBACK NULL #define meshtastic_PowerMetrics_DEFAULT NULL @@ -631,7 +683,7 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg; #define meshtastic_HostMetrics_size 264 #define meshtastic_LocalStats_size 72 #define meshtastic_Nau7802Config_size 16 -#define meshtastic_PowerMetrics_size 30 +#define meshtastic_PowerMetrics_size 81 #define meshtastic_Telemetry_size 272 #ifdef __cplusplus From 7512673b09fb2bdeb3f287e68ad7c4ff28657b7e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 25 Jun 2025 16:36:33 -0500 Subject: [PATCH 345/461] Do not beacon Device telemetry by default anymore (#7116) * Do not beacon Device telemetry by default anymore * Update * Old default interval for sensor * Added userpref * Addd tracker to default telemetry roles * Let the macro do its job in router mode --- src/mesh/NodeDB.cpp | 10 +++++++++- userPrefs.jsonc | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index d13864bd9..f4f50f8b0 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -850,10 +850,12 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role) if (role == meshtastic_Config_DeviceConfig_Role_ROUTER) { initConfigIntervals(); initModuleConfigIntervals(); + moduleConfig.telemetry.device_update_interval = default_telemetry_broadcast_interval_secs; config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY; owner.has_is_unmessagable = true; owner.is_unmessagable = true; } else if (role == meshtastic_Config_DeviceConfig_Role_ROUTER_LATE) { + moduleConfig.telemetry.device_update_interval = ONE_DAY; owner.has_is_unmessagable = true; owner.is_unmessagable = true; } else if (role == meshtastic_Config_DeviceConfig_Role_REPEATER) { @@ -864,6 +866,7 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role) } else if (role == meshtastic_Config_DeviceConfig_Role_SENSOR) { owner.has_is_unmessagable = true; owner.is_unmessagable = true; + moduleConfig.telemetry.device_update_interval = default_telemetry_broadcast_interval_secs; moduleConfig.telemetry.environment_measurement_enabled = true; moduleConfig.telemetry.environment_update_interval = 300; } else if (role == meshtastic_Config_DeviceConfig_Role_LOST_AND_FOUND) { @@ -881,6 +884,7 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role) } else if (role == meshtastic_Config_DeviceConfig_Role_TRACKER) { owner.has_is_unmessagable = true; owner.is_unmessagable = true; + moduleConfig.telemetry.device_update_interval = default_telemetry_broadcast_interval_secs; } else if (role == meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) { owner.has_is_unmessagable = true; owner.is_unmessagable = true; @@ -910,7 +914,11 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role) void NodeDB::initModuleConfigIntervals() { // Zero out telemetry intervals so that they coalesce to defaults in Default.h - moduleConfig.telemetry.device_update_interval = 0; +#ifdef USERPREFS_CONFIG_DEVICE_TELEM_UPDATE_INTERVAL + moduleConfig.telemetry.device_update_interval = USERPREFS_CONFIG_DEVICE_TELEM_UPDATE_INTERVAL; +#else + moduleConfig.telemetry.device_update_interval = UINT32_MAX; +#endif moduleConfig.telemetry.environment_update_interval = 0; moduleConfig.telemetry.air_quality_interval = 0; moduleConfig.telemetry.power_update_interval = 0; diff --git a/userPrefs.jsonc b/userPrefs.jsonc index 497327478..fc9e6ed72 100644 --- a/userPrefs.jsonc +++ b/userPrefs.jsonc @@ -31,6 +31,7 @@ // "USERPREFS_CONFIG_SMART_POSITION_ENABLED": "false", // "USERPREFS_CONFIG_GPS_UPDATE_INTERVAL": "600", // "USERPREFS_CONFIG_POSITION_BROADCAST_INTERVAL": "1800", + // "USERPREFS_CONFIG_DEVICE_TELEM_UPDATE_INTERVAL": "900", // Device telemetry update interval in seconds // "USERPREFS_LORACONFIG_CHANNEL_NUM": "31", // "USERPREFS_LORACONFIG_MODEM_PRESET": "meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST", // "USERPREFS_USE_ADMIN_KEY_0": "{ 0xcd, 0xc0, 0xb4, 0x3c, 0x53, 0x24, 0xdf, 0x13, 0xca, 0x5a, 0xa6, 0x0c, 0x0d, 0xec, 0x85, 0x5a, 0x4c, 0xf6, 0x1a, 0x96, 0x04, 0x1a, 0x3e, 0xfc, 0xbb, 0x8e, 0x33, 0x71, 0xe5, 0xfc, 0xff, 0x3c }", From c144bd03dcaa7f16472ac61929c06d81a4fe602b Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 25 Jun 2025 21:17:47 -0400 Subject: [PATCH 346/461] MeshAdv-Mini: Correct autoconf settings (#7117) --- bin/config.d/lora-MeshAdv-Mini-900M22S.yaml | 2 +- src/platform/portduino/PortduinoGlue.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/config.d/lora-MeshAdv-Mini-900M22S.yaml b/bin/config.d/lora-MeshAdv-Mini-900M22S.yaml index 554116b57..b47b5c996 100644 --- a/bin/config.d/lora-MeshAdv-Mini-900M22S.yaml +++ b/bin/config.d/lora-MeshAdv-Mini-900M22S.yaml @@ -6,6 +6,6 @@ Lora: IRQ: 16 Busy: 20 Reset: 24 - TXen: 13 + RXen: 12 DIO2_AS_RF_SWITCH: true DIO3_TCXO_VOLTAGE: true diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index 43aea4218..5795f0d8d 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -11,7 +11,7 @@ inline const std::unordered_map configProducts = {{"MESHTOAD", "lora-usb-meshtoad-e22.yaml"}, {"MESHSTICK", "lora-meshstick-1262.yaml"}, {"MESHADV-PI", "lora-MeshAdv-900M30S.yaml"}, - {"MESHADV-MINI", "lora-MeshAdv-Mini-900M22S.yaml"}, + {"MeshAdv Mini", "lora-MeshAdv-Mini-900M22S.yaml"}, {"POWERPI", "lora-MeshAdv-900M30S.yaml"}}; enum configNames { From f6630cd31d5607c193abed6f9e75fcb08adce24a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 26 Jun 2025 18:31:14 +1000 Subject: [PATCH 347/461] Upgrade trunk (#7084) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index b40f9458b..dc065d041 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -4,13 +4,13 @@ cli: plugins: sources: - id: trunk - ref: v1.7.0 + ref: v1.7.1 uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.442 - - renovate@40.60.3 - - prettier@3.5.3 + - checkov@3.2.446 + - renovate@41.10.0 + - prettier@3.6.1 - trufflehog@3.89.2 - yamllint@1.37.1 - bandit@1.8.5 @@ -20,9 +20,9 @@ lint: - isort@6.0.1 - markdownlint@0.45.0 - oxipng@9.1.5 - - svgo@3.3.2 + - svgo@4.0.0 - actionlint@1.7.7 - - flake8@7.2.0 + - flake8@7.3.0 - hadolint@2.12.1-beta - shfmt@3.6.0 - shellcheck@0.10.0 From 8ae05f6b33934efe152b0da8aa08498b62644f43 Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Thu, 26 Jun 2025 12:44:51 +0200 Subject: [PATCH 348/461] defcon tft display size definitions (#7142) --- variants/picomputer-s3/platformio.ini | 2 ++ variants/seeed-sensecap-indicator/platformio.ini | 2 ++ variants/t-deck/platformio.ini | 4 +++- variants/unphone/platformio.ini | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/variants/picomputer-s3/platformio.ini b/variants/picomputer-s3/platformio.ini index b861b5496..b7987796f 100644 --- a/variants/picomputer-s3/platformio.ini +++ b/variants/picomputer-s3/platformio.ini @@ -42,6 +42,8 @@ build_flags = -D LV_USE_LOG=0 -D USE_LOG_DEBUG -D LOG_DEBUG_INC=\"DebugConfiguration.h\" + -D LGFX_SCREEN_WIDTH=240 + -D LGFX_SCREEN_HEIGHT=320 -D LGFX_DRIVER=LGFX_PICOMPUTER_S3 -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_PICOMPUTER_S3.h\" -D VIEW_320x240 diff --git a/variants/seeed-sensecap-indicator/platformio.ini b/variants/seeed-sensecap-indicator/platformio.ini index 2187ebd8a..140c6f527 100644 --- a/variants/seeed-sensecap-indicator/platformio.ini +++ b/variants/seeed-sensecap-indicator/platformio.ini @@ -53,6 +53,8 @@ build_flags = -D USE_LOG_DEBUG -D LOG_DEBUG_INC=\"DebugConfiguration.h\" -D CUSTOM_TOUCH_DRIVER + -D LGFX_SCREEN_WIDTH=480 + -D LGFX_SCREEN_HEIGHT=480 -D LGFX_DRIVER=LGFX_INDICATOR -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_INDICATOR.h\" -D VIEW_320x240 diff --git a/variants/t-deck/platformio.ini b/variants/t-deck/platformio.ini index 04e305abb..6ee95b119 100644 --- a/variants/t-deck/platformio.ini +++ b/variants/t-deck/platformio.ini @@ -51,7 +51,9 @@ build_flags = -D RADIOLIB_DEBUG_SPI=0 -D RADIOLIB_DEBUG_PROTOCOL=0 -D RADIOLIB_SPI_PARANOID=0 - -D CALIBRATE_TOUCH=0 +; -D CALIBRATE_TOUCH=0 + -D LGFX_SCREEN_WIDTH=240 + -D LGFX_SCREEN_HEIGHT=320 -D LGFX_DRIVER=LGFX_TDECK -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_T_DECK.h\" ; -D LVGL_DRIVER=LVGL_TDECK diff --git a/variants/unphone/platformio.ini b/variants/unphone/platformio.ini index ef0f62b60..f286c3d4c 100644 --- a/variants/unphone/platformio.ini +++ b/variants/unphone/platformio.ini @@ -54,6 +54,8 @@ build_flags = -D LV_USE_LOG=0 -D USE_LOG_DEBUG -D LOG_DEBUG_INC=\"DebugConfiguration.h\" + -D LGFX_SCREEN_WIDTH=320 + -D LGFX_SCREEN_HEIGHT=480 -D LGFX_DRIVER=LGFX_UNPHONE_V9 -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_UNPHONE.h\" -D VIEW_320x240 From eeb52a1221bd24320559b1252bf17d6ef795f79a Mon Sep 17 00:00:00 2001 From: dylanli Date: Thu, 26 Jun 2025 19:30:45 +0800 Subject: [PATCH 349/461] support seeed_wio_tracker_L1_eink (#7125) * initial commit of eink version * fit for ssd1682 initial test run hud * update to solve mirroring problem * change eink screen ic to ssd1680 * remove HINK_E0213A367 * trunk fmt * fix wrong type * fix some fmt --- src/graphics/niche/InkHUD/DisplayHealth.cpp | 5 + .../seeed_wio_tracker_L1_eink/nicheGraphics.h | 106 ++++++++++ .../seeed_wio_tracker_L1_eink/platformio.ini | 14 ++ .../seeed_wio_tracker_L1_eink/variant.cpp | 103 ++++++++++ variants/seeed_wio_tracker_L1_eink/variant.h | 194 ++++++++++++++++++ 5 files changed, 422 insertions(+) create mode 100644 variants/seeed_wio_tracker_L1_eink/nicheGraphics.h create mode 100644 variants/seeed_wio_tracker_L1_eink/platformio.ini create mode 100644 variants/seeed_wio_tracker_L1_eink/variant.cpp create mode 100644 variants/seeed_wio_tracker_L1_eink/variant.h diff --git a/src/graphics/niche/InkHUD/DisplayHealth.cpp b/src/graphics/niche/InkHUD/DisplayHealth.cpp index e8849b72e..7e1accafd 100644 --- a/src/graphics/niche/InkHUD/DisplayHealth.cpp +++ b/src/graphics/niche/InkHUD/DisplayHealth.cpp @@ -7,7 +7,12 @@ using namespace NicheGraphics; // Timing for "maintenance" // Paying off full-refresh debt with unprovoked updates, if the display is not very active + +#ifdef SEEED_WIO_TRACKER_L1 +static constexpr uint32_t MAINTENANCE_MS_INITIAL = 5 * 1000UL; +#else static constexpr uint32_t MAINTENANCE_MS_INITIAL = 60 * 1000UL; +#endif static constexpr uint32_t MAINTENANCE_MS = 60 * 60 * 1000UL; InkHUD::DisplayHealth::DisplayHealth() : concurrency::OSThread("Mediator") diff --git a/variants/seeed_wio_tracker_L1_eink/nicheGraphics.h b/variants/seeed_wio_tracker_L1_eink/nicheGraphics.h new file mode 100644 index 000000000..7854de4b5 --- /dev/null +++ b/variants/seeed_wio_tracker_L1_eink/nicheGraphics.h @@ -0,0 +1,106 @@ +#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/Backlight/LatchingBacklight.h" +#include "graphics/niche/Drivers/EInk/GDEY0213B74.h" +#include "graphics/niche/Inputs/TwoButton.h" + +// Special case - fix T-Echo's touch button +// ---------------------------------------- +// On a handful of T-Echos, LoRa TX triggers the capacitive touch +// To avoid this, we lockout the button during TX +#include "mesh/RadioLibInterface.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::GDEY0213B74; + 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(7, 1.5); + + // Select fonts + InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; + + // Customize default settings + inkhud->persistence->settings.userTiles.maxCount = 2; // Two applets side-by-side + // 270 degrees clockwise + inkhud->persistence->settings.optionalFeatures.batteryIcon = true; // Device definitely has a battery + inkhud->persistence->settings.optionalMenuItems.backlight = true; // Until proves capacitive button works by touching it + inkhud->persistence->settings.userTiles.count = 1; // One tile only by default, keep things simple for new users + inkhud->persistence->settings.optionalMenuItems.nextTile = false; // Behavior handled by aux button instead + + // Setup backlight controller + // Note: AUX button attached further down + Drivers::LatchingBacklight *backlight = Drivers::LatchingBacklight::getInstance(); + backlight->setPin(PIN_EINK_EN); + + // 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 + + inkhud->persistence->settings.rotation = 1; + // inkhud->persistence->printSettings(&inkhud->persistence->settings); + // Start running InkHUD + inkhud->begin(); + // inkhud->persistence->printSettings(&inkhud->persistence->settings); + // Buttons + // -------------------------- + + Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component + + // #0: Main User Button + buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin()); + buttons->setTiming(0, 75, 500); + buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); }); + buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); }); + + // Begin handling button events + buttons->start(); +} + +#endif \ No newline at end of file diff --git a/variants/seeed_wio_tracker_L1_eink/platformio.ini b/variants/seeed_wio_tracker_L1_eink/platformio.ini new file mode 100644 index 000000000..b84757b9d --- /dev/null +++ b/variants/seeed_wio_tracker_L1_eink/platformio.ini @@ -0,0 +1,14 @@ +[env:seeed_wio_tracker_L1_eink] +board = seeed_wio_tracker_L1 +extends = nrf52840_base, inkhud +;board_level = extra +build_flags = ${nrf52840_base.build_flags} ${inkhud.build_flags} + -I $PROJECT_DIR/variants/seeed_wio_tracker_L1_eink + -D SEEED_WIO_TRACKER_L1 + -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 +board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_wio_tracker_L1_eink> ${inkhud.build_src_filter} +lib_deps = + ${inkhud.lib_deps} + ${nrf52840_base.lib_deps} +debug_tool = jlink diff --git a/variants/seeed_wio_tracker_L1_eink/variant.cpp b/variants/seeed_wio_tracker_L1_eink/variant.cpp new file mode 100644 index 000000000..bcbe20ea5 --- /dev/null +++ b/variants/seeed_wio_tracker_L1_eink/variant.cpp @@ -0,0 +1,103 @@ +/* + * variant.cpp - Digital pin mapping for TRACKER L1 + * + * This file defines the pin mapping array that maps logical digital pins (D0-D17) + * to physical GPIO ports/pins on the Nordic nRF52 series microcontroller. + * + * Board: [Seeed Studio WIO TRACKER L1] + * Hardware Features: + * - LoRa module (CS/SCK/MISO/MOSI control pins) + * - GNSS module (TX/RX/Reset/Wakeup) + * - User LEDs (D11-D12) + * - User button (D13) + * - Grove/NFC interface (D14-D15) + * - Battery voltage monitoring (D16) + * + * Created [20250521] + * By [Dylan] + */ + +#include "variant.h" +#include "nrf.h" +#include "wiring_constants.h" +#include "wiring_digital.h" + +/** + * @brief Digital pin to GPIO port/pin mapping table + * + * Format: Logical Pin (Dx) -> nRF Port.Pin (Px.xx) + * + */ + +extern "C" { +const uint32_t g_ADigitalPinMap[] = { + // D0 .. D10 - Peripheral control pins + 41, // D0 P1.09 GNSS_WAKEUP + 7, // D1 P0.07 LORA_DIO1 + 39, // D2 P1.07 LORA_RESET + 42, // D3 P1.10 LORA_BUSY + 46, // D4 P1.14 (A4/SDA) LORA_CS + 40, // D5 P1.08 (A5/SCL) LORA_SW + 27, // D6 P0.27 (UART_TX) GNSS_TX + 26, // D7 P0.26 (UART_RX) GNSS_RX + 30, // D8 P0.30 (SPI_SCK) LORA_SCK + 3, // D9 P0.3 (SPI_MISO) LORA_MISO + 28, // D10 P0.28 (SPI_MOSI) LORA_MOSI + + // D11-D12 - LED outputs + 33, // D11 P1.1 User LED + // Buzzer + 32, // D12 P1.0 Buzzer + + // D13 - User input + 8, // D13 P0.08 User Button + + // D14-D15 - Grove interface + 6, // D14 P0.06 OLED SDA + 5, // D15 P0.05 OLED SCL + + // D16 - Battery voltage ADC input + 31, // D16 P0.31 VBAT_ADC + // GROVE + 43, // D17 P0.00 GROVESDA + 44, // D18 P0.01 GROVESCL + + // FLASH + 21, // D19 P0.21 (QSPI_SCK) + 25, // D20 P0.25 (QSPI_CSN) + 20, // D21 P0.20 (QSPI_SIO_0 DI) + 24, // D22 P0.24 (QSPI_SIO_1 DO) + 22, // D23 P0.22 (QSPI_SIO_2 WP) + 23, // D24 P0.23 (QSPI_SIO_3 HOLD) + + 36, // D25 TB_UP + 12, // D26 TB_DOWN + 11, // D27 TB_LEFT + 35, // D28 TB_RIGHT + 37, // D29 TB_PRESS + 4, // D30 BAT_CTL + + 13, // D31 EINK_SCK + 14, // D32 EINK_RST + 15, // D33 EINK_MOSI + 16, // D34 EINK_DC + 17, // D35 EINK_BUSY + 19, // D36 EINK_CS + +}; +} + +void initVariant() +{ + pinMode(PIN_QSPI_CS, OUTPUT); + digitalWrite(PIN_QSPI_CS, HIGH); + // This setup is crucial for ensuring low power consumption and proper initialization of the hardware components. + // VBAT_ENABLE + pinMode(BAT_READ, OUTPUT); + digitalWrite(BAT_READ, HIGH); + + pinMode(PIN_LED1, OUTPUT); + digitalWrite(PIN_LED1, LOW); + pinMode(PIN_LED2, OUTPUT); + digitalWrite(PIN_LED2, LOW); +} \ No newline at end of file diff --git a/variants/seeed_wio_tracker_L1_eink/variant.h b/variants/seeed_wio_tracker_L1_eink/variant.h new file mode 100644 index 000000000..98a7b2c39 --- /dev/null +++ b/variants/seeed_wio_tracker_L1_eink/variant.h @@ -0,0 +1,194 @@ +#ifndef _SEEED_TRACKER_L1_H_ +#define _SEEED_TRACKER_L1_H_ +#include "WVariant.h" +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Clock Configuration +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define VARIANT_MCK (64000000ul) // Master clock frequency +#define USE_LFXO // 32.768kHz crystal for LFCLK + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Pin Capacity Definitions +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define PINS_COUNT (38u) // Total GPIO pins +#define NUM_DIGITAL_PINS (38u) // Digital I/O pins +#define NUM_ANALOG_INPUTS (8u) // Analog inputs (A0-A5 + VBAT + AREF) +#define NUM_ANALOG_OUTPUTS (0u) + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// LED Configuration +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// LEDs +// LEDs +#define PIN_LED1 (11) // LED P1.15 +#define PIN_LED2 (12) // + +#define LED_BUILTIN PIN_LED1 +#define LED_CONN PIN_LED2 + +#define LED_GREEN PIN_LED1 +#define LED_BLUE PIN_LED2 +// #define LED_PIN PIN_LED2 +#define LED_STATE_ON 1 // State when LED is litted +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Button Configuration +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +#ifdef BUTTON_PIN +#undef BUTTON_PIN +#endif + +#define BUTTON_PIN D13 // This is the Program Button +// #define BUTTON_NEED_PULLUP 1 +#define BUTTON_ACTIVE_LOW true +#define BUTTON_ACTIVE_PULLUP false + +#define BUTTON_PIN_TOUCH 13 // Touch button +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Digital Pin Mapping (D0-D10) +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define D0 0 // P1.06 GNSS_WAKEUP/IO0 +#define D1 1 // P0.07 LORA_DIO1 +#define D2 2 // P1.07 LORA_RESET +#define D3 3 // P1.10 LORA_BUSY +#define D4 4 // P1.14 LORA_CS +#define D5 5 // P1.08 LORA_SW +#define D6 6 // P0.27 GNSS_TX +#define D7 7 // P0.26 GNSS_RX +#define D8 8 // P0.30 SPI_SCK +#define D9 9 // P0.03 SPI_MISO +#define D10 10 // P0.28 SPI_MOSI +#define D12 12 // P1.00 Buzzer +#define D13 13 // P0.08 User Button +#define D14 14 // P0.05 OLED SCL +#define D15 15 // P0.06 OLED SDA +#define D16 16 // P0.31 VBAT_ADC +#define D17 17 // P0.00 GROVE SDA +#define D18 18 // P0.01 GROVE_SCL +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Analog Pin Definitions +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define PIN_A0 0 // P0.02 Analog Input 0 +#define PIN_A1 1 // P0.03 Analog Input 1 +#define PIN_A2 2 // P0.28 Analog Input 2 +#define PIN_A3 3 // P0.29 Analog Input 3 +#define PIN_A4 4 // P0.04 Analog Input 4 +#define PIN_A5 5 // P0.05 Analog Input 5 +#define PIN_VBAT D16 // P0.31 Battery voltage sense +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Communication Interfaces +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// I2C Configuration +#define HAS_WIRE 1 +#define PIN_WIRE_SDA D18 // P0.09 +#define PIN_WIRE_SCL D17 // P0.10 +#define WIRE_INTERFACES_COUNT 1 + +static const uint8_t SDA = PIN_WIRE_SDA; +static const uint8_t SCL = PIN_WIRE_SCL; + +// SPI Configuration (SX1262) + +// #define SPI_INTERFACES_COUNT 1 +#define PIN_SPI_MISO 9 // P0.03 (D9) +#define PIN_SPI_MOSI 10 // P0.28 (D10) +#define PIN_SPI_SCK 8 // P0.30 (D8) + +// SX1262 LoRa Module Pins +#define USE_SX1262 +#define SX126X_CS D4 // Chip select +#define SX126X_DIO1 D1 // Digital IO 1 (Interrupt) +#define SX126X_BUSY D3 // Busy status +#define SX126X_RESET D2 // Reset control +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 // TCXO supply voltage +#define SX126X_RXEN D5 // RX enable control +#define SX126X_TXEN RADIOLIB_NC +#define SX126X_DIO2_AS_RF_SWITCH // This Line is really necessary for SX1262 to work with RF switch or will loss TX power + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// EINK +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define SPI_INTERFACES_COUNT 2 +#define PIN_EINK_CS 36 +#define PIN_EINK_BUSY 35 +#define PIN_EINK_DC 34 +#define PIN_EINK_RES 32 +#define PIN_EINK_SCLK 31 +#define PIN_EINK_MOSI 33 +#define PIN_EINK_EN 14 // unused +#define PIN_SPI1_MISO 15 // unused +#define PIN_SPI1_MOSI PIN_EINK_MOSI +#define PIN_SPI1_SCK PIN_EINK_SCLK + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Power Management +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +#define BAT_READ 30 // D30 = P0.04 Reads battery voltage from divider on signal board. +#define BATTERY_SENSE_RESOLUTION_BITS 12 +#define ADC_MULTIPLIER 2.0 +#define BATTERY_PIN PIN_VBAT // PIN_A7 +#define AREF_VOLTAGE 3.6 +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// GPS L76KB +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#define GPS_L76K +#ifdef GPS_L76K +#define PIN_GPS_RX D6 // P0.26 +#define PIN_GPS_TX D7 +#define HAS_GPS 1 +#define GPS_BAUDRATE 9600 +#define GPS_THREAD_INTERVAL 50 +#define PIN_SERIAL1_RX PIN_GPS_TX +#define PIN_SERIAL1_TX PIN_GPS_RX + +#define GPS_RX_PIN PIN_GPS_TX +#define GPS_TX_PIN PIN_GPS_RX +#define PIN_GPS_STANDBY D0 + +// #define GPS_DEBUG +// #define GPS_EN D18 // P1.05 +#endif + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// On-board QSPI Flash +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// On-board QSPI Flash +#define PIN_QSPI_SCK (21) +#define PIN_QSPI_CS (22) +#define PIN_QSPI_IO0 (23) +#define PIN_QSPI_IO1 (24) +#define PIN_QSPI_IO2 (25) +#define PIN_QSPI_IO3 (26) + +#define EXTERNAL_FLASH_DEVICES P25Q16H +#define EXTERNAL_FLASH_USE_QSPI + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Buzzer +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Buzzer + +#define PIN_BUZZER D12 // P1.00, pwm output + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// joystick +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +#define CANNED_MESSAGE_MODULE_ENABLE 1 + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Compatibility Definitions +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +#ifdef __cplusplus +extern "C" { +#endif +// Serial port placeholders + +#define PIN_SERIAL2_RX (-1) +#define PIN_SERIAL2_TX (-1) +#ifdef __cplusplus +} +#endif + +#endif // _SEEED_TRACKER_L1_H_ \ No newline at end of file From ad23c065f6f80e27931ec27eb2822e553a7bd7ff Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 26 Jun 2025 07:56:34 -0500 Subject: [PATCH 350/461] Rate limiting fix and added 2 second rate limiting to text messages (#7139) * Rate limiting fix and added 1.5 second rate limiting to text messages * Remove copy-pasta * Update src/mesh/Default.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Two is more reasonable * Two too --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/mesh/Default.h | 1 + src/mesh/PhoneAPI.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mesh/Default.h b/src/mesh/Default.h index fd3f10668..5a6eb61b1 100644 --- a/src/mesh/Default.h +++ b/src/mesh/Default.h @@ -5,6 +5,7 @@ #define ONE_DAY 24 * 60 * 60 #define ONE_MINUTE_MS 60 * 1000 #define THIRTY_SECONDS_MS 30 * 1000 +#define TWO_SECONDS_MS 2 * 1000 #define FIVE_SECONDS_MS 5 * 1000 #define TEN_SECONDS_MS 10 * 1000 diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index e2acd8463..287de38fa 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -670,7 +670,8 @@ bool PhoneAPI::handleToRadioPacket(meshtastic_MeshPacket &p) meshtastic_QueueStatus qs = router->getQueueStatus(); service->sendQueueStatusToPhone(qs, 0, p.id); return false; - } else if (IS_ONE_OF(meshtastic_PortNum_POSITION_APP, meshtastic_PortNum_WAYPOINT_APP, meshtastic_PortNum_ALERT_APP) && + } else if (IS_ONE_OF(p.decoded.portnum, meshtastic_PortNum_POSITION_APP, meshtastic_PortNum_WAYPOINT_APP, + meshtastic_PortNum_ALERT_APP, meshtastic_PortNum_TELEMETRY_APP) && lastPortNumToRadio[p.decoded.portnum] && Throttle::isWithinTimespanMs(lastPortNumToRadio[p.decoded.portnum], TEN_SECONDS_MS)) { // TODO: [Issue #6700] Make this rate limit throttling scale up / down with the preset @@ -680,6 +681,13 @@ bool PhoneAPI::handleToRadioPacket(meshtastic_MeshPacket &p) // FIXME: Figure out why this continues to happen // sendNotification(meshtastic_LogRecord_Level_WARNING, p.id, "Position can only be sent once every 5 seconds"); return false; + } else if (p.decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_APP && lastPortNumToRadio[p.decoded.portnum] && + Throttle::isWithinTimespanMs(lastPortNumToRadio[p.decoded.portnum], TWO_SECONDS_MS)) { + LOG_WARN("Rate limit portnum %d", p.decoded.portnum); + meshtastic_QueueStatus qs = router->getQueueStatus(); + service->sendQueueStatusToPhone(qs, 0, p.id); + sendNotification(meshtastic_LogRecord_Level_WARNING, p.id, "Text messages can only be sent once every 2 seconds"); + return false; } lastPortNumToRadio[p.decoded.portnum] = millis(); service->handleToRadio(p); From 2ab717cebb2e7ff1dced1ec9ee8c2d8510411619 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 26 Jun 2025 10:57:33 -0500 Subject: [PATCH 351/461] Remove bundling of web-ui from ESP32 devices (#7143) --- .github/actions/build-variant/action.yml | 50 ++++++++++++------------ .github/workflows/build_esp32.yml | 2 +- .github/workflows/build_esp32_c3.yml | 2 +- .github/workflows/build_esp32_c6.yml | 2 +- .github/workflows/build_esp32_s3.yml | 2 +- .github/workflows/main_matrix.yml | 1 - bin/build-esp32.sh | 11 +++--- bin/device-install.bat | 19 ++------- bin/device-install.sh | 30 ++++++-------- 9 files changed, 50 insertions(+), 69 deletions(-) diff --git a/.github/actions/build-variant/action.yml b/.github/actions/build-variant/action.yml index 67d002eea..f611908ee 100644 --- a/.github/actions/build-variant/action.yml +++ b/.github/actions/build-variant/action.yml @@ -27,10 +27,10 @@ inputs: description: A newline separated list of paths to store as artifacts required: false default: "" - include-web-ui: - description: Include the web UI in the build - required: false - default: "false" + # include-web-ui: + # description: Include the web UI in the build + # required: false + # default: "false" arch: description: Processor arch name required: true @@ -43,29 +43,29 @@ runs: id: base uses: ./.github/actions/setup-base - - name: Get web ui version - if: inputs.include-web-ui == 'true' - id: webver - shell: bash - run: | - echo "ver=$(cat bin/web.version)" >> $GITHUB_OUTPUT + # - name: Get web ui version + # if: inputs.include-web-ui == 'true' + # id: webver + # shell: bash + # run: | + # echo "ver=$(cat bin/web.version)" >> $GITHUB_OUTPUT - - name: Pull web ui - if: inputs.include-web-ui == 'true' - uses: dsaltares/fetch-gh-release-asset@master - with: - repo: meshtastic/web - file: build.tar - target: build.tar - token: ${{ inputs.github_token }} - version: tags/v${{ steps.webver.outputs.ver }} + # - name: Pull web ui + # if: inputs.include-web-ui == 'true' + # uses: dsaltares/fetch-gh-release-asset@master + # with: + # repo: meshtastic/web + # file: build.tar + # target: build.tar + # token: ${{ inputs.github_token }} + # version: tags/v${{ steps.webver.outputs.ver }} - - name: Unpack web ui - if: inputs.include-web-ui == 'true' - shell: bash - run: | - tar -xf build.tar -C data/static - rm build.tar + # - name: Unpack web ui + # if: inputs.include-web-ui == 'true' + # shell: bash + # run: | + # tar -xf build.tar -C data/static + # rm build.tar - name: Remove debug flags for release shell: bash diff --git a/.github/workflows/build_esp32.yml b/.github/workflows/build_esp32.yml index 4fc31f22c..616f51746 100644 --- a/.github/workflows/build_esp32.yml +++ b/.github/workflows/build_esp32.yml @@ -33,5 +33,5 @@ jobs: artifact-paths: | release/*.bin release/*.elf - include-web-ui: true + #include-web-ui: true arch: esp32 diff --git a/.github/workflows/build_esp32_c3.yml b/.github/workflows/build_esp32_c3.yml index 546762952..1b6b832e9 100644 --- a/.github/workflows/build_esp32_c3.yml +++ b/.github/workflows/build_esp32_c3.yml @@ -33,5 +33,5 @@ jobs: artifact-paths: | release/*.bin release/*.elf - include-web-ui: true + #include-web-ui: true arch: esp32c3 diff --git a/.github/workflows/build_esp32_c6.yml b/.github/workflows/build_esp32_c6.yml index 56d4d806d..29dac51e1 100644 --- a/.github/workflows/build_esp32_c6.yml +++ b/.github/workflows/build_esp32_c6.yml @@ -33,5 +33,5 @@ jobs: artifact-paths: | release/*.bin release/*.elf - include-web-ui: true + #include-web-ui: true arch: esp32c6 diff --git a/.github/workflows/build_esp32_s3.yml b/.github/workflows/build_esp32_s3.yml index a9c067ee1..7e0373503 100644 --- a/.github/workflows/build_esp32_s3.yml +++ b/.github/workflows/build_esp32_s3.yml @@ -33,5 +33,5 @@ jobs: artifact-paths: | release/*.bin release/*.elf - include-web-ui: true + #include-web-ui: true arch: esp32s3 diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 9b9877e04..03e61d572 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -257,7 +257,6 @@ jobs: ./device-*.sh ./device-*.bat ./littlefs-*.bin - ./littlefswebui-*.bin ./bleota*bin ./Meshtastic_nRF52_factory_erase*.uf2 retention-days: 30 diff --git a/bin/build-esp32.sh b/bin/build-esp32.sh index a0635e997..96578e914 100755 --- a/bin/build-esp32.sh +++ b/bin/build-esp32.sh @@ -34,11 +34,12 @@ SRCBIN=.pio/build/$1/firmware.bin cp $SRCBIN $OUTDIR/$basename-update.bin echo "Building Filesystem for ESP32 targets" -pio run --environment $1 -t buildfs -cp .pio/build/$1/littlefs.bin $OUTDIR/littlefswebui-$1-$VERSION.bin -# Remove webserver files from the filesystem and rebuild -ls -l data/static # Diagnostic list of files -rm -rf data/static +# If you want to build the webui, uncomment the following lines +# pio run --environment $1 -t buildfs +# cp .pio/build/$1/littlefs.bin $OUTDIR/littlefswebui-$1-$VERSION.bin +# # Remove webserver files from the filesystem and rebuild +# ls -l data/static # Diagnostic list of files +# rm -rf data/static pio run --environment $1 -t buildfs cp .pio/build/$1/littlefs.bin $OUTDIR/littlefs-$1-$VERSION.bin cp bin/device-install.* $OUTDIR diff --git a/bin/device-install.bat b/bin/device-install.bat index 816d2fbba..12bfd4f6e 100755 --- a/bin/device-install.bat +++ b/bin/device-install.bat @@ -5,7 +5,6 @@ TITLE Meshtastic device-install SET "SCRIPT_NAME=%~nx0" SET "DEBUG=0" SET "PYTHON=" -SET "WEB_APP=0" SET "TFT_BUILD=0" SET "BIGDB8=0" SET "BIGDB16=0" @@ -25,7 +24,7 @@ GOTO getopts :help ECHO Flash image file to device, but first erasing and writing system information. ECHO. -ECHO Usage: %SCRIPT_NAME% -f filename [-p PORT] [-P python] (--web) [--1200bps-reset] +ECHO Usage: %SCRIPT_NAME% -f filename [-p PORT] [-P python] [--1200bps-reset] ECHO. ECHO Options: ECHO -f filename The firmware .bin file to flash. Custom to your device type and region. (required) @@ -35,13 +34,12 @@ ECHO If not set, ESPTOOL iterates all ports (Dangerous). ECHO -P python Specify alternate python interpreter to use to invoke esptool. (default: python) ECHO If supplied the script will use python. ECHO If not supplied the script will try to find esptool in Path. -ECHO --web Enable WebUI. (default: false) ECHO --1200bps-reset Attempt to place the device in correct mode. (1200bps Reset) ECHO Some hardware requires this twice. ECHO. ECHO Example: %SCRIPT_NAME% -p COM17 --1200bps-reset ECHO Example: %SCRIPT_NAME% -f firmware-t-deck-tft-2.6.0.0b106d4.bin -p COM11 -ECHO Example: %SCRIPT_NAME% -f firmware-unphone-2.6.0.0b106d4.bin -p COM11 --web +ECHO Example: %SCRIPT_NAME% -f firmware-unphone-2.6.0.0b106d4.bin -p COM11 GOTO eof :version @@ -61,7 +59,6 @@ IF /I "%~1"=="-f" SET "FILENAME=%~2" & SHIFT IF "%~1"=="-p" SET "ESPTOOL_PORT=%~2" & SHIFT IF /I "%~1"=="--port" SET "ESPTOOL_PORT=%~2" & SHIFT IF "%~1"=="-P" SET "PYTHON=%~2" & SHIFT -IF /I "%~1"=="--web" SET "WEB_APP=1" IF /I "%~1"=="--1200bps-reset" SET "BPS_RESET=1" SHIFT GOTO getopts @@ -153,9 +150,6 @@ IF %BPS_RESET% EQU 1 ( @REM https://github.com/meshtastic/web-flasher/blob/main/types/resources.ts#L3 IF NOT "!FILENAME:-tft-=!"=="!FILENAME!" ( CALL :LOG_MESSAGE DEBUG "We are working with a *-tft-* file. !FILENAME!" - IF %WEB_APP% EQU 1 ( - CALL :LOG_MESSAGE ERROR "Cannot enable WebUI (--web) and MUI." & GOTO eof - ) SET "TFT_BUILD=1" ) ELSE ( CALL :LOG_MESSAGE DEBUG "We are NOT working with a *-tft-* file. !FILENAME!" @@ -209,13 +203,8 @@ SET "OTA_FILENAME=bleota.bin" :end_loop_c3 CALL :LOG_MESSAGE DEBUG "Set OTA_FILENAME to: !OTA_FILENAME!" -@REM Check if (--web) is enabled and prefix BASENAME with "littlefswebui-" else "littlefs-". -IF %WEB_APP% EQU 1 ( - CALL :LOG_MESSAGE INFO "WebUI selected." - SET "SPIFFS_FILENAME=littlefswebui-%BASENAME%" -) ELSE ( - SET "SPIFFS_FILENAME=littlefs-%BASENAME%" -) +@REM Set SPIFFS filename with "littlefs-" prefix. +SET "SPIFFS_FILENAME=littlefs-%BASENAME%" CALL :LOG_MESSAGE DEBUG "Set SPIFFS_FILENAME to: !SPIFFS_FILENAME!" @REM Default offsets. diff --git a/bin/device-install.sh b/bin/device-install.sh index 613696d2f..42d0c4089 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -1,14 +1,18 @@ #!/bin/bash PYTHON=${PYTHON:-$(which python3 python | head -n 1)} -WEB_APP=false BPS_RESET=false TFT_BUILD=false MCU="" # Variant groups BIGDB_8MB=( - "picomputer-s3" + # Check if FILENAME contains "-tft-" and set target partitionScheme accordingly. +if [[ $FILENAME == *"-tft-"* ]]; then + TFT_BUILD=true +fi + +# Extract BASENAME from %FILENAME% for later use.r-s3" "unphone" "seeed-sensecap-indicator" "crowpanel-esp32s3" @@ -76,14 +80,13 @@ set -e # Usage info show_help() { cat < Date: Thu, 26 Jun 2025 11:19:54 -0500 Subject: [PATCH 352/461] Fixed triple click GPS toggle bungle --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index f3147520f..2251241da 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1016,7 +1016,8 @@ void setup() BaseType_t higherWake = 0; mainDelay.interruptFromISR(&higherWake); }, - INPUT_BROKER_USER_PRESS, INPUT_BROKER_SHUTDOWN, 5000, INPUT_BROKER_SEND_PING, INPUT_BROKER_GPS_TOGGLE); + INPUT_BROKER_USER_PRESS, INPUT_BROKER_SHUTDOWN, 5000, INPUT_BROKER_SEND_PING, INPUT_BROKER_NONE, 0, + INPUT_BROKER_GPS_TOGGLE); #endif #endif From 50424d1035a0bb2d34e852cbf3bb47cc22a0559d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Jun 2025 12:39:03 -0500 Subject: [PATCH 353/461] chore(deps): update meshtastic/web to v2.6.4 (#7017) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- bin/web.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/web.version b/bin/web.version index a4db534a2..e46a05b19 100644 --- a/bin/web.version +++ b/bin/web.version @@ -1 +1 @@ -2.5.3 \ No newline at end of file +2.6.4 \ No newline at end of file From 18fbc2149d5b3844e9de29966df536417c1d84ac Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 26 Jun 2025 19:23:08 -0500 Subject: [PATCH 354/461] Fix iOS bluetooth crash: Ensure UINT32_MAX is not used (#7147) --- src/mesh/Default.h | 1 + src/mesh/NodeDB.cpp | 32 ++++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/mesh/Default.h b/src/mesh/Default.h index 5a6eb61b1..7a38e21f1 100644 --- a/src/mesh/Default.h +++ b/src/mesh/Default.h @@ -8,6 +8,7 @@ #define TWO_SECONDS_MS 2 * 1000 #define FIVE_SECONDS_MS 5 * 1000 #define TEN_SECONDS_MS 10 * 1000 +#define MAX_INTERVAL INT32_MAX // FIXME: INT32_MAX to avoid overflow issues with Apple clients but should be UINT32_MAX #define min_default_telemetry_interval_secs 30 * 60 #define default_gps_update_interval IF_ROUTER(ONE_DAY, 2 * 60) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index f4f50f8b0..3eb3a5173 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -339,6 +339,22 @@ NodeDB::NodeDB() moduleConfig.telemetry.health_update_interval = Default::getConfiguredOrMinimumValue( moduleConfig.telemetry.health_update_interval, min_default_telemetry_interval_secs); } + // FIXME: UINT32_MAX intervals overflows Apple clients until they are fully patched + if (config.device.node_info_broadcast_secs > MAX_INTERVAL) + config.device.node_info_broadcast_secs = MAX_INTERVAL; + if (config.position.position_broadcast_secs > MAX_INTERVAL) + config.position.position_broadcast_secs = MAX_INTERVAL; + if (moduleConfig.neighbor_info.update_interval > MAX_INTERVAL) + moduleConfig.neighbor_info.update_interval = MAX_INTERVAL; + if (moduleConfig.telemetry.device_update_interval > MAX_INTERVAL) + moduleConfig.telemetry.device_update_interval = MAX_INTERVAL; + if (moduleConfig.telemetry.environment_update_interval > MAX_INTERVAL) + moduleConfig.telemetry.environment_update_interval = MAX_INTERVAL; + if (moduleConfig.telemetry.air_quality_interval > MAX_INTERVAL) + moduleConfig.telemetry.air_quality_interval = MAX_INTERVAL; + if (moduleConfig.telemetry.health_update_interval > MAX_INTERVAL) + moduleConfig.telemetry.health_update_interval = MAX_INTERVAL; + if (moduleConfig.mqtt.has_map_report_settings && moduleConfig.mqtt.map_report_settings.publish_interval_secs < default_map_publish_interval_secs) { moduleConfig.mqtt.map_report_settings.publish_interval_secs = default_map_publish_interval_secs; @@ -900,14 +916,14 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role) moduleConfig.telemetry.device_update_interval = ONE_DAY; } else if (role == meshtastic_Config_DeviceConfig_Role_CLIENT_HIDDEN) { config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_LOCAL_ONLY; - config.device.node_info_broadcast_secs = UINT32_MAX; + config.device.node_info_broadcast_secs = MAX_INTERVAL; config.position.position_broadcast_smart_enabled = false; - config.position.position_broadcast_secs = UINT32_MAX; - moduleConfig.neighbor_info.update_interval = UINT32_MAX; - moduleConfig.telemetry.device_update_interval = UINT32_MAX; - moduleConfig.telemetry.environment_update_interval = UINT32_MAX; - moduleConfig.telemetry.air_quality_interval = UINT32_MAX; - moduleConfig.telemetry.health_update_interval = UINT32_MAX; + config.position.position_broadcast_secs = MAX_INTERVAL; + moduleConfig.neighbor_info.update_interval = MAX_INTERVAL; + moduleConfig.telemetry.device_update_interval = MAX_INTERVAL; + moduleConfig.telemetry.environment_update_interval = MAX_INTERVAL; + moduleConfig.telemetry.air_quality_interval = MAX_INTERVAL; + moduleConfig.telemetry.health_update_interval = MAX_INTERVAL; } } @@ -917,7 +933,7 @@ void NodeDB::initModuleConfigIntervals() #ifdef USERPREFS_CONFIG_DEVICE_TELEM_UPDATE_INTERVAL moduleConfig.telemetry.device_update_interval = USERPREFS_CONFIG_DEVICE_TELEM_UPDATE_INTERVAL; #else - moduleConfig.telemetry.device_update_interval = UINT32_MAX; + moduleConfig.telemetry.device_update_interval = MAX_INTERVAL; #endif moduleConfig.telemetry.environment_update_interval = 0; moduleConfig.telemetry.air_quality_interval = 0; From 29e7a71c97b767d27998e5145a2243629550aef1 Mon Sep 17 00:00:00 2001 From: Jason P Date: Thu, 26 Jun 2025 22:11:20 -0500 Subject: [PATCH 355/461] 2.7 Miscellaneous Fixes - Week 1 (#7102) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update Favorite Node Message Options to unify against other screens * Rebuild Horizontal Battery, Resolve overlap concerns * Update positioning on Message frame and fix drawCommonHeader overlay * Beginnings of creating isHighResolution bool * Fixup determineResolution() * Implement isHighResolution in place of SCREEN_WIDTH > 128 checks * Line Spacing bound to isHighResolution * Analog Clock for all * Add AM/PM to Analog Clock if isHighResolution and not TWatch * Simple Menu Queue, and add time menu * Fix prompt string for 12/24 hour picker * More menu banners into functions * Fix Action Menu on Home frame * Correct pop-up calculation size and continue to leverage isHighResolution * Move menu bits to MenuHandler * Plumb in the digital/analog picker * Correct Clock Face Picker title * Clock picker fixes * Migrate the rest of the menus to MenuHandler.* * Add compass menu and needle point option * Minor fix for compass point menu * Correct Home menu into typical format * Fix emoji bounce, overlap, and missing commonHeader * Sanitize long_names and removed unused variables * Slightly better sanitizeString variation * Resolved apostrophe being shown as upside down question mark * Gotta keep height and width in expected order * Remove Second Hand for Analog Clock on EInk displays * Fix Clock menu option decision tree * Improvements to Eink Navigation * Pause Banner for Eink moved to bottom * Updated working for 12-/24-hour menu and Added US/Arizona to timezone picker * Add Adhoc Ping and resolve error with std::string sanitized * Hide quick toggle as option is available within Action Menu, commented out for the moment * Remove old battery icon and option, use drawCommonHeader throughout, re-add battery to Clock frames * fix misc build warnings. NFC * Update Analog Clock on EInk to show more digits * Establish Action Menu on all node list screens, add NodeDB reset (with confirmation) option * Add Toggle Backlight for EInk Displays * Suppress action screen Full refresh for Eink * Adjust drawBluetoothConnectedIcon on TWatch * Maintain clock frame when switching between Clock Faces * Move modules beyond the clock in navigation * addressed the conflicts, and changed target branch to 2.7-MiscFixes-Week1 * cleanup, cheers * Add AM/PM to low resolution clock also * Small adjustments to AM/PM replacement across various devices * Resolve dangling pointer issues with sanitize code * Update comments for Screen.cpp related to module load change * Trunk runs * Update message caching to correct aged timestamp * Menu wording adjustments * Time Format wording * Use all the rows on EInk since with autohide the navigation bar * Finalize Time Format picker word change * Retired drawFunctionOverlay code No longer being used * Actually honor the points-north setting * Trunk * Compressed action list * Update no-op showOverlayBanner function * trunk * Correct T_Watch_S3 specific line * Autosized Action menu per screen * Finalize Autosized Action menu per screen * Unify Message Titles * Reorder Timezones to match expectations * Adjust text location for pop-ups * Revert "Actually honor the points-north setting" This reverts commit 20988aa4fabb0975be644989d556fca7e1176680. * Make NodeDB sort its internal vector when lastheard is updated. Don't sort in NodeListRenderer * Update src/graphics/draw/NodeListRenderer.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/mesh/NodeDB.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Pass by reference -- Thanks Copilot! * Throttle sorting just a touch * Check more carefully for own node * Eliminate some now-unneeded sorting * Move function after include * Putting Modules back to position 0 and some trunk checks found * Add Scrollbar for Action menus * Second attempt to move modules down the navigation bar * Continue effort of moving modules in the navigation * Canned Messages tweak * Replicate Function + Space through the Menu System * Move init button parameters into config struct (#7145) * Remove bundling of web-ui from ESP32 devices (#7143) * Fixed triple click GPS toggle bungle * Move init button parameters into config struct * Reapply "Actually honor the points-north setting" This reverts commit 42c1967e7b3735ec9f5be8acd9582bc9edcbc78a. * Actually do compass pointings correctly * Tweak to node bearings * Menu wording tweaks * Get the compass_north_top logic right * Don't jump frames after setting Compass * Get rid of the extra bearingTo functions * Don't blink Mail on EInk Clock Screens * Actually set lat and long * Calibrate * Convert Radians to Degrees * More degree vs radians fixes * De-duplicate draw arrow function * Don't advertise compass calibration without an accell thread. --------- Co-authored-by: Ben Meadors Co-authored-by: Jonathan Bennett Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> Co-authored-by: Thomas Göttgens Co-authored-by: csrutil Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/graphics/Screen.cpp | 308 +++-------- src/graphics/Screen.h | 24 +- src/graphics/SharedUIDisplay.cpp | 99 ++-- src/graphics/SharedUIDisplay.h | 4 +- src/graphics/draw/ClockRenderer.cpp | 105 ++-- src/graphics/draw/ClockRenderer.h | 4 +- src/graphics/draw/CompassRenderer.cpp | 27 +- src/graphics/draw/CompassRenderer.h | 3 - src/graphics/draw/DebugRenderer.cpp | 29 +- src/graphics/draw/MenuHandler.cpp | 479 ++++++++++++++++++ src/graphics/draw/MenuHandler.h | 40 ++ src/graphics/draw/MessageRenderer.cpp | 191 ++++--- src/graphics/draw/MessageRenderer.h | 12 + src/graphics/draw/NodeListRenderer.cpp | 132 ++--- src/graphics/draw/NodeListRenderer.h | 7 - src/graphics/draw/NotificationRenderer.cpp | 215 ++++---- src/graphics/draw/NotificationRenderer.h | 3 +- src/graphics/draw/UIRenderer.cpp | 246 ++++----- src/graphics/draw/UIRenderer.h | 5 - src/graphics/images.h | 38 +- src/input/ButtonThread.cpp | 48 +- src/input/ButtonThread.h | 27 +- src/main.cpp | 154 +++--- src/mesh/MeshModule.cpp | 7 +- src/mesh/MeshModule.h | 2 +- src/mesh/NodeDB.cpp | 26 + src/mesh/NodeDB.h | 2 + src/modules/CannedMessageModule.cpp | 7 +- src/modules/KeyVerificationModule.cpp | 4 +- src/modules/SystemCommandsModule.cpp | 8 +- .../Telemetry/EnvironmentTelemetry.cpp | 4 +- src/modules/Telemetry/PowerTelemetry.cpp | 4 +- src/modules/WaypointModule.cpp | 14 +- src/serialization/MeshPacketSerializer.cpp | 12 +- variants/portduino/platformio.ini | 3 - variants/rak4631/variant.h | 4 +- 36 files changed, 1429 insertions(+), 868 deletions(-) create mode 100644 src/graphics/draw/MenuHandler.cpp create mode 100644 src/graphics/draw/MenuHandler.h diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 0818619a6..c8c9d8b74 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -31,6 +31,7 @@ along with this program. If not, see . #include "TimeFormatters.h" #include "draw/ClockRenderer.h" #include "draw/DebugRenderer.h" +#include "draw/MenuHandler.h" #include "draw/MessageRenderer.h" #include "draw/NodeListRenderer.h" #include "draw/NotificationRenderer.h" @@ -135,13 +136,17 @@ extern bool hasUnreadMessage; // The banner appears in the center of the screen and disappears after the specified duration // Called to trigger a banner with custom message and duration -void Screen::showOverlayBanner(const char *message, uint32_t durationMs, uint8_t options, std::function bannerCallback, - int8_t InitialSelected) +void Screen::showOverlayBanner(const char *message, uint32_t durationMs, const char **optionsArrayPtr, uint8_t options, + std::function bannerCallback, int8_t InitialSelected) { +#ifdef USE_EINK + EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip full refresh for all overlay menus +#endif // Store the message and set the expiration timestamp strncpy(NotificationRenderer::alertBannerMessage, message, 255); NotificationRenderer::alertBannerMessage[255] = '\0'; // Ensure null termination NotificationRenderer::alertBannerUntil = (durationMs == 0) ? 0 : millis() + durationMs; + NotificationRenderer::optionsArrayPtr = optionsArrayPtr; NotificationRenderer::alertBannerOptions = options; NotificationRenderer::alertBannerCallback = bannerCallback; NotificationRenderer::curSelected = InitialSelected; @@ -203,7 +208,7 @@ float Screen::estimatedHeading(double lat, double lon) if (d < 10) // haven't moved enough, just keep current bearing return b; - b = GeoCoord::bearing(oldLat, oldLon, lat, lon); + b = GeoCoord::bearing(oldLat, oldLon, lat, lon) * RAD_TO_DEG; oldLat = lat; oldLon = lon; @@ -413,8 +418,7 @@ void Screen::setup() // === Set custom overlay callbacks === static OverlayCallback overlays[] = { - graphics::UIRenderer::drawFunctionOverlay, // For mute/buzzer modifiers etc. - graphics::UIRenderer::drawNavigationBar // Custom indicator icons for each frame + graphics::UIRenderer::drawNavigationBar // Custom indicator icons for each frame }; ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); @@ -471,6 +475,7 @@ void Screen::setup() // === Turn on display and trigger first draw === handleSetOn(true); + determineResolution(dispdev->height(), dispdev->width()); ui->update(); #ifndef USE_EINK ui->update(); // Some SSD1306 clones drop the first draw, so run twice @@ -557,6 +562,7 @@ int32_t Screen::runOnce() if (displayHeight == 0) { displayHeight = dispdev->getHeight(); } + menuHandler::handleMenuSwitch(); // Show boot screen for first logo_timeout seconds, then switch to normal operation. // serialSinceMsec adjusts for additional serial wait time during nRF52 bootup @@ -585,7 +591,7 @@ int32_t Screen::runOnce() #ifndef DISABLE_WELCOME_UNSET if (!NotificationRenderer::isOverlayBannerShowing() && config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_UNSET) { - LoraRegionPicker(0); + menuHandler::LoraRegionPicker(0); } #endif if (!NotificationRenderer::isOverlayBannerShowing() && rebootAtMsec != 0) { @@ -768,32 +774,6 @@ void Screen::setFrames(FrameFocus focus) indicatorIcons.clear(); size_t numframes = 0; - moduleFrames = MeshModule::GetMeshModulesWithUIFrames(); - LOG_DEBUG("Show %d module frames", moduleFrames.size()); - - // put all of the module frames first. - // this is a little bit of a dirty hack; since we're going to call - // the same drawModuleFrame handler here for all of these module frames - // and then we'll just assume that the state->currentFrame value - // is the same offset into the moduleFrames vector - // so that we can invoke the module's callback - for (auto i = moduleFrames.begin(); i != moduleFrames.end(); ++i) { - // Draw the module frame, using the hack described above - normalFrames[numframes] = drawModuleFrame; - - // Check if the module being drawn has requested focus - // We will honor this request later, if setFrames was triggered by a UIFrameEvent - MeshModule *m = *i; - if (m->isRequestingFocus()) - fsi.positions.focusedModule = numframes; - if (m == waypointModule) - fsi.positions.waypoint = numframes; - - indicatorIcons.push_back(icon_module); - numframes++; - } - - LOG_DEBUG("Added modules. numframes: %d", numframes); // If we have a critical fault, show it first fsi.positions.fault = numframes; @@ -807,7 +787,7 @@ void Screen::setFrames(FrameFocus focus) fsi.positions.clock = numframes; normalFrames[numframes++] = graphics::ClockRenderer::digitalWatchFace ? graphics::ClockRenderer::drawDigitalClockFrame : &graphics::ClockRenderer::drawAnalogClockFrame; - indicatorIcons.push_back(icon_clock); + indicatorIcons.push_back(digital_icon_clock); #endif // Declare this early so it’s available in FOCUS_PRESERVE block @@ -822,22 +802,27 @@ void Screen::setFrames(FrameFocus focus) indicatorIcons.push_back(icon_mail); #ifndef USE_EINK + fsi.positions.nodelist = numframes; normalFrames[numframes++] = graphics::NodeListRenderer::drawDynamicNodeListScreen; indicatorIcons.push_back(icon_nodes); #endif // Show detailed node views only on E-Ink builds #ifdef USE_EINK + fsi.positions.nodelist_lastheard = numframes; normalFrames[numframes++] = graphics::NodeListRenderer::drawLastHeardScreen; indicatorIcons.push_back(icon_nodes); + fsi.positions.nodelist_hopsignal = numframes; normalFrames[numframes++] = graphics::NodeListRenderer::drawHopSignalScreen; indicatorIcons.push_back(icon_signal); + fsi.positions.nodelist_distance = numframes; normalFrames[numframes++] = graphics::NodeListRenderer::drawDistanceScreen; indicatorIcons.push_back(icon_distance); #endif #if HAS_GPS + fsi.positions.nodelist_bearings = numframes; normalFrames[numframes++] = graphics::NodeListRenderer::drawNodeListWithCompasses; indicatorIcons.push_back(icon_list); @@ -857,8 +842,9 @@ void Screen::setFrames(FrameFocus focus) } #if !defined(DISPLAY_CLOCK_FRAME) fsi.positions.clock = numframes; - normalFrames[numframes++] = graphics::ClockRenderer::drawDigitalClockFrame; - indicatorIcons.push_back(icon_clock); + normalFrames[numframes++] = graphics::ClockRenderer::digitalWatchFace ? graphics::ClockRenderer::drawDigitalClockFrame + : graphics::ClockRenderer::drawAnalogClockFrame; + indicatorIcons.push_back(digital_icon_clock); #endif // We don't show the node info of our node (if we have it yet - we should) @@ -885,6 +871,36 @@ void Screen::setFrames(FrameFocus focus) } #endif + // Beware of what changes you make in this code! + // We pass numfames into GetMeshModulesWithUIFrames() which is highly important! + // Inside of that callback, goes over to MeshModule.cpp and we run + // modulesWithUIFrames.resize(startIndex, nullptr), to insert nullptr + // entries until we're ready to start building the matching entries. + // We are doing our best to keep the normalFrames vector + // and the moduleFrames vector in lock step. + moduleFrames = MeshModule::GetMeshModulesWithUIFrames(numframes); + LOG_DEBUG("Show %d module frames", moduleFrames.size()); + + for (auto i = moduleFrames.begin(); i != moduleFrames.end(); ++i) { + // Draw the module frame, using the hack described above + if (*i != nullptr) { + normalFrames[numframes] = drawModuleFrame; + + // Check if the module being drawn has requested focus + // We will honor this request later, if setFrames was triggered by a UIFrameEvent + MeshModule *m = *i; + if (m && m->isRequestingFocus()) + fsi.positions.focusedModule = numframes; + if (m && m == waypointModule) + fsi.positions.waypoint = numframes; + + indicatorIcons.push_back(icon_module); + numframes++; + } + } + + LOG_DEBUG("Added modules. numframes: %d", numframes); + fsi.frameCount = numframes; // Total framecount is used to apply FOCUS_PRESERVE this->frameCount = numframes; // ✅ Save frame count for use in custom overlay LOG_DEBUG("Finished build frames. numframes: %d", numframes); @@ -916,6 +932,11 @@ void Screen::setFrames(FrameFocus focus) // If no module requested focus, will show the first frame instead ui->switchToFrame(fsi.positions.focusedModule); break; + case FOCUS_CLOCK: + // Whichever frame was marked by MeshModule::requestFocus(), if any + // If no module requested focus, will show the first frame instead + ui->switchToFrame(fsi.positions.clock); + break; case FOCUS_PRESERVE: // No more adjustment — force stay on same index @@ -1204,6 +1225,8 @@ int Screen::handleInputEvent(const InputEvent *event) ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); setFastFramerate(); // Draw ASAP ui->update(); + + menuHandler::handleMenuSwitch(); return 0; } /* @@ -1229,7 +1252,7 @@ int Screen::handleInputEvent(const InputEvent *event) // Ask any MeshModules if they're handling keyboard input right now bool inputIntercepted = false; for (MeshModule *module : moduleFrames) { - if (module->interceptingKeyboardInput()) + if (module && module->interceptingKeyboardInput()) inputIntercepted = true; } @@ -1241,129 +1264,36 @@ int Screen::handleInputEvent(const InputEvent *event) showNextFrame(); } else if (event->inputEvent == INPUT_BROKER_SELECT) { if (this->ui->getUiState()->currentFrame == framesetInfo.positions.home) { - const char *banner_message; - int options; - if (kb_found) { - banner_message = "Action?\nBack\nSleep Screen\nNew Preset Msg\nNew Freetext Msg"; - options = 4; - } else { - banner_message = "Action?\nBack\nSleep Screen\nNew Preset Msg"; - options = 3; - } - showOverlayBanner(banner_message, 30000, options, [](int selected) -> void { - if (selected == 1) { - screen->setOn(false); - } else if (selected == 2) { - cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST); - } else if (selected == 3) { - cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST); - } - }); + menuHandler::homeBaseMenu(); #if HAS_TFT } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.memory) { - showOverlayBanner("Switch to MUI?\nYes\nNo", 30000, 2, [](int selected) -> void { - if (selected == 0) { - config.display.displaymode = meshtastic_Config_DisplayConfig_DisplayMode_COLOR; - config.bluetooth.enabled = false; - service->reloadConfig(SEGMENT_CONFIG); - rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); - } - }); + menuHandler::switchToMUIMenu(); #else } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.memory) { - showOverlayBanner( - "Beeps Mode\nAll Enabled\nDisabled\nNotifications\nSystem Only", 30000, 4, - [](int selected) -> void { - config.device.buzzer_mode = (meshtastic_Config_DeviceConfig_BuzzerMode)selected; - service->reloadConfig(SEGMENT_CONFIG); - }, - config.device.buzzer_mode); + menuHandler::BuzzerModeMenu(); #endif #if HAS_GPS } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.gps && gps) { - showOverlayBanner( - "Toggle GPS\nBack\nEnabled\nDisabled", 30000, 3, - [](int selected) -> void { - if (selected == 1) { - config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_ENABLED; - playGPSEnableBeep(); - gps->enable(); - service->reloadConfig(SEGMENT_CONFIG); - } else if (selected == 2) { - config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_DISABLED; - playGPSDisableBeep(); - gps->disable(); - service->reloadConfig(SEGMENT_CONFIG); - } - }, - config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED ? 1 - : 2); // set inital selection + menuHandler::positionBaseMenu(); #endif } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.clock) { - TZPicker(); + menuHandler::clockMenu(); } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.lora) { - LoraRegionPicker(); + menuHandler::LoraRegionPicker(); } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.textMessage && devicestate.rx_text_message.from) { - const char *banner_message; - int options; - if (kb_found) { - banner_message = "Message Action?\nBack\nDismiss\nReply via Preset\nReply via Freetext"; - options = 4; - } else { - banner_message = "Message Action?\nBack\nDismiss\nReply via Preset"; - options = 3; - } -#ifdef HAS_I2S - banner_message = "Message Action?\nBack\nDismiss\nReply via Preset\nReply via Freetext\nRead Aloud"; - options = 5; -#endif - showOverlayBanner(banner_message, 30000, options, [](int selected) -> void { - if (selected == 1) { - screen->dismissCurrentFrame(); - } else if (selected == 2) { - if (devicestate.rx_text_message.to == NODENUM_BROADCAST) { - cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST, - devicestate.rx_text_message.channel); - } else { - cannedMessageModule->LaunchWithDestination(devicestate.rx_text_message.from); - } - } else if (selected == 3) { - if (devicestate.rx_text_message.to == NODENUM_BROADCAST) { - cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST, - devicestate.rx_text_message.channel); - } else { - cannedMessageModule->LaunchFreetextWithDestination(devicestate.rx_text_message.from); - } - } -#ifdef HAS_I2S - else if (selected == 4) { - const meshtastic_MeshPacket &mp = devicestate.rx_text_message; - const char *msg = reinterpret_cast(mp.decoded.payload.bytes); - - audioThread->readAloud(msg); - } -#endif - }); + menuHandler::messageResponseMenu(); } else if (framesetInfo.positions.firstFavorite != 255 && this->ui->getUiState()->currentFrame >= framesetInfo.positions.firstFavorite && this->ui->getUiState()->currentFrame <= framesetInfo.positions.lastFavorite) { - const char *banner_message; - int options; - if (kb_found) { - banner_message = "Message Node?\nCancel\nNew Preset Msg\nNew Freetext Msg"; - options = 3; - } else { - banner_message = "Message Node?\nCancel\nConfirm"; - options = 2; - } - showOverlayBanner(banner_message, 30000, options, [](int selected) -> void { - if (selected == 1) { - cannedMessageModule->LaunchWithDestination(graphics::UIRenderer::currentFavoriteNodeNum); - } else if (selected == 2) { - cannedMessageModule->LaunchFreetextWithDestination(graphics::UIRenderer::currentFavoriteNodeNum); - } - }); + menuHandler::favoriteBaseMenu(); + } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.nodelist || + this->ui->getUiState()->currentFrame == framesetInfo.positions.nodelist_lastheard || + this->ui->getUiState()->currentFrame == framesetInfo.positions.nodelist_hopsignal || + this->ui->getUiState()->currentFrame == framesetInfo.positions.nodelist_distance || + this->ui->getUiState()->currentFrame == framesetInfo.positions.nodelist_hopsignal || + this->ui->getUiState()->currentFrame == framesetInfo.positions.nodelist_bearings) { + menuHandler::nodeListMenu(); } } else if (event->inputEvent == INPUT_BROKER_BACK) { showPrevFrame(); @@ -1397,96 +1327,6 @@ bool Screen::isOverlayBannerShowing() return NotificationRenderer::isOverlayBannerShowing(); } -void Screen::LoraRegionPicker(uint32_t duration) -{ - showOverlayBanner( - "Set the LoRa " - "region\nBack\nUS\nEU_433\nEU_868\nCN\nJP\nANZ\nKR\nTW\nRU\nIN\nNZ_865\nTH\nLORA_24\nUA_433\nUA_868\nMY_433\nMY_" - "919\nSG_" - "923\nPH_433\nPH_868\nPH_915\nANZ_433", - duration, 23, - [](int selected) -> void { - if (selected != 0 && config.lora.region != _meshtastic_Config_LoRaConfig_RegionCode(selected)) { - config.lora.region = _meshtastic_Config_LoRaConfig_RegionCode(selected); - // This is needed as we wait til picking the LoRa region to generate keys for the first time. - if (!owner.is_licensed) { - bool keygenSuccess = false; - if (config.security.private_key.size == 32) { - // public key is derived from private, so this will always have the same result. - if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) { - keygenSuccess = true; - } - } else { - LOG_INFO("Generate new PKI keys"); - crypto->generateKeyPair(config.security.public_key.bytes, config.security.private_key.bytes); - keygenSuccess = true; - } - if (keygenSuccess) { - config.security.public_key.size = 32; - config.security.private_key.size = 32; - owner.public_key.size = 32; - memcpy(owner.public_key.bytes, config.security.public_key.bytes, 32); - } - } - config.lora.tx_enabled = true; - initRegion(); - if (myRegion->dutyCycle < 100) { - config.lora.ignore_mqtt = true; // Ignore MQTT by default if region has a duty cycle limit - } - service->reloadConfig(SEGMENT_CONFIG); - rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); - } - }, - 0); -} - -void Screen::TZPicker() -{ - showOverlayBanner( - "Pick " - "Timezone\nBack\nUS/Hawaii\nUS/Alaska\nUS/Pacific\nUS/Mountain\nUS/Central\nUS/Eastern\nUTC\nEU/Western\nEU/" - "Central\nEU/Eastern\nAsia/Kolkata\nAsia/Hong_Kong\nAU/AWST\nAU/ACST\nAU/AEST\nPacific/NZ", - 30000, 17, [](int selected) -> void { - if (selected == 1) { // Hawaii - strncpy(config.device.tzdef, "HST10", sizeof(config.device.tzdef)); - } else if (selected == 2) { // Alaska - strncpy(config.device.tzdef, "AKST9AKDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); - } else if (selected == 3) { // Pacific - strncpy(config.device.tzdef, "PST8PDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); - } else if (selected == 4) { // Mountain - strncpy(config.device.tzdef, "MST7MDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); - } else if (selected == 5) { // Central - strncpy(config.device.tzdef, "CST6CDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); - } else if (selected == 6) { // Eastern - strncpy(config.device.tzdef, "EST5EDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); - } else if (selected == 7) { // UTC - strncpy(config.device.tzdef, "UTC", sizeof(config.device.tzdef)); - } else if (selected == 8) { // EU/Western - strncpy(config.device.tzdef, "GMT0BST,M3.5.0/1,M10.5.0", sizeof(config.device.tzdef)); - } else if (selected == 9) { // EU/Central - strncpy(config.device.tzdef, "CET-1CEST,M3.5.0,M10.5.0/3", sizeof(config.device.tzdef)); - } else if (selected == 10) { // EU/Eastern - strncpy(config.device.tzdef, "EET-2EEST,M3.5.0/3,M10.5.0/4", sizeof(config.device.tzdef)); - } else if (selected == 11) { // Asia/Kolkata - strncpy(config.device.tzdef, "IST-5:30", sizeof(config.device.tzdef)); - } else if (selected == 12) { // China - strncpy(config.device.tzdef, "HKT-8", sizeof(config.device.tzdef)); - } else if (selected == 13) { // AU/AWST - strncpy(config.device.tzdef, "AWST-8", sizeof(config.device.tzdef)); - } else if (selected == 14) { // AU/ACST - strncpy(config.device.tzdef, "ACST-9:30ACDT,M10.1.0,M4.1.0/3", sizeof(config.device.tzdef)); - } else if (selected == 15) { // AU/AEST - strncpy(config.device.tzdef, "AEST-10AEDT,M10.1.0,M4.1.0/3", sizeof(config.device.tzdef)); - } else if (selected == 16) { // NZ - strncpy(config.device.tzdef, "NZST-12NZDT,M9.5.0,M4.1.0/3", sizeof(config.device.tzdef)); - } - if (selected != 0) { - setenv("TZ", config.device.tzdef, 1); - service->reloadConfig(SEGMENT_CONFIG); - } - }); -} - } // namespace graphics #else diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index 8a836edfc..ac7d9aa69 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -24,6 +24,7 @@ class Screen FOCUS_FAULT, FOCUS_TEXTMESSAGE, FOCUS_MODULE, // Note: target module should call requestFocus(), otherwise no info about which module to focus + FOCUS_CLOCK, }; explicit Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY); @@ -38,8 +39,8 @@ class Screen void setFunctionSymbol(std::string) {} void removeFunctionSymbol(std::string) {} void startAlert(const char *) {} - void showOverlayBanner(const char *message, uint32_t durationMs = 3000, uint8_t options = 0, - std::function bannerCallback = NULL, int8_t InitialSelected = 0) + void showOverlayBanner(const char *message, uint32_t durationMs = 3000, const char **optionsArrayPtr = nullptr, + uint8_t options = 0, std::function bannerCallback = NULL, int8_t InitialSelected = 0) { } void setFrames(FrameFocus focus) {} @@ -209,6 +210,7 @@ class Screen : public concurrency::OSThread FOCUS_FAULT, FOCUS_TEXTMESSAGE, FOCUS_MODULE, // Note: target module should call requestFocus(), otherwise no info about which module to focus + FOCUS_CLOCK, }; // Regenerate the normal set of frames, focusing a specific frame if requested @@ -223,6 +225,8 @@ class Screen : public concurrency::OSThread meshtastic_Config_DisplayConfig_OledType model; OLEDDISPLAY_GEOMETRY geometry; + bool ignoreCompass = false; + bool isOverlayBannerShowing(); // Stores the last 4 of our hardware ID, to make finding the device for pairing easier @@ -286,8 +290,8 @@ class Screen : public concurrency::OSThread enqueueCmd(cmd); } - void showOverlayBanner(const char *message, uint32_t durationMs = 3000, uint8_t options = 0, - std::function bannerCallback = NULL, int8_t InitialSelected = 0); + void showOverlayBanner(const char *message, uint32_t durationMs = 3000, const char **optionsArrayPtr = nullptr, + uint8_t options = 0, std::function bannerCallback = NULL, int8_t InitialSelected = 0); void startFirmwareUpdateScreen() { @@ -301,7 +305,7 @@ class Screen : public concurrency::OSThread void setHeading(long _heading) { hasCompass = true; - compassHeading = _heading; + compassHeading = fmod(_heading, 360); } bool hasHeading() { return hasCompass; } @@ -602,8 +606,6 @@ class Screen : public concurrency::OSThread void handleShowNextFrame(); void handleShowPrevFrame(); void handleStartFirmwareUpdateScreen(); - void TZPicker(); - void LoraRegionPicker(uint32_t duration = 30000); // Info collected by setFrames method. // Index location of specific frames. @@ -612,7 +614,6 @@ class Screen : public concurrency::OSThread struct FramesetInfo { struct FramePositions { uint8_t fault = 255; - uint8_t textMessage = 255; uint8_t waypoint = 255; uint8_t focusedModule = 255; uint8_t log = 255; @@ -622,6 +623,12 @@ class Screen : public concurrency::OSThread uint8_t memory = 255; uint8_t gps = 255; uint8_t home = 255; + uint8_t textMessage = 255; + uint8_t nodelist = 255; + uint8_t nodelist_lastheard = 255; + uint8_t nodelist_hopsignal = 255; + uint8_t nodelist_distance = 255; + uint8_t nodelist_bearings = 255; uint8_t clock = 255; uint8_t firstFavorite = 255; uint8_t lastFavorite = 255; @@ -679,5 +686,6 @@ class Screen : public concurrency::OSThread // Extern declarations for function symbols used in UIRenderer extern std::vector functionSymbol; extern std::string functionSymbolString; +extern graphics::Screen *screen; #endif \ No newline at end of file diff --git a/src/graphics/SharedUIDisplay.cpp b/src/graphics/SharedUIDisplay.cpp index af427cae4..07f2e5cde 100644 --- a/src/graphics/SharedUIDisplay.cpp +++ b/src/graphics/SharedUIDisplay.cpp @@ -10,9 +10,22 @@ namespace graphics { +void determineResolution(int16_t screenheight, int16_t screenwidth) +{ + if (screenwidth > 128) { + isHighResolution = true; + } + + // Special case for Heltec Wireless Tracker v1.1 + if (screenwidth == 160 && screenheight == 80) { + isHighResolution = false; + } +} + // === Shared External State === bool hasUnreadMessage = false; bool isMuted = false; +bool isHighResolution = false; // === Internal State === bool isBoltVisibleShared = true; @@ -40,7 +53,7 @@ void drawRoundedHighlight(OLEDDisplay *display, int16_t x, int16_t y, int16_t w, // ************************* // * Common Header Drawing * // ************************* -void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *titleStr) +void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *titleStr, bool battery_only) { constexpr int HEADER_OFFSET_Y = 1; y += HEADER_OFFSET_Y; @@ -56,34 +69,40 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti const int screenW = display->getWidth(); const int screenH = display->getHeight(); - const bool useBigIcons = (screenW > 128); - - // === Inverted Header Background === - if (isInverted) { - drawRoundedHighlight(display, x, y, screenW, highlightHeight, 2); - display->setColor(BLACK); - } else { - display->setColor(BLACK); - display->fillRect(0, 0, screenW, highlightHeight + 3); - display->setColor(WHITE); - if (screenW > 128) { - display->drawLine(0, 20, screenW, 20); + if (!battery_only) { + // === Inverted Header Background === + if (isInverted) { + display->setColor(BLACK); + display->fillRect(0, 0, screenW, highlightHeight + 2); + display->setColor(WHITE); + drawRoundedHighlight(display, x, y, screenW, highlightHeight, 2); + display->setColor(BLACK); } else { - display->drawLine(0, 14, screenW, 14); + display->setColor(BLACK); + display->fillRect(0, 0, screenW, highlightHeight + 2); + display->setColor(WHITE); + if (isHighResolution) { + display->drawLine(0, 20, screenW, 20); + } else { + display->drawLine(0, 14, screenW, 14); + } } - } - // === Screen Title === - display->setTextAlignment(TEXT_ALIGN_CENTER); - display->drawString(SCREEN_WIDTH / 2, y, titleStr); - if (config.display.heading_bold) { - display->drawString((SCREEN_WIDTH / 2) + 1, y, titleStr); + // === Screen Title === + display->setTextAlignment(TEXT_ALIGN_CENTER); + display->drawString(SCREEN_WIDTH / 2, y, titleStr); + if (config.display.heading_bold) { + display->drawString((SCREEN_WIDTH / 2) + 1, y, titleStr); + } } display->setTextAlignment(TEXT_ALIGN_LEFT); // === Battery State === int chargePercent = powerStatus->getBatteryChargePercent(); bool isCharging = powerStatus->getIsCharging() == meshtastic::OptionalBool::OptTrue; + if (chargePercent == 100) { + isCharging = false; + } uint32_t now = millis(); #ifndef USE_EINK @@ -93,20 +112,22 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti } #endif - bool useHorizontalBattery = (screenW > 128 && screenW >= screenH); + bool useHorizontalBattery = (isHighResolution && screenW >= screenH); const int textY = y + (highlightHeight - FONT_HEIGHT_SMALL) / 2; // === Battery Icons === if (useHorizontalBattery) { int batteryX = 2; - int batteryY = HEADER_OFFSET_Y + 2; - display->drawXbm(batteryX, batteryY, 29, 15, batteryBitmap_h); + int batteryY = HEADER_OFFSET_Y + 3; + display->drawXbm(batteryX, batteryY, 9, 13, batteryBitmap_h_bottom); + display->drawXbm(batteryX + 9, batteryY, 9, 13, batteryBitmap_h_top); if (isCharging && isBoltVisibleShared) - display->drawXbm(batteryX + 9, batteryY + 1, 9, 13, lightning_bolt_h); + display->drawXbm(batteryX + 4, batteryY, 9, 13, lightning_bolt_h); else { - display->drawXbm(batteryX + 8, batteryY, 12, 15, batteryBitmap_sidegaps_h); - int fillWidth = 24 * chargePercent / 100; - display->fillRect(batteryX + 1, batteryY + 1, fillWidth, 13); + display->drawLine(batteryX + 5, batteryY, batteryX + 10, batteryY); + display->drawLine(batteryX + 5, batteryY + 12, batteryX + 10, batteryY + 12); + int fillWidth = 14 * chargePercent / 100; + display->fillRect(batteryX + 1, batteryY + 1, fillWidth, 11); } } else { int batteryX = 1; @@ -129,12 +150,8 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti char chargeStr[4]; snprintf(chargeStr, sizeof(chargeStr), "%d", chargePercent); int chargeNumWidth = display->getStringWidth(chargeStr); - const int batteryOffset = useHorizontalBattery ? 28 : 6; -#ifdef USE_EINK - const int percentX = x + xOffset + batteryOffset - 2; -#else - const int percentX = x + xOffset + batteryOffset; -#endif + const int batteryOffset = useHorizontalBattery ? 19 : 9; + const int percentX = x + batteryOffset; display->drawString(percentX, textY, chargeStr); display->drawString(percentX + chargeNumWidth - 1, textY, "%"); if (isBold) { @@ -148,7 +165,7 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti int timeStrWidth = display->getStringWidth("12:34"); // Default alignment int timeX = screenW - xOffset - timeStrWidth + 4; - if (rtc_sec > 0) { + if (rtc_sec > 0 && !battery_only) { // === Build Time String === long hms = (rtc_sec % SEC_PER_DAY + SEC_PER_DAY) % SEC_PER_DAY; int hour = hms / SEC_PER_HOUR; @@ -164,7 +181,7 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti } timeStrWidth = display->getStringWidth(timeStr); - timeX = screenW - xOffset - timeStrWidth + 4; + timeX = screenW - xOffset - timeStrWidth + 3; // === Show Mail or Mute Icon to the Left of Time === int iconRightEdge = timeX - 1; @@ -217,7 +234,7 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti display->drawXbm(iconX, iconY, mail_width, mail_height, mail); } } else if (isMuted) { - if (useBigIcons) { + if (isHighResolution) { int iconX = iconRightEdge - mute_symbol_big_width; int iconY = textY + (FONT_HEIGHT_SMALL - mute_symbol_big_height) / 2; @@ -259,6 +276,7 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti bool showMail = false; +#ifndef USE_EINK if (hasUnreadMessage) { if (now - lastMailBlink > 500) { isMailIconVisible = !isMailIconVisible; @@ -266,6 +284,11 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti } showMail = isMailIconVisible; } +#else + if (hasUnreadMessage) { + showMail = true; + } +#endif if (showMail) { if (useHorizontalBattery) { @@ -281,7 +304,7 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti display->drawXbm(iconX, iconY, mail_width, mail_height, mail); } } else if (isMuted) { - if (useBigIcons) { + if (isHighResolution) { int iconX = iconRightEdge - mute_symbol_big_width; int iconY = textY + (FONT_HEIGHT_SMALL - mute_symbol_big_height) / 2; display->drawXbm(iconX, iconY, mute_symbol_big_width, mute_symbol_big_height, mute_symbol_big); @@ -300,7 +323,7 @@ const int *getTextPositions(OLEDDisplay *display) { static int textPositions[7]; // Static array that persists beyond function scope - if (display->getHeight() > 64) { + if (isHighResolution) { textPositions[0] = textZeroLine; textPositions[1] = textFirstLine_medium; textPositions[2] = textSecondLine_medium; diff --git a/src/graphics/SharedUIDisplay.h b/src/graphics/SharedUIDisplay.h index 41411ba7f..2e97052a8 100644 --- a/src/graphics/SharedUIDisplay.h +++ b/src/graphics/SharedUIDisplay.h @@ -41,12 +41,14 @@ namespace graphics // Shared state (declare inside namespace) extern bool hasUnreadMessage; extern bool isMuted; +extern bool isHighResolution; +void determineResolution(int16_t screenheight, int16_t screenwidth); // Rounded highlight (used for inverted headers) void drawRoundedHighlight(OLEDDisplay *display, int16_t x, int16_t y, int16_t w, int16_t h, int16_t r); // Shared battery/time/mail header -void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *titleStr = ""); +void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *titleStr = "", bool battery_only = false); const int *getTextPositions(OLEDDisplay *display); diff --git a/src/graphics/draw/ClockRenderer.cpp b/src/graphics/draw/ClockRenderer.cpp index 2e301b4e1..aa177078b 100644 --- a/src/graphics/draw/ClockRenderer.cpp +++ b/src/graphics/draw/ClockRenderer.cpp @@ -21,6 +21,7 @@ namespace graphics namespace ClockRenderer { +bool digitalWatchFace = true; void drawSegmentedDisplayColon(OLEDDisplay *display, int x, int y, float scale) { @@ -146,6 +147,7 @@ void drawVerticalSegment(OLEDDisplay *display, int x, int y, int width, int heig display->fillTriangle(x, y + width, x + height - 1, y + width, x + halfHeight, y + width + halfHeight); } +/* void drawWatchFaceToggleButton(OLEDDisplay *display, int16_t x, int16_t y, bool digitalMode, float scale) { uint16_t segmentWidth = SEGMENT_WIDTH * scale; @@ -179,21 +181,22 @@ void drawWatchFaceToggleButton(OLEDDisplay *display, int16_t x, int16_t y, bool drawVerticalSegment(display, segmentFourX, segmentFourY, segmentWidth, segmentHeight); } } - +*/ // Draw a digital clock void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { display->clear(); display->setTextAlignment(TEXT_ALIGN_LEFT); int line = 1; + // === Set Title, Blank for Clock + const char *titleStr = ""; + // === Header === + graphics::drawCommonHeader(display, x, y, titleStr, true); #ifdef T_WATCH_S3 if (nimbleBluetooth && nimbleBluetooth->isConnected()) { - graphics::ClockRenderer::drawBluetoothConnectedIcon(display, display->getWidth() - 18, y + 2); + graphics::ClockRenderer::drawBluetoothConnectedIcon(display, display->getWidth() - 18, display->getHeight() - 14); } - - drawWatchFaceToggleButton(display, display->getWidth() - 36, display->getHeight() - 36, - graphics::ClockRenderer::digitalWatchFace, 1); #endif uint32_t rtc_sec = getValidTime(RTCQuality::RTCQualityDevice, true); // Display local timezone @@ -230,7 +233,7 @@ void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int1 float scale = 1.5; #else float scale = 0.75; - if (SCREEN_WIDTH > 128) { + if (isHighResolution) { scale = 1.5; } #endif @@ -276,17 +279,17 @@ void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int1 // draw seconds string display->setFont(FONT_SMALL); - int xOffset = (SCREEN_WIDTH > 128) ? 0 : -1; + int xOffset = (isHighResolution) ? 0 : -1; if (hour >= 10) { - xOffset += (SCREEN_WIDTH > 128) ? 32 : 18; + xOffset += (isHighResolution) ? 32 : 18; } - int yOffset = (SCREEN_WIDTH > 128) ? 3 : 1; + int yOffset = (isHighResolution) ? 3 : 1; if (config.display.use_12h_clock) { display->drawString(startingHourMinuteTextX + xOffset, (display->getHeight() - hourMinuteTextY) - yOffset - 2, isPM ? "pm" : "am"); } #ifndef USE_EINK - xOffset = (SCREEN_WIDTH > 128) ? 18 : 10; + xOffset = (isHighResolution) ? 18 : 10; display->drawString(startingHourMinuteTextX + timeStringWidth - xOffset, (display->getHeight() - hourMinuteTextY) - yOffset, secondString); #endif @@ -301,31 +304,30 @@ void drawBluetoothConnectedIcon(OLEDDisplay *display, int16_t x, int16_t y) void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { display->setTextAlignment(TEXT_ALIGN_LEFT); + // === Set Title, Blank for Clock + const char *titleStr = ""; + // === Header === + graphics::drawCommonHeader(display, x, y, titleStr, true); - graphics::UIRenderer::drawBattery(display, x, y + 7, imgBattery, powerStatus); - - if (powerStatus->getHasBattery()) { - char batteryPercent[8]; - snprintf(batteryPercent, sizeof(batteryPercent), "%d%%", powerStatus->getBatteryChargePercent()); - - display->setFont(FONT_SMALL); - - display->drawString(x + 20, y + 2, batteryPercent); - } #ifdef T_WATCH_S3 if (nimbleBluetooth && nimbleBluetooth->isConnected()) { - drawBluetoothConnectedIcon(display, display->getWidth() - 18, y + 2); + drawBluetoothConnectedIcon(display, display->getWidth() - 18, display->getHeight() - 14); } #endif - drawWatchFaceToggleButton(display, display->getWidth() - 36, display->getHeight() - 36, - graphics::ClockRenderer::digitalWatchFace, 1); - // clock face center coordinates int16_t centerX = display->getWidth() / 2; int16_t centerY = display->getHeight() / 2; // clock face radius - int16_t radius = (display->getWidth() / 2) * 0.8; + int16_t radius = 0; + if (display->getHeight() < display->getWidth()) { + radius = (display->getHeight() / 2) * 0.9; + } else { + radius = (display->getWidth() / 2) * 0.9; + } +#ifdef T_WATCH_S3 + radius = (display->getWidth() / 2) * 0.8; +#endif // noon (0 deg) coordinates (outermost circle) int16_t noonX = centerX; @@ -338,10 +340,16 @@ void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 int16_t tickMarkOuterNoonY = secondHandNoonY; // seconds tick mark inner y coordinate; (second nested circle) - double secondsTickMarkInnerNoonY = (double)noonY + 8; + double secondsTickMarkInnerNoonY = (double)noonY + 4; + if (isHighResolution) { + secondsTickMarkInnerNoonY = (double)noonY + 8; + } // hours tick mark inner y coordinate; (third nested circle) - double hoursTickMarkInnerNoonY = (double)noonY + 16; + double hoursTickMarkInnerNoonY = (double)noonY + 6; + if (isHighResolution) { + hoursTickMarkInnerNoonY = (double)noonY + 16; + } // minute hand y coordinate int16_t minuteHandNoonY = secondsTickMarkInnerNoonY + 4; @@ -350,7 +358,10 @@ void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 int16_t hourStringNoonY = minuteHandNoonY + 18; // hour hand radius and y coordinate - int16_t hourHandRadius = radius * 0.55; + int16_t hourHandRadius = radius * 0.35; + if (isHighResolution) { + int16_t hourHandRadius = radius * 0.55; + } int16_t hourHandNoonY = centerY - hourHandRadius; display->setColor(OLEDDISPLAY_COLOR::WHITE); @@ -366,7 +377,20 @@ void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 int minute = (hms % SEC_PER_HOUR) / SEC_PER_MIN; int second = (hms % SEC_PER_HOUR) % SEC_PER_MIN; // or hms % SEC_PER_MIN - hour = hour > 12 ? hour - 12 : hour; + bool isPM = hour >= 12; + if (config.display.use_12h_clock) { + bool isPM = hour >= 12; + display->setFont(FONT_SMALL); + int yOffset = isHighResolution ? 1 : 0; +#ifdef USE_EINK + yOffset += 3; +#endif + display->drawString(centerX - (display->getStringWidth(isPM ? "pm" : "am") / 2), centerY + yOffset, + isPM ? "pm" : "am"); + } + hour %= 12; + if (hour == 0) + hour = 12; int16_t degreesPerHour = 30; int16_t degreesPerMinuteOrSecond = 6; @@ -443,16 +467,32 @@ void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 double hourStringX = (sineAngleInRadians * (hourStringNoonY - centerY) + noonX) - hourStringXOffset; double hourStringY = (cosineAngleInRadians * (hourStringNoonY - centerY) + centerY) - hourStringYOffset; +#ifdef T_WATCH_S3 // draw hour number display->drawStringf(hourStringX, hourStringY, buffer, "%d", hourInt); +#else +#ifdef USE_EINK + if (isHighResolution) { + // draw hour number + display->drawStringf(hourStringX, hourStringY, buffer, "%d", hourInt); + } +#else + if (isHighResolution && (hourInt == 3 || hourInt == 6 || hourInt == 9 || hourInt == 12)) { + // draw hour number + display->drawStringf(hourStringX, hourStringY, buffer, "%d", hourInt); + } +#endif +#endif } if (angle % degreesPerMinuteOrSecond == 0) { double startX = sineAngleInRadians * (secondsTickMarkInnerNoonY - centerY) + noonX; double startY = cosineAngleInRadians * (secondsTickMarkInnerNoonY - centerY) + centerY; - // draw minute tick mark - display->drawLine(startX, startY, endX, endY); + if (isHighResolution) { + // draw minute tick mark + display->drawLine(startX, startY, endX, endY); + } } } @@ -461,9 +501,10 @@ void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 // draw minute hand display->drawLine(centerX, centerY, minuteX, minuteY); - +#ifndef USE_EINK // draw second hand display->drawLine(centerX, centerY, secondX, secondY); +#endif } } diff --git a/src/graphics/draw/ClockRenderer.h b/src/graphics/draw/ClockRenderer.h index 4660dcc35..9c3238b14 100644 --- a/src/graphics/draw/ClockRenderer.h +++ b/src/graphics/draw/ClockRenderer.h @@ -12,7 +12,7 @@ class Screen; namespace ClockRenderer { // Whether we are showing the digital watch face or the analog one -static bool digitalWatchFace = true; +extern bool digitalWatchFace; // Clock frame functions void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); @@ -25,7 +25,7 @@ void drawHorizontalSegment(OLEDDisplay *display, int x, int y, int width, int he void drawVerticalSegment(OLEDDisplay *display, int x, int y, int width, int height); // UI elements for clock displays -void drawWatchFaceToggleButton(OLEDDisplay *display, int16_t x, int16_t y, bool digitalMode = true, float scale = 1); +// void drawWatchFaceToggleButton(OLEDDisplay *display, int16_t x, int16_t y, bool digitalMode = true, float scale = 1); void drawBluetoothConnectedIcon(OLEDDisplay *display, int16_t x, int16_t y); } // namespace ClockRenderer diff --git a/src/graphics/draw/CompassRenderer.cpp b/src/graphics/draw/CompassRenderer.cpp index fef993e2d..6d8051546 100644 --- a/src/graphics/draw/CompassRenderer.cpp +++ b/src/graphics/draw/CompassRenderer.cpp @@ -4,6 +4,7 @@ #include "configuration.h" #include "gps/GeoCoord.h" #include "graphics/ScreenFonts.h" +#include "graphics/SharedUIDisplay.h" #include namespace graphics @@ -45,17 +46,18 @@ void drawCompassNorth(OLEDDisplay *display, int16_t compassX, int16_t compassY, // This could draw a "N" indicator or north arrow // For now, we'll draw a simple north indicator // const float radius = 17.0f; - if (display->width() > 128) { + if (isHighResolution) { radius += 4; } Point north(0, -radius); - north.rotate(-myHeading); + if (!config.display.compass_north_top) + north.rotate(-myHeading); north.translate(compassX, compassY); display->setFont(FONT_SMALL); display->setTextAlignment(TEXT_ALIGN_CENTER); display->setColor(BLACK); - if (display->width() > 128) { + if (isHighResolution) { display->fillRect(north.x - 8, north.y - 1, display->getStringWidth("N") + 3, FONT_HEIGHT_SMALL - 6); } else { display->fillRect(north.x - 4, north.y - 1, display->getStringWidth("N") + 2, FONT_HEIGHT_SMALL - 6); @@ -91,18 +93,22 @@ void drawArrowToNode(OLEDDisplay *display, int16_t x, int16_t y, int16_t size, f float radians = bearing * DEG_TO_RAD; Point tip(0, -size / 2); - Point left(-size / 4, size / 4); - Point right(size / 4, size / 4); + Point left(-size / 6, size / 4); + Point right(size / 6, size / 4); + Point tail(0, size / 4.5); tip.rotate(radians); left.rotate(radians); right.rotate(radians); + tail.rotate(radians); tip.translate(x, y); left.translate(x, y); right.translate(x, y); + tail.translate(x, y); - display->drawTriangle(tip.x, tip.y, left.x, left.y, right.x, right.y); + display->fillTriangle(tip.x, tip.y, left.x, left.y, tail.x, tail.y); + display->fillTriangle(tip.x, tip.y, right.x, right.y, tail.x, tail.y); } float estimatedHeading(double lat, double lon) @@ -127,14 +133,5 @@ uint16_t getCompassDiam(uint32_t displayWidth, uint32_t displayHeight) return maxDiam; } -float calculateBearing(double lat1, double lon1, double lat2, double lon2) -{ - double dLon = (lon2 - lon1) * DEG_TO_RAD; - double y = sin(dLon) * cos(lat2 * DEG_TO_RAD); - double x = cos(lat1 * DEG_TO_RAD) * sin(lat2 * DEG_TO_RAD) - sin(lat1 * DEG_TO_RAD) * cos(lat2 * DEG_TO_RAD) * cos(dLon); - double bearing = atan2(y, x) * RAD_TO_DEG; - return fmod(bearing + 360.0, 360.0); -} - } // namespace CompassRenderer } // namespace graphics diff --git a/src/graphics/draw/CompassRenderer.h b/src/graphics/draw/CompassRenderer.h index 4b26e6463..ca7532b66 100644 --- a/src/graphics/draw/CompassRenderer.h +++ b/src/graphics/draw/CompassRenderer.h @@ -28,9 +28,6 @@ void drawArrowToNode(OLEDDisplay *display, int16_t x, int16_t y, int16_t size, f float estimatedHeading(double lat, double lon); uint16_t getCompassDiam(uint32_t displayWidth, uint32_t displayHeight); -// Utility functions for bearing calculations -float calculateBearing(double lat1, double lon1, double lat2, double lon2); - } // namespace CompassRenderer } // namespace graphics diff --git a/src/graphics/draw/DebugRenderer.cpp b/src/graphics/draw/DebugRenderer.cpp index 2c3a3a3a8..92cf49610 100644 --- a/src/graphics/draw/DebugRenderer.cpp +++ b/src/graphics/draw/DebugRenderer.cpp @@ -67,21 +67,6 @@ void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16 char channelStr[20]; snprintf(channelStr, sizeof(channelStr), "#%s", channels.getName(channels.getPrimaryIndex())); - - // Display power status - if (powerStatus->getHasBattery()) { - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { - UIRenderer::drawBattery(display, x, y + 2, imgBattery, powerStatus); - } else { - UIRenderer::drawBattery(display, x + 1, y + 3, imgBattery, powerStatus); - } - } else if (powerStatus->knowsUSB()) { - if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { - display->drawFastImage(x, y + 2, 16, 8, powerStatus->getHasUSB() ? imgUSB : imgPower); - } else { - display->drawFastImage(x + 1, y + 3, 16, 8, powerStatus->getHasUSB() ? imgUSB : imgPower); - } - } // Display nodes status if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) { UIRenderer::drawNodes(display, x + (SCREEN_WIDTH * 0.25), y + 2, nodeStatus); @@ -393,7 +378,7 @@ void drawLoRaFocused(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int line = 1; // === Set Title - const char *titleStr = (SCREEN_WIDTH > 128) ? "LoRa Info" : "LoRa"; + const char *titleStr = (isHighResolution) ? "LoRa Info" : "LoRa"; // === Header === graphics::drawCommonHeader(display, x, y, titleStr); @@ -444,12 +429,12 @@ void drawLoRaFocused(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, char chUtilPercentage[10]; snprintf(chUtilPercentage, sizeof(chUtilPercentage), "%2.0f%%", airTime->channelUtilizationPercent()); - int chUtil_x = (SCREEN_WIDTH > 128) ? display->getStringWidth(chUtil) + 10 : display->getStringWidth(chUtil) + 5; + int chUtil_x = (isHighResolution) ? display->getStringWidth(chUtil) + 10 : display->getStringWidth(chUtil) + 5; int chUtil_y = getTextPositions(display)[line] + 3; - int chutil_bar_width = (SCREEN_WIDTH > 128) ? 100 : 50; - int chutil_bar_height = (SCREEN_WIDTH > 128) ? 12 : 7; - int extraoffset = (SCREEN_WIDTH > 128) ? 6 : 3; + int chutil_bar_width = (isHighResolution) ? 100 : 50; + int chutil_bar_height = (isHighResolution) ? 12 : 7; + int extraoffset = (isHighResolution) ? 6 : 3; int chutil_percent = airTime->channelUtilizationPercent(); int centerofscreen = SCREEN_WIDTH / 2; @@ -516,7 +501,7 @@ void drawMemoryUsage(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int line = 1; const int barHeight = 6; const int labelX = x; - const int barsOffset = (SCREEN_WIDTH > 128) ? 24 : 0; + const int barsOffset = (isHighResolution) ? 24 : 0; const int barX = x + 40 + barsOffset; auto drawUsageRow = [&](const char *label, uint32_t used, uint32_t total, bool isHeap = false) { @@ -526,7 +511,7 @@ void drawMemoryUsage(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int percent = (used * 100) / total; char combinedStr[24]; - if (SCREEN_WIDTH > 128) { + if (isHighResolution) { snprintf(combinedStr, sizeof(combinedStr), "%s%3d%% %u/%uKB", (percent > 80) ? "! " : "", percent, used / 1024, total / 1024); } else { diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp new file mode 100644 index 000000000..1c327117e --- /dev/null +++ b/src/graphics/draw/MenuHandler.cpp @@ -0,0 +1,479 @@ +#include "configuration.h" +#if HAS_SCREEN +#include "ClockRenderer.h" +#include "GPS.h" +#include "MenuHandler.h" +#include "MeshRadio.h" +#include "MeshService.h" +#include "NodeDB.h" +#include "buzz.h" +#include "graphics/Screen.h" +#include "graphics/draw/UIRenderer.h" +#include "main.h" +#include "modules/AdminModule.h" +#include "modules/CannedMessageModule.h" + +namespace graphics +{ +menuHandler::screenMenus menuHandler::menuQueue = menu_none; + +void menuHandler::LoraRegionPicker(uint32_t duration) +{ + static const char *optionsArray[] = {"Back", + "US", + "EU_433", + "EU_868", + "CN", + "JP", + "ANZ", + "KR", + "TW", + "RU", + "IN", + "NZ_865", + "TH", + "LORA_24", + "UA_433", + "UA_868", + "MY_433", + "MY_" + "919", + "SG_" + "923", + "PH_433", + "PH_868", + "PH_915", + "ANZ_433"}; + screen->showOverlayBanner( + "Set the LoRa region", duration, optionsArray, 23, + [](int selected) -> void { + if (selected != 0 && config.lora.region != _meshtastic_Config_LoRaConfig_RegionCode(selected)) { + config.lora.region = _meshtastic_Config_LoRaConfig_RegionCode(selected); + // This is needed as we wait til picking the LoRa region to generate keys for the first time. + if (!owner.is_licensed) { + bool keygenSuccess = false; + if (config.security.private_key.size == 32) { + // public key is derived from private, so this will always have the same result. + if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) { + keygenSuccess = true; + } + } else { + LOG_INFO("Generate new PKI keys"); + crypto->generateKeyPair(config.security.public_key.bytes, config.security.private_key.bytes); + keygenSuccess = true; + } + if (keygenSuccess) { + config.security.public_key.size = 32; + config.security.private_key.size = 32; + owner.public_key.size = 32; + memcpy(owner.public_key.bytes, config.security.public_key.bytes, 32); + } + } + config.lora.tx_enabled = true; + initRegion(); + if (myRegion->dutyCycle < 100) { + config.lora.ignore_mqtt = true; // Ignore MQTT by default if region has a duty cycle limit + } + service->reloadConfig(SEGMENT_CONFIG); + rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); + } + }, + 0); +} + +void menuHandler::TwelveHourPicker() +{ + static const char *optionsArray[] = {"Back", "12-hour", "24-hour"}; + screen->showOverlayBanner("Time Format", 30000, optionsArray, 3, [](int selected) -> void { + if (selected == 0) { + menuHandler::menuQueue = menuHandler::clock_menu; + } else if (selected == 1) { + config.display.use_12h_clock = true; + } else { + config.display.use_12h_clock = false; + } + service->reloadConfig(SEGMENT_CONFIG); + }); +} + +void menuHandler::ClockFacePicker() +{ + static const char *optionsArray[] = {"Back", "Digital", "Analog"}; + screen->showOverlayBanner("Which Face?", 30000, optionsArray, 3, [](int selected) -> void { + if (selected == 0) { + menuHandler::menuQueue = menuHandler::clock_menu; + } else if (selected == 1) { + graphics::ClockRenderer::digitalWatchFace = true; + screen->setFrames(Screen::FOCUS_CLOCK); + } else { + graphics::ClockRenderer::digitalWatchFace = false; + screen->setFrames(Screen::FOCUS_CLOCK); + } + }); +} + +void menuHandler::TZPicker() +{ + static const char *optionsArray[] = {"Back", + "US/Hawaii", + "US/Alaska", + "US/Pacific", + "US/Arizona", + "US/Mountain", + "US/Central", + "US/Eastern", + "UTC", + "EU/Western", + "EU/" + "Central", + "EU/Eastern", + "Asia/Kolkata", + "Asia/Hong_Kong", + "AU/AWST", + "AU/ACST", + "AU/AEST", + "Pacific/NZ"}; + screen->showOverlayBanner("Pick Timezone", 30000, optionsArray, 17, [](int selected) -> void { + if (selected == 0) { + menuHandler::menuQueue = menuHandler::clock_menu; + } else if (selected == 1) { // Hawaii + strncpy(config.device.tzdef, "HST10", sizeof(config.device.tzdef)); + } else if (selected == 2) { // Alaska + strncpy(config.device.tzdef, "AKST9AKDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); + } else if (selected == 3) { // Pacific + strncpy(config.device.tzdef, "PST8PDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); + } else if (selected == 4) { // Arizona + strncpy(config.device.tzdef, "MST7", sizeof(config.device.tzdef)); + } else if (selected == 5) { // Mountain + strncpy(config.device.tzdef, "MST7MDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); + } else if (selected == 6) { // Central + strncpy(config.device.tzdef, "CST6CDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); + } else if (selected == 7) { // Eastern + strncpy(config.device.tzdef, "EST5EDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); + } else if (selected == 8) { // UTC + strncpy(config.device.tzdef, "UTC", sizeof(config.device.tzdef)); + } else if (selected == 9) { // EU/Western + strncpy(config.device.tzdef, "GMT0BST,M3.5.0/1,M10.5.0", sizeof(config.device.tzdef)); + } else if (selected == 10) { // EU/Central + strncpy(config.device.tzdef, "CET-1CEST,M3.5.0,M10.5.0/3", sizeof(config.device.tzdef)); + } else if (selected == 11) { // EU/Eastern + strncpy(config.device.tzdef, "EET-2EEST,M3.5.0/3,M10.5.0/4", sizeof(config.device.tzdef)); + } else if (selected == 12) { // Asia/Kolkata + strncpy(config.device.tzdef, "IST-5:30", sizeof(config.device.tzdef)); + } else if (selected == 13) { // China + strncpy(config.device.tzdef, "HKT-8", sizeof(config.device.tzdef)); + } else if (selected == 14) { // AU/AWST + strncpy(config.device.tzdef, "AWST-8", sizeof(config.device.tzdef)); + } else if (selected == 15) { // AU/ACST + strncpy(config.device.tzdef, "ACST-9:30ACDT,M10.1.0,M4.1.0/3", sizeof(config.device.tzdef)); + } else if (selected == 16) { // AU/AEST + strncpy(config.device.tzdef, "AEST-10AEDT,M10.1.0,M4.1.0/3", sizeof(config.device.tzdef)); + } else if (selected == 17) { // NZ + strncpy(config.device.tzdef, "NZST-12NZDT,M9.5.0,M4.1.0/3", sizeof(config.device.tzdef)); + } + if (selected != 0) { + setenv("TZ", config.device.tzdef, 1); + service->reloadConfig(SEGMENT_CONFIG); + } + }); +} + +void menuHandler::clockMenu() +{ + static const char *optionsArray[] = {"Back", "Clock Face", "Time Format", "Timezone"}; + screen->showOverlayBanner("Clock Action", 30000, optionsArray, 4, [](int selected) -> void { + if (selected == 1) { + menuHandler::menuQueue = menuHandler::clock_face_picker; + screen->setInterval(0); + runASAP = true; + } else if (selected == 2) { + menuHandler::menuQueue = menuHandler::twelve_hour_picker; + screen->setInterval(0); + runASAP = true; + } else if (selected == 3) { + menuHandler::menuQueue = menuHandler::TZ_picker; + screen->setInterval(0); + runASAP = true; + } + }); +} + +void menuHandler::messageResponseMenu() +{ + + static const char **optionsArrayPtr; + int options; + if (kb_found) { + static const char *optionsArray[] = {"Back", "Dismiss", "Reply via Preset", "Reply via Freetext"}; + optionsArrayPtr = optionsArray; + options = 4; + } else { + static const char *optionsArray[] = {"Back", "Dismiss", "Reply via Preset"}; + optionsArrayPtr = optionsArray; + options = 3; + } +#ifdef HAS_I2S + static const char *optionsArray[] = {"Back", "Dismiss", "Reply via Preset", "Reply via Freetext", "Read Aloud"}; + optionsArrayPtr = optionsArray; + options = 5; +#endif + screen->showOverlayBanner("Message Action", 30000, optionsArrayPtr, options, [](int selected) -> void { + if (selected == 1) { + screen->dismissCurrentFrame(); + } else if (selected == 2) { + if (devicestate.rx_text_message.to == NODENUM_BROADCAST) { + cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST, devicestate.rx_text_message.channel); + } else { + cannedMessageModule->LaunchWithDestination(devicestate.rx_text_message.from); + } + } else if (selected == 3) { + if (devicestate.rx_text_message.to == NODENUM_BROADCAST) { + cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST, devicestate.rx_text_message.channel); + } else { + cannedMessageModule->LaunchFreetextWithDestination(devicestate.rx_text_message.from); + } + } +#ifdef HAS_I2S + else if (selected == 4) { + const meshtastic_MeshPacket &mp = devicestate.rx_text_message; + const char *msg = reinterpret_cast(mp.decoded.payload.bytes); + + audioThread->readAloud(msg); + } +#endif + }); +} + +void menuHandler::homeBaseMenu() +{ + int options; + static const char **optionsArrayPtr; + + if (kb_found) { +#ifdef PIN_EINK_EN + static const char *optionsArray[] = {"Back", "Toggle Backlight", "Send Position", "New Preset Msg", "New Freetext Msg"}; +#else + static const char *optionsArray[] = {"Back", "Sleep Screen", "Send Position", "New Preset Msg", "New Freetext Msg"}; +#endif + optionsArrayPtr = optionsArray; + options = 5; + } else { +#ifdef PIN_EINK_EN + static const char *optionsArray[] = {"Back", "Toggle Backlight", "Send Position", "New Preset Msg"}; +#else + static const char *optionsArray[] = {"Back", "Sleep Screen", "Send Position", "New Preset Msg"}; +#endif + optionsArrayPtr = optionsArray; + options = 4; + } + screen->showOverlayBanner("Home Action", 30000, optionsArrayPtr, options, [](int selected) -> void { + if (selected == 1) { +#ifdef PIN_EINK_EN + if (digitalRead(PIN_EINK_EN) == HIGH) { + digitalWrite(PIN_EINK_EN, LOW); + } else { + digitalWrite(PIN_EINK_EN, HIGH); + } +#else + screen->setOn(false); +#endif + } else if (selected == 2) { + InputEvent event = {.inputEvent = (input_broker_event)175, .kbchar = 175, .touchX = 0, .touchY = 0}; + inputBroker->injectInputEvent(&event); + } else if (selected == 3) { + cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST); + } else if (selected == 4) { + cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST); + } + }); +} + +void menuHandler::favoriteBaseMenu() +{ + int options; + static const char **optionsArrayPtr; + + if (kb_found) { + static const char *optionsArray[] = {"Back", "New Preset Msg", "New Freetext Msg"}; + optionsArrayPtr = optionsArray; + options = 3; + } else { + static const char *optionsArray[] = {"Back", "New Preset Msg"}; + optionsArrayPtr = optionsArray; + options = 2; + } + screen->showOverlayBanner("Favorites Action", 30000, optionsArrayPtr, options, [](int selected) -> void { + if (selected == 1) { + cannedMessageModule->LaunchWithDestination(graphics::UIRenderer::currentFavoriteNodeNum); + } else if (selected == 2) { + cannedMessageModule->LaunchFreetextWithDestination(graphics::UIRenderer::currentFavoriteNodeNum); + } + }); +} + +void menuHandler::positionBaseMenu() +{ + int options; + static const char **optionsArrayPtr; + static const char *optionsArray[] = {"Back", "GPS Toggle", "Compass"}; + static const char *optionsArrayCalibrate[] = {"Back", "GPS Toggle", "Compass", "Compass Calibrate"}; + + if (accelerometerThread) { + optionsArrayPtr = optionsArrayCalibrate; + options = 4; + } else { + optionsArrayPtr = optionsArray; + options = 3; + } + screen->showOverlayBanner("Position Action", 30000, optionsArrayPtr, options, [](int selected) -> void { + if (selected == 1) { + menuQueue = gps_toggle_menu; + } else if (selected == 2) { + menuQueue = compass_point_north_menu; + } else if (selected == 3) { + accelerometerThread->calibrate(30); + } + }); +} + +void menuHandler::nodeListMenu() +{ + static const char *optionsArray[] = {"Back", "Reset NodeDB"}; + screen->showOverlayBanner("Node Action", 30000, optionsArray, 2, [](int selected) -> void { + if (selected == 1) { + menuQueue = reset_node_db_menu; + } + }); +} + +void menuHandler::resetNodeDBMenu() +{ + static const char *optionsArray[] = {"Back", "Confirm"}; + screen->showOverlayBanner("Confirm Reset NodeDB", 30000, optionsArray, 2, [](int selected) -> void { + if (selected == 1) { + disableBluetooth(); + LOG_INFO("Initiate node-db reset"); + nodeDB->resetNodes(); + rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); + } + }); +} + +void menuHandler::compassNorthMenu() +{ + static const char *optionsArray[] = {"Back", "Dynamic", "Fixed Ring", "Freeze Heading"}; + screen->showOverlayBanner("North Directions?", 30000, optionsArray, 4, [](int selected) -> void { + if (selected == 1) { + if (config.display.compass_north_top != false) { + config.display.compass_north_top = false; + service->reloadConfig(SEGMENT_CONFIG); + } + screen->ignoreCompass = false; + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); + } else if (selected == 2) { + if (config.display.compass_north_top != true) { + config.display.compass_north_top = true; + service->reloadConfig(SEGMENT_CONFIG); + } + screen->ignoreCompass = false; + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); + } else if (selected == 3) { + if (config.display.compass_north_top != true) { + config.display.compass_north_top = true; + service->reloadConfig(SEGMENT_CONFIG); + } + screen->ignoreCompass = true; + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); + } else if (selected == 0) { + menuQueue = position_base_menu; + } + }); +} + +void menuHandler::GPSToggleMenu() +{ + static const char *optionsArray[] = {"Back", "Enabled", "Disabled"}; + screen->showOverlayBanner( + "Toggle GPS", 30000, optionsArray, 3, + [](int selected) -> void { + if (selected == 1) { + config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_ENABLED; + playGPSEnableBeep(); + gps->enable(); + service->reloadConfig(SEGMENT_CONFIG); + } else if (selected == 2) { + config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_DISABLED; + playGPSDisableBeep(); + gps->disable(); + service->reloadConfig(SEGMENT_CONFIG); + } else { + menuQueue = position_base_menu; + } + }, + config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED ? 1 : 2); // set inital selection +} + +void menuHandler::BuzzerModeMenu() +{ + static const char *optionsArray[] = {"All Enabled", "Disabled", "Notifications", "System Only"}; + screen->showOverlayBanner( + "Beep Action", 30000, optionsArray, 4, + [](int selected) -> void { + config.device.buzzer_mode = (meshtastic_Config_DeviceConfig_BuzzerMode)selected; + service->reloadConfig(SEGMENT_CONFIG); + }, + config.device.buzzer_mode); +} + +void menuHandler::switchToMUIMenu() +{ + static const char *optionsArray[] = {"Yes", "No"}; + screen->showOverlayBanner("Switch to MUI?", 30000, optionsArray, 2, [](int selected) -> void { + if (selected == 0) { + config.display.displaymode = meshtastic_Config_DisplayConfig_DisplayMode_COLOR; + config.bluetooth.enabled = false; + service->reloadConfig(SEGMENT_CONFIG); + rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); + } + }); +} + +void menuHandler::handleMenuSwitch() +{ + switch (menuQueue) { + case menu_none: + break; + case lora_picker: + LoraRegionPicker(); + break; + case TZ_picker: + TZPicker(); + break; + case twelve_hour_picker: + TwelveHourPicker(); + break; + case clock_face_picker: + ClockFacePicker(); + break; + case clock_menu: + clockMenu(); + break; + case position_base_menu: + positionBaseMenu(); + break; + case gps_toggle_menu: + GPSToggleMenu(); + break; + case compass_point_north_menu: + compassNorthMenu(); + break; + case reset_node_db_menu: + resetNodeDBMenu(); + break; + } + menuQueue = menu_none; +} + +} // namespace graphics + +#endif \ No newline at end of file diff --git a/src/graphics/draw/MenuHandler.h b/src/graphics/draw/MenuHandler.h new file mode 100644 index 000000000..a5bea5176 --- /dev/null +++ b/src/graphics/draw/MenuHandler.h @@ -0,0 +1,40 @@ +#include "configuration.h" +namespace graphics +{ + +class menuHandler +{ + public: + enum screenMenus { + menu_none, + lora_picker, + TZ_picker, + twelve_hour_picker, + clock_face_picker, + clock_menu, + position_base_menu, + gps_toggle_menu, + compass_point_north_menu, + reset_node_db_menu + }; + static screenMenus menuQueue; + + static void LoraRegionPicker(uint32_t duration = 30000); + static void handleMenuSwitch(); + static void clockMenu(); + static void TZPicker(); + static void TwelveHourPicker(); + static void ClockFacePicker(); + static void messageResponseMenu(); + static void homeBaseMenu(); + static void favoriteBaseMenu(); + static void positionBaseMenu(); + static void compassNorthMenu(); + static void GPSToggleMenu(); + static void BuzzerModeMenu(); + static void switchToMUIMenu(); + static void nodeListMenu(); + static void resetNodeDBMenu(); +}; + +} // namespace graphics \ No newline at end of file diff --git a/src/graphics/draw/MessageRenderer.cpp b/src/graphics/draw/MessageRenderer.cpp index 707517d82..3df8a003c 100644 --- a/src/graphics/draw/MessageRenderer.cpp +++ b/src/graphics/draw/MessageRenderer.cpp @@ -56,6 +56,11 @@ namespace graphics namespace MessageRenderer { +// Simple cache based on text hash +static size_t cachedKey = 0; +static std::vector cachedLines; +static std::vector cachedHeights; + void drawStringWithEmotes(OLEDDisplay *display, int x, int y, const std::string &line, const Emote *emotes, int emoteCount) { int cursorX = x; @@ -225,6 +230,7 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 sender); } + uint32_t now = millis(); #ifndef EXCLUDE_EMOJI // === Bounce animation setup === static uint32_t lastBounceTime = 0; @@ -232,7 +238,6 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 const int bounceRange = 2; // Max pixels to bounce up/down const int bounceInterval = 10; // How quickly to change bounce direction (ms) - uint32_t now = millis(); if (now - lastBounceTime >= bounceInterval) { lastBounceTime = now; bounceY = (bounceY + 1) % (bounceRange * 2); @@ -246,82 +251,51 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 display->drawString(x + 4, headerY, headerStr); // Draw separator (same as scroll version) - for (int separatorX = 0; separatorX <= (display->getStringWidth(headerStr) + 3); separatorX += 2) { - display->setPixel(separatorX, headerY + ((SCREEN_WIDTH > 128) ? 19 : 13)); + for (int separatorX = 1; separatorX <= (display->getStringWidth(headerStr) + 2); separatorX += 2) { + display->setPixel(separatorX, headerY + ((isHighResolution) ? 19 : 13)); } // Center the emote below the header line + separator + nav int remainingHeight = SCREEN_HEIGHT - (headerY + FONT_HEIGHT_SMALL) - navHeight; - int emoteY = headerY + FONT_HEIGHT_SMALL + (remainingHeight - e.height) / 2 + bounceY - bounceRange; + int emoteY = headerY + 6 + FONT_HEIGHT_SMALL + (remainingHeight - e.height) / 2 + bounceY - bounceRange; display->drawXbm((SCREEN_WIDTH - e.width) / 2, emoteY, e.width, e.height, e.bitmap); + + // Draw header at the end to sort out overlapping elements + graphics::drawCommonHeader(display, x, y, titleStr); return; } } #endif + // === Generate the cache key === + size_t currentKey = (size_t)mp.from; + currentKey ^= ((size_t)mp.to << 8); + currentKey ^= ((size_t)mp.rx_time << 16); + currentKey ^= ((size_t)mp.id << 24); - // === Word-wrap and build line list === - std::vector lines; - lines.push_back(std::string(headerStr)); // Header line is always first + if (cachedKey != currentKey) { + LOG_INFO("Message cache key is misssed cachedKey=0x%0x, currentKey=0x%x", cachedKey, currentKey); - std::string line, word; - for (int i = 0; messageBuf[i]; ++i) { - char ch = messageBuf[i]; - if (ch == '\n') { - if (!word.empty()) - line += word; - if (!line.empty()) - lines.push_back(line); - line.clear(); - word.clear(); - } else if (ch == ' ') { - line += word + ' '; - word.clear(); - } else { - word += ch; - std::string test = line + word; - if (display->getStringWidth(test.c_str()) > textWidth) { - if (!line.empty()) - lines.push_back(line); - line = word; - word.clear(); - } - } + // Cache miss - regenerate lines and heights + cachedLines = generateLines(display, headerStr, messageBuf, textWidth); + cachedHeights = calculateLineHeights(cachedLines, emotes); + cachedKey = currentKey; + } else { + // Cache hit but update the header line with current time information + cachedLines[0] = std::string(headerStr); + // The header always has a fixed height since it doesn't contain emotes + // As per calculateLineHeights logic for lines without emotes: + cachedHeights[0] = FONT_HEIGHT_SMALL - 2; + if (cachedHeights[0] < 8) + cachedHeights[0] = 8; // minimum safety } - if (!word.empty()) - line += word; - if (!line.empty()) - lines.push_back(line); // === Scrolling logic === - std::vector rowHeights; - - for (const auto &_line : lines) { - int lineHeight = FONT_HEIGHT_SMALL; - bool hasEmote = false; - - for (int i = 0; i < numEmotes; ++i) { - const Emote &e = emotes[i]; - if (_line.find(e.label) != std::string::npos) { - lineHeight = std::max(lineHeight, e.height); - hasEmote = true; - } - } - - // Apply tighter spacing if no emotes on this line - if (!hasEmote) { - lineHeight -= 2; // reduce by 2px for tighter spacing - if (lineHeight < 8) - lineHeight = 8; // minimum safety - } - - rowHeights.push_back(lineHeight); - } int totalHeight = 0; - for (size_t i = 1; i < rowHeights.size(); ++i) { - totalHeight += rowHeights[i]; + for (size_t i = 1; i < cachedHeights.size(); ++i) { + totalHeight += cachedHeights[i]; } - int usableScrollHeight = usableHeight - rowHeights[0]; // remove header height - int scrollStop = std::max(0, totalHeight - usableScrollHeight + rowHeights.back()); + int usableScrollHeight = usableHeight - cachedHeights[0]; // remove header height + int scrollStop = std::max(0, totalHeight - usableScrollHeight + cachedHeights.back()); static float scrollY = 0.0f; static uint32_t lastTime = 0, scrollStartDelay = 0, pauseStart = 0; @@ -363,28 +337,109 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 int scrollOffset = static_cast(scrollY); int yOffset = -scrollOffset + getTextPositions(display)[1]; - for (int separatorX = 0; separatorX <= (display->getStringWidth(headerStr) + 3); separatorX += 2) { - display->setPixel(separatorX, yOffset + ((SCREEN_WIDTH > 128) ? 19 : 13)); + for (int separatorX = 1; separatorX <= (display->getStringWidth(headerStr) + 2); separatorX += 2) { + display->setPixel(separatorX, yOffset + ((isHighResolution) ? 19 : 13)); } // === Render visible lines === + renderMessageContent(display, cachedLines, cachedHeights, x, yOffset, scrollBottom, emotes, numEmotes, isInverted, isBold); + + // Draw header at the end to sort out overlapping elements + graphics::drawCommonHeader(display, x, y, titleStr); +} + +std::vector generateLines(OLEDDisplay *display, const char *headerStr, const char *messageBuf, int textWidth) +{ + std::vector lines; + lines.push_back(std::string(headerStr)); // Header line is always first + + std::string line, word; + for (int i = 0; messageBuf[i]; ++i) { + char ch = messageBuf[i]; + if ((unsigned char)messageBuf[i] == 0xE2 && (unsigned char)messageBuf[i + 1] == 0x80 && + (unsigned char)messageBuf[i + 2] == 0x99) { + ch = '\''; // plain apostrophe + i += 2; // skip over the extra UTF-8 bytes + } + if (ch == '\n') { + if (!word.empty()) + line += word; + if (!line.empty()) + lines.push_back(line); + line.clear(); + word.clear(); + } else if (ch == ' ') { + line += word + ' '; + word.clear(); + } else { + word += ch; + std::string test = line + word; + // Keep these lines for diagnostics + // LOG_INFO("Char: '%c' (0x%02X)", ch, (unsigned char)ch); + // LOG_INFO("Current String: %s", test.c_str()); + if (display->getStringWidth(test.c_str()) > textWidth) { + if (!line.empty()) + lines.push_back(line); + line = word; + word.clear(); + } + } + } + + if (!word.empty()) + line += word; + if (!line.empty()) + lines.push_back(line); + + return lines; +} + +std::vector calculateLineHeights(const std::vector &lines, const Emote *emotes) +{ + std::vector rowHeights; + + for (const auto &_line : lines) { + int lineHeight = FONT_HEIGHT_SMALL; + bool hasEmote = false; + + for (int i = 0; i < numEmotes; ++i) { + const Emote &e = emotes[i]; + if (_line.find(e.label) != std::string::npos) { + lineHeight = std::max(lineHeight, e.height); + hasEmote = true; + } + } + + // Apply tighter spacing if no emotes on this line + if (!hasEmote) { + lineHeight -= 2; // reduce by 2px for tighter spacing + if (lineHeight < 8) + lineHeight = 8; // minimum safety + } + + rowHeights.push_back(lineHeight); + } + + return rowHeights; +} + +void renderMessageContent(OLEDDisplay *display, const std::vector &lines, const std::vector &rowHeights, int x, + int yOffset, int scrollBottom, const Emote *emotes, int numEmotes, bool isInverted, bool isBold) +{ for (size_t i = 0; i < lines.size(); ++i) { int lineY = yOffset; for (size_t j = 0; j < i; ++j) lineY += rowHeights[j]; if (lineY > -rowHeights[i] && lineY < scrollBottom) { if (i == 0 && isInverted) { - display->drawString(x + 3, lineY, lines[i].c_str()); + display->drawString(x, lineY, lines[i].c_str()); if (isBold) - display->drawString(x + 4, lineY, lines[i].c_str()); + display->drawString(x, lineY, lines[i].c_str()); } else { drawStringWithEmotes(display, x, lineY, lines[i], emotes, numEmotes); } } } - - // Draw header at the end to sort out overlapping elements - graphics::drawCommonHeader(display, x, y, titleStr); } } // namespace MessageRenderer diff --git a/src/graphics/draw/MessageRenderer.h b/src/graphics/draw/MessageRenderer.h index d92b96014..c15a699f7 100644 --- a/src/graphics/draw/MessageRenderer.h +++ b/src/graphics/draw/MessageRenderer.h @@ -2,6 +2,8 @@ #include "OLEDDisplay.h" #include "OLEDDisplayUi.h" #include "graphics/emotes.h" +#include +#include namespace graphics { @@ -14,5 +16,15 @@ void drawStringWithEmotes(OLEDDisplay *display, int x, int y, const std::string /// Draws the text message frame for displaying received messages void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); +// Function to generate lines with word wrapping +std::vector generateLines(OLEDDisplay *display, const char *headerStr, const char *messageBuf, int textWidth); + +// Function to calculate heights for each line +std::vector calculateLineHeights(const std::vector &lines, const Emote *emotes); + +// Function to render the message content +void renderMessageContent(OLEDDisplay *display, const std::vector &lines, const std::vector &rowHeights, int x, + int yOffset, int scrollBottom, const Emote *emotes, int numEmotes, bool isInverted, bool isBold); + } // namespace MessageRenderer } // namespace graphics diff --git a/src/graphics/draw/NodeListRenderer.cpp b/src/graphics/draw/NodeListRenderer.cpp index 13b71546e..3f47a3a09 100644 --- a/src/graphics/draw/NodeListRenderer.cpp +++ b/src/graphics/draw/NodeListRenderer.cpp @@ -80,7 +80,11 @@ const char *getCurrentModeTitle(int screenWidth) case MODE_LAST_HEARD: return "Last Heard"; case MODE_HOP_SIGNAL: - return (screenWidth > 128) ? "Hops/Signal" : "Hops/Sig"; +#ifdef USE_EINK + return "Hops/Sig"; +#else + return (isHighResolution) ? "Hops/Signal" : "Hops/Sig"; +#endif case MODE_DISTANCE: return "Distance"; default: @@ -94,50 +98,11 @@ unsigned long getModeCycleIntervalMs() return 3000; } -// Calculate bearing between two lat/lon points -float calculateBearing(double lat1, double lon1, double lat2, double lon2) -{ - double dLon = (lon2 - lon1) * DEG_TO_RAD; - double y = sin(dLon) * cos(lat2 * DEG_TO_RAD); - double x = cos(lat1 * DEG_TO_RAD) * sin(lat2 * DEG_TO_RAD) - sin(lat1 * DEG_TO_RAD) * cos(lat2 * DEG_TO_RAD) * cos(dLon); - double bearing = atan2(y, x) * RAD_TO_DEG; - return fmod(bearing + 360.0, 360.0); -} - int calculateMaxScroll(int totalEntries, int visibleRows) { return std::max(0, (totalEntries - 1) / (visibleRows * 2)); } -void retrieveAndSortNodes(std::vector &nodeList) -{ - size_t numNodes = nodeDB->getNumMeshNodes(); - for (size_t i = 0; i < numNodes; i++) { - meshtastic_NodeInfoLite *node = nodeDB->getMeshNodeByIndex(i); - if (!node || node->num == nodeDB->getNodeNum()) - continue; - - NodeEntry entry; - entry.node = node; - entry.sortValue = sinceLastSeen(node); - - nodeList.push_back(entry); - } - - // Sort nodes: favorites first, then by last heard (most recent first) - std::sort(nodeList.begin(), nodeList.end(), [](const NodeEntry &a, const NodeEntry &b) { - bool aFav = a.node->is_favorite; - bool bFav = b.node->is_favorite; - if (aFav != bFav) - return aFav; - if (a.sortValue == 0 || a.sortValue == UINT32_MAX) - return false; - if (b.sortValue == 0 || b.sortValue == UINT32_MAX) - return true; - return a.sortValue < b.sortValue; - }); -} - void drawColumnSeparator(OLEDDisplay *display, int16_t x, int16_t yStart, int16_t yEnd) { int columnWidth = display->getWidth() / 2; @@ -170,7 +135,7 @@ void drawScrollbar(OLEDDisplay *display, int visibleNodeRows, int totalEntries, void drawEntryLastHeard(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth) { bool isLeftCol = (x < SCREEN_WIDTH / 2); - int timeOffset = (SCREEN_WIDTH > 128) ? (isLeftCol ? 7 : 10) : (isLeftCol ? 3 : 7); + int timeOffset = (isHighResolution) ? (isLeftCol ? 7 : 10) : (isLeftCol ? 3 : 7); const char *nodeName = getSafeNodeName(node); @@ -191,9 +156,9 @@ void drawEntryLastHeard(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); - display->drawString(x + ((SCREEN_WIDTH > 128) ? 6 : 3), y, nodeName); + display->drawString(x + ((isHighResolution) ? 6 : 3), y, nodeName); if (node->is_favorite) { - if (SCREEN_WIDTH > 128) { + if (isHighResolution) { drawScaledXBitmap16x16(x, y + 6, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint, display); } else { display->drawXbm(x, y + 5, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint); @@ -212,8 +177,8 @@ void drawEntryHopSignal(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int bool isLeftCol = (x < SCREEN_WIDTH / 2); int nameMaxWidth = columnWidth - 25; - int barsOffset = (SCREEN_WIDTH > 128) ? (isLeftCol ? 20 : 24) : (isLeftCol ? 15 : 19); - int hopOffset = (SCREEN_WIDTH > 128) ? (isLeftCol ? 21 : 29) : (isLeftCol ? 13 : 17); + int barsOffset = (isHighResolution) ? (isLeftCol ? 20 : 24) : (isLeftCol ? 15 : 19); + int hopOffset = (isHighResolution) ? (isLeftCol ? 21 : 29) : (isLeftCol ? 13 : 17); int barsXOffset = columnWidth - barsOffset; @@ -222,9 +187,9 @@ void drawEntryHopSignal(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); - display->drawStringMaxWidth(x + ((SCREEN_WIDTH > 128) ? 6 : 3), y, nameMaxWidth, nodeName); + display->drawStringMaxWidth(x + ((isHighResolution) ? 6 : 3), y, nameMaxWidth, nodeName); if (node->is_favorite) { - if (SCREEN_WIDTH > 128) { + if (isHighResolution) { drawScaledXBitmap16x16(x, y + 6, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint, display); } else { display->drawXbm(x, y + 5, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint); @@ -259,7 +224,7 @@ void drawEntryHopSignal(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int void drawNodeDistance(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16_t x, int16_t y, int columnWidth) { bool isLeftCol = (x < SCREEN_WIDTH / 2); - int nameMaxWidth = columnWidth - (SCREEN_WIDTH > 128 ? (isLeftCol ? 25 : 28) : (isLeftCol ? 20 : 22)); + int nameMaxWidth = columnWidth - (isHighResolution ? (isLeftCol ? 25 : 28) : (isLeftCol ? 20 : 22)); const char *nodeName = getSafeNodeName(node); char distStr[10] = ""; @@ -314,9 +279,9 @@ void drawNodeDistance(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16 display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); - display->drawStringMaxWidth(x + ((SCREEN_WIDTH > 128) ? 6 : 3), y, nameMaxWidth, nodeName); + display->drawStringMaxWidth(x + ((isHighResolution) ? 6 : 3), y, nameMaxWidth, nodeName); if (node->is_favorite) { - if (SCREEN_WIDTH > 128) { + if (isHighResolution) { drawScaledXBitmap16x16(x, y + 6, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint, display); } else { display->drawXbm(x, y + 5, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint); @@ -324,8 +289,8 @@ void drawNodeDistance(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16 } if (strlen(distStr) > 0) { - int offset = (SCREEN_WIDTH > 128) ? (isLeftCol ? 7 : 10) // Offset for Wide Screens (Left Column:Right Column) - : (isLeftCol ? 4 : 7); // Offset for Narrow Screens (Left Column:Right Column) + int offset = (isHighResolution) ? (isLeftCol ? 7 : 10) // Offset for Wide Screens (Left Column:Right Column) + : (isLeftCol ? 4 : 7); // Offset for Narrow Screens (Left Column:Right Column) int rightEdge = x + columnWidth - offset; int textWidth = display->getStringWidth(distStr); display->drawString(rightEdge - textWidth, y, distStr); @@ -354,15 +319,15 @@ void drawEntryCompass(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16 bool isLeftCol = (x < SCREEN_WIDTH / 2); // Adjust max text width depending on column and screen width - int nameMaxWidth = columnWidth - (SCREEN_WIDTH > 128 ? (isLeftCol ? 25 : 28) : (isLeftCol ? 20 : 22)); + int nameMaxWidth = columnWidth - (isHighResolution ? (isLeftCol ? 25 : 28) : (isLeftCol ? 20 : 22)); const char *nodeName = getSafeNodeName(node); display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); - display->drawStringMaxWidth(x + ((SCREEN_WIDTH > 128) ? 6 : 3), y, nameMaxWidth, nodeName); + display->drawStringMaxWidth(x + ((isHighResolution) ? 6 : 3), y, nameMaxWidth, nodeName); if (node->is_favorite) { - if (SCREEN_WIDTH > 128) { + if (isHighResolution) { drawScaledXBitmap16x16(x, y + 6, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint, display); } else { display->drawXbm(x, y + 5, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint); @@ -377,19 +342,21 @@ void drawCompassArrow(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16 return; bool isLeftCol = (x < SCREEN_WIDTH / 2); - int arrowXOffset = (SCREEN_WIDTH > 128) ? (isLeftCol ? 22 : 24) : (isLeftCol ? 12 : 18); + int arrowXOffset = (isHighResolution) ? (isLeftCol ? 22 : 24) : (isLeftCol ? 12 : 18); int centerX = x + columnWidth - arrowXOffset; int centerY = y + FONT_HEIGHT_SMALL / 2; double nodeLat = node->position.latitude_i * 1e-7; double nodeLon = node->position.longitude_i * 1e-7; - float bearingToNode = calculateBearing(userLat, userLon, nodeLat, nodeLon); + float bearing = GeoCoord::bearing(userLat, userLon, nodeLat, nodeLon); + float bearingToNode = RAD_TO_DEG * bearing; float relativeBearing = fmod((bearingToNode - myHeading + 360), 360); float angle = relativeBearing * DEG_TO_RAD; - // Shrink size by 2px int size = FONT_HEIGHT_SMALL - 5; + CompassRenderer::drawArrowToNode(display, centerX, centerY, size, relativeBearing); + /* float halfSize = size / 2.0; // Point of the arrow @@ -414,6 +381,7 @@ void drawCompassArrow(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16 // Draw the chevron-style arrowhead display->fillTriangle(tipX, tipY, leftX, leftY, notchX, notchY); display->fillTriangle(tipX, tipY, notchX, notchY, rightX, rightY); + */ } // ============================= @@ -436,19 +404,16 @@ void drawNodeListScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t // Space below header y += COMMON_HEADER_HEIGHT; - // Fetch and display sorted node list - std::vector nodeList; - retrieveAndSortNodes(nodeList); - - int totalEntries = nodeList.size(); + int totalEntries = nodeDB->getNumMeshNodes(); int totalRowsAvailable = (display->getHeight() - y) / rowYOffset; -#ifdef USE_EINK - totalRowsAvailable -= 1; -#endif + int visibleNodeRows = totalRowsAvailable; int totalColumns = 2; int startIndex = scrollIndex * visibleNodeRows * totalColumns; + if (nodeDB->getMeshNodeByIndex(startIndex)->num == nodeDB->getNodeNum()) { + startIndex++; // skip own node + } int endIndex = std::min(startIndex + visibleNodeRows * totalColumns, totalEntries); int yOffset = 0; @@ -460,10 +425,10 @@ void drawNodeListScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t for (int i = startIndex; i < endIndex; ++i) { int xPos = x + (col * columnWidth); int yPos = y + yOffset; - renderer(display, nodeList[i].node, xPos, yPos, columnWidth); + renderer(display, nodeDB->getMeshNodeByIndex(i), xPos, yPos, columnWidth); if (extras) { - extras(display, nodeList[i].node, xPos, yPos, columnWidth, heading, lat, lon); + extras(display, nodeDB->getMeshNodeByIndex(i), xPos, yPos, columnWidth, heading, lat, lon); } lastNodeY = std::max(lastNodeY, yPos + FONT_HEIGHT_SMALL); @@ -533,7 +498,12 @@ void drawLastHeardScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_ void drawHopSignalScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { +#ifdef USE_EINK + const char *title = "Hops/Sig"; +#else + const char *title = "Hops/Signal"; +#endif drawNodeListScreen(display, state, x, y, title, drawEntryHopSignal); } @@ -548,22 +518,24 @@ void drawNodeListWithCompasses(OLEDDisplay *display, OLEDDisplayUiState *state, { float heading = 0; bool validHeading = false; - double lat = 0; - double lon = 0; + auto ourNode = nodeDB->getMeshNode(nodeDB->getNodeNum()); + double lat = DegD(ourNode->position.latitude_i); + double lon = DegD(ourNode->position.longitude_i); + if (!screen->ignoreCompass) { #if HAS_GPS - if (screen->hasHeading()) { - heading = screen->getHeading(); // degrees - validHeading = true; - } else { - heading = screen->estimatedHeading(lat, lon); - validHeading = !isnan(heading); - } + if (screen->hasHeading()) { + heading = screen->getHeading(); // degrees + validHeading = true; + } else { + heading = screen->estimatedHeading(lat, lon); + validHeading = !isnan(heading); + } #endif - if (!validHeading) - return; - + if (!validHeading) + return; + } drawNodeListScreen(display, state, x, y, "Bearings", drawEntryCompass, drawCompassArrow, heading, lat, lon); } diff --git a/src/graphics/draw/NodeListRenderer.h b/src/graphics/draw/NodeListRenderer.h index 63f0d1c69..ea8df8bd9 100644 --- a/src/graphics/draw/NodeListRenderer.h +++ b/src/graphics/draw/NodeListRenderer.h @@ -23,12 +23,6 @@ namespace NodeListRenderer typedef void (*EntryRenderer)(OLEDDisplay *, meshtastic_NodeInfoLite *, int16_t, int16_t, int); typedef void (*NodeExtrasRenderer)(OLEDDisplay *, meshtastic_NodeInfoLite *, int16_t, int16_t, int, float, double, double); -// Node entry structure -struct NodeEntry { - meshtastic_NodeInfoLite *node; - uint32_t sortValue; -}; - // Node list mode enumeration enum NodeListMode { MODE_LAST_HEARD = 0, MODE_HOP_SIGNAL = 1, MODE_DISTANCE = 2, MODE_COUNT = 3 }; @@ -57,7 +51,6 @@ void drawNodeListWithCompasses(OLEDDisplay *display, OLEDDisplayUiState *state, // Utility functions const char *getCurrentModeTitle(int screenWidth); -void retrieveAndSortNodes(std::vector &nodeList); const char *getSafeNodeName(meshtastic_NodeInfoLite *node); void drawColumns(OLEDDisplay *display, int16_t x, int16_t y, const char **fields); diff --git a/src/graphics/draw/NotificationRenderer.cpp b/src/graphics/draw/NotificationRenderer.cpp index ed5257012..4866b4060 100644 --- a/src/graphics/draw/NotificationRenderer.cpp +++ b/src/graphics/draw/NotificationRenderer.cpp @@ -31,6 +31,7 @@ int8_t NotificationRenderer::curSelected = 0; char NotificationRenderer::alertBannerMessage[256] = {0}; uint32_t NotificationRenderer::alertBannerUntil = 0; // 0 is a special case meaning forever uint8_t NotificationRenderer::alertBannerOptions = 0; // last x lines are seelctable options +const char **NotificationRenderer::optionsArrayPtr = nullptr; std::function NotificationRenderer::alertBannerCallback = NULL; bool NotificationRenderer::pauseBanner = false; @@ -56,29 +57,22 @@ void NotificationRenderer::drawSSLScreen(OLEDDisplay *display, OLEDDisplayUiStat void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisplayUiState *state) { - // Exit if no message is active or duration has passed - if (!isOverlayBannerShowing()) - return; - - if (pauseBanner) + if (!isOverlayBannerShowing() || pauseBanner) return; // === Layout Configuration === - constexpr uint16_t padding = 5; // Padding around text inside the box - constexpr uint16_t vPadding = 2; // Padding around text inside the box - constexpr uint8_t lineSpacing = 1; // Extra space between lines + constexpr uint16_t hPadding = 5; + constexpr uint16_t vPadding = 2; + constexpr uint8_t lineSpacing = 1; - // Search the message to determine if we need the bell added bool needs_bell = (strstr(alertBannerMessage, "Alert Received") != nullptr); - uint8_t firstOption = 0; - uint8_t firstOptionToShow = 0; - // Setup font and alignment display->setFont(FONT_SMALL); - display->setTextAlignment(TEXT_ALIGN_LEFT); // We will manually center per line - const int MAX_LINES = 24; + display->setTextAlignment(TEXT_ALIGN_LEFT); + constexpr int MAX_LINES = 5; + uint16_t optionWidths[alertBannerOptions] = {0}; uint16_t maxWidth = 0; uint16_t arrowsWidth = display->getStringWidth("> <", 4, true); uint16_t lineWidths[MAX_LINES] = {0}; @@ -86,30 +80,33 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp char *lineStarts[MAX_LINES + 1]; uint16_t lineCount = 0; char lineBuffer[40] = {0}; - // pointer to the terminating null + + // Parse lines char *alertEnd = alertBannerMessage + strnlen(alertBannerMessage, sizeof(alertBannerMessage)); lineStarts[lineCount] = alertBannerMessage; - // loop through lines finding \n characters while ((lineCount < MAX_LINES) && (lineStarts[lineCount] < alertEnd)) { lineStarts[lineCount + 1] = std::find(lineStarts[lineCount], alertEnd, '\n'); lineLengths[lineCount] = lineStarts[lineCount + 1] - lineStarts[lineCount]; - if (lineStarts[lineCount + 1][0] == '\n') { - lineStarts[lineCount + 1] += 1; // Move the start pointer beyond the \n - } + if (lineStarts[lineCount + 1][0] == '\n') + lineStarts[lineCount + 1] += 1; lineWidths[lineCount] = display->getStringWidth(lineStarts[lineCount], lineLengths[lineCount], true); - if (lineWidths[lineCount] > maxWidth) { + if (lineWidths[lineCount] > maxWidth) maxWidth = lineWidths[lineCount]; - } - if (alertBannerOptions > 0 && lineCount > 0 && lineWidths[lineCount] + arrowsWidth > maxWidth) { - maxWidth = lineWidths[lineCount] + arrowsWidth; - } lineCount++; - // if we are doing a selection, add extra width for arrows } + // Measure option widths + for (int i = 0; i < alertBannerOptions; i++) { + optionWidths[i] = display->getStringWidth(optionsArrayPtr[i], strlen(optionsArrayPtr[i]), true); + if (optionWidths[i] > maxWidth) + maxWidth = optionWidths[i]; + if (optionWidths[i] + arrowsWidth > maxWidth) + maxWidth = optionWidths[i] + arrowsWidth; + } + + // Handle input if (alertBannerOptions > 0) { - // respond to input if (inEvent == INPUT_BROKER_UP || inEvent == INPUT_BROKER_ALT_PRESS) { curSelected--; } else if (inEvent == INPUT_BROKER_DOWN || inEvent == INPUT_BROKER_USER_PRESS) { @@ -120,113 +117,133 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp } else if ((inEvent == INPUT_BROKER_CANCEL || inEvent == INPUT_BROKER_ALT_LONG) && alertBannerUntil != 0) { alertBannerMessage[0] = '\0'; } + if (curSelected == -1) curSelected = alertBannerOptions - 1; if (curSelected == alertBannerOptions) curSelected = 0; - // compare number of options to number of lines - if (lineCount < alertBannerOptions) - return; - firstOption = lineCount - alertBannerOptions; - if (curSelected > 1 && alertBannerOptions > 3) { - firstOptionToShow = curSelected + firstOption - 1; - // put the selected option in the middle - } else { - firstOptionToShow = firstOption; - } - } else { // not in an alert with a callback - // TODO: check that at least a second has passed since the alert started + } else { if (inEvent == INPUT_BROKER_SELECT || inEvent == INPUT_BROKER_ALT_LONG || inEvent == INPUT_BROKER_CANCEL) { - alertBannerMessage[0] = '\0'; // end the alert early + alertBannerMessage[0] = '\0'; } } + inEvent = INPUT_BROKER_NONE; if (alertBannerMessage[0] == '\0') return; - // set width from longest line - uint16_t boxWidth = padding * 2 + maxWidth; + // === Box Size Calculation === + uint16_t boxWidth = hPadding * 2 + maxWidth; if (needs_bell) { - if (SCREEN_WIDTH > 128 && boxWidth <= 150) { + if (isHighResolution && boxWidth <= 150) boxWidth += 26; - } - if (SCREEN_WIDTH <= 128 && boxWidth <= 100) { + if (!isHighResolution && boxWidth <= 100) boxWidth += 20; - } - } - // calculate max lines on screen? for now it's 4 - // set height from line count - uint16_t boxHeight; - if (lineCount <= 4) { - boxHeight = vPadding * 2 + lineCount * FONT_HEIGHT_SMALL + (lineCount - 1) * lineSpacing; - } else { - boxHeight = vPadding * 2 + 4 * FONT_HEIGHT_SMALL + 4 * lineSpacing; } + uint16_t totalLines = lineCount + alertBannerOptions; + uint16_t screenHeight = display->height(); + uint8_t effectiveLineHeight = FONT_HEIGHT_SMALL - 3; + uint8_t visibleTotalLines = std::min(totalLines, (screenHeight - vPadding * 2) / effectiveLineHeight); + uint16_t contentHeight = visibleTotalLines * effectiveLineHeight; + uint16_t boxHeight = contentHeight + vPadding * 2; + int16_t boxLeft = (display->width() / 2) - (boxWidth / 2); int16_t boxTop = (display->height() / 2) - (boxHeight / 2); - // === Draw background box === + + // === Draw Box === display->setColor(BLACK); - display->fillRect(boxLeft - 1, boxTop - 1, boxWidth + 2, boxHeight + 2); // Slightly oversized box - display->fillRect(boxLeft, boxTop - 2, boxWidth, 1); // Top Line - display->fillRect(boxLeft, boxTop + boxHeight + 1, boxWidth, 1); // Bottom Line - display->fillRect(boxLeft - 2, boxTop, 1, boxHeight); // Left Line - display->fillRect(boxLeft + boxWidth + 1, boxTop, 1, boxHeight); // Right Line + display->fillRect(boxLeft - 1, boxTop - 1, boxWidth + 2, boxHeight + 2); + display->fillRect(boxLeft, boxTop - 2, boxWidth, 1); + display->fillRect(boxLeft, boxTop + boxHeight + 1, boxWidth, 1); + display->fillRect(boxLeft - 2, boxTop, 1, boxHeight); + display->fillRect(boxLeft + boxWidth + 1, boxTop, 1, boxHeight); display->setColor(WHITE); - display->drawRect(boxLeft, boxTop, boxWidth, boxHeight); // Border + display->drawRect(boxLeft, boxTop, boxWidth, boxHeight); display->setColor(BLACK); - display->fillRect(boxLeft, boxTop, 1, 1); // Top Left - display->fillRect(boxLeft + boxWidth - 1, boxTop, 1, 1); // Top Right - display->fillRect(boxLeft, boxTop + boxHeight - 1, 1, 1); // Bottom Left - display->fillRect(boxLeft + boxWidth - 1, boxTop + boxHeight - 1, 1, 1); // Bottom Right + display->fillRect(boxLeft, boxTop, 1, 1); + display->fillRect(boxLeft + boxWidth - 1, boxTop, 1, 1); + display->fillRect(boxLeft, boxTop + boxHeight - 1, 1, 1); + display->fillRect(boxLeft + boxWidth - 1, boxTop + boxHeight - 1, 1, 1); display->setColor(WHITE); - // === Draw each line centered in the box === + // === Draw Content === int16_t lineY = boxTop + vPadding; + uint8_t linesShown = 0; - for (int i = 0; i < lineCount; i++) { - // is this line selected? - // if so, start the buffer with -> and strncpy to the 4th location - if (i < lineCount - alertBannerOptions || alertBannerOptions == 0) { - strncpy(lineBuffer, lineStarts[i], 40); - if (lineLengths[i] > 39) - lineBuffer[39] = '\0'; - else - lineBuffer[lineLengths[i]] = '\0'; - } else if (i >= firstOptionToShow && i < firstOptionToShow + 3) { - if (i == curSelected + firstOption) { - if (lineLengths[i] > 35) - lineLengths[i] = 35; - strncpy(lineBuffer, "> ", 3); - strncpy(lineBuffer + 2, lineStarts[i], 36); - strncpy(lineBuffer + lineLengths[i] + 2, " <", 3); - lineLengths[i] += 4; - lineWidths[i] += display->getStringWidth("> <", 4, true); - if (lineLengths[i] > 35) - lineBuffer[39] = '\0'; - else - lineBuffer[lineLengths[i]] = '\0'; - } else { - strncpy(lineBuffer, lineStarts[i], 40); - if (lineLengths[i] > 39) - lineBuffer[39] = '\0'; - else - lineBuffer[lineLengths[i]] = '\0'; - } - } else { // add break for the additional lines - continue; - } + for (int i = 0; i < lineCount && linesShown < visibleTotalLines; i++, linesShown++) { + strncpy(lineBuffer, lineStarts[i], 40); + lineBuffer[lineLengths[i] > 39 ? 39 : lineLengths[i]] = '\0'; int16_t textX = boxLeft + (boxWidth - lineWidths[i]) / 2; - if (needs_bell && i == 0) { int bellY = lineY + (FONT_HEIGHT_SMALL - 8) / 2; display->drawXbm(textX - 10, bellY, 8, 8, bell_alert); display->drawXbm(textX + lineWidths[i] + 2, bellY, 8, 8, bell_alert); } + // Determine if this is a pop-up or a pick list + if (alertBannerOptions > 0) { + // Pick List + display->setColor(WHITE); + int background_yOffset = 1; + // Determine if we have low hanging characters + if (strchr(lineBuffer, 'p') || strchr(lineBuffer, 'g') || strchr(lineBuffer, 'y') || strchr(lineBuffer, 'j')) { + background_yOffset = -1; + } + display->fillRect(boxLeft, boxTop + 1, boxWidth, effectiveLineHeight - background_yOffset); + display->setColor(BLACK); + int yOffset = 3; + display->drawString(textX, lineY - yOffset, lineBuffer); + display->setColor(WHITE); + lineY += (effectiveLineHeight - 2 - background_yOffset); + } else { + // Pop-up + display->drawString(textX, lineY - 2, lineBuffer); + lineY += (effectiveLineHeight); + } + } + + uint8_t firstOptionToShow = 0; + if (alertBannerOptions > 0) { + if (curSelected > 1 && alertBannerOptions > visibleTotalLines - lineCount) + firstOptionToShow = curSelected - 1; + else + firstOptionToShow = 0; + } + + for (int i = firstOptionToShow; i < alertBannerOptions && linesShown < visibleTotalLines; i++, linesShown++) { + if (i == curSelected) { + strncpy(lineBuffer, "> ", 3); + strncpy(lineBuffer + 2, optionsArrayPtr[i], 36); + strncpy(lineBuffer + strlen(optionsArrayPtr[i]) + 2, " <", 3); + lineBuffer[39] = '\0'; + } else { + strncpy(lineBuffer, optionsArrayPtr[i], 40); + lineBuffer[39] = '\0'; + } + + int16_t textX = boxLeft + (boxWidth - optionWidths[i] - (i == curSelected ? arrowsWidth : 0)) / 2; display->drawString(textX, lineY, lineBuffer); - lineY += FONT_HEIGHT_SMALL + lineSpacing; + lineY += effectiveLineHeight; + } + + // === Scroll Bar (Thicker, inside box, not over title) === + if (totalLines > visibleTotalLines) { + const uint8_t scrollBarWidth = 5; + const uint8_t scrollPadding = 2; + + int16_t scrollBarX = boxLeft + boxWidth - scrollBarWidth - 2; + int16_t scrollBarY = boxTop + vPadding + effectiveLineHeight; // start after title line + uint16_t scrollBarHeight = boxHeight - vPadding * 2 - effectiveLineHeight; + + float ratio = (float)visibleTotalLines / totalLines; + uint16_t indicatorHeight = std::max((int)(scrollBarHeight * ratio), 4); + float scrollRatio = (float)(firstOptionToShow + linesShown - visibleTotalLines) / (totalLines - visibleTotalLines); + uint16_t indicatorY = scrollBarY + scrollRatio * (scrollBarHeight - indicatorHeight); + + display->drawRect(scrollBarX, scrollBarY, scrollBarWidth, scrollBarHeight); + display->fillRect(scrollBarX + 1, indicatorY, scrollBarWidth - 2, indicatorHeight); } } diff --git a/src/graphics/draw/NotificationRenderer.h b/src/graphics/draw/NotificationRenderer.h index 3ed931dc6..2ec5fd9ec 100644 --- a/src/graphics/draw/NotificationRenderer.h +++ b/src/graphics/draw/NotificationRenderer.h @@ -12,7 +12,8 @@ class NotificationRenderer static char inEvent; static int8_t curSelected; static char alertBannerMessage[256]; - static uint32_t alertBannerUntil; // 0 is a special case meaning forever + static uint32_t alertBannerUntil; // 0 is a special case meaning forever + static const char **optionsArrayPtr; static uint8_t alertBannerOptions; // last x lines are seelctable options static std::function alertBannerCallback; diff --git a/src/graphics/draw/UIRenderer.cpp b/src/graphics/draw/UIRenderer.cpp index a77d5b44b..1738a8246 100644 --- a/src/graphics/draw/UIRenderer.cpp +++ b/src/graphics/draw/UIRenderer.cpp @@ -18,6 +18,32 @@ #include #include +bool isAllowedPunctuation(char c) +{ + const std::string allowed = ".,!?;:-_()[]{}'\"@#$/\\&+=%~^ "; + return allowed.find(c) != std::string::npos; +} + +std::string sanitizeString(const std::string &input) +{ + std::string output; + bool inReplacement = false; + + for (char c : input) { + if (std::isalnum(static_cast(c)) || isAllowedPunctuation(c)) { + output += c; + inReplacement = false; + } else { + if (!inReplacement) { + output += 0xbf; // ISO-8859-1 for inverted question mark + inReplacement = true; + } + } + } + + return output; +} + #if !MESHTASTIC_EXCLUDE_GPS // External variables @@ -38,7 +64,7 @@ NodeNum UIRenderer::currentFavoriteNodeNum = 0; void UIRenderer::drawGps(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::GPSStatus *gps) { // Draw satellite image - if (SCREEN_WIDTH > 128) { + if (isHighResolution) { NodeListRenderer::drawScaledXBitmap16x16(x, y - 2, imgSatellite_width, imgSatellite_height, imgSatellite, display); } else { display->drawXbm(x + 1, y + 1, imgSatellite_width, imgSatellite_height, imgSatellite); @@ -58,7 +84,7 @@ void UIRenderer::drawGps(OLEDDisplay *display, int16_t x, int16_t y, const mesht } else { snprintf(textString, sizeof(textString), "%u sats", gps->getNumSatellites()); } - if (SCREEN_WIDTH > 128) { + if (isHighResolution) { display->drawString(x + 18, y, textString); } else { display->drawString(x + 11, y, textString); @@ -163,46 +189,6 @@ void UIRenderer::drawGpsCoordinates(OLEDDisplay *display, int16_t x, int16_t y, } } -void UIRenderer::drawBattery(OLEDDisplay *display, int16_t x, int16_t y, uint8_t *imgBuffer, - const meshtastic::PowerStatus *powerStatus) -{ - static const uint8_t powerBar[3] = {0x81, 0xBD, 0xBD}; - static const uint8_t lightning[8] = {0xA1, 0xA1, 0xA5, 0xAD, 0xB5, 0xA5, 0x85, 0x85}; - - // Clear the bar area inside the battery image - for (int i = 1; i < 14; i++) { - imgBuffer[i] = 0x81; - } - - // Fill with lightning or power bars - if (powerStatus->getIsCharging()) { - memcpy(imgBuffer + 3, lightning, 8); - } else { - for (int i = 0; i < 4; i++) { - if (powerStatus->getBatteryChargePercent() >= 25 * i) - memcpy(imgBuffer + 1 + (i * 3), powerBar, 3); - } - } - - // Slightly more conservative scaling based on screen width - int scale = 1; - - if (SCREEN_WIDTH >= 200) - scale = 2; - if (SCREEN_WIDTH >= 300) - scale = 2; // Do NOT go higher than 2 - - // Draw scaled battery image (16 columns × 8 rows) - for (int col = 0; col < 16; col++) { - uint8_t colBits = imgBuffer[col]; - for (int row = 0; row < 8; row++) { - if (colBits & (1 << row)) { - display->fillRect(x + col * scale, y + row * scale, scale, scale); - } - } - } -} - // Draw nodes status void UIRenderer::drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::NodeStatus *nodeStatus, int node_offset, bool show_total, String additional_words) @@ -221,19 +207,19 @@ void UIRenderer::drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const mes defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS)) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) - if (SCREEN_WIDTH > 128) { + if (isHighResolution) { NodeListRenderer::drawScaledXBitmap16x16(x, y - 1, 8, 8, imgUser, display); } else { display->drawFastImage(x, y + 3, 8, 8, imgUser); } #else - if (SCREEN_WIDTH > 128) { + if (isHighResolution) { NodeListRenderer::drawScaledXBitmap16x16(x, y - 1, 8, 8, imgUser, display); } else { display->drawFastImage(x, y + 1, 8, 8, imgUser); } #endif - int string_offset = (SCREEN_WIDTH > 128) ? 9 : 0; + int string_offset = (isHighResolution) ? 9 : 0; display->drawString(x + 10 + string_offset, y - 2, usersString); } @@ -293,12 +279,14 @@ void UIRenderer::drawNodeInfo(OLEDDisplay *display, const OLEDDisplayUiState *st // List of available macro Y positions in order, from top to bottom. int line = 1; // which slot to use next + std::string usernameStr; // === 1. Long Name (always try to show first) === const char *username = (node->has_user && node->user.long_name[0]) ? node->user.long_name : nullptr; - if (username && line < 5) { + if (username) { + usernameStr = sanitizeString(username); // Sanitize the incoming long_name just in case // Print node's long name (e.g. "Backpack Node") - display->drawString(x, getTextPositions(display)[line++], username); + display->drawString(x, getTextPositions(display)[line++], usernameStr.c_str()); } // === 2. Signal and Hops (combined on one line, if available) === @@ -456,8 +444,11 @@ void UIRenderer::drawNodeInfo(OLEDDisplay *display, const OLEDDisplayUiState *st GeoCoord::latLongToMeter(DegD(p.latitude_i), DegD(p.longitude_i), DegD(op.latitude_i), DegD(op.longitude_i)); */ float bearing = GeoCoord::bearing(DegD(op.latitude_i), DegD(op.longitude_i), DegD(p.latitude_i), DegD(p.longitude_i)); - if (!config.display.compass_north_top) + if (screen->ignoreCompass) { + myHeading = 0; + } else { bearing -= myHeading; + } display->drawCircle(compassX, compassY, compassRadius); CompassRenderer::drawCompassNorth(display, compassX, compassY, myHeading, compassRadius); @@ -476,7 +467,7 @@ void UIRenderer::drawNodeInfo(OLEDDisplay *display, const OLEDDisplayUiState *st const int margin = 4; // --------- PATCH FOR EINK NAV BAR (ONLY CHANGE BELOW) ----------- #if defined(USE_EINK) - const int iconSize = (SCREEN_WIDTH > 128) ? 16 : 8; + const int iconSize = (isHighResolution) ? 16 : 8; const int navBarHeight = iconSize + 6; #else const int navBarHeight = 0; @@ -497,8 +488,11 @@ void UIRenderer::drawNodeInfo(OLEDDisplay *display, const OLEDDisplayUiState *st int compassY = yBelowContent + availableHeight / 2; const auto &op = ourNode->position; - float myHeading = screen->hasHeading() ? screen->getHeading() * PI / 180 - : screen->estimatedHeading(DegD(op.latitude_i), DegD(op.longitude_i)); + float myHeading = 0; + if (!screen->ignoreCompass) { + myHeading = screen->hasHeading() ? screen->getHeading() * PI / 180 + : screen->estimatedHeading(DegD(op.latitude_i), DegD(op.longitude_i)); + } graphics::CompassRenderer::drawCompassNorth(display, compassX, compassY, myHeading, compassRadius); const auto &p = node->position; @@ -507,7 +501,7 @@ void UIRenderer::drawNodeInfo(OLEDDisplay *display, const OLEDDisplayUiState *st GeoCoord::latLongToMeter(DegD(p.latitude_i), DegD(p.longitude_i), DegD(op.latitude_i), DegD(op.longitude_i)); */ float bearing = GeoCoord::bearing(DegD(op.latitude_i), DegD(op.longitude_i), DegD(p.latitude_i), DegD(p.longitude_i)); - if (!config.display.compass_north_top) + if (!screen->ignoreCompass) bearing -= myHeading; graphics::CompassRenderer::drawNodeHeading(display, compassX, compassY, compassRadius * 2, bearing); @@ -570,15 +564,15 @@ void UIRenderer::drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *sta } else { displayLine = config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT ? "No GPS" : "GPS off"; } - int yOffset = (SCREEN_WIDTH > 128) ? 3 : 1; - if (SCREEN_WIDTH > 128) { + int yOffset = (isHighResolution) ? 3 : 1; + if (isHighResolution) { NodeListRenderer::drawScaledXBitmap16x16(x, getTextPositions(display)[line] + yOffset - 5, imgSatellite_width, imgSatellite_height, imgSatellite, display); } else { display->drawXbm(x + 1, getTextPositions(display)[line] + yOffset, imgSatellite_width, imgSatellite_height, imgSatellite); } - int xOffset = (SCREEN_WIDTH > 128) ? 6 : 0; + int xOffset = (isHighResolution) ? 6 : 0; display->drawString(x + 11 + xOffset, getTextPositions(display)[line], displayLine); } else { UIRenderer::drawGps(display, 0, getTextPositions(display)[line], gpsStatus); @@ -602,17 +596,17 @@ void UIRenderer::drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *sta char chUtilPercentage[10]; snprintf(chUtilPercentage, sizeof(chUtilPercentage), "%2.0f%%", airTime->channelUtilizationPercent()); - int chUtil_x = (SCREEN_WIDTH > 128) ? display->getStringWidth(chUtil) + 10 : display->getStringWidth(chUtil) + 5; + int chUtil_x = (isHighResolution) ? display->getStringWidth(chUtil) + 10 : display->getStringWidth(chUtil) + 5; int chUtil_y = getTextPositions(display)[line] + 3; - int chutil_bar_width = (SCREEN_WIDTH > 128) ? 100 : 50; + int chutil_bar_width = (isHighResolution) ? 100 : 50; if (!config.bluetooth.enabled) { - chutil_bar_width = (SCREEN_WIDTH > 128) ? 80 : 40; + chutil_bar_width = (isHighResolution) ? 80 : 40; } - int chutil_bar_height = (SCREEN_WIDTH > 128) ? 12 : 7; - int extraoffset = (SCREEN_WIDTH > 128) ? 6 : 3; + int chutil_bar_height = (isHighResolution) ? 12 : 7; + int extraoffset = (isHighResolution) ? 6 : 3; if (!config.bluetooth.enabled) { - extraoffset = (SCREEN_WIDTH > 128) ? 6 : 1; + extraoffset = (isHighResolution) ? 6 : 1; } int chutil_percent = airTime->channelUtilizationPercent(); @@ -672,21 +666,20 @@ void UIRenderer::drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *sta // === Fourth & Fifth Rows: Node Identity === int textWidth = 0; int nameX = 0; - int yOffset = (SCREEN_WIDTH > 128) ? 0 : 5; + int yOffset = (isHighResolution) ? 0 : 5; const char *longName = nullptr; + std::string longNameStr; + meshtastic_NodeInfoLite *ourNode = nodeDB->getMeshNode(nodeDB->getNodeNum()); if (ourNode && ourNode->has_user && strlen(ourNode->user.long_name) > 0) { - longName = ourNode->user.long_name; + longNameStr = sanitizeString(ourNode->user.long_name); } - uint8_t dmac[6]; char shortnameble[35]; - getMacAddr(dmac); - snprintf(screen->ourId, sizeof(screen->ourId), "%02x%02x", dmac[4], dmac[5]); snprintf(shortnameble, sizeof(shortnameble), "%s", graphics::UIRenderer::haveGlyphs(owner.short_name) ? owner.short_name : ""); char combinedName[50]; - snprintf(combinedName, sizeof(combinedName), "%s (%s)", longName, shortnameble); + snprintf(combinedName, sizeof(combinedName), "%s (%s)", longNameStr.empty() ? "" : longNameStr.c_str(), shortnameble); if (SCREEN_WIDTH - (display->getStringWidth(longName) + display->getStringWidth(shortnameble)) > 10) { size_t len = strlen(combinedName); if (len >= 3 && strcmp(combinedName + len - 3, " ()") == 0) { @@ -700,7 +693,7 @@ void UIRenderer::drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *sta // === LongName Centered === textWidth = display->getStringWidth(longName); nameX = (SCREEN_WIDTH - textWidth) / 2; - display->drawString(nameX, getTextPositions(display)[line++], longName); + display->drawString(nameX, getTextPositions(display)[line++], longNameStr.c_str()); // === ShortName Centered === textWidth = display->getStringWidth(shortnameble); @@ -808,44 +801,42 @@ void UIRenderer::drawScreensaverOverlay(OLEDDisplay *display, OLEDDisplayUiState { LOG_DEBUG("Draw screensaver overlay"); - EINK_ADD_FRAMEFLAG(display, COSMETIC); // Take the opportunity for a full-refresh + EINK_ADD_FRAMEFLAG(display, COSMETIC); // Full refresh for screensaver // Config display->setFont(FONT_SMALL); display->setTextAlignment(TEXT_ALIGN_LEFT); const char *pauseText = "Screen Paused"; const char *idText = owner.short_name; - const bool useId = haveGlyphs(idText); // This bool is used to hide the idText box if we can't render the short name - constexpr uint16_t padding = 5; + const bool useId = haveGlyphs(idText); + constexpr uint8_t padding = 2; constexpr uint8_t dividerGap = 1; - constexpr uint8_t imprecision = 5; // How far the box origins can drift from center. Combat burn-in. - // Dimensions - const uint16_t idTextWidth = display->getStringWidth(idText, strlen(idText), true); // "true": handle utf8 chars + // Text widths + const uint16_t idTextWidth = display->getStringWidth(idText, strlen(idText), true); const uint16_t pauseTextWidth = display->getStringWidth(pauseText, strlen(pauseText)); - const uint16_t boxWidth = padding + (useId ? idTextWidth + padding + padding : 0) + pauseTextWidth + padding; - const uint16_t boxHeight = padding + FONT_HEIGHT_SMALL + padding; + const uint16_t boxWidth = padding + (useId ? idTextWidth + padding : 0) + pauseTextWidth + padding; + const uint16_t boxHeight = FONT_HEIGHT_SMALL + (padding * 2); - // Position - const int16_t boxLeft = (display->width() / 2) - (boxWidth / 2) + random(-imprecision, imprecision + 1); - // const int16_t boxRight = boxLeft + boxWidth - 1; - const int16_t boxTop = (display->height() / 2) - (boxHeight / 2 + random(-imprecision, imprecision + 1)); - const int16_t boxBottom = boxTop + boxHeight - 1; + // Flush with bottom + const int16_t boxLeft = (display->width() / 2) - (boxWidth / 2); + const int16_t boxTop = display->height() - boxHeight; + const int16_t boxBottom = display->height() - 1; const int16_t idTextLeft = boxLeft + padding; const int16_t idTextTop = boxTop + padding; - const int16_t pauseTextLeft = boxLeft + (useId ? padding + idTextWidth + padding : 0) + padding; + const int16_t pauseTextLeft = boxLeft + (useId ? idTextWidth + (padding * 2) : 0) + padding; const int16_t pauseTextTop = boxTop + padding; const int16_t dividerX = boxLeft + padding + idTextWidth + padding; - const int16_t dividerTop = boxTop + 1 + dividerGap; - const int16_t dividerBottom = boxBottom - 1 - dividerGap; + const int16_t dividerTop = boxTop + dividerGap; + const int16_t dividerBottom = boxBottom - dividerGap; // Draw: box display->setColor(EINK_WHITE); - display->fillRect(boxLeft - 1, boxTop - 1, boxWidth + 2, boxHeight + 2); // Clear a slightly oversized area for the box + display->fillRect(boxLeft, boxTop, boxWidth, boxHeight); display->setColor(EINK_BLACK); display->drawRect(boxLeft, boxTop, boxWidth, boxHeight); - // Draw: Text + // Draw: text if (useId) display->drawString(idTextLeft, idTextTop, idText); display->drawString(pauseTextLeft, pauseTextTop, pauseText); @@ -920,15 +911,15 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU } else { displayLine = config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_NOT_PRESENT ? "No GPS" : "GPS off"; } - int yOffset = (SCREEN_WIDTH > 128) ? 3 : 1; - if (SCREEN_WIDTH > 128) { + int yOffset = (isHighResolution) ? 3 : 1; + if (isHighResolution) { NodeListRenderer::drawScaledXBitmap16x16(x, getTextPositions(display)[line] + yOffset - 5, imgSatellite_width, imgSatellite_height, imgSatellite, display); } else { display->drawXbm(x + 1, getTextPositions(display)[line] + yOffset, imgSatellite_width, imgSatellite_height, imgSatellite); } - int xOffset = (SCREEN_WIDTH > 128) ? 6 : 0; + int xOffset = (isHighResolution) ? 6 : 0; display->drawString(x + 11 + xOffset, getTextPositions(display)[line++], displayLine); } else { UIRenderer::drawGps(display, 0, getTextPositions(display)[line++], gpsStatus); @@ -941,15 +932,18 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU int32_t(gpsStatus->getAltitude())); // === Determine Compass Heading === - float heading; + float heading = 0; bool validHeading = false; - - if (screen->hasHeading()) { - heading = radians(screen->getHeading()); + if (screen->ignoreCompass) { validHeading = true; } else { - heading = screen->estimatedHeading(geoCoord.getLatitude() * 1e-7, geoCoord.getLongitude() * 1e-7); - validHeading = !isnan(heading); + if (screen->hasHeading()) { + heading = radians(screen->getHeading()); + validHeading = true; + } else { + heading = screen->estimatedHeading(geoCoord.getLatitude() * 1e-7, geoCoord.getLongitude() * 1e-7); + validHeading = !isnan(heading); + } } // If GPS is off, no need to display these parts @@ -1005,7 +999,9 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU display->drawCircle(compassX, compassY, compassRadius); // "N" label - float northAngle = -heading; + float northAngle = 0; + if (!config.display.compass_north_top) + northAngle = -heading; float radius = compassRadius; int16_t nX = compassX + (radius - 1) * sin(northAngle); int16_t nY = compassY - (radius - 1) * cos(northAngle); @@ -1046,7 +1042,9 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU display->drawCircle(compassX, compassY, compassRadius); // "N" label - float northAngle = -heading; + float northAngle = 0; + if (!config.display.compass_north_top) + northAngle = -heading; float radius = compassRadius; int16_t nX = compassX + (radius - 1) * sin(northAngle); int16_t nY = compassY - (radius - 1) * cos(northAngle); @@ -1114,18 +1112,6 @@ void UIRenderer::drawOEMBootScreen(OLEDDisplay *display, OLEDDisplayUiState *sta #endif -// Function overlay for showing mute/buzzer modifiers etc. -void UIRenderer::drawFunctionOverlay(OLEDDisplay *display, OLEDDisplayUiState *state) -{ - // LOG_DEBUG("Draw function overlay"); - if (functionSymbol.begin() != functionSymbol.end()) { - char buf[64]; - display->setFont(FONT_SMALL); - snprintf(buf, sizeof(buf), "%s", functionSymbolString.c_str()); - display->drawString(SCREEN_WIDTH - display->getStringWidth(buf), SCREEN_HEIGHT - FONT_HEIGHT_SMALL, buf); - } -} - // Navigation bar overlay implementation static int8_t lastFrameIndex = -1; static uint32_t lastFrameChangeTime = 0; @@ -1141,10 +1127,9 @@ void UIRenderer::drawNavigationBar(OLEDDisplay *display, OLEDDisplayUiState *sta lastFrameChangeTime = millis(); } - const bool useBigIcons = (SCREEN_WIDTH > 128); - const int iconSize = useBigIcons ? 16 : 8; - const int spacing = useBigIcons ? 8 : 4; - const int bigOffset = useBigIcons ? 1 : 0; + const int iconSize = isHighResolution ? 16 : 8; + const int spacing = isHighResolution ? 8 : 4; + const int bigOffset = isHighResolution ? 1 : 0; const size_t totalIcons = screen->indicatorIcons.size(); if (totalIcons == 0) @@ -1158,14 +1143,35 @@ void UIRenderer::drawNavigationBar(OLEDDisplay *display, OLEDDisplayUiState *sta const int totalWidth = (pageEnd - pageStart) * iconSize + (pageEnd - pageStart - 1) * spacing; const int xStart = (SCREEN_WIDTH - totalWidth) / 2; - // Only show bar briefly after switching frames (unless on E-Ink) + // Only show bar briefly after switching frames + static uint32_t navBarLastShown = 0; + static bool cosmeticRefreshDone = false; + + bool navBarVisible = millis() - lastFrameChangeTime <= ICON_DISPLAY_DURATION_MS; + int y = navBarVisible ? (SCREEN_HEIGHT - iconSize - 1) : SCREEN_HEIGHT; + #if defined(USE_EINK) - int y = SCREEN_HEIGHT - iconSize - 1; -#else - int y = SCREEN_HEIGHT - iconSize - 1; - if (millis() - lastFrameChangeTime > ICON_DISPLAY_DURATION_MS) { - y = SCREEN_HEIGHT; + static bool navBarPrevVisible = false; + + if (navBarVisible && !navBarPrevVisible) { + EINK_ADD_FRAMEFLAG(display, DEMAND_FAST); // Fast refresh when showing nav bar + cosmeticRefreshDone = false; + navBarLastShown = millis(); } + + if (!navBarVisible && navBarPrevVisible) { + EINK_ADD_FRAMEFLAG(display, DEMAND_FAST); // Fast refresh when hiding nav bar + navBarLastShown = millis(); // Mark when it disappeared + } + + if (!navBarVisible && navBarLastShown != 0 && !cosmeticRefreshDone) { + if (millis() - navBarLastShown > 10000) { // 10s after hidden + EINK_ADD_FRAMEFLAG(display, COSMETIC); // One-time ghost cleanup + cosmeticRefreshDone = true; + } + } + + navBarPrevVisible = navBarVisible; #endif // Pre-calculate bounding rect @@ -1191,7 +1197,7 @@ void UIRenderer::drawNavigationBar(OLEDDisplay *display, OLEDDisplayUiState *sta display->setColor(BLACK); } - if (useBigIcons) { + if (isHighResolution) { NodeListRenderer::drawScaledXBitmap16x16(x, y, 8, 8, icon, display); } else { display->drawXbm(x, y, iconSize, iconSize, icon); diff --git a/src/graphics/draw/UIRenderer.h b/src/graphics/draw/UIRenderer.h index 21e4aef61..9e5e8c4b4 100644 --- a/src/graphics/draw/UIRenderer.h +++ b/src/graphics/draw/UIRenderer.h @@ -32,8 +32,6 @@ class UIRenderer { public: // Common UI elements - static void drawBattery(OLEDDisplay *display, int16_t x, int16_t y, uint8_t *imgBuffer, - const meshtastic::PowerStatus *powerStatus); static void drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::NodeStatus *nodeStatus, int node_offset = 0, bool show_total = true, String additional_words = ""); @@ -49,9 +47,6 @@ class UIRenderer // Overlay and special screens static void drawFrameText(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y, const char *text); - // Function overlay for showing mute/buzzer modifiers etc. - static void drawFunctionOverlay(OLEDDisplay *display, OLEDDisplayUiState *state); - // Navigation bar overlay static void drawNavigationBar(OLEDDisplay *display, OLEDDisplayUiState *state); diff --git a/src/graphics/images.h b/src/graphics/images.h index e9c2f00ea..c5865878a 100644 --- a/src/graphics/images.h +++ b/src/graphics/images.h @@ -23,9 +23,6 @@ const uint8_t bluetoothConnectedIcon[36] PROGMEM = {0xfe, 0x01, 0xff, 0x03, 0x03 0xf3, 0x3f, 0x33, 0x30, 0x33, 0x33, 0x33, 0x33, 0x03, 0x33, 0xff, 0x33, 0xfe, 0x31, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0x3f, 0xe0, 0x1f}; -// This image definition is here instead of images.h because it's modified dynamically by the drawBattery function -static uint8_t imgBattery[16] = {0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xE7, 0x3C}; - #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || ARCH_PORTDUINO) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) @@ -45,19 +42,15 @@ const uint8_t imgSF[] PROGMEM = {0xd2, 0xb7, 0xad, 0xbb, 0x92, 0x01, 0xfd, 0xfd, // === Horizontal battery === // Basic battery design and all related pieces -const unsigned char batteryBitmap_h[] PROGMEM = { - 0b11111110, 0b00000000, 0b11110000, 0b00000111, 0b00000001, 0b00000000, 0b00000000, 0b00001000, 0b00000001, 0b00000000, - 0b00000000, 0b00001000, 0b00000001, 0b00000000, 0b00000000, 0b00001000, 0b00000001, 0b00000000, 0b00000000, 0b00001000, - 0b00000001, 0b00000000, 0b00000000, 0b00011000, 0b00000001, 0b00000000, 0b00000000, 0b00011000, 0b00000001, 0b00000000, - 0b00000000, 0b00011000, 0b00000001, 0b00000000, 0b00000000, 0b00011000, 0b00000001, 0b00000000, 0b00000000, 0b00011000, - 0b00000001, 0b00000000, 0b00000000, 0b00001000, 0b00000001, 0b00000000, 0b00000000, 0b00001000, 0b00000001, 0b00000000, - 0b00000000, 0b00001000, 0b00000001, 0b00000000, 0b00000000, 0b00001000, 0b11111110, 0b00000000, 0b11110000, 0b00000111}; +const unsigned char batteryBitmap_h_bottom[] PROGMEM = { + 0b00011110, 0b00000000, 0b00000001, 0b00000000, 0b00000001, 0b00000000, 0b00000001, 0b00000000, 0b00000001, + 0b00000000, 0b00000001, 0b00000000, 0b00000001, 0b00000000, 0b00000001, 0b00000000, 0b00000001, 0b00000000, + 0b00000001, 0b00000000, 0b00000001, 0b00000000, 0b00000001, 0b00000000, 0b00011110, 0b00000000}; -// This is the left and right bars for the fill in -const unsigned char batteryBitmap_sidegaps_h[] PROGMEM = { - 0b11111111, 0b00001111, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, - 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, - 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b11111111, 0b00001111}; +const unsigned char batteryBitmap_h_top[] PROGMEM = { + 0b00111100, 0b00000000, 0b01000000, 0b00000000, 0b01000000, 0b00000000, 0b01000000, 0b00000000, 0b01000000, + 0b00000000, 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b11000000, 0b00000000, 0b01000000, 0b00000000, + 0b01000000, 0b00000000, 0b01000000, 0b00000000, 0b01000000, 0b00000000, 0b00111100, 0b00000000}; // Lightning Bolt const unsigned char lightning_bolt_h[] PROGMEM = { @@ -280,11 +273,16 @@ const uint8_t bluetoothdisabled[] PROGMEM = {0b11101100, 0b01010100, 0b01001100, const uint8_t smallbulletpoint[] PROGMEM = {0b00000011, 0b00000011, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000}; -// Clock -#define icon_clock_width 8 -#define icon_clock_height 8 -const uint8_t icon_clock[] PROGMEM = {0b00111100, 0b01000010, 0b10000101, 0b10101001, - 0b10010001, 0b10000001, 0b01000010, 0b00111100}; +// Digital Clock +#define digital_icon_clock_width 8 +#define digital_icon_clock_height 8 +const uint8_t digital_icon_clock[] PROGMEM = {0b00111100, 0b01000010, 0b10000101, 0b10101001, + 0b10010001, 0b10000001, 0b01000010, 0b00111100}; +// Analog Clock +#define analog_icon_clock_width 8 +#define analog_icon_clock_height 8 +const uint8_t analog_icon_clock[] PROGMEM = {0b11111111, 0b01000010, 0b00100100, 0b00011000, + 0b00100100, 0b01000010, 0b01000010, 0b11111111}; #include "img/icon.xbm" static_assert(sizeof(icon_bits) >= 0, "Silence unused variable warning"); \ No newline at end of file diff --git a/src/input/ButtonThread.cpp b/src/input/ButtonThread.cpp index bc75e0a54..da9878fa4 100644 --- a/src/input/ButtonThread.cpp +++ b/src/input/ButtonThread.cpp @@ -27,28 +27,25 @@ ButtonThread::ButtonThread(const char *name) : OSThread(name) _originName = name; } -bool ButtonThread::initButton(uint8_t pinNumber, bool activeLow, bool activePullup, uint32_t pullupSense, voidFuncPtr intRoutine, - input_broker_event singlePress, input_broker_event longPress, uint16_t longPressTime, - input_broker_event doublePress, input_broker_event longLongPress, uint16_t longLongPressTime, - input_broker_event triplePress, input_broker_event shortLong, bool touchQuirk) +bool ButtonThread::initButton(const ButtonConfig &config) { if (inputBroker) inputBroker->registerSource(this); - _longPressTime = longPressTime; - _longLongPressTime = longLongPressTime; - _pinNum = pinNumber; - _activeLow = activeLow; - _touchQuirk = touchQuirk; - _intRoutine = intRoutine; - _longLongPress = longLongPress; + _longPressTime = config.longPressTime; + _longLongPressTime = config.longLongPressTime; + _pinNum = config.pinNumber; + _activeLow = config.activeLow; + _touchQuirk = config.touchQuirk; + _intRoutine = config.intRoutine; + _longLongPress = config.longLongPress; - userButton = OneButton(pinNumber, activeLow, activePullup); + userButton = OneButton(config.pinNumber, config.activeLow, config.activePullup); - if (pullupSense != 0) { - pinMode(pinNumber, pullupSense); + if (config.pullupSense != 0) { + pinMode(config.pinNumber, config.pullupSense); } - _singlePress = singlePress; + _singlePress = config.singlePress; userButton.attachClick( [](void *callerThread) -> void { ButtonThread *thread = (ButtonThread *)callerThread; @@ -56,8 +53,8 @@ bool ButtonThread::initButton(uint8_t pinNumber, bool activeLow, bool activePull }, this); - if (longPress != INPUT_BROKER_NONE) { - _longPress = longPress; + if (config.longPress != INPUT_BROKER_NONE) { + _longPress = config.longPress; userButton.attachLongPressStart( [](void *callerThread) -> void { ButtonThread *thread = (ButtonThread *)callerThread; @@ -74,8 +71,8 @@ bool ButtonThread::initButton(uint8_t pinNumber, bool activeLow, bool activePull this); } - if (doublePress != INPUT_BROKER_NONE) { - _doublePress = doublePress; + if (config.doublePress != INPUT_BROKER_NONE) { + _doublePress = config.doublePress; userButton.attachDoubleClick( [](void *callerThread) -> void { ButtonThread *thread = (ButtonThread *)callerThread; @@ -84,8 +81,8 @@ bool ButtonThread::initButton(uint8_t pinNumber, bool activeLow, bool activePull this); } - if (triplePress != INPUT_BROKER_NONE) { - _triplePress = triplePress; + if (config.triplePress != INPUT_BROKER_NONE) { + _triplePress = config.triplePress; userButton.attachMultiClick( [](void *callerThread) -> void { ButtonThread *thread = (ButtonThread *)callerThread; @@ -94,8 +91,8 @@ bool ButtonThread::initButton(uint8_t pinNumber, bool activeLow, bool activePull }, this); } - if (shortLong != INPUT_BROKER_NONE) { - _shortLong = shortLong; + if (config.shortLong != INPUT_BROKER_NONE) { + _shortLong = config.shortLong; } userButton.setDebounceMs(1); @@ -266,6 +263,11 @@ int32_t ButtonThread::runOnce() break; } + + // doesn't handle BUTTON_EVENT_PRESSED_SCREEN BUTTON_EVENT_TOUCH_LONG_PRESSED BUTTON_EVENT_COMBO_SHORT_LONG + default: { + break; + } } } btnEvent = BUTTON_EVENT_NONE; diff --git a/src/input/ButtonThread.h b/src/input/ButtonThread.h index 033f92b8b..949048de1 100644 --- a/src/input/ButtonThread.h +++ b/src/input/ButtonThread.h @@ -7,6 +7,26 @@ typedef void (*voidFuncPtr)(void); +struct ButtonConfig { + uint8_t pinNumber; + bool activeLow = true; + bool activePullup = true; + uint32_t pullupSense = 0; + voidFuncPtr intRoutine = nullptr; + input_broker_event singlePress = INPUT_BROKER_NONE; + input_broker_event longPress = INPUT_BROKER_NONE; + uint16_t longPressTime = 500; + input_broker_event doublePress = INPUT_BROKER_NONE; + input_broker_event longLongPress = INPUT_BROKER_NONE; + uint16_t longLongPressTime = 5000; + input_broker_event triplePress = INPUT_BROKER_NONE; + input_broker_event shortLong = INPUT_BROKER_NONE; + bool touchQuirk = false; + + // Constructor to set required parameter + ButtonConfig(uint8_t pin = 0) : pinNumber(pin) {} +}; + #ifndef BUTTON_CLICK_MS #define BUTTON_CLICK_MS 250 #endif @@ -28,12 +48,7 @@ class ButtonThread : public Observable, public concurrency:: public: const char *_originName; static const uint32_t c_holdOffTime = 30000; // hold off 30s after boot - bool initButton(uint8_t pinNumber, bool activeLow, bool activePullup, uint32_t pullupSense, voidFuncPtr intRoutine, - input_broker_event singlePress, input_broker_event longPress = INPUT_BROKER_NONE, - uint16_t longPressTime = 500, input_broker_event doublePress = INPUT_BROKER_NONE, - input_broker_event longLongPress = INPUT_BROKER_NONE, uint16_t longLongPressTime = 5000, - input_broker_event triplePress = INPUT_BROKER_NONE, input_broker_event shortLong = INPUT_BROKER_NONE, - bool touchQuirk = false); + bool initButton(const ButtonConfig &config); enum ButtonEventType { BUTTON_EVENT_NONE, diff --git a/src/main.cpp b/src/main.cpp index 2251241da..4b64a78ea 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -927,58 +927,81 @@ void setup() LOG_DEBUG("Use GPIO%02d for button", settingsMap[userButtonPin]); UserButtonThread = new ButtonThread("UserButton"); - if (screen) - UserButtonThread->initButton( - settingsMap[userButtonPin], true, true, INPUT_PULLUP, // pull up bias - []() { - UserButtonThread->userButton.tick(); - runASAP = true; - BaseType_t higherWake = 0; - mainDelay.interruptFromISR(&higherWake); - }, - INPUT_BROKER_USER_PRESS, INPUT_BROKER_SELECT); + if (screen) { + ButtonConfig config; + config.pinNumber = (uint8_t)settingsMap[userButtonPin]; + config.activeLow = true; + config.activePullup = true; + config.pullupSense = INPUT_PULLUP; + config.intRoutine = []() { + UserButtonThread->userButton.tick(); + runASAP = true; + BaseType_t higherWake = 0; + mainDelay.interruptFromISR(&higherWake); + }; + config.singlePress = INPUT_BROKER_USER_PRESS; + config.longPress = INPUT_BROKER_SELECT; + UserButtonThread->initButton(config); + } } #endif #ifdef BUTTON_PIN_TOUCH TouchButtonThread = new ButtonThread("BackButton"); - TouchButtonThread->initButton( - BUTTON_PIN_TOUCH, true, true, pullup_sense, - []() { - TouchButtonThread->userButton.tick(); - runASAP = true; - BaseType_t higherWake = 0; - mainDelay.interruptFromISR(&higherWake); - }, - INPUT_BROKER_NONE, INPUT_BROKER_BACK); + ButtonConfig touchConfig; + touchConfig.pinNumber = BUTTON_PIN_TOUCH; + touchConfig.activeLow = true; + touchConfig.activePullup = true; + touchConfig.pullupSense = pullup_sense; + touchConfig.intRoutine = []() { + TouchButtonThread->userButton.tick(); + runASAP = true; + BaseType_t higherWake = 0; + mainDelay.interruptFromISR(&higherWake); + }; + touchConfig.singlePress = INPUT_BROKER_NONE; + touchConfig.longPress = INPUT_BROKER_BACK; + TouchButtonThread->initButton(touchConfig); #endif #if defined(CANCEL_BUTTON_PIN) // Buttons. Moved here cause we need NodeDB to be initialized CancelButtonThread = new ButtonThread("CancelButton"); - CancelButtonThread->initButton( - CANCEL_BUTTON_PIN, CANCEL_BUTTON_ACTIVE_LOW, CANCEL_BUTTON_ACTIVE_PULLUP, pullup_sense, - []() { - CancelButtonThread->userButton.tick(); - runASAP = true; - BaseType_t higherWake = 0; - mainDelay.interruptFromISR(&higherWake); - }, - INPUT_BROKER_CANCEL, INPUT_BROKER_SHUTDOWN, 4000); + ButtonConfig cancelConfig; + cancelConfig.pinNumber = CANCEL_BUTTON_PIN; + cancelConfig.activeLow = CANCEL_BUTTON_ACTIVE_LOW; + cancelConfig.activePullup = CANCEL_BUTTON_ACTIVE_PULLUP; + cancelConfig.pullupSense = pullup_sense; + cancelConfig.intRoutine = []() { + CancelButtonThread->userButton.tick(); + runASAP = true; + BaseType_t higherWake = 0; + mainDelay.interruptFromISR(&higherWake); + }; + cancelConfig.singlePress = INPUT_BROKER_CANCEL; + cancelConfig.longPress = INPUT_BROKER_SHUTDOWN; + cancelConfig.longPressTime = 4000; + CancelButtonThread->initButton(cancelConfig); #endif #if defined(ALT_BUTTON_PIN) // Buttons. Moved here cause we need NodeDB to be initialized BackButtonThread = new ButtonThread("BackButton"); - BackButtonThread->initButton( - ALT_BUTTON_PIN, ALT_BUTTON_ACTIVE_LOW, ALT_BUTTON_ACTIVE_PULLUP, pullup_sense, - []() { - BackButtonThread->userButton.tick(); - runASAP = true; - BaseType_t higherWake = 0; - mainDelay.interruptFromISR(&higherWake); - }, - INPUT_BROKER_ALT_PRESS, INPUT_BROKER_ALT_LONG, 500); + ButtonConfig backConfig; + backConfig.pinNumber = ALT_BUTTON_PIN; + backConfig.activeLow = ALT_BUTTON_ACTIVE_LOW; + backConfig.activePullup = ALT_BUTTON_ACTIVE_PULLUP; + backConfig.pullupSense = pullup_sense; + backConfig.intRoutine = []() { + BackButtonThread->userButton.tick(); + runASAP = true; + BaseType_t higherWake = 0; + mainDelay.interruptFromISR(&higherWake); + }; + backConfig.singlePress = INPUT_BROKER_ALT_PRESS; + backConfig.longPress = INPUT_BROKER_ALT_LONG; + backConfig.longPressTime = 500; + BackButtonThread->initButton(backConfig); #endif #if defined(BUTTON_PIN) @@ -997,27 +1020,42 @@ void setup() // Buttons. Moved here cause we need NodeDB to be initialized // If your variant.h has a BUTTON_PIN defined, go ahead and define BUTTON_ACTIVE_LOW and BUTTON_ACTIVE_PULLUP UserButtonThread = new ButtonThread("UserButton"); - if (screen) - UserButtonThread->initButton( - _pinNum, BUTTON_ACTIVE_LOW, BUTTON_ACTIVE_PULLUP, pullup_sense, - []() { - UserButtonThread->userButton.tick(); - runASAP = true; - BaseType_t higherWake = 0; - mainDelay.interruptFromISR(&higherWake); - }, - INPUT_BROKER_USER_PRESS, INPUT_BROKER_SELECT, 500, INPUT_BROKER_NONE, INPUT_BROKER_SHUTDOWN); - else - UserButtonThread->initButton( - _pinNum, BUTTON_ACTIVE_LOW, BUTTON_ACTIVE_PULLUP, pullup_sense, - []() { - UserButtonThread->userButton.tick(); - runASAP = true; - BaseType_t higherWake = 0; - mainDelay.interruptFromISR(&higherWake); - }, - INPUT_BROKER_USER_PRESS, INPUT_BROKER_SHUTDOWN, 5000, INPUT_BROKER_SEND_PING, INPUT_BROKER_NONE, 0, - INPUT_BROKER_GPS_TOGGLE); + if (screen) { + ButtonConfig userConfig; + userConfig.pinNumber = (uint8_t)_pinNum; + userConfig.activeLow = BUTTON_ACTIVE_LOW; + userConfig.activePullup = BUTTON_ACTIVE_PULLUP; + userConfig.pullupSense = pullup_sense; + userConfig.intRoutine = []() { + UserButtonThread->userButton.tick(); + runASAP = true; + BaseType_t higherWake = 0; + mainDelay.interruptFromISR(&higherWake); + }; + userConfig.singlePress = INPUT_BROKER_USER_PRESS; + userConfig.longPress = INPUT_BROKER_SELECT; + userConfig.longPressTime = 500; + userConfig.longLongPress = INPUT_BROKER_SHUTDOWN; + UserButtonThread->initButton(userConfig); + } else { + ButtonConfig userConfigNoScreen; + userConfigNoScreen.pinNumber = (uint8_t)_pinNum; + userConfigNoScreen.activeLow = BUTTON_ACTIVE_LOW; + userConfigNoScreen.activePullup = BUTTON_ACTIVE_PULLUP; + userConfigNoScreen.pullupSense = pullup_sense; + userConfigNoScreen.intRoutine = []() { + UserButtonThread->userButton.tick(); + runASAP = true; + BaseType_t higherWake = 0; + mainDelay.interruptFromISR(&higherWake); + }; + userConfigNoScreen.singlePress = INPUT_BROKER_USER_PRESS; + userConfigNoScreen.longPress = INPUT_BROKER_SHUTDOWN; + userConfigNoScreen.longPressTime = 5000; + userConfigNoScreen.doublePress = INPUT_BROKER_SEND_PING; + userConfigNoScreen.triplePress = INPUT_BROKER_GPS_TOGGLE; + UserButtonThread->initButton(userConfigNoScreen); + } #endif #endif diff --git a/src/mesh/MeshModule.cpp b/src/mesh/MeshModule.cpp index 62d3c82bc..c5748a560 100644 --- a/src/mesh/MeshModule.cpp +++ b/src/mesh/MeshModule.cpp @@ -244,10 +244,13 @@ void setReplyTo(meshtastic_MeshPacket *p, const meshtastic_MeshPacket &to) p->decoded.request_id = to.id; } -std::vector MeshModule::GetMeshModulesWithUIFrames() +std::vector MeshModule::GetMeshModulesWithUIFrames(int startIndex) { - std::vector modulesWithUIFrames; + + // Fill with nullptr up to startIndex + modulesWithUIFrames.resize(startIndex, nullptr); + if (modules) { for (auto i = modules->begin(); i != modules->end(); ++i) { auto &pi = **i; diff --git a/src/mesh/MeshModule.h b/src/mesh/MeshModule.h index f08b8f49c..eda3f8881 100644 --- a/src/mesh/MeshModule.h +++ b/src/mesh/MeshModule.h @@ -75,7 +75,7 @@ class MeshModule */ static void callModules(meshtastic_MeshPacket &mp, RxSource src = RX_SRC_RADIO); - static std::vector GetMeshModulesWithUIFrames(); + static std::vector GetMeshModulesWithUIFrames(int startIndex); static void observeUIEvents(Observer *observer); static AdminMessageHandleResult handleAdminMessageForAllModules(const meshtastic_MeshPacket &mp, meshtastic_AdminMessage *request, diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 3eb3a5173..9433cc75d 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1582,6 +1582,7 @@ void NodeDB::addFromContact(meshtastic_SharedContact contact) // Mark the node's key as manually verified to indicate trustworthiness. updateGUIforNode = info; // powerFSM.trigger(EVENT_NODEDB_UPDATED); This event has been retired + sortMeshDB(); notifyObservers(true); // Force an update whether or not our node counts have changed } saveNodeDatabaseToDisk(); @@ -1685,6 +1686,31 @@ void NodeDB::updateFrom(const meshtastic_MeshPacket &mp) info->has_hops_away = true; info->hops_away = mp.hop_start - mp.hop_limit; } + sortMeshDB(); + } +} + +void NodeDB::sortMeshDB() +{ + if (!Throttle::isWithinTimespanMs(lastSort, 1000 * 5)) { + lastSort = millis(); + std::sort(meshNodes->begin(), meshNodes->end(), [](const meshtastic_NodeInfoLite &a, const meshtastic_NodeInfoLite &b) { + if (a.num == myNodeInfo.my_node_num) { + return true; + } + if (b.num == myNodeInfo.my_node_num) { + return false; + } + bool aFav = a.is_favorite; + bool bFav = b.is_favorite; + if (aFav != bFav) + return aFav; + if (a.last_heard == 0 || a.last_heard == UINT32_MAX) + return false; + if (b.last_heard == 0 || b.last_heard == UINT32_MAX) + return true; + return a.last_heard > b.last_heard; + }); } } diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 90ca5aefd..b6e4d600b 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -282,6 +282,7 @@ class NodeDB bool duplicateWarned = false; uint32_t lastNodeDbSave = 0; // when we last saved our db to flash uint32_t lastBackupAttempt = 0; // when we last tried a backup automatically or manually + uint32_t lastSort = 0; // When last sorted the nodeDB /// Find a node in our DB, create an empty NodeInfoLite if missing meshtastic_NodeInfoLite *getOrCreateMeshNode(NodeNum n); @@ -310,6 +311,7 @@ class NodeDB bool saveChannelsToDisk(); bool saveDeviceStateToDisk(); bool saveNodeDatabaseToDisk(); + void sortMeshDB(); }; extern NodeDB *nodeDB; diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index b24f3ca00..4d8d6ce4b 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -154,7 +154,7 @@ int CannedMessageModule::splitConfiguredMessages() } void CannedMessageModule::drawHeader(OLEDDisplay *display, int16_t x, int16_t y, char *buffer) { - if (display->getWidth() > 128) { + if (graphics::isHighResolution) { if (this->dest == NODENUM_BROADCAST) { display->drawStringf(x, y, buffer, "To: Broadcast@%s", channels.getName(this->channel)); } else { @@ -245,12 +245,15 @@ void CannedMessageModule::updateDestinationSelectionList() } } + /* As the nodeDB is sorted, can skip this step // Sort by favorite, then last heard std::sort(this->filteredNodes.begin(), this->filteredNodes.end(), [](const NodeEntry &a, const NodeEntry &b) { if (a.node->is_favorite != b.node->is_favorite) return a.node->is_favorite > b.node->is_favorite; return a.lastHeard < b.lastHeard; }); + */ + scrollIndex = 0; // Show first result at the top destIndex = 0; // Highlight the first entry if (nodesChanged && runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION) { @@ -387,6 +390,7 @@ bool CannedMessageModule::handleTabSwitch(const InputEvent *event) // RESTORE THIS! if (runState == CANNED_MESSAGE_RUN_STATE_DESTINATION_SELECTION) updateDestinationSelectionList(); + requestFocus(); UIFrameEvent e; e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; @@ -986,6 +990,7 @@ int32_t CannedMessageModule::runOnce() default: // Only insert ASCII printable characters (32–126) if (this->payload >= 32 && this->payload <= 126) { + requestFocus(); if (this->cursor == this->freetext.length()) { this->freetext += (char)this->payload; } else { diff --git a/src/modules/KeyVerificationModule.cpp b/src/modules/KeyVerificationModule.cpp index f5a9f2359..c0972c155 100644 --- a/src/modules/KeyVerificationModule.cpp +++ b/src/modules/KeyVerificationModule.cpp @@ -79,10 +79,10 @@ bool KeyVerificationModule::handleReceivedProtobuf(const meshtastic_MeshPacket & memset(message, 0, sizeof(message)); sprintf(message, "Verification: \n"); generateVerificationCode(message + 15); - sprintf(message + 24, "\nACCEPT\nREJECT"); + static const char *optionsArray[] = {"ACCEPT", "REJECT"}; LOG_INFO("Hash1 matches!"); if (screen) { - screen->showOverlayBanner(message, 30000, 2, [=](int selected) { + screen->showOverlayBanner(message, 30000, optionsArray, 2, [=](int selected) { if (selected == 0) { auto remoteNodePtr = nodeDB->getMeshNode(currentRemoteNode); remoteNodePtr->bitfield |= NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK; diff --git a/src/modules/SystemCommandsModule.cpp b/src/modules/SystemCommandsModule.cpp index a6b01d68a..6a7da95af 100644 --- a/src/modules/SystemCommandsModule.cpp +++ b/src/modules/SystemCommandsModule.cpp @@ -100,9 +100,9 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event) case INPUT_BROKER_SEND_PING: service->refreshLocalMeshNode(); if (service->trySendPosition(NODENUM_BROADCAST, true)) { - IF_SCREEN(screen->showOverlayBanner("Position\nUpdate Sent", 3000)); + IF_SCREEN(screen->showOverlayBanner("Position\nSent", 3000)); } else { - IF_SCREEN(screen->showOverlayBanner("Node Info\nUpdate Sent", 3000)); + IF_SCREEN(screen->showOverlayBanner("Node Info\nSent", 3000)); } return true; // Power control @@ -113,6 +113,10 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event) shutdownAtMsec = millis() + DEFAULT_SHUTDOWN_SECONDS * 1000; // runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; return true; + + default: + // No other input events handled here + break; } return false; } \ No newline at end of file diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index 375d1e596..46a24a816 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -30,7 +30,7 @@ namespace graphics { -extern void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *titleStr); +extern void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *titleStr, bool battery_only); } #if __has_include() #include "Sensor/AHT10.h" @@ -358,7 +358,7 @@ void EnvironmentTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiSt int line = 1; // === Set Title - const char *titleStr = (SCREEN_WIDTH > 128) ? "Environment" : "Env."; + const char *titleStr = (graphics::isHighResolution) ? "Environment" : "Env."; // === Header === graphics::drawCommonHeader(display, x, y, titleStr); diff --git a/src/modules/Telemetry/PowerTelemetry.cpp b/src/modules/Telemetry/PowerTelemetry.cpp index df1505226..a92013d01 100644 --- a/src/modules/Telemetry/PowerTelemetry.cpp +++ b/src/modules/Telemetry/PowerTelemetry.cpp @@ -24,7 +24,7 @@ namespace graphics { -extern void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *titleStr); +extern void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *titleStr, bool battery_only); } int32_t PowerTelemetryModule::runOnce() @@ -115,7 +115,7 @@ void PowerTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *s int line = 1; // === Set Title - const char *titleStr = (SCREEN_WIDTH > 128) ? "Power Telem." : "Power"; + const char *titleStr = (graphics::isHighResolution) ? "Power Telem." : "Power"; // === Header === graphics::drawCommonHeader(display, x, y, titleStr); diff --git a/src/modules/WaypointModule.cpp b/src/modules/WaypointModule.cpp index 578e7183a..cab668406 100644 --- a/src/modules/WaypointModule.cpp +++ b/src/modules/WaypointModule.cpp @@ -137,10 +137,14 @@ void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, if (ourNode && (nodeDB->hasValidPosition(ourNode) || screen->hasHeading())) { const meshtastic_PositionLite &op = ourNode->position; float myHeading; - if (screen->hasHeading()) - myHeading = (screen->getHeading()) * PI / 180; // gotta convert compass degrees to Radians - else - myHeading = screen->estimatedHeading(DegD(op.latitude_i), DegD(op.longitude_i)); + if (screen->ignoreCompass) { + myHeading = 0; + } else { + if (screen->hasHeading()) + myHeading = (screen->getHeading()) * PI / 180; // gotta convert compass degrees to Radians + else + myHeading = screen->estimatedHeading(DegD(op.latitude_i), DegD(op.longitude_i)); + } graphics::CompassRenderer::drawCompassNorth(display, compassX, compassY, myHeading, (compassDiam / 2)); // Compass bearing to waypoint @@ -148,7 +152,7 @@ void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, GeoCoord::bearing(DegD(op.latitude_i), DegD(op.longitude_i), DegD(wp.latitude_i), DegD(wp.longitude_i)); // If the top of the compass is a static north then bearingToOther can be drawn on the compass directly // If the top of the compass is not a static north we need adjust bearingToOther based on heading - if (!config.display.compass_north_top) + if (!screen->ignoreCompass) bearingToOther -= myHeading; graphics::CompassRenderer::drawNodeHeading(display, compassX, compassY, compassDiam, bearingToOther); diff --git a/src/serialization/MeshPacketSerializer.cpp b/src/serialization/MeshPacketSerializer.cpp index fc8531298..29a9b6840 100644 --- a/src/serialization/MeshPacketSerializer.cpp +++ b/src/serialization/MeshPacketSerializer.cpp @@ -79,7 +79,8 @@ std::string MeshPacketSerializer::JsonSerialize(const meshtastic_MeshPacket *mp, msgPayload["relative_humidity"] = new JSONValue(decoded->variant.environment_metrics.relative_humidity); } if (decoded->variant.environment_metrics.has_barometric_pressure) { - msgPayload["barometric_pressure"] = new JSONValue(decoded->variant.environment_metrics.barometric_pressure); + msgPayload["barometric_pressure"] = + new JSONValue(decoded->variant.environment_metrics.barometric_pressure); } if (decoded->variant.environment_metrics.has_gas_resistance) { msgPayload["gas_resistance"] = new JSONValue(decoded->variant.environment_metrics.gas_resistance); @@ -125,13 +126,16 @@ std::string MeshPacketSerializer::JsonSerialize(const meshtastic_MeshPacket *mp, msgPayload["pm100"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm100_standard); } if (decoded->variant.air_quality_metrics.has_pm10_environmental) { - msgPayload["pm10_e"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm10_environmental); + msgPayload["pm10_e"] = + new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm10_environmental); } if (decoded->variant.air_quality_metrics.has_pm25_environmental) { - msgPayload["pm25_e"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm25_environmental); + msgPayload["pm25_e"] = + new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm25_environmental); } if (decoded->variant.air_quality_metrics.has_pm100_environmental) { - msgPayload["pm100_e"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm100_environmental); + msgPayload["pm100_e"] = + new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm100_environmental); } } else if (decoded->which_variant == meshtastic_Telemetry_power_metrics_tag) { if (decoded->variant.power_metrics.has_ch1_voltage) { diff --git a/variants/portduino/platformio.ini b/variants/portduino/platformio.ini index 6da827508..5293b12b9 100644 --- a/variants/portduino/platformio.ini +++ b/variants/portduino/platformio.ini @@ -22,7 +22,6 @@ lib_deps = ${native_base.lib_deps} ${device-ui_base.lib_deps} build_flags = ${native_base.build_flags} -Os -lX11 -linput -lxkbcommon -ffunction-sections -fdata-sections -Wl,--gc-sections - -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 -D RAM_SIZE=16384 -D USE_X11=1 -D HAS_TFT=1 @@ -51,7 +50,6 @@ lib_deps = ${device-ui_base.lib_deps} board_level = extra build_flags = ${native_base.build_flags} -Os -ffunction-sections -fdata-sections -Wl,--gc-sections - -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 -D RAM_SIZE=8192 -D USE_FRAMEBUFFER=1 -D LV_COLOR_DEPTH=32 @@ -81,7 +79,6 @@ lib_deps = ${device-ui_base.lib_deps} board_level = extra build_flags = ${native_base.build_flags} -O0 -fsanitize=address -lX11 -linput -lxkbcommon - -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 -D DEBUG_HEAP -D RAM_SIZE=16384 -D USE_X11=1 diff --git a/variants/rak4631/variant.h b/variants/rak4631/variant.h index cd8f46153..f5ec11ef2 100644 --- a/variants/rak4631/variant.h +++ b/variants/rak4631/variant.h @@ -88,8 +88,8 @@ static const uint8_t A7 = PIN_A7; #define ADC_RESOLUTION 14 // Other pins - #define WB_I2C1_SDA (13) // SENSOR_SLOT IO_SLOT - #define WB_I2C1_SCL (14) // SENSOR_SLOT IO_SLOT +#define WB_I2C1_SDA (13) // SENSOR_SLOT IO_SLOT +#define WB_I2C1_SCL (14) // SENSOR_SLOT IO_SLOT #define PIN_AREF (2) #define PIN_NFC1 (9) From 2b97576b187e63d139fa1c211c323f76e8dc5f7f Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 27 Jun 2025 06:26:34 -0500 Subject: [PATCH 356/461] NRF52 BLE fixes / tweaks (#7152) * Try-fix: Flaky NRF52 bluetooth pairing for some users * Safe access for screen pointer --- src/platform/nrf52/NRF52Bluetooth.cpp | 57 +++++++++++++++------------ 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/src/platform/nrf52/NRF52Bluetooth.cpp b/src/platform/nrf52/NRF52Bluetooth.cpp index 89e92afc6..6f0e7250f 100644 --- a/src/platform/nrf52/NRF52Bluetooth.cpp +++ b/src/platform/nrf52/NRF52Bluetooth.cpp @@ -314,7 +314,9 @@ void NRF52Bluetooth::onConnectionSecured(uint16_t conn_handle) } bool NRF52Bluetooth::onPairingPasskey(uint16_t conn_handle, uint8_t const passkey[6], bool match_request) { - LOG_INFO("BLE pair process started with passkey %.3s %.3s", passkey, passkey + 3); + char passkey1[4] = {passkey[0], passkey[1], passkey[2], '\0'}; + char passkey2[4] = {passkey[3], passkey[4], passkey[5], '\0'}; + LOG_INFO("BLE pair process started with passkey %s %s", passkey1, passkey2); powerFSM.trigger(EVENT_BLUETOOTH_PAIR); // Get passkey as string @@ -327,31 +329,33 @@ bool NRF52Bluetooth::onPairingPasskey(uint16_t conn_handle, uint8_t const passke bluetoothStatus->updateStatus(new meshtastic::BluetoothStatus(textkey)); #if !defined(MESHTASTIC_EXCLUDE_SCREEN) // Todo: migrate this display code back into Screen class, and observe bluetoothStatus - screen->startAlert([](OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -> void { - char btPIN[16] = "888888"; - snprintf(btPIN, sizeof(btPIN), "%06u", configuredPasskey); - int x_offset = display->width() / 2; - int y_offset = display->height() <= 80 ? 0 : 12; - display->setTextAlignment(TEXT_ALIGN_CENTER); - display->setFont(FONT_MEDIUM); - display->drawString(x_offset + x, y_offset + y, "Bluetooth"); + if (screen) { + screen->startAlert([](OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -> void { + char btPIN[16] = "888888"; + snprintf(btPIN, sizeof(btPIN), "%06u", configuredPasskey); + int x_offset = display->width() / 2; + int y_offset = display->height() <= 80 ? 0 : 12; + display->setTextAlignment(TEXT_ALIGN_CENTER); + display->setFont(FONT_MEDIUM); + display->drawString(x_offset + x, y_offset + y, "Bluetooth"); - display->setFont(FONT_SMALL); - 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->setFont(FONT_SMALL); + 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->setFont(FONT_LARGE); - String displayPin(btPIN); - String pin = displayPin.substring(0, 3) + " " + displayPin.substring(3, 6); - y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_SMALL - 5 : y_offset + FONT_HEIGHT_SMALL + 5; - display->drawString(x_offset + x, y_offset + y, pin); + display->setFont(FONT_LARGE); + String displayPin(btPIN); + String pin = displayPin.substring(0, 3) + " " + displayPin.substring(3, 6); + y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_SMALL - 5 : y_offset + FONT_HEIGHT_SMALL + 5; + display->drawString(x_offset + x, y_offset + y, pin); - display->setFont(FONT_SMALL); - String deviceName = "Name: "; - deviceName.concat(getDeviceName()); - y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_LARGE - 6 : y_offset + FONT_HEIGHT_LARGE + 5; - display->drawString(x_offset + x, y_offset + y, deviceName); - }); + display->setFont(FONT_SMALL); + String deviceName = "Name: "; + deviceName.concat(getDeviceName()); + y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_LARGE - 6 : y_offset + FONT_HEIGHT_LARGE + 5; + display->drawString(x_offset + x, y_offset + y, deviceName); + }); + } #endif if (match_request) { uint32_t start_time = millis(); @@ -394,8 +398,7 @@ void NRF52Bluetooth::onPairingCompleted(uint16_t conn_handle, uint8_t auth_statu { if (auth_status == BLE_GAP_SEC_STATUS_SUCCESS) { LOG_INFO("BLE pair success"); - bluetoothStatus->updateStatus( - new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED)); + bluetoothStatus->updateStatus(new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::CONNECTED)); } else { LOG_INFO("BLE pair failed"); // Notify UI (or any other interested firmware components) @@ -404,7 +407,9 @@ void NRF52Bluetooth::onPairingCompleted(uint16_t conn_handle, uint8_t auth_statu } // Todo: migrate this display code back into Screen class, and observe bluetoothStatus - screen->endAlert(); + if (screen) { + screen->endAlert(); + } } void NRF52Bluetooth::sendLog(const uint8_t *logMessage, size_t length) From de5b55921e84f477cecaff6db4ff65655e0a94a1 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 27 Jun 2025 11:06:19 -0500 Subject: [PATCH 357/461] Extra check on UDP packets --- src/mesh/udp/UdpMulticastHandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/udp/UdpMulticastHandler.h b/src/mesh/udp/UdpMulticastHandler.h index 39bd61021..ac4f86020 100644 --- a/src/mesh/udp/UdpMulticastHandler.h +++ b/src/mesh/udp/UdpMulticastHandler.h @@ -44,7 +44,7 @@ class UdpMulticastHandler final meshtastic_MeshPacket mp; LOG_DEBUG("Decoding MeshPacket from UDP len=%u", packetLength); bool isPacketDecoded = pb_decode_from_bytes(packet.data(), packetLength, &meshtastic_MeshPacket_msg, &mp); - if (isPacketDecoded && router) { + if (isPacketDecoded && router && mp.which_payload_variant == meshtastic_MeshPacket_encrypted_tag) { UniquePacketPoolPacket p = packetPool.allocUniqueCopy(mp); // Unset received SNR/RSSI p->rx_snr = 0; From 2ea70927c88ab2da3a525c93a1798ce02dce9b1a Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 27 Jun 2025 11:06:50 -0500 Subject: [PATCH 358/461] Revert "automated bumps (#7097)" This reverts commit 4308bbc156c81a240f31c1860fd792264f5b755f. --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 --- debian/changelog | 7 ++----- version.properties | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index f9f647dae..4b07f6388 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,9 +87,6 @@ - - https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.1 - https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.0 diff --git a/debian/changelog b/debian/changelog index 4629e8c3a..d607be68c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.7.1.0) UNRELEASED; urgency=medium +meshtasticd (2.7.0.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging @@ -22,7 +22,4 @@ meshtasticd (2.7.1.0) UNRELEASED; urgency=medium [ ] * GitHub Actions Automatic version bump - [ ] - * GitHub Actions Automatic version bump - - -- Sat, 21 Jun 2025 15:51:49 +0000 + -- Mon, 16 Jun 2025 02:10:49 +0000 diff --git a/version.properties b/version.properties index 3fe1aa385..91c81a0c9 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 7 -build = 1 +build = 0 From f6743798e2db0c518cd257ff2ade95eb06999ee2 Mon Sep 17 00:00:00 2001 From: porkcube Date: Fri, 27 Jun 2025 12:09:04 -0400 Subject: [PATCH 359/461] cleanup Shutting down -> Shutting Down awkwardness (#7099) Co-authored-by: Jonathan Bennett --- src/Power.cpp | 2 +- src/input/ExpressLRSFiveWay.cpp | 4 ++-- src/modules/SystemCommandsModule.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Power.cpp b/src/Power.cpp index 400b6c6eb..fb5db416e 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -682,7 +682,7 @@ bool Power::setup() void Power::shutdown() { - LOG_INFO("Shutting down"); + LOG_INFO("Shutting Down"); #if defined(ARCH_NRF52) || defined(ARCH_ESP32) || defined(ARCH_RP2040) #ifdef PIN_LED1 diff --git a/src/input/ExpressLRSFiveWay.cpp b/src/input/ExpressLRSFiveWay.cpp index 1981a45d4..53bcedc63 100644 --- a/src/input/ExpressLRSFiveWay.cpp +++ b/src/input/ExpressLRSFiveWay.cpp @@ -235,7 +235,7 @@ void ExpressLRSFiveWay::shutdown() { LOG_INFO("Shutdown from long press"); powerFSM.trigger(EVENT_PRESS); - screen->startAlert("Shutting down..."); + screen->startAlert("Shutting Down..."); // Don't set alerting = true. We don't want to auto-dismiss this alert. playShutdownMelody(); // In case user adds a buzzer @@ -250,4 +250,4 @@ void ExpressLRSFiveWay::click() ExpressLRSFiveWay *expressLRSFiveWayInput = nullptr; -#endif \ No newline at end of file +#endif diff --git a/src/modules/SystemCommandsModule.cpp b/src/modules/SystemCommandsModule.cpp index 6a7da95af..08c87ec64 100644 --- a/src/modules/SystemCommandsModule.cpp +++ b/src/modules/SystemCommandsModule.cpp @@ -107,8 +107,8 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event) return true; // Power control case INPUT_BROKER_SHUTDOWN: - LOG_ERROR("Shutting down"); - IF_SCREEN(screen->showOverlayBanner("Shutting down...")); + LOG_ERROR("Shutting Down"); + IF_SCREEN(screen->showOverlayBanner("Shutting Down...")); nodeDB->saveToDisk(); shutdownAtMsec = millis() + DEFAULT_SHUTDOWN_SECONDS * 1000; // runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; @@ -119,4 +119,4 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event) break; } return false; -} \ No newline at end of file +} From a97df4bb524d0f53276a0662e286b8b385a625b1 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 27 Jun 2025 11:22:01 -0500 Subject: [PATCH 360/461] Sanity check incoming UDP --- src/mesh/udp/UdpMulticastHandler.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesh/udp/UdpMulticastHandler.h b/src/mesh/udp/UdpMulticastHandler.h index ac4f86020..d1cc1065c 100644 --- a/src/mesh/udp/UdpMulticastHandler.h +++ b/src/mesh/udp/UdpMulticastHandler.h @@ -45,6 +45,9 @@ class UdpMulticastHandler final LOG_DEBUG("Decoding MeshPacket from UDP len=%u", packetLength); bool isPacketDecoded = pb_decode_from_bytes(packet.data(), packetLength, &meshtastic_MeshPacket_msg, &mp); if (isPacketDecoded && router && mp.which_payload_variant == meshtastic_MeshPacket_encrypted_tag) { + mp.pki_encrypted = false; + mp.public_key.size = 0; + memset(mp.public_key.bytes, 0, sizeof(mp.public_key.bytes)); UniquePacketPoolPacket p = packetPool.allocUniqueCopy(mp); // Unset received SNR/RSSI p->rx_snr = 0; From 705515ace23e8a104f20ce078a3d3c650f16c5bc Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 27 Jun 2025 11:46:33 -0500 Subject: [PATCH 361/461] Resize meshNodes to MAX + 1 to avoid crash during sort --- src/mesh/NodeDB.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 9433cc75d..cc3639f19 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1156,7 +1156,7 @@ void NodeDB::loadFromDisk() LOG_WARN("Node count %d exceeds MAX_NUM_NODES %d, truncating", numMeshNodes, MAX_NUM_NODES); numMeshNodes = MAX_NUM_NODES; } - meshNodes->resize(MAX_NUM_NODES); + meshNodes->resize(MAX_NUM_NODES + 1); // The rp2040, rp2035, and maybe other targets, have a problem doing a sort() when full // static DeviceState scratch; We no longer read into a tempbuf because this structure is 15KB of valuable RAM state = loadProto(deviceStateFileName, meshtastic_DeviceState_size, sizeof(meshtastic_DeviceState), From 2bcf608654facd685321779b339584644a1ecc5d Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 28 Jun 2025 08:19:31 -0500 Subject: [PATCH 362/461] Last second fixes (#7156) * Ditch the 30 second delay for button presses * Only order strictly weakly * Too many comments! * Only sort the populated meshNodes --- src/input/ButtonThread.cpp | 11 ++++++----- src/mesh/NodeDB.cpp | 33 ++++++++++++++++----------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/input/ButtonThread.cpp b/src/input/ButtonThread.cpp index da9878fa4..ad667f003 100644 --- a/src/input/ButtonThread.cpp +++ b/src/input/ButtonThread.cpp @@ -58,15 +58,15 @@ bool ButtonThread::initButton(const ButtonConfig &config) userButton.attachLongPressStart( [](void *callerThread) -> void { ButtonThread *thread = (ButtonThread *)callerThread; - if (millis() > 30000) // hold off 30s after boot - thread->btnEvent = BUTTON_EVENT_LONG_PRESSED; + // if (millis() > 30000) // hold off 30s after boot + thread->btnEvent = BUTTON_EVENT_LONG_PRESSED; }, this); userButton.attachLongPressStop( [](void *callerThread) -> void { ButtonThread *thread = (ButtonThread *)callerThread; - if (millis() > 30000) // hold off 30s after boot - thread->btnEvent = BUTTON_EVENT_LONG_RELEASED; + // if (millis() > 30000) // hold off 30s after boot + thread->btnEvent = BUTTON_EVENT_LONG_RELEASED; }, this); } @@ -254,7 +254,8 @@ int32_t ButtonThread::runOnce() case BUTTON_EVENT_LONG_RELEASED: { LOG_INFO("LONG PRESS RELEASE"); - if (_longLongPress != INPUT_BROKER_NONE && (millis() - buttonPressStartTime) >= _longLongPressTime) { + if (millis() > 30000 && _longLongPress != INPUT_BROKER_NONE && + (millis() - buttonPressStartTime) >= _longLongPressTime) { evt.inputEvent = _longLongPress; this->notifyObservers(&evt); } diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index cc3639f19..8990d4b4f 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1694,23 +1694,22 @@ void NodeDB::sortMeshDB() { if (!Throttle::isWithinTimespanMs(lastSort, 1000 * 5)) { lastSort = millis(); - std::sort(meshNodes->begin(), meshNodes->end(), [](const meshtastic_NodeInfoLite &a, const meshtastic_NodeInfoLite &b) { - if (a.num == myNodeInfo.my_node_num) { - return true; - } - if (b.num == myNodeInfo.my_node_num) { - return false; - } - bool aFav = a.is_favorite; - bool bFav = b.is_favorite; - if (aFav != bFav) - return aFav; - if (a.last_heard == 0 || a.last_heard == UINT32_MAX) - return false; - if (b.last_heard == 0 || b.last_heard == UINT32_MAX) - return true; - return a.last_heard > b.last_heard; - }); + std::sort(meshNodes->begin(), meshNodes->begin() + numMeshNodes, + [](const meshtastic_NodeInfoLite &a, const meshtastic_NodeInfoLite &b) { + if (a.num == myNodeInfo.my_node_num) { + return true; + } + if (b.num == myNodeInfo.my_node_num) { + return false; + } + bool aFav = a.is_favorite; + bool bFav = b.is_favorite; + if (aFav != bFav) + return aFav; + if (a.last_heard != b.last_heard) + return a.last_heard > b.last_heard; + return a.num > b.num; + }); } } From b6a13f1114ed2c259881fd8761832a5aaae97d3b Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 28 Jun 2025 22:54:03 -0500 Subject: [PATCH 363/461] Add check for theoretically impossible comparison, and drop nodenum comparison (#7165) --- src/mesh/NodeDB.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 8990d4b4f..bd4911a9b 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1696,6 +1696,8 @@ void NodeDB::sortMeshDB() lastSort = millis(); std::sort(meshNodes->begin(), meshNodes->begin() + numMeshNodes, [](const meshtastic_NodeInfoLite &a, const meshtastic_NodeInfoLite &b) { + if (a.num == myNodeInfo.my_node_num && b.num == myNodeInfo.my_node_num) // in theory impossible + return false; if (a.num == myNodeInfo.my_node_num) { return true; } @@ -1706,9 +1708,7 @@ void NodeDB::sortMeshDB() bool bFav = b.is_favorite; if (aFav != bFav) return aFav; - if (a.last_heard != b.last_heard) - return a.last_heard > b.last_heard; - return a.num > b.num; + return a.last_heard > b.last_heard; }); } } From 26df4f81420936390bdbbbac9e593161d8e943dc Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Mon, 30 Jun 2025 19:05:24 +0800 Subject: [PATCH 364/461] fix(xiao_ble): Define xiao_ble I2C pins in parent variant (fixes #7163) (#7164) This restores the previously-defined I2C pins that got lost in the cleanup (#7024) Signed-off-by: Andrew Yong --- variants/seeed_xiao_nrf52840_kit/variant.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/variants/seeed_xiao_nrf52840_kit/variant.h b/variants/seeed_xiao_nrf52840_kit/variant.h index d2bbfdda9..a65500612 100644 --- a/variants/seeed_xiao_nrf52840_kit/variant.h +++ b/variants/seeed_xiao_nrf52840_kit/variant.h @@ -179,7 +179,11 @@ static const uint8_t SCK = PIN_SPI_SCK; #define I2C_NO_RESCAN // I2C is a bit finicky, don't scan too much #define WIRE_INTERFACES_COUNT 1 -#if !defined(XIAO_BLE_LEGACY_PINOUT) && !defined(GPS_L76K) +#if defined(XIAO_BLE_LEGACY_PINOUT) +// Used for I2C by DIY xiao_ble variant +#define PIN_WIRE_SDA D4 +#define PIN_WIRE_SCL D5 +#elif !defined(GPS_L76K) // If D6 and D7 are free, I2C is probably the most versatile assignment #define PIN_WIRE_SDA D6 #define PIN_WIRE_SCL D7 From be06a7d88121ce5a0f3741d3968525e15610e893 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 06:05:43 -0500 Subject: [PATCH 365/461] automated bumps (#7155) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 7 +++++-- version.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 4b07f6388..ed57386a3 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.1 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.0 diff --git a/debian/changelog b/debian/changelog index d607be68c..70a01bab4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.7.0.0) UNRELEASED; urgency=medium +meshtasticd (2.7.1.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging @@ -22,4 +22,7 @@ meshtasticd (2.7.0.0) UNRELEASED; urgency=medium [ ] * GitHub Actions Automatic version bump - -- Mon, 16 Jun 2025 02:10:49 +0000 + [ ] + * GitHub Actions Automatic version bump + + -- Fri, 27 Jun 2025 20:12:21 +0000 diff --git a/version.properties b/version.properties index 91c81a0c9..3fe1aa385 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 7 -build = 0 +build = 1 From 4bd416413a2ecad41f9ba3d95e6c68c8b8b2278a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 16:04:12 -0500 Subject: [PATCH 366/461] chore(deps): update meshtastic/device-ui digest to 4b7bf36 (#7178) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 693fdc9c3..0143038af 100644 --- a/platformio.ini +++ b/platformio.ini @@ -109,7 +109,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/cdc6e5bdeedb8293d10e4a02be6ca64e95a7c515.zip + https://github.com/meshtastic/device-ui/archive/4b7bf369adfa5a7bd419fa8293d21206576d52d0.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 5841c889ba439dff335a5460759f084dbe9d5f62 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Tue, 1 Jul 2025 19:34:03 +1000 Subject: [PATCH 367/461] Add detection code for SCD4X (#7185) * Add detection code for SCD4X This patch adds I2C detection support SCD40/SDC41 CO2 sensors. It's a start to get #4601 over the line :) Co-Authored-By: @Coloradohusky * Remove SCD4X from Portduino --- platformio.ini | 3 ++- src/configuration.h | 1 + src/detect/ScanI2C.h | 1 + src/detect/ScanI2CTwoWire.cpp | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index 0143038af..c7b728d6a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -195,4 +195,5 @@ lib_deps = # renovate: datasource=custom.pio depName=Bosch BME68x packageName=boschsensortec/library/BME68x Sensor Library boschsensortec/BME68x Sensor Library@1.3.40408 # renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master - https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip \ No newline at end of file + https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip + sensirion/Sensirion I2C SCD4x@^0.4.0 diff --git a/src/configuration.h b/src/configuration.h index 89257ff2f..cddc7ba7a 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -189,6 +189,7 @@ along with this program. If not, see . #define DFROBOT_RAIN_ADDR 0x1d #define NAU7802_ADDR 0x2A #define MAX30102_ADDR 0x57 +#define SCD4X_ADDR 0x62 #define MLX90614_ADDR_DEF 0x5A #define CGRADSENS_ADDR 0x66 #define LTR390UV_ADDR 0x53 diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index 90467abd0..fc0b7c5a6 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -61,6 +61,7 @@ class ScanI2C FT6336U, STK8BAXX, ICM20948, + SCD4X, MAX30102, TPS65233, MPR121KB, diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index fd3d1c80b..9e9441123 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -447,6 +447,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) SCAN_SIMPLE_CASE(DFROBOT_RAIN_ADDR, DFROBOT_RAIN, "DFRobot Rain Gauge", (uint8_t)addr.address); SCAN_SIMPLE_CASE(LTR390UV_ADDR, LTR390UV, "LTR390UV", (uint8_t)addr.address); SCAN_SIMPLE_CASE(PCT2075_ADDR, PCT2075, "PCT2075", (uint8_t)addr.address); + SCAN_SIMPLE_CASE(SCD4X_ADDR, SCD4X, "SCD4X", (uint8_t)addr.address); SCAN_SIMPLE_CASE(BMM150_ADDR, BMM150, "BMM150", (uint8_t)addr.address); #ifdef HAS_TPS65233 SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233", (uint8_t)addr.address); @@ -556,4 +557,4 @@ void ScanI2CTwoWire::logFoundDevice(const char *device, uint8_t address) { LOG_INFO("%s found at address 0x%x", device, address); } -#endif \ No newline at end of file +#endif From 598eebfb1084dc4423ada754e73942ba61edd3e4 Mon Sep 17 00:00:00 2001 From: dylanli Date: Tue, 1 Jul 2025 18:16:48 +0800 Subject: [PATCH 368/461] fix t1000-e battery level map (#7186) --- src/power.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/power.h b/src/power.h index 33a356d92..e7193dd07 100644 --- a/src/power.h +++ b/src/power.h @@ -25,7 +25,7 @@ #elif defined(CELL_TYPE_LTO) #define OCV_ARRAY 2700, 2560, 2540, 2520, 2500, 2460, 2420, 2400, 2380, 2320, 1500 #elif defined(TRACKER_T1000_E) -#define OCV_ARRAY 4190, 4078, 4017, 3969, 3887, 3818, 3798, 3791, 3766, 3712, 3100 +#define OCV_ARRAY 4190, 4042, 3957, 3885, 3820, 3776, 3746, 3725, 3696, 3644, 3100 #elif defined(HELTEC_MESH_POCKET_BATTERY_5000) #define OCV_ARRAY 4300, 4240, 4120, 4000, 3888, 3800, 3740, 3698, 3655, 3580, 3400 #elif defined(HELTEC_MESH_POCKET_BATTERY_10000) From baf0e9c7e6987be7b872b6c7a92d9ec0725a1f01 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Tue, 1 Jul 2025 21:27:44 +1000 Subject: [PATCH 369/461] Add detection framework for multiple AirQuality sensors (#7187) * Add detection framework for multiple AirQuality sensors Now we have the ability to detect multiple AirQualitySensors, follow the lead of other sensor types and create supporting methods and objects for using this information. Continued cherry-picking to get #4601 over the line :) Co-Authored-By: @Coloradohusky * Update src/main.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/detect/ScanI2C.cpp | 8 +++++++- src/detect/ScanI2C.h | 2 ++ src/main.cpp | 6 ++++++ src/main.h | 3 ++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/detect/ScanI2C.cpp b/src/detect/ScanI2C.cpp index e6236251c..170bef3a6 100644 --- a/src/detect/ScanI2C.cpp +++ b/src/detect/ScanI2C.cpp @@ -41,6 +41,12 @@ ScanI2C::FoundDevice ScanI2C::firstAccelerometer() const return firstOfOrNONE(9, types); } +ScanI2C::FoundDevice ScanI2C::firstAQI() const +{ + ScanI2C::DeviceType types[] = {PMSA0031, SCD4X}; + return firstOfOrNONE(2, types); +} + ScanI2C::FoundDevice ScanI2C::firstRGBLED() const { ScanI2C::DeviceType types[] = {NCP5623, LP5562}; @@ -80,4 +86,4 @@ bool ScanI2C::DeviceAddress::operator<(const ScanI2C::DeviceAddress &other) cons || (port != NO_I2C && other.port != NO_I2C && (address < other.address)); } -ScanI2C::FoundDevice::FoundDevice(ScanI2C::DeviceType type, ScanI2C::DeviceAddress address) : type(type), address(address) {} \ No newline at end of file +ScanI2C::FoundDevice::FoundDevice(ScanI2C::DeviceType type, ScanI2C::DeviceAddress address) : type(type), address(address) {} diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index fc0b7c5a6..dd290db98 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -127,6 +127,8 @@ class ScanI2C FoundDevice firstAccelerometer() const; + FoundDevice firstAQI() const; + FoundDevice firstRGBLED() const; virtual FoundDevice find(DeviceType) const; diff --git a/src/main.cpp b/src/main.cpp index 4b64a78ea..9e0985a3a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -195,6 +195,8 @@ ScanI2C::DeviceAddress rtc_found = ScanI2C::ADDRESS_NONE; ScanI2C::DeviceAddress accelerometer_found = ScanI2C::ADDRESS_NONE; // The I2C address of the RGB LED (if found) ScanI2C::FoundDevice rgb_found = ScanI2C::FoundDevice(ScanI2C::DeviceType::NONE, ScanI2C::ADDRESS_NONE); +/// The I2C address of our Air Quality Indicator (if found) +ScanI2C::DeviceAddress aqi_found = ScanI2C::ADDRESS_NONE; #ifdef T_WATCH_S3 Adafruit_DRV2605 drv; @@ -622,6 +624,9 @@ void setup() pmu_found = i2cScanner->exists(ScanI2C::DeviceType::PMU_AXP192_AXP2101); + auto aqiInfo = i2cScanner->firstAQI(); + aqi_found = aqiInfo.type != ScanI2C::DeviceType::NONE ? aqiInfo.address : ScanI2C::ADDRESS_NONE; + /* * There are a bunch of sensors that have no further logic than to be found and stuffed into the * nodeTelemetrySensorsMap singleton. This wraps that logic in a temporary scope to declare the temporary field @@ -690,6 +695,7 @@ void setup() scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::DPS310, meshtastic_TelemetrySensorType_DPS310); scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::RAK12035, meshtastic_TelemetrySensorType_RAK12035); scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::PCT2075, meshtastic_TelemetrySensorType_PCT2075); + scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::SCD4X, meshtastic_TelemetrySensorType_SCD4X); i2cScanner.reset(); #endif diff --git a/src/main.h b/src/main.h index 79094e2d3..7105bd62b 100644 --- a/src/main.h +++ b/src/main.h @@ -35,6 +35,7 @@ extern bool kb_found; extern ScanI2C::DeviceAddress rtc_found; extern ScanI2C::DeviceAddress accelerometer_found; extern ScanI2C::FoundDevice rgb_found; +extern ScanI2C::DeviceAddress aqi_found; extern bool eink_found; extern bool pmu_found; @@ -92,4 +93,4 @@ void scannerToSensorsMap(const std::unique_ptr &i2cScanner, Scan #endif // We default to 4MHz SPI, SPI mode 0 -extern SPISettings spiSettings; \ No newline at end of file +extern SPISettings spiSettings; From 3ea96bb6e164a5ee61e6983b537cfb8d517ef747 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 1 Jul 2025 16:47:42 +0300 Subject: [PATCH 370/461] Log TX power after limits applyng and store it in config (#7065) * Log and save in config lora tx_power after limits applyng * Log and save in config lora tx_power after limits applyng * Trunk fmt * Remove duplicate logic --------- Co-authored-by: Ben Meadors --- src/mesh/LR11x0Interface.cpp | 5 +---- src/mesh/RF95Interface.cpp | 5 +---- src/mesh/RadioInterface.cpp | 9 ++++++++- src/mesh/RadioInterface.h | 2 +- src/mesh/STM32WLE5JCInterface.cpp | 5 +---- src/mesh/SX126xInterface.cpp | 5 +---- src/mesh/SX128xInterface.cpp | 5 +---- 7 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/mesh/LR11x0Interface.cpp b/src/mesh/LR11x0Interface.cpp index 8cc05994c..a20db808e 100644 --- a/src/mesh/LR11x0Interface.cpp +++ b/src/mesh/LR11x0Interface.cpp @@ -71,10 +71,7 @@ template bool LR11x0Interface::init() RadioLibInterface::init(); - limitPower(); - - if (power > LR1110_MAX_POWER) // Clamp power to maximum defined level - power = LR1110_MAX_POWER; + limitPower(LR1110_MAX_POWER); if ((power > LR1120_MAX_POWER) && (config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_LORA_24)) { // clamp again if wide freq range diff --git a/src/mesh/RF95Interface.cpp b/src/mesh/RF95Interface.cpp index 943a79a5f..97f21fc34 100644 --- a/src/mesh/RF95Interface.cpp +++ b/src/mesh/RF95Interface.cpp @@ -122,10 +122,7 @@ bool RF95Interface::init() power = dacDbValues.db; #endif - limitPower(); - - if (power > RF95_MAX_POWER) // This chip has lower power limits than some - power = RF95_MAX_POWER; + limitPower(RF95_MAX_POWER); iface = lora = new RadioLibRF95(&module); diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index f7cd6f4c1..91a4d0632 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -611,7 +611,7 @@ uint32_t RadioInterface::computeSlotTimeMsec() * Some regulatory regions limit xmit power. * This function should be called by subclasses after setting their desired power. It might lower it */ -void RadioInterface::limitPower() +void RadioInterface::limitPower(int8_t loraMaxPower) { uint8_t maxPower = 255; // No limit @@ -628,6 +628,13 @@ void RadioInterface::limitPower() power -= TX_GAIN_LORA; } + if (power > loraMaxPower) // Clamp power to maximum defined level + power = loraMaxPower; + + if (TX_GAIN_LORA == 0) { // Setting power in config with defined TX_GAIN_LORA will cause decreasing power on each reboot + config.lora.tx_power = power; // Set limited power in config + } + LOG_INFO("Final Tx power: %d dBm", power); } diff --git a/src/mesh/RadioInterface.h b/src/mesh/RadioInterface.h index 68ae09635..c9e71cfa8 100644 --- a/src/mesh/RadioInterface.h +++ b/src/mesh/RadioInterface.h @@ -230,7 +230,7 @@ class RadioInterface * Some regulatory regions limit xmit power. * This function should be called by subclasses after setting their desired power. It might lower it */ - void limitPower(); + void limitPower(int8_t MAX_POWER); /** * Save the frequency we selected for later reuse. diff --git a/src/mesh/STM32WLE5JCInterface.cpp b/src/mesh/STM32WLE5JCInterface.cpp index 3c8bf89c3..d7bc37466 100644 --- a/src/mesh/STM32WLE5JCInterface.cpp +++ b/src/mesh/STM32WLE5JCInterface.cpp @@ -25,10 +25,7 @@ bool STM32WLE5JCInterface::init() lora.setRfSwitchTable(rfswitch_pins, rfswitch_table); - limitPower(); - - if (power > STM32WLx_MAX_POWER) // This chip has lower power limits than some - power = STM32WLx_MAX_POWER; + limitPower(STM32WLx_MAX_POWER); int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage); diff --git a/src/mesh/SX126xInterface.cpp b/src/mesh/SX126xInterface.cpp index e5ecd9302..729c1abc6 100644 --- a/src/mesh/SX126xInterface.cpp +++ b/src/mesh/SX126xInterface.cpp @@ -69,10 +69,7 @@ template bool SX126xInterface::init() RadioLibInterface::init(); - limitPower(); - - if (power > SX126X_MAX_POWER) // Clamp power to maximum defined level - power = SX126X_MAX_POWER; + limitPower(SX126X_MAX_POWER); int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage, useRegulatorLDO); // \todo Display actual typename of the adapter, not just `SX126x` diff --git a/src/mesh/SX128xInterface.cpp b/src/mesh/SX128xInterface.cpp index 2b17543fc..866426872 100644 --- a/src/mesh/SX128xInterface.cpp +++ b/src/mesh/SX128xInterface.cpp @@ -62,10 +62,7 @@ template bool SX128xInterface::init() RadioLibInterface::init(); - limitPower(); - - if (power > SX128X_MAX_POWER) // This chip has lower power limits than some - power = SX128X_MAX_POWER; + limitPower(SX128X_MAX_POWER); preambleLength = 12; // 12 is the default for this chip, 32 does not RX at all From 13013a272fa83566e7bc88339a906d5b396d831a Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Wed, 2 Jul 2025 13:18:14 +1200 Subject: [PATCH 371/461] Limited emoji support for InkHUD (#7176) * Cram a few emoji into AdafruitGFX fonts Values which would normally be assigned to unprintable control characters * Another sneaky string which may contain UTF-8 chars * Document emoji --------- Co-authored-by: Ben Meadors --- .../niche/Fonts/FreeSans6pt_Win1250.h | 970 ++++++++-------- .../niche/Fonts/FreeSans6pt_Win1251.h | 970 ++++++++-------- .../niche/Fonts/FreeSans6pt_Win1252.h | 970 ++++++++-------- .../niche/Fonts/FreeSans9pt_Win1250.h | 1007 +++++++++-------- .../niche/Fonts/FreeSans9pt_Win1251.h | 1006 ++++++++-------- .../niche/Fonts/FreeSans9pt_Win1252.h | 1007 +++++++++-------- src/graphics/niche/InkHUD/Applet.cpp | 5 +- src/graphics/niche/InkHUD/AppletFont.cpp | 113 +- .../InkHUD/Applets/System/Logo/LogoApplet.cpp | 3 +- src/graphics/niche/InkHUD/docs/README.md | 39 +- 10 files changed, 3271 insertions(+), 2819 deletions(-) diff --git a/src/graphics/niche/Fonts/FreeSans6pt_Win1250.h b/src/graphics/niche/Fonts/FreeSans6pt_Win1250.h index aee777783..4042bd835 100644 --- a/src/graphics/niche/Fonts/FreeSans6pt_Win1250.h +++ b/src/graphics/niche/Fonts/FreeSans6pt_Win1250.h @@ -1,457 +1,527 @@ +// trunk-ignore-all(clang-format) #pragma once +/* PROPERTIES + +FONT_NAME FreeSans6pt_Win1250 +*/ const uint8_t FreeSans6pt_Win1250Bitmaps[] PROGMEM = { - /* ' ' 0x20 */ - 0xFC, 0x80, /* '!' 0x21 */ - 0xB6, 0x80, /* '"' 0x22 */ - 0x24, 0x51, 0xF9, 0x42, 0x9F, 0x92, 0x28, /* '#' 0x23 */ - 0x10, 0xE5, 0x55, 0x50, 0xE1, 0x65, 0x55, 0xE1, 0x00, /* '$' 0x24 */ - 0x71, 0x24, 0x89, 0x22, 0x50, 0x74, 0x02, 0x70, 0xA4, 0x49, 0x11, 0xC0, /* '%' 0x25 */ - 0x71, 0x24, 0x9C, 0x62, 0x58, 0xA7, 0xF4, /* '&' 0x26 */ - 0xE0, /* ''' 0x27 */ - 0x5A, 0xAA, 0x94, /* '(' 0x28 */ - 0x89, 0x12, 0x49, 0x29, 0x00, /* ')' 0x29 */ - 0x5E, 0x80, /* '*' 0x2A */ - 0x21, 0x3E, 0x42, 0x00, /* '+' 0x2B */ - 0xE0, /* ',' 0x2C */ - 0xC0, /* '-' 0x2D */ - 0x80, /* '.' 0x2E */ - 0x24, 0xA4, 0xA4, 0x80, /* '/' 0x2F */ - 0x76, 0xE3, 0x18, 0xC6, 0x3B, 0x70, /* '0' 0x30 */ - 0x27, 0x92, 0x49, 0x20, /* '1' 0x31 */ - 0x79, 0x10, 0x41, 0x08, 0xC6, 0x10, 0xFC, /* '2' 0x32 */ - 0x79, 0x30, 0x43, 0x18, 0x10, 0x71, 0x78, /* '3' 0x33 */ - 0x08, 0x61, 0x8A, 0x49, 0x2F, 0xC2, 0x08, /* '4' 0x34 */ - 0xFC, 0x21, 0xE8, 0x84, 0x31, 0xF0, /* '5' 0x35 */ - 0x74, 0x61, 0xE8, 0xC6, 0x31, 0x70, /* '6' 0x36 */ - 0xF8, 0x44, 0x22, 0x11, 0x08, 0x40, /* '7' 0x37 */ - 0x39, 0x34, 0x53, 0x39, 0x1C, 0x51, 0x38, /* '8' 0x38 */ - 0x39, 0x3C, 0x71, 0x4C, 0xF0, 0x53, 0x78, /* '9' 0x39 */ - 0x82, /* ':' 0x3A */ - 0x87, /* ';' 0x3B */ - 0x3E, 0x30, 0x60, 0x80, /* '<' 0x3C */ - 0xF8, 0x3E, /* '=' 0x3D */ - 0xE0, 0xC6, 0xC8, 0x00, /* '>' 0x3E */ - 0x74, 0x42, 0x11, 0x10, 0x80, 0x20, /* '?' 0x3F */ - 0x0F, 0x86, 0x19, 0x9A, 0xA4, 0xD9, 0x13, 0x22, 0x56, 0xDA, 0x6E, 0x60, 0x06, 0x00, 0x3C, 0x00, /* '@' 0x40 */ - 0x18, 0x18, 0x24, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, /* 'A' 0x41 */ - 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xFC, /* 'B' 0x42 */ - 0x3E, 0x63, 0x40, 0x40, 0xC0, 0x40, 0x41, 0x63, 0x3E, /* 'C' 0x43 */ - 0xF9, 0x0A, 0x1C, 0x18, 0x30, 0x61, 0xC2, 0xF8, /* 'D' 0x44 */ - 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, /* 'E' 0x45 */ - 0xFE, 0x08, 0x20, 0xFA, 0x08, 0x20, 0x80, /* 'F' 0x46 */ - 0x1E, 0x61, 0x40, 0x40, 0xC7, 0x41, 0x41, 0x63, 0x1D, /* 'G' 0x47 */ - 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, /* 'H' 0x48 */ - 0xFF, 0x80, /* 'I' 0x49 */ - 0x08, 0x42, 0x10, 0x87, 0x29, 0x70, /* 'J' 0x4A */ - 0x85, 0x12, 0x45, 0x0D, 0x13, 0x22, 0x42, 0x86, /* 'K' 0x4B */ - 0x84, 0x21, 0x08, 0x42, 0x10, 0xF8, /* 'L' 0x4C */ - 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, /* 'M' 0x4D */ - 0x83, 0x86, 0x8D, 0x19, 0x33, 0x62, 0xC3, 0x86, /* 'N' 0x4E */ - 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x06, 0xC6, 0x1E, 0x00, /* 'O' 0x4F */ - 0xFA, 0x18, 0x61, 0xFA, 0x08, 0x20, 0x80, /* 'P' 0x50 */ - 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x16, 0xC6, 0x1F, 0x00, 0x40, /* 'Q' 0x51 */ - 0xFD, 0x0E, 0x1C, 0x2F, 0x90, 0xA1, 0x42, 0x86, /* 'R' 0x52 */ - 0x7A, 0x18, 0x30, 0x78, 0x38, 0x61, 0x78, /* 'S' 0x53 */ - 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, /* 'T' 0x54 */ - 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xE2, 0x78, /* 'U' 0x55 */ - 0xC2, 0x85, 0x0B, 0x22, 0x44, 0x8E, 0x0C, 0x18, /* 'V' 0x56 */ - 0xC4, 0x28, 0xCD, 0x29, 0x25, 0x24, 0xA4, 0x52, 0x8C, 0x61, 0x8C, 0x31, 0x80, /* 'W' 0x57 */ - 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xA3, 0x84, /* 'X' 0x58 */ - 0xC3, 0x42, 0x24, 0x34, 0x18, 0x08, 0x08, 0x08, 0x08, /* 'Y' 0x59 */ - 0x7E, 0x0C, 0x30, 0x41, 0x06, 0x18, 0x20, 0xFE, /* 'Z' 0x5A */ - 0xEA, 0xAA, 0xAB, /* '[' 0x5B */ - 0x92, 0x24, 0x89, 0x20, /* '\' 0x5C */ - 0xD5, 0x55, 0x57, /* ']' 0x5D */ - 0x46, 0xA9, /* '^' 0x5E */ - 0xFE, /* '_' 0x5F */ - 0x80, /* '`' 0x60 */ - 0x79, 0x20, 0x4F, 0xC6, 0x37, 0x40, /* 'a' 0x61 */ - 0x84, 0x3D, 0x18, 0xC6, 0x31, 0xF0, /* 'b' 0x62 */ - 0x39, 0x3C, 0x20, 0xC1, 0x33, 0x80, /* 'c' 0x63 */ - 0x04, 0x13, 0xD3, 0xC6, 0x1C, 0x53, 0x3C, /* 'd' 0x64 */ - 0x39, 0x38, 0x7F, 0x81, 0x13, 0x80, /* 'e' 0x65 */ - 0x6B, 0xA4, 0x92, 0x40, /* 'f' 0x66 */ - 0x35, 0x3C, 0x61, 0xC5, 0x33, 0x41, 0x4D, 0xE0, /* 'g' 0x67 */ - 0x84, 0x3D, 0x38, 0xC6, 0x31, 0x88, /* 'h' 0x68 */ - 0xBF, 0x80, /* 'i' 0x69 */ - 0x45, 0x55, 0x57, /* 'j' 0x6A */ - 0x84, 0x25, 0x4E, 0x52, 0xD2, 0x88, /* 'k' 0x6B */ - 0xFF, 0x80, /* 'l' 0x6C */ - 0xF7, 0x99, 0x91, 0x91, 0x91, 0x91, 0x91, /* 'm' 0x6D */ - 0xF4, 0x63, 0x18, 0xC6, 0x20, /* 'n' 0x6E */ - 0x39, 0x3C, 0x61, 0xC5, 0x33, 0x80, /* 'o' 0x6F */ - 0xF4, 0x63, 0x18, 0xC7, 0xD0, 0x80, /* 'p' 0x70 */ - 0x3D, 0x3C, 0x61, 0xC5, 0x37, 0x41, 0x04, /* 'q' 0x71 */ - 0xF2, 0x49, 0x20, /* 'r' 0x72 */ - 0x7A, 0x50, 0xE0, 0xE5, 0xE0, /* 's' 0x73 */ - 0x5D, 0x24, 0x93, /* 't' 0x74 */ - 0x8C, 0x63, 0x18, 0xCF, 0xA0, /* 'u' 0x75 */ - 0x85, 0x24, 0x92, 0x30, 0xC3, 0x00, /* 'v' 0x76 */ - 0x89, 0x59, 0x59, 0x55, 0x56, 0x26, 0x26, /* 'w' 0x77 */ - 0x4A, 0x4C, 0x43, 0x27, 0x20, /* 'x' 0x78 */ - 0x8A, 0x52, 0xA5, 0x18, 0x84, 0x22, 0x00, /* 'y' 0x79 */ - 0x78, 0x44, 0x46, 0x23, 0xE0, /* 'z' 0x7A */ - 0x6A, 0xAA, 0xA9, /* '{' 0x7B */ - 0xFF, 0xE0, /* '|' 0x7C */ - 0x95, 0x55, 0x56, /* '}' 0x7D */ - 0x66, 0x60, /* '~' 0x7E */ - 0xFF, 0xC0, 0x67, 0x34, 0x58, 0x4C, 0x46, 0x03, 0x11, 0x80, 0xFF, 0xC0, /* 0x7F */ - 0x1C, 0x45, 0x07, 0xE4, 0x1F, 0x10, 0x10, 0x1E, /* 0x80 */ - /* 0x81 */ - 0xE0, /* 0x82 */ - /* 0x83 */ - 0xB6, 0x80, /* 0x84 */ - 0xA8, /* 0x85 */ - 0x21, 0x09, 0xF2, 0x10, 0x84, 0x21, 0x08, /* 0x86 */ - 0x21, 0x09, 0xF2, 0x10, 0x84, 0xF9, 0x08, /* 0x87 */ - /* 0x88 */ - 0x62, 0x09, 0x40, 0x98, 0x06, 0x80, 0x10, 0x01, 0x66, 0x29, 0x92, 0x99, 0x06, 0x60, /* 0x89 */ - 0x28, 0x47, 0xA1, 0x83, 0x07, 0x83, 0x87, 0x17, 0x80, /* 0x8A */ - 0x64, /* 0x8B */ - 0x10, 0x87, 0xA1, 0x83, 0x07, 0x83, 0x87, 0x17, 0x80, /* 0x8C */ - 0x28, 0x4F, 0xC4, 0x10, 0x41, 0x04, 0x10, 0x40, /* 0x8D */ - 0x14, 0x11, 0xF8, 0x30, 0xC1, 0x04, 0x18, 0x61, 0xFC, /* 0x8E */ - 0x08, 0x21, 0xF8, 0x30, 0xC1, 0x04, 0x18, 0x61, 0xFC, /* 0x8F */ - /* 0x90 */ - 0xE0, /* 0x91 */ - 0xE0, /* 0x92 */ - 0xB6, 0x80, /* 0x93 */ - 0xB6, 0x80, /* 0x94 */ - 0xFF, 0x80, /* 0x95 */ - 0xFC, /* 0x96 */ - 0xFF, 0xF0, /* 0x97 */ - /* 0x98 */ - 0xE6, 0x28, 0xCD, 0x19, 0xA3, 0x34, 0x6A, 0x8B, 0x51, 0x68, /* 0x99 */ - 0x52, 0x69, 0x8E, 0x19, 0x60, /* 0x9A */ - 0x98, /* 0x9B */ - 0x24, 0x06, 0x98, 0xE1, 0x96, /* 0x9C */ - 0x15, 0xE4, 0x44, 0x44, 0x60, /* 0x9D */ - 0x51, 0x00, 0xF0, 0x88, 0x8C, 0x47, 0xC0, /* 0x9E */ - 0x11, 0x00, 0xF0, 0x88, 0x8C, 0x47, 0xC0, /* 0x9F */ - /* 0xA0 */ - 0xA8, /* 0xA1 */ - 0x96, /* 0xA2 */ - 0x41, 0x05, 0x18, 0x43, 0x04, 0x10, 0x7C, /* 0xA3 */ - 0xFC, 0x63, 0xF0, /* 0xA4 */ - 0x30, 0x38, 0x28, 0x48, 0x4C, 0x7C, 0x84, 0x86, 0x82, 0x04, 0x07, /* 0xA5 */ - 0xF9, 0xF0, /* 0xA6 */ - 0x32, 0x91, 0xC9, 0x47, 0x26, 0x14, 0xA4, 0xC0, /* 0xA7 */ - 0xA0, /* 0xA8 */ - 0x3E, 0x3F, 0xB8, 0xF4, 0x1A, 0x0D, 0x17, 0x76, 0xC6, 0x3E, 0x00, /* 0xA9 */ - 0x7A, 0x18, 0x30, 0x78, 0x38, 0x61, 0x78, 0xC1, 0x0C, /* 0xAA */ - 0x5A, 0xA5, /* 0xAB */ - 0xFC, 0x10, 0x40, /* 0xAC */ - /* 0xAD */ - 0x3E, 0x31, 0xB7, 0x72, 0x99, 0xCC, 0xC7, 0x56, 0xC6, 0x3E, 0x00, /* 0xAE */ - 0x18, 0x31, 0xF8, 0x30, 0xC1, 0x04, 0x18, 0x61, 0xFC, /* 0xAF */ - 0x69, 0x96, /* 0xB0 */ - 0x21, 0x3E, 0x42, 0x03, 0xE0, /* 0xB1 */ - 0x9C, /* 0xB2 */ - 0x49, 0x35, 0x92, 0x40, /* 0xB3 */ - 0x80, /* 0xB4 */ - 0x8A, 0x28, 0xA2, 0x8A, 0x6E, 0xE0, 0x80, /* 0xB5 */ - 0x7F, 0xAE, 0xBA, 0x68, 0xA2, 0x8A, 0x28, 0xA0, /* 0xB6 */ - 0x80, /* 0xB7 */ - 0x67, 0x80, /* 0xB8 */ - 0x78, 0x84, 0x04, 0x3C, 0xC4, 0x8C, 0x76, 0x04, 0x07, /* 0xB9 */ - 0x69, 0x8E, 0x19, 0x66, 0x26, /* 0xBA */ - 0xA5, 0x5A, /* 0xBB */ - 0xA5, 0x21, 0x08, 0x42, 0x10, 0xF8, /* 0xBC */ - 0xA0, /* 0xBD */ - 0xBA, 0x49, 0x24, 0x90, /* 0xBE */ - 0x31, 0x9E, 0x11, 0x11, 0x88, 0xF8, /* 0xBF */ - 0x10, 0x43, 0xE4, 0x28, 0x50, 0xBE, 0x42, 0x85, 0x0C, /* 0xC0 */ - 0x08, 0x10, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC1 */ - 0x18, 0x24, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC2 */ - 0x24, 0x18, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC3 */ - 0x24, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, /* 0xC4 */ - 0x11, 0x21, 0x08, 0x42, 0x10, 0x87, 0xC0, /* 0xC5 */ - 0x08, 0x20, 0x01, 0xE4, 0x30, 0x20, 0x40, 0x82, 0x8C, 0xF0, /* 0xC6 */ - 0x3E, 0x61, 0xC0, 0x80, 0x80, 0x80, 0xC1, 0x63, 0x3E, 0x0C, 0x04, 0x1C, /* 0xC7 */ - 0x28, 0x20, 0x01, 0xE4, 0x30, 0x20, 0x40, 0x82, 0x8C, 0xF0, /* 0xC8 */ - 0x08, 0x40, 0x3F, 0x82, 0x0F, 0xA0, 0x83, 0xF0, /* 0xC9 */ - 0xFD, 0x02, 0x04, 0x0F, 0xD0, 0x20, 0x40, 0xFC, 0x10, 0x38, /* 0xCA */ - 0x28, 0x0F, 0xE0, 0x83, 0xE8, 0x20, 0x83, 0xF0, /* 0xCB */ - 0x28, 0x40, 0x3F, 0x82, 0x0F, 0xA0, 0x82, 0x0F, 0xC0, /* 0xCC */ - 0x62, 0xAA, 0xA0, /* 0xCD */ - 0x54, 0x24, 0x92, 0x48, /* 0xCE */ - 0x50, 0x43, 0xE4, 0x28, 0x30, 0x60, 0xC1, 0x85, 0xF0, /* 0xCF */ - 0x7C, 0x42, 0x41, 0x41, 0xF1, 0x41, 0x41, 0x42, 0x7C, /* 0xD0 */ - 0x08, 0x23, 0x0F, 0x1B, 0x32, 0x66, 0xC7, 0x87, 0x04, /* 0xD1 */ - 0x28, 0x23, 0x0F, 0x1B, 0x32, 0x66, 0xC7, 0x87, 0x04, /* 0xD2 */ - 0x04, 0x04, 0x0F, 0x8C, 0x6C, 0x1C, 0x06, 0x03, 0x83, 0x63, 0x1F, 0x00, /* 0xD3 */ - 0x08, 0x0A, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, /* 0xD4 */ - 0x0A, 0x0A, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, /* 0xD5 */ - 0x14, 0x00, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, /* 0xD6 */ - 0x8A, 0x88, 0xA8, 0x80, /* 0xD7 */ - 0x50, 0x43, 0xE4, 0x28, 0x50, 0xBE, 0x42, 0x85, 0x0C, /* 0xD8 */ - 0x10, 0x52, 0x4C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xD9 */ - 0x08, 0x22, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xDA */ - 0x14, 0x52, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xDB */ - 0x29, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xDC */ - 0x09, 0x25, 0x12, 0x22, 0x87, 0x04, 0x08, 0x10, 0x20, /* 0xDD */ - 0xFC, 0x41, 0x04, 0x10, 0x41, 0x04, 0x10, 0x60, 0x8E, /* 0xDE */ - 0x7A, 0x18, 0x61, 0x8A, 0x18, 0x61, 0xB8, /* 0xDF */ - 0x42, 0xE9, 0x24, 0x80, /* 0xE0 */ - 0x10, 0x40, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE1 */ - 0x10, 0x50, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE2 */ - 0x48, 0x60, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE3 */ - 0x28, 0x01, 0xE4, 0x20, 0x47, 0xB1, 0x46, 0x76, /* 0xE4 */ - 0x62, 0xAA, 0xA0, /* 0xE5 */ - 0x10, 0x80, 0x1E, 0xC6, 0x08, 0x20, 0xC5, 0xE0, /* 0xE6 */ - 0x7B, 0x18, 0x20, 0x83, 0x17, 0x8C, 0x11, 0xC0, /* 0xE7 */ - 0x28, 0x40, 0x1E, 0xC6, 0x08, 0x20, 0xC5, 0xE0, /* 0xE8 */ - 0x10, 0x80, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, /* 0xE9 */ - 0x7B, 0x38, 0x7F, 0x83, 0x37, 0x84, 0x1C, /* 0xEA */ - 0x28, 0x07, 0xB3, 0x87, 0xF8, 0x31, 0x78, /* 0xEB */ - 0x28, 0x40, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, /* 0xEC */ - 0x62, 0xAA, 0xA0, /* 0xED */ - 0x54, 0x24, 0x92, 0x48, /* 0xEE */ - 0x02, 0x0C, 0x13, 0xEC, 0xD0, 0xA1, 0x42, 0xCC, 0xE8, /* 0xEF */ - 0x04, 0x1D, 0xD6, 0x68, 0x50, 0xA1, 0x66, 0x74, /* 0xF0 */ - 0x11, 0x01, 0x6C, 0xC6, 0x31, 0x8C, 0x40, /* 0xF1 */ - 0x20, 0x81, 0x6C, 0xC6, 0x31, 0x8C, 0x40, /* 0xF2 */ - 0x10, 0x80, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF3 */ - 0x10, 0xA0, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF4 */ - 0x29, 0x40, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF5 */ - 0x28, 0x07, 0xB3, 0x86, 0x18, 0x73, 0x78, /* 0xF6 */ - 0x20, 0x3E, 0x02, 0x00, /* 0xF7 */ - 0xA8, 0x5D, 0x24, 0x90, /* 0xF8 */ - 0x22, 0x89, 0x18, 0xC6, 0x31, 0x9B, 0x40, /* 0xF9 */ - 0x11, 0x23, 0x18, 0xC6, 0x33, 0x68, /* 0xFA */ - 0x2A, 0x81, 0x18, 0xC6, 0x31, 0x9B, 0x40, /* 0xFB */ - 0x50, 0x23, 0x18, 0xC6, 0x33, 0x68, /* 0xFC */ - 0x10, 0x88, 0x52, 0x49, 0x23, 0x0C, 0x30, 0x82, 0x18, /* 0xFD */ - 0x4E, 0x44, 0x44, 0x46, 0x31, 0x70, /* 0xFE */ - 0x80, /* 0xFF */ +/* 0x01 */ 0x1C, 0x0A, 0x05, 0x04, 0xFE, 0x08, 0x1C, 0x02, 0x07, 0xE0, 0x9F, 0xC0, +/* 0x02 */ 0x3F, 0xF0, 0x40, 0xE0, 0x10, 0x3F, 0x04, 0x9E, 0x28, 0x14, 0x0E, 0x00, +/* 0x03 */ 0x3F, 0x10, 0x28, 0x06, 0x49, 0x80, 0x60, 0x19, 0x26, 0x31, 0x40, 0x8F, 0xC0, +/* 0x04 */ 0x3F, 0x10, 0x2A, 0x16, 0x49, 0xA1, 0x60, 0x19, 0xE6, 0x31, 0x40, 0x8F, 0xC0, +/* 0x05 */ 0x28, 0x15, 0x2A, 0xB5, 0x55, 0xA8, 0x54, 0x12, 0x04, 0x41, 0x08, 0x81, 0xC0, +/* 0x06 */ 0x04, 0x08, 0x88, 0x82, 0x07, 0x01, 0x11, 0xA2, 0xC4, 0x40, 0x70, 0x20, 0x88, 0x88, 0x10, 0x00, +/* 0x07 */ +/* 0x08 */ 0x03, 0x83, 0x44, 0x48, 0x28, 0x01, 0x80, 0x17, 0xFE, 0x08, 0x45, 0x28, 0x84, 0x00, +/* 0x09 */ 0x01, 0xC0, 0x68, 0x82, 0x41, 0x10, 0x02, 0x80, 0x06, 0x00, 0x14, 0x00, 0x8F, 0xFC, +/* 0x0A */ +/* 0x0B */ 0x22, 0x2A, 0xA2, 0x30, 0x18, 0x0A, 0x09, 0x04, 0x44, 0x14, 0x04, 0x00, +/* 0x0C */ 0x46, 0x00, 0x19, 0x03, 0x21, 0x20, 0x93, 0x04, 0x20, 0x11, 0x80, 0x50, 0x02, 0x7F, 0xE0, +/* 0x0D */ +/* 0x0E */ 0x08, 0x0E, 0x08, 0x88, 0x24, 0x12, 0x09, 0x05, 0x01, 0xFF, 0x8A, 0x02, 0x00, +/* 0x0F */ 0x3F, 0x14, 0xAA, 0x16, 0x01, 0x92, 0x60, 0x18, 0xC6, 0x49, 0x40, 0x8F, 0xC0, +/* 0x10 */ 0x1B, 0x02, 0xA0, 0x54, 0x12, 0x42, 0x48, 0x49, 0x31, 0x1E, 0x23, 0xEA, 0xFE, 0x3C, +/* 0x11 */ 0x3F, 0x02, 0x00, 0x20, 0x6D, 0x27, 0xF8, 0x3F, 0xC1, 0xFE, 0x37, 0xD0, 0xBE, 0x40, 0xE1, 0xE2, 0x00, +/* 0x12 */ 0x12, 0x42, 0x20, 0x24, 0xC0, 0x29, 0x99, 0x05, 0x23, 0x30, 0xB0, 0x30, 0x00, +/* 0x13 */ 0x3F, 0x88, 0x0A, 0x44, 0xD5, 0x58, 0x03, 0x00, 0x67, 0xCC, 0x71, 0x40, 0x47, 0xF0, +/* 0x14 */ 0x3F, 0x18, 0x69, 0x26, 0x85, 0xA1, 0x6C, 0xD8, 0x06, 0x31, 0x40, 0x8F, 0xC0, +/* 0x15 */ 0x3F, 0x11, 0x00, 0xE8, 0x03, 0xA0, 0x1F, 0xB3, 0x7E, 0x00, 0xE9, 0xE0, 0x23, 0x00, 0x40, 0x40, 0xFE, 0x00, +/* 0x16 */ 0x30, 0x38, 0x3A, 0x3E, 0x6E, 0xEB, 0xC3, 0xC3, 0x66, 0x3C, +/* 0x17 */ 0x3F, 0x04, 0x00, 0x82, 0x88, 0x5C, 0xA4, 0x49, 0x22, 0x81, 0x98, 0xC4, 0x40, 0xA3, 0xF0, +/* 0x18 */ 0x07, 0x80, 0x42, 0x04, 0x08, 0x21, 0x41, 0x42, 0x60, 0x0E, 0x8C, 0xB2, 0x89, 0x50, 0x52, 0x82, 0x80, +/* 0x19 */ 0x3F, 0xC4, 0x02, 0x80, 0x18, 0x01, 0xB3, 0x1B, 0xB9, 0x80, 0x19, 0xE1, 0x40, 0x23, 0xFC, +/* 0x1A */ 0xFF, 0xC0, 0x67, 0x34, 0x58, 0x4C, 0x46, 0x03, 0x11, 0x80, 0xFF, 0xC0, +/* 0x1B */ 0x0F, 0xC0, 0x40, 0x82, 0x49, 0x08, 0x04, 0x00, 0x00, 0x12, 0x02, 0x31, 0x34, 0x0B, 0x88, 0x45, 0x00, 0x20, +/* 0x1C */ 0x3F, 0x88, 0x0A, 0x44, 0xC9, 0x19, 0x3B, 0x00, 0x60, 0x4C, 0x71, 0x40, 0x47, 0xF0, +/* 0x1D */ 0x3F, 0x8B, 0x0A, 0x00, 0xC8, 0x18, 0x13, 0x00, 0x48, 0xCA, 0xC1, 0x44, 0x53, 0x30, +/* 0x1E */ 0x19, 0xC2, 0x02, 0x50, 0x1E, 0x49, 0x80, 0x12, 0x01, 0x27, 0x92, 0x01, 0x10, 0x20, 0xFC, +/* 0x1F */ 0x30, 0x1C, 0x0C, 0x3E, 0x7E, 0xCF, 0x07, 0xC7, 0x7F, 0x3F, +/* ' ' 0x20 */ +/* '!' 0x21 */ 0xFC, 0x80, +/* '"' 0x22 */ 0xB6, 0x80, +/* '#' 0x23 */ 0x24, 0x51, 0xF9, 0x42, 0x9F, 0x92, 0x28, +/* '$' 0x24 */ 0x10, 0xE5, 0x55, 0x50, 0xE1, 0x65, 0x55, 0xE1, 0x00, +/* '%' 0x25 */ 0x71, 0x24, 0x89, 0x22, 0x50, 0x74, 0x02, 0x70, 0xA4, 0x49, 0x11, 0xC0, +/* '&' 0x26 */ 0x71, 0x24, 0x9C, 0x62, 0x58, 0xA7, 0xF4, +/* ''' 0x27 */ 0xE0, +/* '(' 0x28 */ 0x5A, 0xAA, 0x94, +/* ')' 0x29 */ 0x89, 0x12, 0x49, 0x29, 0x00, +/* '*' 0x2A */ 0x5E, 0x80, +/* '+' 0x2B */ 0x21, 0x3E, 0x42, 0x00, +/* ',' 0x2C */ 0xE0, +/* '-' 0x2D */ 0xC0, +/* '.' 0x2E */ 0x80, +/* '/' 0x2F */ 0x24, 0xA4, 0xA4, 0x80, +/* '0' 0x30 */ 0x76, 0xE3, 0x18, 0xC6, 0x3B, 0x70, +/* '1' 0x31 */ 0x27, 0x92, 0x49, 0x20, +/* '2' 0x32 */ 0x79, 0x10, 0x41, 0x08, 0xC6, 0x10, 0xFC, +/* '3' 0x33 */ 0x79, 0x30, 0x43, 0x18, 0x10, 0x71, 0x78, +/* '4' 0x34 */ 0x08, 0x61, 0x8A, 0x49, 0x2F, 0xC2, 0x08, +/* '5' 0x35 */ 0xFC, 0x21, 0xE8, 0x84, 0x31, 0xF0, +/* '6' 0x36 */ 0x74, 0x61, 0xE8, 0xC6, 0x31, 0x70, +/* '7' 0x37 */ 0xF8, 0x44, 0x22, 0x11, 0x08, 0x40, +/* '8' 0x38 */ 0x39, 0x34, 0x53, 0x39, 0x1C, 0x51, 0x38, +/* '9' 0x39 */ 0x39, 0x3C, 0x71, 0x4C, 0xF0, 0x53, 0x78, +/* ':' 0x3A */ 0x82, +/* ';' 0x3B */ 0x87, +/* '<' 0x3C */ 0x3E, 0x30, 0x60, 0x80, +/* '=' 0x3D */ 0xF8, 0x3E, +/* '>' 0x3E */ 0xE0, 0xC6, 0xC8, 0x00, +/* '?' 0x3F */ 0x74, 0x42, 0x11, 0x10, 0x80, 0x20, +/* '@' 0x40 */ 0x0F, 0x86, 0x19, 0x9A, 0xA4, 0xD9, 0x13, 0x22, 0x56, 0xDA, 0x6E, 0x60, 0x06, 0x00, 0x3C, 0x00, +/* 'A' 0x41 */ 0x18, 0x18, 0x24, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, +/* 'B' 0x42 */ 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xFC, +/* 'C' 0x43 */ 0x3E, 0x63, 0x40, 0x40, 0xC0, 0x40, 0x41, 0x63, 0x3E, +/* 'D' 0x44 */ 0xF9, 0x0A, 0x1C, 0x18, 0x30, 0x61, 0xC2, 0xF8, +/* 'E' 0x45 */ 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, +/* 'F' 0x46 */ 0xFE, 0x08, 0x20, 0xFA, 0x08, 0x20, 0x80, +/* 'G' 0x47 */ 0x1E, 0x61, 0x40, 0x40, 0xC7, 0x41, 0x41, 0x63, 0x1D, +/* 'H' 0x48 */ 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, +/* 'I' 0x49 */ 0xFF, 0x80, +/* 'J' 0x4A */ 0x08, 0x42, 0x10, 0x87, 0x29, 0x70, +/* 'K' 0x4B */ 0x85, 0x12, 0x45, 0x0D, 0x13, 0x22, 0x42, 0x86, +/* 'L' 0x4C */ 0x84, 0x21, 0x08, 0x42, 0x10, 0xF8, +/* 'M' 0x4D */ 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, +/* 'N' 0x4E */ 0x83, 0x86, 0x8D, 0x19, 0x33, 0x62, 0xC3, 0x86, +/* 'O' 0x4F */ 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x06, 0xC6, 0x1E, 0x00, +/* 'P' 0x50 */ 0xFA, 0x18, 0x61, 0xFA, 0x08, 0x20, 0x80, +/* 'Q' 0x51 */ 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x16, 0xC6, 0x1F, 0x00, 0x40, +/* 'R' 0x52 */ 0xFD, 0x0E, 0x1C, 0x2F, 0x90, 0xA1, 0x42, 0x86, +/* 'S' 0x53 */ 0x7A, 0x18, 0x30, 0x78, 0x38, 0x61, 0x78, +/* 'T' 0x54 */ 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, +/* 'U' 0x55 */ 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xE2, 0x78, +/* 'V' 0x56 */ 0xC2, 0x85, 0x0B, 0x22, 0x44, 0x8E, 0x0C, 0x18, +/* 'W' 0x57 */ 0xC4, 0x28, 0xCD, 0x29, 0x25, 0x24, 0xA4, 0x52, 0x8C, 0x61, 0x8C, 0x31, 0x80, +/* 'X' 0x58 */ 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xA3, 0x84, +/* 'Y' 0x59 */ 0xC3, 0x42, 0x24, 0x34, 0x18, 0x08, 0x08, 0x08, 0x08, +/* 'Z' 0x5A */ 0x7E, 0x0C, 0x30, 0x41, 0x06, 0x18, 0x20, 0xFE, +/* '[' 0x5B */ 0xEA, 0xAA, 0xAB, +/* '\' 0x5C */ 0x92, 0x24, 0x89, 0x20, +/* ']' 0x5D */ 0xD5, 0x55, 0x57, +/* '^' 0x5E */ 0x46, 0xA9, +/* '_' 0x5F */ 0xFE, +/* '`' 0x60 */ 0x80, +/* 'a' 0x61 */ 0x79, 0x20, 0x4F, 0xC6, 0x37, 0x40, +/* 'b' 0x62 */ 0x84, 0x3D, 0x18, 0xC6, 0x31, 0xF0, +/* 'c' 0x63 */ 0x39, 0x3C, 0x20, 0xC1, 0x33, 0x80, +/* 'd' 0x64 */ 0x04, 0x13, 0xD3, 0xC6, 0x1C, 0x53, 0x3C, +/* 'e' 0x65 */ 0x39, 0x38, 0x7F, 0x81, 0x13, 0x80, +/* 'f' 0x66 */ 0x6B, 0xA4, 0x92, 0x40, +/* 'g' 0x67 */ 0x35, 0x3C, 0x61, 0xC5, 0x33, 0x41, 0x4D, 0xE0, +/* 'h' 0x68 */ 0x84, 0x3D, 0x38, 0xC6, 0x31, 0x88, +/* 'i' 0x69 */ 0xBF, 0x80, +/* 'j' 0x6A */ 0x45, 0x55, 0x57, +/* 'k' 0x6B */ 0x84, 0x25, 0x4E, 0x52, 0xD2, 0x88, +/* 'l' 0x6C */ 0xFF, 0x80, +/* 'm' 0x6D */ 0xF7, 0x99, 0x91, 0x91, 0x91, 0x91, 0x91, +/* 'n' 0x6E */ 0xF4, 0x63, 0x18, 0xC6, 0x20, +/* 'o' 0x6F */ 0x39, 0x3C, 0x61, 0xC5, 0x33, 0x80, +/* 'p' 0x70 */ 0xF4, 0x63, 0x18, 0xC7, 0xD0, 0x80, +/* 'q' 0x71 */ 0x3D, 0x3C, 0x61, 0xC5, 0x37, 0x41, 0x04, +/* 'r' 0x72 */ 0xF2, 0x49, 0x20, +/* 's' 0x73 */ 0x7A, 0x50, 0xE0, 0xE5, 0xE0, +/* 't' 0x74 */ 0x5D, 0x24, 0x93, +/* 'u' 0x75 */ 0x8C, 0x63, 0x18, 0xCF, 0xA0, +/* 'v' 0x76 */ 0x85, 0x24, 0x92, 0x30, 0xC3, 0x00, +/* 'w' 0x77 */ 0x89, 0x59, 0x59, 0x55, 0x56, 0x26, 0x26, +/* 'x' 0x78 */ 0x4A, 0x4C, 0x43, 0x27, 0x20, +/* 'y' 0x79 */ 0x8A, 0x52, 0xA5, 0x18, 0x84, 0x22, 0x00, +/* 'z' 0x7A */ 0x78, 0x44, 0x46, 0x23, 0xE0, +/* '{' 0x7B */ 0x6A, 0xAA, 0xA9, +/* '|' 0x7C */ 0xFF, 0xE0, +/* '}' 0x7D */ 0x95, 0x55, 0x56, +/* '~' 0x7E */ 0x66, 0x60, +/* 0x7F */ 0xFF, 0xC0, 0x67, 0x34, 0x58, 0x4C, 0x46, 0x03, 0x11, 0x80, 0xFF, 0xC0, +/* 0x80 */ 0x1C, 0x45, 0x07, 0xE4, 0x1F, 0x10, 0x10, 0x1E, +/* 0x81 */ +/* 0x82 */ 0xE0, +/* 0x83 */ +/* 0x84 */ 0xB6, 0x80, +/* 0x85 */ 0xA8, +/* 0x86 */ 0x21, 0x09, 0xF2, 0x10, 0x84, 0x21, 0x08, +/* 0x87 */ 0x21, 0x09, 0xF2, 0x10, 0x84, 0xF9, 0x08, +/* 0x88 */ +/* 0x89 */ 0x62, 0x09, 0x40, 0x98, 0x06, 0x80, 0x10, 0x01, 0x66, 0x29, 0x92, 0x99, 0x06, 0x60, +/* 0x8A */ 0x28, 0x47, 0xA1, 0x83, 0x07, 0x83, 0x87, 0x17, 0x80, +/* 0x8B */ 0x64, +/* 0x8C */ 0x10, 0x87, 0xA1, 0x83, 0x07, 0x83, 0x87, 0x17, 0x80, +/* 0x8D */ 0x28, 0x4F, 0xC4, 0x10, 0x41, 0x04, 0x10, 0x40, +/* 0x8E */ 0x14, 0x11, 0xF8, 0x30, 0xC1, 0x04, 0x18, 0x61, 0xFC, +/* 0x8F */ 0x08, 0x21, 0xF8, 0x30, 0xC1, 0x04, 0x18, 0x61, 0xFC, +/* 0x90 */ +/* 0x91 */ 0xE0, +/* 0x92 */ 0xE0, +/* 0x93 */ 0xB6, 0x80, +/* 0x94 */ 0xB6, 0x80, +/* 0x95 */ 0xFF, 0x80, +/* 0x96 */ 0xFC, +/* 0x97 */ 0xFF, 0xF0, +/* 0x98 */ +/* 0x99 */ 0xE6, 0x28, 0xCD, 0x19, 0xA3, 0x34, 0x6A, 0x8B, 0x51, 0x68, +/* 0x9A */ 0x52, 0x69, 0x8E, 0x19, 0x60, +/* 0x9B */ 0x98, +/* 0x9C */ 0x24, 0x06, 0x98, 0xE1, 0x96, +/* 0x9D */ 0x15, 0xE4, 0x44, 0x44, 0x60, +/* 0x9E */ 0x51, 0x00, 0xF0, 0x88, 0x8C, 0x47, 0xC0, +/* 0x9F */ 0x11, 0x00, 0xF0, 0x88, 0x8C, 0x47, 0xC0, +/* 0xA0 */ +/* 0xA1 */ 0xA8, +/* 0xA2 */ 0x96, +/* 0xA3 */ 0x41, 0x05, 0x18, 0x43, 0x04, 0x10, 0x7C, +/* 0xA4 */ 0xFC, 0x63, 0xF0, +/* 0xA5 */ 0x30, 0x38, 0x28, 0x48, 0x4C, 0x7C, 0x84, 0x86, 0x82, 0x04, 0x07, +/* 0xA6 */ 0xF9, 0xF0, +/* 0xA7 */ 0x32, 0x91, 0xC9, 0x47, 0x26, 0x14, 0xA4, 0xC0, +/* 0xA8 */ 0xA0, +/* 0xA9 */ 0x3E, 0x3F, 0xB8, 0xF4, 0x1A, 0x0D, 0x17, 0x76, 0xC6, 0x3E, 0x00, +/* 0xAA */ 0x7A, 0x18, 0x30, 0x78, 0x38, 0x61, 0x78, 0xC1, 0x0C, +/* 0xAB */ 0x5A, 0xA5, +/* 0xAC */ 0xFC, 0x10, 0x40, +/* 0xAD */ +/* 0xAE */ 0x3E, 0x31, 0xB7, 0x72, 0x99, 0xCC, 0xC7, 0x56, 0xC6, 0x3E, 0x00, +/* 0xAF */ 0x18, 0x31, 0xF8, 0x30, 0xC1, 0x04, 0x18, 0x61, 0xFC, +/* 0xB0 */ 0x69, 0x96, +/* 0xB1 */ 0x21, 0x3E, 0x42, 0x03, 0xE0, +/* 0xB2 */ 0x9C, +/* 0xB3 */ 0x49, 0x35, 0x92, 0x40, +/* 0xB4 */ 0x80, +/* 0xB5 */ 0x8A, 0x28, 0xA2, 0x8A, 0x6E, 0xE0, 0x80, +/* 0xB6 */ 0x7F, 0xAE, 0xBA, 0x68, 0xA2, 0x8A, 0x28, 0xA0, +/* 0xB7 */ 0x80, +/* 0xB8 */ 0x67, 0x80, +/* 0xB9 */ 0x78, 0x84, 0x04, 0x3C, 0xC4, 0x8C, 0x76, 0x04, 0x07, +/* 0xBA */ 0x69, 0x8E, 0x19, 0x66, 0x26, +/* 0xBB */ 0xA5, 0x5A, +/* 0xBC */ 0xA5, 0x21, 0x08, 0x42, 0x10, 0xF8, +/* 0xBD */ 0xA0, +/* 0xBE */ 0xBA, 0x49, 0x24, 0x90, +/* 0xBF */ 0x31, 0x9E, 0x11, 0x11, 0x88, 0xF8, +/* 0xC0 */ 0x10, 0x43, 0xE4, 0x28, 0x50, 0xBE, 0x42, 0x85, 0x0C, +/* 0xC1 */ 0x08, 0x10, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, +/* 0xC2 */ 0x18, 0x24, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, +/* 0xC3 */ 0x24, 0x18, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, +/* 0xC4 */ 0x24, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, +/* 0xC5 */ 0x11, 0x21, 0x08, 0x42, 0x10, 0x87, 0xC0, +/* 0xC6 */ 0x08, 0x20, 0x01, 0xE4, 0x30, 0x20, 0x40, 0x82, 0x8C, 0xF0, +/* 0xC7 */ 0x3E, 0x61, 0xC0, 0x80, 0x80, 0x80, 0xC1, 0x63, 0x3E, 0x0C, 0x04, 0x1C, +/* 0xC8 */ 0x28, 0x20, 0x01, 0xE4, 0x30, 0x20, 0x40, 0x82, 0x8C, 0xF0, +/* 0xC9 */ 0x08, 0x40, 0x3F, 0x82, 0x0F, 0xA0, 0x83, 0xF0, +/* 0xCA */ 0xFD, 0x02, 0x04, 0x0F, 0xD0, 0x20, 0x40, 0xFC, 0x10, 0x38, +/* 0xCB */ 0x28, 0x0F, 0xE0, 0x83, 0xE8, 0x20, 0x83, 0xF0, +/* 0xCC */ 0x28, 0x40, 0x3F, 0x82, 0x0F, 0xA0, 0x82, 0x0F, 0xC0, +/* 0xCD */ 0x62, 0xAA, 0xA0, +/* 0xCE */ 0x54, 0x24, 0x92, 0x48, +/* 0xCF */ 0x50, 0x43, 0xE4, 0x28, 0x30, 0x60, 0xC1, 0x85, 0xF0, +/* 0xD0 */ 0x7C, 0x42, 0x41, 0x41, 0xF1, 0x41, 0x41, 0x42, 0x7C, +/* 0xD1 */ 0x08, 0x23, 0x0F, 0x1B, 0x32, 0x66, 0xC7, 0x87, 0x04, +/* 0xD2 */ 0x28, 0x23, 0x0F, 0x1B, 0x32, 0x66, 0xC7, 0x87, 0x04, +/* 0xD3 */ 0x04, 0x04, 0x0F, 0x8C, 0x6C, 0x1C, 0x06, 0x03, 0x83, 0x63, 0x1F, 0x00, +/* 0xD4 */ 0x08, 0x0A, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, +/* 0xD5 */ 0x0A, 0x0A, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, +/* 0xD6 */ 0x14, 0x00, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, +/* 0xD7 */ 0x8A, 0x88, 0xA8, 0x80, +/* 0xD8 */ 0x50, 0x43, 0xE4, 0x28, 0x50, 0xBE, 0x42, 0x85, 0x0C, +/* 0xD9 */ 0x10, 0x52, 0x4C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, +/* 0xDA */ 0x08, 0x22, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, +/* 0xDB */ 0x14, 0x52, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, +/* 0xDC */ 0x29, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, +/* 0xDD */ 0x09, 0x25, 0x12, 0x22, 0x87, 0x04, 0x08, 0x10, 0x20, +/* 0xDE */ 0xFC, 0x41, 0x04, 0x10, 0x41, 0x04, 0x10, 0x60, 0x8E, +/* 0xDF */ 0x7A, 0x18, 0x61, 0x8A, 0x18, 0x61, 0xB8, +/* 0xE0 */ 0x42, 0xE9, 0x24, 0x80, +/* 0xE1 */ 0x10, 0x40, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, +/* 0xE2 */ 0x10, 0x50, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, +/* 0xE3 */ 0x48, 0x60, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, +/* 0xE4 */ 0x28, 0x01, 0xE4, 0x20, 0x47, 0xB1, 0x46, 0x76, +/* 0xE5 */ 0x62, 0xAA, 0xA0, +/* 0xE6 */ 0x10, 0x80, 0x1E, 0xC6, 0x08, 0x20, 0xC5, 0xE0, +/* 0xE7 */ 0x7B, 0x18, 0x20, 0x83, 0x17, 0x8C, 0x11, 0xC0, +/* 0xE8 */ 0x28, 0x40, 0x1E, 0xC6, 0x08, 0x20, 0xC5, 0xE0, +/* 0xE9 */ 0x10, 0x80, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, +/* 0xEA */ 0x7B, 0x38, 0x7F, 0x83, 0x37, 0x84, 0x1C, +/* 0xEB */ 0x28, 0x07, 0xB3, 0x87, 0xF8, 0x31, 0x78, +/* 0xEC */ 0x28, 0x40, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, +/* 0xED */ 0x62, 0xAA, 0xA0, +/* 0xEE */ 0x54, 0x24, 0x92, 0x48, +/* 0xEF */ 0x02, 0x0C, 0x13, 0xEC, 0xD0, 0xA1, 0x42, 0xCC, 0xE8, +/* 0xF0 */ 0x04, 0x1D, 0xD6, 0x68, 0x50, 0xA1, 0x66, 0x74, +/* 0xF1 */ 0x11, 0x01, 0x6C, 0xC6, 0x31, 0x8C, 0x40, +/* 0xF2 */ 0x20, 0x81, 0x6C, 0xC6, 0x31, 0x8C, 0x40, +/* 0xF3 */ 0x10, 0x80, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, +/* 0xF4 */ 0x10, 0xA0, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, +/* 0xF5 */ 0x29, 0x40, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, +/* 0xF6 */ 0x28, 0x07, 0xB3, 0x86, 0x18, 0x73, 0x78, +/* 0xF7 */ 0x20, 0x3E, 0x02, 0x00, +/* 0xF8 */ 0xA8, 0x5D, 0x24, 0x90, +/* 0xF9 */ 0x22, 0x89, 0x18, 0xC6, 0x31, 0x9B, 0x40, +/* 0xFA */ 0x11, 0x23, 0x18, 0xC6, 0x33, 0x68, +/* 0xFB */ 0x2A, 0x81, 0x18, 0xC6, 0x31, 0x9B, 0x40, +/* 0xFC */ 0x50, 0x23, 0x18, 0xC6, 0x33, 0x68, +/* 0xFD */ 0x10, 0x88, 0x52, 0x49, 0x23, 0x0C, 0x30, 0x82, 0x18, +/* 0xFE */ 0x4E, 0x44, 0x44, 0x46, 0x31, 0x70, +/* 0xFF */ 0x80, }; const GFXglyph FreeSans6pt_Win1250Glyphs[] PROGMEM = { - /* ' ' 0x20 */ {0, 0, 0, 3, 0, 0}, - /* '!' 0x21 */ {0, 1, 9, 4, 2, -8}, - /* '"' 0x22 */ {2, 3, 3, 4, 0, -8}, - /* '#' 0x23 */ {4, 7, 8, 7, 0, -7}, - /* '$' 0x24 */ {11, 6, 11, 7, 0, -9}, - /* '%' 0x25 */ {20, 10, 9, 11, 0, -8}, - /* '&' 0x26 */ {32, 6, 9, 8, 1, -8}, - /* ''' 0x27 */ {39, 1, 3, 2, 1, -8}, - /* '(' 0x28 */ {40, 2, 11, 4, 1, -8}, - /* ')' 0x29 */ {43, 3, 11, 4, 0, -8}, - /* '*' 0x2A */ {48, 3, 3, 5, 1, -8}, - /* '+' 0x2B */ {50, 5, 5, 7, 1, -4}, - /* ',' 0x2C */ {54, 1, 3, 3, 1, 0}, - /* '-' 0x2D */ {55, 2, 1, 4, 1, -3}, - /* '.' 0x2E */ {56, 1, 1, 3, 1, 0}, - /* '/' 0x2F */ {57, 3, 9, 3, 0, -8}, - /* '0' 0x30 */ {61, 5, 9, 7, 1, -8}, - /* '1' 0x31 */ {67, 3, 9, 7, 1, -8}, - /* '2' 0x32 */ {71, 6, 9, 7, 0, -8}, - /* '3' 0x33 */ {78, 6, 9, 7, 0, -8}, - /* '4' 0x34 */ {85, 6, 9, 7, 0, -8}, - /* '5' 0x35 */ {92, 5, 9, 7, 1, -8}, - /* '6' 0x36 */ {98, 5, 9, 7, 1, -8}, - /* '7' 0x37 */ {104, 5, 9, 7, 1, -8}, - /* '8' 0x38 */ {110, 6, 9, 7, 0, -8}, - /* '9' 0x39 */ {117, 6, 9, 7, 0, -8}, - /* ':' 0x3A */ {124, 1, 7, 3, 1, -6}, - /* ';' 0x3B */ {125, 1, 8, 3, 1, -5}, - /* '<' 0x3C */ {126, 5, 5, 7, 1, -4}, - /* '=' 0x3D */ {130, 5, 3, 7, 1, -3}, - /* '>' 0x3E */ {132, 5, 5, 7, 1, -4}, - /* '?' 0x3F */ {136, 5, 9, 7, 1, -8}, - /* '@' 0x40 */ {142, 11, 11, 12, 0, -8}, - /* 'A' 0x41 */ {158, 8, 9, 8, 0, -8}, - /* 'B' 0x42 */ {167, 6, 9, 8, 1, -8}, - /* 'C' 0x43 */ {174, 8, 9, 9, 0, -8}, - /* 'D' 0x44 */ {183, 7, 9, 8, 1, -8}, - /* 'E' 0x45 */ {191, 6, 9, 8, 1, -8}, - /* 'F' 0x46 */ {198, 6, 9, 7, 1, -8}, - /* 'G' 0x47 */ {205, 8, 9, 9, 0, -8}, - /* 'H' 0x48 */ {214, 7, 9, 9, 1, -8}, - /* 'I' 0x49 */ {222, 1, 9, 3, 1, -8}, - /* 'J' 0x4A */ {224, 5, 9, 6, 0, -8}, - /* 'K' 0x4B */ {230, 7, 9, 8, 1, -8}, - /* 'L' 0x4C */ {238, 5, 9, 7, 1, -8}, - /* 'M' 0x4D */ {244, 8, 9, 10, 1, -8}, - /* 'N' 0x4E */ {253, 7, 9, 9, 1, -8}, - /* 'O' 0x4F */ {261, 9, 9, 9, 0, -8}, - /* 'P' 0x50 */ {272, 6, 9, 8, 1, -8}, - /* 'Q' 0x51 */ {279, 9, 10, 9, 0, -8}, - /* 'R' 0x52 */ {291, 7, 9, 9, 1, -8}, - /* 'S' 0x53 */ {299, 6, 9, 8, 1, -8}, - /* 'T' 0x54 */ {306, 7, 9, 8, 0, -8}, - /* 'U' 0x55 */ {314, 7, 9, 9, 1, -8}, - /* 'V' 0x56 */ {322, 7, 9, 8, 0, -8}, - /* 'W' 0x57 */ {330, 11, 9, 11, 0, -8}, - /* 'X' 0x58 */ {343, 6, 9, 8, 1, -8}, - /* 'Y' 0x59 */ {350, 8, 9, 8, 0, -8}, - /* 'Z' 0x5A */ {359, 7, 9, 7, 0, -8}, - /* '[' 0x5B */ {367, 2, 12, 3, 1, -8}, - /* '\' 0x5C */ {370, 3, 9, 3, 0, -8}, - /* ']' 0x5D */ {374, 2, 12, 3, 0, -8}, - /* '^' 0x5E */ {377, 4, 4, 6, 1, -8}, - /* '_' 0x5F */ {379, 7, 1, 7, 0, 2}, - /* '`' 0x60 */ {380, 1, 1, 3, 1, -8}, - /* 'a' 0x61 */ {381, 6, 7, 7, 0, -6}, - /* 'b' 0x62 */ {387, 5, 9, 7, 1, -8}, - /* 'c' 0x63 */ {393, 6, 7, 6, 0, -6}, - /* 'd' 0x64 */ {399, 6, 9, 7, 0, -8}, - /* 'e' 0x65 */ {406, 6, 7, 6, 0, -6}, - /* 'f' 0x66 */ {412, 3, 9, 3, 0, -8}, - /* 'g' 0x67 */ {416, 6, 10, 7, 0, -6}, - /* 'h' 0x68 */ {424, 5, 9, 6, 1, -8}, - /* 'i' 0x69 */ {430, 1, 9, 3, 1, -8}, - /* 'j' 0x6A */ {432, 2, 12, 3, 0, -8}, - /* 'k' 0x6B */ {435, 5, 9, 6, 1, -8}, - /* 'l' 0x6C */ {441, 1, 9, 3, 1, -8}, - /* 'm' 0x6D */ {443, 8, 7, 10, 1, -6}, - /* 'n' 0x6E */ {450, 5, 7, 6, 1, -6}, - /* 'o' 0x6F */ {455, 6, 7, 6, 0, -6}, - /* 'p' 0x70 */ {461, 5, 9, 7, 1, -6}, - /* 'q' 0x71 */ {467, 6, 9, 7, 0, -6}, - /* 'r' 0x72 */ {474, 3, 7, 4, 1, -6}, - /* 's' 0x73 */ {477, 5, 7, 6, 0, -6}, - /* 't' 0x74 */ {482, 3, 8, 3, 0, -7}, - /* 'u' 0x75 */ {485, 5, 7, 6, 1, -6}, - /* 'v' 0x76 */ {490, 6, 7, 6, 0, -6}, - /* 'w' 0x77 */ {496, 8, 7, 9, 0, -6}, - /* 'x' 0x78 */ {503, 5, 7, 6, 0, -6}, - /* 'y' 0x79 */ {508, 5, 10, 6, 0, -6}, - /* 'z' 0x7A */ {515, 5, 7, 6, 0, -6}, - /* '{' 0x7B */ {520, 2, 12, 4, 1, -8}, - /* '|' 0x7C */ {523, 1, 11, 3, 1, -8}, - /* '}' 0x7D */ {525, 2, 12, 4, 1, -8}, - /* '~' 0x7E */ {528, 6, 2, 6, 0, -4}, - /* 0x7F */ {530, 9, 10, 11, 1, -8}, - /* 0x80 */ {542, 7, 9, 8, 0, -8}, - /* 0x81 */ {550, 0, 0, 8, 0, 0}, - /* 0x82 */ {550, 1, 3, 3, 1, 0}, - /* 0x83 */ {551, 0, 0, 8, 0, 0}, - /* 0x84 */ {551, 3, 3, 5, 1, 0}, - /* 0x85 */ {553, 5, 1, 7, 1, 0}, - /* 0x86 */ {554, 5, 11, 7, 1, -8}, - /* 0x87 */ {561, 5, 11, 7, 1, -8}, - /* 0x88 */ {568, 0, 0, 8, 0, 0}, - /* 0x89 */ {568, 12, 9, 12, 0, -8}, - /* 0x8A */ {582, 6, 11, 8, 1, -9}, - /* 0x8B */ {591, 2, 3, 4, 1, -4}, - /* 0x8C */ {592, 6, 11, 8, 1, -10}, - /* 0x8D */ {601, 6, 10, 8, 0, -9}, - /* 0x8E */ {609, 7, 10, 7, 0, -9}, - /* 0x8F */ {618, 7, 10, 7, 0, -9}, - /* 0x90 */ {627, 0, 0, 8, 0, 0}, - /* 0x91 */ {627, 1, 3, 3, 1, -8}, - /* 0x92 */ {628, 1, 3, 2, 1, -8}, - /* 0x93 */ {629, 3, 3, 5, 1, -8}, - /* 0x94 */ {631, 3, 3, 5, 1, -8}, - /* 0x95 */ {633, 3, 3, 5, 1, -5}, - /* 0x96 */ {635, 6, 1, 6, 0, -3}, - /* 0x97 */ {636, 12, 1, 12, 0, -3}, - /* 0x98 */ {638, 0, 0, 8, 0, 0}, - /* 0x99 */ {638, 11, 7, 12, 1, -8}, - /* 0x9A */ {648, 4, 9, 6, 1, -8}, - /* 0x9B */ {653, 2, 3, 3, 1, -4}, - /* 0x9C */ {654, 4, 10, 6, 1, -9}, - /* 0x9D */ {659, 4, 9, 5, 0, -8}, - /* 0x9E */ {664, 5, 10, 6, 0, -9}, - /* 0x9F */ {671, 5, 10, 6, 0, -9}, - /* 0xA0 */ {678, 0, 0, 3, 0, 0}, - /* 0xA1 */ {678, 3, 2, 4, 0, -8}, - /* 0xA2 */ {679, 4, 2, 4, 0, -8}, - /* 0xA3 */ {680, 6, 9, 7, 0, -8}, - /* 0xA4 */ {687, 5, 4, 7, 1, -5}, - /* 0xA5 */ {690, 8, 11, 8, 1, -8}, - /* 0xA6 */ {701, 1, 12, 3, 1, -8}, - /* 0xA7 */ {703, 5, 12, 7, 1, -8}, - /* 0xA8 */ {711, 3, 1, 4, 0, -7}, - /* 0xA9 */ {712, 9, 9, 10, 0, -8}, - /* 0xAA */ {723, 6, 12, 8, 1, -8}, - /* 0xAB */ {732, 4, 4, 6, 1, -4}, - /* 0xAC */ {734, 6, 3, 7, 1, -4}, - /* 0xAD */ {737, 0, 0, 0, 0, 0}, - /* 0xAE */ {737, 9, 9, 10, 0, -8}, - /* 0xAF */ {748, 7, 10, 7, 0, -9}, - /* 0xB0 */ {757, 4, 4, 7, 2, -8}, - /* 0xB1 */ {759, 5, 7, 7, 1, -6}, - /* 0xB2 */ {764, 3, 2, 4, 1, 1}, - /* 0xB3 */ {765, 3, 9, 3, 0, -8}, - /* 0xB4 */ {769, 1, 1, 4, 1, -8}, - /* 0xB5 */ {770, 6, 9, 7, 1, -6}, - /* 0xB6 */ {777, 6, 10, 6, 1, -8}, - /* 0xB7 */ {785, 1, 1, 3, 1, -2}, - /* 0xB8 */ {786, 3, 3, 4, 1, 1}, - /* 0xB9 */ {788, 8, 9, 7, 0, -6}, - /* 0xBA */ {797, 4, 10, 6, 1, -6}, - /* 0xBB */ {802, 4, 4, 6, 1, -5}, - /* 0xBC */ {804, 5, 9, 7, 1, -8}, - /* 0xBD */ {810, 3, 1, 4, 0, -8}, - /* 0xBE */ {811, 3, 10, 3, 1, -9}, - /* 0xBF */ {815, 5, 9, 6, 0, -8}, - /* 0xC0 */ {821, 7, 10, 9, 1, -9}, - /* 0xC1 */ {830, 8, 10, 8, 0, -9}, - /* 0xC2 */ {840, 8, 10, 8, 0, -9}, - /* 0xC3 */ {850, 8, 10, 8, 0, -9}, - /* 0xC4 */ {860, 8, 10, 8, 0, -9}, - /* 0xC5 */ {870, 5, 10, 7, 1, -9}, - /* 0xC6 */ {877, 7, 11, 9, 0, -10}, - /* 0xC7 */ {887, 8, 12, 9, 0, -8}, - /* 0xC8 */ {899, 7, 11, 9, 0, -10}, - /* 0xC9 */ {909, 6, 10, 8, 1, -9}, - /* 0xCA */ {917, 7, 11, 8, 1, -8}, - /* 0xCB */ {927, 6, 10, 8, 1, -9}, - /* 0xCC */ {935, 6, 11, 8, 1, -10}, - /* 0xCD */ {944, 2, 10, 3, 1, -9}, - /* 0xCE */ {947, 3, 10, 4, 0, -9}, - /* 0xCF */ {951, 7, 10, 8, 1, -9}, - /* 0xD0 */ {960, 8, 9, 8, 0, -8}, - /* 0xD1 */ {969, 7, 10, 9, 1, -9}, - /* 0xD2 */ {978, 7, 10, 9, 1, -9}, - /* 0xD3 */ {987, 9, 10, 9, 0, -9}, - /* 0xD4 */ {999, 9, 11, 9, 0, -10}, - /* 0xD5 */ {1012, 9, 11, 9, 0, -10}, - /* 0xD6 */ {1025, 9, 11, 9, 0, -10}, - /* 0xD7 */ {1038, 5, 5, 7, 1, -5}, - /* 0xD8 */ {1042, 7, 10, 9, 1, -9}, - /* 0xD9 */ {1051, 7, 10, 9, 1, -9}, - /* 0xDA */ {1060, 7, 10, 9, 1, -9}, - /* 0xDB */ {1069, 7, 10, 9, 1, -9}, - /* 0xDC */ {1078, 7, 10, 9, 1, -9}, - /* 0xDD */ {1087, 7, 10, 8, 1, -9}, - /* 0xDE */ {1096, 6, 12, 7, 0, -8}, - /* 0xDF */ {1105, 6, 9, 7, 1, -8}, - /* 0xE0 */ {1112, 3, 9, 4, 1, -8}, - /* 0xE1 */ {1116, 7, 10, 7, 0, -9}, - /* 0xE2 */ {1125, 7, 10, 7, 0, -9}, - /* 0xE3 */ {1134, 7, 10, 7, 0, -9}, - /* 0xE4 */ {1143, 7, 9, 7, 0, -8}, - /* 0xE5 */ {1151, 2, 10, 3, 1, -9}, - /* 0xE6 */ {1154, 6, 10, 6, 0, -9}, - /* 0xE7 */ {1162, 6, 10, 6, 0, -6}, - /* 0xE8 */ {1170, 6, 10, 6, 0, -9}, - /* 0xE9 */ {1178, 6, 10, 6, 0, -9}, - /* 0xEA */ {1186, 6, 9, 6, 0, -6}, - /* 0xEB */ {1193, 6, 9, 6, 0, -8}, - /* 0xEC */ {1200, 6, 10, 6, 0, -9}, - /* 0xED */ {1208, 2, 10, 3, 1, -9}, - /* 0xEE */ {1211, 3, 10, 3, 0, -9}, - /* 0xEF */ {1215, 7, 10, 7, 0, -9}, - /* 0xF0 */ {1224, 7, 9, 7, 0, -8}, - /* 0xF1 */ {1232, 5, 10, 6, 1, -9}, - /* 0xF2 */ {1239, 5, 10, 6, 1, -9}, - /* 0xF3 */ {1246, 6, 10, 6, 0, -9}, - /* 0xF4 */ {1254, 6, 10, 6, 0, -9}, - /* 0xF5 */ {1262, 6, 10, 6, 0, -9}, - /* 0xF6 */ {1270, 6, 9, 6, 0, -8}, - /* 0xF7 */ {1277, 5, 5, 7, 1, -5}, - /* 0xF8 */ {1281, 3, 10, 4, 1, -9}, - /* 0xF9 */ {1285, 5, 10, 6, 1, -9}, - /* 0xFA */ {1292, 5, 9, 6, 1, -8}, - /* 0xFB */ {1298, 5, 10, 6, 1, -9}, - /* 0xFC */ {1305, 5, 9, 6, 1, -8}, - /* 0xFD */ {1311, 6, 12, 6, 0, -8}, - /* 0xFE */ {1320, 4, 11, 3, 0, -7}, - /* 0xFF */ {1326, 1, 1, 4, 1, -7}, +/* 0x01 */ { 0, 9, 10, 11, 1, -9 }, +/* 0x02 */ { 12, 9, 10, 11, 1, -8 }, +/* 0x03 */ { 24, 10, 10, 12, 1, -8 }, +/* 0x04 */ { 37, 10, 10, 12, 1, -8 }, +/* 0x05 */ { 50, 10, 10, 12, 1, -9 }, +/* 0x06 */ { 63, 11, 11, 13, 1, -9 }, +/* 0x07 */ { 79, 0, 0, 8, 0, 0 }, +/* 0x08 */ { 79, 12, 9, 14, 1, -8 }, +/* 0x09 */ { 93, 14, 8, 16, 1, -7 }, +/* 0x0A */ { 107, 0, 0, 8, 0, 0 }, +/* 0x0B */ { 107, 9, 10, 11, 1, -9 }, +/* 0x0C */ { 119, 13, 9, 15, 1, -8 }, +/* 0x0D */ { 134, 0, 0, 8, 0, 0 }, +/* 0x0E */ { 134, 9, 11, 11, 1, -9 }, +/* 0x0F */ { 147, 10, 10, 12, 1, -9 }, +/* 0x10 */ { 160, 11, 10, 13, 1, -9 }, +/* 0x11 */ { 174, 13, 10, 15, 1, -9 }, +/* 0x12 */ { 191, 10, 10, 12, 1, -9 }, +/* 0x13 */ { 204, 11, 10, 13, 1, -9 }, +/* 0x14 */ { 218, 10, 10, 12, 1, -9 }, +/* 0x15 */ { 231, 14, 10, 16, 1, -9 }, +/* 0x16 */ { 249, 8, 10, 10, 1, -9 }, +/* 0x17 */ { 259, 12, 10, 14, 1, -9 }, +/* 0x18 */ { 274, 13, 10, 15, 1, -9 }, +/* 0x19 */ { 291, 12, 10, 14, 1, -9 }, +/* 0x1A */ { 306, 9, 10, 11, 1, -8 }, +/* 0x1B */ { 318, 14, 10, 16, 1, -9 }, +/* 0x1C */ { 336, 11, 10, 13, 1, -9 }, +/* 0x1D */ { 350, 11, 10, 13, 1, -9 }, +/* 0x1E */ { 364, 12, 10, 14, 1, -9 }, +/* 0x1F */ { 379, 8, 10, 11, 2, -9 }, +/* ' ' 0x20 */ { 389, 0, 0, 3, 0, 0 }, +/* '!' 0x21 */ { 389, 1, 9, 4, 2, -8 }, +/* '"' 0x22 */ { 391, 3, 3, 4, 0, -8 }, +/* '#' 0x23 */ { 393, 7, 8, 7, 0, -7 }, +/* '$' 0x24 */ { 400, 6, 11, 7, 0, -9 }, +/* '%' 0x25 */ { 409, 10, 9, 11, 0, -8 }, +/* '&' 0x26 */ { 421, 6, 9, 8, 1, -8 }, +/* ''' 0x27 */ { 428, 1, 3, 2, 1, -8 }, +/* '(' 0x28 */ { 429, 2, 11, 4, 1, -8 }, +/* ')' 0x29 */ { 432, 3, 11, 4, 0, -8 }, +/* '*' 0x2A */ { 437, 3, 3, 5, 1, -8 }, +/* '+' 0x2B */ { 439, 5, 5, 7, 1, -4 }, +/* ',' 0x2C */ { 443, 1, 3, 3, 1, 0 }, +/* '-' 0x2D */ { 444, 2, 1, 4, 1, -3 }, +/* '.' 0x2E */ { 445, 1, 1, 3, 1, 0 }, +/* '/' 0x2F */ { 446, 3, 9, 3, 0, -8 }, +/* '0' 0x30 */ { 450, 5, 9, 7, 1, -8 }, +/* '1' 0x31 */ { 456, 3, 9, 7, 1, -8 }, +/* '2' 0x32 */ { 460, 6, 9, 7, 0, -8 }, +/* '3' 0x33 */ { 467, 6, 9, 7, 0, -8 }, +/* '4' 0x34 */ { 474, 6, 9, 7, 0, -8 }, +/* '5' 0x35 */ { 481, 5, 9, 7, 1, -8 }, +/* '6' 0x36 */ { 487, 5, 9, 7, 1, -8 }, +/* '7' 0x37 */ { 493, 5, 9, 7, 1, -8 }, +/* '8' 0x38 */ { 499, 6, 9, 7, 0, -8 }, +/* '9' 0x39 */ { 506, 6, 9, 7, 0, -8 }, +/* ':' 0x3A */ { 513, 1, 7, 3, 1, -6 }, +/* ';' 0x3B */ { 514, 1, 8, 3, 1, -5 }, +/* '<' 0x3C */ { 515, 5, 5, 7, 1, -4 }, +/* '=' 0x3D */ { 519, 5, 3, 7, 1, -3 }, +/* '>' 0x3E */ { 521, 5, 5, 7, 1, -4 }, +/* '?' 0x3F */ { 525, 5, 9, 7, 1, -8 }, +/* '@' 0x40 */ { 531, 11, 11, 12, 0, -8 }, +/* 'A' 0x41 */ { 547, 8, 9, 8, 0, -8 }, +/* 'B' 0x42 */ { 556, 6, 9, 8, 1, -8 }, +/* 'C' 0x43 */ { 563, 8, 9, 9, 0, -8 }, +/* 'D' 0x44 */ { 572, 7, 9, 8, 1, -8 }, +/* 'E' 0x45 */ { 580, 6, 9, 8, 1, -8 }, +/* 'F' 0x46 */ { 587, 6, 9, 7, 1, -8 }, +/* 'G' 0x47 */ { 594, 8, 9, 9, 0, -8 }, +/* 'H' 0x48 */ { 603, 7, 9, 9, 1, -8 }, +/* 'I' 0x49 */ { 611, 1, 9, 3, 1, -8 }, +/* 'J' 0x4A */ { 613, 5, 9, 6, 0, -8 }, +/* 'K' 0x4B */ { 619, 7, 9, 8, 1, -8 }, +/* 'L' 0x4C */ { 627, 5, 9, 7, 1, -8 }, +/* 'M' 0x4D */ { 633, 8, 9, 10, 1, -8 }, +/* 'N' 0x4E */ { 642, 7, 9, 9, 1, -8 }, +/* 'O' 0x4F */ { 650, 9, 9, 9, 0, -8 }, +/* 'P' 0x50 */ { 661, 6, 9, 8, 1, -8 }, +/* 'Q' 0x51 */ { 668, 9, 10, 9, 0, -8 }, +/* 'R' 0x52 */ { 680, 7, 9, 9, 1, -8 }, +/* 'S' 0x53 */ { 688, 6, 9, 8, 1, -8 }, +/* 'T' 0x54 */ { 695, 7, 9, 8, 0, -8 }, +/* 'U' 0x55 */ { 703, 7, 9, 9, 1, -8 }, +/* 'V' 0x56 */ { 711, 7, 9, 8, 0, -8 }, +/* 'W' 0x57 */ { 719, 11, 9, 11, 0, -8 }, +/* 'X' 0x58 */ { 732, 6, 9, 8, 1, -8 }, +/* 'Y' 0x59 */ { 739, 8, 9, 8, 0, -8 }, +/* 'Z' 0x5A */ { 748, 7, 9, 7, 0, -8 }, +/* '[' 0x5B */ { 756, 2, 12, 3, 1, -8 }, +/* '\' 0x5C */ { 759, 3, 9, 3, 0, -8 }, +/* ']' 0x5D */ { 763, 2, 12, 3, 0, -8 }, +/* '^' 0x5E */ { 766, 4, 4, 6, 1, -8 }, +/* '_' 0x5F */ { 768, 7, 1, 7, 0, 2 }, +/* '`' 0x60 */ { 769, 1, 1, 3, 1, -8 }, +/* 'a' 0x61 */ { 770, 6, 7, 7, 0, -6 }, +/* 'b' 0x62 */ { 776, 5, 9, 7, 1, -8 }, +/* 'c' 0x63 */ { 782, 6, 7, 6, 0, -6 }, +/* 'd' 0x64 */ { 788, 6, 9, 7, 0, -8 }, +/* 'e' 0x65 */ { 795, 6, 7, 6, 0, -6 }, +/* 'f' 0x66 */ { 801, 3, 9, 3, 0, -8 }, +/* 'g' 0x67 */ { 805, 6, 10, 7, 0, -6 }, +/* 'h' 0x68 */ { 813, 5, 9, 6, 1, -8 }, +/* 'i' 0x69 */ { 819, 1, 9, 3, 1, -8 }, +/* 'j' 0x6A */ { 821, 2, 12, 3, 0, -8 }, +/* 'k' 0x6B */ { 824, 5, 9, 6, 1, -8 }, +/* 'l' 0x6C */ { 830, 1, 9, 3, 1, -8 }, +/* 'm' 0x6D */ { 832, 8, 7, 10, 1, -6 }, +/* 'n' 0x6E */ { 839, 5, 7, 6, 1, -6 }, +/* 'o' 0x6F */ { 844, 6, 7, 6, 0, -6 }, +/* 'p' 0x70 */ { 850, 5, 9, 7, 1, -6 }, +/* 'q' 0x71 */ { 856, 6, 9, 7, 0, -6 }, +/* 'r' 0x72 */ { 863, 3, 7, 4, 1, -6 }, +/* 's' 0x73 */ { 866, 5, 7, 6, 0, -6 }, +/* 't' 0x74 */ { 871, 3, 8, 3, 0, -7 }, +/* 'u' 0x75 */ { 874, 5, 7, 6, 1, -6 }, +/* 'v' 0x76 */ { 879, 6, 7, 6, 0, -6 }, +/* 'w' 0x77 */ { 885, 8, 7, 9, 0, -6 }, +/* 'x' 0x78 */ { 892, 5, 7, 6, 0, -6 }, +/* 'y' 0x79 */ { 897, 5, 10, 6, 0, -6 }, +/* 'z' 0x7A */ { 904, 5, 7, 6, 0, -6 }, +/* '{' 0x7B */ { 909, 2, 12, 4, 1, -8 }, +/* '|' 0x7C */ { 912, 1, 11, 3, 1, -8 }, +/* '}' 0x7D */ { 914, 2, 12, 4, 1, -8 }, +/* '~' 0x7E */ { 917, 6, 2, 6, 0, -4 }, +/* 0x7F */ { 919, 9, 10, 0, 1, -8 }, +/* 0x80 */ { 931, 7, 9, 8, 0, -8 }, +/* 0x81 */ { 939, 0, 0, 8, 0, 0 }, +/* 0x82 */ { 939, 1, 3, 3, 1, 0 }, +/* 0x83 */ { 940, 0, 0, 8, 0, 0 }, +/* 0x84 */ { 940, 3, 3, 5, 1, 0 }, +/* 0x85 */ { 942, 5, 1, 7, 1, 0 }, +/* 0x86 */ { 943, 5, 11, 7, 1, -8 }, +/* 0x87 */ { 950, 5, 11, 7, 1, -8 }, +/* 0x88 */ { 957, 0, 0, 8, 0, 0 }, +/* 0x89 */ { 957, 12, 9, 12, 0, -8 }, +/* 0x8A */ { 971, 6, 11, 8, 1, -9 }, +/* 0x8B */ { 980, 2, 3, 4, 1, -4 }, +/* 0x8C */ { 981, 6, 11, 8, 1, -10 }, +/* 0x8D */ { 990, 6, 10, 8, 0, -9 }, +/* 0x8E */ { 998, 7, 10, 7, 0, -9 }, +/* 0x8F */ { 1007, 7, 10, 7, 0, -9 }, +/* 0x90 */ { 1016, 0, 0, 8, 0, 0 }, +/* 0x91 */ { 1016, 1, 3, 3, 1, -8 }, +/* 0x92 */ { 1017, 1, 3, 2, 1, -8 }, +/* 0x93 */ { 1018, 3, 3, 5, 1, -8 }, +/* 0x94 */ { 1020, 3, 3, 5, 1, -8 }, +/* 0x95 */ { 1022, 3, 3, 5, 1, -5 }, +/* 0x96 */ { 1024, 6, 1, 6, 0, -3 }, +/* 0x97 */ { 1025, 12, 1, 12, 0, -3 }, +/* 0x98 */ { 1027, 0, 0, 8, 0, 0 }, +/* 0x99 */ { 1027, 11, 7, 12, 1, -8 }, +/* 0x9A */ { 1037, 4, 9, 6, 1, -8 }, +/* 0x9B */ { 1042, 2, 3, 3, 1, -4 }, +/* 0x9C */ { 1043, 4, 10, 6, 1, -9 }, +/* 0x9D */ { 1048, 4, 9, 5, 0, -8 }, +/* 0x9E */ { 1053, 5, 10, 6, 0, -9 }, +/* 0x9F */ { 1060, 5, 10, 6, 0, -9 }, +/* 0xA0 */ { 1067, 0, 0, 3, 0, 0 }, +/* 0xA1 */ { 1067, 3, 2, 4, 0, -8 }, +/* 0xA2 */ { 1068, 4, 2, 4, 0, -8 }, +/* 0xA3 */ { 1069, 6, 9, 7, 0, -8 }, +/* 0xA4 */ { 1076, 5, 4, 7, 1, -5 }, +/* 0xA5 */ { 1079, 8, 11, 8, 1, -8 }, +/* 0xA6 */ { 1090, 1, 12, 3, 1, -8 }, +/* 0xA7 */ { 1092, 5, 12, 7, 1, -8 }, +/* 0xA8 */ { 1100, 3, 1, 4, 0, -7 }, +/* 0xA9 */ { 1101, 9, 9, 10, 0, -8 }, +/* 0xAA */ { 1112, 6, 12, 8, 1, -8 }, +/* 0xAB */ { 1121, 4, 4, 6, 1, -4 }, +/* 0xAC */ { 1123, 6, 3, 7, 1, -4 }, +/* 0xAD */ { 1126, 0, 0, 0, 0, 0 }, +/* 0xAE */ { 1126, 9, 9, 10, 0, -8 }, +/* 0xAF */ { 1137, 7, 10, 7, 0, -9 }, +/* 0xB0 */ { 1146, 4, 4, 7, 2, -8 }, +/* 0xB1 */ { 1148, 5, 7, 7, 1, -6 }, +/* 0xB2 */ { 1153, 3, 2, 4, 1, 1 }, +/* 0xB3 */ { 1154, 3, 9, 3, 0, -8 }, +/* 0xB4 */ { 1158, 1, 1, 4, 1, -8 }, +/* 0xB5 */ { 1159, 6, 9, 7, 1, -6 }, +/* 0xB6 */ { 1166, 6, 10, 6, 1, -8 }, +/* 0xB7 */ { 1174, 1, 1, 3, 1, -2 }, +/* 0xB8 */ { 1175, 3, 3, 4, 1, 1 }, +/* 0xB9 */ { 1177, 8, 9, 7, 0, -6 }, +/* 0xBA */ { 1186, 4, 10, 6, 1, -6 }, +/* 0xBB */ { 1191, 4, 4, 6, 1, -5 }, +/* 0xBC */ { 1193, 5, 9, 7, 1, -8 }, +/* 0xBD */ { 1199, 3, 1, 4, 0, -8 }, +/* 0xBE */ { 1200, 3, 10, 3, 1, -9 }, +/* 0xBF */ { 1204, 5, 9, 6, 0, -8 }, +/* 0xC0 */ { 1210, 7, 10, 9, 1, -9 }, +/* 0xC1 */ { 1219, 8, 10, 8, 0, -9 }, +/* 0xC2 */ { 1229, 8, 10, 8, 0, -9 }, +/* 0xC3 */ { 1239, 8, 10, 8, 0, -9 }, +/* 0xC4 */ { 1249, 8, 10, 8, 0, -9 }, +/* 0xC5 */ { 1259, 5, 10, 7, 1, -9 }, +/* 0xC6 */ { 1266, 7, 11, 9, 0, -10 }, +/* 0xC7 */ { 1276, 8, 12, 9, 0, -8 }, +/* 0xC8 */ { 1288, 7, 11, 9, 0, -10 }, +/* 0xC9 */ { 1298, 6, 10, 8, 1, -9 }, +/* 0xCA */ { 1306, 7, 11, 8, 1, -8 }, +/* 0xCB */ { 1316, 6, 10, 8, 1, -9 }, +/* 0xCC */ { 1324, 6, 11, 8, 1, -10 }, +/* 0xCD */ { 1333, 2, 10, 3, 1, -9 }, +/* 0xCE */ { 1336, 3, 10, 4, 0, -9 }, +/* 0xCF */ { 1340, 7, 10, 8, 1, -9 }, +/* 0xD0 */ { 1349, 8, 9, 8, 0, -8 }, +/* 0xD1 */ { 1358, 7, 10, 9, 1, -9 }, +/* 0xD2 */ { 1367, 7, 10, 9, 1, -9 }, +/* 0xD3 */ { 1376, 9, 10, 9, 0, -9 }, +/* 0xD4 */ { 1388, 9, 11, 9, 0, -10 }, +/* 0xD5 */ { 1401, 9, 11, 9, 0, -10 }, +/* 0xD6 */ { 1414, 9, 11, 9, 0, -10 }, +/* 0xD7 */ { 1427, 5, 5, 7, 1, -5 }, +/* 0xD8 */ { 1431, 7, 10, 9, 1, -9 }, +/* 0xD9 */ { 1440, 7, 10, 9, 1, -9 }, +/* 0xDA */ { 1449, 7, 10, 9, 1, -9 }, +/* 0xDB */ { 1458, 7, 10, 9, 1, -9 }, +/* 0xDC */ { 1467, 7, 10, 9, 1, -9 }, +/* 0xDD */ { 1476, 7, 10, 8, 1, -9 }, +/* 0xDE */ { 1485, 6, 12, 7, 0, -8 }, +/* 0xDF */ { 1494, 6, 9, 7, 1, -8 }, +/* 0xE0 */ { 1501, 3, 9, 4, 1, -8 }, +/* 0xE1 */ { 1505, 7, 10, 7, 0, -9 }, +/* 0xE2 */ { 1514, 7, 10, 7, 0, -9 }, +/* 0xE3 */ { 1523, 7, 10, 7, 0, -9 }, +/* 0xE4 */ { 1532, 7, 9, 7, 0, -8 }, +/* 0xE5 */ { 1540, 2, 10, 3, 1, -9 }, +/* 0xE6 */ { 1543, 6, 10, 6, 0, -9 }, +/* 0xE7 */ { 1551, 6, 10, 6, 0, -6 }, +/* 0xE8 */ { 1559, 6, 10, 6, 0, -9 }, +/* 0xE9 */ { 1567, 6, 10, 6, 0, -9 }, +/* 0xEA */ { 1575, 6, 9, 6, 0, -6 }, +/* 0xEB */ { 1582, 6, 9, 6, 0, -8 }, +/* 0xEC */ { 1589, 6, 10, 6, 0, -9 }, +/* 0xED */ { 1597, 2, 10, 3, 1, -9 }, +/* 0xEE */ { 1600, 3, 10, 3, 0, -9 }, +/* 0xEF */ { 1604, 7, 10, 7, 0, -9 }, +/* 0xF0 */ { 1613, 7, 9, 7, 0, -8 }, +/* 0xF1 */ { 1621, 5, 10, 6, 1, -9 }, +/* 0xF2 */ { 1628, 5, 10, 6, 1, -9 }, +/* 0xF3 */ { 1635, 6, 10, 6, 0, -9 }, +/* 0xF4 */ { 1643, 6, 10, 6, 0, -9 }, +/* 0xF5 */ { 1651, 6, 10, 6, 0, -9 }, +/* 0xF6 */ { 1659, 6, 9, 6, 0, -8 }, +/* 0xF7 */ { 1666, 5, 5, 7, 1, -5 }, +/* 0xF8 */ { 1670, 3, 10, 4, 1, -9 }, +/* 0xF9 */ { 1674, 5, 10, 6, 1, -9 }, +/* 0xFA */ { 1681, 5, 9, 6, 1, -8 }, +/* 0xFB */ { 1687, 5, 10, 6, 1, -9 }, +/* 0xFC */ { 1694, 5, 9, 6, 1, -8 }, +/* 0xFD */ { 1700, 6, 12, 6, 0, -8 }, +/* 0xFE */ { 1709, 4, 11, 3, 0, -7 }, +/* 0xFF */ { 1715, 1, 1, 4, 1, -7 }, }; -const GFXfont FreeSans6pt_Win1250 PROGMEM = {(uint8_t *)FreeSans6pt_Win1250Bitmaps, (GFXglyph *)FreeSans6pt_Win1250Glyphs, 0x20, - 0xFF, 14}; +const GFXfont FreeSans6pt_Win1250 PROGMEM = { +(uint8_t*)FreeSans6pt_Win1250Bitmaps, +(GFXglyph*)FreeSans6pt_Win1250Glyphs, +0x01, 0xFF, 14 +}; diff --git a/src/graphics/niche/Fonts/FreeSans6pt_Win1251.h b/src/graphics/niche/Fonts/FreeSans6pt_Win1251.h index 4d3ad1705..8fe505fbd 100644 --- a/src/graphics/niche/Fonts/FreeSans6pt_Win1251.h +++ b/src/graphics/niche/Fonts/FreeSans6pt_Win1251.h @@ -1,457 +1,527 @@ +// trunk-ignore-all(clang-format) #pragma once +/* PROPERTIES + +FONT_NAME FreeSans6pt_Win1251 +*/ const uint8_t FreeSans6pt_Win1251Bitmaps[] PROGMEM = { - /* ' ' 0x20 */ - 0xFC, 0x80, /* '!' 0x21 */ - 0xB6, 0x80, /* '"' 0x22 */ - 0x24, 0x51, 0xF9, 0x42, 0x9F, 0x92, 0x28, /* '#' 0x23 */ - 0x10, 0xE5, 0x55, 0x50, 0xE1, 0x65, 0x55, 0xE1, 0x00, /* '$' 0x24 */ - 0x71, 0x24, 0x89, 0x22, 0x50, 0x74, 0x02, 0x70, 0xA4, 0x49, 0x11, 0xC0, /* '%' 0x25 */ - 0x71, 0x24, 0x9C, 0x62, 0x58, 0xA7, 0xF4, /* '&' 0x26 */ - 0xE0, /* ''' 0x27 */ - 0x5A, 0xAA, 0x94, /* '(' 0x28 */ - 0x89, 0x12, 0x49, 0x29, 0x00, /* ')' 0x29 */ - 0x5E, 0x80, /* '*' 0x2A */ - 0x21, 0x3E, 0x42, 0x00, /* '+' 0x2B */ - 0xE0, /* ',' 0x2C */ - 0xC0, /* '-' 0x2D */ - 0x80, /* '.' 0x2E */ - 0x24, 0xA4, 0xA4, 0x80, /* '/' 0x2F */ - 0x76, 0xE3, 0x18, 0xC6, 0x3B, 0x70, /* '0' 0x30 */ - 0x27, 0x92, 0x49, 0x20, /* '1' 0x31 */ - 0x79, 0x10, 0x41, 0x08, 0xC6, 0x10, 0xFC, /* '2' 0x32 */ - 0x79, 0x30, 0x43, 0x18, 0x10, 0x71, 0x78, /* '3' 0x33 */ - 0x08, 0x61, 0x8A, 0x49, 0x2F, 0xC2, 0x08, /* '4' 0x34 */ - 0xFC, 0x21, 0xE8, 0x84, 0x31, 0xF0, /* '5' 0x35 */ - 0x74, 0x61, 0xE8, 0xC6, 0x31, 0x70, /* '6' 0x36 */ - 0xF8, 0x44, 0x22, 0x11, 0x08, 0x40, /* '7' 0x37 */ - 0x39, 0x34, 0x53, 0x39, 0x1C, 0x51, 0x38, /* '8' 0x38 */ - 0x39, 0x3C, 0x71, 0x4C, 0xF0, 0x53, 0x78, /* '9' 0x39 */ - 0x82, /* ':' 0x3A */ - 0x87, /* ';' 0x3B */ - 0x3E, 0x30, 0x60, 0x80, /* '<' 0x3C */ - 0xF8, 0x3E, /* '=' 0x3D */ - 0xE0, 0xC6, 0xC8, 0x00, /* '>' 0x3E */ - 0x74, 0x42, 0x11, 0x10, 0x80, 0x20, /* '?' 0x3F */ - 0x0F, 0x86, 0x19, 0x9A, 0xA4, 0xD9, 0x13, 0x22, 0x56, 0xDA, 0x6E, 0x60, 0x06, 0x00, 0x3C, 0x00, /* '@' 0x40 */ - 0x18, 0x18, 0x24, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, /* 'A' 0x41 */ - 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xFC, /* 'B' 0x42 */ - 0x3E, 0x63, 0x40, 0x40, 0xC0, 0x40, 0x41, 0x63, 0x3E, /* 'C' 0x43 */ - 0xF9, 0x0A, 0x1C, 0x18, 0x30, 0x61, 0xC2, 0xF8, /* 'D' 0x44 */ - 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, /* 'E' 0x45 */ - 0xFE, 0x08, 0x20, 0xFA, 0x08, 0x20, 0x80, /* 'F' 0x46 */ - 0x1E, 0x61, 0x40, 0x40, 0xC7, 0x41, 0x41, 0x63, 0x1D, /* 'G' 0x47 */ - 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, /* 'H' 0x48 */ - 0xFF, 0x80, /* 'I' 0x49 */ - 0x08, 0x42, 0x10, 0x87, 0x29, 0x70, /* 'J' 0x4A */ - 0x85, 0x12, 0x45, 0x0D, 0x13, 0x22, 0x42, 0x86, /* 'K' 0x4B */ - 0x84, 0x21, 0x08, 0x42, 0x10, 0xF8, /* 'L' 0x4C */ - 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, /* 'M' 0x4D */ - 0x83, 0x86, 0x8D, 0x19, 0x33, 0x62, 0xC3, 0x86, /* 'N' 0x4E */ - 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x06, 0xC6, 0x1E, 0x00, /* 'O' 0x4F */ - 0xFA, 0x18, 0x61, 0xFA, 0x08, 0x20, 0x80, /* 'P' 0x50 */ - 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x16, 0xC6, 0x1F, 0x00, 0x40, /* 'Q' 0x51 */ - 0xFD, 0x0E, 0x1C, 0x2F, 0x90, 0xA1, 0x42, 0x86, /* 'R' 0x52 */ - 0x7A, 0x18, 0x30, 0x78, 0x38, 0x61, 0x78, /* 'S' 0x53 */ - 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, /* 'T' 0x54 */ - 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xE2, 0x78, /* 'U' 0x55 */ - 0xC2, 0x85, 0x0B, 0x22, 0x44, 0x8E, 0x0C, 0x18, /* 'V' 0x56 */ - 0xC4, 0x28, 0xCD, 0x29, 0x25, 0x24, 0xA4, 0x52, 0x8C, 0x61, 0x8C, 0x31, 0x80, /* 'W' 0x57 */ - 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xA3, 0x84, /* 'X' 0x58 */ - 0xC3, 0x42, 0x24, 0x34, 0x18, 0x08, 0x08, 0x08, 0x08, /* 'Y' 0x59 */ - 0x7E, 0x0C, 0x30, 0x41, 0x06, 0x18, 0x20, 0xFE, /* 'Z' 0x5A */ - 0xEA, 0xAA, 0xAB, /* '[' 0x5B */ - 0x92, 0x24, 0x89, 0x20, /* '\' 0x5C */ - 0xD5, 0x55, 0x57, /* ']' 0x5D */ - 0x46, 0xA9, /* '^' 0x5E */ - 0xFE, /* '_' 0x5F */ - 0x80, /* '`' 0x60 */ - 0x79, 0x20, 0x4F, 0xC6, 0x37, 0x40, /* 'a' 0x61 */ - 0x84, 0x3D, 0x18, 0xC6, 0x31, 0xF0, /* 'b' 0x62 */ - 0x39, 0x3C, 0x20, 0xC1, 0x33, 0x80, /* 'c' 0x63 */ - 0x04, 0x13, 0xD3, 0xC6, 0x1C, 0x53, 0x3C, /* 'd' 0x64 */ - 0x39, 0x38, 0x7F, 0x81, 0x13, 0x80, /* 'e' 0x65 */ - 0x6B, 0xA4, 0x92, 0x40, /* 'f' 0x66 */ - 0x35, 0x3C, 0x61, 0xC5, 0x33, 0x41, 0x4D, 0xE0, /* 'g' 0x67 */ - 0x84, 0x3D, 0x38, 0xC6, 0x31, 0x88, /* 'h' 0x68 */ - 0xBF, 0x80, /* 'i' 0x69 */ - 0x45, 0x55, 0x57, /* 'j' 0x6A */ - 0x84, 0x25, 0x4E, 0x52, 0xD2, 0x88, /* 'k' 0x6B */ - 0xFF, 0x80, /* 'l' 0x6C */ - 0xF7, 0x99, 0x91, 0x91, 0x91, 0x91, 0x91, /* 'm' 0x6D */ - 0xF4, 0x63, 0x18, 0xC6, 0x20, /* 'n' 0x6E */ - 0x39, 0x3C, 0x61, 0xC5, 0x33, 0x80, /* 'o' 0x6F */ - 0xF4, 0x63, 0x18, 0xC7, 0xD0, 0x80, /* 'p' 0x70 */ - 0x3D, 0x3C, 0x61, 0xC5, 0x37, 0x41, 0x04, /* 'q' 0x71 */ - 0xF2, 0x49, 0x20, /* 'r' 0x72 */ - 0x7A, 0x50, 0xE0, 0xE5, 0xE0, /* 's' 0x73 */ - 0x5D, 0x24, 0x93, /* 't' 0x74 */ - 0x8C, 0x63, 0x18, 0xCF, 0xA0, /* 'u' 0x75 */ - 0x85, 0x24, 0x92, 0x30, 0xC3, 0x00, /* 'v' 0x76 */ - 0x89, 0x59, 0x59, 0x55, 0x56, 0x26, 0x26, /* 'w' 0x77 */ - 0x4A, 0x4C, 0x43, 0x27, 0x20, /* 'x' 0x78 */ - 0x8A, 0x52, 0xA5, 0x18, 0x84, 0x22, 0x00, /* 'y' 0x79 */ - 0x78, 0x44, 0x46, 0x23, 0xE0, /* 'z' 0x7A */ - 0x6A, 0xAA, 0xA9, /* '{' 0x7B */ - 0xFF, 0xE0, /* '|' 0x7C */ - 0x95, 0x55, 0x56, /* '}' 0x7D */ - 0x66, 0x60, /* '~' 0x7E */ - 0xFF, 0xC0, 0x67, 0x34, 0x58, 0x4C, 0x46, 0x03, 0x11, 0x80, 0xFF, 0xC0, /* 0x7F */ - 0xFC, 0x08, 0x04, 0x02, 0x01, 0xF0, 0x8C, 0x46, 0x23, 0x11, 0x80, 0xC0, 0xC0, /* 0x80 */ - 0x10, 0x8F, 0xE0, 0x82, 0x08, 0x20, 0x82, 0x00, /* 0x81 */ - 0xE0, /* 0x82 */ - 0x24, 0x0F, 0x88, 0x88, 0x80, /* 0x83 */ - 0xB6, 0x80, /* 0x84 */ - 0xA8, /* 0x85 */ - 0x21, 0x09, 0xF2, 0x10, 0x84, 0x21, 0x08, /* 0x86 */ - 0x21, 0x09, 0xF2, 0x10, 0x84, 0xF9, 0x08, /* 0x87 */ - 0x1C, 0x45, 0x07, 0xE4, 0x1F, 0x10, 0x10, 0x1E, /* 0x88 */ - 0x62, 0x09, 0x40, 0x98, 0x06, 0x80, 0x10, 0x01, 0x66, 0x29, 0x92, 0x99, 0x06, 0x60, /* 0x89 */ - 0x7C, 0x08, 0x81, 0x10, 0x22, 0x04, 0x7C, 0x88, 0x51, 0x0A, 0x21, 0x87, 0xC0, /* 0x8A */ - 0x64, /* 0x8B */ - 0x84, 0x10, 0x82, 0x10, 0x42, 0x0F, 0xFD, 0x08, 0xA1, 0x0C, 0x23, 0x87, 0xC0, /* 0x8C */ - 0x10, 0x88, 0xE6, 0xB3, 0x8C, 0x28, 0x92, 0x28, 0xC0, /* 0x8D */ - 0xFC, 0x08, 0x04, 0x02, 0x01, 0xF0, 0x8C, 0x46, 0x23, 0x11, 0x80, /* 0x8E */ - 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xFE, 0x20, 0x40, /* 0x8F */ - 0x43, 0xC4, 0x1F, 0x45, 0x14, 0x51, 0x44, 0x11, 0x80, /* 0x90 */ - 0xE0, /* 0x91 */ - 0xE0, /* 0x92 */ - 0xB6, 0x80, /* 0x93 */ - 0xB6, 0x80, /* 0x94 */ - 0xFF, 0x80, /* 0x95 */ - 0xFC, /* 0x96 */ - 0xFF, 0xF0, /* 0x97 */ - /* 0x98 */ - 0xE6, 0x28, 0xCD, 0x19, 0xA3, 0x34, 0x6A, 0x8B, 0x51, 0x68, /* 0x99 */ - 0x78, 0x24, 0x13, 0xC9, 0x14, 0x8E, 0x7C, /* 0x9A */ - 0x98, /* 0x9B */ - 0x88, 0x44, 0x3F, 0xD1, 0x38, 0x8C, 0x78, /* 0x9C */ - 0x24, 0x09, 0xAC, 0xCA, 0x90, /* 0x9D */ - 0x43, 0xC4, 0x1F, 0x45, 0x14, 0x51, 0x44, /* 0x9E */ - 0x8C, 0x63, 0x18, 0xFC, 0x80, /* 0x9F */ - /* 0xA0 */ - 0x24, 0x33, 0x0A, 0x36, 0x45, 0x8E, 0x0C, 0x10, 0x60, 0x80, /* 0xA1 */ - 0x51, 0x22, 0x95, 0xA8, 0xC4, 0x23, 0x10, /* 0xA2 */ - 0x08, 0x42, 0x10, 0x86, 0x31, 0x78, /* 0xA3 */ - 0xFC, 0x63, 0xF0, /* 0xA4 */ - 0x07, 0xF8, 0x20, 0x82, 0x08, 0x20, 0x82, 0x00, /* 0xA5 */ - 0xF9, 0xF0, /* 0xA6 */ - 0x32, 0x91, 0xC9, 0x47, 0x26, 0x14, 0xA4, 0xC0, /* 0xA7 */ - 0x28, 0x0F, 0xE0, 0x82, 0x0F, 0xE0, 0x82, 0x0F, 0xC0, /* 0xA8 */ - 0x3E, 0x3F, 0xB8, 0xF4, 0x1A, 0x0D, 0x17, 0x76, 0xC6, 0x3E, 0x00, /* 0xA9 */ - 0x38, 0x8A, 0x0C, 0x0F, 0x90, 0x20, 0xE3, 0x7C, /* 0xAA */ - 0x5A, 0xA5, /* 0xAB */ - 0x51, 0x55, 0x56, /* 0xAC */ - /* 0xAD */ - 0x3E, 0x31, 0xB7, 0x72, 0x99, 0xCC, 0xC7, 0x56, 0xC6, 0x3E, 0x00, /* 0xAE */ - 0xA1, 0x24, 0x92, 0x49, 0x00, /* 0xAF */ - 0x69, 0x96, /* 0xB0 */ - 0x21, 0x3E, 0x42, 0x03, 0xE0, /* 0xB1 */ - 0xFF, 0x80, /* 0xB2 */ - 0xDF, 0x80, /* 0xB3 */ - 0x27, 0xC9, 0x24, /* 0xB4 */ - 0x8A, 0x28, 0xA2, 0x8A, 0x6E, 0xE0, 0x80, /* 0xB5 */ - 0x7F, 0xAE, 0xBA, 0x68, 0xA2, 0x8A, 0x28, 0xA0, /* 0xB6 */ - 0x80, /* 0xB7 */ - 0x28, 0xA0, 0x1E, 0x47, 0xFC, 0x11, 0x78, /* 0xB8 */ - 0x88, 0x44, 0x32, 0x59, 0xDA, 0xCD, 0x66, 0x6B, 0x32, 0x8B, 0x80, /* 0xB9 */ - 0x79, 0x1F, 0x30, 0x45, 0xE0, /* 0xBA */ - 0xA5, 0x5A, /* 0xBB */ - 0x45, 0x55, 0x57, /* 0xBC */ - 0x7A, 0x18, 0x70, 0x78, 0x38, 0x61, 0x7C, /* 0xBD */ - 0x7A, 0x1C, 0x1C, 0xBC, /* 0xBE */ - 0xB4, 0x24, 0x92, 0x40, /* 0xBF */ - 0x18, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, /* 0xC0 */ - 0xFE, 0x08, 0x20, 0xFA, 0x18, 0x61, 0xF8, /* 0xC1 */ - 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xFC, /* 0xC2 */ - 0xFE, 0x08, 0x20, 0x82, 0x08, 0x20, 0x80, /* 0xC3 */ - 0x1F, 0x08, 0x84, 0x42, 0x21, 0x10, 0x88, 0x44, 0x42, 0xFF, 0xC0, 0x60, 0x20, /* 0xC4 */ - 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, /* 0xC5 */ - 0x88, 0xA4, 0x9A, 0x87, 0xC1, 0xC1, 0xF1, 0xAD, 0x92, 0x88, 0x80, /* 0xC6 */ - 0x7A, 0x18, 0x41, 0x38, 0x18, 0x61, 0x7C, /* 0xC7 */ - 0x87, 0x0E, 0x2C, 0x59, 0x34, 0x68, 0xE1, 0xC2, /* 0xC8 */ - 0x28, 0x22, 0x1C, 0x38, 0xB1, 0x64, 0xD1, 0xA3, 0x87, 0x08, /* 0xC9 */ - 0x8E, 0x6B, 0x38, 0xC2, 0x89, 0x22, 0x8C, /* 0xCA */ - 0x3E, 0x44, 0x89, 0x12, 0x24, 0x58, 0xA1, 0xC2, /* 0xCB */ - 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, /* 0xCC */ - 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, /* 0xCD */ - 0x3C, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0xC2, 0x7C, /* 0xCE */ - 0xFF, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x82, /* 0xCF */ - 0xFA, 0x18, 0x61, 0xFE, 0x08, 0x20, 0x80, /* 0xD0 */ - 0x38, 0x8A, 0x0C, 0x08, 0x10, 0x20, 0xE3, 0x7C, /* 0xD1 */ - 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, /* 0xD2 */ - 0xC2, 0x8D, 0x91, 0x63, 0x83, 0x04, 0x18, 0x20, /* 0xD3 */ - 0x08, 0x1F, 0x32, 0x71, 0x18, 0x8C, 0x47, 0x26, 0xFE, 0x08, 0x00, /* 0xD4 */ - 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xB3, 0x84, /* 0xD5 */ - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0xFF, 0x01, 0x01, /* 0xD6 */ - 0x8E, 0x38, 0xE3, 0x8D, 0xF0, 0xC3, 0x0C, /* 0xD7 */ - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0xFF, /* 0xD8 */ - 0x99, 0x4C, 0xA6, 0x53, 0x29, 0x94, 0xCA, 0x65, 0x32, 0xFF, 0x80, 0x40, 0x20, /* 0xD9 */ - 0xF0, 0x04, 0x01, 0x00, 0x40, 0x1F, 0x84, 0x21, 0x0C, 0x42, 0x1F, 0x00, /* 0xDA */ - 0x81, 0xC0, 0xE0, 0x70, 0x3F, 0xDC, 0x2E, 0x17, 0x0B, 0xF9, 0x80, /* 0xDB */ - 0x82, 0x08, 0x20, 0xFE, 0x18, 0x61, 0xF8, /* 0xDC */ - 0x79, 0x8A, 0x18, 0x13, 0xE0, 0x60, 0xC2, 0x7C, /* 0xDD */ - 0x87, 0x26, 0x39, 0x06, 0x41, 0xF0, 0x64, 0x19, 0x06, 0x63, 0x8F, 0x80, /* 0xDE */ - 0x7E, 0x18, 0x61, 0x7C, 0xD6, 0x71, 0x84, /* 0xDF */ - 0x79, 0x11, 0xD9, 0xCD, 0xD0, /* 0xE0 */ - 0x0D, 0xC4, 0x1E, 0x47, 0x1C, 0x51, 0x78, /* 0xE1 */ - 0xF4, 0xBD, 0x29, 0xF8, /* 0xE2 */ - 0xF8, 0x88, 0x88, /* 0xE3 */ - 0x3C, 0x48, 0x91, 0x22, 0x5F, 0xE0, 0x80, /* 0xE4 */ - 0x79, 0x1F, 0xF0, 0x45, 0xE0, /* 0xE5 */ - 0x92, 0x54, 0x38, 0x3C, 0x56, 0x93, /* 0xE6 */ - 0x78, 0x23, 0x82, 0xCD, 0xE0, /* 0xE7 */ - 0x9C, 0xEB, 0x5C, 0xC4, /* 0xE8 */ - 0x70, 0x27, 0x3A, 0xD7, 0x31, /* 0xE9 */ - 0x9A, 0xCC, 0xA9, /* 0xEA */ - 0x7A, 0x52, 0x94, 0xE4, /* 0xEB */ - 0x8F, 0x3D, 0x6D, 0xA6, 0x90, /* 0xEC */ - 0x8C, 0x7F, 0x18, 0xC4, /* 0xED */ - 0x79, 0x1C, 0x71, 0x45, 0xE0, /* 0xEE */ - 0xFC, 0x63, 0x18, 0xC4, /* 0xEF */ - 0xFC, 0x63, 0x18, 0xFA, 0x10, 0x80, /* 0xF0 */ - 0x79, 0x1C, 0x30, 0x45, 0xE0, /* 0xF1 */ - 0xF9, 0x08, 0x42, 0x10, /* 0xF2 */ - 0x8A, 0x56, 0xA3, 0x10, 0x8C, 0x40, /* 0xF3 */ - 0x04, 0x01, 0x07, 0xF9, 0x31, 0xC4, 0x71, 0x14, 0xC5, 0xFE, 0x04, 0x01, 0x00, 0x40, /* 0xF4 */ - 0x4B, 0x8C, 0x65, 0xE4, /* 0xF5 */ - 0x8A, 0x28, 0xA2, 0x8B, 0xF0, 0x40, /* 0xF6 */ - 0x99, 0x97, 0x11, /* 0xF7 */ - 0x96, 0x59, 0x65, 0x97, 0xF0, /* 0xF8 */ - 0x95, 0x2A, 0x54, 0xA9, 0x5F, 0xC0, 0x80, /* 0xF9 */ - 0xF0, 0x20, 0x78, 0x91, 0x23, 0xC0, /* 0xFA */ - 0x86, 0x1F, 0x63, 0x8F, 0xD0, /* 0xFB */ - 0x84, 0x3D, 0x18, 0xF8, /* 0xFC */ - 0xF4, 0xDE, 0x19, 0xF8, /* 0xFD */ - 0x9E, 0xA2, 0xE1, 0xA1, 0xA2, 0x9E, /* 0xFE */ - 0xFC, 0x7E, 0xD4, 0xC4, /* 0xFF */ +/* 0x01 */ 0x1C, 0x0A, 0x05, 0x04, 0xFE, 0x08, 0x1C, 0x02, 0x07, 0xE0, 0x9F, 0xC0, +/* 0x02 */ 0x3F, 0xF0, 0x40, 0xE0, 0x10, 0x3F, 0x04, 0x9E, 0x28, 0x14, 0x0E, 0x00, +/* 0x03 */ 0x3F, 0x10, 0x28, 0x06, 0x49, 0x80, 0x60, 0x19, 0x26, 0x31, 0x40, 0x8F, 0xC0, +/* 0x04 */ 0x3F, 0x10, 0x2A, 0x16, 0x49, 0xA1, 0x60, 0x19, 0xE6, 0x31, 0x40, 0x8F, 0xC0, +/* 0x05 */ 0x28, 0x15, 0x2A, 0xB5, 0x55, 0xA8, 0x54, 0x12, 0x04, 0x41, 0x08, 0x81, 0xC0, +/* 0x06 */ 0x04, 0x08, 0x88, 0x82, 0x07, 0x01, 0x11, 0xA2, 0xC4, 0x40, 0x70, 0x20, 0x88, 0x88, 0x10, 0x00, +/* 0x07 */ +/* 0x08 */ 0x03, 0x83, 0x44, 0x48, 0x28, 0x01, 0x80, 0x17, 0xFE, 0x08, 0x45, 0x28, 0x84, 0x00, +/* 0x09 */ 0x01, 0xC0, 0x68, 0x82, 0x41, 0x10, 0x02, 0x80, 0x06, 0x00, 0x14, 0x00, 0x8F, 0xFC, +/* 0x0A */ +/* 0x0B */ 0x22, 0x2A, 0xA2, 0x30, 0x18, 0x0A, 0x09, 0x04, 0x44, 0x14, 0x04, 0x00, +/* 0x0C */ 0x46, 0x00, 0x19, 0x03, 0x21, 0x20, 0x93, 0x04, 0x20, 0x11, 0x80, 0x50, 0x02, 0x7F, 0xE0, +/* 0x0D */ +/* 0x0E */ 0x08, 0x0E, 0x08, 0x88, 0x24, 0x12, 0x09, 0x05, 0x01, 0xFF, 0x8A, 0x02, 0x00, +/* 0x0F */ 0x3F, 0x14, 0xAA, 0x16, 0x01, 0x92, 0x60, 0x18, 0xC6, 0x49, 0x40, 0x8F, 0xC0, +/* 0x10 */ 0x1B, 0x02, 0xA0, 0x54, 0x12, 0x42, 0x48, 0x49, 0x31, 0x1E, 0x23, 0xEA, 0xFE, 0x3C, +/* 0x11 */ 0x3F, 0x02, 0x00, 0x20, 0x6D, 0x27, 0xF8, 0x3F, 0xC1, 0xFE, 0x37, 0xD0, 0xBE, 0x40, 0xE1, 0xE2, 0x00, +/* 0x12 */ 0x12, 0x42, 0x20, 0x24, 0xC0, 0x29, 0x99, 0x05, 0x23, 0x30, 0xB0, 0x30, 0x00, +/* 0x13 */ 0x3F, 0x88, 0x0A, 0x44, 0xD5, 0x58, 0x03, 0x00, 0x67, 0xCC, 0x71, 0x40, 0x47, 0xF0, +/* 0x14 */ 0x3F, 0x18, 0x69, 0x26, 0x85, 0xA1, 0x6C, 0xD8, 0x06, 0x31, 0x40, 0x8F, 0xC0, +/* 0x15 */ 0x3F, 0x11, 0x00, 0xE8, 0x03, 0xA0, 0x1F, 0xB3, 0x7E, 0x00, 0xE9, 0xE0, 0x23, 0x00, 0x40, 0x40, 0xFE, 0x00, +/* 0x16 */ 0x30, 0x38, 0x3A, 0x3E, 0x6E, 0xEB, 0xC3, 0xC3, 0x66, 0x3C, +/* 0x17 */ 0x3F, 0x04, 0x00, 0x82, 0x88, 0x5C, 0xA4, 0x49, 0x22, 0x81, 0x98, 0xC4, 0x40, 0xA3, 0xF0, +/* 0x18 */ 0x07, 0x80, 0x42, 0x04, 0x08, 0x21, 0x41, 0x42, 0x60, 0x0E, 0x8C, 0xB2, 0x89, 0x50, 0x52, 0x82, 0x80, +/* 0x19 */ 0x3F, 0xC4, 0x02, 0x80, 0x18, 0x01, 0xB3, 0x1B, 0xB9, 0x80, 0x19, 0xE1, 0x40, 0x23, 0xFC, +/* 0x1A */ 0xFF, 0xC0, 0x67, 0x34, 0x58, 0x4C, 0x46, 0x03, 0x11, 0x80, 0xFF, 0xC0, +/* 0x1B */ 0x0F, 0xC0, 0x40, 0x82, 0x49, 0x08, 0x04, 0x00, 0x00, 0x12, 0x02, 0x31, 0x34, 0x0B, 0x88, 0x45, 0x00, 0x20, +/* 0x1C */ 0x3F, 0x88, 0x0A, 0x44, 0xC9, 0x19, 0x3B, 0x00, 0x60, 0x4C, 0x71, 0x40, 0x47, 0xF0, +/* 0x1D */ 0x3F, 0x8B, 0x0A, 0x00, 0xC8, 0x18, 0x13, 0x00, 0x48, 0xCA, 0xC1, 0x44, 0x53, 0x30, +/* 0x1E */ 0x19, 0xC2, 0x02, 0x50, 0x1E, 0x49, 0x80, 0x12, 0x01, 0x27, 0x92, 0x01, 0x10, 0x20, 0xFC, +/* 0x1F */ 0x30, 0x1C, 0x0C, 0x3E, 0x7E, 0xCF, 0x07, 0xC7, 0x7F, 0x3F, +/* ' ' 0x20 */ +/* '!' 0x21 */ 0xFC, 0x80, +/* '"' 0x22 */ 0xB6, 0x80, +/* '#' 0x23 */ 0x24, 0x51, 0xF9, 0x42, 0x9F, 0x92, 0x28, +/* '$' 0x24 */ 0x10, 0xE5, 0x55, 0x50, 0xE1, 0x65, 0x55, 0xE1, 0x00, +/* '%' 0x25 */ 0x71, 0x24, 0x89, 0x22, 0x50, 0x74, 0x02, 0x70, 0xA4, 0x49, 0x11, 0xC0, +/* '&' 0x26 */ 0x71, 0x24, 0x9C, 0x62, 0x58, 0xA7, 0xF4, +/* ''' 0x27 */ 0xE0, +/* '(' 0x28 */ 0x5A, 0xAA, 0x94, +/* ')' 0x29 */ 0x89, 0x12, 0x49, 0x29, 0x00, +/* '*' 0x2A */ 0x5E, 0x80, +/* '+' 0x2B */ 0x21, 0x3E, 0x42, 0x00, +/* ',' 0x2C */ 0xE0, +/* '-' 0x2D */ 0xC0, +/* '.' 0x2E */ 0x80, +/* '/' 0x2F */ 0x24, 0xA4, 0xA4, 0x80, +/* '0' 0x30 */ 0x76, 0xE3, 0x18, 0xC6, 0x3B, 0x70, +/* '1' 0x31 */ 0x27, 0x92, 0x49, 0x20, +/* '2' 0x32 */ 0x79, 0x10, 0x41, 0x08, 0xC6, 0x10, 0xFC, +/* '3' 0x33 */ 0x79, 0x30, 0x43, 0x18, 0x10, 0x71, 0x78, +/* '4' 0x34 */ 0x08, 0x61, 0x8A, 0x49, 0x2F, 0xC2, 0x08, +/* '5' 0x35 */ 0xFC, 0x21, 0xE8, 0x84, 0x31, 0xF0, +/* '6' 0x36 */ 0x74, 0x61, 0xE8, 0xC6, 0x31, 0x70, +/* '7' 0x37 */ 0xF8, 0x44, 0x22, 0x11, 0x08, 0x40, +/* '8' 0x38 */ 0x39, 0x34, 0x53, 0x39, 0x1C, 0x51, 0x38, +/* '9' 0x39 */ 0x39, 0x3C, 0x71, 0x4C, 0xF0, 0x53, 0x78, +/* ':' 0x3A */ 0x82, +/* ';' 0x3B */ 0x87, +/* '<' 0x3C */ 0x3E, 0x30, 0x60, 0x80, +/* '=' 0x3D */ 0xF8, 0x3E, +/* '>' 0x3E */ 0xE0, 0xC6, 0xC8, 0x00, +/* '?' 0x3F */ 0x74, 0x42, 0x11, 0x10, 0x80, 0x20, +/* '@' 0x40 */ 0x0F, 0x86, 0x19, 0x9A, 0xA4, 0xD9, 0x13, 0x22, 0x56, 0xDA, 0x6E, 0x60, 0x06, 0x00, 0x3C, 0x00, +/* 'A' 0x41 */ 0x18, 0x18, 0x24, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, +/* 'B' 0x42 */ 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xFC, +/* 'C' 0x43 */ 0x3E, 0x63, 0x40, 0x40, 0xC0, 0x40, 0x41, 0x63, 0x3E, +/* 'D' 0x44 */ 0xF9, 0x0A, 0x1C, 0x18, 0x30, 0x61, 0xC2, 0xF8, +/* 'E' 0x45 */ 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, +/* 'F' 0x46 */ 0xFE, 0x08, 0x20, 0xFA, 0x08, 0x20, 0x80, +/* 'G' 0x47 */ 0x1E, 0x61, 0x40, 0x40, 0xC7, 0x41, 0x41, 0x63, 0x1D, +/* 'H' 0x48 */ 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, +/* 'I' 0x49 */ 0xFF, 0x80, +/* 'J' 0x4A */ 0x08, 0x42, 0x10, 0x87, 0x29, 0x70, +/* 'K' 0x4B */ 0x85, 0x12, 0x45, 0x0D, 0x13, 0x22, 0x42, 0x86, +/* 'L' 0x4C */ 0x84, 0x21, 0x08, 0x42, 0x10, 0xF8, +/* 'M' 0x4D */ 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, +/* 'N' 0x4E */ 0x83, 0x86, 0x8D, 0x19, 0x33, 0x62, 0xC3, 0x86, +/* 'O' 0x4F */ 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x06, 0xC6, 0x1E, 0x00, +/* 'P' 0x50 */ 0xFA, 0x18, 0x61, 0xFA, 0x08, 0x20, 0x80, +/* 'Q' 0x51 */ 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x16, 0xC6, 0x1F, 0x00, 0x40, +/* 'R' 0x52 */ 0xFD, 0x0E, 0x1C, 0x2F, 0x90, 0xA1, 0x42, 0x86, +/* 'S' 0x53 */ 0x7A, 0x18, 0x30, 0x78, 0x38, 0x61, 0x78, +/* 'T' 0x54 */ 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, +/* 'U' 0x55 */ 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xE2, 0x78, +/* 'V' 0x56 */ 0xC2, 0x85, 0x0B, 0x22, 0x44, 0x8E, 0x0C, 0x18, +/* 'W' 0x57 */ 0xC4, 0x28, 0xCD, 0x29, 0x25, 0x24, 0xA4, 0x52, 0x8C, 0x61, 0x8C, 0x31, 0x80, +/* 'X' 0x58 */ 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xA3, 0x84, +/* 'Y' 0x59 */ 0xC3, 0x42, 0x24, 0x34, 0x18, 0x08, 0x08, 0x08, 0x08, +/* 'Z' 0x5A */ 0x7E, 0x0C, 0x30, 0x41, 0x06, 0x18, 0x20, 0xFE, +/* '[' 0x5B */ 0xEA, 0xAA, 0xAB, +/* '\' 0x5C */ 0x92, 0x24, 0x89, 0x20, +/* ']' 0x5D */ 0xD5, 0x55, 0x57, +/* '^' 0x5E */ 0x46, 0xA9, +/* '_' 0x5F */ 0xFE, +/* '`' 0x60 */ 0x80, +/* 'a' 0x61 */ 0x79, 0x20, 0x4F, 0xC6, 0x37, 0x40, +/* 'b' 0x62 */ 0x84, 0x3D, 0x18, 0xC6, 0x31, 0xF0, +/* 'c' 0x63 */ 0x39, 0x3C, 0x20, 0xC1, 0x33, 0x80, +/* 'd' 0x64 */ 0x04, 0x13, 0xD3, 0xC6, 0x1C, 0x53, 0x3C, +/* 'e' 0x65 */ 0x39, 0x38, 0x7F, 0x81, 0x13, 0x80, +/* 'f' 0x66 */ 0x6B, 0xA4, 0x92, 0x40, +/* 'g' 0x67 */ 0x35, 0x3C, 0x61, 0xC5, 0x33, 0x41, 0x4D, 0xE0, +/* 'h' 0x68 */ 0x84, 0x3D, 0x38, 0xC6, 0x31, 0x88, +/* 'i' 0x69 */ 0xBF, 0x80, +/* 'j' 0x6A */ 0x45, 0x55, 0x57, +/* 'k' 0x6B */ 0x84, 0x25, 0x4E, 0x52, 0xD2, 0x88, +/* 'l' 0x6C */ 0xFF, 0x80, +/* 'm' 0x6D */ 0xF7, 0x99, 0x91, 0x91, 0x91, 0x91, 0x91, +/* 'n' 0x6E */ 0xF4, 0x63, 0x18, 0xC6, 0x20, +/* 'o' 0x6F */ 0x39, 0x3C, 0x61, 0xC5, 0x33, 0x80, +/* 'p' 0x70 */ 0xF4, 0x63, 0x18, 0xC7, 0xD0, 0x80, +/* 'q' 0x71 */ 0x3D, 0x3C, 0x61, 0xC5, 0x37, 0x41, 0x04, +/* 'r' 0x72 */ 0xF2, 0x49, 0x20, +/* 's' 0x73 */ 0x7A, 0x50, 0xE0, 0xE5, 0xE0, +/* 't' 0x74 */ 0x5D, 0x24, 0x93, +/* 'u' 0x75 */ 0x8C, 0x63, 0x18, 0xCF, 0xA0, +/* 'v' 0x76 */ 0x85, 0x24, 0x92, 0x30, 0xC3, 0x00, +/* 'w' 0x77 */ 0x89, 0x59, 0x59, 0x55, 0x56, 0x26, 0x26, +/* 'x' 0x78 */ 0x4A, 0x4C, 0x43, 0x27, 0x20, +/* 'y' 0x79 */ 0x8A, 0x52, 0xA5, 0x18, 0x84, 0x22, 0x00, +/* 'z' 0x7A */ 0x78, 0x44, 0x46, 0x23, 0xE0, +/* '{' 0x7B */ 0x6A, 0xAA, 0xA9, +/* '|' 0x7C */ 0xFF, 0xE0, +/* '}' 0x7D */ 0x95, 0x55, 0x56, +/* '~' 0x7E */ 0x66, 0x60, +/* 0x7F */ +/* 0x80 */ 0xFC, 0x08, 0x04, 0x02, 0x01, 0xF0, 0x8C, 0x46, 0x23, 0x11, 0x80, 0xC0, 0xC0, +/* 0x81 */ 0x10, 0x8F, 0xE0, 0x82, 0x08, 0x20, 0x82, 0x00, +/* 0x82 */ 0xE0, +/* 0x83 */ 0x24, 0x0F, 0x88, 0x88, 0x80, +/* 0x84 */ 0xB6, 0x80, +/* 0x85 */ 0xA8, +/* 0x86 */ 0x21, 0x09, 0xF2, 0x10, 0x84, 0x21, 0x08, +/* 0x87 */ 0x21, 0x09, 0xF2, 0x10, 0x84, 0xF9, 0x08, +/* 0x88 */ 0x1C, 0x45, 0x07, 0xE4, 0x1F, 0x10, 0x10, 0x1E, +/* 0x89 */ 0x62, 0x09, 0x40, 0x98, 0x06, 0x80, 0x10, 0x01, 0x66, 0x29, 0x92, 0x99, 0x06, 0x60, +/* 0x8A */ 0x7C, 0x08, 0x81, 0x10, 0x22, 0x04, 0x7C, 0x88, 0x51, 0x0A, 0x21, 0x87, 0xC0, +/* 0x8B */ 0x64, +/* 0x8C */ 0x84, 0x10, 0x82, 0x10, 0x42, 0x0F, 0xFD, 0x08, 0xA1, 0x0C, 0x23, 0x87, 0xC0, +/* 0x8D */ 0x10, 0x88, 0xE6, 0xB3, 0x8C, 0x28, 0x92, 0x28, 0xC0, +/* 0x8E */ 0xFC, 0x08, 0x04, 0x02, 0x01, 0xF0, 0x8C, 0x46, 0x23, 0x11, 0x80, +/* 0x8F */ 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xFE, 0x20, 0x40, +/* 0x90 */ 0x43, 0xC4, 0x1F, 0x45, 0x14, 0x51, 0x44, 0x11, 0x80, +/* 0x91 */ 0xE0, +/* 0x92 */ 0xE0, +/* 0x93 */ 0xB6, 0x80, +/* 0x94 */ 0xB6, 0x80, +/* 0x95 */ 0xFF, 0x80, +/* 0x96 */ 0xFC, +/* 0x97 */ 0xFF, 0xF0, +/* 0x98 */ +/* 0x99 */ 0xE6, 0x28, 0xCD, 0x19, 0xA3, 0x34, 0x6A, 0x8B, 0x51, 0x68, +/* 0x9A */ 0x78, 0x24, 0x13, 0xC9, 0x14, 0x8E, 0x7C, +/* 0x9B */ 0x98, +/* 0x9C */ 0x88, 0x44, 0x3F, 0xD1, 0x38, 0x8C, 0x78, +/* 0x9D */ 0x24, 0x09, 0xAC, 0xCA, 0x90, +/* 0x9E */ 0x43, 0xC4, 0x1F, 0x45, 0x14, 0x51, 0x44, +/* 0x9F */ 0x8C, 0x63, 0x18, 0xFC, 0x80, +/* 0xA0 */ +/* 0xA1 */ 0x24, 0x33, 0x0A, 0x36, 0x45, 0x8E, 0x0C, 0x10, 0x60, 0x80, +/* 0xA2 */ 0x51, 0x22, 0x95, 0xA8, 0xC4, 0x23, 0x10, +/* 0xA3 */ 0x08, 0x42, 0x10, 0x86, 0x31, 0x78, +/* 0xA4 */ 0xFC, 0x63, 0xF0, +/* 0xA5 */ 0x07, 0xF8, 0x20, 0x82, 0x08, 0x20, 0x82, 0x00, +/* 0xA6 */ 0xF9, 0xF0, +/* 0xA7 */ 0x32, 0x91, 0xC9, 0x47, 0x26, 0x14, 0xA4, 0xC0, +/* 0xA8 */ 0x28, 0x0F, 0xE0, 0x82, 0x0F, 0xE0, 0x82, 0x0F, 0xC0, +/* 0xA9 */ 0x3E, 0x3F, 0xB8, 0xF4, 0x1A, 0x0D, 0x17, 0x76, 0xC6, 0x3E, 0x00, +/* 0xAA */ 0x38, 0x8A, 0x0C, 0x0F, 0x90, 0x20, 0xE3, 0x7C, +/* 0xAB */ 0x5A, 0xA5, +/* 0xAC */ 0x51, 0x55, 0x56, +/* 0xAD */ +/* 0xAE */ 0x3E, 0x31, 0xB7, 0x72, 0x99, 0xCC, 0xC7, 0x56, 0xC6, 0x3E, 0x00, +/* 0xAF */ 0xA1, 0x24, 0x92, 0x49, 0x00, +/* 0xB0 */ 0x69, 0x96, +/* 0xB1 */ 0x21, 0x3E, 0x42, 0x03, 0xE0, +/* 0xB2 */ 0xFF, 0x80, +/* 0xB3 */ 0xDF, 0x80, +/* 0xB4 */ 0x27, 0xC9, 0x24, +/* 0xB5 */ 0x8A, 0x28, 0xA2, 0x8A, 0x6E, 0xE0, 0x80, +/* 0xB6 */ 0x7F, 0xAE, 0xBA, 0x68, 0xA2, 0x8A, 0x28, 0xA0, +/* 0xB7 */ 0x80, +/* 0xB8 */ 0x28, 0xA0, 0x1E, 0x47, 0xFC, 0x11, 0x78, +/* 0xB9 */ 0x88, 0x44, 0x32, 0x59, 0xDA, 0xCD, 0x66, 0x6B, 0x32, 0x8B, 0x80, +/* 0xBA */ 0x79, 0x1F, 0x30, 0x45, 0xE0, +/* 0xBB */ 0xA5, 0x5A, +/* 0xBC */ 0x45, 0x55, 0x57, +/* 0xBD */ 0x7A, 0x18, 0x70, 0x78, 0x38, 0x61, 0x7C, +/* 0xBE */ 0x7A, 0x1C, 0x1C, 0xBC, +/* 0xBF */ 0xB4, 0x24, 0x92, 0x40, +/* 0xC0 */ 0x18, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, +/* 0xC1 */ 0xFE, 0x08, 0x20, 0xFA, 0x18, 0x61, 0xF8, +/* 0xC2 */ 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xFC, +/* 0xC3 */ 0xFE, 0x08, 0x20, 0x82, 0x08, 0x20, 0x80, +/* 0xC4 */ 0x1F, 0x08, 0x84, 0x42, 0x21, 0x10, 0x88, 0x44, 0x42, 0xFF, 0xC0, 0x60, 0x20, +/* 0xC5 */ 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, +/* 0xC6 */ 0x88, 0xA4, 0x9A, 0x87, 0xC1, 0xC1, 0xF1, 0xAD, 0x92, 0x88, 0x80, +/* 0xC7 */ 0x7A, 0x18, 0x41, 0x38, 0x18, 0x61, 0x7C, +/* 0xC8 */ 0x87, 0x0E, 0x2C, 0x59, 0x34, 0x68, 0xE1, 0xC2, +/* 0xC9 */ 0x28, 0x22, 0x1C, 0x38, 0xB1, 0x64, 0xD1, 0xA3, 0x87, 0x08, +/* 0xCA */ 0x8E, 0x6B, 0x38, 0xC2, 0x89, 0x22, 0x8C, +/* 0xCB */ 0x3E, 0x44, 0x89, 0x12, 0x24, 0x58, 0xA1, 0xC2, +/* 0xCC */ 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, +/* 0xCD */ 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, +/* 0xCE */ 0x3C, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0xC2, 0x7C, +/* 0xCF */ 0xFF, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x82, +/* 0xD0 */ 0xFA, 0x18, 0x61, 0xFE, 0x08, 0x20, 0x80, +/* 0xD1 */ 0x38, 0x8A, 0x0C, 0x08, 0x10, 0x20, 0xE3, 0x7C, +/* 0xD2 */ 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, +/* 0xD3 */ 0xC2, 0x8D, 0x91, 0x63, 0x83, 0x04, 0x18, 0x20, +/* 0xD4 */ 0x08, 0x1F, 0x32, 0x71, 0x18, 0x8C, 0x47, 0x26, 0xFE, 0x08, 0x00, +/* 0xD5 */ 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xB3, 0x84, +/* 0xD6 */ 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0xFF, 0x01, 0x01, +/* 0xD7 */ 0x8E, 0x38, 0xE3, 0x8D, 0xF0, 0xC3, 0x0C, +/* 0xD8 */ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0xFF, +/* 0xD9 */ 0x99, 0x4C, 0xA6, 0x53, 0x29, 0x94, 0xCA, 0x65, 0x32, 0xFF, 0x80, 0x40, 0x20, +/* 0xDA */ 0xF0, 0x04, 0x01, 0x00, 0x40, 0x1F, 0x84, 0x21, 0x0C, 0x42, 0x1F, 0x00, +/* 0xDB */ 0x81, 0xC0, 0xE0, 0x70, 0x3F, 0xDC, 0x2E, 0x17, 0x0B, 0xF9, 0x80, +/* 0xDC */ 0x82, 0x08, 0x20, 0xFE, 0x18, 0x61, 0xF8, +/* 0xDD */ 0x79, 0x8A, 0x18, 0x13, 0xE0, 0x60, 0xC2, 0x7C, +/* 0xDE */ 0x87, 0x26, 0x39, 0x06, 0x41, 0xF0, 0x64, 0x19, 0x06, 0x63, 0x8F, 0x80, +/* 0xDF */ 0x7E, 0x18, 0x61, 0x7C, 0xD6, 0x71, 0x84, +/* 0xE0 */ 0x79, 0x11, 0xD9, 0xCD, 0xD0, +/* 0xE1 */ 0x0D, 0xC4, 0x1E, 0x47, 0x1C, 0x51, 0x78, +/* 0xE2 */ 0xF4, 0xBD, 0x29, 0xF8, +/* 0xE3 */ 0xF8, 0x88, 0x88, +/* 0xE4 */ 0x3C, 0x48, 0x91, 0x22, 0x5F, 0xE0, 0x80, +/* 0xE5 */ 0x79, 0x1F, 0xF0, 0x45, 0xE0, +/* 0xE6 */ 0x92, 0x54, 0x38, 0x3C, 0x56, 0x93, +/* 0xE7 */ 0x78, 0x23, 0x82, 0xCD, 0xE0, +/* 0xE8 */ 0x9C, 0xEB, 0x5C, 0xC4, +/* 0xE9 */ 0x70, 0x27, 0x3A, 0xD7, 0x31, +/* 0xEA */ 0x9A, 0xCC, 0xA9, +/* 0xEB */ 0x7A, 0x52, 0x94, 0xE4, +/* 0xEC */ 0x8F, 0x3D, 0x6D, 0xA6, 0x90, +/* 0xED */ 0x8C, 0x7F, 0x18, 0xC4, +/* 0xEE */ 0x79, 0x1C, 0x71, 0x45, 0xE0, +/* 0xEF */ 0xFC, 0x63, 0x18, 0xC4, +/* 0xF0 */ 0xFC, 0x63, 0x18, 0xFA, 0x10, 0x80, +/* 0xF1 */ 0x79, 0x1C, 0x30, 0x45, 0xE0, +/* 0xF2 */ 0xF9, 0x08, 0x42, 0x10, +/* 0xF3 */ 0x8A, 0x56, 0xA3, 0x10, 0x8C, 0x40, +/* 0xF4 */ 0x04, 0x01, 0x07, 0xF9, 0x31, 0xC4, 0x71, 0x14, 0xC5, 0xFE, 0x04, 0x01, 0x00, 0x40, +/* 0xF5 */ 0x4B, 0x8C, 0x65, 0xE4, +/* 0xF6 */ 0x8A, 0x28, 0xA2, 0x8B, 0xF0, 0x40, +/* 0xF7 */ 0x99, 0x97, 0x11, +/* 0xF8 */ 0x96, 0x59, 0x65, 0x97, 0xF0, +/* 0xF9 */ 0x95, 0x2A, 0x54, 0xA9, 0x5F, 0xC0, 0x80, +/* 0xFA */ 0xF0, 0x20, 0x78, 0x91, 0x23, 0xC0, +/* 0xFB */ 0x86, 0x1F, 0x63, 0x8F, 0xD0, +/* 0xFC */ 0x84, 0x3D, 0x18, 0xF8, +/* 0xFD */ 0xF4, 0xDE, 0x19, 0xF8, +/* 0xFE */ 0x9E, 0xA2, 0xE1, 0xA1, 0xA2, 0x9E, +/* 0xFF */ 0xFC, 0x7E, 0xD4, 0xC4, }; const GFXglyph FreeSans6pt_Win1251Glyphs[] PROGMEM = { - /* ' ' 0x20 */ {0, 0, 0, 3, 0, 0}, - /* '!' 0x21 */ {0, 1, 9, 4, 2, -8}, - /* '"' 0x22 */ {2, 3, 3, 4, 0, -8}, - /* '#' 0x23 */ {4, 7, 8, 7, 0, -7}, - /* '$' 0x24 */ {11, 6, 11, 7, 0, -9}, - /* '%' 0x25 */ {20, 10, 9, 11, 0, -8}, - /* '&' 0x26 */ {32, 6, 9, 8, 1, -8}, - /* ''' 0x27 */ {39, 1, 3, 2, 1, -8}, - /* '(' 0x28 */ {40, 2, 11, 4, 1, -8}, - /* ')' 0x29 */ {43, 3, 11, 4, 0, -8}, - /* '*' 0x2A */ {48, 3, 3, 5, 1, -8}, - /* '+' 0x2B */ {50, 5, 5, 7, 1, -4}, - /* ',' 0x2C */ {54, 1, 3, 3, 1, 0}, - /* '-' 0x2D */ {55, 2, 1, 4, 1, -3}, - /* '.' 0x2E */ {56, 1, 1, 3, 1, 0}, - /* '/' 0x2F */ {57, 3, 9, 3, 0, -8}, - /* '0' 0x30 */ {61, 5, 9, 7, 1, -8}, - /* '1' 0x31 */ {67, 3, 9, 7, 1, -8}, - /* '2' 0x32 */ {71, 6, 9, 7, 0, -8}, - /* '3' 0x33 */ {78, 6, 9, 7, 0, -8}, - /* '4' 0x34 */ {85, 6, 9, 7, 0, -8}, - /* '5' 0x35 */ {92, 5, 9, 7, 1, -8}, - /* '6' 0x36 */ {98, 5, 9, 7, 1, -8}, - /* '7' 0x37 */ {104, 5, 9, 7, 1, -8}, - /* '8' 0x38 */ {110, 6, 9, 7, 0, -8}, - /* '9' 0x39 */ {117, 6, 9, 7, 0, -8}, - /* ':' 0x3A */ {124, 1, 7, 3, 1, -6}, - /* ';' 0x3B */ {125, 1, 8, 3, 1, -5}, - /* '<' 0x3C */ {126, 5, 5, 7, 1, -4}, - /* '=' 0x3D */ {130, 5, 3, 7, 1, -3}, - /* '>' 0x3E */ {132, 5, 5, 7, 1, -4}, - /* '?' 0x3F */ {136, 5, 9, 7, 1, -8}, - /* '@' 0x40 */ {142, 11, 11, 12, 0, -8}, - /* 'A' 0x41 */ {158, 8, 9, 8, 0, -8}, - /* 'B' 0x42 */ {167, 6, 9, 8, 1, -8}, - /* 'C' 0x43 */ {174, 8, 9, 9, 0, -8}, - /* 'D' 0x44 */ {183, 7, 9, 8, 1, -8}, - /* 'E' 0x45 */ {191, 6, 9, 8, 1, -8}, - /* 'F' 0x46 */ {198, 6, 9, 7, 1, -8}, - /* 'G' 0x47 */ {205, 8, 9, 9, 0, -8}, - /* 'H' 0x48 */ {214, 7, 9, 9, 1, -8}, - /* 'I' 0x49 */ {222, 1, 9, 3, 1, -8}, - /* 'J' 0x4A */ {224, 5, 9, 6, 0, -8}, - /* 'K' 0x4B */ {230, 7, 9, 8, 1, -8}, - /* 'L' 0x4C */ {238, 5, 9, 7, 1, -8}, - /* 'M' 0x4D */ {244, 8, 9, 10, 1, -8}, - /* 'N' 0x4E */ {253, 7, 9, 9, 1, -8}, - /* 'O' 0x4F */ {261, 9, 9, 9, 0, -8}, - /* 'P' 0x50 */ {272, 6, 9, 8, 1, -8}, - /* 'Q' 0x51 */ {279, 9, 10, 9, 0, -8}, - /* 'R' 0x52 */ {291, 7, 9, 9, 1, -8}, - /* 'S' 0x53 */ {299, 6, 9, 8, 1, -8}, - /* 'T' 0x54 */ {306, 7, 9, 8, 0, -8}, - /* 'U' 0x55 */ {314, 7, 9, 9, 1, -8}, - /* 'V' 0x56 */ {322, 7, 9, 8, 0, -8}, - /* 'W' 0x57 */ {330, 11, 9, 11, 0, -8}, - /* 'X' 0x58 */ {343, 6, 9, 8, 1, -8}, - /* 'Y' 0x59 */ {350, 8, 9, 8, 0, -8}, - /* 'Z' 0x5A */ {359, 7, 9, 7, 0, -8}, - /* '[' 0x5B */ {367, 2, 12, 3, 1, -8}, - /* '\' 0x5C */ {370, 3, 9, 3, 0, -8}, - /* ']' 0x5D */ {374, 2, 12, 3, 0, -8}, - /* '^' 0x5E */ {377, 4, 4, 6, 1, -8}, - /* '_' 0x5F */ {379, 7, 1, 7, 0, 2}, - /* '`' 0x60 */ {380, 1, 1, 3, 1, -8}, - /* 'a' 0x61 */ {381, 6, 7, 7, 0, -6}, - /* 'b' 0x62 */ {387, 5, 9, 7, 1, -8}, - /* 'c' 0x63 */ {393, 6, 7, 6, 0, -6}, - /* 'd' 0x64 */ {399, 6, 9, 7, 0, -8}, - /* 'e' 0x65 */ {406, 6, 7, 6, 0, -6}, - /* 'f' 0x66 */ {412, 3, 9, 3, 0, -8}, - /* 'g' 0x67 */ {416, 6, 10, 7, 0, -6}, - /* 'h' 0x68 */ {424, 5, 9, 6, 1, -8}, - /* 'i' 0x69 */ {430, 1, 9, 3, 1, -8}, - /* 'j' 0x6A */ {432, 2, 12, 3, 0, -8}, - /* 'k' 0x6B */ {435, 5, 9, 6, 1, -8}, - /* 'l' 0x6C */ {441, 1, 9, 3, 1, -8}, - /* 'm' 0x6D */ {443, 8, 7, 10, 1, -6}, - /* 'n' 0x6E */ {450, 5, 7, 6, 1, -6}, - /* 'o' 0x6F */ {455, 6, 7, 6, 0, -6}, - /* 'p' 0x70 */ {461, 5, 9, 7, 1, -6}, - /* 'q' 0x71 */ {467, 6, 9, 7, 0, -6}, - /* 'r' 0x72 */ {474, 3, 7, 4, 1, -6}, - /* 's' 0x73 */ {477, 5, 7, 6, 0, -6}, - /* 't' 0x74 */ {482, 3, 8, 3, 0, -7}, - /* 'u' 0x75 */ {485, 5, 7, 6, 1, -6}, - /* 'v' 0x76 */ {490, 6, 7, 6, 0, -6}, - /* 'w' 0x77 */ {496, 8, 7, 9, 0, -6}, - /* 'x' 0x78 */ {503, 5, 7, 6, 0, -6}, - /* 'y' 0x79 */ {508, 5, 10, 6, 0, -6}, - /* 'z' 0x7A */ {515, 5, 7, 6, 0, -6}, - /* '{' 0x7B */ {520, 2, 12, 4, 1, -8}, - /* '|' 0x7C */ {523, 1, 11, 3, 1, -8}, - /* '}' 0x7D */ {525, 2, 12, 4, 1, -8}, - /* '~' 0x7E */ {528, 6, 2, 6, 0, -4}, - /* 0x7F */ {530, 9, 10, 11, 1, -8}, - /* 0x80 */ {542, 9, 11, 9, 0, -8}, - /* 0x81 */ {555, 6, 10, 7, 1, -9}, - /* 0x82 */ {563, 1, 3, 3, 1, 0}, - /* 0x83 */ {564, 4, 9, 5, 1, -8}, - /* 0x84 */ {569, 3, 3, 5, 1, 0}, - /* 0x85 */ {571, 5, 1, 7, 1, 0}, - /* 0x86 */ {572, 5, 11, 7, 1, -8}, - /* 0x87 */ {579, 5, 11, 7, 1, -8}, - /* 0x88 */ {586, 7, 9, 8, 0, -8}, - /* 0x89 */ {594, 12, 9, 12, 0, -8}, - /* 0x8A */ {608, 11, 9, 13, 1, -8}, - /* 0x8B */ {621, 2, 3, 4, 1, -4}, - /* 0x8C */ {622, 11, 9, 12, 1, -8}, - /* 0x8D */ {635, 6, 11, 8, 1, -10}, - /* 0x8E */ {644, 9, 9, 9, 0, -8}, - /* 0x8F */ {655, 7, 11, 9, 1, -8}, - /* 0x90 */ {665, 6, 11, 7, 0, -8}, - /* 0x91 */ {674, 1, 3, 3, 1, -8}, - /* 0x92 */ {675, 1, 3, 2, 1, -8}, - /* 0x93 */ {676, 3, 3, 5, 1, -8}, - /* 0x94 */ {678, 3, 3, 5, 1, -8}, - /* 0x95 */ {680, 3, 3, 5, 1, -5}, - /* 0x96 */ {682, 6, 1, 6, 0, -3}, - /* 0x97 */ {683, 12, 1, 12, 0, -3}, - /* 0x98 */ {685, 0, 0, 8, 0, 0}, - /* 0x99 */ {685, 11, 7, 12, 1, -8}, - /* 0x9A */ {695, 9, 6, 10, 0, -5}, - /* 0x9B */ {702, 2, 3, 3, 1, -4}, - /* 0x9C */ {703, 9, 6, 10, 1, -5}, - /* 0x9D */ {710, 4, 9, 6, 1, -8}, - /* 0x9E */ {715, 6, 9, 7, 0, -8}, - /* 0x9F */ {722, 5, 7, 7, 1, -5}, - /* 0xA0 */ {727, 0, 0, 3, 0, 0}, - /* 0xA1 */ {727, 7, 11, 7, 0, -10}, - /* 0xA2 */ {737, 5, 11, 6, 0, -7}, - /* 0xA3 */ {744, 5, 9, 6, 0, -8}, - /* 0xA4 */ {750, 5, 4, 7, 1, -5}, - /* 0xA5 */ {753, 6, 10, 7, 1, -9}, - /* 0xA6 */ {761, 1, 12, 3, 1, -8}, - /* 0xA7 */ {763, 5, 12, 7, 1, -8}, - /* 0xA8 */ {771, 6, 11, 8, 1, -10}, - /* 0xA9 */ {780, 9, 9, 10, 0, -8}, - /* 0xAA */ {791, 7, 9, 9, 1, -8}, - /* 0xAB */ {799, 4, 4, 6, 1, -4}, - /* 0xAC */ {801, 2, 12, 3, 0, -8}, - /* 0xAD */ {804, 0, 0, 0, 0, 0}, - /* 0xAE */ {804, 9, 9, 10, 0, -8}, - /* 0xAF */ {815, 3, 11, 3, 0, -10}, - /* 0xB0 */ {820, 4, 4, 7, 2, -8}, - /* 0xB1 */ {822, 5, 7, 7, 1, -6}, - /* 0xB2 */ {827, 1, 9, 3, 1, -8}, - /* 0xB3 */ {829, 1, 9, 3, 1, -8}, - /* 0xB4 */ {831, 3, 8, 5, 1, -7}, - /* 0xB5 */ {834, 6, 9, 7, 1, -6}, - /* 0xB6 */ {841, 6, 10, 6, 1, -8}, - /* 0xB7 */ {849, 1, 1, 3, 1, -2}, - /* 0xB8 */ {850, 6, 9, 7, 0, -8}, - /* 0xB9 */ {857, 9, 9, 11, 1, -8}, - /* 0xBA */ {868, 6, 6, 6, 0, -5}, - /* 0xBB */ {873, 4, 4, 6, 1, -5}, - /* 0xBC */ {875, 2, 12, 3, 0, -8}, - /* 0xBD */ {878, 6, 9, 8, 1, -8}, - /* 0xBE */ {885, 5, 6, 6, 0, -5}, - /* 0xBF */ {889, 3, 9, 3, 0, -8}, - /* 0xC0 */ {893, 8, 9, 8, 0, -8}, - /* 0xC1 */ {902, 6, 9, 8, 1, -8}, - /* 0xC2 */ {909, 6, 9, 8, 1, -8}, - /* 0xC3 */ {916, 6, 9, 7, 1, -8}, - /* 0xC4 */ {923, 9, 11, 10, 0, -8}, - /* 0xC5 */ {936, 6, 9, 8, 1, -8}, - /* 0xC6 */ {943, 9, 9, 11, 1, -8}, - /* 0xC7 */ {954, 6, 9, 8, 1, -8}, - /* 0xC8 */ {961, 7, 9, 9, 1, -8}, - /* 0xC9 */ {969, 7, 11, 9, 1, -10}, - /* 0xCA */ {979, 6, 9, 8, 1, -8}, - /* 0xCB */ {986, 7, 9, 8, 0, -8}, - /* 0xCC */ {994, 8, 9, 10, 1, -8}, - /* 0xCD */ {1003, 7, 9, 9, 1, -8}, - /* 0xCE */ {1011, 8, 9, 10, 1, -8}, - /* 0xCF */ {1020, 7, 9, 9, 1, -8}, - /* 0xD0 */ {1028, 6, 9, 8, 1, -8}, - /* 0xD1 */ {1035, 7, 9, 9, 1, -8}, - /* 0xD2 */ {1043, 7, 9, 7, 0, -8}, - /* 0xD3 */ {1051, 7, 9, 7, 0, -8}, - /* 0xD4 */ {1059, 9, 9, 10, 1, -8}, - /* 0xD5 */ {1070, 6, 9, 8, 1, -8}, - /* 0xD6 */ {1077, 8, 11, 9, 1, -8}, - /* 0xD7 */ {1088, 6, 9, 8, 1, -8}, - /* 0xD8 */ {1095, 8, 9, 10, 1, -8}, - /* 0xD9 */ {1104, 9, 11, 10, 1, -8}, - /* 0xDA */ {1117, 10, 9, 10, 0, -8}, - /* 0xDB */ {1129, 9, 9, 10, 1, -8}, - /* 0xDC */ {1140, 6, 9, 8, 1, -8}, - /* 0xDD */ {1147, 7, 9, 9, 1, -8}, - /* 0xDE */ {1155, 10, 9, 12, 1, -8}, - /* 0xDF */ {1167, 6, 9, 8, 1, -8}, - /* 0xE0 */ {1174, 6, 6, 7, 0, -5}, - /* 0xE1 */ {1179, 6, 9, 7, 0, -8}, - /* 0xE2 */ {1186, 5, 6, 6, 1, -5}, - /* 0xE3 */ {1190, 4, 6, 5, 1, -5}, - /* 0xE4 */ {1193, 7, 7, 7, 0, -5}, - /* 0xE5 */ {1200, 6, 6, 7, 0, -5}, - /* 0xE6 */ {1205, 8, 6, 9, 1, -5}, - /* 0xE7 */ {1211, 6, 6, 6, 0, -5}, - /* 0xE8 */ {1216, 5, 6, 7, 1, -5}, - /* 0xE9 */ {1220, 5, 8, 7, 1, -7}, - /* 0xEA */ {1225, 4, 6, 6, 1, -5}, - /* 0xEB */ {1228, 5, 6, 6, 0, -5}, - /* 0xEC */ {1232, 6, 6, 7, 1, -5}, - /* 0xED */ {1237, 5, 6, 7, 1, -5}, - /* 0xEE */ {1241, 6, 6, 7, 0, -5}, - /* 0xEF */ {1246, 5, 6, 7, 1, -5}, - /* 0xF0 */ {1250, 5, 9, 7, 1, -5}, - /* 0xF1 */ {1256, 6, 6, 6, 0, -5}, - /* 0xF2 */ {1261, 5, 6, 5, 0, -5}, - /* 0xF3 */ {1265, 5, 9, 6, 0, -5}, - /* 0xF4 */ {1271, 10, 11, 10, 0, -7}, - /* 0xF5 */ {1285, 5, 6, 6, 0, -5}, - /* 0xF6 */ {1289, 6, 7, 7, 1, -5}, - /* 0xF7 */ {1295, 4, 6, 6, 1, -5}, - /* 0xF8 */ {1298, 6, 6, 8, 1, -5}, - /* 0xF9 */ {1303, 7, 7, 9, 1, -5}, - /* 0xFA */ {1310, 7, 6, 8, 0, -5}, - /* 0xFB */ {1316, 6, 6, 8, 1, -5}, - /* 0xFC */ {1321, 5, 6, 6, 1, -5}, - /* 0xFD */ {1325, 5, 6, 6, 1, -5}, - /* 0xFE */ {1329, 8, 6, 9, 1, -5}, - /* 0xFF */ {1335, 5, 6, 7, 1, -5}, +/* 0x01 */ { 0, 9, 10, 11, 1, -9 }, +/* 0x02 */ { 12, 9, 10, 11, 1, -8 }, +/* 0x03 */ { 24, 10, 10, 12, 1, -8 }, +/* 0x04 */ { 37, 10, 10, 12, 1, -8 }, +/* 0x05 */ { 50, 10, 10, 12, 1, -9 }, +/* 0x06 */ { 63, 11, 11, 13, 1, -9 }, +/* 0x07 */ { 79, 0, 0, 8, 0, 0 }, +/* 0x08 */ { 79, 12, 9, 14, 1, -8 }, +/* 0x09 */ { 93, 14, 8, 16, 1, -7 }, +/* 0x0A */ { 107, 0, 0, 8, 0, 0 }, +/* 0x0B */ { 107, 9, 10, 11, 1, -9 }, +/* 0x0C */ { 119, 13, 9, 15, 1, -8 }, +/* 0x0D */ { 134, 0, 0, 8, 0, 0 }, +/* 0x0E */ { 134, 9, 11, 11, 1, -9 }, +/* 0x0F */ { 147, 10, 10, 12, 1, -9 }, +/* 0x10 */ { 160, 11, 10, 13, 1, -9 }, +/* 0x11 */ { 174, 13, 10, 15, 1, -9 }, +/* 0x12 */ { 191, 10, 10, 12, 1, -9 }, +/* 0x13 */ { 204, 11, 10, 13, 1, -9 }, +/* 0x14 */ { 218, 10, 10, 12, 1, -9 }, +/* 0x15 */ { 231, 14, 10, 16, 1, -9 }, +/* 0x16 */ { 249, 8, 10, 10, 1, -9 }, +/* 0x17 */ { 259, 12, 10, 14, 1, -9 }, +/* 0x18 */ { 274, 13, 10, 15, 1, -9 }, +/* 0x19 */ { 291, 12, 10, 14, 1, -9 }, +/* 0x1A */ { 306, 9, 10, 11, 1, -8 }, +/* 0x1B */ { 318, 14, 10, 16, 1, -9 }, +/* 0x1C */ { 336, 11, 10, 13, 1, -9 }, +/* 0x1D */ { 350, 11, 10, 13, 1, -9 }, +/* 0x1E */ { 364, 12, 10, 14, 1, -9 }, +/* 0x1F */ { 379, 8, 10, 11, 2, -9 }, +/* ' ' 0x20 */ { 389, 0, 0, 3, 0, 0 }, +/* '!' 0x21 */ { 389, 1, 9, 4, 2, -8 }, +/* '"' 0x22 */ { 391, 3, 3, 4, 0, -8 }, +/* '#' 0x23 */ { 393, 7, 8, 7, 0, -7 }, +/* '$' 0x24 */ { 400, 6, 11, 7, 0, -9 }, +/* '%' 0x25 */ { 409, 10, 9, 11, 0, -8 }, +/* '&' 0x26 */ { 421, 6, 9, 8, 1, -8 }, +/* ''' 0x27 */ { 428, 1, 3, 2, 1, -8 }, +/* '(' 0x28 */ { 429, 2, 11, 4, 1, -8 }, +/* ')' 0x29 */ { 432, 3, 11, 4, 0, -8 }, +/* '*' 0x2A */ { 437, 3, 3, 5, 1, -8 }, +/* '+' 0x2B */ { 439, 5, 5, 7, 1, -4 }, +/* ',' 0x2C */ { 443, 1, 3, 3, 1, 0 }, +/* '-' 0x2D */ { 444, 2, 1, 4, 1, -3 }, +/* '.' 0x2E */ { 445, 1, 1, 3, 1, 0 }, +/* '/' 0x2F */ { 446, 3, 9, 3, 0, -8 }, +/* '0' 0x30 */ { 450, 5, 9, 7, 1, -8 }, +/* '1' 0x31 */ { 456, 3, 9, 7, 1, -8 }, +/* '2' 0x32 */ { 460, 6, 9, 7, 0, -8 }, +/* '3' 0x33 */ { 467, 6, 9, 7, 0, -8 }, +/* '4' 0x34 */ { 474, 6, 9, 7, 0, -8 }, +/* '5' 0x35 */ { 481, 5, 9, 7, 1, -8 }, +/* '6' 0x36 */ { 487, 5, 9, 7, 1, -8 }, +/* '7' 0x37 */ { 493, 5, 9, 7, 1, -8 }, +/* '8' 0x38 */ { 499, 6, 9, 7, 0, -8 }, +/* '9' 0x39 */ { 506, 6, 9, 7, 0, -8 }, +/* ':' 0x3A */ { 513, 1, 7, 3, 1, -6 }, +/* ';' 0x3B */ { 514, 1, 8, 3, 1, -5 }, +/* '<' 0x3C */ { 515, 5, 5, 7, 1, -4 }, +/* '=' 0x3D */ { 519, 5, 3, 7, 1, -3 }, +/* '>' 0x3E */ { 521, 5, 5, 7, 1, -4 }, +/* '?' 0x3F */ { 525, 5, 9, 7, 1, -8 }, +/* '@' 0x40 */ { 531, 11, 11, 12, 0, -8 }, +/* 'A' 0x41 */ { 547, 8, 9, 8, 0, -8 }, +/* 'B' 0x42 */ { 556, 6, 9, 8, 1, -8 }, +/* 'C' 0x43 */ { 563, 8, 9, 9, 0, -8 }, +/* 'D' 0x44 */ { 572, 7, 9, 8, 1, -8 }, +/* 'E' 0x45 */ { 580, 6, 9, 8, 1, -8 }, +/* 'F' 0x46 */ { 587, 6, 9, 7, 1, -8 }, +/* 'G' 0x47 */ { 594, 8, 9, 9, 0, -8 }, +/* 'H' 0x48 */ { 603, 7, 9, 9, 1, -8 }, +/* 'I' 0x49 */ { 611, 1, 9, 3, 1, -8 }, +/* 'J' 0x4A */ { 613, 5, 9, 6, 0, -8 }, +/* 'K' 0x4B */ { 619, 7, 9, 8, 1, -8 }, +/* 'L' 0x4C */ { 627, 5, 9, 7, 1, -8 }, +/* 'M' 0x4D */ { 633, 8, 9, 10, 1, -8 }, +/* 'N' 0x4E */ { 642, 7, 9, 9, 1, -8 }, +/* 'O' 0x4F */ { 650, 9, 9, 9, 0, -8 }, +/* 'P' 0x50 */ { 661, 6, 9, 8, 1, -8 }, +/* 'Q' 0x51 */ { 668, 9, 10, 9, 0, -8 }, +/* 'R' 0x52 */ { 680, 7, 9, 9, 1, -8 }, +/* 'S' 0x53 */ { 688, 6, 9, 8, 1, -8 }, +/* 'T' 0x54 */ { 695, 7, 9, 8, 0, -8 }, +/* 'U' 0x55 */ { 703, 7, 9, 9, 1, -8 }, +/* 'V' 0x56 */ { 711, 7, 9, 8, 0, -8 }, +/* 'W' 0x57 */ { 719, 11, 9, 11, 0, -8 }, +/* 'X' 0x58 */ { 732, 6, 9, 8, 1, -8 }, +/* 'Y' 0x59 */ { 739, 8, 9, 8, 0, -8 }, +/* 'Z' 0x5A */ { 748, 7, 9, 7, 0, -8 }, +/* '[' 0x5B */ { 756, 2, 12, 3, 1, -8 }, +/* '\' 0x5C */ { 759, 3, 9, 3, 0, -8 }, +/* ']' 0x5D */ { 763, 2, 12, 3, 0, -8 }, +/* '^' 0x5E */ { 766, 4, 4, 6, 1, -8 }, +/* '_' 0x5F */ { 768, 7, 1, 7, 0, 2 }, +/* '`' 0x60 */ { 769, 1, 1, 3, 1, -8 }, +/* 'a' 0x61 */ { 770, 6, 7, 7, 0, -6 }, +/* 'b' 0x62 */ { 776, 5, 9, 7, 1, -8 }, +/* 'c' 0x63 */ { 782, 6, 7, 6, 0, -6 }, +/* 'd' 0x64 */ { 788, 6, 9, 7, 0, -8 }, +/* 'e' 0x65 */ { 795, 6, 7, 6, 0, -6 }, +/* 'f' 0x66 */ { 801, 3, 9, 3, 0, -8 }, +/* 'g' 0x67 */ { 805, 6, 10, 7, 0, -6 }, +/* 'h' 0x68 */ { 813, 5, 9, 6, 1, -8 }, +/* 'i' 0x69 */ { 819, 1, 9, 3, 1, -8 }, +/* 'j' 0x6A */ { 821, 2, 12, 3, 0, -8 }, +/* 'k' 0x6B */ { 824, 5, 9, 6, 1, -8 }, +/* 'l' 0x6C */ { 830, 1, 9, 3, 1, -8 }, +/* 'm' 0x6D */ { 832, 8, 7, 10, 1, -6 }, +/* 'n' 0x6E */ { 839, 5, 7, 6, 1, -6 }, +/* 'o' 0x6F */ { 844, 6, 7, 6, 0, -6 }, +/* 'p' 0x70 */ { 850, 5, 9, 7, 1, -6 }, +/* 'q' 0x71 */ { 856, 6, 9, 7, 0, -6 }, +/* 'r' 0x72 */ { 863, 3, 7, 4, 1, -6 }, +/* 's' 0x73 */ { 866, 5, 7, 6, 0, -6 }, +/* 't' 0x74 */ { 871, 3, 8, 3, 0, -7 }, +/* 'u' 0x75 */ { 874, 5, 7, 6, 1, -6 }, +/* 'v' 0x76 */ { 879, 6, 7, 6, 0, -6 }, +/* 'w' 0x77 */ { 885, 8, 7, 9, 0, -6 }, +/* 'x' 0x78 */ { 892, 5, 7, 6, 0, -6 }, +/* 'y' 0x79 */ { 897, 5, 10, 6, 0, -6 }, +/* 'z' 0x7A */ { 904, 5, 7, 6, 0, -6 }, +/* '{' 0x7B */ { 909, 2, 12, 4, 1, -8 }, +/* '|' 0x7C */ { 912, 1, 11, 3, 1, -8 }, +/* '}' 0x7D */ { 914, 2, 12, 4, 1, -8 }, +/* '~' 0x7E */ { 917, 6, 2, 6, 0, -4 }, +/* 0x7F */ { 919, 0, 0, 0, 0, 0 }, +/* 0x80 */ { 919, 9, 11, 9, 0, -8 }, +/* 0x81 */ { 932, 6, 10, 7, 1, -9 }, +/* 0x82 */ { 940, 1, 3, 3, 1, 0 }, +/* 0x83 */ { 941, 4, 9, 5, 1, -8 }, +/* 0x84 */ { 946, 3, 3, 5, 1, 0 }, +/* 0x85 */ { 948, 5, 1, 7, 1, 0 }, +/* 0x86 */ { 949, 5, 11, 7, 1, -8 }, +/* 0x87 */ { 956, 5, 11, 7, 1, -8 }, +/* 0x88 */ { 963, 7, 9, 8, 0, -8 }, +/* 0x89 */ { 971, 12, 9, 12, 0, -8 }, +/* 0x8A */ { 985, 11, 9, 13, 1, -8 }, +/* 0x8B */ { 998, 2, 3, 4, 1, -4 }, +/* 0x8C */ { 999, 11, 9, 12, 1, -8 }, +/* 0x8D */ { 1012, 6, 11, 8, 1, -10 }, +/* 0x8E */ { 1021, 9, 9, 9, 0, -8 }, +/* 0x8F */ { 1032, 7, 11, 9, 1, -8 }, +/* 0x90 */ { 1042, 6, 11, 7, 0, -8 }, +/* 0x91 */ { 1051, 1, 3, 3, 1, -8 }, +/* 0x92 */ { 1052, 1, 3, 2, 1, -8 }, +/* 0x93 */ { 1053, 3, 3, 5, 1, -8 }, +/* 0x94 */ { 1055, 3, 3, 5, 1, -8 }, +/* 0x95 */ { 1057, 3, 3, 5, 1, -5 }, +/* 0x96 */ { 1059, 6, 1, 6, 0, -3 }, +/* 0x97 */ { 1060, 12, 1, 12, 0, -3 }, +/* 0x98 */ { 1062, 0, 0, 8, 0, 0 }, +/* 0x99 */ { 1062, 11, 7, 12, 1, -8 }, +/* 0x9A */ { 1072, 9, 6, 10, 0, -5 }, +/* 0x9B */ { 1079, 2, 3, 3, 1, -4 }, +/* 0x9C */ { 1080, 9, 6, 10, 1, -5 }, +/* 0x9D */ { 1087, 4, 9, 6, 1, -8 }, +/* 0x9E */ { 1092, 6, 9, 7, 0, -8 }, +/* 0x9F */ { 1099, 5, 7, 7, 1, -5 }, +/* 0xA0 */ { 1104, 0, 0, 3, 0, 0 }, +/* 0xA1 */ { 1104, 7, 11, 7, 0, -10 }, +/* 0xA2 */ { 1114, 5, 11, 6, 0, -7 }, +/* 0xA3 */ { 1121, 5, 9, 6, 0, -8 }, +/* 0xA4 */ { 1127, 5, 4, 7, 1, -5 }, +/* 0xA5 */ { 1130, 6, 10, 7, 1, -9 }, +/* 0xA6 */ { 1138, 1, 12, 3, 1, -8 }, +/* 0xA7 */ { 1140, 5, 12, 7, 1, -8 }, +/* 0xA8 */ { 1148, 6, 11, 8, 1, -10 }, +/* 0xA9 */ { 1157, 9, 9, 10, 0, -8 }, +/* 0xAA */ { 1168, 7, 9, 9, 1, -8 }, +/* 0xAB */ { 1176, 4, 4, 6, 1, -4 }, +/* 0xAC */ { 1178, 2, 12, 3, 0, -8 }, +/* 0xAD */ { 1181, 0, 0, 0, 0, 0 }, +/* 0xAE */ { 1181, 9, 9, 10, 0, -8 }, +/* 0xAF */ { 1192, 3, 11, 3, 0, -10 }, +/* 0xB0 */ { 1197, 4, 4, 7, 2, -8 }, +/* 0xB1 */ { 1199, 5, 7, 7, 1, -6 }, +/* 0xB2 */ { 1204, 1, 9, 3, 1, -8 }, +/* 0xB3 */ { 1206, 1, 9, 3, 1, -8 }, +/* 0xB4 */ { 1208, 3, 8, 5, 1, -7 }, +/* 0xB5 */ { 1211, 6, 9, 7, 1, -6 }, +/* 0xB6 */ { 1218, 6, 10, 6, 1, -8 }, +/* 0xB7 */ { 1226, 1, 1, 3, 1, -2 }, +/* 0xB8 */ { 1227, 6, 9, 7, 0, -8 }, +/* 0xB9 */ { 1234, 9, 9, 11, 1, -8 }, +/* 0xBA */ { 1245, 6, 6, 6, 0, -5 }, +/* 0xBB */ { 1250, 4, 4, 6, 1, -5 }, +/* 0xBC */ { 1252, 2, 12, 3, 0, -8 }, +/* 0xBD */ { 1255, 6, 9, 8, 1, -8 }, +/* 0xBE */ { 1262, 5, 6, 6, 0, -5 }, +/* 0xBF */ { 1266, 3, 9, 3, 0, -8 }, +/* 0xC0 */ { 1270, 8, 9, 8, 0, -8 }, +/* 0xC1 */ { 1279, 6, 9, 8, 1, -8 }, +/* 0xC2 */ { 1286, 6, 9, 8, 1, -8 }, +/* 0xC3 */ { 1293, 6, 9, 7, 1, -8 }, +/* 0xC4 */ { 1300, 9, 11, 10, 0, -8 }, +/* 0xC5 */ { 1313, 6, 9, 8, 1, -8 }, +/* 0xC6 */ { 1320, 9, 9, 11, 1, -8 }, +/* 0xC7 */ { 1331, 6, 9, 8, 1, -8 }, +/* 0xC8 */ { 1338, 7, 9, 9, 1, -8 }, +/* 0xC9 */ { 1346, 7, 11, 9, 1, -10 }, +/* 0xCA */ { 1356, 6, 9, 8, 1, -8 }, +/* 0xCB */ { 1363, 7, 9, 8, 0, -8 }, +/* 0xCC */ { 1371, 8, 9, 10, 1, -8 }, +/* 0xCD */ { 1380, 7, 9, 9, 1, -8 }, +/* 0xCE */ { 1388, 8, 9, 10, 1, -8 }, +/* 0xCF */ { 1397, 7, 9, 9, 1, -8 }, +/* 0xD0 */ { 1405, 6, 9, 8, 1, -8 }, +/* 0xD1 */ { 1412, 7, 9, 9, 1, -8 }, +/* 0xD2 */ { 1420, 7, 9, 7, 0, -8 }, +/* 0xD3 */ { 1428, 7, 9, 7, 0, -8 }, +/* 0xD4 */ { 1436, 9, 9, 10, 1, -8 }, +/* 0xD5 */ { 1447, 6, 9, 8, 1, -8 }, +/* 0xD6 */ { 1454, 8, 11, 9, 1, -8 }, +/* 0xD7 */ { 1465, 6, 9, 8, 1, -8 }, +/* 0xD8 */ { 1472, 8, 9, 10, 1, -8 }, +/* 0xD9 */ { 1481, 9, 11, 10, 1, -8 }, +/* 0xDA */ { 1494, 10, 9, 10, 0, -8 }, +/* 0xDB */ { 1506, 9, 9, 10, 1, -8 }, +/* 0xDC */ { 1517, 6, 9, 8, 1, -8 }, +/* 0xDD */ { 1524, 7, 9, 9, 1, -8 }, +/* 0xDE */ { 1532, 10, 9, 12, 1, -8 }, +/* 0xDF */ { 1544, 6, 9, 8, 1, -8 }, +/* 0xE0 */ { 1551, 6, 6, 7, 0, -5 }, +/* 0xE1 */ { 1556, 6, 9, 7, 0, -8 }, +/* 0xE2 */ { 1563, 5, 6, 6, 1, -5 }, +/* 0xE3 */ { 1567, 4, 6, 5, 1, -5 }, +/* 0xE4 */ { 1570, 7, 7, 7, 0, -5 }, +/* 0xE5 */ { 1577, 6, 6, 7, 0, -5 }, +/* 0xE6 */ { 1582, 8, 6, 9, 1, -5 }, +/* 0xE7 */ { 1588, 6, 6, 6, 0, -5 }, +/* 0xE8 */ { 1593, 5, 6, 7, 1, -5 }, +/* 0xE9 */ { 1597, 5, 8, 7, 1, -7 }, +/* 0xEA */ { 1602, 4, 6, 6, 1, -5 }, +/* 0xEB */ { 1605, 5, 6, 6, 0, -5 }, +/* 0xEC */ { 1609, 6, 6, 7, 1, -5 }, +/* 0xED */ { 1614, 5, 6, 7, 1, -5 }, +/* 0xEE */ { 1618, 6, 6, 7, 0, -5 }, +/* 0xEF */ { 1623, 5, 6, 7, 1, -5 }, +/* 0xF0 */ { 1627, 5, 9, 7, 1, -5 }, +/* 0xF1 */ { 1633, 6, 6, 6, 0, -5 }, +/* 0xF2 */ { 1638, 5, 6, 5, 0, -5 }, +/* 0xF3 */ { 1642, 5, 9, 6, 0, -5 }, +/* 0xF4 */ { 1648, 10, 11, 10, 0, -7 }, +/* 0xF5 */ { 1662, 5, 6, 6, 0, -5 }, +/* 0xF6 */ { 1666, 6, 7, 7, 1, -5 }, +/* 0xF7 */ { 1672, 4, 6, 6, 1, -5 }, +/* 0xF8 */ { 1675, 6, 6, 8, 1, -5 }, +/* 0xF9 */ { 1680, 7, 7, 9, 1, -5 }, +/* 0xFA */ { 1687, 7, 6, 8, 0, -5 }, +/* 0xFB */ { 1693, 6, 6, 8, 1, -5 }, +/* 0xFC */ { 1698, 5, 6, 6, 1, -5 }, +/* 0xFD */ { 1702, 5, 6, 6, 1, -5 }, +/* 0xFE */ { 1706, 8, 6, 9, 1, -5 }, +/* 0xFF */ { 1712, 5, 6, 7, 1, -5 }, }; -const GFXfont FreeSans6pt_Win1251 PROGMEM = {(uint8_t *)FreeSans6pt_Win1251Bitmaps, (GFXglyph *)FreeSans6pt_Win1251Glyphs, 0x20, - 0xFF, 14}; +const GFXfont FreeSans6pt_Win1251 PROGMEM = { +(uint8_t*)FreeSans6pt_Win1251Bitmaps, +(GFXglyph*)FreeSans6pt_Win1251Glyphs, +0x01, 0xFF, 14 +}; diff --git a/src/graphics/niche/Fonts/FreeSans6pt_Win1252.h b/src/graphics/niche/Fonts/FreeSans6pt_Win1252.h index 32f995270..b17be8756 100644 --- a/src/graphics/niche/Fonts/FreeSans6pt_Win1252.h +++ b/src/graphics/niche/Fonts/FreeSans6pt_Win1252.h @@ -1,457 +1,527 @@ +// trunk-ignore-all(clang-format) #pragma once +/* PROPERTIES + +FONT_NAME FreeSans6pt_Win1252 +*/ const uint8_t FreeSans6pt_Win1252Bitmaps[] PROGMEM = { - /* ' ' 0x20 */ - 0xFC, 0x80, /* '!' 0x21 */ - 0xB6, 0x80, /* '"' 0x22 */ - 0x24, 0x51, 0xF9, 0x42, 0x9F, 0x92, 0x28, /* '#' 0x23 */ - 0x10, 0xE5, 0x55, 0x50, 0xE1, 0x65, 0x55, 0xE1, 0x00, /* '$' 0x24 */ - 0x71, 0x24, 0x89, 0x22, 0x50, 0x74, 0x02, 0x70, 0xA4, 0x49, 0x11, 0xC0, /* '%' 0x25 */ - 0x71, 0x24, 0x9C, 0x62, 0x58, 0xA7, 0xF4, /* '&' 0x26 */ - 0xE0, /* ''' 0x27 */ - 0x5A, 0xAA, 0x94, /* '(' 0x28 */ - 0x89, 0x12, 0x49, 0x29, 0x00, /* ')' 0x29 */ - 0x5E, 0x80, /* '*' 0x2A */ - 0x21, 0x3E, 0x42, 0x00, /* '+' 0x2B */ - 0xE0, /* ',' 0x2C */ - 0xC0, /* '-' 0x2D */ - 0x80, /* '.' 0x2E */ - 0x24, 0xA4, 0xA4, 0x80, /* '/' 0x2F */ - 0x76, 0xE3, 0x18, 0xC6, 0x3B, 0x70, /* '0' 0x30 */ - 0x27, 0x92, 0x49, 0x20, /* '1' 0x31 */ - 0x79, 0x10, 0x41, 0x08, 0xC6, 0x10, 0xFC, /* '2' 0x32 */ - 0x79, 0x30, 0x43, 0x18, 0x10, 0x71, 0x78, /* '3' 0x33 */ - 0x08, 0x61, 0x8A, 0x49, 0x2F, 0xC2, 0x08, /* '4' 0x34 */ - 0xFC, 0x21, 0xE8, 0x84, 0x31, 0xF0, /* '5' 0x35 */ - 0x74, 0x61, 0xE8, 0xC6, 0x31, 0x70, /* '6' 0x36 */ - 0xF8, 0x44, 0x22, 0x11, 0x08, 0x40, /* '7' 0x37 */ - 0x39, 0x34, 0x53, 0x39, 0x1C, 0x51, 0x38, /* '8' 0x38 */ - 0x39, 0x3C, 0x71, 0x4C, 0xF0, 0x53, 0x78, /* '9' 0x39 */ - 0x82, /* ':' 0x3A */ - 0x87, /* ';' 0x3B */ - 0x3E, 0x30, 0x60, 0x80, /* '<' 0x3C */ - 0xF8, 0x3E, /* '=' 0x3D */ - 0xE0, 0xC6, 0xC8, 0x00, /* '>' 0x3E */ - 0x74, 0x42, 0x11, 0x10, 0x80, 0x20, /* '?' 0x3F */ - 0x0F, 0x86, 0x19, 0x9A, 0xA4, 0xD9, 0x13, 0x22, 0x56, 0xDA, 0x6E, 0x60, 0x06, 0x00, 0x3C, 0x00, /* '@' 0x40 */ - 0x18, 0x18, 0x24, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, /* 'A' 0x41 */ - 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xFC, /* 'B' 0x42 */ - 0x3E, 0x63, 0x40, 0x40, 0xC0, 0x40, 0x41, 0x63, 0x3E, /* 'C' 0x43 */ - 0xF9, 0x0A, 0x1C, 0x18, 0x30, 0x61, 0xC2, 0xF8, /* 'D' 0x44 */ - 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, /* 'E' 0x45 */ - 0xFE, 0x08, 0x20, 0xFA, 0x08, 0x20, 0x80, /* 'F' 0x46 */ - 0x1E, 0x61, 0x40, 0x40, 0xC7, 0x41, 0x41, 0x63, 0x1D, /* 'G' 0x47 */ - 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, /* 'H' 0x48 */ - 0xFF, 0x80, /* 'I' 0x49 */ - 0x08, 0x42, 0x10, 0x87, 0x29, 0x70, /* 'J' 0x4A */ - 0x85, 0x12, 0x45, 0x0D, 0x13, 0x22, 0x42, 0x86, /* 'K' 0x4B */ - 0x84, 0x21, 0x08, 0x42, 0x10, 0xF8, /* 'L' 0x4C */ - 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, /* 'M' 0x4D */ - 0x83, 0x86, 0x8D, 0x19, 0x33, 0x62, 0xC3, 0x86, /* 'N' 0x4E */ - 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x06, 0xC6, 0x1E, 0x00, /* 'O' 0x4F */ - 0xFA, 0x18, 0x61, 0xFA, 0x08, 0x20, 0x80, /* 'P' 0x50 */ - 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x16, 0xC6, 0x1F, 0x00, 0x40, /* 'Q' 0x51 */ - 0xFD, 0x0E, 0x1C, 0x2F, 0x90, 0xA1, 0x42, 0x86, /* 'R' 0x52 */ - 0x7A, 0x18, 0x30, 0x78, 0x38, 0x61, 0x78, /* 'S' 0x53 */ - 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, /* 'T' 0x54 */ - 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xE2, 0x78, /* 'U' 0x55 */ - 0xC2, 0x85, 0x0B, 0x22, 0x44, 0x8E, 0x0C, 0x18, /* 'V' 0x56 */ - 0xC4, 0x28, 0xCD, 0x29, 0x25, 0x24, 0xA4, 0x52, 0x8C, 0x61, 0x8C, 0x31, 0x80, /* 'W' 0x57 */ - 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xA3, 0x84, /* 'X' 0x58 */ - 0xC3, 0x42, 0x24, 0x34, 0x18, 0x08, 0x08, 0x08, 0x08, /* 'Y' 0x59 */ - 0x7E, 0x0C, 0x30, 0x41, 0x06, 0x18, 0x20, 0xFE, /* 'Z' 0x5A */ - 0xEA, 0xAA, 0xAB, /* '[' 0x5B */ - 0x92, 0x24, 0x89, 0x20, /* '\' 0x5C */ - 0xD5, 0x55, 0x57, /* ']' 0x5D */ - 0x46, 0xA9, /* '^' 0x5E */ - 0xFE, /* '_' 0x5F */ - 0x80, /* '`' 0x60 */ - 0x79, 0x20, 0x4F, 0xC6, 0x37, 0x40, /* 'a' 0x61 */ - 0x84, 0x3D, 0x18, 0xC6, 0x31, 0xF0, /* 'b' 0x62 */ - 0x39, 0x3C, 0x20, 0xC1, 0x33, 0x80, /* 'c' 0x63 */ - 0x04, 0x13, 0xD3, 0xC6, 0x1C, 0x53, 0x3C, /* 'd' 0x64 */ - 0x39, 0x38, 0x7F, 0x81, 0x13, 0x80, /* 'e' 0x65 */ - 0x6B, 0xA4, 0x92, 0x40, /* 'f' 0x66 */ - 0x35, 0x3C, 0x61, 0xC5, 0x33, 0x41, 0x4D, 0xE0, /* 'g' 0x67 */ - 0x84, 0x3D, 0x38, 0xC6, 0x31, 0x88, /* 'h' 0x68 */ - 0xBF, 0x80, /* 'i' 0x69 */ - 0x45, 0x55, 0x57, /* 'j' 0x6A */ - 0x84, 0x25, 0x4E, 0x52, 0xD2, 0x88, /* 'k' 0x6B */ - 0xFF, 0x80, /* 'l' 0x6C */ - 0xF7, 0x99, 0x91, 0x91, 0x91, 0x91, 0x91, /* 'm' 0x6D */ - 0xF4, 0x63, 0x18, 0xC6, 0x20, /* 'n' 0x6E */ - 0x39, 0x3C, 0x61, 0xC5, 0x33, 0x80, /* 'o' 0x6F */ - 0xF4, 0x63, 0x18, 0xC7, 0xD0, 0x80, /* 'p' 0x70 */ - 0x3D, 0x3C, 0x61, 0xC5, 0x37, 0x41, 0x04, /* 'q' 0x71 */ - 0xF2, 0x49, 0x20, /* 'r' 0x72 */ - 0x7A, 0x50, 0xE0, 0xE5, 0xE0, /* 's' 0x73 */ - 0x5D, 0x24, 0x93, /* 't' 0x74 */ - 0x8C, 0x63, 0x18, 0xCF, 0xA0, /* 'u' 0x75 */ - 0x85, 0x24, 0x92, 0x30, 0xC3, 0x00, /* 'v' 0x76 */ - 0x89, 0x59, 0x59, 0x55, 0x56, 0x26, 0x26, /* 'w' 0x77 */ - 0x4A, 0x4C, 0x43, 0x27, 0x20, /* 'x' 0x78 */ - 0x8A, 0x52, 0xA5, 0x18, 0x84, 0x22, 0x00, /* 'y' 0x79 */ - 0x78, 0x44, 0x46, 0x23, 0xE0, /* 'z' 0x7A */ - 0x6A, 0xAA, 0xA9, /* '{' 0x7B */ - 0xFF, 0xE0, /* '|' 0x7C */ - 0x95, 0x55, 0x56, /* '}' 0x7D */ - 0x66, 0x60, /* '~' 0x7E */ - 0xFF, 0xC0, 0x67, 0x34, 0x58, 0x4C, 0x46, 0x03, 0x11, 0x80, 0xFF, 0xC0, /* 0x7F */ - 0x1C, 0x45, 0x07, 0xE4, 0x1F, 0x10, 0x10, 0x1E, /* 0x80 */ - /* 0x81 */ - 0xE0, /* 0x82 */ - 0x6B, 0xA4, 0x92, 0x49, 0x60, /* 0x83 */ - 0xB6, 0x80, /* 0x84 */ - 0xA8, /* 0x85 */ - 0x21, 0x09, 0xF2, 0x10, 0x84, 0x21, 0x08, /* 0x86 */ - 0x21, 0x09, 0xF2, 0x10, 0x84, 0xF9, 0x08, /* 0x87 */ - 0x54, /* 0x88 */ - 0x62, 0x09, 0x40, 0x98, 0x06, 0x80, 0x10, 0x01, 0x66, 0x29, 0x92, 0x99, 0x06, 0x60, /* 0x89 */ - 0x28, 0x47, 0xA1, 0x83, 0x07, 0x83, 0x87, 0x17, 0x80, /* 0x8A */ - 0x64, /* 0x8B */ - 0x3B, 0xE8, 0xC2, 0x08, 0x41, 0x08, 0x3F, 0x04, 0x20, 0x82, 0x30, 0x3B, 0xE0, /* 0x8C */ - /* 0x8D */ - 0x14, 0x11, 0xF8, 0x30, 0xC1, 0x04, 0x18, 0x61, 0xFC, /* 0x8E */ - /* 0x8F */ - /* 0x90 */ - 0xE0, /* 0x91 */ - 0xE0, /* 0x92 */ - 0xB6, 0x80, /* 0x93 */ - 0xB6, 0x80, /* 0x94 */ - 0xFF, 0x80, /* 0x95 */ - 0xFC, /* 0x96 */ - 0xFF, 0xF0, /* 0x97 */ - 0xDB, /* 0x98 */ - 0xE6, 0x28, 0xCD, 0x19, 0xA3, 0x34, 0x6A, 0x8B, 0x51, 0x68, /* 0x99 */ - 0x52, 0x69, 0x8E, 0x19, 0x60, /* 0x9A */ - 0x98, /* 0x9B */ - 0x7B, 0xD9, 0xCE, 0x10, 0xC3, 0xF8, 0x41, 0x9C, 0x5E, 0xF0, /* 0x9C */ - /* 0x9D */ - 0x51, 0x1E, 0x11, 0x11, 0x88, 0xF8, /* 0x9E */ - 0x29, 0x05, 0x12, 0x22, 0x87, 0x04, 0x08, 0x10, 0x20, /* 0x9F */ - /* 0xA0 */ - 0xBF, 0x80, /* 0xA1 */ - 0x23, 0xAB, 0x4A, 0x52, 0xAE, 0x20, /* 0xA2 */ - 0x39, 0x14, 0x10, 0xF0, 0x82, 0x1C, 0x4C, /* 0xA3 */ - 0xFC, 0x63, 0xF0, /* 0xA4 */ - 0x8C, 0x54, 0xAF, 0x93, 0xE4, 0x20, /* 0xA5 */ - 0xF9, 0xF0, /* 0xA6 */ - 0x32, 0x91, 0xC9, 0x47, 0x26, 0x14, 0xA4, 0xC0, /* 0xA7 */ - 0xA0, /* 0xA8 */ - 0x3E, 0x3F, 0xB8, 0xF4, 0x1A, 0x0D, 0x17, 0x76, 0xC6, 0x3E, 0x00, /* 0xA9 */ - 0x61, 0x79, 0x60, /* 0xAA */ - 0x5A, 0xA5, /* 0xAB */ - 0xFC, 0x10, 0x40, /* 0xAC */ - /* 0xAD */ - 0x3E, 0x31, 0xB7, 0x72, 0x99, 0xCC, 0xC7, 0x56, 0xC6, 0x3E, 0x00, /* 0xAE */ - 0xE0, /* 0xAF */ - 0x69, 0x96, /* 0xB0 */ - 0x21, 0x3E, 0x42, 0x03, 0xE0, /* 0xB1 */ - 0x69, 0x3C, 0xF0, /* 0xB2 */ - 0x79, 0x29, 0x70, /* 0xB3 */ - 0x80, /* 0xB4 */ - 0x8A, 0x28, 0xA2, 0x8A, 0x6E, 0xE0, 0x80, /* 0xB5 */ - 0x7F, 0xAE, 0xBA, 0x68, 0xA2, 0x8A, 0x28, 0xA0, /* 0xB6 */ - 0x80, /* 0xB7 */ - 0x67, 0x80, /* 0xB8 */ - 0x75, 0x50, /* 0xB9 */ - 0x69, 0x96, 0xF0, /* 0xBA */ - 0xA5, 0x5A, /* 0xBB */ - 0x42, 0x30, 0x84, 0x41, 0x10, 0x48, 0x82, 0x61, 0x28, 0x8F, 0x20, 0x80, /* 0xBC */ - 0x40, 0x63, 0x11, 0x09, 0x74, 0xA8, 0x84, 0x44, 0x44, 0x43, 0x80, /* 0xBD */ - 0x71, 0x24, 0x82, 0x20, 0x50, 0x98, 0x9A, 0x61, 0x28, 0x4F, 0x20, 0x80, /* 0xBE */ - 0x20, 0x08, 0x44, 0x42, 0x11, 0x70, /* 0xBF */ - 0x10, 0x08, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC0 */ - 0x08, 0x10, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC1 */ - 0x18, 0x24, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC2 */ - 0x34, 0x2C, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC3 */ - 0x24, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, /* 0xC4 */ - 0x18, 0x24, 0x18, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, /* 0xC5 */ - 0x1F, 0xC5, 0x02, 0x40, 0x90, 0x47, 0xDF, 0x04, 0x42, 0x10, 0x87, 0xC0, /* 0xC6 */ - 0x3E, 0x61, 0xC0, 0x80, 0x80, 0x80, 0xC1, 0x63, 0x3E, 0x0C, 0x04, 0x1C, /* 0xC7 */ - 0x20, 0x40, 0x3F, 0x82, 0x0F, 0xA0, 0x83, 0xF0, /* 0xC8 */ - 0x08, 0x40, 0x3F, 0x82, 0x0F, 0xA0, 0x83, 0xF0, /* 0xC9 */ - 0x10, 0xA0, 0x3F, 0x82, 0x0F, 0xA0, 0x83, 0xF0, /* 0xCA */ - 0x28, 0x0F, 0xE0, 0x83, 0xE8, 0x20, 0x83, 0xF0, /* 0xCB */ - 0x91, 0x55, 0x50, /* 0xCC */ - 0x62, 0xAA, 0xA0, /* 0xCD */ - 0x54, 0x24, 0x92, 0x48, /* 0xCE */ - 0xA1, 0x24, 0x92, 0x48, /* 0xCF */ - 0x7C, 0x42, 0x41, 0x41, 0xF1, 0x41, 0x41, 0x42, 0x7C, /* 0xD0 */ - 0x14, 0x53, 0x0F, 0x1B, 0x32, 0x66, 0xC7, 0x87, 0x04, /* 0xD1 */ - 0x10, 0x04, 0x0F, 0x8C, 0x6C, 0x1C, 0x06, 0x03, 0x83, 0x63, 0x1F, 0x00, /* 0xD2 */ - 0x04, 0x04, 0x0F, 0x8C, 0x6C, 0x1C, 0x06, 0x03, 0x83, 0x63, 0x1F, 0x00, /* 0xD3 */ - 0x08, 0x0A, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, /* 0xD4 */ - 0x1A, 0x0B, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, /* 0xD5 */ - 0x14, 0x00, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, /* 0xD6 */ - 0x8A, 0x88, 0xA8, 0x80, /* 0xD7 */ - 0x3E, 0xB1, 0xB0, 0xF0, 0x98, 0x8C, 0x87, 0x86, 0xC6, 0xBE, 0x00, /* 0xD8 */ - 0x20, 0x22, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xD9 */ - 0x08, 0x22, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xDA */ - 0x10, 0x52, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xDB */ - 0x29, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, /* 0xDC */ - 0x09, 0x25, 0x12, 0x22, 0x87, 0x04, 0x08, 0x10, 0x20, /* 0xDD */ - 0x83, 0xE8, 0x61, 0x87, 0xE8, 0x20, 0x80, /* 0xDE */ - 0x7A, 0x18, 0x61, 0x8A, 0x18, 0x61, 0xB8, /* 0xDF */ - 0x20, 0x20, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE0 */ - 0x10, 0x40, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE1 */ - 0x10, 0x50, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE2 */ - 0x68, 0xB0, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE3 */ - 0x28, 0x01, 0xE4, 0x20, 0x47, 0xB1, 0x46, 0x76, /* 0xE4 */ - 0x10, 0x50, 0x43, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, /* 0xE5 */ - 0x7B, 0xA1, 0x90, 0x45, 0xFF, 0x84, 0x23, 0x17, 0x38, /* 0xE6 */ - 0x7B, 0x18, 0x20, 0x83, 0x17, 0x8C, 0x11, 0xC0, /* 0xE7 */ - 0x20, 0x40, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, /* 0xE8 */ - 0x10, 0x80, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, /* 0xE9 */ - 0x10, 0xA0, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, /* 0xEA */ - 0x28, 0x07, 0xB3, 0x87, 0xF8, 0x31, 0x78, /* 0xEB */ - 0x91, 0x55, 0x50, /* 0xEC */ - 0x62, 0xAA, 0xA0, /* 0xED */ - 0x54, 0x24, 0x92, 0x48, /* 0xEE */ - 0xA1, 0x24, 0x92, 0x40, /* 0xEF */ - 0x28, 0x42, 0x8F, 0x46, 0x18, 0x52, 0x30, /* 0xF0 */ - 0x6A, 0xC1, 0x6C, 0xC6, 0x31, 0x8C, 0x40, /* 0xF1 */ - 0x20, 0x40, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF2 */ - 0x10, 0x80, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF3 */ - 0x10, 0xA0, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF4 */ - 0x69, 0x60, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, /* 0xF5 */ - 0x28, 0x07, 0xB3, 0x86, 0x18, 0x73, 0x78, /* 0xF6 */ - 0x20, 0x3E, 0x02, 0x00, /* 0xF7 */ - 0x7F, 0x39, 0x69, 0xC7, 0x3F, 0x80, /* 0xF8 */ - 0x41, 0x23, 0x18, 0xC6, 0x33, 0x68, /* 0xF9 */ - 0x11, 0x23, 0x18, 0xC6, 0x33, 0x68, /* 0xFA */ - 0x22, 0x81, 0x18, 0xC6, 0x31, 0x9B, 0x40, /* 0xFB */ - 0x50, 0x23, 0x18, 0xC6, 0x33, 0x68, /* 0xFC */ - 0x10, 0x88, 0x52, 0x49, 0x23, 0x0C, 0x30, 0x82, 0x18, /* 0xFD */ - 0x84, 0x3D, 0xB8, 0xC6, 0x3B, 0xF4, 0x20, /* 0xFE */ - 0x28, 0x08, 0x52, 0x49, 0x23, 0x0C, 0x30, 0x82, 0x18, /* 0xFF */ +/* 0x01 */ 0x1C, 0x0A, 0x05, 0x04, 0xFE, 0x08, 0x1C, 0x02, 0x07, 0xE0, 0x9F, 0xC0, +/* 0x02 */ 0x3F, 0xF0, 0x40, 0xE0, 0x10, 0x3F, 0x04, 0x9E, 0x28, 0x14, 0x0E, 0x00, +/* 0x03 */ 0x3F, 0x10, 0x28, 0x06, 0x49, 0x80, 0x60, 0x19, 0x26, 0x31, 0x40, 0x8F, 0xC0, +/* 0x04 */ 0x3F, 0x10, 0x2A, 0x16, 0x49, 0xA1, 0x60, 0x19, 0xE6, 0x31, 0x40, 0x8F, 0xC0, +/* 0x05 */ 0x28, 0x15, 0x2A, 0xB5, 0x55, 0xA8, 0x54, 0x12, 0x04, 0x41, 0x08, 0x81, 0xC0, +/* 0x06 */ 0x04, 0x08, 0x88, 0x82, 0x07, 0x01, 0x11, 0xA2, 0xC4, 0x40, 0x70, 0x20, 0x88, 0x88, 0x10, 0x00, +/* 0x07 */ +/* 0x08 */ 0x03, 0x83, 0x44, 0x48, 0x28, 0x01, 0x80, 0x17, 0xFE, 0x08, 0x45, 0x28, 0x84, 0x00, +/* 0x09 */ 0x01, 0xC0, 0x68, 0x82, 0x41, 0x10, 0x02, 0x80, 0x06, 0x00, 0x14, 0x00, 0x8F, 0xFC, +/* 0x0A */ +/* 0x0B */ 0x22, 0x2A, 0xA2, 0x30, 0x18, 0x0A, 0x09, 0x04, 0x44, 0x14, 0x04, 0x00, +/* 0x0C */ 0x46, 0x00, 0x19, 0x03, 0x21, 0x20, 0x93, 0x04, 0x20, 0x11, 0x80, 0x50, 0x02, 0x7F, 0xE0, +/* 0x0D */ +/* 0x0E */ 0x08, 0x0E, 0x08, 0x88, 0x24, 0x12, 0x09, 0x05, 0x01, 0xFF, 0x8A, 0x02, 0x00, +/* 0x0F */ 0x3F, 0x14, 0xAA, 0x16, 0x01, 0x92, 0x60, 0x18, 0xC6, 0x49, 0x40, 0x8F, 0xC0, +/* 0x10 */ 0x1B, 0x02, 0xA0, 0x54, 0x12, 0x42, 0x48, 0x49, 0x31, 0x1E, 0x23, 0xEA, 0xFE, 0x3C, +/* 0x11 */ 0x3F, 0x02, 0x00, 0x20, 0x6D, 0x27, 0xF8, 0x3F, 0xC1, 0xFE, 0x37, 0xD0, 0xBE, 0x40, 0xE1, 0xE2, 0x00, +/* 0x12 */ 0x12, 0x42, 0x20, 0x24, 0xC0, 0x29, 0x99, 0x05, 0x23, 0x30, 0xB0, 0x30, 0x00, +/* 0x13 */ 0x3F, 0x88, 0x0A, 0x44, 0xD5, 0x58, 0x03, 0x00, 0x67, 0xCC, 0x71, 0x40, 0x47, 0xF0, +/* 0x14 */ 0x3F, 0x18, 0x69, 0x26, 0x85, 0xA1, 0x6C, 0xD8, 0x06, 0x31, 0x40, 0x8F, 0xC0, +/* 0x15 */ 0x3F, 0x11, 0x00, 0xE8, 0x03, 0xA0, 0x1F, 0xB3, 0x7E, 0x00, 0xE9, 0xE0, 0x23, 0x00, 0x40, 0x40, 0xFE, 0x00, +/* 0x16 */ 0x30, 0x38, 0x3A, 0x3E, 0x6E, 0xEB, 0xC3, 0xC3, 0x66, 0x3C, +/* 0x17 */ 0x3F, 0x04, 0x00, 0x82, 0x88, 0x5C, 0xA4, 0x49, 0x22, 0x81, 0x98, 0xC4, 0x40, 0xA3, 0xF0, +/* 0x18 */ 0x07, 0x80, 0x42, 0x04, 0x08, 0x21, 0x41, 0x42, 0x60, 0x0E, 0x8C, 0xB2, 0x89, 0x50, 0x52, 0x82, 0x80, +/* 0x19 */ 0x3F, 0xC4, 0x02, 0x80, 0x18, 0x01, 0xB3, 0x1B, 0xB9, 0x80, 0x19, 0xE1, 0x40, 0x23, 0xFC, +/* 0x1A */ 0xFF, 0xC0, 0x67, 0x34, 0x58, 0x4C, 0x46, 0x03, 0x11, 0x80, 0xFF, 0xC0, +/* 0x1B */ 0x0F, 0xC0, 0x40, 0x82, 0x49, 0x08, 0x04, 0x00, 0x00, 0x12, 0x02, 0x31, 0x34, 0x0B, 0x88, 0x45, 0x00, 0x20, +/* 0x1C */ 0x3F, 0x88, 0x0A, 0x44, 0xC9, 0x19, 0x3B, 0x00, 0x60, 0x4C, 0x71, 0x40, 0x47, 0xF0, +/* 0x1D */ 0x3F, 0x8B, 0x0A, 0x00, 0xC8, 0x18, 0x13, 0x00, 0x48, 0xCA, 0xC1, 0x44, 0x53, 0x30, +/* 0x1E */ 0x19, 0xC2, 0x02, 0x50, 0x1E, 0x49, 0x80, 0x12, 0x01, 0x27, 0x92, 0x01, 0x10, 0x20, 0xFC, +/* 0x1F */ 0x30, 0x1C, 0x0C, 0x3E, 0x7E, 0xCF, 0x07, 0xC7, 0x7F, 0x3F, +/* ' ' 0x20 */ +/* '!' 0x21 */ 0xFC, 0x80, +/* '"' 0x22 */ 0xB6, 0x80, +/* '#' 0x23 */ 0x24, 0x51, 0xF9, 0x42, 0x9F, 0x92, 0x28, +/* '$' 0x24 */ 0x10, 0xE5, 0x55, 0x50, 0xE1, 0x65, 0x55, 0xE1, 0x00, +/* '%' 0x25 */ 0x71, 0x24, 0x89, 0x22, 0x50, 0x74, 0x02, 0x70, 0xA4, 0x49, 0x11, 0xC0, +/* '&' 0x26 */ 0x71, 0x24, 0x9C, 0x62, 0x58, 0xA7, 0xF4, +/* ''' 0x27 */ 0xE0, +/* '(' 0x28 */ 0x5A, 0xAA, 0x94, +/* ')' 0x29 */ 0x89, 0x12, 0x49, 0x29, 0x00, +/* '*' 0x2A */ 0x5E, 0x80, +/* '+' 0x2B */ 0x21, 0x3E, 0x42, 0x00, +/* ',' 0x2C */ 0xE0, +/* '-' 0x2D */ 0xC0, +/* '.' 0x2E */ 0x80, +/* '/' 0x2F */ 0x24, 0xA4, 0xA4, 0x80, +/* '0' 0x30 */ 0x76, 0xE3, 0x18, 0xC6, 0x3B, 0x70, +/* '1' 0x31 */ 0x27, 0x92, 0x49, 0x20, +/* '2' 0x32 */ 0x79, 0x10, 0x41, 0x08, 0xC6, 0x10, 0xFC, +/* '3' 0x33 */ 0x79, 0x30, 0x43, 0x18, 0x10, 0x71, 0x78, +/* '4' 0x34 */ 0x08, 0x61, 0x8A, 0x49, 0x2F, 0xC2, 0x08, +/* '5' 0x35 */ 0xFC, 0x21, 0xE8, 0x84, 0x31, 0xF0, +/* '6' 0x36 */ 0x74, 0x61, 0xE8, 0xC6, 0x31, 0x70, +/* '7' 0x37 */ 0xF8, 0x44, 0x22, 0x11, 0x08, 0x40, +/* '8' 0x38 */ 0x39, 0x34, 0x53, 0x39, 0x1C, 0x51, 0x38, +/* '9' 0x39 */ 0x39, 0x3C, 0x71, 0x4C, 0xF0, 0x53, 0x78, +/* ':' 0x3A */ 0x82, +/* ';' 0x3B */ 0x87, +/* '<' 0x3C */ 0x3E, 0x30, 0x60, 0x80, +/* '=' 0x3D */ 0xF8, 0x3E, +/* '>' 0x3E */ 0xE0, 0xC6, 0xC8, 0x00, +/* '?' 0x3F */ 0x74, 0x42, 0x11, 0x10, 0x80, 0x20, +/* '@' 0x40 */ 0x0F, 0x86, 0x19, 0x9A, 0xA4, 0xD9, 0x13, 0x22, 0x56, 0xDA, 0x6E, 0x60, 0x06, 0x00, 0x3C, 0x00, +/* 'A' 0x41 */ 0x18, 0x18, 0x24, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, +/* 'B' 0x42 */ 0xFA, 0x18, 0x61, 0xFA, 0x18, 0x61, 0xFC, +/* 'C' 0x43 */ 0x3E, 0x63, 0x40, 0x40, 0xC0, 0x40, 0x41, 0x63, 0x3E, +/* 'D' 0x44 */ 0xF9, 0x0A, 0x1C, 0x18, 0x30, 0x61, 0xC2, 0xF8, +/* 'E' 0x45 */ 0xFE, 0x08, 0x20, 0xFE, 0x08, 0x20, 0xFC, +/* 'F' 0x46 */ 0xFE, 0x08, 0x20, 0xFA, 0x08, 0x20, 0x80, +/* 'G' 0x47 */ 0x1E, 0x61, 0x40, 0x40, 0xC7, 0x41, 0x41, 0x63, 0x1D, +/* 'H' 0x48 */ 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x60, 0xC1, 0x82, +/* 'I' 0x49 */ 0xFF, 0x80, +/* 'J' 0x4A */ 0x08, 0x42, 0x10, 0x87, 0x29, 0x70, +/* 'K' 0x4B */ 0x85, 0x12, 0x45, 0x0D, 0x13, 0x22, 0x42, 0x86, +/* 'L' 0x4C */ 0x84, 0x21, 0x08, 0x42, 0x10, 0xF8, +/* 'M' 0x4D */ 0xC3, 0xC3, 0xC3, 0xA5, 0xA5, 0xA5, 0x99, 0x99, 0x99, +/* 'N' 0x4E */ 0x83, 0x86, 0x8D, 0x19, 0x33, 0x62, 0xC3, 0x86, +/* 'O' 0x4F */ 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x06, 0xC6, 0x1E, 0x00, +/* 'P' 0x50 */ 0xFA, 0x18, 0x61, 0xFA, 0x08, 0x20, 0x80, +/* 'Q' 0x51 */ 0x1E, 0x31, 0x90, 0x68, 0x1C, 0x0A, 0x05, 0x16, 0xC6, 0x1F, 0x00, 0x40, +/* 'R' 0x52 */ 0xFD, 0x0E, 0x1C, 0x2F, 0x90, 0xA1, 0x42, 0x86, +/* 'S' 0x53 */ 0x7A, 0x18, 0x30, 0x78, 0x38, 0x61, 0x78, +/* 'T' 0x54 */ 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, +/* 'U' 0x55 */ 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xE2, 0x78, +/* 'V' 0x56 */ 0xC2, 0x85, 0x0B, 0x22, 0x44, 0x8E, 0x0C, 0x18, +/* 'W' 0x57 */ 0xC4, 0x28, 0xCD, 0x29, 0x25, 0x24, 0xA4, 0x52, 0x8C, 0x61, 0x8C, 0x31, 0x80, +/* 'X' 0x58 */ 0x87, 0x34, 0x8C, 0x30, 0xC4, 0xA3, 0x84, +/* 'Y' 0x59 */ 0xC3, 0x42, 0x24, 0x34, 0x18, 0x08, 0x08, 0x08, 0x08, +/* 'Z' 0x5A */ 0x7E, 0x0C, 0x30, 0x41, 0x06, 0x18, 0x20, 0xFE, +/* '[' 0x5B */ 0xEA, 0xAA, 0xAB, +/* '\' 0x5C */ 0x92, 0x24, 0x89, 0x20, +/* ']' 0x5D */ 0xD5, 0x55, 0x57, +/* '^' 0x5E */ 0x46, 0xA9, +/* '_' 0x5F */ 0xFE, +/* '`' 0x60 */ 0x80, +/* 'a' 0x61 */ 0x79, 0x20, 0x4F, 0xC6, 0x37, 0x40, +/* 'b' 0x62 */ 0x84, 0x3D, 0x18, 0xC6, 0x31, 0xF0, +/* 'c' 0x63 */ 0x39, 0x3C, 0x20, 0xC1, 0x33, 0x80, +/* 'd' 0x64 */ 0x04, 0x13, 0xD3, 0xC6, 0x1C, 0x53, 0x3C, +/* 'e' 0x65 */ 0x39, 0x38, 0x7F, 0x81, 0x13, 0x80, +/* 'f' 0x66 */ 0x6B, 0xA4, 0x92, 0x40, +/* 'g' 0x67 */ 0x35, 0x3C, 0x61, 0xC5, 0x33, 0x41, 0x4D, 0xE0, +/* 'h' 0x68 */ 0x84, 0x3D, 0x38, 0xC6, 0x31, 0x88, +/* 'i' 0x69 */ 0xBF, 0x80, +/* 'j' 0x6A */ 0x45, 0x55, 0x57, +/* 'k' 0x6B */ 0x84, 0x25, 0x4E, 0x52, 0xD2, 0x88, +/* 'l' 0x6C */ 0xFF, 0x80, +/* 'm' 0x6D */ 0xF7, 0x99, 0x91, 0x91, 0x91, 0x91, 0x91, +/* 'n' 0x6E */ 0xF4, 0x63, 0x18, 0xC6, 0x20, +/* 'o' 0x6F */ 0x39, 0x3C, 0x61, 0xC5, 0x33, 0x80, +/* 'p' 0x70 */ 0xF4, 0x63, 0x18, 0xC7, 0xD0, 0x80, +/* 'q' 0x71 */ 0x3D, 0x3C, 0x61, 0xC5, 0x37, 0x41, 0x04, +/* 'r' 0x72 */ 0xF2, 0x49, 0x20, +/* 's' 0x73 */ 0x7A, 0x50, 0xE0, 0xE5, 0xE0, +/* 't' 0x74 */ 0x5D, 0x24, 0x93, +/* 'u' 0x75 */ 0x8C, 0x63, 0x18, 0xCF, 0xA0, +/* 'v' 0x76 */ 0x85, 0x24, 0x92, 0x30, 0xC3, 0x00, +/* 'w' 0x77 */ 0x89, 0x59, 0x59, 0x55, 0x56, 0x26, 0x26, +/* 'x' 0x78 */ 0x4A, 0x4C, 0x43, 0x27, 0x20, +/* 'y' 0x79 */ 0x8A, 0x52, 0xA5, 0x18, 0x84, 0x22, 0x00, +/* 'z' 0x7A */ 0x78, 0x44, 0x46, 0x23, 0xE0, +/* '{' 0x7B */ 0x6A, 0xAA, 0xA9, +/* '|' 0x7C */ 0xFF, 0xE0, +/* '}' 0x7D */ 0x95, 0x55, 0x56, +/* '~' 0x7E */ 0x66, 0x60, +/* 0x7F */ +/* 0x80 */ 0x1C, 0x45, 0x07, 0xE4, 0x1F, 0x10, 0x10, 0x1E, +/* 0x81 */ +/* 0x82 */ 0xE0, +/* 0x83 */ 0x6B, 0xA4, 0x92, 0x49, 0x60, +/* 0x84 */ 0xB6, 0x80, +/* 0x85 */ 0xA8, +/* 0x86 */ 0x21, 0x09, 0xF2, 0x10, 0x84, 0x21, 0x08, +/* 0x87 */ 0x21, 0x09, 0xF2, 0x10, 0x84, 0xF9, 0x08, +/* 0x88 */ 0x54, +/* 0x89 */ 0x62, 0x09, 0x40, 0x98, 0x06, 0x80, 0x10, 0x01, 0x66, 0x29, 0x92, 0x99, 0x06, 0x60, +/* 0x8A */ 0x28, 0x47, 0xA1, 0x83, 0x07, 0x83, 0x87, 0x17, 0x80, +/* 0x8B */ 0x64, +/* 0x8C */ 0x3B, 0xE8, 0xC2, 0x08, 0x41, 0x08, 0x3F, 0x04, 0x20, 0x82, 0x30, 0x3B, 0xE0, +/* 0x8D */ +/* 0x8E */ 0x14, 0x11, 0xF8, 0x30, 0xC1, 0x04, 0x18, 0x61, 0xFC, +/* 0x8F */ +/* 0x90 */ +/* 0x91 */ 0xE0, +/* 0x92 */ 0xE0, +/* 0x93 */ 0xB6, 0x80, +/* 0x94 */ 0xB6, 0x80, +/* 0x95 */ 0xFF, 0x80, +/* 0x96 */ 0xFC, +/* 0x97 */ 0xFF, 0xF0, +/* 0x98 */ 0xDB, +/* 0x99 */ 0xE6, 0x28, 0xCD, 0x19, 0xA3, 0x34, 0x6A, 0x8B, 0x51, 0x68, +/* 0x9A */ 0x52, 0x69, 0x8E, 0x19, 0x60, +/* 0x9B */ 0x98, +/* 0x9C */ 0x7B, 0xD9, 0xCE, 0x10, 0xC3, 0xF8, 0x41, 0x9C, 0x5E, 0xF0, +/* 0x9D */ +/* 0x9E */ 0x51, 0x1E, 0x11, 0x11, 0x88, 0xF8, +/* 0x9F */ 0x29, 0x05, 0x12, 0x22, 0x87, 0x04, 0x08, 0x10, 0x20, +/* 0xA0 */ +/* 0xA1 */ 0xBF, 0x80, +/* 0xA2 */ 0x23, 0xAB, 0x4A, 0x52, 0xAE, 0x20, +/* 0xA3 */ 0x39, 0x14, 0x10, 0xF0, 0x82, 0x1C, 0x4C, +/* 0xA4 */ 0xFC, 0x63, 0xF0, +/* 0xA5 */ 0x8C, 0x54, 0xAF, 0x93, 0xE4, 0x20, +/* 0xA6 */ 0xF9, 0xF0, +/* 0xA7 */ 0x32, 0x91, 0xC9, 0x47, 0x26, 0x14, 0xA4, 0xC0, +/* 0xA8 */ 0xA0, +/* 0xA9 */ 0x3E, 0x3F, 0xB8, 0xF4, 0x1A, 0x0D, 0x17, 0x76, 0xC6, 0x3E, 0x00, +/* 0xAA */ 0x61, 0x79, 0x60, +/* 0xAB */ 0x5A, 0xA5, +/* 0xAC */ 0xFC, 0x10, 0x40, +/* 0xAD */ +/* 0xAE */ 0x3E, 0x31, 0xB7, 0x72, 0x99, 0xCC, 0xC7, 0x56, 0xC6, 0x3E, 0x00, +/* 0xAF */ 0xE0, +/* 0xB0 */ 0x69, 0x96, +/* 0xB1 */ 0x21, 0x3E, 0x42, 0x03, 0xE0, +/* 0xB2 */ 0x69, 0x3C, 0xF0, +/* 0xB3 */ 0x79, 0x29, 0x70, +/* 0xB4 */ 0x80, +/* 0xB5 */ 0x8A, 0x28, 0xA2, 0x8A, 0x6E, 0xE0, 0x80, +/* 0xB6 */ 0x7F, 0xAE, 0xBA, 0x68, 0xA2, 0x8A, 0x28, 0xA0, +/* 0xB7 */ 0x80, +/* 0xB8 */ 0x67, 0x80, +/* 0xB9 */ 0x75, 0x50, +/* 0xBA */ 0x69, 0x96, 0xF0, +/* 0xBB */ 0xA5, 0x5A, +/* 0xBC */ 0x42, 0x30, 0x84, 0x41, 0x10, 0x48, 0x82, 0x61, 0x28, 0x8F, 0x20, 0x80, +/* 0xBD */ 0x40, 0x63, 0x11, 0x09, 0x74, 0xA8, 0x84, 0x44, 0x44, 0x43, 0x80, +/* 0xBE */ 0x71, 0x24, 0x82, 0x20, 0x50, 0x98, 0x9A, 0x61, 0x28, 0x4F, 0x20, 0x80, +/* 0xBF */ 0x20, 0x08, 0x44, 0x42, 0x11, 0x70, +/* 0xC0 */ 0x10, 0x08, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, +/* 0xC1 */ 0x08, 0x10, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, +/* 0xC2 */ 0x18, 0x24, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, +/* 0xC3 */ 0x34, 0x2C, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, +/* 0xC4 */ 0x24, 0x00, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0x42, 0xC3, +/* 0xC5 */ 0x18, 0x24, 0x18, 0x18, 0x3C, 0x24, 0x24, 0x7E, 0x42, 0xC3, +/* 0xC6 */ 0x1F, 0xC5, 0x02, 0x40, 0x90, 0x47, 0xDF, 0x04, 0x42, 0x10, 0x87, 0xC0, +/* 0xC7 */ 0x3E, 0x61, 0xC0, 0x80, 0x80, 0x80, 0xC1, 0x63, 0x3E, 0x0C, 0x04, 0x1C, +/* 0xC8 */ 0x20, 0x40, 0x3F, 0x82, 0x0F, 0xA0, 0x83, 0xF0, +/* 0xC9 */ 0x08, 0x40, 0x3F, 0x82, 0x0F, 0xA0, 0x83, 0xF0, +/* 0xCA */ 0x10, 0xA0, 0x3F, 0x82, 0x0F, 0xA0, 0x83, 0xF0, +/* 0xCB */ 0x28, 0x0F, 0xE0, 0x83, 0xE8, 0x20, 0x83, 0xF0, +/* 0xCC */ 0x91, 0x55, 0x50, +/* 0xCD */ 0x62, 0xAA, 0xA0, +/* 0xCE */ 0x54, 0x24, 0x92, 0x48, +/* 0xCF */ 0xA1, 0x24, 0x92, 0x48, +/* 0xD0 */ 0x7C, 0x42, 0x41, 0x41, 0xF1, 0x41, 0x41, 0x42, 0x7C, +/* 0xD1 */ 0x14, 0x53, 0x0F, 0x1B, 0x32, 0x66, 0xC7, 0x87, 0x04, +/* 0xD2 */ 0x10, 0x04, 0x0F, 0x8C, 0x6C, 0x1C, 0x06, 0x03, 0x83, 0x63, 0x1F, 0x00, +/* 0xD3 */ 0x04, 0x04, 0x0F, 0x8C, 0x6C, 0x1C, 0x06, 0x03, 0x83, 0x63, 0x1F, 0x00, +/* 0xD4 */ 0x08, 0x0A, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, +/* 0xD5 */ 0x1A, 0x0B, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, +/* 0xD6 */ 0x14, 0x00, 0x00, 0x07, 0xC6, 0x36, 0x0E, 0x03, 0x01, 0xC1, 0xB1, 0x8F, 0x80, +/* 0xD7 */ 0x8A, 0x88, 0xA8, 0x80, +/* 0xD8 */ 0x3E, 0xB1, 0xB0, 0xF0, 0x98, 0x8C, 0x87, 0x86, 0xC6, 0xBE, 0x00, +/* 0xD9 */ 0x20, 0x22, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, +/* 0xDA */ 0x08, 0x22, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, +/* 0xDB */ 0x10, 0x52, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, +/* 0xDC */ 0x29, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0xC6, 0xF8, +/* 0xDD */ 0x09, 0x25, 0x12, 0x22, 0x87, 0x04, 0x08, 0x10, 0x20, +/* 0xDE */ 0x83, 0xE8, 0x61, 0x87, 0xE8, 0x20, 0x80, +/* 0xDF */ 0x7A, 0x18, 0x61, 0x8A, 0x18, 0x61, 0xB8, +/* 0xE0 */ 0x20, 0x20, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, +/* 0xE1 */ 0x10, 0x40, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, +/* 0xE2 */ 0x10, 0x50, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, +/* 0xE3 */ 0x68, 0xB0, 0x03, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, +/* 0xE4 */ 0x28, 0x01, 0xE4, 0x20, 0x47, 0xB1, 0x46, 0x76, +/* 0xE5 */ 0x10, 0x50, 0x43, 0xC8, 0x40, 0x8F, 0x62, 0x8C, 0xEC, +/* 0xE6 */ 0x7B, 0xA1, 0x90, 0x45, 0xFF, 0x84, 0x23, 0x17, 0x38, +/* 0xE7 */ 0x7B, 0x18, 0x20, 0x83, 0x17, 0x8C, 0x11, 0xC0, +/* 0xE8 */ 0x20, 0x40, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, +/* 0xE9 */ 0x10, 0x80, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, +/* 0xEA */ 0x10, 0xA0, 0x1E, 0xCE, 0x1F, 0xE0, 0xC5, 0xE0, +/* 0xEB */ 0x28, 0x07, 0xB3, 0x87, 0xF8, 0x31, 0x78, +/* 0xEC */ 0x91, 0x55, 0x50, +/* 0xED */ 0x62, 0xAA, 0xA0, +/* 0xEE */ 0x54, 0x24, 0x92, 0x48, +/* 0xEF */ 0xA1, 0x24, 0x92, 0x40, +/* 0xF0 */ 0x28, 0x42, 0x8F, 0x46, 0x18, 0x52, 0x30, +/* 0xF1 */ 0x6A, 0xC1, 0x6C, 0xC6, 0x31, 0x8C, 0x40, +/* 0xF2 */ 0x20, 0x40, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, +/* 0xF3 */ 0x10, 0x80, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, +/* 0xF4 */ 0x10, 0xA0, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, +/* 0xF5 */ 0x69, 0x60, 0x1E, 0xCE, 0x18, 0x61, 0xCD, 0xE0, +/* 0xF6 */ 0x28, 0x07, 0xB3, 0x86, 0x18, 0x73, 0x78, +/* 0xF7 */ 0x20, 0x3E, 0x02, 0x00, +/* 0xF8 */ 0x7F, 0x39, 0x69, 0xC7, 0x3F, 0x80, +/* 0xF9 */ 0x41, 0x23, 0x18, 0xC6, 0x33, 0x68, +/* 0xFA */ 0x11, 0x23, 0x18, 0xC6, 0x33, 0x68, +/* 0xFB */ 0x22, 0x81, 0x18, 0xC6, 0x31, 0x9B, 0x40, +/* 0xFC */ 0x50, 0x23, 0x18, 0xC6, 0x33, 0x68, +/* 0xFD */ 0x10, 0x88, 0x52, 0x49, 0x23, 0x0C, 0x30, 0x82, 0x18, +/* 0xFE */ 0x84, 0x3D, 0xB8, 0xC6, 0x3B, 0xF4, 0x20, +/* 0xFF */ 0x28, 0x08, 0x52, 0x49, 0x23, 0x0C, 0x30, 0x82, 0x18, }; const GFXglyph FreeSans6pt_Win1252Glyphs[] PROGMEM = { - /* ' ' 0x20 */ {0, 0, 0, 3, 0, 0}, - /* '!' 0x21 */ {0, 1, 9, 4, 2, -8}, - /* '"' 0x22 */ {2, 3, 3, 4, 0, -8}, - /* '#' 0x23 */ {4, 7, 8, 7, 0, -7}, - /* '$' 0x24 */ {11, 6, 11, 7, 0, -9}, - /* '%' 0x25 */ {20, 10, 9, 11, 0, -8}, - /* '&' 0x26 */ {32, 6, 9, 8, 1, -8}, - /* ''' 0x27 */ {39, 1, 3, 2, 1, -8}, - /* '(' 0x28 */ {40, 2, 11, 4, 1, -8}, - /* ')' 0x29 */ {43, 3, 11, 4, 0, -8}, - /* '*' 0x2A */ {48, 3, 3, 5, 1, -8}, - /* '+' 0x2B */ {50, 5, 5, 7, 1, -4}, - /* ',' 0x2C */ {54, 1, 3, 3, 1, 0}, - /* '-' 0x2D */ {55, 2, 1, 4, 1, -3}, - /* '.' 0x2E */ {56, 1, 1, 3, 1, 0}, - /* '/' 0x2F */ {57, 3, 9, 3, 0, -8}, - /* '0' 0x30 */ {61, 5, 9, 7, 1, -8}, - /* '1' 0x31 */ {67, 3, 9, 7, 1, -8}, - /* '2' 0x32 */ {71, 6, 9, 7, 0, -8}, - /* '3' 0x33 */ {78, 6, 9, 7, 0, -8}, - /* '4' 0x34 */ {85, 6, 9, 7, 0, -8}, - /* '5' 0x35 */ {92, 5, 9, 7, 1, -8}, - /* '6' 0x36 */ {98, 5, 9, 7, 1, -8}, - /* '7' 0x37 */ {104, 5, 9, 7, 1, -8}, - /* '8' 0x38 */ {110, 6, 9, 7, 0, -8}, - /* '9' 0x39 */ {117, 6, 9, 7, 0, -8}, - /* ':' 0x3A */ {124, 1, 7, 3, 1, -6}, - /* ';' 0x3B */ {125, 1, 8, 3, 1, -5}, - /* '<' 0x3C */ {126, 5, 5, 7, 1, -4}, - /* '=' 0x3D */ {130, 5, 3, 7, 1, -3}, - /* '>' 0x3E */ {132, 5, 5, 7, 1, -4}, - /* '?' 0x3F */ {136, 5, 9, 7, 1, -8}, - /* '@' 0x40 */ {142, 11, 11, 12, 0, -8}, - /* 'A' 0x41 */ {158, 8, 9, 8, 0, -8}, - /* 'B' 0x42 */ {167, 6, 9, 8, 1, -8}, - /* 'C' 0x43 */ {174, 8, 9, 9, 0, -8}, - /* 'D' 0x44 */ {183, 7, 9, 8, 1, -8}, - /* 'E' 0x45 */ {191, 6, 9, 8, 1, -8}, - /* 'F' 0x46 */ {198, 6, 9, 7, 1, -8}, - /* 'G' 0x47 */ {205, 8, 9, 9, 0, -8}, - /* 'H' 0x48 */ {214, 7, 9, 9, 1, -8}, - /* 'I' 0x49 */ {222, 1, 9, 3, 1, -8}, - /* 'J' 0x4A */ {224, 5, 9, 6, 0, -8}, - /* 'K' 0x4B */ {230, 7, 9, 8, 1, -8}, - /* 'L' 0x4C */ {238, 5, 9, 7, 1, -8}, - /* 'M' 0x4D */ {244, 8, 9, 10, 1, -8}, - /* 'N' 0x4E */ {253, 7, 9, 9, 1, -8}, - /* 'O' 0x4F */ {261, 9, 9, 9, 0, -8}, - /* 'P' 0x50 */ {272, 6, 9, 8, 1, -8}, - /* 'Q' 0x51 */ {279, 9, 10, 9, 0, -8}, - /* 'R' 0x52 */ {291, 7, 9, 9, 1, -8}, - /* 'S' 0x53 */ {299, 6, 9, 8, 1, -8}, - /* 'T' 0x54 */ {306, 7, 9, 8, 0, -8}, - /* 'U' 0x55 */ {314, 7, 9, 9, 1, -8}, - /* 'V' 0x56 */ {322, 7, 9, 8, 0, -8}, - /* 'W' 0x57 */ {330, 11, 9, 11, 0, -8}, - /* 'X' 0x58 */ {343, 6, 9, 8, 1, -8}, - /* 'Y' 0x59 */ {350, 8, 9, 8, 0, -8}, - /* 'Z' 0x5A */ {359, 7, 9, 7, 0, -8}, - /* '[' 0x5B */ {367, 2, 12, 3, 1, -8}, - /* '\' 0x5C */ {370, 3, 9, 3, 0, -8}, - /* ']' 0x5D */ {374, 2, 12, 3, 0, -8}, - /* '^' 0x5E */ {377, 4, 4, 6, 1, -8}, - /* '_' 0x5F */ {379, 7, 1, 7, 0, 2}, - /* '`' 0x60 */ {380, 1, 1, 3, 1, -8}, - /* 'a' 0x61 */ {381, 6, 7, 7, 0, -6}, - /* 'b' 0x62 */ {387, 5, 9, 7, 1, -8}, - /* 'c' 0x63 */ {393, 6, 7, 6, 0, -6}, - /* 'd' 0x64 */ {399, 6, 9, 7, 0, -8}, - /* 'e' 0x65 */ {406, 6, 7, 6, 0, -6}, - /* 'f' 0x66 */ {412, 3, 9, 3, 0, -8}, - /* 'g' 0x67 */ {416, 6, 10, 7, 0, -6}, - /* 'h' 0x68 */ {424, 5, 9, 6, 1, -8}, - /* 'i' 0x69 */ {430, 1, 9, 3, 1, -8}, - /* 'j' 0x6A */ {432, 2, 12, 3, 0, -8}, - /* 'k' 0x6B */ {435, 5, 9, 6, 1, -8}, - /* 'l' 0x6C */ {441, 1, 9, 3, 1, -8}, - /* 'm' 0x6D */ {443, 8, 7, 10, 1, -6}, - /* 'n' 0x6E */ {450, 5, 7, 6, 1, -6}, - /* 'o' 0x6F */ {455, 6, 7, 6, 0, -6}, - /* 'p' 0x70 */ {461, 5, 9, 7, 1, -6}, - /* 'q' 0x71 */ {467, 6, 9, 7, 0, -6}, - /* 'r' 0x72 */ {474, 3, 7, 4, 1, -6}, - /* 's' 0x73 */ {477, 5, 7, 6, 0, -6}, - /* 't' 0x74 */ {482, 3, 8, 3, 0, -7}, - /* 'u' 0x75 */ {485, 5, 7, 6, 1, -6}, - /* 'v' 0x76 */ {490, 6, 7, 6, 0, -6}, - /* 'w' 0x77 */ {496, 8, 7, 9, 0, -6}, - /* 'x' 0x78 */ {503, 5, 7, 6, 0, -6}, - /* 'y' 0x79 */ {508, 5, 10, 6, 0, -6}, - /* 'z' 0x7A */ {515, 5, 7, 6, 0, -6}, - /* '{' 0x7B */ {520, 2, 12, 4, 1, -8}, - /* '|' 0x7C */ {523, 1, 11, 3, 1, -8}, - /* '}' 0x7D */ {525, 2, 12, 4, 1, -8}, - /* '~' 0x7E */ {528, 6, 2, 6, 0, -4}, - /* 0x7F */ {530, 9, 10, 11, 1, -8}, - /* 0x80 */ {542, 7, 9, 8, 0, -8}, - /* 0x81 */ {550, 0, 0, 8, 0, 0}, - /* 0x82 */ {550, 1, 3, 3, 1, 0}, - /* 0x83 */ {551, 3, 12, 3, 0, -8}, - /* 0x84 */ {556, 3, 3, 5, 1, 0}, - /* 0x85 */ {558, 5, 1, 7, 1, 0}, - /* 0x86 */ {559, 5, 11, 7, 1, -8}, - /* 0x87 */ {566, 5, 11, 7, 1, -8}, - /* 0x88 */ {573, 3, 2, 4, 0, -9}, - /* 0x89 */ {574, 12, 9, 12, 0, -8}, - /* 0x8A */ {588, 6, 11, 8, 1, -9}, - /* 0x8B */ {597, 2, 3, 4, 1, -4}, - /* 0x8C */ {598, 11, 9, 12, 0, -8}, - /* 0x8D */ {611, 0, 0, 8, 0, 0}, - /* 0x8E */ {611, 7, 10, 7, 0, -9}, - /* 0x8F */ {620, 0, 0, 8, 0, 0}, - /* 0x90 */ {620, 0, 0, 8, 0, 0}, - /* 0x91 */ {620, 1, 3, 3, 1, -8}, - /* 0x92 */ {621, 1, 3, 2, 1, -8}, - /* 0x93 */ {622, 3, 3, 5, 1, -8}, - /* 0x94 */ {624, 3, 3, 5, 1, -8}, - /* 0x95 */ {626, 3, 3, 5, 1, -5}, - /* 0x96 */ {628, 6, 1, 6, 0, -3}, - /* 0x97 */ {629, 12, 1, 12, 0, -3}, - /* 0x98 */ {631, 4, 2, 4, 0, -8}, - /* 0x99 */ {632, 11, 7, 12, 1, -8}, - /* 0x9A */ {642, 4, 9, 6, 1, -8}, - /* 0x9B */ {647, 2, 3, 3, 1, -4}, - /* 0x9C */ {648, 11, 7, 11, 0, -6}, - /* 0x9D */ {658, 0, 0, 8, 0, 0}, - /* 0x9E */ {658, 5, 9, 6, 0, -8}, - /* 0x9F */ {664, 7, 10, 8, 1, -9}, - /* 0xA0 */ {673, 0, 0, 3, 0, 0}, - /* 0xA1 */ {673, 1, 9, 4, 1, -5}, - /* 0xA2 */ {675, 5, 9, 7, 1, -7}, - /* 0xA3 */ {681, 6, 9, 7, 0, -8}, - /* 0xA4 */ {688, 5, 4, 7, 1, -5}, - /* 0xA5 */ {691, 5, 9, 7, 1, -8}, - /* 0xA6 */ {697, 1, 12, 3, 1, -8}, - /* 0xA7 */ {699, 5, 12, 7, 1, -8}, - /* 0xA8 */ {707, 3, 1, 4, 0, -7}, - /* 0xA9 */ {708, 9, 9, 10, 0, -8}, - /* 0xAA */ {719, 4, 5, 4, 0, -8}, - /* 0xAB */ {722, 4, 4, 6, 1, -4}, - /* 0xAC */ {724, 6, 3, 7, 1, -4}, - /* 0xAD */ {727, 0, 0, 0, 0, 0}, - /* 0xAE */ {727, 9, 9, 10, 0, -8}, - /* 0xAF */ {738, 3, 1, 4, 0, -8}, - /* 0xB0 */ {739, 4, 4, 7, 2, -8}, - /* 0xB1 */ {741, 5, 7, 7, 1, -6}, - /* 0xB2 */ {746, 4, 5, 4, 0, -9}, - /* 0xB3 */ {749, 4, 5, 4, 0, -9}, - /* 0xB4 */ {752, 1, 1, 4, 1, -8}, - /* 0xB5 */ {753, 6, 9, 7, 1, -6}, - /* 0xB6 */ {760, 6, 10, 6, 1, -8}, - /* 0xB7 */ {768, 1, 1, 3, 1, -2}, - /* 0xB8 */ {769, 3, 3, 4, 1, 1}, - /* 0xB9 */ {771, 2, 6, 4, 1, -9}, - /* 0xBA */ {773, 4, 5, 4, 0, -8}, - /* 0xBB */ {776, 4, 4, 6, 1, -5}, - /* 0xBC */ {778, 10, 9, 10, 1, -8}, - /* 0xBD */ {790, 9, 9, 10, 1, -8}, - /* 0xBE */ {801, 10, 9, 11, 0, -8}, - /* 0xBF */ {813, 5, 9, 7, 1, -5}, - /* 0xC0 */ {819, 8, 10, 8, 0, -9}, - /* 0xC1 */ {829, 8, 10, 8, 0, -9}, - /* 0xC2 */ {839, 8, 10, 8, 0, -9}, - /* 0xC3 */ {849, 8, 10, 8, 0, -9}, - /* 0xC4 */ {859, 8, 10, 8, 0, -9}, - /* 0xC5 */ {869, 8, 10, 8, 0, -9}, - /* 0xC6 */ {879, 10, 9, 12, 1, -8}, - /* 0xC7 */ {891, 8, 12, 9, 0, -8}, - /* 0xC8 */ {903, 6, 10, 8, 1, -9}, - /* 0xC9 */ {911, 6, 10, 8, 1, -9}, - /* 0xCA */ {919, 6, 10, 8, 1, -9}, - /* 0xCB */ {927, 6, 10, 8, 1, -9}, - /* 0xCC */ {935, 2, 10, 3, 0, -9}, - /* 0xCD */ {938, 2, 10, 3, 1, -9}, - /* 0xCE */ {941, 3, 10, 4, 0, -9}, - /* 0xCF */ {945, 3, 10, 4, 0, -9}, - /* 0xD0 */ {949, 8, 9, 8, 0, -8}, - /* 0xD1 */ {958, 7, 10, 9, 1, -9}, - /* 0xD2 */ {967, 9, 10, 9, 0, -9}, - /* 0xD3 */ {979, 9, 10, 9, 0, -9}, - /* 0xD4 */ {991, 9, 11, 9, 0, -10}, - /* 0xD5 */ {1004, 9, 11, 9, 0, -10}, - /* 0xD6 */ {1017, 9, 11, 9, 0, -10}, - /* 0xD7 */ {1030, 5, 5, 7, 1, -5}, - /* 0xD8 */ {1034, 9, 9, 9, 0, -8}, - /* 0xD9 */ {1045, 7, 10, 9, 1, -9}, - /* 0xDA */ {1054, 7, 10, 9, 1, -9}, - /* 0xDB */ {1063, 7, 10, 9, 1, -9}, - /* 0xDC */ {1072, 7, 10, 9, 1, -9}, - /* 0xDD */ {1081, 7, 10, 8, 1, -9}, - /* 0xDE */ {1090, 6, 9, 8, 1, -8}, - /* 0xDF */ {1097, 6, 9, 7, 1, -8}, - /* 0xE0 */ {1104, 7, 10, 7, 0, -9}, - /* 0xE1 */ {1113, 7, 10, 7, 0, -9}, - /* 0xE2 */ {1122, 7, 10, 7, 0, -9}, - /* 0xE3 */ {1131, 7, 10, 7, 0, -9}, - /* 0xE4 */ {1140, 7, 9, 7, 0, -8}, - /* 0xE5 */ {1148, 7, 10, 7, 0, -9}, - /* 0xE6 */ {1157, 10, 7, 10, 0, -6}, - /* 0xE7 */ {1166, 6, 10, 6, 0, -6}, - /* 0xE8 */ {1174, 6, 10, 6, 0, -9}, - /* 0xE9 */ {1182, 6, 10, 6, 0, -9}, - /* 0xEA */ {1190, 6, 10, 6, 0, -9}, - /* 0xEB */ {1198, 6, 9, 6, 0, -8}, - /* 0xEC */ {1205, 2, 10, 3, 0, -9}, - /* 0xED */ {1208, 2, 10, 3, 1, -9}, - /* 0xEE */ {1211, 3, 10, 3, 0, -9}, - /* 0xEF */ {1215, 3, 9, 3, 0, -8}, - /* 0xF0 */ {1219, 6, 9, 6, 0, -8}, - /* 0xF1 */ {1226, 5, 10, 6, 1, -9}, - /* 0xF2 */ {1233, 6, 10, 6, 0, -9}, - /* 0xF3 */ {1241, 6, 10, 6, 0, -9}, - /* 0xF4 */ {1249, 6, 10, 6, 0, -9}, - /* 0xF5 */ {1257, 6, 10, 6, 0, -9}, - /* 0xF6 */ {1265, 6, 9, 6, 0, -8}, - /* 0xF7 */ {1272, 5, 5, 7, 1, -5}, - /* 0xF8 */ {1276, 6, 7, 6, 0, -6}, - /* 0xF9 */ {1282, 5, 9, 6, 1, -8}, - /* 0xFA */ {1288, 5, 9, 6, 1, -8}, - /* 0xFB */ {1294, 5, 10, 6, 1, -9}, - /* 0xFC */ {1301, 5, 9, 6, 1, -8}, - /* 0xFD */ {1307, 6, 12, 6, 0, -8}, - /* 0xFE */ {1316, 5, 11, 7, 1, -8}, - /* 0xFF */ {1323, 6, 12, 6, 0, -8}, +/* 0x01 */ { 0, 9, 10, 11, 1, -9 }, +/* 0x02 */ { 12, 9, 10, 11, 1, -8 }, +/* 0x03 */ { 24, 10, 10, 12, 1, -8 }, +/* 0x04 */ { 37, 10, 10, 12, 1, -8 }, +/* 0x05 */ { 50, 10, 10, 12, 1, -9 }, +/* 0x06 */ { 63, 11, 11, 13, 1, -9 }, +/* 0x07 */ { 79, 0, 0, 8, 0, 0 }, +/* 0x08 */ { 79, 12, 9, 14, 1, -8 }, +/* 0x09 */ { 93, 14, 8, 16, 1, -7 }, +/* 0x0A */ { 107, 0, 0, 8, 0, 0 }, +/* 0x0B */ { 107, 9, 10, 11, 1, -9 }, +/* 0x0C */ { 119, 13, 9, 15, 1, -8 }, +/* 0x0D */ { 134, 0, 0, 8, 0, 0 }, +/* 0x0E */ { 134, 9, 11, 11, 1, -9 }, +/* 0x0F */ { 147, 10, 10, 12, 1, -9 }, +/* 0x10 */ { 160, 11, 10, 13, 1, -9 }, +/* 0x11 */ { 174, 13, 10, 15, 1, -9 }, +/* 0x12 */ { 191, 10, 10, 12, 1, -9 }, +/* 0x13 */ { 204, 11, 10, 13, 1, -9 }, +/* 0x14 */ { 218, 10, 10, 12, 1, -9 }, +/* 0x15 */ { 231, 14, 10, 16, 1, -9 }, +/* 0x16 */ { 249, 8, 10, 10, 1, -9 }, +/* 0x17 */ { 259, 12, 10, 14, 1, -9 }, +/* 0x18 */ { 274, 13, 10, 15, 1, -9 }, +/* 0x19 */ { 291, 12, 10, 14, 1, -9 }, +/* 0x1A */ { 306, 9, 10, 11, 1, -8 }, +/* 0x1B */ { 318, 14, 10, 16, 1, -9 }, +/* 0x1C */ { 336, 11, 10, 13, 1, -9 }, +/* 0x1D */ { 350, 11, 10, 13, 1, -9 }, +/* 0x1E */ { 364, 12, 10, 14, 1, -9 }, +/* 0x1F */ { 379, 8, 10, 11, 2, -9 }, +/* ' ' 0x20 */ { 389, 0, 0, 3, 0, 0 }, +/* '!' 0x21 */ { 389, 1, 9, 4, 2, -8 }, +/* '"' 0x22 */ { 391, 3, 3, 4, 0, -8 }, +/* '#' 0x23 */ { 393, 7, 8, 7, 0, -7 }, +/* '$' 0x24 */ { 400, 6, 11, 7, 0, -9 }, +/* '%' 0x25 */ { 409, 10, 9, 11, 0, -8 }, +/* '&' 0x26 */ { 421, 6, 9, 8, 1, -8 }, +/* ''' 0x27 */ { 428, 1, 3, 2, 1, -8 }, +/* '(' 0x28 */ { 429, 2, 11, 4, 1, -8 }, +/* ')' 0x29 */ { 432, 3, 11, 4, 0, -8 }, +/* '*' 0x2A */ { 437, 3, 3, 5, 1, -8 }, +/* '+' 0x2B */ { 439, 5, 5, 7, 1, -4 }, +/* ',' 0x2C */ { 443, 1, 3, 3, 1, 0 }, +/* '-' 0x2D */ { 444, 2, 1, 4, 1, -3 }, +/* '.' 0x2E */ { 445, 1, 1, 3, 1, 0 }, +/* '/' 0x2F */ { 446, 3, 9, 3, 0, -8 }, +/* '0' 0x30 */ { 450, 5, 9, 7, 1, -8 }, +/* '1' 0x31 */ { 456, 3, 9, 7, 1, -8 }, +/* '2' 0x32 */ { 460, 6, 9, 7, 0, -8 }, +/* '3' 0x33 */ { 467, 6, 9, 7, 0, -8 }, +/* '4' 0x34 */ { 474, 6, 9, 7, 0, -8 }, +/* '5' 0x35 */ { 481, 5, 9, 7, 1, -8 }, +/* '6' 0x36 */ { 487, 5, 9, 7, 1, -8 }, +/* '7' 0x37 */ { 493, 5, 9, 7, 1, -8 }, +/* '8' 0x38 */ { 499, 6, 9, 7, 0, -8 }, +/* '9' 0x39 */ { 506, 6, 9, 7, 0, -8 }, +/* ':' 0x3A */ { 513, 1, 7, 3, 1, -6 }, +/* ';' 0x3B */ { 514, 1, 8, 3, 1, -5 }, +/* '<' 0x3C */ { 515, 5, 5, 7, 1, -4 }, +/* '=' 0x3D */ { 519, 5, 3, 7, 1, -3 }, +/* '>' 0x3E */ { 521, 5, 5, 7, 1, -4 }, +/* '?' 0x3F */ { 525, 5, 9, 7, 1, -8 }, +/* '@' 0x40 */ { 531, 11, 11, 12, 0, -8 }, +/* 'A' 0x41 */ { 547, 8, 9, 8, 0, -8 }, +/* 'B' 0x42 */ { 556, 6, 9, 8, 1, -8 }, +/* 'C' 0x43 */ { 563, 8, 9, 9, 0, -8 }, +/* 'D' 0x44 */ { 572, 7, 9, 8, 1, -8 }, +/* 'E' 0x45 */ { 580, 6, 9, 8, 1, -8 }, +/* 'F' 0x46 */ { 587, 6, 9, 7, 1, -8 }, +/* 'G' 0x47 */ { 594, 8, 9, 9, 0, -8 }, +/* 'H' 0x48 */ { 603, 7, 9, 9, 1, -8 }, +/* 'I' 0x49 */ { 611, 1, 9, 3, 1, -8 }, +/* 'J' 0x4A */ { 613, 5, 9, 6, 0, -8 }, +/* 'K' 0x4B */ { 619, 7, 9, 8, 1, -8 }, +/* 'L' 0x4C */ { 627, 5, 9, 7, 1, -8 }, +/* 'M' 0x4D */ { 633, 8, 9, 10, 1, -8 }, +/* 'N' 0x4E */ { 642, 7, 9, 9, 1, -8 }, +/* 'O' 0x4F */ { 650, 9, 9, 9, 0, -8 }, +/* 'P' 0x50 */ { 661, 6, 9, 8, 1, -8 }, +/* 'Q' 0x51 */ { 668, 9, 10, 9, 0, -8 }, +/* 'R' 0x52 */ { 680, 7, 9, 9, 1, -8 }, +/* 'S' 0x53 */ { 688, 6, 9, 8, 1, -8 }, +/* 'T' 0x54 */ { 695, 7, 9, 8, 0, -8 }, +/* 'U' 0x55 */ { 703, 7, 9, 9, 1, -8 }, +/* 'V' 0x56 */ { 711, 7, 9, 8, 0, -8 }, +/* 'W' 0x57 */ { 719, 11, 9, 11, 0, -8 }, +/* 'X' 0x58 */ { 732, 6, 9, 8, 1, -8 }, +/* 'Y' 0x59 */ { 739, 8, 9, 8, 0, -8 }, +/* 'Z' 0x5A */ { 748, 7, 9, 7, 0, -8 }, +/* '[' 0x5B */ { 756, 2, 12, 3, 1, -8 }, +/* '\' 0x5C */ { 759, 3, 9, 3, 0, -8 }, +/* ']' 0x5D */ { 763, 2, 12, 3, 0, -8 }, +/* '^' 0x5E */ { 766, 4, 4, 6, 1, -8 }, +/* '_' 0x5F */ { 768, 7, 1, 7, 0, 2 }, +/* '`' 0x60 */ { 769, 1, 1, 3, 1, -8 }, +/* 'a' 0x61 */ { 770, 6, 7, 7, 0, -6 }, +/* 'b' 0x62 */ { 776, 5, 9, 7, 1, -8 }, +/* 'c' 0x63 */ { 782, 6, 7, 6, 0, -6 }, +/* 'd' 0x64 */ { 788, 6, 9, 7, 0, -8 }, +/* 'e' 0x65 */ { 795, 6, 7, 6, 0, -6 }, +/* 'f' 0x66 */ { 801, 3, 9, 3, 0, -8 }, +/* 'g' 0x67 */ { 805, 6, 10, 7, 0, -6 }, +/* 'h' 0x68 */ { 813, 5, 9, 6, 1, -8 }, +/* 'i' 0x69 */ { 819, 1, 9, 3, 1, -8 }, +/* 'j' 0x6A */ { 821, 2, 12, 3, 0, -8 }, +/* 'k' 0x6B */ { 824, 5, 9, 6, 1, -8 }, +/* 'l' 0x6C */ { 830, 1, 9, 3, 1, -8 }, +/* 'm' 0x6D */ { 832, 8, 7, 10, 1, -6 }, +/* 'n' 0x6E */ { 839, 5, 7, 6, 1, -6 }, +/* 'o' 0x6F */ { 844, 6, 7, 6, 0, -6 }, +/* 'p' 0x70 */ { 850, 5, 9, 7, 1, -6 }, +/* 'q' 0x71 */ { 856, 6, 9, 7, 0, -6 }, +/* 'r' 0x72 */ { 863, 3, 7, 4, 1, -6 }, +/* 's' 0x73 */ { 866, 5, 7, 6, 0, -6 }, +/* 't' 0x74 */ { 871, 3, 8, 3, 0, -7 }, +/* 'u' 0x75 */ { 874, 5, 7, 6, 1, -6 }, +/* 'v' 0x76 */ { 879, 6, 7, 6, 0, -6 }, +/* 'w' 0x77 */ { 885, 8, 7, 9, 0, -6 }, +/* 'x' 0x78 */ { 892, 5, 7, 6, 0, -6 }, +/* 'y' 0x79 */ { 897, 5, 10, 6, 0, -6 }, +/* 'z' 0x7A */ { 904, 5, 7, 6, 0, -6 }, +/* '{' 0x7B */ { 909, 2, 12, 4, 1, -8 }, +/* '|' 0x7C */ { 912, 1, 11, 3, 1, -8 }, +/* '}' 0x7D */ { 914, 2, 12, 4, 1, -8 }, +/* '~' 0x7E */ { 917, 6, 2, 6, 0, -4 }, +/* 0x7F */ { 919, 0, 0, 0, 0, 0 }, +/* 0x80 */ { 919, 7, 9, 8, 0, -8 }, +/* 0x81 */ { 927, 0, 0, 8, 0, 0 }, +/* 0x82 */ { 927, 1, 3, 3, 1, 0 }, +/* 0x83 */ { 928, 3, 12, 3, 0, -8 }, +/* 0x84 */ { 933, 3, 3, 5, 1, 0 }, +/* 0x85 */ { 935, 5, 1, 7, 1, 0 }, +/* 0x86 */ { 936, 5, 11, 7, 1, -8 }, +/* 0x87 */ { 943, 5, 11, 7, 1, -8 }, +/* 0x88 */ { 950, 3, 2, 4, 0, -9 }, +/* 0x89 */ { 951, 12, 9, 12, 0, -8 }, +/* 0x8A */ { 965, 6, 11, 8, 1, -9 }, +/* 0x8B */ { 974, 2, 3, 4, 1, -4 }, +/* 0x8C */ { 975, 11, 9, 12, 0, -8 }, +/* 0x8D */ { 988, 0, 0, 8, 0, 0 }, +/* 0x8E */ { 988, 7, 10, 7, 0, -9 }, +/* 0x8F */ { 997, 0, 0, 8, 0, 0 }, +/* 0x90 */ { 997, 0, 0, 8, 0, 0 }, +/* 0x91 */ { 997, 1, 3, 3, 1, -8 }, +/* 0x92 */ { 998, 1, 3, 2, 1, -8 }, +/* 0x93 */ { 999, 3, 3, 5, 1, -8 }, +/* 0x94 */ { 1001, 3, 3, 5, 1, -8 }, +/* 0x95 */ { 1003, 3, 3, 5, 1, -5 }, +/* 0x96 */ { 1005, 6, 1, 6, 0, -3 }, +/* 0x97 */ { 1006, 12, 1, 12, 0, -3 }, +/* 0x98 */ { 1008, 4, 2, 4, 0, -8 }, +/* 0x99 */ { 1009, 11, 7, 12, 1, -8 }, +/* 0x9A */ { 1019, 4, 9, 6, 1, -8 }, +/* 0x9B */ { 1024, 2, 3, 3, 1, -4 }, +/* 0x9C */ { 1025, 11, 7, 11, 0, -6 }, +/* 0x9D */ { 1035, 0, 0, 8, 0, 0 }, +/* 0x9E */ { 1035, 5, 9, 6, 0, -8 }, +/* 0x9F */ { 1041, 7, 10, 8, 1, -9 }, +/* 0xA0 */ { 1050, 0, 0, 3, 0, 0 }, +/* 0xA1 */ { 1050, 1, 9, 4, 1, -5 }, +/* 0xA2 */ { 1052, 5, 9, 7, 1, -7 }, +/* 0xA3 */ { 1058, 6, 9, 7, 0, -8 }, +/* 0xA4 */ { 1065, 5, 4, 7, 1, -5 }, +/* 0xA5 */ { 1068, 5, 9, 7, 1, -8 }, +/* 0xA6 */ { 1074, 1, 12, 3, 1, -8 }, +/* 0xA7 */ { 1076, 5, 12, 7, 1, -8 }, +/* 0xA8 */ { 1084, 3, 1, 4, 0, -7 }, +/* 0xA9 */ { 1085, 9, 9, 10, 0, -8 }, +/* 0xAA */ { 1096, 4, 5, 4, 0, -8 }, +/* 0xAB */ { 1099, 4, 4, 6, 1, -4 }, +/* 0xAC */ { 1101, 6, 3, 7, 1, -4 }, +/* 0xAD */ { 1104, 0, 0, 0, 0, 0 }, +/* 0xAE */ { 1104, 9, 9, 10, 0, -8 }, +/* 0xAF */ { 1115, 3, 1, 4, 0, -8 }, +/* 0xB0 */ { 1116, 4, 4, 7, 2, -8 }, +/* 0xB1 */ { 1118, 5, 7, 7, 1, -6 }, +/* 0xB2 */ { 1123, 4, 5, 4, 0, -9 }, +/* 0xB3 */ { 1126, 4, 5, 4, 0, -9 }, +/* 0xB4 */ { 1129, 1, 1, 4, 1, -8 }, +/* 0xB5 */ { 1130, 6, 9, 7, 1, -6 }, +/* 0xB6 */ { 1137, 6, 10, 6, 1, -8 }, +/* 0xB7 */ { 1145, 1, 1, 3, 1, -2 }, +/* 0xB8 */ { 1146, 3, 3, 4, 1, 1 }, +/* 0xB9 */ { 1148, 2, 6, 4, 1, -9 }, +/* 0xBA */ { 1150, 4, 5, 4, 0, -8 }, +/* 0xBB */ { 1153, 4, 4, 6, 1, -5 }, +/* 0xBC */ { 1155, 10, 9, 10, 1, -8 }, +/* 0xBD */ { 1167, 9, 9, 10, 1, -8 }, +/* 0xBE */ { 1178, 10, 9, 11, 0, -8 }, +/* 0xBF */ { 1190, 5, 9, 7, 1, -5 }, +/* 0xC0 */ { 1196, 8, 10, 8, 0, -9 }, +/* 0xC1 */ { 1206, 8, 10, 8, 0, -9 }, +/* 0xC2 */ { 1216, 8, 10, 8, 0, -9 }, +/* 0xC3 */ { 1226, 8, 10, 8, 0, -9 }, +/* 0xC4 */ { 1236, 8, 10, 8, 0, -9 }, +/* 0xC5 */ { 1246, 8, 10, 8, 0, -9 }, +/* 0xC6 */ { 1256, 10, 9, 12, 1, -8 }, +/* 0xC7 */ { 1268, 8, 12, 9, 0, -8 }, +/* 0xC8 */ { 1280, 6, 10, 8, 1, -9 }, +/* 0xC9 */ { 1288, 6, 10, 8, 1, -9 }, +/* 0xCA */ { 1296, 6, 10, 8, 1, -9 }, +/* 0xCB */ { 1304, 6, 10, 8, 1, -9 }, +/* 0xCC */ { 1312, 2, 10, 3, 0, -9 }, +/* 0xCD */ { 1315, 2, 10, 3, 1, -9 }, +/* 0xCE */ { 1318, 3, 10, 4, 0, -9 }, +/* 0xCF */ { 1322, 3, 10, 4, 0, -9 }, +/* 0xD0 */ { 1326, 8, 9, 8, 0, -8 }, +/* 0xD1 */ { 1335, 7, 10, 9, 1, -9 }, +/* 0xD2 */ { 1344, 9, 10, 9, 0, -9 }, +/* 0xD3 */ { 1356, 9, 10, 9, 0, -9 }, +/* 0xD4 */ { 1368, 9, 11, 9, 0, -10 }, +/* 0xD5 */ { 1381, 9, 11, 9, 0, -10 }, +/* 0xD6 */ { 1394, 9, 11, 9, 0, -10 }, +/* 0xD7 */ { 1407, 5, 5, 7, 1, -5 }, +/* 0xD8 */ { 1411, 9, 9, 9, 0, -8 }, +/* 0xD9 */ { 1422, 7, 10, 9, 1, -9 }, +/* 0xDA */ { 1431, 7, 10, 9, 1, -9 }, +/* 0xDB */ { 1440, 7, 10, 9, 1, -9 }, +/* 0xDC */ { 1449, 7, 10, 9, 1, -9 }, +/* 0xDD */ { 1458, 7, 10, 8, 1, -9 }, +/* 0xDE */ { 1467, 6, 9, 8, 1, -8 }, +/* 0xDF */ { 1474, 6, 9, 7, 1, -8 }, +/* 0xE0 */ { 1481, 7, 10, 7, 0, -9 }, +/* 0xE1 */ { 1490, 7, 10, 7, 0, -9 }, +/* 0xE2 */ { 1499, 7, 10, 7, 0, -9 }, +/* 0xE3 */ { 1508, 7, 10, 7, 0, -9 }, +/* 0xE4 */ { 1517, 7, 9, 7, 0, -8 }, +/* 0xE5 */ { 1525, 7, 10, 7, 0, -9 }, +/* 0xE6 */ { 1534, 10, 7, 10, 0, -6 }, +/* 0xE7 */ { 1543, 6, 10, 6, 0, -6 }, +/* 0xE8 */ { 1551, 6, 10, 6, 0, -9 }, +/* 0xE9 */ { 1559, 6, 10, 6, 0, -9 }, +/* 0xEA */ { 1567, 6, 10, 6, 0, -9 }, +/* 0xEB */ { 1575, 6, 9, 6, 0, -8 }, +/* 0xEC */ { 1582, 2, 10, 3, 0, -9 }, +/* 0xED */ { 1585, 2, 10, 3, 1, -9 }, +/* 0xEE */ { 1588, 3, 10, 3, 0, -9 }, +/* 0xEF */ { 1592, 3, 9, 3, 0, -8 }, +/* 0xF0 */ { 1596, 6, 9, 6, 0, -8 }, +/* 0xF1 */ { 1603, 5, 10, 6, 1, -9 }, +/* 0xF2 */ { 1610, 6, 10, 6, 0, -9 }, +/* 0xF3 */ { 1618, 6, 10, 6, 0, -9 }, +/* 0xF4 */ { 1626, 6, 10, 6, 0, -9 }, +/* 0xF5 */ { 1634, 6, 10, 6, 0, -9 }, +/* 0xF6 */ { 1642, 6, 9, 6, 0, -8 }, +/* 0xF7 */ { 1649, 5, 5, 7, 1, -5 }, +/* 0xF8 */ { 1653, 6, 7, 6, 0, -6 }, +/* 0xF9 */ { 1659, 5, 9, 6, 1, -8 }, +/* 0xFA */ { 1665, 5, 9, 6, 1, -8 }, +/* 0xFB */ { 1671, 5, 10, 6, 1, -9 }, +/* 0xFC */ { 1678, 5, 9, 6, 1, -8 }, +/* 0xFD */ { 1684, 6, 12, 6, 0, -8 }, +/* 0xFE */ { 1693, 5, 11, 7, 1, -8 }, +/* 0xFF */ { 1700, 6, 12, 6, 0, -8 }, }; -const GFXfont FreeSans6pt_Win1252 PROGMEM = {(uint8_t *)FreeSans6pt_Win1252Bitmaps, (GFXglyph *)FreeSans6pt_Win1252Glyphs, 0x20, - 0xFF, 14}; +const GFXfont FreeSans6pt_Win1252 PROGMEM = { +(uint8_t*)FreeSans6pt_Win1252Bitmaps, +(GFXglyph*)FreeSans6pt_Win1252Glyphs, +0x01, 0xFF, 10 +}; diff --git a/src/graphics/niche/Fonts/FreeSans9pt_Win1250.h b/src/graphics/niche/Fonts/FreeSans9pt_Win1250.h index 7022939a0..dd66801a1 100644 --- a/src/graphics/niche/Fonts/FreeSans9pt_Win1250.h +++ b/src/graphics/niche/Fonts/FreeSans9pt_Win1250.h @@ -1,494 +1,527 @@ +// trunk-ignore-all(clang-format) #pragma once +/* PROPERTIES + +FONT_NAME FreeSans9pt_Win1250 +*/ const uint8_t FreeSans9pt_Win1250Bitmaps[] PROGMEM = { - /* ' ' 0x20 */ - 0xFF, 0xFF, 0xF0, 0xC0, /* '!' 0x21 */ - 0xDE, 0xF7, 0x20, /* '"' 0x22 */ - 0x09, 0x86, 0x41, 0x91, 0xFF, 0x13, 0x04, 0xC3, 0x20, 0xC8, 0xFF, 0x89, 0x82, 0x61, 0x90, /* '#' 0x23 */ - 0x10, 0x1F, 0x14, 0xDA, 0x3D, 0x1E, 0x83, 0x40, 0x78, 0x17, 0x08, 0xF4, 0x7A, 0x35, 0x33, 0xF0, 0x40, 0x20, /* '$' 0x24 */ - 0x38, 0x10, 0xEC, 0x20, 0xC6, 0x20, 0xC6, 0x40, 0xC6, 0x40, 0x6C, 0x80, 0x39, 0x00, 0x01, 0x3C, 0x02, 0x77, 0x02, 0x63, 0x04, - 0x63, 0x04, 0x77, 0x08, 0x3C, /* '%' 0x25 */ - 0x0E, 0x0C, 0xC3, 0x30, 0xCC, 0x1E, 0x03, 0x03, 0xC1, 0x9B, 0xC2, 0xF0, 0xEC, 0x19, 0x8F, 0x3C, 0x40, /* '&' 0x26 */ - 0xFE, /* ''' 0x27 */ - 0x13, 0x26, 0x6C, 0xCC, 0xCC, 0xC4, 0x66, 0x23, 0x10, /* '(' 0x28 */ - 0x8C, 0x46, 0x63, 0x33, 0x33, 0x32, 0x66, 0x4C, 0x80, /* ')' 0x29 */ - 0x25, 0x7E, 0xA5, 0x00, /* '*' 0x2A */ - 0x30, 0xC3, 0x3F, 0x30, 0xC3, 0x0C, /* '+' 0x2B */ - 0xD6, /* ',' 0x2C */ - 0xF0, /* '-' 0x2D */ - 0xC0, /* '.' 0x2E */ - 0x08, 0x44, 0x21, 0x10, 0x84, 0x42, 0x11, 0x08, 0x00, /* '/' 0x2F */ - 0x3C, 0x66, 0x42, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x42, 0x66, 0x3C, /* '0' 0x30 */ - 0x11, 0x3F, 0x33, 0x33, 0x33, 0x33, 0x30, /* '1' 0x31 */ - 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x1C, 0x1C, 0x1C, 0x18, 0x18, 0x10, 0x08, 0x07, 0xF8, /* '2' 0x32 */ - 0x3C, 0x66, 0xC3, 0xC3, 0x03, 0x06, 0x1C, 0x07, 0x03, 0xC3, 0xC3, 0x66, 0x3C, /* '3' 0x33 */ - 0x0C, 0x18, 0x71, 0x62, 0xC9, 0xA3, 0x46, 0xFE, 0x18, 0x30, 0x60, 0xC0, /* '4' 0x34 */ - 0x7F, 0x20, 0x10, 0x08, 0x08, 0x07, 0xF3, 0x8C, 0x03, 0x01, 0x80, 0xF0, 0x6C, 0x63, 0xE0, /* '5' 0x35 */ - 0x1E, 0x31, 0x98, 0x78, 0x0C, 0x06, 0xF3, 0x8D, 0x83, 0xC1, 0xE0, 0xD0, 0x6C, 0x63, 0xE0, /* '6' 0x36 */ - 0xFF, 0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x18, 0x18, 0x18, 0x10, 0x30, 0x30, /* '7' 0x37 */ - 0x3E, 0x31, 0xB0, 0x78, 0x3C, 0x1B, 0x18, 0xF8, 0xC6, 0xC1, 0xE0, 0xF0, 0x6C, 0x63, 0xE0, /* '8' 0x38 */ - 0x3C, 0x66, 0xC2, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0xC2, 0x66, 0x3C, /* '9' 0x39 */ - 0xC0, 0x00, 0x30, /* ':' 0x3A */ - 0xC0, 0x00, 0x00, 0x64, 0xA0, /* ';' 0x3B */ - 0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x07, 0x80, 0x70, 0x0E, 0x01, 0x80, /* '<' 0x3C */ - 0xFF, 0x80, 0x00, 0x1F, 0xF0, /* '=' 0x3D */ - 0xE0, 0x1C, 0x03, 0x80, 0x30, 0x70, 0xE3, 0x81, 0x00, /* '>' 0x3E */ - 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x18, 0x38, 0x18, 0x18, 0x0C, 0x00, 0x00, 0x01, 0x80, /* '?' 0x3F */ - 0x03, 0xF0, 0x06, 0x0E, 0x06, 0x01, 0x86, 0x00, 0x66, 0x1D, 0xBB, 0x31, 0xCF, 0x18, 0xC7, 0x98, 0x63, 0xCC, 0x31, 0xE6, 0x11, - 0xB3, 0x99, 0xCC, 0xF7, 0x86, 0x00, 0x01, 0x80, 0x00, 0x70, 0x40, 0x0F, 0xE0, /* '@' 0x40 */ - 0x06, 0x00, 0xF0, 0x0F, 0x00, 0x90, 0x19, 0x81, 0x98, 0x10, 0x83, 0x0C, 0x3F, 0xC2, 0x04, 0x60, 0x66, 0x06, 0xC0, - 0x30, /* 'A' 0x41 */ - 0xFF, 0x18, 0x33, 0x03, 0x60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, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xB0, 0x61, 0xF0, /* 'U' 0x55 */ - 0xC0, 0x6C, 0x0D, 0x81, 0x10, 0x63, 0x0C, 0x61, 0x04, 0x60, 0xCC, 0x19, 0x01, 0x60, 0x3C, 0x07, 0x00, 0x60, /* 'V' 0x56 */ - 0xC1, 0x81, 0x61, 0xC3, 0x61, 0xC3, 0x61, 0x43, 0x62, 0x62, 0x22, 0x66, 0x32, 0x26, 0x36, 0x26, 0x14, 0x34, 0x14, 0x34, 0x1C, - 0x1C, 0x18, 0x1C, 0x08, 0x18, /* 'W' 0x57 */ - 0xC0, 0xD8, 0x66, 0x18, 0xCC, 0x1E, 0x07, 0x00, 0xC0, 0x78, 0x32, 0x0C, 0xC6, 0x1B, 0x07, 0xC0, 0xC0, /* 'X' 0x58 */ - 0xC0, 0x36, 0x06, 0x30, 0xC3, 0x0C, 0x19, 0x81, 0xD8, 0x0F, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, - 0x00, /* 'Y' 0x59 */ - 0xFF, 0xC0, 0x60, 0x30, 0x0C, 0x06, 0x03, 0x01, 0xC0, 0x60, 0x30, 0x18, 0x06, 0x03, 0x00, 0xFF, 0xC0, /* 'Z' 0x5A */ - 0xFB, 0x6D, 0xB6, 0xDB, 0x6D, 0xB6, 0xE0, /* '[' 0x5B */ - 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x80, /* '\' 0x5C */ - 0xED, 0xB6, 0xDB, 0x6D, 0xB6, 0xDB, 0xE0, /* ']' 0x5D */ - 0x30, 0x60, 0xA2, 0x44, 0xD8, 0xA1, 0x80, /* '^' 0x5E */ - 0xFF, 0xC0, /* '_' 0x5F */ - 0xC6, 0x30, /* '`' 0x60 */ - 0x7E, 0x71, 0xB0, 0xC0, 0x60, 0xF3, 0xDB, 0x0D, 0x86, 0xC7, 0x3D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0xC3, 0xC3, 0xC3, 0xC3, 0x66, 0x3C, /* 'o' 0x6F */ - 0xDE, 0x71, 0xB0, 0x78, 0x3C, 0x1E, 0x0F, 0x07, 0x83, 0xE3, 0x6F, 0x30, 0x18, 0x0C, 0x00, /* 'p' 0x70 */ - 0x3B, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0x03, /* 'q' 0x71 */ - 0xDF, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0x00, /* 'r' 0x72 */ - 0x3E, 0xE3, 0xC0, 0xC0, 0xE0, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, /* 's' 0x73 */ - 0x66, 0xF6, 0x66, 0x66, 0x66, 0x67, /* 't' 0x74 */ - 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 'u' 0x75 */ - 0xC1, 0xA0, 0x98, 0xCC, 0x42, 0x21, 0xB0, 0xD0, 0x28, 0x1C, 0x0C, 0x00, /* 'v' 0x76 */ - 0xC6, 0x1E, 0x38, 0x91, 0xC4, 0xCA, 0x66, 0xD3, 0x16, 0xD0, 0xA6, 0x87, 0x1C, 0x38, 0xC0, 0xC6, 0x00, /* 'w' 0x77 */ - 0x87, 0x89, 0xB1, 0xC3, 0x07, 0x1E, 0x26, 0xC5, 0x0C, /* 'x' 0x78 */ - 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, /* 'y' 0x79 */ - 0xFE, 0x0C, 0x30, 0xC1, 0x86, 0x18, 0x20, 0xC1, 0xFC, /* 'z' 0x7A */ - 0x36, 0x66, 0x66, 0x6E, 0xCE, 0x66, 0x66, 0x66, 0x30, /* '{' 0x7B */ - 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, /* '|' 0x7C */ - 0xC6, 0x66, 0x66, 0x67, 0x37, 0x66, 0x66, 0x66, 0xC0, /* '}' 0x7D */ - 0x61, 0x24, 0x38, /* '~' 0x7E */ - 0xFF, 0xFC, 0x00, 0x63, 0xE3, 0x31, 0x99, 0x04, 0xC8, 0x66, 0x06, 0x30, 0x61, 0x83, 0x0C, 0x18, 0x60, 0x03, 0x06, 0x18, 0x00, - 0xFF, 0xFC, /* 0x7F */ - 0x07, 0xC6, 0x13, 0x00, 0xC0, 0x60, 0x3F, 0xE6, 0x03, 0xFC, 0x60, 0x0C, 0x03, 0x00, 0x61, 0x07, 0xC0, /* 0x80 */ - /* 0x81 */ - 0xDC, /* 0x82 */ - /* 0x83 */ - 0xDA, 0x76, /* 0x84 */ - 0xCC, 0xC0, /* 0x85 */ - 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 0x86 */ - 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, /* 0x87 */ - /* 0x88 */ - 0x70, 0x80, 0x22, 0x20, 0x08, 0x90, 0x02, 0x24, 0x00, 0x72, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x10, 0x00, 0x09, 0xC7, 0x84, - 0x8B, 0x31, 0x22, 0x84, 0x88, 0xB3, 0x21, 0xC7, 0x80, /* 0x89 */ - 0x1B, 0x03, 0x83, 0xF1, 0x86, 0xC0, 0xF0, 0x3C, 0x01, 0xE0, 0x1F, 0x00, 0xE0, 0x0F, 0x03, 0xC0, 0xD8, 0x63, 0xF0, /* 0x8A */ - 0x69, /* 0x8B */ - 0x06, 0x03, 0x03, 0xF1, 0x86, 0xC0, 0xF0, 0x3C, 0x01, 0xE0, 0x1F, 0x00, 0xE0, 0x0F, 0x03, 0xC0, 0xD8, 0x63, 0xF0, /* 0x8C */ - 0x33, 0x0F, 0x3F, 0xE1, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, 0x60, 0x30, /* 0x8D */ - 0x1B, 0x03, 0x8F, 0xFC, 0x06, 0x03, 0x00, 0xC0, 0x60, 0x30, 0x1C, 0x06, 0x03, 0x01, 0x80, 0x60, 0x30, 0x0F, 0xFC, /* 0x8E */ - 0x0C, 0x06, 0x0F, 0xFC, 0x06, 0x03, 0x00, 0xC0, 0x60, 0x30, 0x1C, 0x06, 0x03, 0x01, 0x80, 0x60, 0x30, 0x0F, 0xFC, /* 0x8F */ - /* 0x90 */ - 0x6B, /* 0x91 */ - 0xD6, /* 0x92 */ - 0x4C, 0xA5, 0xB0, /* 0x93 */ - 0xDA, 0x53, 0x20, /* 0x94 */ - 0x6F, 0xFF, 0x60, /* 0x95 */ - 0xFE, /* 0x96 */ - 0xFF, 0xFF, /* 0x97 */ - /* 0x98 */ - 0xFC, 0xE1, 0xCC, 0x38, 0x73, 0x0E, 0x1C, 0xC3, 0x8F, 0x30, 0xD2, 0xCC, 0x34, 0xB3, 0x0D, 0x6C, 0xC3, 0x53, 0x30, 0xCC, 0xCC, - 0x33, 0x30, /* 0x99 */ - 0x24, 0x3C, 0x18, 0x7E, 0xE3, 0xC0, 0xC0, 0x60, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, /* 0x9A */ - 0x96, /* 0x9B */ - 0x0C, 0x18, 0x10, 0x3E, 0xE3, 0xC0, 0xC0, 0xE0, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, /* 0x9C */ - 0x0D, 0xA7, 0x3C, 0x61, 0x86, 0x18, 0x61, 0x86, 0x18, 0x70, /* 0x9D */ - 0x48, 0xF0, 0xC7, 0xF0, 0x61, 0x86, 0x0C, 0x30, 0xC1, 0x06, 0x0F, 0xE0, /* 0x9E */ - 0x0C, 0x10, 0x47, 0xF0, 0x61, 0x86, 0x0C, 0x30, 0xC1, 0x06, 0x0F, 0xE0, /* 0x9F */ - /* 0xA0 */ - 0x8A, 0x9C, /* 0xA1 */ - 0x85, 0xE0, /* 0xA2 */ - 0x60, 0x30, 0x18, 0x0C, 0x86, 0xC3, 0xC1, 0xC1, 0xC0, 0xE0, 0x30, 0x18, 0x0C, 0x07, 0xF8, /* 0xA3 */ - 0xFF, 0xDF, 0x1E, 0x3E, 0xFF, 0xC0, /* 0xA4 */ - 0x06, 0x00, 0xF0, 0x0F, 0x01, 0x30, 0x13, 0x81, 0x38, 0x21, 0x82, 0x1C, 0x3F, 0xC6, 0x04, 0x60, 0x66, 0x06, 0xC0, 0x30, 0x06, - 0x00, 0xC0, 0x0C, 0x00, 0x70, /* 0xA5 */ - 0xFF, 0xFC, 0x0F, 0xFF, 0xC0, /* 0xA6 */ - 0x0C, 0x09, 0x0C, 0xC6, 0x63, 0x81, 0xE3, 0x19, 0x87, 0xE1, 0xB8, 0xC6, 0x41, 0xC0, 0x73, 0x19, 0x8C, 0x66, 0x1E, - 0x00, /* 0xA7 */ - 0xCC, /* 0xA8 */ - 0x0F, 0xC0, 0x61, 0x87, 0x03, 0x9B, 0xC6, 0xD9, 0x8F, 0x60, 0x3D, 0x00, 0xF4, 0x03, 0xD8, 0x0D, 0xE6, 0x67, 0xF3, 0x86, 0x18, - 0x0F, 0xC0, /* 0xA9 */ - 0x3F, 0x18, 0x6C, 0x0F, 0x03, 0xC0, 0x1E, 0x01, 0xF0, 0x0E, 0x00, 0xF0, 0x3C, 0x0D, 0x86, 0x3F, 0x02, 0x00, 0xE0, 0x18, 0x1C, - 0x00, /* 0xAA */ - 0x22, 0xCF, 0x26, 0x46, 0x64, 0x40, /* 0xAB */ - 0xFF, 0x80, 0xC0, 0x60, 0x30, 0x18, /* 0xAC */ - /* 0xAD */ - 0x0F, 0xC0, 0x61, 0x87, 0x03, 0x9F, 0xE6, 0xD0, 0x8F, 0x42, 0x3D, 0xF0, 0xF4, 0x23, 0xD0, 0x8D, 0xC2, 0x67, 0x0B, 0x86, 0x18, - 0x0F, 0xC0, /* 0xAE */ - 0x0C, 0x00, 0x0F, 0xFC, 0x06, 0x03, 0x00, 0xC0, 0x60, 0x30, 0x1C, 0x06, 0x03, 0x01, 0x80, 0x60, 0x30, 0x0F, 0xFC, /* 0xAF */ - 0x74, 0x63, 0x17, 0x00, /* 0xB0 */ - 0x0C, 0x06, 0x03, 0x07, 0xE0, 0xC0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x3F, 0xE0, /* 0xB1 */ - 0x6C, 0xC7, /* 0xB2 */ - 0x66, 0x66, 0x67, 0x6E, 0x66, 0x66, 0x60, /* 0xB3 */ - 0x36, 0xC0, /* 0xB4 */ - 0xC3, 0x61, 0xB0, 0xD8, 0x6C, 0x36, 0x1B, 0x0D, 0x86, 0xE7, 0x7D, 0xF0, 0x18, 0x0C, 0x00, /* 0xB5 */ - 0x3F, 0x7E, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0x72, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, /* 0xB6 */ - 0xE0, /* 0xB7 */ - 0x21, 0xC7, 0xE0, /* 0xB8 */ - 0x7E, 0x38, 0xCC, 0x30, 0x0C, 0x0F, 0x1E, 0xCC, 0x33, 0x0C, 0xC7, 0x1E, 0xE0, 0x10, 0x0C, 0x03, 0x00, 0x70, /* 0xB9 */ - 0x3E, 0xE3, 0xC0, 0xC0, 0xE0, 0x3C, 0x07, 0xC3, 0xC3, 0x7E, 0x10, 0x1C, 0x0C, 0x38, /* 0xBA */ - 0x89, 0x98, 0x99, 0x3C, 0xD1, 0x00, /* 0xBB */ - 0xC6, 0xC4, 0xC8, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, /* 0xBC */ - 0x6F, 0x69, 0x00, /* 0xBD */ - 0xDE, 0xB9, 0x8C, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x00, /* 0xBE */ - 0x30, 0x03, 0xF8, 0x30, 0xC3, 0x06, 0x18, 0x60, 0x83, 0x07, 0xF0, /* 0xBF */ - 0x06, 0x00, 0xC0, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x0C, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x06, - 0xC0, 0x70, /* 0xC0 */ - 0x06, 0x03, 0x00, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC1 */ - 0x0C, 0x04, 0x80, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC2 */ - 0x21, 0x07, 0x80, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC3 */ - 0x33, 0x00, 0x00, 0xC0, 0x78, 0x1E, 0x04, 0x83, 0x30, 0xCC, 0x33, 0x1F, 0xE6, 0x19, 0x02, 0xC0, 0xF0, 0x30, /* 0xC4 */ - 0x30, 0x60, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, /* 0xC5 */ - 0x06, 0x01, 0x80, 0x00, 0x0F, 0xC3, 0x0C, 0xC0, 0xD0, 0x1E, 0x00, 0xC0, 0x18, 0x03, 0x01, 0xA0, 0x36, 0x0C, 0x61, 0x87, - 0xC0, /* 0xC6 */ - 0x1F, 0x06, 0x19, 0x83, 0xA0, 0x3C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0xE1, 0xF0, 0x08, 0x01, 0xC0, - 0x18, 0x0E, 0x00, /* 0xC7 */ - 0x19, 0x81, 0xE0, 0x00, 0x0F, 0xC3, 0x0C, 0xC0, 0xF0, 0x1E, 0x00, 0xC0, 0x18, 0x03, 0x01, 0xA0, 0x36, 0x0C, 0x61, 0x87, - 0xC0, /* 0xC8 */ - 0x0C, 0x0C, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, /* 0xC9 */ - 0xFF, 0xD8, 0x03, 0x00, 0x60, 0x0C, 0x01, 0x80, 0x3F, 0xF6, 0x00, 0xC0, 0x18, 0x03, 0x00, 0x60, 0x0F, 0xFC, 0x01, 0x80, 0x60, - 0x0C, 0x00, 0xE0, /* 0xCA */ - 0x33, 0x00, 0x3F, 0xF8, 0x0C, 0x06, 0x03, 0x01, 0xFE, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, /* 0xCB */ - 0x33, 0x0F, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0xFE, /* 0xCC */ - 0x78, 0x36, 0xDB, 0x6D, 0xB6, 0xC0, /* 0xCD */ - 0x76, 0xC0, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18, /* 0xCE */ - 0x66, 0x0F, 0x00, 0x03, 0xF8, 0xC3, 0x30, 0x6C, 0x0F, 0x03, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC1, 0xB0, 0xEF, 0xE0, /* 0xCF */ - 0x7F, 0x0C, 0x31, 0x83, 0x30, 0x36, 0x06, 0xC0, 0xFE, 0x1B, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x30, 0xE7, 0xF0, /* 0xD0 */ - 0x03, 0x01, 0x83, 0x81, 0xF0, 0x3F, 0x07, 0xA0, 0xF6, 0x1E, 0x63, 0xC4, 0x78, 0xCF, 0x0D, 0xE1, 0xBC, 0x1F, 0x81, - 0xC0, /* 0xD1 */ - 0x19, 0x81, 0xE3, 0x81, 0xF0, 0x3F, 0x07, 0xA0, 0xF6, 0x1E, 0x63, 0xC4, 0x78, 0xCF, 0x0D, 0xE1, 0xBC, 0x1F, 0x81, - 0xC0, /* 0xD2 */ - 0x03, 0x00, 0x60, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, - 0x0F, 0x00, /* 0xD3 */ - 0x0F, 0x01, 0x98, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, - 0x0F, 0x00, /* 0xD4 */ - 0x0D, 0x81, 0xB0, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, - 0x0F, 0x00, /* 0xD5 */ - 0x19, 0x81, 0x98, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, - 0x0F, 0x00, /* 0xD6 */ - 0x83, 0x89, 0xA1, 0x83, 0x89, 0xA1, 0x80, /* 0xD7 */ - 0x33, 0x01, 0xE0, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x0C, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x06, - 0xC0, 0x70, /* 0xD8 */ - 0x04, 0x01, 0x43, 0x11, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, - 0x00, /* 0xD9 */ - 0x06, 0x01, 0x83, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, - 0x00, /* 0xDA */ - 0x0D, 0x83, 0x63, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, - 0x00, /* 0xDB */ - 0x1B, 0x00, 0x03, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, - 0x00, /* 0xDC */ - 0x03, 0x0C, 0x63, 0x60, 0x63, 0x0C, 0x30, 0xC1, 0x98, 0x1D, 0x80, 0xF0, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, - 0x60, /* 0xDD */ - 0xFF, 0x86, 0x03, 0x01, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, 0x40, 0x3C, 0x06, 0x1E, - 0x00, /* 0xDE */ - 0x3C, 0x33, 0x30, 0xD8, 0x6C, 0x36, 0x33, 0x39, 0x86, 0xC1, 0xE0, 0xF0, 0x78, 0x6D, 0xE0, /* 0xDF */ - 0x19, 0x89, 0xBE, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x00, /* 0xE0 */ - 0x0C, 0x04, 0x04, 0x0F, 0xCE, 0x36, 0x18, 0x0C, 0x1E, 0x7B, 0x61, 0xB0, 0xD8, 0xE7, 0xB8, /* 0xE1 */ - 0x10, 0x14, 0x1B, 0x0F, 0xCE, 0x36, 0x18, 0x0C, 0x1E, 0x7B, 0x61, 0xB0, 0xD8, 0xE7, 0xB8, /* 0xE2 */ - 0x66, 0x1E, 0x00, 0x0F, 0xCE, 0x36, 0x18, 0x0C, 0x1E, 0x7B, 0x61, 0xB0, 0xD8, 0xE7, 0xB8, /* 0xE3 */ - 0x66, 0x00, 0x1F, 0x9C, 0x6C, 0x30, 0x18, 0x3C, 0xF6, 0xC3, 0x61, 0xB1, 0xCF, 0x70, /* 0xE4 */ - 0x78, 0x36, 0xDB, 0x6D, 0xB6, 0xD8, /* 0xE5 */ - 0x0C,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x00, 0x0A, 0x00, 0x24, 0x00, 0x48, 0x01, 0x10, 0x04, 0x40, 0x10, 0xFF, 0x20, 0x02, 0x81, 0xFD, 0x00, 0x06, 0x07, 0xF4, 0x08, 0x24, 0x0F, 0x88, 0x11, 0x0F, 0xDC, 0x00, +/* 0x02 */ 0x3F, 0x70, 0x81, 0x11, 0x03, 0xE4, 0x08, 0x28, 0x1F, 0xD0, 0x00, 0x60, 0x7F, 0x20, 0x02, 0x43, 0xFC, 0x44, 0x00, 0x44, 0x00, 0x48, 0x00, 0x90, 0x00, 0xA0, 0x01, 0xC0, 0x00, +/* 0x03 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x00, 0x31, 0x8C, 0x63, 0x18, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x06, 0x20, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x04 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x82, 0x30, 0x88, 0x62, 0x08, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x06, 0x3F, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x05 */ 0x0B, 0x10, 0x14, 0xA8, 0x12, 0x50, 0x29, 0x42, 0x24, 0xA5, 0x32, 0x95, 0x5A, 0x09, 0x48, 0x09, 0x24, 0x01, 0x10, 0x01, 0x48, 0x02, 0xA4, 0x02, 0x42, 0x04, 0x01, 0x98, 0x00, 0x60, +/* 0x06 */ 0x00, 0x80, 0x22, 0x80, 0x65, 0x00, 0xBE, 0xE1, 0x82, 0x4E, 0x03, 0x24, 0x04, 0x28, 0x06, 0x30, 0x12, 0x20, 0x3C, 0xA0, 0xC3, 0xFE, 0x80, 0x4D, 0x00, 0xA6, 0x01, 0x80, 0x00, +/* 0x07 */ +/* 0x08 */ 0x00, 0xF8, 0x00, 0x82, 0x00, 0x80, 0x83, 0xE0, 0x41, 0x10, 0x21, 0x04, 0x1B, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xE0, 0x00, 0x4F, 0xE1, 0xC0, 0x0F, 0x02, 0x00, 0x03, 0x01, 0x00, 0x09, 0x88, 0x0C, 0x0C, +/* 0x09 */ 0x00, 0xF8, 0x00, 0x82, 0x00, 0x80, 0x83, 0xE0, 0x41, 0x10, 0x21, 0x04, 0x1B, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xE0, 0x00, 0x4F, 0xE1, 0xC0, 0x0F, 0x00, +/* 0x0A */ +/* 0x0B */ 0x1C, 0x1C, 0x31, 0xB1, 0x90, 0x50, 0x50, 0x10, 0x18, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x02, 0x80, 0x02, 0x40, 0x01, 0x10, 0x01, 0x04, 0x01, 0x01, 0x01, 0x00, 0x41, 0x00, 0x11, 0x00, 0x07, 0x00, 0x01, 0x00, +/* 0x0C */ 0x06, 0x00, 0x0A, 0x00, 0x12, 0x00, 0x32, 0x01, 0x84, 0x04, 0x10, 0x08, 0x98, 0x1C, 0x18, 0x40, 0x48, 0x82, 0x11, 0xF0, 0x74, 0x02, 0x18, 0x70, 0x2F, 0x9F, 0x80, +/* 0x0D */ +/* 0x0E */ 0x01, 0x00, 0x05, 0x00, 0x0A, 0x00, 0x3E, 0x00, 0x82, 0x02, 0x82, 0x06, 0x04, 0x10, 0x04, 0x20, 0x08, 0x40, 0x10, 0xFF, 0x22, 0x00, 0x29, 0xFF, 0x3F, 0x8F, 0xDF, 0x9F, 0x01, 0xC0, +/* 0x0F */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x82, 0x36, 0x03, 0x60, 0x00, 0xCC, 0x19, 0xA4, 0x4B, 0x00, 0x06, 0x8E, 0x2B, 0x22, 0x66, 0x7C, 0xCC, 0x71, 0x98, 0x03, 0x00, +/* 0x10 */ 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, 0x1E, 0x00, 0x54, 0x00, 0xA8, 0x01, 0x50, 0x02, 0xA0, 0x05, 0x20, 0x32, 0x61, 0xC4, 0x74, 0x49, 0x10, 0x6C, 0x00, 0xD8, 0x01, 0x10, 0x00, +/* 0x11 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x40, 0x29, 0x00, 0x31, 0x84, 0x63, 0x18, 0xC0, 0x00, 0x80, 0x15, 0x03, 0x7E, 0x02, 0xFA, 0x04, 0xE4, 0x18, 0x84, 0x00, 0x06, 0x0C, 0x03, 0xE0, +/* 0x12 */ 0x02, 0x08, 0x01, 0x08, 0x40, 0x10, 0xC0, 0x08, 0xC0, 0x60, 0x80, 0x28, 0x04, 0x12, 0x4C, 0x10, 0x80, 0x08, 0x23, 0x0E, 0x08, 0xC4, 0x82, 0x04, 0x20, 0x83, 0x09, 0x82, 0x47, 0x01, 0x1C, 0x01, 0x30, 0x00, 0xE0, 0x00, 0x00, +/* 0x13 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x00, 0x31, 0x08, 0x65, 0x28, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x06, 0x3F, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x14 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x22, 0x29, 0x83, 0x30, 0x00, 0x65, 0x14, 0xD3, 0x4D, 0xBA, 0xEB, 0x38, 0xE6, 0x00, 0x0A, 0x00, 0x24, 0x38, 0x44, 0x01, 0x07, 0x1C, 0x01, 0xC0, +/* 0x15 */ 0x07, 0xC0, 0x30, 0x18, 0x80, 0x32, 0x00, 0xF8, 0x01, 0xF1, 0x09, 0xA5, 0x28, 0x40, 0x01, 0x80, 0x03, 0x00, 0x06, 0x3F, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x16 */ 0x0C, 0x00, 0xC0, 0x1C, 0x03, 0x80, 0xF8, 0xBB, 0x36, 0xC7, 0x99, 0xF3, 0xFE, 0x3F, 0xC3, 0xF0, 0x7E, 0x0E, 0xC1, 0x8E, 0xE0, 0x20, +/* 0x17 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x00, 0x10, 0x01, 0x20, 0x1D, 0x44, 0x42, 0x84, 0x85, 0x00, 0x86, 0x00, 0xC4, 0x00, 0x44, 0x7C, 0x44, 0x00, 0x06, 0x0C, 0x03, 0xE0, +/* 0x18 */ 0x01, 0xE0, 0x00, 0x84, 0x00, 0x40, 0x80, 0x20, 0x10, 0x08, 0x24, 0x02, 0x41, 0x00, 0x86, 0x03, 0x12, 0x03, 0xB4, 0x03, 0x52, 0x81, 0x23, 0x80, 0x70, 0xA0, 0x14, 0x28, 0x05, 0x0A, 0x01, 0x42, 0x80, 0x50, +/* 0x19 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x00, 0x33, 0x18, 0x60, 0x00, 0xDC, 0xE1, 0xB9, 0xC3, 0x7B, 0xC6, 0x63, 0x0A, 0x00, 0x24, 0xF0, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x1A */ 0xFF, 0xFC, 0x00, 0x63, 0xE3, 0x31, 0x99, 0x04, 0xC8, 0x66, 0x06, 0x30, 0x61, 0x82, 0x0C, 0x10, 0x60, 0x03, 0x04, 0x18, 0x00, 0xFF, 0xFC, +/* 0x1B */ 0x07, 0xF0, 0x06, 0x0C, 0x04, 0x01, 0x04, 0x00, 0x44, 0x22, 0x12, 0x2A, 0x89, 0x00, 0x04, 0x80, 0x02, 0x44, 0x11, 0x01, 0xF0, 0x04, 0x01, 0x0D, 0x01, 0x6A, 0x41, 0x2C, 0x00, 0x05, 0xC0, 0x0E, 0x18, 0x18, +/* 0x1C */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0xC0, 0x2A, 0x00, 0x33, 0x00, 0x66, 0x00, 0xCC, 0x39, 0x80, 0x83, 0x00, 0x06, 0x00, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x1D */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x70, 0x28, 0x00, 0x31, 0x80, 0x63, 0x18, 0xC0, 0x31, 0x80, 0x03, 0x00, 0x06, 0x60, 0x0D, 0x33, 0x12, 0x10, 0x48, 0x21, 0x23, 0x8C, 0x00, +/* 0x1E */ 0x03, 0x00, 0x07, 0x9E, 0x07, 0x00, 0x86, 0x00, 0x27, 0xC0, 0x0F, 0xC0, 0x07, 0x8C, 0x62, 0x06, 0x31, 0x20, 0x00, 0x90, 0x00, 0x48, 0x00, 0x24, 0x3E, 0x11, 0x00, 0x10, 0x40, 0x10, 0x18, 0x30, 0x03, 0xE0, +/* 0x1F */ 0x18, 0x02, 0x80, 0x4C, 0x16, 0x41, 0x24, 0x3C, 0x88, 0x6E, 0x65, 0xF2, 0x78, 0x46, 0x88, 0xCF, 0x18, 0x02, 0x80, 0x8C, 0x60, 0x70, +/* ' ' 0x20 */ +/* '!' 0x21 */ 0xFF, 0xFF, 0xF0, 0xC0, +/* '"' 0x22 */ 0xDE, 0xF7, 0x20, +/* '#' 0x23 */ 0x09, 0x86, 0x41, 0x91, 0xFF, 0x13, 0x04, 0xC3, 0x20, 0xC8, 0xFF, 0x89, 0x82, 0x61, 0x90, +/* '$' 0x24 */ 0x10, 0x1F, 0x14, 0xDA, 0x3D, 0x1E, 0x83, 0x40, 0x78, 0x17, 0x08, 0xF4, 0x7A, 0x35, 0x33, 0xF0, 0x40, 0x20, +/* '%' 0x25 */ 0x38, 0x10, 0xEC, 0x20, 0xC6, 0x20, 0xC6, 0x40, 0xC6, 0x40, 0x6C, 0x80, 0x39, 0x00, 0x01, 0x3C, 0x02, 0x77, 0x02, 0x63, 0x04, 0x63, 0x04, 0x77, 0x08, 0x3C, +/* '&' 0x26 */ 0x0E, 0x0C, 0xC3, 0x30, 0xCC, 0x1E, 0x03, 0x03, 0xC1, 0x9B, 0xC2, 0xF0, 0xEC, 0x19, 0x8F, 0x3C, 0x40, +/* ''' 0x27 */ 0xFE, +/* '(' 0x28 */ 0x13, 0x26, 0x6C, 0xCC, 0xCC, 0xC4, 0x66, 0x23, 0x10, +/* ')' 0x29 */ 0x8C, 0x46, 0x63, 0x33, 0x33, 0x32, 0x66, 0x4C, 0x80, +/* '*' 0x2A */ 0x25, 0x7E, 0xA5, 0x00, +/* '+' 0x2B */ 0x30, 0xC3, 0x3F, 0x30, 0xC3, 0x0C, +/* ',' 0x2C */ 0xD6, +/* '-' 0x2D */ 0xF0, +/* '.' 0x2E */ 0xC0, +/* '/' 0x2F */ 0x08, 0x44, 0x21, 0x10, 0x84, 0x42, 0x11, 0x08, 0x00, +/* '0' 0x30 */ 0x3C, 0x66, 0x42, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x42, 0x66, 0x3C, +/* '1' 0x31 */ 0x11, 0x3F, 0x33, 0x33, 0x33, 0x33, 0x30, +/* '2' 0x32 */ 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x1C, 0x1C, 0x1C, 0x18, 0x18, 0x10, 0x08, 0x07, 0xF8, +/* '3' 0x33 */ 0x3C, 0x66, 0xC3, 0xC3, 0x03, 0x06, 0x1C, 0x07, 0x03, 0xC3, 0xC3, 0x66, 0x3C, +/* '4' 0x34 */ 0x0C, 0x18, 0x71, 0x62, 0xC9, 0xA3, 0x46, 0xFE, 0x18, 0x30, 0x60, 0xC0, +/* '5' 0x35 */ 0x7F, 0x20, 0x10, 0x08, 0x08, 0x07, 0xF3, 0x8C, 0x03, 0x01, 0x80, 0xF0, 0x6C, 0x63, 0xE0, +/* '6' 0x36 */ 0x1E, 0x31, 0x98, 0x78, 0x0C, 0x06, 0xF3, 0x8D, 0x83, 0xC1, 0xE0, 0xD0, 0x6C, 0x63, 0xE0, +/* '7' 0x37 */ 0xFF, 0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x18, 0x18, 0x18, 0x10, 0x30, 0x30, +/* '8' 0x38 */ 0x3E, 0x31, 0xB0, 0x78, 0x3C, 0x1B, 0x18, 0xF8, 0xC6, 0xC1, 0xE0, 0xF0, 0x6C, 0x63, 0xE0, +/* '9' 0x39 */ 0x3C, 0x66, 0xC2, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0xC2, 0x66, 0x3C, +/* ':' 0x3A */ 0xC0, 0x00, 0x30, +/* ';' 0x3B */ 0xC0, 0x00, 0x00, 0x64, 0xA0, +/* '<' 0x3C */ 0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x07, 0x80, 0x70, 0x0E, 0x01, 0x80, +/* '=' 0x3D */ 0xFF, 0x80, 0x00, 0x1F, 0xF0, +/* '>' 0x3E */ 0xE0, 0x1C, 0x03, 0x80, 0x30, 0x70, 0xE3, 0x81, 0x00, +/* '?' 0x3F */ 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x18, 0x38, 0x18, 0x18, 0x0C, 0x00, 0x00, 0x01, 0x80, +/* '@' 0x40 */ 0x03, 0xF0, 0x06, 0x0E, 0x06, 0x01, 0x86, 0x00, 0x66, 0x1D, 0xBB, 0x31, 0xCF, 0x18, 0xC7, 0x98, 0x63, 0xCC, 0x31, 0xE6, 0x11, 0xB3, 0x99, 0xCC, 0xF7, 0x86, 0x00, 0x01, 0x80, 0x00, 0x70, 0x40, 0x0F, 0xE0, +/* 'A' 0x41 */ 0x06, 0x00, 0xF0, 0x0F, 0x00, 0x90, 0x19, 0x81, 0x98, 0x10, 0x83, 0x0C, 0x3F, 0xC2, 0x04, 0x60, 0x66, 0x06, 0xC0, 0x30, +/* 'B' 0x42 */ 0xFF, 0x18, 0x33, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x3F, 0xC6, 0x06, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, +/* 'C' 0x43 */ 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 */ 0xC0, 0x6C, 0x0D, 0x81, 0x10, 0x63, 0x0C, 0x61, 0x04, 0x60, 0xCC, 0x19, 0x01, 0x60, 0x3C, 0x07, 0x00, 0x60, +/* 'W' 0x57 */ 0xC1, 0x81, 0x61, 0xC3, 0x61, 0xC3, 0x61, 0x43, 0x62, 0x62, 0x22, 0x66, 0x32, 0x26, 0x36, 0x26, 0x14, 0x34, 0x14, 0x34, 0x1C, 0x1C, 0x18, 0x1C, 0x08, 0x18, +/* 'X' 0x58 */ 0xC0, 0xD8, 0x66, 0x18, 0xCC, 0x1E, 0x07, 0x00, 0xC0, 0x78, 0x32, 0x0C, 0xC6, 0x1B, 0x07, 0xC0, 0xC0, +/* 'Y' 0x59 */ 0xC0, 0x36, 0x06, 0x30, 0xC3, 0x0C, 0x19, 0x81, 0xD8, 0x0F, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, +/* 'Z' 0x5A */ 0xFF, 0xC0, 0x60, 0x30, 0x0C, 0x06, 0x03, 0x01, 0xC0, 0x60, 0x30, 0x18, 0x06, 0x03, 0x00, 0xFF, 0xC0, +/* '[' 0x5B */ 0xFB, 0x6D, 0xB6, 0xDB, 0x6D, 0xB6, 0xE0, +/* '\' 0x5C */ 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x80, +/* ']' 0x5D */ 0xED, 0xB6, 0xDB, 0x6D, 0xB6, 0xDB, 0xE0, +/* '^' 0x5E */ 0x30, 0x60, 0xA2, 0x44, 0xD8, 0xA1, 0x80, +/* '_' 0x5F */ 0xFF, 0xC0, +/* '`' 0x60 */ 0xC6, 0x30, +/* 'a' 0x61 */ 0x7E, 0x71, 0xB0, 0xC0, 0x60, 0xF3, 0xDB, 0x0D, 0x86, 0xC7, 0x3D, 0xC0, +/* 'b' 0x62 */ 0xC0, 0x60, 0x30, 0x1B, 0xCE, 0x36, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x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, 0xE3, 0x6F, 0x30, 0x18, 0x0C, 0x00, +/* 'q' 0x71 */ 0x3B, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0x03, +/* 'r' 0x72 */ 0xDF, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0x00, +/* 's' 0x73 */ 0x3E, 0xE3, 0xC0, 0xC0, 0xE0, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, +/* 't' 0x74 */ 0x66, 0xF6, 0x66, 0x66, 0x66, 0x67, +/* 'u' 0x75 */ 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, +/* 'v' 0x76 */ 0xC1, 0xA0, 0x98, 0xCC, 0x42, 0x21, 0xB0, 0xD0, 0x28, 0x1C, 0x0C, 0x00, +/* 'w' 0x77 */ 0xC6, 0x1E, 0x38, 0x91, 0xC4, 0xCA, 0x66, 0xD3, 0x16, 0xD0, 0xA6, 0x87, 0x1C, 0x38, 0xC0, 0xC6, 0x00, +/* 'x' 0x78 */ 0x87, 0x89, 0xB1, 0xC3, 0x07, 0x1E, 0x26, 0xC5, 0x0C, +/* 'y' 0x79 */ 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, +/* 'z' 0x7A */ 0xFE, 0x0C, 0x30, 0xC1, 0x86, 0x18, 0x20, 0xC1, 0xFC, +/* '{' 0x7B */ 0x36, 0x66, 0x66, 0x6E, 0xCE, 0x66, 0x66, 0x66, 0x30, +/* '|' 0x7C */ 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, +/* '}' 0x7D */ 0xC6, 0x66, 0x66, 0x67, 0x37, 0x66, 0x66, 0x66, 0xC0, +/* '~' 0x7E */ 0x61, 0x24, 0x38, +/* 0x7F */ 0xFF, 0xFC, 0x00, 0x63, 0xE3, 0x31, 0x99, 0x04, 0xC8, 0x66, 0x06, 0x30, 0x61, 0x83, 0x0C, 0x18, 0x60, 0x03, 0x06, 0x18, 0x00, 0xFF, 0xFC, +/* 0x80 */ 0x07, 0xC6, 0x13, 0x00, 0xC0, 0x60, 0x3F, 0xE6, 0x03, 0xFC, 0x60, 0x0C, 0x03, 0x00, 0x61, 0x07, 0xC0, +/* 0x81 */ +/* 0x82 */ 0xDC, +/* 0x83 */ +/* 0x84 */ 0xDA, 0x76, +/* 0x85 */ 0xCC, 0xC0, +/* 0x86 */ 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, +/* 0x87 */ 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, +/* 0x88 */ +/* 0x89 */ 0x70, 0x80, 0x22, 0x20, 0x08, 0x90, 0x02, 0x24, 0x00, 0x72, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x10, 0x00, 0x09, 0xC7, 0x84, 0x8B, 0x31, 0x22, 0x84, 0x88, 0xB3, 0x21, 0xC7, 0x80, +/* 0x8A */ 0x1B, 0x03, 0x83, 0xF1, 0x86, 0xC0, 0xF0, 0x3C, 0x01, 0xE0, 0x1F, 0x00, 0xE0, 0x0F, 0x03, 0xC0, 0xD8, 0x63, 0xF0, +/* 0x8B */ 0x69, +/* 0x8C */ 0x06, 0x03, 0x03, 0xF1, 0x86, 0xC0, 0xF0, 0x3C, 0x01, 0xE0, 0x1F, 0x00, 0xE0, 0x0F, 0x03, 0xC0, 0xD8, 0x63, 0xF0, +/* 0x8D */ 0x33, 0x0F, 0x3F, 0xE1, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, 0x60, 0x30, +/* 0x8E */ 0x1B, 0x03, 0x8F, 0xFC, 0x06, 0x03, 0x00, 0xC0, 0x60, 0x30, 0x1C,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xC0, 0x70, +/* 0xC1 */ 0x06, 0x03, 0x00, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, +/* 0xC2 */ 0x0C, 0x04, 0x80, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, +/* 0xC3 */ 0x21, 0x07, 0x80, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, +/* 0xC4 */ 0x33, 0x00, 0x00, 0xC0, 0x78, 0x1E, 0x04, 0x83, 0x30, 0xCC, 0x33, 0x1F, 0xE6, 0x19, 0x02, 0xC0, 0xF0, 0x30, +/* 0xC5 */ 0x30, 0x60, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, +/* 0xC6 */ 0x06, 0x01, 0x80, 0x00, 0x0F, 0xC3, 0x0C, 0xC0, 0xD0, 0x1E, 0x00, 0xC0, 0x18, 0x03, 0x01, 0xA0, 0x36, 0x0C, 0x61, 0x87, 0xC0, +/* 0xC7 */ 0x1F, 0x06, 0x19, 0x83, 0xA0, 0x3C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0xE1, 0xF0, 0x08, 0x01, 0xC0, 0x18, 0x0E, 0x00, +/* 0xC8 */ 0x19, 0x81, 0xE0, 0x00, 0x0F, 0xC3, 0x0C, 0xC0, 0xF0, 0x1E, 0x00, 0xC0, 0x18, 0x03, 0x01, 0xA0, 0x36, 0x0C, 0x61, 0x87, 0xC0, +/* 0xC9 */ 0x0C, 0x0C, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, +/* 0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x63, 0x9C, 0x0F, 0x00, +/* 0xD4 */ 0x0F, 0x01, 0x98, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, 0x0F, 0x00, +/* 0xD5 */ 0x0D, 0x81, 0xB0, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, 0x0F, 0x00, +/* 0xD6 */ 0x19, 0x81, 0x98, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, 0x0F, 0x00, +/* 0xD7 */ 0x83, 0x89, 0xA1, 0x83, 0x89, 0xA1, 0x80, +/* 0xD8 */ 0x33, 0x01, 0xE0, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x0C, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x06, 0xC0, 0x70, +/* 0xD9 */ 0x04, 0x01, 0x43, 0x11, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, 0x00, +/* 0xDA */ 0x06, 0x01, 0x83, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, 0x00, +/* 0xDB */ 0x0D, 0x83, 0x63, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, 0x00, +/* 0xDC */ 0x1B, 0x00, 0x03, 0x01, 0xE0, 0x3C, 0x07, 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18, 0x24, 0x00, 0x3C, 0x66, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x66, 0x3C, +/* 0xF5 */ 0x36, 0x6C, 0x00, 0x3C, 0x66, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x66, 0x3C, +/* 0xF6 */ 0x66, 0x00, 0x3C, 0x66, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x66, 0x3C, +/* 0xF7 */ 0x18, 0x00, 0x00, 0x1F, 0xF0, 0x00, 0x00, 0x00, 0x30, +/* 0xF8 */ 0xDB, 0x81, 0xBE, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x00, +/* 0xF9 */ 0x10, 0x28, 0x10, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, +/* 0xFA */ 0x06, 0x0C, 0x18, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, +/* 0xFB */ 0x36, 0x6C, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, +/* 0xFC */ 0x66, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, +/* 0xFD */ 0x06, 0x04, 0x08, 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, +/* 0xFE */ 0x63, 0x3C, 0xC6, 0x31, 0x8C, 0x63, 0x18, 0xE2, 0x1C, 0x6F, +/* 0xFF */ 0xC0, }; const GFXglyph FreeSans9pt_Win1250Glyphs[] PROGMEM = { - /* ' ' 0x20 */ {0, 0, 0, 5, 0, 0}, - /* '!' 0x21 */ {0, 2, 13, 6, 2, -12}, - /* '"' 0x22 */ {4, 5, 4, 6, 1, -12}, - /* '#' 0x23 */ {7, 10, 12, 10, 0, -11}, - /* '$' 0x24 */ {22, 9, 16, 10, 1, -13}, - /* '%' 0x25 */ {40, 16, 13, 16, 1, -12}, - /* '&' 0x26 */ {66, 10, 13, 12, 1, -12}, - /* ''' 0x27 */ {83, 2, 4, 4, 1, -12}, - /* '(' 0x28 */ {84, 4, 17, 6, 1, -12}, - /* ')' 0x29 */ {93, 4, 17, 6, 1, -12}, - /* '*' 0x2A */ {102, 5, 5, 7, 1, -12}, - /* '+' 0x2B */ {106, 6, 8, 11, 3, -7}, - /* ',' 0x2C */ {112, 2, 4, 5, 2, 0}, - /* '-' 0x2D */ {113, 4, 1, 6, 1, -4}, - /* '.' 0x2E */ {114, 2, 1, 5, 1, 0}, - /* '/' 0x2F */ {115, 5, 13, 5, 0, -12}, - /* '0' 0x30 */ {124, 8, 13, 10, 1, -12}, - /* '1' 0x31 */ {137, 4, 13, 10, 3, -12}, - /* '2' 0x32 */ {144, 9, 13, 10, 1, -12}, - /* '3' 0x33 */ {159, 8, 13, 10, 1, -12}, - /* '4' 0x34 */ {172, 7, 13, 10, 2, -12}, - /* '5' 0x35 */ {184, 9, 13, 10, 1, -12}, - /* '6' 0x36 */ {199, 9, 13, 10, 1, -12}, - /* '7' 0x37 */ {214, 8, 13, 10, 0, -12}, - /* '8' 0x38 */ {227, 9, 13, 10, 1, -12}, - /* '9' 0x39 */ {242, 8, 13, 10, 1, -12}, - /* ':' 0x3A */ {255, 2, 10, 5, 1, -9}, - /* ';' 0x3B */ {258, 3, 12, 5, 1, -8}, - /* '<' 0x3C */ {263, 9, 9, 11, 1, -8}, - /* '=' 0x3D */ {274, 9, 4, 11, 1, -5}, - /* '>' 0x3E */ {279, 9, 8, 11, 1, -7}, - /* '?' 0x3F */ {288, 9, 13, 10, 1, -12}, - /* '@' 0x40 */ {303, 17, 16, 18, 1, -12}, - /* 'A' 0x41 */ {337, 12, 13, 12, 0, -12}, - /* 'B' 0x42 */ {357, 11, 13, 12, 1, -12}, - /* 'C' 0x43 */ {375, 11, 13, 13, 1, -12}, - /* 'D' 0x44 */ {393, 11, 13, 13, 1, -12}, - /* 'E' 0x45 */ {411, 9, 13, 11, 1, -12}, - /* 'F' 0x46 */ {426, 8, 13, 11, 1, -12}, - /* 'G' 0x47 */ {439, 12, 13, 14, 1, -12}, - /* 'H' 0x48 */ {459, 11, 13, 13, 1, -12}, - /* 'I' 0x49 */ {477, 2, 13, 5, 2, -12}, - /* 'J' 0x4A */ {481, 7, 13, 10, 1, -12}, - /* 'K' 0x4B */ {493, 10, 13, 12, 1, -12}, - /* 'L' 0x4C */ {510, 8, 13, 10, 1, -12}, - /* 'M' 0x4D */ {523, 13, 13, 15, 1, -12}, - /* 'N' 0x4E */ {545, 11, 13, 13, 1, -12}, - /* 'O' 0x4F */ {563, 13, 13, 14, 1, -12}, - /* 'P' 0x50 */ {585, 10, 13, 12, 1, -12}, - /* 'Q' 0x51 */ {602, 13, 14, 14, 1, -12}, - /* 'R' 0x52 */ {625, 12, 13, 13, 1, -12}, - /* 'S' 0x53 */ {645, 10, 13, 12, 1, -12}, - /* 'T' 0x54 */ {662, 9, 13, 11, 1, -12}, - /* 'U' 0x55 */ {677, 11, 13, 13, 1, -12}, - /* 'V' 0x56 */ {695, 11, 13, 11, 0, -12}, - /* 'W' 0x57 */ {713, 16, 13, 17, 0, -12}, - /* 'X' 0x58 */ {739, 10, 13, 12, 1, -12}, - /* 'Y' 0x59 */ {756, 12, 13, 12, 0, -12}, - /* 'Z' 0x5A */ {776, 10, 13, 11, 1, -12}, - /* '[' 0x5B */ {793, 3, 17, 5, 1, -12}, - /* '\' 0x5C */ {800, 5, 13, 5, 0, -12}, - /* ']' 0x5D */ {809, 3, 17, 5, 0, -12}, - /* '^' 0x5E */ {816, 7, 7, 8, 1, -12}, - /* '_' 0x5F */ {823, 10, 1, 10, 0, 3}, - /* '`' 0x60 */ {825, 4, 3, 5, 0, -12}, - /* 'a' 0x61 */ {827, 9, 10, 10, 1, -9}, - /* 'b' 0x62 */ {839, 9, 13, 10, 1, -12}, - /* 'c' 0x63 */ {854, 8, 10, 9, 1, -9}, - /* 'd' 0x64 */ {864, 8, 13, 10, 1, -12}, - /* 'e' 0x65 */ {877, 8, 10, 10, 1, -9}, - /* 'f' 0x66 */ {887, 4, 13, 5, 1, -12}, - /* 'g' 0x67 */ {894, 8, 14, 10, 1, -9}, - /* 'h' 0x68 */ {908, 8, 13, 10, 1, -12}, - /* 'i' 0x69 */ {921, 2, 13, 4, 1, -12}, - /* 'j' 0x6A */ {925, 4, 17, 4, 0, -12}, - /* 'k' 0x6B */ {934, 8, 13, 9, 1, -12}, - /* 'l' 0x6C */ {947, 2, 13, 4, 1, -12}, - /* 'm' 0x6D */ {951, 13, 10, 15, 1, -9}, - /* 'n' 0x6E */ {968, 8, 10, 10, 1, -9}, - /* 'o' 0x6F */ {978, 8, 10, 10, 1, -9}, - /* 'p' 0x70 */ {988, 9, 13, 10, 1, -9}, - /* 'q' 0x71 */ {1003, 8, 13, 10, 1, -9}, - /* 'r' 0x72 */ {1016, 5, 10, 6, 1, -9}, - /* 's' 0x73 */ {1023, 8, 10, 9, 1, -9}, - /* 't' 0x74 */ {1033, 4, 12, 5, 1, -11}, - /* 'u' 0x75 */ {1039, 8, 10, 10, 1, -9}, - /* 'v' 0x76 */ {1049, 9, 10, 9, 0, -9}, - /* 'w' 0x77 */ {1061, 13, 10, 13, 0, -9}, - /* 'x' 0x78 */ {1078, 7, 10, 9, 1, -9}, - /* 'y' 0x79 */ {1087, 8, 14, 9, 0, -9}, - /* 'z' 0x7A */ {1101, 7, 10, 9, 1, -9}, - /* '{' 0x7B */ {1110, 4, 17, 6, 1, -12}, - /* '|' 0x7C */ {1119, 2, 17, 4, 2, -12}, - /* '}' 0x7D */ {1124, 4, 17, 6, 1, -12}, - /* '~' 0x7E */ {1133, 7, 3, 9, 1, -7}, - /* 0x7F */ {1136, 13, 14, 15, 1, -12}, - /* 0x80 */ {1159, 10, 13, 12, 1, -12}, - /* 0x81 */ {1176, 0, 0, 0, 0, 0}, - /* 0x82 */ {1176, 2, 3, 5, 1, 0}, - /* 0x83 */ {1177, 0, 0, 0, 0, 0}, - /* 0x84 */ {1177, 5, 3, 7, 1, 0}, - /* 0x85 */ {1179, 10, 1, 12, 1, 0}, - /* 0x86 */ {1181, 8, 16, 10, 1, -12}, - /* 0x87 */ {1197, 8, 16, 10, 1, -12}, - /* 0x88 */ {1213, 0, 0, 0, 0, 0}, - /* 0x89 */ {1213, 18, 13, 18, 0, -12}, - /* 0x8A */ {1243, 10, 15, 12, 1, -14}, - /* 0x8B */ {1262, 2, 4, 4, 1, -6}, - /* 0x8C */ {1263, 10, 15, 12, 1, -14}, - /* 0x8D */ {1282, 9, 15, 11, 1, -14}, - /* 0x8E */ {1299, 10, 15, 11, 1, -14}, - /* 0x8F */ {1318, 10, 15, 11, 1, -14}, - /* 0x90 */ {1337, 0, 0, 0, 0, 0}, - /* 0x91 */ {1337, 2, 4, 4, 2, -12}, - /* 0x92 */ {1338, 2, 4, 4, 1, -12}, - /* 0x93 */ {1339, 5, 4, 7, 2, -12}, - /* 0x94 */ {1342, 5, 4, 7, 1, -12}, - /* 0x95 */ {1345, 4, 5, 7, 1, -8}, - /* 0x96 */ {1348, 7, 1, 9, 1, -4}, - /* 0x97 */ {1349, 16, 1, 18, 1, -4}, - /* 0x98 */ {1351, 0, 0, 0, 0, 0}, - /* 0x99 */ {1351, 18, 10, 18, 1, -13}, - /* 0x9A */ {1374, 8, 13, 9, 1, -12}, - /* 0x9B */ {1387, 2, 4, 5, 2, -6}, - /* 0x9C */ {1388, 8, 13, 9, 1, -12}, - /* 0x9D */ {1401, 6, 13, 8, 1, -12}, - /* 0x9E */ {1411, 7, 13, 9, 1, -12}, - /* 0x9F */ {1423, 7, 13, 9, 1, -12}, - /* 0xA0 */ {1435, 0, 0, 5, 0, 0}, - /* 0xA1 */ {1435, 5, 3, 6, 0, -12}, - /* 0xA2 */ {1437, 6, 2, 6, 0, -12}, - /* 0xA3 */ {1439, 9, 13, 11, 1, -12}, - /* 0xA4 */ {1454, 7, 6, 10, 2, -8}, - /* 0xA5 */ {1460, 12, 17, 12, 1, -12}, - /* 0xA6 */ {1486, 2, 17, 5, 2, -12}, - /* 0xA7 */ {1491, 9, 17, 10, 1, -12}, - /* 0xA8 */ {1511, 6, 1, 6, 0, -11}, - /* 0xA9 */ {1512, 14, 13, 14, 1, -12}, - /* 0xAA */ {1535, 10, 17, 12, 1, -12}, - /* 0xAB */ {1557, 7, 6, 9, 1, -7}, - /* 0xAC */ {1563, 9, 5, 11, 2, -5}, - /* 0xAD */ {1569, 0, 0, 0, 0, 0}, - /* 0xAE */ {1569, 14, 13, 14, 1, -12}, - /* 0xAF */ {1592, 10, 15, 11, 1, -14}, - /* 0xB0 */ {1611, 5, 5, 11, 3, -11}, - /* 0xB1 */ {1615, 9, 11, 11, 1, -10}, - /* 0xB2 */ {1628, 4, 4, 6, 1, 1}, - /* 0xB3 */ {1630, 4, 13, 5, 1, -12}, - /* 0xB4 */ {1637, 4, 3, 6, 2, -12}, - /* 0xB5 */ {1639, 9, 13, 10, 1, -9}, - /* 0xB6 */ {1654, 8, 16, 10, 2, -12}, - /* 0xB7 */ {1670, 3, 1, 5, 1, -4}, - /* 0xB8 */ {1671, 5, 4, 6, 1, 1}, - /* 0xB9 */ {1674, 10, 14, 10, 1, -9}, - /* 0xBA */ {1692, 8, 14, 9, 1, -9}, - /* 0xBB */ {1706, 7, 6, 9, 1, -7}, - /* 0xBC */ {1712, 8, 13, 10, 1, -12}, - /* 0xBD */ {1725, 6, 3, 6, 0, -12}, - /* 0xBE */ {1728, 5, 13, 7, 1, -12}, - /* 0xBF */ {1737, 7, 12, 9, 1, -11}, - /* 0xC0 */ {1748, 12, 15, 13, 1, -14}, - /* 0xC1 */ {1771, 10, 14, 12, 1, -13}, - /* 0xC2 */ {1789, 10, 14, 12, 1, -13}, - /* 0xC3 */ {1807, 10, 14, 12, 1, -13}, - /* 0xC4 */ {1825, 10, 14, 12, 1, -13}, - /* 0xC5 */ {1843, 8, 14, 10, 1, -13}, - /* 0xC6 */ {1857, 11, 15, 13, 1, -14}, - /* 0xC7 */ {1878, 11, 17, 13, 1, -12}, - /* 0xC8 */ {1902, 11, 15, 13, 1, -14}, - /* 0xC9 */ {1923, 9, 14, 11, 1, -13}, - /* 0xCA */ {1939, 11, 17, 12, 1, -12}, - /* 0xCB */ {1963, 9, 14, 11, 1, -13}, - /* 0xCC */ {1979, 9, 15, 11, 1, -14}, - /* 0xCD */ {1996, 3, 14, 5, 1, -13}, - /* 0xCE */ {2002, 5, 14, 5, 0, -13}, - /* 0xCF */ {2011, 10, 15, 13, 2, -14}, - /* 0xD0 */ {2030, 11, 13, 13, 1, -12}, - /* 0xD1 */ {2048, 11, 14, 13, 1, -13}, - /* 0xD2 */ {2068, 11, 14, 13, 1, -13}, - /* 0xD3 */ {2088, 12, 15, 13, 1, -14}, - /* 0xD4 */ {2111, 12, 15, 13, 1, -14}, - /* 0xD5 */ {2134, 12, 15, 13, 1, -14}, - /* 0xD6 */ {2157, 12, 15, 13, 1, -14}, - /* 0xD7 */ {2180, 7, 7, 11, 2, -7}, - /* 0xD8 */ {2187, 12, 15, 13, 1, -14}, - /* 0xD9 */ {2210, 11, 14, 13, 1, -13}, - /* 0xDA */ {2230, 11, 14, 13, 1, -13}, - /* 0xDB */ {2250, 11, 14, 13, 1, -13}, - /* 0xDC */ {2270, 11, 14, 13, 1, -13}, - /* 0xDD */ {2290, 12, 14, 12, 0, -13}, - /* 0xDE */ {2311, 9, 17, 11, 1, -12}, - /* 0xDF */ {2331, 9, 13, 11, 1, -12}, - /* 0xE0 */ {2346, 5, 13, 6, 1, -12}, - /* 0xE1 */ {2355, 9, 13, 10, 1, -12}, - /* 0xE2 */ {2370, 9, 13, 10, 1, -12}, - /* 0xE3 */ {2385, 9, 13, 10, 1, -12}, - /* 0xE4 */ {2400, 9, 12, 10, 1, -11}, - /* 0xE5 */ {2414, 3, 15, 4, 0, -14}, - /* 0xE6 */ {2420, 8, 13, 9, 1, -12}, - /* 0xE7 */ {2433, 8, 14, 9, 1, -9}, - /* 0xE8 */ {2447, 8, 13, 9, 1, -12}, - /* 0xE9 */ {2460, 8, 13, 10, 1, -12}, - /* 0xEA */ {2473, 8, 14, 10, 1, -9}, - /* 0xEB */ {2487, 8, 12, 10, 1, -11}, - /* 0xEC */ {2499, 8, 13, 10, 1, -12}, - /* 0xED */ {2512, 3, 13, 4, 1, -12}, - /* 0xEE */ {2517, 4, 13, 5, 0, -12}, - /* 0xEF */ {2524, 12, 13, 12, 1, -12}, - /* 0xF0 */ {2544, 9, 13, 10, 1, -12}, - /* 0xF1 */ {2559, 8, 13, 10, 1, -12}, - /* 0xF2 */ {2572, 8, 13, 10, 1, -12}, - /* 0xF3 */ {2585, 8, 13, 10, 1, -12}, - /* 0xF4 */ {2598, 8, 13, 10, 1, -12}, - /* 0xF5 */ {2611, 8, 13, 10, 1, -12}, - /* 0xF6 */ {2624, 8, 12, 10, 1, -11}, - /* 0xF7 */ {2636, 9, 8, 11, 1, -7}, - /* 0xF8 */ {2645, 5, 13, 6, 1, -12}, - /* 0xF9 */ {2654, 8, 13, 10, 1, -12}, - /* 0xFA */ {2667, 8, 13, 10, 1, -12}, - /* 0xFB */ {2680, 8, 13, 10, 1, -12}, - /* 0xFC */ {2693, 8, 12, 10, 1, -11}, - /* 0xFD */ {2705, 8, 17, 9, 0, -12}, - /* 0xFE */ {2722, 5, 16, 5, 1, -11}, - /* 0xFF */ {2732, 2, 1, 6, 2, -11}, +/* 0x01 */ { 0, 15, 15, 17, 1, -13 }, +/* 0x02 */ { 29, 15, 15, 17, 1, -13 }, +/* 0x03 */ { 58, 15, 16, 17, 1, -14 }, +/* 0x04 */ { 88, 15, 16, 17, 1, -14 }, +/* 0x05 */ { 118, 16, 15, 18, 1, -13 }, +/* 0x06 */ { 148, 15, 15, 17, 1, -13 }, +/* 0x07 */ { 177, 0, 0, 8, 0, 0 }, +/* 0x08 */ { 177, 17, 16, 19, 1, -14 }, +/* 0x09 */ { 211, 17, 12, 19, 1, -12 }, +/* 0x0A */ { 237, 0, 0, 8, 0, 0 }, +/* 0x0B */ { 237, 17, 16, 19, 1, -14 }, +/* 0x0C */ { 271, 15, 14, 17, 1, -12 }, +/* 0x0D */ { 298, 0, 0, 8, 0, 0 }, +/* 0x0E */ { 298, 15, 16, 17, 1, -14 }, +/* 0x0F */ { 328, 15, 15, 17, 1, -13 }, +/* 0x10 */ { 357, 15, 15, 17, 1, -13 }, +/* 0x11 */ { 386, 15, 16, 17, 1, -14 }, +/* 0x12 */ { 416, 17, 17, 19, 1, -15 }, +/* 0x13 */ { 453, 15, 16, 17, 1, -14 }, +/* 0x14 */ { 483, 15, 16, 17, 1, -14 }, +/* 0x15 */ { 513, 15, 16, 17, 1, -14 }, +/* 0x16 */ { 543, 11, 16, 13, 1, -14 }, +/* 0x17 */ { 565, 15, 16, 17, 1, -14 }, +/* 0x18 */ { 595, 18, 15, 20, 1, -13 }, +/* 0x19 */ { 629, 15, 16, 17, 1, -14 }, +/* 0x1A */ { 659, 13, 14, 15, 1, -12 }, +/* 0x1B */ { 682, 17, 16, 19, 1, -14 }, +/* 0x1C */ { 716, 15, 16, 17, 1, -14 }, +/* 0x1D */ { 746, 15, 15, 17, 1, -13 }, +/* 0x1E */ { 775, 17, 16, 19, 1, -14 }, +/* 0x1F */ { 809, 11, 16, 13, 1, -14 }, +/* ' ' 0x20 */ { 831, 0, 0, 5, 0, 0 }, +/* '!' 0x21 */ { 831, 2, 13, 6, 2, -12 }, +/* '"' 0x22 */ { 835, 5, 4, 6, 1, -12 }, +/* '#' 0x23 */ { 838, 10, 12, 10, 0, -11 }, +/* '$' 0x24 */ { 853, 9, 16, 10, 1, -13 }, +/* '%' 0x25 */ { 871, 16, 13, 16, 1, -12 }, +/* '&' 0x26 */ { 897, 10, 13, 12, 1, -12 }, +/* ''' 0x27 */ { 914, 2, 4, 4, 1, -12 }, +/* '(' 0x28 */ { 915, 4, 17, 6, 1, -12 }, +/* ')' 0x29 */ { 924, 4, 17, 6, 1, -12 }, +/* '*' 0x2A */ { 933, 5, 5, 7, 1, -12 }, +/* '+' 0x2B */ { 937, 6, 8, 11, 3, -7 }, +/* ',' 0x2C */ { 943, 2, 4, 5, 2, 0 }, +/* '-' 0x2D */ { 944, 4, 1, 6, 1, -4 }, +/* '.' 0x2E */ { 945, 2, 1, 5, 1, 0 }, +/* '/' 0x2F */ { 946, 5, 13, 5, 0, -12 }, +/* '0' 0x30 */ { 955, 8, 13, 10, 1, -12 }, +/* '1' 0x31 */ { 968, 4, 13, 10, 3, -12 }, +/* '2' 0x32 */ { 975, 9, 13, 10, 1, -12 }, +/* '3' 0x33 */ { 990, 8, 13, 10, 1, -12 }, +/* '4' 0x34 */ { 1003, 7, 13, 10, 2, -12 }, +/* '5' 0x35 */ { 1015, 9, 13, 10, 1, -12 }, +/* '6' 0x36 */ { 1030, 9, 13, 10, 1, -12 }, +/* '7' 0x37 */ { 1045, 8, 13, 10, 0, -12 }, +/* '8' 0x38 */ { 1058, 9, 13, 10, 1, -12 }, +/* '9' 0x39 */ { 1073, 8, 13, 10, 1, -12 }, +/* ':' 0x3A */ { 1086, 2, 10, 5, 1, -9 }, +/* ';' 0x3B */ { 1089, 3, 12, 5, 1, -8 }, +/* '<' 0x3C */ { 1094, 9, 9, 11, 1, -8 }, +/* '=' 0x3D */ { 1105, 9, 4, 11, 1, -5 }, +/* '>' 0x3E */ { 1110, 9, 8, 11, 1, -7 }, +/* '?' 0x3F */ { 1119, 9, 13, 10, 1, -12 }, +/* '@' 0x40 */ { 1134, 17, 16, 18, 1, -12 }, +/* 'A' 0x41 */ { 1168, 12, 13, 12, 0, -12 }, +/* 'B' 0x42 */ { 1188, 11, 13, 12, 1, -12 }, +/* 'C' 0x43 */ { 1206, 11, 13, 13, 1, -12 }, +/* 'D' 0x44 */ { 1224, 11, 13, 13, 1, -12 }, +/* 'E' 0x45 */ { 1242, 9, 13, 11, 1, -12 }, +/* 'F' 0x46 */ { 1257, 8, 13, 11, 1, -12 }, +/* 'G' 0x47 */ { 1270, 12, 13, 14, 1, -12 }, +/* 'H' 0x48 */ { 1290, 11, 13, 13, 1, -12 }, +/* 'I' 0x49 */ { 1308, 2, 13, 5, 2, -12 }, +/* 'J' 0x4A */ { 1312, 7, 13, 10, 1, -12 }, +/* 'K' 0x4B */ { 1324, 10, 13, 12, 1, -12 }, +/* 'L' 0x4C */ { 1341, 8, 13, 10, 1, -12 }, +/* 'M' 0x4D */ { 1354, 13, 13, 15, 1, -12 }, +/* 'N' 0x4E */ { 1376, 11, 13, 13, 1, -12 }, +/* 'O' 0x4F */ { 1394, 13, 13, 14, 1, -12 }, +/* 'P' 0x50 */ { 1416, 10, 13, 12, 1, -12 }, +/* 'Q' 0x51 */ { 1433, 13, 14, 14, 1, -12 }, +/* 'R' 0x52 */ { 1456, 12, 13, 13, 1, -12 }, +/* 'S' 0x53 */ { 1476, 10, 13, 12, 1, -12 }, +/* 'T' 0x54 */ { 1493, 9, 13, 11, 1, -12 }, +/* 'U' 0x55 */ { 1508, 11, 13, 13, 1, -12 }, +/* 'V' 0x56 */ { 1526, 11, 13, 11, 0, -12 }, +/* 'W' 0x57 */ { 1544, 16, 13, 17, 0, -12 }, +/* 'X' 0x58 */ { 1570, 10, 13, 12, 1, -12 }, +/* 'Y' 0x59 */ { 1587, 12, 13, 12, 0, -12 }, +/* 'Z' 0x5A */ { 1607, 10, 13, 11, 1, -12 }, +/* '[' 0x5B */ { 1624, 3, 17, 5, 1, -12 }, +/* '\' 0x5C */ { 1631, 5, 13, 5, 0, -12 }, +/* ']' 0x5D */ { 1640, 3, 17, 5, 0, -12 }, +/* '^' 0x5E */ { 1647, 7, 7, 8, 1, -12 }, +/* '_' 0x5F */ { 1654, 10, 1, 10, 0, 3 }, +/* '`' 0x60 */ { 1656, 4, 3, 5, 0, -12 }, +/* 'a' 0x61 */ { 1658, 9, 10, 10, 1, -9 }, +/* 'b' 0x62 */ { 1670, 9, 13, 10, 1, -12 }, +/* 'c' 0x63 */ { 1685, 8, 10, 9, 1, -9 }, +/* 'd' 0x64 */ { 1695, 8, 13, 10, 1, -12 }, +/* 'e' 0x65 */ { 1708, 8, 10, 10, 1, -9 }, +/* 'f' 0x66 */ { 1718, 4, 13, 5, 1, -12 }, +/* 'g' 0x67 */ { 1725, 8, 14, 10, 1, -9 }, +/* 'h' 0x68 */ { 1739, 8, 13, 10, 1, -12 }, +/* 'i' 0x69 */ { 1752, 2, 13, 4, 1, -12 }, +/* 'j' 0x6A */ { 1756, 4, 17, 4, 0, -12 }, +/* 'k' 0x6B */ { 1765, 8, 13, 9, 1, -12 }, +/* 'l' 0x6C */ { 1778, 2, 13, 4, 1, -12 }, +/* 'm' 0x6D */ { 1782, 13, 10, 15, 1, -9 }, +/* 'n' 0x6E */ { 1799, 8, 10, 10, 1, -9 }, +/* 'o' 0x6F */ { 1809, 8, 10, 10, 1, -9 }, +/* 'p' 0x70 */ { 1819, 9, 13, 10, 1, -9 }, +/* 'q' 0x71 */ { 1834, 8, 13, 10, 1, -9 }, +/* 'r' 0x72 */ { 1847, 5, 10, 6, 1, -9 }, +/* 's' 0x73 */ { 1854, 8, 10, 9, 1, -9 }, +/* 't' 0x74 */ { 1864, 4, 12, 5, 1, -11 }, +/* 'u' 0x75 */ { 1870, 8, 10, 10, 1, -9 }, +/* 'v' 0x76 */ { 1880, 9, 10, 9, 0, -9 }, +/* 'w' 0x77 */ { 1892, 13, 10, 13, 0, -9 }, +/* 'x' 0x78 */ { 1909, 7, 10, 9, 1, -9 }, +/* 'y' 0x79 */ { 1918, 8, 14, 9, 0, -9 }, +/* 'z' 0x7A */ { 1932, 7, 10, 9, 1, -9 }, +/* '{' 0x7B */ { 1941, 4, 17, 6, 1, -12 }, +/* '|' 0x7C */ { 1950, 2, 17, 4, 2, -12 }, +/* '}' 0x7D */ { 1955, 4, 17, 6, 1, -12 }, +/* '~' 0x7E */ { 1964, 7, 3, 9, 1, -7 }, +/* 0x7F */ { 1967, 13, 14, 15, 1, -12 }, +/* 0x80 */ { 1990, 10, 13, 12, 1, -12 }, +/* 0x81 */ { 2007, 0, 0, 0, 0, 0 }, +/* 0x82 */ { 2007, 2, 3, 5, 1, 0 }, +/* 0x83 */ { 2008, 0, 0, 0, 0, 0 }, +/* 0x84 */ { 2008, 5, 3, 7, 1, 0 }, +/* 0x85 */ { 2010, 10, 1, 12, 1, 0 }, +/* 0x86 */ { 2012, 8, 16, 10, 1, -12 }, +/* 0x87 */ { 2028, 8, 16, 10, 1, -12 }, +/* 0x88 */ { 2044, 0, 0, 0, 0, 0 }, +/* 0x89 */ { 2044, 18, 13, 18, 0, -12 }, +/* 0x8A */ { 2074, 10, 15, 12, 1, -14 }, +/* 0x8B */ { 2093, 2, 4, 4, 1, -6 }, +/* 0x8C */ { 2094, 10, 15, 12, 1, -14 }, +/* 0x8D */ { 2113, 9, 15, 11, 1, -14 }, +/* 0x8E */ { 2130, 10, 15, 11, 1, -14 }, +/* 0x8F */ { 2149, 10, 15, 11, 1, -14 }, +/* 0x90 */ { 2168, 0, 0, 0, 0, 0 }, +/* 0x91 */ { 2168, 2, 4, 4, 2, -12 }, +/* 0x92 */ { 2169, 2, 4, 4, 1, -12 }, +/* 0x93 */ { 2170, 5, 4, 7, 2, -12 }, +/* 0x94 */ { 2173, 5, 4, 7, 1, -12 }, +/* 0x95 */ { 2176, 4, 5, 7, 1, -8 }, +/* 0x96 */ { 2179, 7, 1, 9, 1, -4 }, +/* 0x97 */ { 2180, 16, 1, 18, 1, -4 }, +/* 0x98 */ { 2182, 0, 0, 0, 0, 0 }, +/* 0x99 */ { 2182, 18, 10, 18, 1, -13 }, +/* 0x9A */ { 2205, 8, 13, 9, 1, -12 }, +/* 0x9B */ { 2218, 2, 4, 5, 2, -6 }, +/* 0x9C */ { 2219, 8, 13, 9, 1, -12 }, +/* 0x9D */ { 2232, 6, 13, 8, 1, -12 }, +/* 0x9E */ { 2242, 7, 13, 9, 1, -12 }, +/* 0x9F */ { 2254, 7, 13, 9, 1, -12 }, +/* 0xA0 */ { 2266, 0, 0, 5, 0, 0 }, +/* 0xA1 */ { 2266, 5, 3, 6, 0, -12 }, +/* 0xA2 */ { 2268, 6, 2, 6, 0, -12 }, +/* 0xA3 */ { 2270, 9, 13, 11, 1, -12 }, +/* 0xA4 */ { 2285, 7, 6, 10, 2, -8 }, +/* 0xA5 */ { 2291, 12, 17, 12, 1, -12 }, +/* 0xA6 */ { 2317, 2, 17, 5, 2, -12 }, +/* 0xA7 */ { 2322, 9, 17, 10, 1, -12 }, +/* 0xA8 */ { 2342, 6, 1, 6, 0, -11 }, +/* 0xA9 */ { 2343, 14, 13, 14, 1, -12 }, +/* 0xAA */ { 2366, 10, 17, 12, 1, -12 }, +/* 0xAB */ { 2388, 7, 6, 9, 1, -7 }, +/* 0xAC */ { 2394, 9, 5, 11, 2, -5 }, +/* 0xAD */ { 2400, 0, 0, 0, 0, 0 }, +/* 0xAE */ { 2400, 14, 13, 14, 1, -12 }, +/* 0xAF */ { 2423, 10, 15, 11, 1, -14 }, +/* 0xB0 */ { 2442, 5, 5, 11, 3, -11 }, +/* 0xB1 */ { 2446, 9, 11, 11, 1, -10 }, +/* 0xB2 */ { 2459, 4, 4, 6, 1, 1 }, +/* 0xB3 */ { 2461, 4, 13, 5, 1, -12 }, +/* 0xB4 */ { 2468, 4, 3, 6, 2, -12 }, +/* 0xB5 */ { 2470, 9, 13, 10, 1, -9 }, +/* 0xB6 */ { 2485, 8, 16, 10, 2, -12 }, +/* 0xB7 */ { 2501, 3, 1, 5, 1, -4 }, +/* 0xB8 */ { 2502, 5, 4, 6, 1, 1 }, +/* 0xB9 */ { 2505, 10, 14, 10, 1, -9 }, +/* 0xBA */ { 2523, 8, 14, 9, 1, -9 }, +/* 0xBB */ { 2537, 7, 6, 9, 1, -7 }, +/* 0xBC */ { 2543, 8, 13, 10, 1, -12 }, +/* 0xBD */ { 2556, 6, 3, 6, 0, -12 }, +/* 0xBE */ { 2559, 5, 13, 7, 1, -12 }, +/* 0xBF */ { 2568, 7, 12, 9, 1, -11 }, +/* 0xC0 */ { 2579, 12, 15, 13, 1, -14 }, +/* 0xC1 */ { 2602, 10, 14, 12, 1, -13 }, +/* 0xC2 */ { 2620, 10, 14, 12, 1, -13 }, +/* 0xC3 */ { 2638, 10, 14, 12, 1, -13 }, +/* 0xC4 */ { 2656, 10, 14, 12, 1, -13 }, +/* 0xC5 */ { 2674, 8, 14, 10, 1, -13 }, +/* 0xC6 */ { 2688, 11, 15, 13, 1, -14 }, +/* 0xC7 */ { 2709, 11, 17, 13, 1, -12 }, +/* 0xC8 */ { 2733, 11, 15, 13, 1, -14 }, +/* 0xC9 */ { 2754, 9, 14, 11, 1, -13 }, +/* 0xCA */ { 2770, 11, 17, 12, 1, -12 }, +/* 0xCB */ { 2794, 9, 14, 11, 1, -13 }, +/* 0xCC */ { 2810, 9, 15, 11, 1, -14 }, +/* 0xCD */ { 2827, 3, 14, 5, 1, -13 }, +/* 0xCE */ { 2833, 5, 14, 5, 0, -13 }, +/* 0xCF */ { 2842, 10, 15, 13, 2, -14 }, +/* 0xD0 */ { 2861, 11, 13, 13, 1, -12 }, +/* 0xD1 */ { 2879, 11, 14, 13, 1, -13 }, +/* 0xD2 */ { 2899, 11, 14, 13, 1, -13 }, +/* 0xD3 */ { 2919, 12, 15, 13, 1, -14 }, +/* 0xD4 */ { 2942, 12, 15, 13, 1, -14 }, +/* 0xD5 */ { 2965, 12, 15, 13, 1, -14 }, +/* 0xD6 */ { 2988, 12, 15, 13, 1, -14 }, +/* 0xD7 */ { 3011, 7, 7, 11, 2, -7 }, +/* 0xD8 */ { 3018, 12, 15, 13, 1, -14 }, +/* 0xD9 */ { 3041, 11, 14, 13, 1, -13 }, +/* 0xDA */ { 3061, 11, 14, 13, 1, -13 }, +/* 0xDB */ { 3081, 11, 14, 13, 1, -13 }, +/* 0xDC */ { 3101, 11, 14, 13, 1, -13 }, +/* 0xDD */ { 3121, 12, 14, 12, 0, -13 }, +/* 0xDE */ { 3142, 9, 17, 11, 1, -12 }, +/* 0xDF */ { 3162, 9, 13, 11, 1, -12 }, +/* 0xE0 */ { 3177, 5, 13, 6, 1, -12 }, +/* 0xE1 */ { 3186, 9, 13, 10, 1, -12 }, +/* 0xE2 */ { 3201, 9, 13, 10, 1, -12 }, +/* 0xE3 */ { 3216, 9, 13, 10, 1, -12 }, +/* 0xE4 */ { 3231, 9, 12, 10, 1, -11 }, +/* 0xE5 */ { 3245, 3, 15, 4, 0, -14 }, +/* 0xE6 */ { 3251, 8, 13, 9, 1, -12 }, +/* 0xE7 */ { 3264, 8, 14, 9, 1, -9 }, +/* 0xE8 */ { 3278, 8, 13, 9, 1, -12 }, +/* 0xE9 */ { 3291, 8, 13, 10, 1, -12 }, +/* 0xEA */ { 3304, 8, 14, 10, 1, -9 }, +/* 0xEB */ { 3318, 8, 12, 10, 1, -11 }, +/* 0xEC */ { 3330, 8, 13, 10, 1, -12 }, +/* 0xED */ { 3343, 3, 13, 4, 1, -12 }, +/* 0xEE */ { 3348, 4, 13, 5, 0, -12 }, +/* 0xEF */ { 3355, 12, 13, 12, 1, -12 }, +/* 0xF0 */ { 3375, 9, 13, 10, 1, -12 }, +/* 0xF1 */ { 3390, 8, 13, 10, 1, -12 }, +/* 0xF2 */ { 3403, 8, 13, 10, 1, -12 }, +/* 0xF3 */ { 3416, 8, 13, 10, 1, -12 }, +/* 0xF4 */ { 3429, 8, 13, 10, 1, -12 }, +/* 0xF5 */ { 3442, 8, 13, 10, 1, -12 }, +/* 0xF6 */ { 3455, 8, 12, 10, 1, -11 }, +/* 0xF7 */ { 3467, 9, 8, 11, 1, -7 }, +/* 0xF8 */ { 3476, 5, 13, 6, 1, -12 }, +/* 0xF9 */ { 3485, 8, 13, 10, 1, -12 }, +/* 0xFA */ { 3498, 8, 13, 10, 1, -12 }, +/* 0xFB */ { 3511, 8, 13, 10, 1, -12 }, +/* 0xFC */ { 3524, 8, 12, 10, 1, -11 }, +/* 0xFD */ { 3536, 8, 17, 9, 0, -12 }, +/* 0xFE */ { 3553, 5, 16, 5, 1, -11 }, +/* 0xFF */ { 3563, 2, 1, 6, 2, -11 }, }; -const GFXfont FreeSans9pt_Win1250 PROGMEM = {(uint8_t *)FreeSans9pt_Win1250Bitmaps, (GFXglyph *)FreeSans9pt_Win1250Glyphs, 0x20, - 0xFF, 21}; +const GFXfont FreeSans9pt_Win1250 PROGMEM = { +(uint8_t*)FreeSans9pt_Win1250Bitmaps, +(GFXglyph*)FreeSans9pt_Win1250Glyphs, +0x01, 0xFF, 21 +}; diff --git a/src/graphics/niche/Fonts/FreeSans9pt_Win1251.h b/src/graphics/niche/Fonts/FreeSans9pt_Win1251.h index 82857cb91..b1511d996 100644 --- a/src/graphics/niche/Fonts/FreeSans9pt_Win1251.h +++ b/src/graphics/niche/Fonts/FreeSans9pt_Win1251.h @@ -1,493 +1,527 @@ +// trunk-ignore-all(clang-format) #pragma once +/* PROPERTIES + +FONT_NAME FreeSans9pt_Win1251 +*/ const uint8_t FreeSans9pt_Win1251Bitmaps[] PROGMEM = { - /* ' ' 0x20 */ - 0xFF, 0xFF, 0xF0, 0xC0, /* '!' 0x21 */ - 0xDE, 0xF7, 0x20, /* '"' 0x22 */ - 0x09, 0x86, 0x41, 0x91, 0xFF, 0x13, 0x04, 0xC3, 0x20, 0xC8, 0xFF, 0x89, 0x82, 0x61, 0x90, /* '#' 0x23 */ - 0x10, 0x1F, 0x14, 0xDA, 0x3D, 0x1E, 0x83, 0x40, 0x78, 0x17, 0x08, 0xF4, 0x7A, 0x35, 0x33, 0xF0, 0x40, 0x20, /* '$' 0x24 */ - 0x38, 0x10, 0xEC, 0x20, 0xC6, 0x20, 0xC6, 0x40, 0xC6, 0x40, 0x6C, 0x80, 0x39, 0x00, 0x01, 0x3C, 0x02, 0x77, 0x02, 0x63, 0x04, - 0x63, 0x04, 0x77, 0x08, 0x3C, /* '%' 0x25 */ - 0x0E, 0x0C, 0xC3, 0x30, 0xCC, 0x1E, 0x03, 0x03, 0xC1, 0x9B, 0xC2, 0xF0, 0xEC, 0x19, 0x8F, 0x3C, 0x40, /* '&' 0x26 */ - 0xFE, /* ''' 0x27 */ - 0x13, 0x26, 0x6C, 0xCC, 0xCC, 0xC4, 0x66, 0x23, 0x10, /* '(' 0x28 */ - 0x8C, 0x46, 0x63, 0x33, 0x33, 0x32, 0x66, 0x4C, 0x80, /* ')' 0x29 */ - 0x25, 0x7E, 0xA5, 0x00, /* '*' 0x2A */ - 0x30, 0xC3, 0x3F, 0x30, 0xC3, 0x0C, /* '+' 0x2B */ - 0xD6, /* ',' 0x2C */ - 0xF0, /* '-' 0x2D */ - 0xC0, /* '.' 0x2E */ - 0x08, 0x44, 0x21, 0x10, 0x84, 0x42, 0x11, 0x08, 0x00, /* '/' 0x2F */ - 0x3C, 0x66, 0x42, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x42, 0x66, 0x3C, /* '0' 0x30 */ - 0x11, 0x3F, 0x33, 0x33, 0x33, 0x33, 0x30, /* '1' 0x31 */ - 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x1C, 0x1C, 0x1C, 0x18, 0x18, 0x10, 0x08, 0x07, 0xF8, /* '2' 0x32 */ - 0x3C, 0x66, 0xC3, 0xC3, 0x03, 0x06, 0x1C, 0x07, 0x03, 0xC3, 0xC3, 0x66, 0x3C, /* '3' 0x33 */ - 0x0C, 0x18, 0x71, 0x62, 0xC9, 0xA3, 0x46, 0xFE, 0x18, 0x30, 0x60, 0xC0, /* '4' 0x34 */ - 0x7F, 0x20, 0x10, 0x08, 0x08, 0x07, 0xF3, 0x8C, 0x03, 0x01, 0x80, 0xF0, 0x6C, 0x63, 0xE0, /* '5' 0x35 */ - 0x1E, 0x31, 0x98, 0x78, 0x0C, 0x06, 0xF3, 0x8D, 0x83, 0xC1, 0xE0, 0xD0, 0x6C, 0x63, 0xE0, /* '6' 0x36 */ - 0xFF, 0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x18, 0x18, 0x18, 0x10, 0x30, 0x30, /* '7' 0x37 */ - 0x3E, 0x31, 0xB0, 0x78, 0x3C, 0x1B, 0x18, 0xF8, 0xC6, 0xC1, 0xE0, 0xF0, 0x6C, 0x63, 0xE0, /* '8' 0x38 */ - 0x3C, 0x66, 0xC2, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0xC2, 0x66, 0x3C, /* '9' 0x39 */ - 0xC0, 0x00, 0x30, /* ':' 0x3A */ - 0xC0, 0x00, 0x00, 0x64, 0xA0, /* ';' 0x3B */ - 0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x07, 0x80, 0x70, 0x0E, 0x01, 0x80, /* '<' 0x3C */ - 0xFF, 0x80, 0x00, 0x1F, 0xF0, /* '=' 0x3D */ - 0xE0, 0x1C, 0x03, 0x80, 0x30, 0x70, 0xE3, 0x81, 0x00, /* '>' 0x3E */ - 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x18, 0x38, 0x18, 0x18, 0x0C, 0x00, 0x00, 0x01, 0x80, /* '?' 0x3F */ - 0x03, 0xF0, 0x06, 0x0E, 0x06, 0x01, 0x86, 0x00, 0x66, 0x1D, 0xBB, 0x31, 0xCF, 0x18, 0xC7, 0x98, 0x63, 0xCC, 0x31, 0xE6, 0x11, - 0xB3, 0x99, 0xCC, 0xF7, 0x86, 0x00, 0x01, 0x80, 0x00, 0x70, 0x40, 0x0F, 0xE0, /* '@' 0x40 */ - 0x06, 0x00, 0xF0, 0x0F, 0x00, 0x90, 0x19, 0x81, 0x98, 0x10, 0x83, 0x0C, 0x3F, 0xC2, 0x04, 0x60, 0x66, 0x06, 0xC0, - 0x30, /* 'A' 0x41 */ - 0xFF, 0x18, 0x33, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x3F, 0xC6, 0x06, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, /* 'B' 0x42 */ - 0x1F, 0x86, 0x19, 0x81, 0xA0, 0x3C, 0x01, 0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63, 0x0C, 0x61, 0x04, 0x60, 0xCC, 0x19, 0x01, 0x60, 0x3C, 0x07, 0x00, 0x60, /* 'V' 0x56 */ - 0xC1, 0x81, 0x61, 0xC3, 0x61, 0xC3, 0x61, 0x43, 0x62, 0x62, 0x22, 0x66, 0x32, 0x26, 0x36, 0x26, 0x14, 0x34, 0x14, 0x34, 0x1C, - 0x1C, 0x18, 0x1C, 0x08, 0x18, /* 'W' 0x57 */ - 0xC0, 0xD8, 0x66, 0x18, 0xCC, 0x1E, 0x07, 0x00, 0xC0, 0x78, 0x32, 0x0C, 0xC6, 0x1B, 0x07, 0xC0, 0xC0, /* 'X' 0x58 */ - 0xC0, 0x36, 0x06, 0x30, 0xC3, 0x0C, 0x19, 0x81, 0xD8, 0x0F, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, - 0x00, /* 'Y' 0x59 */ - 0xFF, 0xC0, 0x60, 0x30, 0x0C, 0x06, 0x03, 0x01, 0xC0, 0x60, 0x30, 0x18, 0x06, 0x03, 0x00, 0xFF, 0xC0, /* 'Z' 0x5A */ - 0xFB, 0x6D, 0xB6, 0xDB, 0x6D, 0xB6, 0xE0, /* '[' 0x5B */ - 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x80, /* '\' 0x5C */ - 0xED, 0xB6, 0xDB, 0x6D, 0xB6, 0xDB, 0xE0, /* ']' 0x5D */ - 0x30, 0x60, 0xA2, 0x44, 0xD8, 0xA1, 0x80, /* '^' 0x5E */ - 0xFF, 0xC0, /* '_' 0x5F */ - 0xC6, 0x30, /* '`' 0x60 */ - 0x7E, 0x71, 0xB0, 0xC0, 0x60, 0xF3, 0xDB, 0x0D, 0x86, 0xC7, 0x3D, 0xC0, /* 'a' 0x61 */ - 0xC0, 0x60, 0x30, 0x1B, 0xCE, 0x36, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x6D, 0xE0, /* 'b' 0x62 */ - 0x3C, 0x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00, /* 'p' 0x70 */ - 0x3B, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0x03, /* 'q' 0x71 */ - 0xDF, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0x00, /* 'r' 0x72 */ - 0x3E, 0xE3, 0xC0, 0xC0, 0xE0, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, /* 's' 0x73 */ - 0x66, 0xF6, 0x66, 0x66, 0x66, 0x67, /* 't' 0x74 */ - 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 'u' 0x75 */ - 0xC1, 0xA0, 0x98, 0xCC, 0x42, 0x21, 0xB0, 0xD0, 0x28, 0x1C, 0x0C, 0x00, /* 'v' 0x76 */ - 0xC6, 0x1E, 0x38, 0x91, 0xC4, 0xCA, 0x66, 0xD3, 0x16, 0xD0, 0xA6, 0x87, 0x1C, 0x38, 0xC0, 0xC6, 0x00, /* 'w' 0x77 */ - 0x87, 0x89, 0xB1, 0xC3, 0x07, 0x1E, 0x26, 0xC5, 0x0C, /* 'x' 0x78 */ - 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, /* 'y' 0x79 */ - 0xFE, 0x0C, 0x30, 0xC1, 0x86, 0x18, 0x20, 0xC1, 0xFC, /* 'z' 0x7A */ - 0x36, 0x66, 0x66, 0x6E, 0xCE, 0x66, 0x66, 0x66, 0x30, /* '{' 0x7B */ - 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, /* '|' 0x7C */ - 0xC6, 0x66, 0x66, 0x67, 0x37, 0x66, 0x66, 0x66, 0xC0, /* '}' 0x7D */ - 0x61, 0x24, 0x38, /* '~' 0x7E */ - 0xFF, 0xFC, 0x00, 0x63, 0xE3, 0x31, 0x99, 0x04, 0xC8, 0x66, 0x06, 0x30, 0x61, 0x83, 0x0C, 0x18, 0x60, 0x03, 0x06, 0x18, 0x00, - 0xFF, 0xFC, /* 0x7F */ - 0xFF, 0x01, 0x80, 0x18, 0x01, 0x80, 0x18, 0x01, 0xFE, 0x18, 0x31, 0x83, 0x18, 0x31, 0x83, 0x18, 0x31, 0x83, 0x18, 0x30, 0x03, - 0x00, 0x30, 0x0E, /* 0x80 */ - 0x0C, 0x18, 0x00, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, /* 0x81 */ - 0xDC, /* 0x82 */ - 0x18, 0x89, 0xFC, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x00, /* 0x83 */ - 0xDA, 0x76, /* 0x84 */ - 0xCC, 0xC0, /* 0x85 */ - 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 0x86 */ - 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, /* 0x87 */ - 0x07, 0xC6, 0x13, 0x00, 0xC0, 0x60, 0x3F, 0xE6, 0x03, 0xFC, 0x60, 0x0C, 0x03, 0x00, 0x61, 0x07, 0xC0, /* 0x88 */ - 0x70, 0x80, 0x22, 0x20, 0x08, 0x90, 0x02, 0x24, 0x00, 0x72, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x10, 0x00, 0x09, 0xC7, 0x84, - 0x8B, 0x31, 0x22, 0x84, 0x88, 0xB3, 0x21, 0xC7, 0x80, /* 0x89 */ - 0x3F, 0x80, 0x18, 0xC0, 0x0C, 0x60, 0x06, 0x30, 0x03, 0x18, 0x01, 0x8C, 0x00, 0xC7, 0xF8, 0x63, 0x06, 0x31, 0x81, 0x90, 0xC0, - 0xD8, 0x60, 0x6C, 0x30, 0x6C, 0x1F, 0xE0, /* 0x8A */ - 0x69, /* 0x8B */ - 0xC0, 0xC0, 0x60, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0C, 0x0C, 0x06, 0x06, 0x03, 0xFF, 0xF9, 0x81, 0x86, 0xC0, 0xC1, 0xE0, 0x60, - 0xF0, 0x30, 0x78, 0x18, 0x6C, 0x0F, 0xE0, /* 0x8C */ - 0x0C, 0x06, 0x0C, 0x1B, 0x0C, 0xC6, 0x33, 0x0D, 0x83, 0xC0, 0xF0, 0x3E, 0x0D, 0xC3, 0x38, 0xC7, 0x30, 0xEC, 0x1C, /* 0x8D */ - 0xFF, 0x01, 0x80, 0x18, 0x01, 0x80, 0x18, 0x01, 0xFE, 0x18, 0x31, 0x83, 0x18, 0x31, 0x83, 0x18, 0x31, 0x83, 0x18, - 0x30, /* 0x8E */ - 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3F, 0xFE, 0x0C, 0x01, - 0x80, /* 0x8F */ - 0x60, 0x7C, 0x18, 0x0D, 0xE7, 0x1B, 0x0D, 0x86, 0xC3, 0x61, 0xB0, 0xD8, 0x6C, 0x36, 0x18, 0x18, 0x08, 0x08, /* 0x90 */ - 0x6B, /* 0x91 */ - 0xD6, /* 0x92 */ - 0x4C, 0xA5, 0xB0, /* 0x93 */ - 0xDA, 0x53, 0x20, /* 0x94 */ - 0x6F, 0xFF, 0x60, /* 0x95 */ - 0xFE, /* 0x96 */ - 0xFF, 0xFF, /* 0x97 */ - /* 0x98 */ - 0xFC, 0xE1, 0xCC, 0x38, 0x73, 0x0E, 0x1C, 0xC3, 0x8F, 0x30, 0xD2, 0xCC, 0x34, 0xB3, 0x0D, 0x6C, 0xC3, 0x53, 0x30, 0xCC, 0xCC, - 0x33, 0x30, /* 0x99 */ - 0x7E, 0x03, 0x30, 0x19, 0x80, 0xCC, 0x06, 0x60, 0x33, 0xF9, 0x98, 0x6C, 0xC3, 0x46, 0x1E, 0x3F, 0x80, /* 0x9A */ - 0x96, /* 0x9B */ - 0xC3, 0x03, 0x0C, 0x0C, 0x30, 0x30, 0xC0, 0xC3, 0x03, 0xFF, 0xEC, 0x30, 0xF0, 0xC3, 0xC3, 0x0F, 0x0F, 0xE0, /* 0x9C */ - 0x0C, 0x30, 0x46, 0x3C, 0xDB, 0x34, 0x70, 0xF1, 0xB3, 0x36, 0x3C, 0x20, /* 0x9D */ - 0x60, 0x7C, 0x18, 0x0D, 0xE7, 0x3B, 0x0D, 0x86, 0xC3, 0x61, 0xB0, 0xD8, 0x6C, 0x36, 0x18, /* 0x9E */ - 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xFF, 0x18, 0x18, /* 0x9F */ - /* 0xA0 */ - 0x21, 0x07, 0x8C, 0x0F, 0x06, 0x61, 0x98, 0xC3, 0x30, 0xD8, 0x1E, 0x07, 0x00, 0xC0, 0x60, 0x18, 0x0C, 0x03, 0x00, /* 0xA1 */ - 0x66, 0x18, 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, /* 0xA2 */ - 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x07, 0x8F, 0x1E, 0x27, 0x80, /* 0xA3 */ - 0xFF, 0xDF, 0x1E, 0x3E, 0xFF, 0xC0, /* 0xA4 */ - 0x00, 0xC0, 0x3F, 0xFF, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x00, /* 0xA5 */ - 0xFF, 0xFC, 0x0F, 0xFF, 0xC0, /* 0xA6 */ - 0x0C, 0x09, 0x0C, 0xC6, 0x63, 0x81, 0xE3, 0x19, 0x87, 0xE1, 0xB8, 0xC6, 0x41, 0xC0, 0x73, 0x19, 0x8C, 0x66, 0x1E, - 0x00, /* 0xA7 */ - 0x33, 0x00, 0x3F, 0xF8, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0xFE, /* 0xA8 */ - 0x0F, 0xC0, 0x61, 0x87, 0x03, 0x9B, 0xC6, 0xD9, 0x8F, 0x60, 0x3D, 0x00, 0xF4, 0x03, 0xD8, 0x0D, 0xE6, 0x67, 0xF3, 0x86, 0x18, - 0x0F, 0xC0, /* 0xA9 */ - 0x1F, 0x86, 0x19, 0x81, 0xB0, 0x3C, 0x01, 0x80, 0x3F, 0xC6, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0x61, 0xF0, /* 0xAA */ - 0x22, 0xCF, 0x26, 0x46, 0x64, 0x40, /* 0xAB */ - 0xFF, 0x80, 0xC0, 0x60, 0x30, 0x18, /* 0xAC */ - /* 0xAD */ - 0x0F, 0xC0, 0x61, 0x87, 0x03, 0x9F, 0xE6, 0xD0, 0x8F, 0x42, 0x3D, 0xF0, 0xF4, 0x23, 0xD0, 0x8D, 0xC2, 0x67, 0x0B, 0x86, 0x18, - 0x0F, 0xC0, /* 0xAE */ - 0xCC, 0x03, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x00, /* 0xAF */ - 0x74, 0x63, 0x17, 0x00, /* 0xB0 */ - 0x0C, 0x06, 0x03, 0x07, 0xE0, 0xC0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x3F, 0xE0, /* 0xB1 */ - 0xFF, 0xFF, 0xFF, 0xC0, /* 0xB2 */ - 0xC3, 0xFF, 0xFF, 0xC0, /* 0xB3 */ - 0x0C, 0x3F, 0xF0, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, /* 0xB4 */ - 0xC3, 0x61, 0xB0, 0xD8, 0x6C, 0x36, 0x1B, 0x0D, 0x86, 0xE7, 0x7D, 0xF0, 0x18, 0x0C, 0x00, /* 0xB5 */ - 0x3F, 0x7E, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0x72, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, /* 0xB6 */ - 0xE0, /* 0xB7 */ - 0x66, 0x00, 0x3C, 0x66, 0xC3, 0xC3, 0xFF, 0xC0, 0xC0, 0xC3, 0x66, 0x3C, /* 0xB8 */ - 0xC1, 0x81, 0x83, 0x03, 0x86, 0x05, 0x0C, 0xEB, 0x1A, 0x32, 0x34, 0x66, 0x68, 0xC4, 0xD1, 0x8D, 0xB3, 0x0B, 0x3A, 0x1E, 0x04, - 0x1C, 0x08, 0x1B, 0xC0, /* 0xB9 */ - 0x3C, 0x46, 0xC3, 0x80, 0xF8, 0x80, 0x80, 0xC3, 0x46, 0x3C, /* 0xBA */ - 0x89, 0x98, 0x99, 0x3C, 0xD1, 0x00, /* 0xBB */ - 0x30, 0x03, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0xE0, /* 0xBC */ - 0x3F, 0x18, 0x6C, 0x0F, 0x03, 0xC0, 0x1E, 0x01, 0xF0, 0x0E, 0x00, 0xF0, 0x3C, 0x0D, 0x86, 0x3F, 0x00, /* 0xBD */ - 0x3E, 0xE3, 0xC0, 0xC0, 0x60, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, /* 0xBE */ - 0xCC, 0x03, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, /* 0xBF */ - 0x06, 0x00, 0xF0, 0x0F, 0x00, 0x90, 0x19, 0x81, 0x98, 0x10, 0x83, 0x0C, 0x3F, 0xC2, 0x04, 0x60, 0x66, 0x06, 0xC0, - 0x30, /* 0xC0 */ - 0xFF, 0x18, 0x03, 0x00, 0x60, 0x0C, 0x01, 0x80, 0x3F, 0xE6, 0x06, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, /* 0xC1 */ - 0xFF, 0x18, 0x33, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x3F, 0xC6, 0x06, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x6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, 0x0C, 0xC3, 0x30, 0xC8, 0x36, 0x0D, 0x83, 0xC0, 0xC0, /* 0xCB */ - 0xE0, 0x3F, 0x01, 0xFC, 0x1F, 0xE0, 0xFD, 0x05, 0xEC, 0x6F, 0x63, 0x79, 0x13, 0xCD, 0x9E, 0x6C, 0xF1, 0x47, 0x8E, 0x3C, 0x71, - 0x80, /* 0xCC */ - 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xFF, 0xFE, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x06, /* 0xCD */ - 0x0F, 0x81, 0x83, 0x18, 0x0C, 0xC0, 0x6C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1B, 0x01, 0x98, 0x0C, 0x60, 0xC0, 0xF8, - 0x00, /* 0xCE */ - 0xFF, 0xF8, 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x06, /* 0xCF */ - 0xFF, 0x30, 0x6C, 0x0F, 0x03, 0xC0, 0xF0, 0x6F, 0xF3, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x00, /* 0xD0 */ - 0x1F, 0x86, 0x19, 0x81, 0xA0, 0x3C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0x61, 0xF0, /* 0xD1 */ - 0xFF, 0x86, 0x03, 0x01, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, /* 0xD2 */ - 0xC0, 0xF0, 0x66, 0x19, 0x8C, 0x33, 0x0D, 0x81, 0xE0, 0x70, 0x0C, 0x06, 0x01, 0x80, 0xC0, 0x30, 0x00, /* 0xD3 */ - 0x03, 0x00, 0x0C, 0x01, 0xFE, 0x1C, 0xCE, 0xE3, 0x1F, 0x0C, 0x3C, 0x30, 0xF0, 0xC3, 0xE3, 0x1D, 0xCC, 0xE3, 0xFF, 0x00, 0xC0, - 0x03, 0x00, /* 0xD4 */ - 0xC0, 0xD8, 0x66, 0x18, 0xCC, 0x1E, 0x07, 0x00, 0xC0, 0x78, 0x32, 0x0C, 0xC6, 0x1B, 0x07, 0xC0, 0xC0, /* 0xD5 */ - 0xC0, 0x66, 0x03, 0x30, 0x19, 0x80, 0xCC, 0x06, 0x60, 0x33, 0x01, 0x98, 0x0C, 0xC0, 0x66, 0x03, 0x30, 0x19, 0x80, 0xCF, 0xFF, - 0x80, 0x0C, 0x00, 0x60, /* 0xD6 */ - 0xC1, 0xE0, 0xF0, 0x78, 0x3C, 0x1E, 0x0F, 0x06, 0xFF, 0x01, 0x80, 0xC0, 0x60, 0x30, 0x18, /* 0xD7 */ - 0xC3, 0x1E, 0x18, 0xF0, 0xC7, 0x86, 0x3C, 0x31, 0xE1, 0x8F, 0x0C, 0x78, 0x63, 0xC3, 0x1E, 0x18, 0xF0, 0xC7, 0x86, 0x3F, 0xFF, - 0x80, /* 0xD8 */ - 0xC3, 0x19, 0x86, 0x33, 0x0C, 0x66, 0x18, 0xCC, 0x31, 0x98, 0x63, 0x30, 0xC6, 0x61, 0x8C, 0xC3, 0x19, 0x86, 0x33, 0x0C, 0x66, - 0x18, 0xCF, 0xFF, 0xE0, 0x00, 0xC0, 0x01, 0x80, /* 0xD9 */ - 0xF8, 0x00, 0xC0, 0x06, 0x00, 0x30, 0x01, 0x80, 0x0F, 0xF0, 0x60, 0xC3, 0x03, 0x18, 0x18, 0xC0, 0xC6, 0x06, 0x30, 0x61, 0xFE, - 0x00, /* 0xDA */ - 0xC0, 0x0F, 0x00, 0x3C, 0x00, 0xF0, 0x03, 0xC0, 0x0F, 0xFE, 0x3C, 0x0C, 0xF0, 0x1B, 0xC0, 0x6F, 0x01, 0xBC, 0x06, 0xF0, 0x33, - 0xFF, 0x8C, /* 0xDB */ - 0xC0, 0x18, 0x03, 0x00, 0x60, 0x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 0xFD, 0x00, 0x06, 0x07, 0xF4, 0x08, 0x24, 0x0F, 0x88, 0x11, 0x0F, 0xDC, 0x00, +/* 0x02 */ 0x3F, 0x70, 0x81, 0x11, 0x03, 0xE4, 0x08, 0x28, 0x1F, 0xD0, 0x00, 0x60, 0x7F, 0x20, 0x02, 0x43, 0xFC, 0x44, 0x00, 0x44, 0x00, 0x48, 0x00, 0x90, 0x00, 0xA0, 0x01, 0xC0, 0x00, +/* 0x03 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x00, 0x31, 0x8C, 0x63, 0x18, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x06, 0x20, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x04 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x82, 0x30, 0x88, 0x62, 0x08, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x06, 0x3F, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x05 */ 0x0B, 0x10, 0x14, 0xA8, 0x12, 0x50, 0x29, 0x42, 0x24, 0xA5, 0x32, 0x95, 0x5A, 0x09, 0x48, 0x09, 0x24, 0x01, 0x10, 0x01, 0x48, 0x02, 0xA4, 0x02, 0x42, 0x04, 0x01, 0x98, 0x00, 0x60, +/* 0x06 */ 0x00, 0x80, 0x22, 0x80, 0x65, 0x00, 0xBE, 0xE1, 0x82, 0x4E, 0x03, 0x24, 0x04, 0x28, 0x06, 0x30, 0x12, 0x20, 0x3C, 0xA0, 0xC3, 0xFE, 0x80, 0x4D, 0x00, 0xA6, 0x01, 0x80, 0x00, +/* 0x07 */ +/* 0x08 */ 0x00, 0xF8, 0x00, 0x82, 0x00, 0x80, 0x83, 0xE0, 0x41, 0x10, 0x21, 0x04, 0x1B, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xE0, 0x00, 0x4F, 0xE1, 0xC0, 0x0F, 0x02, 0x00, 0x03, 0x01, 0x00, 0x09, 0x88, 0x0C, 0x0C, +/* 0x09 */ 0x00, 0xF8, 0x00, 0x82, 0x00, 0x80, 0x83, 0xE0, 0x41, 0x10, 0x21, 0x04, 0x1B, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xE0, 0x00, 0x4F, 0xE1, 0xC0, 0x0F, 0x00, +/* 0x0A */ +/* 0x0B */ 0x1C, 0x1C, 0x31, 0xB1, 0x90, 0x50, 0x50, 0x10, 0x18, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x02, 0x80, 0x02, 0x40, 0x01, 0x10, 0x01, 0x04, 0x01, 0x01, 0x01, 0x00, 0x41, 0x00, 0x11, 0x00, 0x07, 0x00, 0x01, 0x00, +/* 0x0C */ 0x06, 0x00, 0x0A, 0x00, 0x12, 0x00, 0x32, 0x01, 0x84, 0x04, 0x10, 0x08, 0x98, 0x1C, 0x18, 0x40, 0x48, 0x82, 0x11, 0xF0, 0x74, 0x02, 0x18, 0x70, 0x2F, 0x9F, 0x80, +/* 0x0D */ +/* 0x0E */ 0x01, 0x00, 0x05, 0x00, 0x0A, 0x00, 0x3E, 0x00, 0x82, 0x02, 0x82, 0x06, 0x04, 0x10, 0x04, 0x20, 0x08, 0x40, 0x10, 0xFF, 0x22, 0x00, 0x29, 0xFF, 0x3F, 0x8F, 0xDF, 0x9F, 0x01, 0xC0, +/* 0x0F */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x82, 0x36, 0x03, 0x60, 0x00, 0xCC, 0x19, 0xA4, 0x4B, 0x00, 0x06, 0x8E, 0x2B, 0x22, 0x66, 0x7C, 0xCC, 0x71, 0x98, 0x03, 0x00, +/* 0x10 */ 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, 0x1E, 0x00, 0x54, 0x00, 0xA8, 0x01, 0x50, 0x02, 0xA0, 0x05, 0x20, 0x32, 0x61, 0xC4, 0x74, 0x49, 0x10, 0x6C, 0x00, 0xD8, 0x01, 0x10, 0x00, +/* 0x11 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x40, 0x29, 0x00, 0x31, 0x84, 0x63, 0x18, 0xC0, 0x00, 0x80, 0x15, 0x03, 0x7E, 0x02, 0xFA, 0x04, 0xE4, 0x18, 0x84, 0x00, 0x06, 0x0C, 0x03, 0xE0, +/* 0x12 */ 0x02, 0x08, 0x01, 0x08, 0x40, 0x10, 0xC0, 0x08, 0xC0, 0x60, 0x80, 0x28, 0x04, 0x12, 0x4C, 0x10, 0x80, 0x08, 0x23, 0x0E, 0x08, 0xC4, 0x82, 0x04, 0x20, 0x83, 0x09, 0x82, 0x47, 0x01, 0x1C, 0x01, 0x30, 0x00, 0xE0, 0x00, 0x00, +/* 0x13 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x00, 0x31, 0x08, 0x65, 0x28, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x06, 0x3F, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x14 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x22, 0x29, 0x83, 0x30, 0x00, 0x65, 0x14, 0xD3, 0x4D, 0xBA, 0xEB, 0x38, 0xE6, 0x00, 0x0A, 0x00, 0x24, 0x38, 0x44, 0x01, 0x07, 0x1C, 0x01, 0xC0, +/* 0x15 */ 0x07, 0xC0, 0x30, 0x18, 0x80, 0x32, 0x00, 0xF8, 0x01, 0xF1, 0x09, 0xA5, 0x28, 0x40, 0x01, 0x80, 0x03, 0x00, 0x06, 0x3F, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x16 */ 0x0C, 0x00, 0xC0, 0x1C, 0x03, 0x80, 0xF8, 0xBB, 0x36, 0xC7, 0x99, 0xF3, 0xFE, 0x3F, 0xC3, 0xF0, 0x7E, 0x0E, 0xC1, 0x8E, 0xE0, 0x20, +/* 0x17 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x00, 0x10, 0x01, 0x20, 0x1D, 0x44, 0x42, 0x84, 0x85, 0x00, 0x86, 0x00, 0xC4, 0x00, 0x44, 0x7C, 0x44, 0x00, 0x06, 0x0C, 0x03, 0xE0, +/* 0x18 */ 0x01, 0xE0, 0x00, 0x84, 0x00, 0x40, 0x80, 0x20, 0x10, 0x08, 0x24, 0x02, 0x41, 0x00, 0x86, 0x03, 0x12, 0x03, 0xB4, 0x03, 0x52, 0x81, 0x23, 0x80, 0x70, 0xA0, 0x14, 0x28, 0x05, 0x0A, 0x01, 0x42, 0x80, 0x50, +/* 0x19 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x00, 0x33, 0x18, 0x60, 0x00, 0xDC, 0xE1, 0xB9, 0xC3, 0x7B, 0xC6, 0x63, 0x0A, 0x00, 0x24, 0xF0, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x1A */ 0xFF, 0xFC, 0x00, 0x63, 0xE3, 0x31, 0x99, 0x04, 0xC8, 0x66, 0x06, 0x30, 0x61, 0x82, 0x0C, 0x10, 0x60, 0x03, 0x04, 0x18, 0x00, 0xFF, 0xFC, +/* 0x1B */ 0x07, 0xF0, 0x06, 0x0C, 0x04, 0x01, 0x04, 0x00, 0x44, 0x22, 0x12, 0x2A, 0x89, 0x00, 0x04, 0x80, 0x02, 0x44, 0x11, 0x01, 0xF0, 0x04, 0x01, 0x0D, 0x01, 0x6A, 0x41, 0x2C, 0x00, 0x05, 0xC0, 0x0E, 0x18, 0x18, +/* 0x1C */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0xC0, 0x2A, 0x00, 0x33, 0x00, 0x66, 0x00, 0xCC, 0x39, 0x80, 0x83, 0x00, 0x06, 0x00, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x1D */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x70, 0x28, 0x00, 0x31, 0x80, 0x63, 0x18, 0xC0, 0x31, 0x80, 0x03, 0x00, 0x06, 0x60, 0x0D, 0x33, 0x12, 0x10, 0x48, 0x21, 0x23, 0x8C, 0x00, +/* 0x1E */ 0x03, 0x00, 0x07, 0x9E, 0x07, 0x00, 0x86, 0x00, 0x27, 0xC0, 0x0F, 0xC0, 0x07, 0x8C, 0x62, 0x06, 0x31, 0x20, 0x00, 0x90, 0x00, 0x48, 0x00, 0x24, 0x3E, 0x11, 0x00, 0x10, 0x40, 0x10, 0x18, 0x30, 0x03, 0xE0, +/* 0x1F */ 0x18, 0x02, 0x80, 0x4C, 0x16, 0x41, 0x24, 0x3C, 0x88, 0x6E, 0x65, 0xF2, 0x78, 0x46, 0x88, 0xCF, 0x18, 0x02, 0x80, 0x8C, 0x60, 0x70, +/* ' ' 0x20 */ +/* '!' 0x21 */ 0xFF, 0xFF, 0xF0, 0xC0, +/* '"' 0x22 */ 0xDE, 0xF7, 0x20, +/* '#' 0x23 */ 0x09, 0x86, 0x41, 0x91, 0xFF, 0x13, 0x04, 0xC3, 0x20, 0xC8, 0xFF, 0x89, 0x82, 0x61, 0x90, +/* '$' 0x24 */ 0x10, 0x1F, 0x14, 0xDA, 0x3D, 0x1E, 0x83, 0x40, 0x78, 0x17, 0x08, 0xF4, 0x7A, 0x35, 0x33, 0xF0, 0x40, 0x20, +/* '%' 0x25 */ 0x38, 0x10, 0xEC, 0x20, 0xC6, 0x20, 0xC6, 0x40, 0xC6, 0x40, 0x6C, 0x80, 0x39, 0x00, 0x01, 0x3C, 0x02, 0x77, 0x02, 0x63, 0x04, 0x63, 0x04, 0x77, 0x08, 0x3C, +/* '&' 0x26 */ 0x0E, 0x0C, 0xC3, 0x30, 0xCC, 0x1E, 0x03, 0x03, 0xC1, 0x9B, 0xC2, 0xF0, 0xEC, 0x19, 0x8F, 0x3C, 0x40, +/* ''' 0x27 */ 0xFE, +/* '(' 0x28 */ 0x13, 0x26, 0x6C, 0xCC, 0xCC, 0xC4, 0x66, 0x23, 0x10, +/* ')' 0x29 */ 0x8C, 0x46, 0x63, 0x33, 0x33, 0x32, 0x66, 0x4C, 0x80, +/* '*' 0x2A */ 0x25, 0x7E, 0xA5, 0x00, +/* '+' 0x2B */ 0x30, 0xC3, 0x3F, 0x30, 0xC3, 0x0C, +/* ',' 0x2C */ 0xD6, +/* '-' 0x2D */ 0xF0, +/* '.' 0x2E */ 0xC0, +/* '/' 0x2F */ 0x08, 0x44, 0x21, 0x10, 0x84, 0x42, 0x11, 0x08, 0x00, +/* '0' 0x30 */ 0x3C, 0x66, 0x42, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x42, 0x66, 0x3C, +/* '1' 0x31 */ 0x11, 0x3F, 0x33, 0x33, 0x33, 0x33, 0x30, +/* '2' 0x32 */ 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x1C, 0x1C, 0x1C, 0x18, 0x18, 0x10, 0x08, 0x07, 0xF8, +/* '3' 0x33 */ 0x3C, 0x66, 0xC3, 0xC3, 0x03, 0x06, 0x1C, 0x07, 0x03, 0xC3, 0xC3, 0x66, 0x3C, +/* '4' 0x34 */ 0x0C, 0x18, 0x71, 0x62, 0xC9, 0xA3, 0x46, 0xFE, 0x18, 0x30, 0x60, 0xC0, +/* '5' 0x35 */ 0x7F, 0x20, 0x10, 0x08, 0x08, 0x07, 0xF3, 0x8C, 0x03, 0x01, 0x80, 0xF0, 0x6C, 0x63, 0xE0, +/* '6' 0x36 */ 0x1E, 0x31, 0x98, 0x78, 0x0C, 0x06, 0xF3, 0x8D, 0x83, 0xC1, 0xE0, 0xD0, 0x6C, 0x63, 0xE0, +/* '7' 0x37 */ 0xFF, 0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x18, 0x18, 0x18, 0x10, 0x30, 0x30, +/* '8' 0x38 */ 0x3E, 0x31, 0xB0, 0x78, 0x3C, 0x1B, 0x18, 0xF8, 0xC6, 0xC1, 0xE0, 0xF0, 0x6C, 0x63, 0xE0, +/* '9' 0x39 */ 0x3C, 0x66, 0xC2, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0xC2, 0x66, 0x3C, +/* ':' 0x3A */ 0xC0, 0x00, 0x30, +/* ';' 0x3B */ 0xC0, 0x00, 0x00, 0x64, 0xA0, +/* '<' 0x3C */ 0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x07, 0x80, 0x70, 0x0E, 0x01, 0x80, +/* '=' 0x3D */ 0xFF, 0x80, 0x00, 0x1F, 0xF0, +/* '>' 0x3E */ 0xE0, 0x1C, 0x03, 0x80, 0x30, 0x70, 0xE3, 0x81, 0x00, +/* '?' 0x3F */ 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x18, 0x38, 0x18, 0x18, 0x0C, 0x00, 0x00, 0x01, 0x80, +/* '@' 0x40 */ 0x03, 0xF0, 0x06, 0x0E, 0x06, 0x01, 0x86, 0x00, 0x66, 0x1D, 0xBB, 0x31, 0xCF, 0x18, 0xC7, 0x98, 0x63, 0xCC, 0x31, 0xE6, 0x11, 0xB3, 0x99, 0xCC, 0xF7, 0x86, 0x00, 0x01, 0x80, 0x00, 0x70, 0x40, 0x0F, 0xE0, +/* 'A' 0x41 */ 0x06, 0x00, 0xF0, 0x0F, 0x00, 0x90, 0x19, 0x81, 0x98, 0x10, 0x83, 0x0C, 0x3F, 0xC2, 0x04, 0x60, 0x66, 0x06, 0xC0, 0x30, +/* 'B' 0x42 */ 0xFF, 0x18, 0x33, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x3F, 0xC6, 0x06, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, +/* 'C' 0x43 */ 0x1F, 0x86, 0x19, 0x81, 0xA0, 0x3C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 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x60, 0x3C, 0x07, 0x00, 0x60, +/* 'W' 0x57 */ 0xC1, 0x81, 0x61, 0xC3, 0x61, 0xC3, 0x61, 0x43, 0x62, 0x62, 0x22, 0x66, 0x32, 0x26, 0x36, 0x26, 0x14, 0x34, 0x14, 0x34, 0x1C, 0x1C, 0x18, 0x1C, 0x08, 0x18, +/* 'X' 0x58 */ 0xC0, 0xD8, 0x66, 0x18, 0xCC, 0x1E, 0x07, 0x00, 0xC0, 0x78, 0x32, 0x0C, 0xC6, 0x1B, 0x07, 0xC0, 0xC0, +/* 'Y' 0x59 */ 0xC0, 0x36, 0x06, 0x30, 0xC3, 0x0C, 0x19, 0x81, 0xD8, 0x0F, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, +/* 'Z' 0x5A */ 0xFF, 0xC0, 0x60, 0x30, 0x0C, 0x06, 0x03, 0x01, 0xC0, 0x60, 0x30, 0x18, 0x06, 0x03, 0x00, 0xFF, 0xC0, +/* '[' 0x5B */ 0xFB, 0x6D, 0xB6, 0xDB, 0x6D, 0xB6, 0xE0, +/* '\' 0x5C */ 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x80, +/* ']' 0x5D */ 0xED, 0xB6, 0xDB, 0x6D, 0xB6, 0xDB, 0xE0, +/* '^' 0x5E */ 0x30, 0x60, 0xA2, 0x44, 0xD8, 0xA1, 0x80, +/* '_' 0x5F */ 0xFF, 0xC0, +/* '`' 0x60 */ 0xC6, 0x30, +/* 'a' 0x61 */ 0x7E, 0x71, 0xB0, 0xC0, 0x60, 0xF3, 0xDB, 0x0D, 0x86, 0xC7, 0x3D, 0xC0, +/* 'b' 0x62 */ 0xC0, 0x60, 0x30, 0x1B, 0xCE, 0x36, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x6D, 0xE0, +/* 'c' 0x63 */ 0x3C, 0x66, 0xC3, 0xC0, 0xC0, 0xC0, 0xC0, 0xC3, 0x66,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3, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0x03, +/* 'r' 0x72 */ 0xDF, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0x00, +/* 's' 0x73 */ 0x3E, 0xE3, 0xC0, 0xC0, 0xE0, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, +/* 't' 0x74 */ 0x66, 0xF6, 0x66, 0x66, 0x66, 0x67, +/* 'u' 0x75 */ 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, +/* 'v' 0x76 */ 0xC1, 0xA0, 0x98, 0xCC, 0x42, 0x21, 0xB0, 0xD0, 0x28, 0x1C, 0x0C, 0x00, +/* 'w' 0x77 */ 0xC6, 0x1E, 0x38, 0x91, 0xC4, 0xCA, 0x66, 0xD3, 0x16, 0xD0, 0xA6, 0x87, 0x1C, 0x38, 0xC0, 0xC6, 0x00, +/* 'x' 0x78 */ 0x87, 0x89, 0xB1, 0xC3, 0x07, 0x1E, 0x26, 0xC5, 0x0C, +/* 'y' 0x79 */ 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, +/* 'z' 0x7A */ 0xFE, 0x0C, 0x30, 0xC1, 0x86, 0x18, 0x20, 0xC1, 0xFC, +/* '{' 0x7B */ 0x36, 0x66, 0x66, 0x6E, 0xCE, 0x66, 0x66, 0x66, 0x30, +/* '|' 0x7C */ 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, +/* '}' 0x7D */ 0xC6, 0x66, 0x66, 0x67, 0x37, 0x66, 0x66, 0x66, 0xC0, +/* '~' 0x7E */ 0x61, 0x24, 0x38, +/* 0x7F */ 0xFF, 0xFC, 0x00, 0x63, 0xE3, 0x31, 0x99, 0x04, 0xC8, 0x66, 0x06, 0x30, 0x61, 0x83, 0x0C, 0x18, 0x60, 0x03, 0x06, 0x18, 0x00, 0xFF, 0xFC, +/* 0x80 */ 0xFF, 0x01, 0x80, 0x18, 0x01, 0x80, 0x18, 0x01, 0xFE, 0x18, 0x31, 0x83, 0x18, 0x31, 0x83, 0x18, 0x31, 0x83, 0x18, 0x30, 0x03, 0x00, 0x30, 0x0E, +/* 0x81 */ 0x0C, 0x18, 0x00, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, +/* 0x82 */ 0xDC, +/* 0x83 */ 0x18, 0x89, 0xFC, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x00, +/* 0x84 */ 0xDA, 0x76, +/* 0x85 */ 0xCC, 0xC0, +/* 0x86 */ 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, +/* 0x87 */ 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, +/* 0x88 */ 0x07, 0xC6, 0x13, 0x00, 0xC0, 0x60, 0x3F, 0xE6, 0x03, 0xFC, 0x60, 0x0C, 0x03, 0x00, 0x61, 0x07, 0xC0, +/* 0x89 */ 0x70, 0x80, 0x22, 0x20, 0x08, 0x90, 0x02, 0x24, 0x00, 0x72, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x10, 0x00, 0x09, 0xC7, 0x84, 0x8B, 0x31, 0x22, 0x84, 0x88, 0xB3, 0x21, 0xC7, 0x80, +/* 0x8A */ 0x3F, 0x80, 0x18, 0xC0, 0x0C, 0x60, 0x06, 0x30, 0x03, 0x18, 0x01, 0x8C, 0x00, 0xC7, 0xF8, 0x63, 0x06, 0x31, 0x81, 0x90, 0xC0, 0xD8, 0x60, 0x6C, 0x30, 0x6C, 0x1F, 0xE0, +/* 0x8B */ 0x69, +/* 0x8C */ 0xC0, 0xC0, 0x60, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0C, 0x0C, 0x06, 0x06, 0x03, 0xFF, 0xF9, 0x81, 0x86, 0xC0, 0xC1, 0xE0, 0x60, 0xF0, 0x30, 0x78, 0x18, 0x6C, 0x0F, 0xE0, +/* 0x8D */ 0x0C, 0x06, 0x0C, 0x1B, 0x0C, 0xC6, 0x33, 0x0D, 0x83, 0xC0, 0xF0, 0x3E, 0x0D, 0xC3, 0x38, 0xC7, 0x30, 0xEC, 0x1C, +/* 0x8E */ 0xFF, 0x01, 0x80, 0x18, 0x01, 0x80, 0x18, 0x01, 0xFE, 0x18, 0x31, 0x83, 0x18, 0x31, 0x83, 0x18, 0x31, 0x83, 0x18, 0x30, +/* 0x8F */ 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3F, 0xFE, 0x0C, 0x01, 0x80, +/* 0x90 */ 0x60, 0x7C, 0x18, 0x0D, 0xE7, 0x1B, 0x0D, 0x86, 0xC3, 0x61, 0xB0, 0xD8, 0x6C, 0x36, 0x18, 0x18, 0x08, 0x08, +/* 0x91 */ 0x6B, +/* 0x92 */ 0xD6, +/* 0x93 */ 0x4C, 0xA5, 0xB0, +/* 0x94 */ 0xDA, 0x53, 0x20, +/* 0x95 */ 0x6F, 0xFF, 0x60, +/* 0x96 */ 0xFE, +/* 0x97 */ 0xFF, 0xFF, +/* 0x98 */ +/* 0x99 */ 0xFC, 0xE1, 0xCC, 0x38, 0x73, 0x0E, 0x1C, 0xC3, 0x8F, 0x30, 0xD2, 0xCC, 0x34, 0xB3, 0x0D, 0x6C, 0xC3, 0x53, 0x30, 0xCC, 0xCC, 0x33, 0x30, +/* 0x9A */ 0x7E, 0x03, 0x30, 0x19, 0x80, 0xCC, 0x06, 0x60, 0x33, 0xF9, 0x98, 0x6C, 0xC3, 0x46, 0x1E, 0x3F, 0x80, +/* 0x9B */ 0x96, +/* 0x9C */ 0xC3, 0x03, 0x0C, 0x0C, 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x24 */ {22, 9, 16, 10, 1, -13}, - /* '%' 0x25 */ {40, 16, 13, 16, 1, -12}, - /* '&' 0x26 */ {66, 10, 13, 12, 1, -12}, - /* ''' 0x27 */ {83, 2, 4, 4, 1, -12}, - /* '(' 0x28 */ {84, 4, 17, 6, 1, -12}, - /* ')' 0x29 */ {93, 4, 17, 6, 1, -12}, - /* '*' 0x2A */ {102, 5, 5, 7, 1, -12}, - /* '+' 0x2B */ {106, 6, 8, 11, 3, -7}, - /* ',' 0x2C */ {112, 2, 4, 5, 2, 0}, - /* '-' 0x2D */ {113, 4, 1, 6, 1, -4}, - /* '.' 0x2E */ {114, 2, 1, 5, 1, 0}, - /* '/' 0x2F */ {115, 5, 13, 5, 0, -12}, - /* '0' 0x30 */ {124, 8, 13, 10, 1, -12}, - /* '1' 0x31 */ {137, 4, 13, 10, 3, -12}, - /* '2' 0x32 */ {144, 9, 13, 10, 1, -12}, - /* '3' 0x33 */ {159, 8, 13, 10, 1, -12}, - /* '4' 0x34 */ {172, 7, 13, 10, 2, -12}, - /* '5' 0x35 */ {184, 9, 13, 10, 1, -12}, - /* '6' 0x36 */ {199, 9, 13, 10, 1, -12}, - /* '7' 0x37 */ {214, 8, 13, 10, 0, -12}, - /* '8' 0x38 */ {227, 9, 13, 10, 1, -12}, - /* '9' 0x39 */ {242, 8, 13, 10, 1, -12}, - /* ':' 0x3A */ {255, 2, 10, 5, 1, -9}, - /* ';' 0x3B */ {258, 3, 12, 5, 1, -8}, - /* '<' 0x3C */ {263, 9, 9, 11, 1, -8}, - /* '=' 0x3D */ {274, 9, 4, 11, 1, -5}, - /* '>' 0x3E */ {279, 9, 8, 11, 1, -7}, - /* '?' 0x3F */ {288, 9, 13, 10, 1, -12}, - /* '@' 0x40 */ {303, 17, 16, 18, 1, -12}, - /* 'A' 0x41 */ {337, 12, 13, 12, 0, -12}, - /* 'B' 0x42 */ {357, 11, 13, 12, 1, -12}, - /* 'C' 0x43 */ {375, 11, 13, 13, 1, -12}, - /* 'D' 0x44 */ {393, 11, 13, 13, 1, -12}, - /* 'E' 0x45 */ {411, 9, 13, 11, 1, -12}, - /* 'F' 0x46 */ {426, 8, 13, 11, 1, -12}, - /* 'G' 0x47 */ {439, 12, 13, 14, 1, -12}, - /* 'H' 0x48 */ {459, 11, 13, 13, 1, -12}, - /* 'I' 0x49 */ {477, 2, 13, 5, 2, -12}, - /* 'J' 0x4A */ {481, 7, 13, 10, 1, -12}, - /* 'K' 0x4B */ {493, 10, 13, 12, 1, -12}, - /* 'L' 0x4C */ {510, 8, 13, 10, 1, -12}, - /* 'M' 0x4D */ {523, 13, 13, 15, 1, -12}, - /* 'N' 0x4E */ {545, 11, 13, 13, 1, -12}, - /* 'O' 0x4F */ {563, 13, 13, 14, 1, -12}, - /* 'P' 0x50 */ {585, 10, 13, 12, 1, -12}, - /* 'Q' 0x51 */ {602, 13, 14, 14, 1, -12}, - /* 'R' 0x52 */ {625, 12, 13, 13, 1, -12}, - /* 'S' 0x53 */ {645, 10, 13, 12, 1, -12}, - /* 'T' 0x54 */ {662, 9, 13, 11, 1, -12}, - /* 'U' 0x55 */ {677, 11, 13, 13, 1, -12}, - /* 'V' 0x56 */ {695, 11, 13, 11, 0, -12}, - /* 'W' 0x57 */ {713, 16, 13, 17, 0, -12}, - /* 'X' 0x58 */ {739, 10, 13, 12, 1, -12}, - /* 'Y' 0x59 */ {756, 12, 13, 12, 0, -12}, - /* 'Z' 0x5A */ {776, 10, 13, 11, 1, -12}, - /* '[' 0x5B */ {793, 3, 17, 5, 1, -12}, - /* '\' 0x5C */ {800, 5, 13, 5, 0, -12}, - /* ']' 0x5D */ {809, 3, 17, 5, 0, -12}, - /* '^' 0x5E */ {816, 7, 7, 8, 1, -12}, - /* '_' 0x5F */ {823, 10, 1, 10, 0, 3}, - /* '`' 0x60 */ {825, 4, 3, 5, 0, -12}, - /* 'a' 0x61 */ {827, 9, 10, 10, 1, -9}, - /* 'b' 0x62 */ {839, 9, 13, 10, 1, -12}, - /* 'c' 0x63 */ {854, 8, 10, 9, 1, -9}, - /* 'd' 0x64 */ {864, 8, 13, 10, 1, -12}, - /* 'e' 0x65 */ {877, 8, 10, 10, 1, -9}, - /* 'f' 0x66 */ {887, 4, 13, 5, 1, -12}, - /* 'g' 0x67 */ {894, 8, 14, 10, 1, -9}, - /* 'h' 0x68 */ {908, 8, 13, 10, 1, -12}, - /* 'i' 0x69 */ {921, 2, 13, 4, 1, -12}, - /* 'j' 0x6A */ {925, 4, 17, 4, 0, -12}, - /* 'k' 0x6B */ {934, 8, 13, 9, 1, -12}, - /* 'l' 0x6C */ {947, 2, 13, 4, 1, -12}, - /* 'm' 0x6D */ {951, 13, 10, 15, 1, -9}, - /* 'n' 0x6E */ {968, 8, 10, 10, 1, -9}, - /* 'o' 0x6F */ {978, 8, 10, 10, 1, -9}, - /* 'p' 0x70 */ {988, 9, 13, 10, 1, -9}, - /* 'q' 0x71 */ {1003, 8, 13, 10, 1, -9}, - /* 'r' 0x72 */ {1016, 5, 10, 6, 1, -9}, - /* 's' 0x73 */ {1023, 8, 10, 9, 1, -9}, - /* 't' 0x74 */ {1033, 4, 12, 5, 1, -11}, - /* 'u' 0x75 */ {1039, 8, 10, 10, 1, -9}, - /* 'v' 0x76 */ {1049, 9, 10, 9, 0, -9}, - /* 'w' 0x77 */ {1061, 13, 10, 13, 0, -9}, - /* 'x' 0x78 */ {1078, 7, 10, 9, 1, -9}, - /* 'y' 0x79 */ {1087, 8, 14, 9, 0, -9}, - /* 'z' 0x7A */ {1101, 7, 10, 9, 1, -9}, - /* '{' 0x7B */ {1110, 4, 17, 6, 1, -12}, - /* '|' 0x7C */ {1119, 2, 17, 4, 2, -12}, - /* '}' 0x7D */ {1124, 4, 17, 6, 1, -12}, - /* '~' 0x7E */ {1133, 7, 3, 9, 1, -7}, - /* 0x7F */ {1136, 13, 14, 15, 1, -12}, - /* 0x80 */ {1159, 12, 16, 14, 1, -12}, - /* 0x81 */ {1183, 8, 15, 11, 1, -14}, - /* 0x82 */ {1198, 2, 3, 5, 1, 0}, - /* 0x83 */ {1199, 5, 13, 7, 1, -12}, - /* 0x84 */ {1208, 5, 3, 7, 1, 0}, - /* 0x85 */ {1210, 10, 1, 12, 1, 0}, - /* 0x86 */ {1212, 8, 16, 10, 1, -12}, - /* 0x87 */ {1228, 8, 16, 10, 1, -12}, - /* 0x88 */ {1244, 10, 13, 12, 1, -12}, - /* 0x89 */ {1261, 18, 13, 18, 0, -12}, - /* 0x8A */ {1291, 17, 13, 18, 1, -12}, - /* 0x8B */ {1319, 2, 4, 4, 1, -6}, - /* 0x8C */ {1320, 17, 13, 18, 1, -12}, - /* 0x8D */ {1348, 10, 15, 11, 1, -14}, - /* 0x8E */ {1367, 12, 13, 14, 1, -12}, - /* 0x8F */ {1387, 11, 15, 13, 1, -12}, - /* 0x90 */ {1408, 9, 16, 10, 1, -12}, - /* 0x91 */ {1426, 2, 4, 4, 2, -12}, - /* 0x92 */ {1427, 2, 4, 4, 1, -12}, - /* 0x93 */ {1428, 5, 4, 7, 2, -12}, - /* 0x94 */ {1431, 5, 4, 7, 1, -12}, - /* 0x95 */ {1434, 4, 5, 7, 1, -8}, - /* 0x96 */ {1437, 7, 1, 9, 1, -4}, - /* 0x97 */ {1438, 16, 1, 18, 1, -4}, - /* 0x98 */ {1440, 0, 0, 0, 0, 0}, - /* 0x99 */ {1440, 18, 10, 18, 1, -13}, - /* 0x9A */ {1463, 13, 10, 14, 1, -9}, - /* 0x9B */ {1480, 2, 4, 5, 2, -6}, - /* 0x9C */ {1481, 14, 10, 15, 1, -9}, - /* 0x9D */ {1499, 7, 13, 9, 1, -12}, - /* 0x9E */ {1511, 9, 13, 10, 1, -12}, - /* 0x9F */ {1526, 8, 12, 10, 1, -9}, - /* 0xA0 */ {1538, 0, 0, 5, 0, 0}, - /* 0xA1 */ {1538, 10, 15, 11, 1, -14}, - /* 0xA2 */ {1557, 8, 16, 9, 0, -11}, - /* 0xA3 */ {1573, 7, 13, 10, 1, -12}, - /* 0xA4 */ {1585, 7, 6, 10, 2, -8}, - /* 0xA5 */ {1591, 10, 14, 11, 1, -13}, - /* 0xA6 */ {1609, 2, 17, 5, 2, -12}, - /* 0xA7 */ {1614, 9, 17, 10, 1, -12}, - /* 0xA8 */ {1634, 9, 15, 12, 1, -14}, - /* 0xA9 */ {1651, 14, 13, 14, 1, -12}, - /* 0xAA */ {1674, 11, 13, 13, 1, -12}, - /* 0xAB */ {1692, 7, 6, 9, 1, -7}, - /* 0xAC */ {1698, 9, 5, 11, 2, -5}, - /* 0xAD */ {1704, 0, 0, 0, 0, 0}, - /* 0xAE */ {1704, 14, 13, 14, 1, -12}, - /* 0xAF */ {1727, 6, 15, 5, 0, -14}, - /* 0xB0 */ {1739, 5, 5, 11, 3, -11}, - /* 0xB1 */ {1743, 9, 11, 11, 1, -10}, - /* 0xB2 */ {1756, 2, 13, 4, 1, -12}, - /* 0xB3 */ {1760, 2, 13, 4, 1, -12}, - /* 0xB4 */ {1764, 6, 12, 7, 1, -11}, - /* 0xB5 */ {1773, 9, 13, 10, 1, -9}, - /* 0xB6 */ {1788, 8, 16, 10, 2, -12}, - /* 0xB7 */ {1804, 3, 1, 5, 1, -4}, - /* 0xB8 */ {1805, 8, 12, 10, 1, -11}, - /* 0xB9 */ {1817, 15, 13, 17, 1, -12}, - /* 0xBA */ {1842, 8, 10, 9, 1, -9}, - /* 0xBB */ {1852, 7, 6, 9, 1, -7}, - /* 0xBC */ {1858, 4, 17, 4, 0, -12}, - /* 0xBD */ {1867, 10, 13, 12, 1, -12}, - /* 0xBE */ {1884, 8, 10, 9, 1, -9}, - /* 0xBF */ {1894, 6, 12, 5, -1, -11}, - /* 0xC0 */ {1903, 12, 13, 12, 0, -12}, - /* 0xC1 */ {1923, 11, 13, 12, 1, -12}, - /* 0xC2 */ {1941, 11, 13, 12, 1, -12}, - /* 0xC3 */ {1959, 8, 13, 8, 1, -12}, - /* 0xC4 */ {1972, 14, 16, 15, 1, -12}, - /* 0xC5 */ {2000, 9, 13, 12, 1, -12}, - /* 0xC6 */ {2015, 16, 13, 16, 0, -12}, - /* 0xC7 */ {2041, 10, 13, 12, 1, -12}, - /* 0xC8 */ {2058, 11, 13, 13, 1, -12}, - /* 0xC9 */ {2076, 11, 16, 13, 1, -15}, - /* 0xCA */ {2098, 10, 13, 11, 1, -12}, - /* 0xCB */ {2115, 10, 13, 12, 1, -12}, - /* 0xCC */ {2132, 13, 13, 15, 1, -12}, - /* 0xCD */ {2154, 11, 13, 13, 1, -12}, - /* 0xCE */ {2172, 13, 13, 14, 1, -12}, - /* 0xCF */ {2194, 11, 13, 13, 1, -12}, - /* 0xD0 */ {2212, 10, 13, 12, 1, -12}, - /* 0xD1 */ {2229, 11, 13, 13, 1, -12}, - /* 0xD2 */ {2247, 9, 13, 11, 1, -12}, - /* 0xD3 */ {2262, 10, 13, 11, 1, -12}, - /* 0xD4 */ {2279, 14, 13, 15, 1, -12}, - /* 0xD5 */ {2302, 10, 13, 12, 1, -12}, - /* 0xD6 */ {2319, 13, 15, 13, 1, -12}, - /* 0xD7 */ {2344, 9, 13, 11, 1, -12}, - /* 0xD8 */ {2359, 13, 13, 15, 1, -12}, - /* 0xD9 */ {2381, 15, 15, 15, 1, -12}, - /* 0xDA */ {2410, 13, 13, 15, 2, -12}, - /* 0xDB */ {2432, 14, 13, 16, 1, -12}, - /* 0xDC */ {2455, 11, 13, 12, 1, -12}, - /* 0xDD */ {2473, 11, 13, 13, 1, -12}, - /* 0xDE */ {2491, 17, 13, 18, 1, -12}, - /* 0xDF */ {2519, 10, 13, 12, 1, -12}, - /* 0xE0 */ {2536, 9, 10, 10, 1, -9}, - /* 0xE1 */ {2548, 8, 14, 10, 1, -13}, - /* 0xE2 */ {2562, 7, 10, 9, 1, -9}, - /* 0xE3 */ {2571, 5, 10, 7, 1, -9}, - /* 0xE4 */ {2578, 11, 12, 10, 0, -9}, - /* 0xE5 */ {2595, 8, 10, 10, 1, -9}, - /* 0xE6 */ {2605, 12, 10, 14, 1, -9}, - /* 0xE7 */ {2620, 7, 10, 9, 1, -9}, - /* 0xE8 */ {2629, 8, 10, 10, 1, -9}, - /* 0xE9 */ {2639, 8, 12, 10, 1, -11}, - /* 0xEA */ {2651, 7, 10, 9, 1, -9}, - /* 0xEB */ {2660, 7, 10, 8, 0, -9}, - /* 0xEC */ {2669, 9, 10, 11, 1, -9}, - /* 0xED */ {2681, 8, 10, 10, 1, -9}, - /* 0xEE */ {2691, 8, 10, 10, 1, -9}, - /* 0xEF */ {2701, 8, 10, 10, 1, -9}, - /* 0xF0 */ {2711, 9, 13, 10, 1, -9}, - /* 0xF1 */ {2726, 8, 10, 9, 1, -9}, - /* 0xF2 */ {2736, 6, 10, 7, 1, -9}, - /* 0xF3 */ {2744, 8, 14, 9, 0, -9}, - /* 0xF4 */ {2758, 14, 15, 15, 1, -11}, - /* 0xF5 */ {2785, 7, 10, 9, 1, -9}, - /* 0xF6 */ {2794, 10, 12, 10, 1, -9}, - /* 0xF7 */ {2809, 7, 10, 9, 1, -9}, - /* 0xF8 */ {2818, 10, 10, 12, 1, -9}, - /* 0xF9 */ {2831, 12, 12, 13, 1, -9}, - /* 0xFA */ {2849, 9, 10, 12, 2, -9}, - /* 0xFB */ {2861, 10, 10, 12, 1, -9}, - /* 0xFC */ {2874, 8, 10, 9, 1, -9}, - /* 0xFD */ {2884, 8, 10, 9, 1, -9}, - /* 0xFE */ {2894, 12, 10, 13, 1, -9}, - /* 0xFF */ {2909, 8, 10, 10, 1, -9}, +/* 0x01 */ { 0, 15, 15, 17, 1, -13 }, +/* 0x02 */ { 29, 15, 15, 17, 1, -13 }, +/* 0x03 */ { 58, 15, 16, 17, 1, -14 }, +/* 0x04 */ { 88, 15, 16, 17, 1, -14 }, +/* 0x05 */ { 118, 16, 15, 18, 1, -13 }, +/* 0x06 */ { 148, 15, 15, 17, 1, -13 }, +/* 0x07 */ { 177, 0, 0, 8, 0, 0 }, +/* 0x08 */ { 177, 17, 16, 19, 1, -14 }, +/* 0x09 */ { 211, 17, 12, 19, 1, -12 }, +/* 0x0A */ { 237, 0, 0, 8, 0, 0 }, +/* 0x0B */ { 237, 17, 16, 19, 1, -14 }, +/* 0x0C */ { 271, 15, 14, 17, 1, -12 }, +/* 0x0D */ { 298, 0, 0, 8, 0, 0 }, +/* 0x0E */ { 298, 15, 16, 17, 1, -14 }, +/* 0x0F */ { 328, 15, 15, 17, 1, -13 }, +/* 0x10 */ { 357, 15, 15, 17, 1, -13 }, +/* 0x11 */ { 386, 15, 16, 17, 1, -14 }, +/* 0x12 */ { 416, 17, 17, 19, 1, -15 }, +/* 0x13 */ { 453, 15, 16, 17, 1, -14 }, +/* 0x14 */ { 483, 15, 16, 17, 1, -14 }, +/* 0x15 */ { 513, 15, 16, 17, 1, -14 }, +/* 0x16 */ { 543, 11, 16, 13, 1, -14 }, +/* 0x17 */ { 565, 15, 16, 17, 1, -14 }, +/* 0x18 */ { 595, 18, 15, 20, 1, -13 }, +/* 0x19 */ { 629, 15, 16, 17, 1, -14 }, +/* 0x1A */ { 659, 13, 14, 15, 1, -12 }, +/* 0x1B */ { 682, 17, 16, 19, 1, -14 }, +/* 0x1C */ { 716, 15, 16, 17, 1, -14 }, +/* 0x1D */ { 746, 15, 15, 17, 1, -13 }, +/* 0x1E */ { 775, 17, 16, 19, 1, -14 }, +/* 0x1F */ { 809, 11, 16, 13, 1, -14 }, +/* ' ' 0x20 */ { 831, 0, 0, 5, 0, 0 }, +/* '!' 0x21 */ { 831, 2, 13, 6, 2, -12 }, +/* '"' 0x22 */ { 835, 5, 4, 6, 1, -12 }, +/* '#' 0x23 */ { 838, 10, 12, 10, 0, -11 }, +/* '$' 0x24 */ { 853, 9, 16, 10, 1, -13 }, +/* '%' 0x25 */ { 871, 16, 13, 16, 1, -12 }, +/* '&' 0x26 */ { 897, 10, 13, 12, 1, -12 }, +/* ''' 0x27 */ { 914, 2, 4, 4, 1, -12 }, +/* '(' 0x28 */ { 915, 4, 17, 6, 1, -12 }, +/* ')' 0x29 */ { 924, 4, 17, 6, 1, -12 }, +/* '*' 0x2A */ { 933, 5, 5, 7, 1, -12 }, +/* '+' 0x2B */ { 937, 6, 8, 11, 3, -7 }, +/* ',' 0x2C */ { 943, 2, 4, 5, 2, 0 }, +/* '-' 0x2D */ { 944, 4, 1, 6, 1, -4 }, +/* '.' 0x2E */ { 945, 2, 1, 5, 1, 0 }, +/* '/' 0x2F */ { 946, 5, 13, 5, 0, -12 }, +/* '0' 0x30 */ { 955, 8, 13, 10, 1, -12 }, +/* '1' 0x31 */ { 968, 4, 13, 10, 3, -12 }, +/* '2' 0x32 */ { 975, 9, 13, 10, 1, -12 }, +/* '3' 0x33 */ { 990, 8, 13, 10, 1, -12 }, +/* '4' 0x34 */ { 1003, 7, 13, 10, 2, -12 }, +/* '5' 0x35 */ { 1015, 9, 13, 10, 1, -12 }, +/* '6' 0x36 */ { 1030, 9, 13, 10, 1, -12 }, +/* '7' 0x37 */ { 1045, 8, 13, 10, 0, -12 }, +/* '8' 0x38 */ { 1058, 9, 13, 10, 1, -12 }, +/* '9' 0x39 */ { 1073, 8, 13, 10, 1, -12 }, +/* ':' 0x3A */ { 1086, 2, 10, 5, 1, -9 }, +/* ';' 0x3B */ { 1089, 3, 12, 5, 1, -8 }, +/* '<' 0x3C */ { 1094, 9, 9, 11, 1, -8 }, +/* '=' 0x3D */ { 1105, 9, 4, 11, 1, -5 }, +/* '>' 0x3E */ { 1110, 9, 8, 11, 1, -7 }, +/* '?' 0x3F */ { 1119, 9, 13, 10, 1, -12 }, +/* '@' 0x40 */ { 1134, 17, 16, 18, 1, -12 }, +/* 'A' 0x41 */ { 1168, 12, 13, 12, 0, -12 }, +/* 'B' 0x42 */ { 1188, 11, 13, 12, 1, -12 }, +/* 'C' 0x43 */ { 1206, 11, 13, 13, 1, -12 }, +/* 'D' 0x44 */ { 1224, 11, 13, 13, 1, -12 }, +/* 'E' 0x45 */ { 1242, 9, 13, 11, 1, -12 }, +/* 'F' 0x46 */ { 1257, 8, 13, 11, 1, -12 }, +/* 'G' 0x47 */ { 1270, 12, 13, 14, 1, -12 }, +/* 'H' 0x48 */ { 1290, 11, 13, 13, 1, -12 }, +/* 'I' 0x49 */ { 1308, 2, 13, 5, 2, -12 }, +/* 'J' 0x4A */ { 1312, 7, 13, 10, 1, -12 }, +/* 'K' 0x4B */ { 1324, 10, 13, 12, 1, -12 }, +/* 'L' 0x4C */ { 1341, 8, 13, 10, 1, -12 }, +/* 'M' 0x4D */ { 1354, 13, 13, 15, 1, -12 }, +/* 'N' 0x4E */ { 1376, 11, 13, 13, 1, -12 }, +/* 'O' 0x4F */ { 1394, 13, 13, 14, 1, -12 }, +/* 'P' 0x50 */ { 1416, 10, 13, 12, 1, -12 }, +/* 'Q' 0x51 */ { 1433, 13, 14, 14, 1, -12 }, +/* 'R' 0x52 */ { 1456, 12, 13, 13, 1, -12 }, +/* 'S' 0x53 */ { 1476, 10, 13, 12, 1, -12 }, +/* 'T' 0x54 */ { 1493, 9, 13, 11, 1, -12 }, +/* 'U' 0x55 */ { 1508, 11, 13, 13, 1, -12 }, +/* 'V' 0x56 */ { 1526, 11, 13, 11, 0, -12 }, +/* 'W' 0x57 */ { 1544, 16, 13, 17, 0, -12 }, +/* 'X' 0x58 */ { 1570, 10, 13, 12, 1, -12 }, +/* 'Y' 0x59 */ { 1587, 12, 13, 12, 0, -12 }, +/* 'Z' 0x5A */ { 1607, 10, 13, 11, 1, -12 }, +/* '[' 0x5B */ { 1624, 3, 17, 5, 1, -12 }, +/* '\' 0x5C */ { 1631, 5, 13, 5, 0, -12 }, +/* ']' 0x5D */ { 1640, 3, 17, 5, 0, -12 }, +/* '^' 0x5E */ { 1647, 7, 7, 8, 1, -12 }, +/* '_' 0x5F */ { 1654, 10, 1, 10, 0, 3 }, +/* '`' 0x60 */ { 1656, 4, 3, 5, 0, -12 }, +/* 'a' 0x61 */ { 1658, 9, 10, 10, 1, -9 }, +/* 'b' 0x62 */ { 1670, 9, 13, 10, 1, -12 }, +/* 'c' 0x63 */ { 1685, 8, 10, 9, 1, -9 }, +/* 'd' 0x64 */ { 1695, 8, 13, 10, 1, -12 }, +/* 'e' 0x65 */ { 1708, 8, 10, 10, 1, -9 }, +/* 'f' 0x66 */ { 1718, 4, 13, 5, 1, -12 }, +/* 'g' 0x67 */ { 1725, 8, 14, 10, 1, -9 }, +/* 'h' 0x68 */ { 1739, 8, 13, 10, 1, -12 }, +/* 'i' 0x69 */ { 1752, 2, 13, 4, 1, -12 }, +/* 'j' 0x6A */ { 1756, 4, 17, 4, 0, -12 }, +/* 'k' 0x6B */ { 1765, 8, 13, 9, 1, -12 }, +/* 'l' 0x6C */ { 1778, 2, 13, 4, 1, -12 }, +/* 'm' 0x6D */ { 1782, 13, 10, 15, 1, -9 }, +/* 'n' 0x6E */ { 1799, 8, 10, 10, 1, -9 }, +/* 'o' 0x6F */ { 1809, 8, 10, 10, 1, -9 }, +/* 'p' 0x70 */ { 1819, 9, 13, 10, 1, -9 }, +/* 'q' 0x71 */ { 1834, 8, 13, 10, 1, -9 }, +/* 'r' 0x72 */ { 1847, 5, 10, 6, 1, -9 }, +/* 's' 0x73 */ { 1854, 8, 10, 9, 1, -9 }, +/* 't' 0x74 */ { 1864, 4, 12, 5, 1, -11 }, +/* 'u' 0x75 */ { 1870, 8, 10, 10, 1, -9 }, +/* 'v' 0x76 */ { 1880, 9, 10, 9, 0, -9 }, +/* 'w' 0x77 */ { 1892, 13, 10, 13, 0, -9 }, +/* 'x' 0x78 */ { 1909, 7, 10, 9, 1, -9 }, +/* 'y' 0x79 */ { 1918, 8, 14, 9, 0, -9 }, +/* 'z' 0x7A */ { 1932, 7, 10, 9, 1, -9 }, +/* '{' 0x7B */ { 1941, 4, 17, 6, 1, -12 }, +/* '|' 0x7C */ { 1950, 2, 17, 4, 2, -12 }, +/* '}' 0x7D */ { 1955, 4, 17, 6, 1, -12 }, +/* '~' 0x7E */ { 1964, 7, 3, 9, 1, -7 }, +/* 0x7F */ { 1967, 13, 14, 15, 1, -12 }, +/* 0x80 */ { 1990, 12, 16, 14, 1, -12 }, +/* 0x81 */ { 2014, 8, 15, 11, 1, -14 }, +/* 0x82 */ { 2029, 2, 3, 5, 1, 0 }, +/* 0x83 */ { 2030, 5, 13, 7, 1, -12 }, +/* 0x84 */ { 2039, 5, 3, 7, 1, 0 }, +/* 0x85 */ { 2041, 10, 1, 12, 1, 0 }, +/* 0x86 */ { 2043, 8, 16, 10, 1, -12 }, +/* 0x87 */ { 2059, 8, 16, 10, 1, -12 }, +/* 0x88 */ { 2075, 10, 13, 12, 1, -12 }, +/* 0x89 */ { 2092, 18, 13, 18, 0, -12 }, +/* 0x8A */ { 2122, 17, 13, 18, 1, -12 }, +/* 0x8B */ { 2150, 2, 4, 4, 1, -6 }, +/* 0x8C */ { 2151, 17, 13, 18, 1, -12 }, +/* 0x8D */ { 2179, 10, 15, 11, 1, -14 }, +/* 0x8E */ { 2198, 12, 13, 14, 1, -12 }, +/* 0x8F */ { 2218, 11, 15, 13, 1, -12 }, +/* 0x90 */ { 2239, 9, 16, 10, 1, -12 }, +/* 0x91 */ { 2257, 2, 4, 4, 2, -12 }, +/* 0x92 */ { 2258, 2, 4, 4, 1, -12 }, +/* 0x93 */ { 2259, 5, 4, 7, 2, -12 }, +/* 0x94 */ { 2262, 5, 4, 7, 1, -12 }, +/* 0x95 */ { 2265, 4, 5, 7, 1, -8 }, +/* 0x96 */ { 2268, 7, 1, 9, 1, -4 }, +/* 0x97 */ { 2269, 16, 1, 18, 1, -4 }, +/* 0x98 */ { 2271, 0, 0, 0, 0, 0 }, +/* 0x99 */ { 2271, 18, 10, 18, 1, -13 }, +/* 0x9A */ { 2294, 13, 10, 14, 1, -9 }, +/* 0x9B */ { 2311, 2, 4, 5, 2, -6 }, +/* 0x9C */ { 2312, 14, 10, 15, 1, -9 }, +/* 0x9D */ { 2330, 7, 13, 9, 1, -12 }, +/* 0x9E */ { 2342, 9, 13, 10, 1, -12 }, +/* 0x9F */ { 2357, 8, 12, 10, 1, -9 }, +/* 0xA0 */ { 2369, 0, 0, 5, 0, 0 }, +/* 0xA1 */ { 2369, 10, 15, 11, 1, -14 }, +/* 0xA2 */ { 2388, 8, 16, 9, 0, -11 }, +/* 0xA3 */ { 2404, 7, 13, 10, 1, -12 }, +/* 0xA4 */ { 2416, 7, 6, 10, 2, -8 }, +/* 0xA5 */ { 2422, 10, 14, 11, 1, -13 }, +/* 0xA6 */ { 2440, 2, 17, 5, 2, -12 }, +/* 0xA7 */ { 2445, 9, 17, 10, 1, -12 }, +/* 0xA8 */ { 2465, 9, 15, 12, 1, -14 }, +/* 0xA9 */ { 2482, 14, 13, 14, 1, -12 }, +/* 0xAA */ { 2505, 11, 13, 13, 1, -12 }, +/* 0xAB */ { 2523, 7, 6, 9, 1, -7 }, +/* 0xAC */ { 2529, 9, 5, 11, 2, -5 }, +/* 0xAD */ { 2535, 0, 0, 0, 0, 0 }, +/* 0xAE */ { 2535, 14, 13, 14, 1, -12 }, +/* 0xAF */ { 2558, 6, 15, 5, 0, -14 }, +/* 0xB0 */ { 2570, 5, 5, 11, 3, -11 }, +/* 0xB1 */ { 2574, 9, 11, 11, 1, -10 }, +/* 0xB2 */ { 2587, 2, 13, 4, 1, -12 }, +/* 0xB3 */ { 2591, 2, 13, 4, 1, -12 }, +/* 0xB4 */ { 2595, 6, 12, 7, 1, -11 }, +/* 0xB5 */ { 2604, 9, 13, 10, 1, -9 }, +/* 0xB6 */ { 2619, 8, 16, 10, 2, -12 }, +/* 0xB7 */ { 2635, 3, 1, 5, 1, -4 }, +/* 0xB8 */ { 2636, 8, 12, 10, 1, -11 }, +/* 0xB9 */ { 2648, 15, 13, 17, 1, -12 }, +/* 0xBA */ { 2673, 8, 10, 9, 1, -9 }, +/* 0xBB */ { 2683, 7, 6, 9, 1, -7 }, +/* 0xBC */ { 2689, 4, 17, 4, 0, -12 }, +/* 0xBD */ { 2698, 10, 13, 12, 1, -12 }, +/* 0xBE */ { 2715, 8, 10, 9, 1, -9 }, +/* 0xBF */ { 2725, 6, 12, 5, -1, -11 }, +/* 0xC0 */ { 2734, 12, 13, 12, 0, -12 }, +/* 0xC1 */ { 2754, 11, 13, 12, 1, -12 }, +/* 0xC2 */ { 2772, 11, 13, 12, 1, -12 }, +/* 0xC3 */ { 2790, 8, 13, 8, 1, -12 }, +/* 0xC4 */ { 2803, 14, 16, 15, 1, -12 }, +/* 0xC5 */ { 2831, 9, 13, 12, 1, -12 }, +/* 0xC6 */ { 2846, 16, 13, 16, 0, -12 }, +/* 0xC7 */ { 2872, 10, 13, 12, 1, -12 }, +/* 0xC8 */ { 2889, 11, 13, 13, 1, -12 }, +/* 0xC9 */ { 2907, 11, 16, 13, 1, -15 }, +/* 0xCA */ { 2929, 10, 13, 11, 1, -12 }, +/* 0xCB */ { 2946, 10, 13, 12, 1, -12 }, +/* 0xCC */ { 2963, 13, 13, 15, 1, -12 }, +/* 0xCD */ { 2985, 11, 13, 13, 1, -12 }, +/* 0xCE */ { 3003, 13, 13, 14, 1, -12 }, +/* 0xCF */ { 3025, 11, 13, 13, 1, -12 }, +/* 0xD0 */ { 3043, 10, 13, 12, 1, -12 }, +/* 0xD1 */ { 3060, 11, 13, 13, 1, -12 }, +/* 0xD2 */ { 3078, 9, 13, 11, 1, -12 }, +/* 0xD3 */ { 3093, 10, 13, 11, 1, -12 }, +/* 0xD4 */ { 3110, 14, 13, 15, 1, -12 }, +/* 0xD5 */ { 3133, 10, 13, 12, 1, -12 }, +/* 0xD6 */ { 3150, 13, 15, 13, 1, -12 }, +/* 0xD7 */ { 3175, 9, 13, 11, 1, -12 }, +/* 0xD8 */ { 3190, 13, 13, 15, 1, -12 }, +/* 0xD9 */ { 3212, 15, 15, 15, 1, -12 }, +/* 0xDA */ { 3241, 13, 13, 15, 2, -12 }, +/* 0xDB */ { 3263, 14, 13, 16, 1, -12 }, +/* 0xDC */ { 3286, 11, 13, 12, 1, -12 }, +/* 0xDD */ { 3304, 11, 13, 13, 1, -12 }, +/* 0xDE */ { 3322, 17, 13, 18, 1, -12 }, +/* 0xDF */ { 3350, 10, 13, 12, 1, -12 }, +/* 0xE0 */ { 3367, 9, 10, 10, 1, -9 }, +/* 0xE1 */ { 3379, 8, 14, 10, 1, -13 }, +/* 0xE2 */ { 3393, 7, 10, 9, 1, -9 }, +/* 0xE3 */ { 3402, 5, 10, 7, 1, -9 }, +/* 0xE4 */ { 3409, 11, 12, 10, 0, -9 }, +/* 0xE5 */ { 3426, 8, 10, 10, 1, -9 }, +/* 0xE6 */ { 3436, 12, 10, 14, 1, -9 }, +/* 0xE7 */ { 3451, 7, 10, 9, 1, -9 }, +/* 0xE8 */ { 3460, 8, 10, 10, 1, -9 }, +/* 0xE9 */ { 3470, 8, 12, 10, 1, -11 }, +/* 0xEA */ { 3482, 7, 10, 9, 1, -9 }, +/* 0xEB */ { 3491, 7, 10, 8, 0, -9 }, +/* 0xEC */ { 3500, 9, 10, 11, 1, -9 }, +/* 0xED */ { 3512, 8, 10, 10, 1, -9 }, +/* 0xEE */ { 3522, 8, 10, 10, 1, -9 }, +/* 0xEF */ { 3532, 8, 10, 10, 1, -9 }, +/* 0xF0 */ { 3542, 9, 13, 10, 1, -9 }, +/* 0xF1 */ { 3557, 8, 10, 9, 1, -9 }, +/* 0xF2 */ { 3567, 6, 10, 7, 1, -9 }, +/* 0xF3 */ { 3575, 8, 14, 9, 0, -9 }, +/* 0xF4 */ { 3589, 14, 15, 15, 1, -11 }, +/* 0xF5 */ { 3616, 7, 10, 9, 1, -9 }, +/* 0xF6 */ { 3625, 10, 12, 10, 1, -9 }, +/* 0xF7 */ { 3640, 7, 10, 9, 1, -9 }, +/* 0xF8 */ { 3649, 10, 10, 12, 1, -9 }, +/* 0xF9 */ { 3662, 12, 12, 13, 1, -9 }, +/* 0xFA */ { 3680, 9, 10, 12, 2, -9 }, +/* 0xFB */ { 3692, 10, 10, 12, 1, -9 }, +/* 0xFC */ { 3705, 8, 10, 9, 1, -9 }, +/* 0xFD */ { 3715, 8, 10, 9, 1, -9 }, +/* 0xFE */ { 3725, 12, 10, 13, 1, -9 }, +/* 0xFF */ { 3740, 8, 10, 10, 1, -9 }, }; -const GFXfont FreeSans9pt_Win1251 PROGMEM = {(uint8_t *)FreeSans9pt_Win1251Bitmaps, (GFXglyph *)FreeSans9pt_Win1251Glyphs, 0x20, - 0xFF, 21}; +const GFXfont FreeSans9pt_Win1251 PROGMEM = { +(uint8_t*)FreeSans9pt_Win1251Bitmaps, +(GFXglyph*)FreeSans9pt_Win1251Glyphs, +0x01, 0xFF, 21 +}; diff --git a/src/graphics/niche/Fonts/FreeSans9pt_Win1252.h b/src/graphics/niche/Fonts/FreeSans9pt_Win1252.h index 20f2ddc2f..8bc656632 100644 --- a/src/graphics/niche/Fonts/FreeSans9pt_Win1252.h +++ b/src/graphics/niche/Fonts/FreeSans9pt_Win1252.h @@ -1,494 +1,527 @@ +// trunk-ignore-all(clang-format) #pragma once +/* PROPERTIES + +FONT_NAME FreeSans9pt_Win1252 +*/ const uint8_t FreeSans9pt_Win1252Bitmaps[] PROGMEM = { - /* ' ' 0x20 */ - 0xFF, 0xFF, 0xF0, 0xC0, /* '!' 0x21 */ - 0xDE, 0xF7, 0x20, /* '"' 0x22 */ - 0x09, 0x86, 0x41, 0x91, 0xFF, 0x13, 0x04, 0xC3, 0x20, 0xC8, 0xFF, 0x89, 0x82, 0x61, 0x90, /* '#' 0x23 */ - 0x10, 0x1F, 0x14, 0xDA, 0x3D, 0x1E, 0x83, 0x40, 0x78, 0x17, 0x08, 0xF4, 0x7A, 0x35, 0x33, 0xF0, 0x40, 0x20, /* '$' 0x24 */ - 0x38, 0x10, 0xEC, 0x20, 0xC6, 0x20, 0xC6, 0x40, 0xC6, 0x40, 0x6C, 0x80, 0x39, 0x00, 0x01, 0x3C, 0x02, 0x77, 0x02, 0x63, 0x04, - 0x63, 0x04, 0x77, 0x08, 0x3C, /* '%' 0x25 */ - 0x0E, 0x0C, 0xC3, 0x30, 0xCC, 0x1E, 0x03, 0x03, 0xC1, 0x9B, 0xC2, 0xF0, 0xEC, 0x19, 0x8F, 0x3C, 0x40, /* '&' 0x26 */ - 0xFE, /* ''' 0x27 */ - 0x13, 0x26, 0x6C, 0xCC, 0xCC, 0xC4, 0x66, 0x23, 0x10, /* '(' 0x28 */ - 0x8C, 0x46, 0x63, 0x33, 0x33, 0x32, 0x66, 0x4C, 0x80, /* ')' 0x29 */ - 0x25, 0x7E, 0xA5, 0x00, /* '*' 0x2A */ - 0x30, 0xC3, 0x3F, 0x30, 0xC3, 0x0C, /* '+' 0x2B */ - 0xD6, /* ',' 0x2C */ - 0xF0, /* '-' 0x2D */ - 0xC0, /* '.' 0x2E */ - 0x08, 0x44, 0x21, 0x10, 0x84, 0x42, 0x11, 0x08, 0x00, /* '/' 0x2F */ - 0x3C, 0x66, 0x42, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x42, 0x66, 0x3C, /* '0' 0x30 */ - 0x11, 0x3F, 0x33, 0x33, 0x33, 0x33, 0x30, /* '1' 0x31 */ - 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x1C, 0x1C, 0x1C, 0x18, 0x18, 0x10, 0x08, 0x07, 0xF8, /* '2' 0x32 */ - 0x3C, 0x66, 0xC3, 0xC3, 0x03, 0x06, 0x1C, 0x07, 0x03, 0xC3, 0xC3, 0x66, 0x3C, /* '3' 0x33 */ - 0x0C, 0x18, 0x71, 0x62, 0xC9, 0xA3, 0x46, 0xFE, 0x18, 0x30, 0x60, 0xC0, /* '4' 0x34 */ - 0x7F, 0x20, 0x10, 0x08, 0x08, 0x07, 0xF3, 0x8C, 0x03, 0x01, 0x80, 0xF0, 0x6C, 0x63, 0xE0, /* '5' 0x35 */ - 0x1E, 0x31, 0x98, 0x78, 0x0C, 0x06, 0xF3, 0x8D, 0x83, 0xC1, 0xE0, 0xD0, 0x6C, 0x63, 0xE0, /* '6' 0x36 */ - 0xFF, 0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x18, 0x18, 0x18, 0x10, 0x30, 0x30, /* '7' 0x37 */ - 0x3E, 0x31, 0xB0, 0x78, 0x3C, 0x1B, 0x18, 0xF8, 0xC6, 0xC1, 0xE0, 0xF0, 0x6C, 0x63, 0xE0, /* '8' 0x38 */ - 0x3C, 0x66, 0xC2, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0xC2, 0x66, 0x3C, /* '9' 0x39 */ - 0xC0, 0x00, 0x30, /* ':' 0x3A */ - 0xC0, 0x00, 0x00, 0x64, 0xA0, /* ';' 0x3B */ - 0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x07, 0x80, 0x70, 0x0E, 0x01, 0x80, /* '<' 0x3C */ - 0xFF, 0x80, 0x00, 0x1F, 0xF0, /* '=' 0x3D */ - 0xE0, 0x1C, 0x03, 0x80, 0x30, 0x70, 0xE3, 0x81, 0x00, /* '>' 0x3E */ - 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x18, 0x38, 0x18, 0x18, 0x0C, 0x00, 0x00, 0x01, 0x80, /* '?' 0x3F */ - 0x03, 0xF0, 0x06, 0x0E, 0x06, 0x01, 0x86, 0x00, 0x66, 0x1D, 0xBB, 0x31, 0xCF, 0x18, 0xC7, 0x98, 0x63, 0xCC, 0x31, 0xE6, 0x11, - 0xB3, 0x99, 0xCC, 0xF7, 0x86, 0x00, 0x01, 0x80, 0x00, 0x70, 0x40, 0x0F, 0xE0, /* '@' 0x40 */ - 0x06, 0x00, 0xF0, 0x0F, 0x00, 0x90, 0x19, 0x81, 0x98, 0x10, 0x83, 0x0C, 0x3F, 0xC2, 0x04, 0x60, 0x66, 0x06, 0xC0, - 0x30, /* 'A' 0x41 */ - 0xFF, 0x18, 0x33, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x3F, 0xC6, 0x06, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, /* 'B' 0x42 */ - 0x1F, 0x86, 0x19, 0x81, 0xA0, 0x3C, 0x01, 0x80, 0x30, 0x06, 0x00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, 0x60, 0xCC, 0x19, 0x01, 0x60, 0x3C, 0x07, 0x00, 0x60, /* 'V' 0x56 */ - 0xC1, 0x81, 0x61, 0xC3, 0x61, 0xC3, 0x61, 0x43, 0x62, 0x62, 0x22, 0x66, 0x32, 0x26, 0x36, 0x26, 0x14, 0x34, 0x14, 0x34, 0x1C, - 0x1C, 0x18, 0x1C, 0x08, 0x18, /* 'W' 0x57 */ - 0xC0, 0xD8, 0x66, 0x18, 0xCC, 0x1E, 0x07, 0x00, 0xC0, 0x78, 0x32, 0x0C, 0xC6, 0x1B, 0x07, 0xC0, 0xC0, /* 'X' 0x58 */ - 0xC0, 0x36, 0x06, 0x30, 0xC3, 0x0C, 0x19, 0x81, 0xD8, 0x0F, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, - 0x00, /* 'Y' 0x59 */ - 0xFF, 0xC0, 0x60, 0x30, 0x0C, 0x06, 0x03, 0x01, 0xC0, 0x60, 0x30, 0x18, 0x06, 0x03, 0x00, 0xFF, 0xC0, /* 'Z' 0x5A */ - 0xFB, 0x6D, 0xB6, 0xDB, 0x6D, 0xB6, 0xE0, /* '[' 0x5B */ - 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x80, /* '\' 0x5C */ - 0xED, 0xB6, 0xDB, 0x6D, 0xB6, 0xDB, 0xE0, /* ']' 0x5D */ - 0x30, 0x60, 0xA2, 0x44, 0xD8, 0xA1, 0x80, /* '^' 0x5E */ - 0xFF, 0xC0, /* '_' 0x5F */ - 0xC6, 0x30, /* '`' 0x60 */ - 0x7E, 0x71, 0xB0, 0xC0, 0x60, 0xF3, 0xDB, 0x0D, 0x86, 0xC7, 0x3D, 0xC0, /* 'a' 0x61 */ - 0xC0, 0x60, 0x30, 0x1B, 0xCE, 0x36, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x6D, 0xE0, /* 'b' 0x62 */ - 0x3C, 0x66, 0xC3, 0xC0, 0x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0x3B, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0x03, /* 'q' 0x71 */ - 0xDF, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0x00, /* 'r' 0x72 */ - 0x3E, 0xE3, 0xC0, 0xC0, 0xE0, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, /* 's' 0x73 */ - 0x66, 0xF6, 0x66, 0x66, 0x66, 0x67, /* 't' 0x74 */ - 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 'u' 0x75 */ - 0xC1, 0xA0, 0x98, 0xCC, 0x42, 0x21, 0xB0, 0xD0, 0x28, 0x1C, 0x0C, 0x00, /* 'v' 0x76 */ - 0xC6, 0x1E, 0x38, 0x91, 0xC4, 0xCA, 0x66, 0xD3, 0x16, 0xD0, 0xA6, 0x87, 0x1C, 0x38, 0xC0, 0xC6, 0x00, /* 'w' 0x77 */ - 0x87, 0x89, 0xB1, 0xC3, 0x07, 0x1E, 0x26, 0xC5, 0x0C, /* 'x' 0x78 */ - 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, /* 'y' 0x79 */ - 0xFE, 0x0C, 0x30, 0xC1, 0x86, 0x18, 0x20, 0xC1, 0xFC, /* 'z' 0x7A */ - 0x36, 0x66, 0x66, 0x6E, 0xCE, 0x66, 0x66, 0x66, 0x30, /* '{' 0x7B */ - 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, /* '|' 0x7C */ - 0xC6, 0x66, 0x66, 0x67, 0x37, 0x66, 0x66, 0x66, 0xC0, /* '}' 0x7D */ - 0x61, 0x24, 0x38, /* '~' 0x7E */ - 0xFF, 0xFC, 0x00, 0x63, 0xE3, 0x31, 0x99, 0x04, 0xC8, 0x66, 0x06, 0x30, 0x61, 0x83, 0x0C, 0x18, 0x60, 0x03, 0x06, 0x18, 0x00, - 0xFF, 0xFC, /* 0x7F */ - 0x07, 0xC6, 0x13, 0x00, 0xC0, 0x60, 0x3F, 0xE6, 0x03, 0xFC, 0x60, 0x0C, 0x03, 0x00, 0x61, 0x07, 0xC0, /* 0x80 */ - /* 0x81 */ - 0xDC, /* 0x82 */ - 0x19, 0x8C, 0xF3, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0xE0, /* 0x83 */ - 0xDA, 0x76, /* 0x84 */ - 0xCC, 0xC0, /* 0x85 */ - 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, /* 0x86 */ - 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, /* 0x87 */ - 0x72, 0xA2, /* 0x88 */ - 0x70, 0x80, 0x22, 0x20, 0x08, 0x90, 0x02, 0x24, 0x00, 0x72, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x10, 0x00, 0x09, 0xC7, 0x84, - 0x8B, 0x31, 0x22, 0x84, 0x88, 0xB3, 0x21, 0xC7, 0x80, /* 0x89 */ - 0x1B, 0x03, 0x80, 0x00, 0xFC, 0x61, 0xB0, 0x3C, 0x0F, 0x00, 0x78, 0x07, 0xC0, 0x38, 0x03, 0xC0, 0xF0, 0x36, 0x18, - 0xFC, /* 0x8A */ - 0x69, /* 0x8B */ - 0x1E, 0xFE, 0x43, 0x81, 0x83, 0x06, 0x06, 0x0C, 0x0C, 0x18, 0x18, 0x30, 0x3F, 0xE0, 0x60, 0xC0, 0xC1, 0x81, 0x81, 0x83, 0x01, - 0x8E, 0x01, 0xEF, 0xE0, /* 0x8C */ - /* 0x8D */ - 0x1B, 0x03, 0x80, 0x03, 0xFF, 0x01, 0x80, 0xC0, 0x30, 0x18, 0x0C, 0x07, 0x01, 0x80, 0xC0, 0x60, 0x18, 0x0C, 0x03, - 0xFF, /* 0x8E */ - /* 0x8F */ - /* 0x90 */ - 0x6B, /* 0x91 */ - 0xD6, /* 0x92 */ - 0x4C, 0xA5, 0xB0, /* 0x93 */ - 0xDA, 0x53, 0x20, /* 0x94 */ - 0x6F, 0xFF, 0x60, /* 0x95 */ - 0xFE, /* 0x96 */ - 0xFF, 0xFF, /* 0x97 */ - 0x4D, 0xC0, /* 0x98 */ - 0xFC, 0xE1, 0xCC, 0x38, 0x73, 0x0E, 0x1C, 0xC3, 0x8F, 0x30, 0xD2, 0xCC, 0x34, 0xB3, 0x0D, 0x6C, 0xC3, 0x53, 0x30, 0xCC, 0xCC, - 0x33, 0x30, /* 0x99 */ - 0x24, 0x3C, 0x18, 0x7E, 0xE3, 0xC0, 0xC0, 0x60, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, /* 0x9A */ - 0x96, /* 0x9B */ - 0x3C, 0xF8, 0xCF, 0x1B, 0x0C, 0x1E, 0x18, 0x3C, 0x3F, 0xF8, 0x60, 0x30, 0xC0, 0x61, 0x83, 0x67, 0x8C, 0x79, 0xF0, /* 0x9C */ - /* 0x9D */ - 0x48, 0xF0, 0xC7, 0xF0, 0x61, 0x86, 0x0C, 0x30, 0xC1, 0x06, 0x0F, 0xE0, /* 0x9E */ - 0x19, 0x80, 0x00, 0xC0, 0x36, 0x06, 0x30, 0xC3, 0x0C, 0x19, 0x81, 0xD8, 0x0F, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, - 0x60, /* 0x9F */ - /* 0xA0 */ - 0xCF, 0xFF, 0xFF, 0xC0, /* 0xA1 */ - 0x08, 0x04, 0x0F, 0x8D, 0x6C, 0x9E, 0x43, 0x21, 0x90, 0xC8, 0x64, 0xDA, 0xC7, 0xC0, 0x80, 0x40, /* 0xA2 */ - 0x1F, 0x0C, 0x66, 0x0D, 0x83, 0x60, 0x0C, 0x0F, 0xC0, 0x60, 0x18, 0x06, 0x03, 0x01, 0xF1, 0x43, 0xC0, /* 0xA3 */ - 0xFF, 0xDF, 0x1E, 0x3E, 0xFF, 0xC0, /* 0xA4 */ - 0xC3, 0x42, 0x42, 0x24, 0x24, 0x3C, 0x18, 0x7E, 0x18, 0x7E, 0x18, 0x18, 0x18, /* 0xA5 */ - 0xFF, 0xFC, 0x0F, 0xFF, 0xC0, /* 0xA6 */ - 0x0C, 0x09, 0x0C, 0xC6, 0x63, 0x81, 0xE3, 0x19, 0x87, 0xE1, 0xB8, 0xC6, 0x41, 0xC0, 0x73, 0x19, 0x8C, 0x66, 0x1E, - 0x00, /* 0xA7 */ - 0xCC, /* 0xA8 */ - 0x0F, 0xC0, 0x61, 0x87, 0x03, 0x9B, 0xC6, 0xD9, 0x8F, 0x60, 0x3D, 0x00, 0xF4, 0x03, 0xD8, 0x0D, 0xE6, 0x67, 0xF3, 0x86, 0x18, - 0x0F, 0xC0, /* 0xA9 */ - 0x74, 0x8D, 0xA9, 0x7C, 0x1F, /* 0xAA */ - 0x22, 0xCF, 0x26, 0x46, 0x64, 0x40, /* 0xAB */ - 0xFF, 0x80, 0xC0, 0x60, 0x30, 0x18, /* 0xAC */ - /* 0xAD */ - 0x0F, 0xC0, 0x61, 0x87, 0x03, 0x9F, 0xE6, 0xD0, 0x8F, 0x42, 0x3D, 0xF0, 0xF4, 0x23, 0xD0, 0x8D, 0xC2, 0x67, 0x0B, 0x86, 0x18, - 0x0F, 0xC0, /* 0xAE */ - 0xF8, /* 0xAF */ - 0x74, 0x63, 0x17, 0x00, /* 0xB0 */ - 0x0C, 0x06, 0x03, 0x07, 0xE0, 0xC0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x3F, 0xE0, /* 0xB1 */ - 0x7B, 0x30, 0xC3, 0x11, 0x84, 0x3F, /* 0xB2 */ - 0x7D, 0x8C, 0x18, 0xC0, 0x60, 0xF1, 0xBE, /* 0xB3 */ - 0x36, 0xC0, /* 0xB4 */ - 0xC3, 0x61, 0xB0, 0xD8, 0x6C, 0x36, 0x1B, 0x0D, 0x86, 0xE7, 0x7D, 0xF0, 0x18, 0x0C, 0x00, /* 0xB5 */ - 0x3F, 0x7E, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0x72, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, /* 0xB6 */ - 0xE0, /* 0xB7 */ - 0x21, 0xC7, 0xE0, /* 0xB8 */ - 0x3D, 0xB6, 0xD8, /* 0xB9 */ - 0x74, 0x63, 0x18, 0xB8, 0x1F, /* 0xBA */ - 0x89, 0x98, 0x99, 0x3C, 0xD1, 0x00, /* 0xBB */ - 0x20, 0x43, 0x81, 0x06, 0x08, 0x18, 0x20, 0x61, 0x01, 0x84, 0x06, 0x21, 0x80, 0x86, 0x04, 0x78, 0x32, 0x60, 0x87, 0xC4, 0x06, - 0x10, 0x18, /* 0xBC */ - 0x20, 0x43, 0x81, 0x06, 0x08, 0x18, 0x20, 0x61, 0x01, 0x8D, 0xE6, 0x2C, 0xC1, 0x03, 0x0C, 0x0C, 0x20, 0x41, 0x86, 0x0C, 0x30, - 0x20, 0xFC, /* 0xBD */ - 0x78, 0x11, 0x98, 0x40, 0x31, 0x00, 0x82, 0x00, 0xC8, 0x01, 0x90, 0x33, 0x43, 0x3D, 0x06, 0x02, 0x3C, 0x08, 0x98, 0x10, 0xF8, - 0x40, 0x61, 0x00, 0xC0, /* 0xBE */ - 0x0C, 0x00, 0x00, 0x01, 0x80, 0xC0, 0xC0, 0xE0, 0xC0, 0xC0, 0x60, 0xF0, 0x6C, 0x63, 0xE0, /* 0xBF */ - 0x18, 0x03, 0x00, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC0 */ - 0x06, 0x03, 0x00, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC1 */ - 0x0C, 0x04, 0x80, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC2 */ - 0x19, 0x09, 0x80, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC3 */ - 0x33, 0x00, 0x00, 0xC0, 0x78, 0x1E, 0x04, 0x83, 0x30, 0xCC, 0x33, 0x1F, 0xE6, 0x19, 0x02, 0xC0, 0xF0, 0x30, /* 0xC4 */ - 0x0C, 0x04, 0x81, 0x20, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, /* 0xC5 */ - 0x07, 0xFF, 0x04, 0xC0, 0x0C, 0xC0, 0x08, 0xC0, 0x18, 0xC0, 0x18, 0xC0, 0x30, 0xFF, 0x30, 0xC0, 0x3F, 0xC0, 0x60, 0xC0, 0x60, - 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, /* 0xC6 */ - 0x1F, 0x06, 0x19, 0x83, 0xA0, 0x3C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0xE1, 0xF0, 0x08, 0x01, 0xC0, - 0x18, 0x0E, 0x00, /* 0xC7 */ - 0x18, 0x06, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, /* 0xC8 */ - 0x0C, 0x0C, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, /* 0xC9 */ - 0x1C, 0x1B, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, /* 0xCA */ - 0x33, 0x00, 0x3F, 0xF8, 0x0C, 0x06, 0x03, 0x01, 0xFE, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, /* 0xCB */ - 0xCC, 0x36, 0xDB, 0x6D, 0xB6, 0xD8, /* 0xCC */ - 0x78, 0x36, 0xDB, 0x6D, 0xB6, 0xC0, /* 0xCD */ - 0x76, 0xC0, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18, /* 0xCE */ - 0xCC, 0x03, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC0, /* 0xCF */ - 0x7F, 0x0C, 0x31, 0x83, 0x30, 0x36, 0x06, 0xC0, 0xFE, 0x1B, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x30, 0xE7, 0xF0, /* 0xD0 */ - 0x19, 0x02, 0xC3, 0x81, 0xF0, 0x3F, 0x07, 0xA0, 0xF6, 0x1E, 0x63, 0xC4, 0x78, 0xCF, 0x0D, 0xE1, 0xBC, 0x1F, 0x81, - 0xC0, /* 0xD1 */ - 0x0C, 0x00, 0x60, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, - 0x0F, 0x00, /* 0xD2 */ - 0x03, 0x00, 0x60, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, - 0x0F, 0x00, /* 0xD3 */ - 0x0F, 0x01, 0x98, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, - 0x0F, 0x00, /* 0xD4 */ - 0x1C, 0x81, 0x38, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, - 0x0F, 0x00, /* 0xD5 */ - 0x19, 0x81, 0x98, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, - 0x0F, 0x00, /* 0xD6 */ - 0x83, 0x89, 0xA1, 0x83, 0x89, 0xA1, 0x80, /* 0xD7 */ - 0x0F, 0xD9, 0x83, 0x18, 0x1C, 0xC1, 0xEC, 0x19, 0xE0, 0x8F, 0x08, 0x78, 0x83, 0xC8, 0x1B, 0x81, 0x98, 0x0C, 0xE0, 0xC8, 0xF8, - 0x00, /* 0xD8 */ - 0x0C, 0x00, 0xC3, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, - 0x00, /* 0xD9 */ - 0x06, 0x01, 0x83, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, - 0x00, /* 0xDA */ - 0x0E, 0x03, 0x63, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, - 0x00, /* 0xDB */ - 0x1B, 0x00, 0x03, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x36, 0x0C, 0x3E, - 0x00, /* 0xDC */ - 0x03, 0x0C, 0x63, 0x60, 0x63, 0x0C, 0x30, 0xC1, 0x98, 0x1D, 0x80, 0xF0, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, - 0x60, /* 0xDD */ - 0xC0, 0x30, 0x0F, 0xF3, 0x06, 0xC0, 0xF0, 0x3C, 0x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 0x00, 0x1F, 0xF0, 0x00, 0x00, 0x00, 0x30, /* 0xF7 */ - 0x3D, 0x66, 0xC7, 0xCB, 0xCB, 0xD3, 0xD3, 0xE3, 0x66, 0xBC, /* 0xF8 */ - 0x60, 0x30, 0x18, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 0xF9 */ - 0x06, 0x0C, 0x18, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 0xFA */ - 0x3C, 0x66, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 0xFB */ - 0x66, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, /* 0xFC */ - 0x06, 0x04, 0x08, 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, /* 0xFD */ - 0xC0, 0x60, 0x30, 0x1B, 0xCE, 0x36, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x6D, 0xE6, 0x03, 0x01, 0x80, /* 0xFE */ - 0x33, 0x00, 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, /* 0xFF */ +/* 0x01 */ 0x07, 0x00, 0x0A, 0x00, 0x24, 0x00, 0x48, 0x01, 0x10, 0x04, 0x40, 0x10, 0xFF, 0x20, 0x02, 0x81, 0xFD, 0x00, 0x06, 0x07, 0xF4, 0x08, 0x24, 0x0F, 0x88, 0x11, 0x0F, 0xDC, 0x00, +/* 0x02 */ 0x3F, 0x70, 0x81, 0x11, 0x03, 0xE4, 0x08, 0x28, 0x1F, 0xD0, 0x00, 0x60, 0x7F, 0x20, 0x02, 0x43, 0xFC, 0x44, 0x00, 0x44, 0x00, 0x48, 0x00, 0x90, 0x00, 0xA0, 0x01, 0xC0, 0x00, +/* 0x03 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x00, 0x31, 0x8C, 0x63, 0x18, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x06, 0x20, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x04 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x82, 0x30, 0x88, 0x62, 0x08, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x06, 0x3F, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x05 */ 0x0B, 0x10, 0x14, 0xA8, 0x12, 0x50, 0x29, 0x42, 0x24, 0xA5, 0x32, 0x95, 0x5A, 0x09, 0x48, 0x09, 0x24, 0x01, 0x10, 0x01, 0x48, 0x02, 0xA4, 0x02, 0x42, 0x04, 0x01, 0x98, 0x00, 0x60, +/* 0x06 */ 0x00, 0x80, 0x22, 0x80, 0x65, 0x00, 0xBE, 0xE1, 0x82, 0x4E, 0x03, 0x24, 0x04, 0x28, 0x06, 0x30, 0x12, 0x20, 0x3C, 0xA0, 0xC3, 0xFE, 0x80, 0x4D, 0x00, 0xA6, 0x01, 0x80, 0x00, +/* 0x07 */ +/* 0x08 */ 0x00, 0xF8, 0x00, 0x82, 0x00, 0x80, 0x83, 0xE0, 0x41, 0x10, 0x21, 0x04, 0x1B, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xE0, 0x00, 0x4F, 0xE1, 0xC0, 0x0F, 0x02, 0x00, 0x03, 0x01, 0x00, 0x09, 0x88, 0x0C, 0x0C, +/* 0x09 */ 0x00, 0xF8, 0x00, 0x82, 0x00, 0x80, 0x83, 0xE0, 0x41, 0x10, 0x21, 0x04, 0x1B, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xE0, 0x00, 0x4F, 0xE1, 0xC0, 0x0F, 0x00, +/* 0x0A */ +/* 0x0B */ 0x1C, 0x1C, 0x31, 0xB1, 0x90, 0x50, 0x50, 0x10, 0x18, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x02, 0x80, 0x02, 0x40, 0x01, 0x10, 0x01, 0x04, 0x01, 0x01, 0x01, 0x00, 0x41, 0x00, 0x11, 0x00, 0x07, 0x00, 0x01, 0x00, +/* 0x0C */ 0x06, 0x00, 0x0A, 0x00, 0x12, 0x00, 0x32, 0x01, 0x84, 0x04, 0x10, 0x08, 0x98, 0x1C, 0x18, 0x40, 0x48, 0x82, 0x11, 0xF0, 0x74, 0x02, 0x18, 0x70, 0x2F, 0x9F, 0x80, +/* 0x0D */ +/* 0x0E */ 0x01, 0x00, 0x05, 0x00, 0x0A, 0x00, 0x3E, 0x00, 0x82, 0x02, 0x82, 0x06, 0x04, 0x10, 0x04, 0x20, 0x08, 0x40, 0x10, 0xFF, 0x22, 0x00, 0x29, 0xFF, 0x3F, 0x8F, 0xDF, 0x9F, 0x01, 0xC0, +/* 0x0F */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x82, 0x36, 0x03, 0x60, 0x00, 0xCC, 0x19, 0xA4, 0x4B, 0x00, 0x06, 0x8E, 0x2B, 0x22, 0x66, 0x7C, 0xCC, 0x71, 0x98, 0x03, 0x00, +/* 0x10 */ 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, 0x1E, 0x00, 0x54, 0x00, 0xA8, 0x01, 0x50, 0x02, 0xA0, 0x05, 0x20, 0x32, 0x61, 0xC4, 0x74, 0x49, 0x10, 0x6C, 0x00, 0xD8, 0x01, 0x10, 0x00, +/* 0x11 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x40, 0x29, 0x00, 0x31, 0x84, 0x63, 0x18, 0xC0, 0x00, 0x80, 0x15, 0x03, 0x7E, 0x02, 0xFA, 0x04, 0xE4, 0x18, 0x84, 0x00, 0x06, 0x0C, 0x03, 0xE0, +/* 0x12 */ 0x02, 0x08, 0x01, 0x08, 0x40, 0x10, 0xC0, 0x08, 0xC0, 0x60, 0x80, 0x28, 0x04, 0x12, 0x4C, 0x10, 0x80, 0x08, 0x23, 0x0E, 0x08, 0xC4, 0x82, 0x04, 0x20, 0x83, 0x09, 0x82, 0x47, 0x01, 0x1C, 0x01, 0x30, 0x00, 0xE0, 0x00, 0x00, +/* 0x13 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x00, 0x31, 0x08, 0x65, 0x28, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x06, 0x3F, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x14 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x22, 0x29, 0x83, 0x30, 0x00, 0x65, 0x14, 0xD3, 0x4D, 0xBA, 0xEB, 0x38, 0xE6, 0x00, 0x0A, 0x00, 0x24, 0x38, 0x44, 0x01, 0x07, 0x1C, 0x01, 0xC0, +/* 0x15 */ 0x07, 0xC0, 0x30, 0x18, 0x80, 0x32, 0x00, 0xF8, 0x01, 0xF1, 0x09, 0xA5, 0x28, 0x40, 0x01, 0x80, 0x03, 0x00, 0x06, 0x3F, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x16 */ 0x0C, 0x00, 0xC0, 0x1C, 0x03, 0x80, 0xF8, 0xBB, 0x36, 0xC7, 0x99, 0xF3, 0xFE, 0x3F, 0xC3, 0xF0, 0x7E, 0x0E, 0xC1, 0x8E, 0xE0, 0x20, +/* 0x17 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x00, 0x10, 0x01, 0x20, 0x1D, 0x44, 0x42, 0x84, 0x85, 0x00, 0x86, 0x00, 0xC4, 0x00, 0x44, 0x7C, 0x44, 0x00, 0x06, 0x0C, 0x03, 0xE0, +/* 0x18 */ 0x01, 0xE0, 0x00, 0x84, 0x00, 0x40, 0x80, 0x20, 0x10, 0x08, 0x24, 0x02, 0x41, 0x00, 0x86, 0x03, 0x12, 0x03, 0xB4, 0x03, 0x52, 0x81, 0x23, 0x80, 0x70, 0xA0, 0x14, 0x28, 0x05, 0x0A, 0x01, 0x42, 0x80, 0x50, +/* 0x19 */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x28, 0x00, 0x33, 0x18, 0x60, 0x00, 0xDC, 0xE1, 0xB9, 0xC3, 0x7B, 0xC6, 0x63, 0x0A, 0x00, 0x24, 0xF0, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x1A */ 0xFF, 0xFC, 0x00, 0x63, 0xE3, 0x31, 0x99, 0x04, 0xC8, 0x66, 0x06, 0x30, 0x61, 0x82, 0x0C, 0x10, 0x60, 0x03, 0x04, 0x18, 0x00, 0xFF, 0xFC, +/* 0x1B */ 0x07, 0xF0, 0x06, 0x0C, 0x04, 0x01, 0x04, 0x00, 0x44, 0x22, 0x12, 0x2A, 0x89, 0x00, 0x04, 0x80, 0x02, 0x44, 0x11, 0x01, 0xF0, 0x04, 0x01, 0x0D, 0x01, 0x6A, 0x41, 0x2C, 0x00, 0x05, 0xC0, 0x0E, 0x18, 0x18, +/* 0x1C */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0xC0, 0x2A, 0x00, 0x33, 0x00, 0x66, 0x00, 0xCC, 0x39, 0x80, 0x83, 0x00, 0x06, 0x00, 0x8C, 0x3E, 0x14, 0x00, 0x44, 0x01, 0x06, 0x0C, 0x03, 0xE0, +/* 0x1D */ 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x70, 0x28, 0x00, 0x31, 0x80, 0x63, 0x18, 0xC0, 0x31, 0x80, 0x03, 0x00, 0x06, 0x60, 0x0D, 0x33, 0x12, 0x10, 0x48, 0x21, 0x23, 0x8C, 0x00, +/* 0x1E */ 0x03, 0x00, 0x07, 0x9E, 0x07, 0x00, 0x86, 0x00, 0x27, 0xC0, 0x0F, 0xC0, 0x07, 0x8C, 0x62, 0x06, 0x31, 0x20, 0x00, 0x90, 0x00, 0x48, 0x00, 0x24, 0x3E, 0x11, 0x00, 0x10, 0x40, 0x10, 0x18, 0x30, 0x03, 0xE0, +/* 0x1F */ 0x18, 0x02, 0x80, 0x4C, 0x16, 0x41, 0x24, 0x3C, 0x88, 0x6E, 0x65, 0xF2, 0x78, 0x46, 0x88, 0xCF, 0x18, 0x02, 0x80, 0x8C, 0x60, 0x70, +/* ' ' 0x20 */ +/* '!' 0x21 */ 0xFF, 0xFF, 0xF0, 0xC0, +/* '"' 0x22 */ 0xDE, 0xF7, 0x20, +/* '#' 0x23 */ 0x09, 0x86, 0x41, 0x91, 0xFF, 0x13, 0x04, 0xC3, 0x20, 0xC8, 0xFF, 0x89, 0x82, 0x61, 0x90, +/* '$' 0x24 */ 0x10, 0x1F, 0x14, 0xDA, 0x3D, 0x1E, 0x83, 0x40, 0x78, 0x17, 0x08, 0xF4, 0x7A, 0x35, 0x33, 0xF0, 0x40, 0x20, +/* '%' 0x25 */ 0x38, 0x10, 0xEC, 0x20, 0xC6, 0x20, 0xC6, 0x40, 0xC6, 0x40, 0x6C, 0x80, 0x39, 0x00, 0x01, 0x3C, 0x02, 0x77, 0x02, 0x63, 0x04, 0x63, 0x04, 0x77, 0x08, 0x3C, +/* '&' 0x26 */ 0x0E, 0x0C, 0xC3, 0x30, 0xCC, 0x1E, 0x03, 0x03, 0xC1, 0x9B, 0xC2, 0xF0, 0xEC, 0x19, 0x8F, 0x3C, 0x40, +/* ''' 0x27 */ 0xFE, +/* '(' 0x28 */ 0x13, 0x26, 0x6C, 0xCC, 0xCC, 0xC4, 0x66, 0x23, 0x10, +/* ')' 0x29 */ 0x8C, 0x46, 0x63, 0x33, 0x33, 0x32, 0x66, 0x4C, 0x80, +/* '*' 0x2A */ 0x25, 0x7E, 0xA5, 0x00, +/* '+' 0x2B */ 0x30, 0xC3, 0x3F, 0x30, 0xC3, 0x0C, +/* ',' 0x2C */ 0xD6, +/* '-' 0x2D */ 0xF0, +/* '.' 0x2E */ 0xC0, +/* '/' 0x2F */ 0x08, 0x44, 0x21, 0x10, 0x84, 0x42, 0x11, 0x08, 0x00, +/* '0' 0x30 */ 0x3C, 0x66, 0x42, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x42, 0x66, 0x3C, +/* '1' 0x31 */ 0x11, 0x3F, 0x33, 0x33, 0x33, 0x33, 0x30, +/* '2' 0x32 */ 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x1C, 0x1C, 0x1C, 0x18, 0x18, 0x10, 0x08, 0x07, 0xF8, +/* '3' 0x33 */ 0x3C, 0x66, 0xC3, 0xC3, 0x03, 0x06, 0x1C, 0x07, 0x03, 0xC3, 0xC3, 0x66, 0x3C, +/* '4' 0x34 */ 0x0C, 0x18, 0x71, 0x62, 0xC9, 0xA3, 0x46, 0xFE, 0x18, 0x30, 0x60, 0xC0, +/* '5' 0x35 */ 0x7F, 0x20, 0x10, 0x08, 0x08, 0x07, 0xF3, 0x8C, 0x03, 0x01, 0x80, 0xF0, 0x6C, 0x63, 0xE0, +/* '6' 0x36 */ 0x1E, 0x31, 0x98, 0x78, 0x0C, 0x06, 0xF3, 0x8D, 0x83, 0xC1, 0xE0, 0xD0, 0x6C, 0x63, 0xE0, +/* '7' 0x37 */ 0xFF, 0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x18, 0x18, 0x18, 0x10, 0x30, 0x30, +/* '8' 0x38 */ 0x3E, 0x31, 0xB0, 0x78, 0x3C, 0x1B, 0x18, 0xF8, 0xC6, 0xC1, 0xE0, 0xF0, 0x6C, 0x63, 0xE0, +/* '9' 0x39 */ 0x3C, 0x66, 0xC2, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0xC2, 0x66, 0x3C, +/* ':' 0x3A */ 0xC0, 0x00, 0x30, +/* ';' 0x3B */ 0xC0, 0x00, 0x00, 0x64, 0xA0, +/* '<' 0x3C */ 0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x07, 0x80, 0x70, 0x0E, 0x01, 0x80, +/* '=' 0x3D */ 0xFF, 0x80, 0x00, 0x1F, 0xF0, +/* '>' 0x3E */ 0xE0, 0x1C, 0x03, 0x80, 0x30, 0x70, 0xE3, 0x81, 0x00, +/* '?' 0x3F */ 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x18, 0x38, 0x18, 0x18, 0x0C, 0x00, 0x00, 0x01, 0x80, +/* '@' 0x40 */ 0x03, 0xF0, 0x06, 0x0E, 0x06, 0x01, 0x86, 0x00, 0x66, 0x1D, 0xBB, 0x31, 0xCF, 0x18, 0xC7, 0x98, 0x63, 0xCC, 0x31, 0xE6, 0x11, 0xB3, 0x99, 0xCC, 0xF7, 0x86, 0x00, 0x01, 0x80, 0x00, 0x70, 0x40, 0x0F, 0xE0, +/* 'A' 0x41 */ 0x06, 0x00, 0xF0, 0x0F, 0x00, 0x90, 0x19, 0x81, 0x98, 0x10, 0x83, 0x0C, 0x3F, 0xC2, 0x04, 0x60, 0x66, 0x06, 0xC0, 0x30, +/* 'B' 0x42 */ 0xFF, 0x18, 0x33, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x3F, 0xC6, 0x06, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, +/* 'C' 0x43 */ 0x1F, 0x86, 0x19, 0x81, 0xA0, 0x3C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0x61, 0xF0, +/* 'D' 0x44 */ 0xFF, 0x18, 0x33, 0x03, 0x60, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x03, 0x60, 0xCF, 0xF0, +/* 'E' 0x45 */ 0xFF, 0xE0, 0x30, 0x18, 0x0C, 0x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0x00, 0x78, 0x03, 0xC0, 0x1B, 0x01, 0x98, 0x0C, 0x60, 0xC0, 0xF8, 0x00, +/* 'P' 0x50 */ 0xFF, 0x30, 0x6C, 0x0F, 0x03, 0xC0, 0xF0, 0x6F, 0xF3, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x00, +/* 'Q' 0x51 */ 0x0F, 0x81, 0x83, 0x18, 0x0C, 0xC0, 0x6C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1B, 0x01, 0x98, 0x6C, 0x60, 0xC0, 0xFB, 0x00, 0x08, +/* 'R' 0x52 */ 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x0C, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x06, 0xC0, 0x70, +/* 'S' 0x53 */ 0x3F, 0x18, 0x6C, 0x0F, 0x03, 0xC0, 0x1E, 0x01, 0xF0, 0x0E, 0x00, 0xF0, 0x3C, 0x0D, 0x86, 0x3F, 0x00, +/* 'T' 0x54 */ 0xFF, 0x86, 0x03, 0x01, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, +/* 'U' 0x55 */ 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xB0, 0x61, 0xF0, +/* 'V' 0x56 */ 0xC0, 0x6C, 0x0D, 0x81, 0x10, 0x63, 0x0C, 0x61, 0x04, 0x60, 0xCC, 0x19, 0x01, 0x60, 0x3C, 0x07, 0x00, 0x60, +/* 'W' 0x57 */ 0xC1, 0x81, 0x61, 0xC3, 0x61, 0xC3, 0x61, 0x43, 0x62, 0x62, 0x22, 0x66, 0x32, 0x26, 0x36, 0x26, 0x14, 0x34, 0x14, 0x34, 0x1C, 0x1C, 0x18, 0x1C, 0x08, 0x18, +/*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0x74 */ 0x66, 0xF6, 0x66, 0x66, 0x66, 0x67, +/* 'u' 0x75 */ 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, +/* 'v' 0x76 */ 0xC1, 0xA0, 0x98, 0xCC, 0x42, 0x21, 0xB0, 0xD0, 0x28, 0x1C, 0x0C, 0x00, +/* 'w' 0x77 */ 0xC6, 0x1E, 0x38, 0x91, 0xC4, 0xCA, 0x66, 0xD3, 0x16, 0xD0, 0xA6, 0x87, 0x1C, 0x38, 0xC0, 0xC6, 0x00, +/* 'x' 0x78 */ 0x87, 0x89, 0xB1, 0xC3, 0x07, 0x1E, 0x26, 0xC5, 0x0C, +/* 'y' 0x79 */ 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, +/* 'z' 0x7A */ 0xFE, 0x0C, 0x30, 0xC1, 0x86, 0x18, 0x20, 0xC1, 0xFC, +/* '{' 0x7B */ 0x36, 0x66, 0x66, 0x6E, 0xCE, 0x66, 0x66, 0x66, 0x30, +/* '|' 0x7C */ 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, +/* '}' 0x7D */ 0xC6, 0x66, 0x66, 0x67, 0x37, 0x66, 0x66, 0x66, 0xC0, +/* '~' 0x7E */ 0x61, 0x24, 0x38, +/* 0x7F */ +/* 0x80 */ 0x07, 0xC6, 0x13, 0x00, 0xC0, 0x60, 0x3F, 0xE6, 0x03, 0xFC, 0x60, 0x0C, 0x03, 0x00, 0x61, 0x07, 0xC0, +/* 0x81 */ +/* 0x82 */ 0xDC, +/* 0x83 */ 0x19, 0x8C, 0xF3, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0xE0, +/* 0x84 */ 0xDA, 0x76, +/* 0x85 */ 0xCC, 0xC0, +/* 0x86 */ 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, +/* 0x87 */ 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, +/* 0x88 */ 0x72, 0xA2, +/* 0x89 */ 0x70, 0x80, 0x22, 0x20, 0x08, 0x90, 0x02, 0x24, 0x00, 0x72, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x10, 0x00, 0x09, 0xC7, 0x84, 0x8B, 0x31, 0x22, 0x84, 0x88, 0xB3, 0x21, 0xC7, 0x80, +/* 0x8A */ 0x1B, 0x03, 0x80, 0x00, 0xFC, 0x61, 0xB0, 0x3C, 0x0F, 0x00, 0x78, 0x07, 0xC0, 0x38, 0x03, 0xC0, 0xF0, 0x36, 0x18, 0xFC, +/* 0x8B */ 0x69, +/* 0x8C */ 0x1E, 0xFE, 0x43, 0x81, 0x83, 0x06, 0x06, 0x0C, 0x0C, 0x18, 0x18, 0x30, 0x3F, 0xE0, 0x60, 0xC0, 0xC1, 0x81, 0x81, 0x83, 0x01, 0x8E, 0x01, 0xEF, 0xE0, +/* 0x8D */ +/* 0x8E */ 0x1B, 0x03, 0x80, 0x03, 0xFF, 0x01, 0x80, 0xC0, 0x30, 0x18, 0x0C, 0x07, 0x01, 0x80, 0xC0, 0x60, 0x18, 0x0C, 0x03, 0xFF, +/* 0x8F */ +/* 0x90 */ +/* 0x91 */ 0x6B, +/* 0x92 */ 0xD6, +/* 0x93 */ 0x4C, 0xA5, 0xB0, +/* 0x94 */ 0xDA, 0x53, 0x20, +/* 0x95 */ 0x6F, 0xFF, 0x60, +/* 0x96 */ 0xFE, +/* 0x97 */ 0xFF, 0xFF, +/* 0x98 */ 0x4D, 0xC0, +/* 0x99 */ 0xFC, 0xE1, 0xCC, 0x38, 0x73, 0x0E, 0x1C, 0xC3, 0x8F, 0x30, 0xD2, 0xCC, 0x34, 0xB3, 0x0D, 0x6C, 0xC3, 0x53, 0x30, 0x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x61, 0x01, 0x84, 0x06, 0x21, 0x80, 0x86, 0x04, 0x78, 0x32, 0x60, 0x87, 0xC4, 0x06, 0x10, 0x18, +/* 0xBD */ 0x20, 0x43, 0x81, 0x06, 0x08, 0x18, 0x20, 0x61, 0x01, 0x8D, 0xE6, 0x2C, 0xC1, 0x03, 0x0C, 0x0C, 0x20, 0x41, 0x86, 0x0C, 0x30, 0x20, 0xFC, +/* 0xBE */ 0x78, 0x11, 0x98, 0x40, 0x31, 0x00, 0x82, 0x00, 0xC8, 0x01, 0x90, 0x33, 0x43, 0x3D, 0x06, 0x02, 0x3C, 0x08, 0x98, 0x10, 0xF8, 0x40, 0x61, 0x00, 0xC0, +/* 0xBF */ 0x0C, 0x00, 0x00, 0x01, 0x80, 0xC0, 0xC0, 0xE0, 0xC0, 0xC0, 0x60, 0xF0, 0x6C, 0x63, 0xE0, +/* 0xC0 */ 0x18, 0x03, 0x00, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, +/* 0xC1 */ 0x06, 0x03, 0x00, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, +/* 0xC2 */ 0x0C, 0x04, 0x80, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, +/* 0xC3 */ 0x19, 0x09, 0x80, 0x00, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, +/* 0xC4 */ 0x33, 0x00, 0x00, 0xC0, 0x78, 0x1E, 0x04, 0x83, 0x30, 0xCC, 0x33, 0x1F, 0xE6, 0x19, 0x02, 0xC0, 0xF0, 0x30, +/* 0xC5 */ 0x0C, 0x04, 0x81, 0x20, 0x30, 0x1E, 0x07, 0x81, 0x20, 0xCC, 0x33, 0x0F, 0xC6, 0x19, 0x86, 0x40, 0xB0, 0x30, +/* 0xC6 */ 0x07, 0xFF, 0x04, 0xC0, 0x0C, 0xC0, 0x08, 0xC0, 0x18, 0xC0, 0x18, 0xC0, 0x30, 0xFF, 0x30, 0xC0, 0x3F, 0xC0, 0x60, 0xC0, 0x60, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, +/* 0xC7 */ 0x1F, 0x06, 0x19, 0x83, 0xA0, 0x3C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0xE1, 0xF0, 0x08, 0x01, 0xC0, 0x18, 0x0E, 0x00, +/* 0xC8 */ 0x18, 0x06, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, +/* 0xC9 */ 0x0C, 0x0C, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, +/* 0xCA */ 0x1C, 0x1B, 0x00, 0x1F, 0xFC, 0x06, 0x03, 0x01, 0x80, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, +/* 0xCB */ 0x33, 0x00, 0x3F, 0xF8, 0x0C, 0x06, 0x03, 0x01, 0xFE, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x07, 0xFC, +/* 0xCC */ 0xCC, 0x36, 0xDB, 0x6D, 0xB6, 0xD8, +/* 0xCD */ 0x78, 0x36, 0xDB, 0x6D, 0xB6, 0xC0, +/* 0xCE */ 0x76, 0xC0, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18, +/* 0xCF */ 0xCC, 0x03, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC0, +/* 0xD0 */ 0x7F, 0x0C, 0x31, 0x83, 0x30, 0x36, 0x06, 0xC0, 0xFE, 0x1B, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x30, 0xE7, 0xF0, +/* 0xD1 */ 0x19, 0x02, 0xC3, 0x81, 0xF0, 0x3F, 0x07, 0xA0, 0xF6, 0x1E, 0x63, 0xC4, 0x78, 0xCF, 0x0D, 0xE1, 0xBC, 0x1F, 0x81, 0xC0, +/* 0xD2 */ 0x0C, 0x00, 0x60, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, 0x0F, 0x00, +/* 0xD3 */ 0x03, 0x00, 0x60, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, 0x0F, 0x00, +/* 0xD4 */ 0x0F, 0x01, 0x98, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, 0x0F, 0x00, +/* 0xD5 */ 0x1C, 0x81, 0x38, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, 0x0F, 0x00, +/* 0xD6 */ 0x19, 0x81, 0x98, 0x00, 0x00, 0xF0, 0x39, 0xC6, 0x06, 0x60, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x60, 0x63, 0x9C, 0x0F, 0x00, +/* 0xD7 */ 0x83, 0x89, 0xA1, 0x83, 0x89, 0xA1, 0x80, +/* 0xD8 */ 0x0F, 0xD9, 0x83, 0x18, 0x1C, 0xC1, 0xEC, 0x19, 0xE0, 0x8F, 0x08, 0x78, 0x83, 0xC8, 0x1B, 0x81, 0x98, 0x0C, 0xE0, 0xC8, 0x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C7, 0x7B, +/* 0xFC */ 0x66, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, +/* 0xFD */ 0x06, 0x04, 0x08, 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, +/* 0xFE */ 0xC0, 0x60, 0x30, 0x1B, 0xCE, 0x36, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x6D, 0xE6, 0x03, 0x01, 0x80, +/* 0xFF */ 0x33, 0x00, 0xC1, 0x43, 0x63, 0x62, 0x26, 0x36, 0x34, 0x1C, 0x1C, 0x18, 0x18, 0x18, 0x10, 0x60, }; const GFXglyph FreeSans9pt_Win1252Glyphs[] PROGMEM = { - /* ' ' 0x20 */ {0, 0, 0, 5, 0, 0}, - /* '!' 0x21 */ {0, 2, 13, 6, 2, -12}, - /* '"' 0x22 */ {4, 5, 4, 6, 1, -12}, - /* '#' 0x23 */ {7, 10, 12, 10, 0, -11}, - /* '$' 0x24 */ {22, 9, 16, 10, 1, -13}, - /* '%' 0x25 */ {40, 16, 13, 16, 1, -12}, - /* '&' 0x26 */ {66, 10, 13, 12, 1, -12}, - /* ''' 0x27 */ {83, 2, 4, 4, 1, -12}, - /* '(' 0x28 */ {84, 4, 17, 6, 1, -12}, - /* ')' 0x29 */ {93, 4, 17, 6, 1, -12}, - /* '*' 0x2A */ {102, 5, 5, 7, 1, -12}, - /* '+' 0x2B */ {106, 6, 8, 11, 3, -7}, - /* ',' 0x2C */ {112, 2, 4, 5, 2, 0}, - /* '-' 0x2D */ {113, 4, 1, 6, 1, -4}, - /* '.' 0x2E */ {114, 2, 1, 5, 1, 0}, - /* '/' 0x2F */ {115, 5, 13, 5, 0, -12}, - /* '0' 0x30 */ {124, 8, 13, 10, 1, -12}, - /* '1' 0x31 */ {137, 4, 13, 10, 3, -12}, - /* '2' 0x32 */ {144, 9, 13, 10, 1, -12}, - /* '3' 0x33 */ {159, 8, 13, 10, 1, -12}, - /* '4' 0x34 */ {172, 7, 13, 10, 2, -12}, - /* '5' 0x35 */ {184, 9, 13, 10, 1, -12}, - /* '6' 0x36 */ {199, 9, 13, 10, 1, -12}, - /* '7' 0x37 */ {214, 8, 13, 10, 0, -12}, - /* '8' 0x38 */ {227, 9, 13, 10, 1, -12}, - /* '9' 0x39 */ {242, 8, 13, 10, 1, -12}, - /* ':' 0x3A */ {255, 2, 10, 5, 1, -9}, - /* ';' 0x3B */ {258, 3, 12, 5, 1, -8}, - /* '<' 0x3C */ {263, 9, 9, 11, 1, -8}, - /* '=' 0x3D */ {274, 9, 4, 11, 1, -5}, - /* '>' 0x3E */ {279, 9, 8, 11, 1, -7}, - /* '?' 0x3F */ {288, 9, 13, 10, 1, -12}, - /* '@' 0x40 */ {303, 17, 16, 18, 1, -12}, - /* 'A' 0x41 */ {337, 12, 13, 12, 0, -12}, - /* 'B' 0x42 */ {357, 11, 13, 12, 1, -12}, - /* 'C' 0x43 */ {375, 11, 13, 13, 1, -12}, - /* 'D' 0x44 */ {393, 11, 13, 13, 1, -12}, - /* 'E' 0x45 */ {411, 9, 13, 11, 1, -12}, - /* 'F' 0x46 */ {426, 8, 13, 11, 1, -12}, - /* 'G' 0x47 */ {439, 12, 13, 14, 1, -12}, - /* 'H' 0x48 */ {459, 11, 13, 13, 1, -12}, - /* 'I' 0x49 */ {477, 2, 13, 5, 2, -12}, - /* 'J' 0x4A */ {481, 7, 13, 10, 1, -12}, - /* 'K' 0x4B */ {493, 10, 13, 12, 1, -12}, - /* 'L' 0x4C */ {510, 8, 13, 10, 1, -12}, - /* 'M' 0x4D */ {523, 13, 13, 15, 1, -12}, - /* 'N' 0x4E */ {545, 11, 13, 13, 1, -12}, - /* 'O' 0x4F */ {563, 13, 13, 14, 1, -12}, - /* 'P' 0x50 */ {585, 10, 13, 12, 1, -12}, - /* 'Q' 0x51 */ {602, 13, 14, 14, 1, -12}, - /* 'R' 0x52 */ {625, 12, 13, 13, 1, -12}, - /* 'S' 0x53 */ {645, 10, 13, 12, 1, -12}, - /* 'T' 0x54 */ {662, 9, 13, 11, 1, -12}, - /* 'U' 0x55 */ {677, 11, 13, 13, 1, -12}, - /* 'V' 0x56 */ {695, 11, 13, 11, 0, -12}, - /* 'W' 0x57 */ {713, 16, 13, 17, 0, -12}, - /* 'X' 0x58 */ {739, 10, 13, 12, 1, -12}, - /* 'Y' 0x59 */ {756, 12, 13, 12, 0, -12}, - /* 'Z' 0x5A */ {776, 10, 13, 11, 1, -12}, - /* '[' 0x5B */ {793, 3, 17, 5, 1, -12}, - /* '\' 0x5C */ {800, 5, 13, 5, 0, -12}, - /* ']' 0x5D */ {809, 3, 17, 5, 0, -12}, - /* '^' 0x5E */ {816, 7, 7, 8, 1, -12}, - /* '_' 0x5F */ {823, 10, 1, 10, 0, 3}, - /* '`' 0x60 */ {825, 4, 3, 5, 0, -12}, - /* 'a' 0x61 */ {827, 9, 10, 10, 1, -9}, - /* 'b' 0x62 */ {839, 9, 13, 10, 1, -12}, - /* 'c' 0x63 */ {854, 8, 10, 9, 1, -9}, - /* 'd' 0x64 */ {864, 8, 13, 10, 1, -12}, - /* 'e' 0x65 */ {877, 8, 10, 10, 1, -9}, - /* 'f' 0x66 */ {887, 4, 13, 5, 1, -12}, - /* 'g' 0x67 */ {894, 8, 14, 10, 1, -9}, - /* 'h' 0x68 */ {908, 8, 13, 10, 1, -12}, - /* 'i' 0x69 */ {921, 2, 13, 4, 1, -12}, - /* 'j' 0x6A */ {925, 4, 17, 4, 0, -12}, - /* 'k' 0x6B */ {934, 8, 13, 9, 1, -12}, - /* 'l' 0x6C */ {947, 2, 13, 4, 1, -12}, - /* 'm' 0x6D */ {951, 13, 10, 15, 1, -9}, - /* 'n' 0x6E */ {968, 8, 10, 10, 1, -9}, - /* 'o' 0x6F */ {978, 8, 10, 10, 1, -9}, - /* 'p' 0x70 */ {988, 9, 13, 10, 1, -9}, - /* 'q' 0x71 */ {1003, 8, 13, 10, 1, -9}, - /* 'r' 0x72 */ {1016, 5, 10, 6, 1, -9}, - /* 's' 0x73 */ {1023, 8, 10, 9, 1, -9}, - /* 't' 0x74 */ {1033, 4, 12, 5, 1, -11}, - /* 'u' 0x75 */ {1039, 8, 10, 10, 1, -9}, - /* 'v' 0x76 */ {1049, 9, 10, 9, 0, -9}, - /* 'w' 0x77 */ {1061, 13, 10, 13, 0, -9}, - /* 'x' 0x78 */ {1078, 7, 10, 9, 1, -9}, - /* 'y' 0x79 */ {1087, 8, 14, 9, 0, -9}, - /* 'z' 0x7A */ {1101, 7, 10, 9, 1, -9}, - /* '{' 0x7B */ {1110, 4, 17, 6, 1, -12}, - /* '|' 0x7C */ {1119, 2, 17, 4, 2, -12}, - /* '}' 0x7D */ {1124, 4, 17, 6, 1, -12}, - /* '~' 0x7E */ {1133, 7, 3, 9, 1, -7}, - /* 0x7F */ {1136, 13, 14, 15, 1, -12}, - /* 0x80 */ {1159, 10, 13, 12, 1, -12}, - /* 0x81 */ {1176, 0, 0, 8, 0, 0}, - /* 0x82 */ {1176, 2, 3, 5, 1, 0}, - /* 0x83 */ {1177, 5, 17, 5, 0, -12}, - /* 0x84 */ {1188, 5, 3, 7, 1, 0}, - /* 0x85 */ {1190, 10, 1, 12, 1, 0}, - /* 0x86 */ {1192, 8, 16, 10, 1, -12}, - /* 0x87 */ {1208, 8, 16, 10, 1, -12}, - /* 0x88 */ {1224, 5, 3, 6, 0, -12}, - /* 0x89 */ {1226, 18, 13, 18, 0, -12}, - /* 0x8A */ {1256, 10, 16, 12, 1, -15}, - /* 0x8B */ {1276, 2, 4, 4, 1, -6}, - /* 0x8C */ {1277, 15, 13, 18, 1, -12}, - /* 0x8D */ {1302, 0, 0, 8, 0, 0}, - /* 0x8E */ {1302, 10, 16, 11, 1, -15}, - /* 0x8F */ {1322, 0, 0, 8, 0, 0}, - /* 0x90 */ {1322, 0, 0, 8, 0, 0}, - /* 0x91 */ {1322, 2, 4, 4, 2, -12}, - /* 0x92 */ {1323, 2, 4, 4, 1, -12}, - /* 0x93 */ {1324, 5, 4, 7, 2, -12}, - /* 0x94 */ {1327, 5, 4, 7, 1, -12}, - /* 0x95 */ {1330, 4, 5, 7, 1, -8}, - /* 0x96 */ {1333, 7, 1, 9, 1, -4}, - /* 0x97 */ {1334, 16, 1, 18, 1, -4}, - /* 0x98 */ {1336, 5, 2, 6, 0, -12}, - /* 0x99 */ {1338, 18, 10, 18, 1, -13}, - /* 0x9A */ {1361, 8, 13, 9, 1, -12}, - /* 0x9B */ {1374, 2, 4, 5, 2, -6}, - /* 0x9C */ {1375, 15, 10, 17, 1, -9}, - /* 0x9D */ {1394, 0, 0, 8, 0, 0}, - /* 0x9E */ {1394, 7, 13, 9, 1, -12}, - /* 0x9F */ {1406, 12, 14, 12, 0, -13}, - /* 0xA0 */ {1427, 0, 0, 5, 0, 0}, - /* 0xA1 */ {1427, 2, 13, 6, 2, -8}, - /* 0xA2 */ {1431, 9, 14, 10, 1, -11}, - /* 0xA3 */ {1447, 10, 13, 10, 0, -12}, - /* 0xA4 */ {1464, 7, 6, 10, 2, -8}, - /* 0xA5 */ {1470, 8, 13, 10, 1, -12}, - /* 0xA6 */ {1483, 2, 17, 5, 2, -12}, - /* 0xA7 */ {1488, 9, 17, 10, 1, -12}, - /* 0xA8 */ {1508, 6, 1, 6, 0, -11}, - /* 0xA9 */ {1509, 14, 13, 14, 1, -12}, - /* 0xAA */ {1532, 5, 8, 7, 1, -12}, - /* 0xAB */ {1537, 7, 6, 9, 1, -7}, - /* 0xAC */ {1543, 9, 5, 11, 2, -5}, - /* 0xAD */ {1549, 0, 0, 0, 0, 0}, - /* 0xAE */ {1549, 14, 13, 14, 1, -12}, - /* 0xAF */ {1572, 5, 1, 6, 0, -12}, - /* 0xB0 */ {1573, 5, 5, 11, 3, -11}, - /* 0xB1 */ {1577, 9, 11, 11, 1, -10}, - /* 0xB2 */ {1590, 6, 8, 6, 1, -13}, - /* 0xB3 */ {1596, 7, 8, 6, 0, -13}, - /* 0xB4 */ {1603, 4, 3, 6, 2, -12}, - /* 0xB5 */ {1605, 9, 13, 10, 1, -9}, - /* 0xB6 */ {1620, 8, 16, 10, 2, -12}, - /* 0xB7 */ {1636, 3, 1, 5, 1, -4}, - /* 0xB8 */ {1637, 5, 4, 6, 1, 1}, - /* 0xB9 */ {1640, 3, 7, 6, 2, -13}, - /* 0xBA */ {1643, 5, 8, 7, 1, -12}, - /* 0xBB */ {1648, 7, 6, 9, 1, -7}, - /* 0xBC */ {1654, 14, 13, 16, 2, -12}, - /* 0xBD */ {1677, 14, 13, 16, 2, -12}, - /* 0xBE */ {1700, 15, 13, 16, 1, -12}, - /* 0xBF */ {1725, 9, 13, 10, 1, -8}, - /* 0xC0 */ {1740, 10, 14, 12, 1, -13}, - /* 0xC1 */ {1758, 10, 14, 12, 1, -13}, - /* 0xC2 */ {1776, 10, 14, 12, 1, -13}, - /* 0xC3 */ {1794, 10, 14, 12, 1, -13}, - /* 0xC4 */ {1812, 10, 14, 12, 1, -13}, - /* 0xC5 */ {1830, 10, 14, 12, 1, -13}, - /* 0xC6 */ {1848, 16, 13, 18, 1, -12}, - /* 0xC7 */ {1874, 11, 17, 13, 1, -12}, - /* 0xC8 */ {1898, 9, 14, 11, 1, -13}, - /* 0xC9 */ {1914, 9, 14, 11, 1, -13}, - /* 0xCA */ {1930, 9, 14, 11, 1, -13}, - /* 0xCB */ {1946, 9, 14, 11, 1, -13}, - /* 0xCC */ {1962, 3, 15, 5, 1, -13}, - /* 0xCD */ {1968, 3, 14, 5, 1, -13}, - /* 0xCE */ {1974, 5, 14, 5, 0, -13}, - /* 0xCF */ {1983, 6, 14, 5, 0, -13}, - /* 0xD0 */ {1994, 11, 13, 13, 1, -12}, - /* 0xD1 */ {2012, 11, 14, 13, 1, -13}, - /* 0xD2 */ {2032, 12, 15, 13, 1, -14}, - /* 0xD3 */ {2055, 12, 15, 13, 1, -14}, - /* 0xD4 */ {2078, 12, 15, 13, 1, -14}, - /* 0xD5 */ {2101, 12, 15, 13, 1, -14}, - /* 0xD6 */ {2124, 12, 15, 13, 1, -14}, - /* 0xD7 */ {2147, 7, 7, 11, 2, -7}, - /* 0xD8 */ {2154, 13, 13, 14, 1, -12}, - /* 0xD9 */ {2176, 11, 14, 13, 1, -13}, - /* 0xDA */ {2196, 11, 14, 13, 1, -13}, - /* 0xDB */ {2216, 11, 14, 13, 1, -13}, - /* 0xDC */ {2236, 11, 14, 13, 1, -13}, - /* 0xDD */ {2256, 12, 14, 12, 0, -13}, - /* 0xDE */ {2277, 10, 13, 12, 1, -12}, - /* 0xDF */ {2294, 9, 13, 11, 1, -12}, - /* 0xE0 */ {2309, 9, 13, 10, 1, -12}, - /* 0xE1 */ {2324, 9, 13, 10, 1, -12}, - /* 0xE2 */ {2339, 9, 13, 10, 1, -12}, - /* 0xE3 */ {2354, 9, 13, 10, 1, -12}, - /* 0xE4 */ {2369, 9, 12, 10, 1, -11}, - /* 0xE5 */ {2383, 9, 14, 10, 1, -13}, - /* 0xE6 */ {2399, 15, 10, 16, 1, -9}, - /* 0xE7 */ {2418, 8, 14, 9, 1, -9}, - /* 0xE8 */ {2432, 8, 13, 10, 1, -12}, - /* 0xE9 */ {2445, 8, 13, 10, 1, -12}, - /* 0xEA */ {2458, 8, 13, 10, 1, -12}, - /* 0xEB */ {2471, 8, 12, 10, 1, -11}, - /* 0xEC */ {2483, 3, 13, 4, 0, -12}, - /* 0xED */ {2488, 3, 13, 4, 1, -12}, - /* 0xEE */ {2493, 4, 13, 5, 0, -12}, - /* 0xEF */ {2500, 6, 12, 5, -1, -11}, - /* 0xF0 */ {2509, 8, 13, 10, 1, -12}, - /* 0xF1 */ {2522, 8, 13, 10, 1, -12}, - /* 0xF2 */ {2535, 8, 13, 10, 1, -12}, - /* 0xF3 */ {2548, 8, 13, 10, 1, -12}, - /* 0xF4 */ {2561, 8, 13, 10, 1, -12}, - /* 0xF5 */ {2574, 8, 13, 10, 1, -12}, - /* 0xF6 */ {2587, 8, 12, 10, 1, -11}, - /* 0xF7 */ {2599, 9, 8, 11, 1, -7}, - /* 0xF8 */ {2608, 8, 10, 10, 1, -9}, - /* 0xF9 */ {2618, 8, 13, 10, 1, -12}, - /* 0xFA */ {2631, 8, 13, 10, 1, -12}, - /* 0xFB */ {2644, 8, 13, 10, 1, -12}, - /* 0xFC */ {2657, 8, 12, 10, 1, -11}, - /* 0xFD */ {2669, 8, 17, 9, 0, -12}, - /* 0xFE */ {2686, 9, 16, 10, 1, -12}, - /* 0xFF */ {2704, 8, 16, 9, 0, -11}, +/* 0x01 */ { 0, 15, 15, 17, 1, -13 }, +/* 0x02 */ { 29, 15, 15, 17, 1, -13 }, +/* 0x03 */ { 58, 15, 16, 17, 1, -14 }, +/* 0x04 */ { 88, 15, 16, 17, 1, -14 }, +/* 0x05 */ { 118, 16, 15, 18, 1, -13 }, +/* 0x06 */ { 148, 15, 15, 17, 1, -13 }, +/* 0x07 */ { 177, 0, 0, 8, 0, 0 }, +/* 0x08 */ { 177, 17, 16, 19, 1, -14 }, +/* 0x09 */ { 211, 17, 12, 19, 1, -12 }, +/* 0x0A */ { 237, 0, 0, 8, 0, 0 }, +/* 0x0B */ { 237, 17, 16, 19, 1, -14 }, +/* 0x0C */ { 271, 15, 14, 17, 1, -12 }, +/* 0x0D */ { 298, 0, 0, 8, 0, 0 }, +/* 0x0E */ { 298, 15, 16, 17, 1, -14 }, +/* 0x0F */ { 328, 15, 15, 17, 1, -13 }, +/* 0x10 */ { 357, 15, 15, 17, 1, -13 }, +/* 0x11 */ { 386, 15, 16, 17, 1, -14 }, +/* 0x12 */ { 416, 17, 17, 19, 1, -15 }, +/* 0x13 */ { 453, 15, 16, 17, 1, -14 }, +/* 0x14 */ { 483, 15, 16, 17, 1, -14 }, +/* 0x15 */ { 513, 15, 16, 17, 1, -14 }, +/* 0x16 */ { 543, 11, 16, 13, 1, -14 }, +/* 0x17 */ { 565, 15, 16, 17, 1, -14 }, +/* 0x18 */ { 595, 18, 15, 20, 1, -13 }, +/* 0x19 */ { 629, 15, 16, 17, 1, -14 }, +/* 0x1A */ { 659, 13, 14, 15, 1, -12 }, +/* 0x1B */ { 682, 17, 16, 19, 1, -14 }, +/* 0x1C */ { 716, 15, 16, 17, 1, -14 }, +/* 0x1D */ { 746, 15, 15, 17, 1, -13 }, +/* 0x1E */ { 775, 17, 16, 19, 1, -14 }, +/* 0x1F */ { 809, 11, 16, 13, 1, -14 }, +/* ' ' 0x20 */ { 831, 0, 0, 5, 0, 0 }, +/* '!' 0x21 */ { 831, 2, 13, 6, 2, -12 }, +/* '"' 0x22 */ { 835, 5, 4, 6, 1, -12 }, +/* '#' 0x23 */ { 838, 10, 12, 10, 0, -11 }, +/* '$' 0x24 */ { 853, 9, 16, 10, 1, -13 }, +/* '%' 0x25 */ { 871, 16, 13, 16, 1, -12 }, +/* '&' 0x26 */ { 897, 10, 13, 12, 1, -12 }, +/* ''' 0x27 */ { 914, 2, 4, 4, 1, -12 }, +/* '(' 0x28 */ { 915, 4, 17, 6, 1, -12 }, +/* ')' 0x29 */ { 924, 4, 17, 6, 1, -12 }, +/* '*' 0x2A */ { 933, 5, 5, 7, 1, -12 }, +/* '+' 0x2B */ { 937, 6, 8, 11, 3, -7 }, +/* ',' 0x2C */ { 943, 2, 4, 5, 2, 0 }, +/* '-' 0x2D */ { 944, 4, 1, 6, 1, -4 }, +/* '.' 0x2E */ { 945, 2, 1, 5, 1, 0 }, +/* '/' 0x2F */ { 946, 5, 13, 5, 0, -12 }, +/* '0' 0x30 */ { 955, 8, 13, 10, 1, -12 }, +/* '1' 0x31 */ { 968, 4, 13, 10, 3, -12 }, +/* '2' 0x32 */ { 975, 9, 13, 10, 1, -12 }, +/* '3' 0x33 */ { 990, 8, 13, 10, 1, -12 }, +/* '4' 0x34 */ { 1003, 7, 13, 10, 2, -12 }, +/* '5' 0x35 */ { 1015, 9, 13, 10, 1, -12 }, +/* '6' 0x36 */ { 1030, 9, 13, 10, 1, -12 }, +/* '7' 0x37 */ { 1045, 8, 13, 10, 0, -12 }, +/* '8' 0x38 */ { 1058, 9, 13, 10, 1, -12 }, +/* '9' 0x39 */ { 1073, 8, 13, 10, 1, -12 }, +/* ':' 0x3A */ { 1086, 2, 10, 5, 1, -9 }, +/* ';' 0x3B */ { 1089, 3, 12, 5, 1, -8 }, +/* '<' 0x3C */ { 1094, 9, 9, 11, 1, -8 }, +/* '=' 0x3D */ { 1105, 9, 4, 11, 1, -5 }, +/* '>' 0x3E */ { 1110, 9, 8, 11, 1, -7 }, +/* '?' 0x3F */ { 1119, 9, 13, 10, 1, -12 }, +/* '@' 0x40 */ { 1134, 17, 16, 18, 1, -12 }, +/* 'A' 0x41 */ { 1168, 12, 13, 12, 0, -12 }, +/* 'B' 0x42 */ { 1188, 11, 13, 12, 1, -12 }, +/* 'C' 0x43 */ { 1206, 11, 13, 13, 1, -12 }, +/* 'D' 0x44 */ { 1224, 11, 13, 13, 1, -12 }, +/* 'E' 0x45 */ { 1242, 9, 13, 11, 1, -12 }, +/* 'F' 0x46 */ { 1257, 8, 13, 11, 1, -12 }, +/* 'G' 0x47 */ { 1270, 12, 13, 14, 1, -12 }, +/* 'H' 0x48 */ { 1290, 11, 13, 13, 1, -12 }, +/* 'I' 0x49 */ { 1308, 2, 13, 5, 2, -12 }, +/* 'J' 0x4A */ { 1312, 7, 13, 10, 1, -12 }, +/* 'K' 0x4B */ { 1324, 10, 13, 12, 1, -12 }, +/* 'L' 0x4C */ { 1341, 8, 13, 10, 1, -12 }, +/* 'M' 0x4D */ { 1354, 13, 13, 15, 1, -12 }, +/* 'N' 0x4E */ { 1376, 11, 13, 13, 1, -12 }, +/* 'O' 0x4F */ { 1394, 13, 13, 14, 1, -12 }, +/* 'P' 0x50 */ { 1416, 10, 13, 12, 1, -12 }, +/* 'Q' 0x51 */ { 1433, 13, 14, 14, 1, -12 }, +/* 'R' 0x52 */ { 1456, 12, 13, 13, 1, -12 }, +/* 'S' 0x53 */ { 1476, 10, 13, 12, 1, -12 }, +/* 'T' 0x54 */ { 1493, 9, 13, 11, 1, -12 }, +/* 'U' 0x55 */ { 1508, 11, 13, 13, 1, -12 }, +/* 'V' 0x56 */ { 1526, 11, 13, 11, 0, -12 }, +/* 'W' 0x57 */ { 1544, 16, 13, 17, 0, -12 }, +/* 'X' 0x58 */ { 1570, 10, 13, 12, 1, -12 }, +/* 'Y' 0x59 */ { 1587, 12, 13, 12, 0, -12 }, +/* 'Z' 0x5A */ { 1607, 10, 13, 11, 1, -12 }, +/* '[' 0x5B */ { 1624, 3, 17, 5, 1, -12 }, +/* '\' 0x5C */ { 1631, 5, 13, 5, 0, -12 }, +/* ']' 0x5D */ { 1640, 3, 17, 5, 0, -12 }, +/* '^' 0x5E */ { 1647, 7, 7, 8, 1, -12 }, +/* '_' 0x5F */ { 1654, 10, 1, 10, 0, 3 }, +/* '`' 0x60 */ { 1656, 4, 3, 5, 0, -12 }, +/* 'a' 0x61 */ { 1658, 9, 10, 10, 1, -9 }, +/* 'b' 0x62 */ { 1670, 9, 13, 10, 1, -12 }, +/* 'c' 0x63 */ { 1685, 8, 10, 9, 1, -9 }, +/* 'd' 0x64 */ { 1695, 8, 13, 10, 1, -12 }, +/* 'e' 0x65 */ { 1708, 8, 10, 10, 1, -9 }, +/* 'f' 0x66 */ { 1718, 4, 13, 5, 1, -12 }, +/* 'g' 0x67 */ { 1725, 8, 14, 10, 1, -9 }, +/* 'h' 0x68 */ { 1739, 8, 13, 10, 1, -12 }, +/* 'i' 0x69 */ { 1752, 2, 13, 4, 1, -12 }, +/* 'j' 0x6A */ { 1756, 4, 17, 4, 0, -12 }, +/* 'k' 0x6B */ { 1765, 8, 13, 9, 1, -12 }, +/* 'l' 0x6C */ { 1778, 2, 13, 4, 1, -12 }, +/* 'm' 0x6D */ { 1782, 13, 10, 15, 1, -9 }, +/* 'n' 0x6E */ { 1799, 8, 10, 10, 1, -9 }, +/* 'o' 0x6F */ { 1809, 8, 10, 10, 1, -9 }, +/* 'p' 0x70 */ { 1819, 9, 13, 10, 1, -9 }, +/* 'q' 0x71 */ { 1834, 8, 13, 10, 1, -9 }, +/* 'r' 0x72 */ { 1847, 5, 10, 6, 1, -9 }, +/* 's' 0x73 */ { 1854, 8, 10, 9, 1, -9 }, +/* 't' 0x74 */ { 1864, 4, 12, 5, 1, -11 }, +/* 'u' 0x75 */ { 1870, 8, 10, 10, 1, -9 }, +/* 'v' 0x76 */ { 1880, 9, 10, 9, 0, -9 }, +/* 'w' 0x77 */ { 1892, 13, 10, 13, 0, -9 }, +/* 'x' 0x78 */ { 1909, 7, 10, 9, 1, -9 }, +/* 'y' 0x79 */ { 1918, 8, 14, 9, 0, -9 }, +/* 'z' 0x7A */ { 1932, 7, 10, 9, 1, -9 }, +/* '{' 0x7B */ { 1941, 4, 17, 6, 1, -12 }, +/* '|' 0x7C */ { 1950, 2, 17, 4, 2, -12 }, +/* '}' 0x7D */ { 1955, 4, 17, 6, 1, -12 }, +/* '~' 0x7E */ { 1964, 7, 3, 9, 1, -7 }, +/* 0x7F */ { 1967, 0, 0, 0, 0, 0 }, +/* 0x80 */ { 1967, 10, 13, 12, 1, -12 }, +/* 0x81 */ { 1984, 0, 0, 8, 0, 0 }, +/* 0x82 */ { 1984, 2, 3, 5, 1, 0 }, +/* 0x83 */ { 1985, 5, 17, 5, 0, -12 }, +/* 0x84 */ { 1996, 5, 3, 7, 1, 0 }, +/* 0x85 */ { 1998, 10, 1, 12, 1, 0 }, +/* 0x86 */ { 2000, 8, 16, 10, 1, -12 }, +/* 0x87 */ { 2016, 8, 16, 10, 1, -12 }, +/* 0x88 */ { 2032, 5, 3, 6, 0, -12 }, +/* 0x89 */ { 2034, 18, 13, 18, 0, -12 }, +/* 0x8A */ { 2064, 10, 16, 12, 1, -15 }, +/* 0x8B */ { 2084, 2, 4, 4, 1, -6 }, +/* 0x8C */ { 2085, 15, 13, 18, 1, -12 }, +/* 0x8D */ { 2110, 0, 0, 8, 0, 0 }, +/* 0x8E */ { 2110, 10, 16, 11, 1, -15 }, +/* 0x8F */ { 2130, 0, 0, 8, 0, 0 }, +/* 0x90 */ { 2130, 0, 0, 8, 0, 0 }, +/* 0x91 */ { 2130, 2, 4, 4, 2, -12 }, +/* 0x92 */ { 2131, 2, 4, 4, 1, -12 }, +/* 0x93 */ { 2132, 5, 4, 7, 2, -12 }, +/* 0x94 */ { 2135, 5, 4, 7, 1, -12 }, +/* 0x95 */ { 2138, 4, 5, 7, 1, -8 }, +/* 0x96 */ { 2141, 7, 1, 9, 1, -4 }, +/* 0x97 */ { 2142, 16, 1, 18, 1, -4 }, +/* 0x98 */ { 2144, 5, 2, 6, 0, -12 }, +/* 0x99 */ { 2146, 18, 10, 18, 1, -13 }, +/* 0x9A */ { 2169, 8, 13, 9, 1, -12 }, +/* 0x9B */ { 2182, 2, 4, 5, 2, -6 }, +/* 0x9C */ { 2183, 15, 10, 17, 1, -9 }, +/* 0x9D */ { 2202, 0, 0, 8, 0, 0 }, +/* 0x9E */ { 2202, 7, 13, 9, 1, -12 }, +/* 0x9F */ { 2214, 12, 14, 12, 0, -13 }, +/* 0xA0 */ { 2235, 0, 0, 5, 0, 0 }, +/* 0xA1 */ { 2235, 2, 13, 6, 2, -8 }, +/* 0xA2 */ { 2239, 9, 14, 10, 1, -11 }, +/* 0xA3 */ { 2255, 10, 13, 10, 0, -12 }, +/* 0xA4 */ { 2272, 7, 6, 10, 2, -8 }, +/* 0xA5 */ { 2278, 8, 13, 10, 1, -12 }, +/* 0xA6 */ { 2291, 2, 17, 5, 2, -12 }, +/* 0xA7 */ { 2296, 9, 17, 10, 1, -12 }, +/* 0xA8 */ { 2316, 6, 1, 6, 0, -11 }, +/* 0xA9 */ { 2317, 14, 13, 14, 1, -12 }, +/* 0xAA */ { 2340, 5, 8, 7, 1, -12 }, +/* 0xAB */ { 2345, 7, 6, 9, 1, -7 }, +/* 0xAC */ { 2351, 9, 5, 11, 2, -5 }, +/* 0xAD */ { 2357, 0, 0, 0, 0, 0 }, +/* 0xAE */ { 2357, 14, 13, 14, 1, -12 }, +/* 0xAF */ { 2380, 5, 1, 6, 0, -12 }, +/* 0xB0 */ { 2381, 5, 5, 11, 3, -11 }, +/* 0xB1 */ { 2385, 9, 11, 11, 1, -10 }, +/* 0xB2 */ { 2398, 6, 8, 6, 1, -13 }, +/* 0xB3 */ { 2404, 7, 8, 6, 0, -13 }, +/* 0xB4 */ { 2411, 4, 3, 6, 2, -12 }, +/* 0xB5 */ { 2413, 9, 13, 10, 1, -9 }, +/* 0xB6 */ { 2428, 8, 16, 10, 2, -12 }, +/* 0xB7 */ { 2444, 3, 1, 5, 1, -4 }, +/* 0xB8 */ { 2445, 5, 4, 6, 1, 1 }, +/* 0xB9 */ { 2448, 3, 7, 6, 2, -13 }, +/* 0xBA */ { 2451, 5, 8, 7, 1, -12 }, +/* 0xBB */ { 2456, 7, 6, 9, 1, -7 }, +/* 0xBC */ { 2462, 14, 13, 16, 2, -12 }, +/* 0xBD */ { 2485, 14, 13, 16, 2, -12 }, +/* 0xBE */ { 2508, 15, 13, 16, 1, -12 }, +/* 0xBF */ { 2533, 9, 13, 10, 1, -8 }, +/* 0xC0 */ { 2548, 10, 14, 12, 1, -13 }, +/* 0xC1 */ { 2566, 10, 14, 12, 1, -13 }, +/* 0xC2 */ { 2584, 10, 14, 12, 1, -13 }, +/* 0xC3 */ { 2602, 10, 14, 12, 1, -13 }, +/* 0xC4 */ { 2620, 10, 14, 12, 1, -13 }, +/* 0xC5 */ { 2638, 10, 14, 12, 1, -13 }, +/* 0xC6 */ { 2656, 16, 13, 18, 1, -12 }, +/* 0xC7 */ { 2682, 11, 17, 13, 1, -12 }, +/* 0xC8 */ { 2706, 9, 14, 11, 1, -13 }, +/* 0xC9 */ { 2722, 9, 14, 11, 1, -13 }, +/* 0xCA */ { 2738, 9, 14, 11, 1, -13 }, +/* 0xCB */ { 2754, 9, 14, 11, 1, -13 }, +/* 0xCC */ { 2770, 3, 15, 5, 1, -13 }, +/* 0xCD */ { 2776, 3, 14, 5, 1, -13 }, +/* 0xCE */ { 2782, 5, 14, 5, 0, -13 }, +/* 0xCF */ { 2791, 6, 14, 5, 0, -13 }, +/* 0xD0 */ { 2802, 11, 13, 13, 1, -12 }, +/* 0xD1 */ { 2820, 11, 14, 13, 1, -13 }, +/* 0xD2 */ { 2840, 12, 15, 13, 1, -14 }, +/* 0xD3 */ { 2863, 12, 15, 13, 1, -14 }, +/* 0xD4 */ { 2886, 12, 15, 13, 1, -14 }, +/* 0xD5 */ { 2909, 12, 15, 13, 1, -14 }, +/* 0xD6 */ { 2932, 12, 15, 13, 1, -14 }, +/* 0xD7 */ { 2955, 7, 7, 11, 2, -7 }, +/* 0xD8 */ { 2962, 13, 13, 14, 1, -12 }, +/* 0xD9 */ { 2984, 11, 14, 13, 1, -13 }, +/* 0xDA */ { 3004, 11, 14, 13, 1, -13 }, +/* 0xDB */ { 3024, 11, 14, 13, 1, -13 }, +/* 0xDC */ { 3044, 11, 14, 13, 1, -13 }, +/* 0xDD */ { 3064, 12, 14, 12, 0, -13 }, +/* 0xDE */ { 3085, 10, 13, 12, 1, -12 }, +/* 0xDF */ { 3102, 9, 13, 11, 1, -12 }, +/* 0xE0 */ { 3117, 9, 13, 10, 1, -12 }, +/* 0xE1 */ { 3132, 9, 13, 10, 1, -12 }, +/* 0xE2 */ { 3147, 9, 13, 10, 1, -12 }, +/* 0xE3 */ { 3162, 9, 13, 10, 1, -12 }, +/* 0xE4 */ { 3177, 9, 12, 10, 1, -11 }, +/* 0xE5 */ { 3191, 9, 14, 10, 1, -13 }, +/* 0xE6 */ { 3207, 15, 10, 16, 1, -9 }, +/* 0xE7 */ { 3226, 8, 14, 9, 1, -9 }, +/* 0xE8 */ { 3240, 8, 13, 10, 1, -12 }, +/* 0xE9 */ { 3253, 8, 13, 10, 1, -12 }, +/* 0xEA */ { 3266, 8, 13, 10, 1, -12 }, +/* 0xEB */ { 3279, 8, 12, 10, 1, -11 }, +/* 0xEC */ { 3291, 3, 13, 4, 0, -12 }, +/* 0xED */ { 3296, 3, 13, 4, 1, -12 }, +/* 0xEE */ { 3301, 4, 13, 5, 0, -12 }, +/* 0xEF */ { 3308, 6, 12, 5, -1, -11 }, +/* 0xF0 */ { 3317, 8, 13, 10, 1, -12 }, +/* 0xF1 */ { 3330, 8, 13, 10, 1, -12 }, +/* 0xF2 */ { 3343, 8, 13, 10, 1, -12 }, +/* 0xF3 */ { 3356, 8, 13, 10, 1, -12 }, +/* 0xF4 */ { 3369, 8, 13, 10, 1, -12 }, +/* 0xF5 */ { 3382, 8, 13, 10, 1, -12 }, +/* 0xF6 */ { 3395, 8, 12, 10, 1, -11 }, +/* 0xF7 */ { 3407, 9, 8, 11, 1, -7 }, +/* 0xF8 */ { 3416, 8, 10, 10, 1, -9 }, +/* 0xF9 */ { 3426, 8, 13, 10, 1, -12 }, +/* 0xFA */ { 3439, 8, 13, 10, 1, -12 }, +/* 0xFB */ { 3452, 8, 13, 10, 1, -12 }, +/* 0xFC */ { 3465, 8, 12, 10, 1, -11 }, +/* 0xFD */ { 3477, 8, 17, 9, 0, -12 }, +/* 0xFE */ { 3494, 9, 16, 10, 1, -12 }, +/* 0xFF */ { 3512, 8, 16, 9, 0, -11 }, }; -const GFXfont FreeSans9pt_Win1252 PROGMEM = {(uint8_t *)FreeSans9pt_Win1252Bitmaps, (GFXglyph *)FreeSans9pt_Win1252Glyphs, 0x20, - 0xFF, 21}; +const GFXfont FreeSans9pt_Win1252 PROGMEM = { +(uint8_t*)FreeSans9pt_Win1252Bitmaps, +(GFXglyph*)FreeSans9pt_Win1252Glyphs, +0x01, 0xFF, 16 +}; diff --git a/src/graphics/niche/InkHUD/Applet.cpp b/src/graphics/niche/InkHUD/Applet.cpp index f63bd4bbe..362a50d16 100644 --- a/src/graphics/niche/InkHUD/Applet.cpp +++ b/src/graphics/niche/InkHUD/Applet.cpp @@ -353,10 +353,9 @@ std::string InkHUD::Applet::parseShortName(meshtastic_NodeInfoLite *node) // Determine if all characters of a string are printable using the current font bool InkHUD::Applet::isPrintable(std::string text) { - // Scan for DEL (0x7F), which is the value assigned by AppletFont::applyEncoding if a unicode character is not handled - // Todo: move this to from DEL to SUB, once the fonts have been changed for this + // Scan for SUB (0x1A), which is the value assigned by AppletFont::applyEncoding if a unicode character is not handled for (char &c : text) { - if (c == '\x7F') + if (c == '\x1A') return false; } diff --git a/src/graphics/niche/InkHUD/AppletFont.cpp b/src/graphics/niche/InkHUD/AppletFont.cpp index 88fb4054b..db7097f3f 100644 --- a/src/graphics/niche/InkHUD/AppletFont.cpp +++ b/src/graphics/niche/InkHUD/AppletFont.cpp @@ -616,9 +616,116 @@ char InkHUD::AppletFont::applyEncoding(std::string utf8) } } - // If not handled, return DEL - // Todo: swap this to SUB, and modify the fonts - return '\x7F'; + else /*ASCII or Unhandled*/ { + if (utf8.length() == 1) + return utf8.at(0); + } + + // All single-byte (ASCII) characters should have been handled by now + // Only unhandled multi-byte UTF8 characters should remain + assert(utf8.length() > 1); + + // Parse emoji + // Strip emoji modifiers + switch (toUtf32(utf8)) { + REMAP(0x1F44D, 0x01) // 👍 Thumbs Up + REMAP(0x1F44E, 0x02) // 👎 Thumbs Down + + REMAP(0x1F60A, 0x03) // 😊 Smiling Face with Smiling Eyes + REMAP(0x1F642, 0x03) // 🙂 Slightly Smiling Face + REMAP(0x1F601, 0x03) // 😁 Grinning Face with Smiling Eye + + REMAP(0x1F602, 0x04) // 😂 Face with Tears of Joy + REMAP(0x1F923, 0x04) // 🤣 Rolling on the Floor Laughing + REMAP(0x1F606, 0x04) // 😆 Smiling with Open Mouth and Closed Eyes + + REMAP(0x1F44B, 0x05) // 👋 Waving Hand + + REMAP(0x02600, 0x06) // ☀ Sun + REMAP(0x1F31E, 0x06) // 🌞 Sun with Face + + // 0x07 - Bell character (unused) + REMAP(0x1F327, 0x08) // 🌧️ Cloud with Rain + + REMAP(0x02601, 0x09) // ☁️ Cloud + REMAP(0x1F32B, 0x09) // Fog + + REMAP(0x1F9E1, 0x0B) // 🧡 Orange Heart + REMAP(0x02763, 0x0B) // ❣ Heart Exclamation + REMAP(0x02764, 0x0B) // ❤ Heart + REMAP(0x1F495, 0x0B) // 💕 Two Hearts + REMAP(0x1F496, 0x0B) // 💖 Sparkling Heart + REMAP(0x1F497, 0x0B) // 💗 Growing Heart + REMAP(0x1F498, 0x0B) // 💘 Heart with Arrow + + REMAP(0x1F4A9, 0x0C) // 💩 Pile of Poo + // 0x0D - Carriage return (unused) + REMAP(0x1F514, 0x0E) // 🔔 Bell + + REMAP(0x1F62D, 0x0F) // 😭 Loudly Crying Face + REMAP(0x1F622, 0x0F) // 😢 Crying Face + + REMAP(0x1F64F, 0x10) // 🙏 Person with Folded Hands + REMAP(0x1F618, 0x11) // 😘 Face Throwing a Kiss + REMAP(0x1F389, 0x12) // 🎉 Party Popper + + REMAP(0x1F600, 0x13) // 😀 Grinning Face + REMAP(0x1F603, 0x13) // 😃 Smiling Face with Open Mouth + REMAP(0x1F604, 0x13) // 😄 Smiling Face with Open Mouth and Smiling Eyes + + REMAP(0x1F97A, 0x14) // 🥺 Face with Pleading Eyes + REMAP(0x1F605, 0x15) // 😅 Smiling with Sweat + REMAP(0x1F525, 0x16) // 🔥 Fire + REMAP(0x1F926, 0x17) // 🤦 Face Palm + REMAP(0x1F937, 0x18) // 🤷 Shrug + REMAP(0x1F644, 0x19) // 🙄 Face with Rolling Eyes + // 0x1A Substitution (unused) + REMAP(0x1F917, 0x1B) // 🤗 Hugging Face + + REMAP(0x1F609, 0x1C) // 😉 Winking Face + REMAP(0x1F61C, 0x1C) // 😜 Face with Stuck-Out Tongue and Winking Eye + REMAP(0x1F60F, 0x1C) // 😏 Smirking Face + + REMAP(0x1F914, 0x1D) // 🤔 Thinking Face + REMAP(0x1FAE1, 0x1E) // 🫡 Saluting Face + REMAP(0x1F44C, 0x1F) // 👌 OK Hand Sign + + REMAP(0x02755, '!') // ❕ + REMAP(0x02757, '!') // ❗ + REMAP(0x0203C, '!') // ‼ + REMAP(0x02753, '?') // ❓ + REMAP(0x02754, '?') // ❔ + REMAP(0x02049, '?') // ⁉ + + // Modifiers (deleted) + REMAP(0x02640, 0x7F) // Gender + REMAP(0x02642, 0x7F) + REMAP(0x1F3FB, 0x7F) // Skin Tones + REMAP(0x1F3FC, 0x7F) + REMAP(0x1F3FD, 0x7F) + REMAP(0x1F3FE, 0x7F) + REMAP(0x1F3FF, 0x7F) + REMAP(0x0FE00, 0x7F) // Variation Selectors + REMAP(0x0FE01, 0x7F) + REMAP(0x0FE02, 0x7F) + REMAP(0x0FE03, 0x7F) + REMAP(0x0FE04, 0x7F) + REMAP(0x0FE05, 0x7F) + REMAP(0x0FE06, 0x7F) + REMAP(0x0FE07, 0x7F) + REMAP(0x0FE08, 0x7F) + REMAP(0x0FE09, 0x7F) + REMAP(0x0FE0A, 0x7F) + REMAP(0x0FE0B, 0x7F) + REMAP(0x0FE0C, 0x7F) + REMAP(0x0FE0D, 0x7F) + REMAP(0x0FE0E, 0x7F) + REMAP(0x0FE0F, 0x7F) + REMAP(0x0200D, 0x7F) // Zero Width Joiner + } + + // If not handled, return SUB + return '\x1A'; // Sweep up the syntactic sugar // Don't want ants in the house diff --git a/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp index fa85deab3..d9a3bd2dd 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp @@ -14,9 +14,10 @@ InkHUD::LogoApplet::LogoApplet() : concurrency::OSThread("LogoApplet") // During onboarding, show the default short name as well as the version string // This behavior assists manufacturers during mass production, and should not be modified without good reason if (!settings->tips.safeShutdownSeen) { + meshtastic_NodeInfoLite *ourNode = nodeDB->getMeshNode(nodeDB->getNodeNum()); fontTitle = fontLarge; textLeft = xstr(APP_VERSION_SHORT); - textRight = owner.short_name; + textRight = parseShortName(ourNode); textTitle = "Meshtastic"; } else { fontTitle = fontSmall; diff --git a/src/graphics/niche/InkHUD/docs/README.md b/src/graphics/niche/InkHUD/docs/README.md index b504d46c1..c30d25845 100644 --- a/src/graphics/niche/InkHUD/docs/README.md +++ b/src/graphics/niche/InkHUD/docs/README.md @@ -1,6 +1,6 @@ # InkHUD -This document is intended as a reference for maintainers. A haphazard collection of notes which _might_ be helpful. +A haphazard collection of notes which _might_ be helpful for developers. self deprecating meme @@ -109,7 +109,7 @@ The display image does not update "automatically". Individual applets are respon (animated diagram) -animated process diagram of InkHUD rendering +animated process diagram of InkHUD rendering An overview: @@ -338,6 +338,8 @@ std::string parsed = parse(greeting); This will re-encode the characters to match whichever extended-ASCII font InkHUD has been built with. +A limited set of emoji have been [wedged into unused code points within the font](#emoji). + ### Localization InkHUD is bundled with extended-ASCII fonts for: @@ -734,3 +736,36 @@ Some fonts may have a handful of especially tall characters, especially extended // -2 px of padding above, +1 px of padding below InkHUD::AppletFont(FreeSans9pt7b, ASCII, -2, 1); ``` + +#### Emoji + +AdafruitGFX fonts are limited to 255 characters. InkHUD supports a restricted set of emoji, which are stored in the unused code points of the ASCII control characters (`'\x01'`, `'\x02'`, etc). + +Standard AdafruitGFX fonts contain no glyphs below `'\x20'`, so will ignore these attempts to parse emoji. + +This mapping of emoji to control characters is fairly arbitrary. Selection was influenced by [PR #3940 Oled screen emojis](https://github.com/meshtastic/firmware/pull/3940) and [Emoji Frequency Spreadsheet](https://docs.google.com/spreadsheets/d/1Zs13WJYdZL1pNZP0dCIXkWau_tZOjK3mmJz0KNq4I30/). + +| Code Point | Emoji | +| ---------- | ---------------------------------------------- | +| ~~`0x00`~~ | (null term, unused) | +| `0x01` | 👍 | +| `0x02` | 👎 | +| `0x03` | 🙂 | +| `0x04` | 😆 | +| `0x05` | 👋 | +| `0x06` | ☀ | +| ~~`0x07`~~ | (bell char, unused) | +| `0x08` | 🌧 | +| `0x09` | ☁ | +| ~~`0x0A`~~ | (line feed, unused) | +| `0x0B` | ♥ | +| `0x0C` | 💩 | +| ~~`0x0D`~~ | (carriage return, unused) | +| `0x0E` | 🔔 | +| `0x0F` | 😭 | +| `0x1A` | (substitution "⍰", used for unprintable chars) | +| `0x1B` | 🤗 | +| `0x1C` | 😉 | +| `0x1D` | 😏 | +| `0x1E` | 🫡 (saluting face) | +| `0x1F` | 👌 | From a7528d777ab1a2fab6c60e5344ffd5066d4ba3c2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 20:20:22 -0500 Subject: [PATCH 372/461] [create-pull-request] automated change (#7193) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- .../generated/meshtastic/device_ui.pb.cpp | 2 ++ src/mesh/generated/meshtastic/device_ui.pb.h | 36 ++++++++++++++++--- src/mesh/generated/meshtastic/mesh.pb.h | 6 ++++ src/mesh/generated/meshtastic/portnums.pb.h | 4 +++ 5 files changed, 45 insertions(+), 5 deletions(-) diff --git a/protobufs b/protobufs index 386fa53c1..86c738e80 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 386fa53c1596c8dfc547521f08df107f4cb3a275 +Subproject commit 86c738e8061ec09625ee52bc61ba862414384ce6 diff --git a/src/mesh/generated/meshtastic/device_ui.pb.cpp b/src/mesh/generated/meshtastic/device_ui.pb.cpp index 4bb3cc66c..2fc8d9461 100644 --- a/src/mesh/generated/meshtastic/device_ui.pb.cpp +++ b/src/mesh/generated/meshtastic/device_ui.pb.cpp @@ -26,3 +26,5 @@ PB_BIND(meshtastic_Map, meshtastic_Map, AUTO) + + diff --git a/src/mesh/generated/meshtastic/device_ui.pb.h b/src/mesh/generated/meshtastic/device_ui.pb.h index 3a8ddd3a4..8313438f8 100644 --- a/src/mesh/generated/meshtastic/device_ui.pb.h +++ b/src/mesh/generated/meshtastic/device_ui.pb.h @@ -10,6 +10,15 @@ #endif /* Enum definitions */ +typedef enum _meshtastic_CompassMode { + /* Compass with dynamic ring and heading */ + meshtastic_CompassMode_DYNAMIC = 0, + /* Compass with fixed ring and heading */ + meshtastic_CompassMode_FIXED_RING = 1, + /* Compass with heading and freeze option */ + meshtastic_CompassMode_FREEZE_HEADING = 2 +} meshtastic_CompassMode; + typedef enum _meshtastic_Theme { /* Dark */ meshtastic_Theme_DARK = 0, @@ -144,6 +153,14 @@ typedef struct _meshtastic_DeviceUIConfig { /* Map related data */ bool has_map_data; meshtastic_Map map_data; + /* Compass mode */ + meshtastic_CompassMode compass_mode; + /* RGB color for BaseUI + 0xRRGGBB format, e.g. 0xFF0000 for red */ + uint32_t screen_rgb_color; + /* Clockface analog style + true for analog clockface, false for digital clockface */ + bool is_clockface_analog; } meshtastic_DeviceUIConfig; @@ -152,6 +169,10 @@ extern "C" { #endif /* Helper constants for enums */ +#define _meshtastic_CompassMode_MIN meshtastic_CompassMode_DYNAMIC +#define _meshtastic_CompassMode_MAX meshtastic_CompassMode_FREEZE_HEADING +#define _meshtastic_CompassMode_ARRAYSIZE ((meshtastic_CompassMode)(meshtastic_CompassMode_FREEZE_HEADING+1)) + #define _meshtastic_Theme_MIN meshtastic_Theme_DARK #define _meshtastic_Theme_MAX meshtastic_Theme_RED #define _meshtastic_Theme_ARRAYSIZE ((meshtastic_Theme)(meshtastic_Theme_RED+1)) @@ -162,6 +183,7 @@ extern "C" { #define meshtastic_DeviceUIConfig_theme_ENUMTYPE meshtastic_Theme #define meshtastic_DeviceUIConfig_language_ENUMTYPE meshtastic_Language +#define meshtastic_DeviceUIConfig_compass_mode_ENUMTYPE meshtastic_CompassMode @@ -169,12 +191,12 @@ extern "C" { /* Initializer values for message structs */ -#define meshtastic_DeviceUIConfig_init_default {0, 0, 0, 0, 0, 0, _meshtastic_Theme_MIN, 0, 0, 0, _meshtastic_Language_MIN, false, meshtastic_NodeFilter_init_default, false, meshtastic_NodeHighlight_init_default, {0, {0}}, false, meshtastic_Map_init_default} +#define meshtastic_DeviceUIConfig_init_default {0, 0, 0, 0, 0, 0, _meshtastic_Theme_MIN, 0, 0, 0, _meshtastic_Language_MIN, false, meshtastic_NodeFilter_init_default, false, meshtastic_NodeHighlight_init_default, {0, {0}}, false, meshtastic_Map_init_default, _meshtastic_CompassMode_MIN, 0, 0} #define meshtastic_NodeFilter_init_default {0, 0, 0, 0, 0, "", 0} #define meshtastic_NodeHighlight_init_default {0, 0, 0, 0, ""} #define meshtastic_GeoPoint_init_default {0, 0, 0} #define meshtastic_Map_init_default {false, meshtastic_GeoPoint_init_default, "", 0} -#define meshtastic_DeviceUIConfig_init_zero {0, 0, 0, 0, 0, 0, _meshtastic_Theme_MIN, 0, 0, 0, _meshtastic_Language_MIN, false, meshtastic_NodeFilter_init_zero, false, meshtastic_NodeHighlight_init_zero, {0, {0}}, false, meshtastic_Map_init_zero} +#define meshtastic_DeviceUIConfig_init_zero {0, 0, 0, 0, 0, 0, _meshtastic_Theme_MIN, 0, 0, 0, _meshtastic_Language_MIN, false, meshtastic_NodeFilter_init_zero, false, meshtastic_NodeHighlight_init_zero, {0, {0}}, false, meshtastic_Map_init_zero, _meshtastic_CompassMode_MIN, 0, 0} #define meshtastic_NodeFilter_init_zero {0, 0, 0, 0, 0, "", 0} #define meshtastic_NodeHighlight_init_zero {0, 0, 0, 0, ""} #define meshtastic_GeoPoint_init_zero {0, 0, 0} @@ -214,6 +236,9 @@ extern "C" { #define meshtastic_DeviceUIConfig_node_highlight_tag 13 #define meshtastic_DeviceUIConfig_calibration_data_tag 14 #define meshtastic_DeviceUIConfig_map_data_tag 15 +#define meshtastic_DeviceUIConfig_compass_mode_tag 16 +#define meshtastic_DeviceUIConfig_screen_rgb_color_tag 17 +#define meshtastic_DeviceUIConfig_is_clockface_analog_tag 18 /* Struct field encoding specification for nanopb */ #define meshtastic_DeviceUIConfig_FIELDLIST(X, a) \ @@ -231,7 +256,10 @@ X(a, STATIC, SINGULAR, UENUM, language, 11) \ X(a, STATIC, OPTIONAL, MESSAGE, node_filter, 12) \ X(a, STATIC, OPTIONAL, MESSAGE, node_highlight, 13) \ X(a, STATIC, SINGULAR, BYTES, calibration_data, 14) \ -X(a, STATIC, OPTIONAL, MESSAGE, map_data, 15) +X(a, STATIC, OPTIONAL, MESSAGE, map_data, 15) \ +X(a, STATIC, SINGULAR, UENUM, compass_mode, 16) \ +X(a, STATIC, SINGULAR, UINT32, screen_rgb_color, 17) \ +X(a, STATIC, SINGULAR, BOOL, is_clockface_analog, 18) #define meshtastic_DeviceUIConfig_CALLBACK NULL #define meshtastic_DeviceUIConfig_DEFAULT NULL #define meshtastic_DeviceUIConfig_node_filter_MSGTYPE meshtastic_NodeFilter @@ -288,7 +316,7 @@ extern const pb_msgdesc_t meshtastic_Map_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_DEVICE_UI_PB_H_MAX_SIZE meshtastic_DeviceUIConfig_size -#define meshtastic_DeviceUIConfig_size 188 +#define meshtastic_DeviceUIConfig_size 201 #define meshtastic_GeoPoint_size 33 #define meshtastic_Map_size 58 #define meshtastic_NodeFilter_size 47 diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index b07c59625..9e0415198 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -267,6 +267,12 @@ typedef enum _meshtastic_HardwareModel { /* * GAT562 Mesh Trial Tracker */ meshtastic_HardwareModel_GAT562_MESH_TRIAL_TRACKER = 104, + /* * + RAKwireless WisMesh Tag */ + meshtastic_HardwareModel_WISMESH_TAG = 105, + /* * + RAKwireless WisBlock Core RAK3312 https://docs.rakwireless.com/product-categories/wisduo/rak3112-module/overview/ */ + meshtastic_HardwareModel_RAK3312 = 106, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ diff --git a/src/mesh/generated/meshtastic/portnums.pb.h b/src/mesh/generated/meshtastic/portnums.pb.h index 5bd27ef7d..67adc60cc 100644 --- a/src/mesh/generated/meshtastic/portnums.pb.h +++ b/src/mesh/generated/meshtastic/portnums.pb.h @@ -133,6 +133,10 @@ typedef enum _meshtastic_PortNum { /* Reticulum Network Stack Tunnel App ENCODING: Fragmented RNS Packet. Handled by Meshtastic RNS interface */ meshtastic_PortNum_RETICULUM_TUNNEL_APP = 76, + /* App for transporting Cayenne Low Power Payload, popular for LoRaWAN sensor nodes. Offers ability to send + arbitrary telemetry over meshtastic that is not covered by telemetry.proto + ENCODING: CayenneLLP */ + meshtastic_PortNum_CAYENNE_APP = 77, /* Private applications should use portnums >= 256. To simplify initial development and testing you can use "PRIVATE_APP" in your code without needing to rebuild protobuf files (via [regen-protos.sh](https://github.com/meshtastic/firmware/blob/master/bin/regen-protos.sh)) */ From cc961d7762f8134746ac5a8400ea5cabccc9cf30 Mon Sep 17 00:00:00 2001 From: dylanli Date: Wed, 2 Jul 2025 11:39:51 +0800 Subject: [PATCH 373/461] update seeed device battery level map (#7194) --- src/power.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/power.h b/src/power.h index e7193dd07..70f075b7c 100644 --- a/src/power.h +++ b/src/power.h @@ -30,6 +30,10 @@ #define OCV_ARRAY 4300, 4240, 4120, 4000, 3888, 3800, 3740, 3698, 3655, 3580, 3400 #elif defined(HELTEC_MESH_POCKET_BATTERY_10000) #define OCV_ARRAY 4100, 4060, 3960, 3840, 3729, 3625, 3550, 3500, 3420, 3345, 3100 +#elif defined(SEEED_WIO_TRACKER_L1) +#define OCV_ARRAY 4200, 3876, 3826, 3763, 3713, 3660, 3573, 3485, 3422, 3359, 3300 +#elif defined(SEEED_SOLAR_NODE) +#define OCV_ARRAY 4200, 3986, 3922, 3812, 3734, 3645, 3527, 3420, 3281, 3087, 2786 #else // LiIon #define OCV_ARRAY 4190, 4050, 3990, 3890, 3800, 3720, 3630, 3530, 3420, 3300, 3100 #endif From 30eec01f559ec0d87cde3fbe912d8942555b1397 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski <68911033+jankowski-t@users.noreply.github.com> Date: Wed, 2 Jul 2025 05:41:56 +0200 Subject: [PATCH 374/461] Fix hydra radio (#7192) Added missing defines to variant.h --- variants/diy/hydra/variant.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/variants/diy/hydra/variant.h b/variants/diy/hydra/variant.h index 4c809502e..0d64c1b5e 100644 --- a/variants/diy/hydra/variant.h +++ b/variants/diy/hydra/variant.h @@ -36,8 +36,12 @@ #define SX126X_TXEN 13 // Schematic connects EBYTE module's TXEN pin to MCU #define SX126X_RXEN 14 // Schematic connects EBYTE module's RXEN pin to MCU -#define LORA_CS SX126X_CS // Compatibility with variant file configuration structure -#define LORA_SCK SX126X_SCK // Compatibility with variant file configuration structure -#define LORA_MOSI SX126X_MOSI // Compatibility with variant file configuration structure -#define LORA_MISO SX126X_MISO // Compatibility with variant file configuration structure -#define LORA_DIO1 SX126X_DIO1 // Compatibility with variant file configuration structure +#define LORA_CS SX126X_CS // Compatibility with variant file configuration structure +#define LORA_SCK SX126X_SCK // Compatibility with variant file configuration structure +#define LORA_MOSI SX126X_MOSI // Compatibility with variant file configuration structure +#define LORA_MISO SX126X_MISO // Compatibility with variant file configuration structure +#define LORA_DIO1 SX126X_DIO1 // Compatibility with variant file configuration structure +#define LORA_TXEN SX126X_TXEN // Compatibility with variant file configuration structure +#define LORA_RXEN SX126X_RXEN // Compatibility with variant file configuration structure +#define LORA_RESET SX126X_RESET // Compatibility with variant file configuration structure +#define LORA_DIO2 SX126X_BUSY // Compatibility with variant file configuration structure \ No newline at end of file From 53013e9a7e8a24306717d48f224125ed85e1fd92 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 18:34:51 +1000 Subject: [PATCH 375/461] Upgrade trunk (#7151) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index dc065d041..2ddebdf1d 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,15 +8,15 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.446 - - renovate@41.10.0 - - prettier@3.6.1 + - checkov@3.2.447 + - renovate@41.17.2 + - prettier@3.6.2 - trufflehog@3.89.2 - yamllint@1.37.1 - bandit@1.8.5 - - trivy@0.63.0 + - trivy@0.64.0 - taplo@0.9.3 - - ruff@0.12.0 + - ruff@0.12.1 - isort@6.0.1 - markdownlint@0.45.0 - oxipng@9.1.5 From aadea892027cab956e72be74d23b8cc9dc3925ed Mon Sep 17 00:00:00 2001 From: dylanli Date: Wed, 2 Jul 2025 18:49:47 +0800 Subject: [PATCH 376/461] fix bug of cant't switch between two applets side-by-side (#7195) --- variants/seeed_wio_tracker_L1_eink/nicheGraphics.h | 1 - 1 file changed, 1 deletion(-) diff --git a/variants/seeed_wio_tracker_L1_eink/nicheGraphics.h b/variants/seeed_wio_tracker_L1_eink/nicheGraphics.h index 7854de4b5..12ec4479a 100644 --- a/variants/seeed_wio_tracker_L1_eink/nicheGraphics.h +++ b/variants/seeed_wio_tracker_L1_eink/nicheGraphics.h @@ -66,7 +66,6 @@ void setupNicheGraphics() inkhud->persistence->settings.optionalFeatures.batteryIcon = true; // Device definitely has a battery inkhud->persistence->settings.optionalMenuItems.backlight = true; // Until proves capacitive button works by touching it inkhud->persistence->settings.userTiles.count = 1; // One tile only by default, keep things simple for new users - inkhud->persistence->settings.optionalMenuItems.nextTile = false; // Behavior handled by aux button instead // Setup backlight controller // Note: AUX button attached further down From 17f8303e01bb6b56315c5372ef00701f0f387585 Mon Sep 17 00:00:00 2001 From: Mictronics Date: Wed, 2 Jul 2025 12:59:43 +0200 Subject: [PATCH 377/461] Fix build when MESHTASTIC_EXCLUDE_GPS is defined (#7154) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28 * Merge PR #420 * Fixed double and missing Default class. * Use correct format specifier and fixed typo. * Removed duplicate code. * Fix error: #if with no expression * Fix warning: extra tokens at end of #endif directive. * Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board. * Fix deprecated macros. * Set RP2040 in dormant mode when deep sleep is triggered. * Fix array out of bounds read. * Admin key count needs to be set otherwise the key will be zero loaded after reset. * Don't reset the admin key size when loading defaults. Preserve an existing key in config if possible. * Remove log spam when reading INA voltage sensor. * Remove static declaration for admin keys from userPrefs.h. Load hard coded admin keys in case config file has empty slots. * Removed newlines from log. * Fix issue #5665. * Fix build for Pico2 RP2350 platform. * Enable Wifi client on Pico2W. * Use correct processor on Pico2. * Fix deprecated warning. * Update platform and framework for RP2350. * Added Pico2W variant including Wifi support. * Fix typo in used variant. * Remove obsolete define. * Fix for native Linux build. * Simplify RP2350 platform tag reference. Co-authored-by: Austin * Cast user prefs strings. * Update to last successfully building platform package. * Define I2C GPIOs to ensure usage of both ports. Possibly fixes #5361 * RAK11310 support for RAK12002 RTC added. * Update platform and framework packages to 4.4.3. * Use RP2040 base platform and framework package. Use RAK11300 board definition in arduino-pico framework. * Use RAK11300 board definition in arduino-pico framework. * Fix build when MESHTASTIC_EXCLUDE_GPS is defined. --------- Co-authored-by: Ben Meadors Co-authored-by: Thomas Göttgens Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Co-authored-by: Austin Co-authored-by: Tom Fifield --- src/graphics/draw/MenuHandler.cpp | 8 ++++++++ src/graphics/draw/MenuHandler.h | 2 ++ src/graphics/draw/UIRenderer.cpp | 8 +++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 1c327117e..9736cf9d1 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -327,7 +327,11 @@ void menuHandler::positionBaseMenu() } screen->showOverlayBanner("Position Action", 30000, optionsArrayPtr, options, [](int selected) -> void { if (selected == 1) { +#if MESHTASTIC_EXCLUDE_GPS + menuQueue = menu_none; +#else menuQueue = gps_toggle_menu; +#endif } else if (selected == 2) { menuQueue = compass_point_north_menu; } else if (selected == 3) { @@ -390,6 +394,7 @@ void menuHandler::compassNorthMenu() }); } +#if !MESHTASTIC_EXCLUDE_GPS void menuHandler::GPSToggleMenu() { static const char *optionsArray[] = {"Back", "Enabled", "Disabled"}; @@ -412,6 +417,7 @@ void menuHandler::GPSToggleMenu() }, config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED ? 1 : 2); // set inital selection } +#endif void menuHandler::BuzzerModeMenu() { @@ -461,9 +467,11 @@ void menuHandler::handleMenuSwitch() case position_base_menu: positionBaseMenu(); break; +#if !MESHTASTIC_EXCLUDE_GPS case gps_toggle_menu: GPSToggleMenu(); break; +#endif case compass_point_north_menu: compassNorthMenu(); break; diff --git a/src/graphics/draw/MenuHandler.h b/src/graphics/draw/MenuHandler.h index a5bea5176..5a5ee8bf6 100644 --- a/src/graphics/draw/MenuHandler.h +++ b/src/graphics/draw/MenuHandler.h @@ -13,7 +13,9 @@ class menuHandler clock_face_picker, clock_menu, position_base_menu, +#if !MESHTASTIC_EXCLUDE_GPS gps_toggle_menu, +#endif compass_point_north_menu, reset_node_db_menu }; diff --git a/src/graphics/draw/UIRenderer.cpp b/src/graphics/draw/UIRenderer.cpp index 1738a8246..9c3a9eabb 100644 --- a/src/graphics/draw/UIRenderer.cpp +++ b/src/graphics/draw/UIRenderer.cpp @@ -44,22 +44,20 @@ std::string sanitizeString(const std::string &input) return output; } -#if !MESHTASTIC_EXCLUDE_GPS - // External variables extern graphics::Screen *screen; namespace graphics { +NodeNum UIRenderer::currentFavoriteNodeNum = 0; +#if !MESHTASTIC_EXCLUDE_GPS // GeoCoord object for coordinate conversions extern GeoCoord geoCoord; // Threshold values for the GPS lock accuracy bar display extern uint32_t dopThresholds[5]; -NodeNum UIRenderer::currentFavoriteNodeNum = 0; - // Draw GPS status summary void UIRenderer::drawGps(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::GPSStatus *gps) { @@ -188,6 +186,7 @@ void UIRenderer::drawGpsCoordinates(OLEDDisplay *display, int16_t x, int16_t y, } } } +#endif // !MESHTASTIC_EXCLUDE_GPS // Draw nodes status void UIRenderer::drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::NodeStatus *nodeStatus, int node_offset, @@ -1242,5 +1241,4 @@ std::string UIRenderer::drawTimeDelta(uint32_t days, uint32_t hours, uint32_t mi } // namespace graphics -#endif // !MESHTASTIC_EXCLUDE_GPS #endif // HAS_SCREEN \ No newline at end of file From d494c23a88ff890b4507ab9af70d1b7d04e269a5 Mon Sep 17 00:00:00 2001 From: Chloe Bethel Date: Wed, 2 Jul 2025 12:01:45 +0100 Subject: [PATCH 378/461] Enable telemetry and I2C sensors on STM32WL (except accelerometers) (#7008) * Update platformio inis for stm32 platform and wio-e5 variant for enabling i2c * Don't reference timezone functions if MESHTASTIC_EXCLUDE_TZ is defined * Use custom pow_of_two in RadioInterface instead of floating-point pow() * First pass: enable sensors for STM32wL * Fix AirQualityTelemetryModule being created if the PM25AQI header is missing * Link in power sensor libraries * more ini tweaks * Add =1 to EXCLUDE defines, fix indentation. * Drop HAS_WIRE in ini, it's defined in architecture.h * Fix build when power sensor libraries are missing Make MAX sensor integration into Power.cpp optional based on its library header existing. Also make NullSensor expose a voltage and current sensor, because Power calls directly into these for INA sensors. This lets us remove all the deps for the STM32WL platform. * Change default I2C for RAK3172 to be I2C1, not I2C2 * Respect the laws of mathematics (oops) --- arch/stm32/stm32.ini | 21 +++++++++++-------- src/Power.cpp | 11 +++++----- src/gps/RTC.cpp | 4 ++++ src/mesh/RadioInterface.cpp | 16 +++++++++----- src/modules/Modules.cpp | 3 +++ .../Telemetry/Sensor/MAX17048Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/MAX17048Sensor.h | 2 +- src/modules/Telemetry/Sensor/nullSensor.cpp | 11 ++++++++++ src/modules/Telemetry/Sensor/nullSensor.h | 10 +++++++-- src/platform/stm32wl/architecture.h | 5 ++++- src/power.h | 2 +- variants/rak3172/platformio.ini | 3 ++- variants/wio-e5/platformio.ini | 19 +++++++---------- 13 files changed, 71 insertions(+), 38 deletions(-) diff --git a/arch/stm32/stm32.ini b/arch/stm32/stm32.ini index e7a340f92..1a0890b8a 100644 --- a/arch/stm32/stm32.ini +++ b/arch/stm32/stm32.ini @@ -16,14 +16,17 @@ build_flags = ${arduino_base.build_flags} -flto -Isrc/platform/stm32wl -g - -DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR - -DMESHTASTIC_EXCLUDE_INPUTBROKER - -DMESHTASTIC_EXCLUDE_I2C - -DMESHTASTIC_EXCLUDE_POWERMON - -DMESHTASTIC_EXCLUDE_SCREEN - -DMESHTASTIC_EXCLUDE_MQTT - -DMESHTASTIC_EXCLUDE_BLUETOOTH - -DMESHTASTIC_EXCLUDE_GPS + -DMESHTASTIC_EXCLUDE_AUDIO=1 + -DMESHTASTIC_EXCLUDE_ATAK=1 ; ATAK is quite big, disable it for big flash savings. + -DMESHTASTIC_EXCLUDE_INPUTBROKER=1 + -DMESHTASTIC_EXCLUDE_POWERMON=1 + -DMESHTASTIC_EXCLUDE_SCREEN=1 + -DMESHTASTIC_EXCLUDE_MQTT=1 + -DMESHTASTIC_EXCLUDE_BLUETOOTH=1 + -DMESHTASTIC_EXCLUDE_GPS=1 + -DMESHTASTIC_EXCLUDE_WIFI=1 + -DMESHTASTIC_EXCLUDE_TZ=1 ; Exclude TZ to save some flash space. + -DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF ; This is REQUIRED for at least traceroute debug prints - without it the length ends up uninitialized. ;-DDEBUG_MUTE -fmerge-all-constants -ffunction-sections @@ -39,9 +42,9 @@ debug_tool = stlink lib_deps = ${env.lib_deps} ${radiolib_base.lib_deps} + # renovate: datasource=git-refs depName=caveman99-stm32-Crypto packageName=https://github.com/caveman99/Crypto gitBranch=main https://github.com/caveman99/Crypto/archive/eae9c768054118a9399690f8af202853d1ae8516.zip lib_ignore = mathertel/OneButton@2.6.1 - Wire diff --git a/src/Power.cpp b/src/Power.cpp index fb5db416e..9c67977bd 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -103,7 +103,7 @@ NullSensor ina3221Sensor; #endif -#if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_STM32WL) +#if !MESHTASTIC_EXCLUDE_I2C #include "modules/Telemetry/Sensor/MAX17048Sensor.h" #include extern std::pair nodeTelemetrySensorsMap[_meshtastic_TelemetrySensorType_MAX + 1]; @@ -278,7 +278,7 @@ class AnalogBatteryLevel : public HasBatteryLevel } #endif -#if HAS_TELEMETRY && !defined(ARCH_STM32WL) && !defined(HAS_PMU) && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#if HAS_TELEMETRY && !defined(HAS_PMU) && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR if (hasINA()) { return getINAVoltage(); } @@ -456,8 +456,7 @@ class AnalogBatteryLevel : public HasBatteryLevel #ifdef EXT_CHRG_DETECT return digitalRead(EXT_CHRG_DETECT) == ext_chrg_detect_value; #else -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_STM32WL) && \ - !defined(DISABLE_INA_CHARGING_DETECTION) +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(DISABLE_INA_CHARGING_DETECTION) if (hasINA()) { // get current flow from INA sensor - negative value means power flowing into the battery // default assuming BATTERY+ <--> INA_VIN+ <--> SHUNT RESISTOR <--> INA_VIN- <--> LOAD @@ -503,7 +502,7 @@ class AnalogBatteryLevel : public HasBatteryLevel } #endif -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_STM32WL) +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR uint16_t getINAVoltage() { if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA219].first == config.power.device_battery_ina_address) { @@ -1161,7 +1160,7 @@ bool Power::axpChipInit() #endif } -#if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) +#if !MESHTASTIC_EXCLUDE_I2C && __has_include() /** * Wrapper class for an I2C MAX17048 Lipo battery sensor. diff --git a/src/gps/RTC.cpp b/src/gps/RTC.cpp index af964eab5..219a593e0 100644 --- a/src/gps/RTC.cpp +++ b/src/gps/RTC.cpp @@ -244,11 +244,15 @@ bool perhapsSetRTC(RTCQuality q, struct tm &t) */ int32_t getTZOffset() { +#if MESHTASTIC_EXCLUDE_TZ + return 0; +#else time_t now = getTime(false); struct tm *gmt; gmt = gmtime(&now); gmt->tm_isdst = -1; return (int32_t)difftime(now, mktime(gmt)); +#endif } /** diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 91a4d0632..4db05b4d4 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -12,6 +12,12 @@ #include #include +// Calculate 2^n without calling pow() +uint32_t pow_of_2(uint32_t n) +{ + return 1 << n; +} + #define RDEF(name, freq_start, freq_end, duty_cycle, spacing, power_limit, audio_permitted, frequency_switching, wide_lora) \ { \ meshtastic_Config_LoRaConfig_RegionCode_##name, freq_start, freq_end, duty_cycle, spacing, power_limit, audio_permitted, \ @@ -246,7 +252,7 @@ uint32_t RadioInterface::getRetransmissionMsec(const meshtastic_MeshPacket *p) float channelUtil = airTime->channelUtilizationPercent(); uint8_t CWsize = map(channelUtil, 0, 100, CWmin, CWmax); // Assuming we pick max. of CWsize and there will be a client with SNR at half the range - return 2 * packetAirtime + (pow(2, CWsize) + 2 * CWmax + pow(2, int((CWmax + CWmin) / 2))) * slotTimeMsec + + return 2 * packetAirtime + (pow_of_2(CWsize) + 2 * CWmax + pow_of_2(int((CWmax + CWmin) / 2))) * slotTimeMsec + PROCESSING_TIME_MSEC; } @@ -259,7 +265,7 @@ uint32_t RadioInterface::getTxDelayMsec() float channelUtil = airTime->channelUtilizationPercent(); uint8_t CWsize = map(channelUtil, 0, 100, CWmin, CWmax); // LOG_DEBUG("Current channel utilization is %f so setting CWsize to %d", channelUtil, CWsize); - return random(0, pow(2, CWsize)) * slotTimeMsec; + return random(0, pow_of_2(CWsize)) * slotTimeMsec; } /** The CW size to use when calculating SNR_based delays */ @@ -279,7 +285,7 @@ uint32_t RadioInterface::getTxDelayMsecWeightedWorst(float snr) { uint8_t CWsize = getCWsize(snr); // offset the maximum delay for routers: (2 * CWmax * slotTimeMsec) - return (2 * CWmax * slotTimeMsec) + pow(2, CWsize) * slotTimeMsec; + return (2 * CWmax * slotTimeMsec) + pow_of_2(CWsize) * slotTimeMsec; } /** The delay to use when we want to flood a message */ @@ -296,7 +302,7 @@ uint32_t RadioInterface::getTxDelayMsecWeighted(float snr) LOG_DEBUG("rx_snr found in packet. Router: setting tx delay:%d", delay); } else { // offset the maximum delay for routers: (2 * CWmax * slotTimeMsec) - delay = (2 * CWmax * slotTimeMsec) + random(0, pow(2, CWsize)) * slotTimeMsec; + delay = (2 * CWmax * slotTimeMsec) + random(0, pow_of_2(CWsize)) * slotTimeMsec; LOG_DEBUG("rx_snr found in packet. Setting tx delay:%d", delay); } @@ -596,7 +602,7 @@ void RadioInterface::applyModemConfig() uint32_t RadioInterface::computeSlotTimeMsec() { float sumPropagationTurnaroundMACTime = 0.2 + 0.4 + 7; // in milliseconds - float symbolTime = pow(2, sf) / bw; // in milliseconds + float symbolTime = pow_of_2(sf) / bw; // in milliseconds if (myRegion->wideLora) { // CAD duration derived from AN1200.22 of SX1280 diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp index 783c08b9f..403f36a04 100644 --- a/src/modules/Modules.cpp +++ b/src/modules/Modules.cpp @@ -213,11 +213,14 @@ void setupModules() #if HAS_TELEMETRY new DeviceTelemetryModule(); #endif +// TODO: How to improve this? #if HAS_SENSOR && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR new EnvironmentTelemetryModule(); +#if __has_include("Adafruit_PM25AQI.h") if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_PMSA003I].first > 0) { new AirQualityTelemetryModule(); } +#endif #if !MESHTASTIC_EXCLUDE_HEALTH_TELEMETRY if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_MAX30102].first > 0 || nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_MLX90614].first > 0) { diff --git a/src/modules/Telemetry/Sensor/MAX17048Sensor.cpp b/src/modules/Telemetry/Sensor/MAX17048Sensor.cpp index 6ab96aa57..1a6792d3a 100644 --- a/src/modules/Telemetry/Sensor/MAX17048Sensor.cpp +++ b/src/modules/Telemetry/Sensor/MAX17048Sensor.cpp @@ -1,6 +1,6 @@ #include "MAX17048Sensor.h" -#if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_STM32WL) && __has_include() +#if !MESHTASTIC_EXCLUDE_I2C && __has_include() MAX17048Singleton *MAX17048Singleton::GetInstance() { diff --git a/src/modules/Telemetry/Sensor/MAX17048Sensor.h b/src/modules/Telemetry/Sensor/MAX17048Sensor.h index 6f61421dc..d27169406 100644 --- a/src/modules/Telemetry/Sensor/MAX17048Sensor.h +++ b/src/modules/Telemetry/Sensor/MAX17048Sensor.h @@ -5,7 +5,7 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_STM32WL) && __has_include() +#if !MESHTASTIC_EXCLUDE_I2C && __has_include() // Samples to store in a buffer to determine if the battery is charging or discharging #define MAX17048_CHARGING_SAMPLES 3 diff --git a/src/modules/Telemetry/Sensor/nullSensor.cpp b/src/modules/Telemetry/Sensor/nullSensor.cpp index 9522c7fcc..c84b9d27f 100644 --- a/src/modules/Telemetry/Sensor/nullSensor.cpp +++ b/src/modules/Telemetry/Sensor/nullSensor.cpp @@ -20,4 +20,15 @@ bool NullSensor::getMetrics(meshtastic_Telemetry *measurement) { return false; } + +uint16_t NullSensor::getBusVoltageMv() +{ + return 0; +} + +int16_t NullSensor::getCurrentMa() +{ + return 0; +} + #endif \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/nullSensor.h b/src/modules/Telemetry/Sensor/nullSensor.h index 94dbcc7f8..a400acf97 100644 --- a/src/modules/Telemetry/Sensor/nullSensor.h +++ b/src/modules/Telemetry/Sensor/nullSensor.h @@ -4,9 +4,12 @@ #pragma once #include "../mesh/generated/meshtastic/telemetry.pb.h" -#include "TelemetrySensor.h" -class NullSensor : public TelemetrySensor +#include "CurrentSensor.h" +#include "TelemetrySensor.h" +#include "VoltageSensor.h" + +class NullSensor : public TelemetrySensor, VoltageSensor, CurrentSensor { protected: @@ -17,6 +20,9 @@ class NullSensor : public TelemetrySensor virtual int32_t runOnce() override; virtual bool getMetrics(meshtastic_Telemetry *measurement) override; int32_t runTrigger() { return 0; } + + virtual uint16_t getBusVoltageMv() override; + virtual int16_t getCurrentMa() override; }; #endif \ No newline at end of file diff --git a/src/platform/stm32wl/architecture.h b/src/platform/stm32wl/architecture.h index 325a192a4..ac2bbe5d1 100644 --- a/src/platform/stm32wl/architecture.h +++ b/src/platform/stm32wl/architecture.h @@ -12,6 +12,9 @@ #ifndef HAS_TELEMETRY #define HAS_TELEMETRY 1 #endif +#ifndef HAS_WIRE +#define HAS_WIRE 1 +#endif // // set HW_VENDOR @@ -28,4 +31,4 @@ #define SX126X_CS 1000 #define SX126X_DIO1 1001 #define SX126X_RESET 1003 -#define SX126X_BUSY 1004 \ No newline at end of file +#define SX126X_BUSY 1004 diff --git a/src/power.h b/src/power.h index 70f075b7c..c71f96c10 100644 --- a/src/power.h +++ b/src/power.h @@ -81,7 +81,7 @@ extern NullSensor ina3221Sensor; #endif -#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_STM32WL) +#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR #if __has_include() #include "modules/Telemetry/Sensor/MAX17048Sensor.h" extern MAX17048Sensor max17048Sensor; diff --git a/variants/rak3172/platformio.ini b/variants/rak3172/platformio.ini index 456697aef..99610b17c 100644 --- a/variants/rak3172/platformio.ini +++ b/variants/rak3172/platformio.ini @@ -5,6 +5,8 @@ board_upload.maximum_size = 233472 ; reserve the last 28KB for filesystem build_flags = ${stm32_base.build_flags} -Ivariants/rak3172 + -DPIN_WIRE_SDA=PA11 + -DPIN_WIRE_SCL=PA12 -DHAL_DAC_MODULE_ONLY -DHAL_RNG_MODULE_ENABLED -DRADIOLIB_EXCLUDE_SX128X=1 @@ -18,6 +20,5 @@ build_flags = -DMESHTASTIC_EXCLUDE_SCREEN=1 -DMESHTASTIC_EXCLUDE_MQTT=1 -DMESHTASTIC_EXCLUDE_POWERMON=1 - ;-DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF ;-DCFG_DEBUG upload_port = stlink diff --git a/variants/wio-e5/platformio.ini b/variants/wio-e5/platformio.ini index e746ae2f0..1ef7abd78 100644 --- a/variants/wio-e5/platformio.ini +++ b/variants/wio-e5/platformio.ini @@ -8,20 +8,17 @@ build_flags = -DSERIAL_UART_INSTANCE=1 -DPIN_SERIAL_RX=PB7 -DPIN_SERIAL_TX=PB6 + -DPIN_WIRE_SDA=PA15 + -DPIN_WIRE_SCL=PB15 -DHAL_DAC_MODULE_ONLY -DHAL_RNG_MODULE_ENABLED -DRADIOLIB_EXCLUDE_SX128X=1 -DRADIOLIB_EXCLUDE_SX127X=1 -DRADIOLIB_EXCLUDE_LR11X0=1 - -DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1 - -DMESHTASTIC_EXCLUDE_I2C=1 - -DMESHTASTIC_EXCLUDE_WIFI=1 - -DMESHTASTIC_EXCLUDE_BLUETOOTH=1 - -DMESHTASTIC_EXCLUDE_GPS=1 - -DMESHTASTIC_EXCLUDE_SCREEN=1 - -DMESHTASTIC_EXCLUDE_MQTT=1 - -DMESHTASTIC_EXCLUDE_POWERMON=1 - ;-DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF - ;-DCFG_DEBUG + -DHAS_SENSOR -upload_port = stlink \ No newline at end of file +upload_port = stlink + +lib_deps = + ${stm32_base.lib_deps} + # Add your custom sensor here! \ No newline at end of file From d25240b33b6ec0f344dbdd61d9d05843a6a678e5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 06:03:00 -0500 Subject: [PATCH 379/461] [create-pull-request] automated change (#7199) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/telemetry.pb.h | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/protobufs b/protobufs index 86c738e80..5ef7aec95 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 86c738e8061ec09625ee52bc61ba862414384ce6 +Subproject commit 5ef7aec9597c6f841152e63b84d9dd7608cdef81 diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index 90b0d9d10..072a99a24 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -281,6 +281,12 @@ typedef struct _meshtastic_AirQualityMetrics { /* CO2 concentration in ppm */ bool has_co2; uint32_t co2; + /* CO2 sensor temperature in degC */ + bool has_co2_temperature; + float co2_temperature; + /* CO2 sensor relative humidity in % */ + bool has_co2_humidity; + float co2_humidity; } meshtastic_AirQualityMetrics; /* Local device mesh statistics */ @@ -409,7 +415,7 @@ extern "C" { #define meshtastic_DeviceMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_EnvironmentMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_PowerMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} -#define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} +#define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0} #define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""} @@ -418,7 +424,7 @@ extern "C" { #define meshtastic_DeviceMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_EnvironmentMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_PowerMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} -#define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} +#define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0} #define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""} @@ -482,6 +488,8 @@ extern "C" { #define meshtastic_AirQualityMetrics_particles_50um_tag 11 #define meshtastic_AirQualityMetrics_particles_100um_tag 12 #define meshtastic_AirQualityMetrics_co2_tag 13 +#define meshtastic_AirQualityMetrics_co2_temperature_tag 14 +#define meshtastic_AirQualityMetrics_co2_humidity_tag 15 #define meshtastic_LocalStats_uptime_seconds_tag 1 #define meshtastic_LocalStats_channel_utilization_tag 2 #define meshtastic_LocalStats_air_util_tx_tag 3 @@ -587,7 +595,9 @@ X(a, STATIC, OPTIONAL, UINT32, particles_10um, 9) \ X(a, STATIC, OPTIONAL, UINT32, particles_25um, 10) \ X(a, STATIC, OPTIONAL, UINT32, particles_50um, 11) \ X(a, STATIC, OPTIONAL, UINT32, particles_100um, 12) \ -X(a, STATIC, OPTIONAL, UINT32, co2, 13) +X(a, STATIC, OPTIONAL, UINT32, co2, 13) \ +X(a, STATIC, OPTIONAL, FLOAT, co2_temperature, 14) \ +X(a, STATIC, OPTIONAL, FLOAT, co2_humidity, 15) #define meshtastic_AirQualityMetrics_CALLBACK NULL #define meshtastic_AirQualityMetrics_DEFAULT NULL @@ -676,7 +686,7 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_Telemetry_size -#define meshtastic_AirQualityMetrics_size 78 +#define meshtastic_AirQualityMetrics_size 88 #define meshtastic_DeviceMetrics_size 27 #define meshtastic_EnvironmentMetrics_size 113 #define meshtastic_HealthMetrics_size 11 From 90e99b2bac8fbe26927dd7294f69c481bc49d7c6 Mon Sep 17 00:00:00 2001 From: "Daniel.Cao" <144674500+DanielCao0@users.noreply.github.com> Date: Wed, 2 Jul 2025 19:03:42 +0800 Subject: [PATCH 380/461] feat: add support for RAK3312 (New RAKwireless wiscore ESP32-S3 + SX1262) (#7115) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add support for RAK3112 variant with necessary configurations and definitions * Add the configuration of the LED pin * Refactor rak3112 variant configuration: update name, remove unused files, * Update RAK3112 configuration: refine memory settings, adjust GPS pin definitions * Update RAK3112 hardware vendor definition to use correct model * configure LED pins and update module definitions * Update USB mode configuration for RAK3112 board * Update power and battery configuration in rak3112 variant * Cancel the modification of mesh.pb.h * Rename RAKwireless RAK3112 to RAK3312 --------- Co-authored-by: daniel Co-authored-by: Thomas Göttgens Co-authored-by: Ben Meadors --- boards/wiscore_rak3312.json | 41 ++++++++++++++++++++++++++++ src/mesh/NodeDB.cpp | 2 +- src/platform/esp32/architecture.h | 2 ++ variants/rak3312/pins_arduino.h | 28 ++++++++++++++++++++ variants/rak3312/platformio.ini | 8 ++++++ variants/rak3312/variant.h | 44 +++++++++++++++++++++++++++++++ 6 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 boards/wiscore_rak3312.json create mode 100644 variants/rak3312/pins_arduino.h create mode 100644 variants/rak3312/platformio.ini create mode 100644 variants/rak3312/variant.h diff --git a/boards/wiscore_rak3312.json b/boards/wiscore_rak3312.json new file mode 100644 index 000000000..192e1c03c --- /dev/null +++ b/boards/wiscore_rak3312.json @@ -0,0 +1,41 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32s3_out.ld", + "memory_type": "qio_opi", + "partitions": "default_16MB.csv" + }, + "core": "esp32", + "extra_flags": [ + "-DRAK3312", + "-DARDUINO_USB_CDC_ON_BOOT=1", + "-DARDUINO_USB_MODE=1", + "-DARDUINO_RUNNING_CORE=1", + "-DARDUINO_EVENT_RUNNING_CORE=1", + "-DBOARD_HAS_PSRAM" + ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "dio", + "hwids": [["0x303A", "0x1001"]], + "mcu": "esp32s3", + "variant": "rak3312" + }, + "connectivity": ["wifi", "bluetooth"], + "debug": { + "openocd_target": "esp32s3.cfg" + }, + "frameworks": ["arduino", "espidf"], + "name": "WisCore RAK3312 Board", + "upload": { + "flash_size": "16MB", + "maximum_ram_size": 327680, + "maximum_size": 16777216, + "use_1200bps_touch": true, + "wait_for_upload_port": true, + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://www.rakwireless.com/en-us", + "vendor": "rakwireless" +} diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index bd4911a9b..79047cbd8 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -771,7 +771,7 @@ void NodeDB::installDefaultModuleConfig() moduleConfig.external_notification.alert_message_buzzer = true; moduleConfig.external_notification.nag_timeout = 60; #endif -#if defined(RAK4630) || defined(RAK11310) +#if defined(RAK4630) || defined(RAK11310) || defined(RAK3312) // Default to RAK led pin 2 (blue) moduleConfig.external_notification.enabled = true; moduleConfig.external_notification.output = PIN_LED2; diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index 3763bce1e..baefbc4eb 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -184,6 +184,8 @@ #define HW_VENDOR meshtastic_HardwareModel_HELTEC_SENSOR_HUB #elif defined(ELECROW_PANEL) #define HW_VENDOR meshtastic_HardwareModel_CROWPANEL +#elif defined(RAK3312) +#define HW_VENDOR meshtastic_HardwareModel_RAK3312 #elif defined(LINK_32) #define HW_VENDOR meshtastic_HardwareModel_LINK_32 #endif diff --git a/variants/rak3312/pins_arduino.h b/variants/rak3312/pins_arduino.h new file mode 100644 index 000000000..15a26e991 --- /dev/null +++ b/variants/rak3312/pins_arduino.h @@ -0,0 +1,28 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include "variant.h" +#include + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +// The default Wire will be mapped to PMU and RTC +static const uint8_t SDA = 9; +static const uint8_t SCL = 40; + +// Default SPI will be mapped to Radio +static const uint8_t SS = 12; +static const uint8_t MOSI = 11; +static const uint8_t MISO = 10; +static const uint8_t SCK = 13; + +#define SPI_MOSI (11) +#define SPI_SCK (13) +#define SPI_MISO (10) +#define SPI_CS (12) + +// LEDs +#define LED_BUILTIN LED_GREEN + +#endif /* Pins_Arduino_h */ diff --git a/variants/rak3312/platformio.ini b/variants/rak3312/platformio.ini new file mode 100644 index 000000000..d2877b3f7 --- /dev/null +++ b/variants/rak3312/platformio.ini @@ -0,0 +1,8 @@ +[env:rak3312] +extends = esp32s3_base +board = wiscore_rak3312 +board_check = true +upload_protocol = esptool + +build_flags = + ${esp32_base.build_flags} -D RAK3312 -I variants/rak3312 diff --git a/variants/rak3312/variant.h b/variants/rak3312/variant.h new file mode 100644 index 000000000..dfdf4de71 --- /dev/null +++ b/variants/rak3312/variant.h @@ -0,0 +1,44 @@ +#define I2C_SDA 9 +#define I2C_SCL 40 + +#define USE_SX1262 + +#define LORA_SCK 5 +#define LORA_MISO 3 +#define LORA_MOSI 6 +#define LORA_CS 7 +#define LORA_RESET 8 + +#ifdef USE_SX1262 +#define SX126X_CS LORA_CS +#define SX126X_DIO1 47 +#define SX126X_BUSY 48 +#define SX126X_RESET LORA_RESET +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 +#endif + +#define SX126X_POWER_EN (4) + +#define PIN_POWER_EN PIN_3V3_EN +#define PIN_3V3_EN (14) + +#define LED_GREEN 46 +#define LED_BLUE 45 + +#define PIN_LED1 LED_GREEN +#define PIN_LED2 LED_BLUE + +#define LED_CONN LED_BLUE +#define LED_PIN LED_GREEN +#define ledOff(pin) pinMode(pin, INPUT) + +#define LED_STATE_ON 1 // State when LED is litted + +#define HAS_GPS 1 +#define GPS_TX_PIN 43 +#define GPS_RX_PIN 44 + +#define BATTERY_PIN 1 +#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_MULTIPLIER 1.667 \ No newline at end of file From e505ec847e20167ceca273fe22872720a5df7439 Mon Sep 17 00:00:00 2001 From: Razurac <19306567+razurac@users.noreply.github.com> Date: Wed, 2 Jul 2025 13:06:02 +0200 Subject: [PATCH 381/461] Added option to invert screen on InkHUD (#7075) * Added option to invert screen on InkHUD * Rewrite to make use of existing config.display.displaymode --------- Co-authored-by: Ben Meadors --- .../niche/InkHUD/Applets/System/Menu/MenuAction.h | 1 + .../niche/InkHUD/Applets/System/Menu/MenuApplet.cpp | 13 +++++++++++++ .../niche/InkHUD/Applets/System/Menu/MenuApplet.h | 2 ++ src/graphics/niche/InkHUD/Renderer.cpp | 7 +++++++ 4 files changed, 23 insertions(+) diff --git a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h index f42b9dc2c..c84ee09e0 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h +++ b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h @@ -33,6 +33,7 @@ enum MenuAction { LAYOUT, TOGGLE_BATTERY_ICON, TOGGLE_NOTIFICATIONS, + TOGGLE_INVERT_COLOR, TOGGLE_12H_CLOCK, }; diff --git a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp index 69965972f..27d1825d5 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp @@ -205,6 +205,15 @@ void InkHUD::MenuApplet::execute(MenuItem item) settings->optionalFeatures.notifications = !settings->optionalFeatures.notifications; break; + case TOGGLE_INVERT_COLOR: + if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) + config.display.displaymode = meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT; + else + config.display.displaymode = meshtastic_Config_DisplayConfig_DisplayMode_INVERTED; + + nodeDB->saveToDisk(SEGMENT_CONFIG); + break; + case SET_RECENTS: // Set value of settings.recentlyActiveSeconds // Uses menu cursor to read RECENTS_OPTIONS_MINUTES array (defined at top of this file) @@ -316,6 +325,10 @@ void InkHUD::MenuApplet::showPage(MenuPage page) &settings->optionalFeatures.notifications)); items.push_back(MenuItem("Battery Icon", MenuAction::TOGGLE_BATTERY_ICON, MenuPage::OPTIONS, &settings->optionalFeatures.batteryIcon)); + + invertedColors = (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED); + items.push_back(MenuItem("Invert Color", MenuAction::TOGGLE_INVERT_COLOR, MenuPage::OPTIONS, &invertedColors)); + items.push_back( MenuItem("12-Hour Clock", MenuAction::TOGGLE_12H_CLOCK, MenuPage::OPTIONS, &config.display.use_12h_clock)); items.push_back(MenuItem("Exit", MenuPage::EXIT)); diff --git a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.h b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.h index 4c974672a..8f9280e6f 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.h +++ b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.h @@ -91,6 +91,8 @@ class MenuApplet : public SystemApplet, public concurrency::OSThread } cm; Applet *borrowedTileOwner = nullptr; // Which applet we have temporarily replaced while displaying menu + + bool invertedColors = false; // Helper to display current state of config.display.displaymode in InkHUD options }; } // namespace NicheGraphics::InkHUD diff --git a/src/graphics/niche/InkHUD/Renderer.cpp b/src/graphics/niche/InkHUD/Renderer.cpp index c058c4126..072e9dbd6 100644 --- a/src/graphics/niche/InkHUD/Renderer.cpp +++ b/src/graphics/niche/InkHUD/Renderer.cpp @@ -224,6 +224,13 @@ void InkHUD::Renderer::render(bool async) renderPlaceholders(); renderSystemApplets(); + // Invert Buffer if set by user + if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { + for (size_t i = 0; i < imageBufferWidth * imageBufferHeight; ++i) { + imageBuffer[i] = ~imageBuffer[i]; + } + } + // Tell display to begin process of drawing new image LOG_INFO("Updating display"); driver->update(imageBuffer, updateType); From f39c7ad47e524825961d0a853a9819d7763b7d34 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 2 Jul 2025 08:20:40 -0400 Subject: [PATCH 382/461] mDNS: Remove HTTP/HTTPS. Advertise shortname. (#7162) --- src/mesh/wifi/WiFiAPClient.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mesh/wifi/WiFiAPClient.cpp b/src/mesh/wifi/WiFiAPClient.cpp index 24be97ad7..7a56c258b 100644 --- a/src/mesh/wifi/WiFiAPClient.cpp +++ b/src/mesh/wifi/WiFiAPClient.cpp @@ -87,16 +87,18 @@ static void onNetworkConnected() // start mdns if (!MDNS.begin("Meshtastic")) { - LOG_ERROR("Error setting up MDNS responder!"); + LOG_ERROR("Error setting up mDNS responder!"); } else { LOG_INFO("mDNS Host: Meshtastic.local"); MDNS.addService("meshtastic", "tcp", SERVER_API_DEFAULT_PORT); +// ESPmDNS (ESP32) and SimpleMDNS (RP2040) have slightly different APIs for adding TXT records #ifdef ARCH_ESP32 - MDNS.addService("http", "tcp", 80); - MDNS.addService("https", "tcp", 443); + MDNS.addServiceTxt("meshtastic", "tcp", "shortname", String(owner.short_name)); + MDNS.addServiceTxt("meshtastic", "tcp", "id", String(owner.id)); // ESP32 prints obtained IP address in WiFiEvent #elif defined(ARCH_RP2040) - // ARCH_RP2040 does not support HTTPS + MDNS.addServiceTxt("meshtastic", "shortname", owner.short_name); + MDNS.addServiceTxt("meshtastic", "id", owner.id); LOG_INFO("Obtained IP address: %s", WiFi.localIP().toString().c_str()); #endif } From 553fc0cb1b364ced276b208733aa39acf54ed5e5 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 2 Jul 2025 10:11:39 -0400 Subject: [PATCH 383/461] Renovate comment for sensirion/Sensirion I2C SCD4x (#7202) --- platformio.ini | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/platformio.ini b/platformio.ini index c7b728d6a..7f55ab2b1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -49,11 +49,11 @@ build_flags = -Wno-missing-field-initializers -DMESHTASTIC_EXCLUDE_DROPZONE=1 -DMESHTASTIC_EXCLUDE_REMOTEHARDWARE=1 -DMESHTASTIC_EXCLUDE_HEALTH_TELEMETRY=1 - -DMESHTASTIC_EXCLUDE_POWERSTRESS=1 ; exclude power stress test module from main firmware + -DMESHTASTIC_EXCLUDE_POWERSTRESS=1 ; exclude power stress test module from main firmware -DMESHTASTIC_EXCLUDE_GENERIC_THREAD_MODULE=1 -D MAX_THREADS=40 ; As we've split modules, we have more threads to manage - #-DBUILD_EPOCH=$UNIX_TIME - #-D OLED_PL=1 + #-DBUILD_EPOCH=$UNIX_TIME + #-D OLED_PL=1 monitor_speed = 115200 monitor_filters = direct @@ -168,8 +168,8 @@ lib_deps = adafruit/Adafruit PCT2075@1.0.5 # renovate: datasource=custom.pio depName=DFRobot_BMM150 packageName=dfrobot/library/DFRobot_BMM150 dfrobot/DFRobot_BMM150@1.0.0 - - ; (not included in native / portduino) + +; (not included in native / portduino) [environmental_extra] lib_deps = # renovate: datasource=custom.pio depName=Adafruit BMP3XX packageName=adafruit/library/Adafruit BMP3XX Library @@ -196,4 +196,7 @@ lib_deps = boschsensortec/BME68x Sensor Library@1.3.40408 # renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip - sensirion/Sensirion I2C SCD4x@^0.4.0 + # renovate: datasource=custom.pio depName=Sensirion Core packageName=sensirion/library/Sensirion Core + sensirion/Sensirion Core@0.7.1 + # renovate: datasource=custom.pio depName=Sensirion I2C SCD4x packageName=sensirion/library/Sensirion I2C SCD4x + sensirion/Sensirion I2C SCD4x@1.0.0 From f99ac2104c0d8d2e9f83f2d457dae322d56018f1 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 2 Jul 2025 14:53:12 -0400 Subject: [PATCH 384/461] Add customizable boot logo based on resolution (#7146) --- .gitignore | 5 +++- bin/platformio-custom.py | 30 +++++++++++++++++++ branding/README.md | 17 +++++++++++ variants/elecrow_panel/platformio.ini | 3 ++ variants/mesh-tab/platformio.ini | 7 +++++ variants/picomputer-s3/platformio.ini | 1 + .../seeed-sensecap-indicator/platformio.ini | 1 + variants/t-deck/platformio.ini | 1 + variants/unphone/platformio.ini | 1 + 9 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 branding/README.md diff --git a/.gitignore b/.gitignore index b63f431d1..cc742c6c1 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,7 @@ release/ .vscode/extensions.json /compile_commands.json src/mesh/raspihttp/certificate.pem -src/mesh/raspihttp/private_key.pem \ No newline at end of file +src/mesh/raspihttp/private_key.pem + +# Ignore logo (set at build time with platformio-custom.py) +data/boot/logo.* diff --git a/bin/platformio-custom.py b/bin/platformio-custom.py index 600f9447f..be2a9ab71 100644 --- a/bin/platformio-custom.py +++ b/bin/platformio-custom.py @@ -131,3 +131,33 @@ for lb in env.GetLibBuilders(): if lb.name == "meshtastic-device-ui": lb.env.Append(CPPDEFINES=[("APP_VERSION", verObj["long"])]) break + +# Get the display resolution from macros +def get_display_resolution(build_flags): + # Check "DISPLAY_SIZE" to determine the screen resolution + for flag in build_flags: + if isinstance(flag, tuple) and flag[0] == "DISPLAY_SIZE": + screen_width, screen_height = map(int, flag[1].split("x")) + return screen_width, screen_height + print("No screen resolution defined in build_flags. Please define DISPLAY_SIZE.") + exit(1) + +def load_boot_logo(source, target, env): + build_flags = env.get("CPPDEFINES", []) + logo_w, logo_h = get_display_resolution(build_flags) + print(f"TFT build with {logo_w}x{logo_h} resolution detected") + + # Load the boot logo from `branding/logo_x.png` if it exists + source_path = join(env["PROJECT_DIR"], "branding", f"logo_{logo_w}x{logo_h}.png") + dest_dir = join(env["PROJECT_DIR"], "data", "boot") + dest_path = join(dest_dir, "logo.png") + if env.File(source_path).exists(): + print(f"Loading boot logo from {source_path}") + # Prepare the destination + env.Execute(f"mkdir -p {dest_dir} && rm -f {dest_path}") + # Copy the logo to the `data/boot` directory + env.Execute(f"cp {source_path} {dest_path}") + +# Load the boot logo on TFT builds +if ("HAS_TFT", 1) in env.get("CPPDEFINES", []): + env.AddPreAction('$BUILD_DIR/littlefs.bin', load_boot_logo) diff --git a/branding/README.md b/branding/README.md new file mode 100644 index 000000000..3a558bf20 --- /dev/null +++ b/branding/README.md @@ -0,0 +1,17 @@ +# Meshtastic Branding / Whitelabeling + +This directory is consumed during the creation of **event** firmware. + +`bin/platformio-custom.py` determines the display resolution, and locates the corresponding `logo_x.png`. + +Ex: + +- `logo_800x480.png` +- `logo_480x480.png` +- `logo_480x320.png` +- `logo_320x480.png` +- `logo_320x240.png` + +This file is copied to `data/boot/logo.png` before filesytem image compilation. + +For additional examples see the [`event/defcon33` branch](https://github.com/meshtastic/firmware/tree/event/defcon33). diff --git a/variants/elecrow_panel/platformio.ini b/variants/elecrow_panel/platformio.ini index 5bce58208..de7f28a83 100644 --- a/variants/elecrow_panel/platformio.ini +++ b/variants/elecrow_panel/platformio.ini @@ -79,6 +79,7 @@ build_flags = -D SPI_FREQUENCY=80000000 -D LGFX_SCREEN_WIDTH=240 -D LGFX_SCREEN_HEIGHT=320 + -D DISPLAY_SIZE=320x240 ; landscape mode -D LGFX_PANEL=ST7789 -D LGFX_ROTATION=1 -D LGFX_CFG_HOST=SPI2_HOST @@ -103,6 +104,7 @@ build_flags = -D SPI_FREQUENCY=60000000 -D LGFX_SCREEN_WIDTH=320 -D LGFX_SCREEN_HEIGHT=480 + -D DISPLAY_SIZE=320x480 ; portrait mode -D LGFX_PANEL=ILI9488 -D LGFX_ROTATION=0 -D LGFX_CFG_HOST=SPI2_HOST @@ -126,3 +128,4 @@ extends = crowpanel_large_esp32s3_base build_flags = ${crowpanel_large_esp32s3_base.build_flags} -D VIEW_320x240 + -D DISPLAY_SIZE=800x480 ; landscape mode diff --git a/variants/mesh-tab/platformio.ini b/variants/mesh-tab/platformio.ini index beeb58a48..52f9fc13c 100644 --- a/variants/mesh-tab/platformio.ini +++ b/variants/mesh-tab/platformio.ini @@ -85,6 +85,7 @@ build_flags = ${mesh_tab_xpt2046.build_flags} -D SPI_FREQUENCY=60000000 -D LGFX_SCREEN_WIDTH=240 -D LGFX_SCREEN_HEIGHT=320 + -D DISPLAY_SIZE=320x240 ; landscape mode -D LGFX_PANEL=ST7789 -D LGFX_INVERT_COLOR=false -D LGFX_ROTATION=3 @@ -97,6 +98,7 @@ build_flags = ${mesh_tab_xpt2046.build_flags} -D SPI_FREQUENCY=60000000 ; if image is distorted then lower to 40 MHz -D LGFX_SCREEN_WIDTH=240 -D LGFX_SCREEN_HEIGHT=320 + -D DISPLAY_SIZE=320x240 ; landscape mode -D LGFX_PANEL=ILI9341 -D LGFX_ROTATION=1 -D LGFX_TOUCH_ROTATION=4 @@ -109,6 +111,7 @@ build_flags = ${mesh_tab_xpt2046.build_flags} -D DISPLAY_SET_RESOLUTION -D LGFX_SCREEN_WIDTH=320 -D LGFX_SCREEN_HEIGHT=480 + -D DISPLAY_SIZE=320x480 ; portrait mode -D LGFX_PANEL=ILI9488 -D LGFX_ROTATION=0 -D LGFX_TOUCH_ROTATION=0 @@ -121,6 +124,7 @@ build_flags = ${mesh_tab_xpt2046.build_flags} -D DISPLAY_SET_RESOLUTION -D LGFX_SCREEN_WIDTH=320 -D LGFX_SCREEN_HEIGHT=480 + -D DISPLAY_SIZE=320x480 ; portrait mode -D LGFX_PANEL=HX8357B -D LGFX_INVERT_COLOR=false -D LGFX_ROTATION=4 @@ -133,6 +137,7 @@ build_flags = ${mesh_tab_ft5x06.build_flags} -D SPI_FREQUENCY=75000000 ; may go higher upto 60/80 MHz -D LGFX_SCREEN_WIDTH=240 -D LGFX_SCREEN_HEIGHT=320 + -D DISPLAY_SIZE=320x240 ; landscape mode -D LGFX_PANEL=ILI9341 -D LGFX_ROTATION=1 -D LGFX_TOUCH_X_MIN=0 @@ -149,6 +154,7 @@ build_flags = ${mesh_tab_ft5x06.build_flags} -D DISPLAY_SET_RESOLUTION -D LGFX_SCREEN_WIDTH=320 -D LGFX_SCREEN_HEIGHT=480 + -D DISPLAY_SIZE=320x480 ; portrait mode -D LGFX_PANEL=ILI9488 -D LGFX_ROTATION=2 -D LGFX_TOUCH_X_MIN=0 @@ -165,6 +171,7 @@ build_flags = ${mesh_tab_ft5x06.build_flags} -D DISPLAY_SET_RESOLUTION -D LGFX_SCREEN_WIDTH=320 -D LGFX_SCREEN_HEIGHT=480 + -D DISPLAY_SIZE=320x480 ; portrait mode -D LGFX_PANEL=HX8357B -D LGFX_ROTATION=4 -D LGFX_TOUCH_X_MIN=0 diff --git a/variants/picomputer-s3/platformio.ini b/variants/picomputer-s3/platformio.ini index b7987796f..cb5e829b4 100644 --- a/variants/picomputer-s3/platformio.ini +++ b/variants/picomputer-s3/platformio.ini @@ -44,6 +44,7 @@ build_flags = -D LOG_DEBUG_INC=\"DebugConfiguration.h\" -D LGFX_SCREEN_WIDTH=240 -D LGFX_SCREEN_HEIGHT=320 + -D DISPLAY_SIZE=320x240 ; landscape mode -D LGFX_DRIVER=LGFX_PICOMPUTER_S3 -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_PICOMPUTER_S3.h\" -D VIEW_320x240 diff --git a/variants/seeed-sensecap-indicator/platformio.ini b/variants/seeed-sensecap-indicator/platformio.ini index 140c6f527..63f814b57 100644 --- a/variants/seeed-sensecap-indicator/platformio.ini +++ b/variants/seeed-sensecap-indicator/platformio.ini @@ -55,6 +55,7 @@ build_flags = -D CUSTOM_TOUCH_DRIVER -D LGFX_SCREEN_WIDTH=480 -D LGFX_SCREEN_HEIGHT=480 + -D DISPLAY_SIZE=480x480 -D LGFX_DRIVER=LGFX_INDICATOR -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_INDICATOR.h\" -D VIEW_320x240 diff --git a/variants/t-deck/platformio.ini b/variants/t-deck/platformio.ini index 6ee95b119..c9bd64bc3 100644 --- a/variants/t-deck/platformio.ini +++ b/variants/t-deck/platformio.ini @@ -54,6 +54,7 @@ build_flags = ; -D CALIBRATE_TOUCH=0 -D LGFX_SCREEN_WIDTH=240 -D LGFX_SCREEN_HEIGHT=320 + -D DISPLAY_SIZE=320x240 ; landscape mode -D LGFX_DRIVER=LGFX_TDECK -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_T_DECK.h\" ; -D LVGL_DRIVER=LVGL_TDECK diff --git a/variants/unphone/platformio.ini b/variants/unphone/platformio.ini index f286c3d4c..b9da6d0e5 100644 --- a/variants/unphone/platformio.ini +++ b/variants/unphone/platformio.ini @@ -56,6 +56,7 @@ build_flags = -D LOG_DEBUG_INC=\"DebugConfiguration.h\" -D LGFX_SCREEN_WIDTH=320 -D LGFX_SCREEN_HEIGHT=480 + -D DISPLAY_SIZE=320x480 ; portrait mode -D LGFX_DRIVER=LGFX_UNPHONE_V9 -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_UNPHONE.h\" -D VIEW_320x240 From 1f85e2a02ad2f329867d7e65c8637cc493e29fe7 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Thu, 3 Jul 2025 12:18:34 +1200 Subject: [PATCH 385/461] Additional larger font for InkHUD UI (#7201) * Add 12pt fonts * Add fontMedium In addition to fontSmall and fontLarge * Set fonts in nicheGraphics.h * Change all uses of fontLarge to fontMedium fontLarge was previously set at 9pt. fontLarge is now 12pt, fontMedium is 9pt. (NB: fonts may be customized per-variant) * Use fontLarge with "All Messages" and "DMs" applets * Documentation --- .../niche/Fonts/FreeSans12pt_Win1250.h | 527 ++++++++++++++++++ .../niche/Fonts/FreeSans12pt_Win1251.h | 527 ++++++++++++++++++ .../niche/Fonts/FreeSans12pt_Win1252.h | 527 ++++++++++++++++++ src/graphics/niche/InkHUD/Applet.cpp | 5 +- src/graphics/niche/InkHUD/Applet.h | 2 +- src/graphics/niche/InkHUD/AppletFont.h | 6 + .../Applets/Bases/NodeList/NodeListApplet.cpp | 10 +- .../Applets/Bases/NodeList/NodeListApplet.h | 4 +- .../InkHUD/Applets/System/Logo/LogoApplet.cpp | 4 +- .../InkHUD/Applets/System/Menu/MenuApplet.cpp | 6 +- .../Applets/System/Pairing/PairingApplet.cpp | 4 +- .../InkHUD/Applets/System/Tips/TipsApplet.cpp | 22 +- .../User/AllMessage/AllMessageApplet.cpp | 22 +- .../niche/InkHUD/Applets/User/DM/DMApplet.cpp | 22 +- src/graphics/niche/InkHUD/docs/README.md | 15 +- variants/ELECROW-ThinkNode-M1/nicheGraphics.h | 3 +- .../nrf52_promicro_diy_tcxo/nicheGraphics.h | 5 +- .../nicheGraphics.h | 5 +- variants/heltec_mesh_pocket/nicheGraphics.h | 3 +- .../heltec_vision_master_e213/nicheGraphics.h | 3 +- .../heltec_vision_master_e290/nicheGraphics.h | 3 +- .../heltec_wireless_paper/nicheGraphics.h | 3 +- .../seeed_wio_tracker_L1_eink/nicheGraphics.h | 3 +- variants/t-echo/nicheGraphics.h | 3 +- variants/tlora_t3s3_epaper/nicheGraphics.h | 3 +- 25 files changed, 1679 insertions(+), 58 deletions(-) create mode 100644 src/graphics/niche/Fonts/FreeSans12pt_Win1250.h create mode 100644 src/graphics/niche/Fonts/FreeSans12pt_Win1251.h create mode 100644 src/graphics/niche/Fonts/FreeSans12pt_Win1252.h diff --git a/src/graphics/niche/Fonts/FreeSans12pt_Win1250.h b/src/graphics/niche/Fonts/FreeSans12pt_Win1250.h new file mode 100644 index 000000000..66edcc6ad --- /dev/null +++ b/src/graphics/niche/Fonts/FreeSans12pt_Win1250.h @@ -0,0 +1,527 @@ +// trunk-ignore-all(clang-format) +#pragma once +/* PROPERTIES + +FONT_NAME FreeSans12pt_Win1250 +*/ +const uint8_t FreeSans12pt_Win1250Bitmaps[] PROGMEM = { +/* 0x01 */ 0x00, 0x30, 0x00, 0x09, 0x00, 0x01, 0x20, 0x00, 0x24, 0x00, 0x04, 0x80, 0x01, 0x90, 0x00, 0x62, 0x00, 0x30, 0xFE, 0x04, 0x10, 0x5F, 0x02, 0x0B, 0x00, 0x7F, 0xE0, 0x0C, 0x1C, 0x02, 0x83, 0x81, 0x9F, 0xF0, 0x02, 0x1E, 0x00, 0x41, 0xC0, 0x0E, 0x7F, 0x81, 0x78, 0x18, 0x62, 0x00, 0xFF, 0xC0, +/* 0x02 */ 0x00, 0xFF, 0x80, 0x61, 0x13, 0xF0, 0x62, 0x60, 0x07, 0xFC, 0x00, 0x83, 0x80, 0x10, 0xF0, 0x33, 0xF6, 0x01, 0x41, 0xC0, 0x18, 0x38, 0x03, 0xFF, 0xE0, 0x47, 0x02, 0x08, 0x20, 0x61, 0xC4, 0x06, 0x17, 0x00, 0x22, 0x00, 0x02, 0x40, 0x00, 0x48, 0x00, 0x09, 0x00, 0x01, 0x20, 0x00, 0x3C, 0x00, +/* 0x03 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x04, 0x08, 0x48, 0x70, 0xE1, 0xC3, 0x87, 0x0E, 0x08, 0x10, 0x70, 0x00, 0x03, 0x80, 0x00, 0x14, 0x00, 0x00, 0xA1, 0x81, 0x8D, 0x87, 0xF0, 0x44, 0x00, 0x06, 0x30, 0x00, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x04 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x10, 0x02, 0x48, 0xE0, 0x61, 0xC1, 0xCC, 0x0E, 0x78, 0x1C, 0x70, 0x00, 0x03, 0x80, 0x00, 0x14, 0xFF, 0xFC, 0xA6, 0x00, 0xCD, 0x9F, 0xFE, 0x44, 0x71, 0xE6, 0x30, 0xFC, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x05 */ 0x00, 0x18, 0x00, 0x00, 0x40, 0x01, 0x90, 0x01, 0xF4, 0x08, 0x12, 0x23, 0xC1, 0x91, 0x2C, 0x1C, 0x8A, 0xC3, 0x64, 0x64, 0x13, 0x22, 0x41, 0x98, 0x26, 0x2C, 0xC4, 0x22, 0x60, 0x42, 0x13, 0x04, 0x30, 0x80, 0x61, 0xA4, 0x02, 0x18, 0x20, 0x03, 0x41, 0x00, 0x20, 0x08, 0x02, 0x00, 0x60, 0x40, 0x03, 0xF8, +/* 0x06 */ 0x00, 0x10, 0x00, 0x03, 0x00, 0x1C, 0x48, 0x00, 0xB4, 0x80, 0x09, 0xF9, 0xC0, 0xE0, 0xE4, 0x0C, 0x02, 0x8F, 0x80, 0x38, 0x88, 0x01, 0x0D, 0x00, 0x18, 0x30, 0x01, 0x60, 0x80, 0x13, 0x18, 0x03, 0xF2, 0xC0, 0x20, 0x26, 0x06, 0x07, 0xFF, 0xA0, 0x02, 0x39, 0x00, 0x14, 0x70, 0x01, 0xC3, 0x00, 0x18, 0x00, +/* 0x07 */ +/* 0x08 */ 0x00, 0x1F, 0x80, 0x00, 0x60, 0x80, 0x01, 0x00, 0x80, 0x06, 0x00, 0x80, 0x3C, 0x01, 0x01, 0x8C, 0x02, 0x02, 0x08, 0x04, 0x04, 0x08, 0x0C, 0x38, 0x00, 0x04, 0x80, 0x00, 0x06, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x2E, 0xC0, 0x01, 0x83, 0x7E, 0x0C, 0x10, 0x37, 0xE2, 0x61, 0x00, 0x0C, 0xC6, 0x10, 0x98, 0x0C, 0x63, 0x00, 0x00, 0xC6, 0x00, +/* 0x09 */ 0x00, 0x1F, 0x80, 0x00, 0x60, 0x80, 0x01, 0x00, 0x80, 0x06, 0x00, 0x80, 0x3C, 0x01, 0x01, 0x8C, 0x02, 0x02, 0x08, 0x04, 0x04, 0x08, 0x0C, 0x38, 0x00, 0x04, 0x80, 0x00, 0x06, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x2E, 0xC0, 0x01, 0x83, 0x7E, 0x0C, 0x00, 0x37, 0xE0, +/* 0x0A */ +/* 0x0B */ 0x1F, 0x07, 0xC1, 0x86, 0x41, 0x10, 0x0C, 0x04, 0x80, 0x40, 0x18, 0x00, 0x00, 0xC0, 0x00, 0x06, 0x00, 0x00, 0x30, 0x00, 0x01, 0x40, 0x00, 0x0A, 0x00, 0x00, 0x88, 0x00, 0x04, 0x40, 0x00, 0x41, 0x00, 0x02, 0x04, 0x00, 0x20, 0x20, 0x02, 0x00, 0x80, 0x20, 0x02, 0x02, 0x00, 0x08, 0x20, 0x00, 0x22, 0x00, 0x00, 0xE0, 0x00, +/* 0x0C */ 0x01, 0x00, 0x00, 0x38, 0x00, 0x04, 0xC0, 0x01, 0x08, 0x00, 0x18, 0x80, 0x1C, 0x10, 0x02, 0x07, 0x80, 0x81, 0x10, 0x1F, 0xC2, 0x02, 0x00, 0x60, 0x80, 0x1A, 0x20, 0x1C, 0x42, 0x1C, 0x08, 0xFE, 0x03, 0xA0, 0x01, 0x8C, 0x01, 0xC1, 0x43, 0xD0, 0x27, 0x81, 0xF8, +/* 0x0D */ +/* 0x0E */ 0x00, 0xE0, 0x00, 0x11, 0x00, 0x01, 0x10, 0x00, 0x0B, 0x00, 0x03, 0xF8, 0x00, 0x60, 0x60, 0x09, 0x02, 0x00, 0xA0, 0x10, 0x16, 0x01, 0x01, 0x40, 0x10, 0x10, 0x01, 0x01, 0x00, 0x08, 0x10, 0x00, 0x82, 0x1F, 0x08, 0x3F, 0x90, 0x44, 0x00, 0x06, 0xBF, 0xFF, 0xAF, 0xF0, 0xFF, 0xFF, 0x0F, 0xE3, 0xFB, 0xFC, +/* 0x0F */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x40, 0x12, 0x34, 0x00, 0x69, 0x40, 0x01, 0x49, 0xE0, 0xF1, 0xCD, 0x06, 0x8E, 0x28, 0x14, 0x71, 0x40, 0xA3, 0x8B, 0xFD, 0x14, 0x50, 0x68, 0xA2, 0x81, 0x4D, 0x97, 0xFA, 0x44, 0xBF, 0xD6, 0x31, 0x02, 0xE0, 0xC8, 0x16, 0x08, 0x61, 0x08, 0x21, 0xF0, 0x80, 0xF8, 0x78, 0x00, +/* 0x10 */ 0x00, 0xF0, 0x00, 0x3A, 0x00, 0x07, 0xC0, 0x00, 0xA8, 0x00, 0x1F, 0x00, 0x02, 0xB0, 0x00, 0x52, 0x00, 0x0A, 0x40, 0x02, 0x48, 0x00, 0x49, 0x00, 0x09, 0x30, 0x01, 0x22, 0x01, 0xC4, 0x70, 0xF0, 0x85, 0xE1, 0x10, 0x88, 0x37, 0x20, 0x03, 0x9C, 0x00, 0x37, 0x00, 0x06, 0x40, 0x01, 0x86, 0x00, +/* 0x11 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x60, 0x02, 0x36, 0x00, 0x09, 0x04, 0x0C, 0x48, 0x60, 0xC1, 0xC3, 0x0F, 0x0E, 0x00, 0x08, 0x70, 0x00, 0x23, 0x80, 0x63, 0x84, 0x01, 0x9F, 0x20, 0x0C, 0xFD, 0x80, 0x27, 0xE4, 0x03, 0x3F, 0x30, 0x33, 0xE0, 0xC0, 0x00, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x12 */ 0x00, 0xC2, 0x00, 0x1C, 0x24, 0x02, 0x18, 0x60, 0x64, 0x02, 0x02, 0x40, 0x20, 0x00, 0xF2, 0x03, 0x89, 0xE0, 0x7C, 0x80, 0x0E, 0x25, 0x80, 0xE1, 0x00, 0x1A, 0x08, 0x71, 0xB0, 0xC4, 0x39, 0x84, 0xC2, 0xCC, 0x40, 0x76, 0x7C, 0x05, 0xBB, 0x80, 0x4C, 0xE0, 0x0A, 0x78, 0x00, 0x9C, 0x00, 0x0F, 0x00, 0x00, +/* 0x13 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x00, 0x00, 0x48, 0x60, 0xC1, 0xC6, 0xC9, 0x0E, 0x00, 0x00, 0x70, 0x00, 0x03, 0x80, 0x00, 0x14, 0xFF, 0xF8, 0xA6, 0x00, 0xCD, 0x9F, 0xFE, 0x44, 0x71, 0xE6, 0x30, 0xFC, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x14 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x20, 0x22, 0x33, 0x01, 0x89, 0x20, 0x02, 0x48, 0x60, 0xE1, 0xC8, 0x80, 0x8E, 0x46, 0x46, 0x72, 0x32, 0x33, 0x9F, 0x9F, 0x94, 0x78, 0x78, 0xA0, 0x00, 0x0D, 0x80, 0x00, 0x44, 0x0E, 0x06, 0x30, 0x00, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x15 */ 0x03, 0xFC, 0x20, 0x38, 0x1C, 0x81, 0x80, 0x1D, 0x08, 0x00, 0x32, 0x60, 0x00, 0x89, 0x00, 0x02, 0x18, 0x00, 0x08, 0x61, 0xC3, 0x22, 0x8D, 0x93, 0x72, 0x00, 0x00, 0x48, 0x00, 0x01, 0x20, 0x00, 0x04, 0x9F, 0xFF, 0x92, 0x60, 0x0E, 0x44, 0xFF, 0xF2, 0x11, 0xC3, 0x88, 0x21, 0xF8, 0x40, 0x40, 0x02, 0x00, 0xC0, 0x30, 0x00, 0xFF, 0x00, +/* 0x16 */ 0x03, 0x80, 0x03, 0xC0, 0x01, 0xE0, 0x01, 0xE0, 0x03, 0xF0, 0x03, 0xF0, 0x27, 0xF0, 0x6F, 0x70, 0x6E, 0x60, 0xFC, 0x60, 0xFC, 0x7E, 0xFC, 0x7E, 0xFC, 0x3F, 0xF4, 0x1F, 0xF4, 0x1F, 0xF0, 0x0E, 0x70, 0x0E, 0x30, 0x1C, 0x38, 0x38, 0x0F, 0xF0, +/* 0x17 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x00, 0x00, 0x48, 0x00, 0x21, 0xC0, 0x02, 0x8E, 0x20, 0xF4, 0x70, 0x84, 0x11, 0x82, 0x40, 0x84, 0x01, 0x03, 0x20, 0x0F, 0x85, 0x80, 0x03, 0x04, 0x00, 0x04, 0x30, 0x78, 0x10, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x18 */ 0x00, 0xFC, 0x00, 0x02, 0x06, 0x00, 0x08, 0x24, 0x00, 0x21, 0xA4, 0x00, 0x4C, 0x48, 0x00, 0xA0, 0x50, 0x01, 0x92, 0x60, 0x03, 0x24, 0xC0, 0x06, 0x01, 0x81, 0x28, 0x03, 0x49, 0x6C, 0xC4, 0xAD, 0xD8, 0x16, 0xA4, 0xCC, 0xC4, 0x44, 0x86, 0x13, 0x05, 0x00, 0x28, 0x0A, 0x00, 0x50, 0x14, 0x00, 0x90, 0x48, 0x01, 0x20, 0x90, 0x02, 0x41, 0x20, 0x00, 0x00, +/* 0x19 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x00, 0x00, 0x49, 0xC3, 0x81, 0xC0, 0x00, 0x0E, 0x78, 0xF0, 0x77, 0xEF, 0xC3, 0xA7, 0x4E, 0x15, 0x0A, 0x10, 0xA7, 0x8F, 0x0D, 0x80, 0x00, 0x44, 0x00, 0x06, 0x33, 0xF0, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x1A */ 0xFF, 0xFF, 0x00, 0x06, 0x00, 0x0C, 0x3E, 0x18, 0x82, 0x32, 0x02, 0x64, 0x04, 0xC8, 0x09, 0x80, 0x23, 0x00, 0x86, 0x02, 0x0C, 0x08, 0x18, 0x10, 0x30, 0x00, 0x60, 0x00, 0xC0, 0x81, 0x80, 0x03, 0x00, 0x07, 0xFF, 0xF8, +/* 0x1B */ 0x00, 0xFE, 0x00, 0x03, 0x81, 0x80, 0x04, 0x00, 0x60, 0x08, 0x00, 0x30, 0x10, 0x00, 0x10, 0x30, 0x07, 0x88, 0x23, 0xC8, 0x08, 0x22, 0x00, 0x04, 0x60, 0x00, 0x44, 0x60, 0x00, 0x84, 0x63, 0x03, 0x04, 0x61, 0xFC, 0x04, 0x6B, 0x00, 0x9E, 0xA5, 0x01, 0x6A, 0xD5, 0x01, 0x43, 0xA8, 0x81, 0x05, 0xD0, 0x82, 0x0A, 0xA0, 0x82, 0x05, 0xC0, 0x82, 0x02, 0x61, 0xFF, 0x0C, 0x1E, 0x00, 0xF0, +/* 0x1C */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x30, 0x02, 0x32, 0x00, 0x09, 0x00, 0x00, 0x48, 0x20, 0x61, 0xC3, 0x84, 0x0E, 0x1C, 0x78, 0x70, 0x40, 0x03, 0x80, 0x00, 0x14, 0x00, 0x00, 0xA0, 0x03, 0x0D, 0x83, 0xF0, 0x44, 0x00, 0x06, 0x30, 0x00, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x1D */ 0x01, 0xFE, 0x00, 0x3A, 0x1C, 0x03, 0x00, 0x30, 0x23, 0x1E, 0xC3, 0x38, 0x03, 0x10, 0xC3, 0x09, 0x00, 0x18, 0x68, 0x00, 0xC1, 0x40, 0x00, 0x0A, 0x07, 0x80, 0x50, 0x46, 0x02, 0x80, 0x00, 0x1A, 0x1E, 0x00, 0xCB, 0x10, 0x0D, 0x03, 0x00, 0x48, 0x60, 0x06, 0x40, 0x00, 0x22, 0x0C, 0x02, 0x10, 0x60, 0x60, 0x43, 0xFC, 0x01, 0xE0, 0x00, 0x00, +/* 0x1E */ 0x01, 0xF0, 0x00, 0xEA, 0xC0, 0x31, 0x5F, 0x04, 0x5F, 0x88, 0x80, 0xA0, 0x48, 0x0E, 0x02, 0x8F, 0x40, 0x3C, 0x10, 0x21, 0x66, 0x87, 0x15, 0x98, 0x71, 0x41, 0x02, 0x14, 0x00, 0x01, 0x40, 0x00, 0x14, 0x00, 0x01, 0x21, 0xFE, 0x12, 0x00, 0x02, 0x10, 0x00, 0x60, 0x80, 0x0C, 0x06, 0x01, 0x80, 0x3F, 0xE0, +/* 0x1F */ 0x0E, 0x00, 0x13, 0x00, 0x23, 0x00, 0xF3, 0x01, 0x31, 0x01, 0x11, 0x03, 0xD3, 0x06, 0xF2, 0x30, 0x34, 0xC7, 0x25, 0x33, 0x2B, 0xC2, 0x57, 0x04, 0x3A, 0x08, 0x72, 0x30, 0xA3, 0xC3, 0x40, 0x04, 0x40, 0x18, 0x40, 0x60, 0x7F, 0x80, +/* ' ' 0x20 */ +/* '!' 0x21 */ 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, +/* '"' 0x22 */ 0xCF, 0x3C, 0xF3, 0x8A, 0x20, +/* '#' 0x23 */ 0x06, 0x30, 0x31, 0x03, 0x18, 0x18, 0xC7, 0xFF, 0xBF, 0xFC, 0x31, 0x01, 0x18, 0x18, 0xC7, 0xFF, 0xBF, 0xFC, 0x31, 0x01, 0x18, 0x18, 0xC0, 0xC6, 0x06, 0x30, +/* '$' 0x24 */ 0x04, 0x03, 0xE1, 0xFF, 0x72, 0x7C, 0x47, 0x88, 0xF1, 0x07, 0xA0, 0x7E, 0x03, 0xF0, 0x17, 0x02, 0x7C, 0x47, 0x88, 0xF1, 0x1B, 0x26, 0x7F, 0xC3, 0xE0, 0x10, 0x02, 0x00, +/* '%' 0x25 */ 0x00, 0x06, 0x03, 0xC0, 0x40, 0x7E, 0x0C, 0x0E, 0x70, 0x80, 0xC3, 0x18, 0x0C, 0x31, 0x00, 0xE7, 0x30, 0x07, 0xE6, 0x00, 0x3C, 0x40, 0x00, 0x0C, 0x7C, 0x00, 0x8F, 0xE0, 0x19, 0xC7, 0x01, 0x18, 0x30, 0x31, 0x83, 0x02, 0x1C, 0x70, 0x40, 0xFE, 0x04, 0x07, 0xC0, +/* '&' 0x26 */ 0x0F, 0x00, 0x7E, 0x03, 0x9C, 0x0C, 0x30, 0x30, 0xC0, 0xE7, 0x01, 0xF8, 0x03, 0x80, 0x3E, 0x01, 0xCC, 0x6E, 0x39, 0xB0, 0x7C, 0xC0, 0xF3, 0x03, 0xCE, 0x1F, 0x9F, 0xE6, 0x3E, 0x1C, +/* ''' 0x27 */ 0xFF, 0xA0, +/* '(' 0x28 */ 0x08, 0x8C, 0x46, 0x31, 0x98, 0xC6, 0x31, 0x8C, 0x63, 0x08, 0x63, 0x08, 0x61, 0x0C, 0x20, +/* ')' 0x29 */ 0x82, 0x18, 0xC3, 0x18, 0xC3, 0x18, 0xC6, 0x31, 0x8C, 0x62, 0x31, 0x88, 0xC4, 0x62, 0x00, +/* '*' 0x2A */ 0x10, 0x23, 0x5B, 0xE3, 0x8D, 0x91, 0x00, +/* '+' 0x2B */ 0x0C, 0x03, 0x00, 0xC0, 0x30, 0xFF, 0xFF, 0xF0, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, +/* ',' 0x2C */ 0xF5, 0x60, +/* '-' 0x2D */ 0xFF, 0xF0, +/* '.' 0x2E */ 0xF0, +/* '/' 0x2F */ 0x02, 0x0C, 0x10, 0x20, 0xC1, 0x02, 0x0C, 0x10, 0x20, 0xC1, 0x02, 0x0C, 0x10, 0x20, 0xC1, 0x00, +/* '0' 0x30 */ 0x1F, 0x07, 0xF1, 0xC7, 0x30, 0x6C, 0x0F, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3E, 0x0E, 0xC1, 0x9C, 0x71, 0xFC, 0x1F, 0x00, +/* '1' 0x31 */ 0x08, 0xCF, 0xFF, 0x8C, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18, +/* '2' 0x32 */ 0x1F, 0x0F, 0xF9, 0x87, 0x60, 0x7C, 0x06, 0x00, 0xC0, 0x18, 0x07, 0x01, 0xC0, 0xF0, 0x78, 0x1C, 0x06, 0x00, 0xC0, 0x30, 0x07, 0xFF, 0xFF, 0xE0, +/* '3' 0x33 */ 0x3F, 0x0F, 0xF3, 0x87, 0x60, 0x6C, 0x0C, 0x01, 0x80, 0x60, 0x78, 0x0F, 0x80, 0x18, 0x01, 0x80, 0x3C, 0x07, 0x80, 0xD8, 0x73, 0xFC, 0x3F, 0x00, +/* '4' 0x34 */ 0x01, 0x80, 0x70, 0x0E, 0x03, 0xC0, 0xD8, 0x1B, 0x06, 0x61, 0x8C, 0x21, 0x8C, 0x33, 0x06, 0x7F, 0xFF, 0xFE, 0x03, 0x00, 0x60, 0x0C, 0x01, 0x80, +/* '5' 0x35 */ 0x3F, 0xCF, 0xF9, 0x80, 0x30, 0x06, 0x00, 0xDE, 0x1F, 0xE7, 0x0E, 0x00, 0xE0, 0x0C, 0x01, 0x80, 0x30, 0x07, 0x81, 0xB8, 0x73, 0xFC, 0x1F, 0x00, +/* '6' 0x36 */ 0x0F, 0x07, 0xF9, 0xC3, 0x30, 0x74, 0x01, 0x80, 0x33, 0xC7, 0xFE, 0xF1, 0xDC, 0x1F, 0x01, 0xE0, 0x3C, 0x06, 0xC1, 0xDC, 0x71, 0xFC, 0x1F, 0x00, +/* '7' 0x37 */ 0xFF, 0xFF, 0xFC, 0x01, 0x00, 0x60, 0x18, 0x02, 0x00, 0xC0, 0x30, 0x06, 0x01, 0x80, 0x30, 0x04, 0x01, 0x80, 0x30, 0x06, 0x01, 0x80, 0x30, 0x00, +/* '8' 0x38 */ 0x1F, 0x07, 0xF1, 0xC7, 0x30, 0x66, 0x0C, 0xC1, 0x8C, 0x61, 0xF8, 0x3F, 0x8E, 0x3B, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xD8, 0x31, 0xFC, 0x1F, 0x00, +/* '9' 0x39 */ 0x1F, 0x07, 0xF1, 0xC7, 0x70, 0x6C, 0x07, 0x80, 0xF0, 0x1E, 0x07, 0x61, 0xEF, 0xFC, 0x79, 0x80, 0x30, 0x05, 0xC1, 0x98, 0x73, 0xFC, 0x1E, 0x00, +/* ':' 0x3A */ 0xF0, 0x00, 0x03, 0xC0, +/* ';' 0x3B */ 0xF0, 0x00, 0x0F, 0x56, +/* '<' 0x3C */ 0x00, 0x70, 0x1E, 0x0F, 0x83, 0xC0, 0xF0, 0x0E, 0x00, 0x7C, 0x00, 0xF0, 0x03, 0xC0, 0x0F, 0x00, 0x10, +/* '=' 0x3D */ 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, +/* '>' 0x3E */ 0xE0, 0x07, 0x80, 0x1F, 0x00, 0x7C, 0x00, 0xF0, 0x07, 0x01, 0xE0, 0xF0, 0x3C, 0x0F, 0x00, 0x80, 0x00, +/* '?' 0x3F */ 0x3F, 0x1F, 0xEE, 0x1F, 0x03, 0xC0, 0xC0, 0x30, 0x0C, 0x06, 0x03, 0x81, 0xC0, 0xE0, 0x30, 0x0C, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x03, 0x00, +/* '@' 0x40 */ 0x00, 0xFE, 0x00, 0x0F, 0xFE, 0x00, 0xF0, 0x3E, 0x07, 0x00, 0x3C, 0x38, 0x00, 0x38, 0xC1, 0xE0, 0x66, 0x0F, 0xD9, 0xD8, 0x61, 0xC3, 0xC3, 0x07, 0x0F, 0x1C, 0x1C, 0x3C, 0x60, 0x60, 0xF1, 0x81, 0x83, 0xC6, 0x06, 0x1B, 0x18, 0x38, 0xEE, 0x71, 0xE7, 0x18, 0xFD, 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0x00, 0x40, +/* 'R' 0x52 */ 0xFF, 0xE3, 0xFF, 0xCC, 0x03, 0xB0, 0x06, 0xC0, 0x1B, 0x00, 0x6C, 0x01, 0xB0, 0x0C, 0xFF, 0xE3, 0xFF, 0xCC, 0x03, 0xB0, 0x06, 0xC0, 0x1B, 0x00, 0x6C, 0x01, 0xB0, 0x06, 0xC0, 0x1B, 0x00, 0x70, +/* 'S' 0x53 */ 0x0F, 0xE0, 0x7F, 0xC3, 0x83, 0x98, 0x07, 0x60, 0x0D, 0x80, 0x07, 0x00, 0x1E, 0x00, 0x3F, 0x80, 0x3F, 0xC0, 0x0F, 0x80, 0x07, 0xC0, 0x0F, 0x00, 0x3E, 0x00, 0xDE, 0x0E, 0x3F, 0xF0, 0x3F, 0x80, +/* 'T' 0x54 */ 0xFF, 0xFF, 0xFF, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, +/* 'U' 0x55 */ 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x80, 0xEE, 0x0E, 0x3F, 0xE0, 0xFC, 0x00, +/* 'V' 0x56 */ 0xC0, 0x0F, 0x00, 0x7E, 0x01, 0x98, 0x06, 0x60, 0x39, 0xC0, 0xC3, 0x03, 0x0C, 0x1C, 0x38, 0x60, 0x61, 0x81, 0x8E, 0x07, 0x30, 0x0C, 0xC0, 0x37, 0x00, 0xF8, 0x01, 0xE0, 0x07, 0x80, 0x1C, 0x00, +/* 'W' 0x57 */ 0xE0, 0x30, 0x1D, 0x80, 0xE0, 0x76, 0x07, 0x81, 0xDC, 0x1E, 0x06, 0x70, 0x7C, 0x18, 0xC1, 0xB0, 0xE3, 0x0C, 0xC3, 0x8C, 0x33, 0x0C, 0x38, 0xC6, 0x30, 0x67, 0x18, 0xC1, 0x98, 0x67, 0x06, 0x61, 0xD8, 0x1D, 0x83, 0x60, 0x3C, 0x0D, 0x80, 0xF0, 0x3E, 0x03, 0xC0, 0x70, 0x0F, 0x01, 0xC0, 0x18, 0x07, 0x00, +/* 'X' 0x58 */ 0xE0, 0x1D, 0x80, 0xE7, 0x03, 0x0E, 0x1C, 0x18, 0x60, 0x73, 0x00, 0xFC, 0x01, 0xE0, 0x07, 0x00, 0x1E, 0x00, 0xF8, 0x03, 0x30, 0x1C, 0xE0, 0xE1, 0x83, 0x07, 0x1C, 0x0E, 0xE0, 0x1B, 0x00, 0x70, +/* 'Y' 0x59 */ 0xC0, 0x0F, 0x80, 0x76, 0x01, 0x9C, 0x0C, 0x38, 0x70, 0x61, 0x81, 0xCE, 0x03, 0x30, 0x0F, 0x80, 0x1E, 0x00, 0x30, 0x00, 0xC0, 0x03, 0x00, 0x0C, 0x00, 0x30, 0x00, 0xC0, 0x03, 0x00, 0x0C, 0x00, +/* 'Z' 0x5A */ 0xFF, 0xFF, 0xFF, 0xC0, 0x0E, 0x00, 0xE0, 0x0E, 0x00, 0x60, 0x07, 0x00, 0x70, 0x07, 0x00, 0x30, 0x03, 0x80, 0x38, 0x03, 0x80, 0x18, 0x01, 0xC0, 0x1C, 0x00, 0xFF, 0xFF, 0xFF, 0xC0, +/* '[' 0x5B */ 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCF, 0xF0, +/* '\' 0x5C */ 0x81, 0x81, 0x02, 0x06, 0x04, 0x08, 0x18, 0x10, 0x20, 0x60, 0x40, 0x81, 0x81, 0x02, 0x06, 0x04, +/* ']' 0x5D */ 0xFF, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3F, 0xF0, +/* '^' 0x5E */ 0x0C, 0x0E, 0x05, 0x86, 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 0x0E, 0x00, +/* 'z' 0x7A */ 0xFF, 0xFF, 0xF0, 0x18, 0x0C, 0x07, 0x03, 0x81, 0xC0, 0x60, 0x30, 0x18, 0x0E, 0x03, 0xFF, 0xFF, 0xC0, +/* '{' 0x7B */ 0x19, 0xCC, 0x63, 0x18, 0xC6, 0x31, 0x99, 0x86, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x1C, 0x60, +/* '|' 0x7C */ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, +/* '}' 0x7D */ 0xC7, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x0C, 0x33, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0x73, 0x00, +/* '~' 0x7E */ 0x70, 0x3E, 0x09, 0xE4, 0x1F, 0x03, 0x80, +/* 0x7F */ +/* 0x80 */ 0x01, 0xF0, 0x1F, 0xF0, 0xE0, 0xC7, 0x00, 0x18, 0x00, 0xC0, 0x07, 0xFF, 0x3F, 0xFC, 0x30, 0x01, 0xFF, 0x8F, 0xFC, 0x0C, 0x00, 0x18, 0x00, 0x70, 0x00, 0xE0, 0x81, 0xFE, 0x03, 0xF0, +/* 0x81 */ +/* 0x82 */ 0xF5, 0x80, +/* 0x83 */ +/* 0x84 */ 0xCF, 0x34, 0x51, 0x88, +/* 0x85 */ 0xC6, 0x3C, 0x63, +/* 0x86 */ 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x3F, 0xFF, 0xFC, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x00, +/* 0x87 */ 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x3F, 0xFF, 0xFC, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x0F, 0xFF, 0xFF, 0x0C, 0x03, 0x00, 0xC0, 0x30, +/* 0x88 */ +/* 0x89 */ 0x38, 0x18, 0x00, 0xF8, 0x30, 0x03, 0x18, 0xC0, 0x04, 0x11, 0x80, 0x0C, 0x66, 0x00, 0x0F, 0x8C, 0x00, 0x0E, 0x30, 0x00, 0x00, 0x40, 0x00, 0x01, 0x80, 0x00, 0x06, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x31, 0xC0, 0xE0, 0x67, 0xC3, 0xC1, 0x98, 0xCC, 0xC3, 0x20, 0x90, 0x8C, 0x63, 0x33, 0x10, 0x7C, 0x3C, 0x60, 0x70, 0x38, +/* 0x8A */ 0x0C, 0x40, 0x1F, 0x00, 0x38, 0x03, 0xF8, 0x1F, 0xF0, 0xE0, 0xE6, 0x01, 0xD8, 0x03, 0x60, 0x01, 0xC0, 0x07, 0x80, 0x0F, 0xE0, 0x0F, 0xF0, 0x03, 0xE0, 0x01, 0xF0, 0x03, 0xC0, 0x0F, 0x80, 0x37, 0x83, 0x8F, 0xFC, 0x0F, 0xE0, +/* 0x8B */ 0x2F, 0x49, 0x99, +/* 0x8C */ 0x01, 0x80, 0x0C, 0x00, 0x60, 0x00, 0x00, 0x0F, 0xE0, 0x7F, 0xC3, 0x83, 0x98, 0x07, 0x60, 0x0D, 0x80, 0x07, 0x00, 0x1E, 0x00, 0x3F, 0x80, 0x3F, 0xC0, 0x0F, 0x80, 0x07, 0xC0, 0x0F, 0x00, 0x3E, 0x00, 0xDE, 0x0E, 0x3F, 0xF0, 0x3F, 0x80, +/* 0x8D */ 0x0C, 0xC0, 0xF8, 0x07, 0x0F, 0xFF, 0xFF, 0xF0, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, +/* 0x8E */ 0x0C, 0xC0, 0x3C, 0x00, 0xE1, 0xFF, 0xFF, 0xFF, 0x80, 0x1C, 0x01, 0xC0, 0x1C, 0x00, 0xC0, 0x0E, 0x00, 0xE0, 0x0E, 0x00, 0x60, 0x07, 0x00, 0x70, 0x07, 0x00, 0x30, 0x03, 0x80, 0x38, 0x01, 0xFF, 0xFF, 0xFF, 0x80, +/* 0x8F */ 0x01, 0x80, 0x18, 0x01, 0x80, 0x00, 0x0F, 0xFF, 0xFF, 0xFC, 0x00, 0xE0, 0x0E, 0x00, 0xE0, 0x06, 0x00, 0x70, 0x07, 0x00, 0x70, 0x03, 0x00, 0x38, 0x03, 0x80, 0x38, 0x01, 0x80, 0x1C, 0x01, 0xC0, 0x0F, 0xFF, 0xFF, 0xFC, +/* 0x90 */ +/* 0x91 */ 0x6A, 0xF0, +/* 0x92 */ 0xF5, 0x60, +/* 0x93 */ 0x4E, 0x28, 0xA2, 0xCF, 0x30, +/* 0x94 */ 0xCF, 0x34, 0x51, 0x4E, 0x20, +/* 0x95 */ 0x7B, 0xFF, 0xFF, 0xFD, 0xE0, +/* 0x96 */ 0xFF, 0xFF, 0xF0, +/* 0x97 */ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, +/* 0x98 */ +/* 0x99 */ 0xFF, 0x70, 0x1F, 0xFD, 0xC0, 0x71, 0x87, 0x83, 0xC6, 0x1E, 0x0F, 0x18, 0x68, 0x3C, 0x61, 0xB1, 0xB1, 0x86, 0xC6, 0xC6, 0x19, 0x1B, 0x18, 0x66, 0xCC, 0x61, 0x9B, 0x31, 0x86, 0x3C, 0xC6, 0x18, 0xE3, 0x18, 0x63, 0x8C, +/* 0x9A */ 0x63, 0x0D, 0x83, 0x60, 0x70, 0x00, 0x0F, 0x87, 0xFB, 0x86, 0xC0, 0x30, 0x0F, 0x01, 0xFC, 0x0F, 0xC0, 0x7C, 0x0F, 0x87, 0x7F, 0x8F, 0xC0, +/* 0x9B */ 0x99, 0x92, 0xF4, +/* 0x9C */ 0x07, 0x03, 0x80, 0xC0, 0x60, 0x00, 0x0F, 0x87, 0xFB, 0x86, 0xC0, 0x30, 0x0F, 0x01, 0xFC, 0x0F, 0xC0, 0x7C, 0x0F, 0x87, 0x7F, 0x8F, 0xC0, +/* 0x9D */ 0x03, 0x06, 0x66, 0x64, 0x60, 0xF8, 0xF8, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, 0x38, +/* 0x9E */ 0x63, 0x0C, 0x83, 0x60, 0x70, 0x00, 0x3F, 0xFF, 0xFC, 0x06, 0x03, 0x01, 0xC0, 0xE0, 0x70, 0x18, 0x0C, 0x06, 0x03, 0x80, 0xFF, 0xFF, 0xF0, +/* 0x9F */ 0x07, 0x01, 0x80, 0xC0, 0x20, 0x00, 0x3F, 0xFF, 0xFC, 0x06, 0x03, 0x01, 0xC0, 0xE0, 0x70, 0x18, 0x0C, 0x06, 0x03, 0x80, 0xFF, 0xFF, 0xF0, +/* 0xA0 */ +/* 0xA1 */ 0xC6, 0xD9, 0xB1, 0xC0, +/* 0xA2 */ 0x83, 0x8D, 0xF1, 0xC0, +/* 0xA3 */ 0x30, 0x01, 0x80, 0x0C, 0x00, 0x60, 0x03, 0x00, 0x18, 0x80, 0xCC, 0x06, 0xC0, 0x3C, 0x01, 0xC0, 0x3C, 0x01, 0x60, 0x03, 0x00, 0x18, 0x00, 0xC0, 0x06, 0x00, 0x3F, 0xF9, 0xFF, 0xC0, +/* 0xA4 */ 0xDD, 0xFF, 0xD8, 0xD8, 0x3C, 0x1E, 0x0F, 0x8D, 0xFF, 0xDD, 0x80, +/* 0xA5 */ 0x03, 0x80, 0x03, 0xC0, 0x07, 0xC0, 0x07, 0xC0, 0x04, 0xE0, 0x0C, 0xE0, 0x0C, 0xE0, 0x08, 0x70, 0x18, 0x70, 0x18, 0x70, 0x10, 0x38, 0x3F, 0xF8, 0x3F, 0xF8, 0x30, 0x1C, 0x70, 0x0C, 0x60, 0x0C, 0x60, 0x0E, 0xE0, 0x06, 0x00, 0x0E, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x0F, +/* 0xA6 */ 0xFF, 0xFF, 0xF0, 0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 0xFF, 0xE3, 0xC7, 0x00, 0x30, 0x03, 0x00, 0x18, 0x00, 0xC0, 0x03, 0xC0, +/* 0xBA */ 0x3F, 0x1F, 0xEE, 0x1B, 0x00, 0xC0, 0x3C, 0x07, 0xF0, 0x3E, 0x01, 0xF0, 0x3C, 0x0D, 0xDE, 0x7F, 0x02, 0x01, 0xE0, 0x18, 0x46, 0x0F, 0x00, +/* 0xBB */ 0x88, 0xC6, 0xE7, 0x21, 0x21, 0xE7, 0xC6, 0x88, +/* 0xBC */ 0xC3, 0x31, 0x8C, 0x63, 0x10, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xFF, 0xFF, 0xF0, +/* 0xBD */ 0x77, 0x66, 0xCC, 0xC8, +/* 0xBE */ 0xC7, 0x9B, 0x36, 0xCC, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x80, +/* 0xBF */ 0x0C, 0x03, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xF0, 0x18, 0x0C, 0x07, 0x03, 0x81, 0xC0, 0x60, 0x30, 0x18, 0x0E, 0x03, 0xFF, 0xFF, 0xC0, +/* 0xC0 */ 0x03, 0x80, 0x18, 0x00, 0x40, 0x00, 0x00, 0xFF, 0xE3, 0xFF, 0xCC, 0x03, 0xB0, 0x06, 0xC0, 0x1B, 0x00, 0x6C, 0x01, 0xB0, 0x0C, 0xFF, 0xE3, 0xFF, 0xCC, 0x03, 0xB0, 0x06, 0xC0, 0x1B, 0x00, 0x6C, 0x01, 0xB0, 0x06, 0xC0, 0x1B, 0x00, 0x70, +/* 0xC1 */ 0x01, 0xC0, 0x0C, 0x00, 0x20, 0x00, 0x00, 0x07, 0x80, 0x1E, 0x00, 0x78, 0x03, 0xF0, 0x0C, 0xC0, 0x33, 0x01, 0xCE, 0x06, 0x18, 0x18, 0x60, 0xE1, 0xC3, 0x03, 0x0F, 0xFC, 0x7F, 0xF9, 0x80, 0x66, 0x01, 0xB8, 0x07, 0xC0, 0x0F, 0x00, 0x30, +/* 0xC2 */ 0x07, 0x00, 0x3E, 0x01, 0x8C, 0x00, 0x00, 0x07, 0x80, 0x1E, 0x00, 0x78, 0x03, 0xF0, 0x0C, 0xC0, 0x33, 0x01, 0xCE, 0x06, 0x18, 0x18, 0x60, 0xE1, 0xC3, 0x03, 0x0F, 0xFC, 0x7F, 0xF9, 0x80, 0x66, 0x01, 0xB8, 0x07, 0xC0, 0x0F, 0x00, 0x30, +/* 0xC3 */ 0x10, 0x40, 0x63, 0x00, 0xF8, 0x01, 0xE0, 0x07, 0x80, 0x1E, 0x00, 0x78, 0x03, 0xF0, 0x0C, 0xC0, 0x33, 0x01, 0xCE, 0x06, 0x18, 0x18, 0x60, 0xE1, 0xC3, 0x03, 0x0F, 0xFC, 0x7F, 0xF9, 0x80, 0x66, 0x01, 0xB8, 0x07, 0xC0, 0x0F, 0x00, 0x30, +/* 0xC4 */ 0x0C, 0xC0, 0x33, 0x00, 0x00, 0x01, 0xE0, 0x07, 0x80, 0x1E, 0x00, 0xFC, 0x03, 0x30, 0x0C, 0xC0, 0x73, 0x81, 0x86, 0x06, 0x18, 0x38, 0x70, 0xC0, 0xC3, 0xFF, 0x1F, 0xFE, 0x60, 0x19, 0x80, 0x6E, 0x01, 0xF0, 0x03, 0xC0, 0x0C, +/* 0xC5 */ 0x18, 0x0C, 0x06, 0x00, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xFF, 0xFF, 0xF0, +/* 0xC6 */ 0x00, 0xC0, 0x03, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x7E, 0x03, 0xFF, 0x0E, 0x07, 0x38, 0x07, 0x60, 0x06, 0xC0, 0x03, 0x00, 0x06, 0x00, 0x0C, 0x00, 0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0xE0, 0x06, 0xC0, 0x0D, 0xC0, 0x31, 0xE0, 0xE1, 0xFF, 0x80, 0xFC, 0x00, +/* 0xC7 */ 0x07, 0xE0, 0x3F, 0xF0, 0xE0, 0x73, 0x80, 0x66, 0x00, 0x7C, 0x00, 0x30, 0x00, 0x60, 0x00, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x6C, 0x01, 0xDC, 0x03, 0x1C, 0x1E, 0x1F, 0xF8, 0x0F, 0xC0, 0x08, 0x00, 0x1E, 0x00, 0x0C, 0x01, 0x18, 0x01, 0xE0, 0x00, +/* 0xC8 */ 0x06, 0x30, 0x07, 0xC0, 0x07, 0x00, 0x3F, 0x01, 0xFF, 0x87, 0x03, 0x9C, 0x03, 0xB0, 0x03, 0x60, 0x01, 0x80, 0x03, 0x00, 0x06, 0x00, 0x0C, 0x00, 0x18, 0x00, 0x30, 0x00, 0x70, 0x03, 0x60, 0x06, 0xE0, 0x18, 0xF0, 0x70, 0xFF, 0xC0, 0x7E, 0x00, +/* 0xC9 */ 0x07, 0x00, 0x60, 0x0C, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xFF, 0xEF, 0xFE, 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xFF, 0xFF, 0xFF, +/* 0xCA */ 0xFF, 0xE7, 0xFF, 0x30, 0x01, 0x80, 0x0C, 0x00, 0x60, 0x03, 0x00, 0x18, 0x00, 0xFF, 0xE7, 0xFF, 0x30, 0x01, 0x80, 0x0C, 0x00, 0x60, 0x03, 0x00, 0x18, 0x00, 0xFF, 0xF7, 0xFF, 0x80, 0x18, 0x01, 0x80, 0x0C, 0x00, 0x60, 0x01, 0xE0, +/* 0xCB */ 0x19, 0x81, 0x98, 0x00, 0x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xD8, 0x1E, 0xE0, 0xF3, 0x07, 0x9C, 0x3C, 0x61, 0xE1, 0x8F, 0x0E, 0x78, 0x33, 0xC1, 0xDE, 0x06, 0xF0, 0x1F, 0x80, 0xFC, 0x03, 0xE0, 0x1C, +/* 0xD2 */ 0x0C, 0xC0, 0x3C, 0x00, 0xE1, 0xC0, 0x3E, 0x01, 0xF8, 0x0F, 0xC0, 0x7B, 0x03, 0xDC, 0x1E, 0x60, 0xF3, 0x87, 0x8C, 0x3C, 0x31, 0xE1, 0xCF, 0x06, 0x78, 0x3B, 0xC0, 0xDE, 0x03, 0xF0, 0x1F, 0x80, 0x7C, 0x03, 0x80, +/* 0xD3 */ 0x00, 0xE0, 0x00, 0x60, 0x00, 0x40, 0x00, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0xE0, 0xF0, 0x78, 0x60, 0x0C, 0x60, 0x03, 0x30, 0x01, 0xB0, 0x00, 0x78, 0x00, 0x3C, 0x00, 0x1E, 0x00, 0x0F, 0x00, 0x07, 0x80, 0x03, 0x60, 0x03, 0x30, 0x01, 0x8C, 0x01, 0x87, 0x83, 0xC1, 0xFF, 0xC0, 0x3F, 0x80, +/* 0xD4 */ 0x03, 0xC0, 0x01, 0xE0, 0x01, 0x98, 0x00, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0xE0, 0xF0, 0x78, 0x60, 0x0C, 0x60, 0x03, 0x30, 0x01, 0xB0, 0x00, 0x78, 0x00, 0x3C, 0x00, 0x1E, 0x00, 0x0F, 0x00, 0x07, 0x80, 0x03, 0x60, 0x03, 0x30, 0x01, 0x8C, 0x01, 0x87, 0x83, 0xC1, 0xFF, 0xC0, 0x3F, 0x80, +/* 0xD5 */ 0x03, 0xB8, 0x01, 0x98, 0x00, 0x98, 0x00, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0xE0, 0xF0, 0x78, 0x60, 0x0C, 0x60, 0x03, 0x30, 0x01, 0xB0, 0x00, 0x78, 0x00, 0x3C, 0x00, 0x1E, 0x00, 0x0F, 0x00, 0x07, 0x80, 0x03, 0x60, 0x03, 0x30, 0x01, 0x8C, 0x01, 0x87, 0x83, 0xC1, 0xFF, 0xC0, 0x3F, 0x80, +/* 0xD6 */ 0x06, 0x30, 0x03, 0x18, 0x00, 0x00, 0x00, 0xFE, 0x01, 0xFF, 0xC1, 0xE0, 0xF0, 0xC0, 0x18, 0xC0, 0x06, 0x60, 0x03, 0x60, 0x00, 0xF0, 0x00, 0x78, 0x00, 0x3C, 0x00, 0x1E, 0x00, 0x0F, 0x00, 0x06, 0xC0, 0x06, 0x60, 0x03, 0x18, 0x03, 0x0F, 0x07, 0x83, 0xFF, 0x80, 0x7F, 0x00, +/* 0xD7 */ 0x81, 0xC3, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0xC3, 0x81, +/* 0xD8 */ 0x0C, 0xC0, 0x1E, 0x00, 0x78, 0x3F, 0xF8, 0xFF, 0xF3, 0x00, 0xEC, 0x01, 0xB0, 0x06, 0xC0, 0x1B, 0x00, 0x6C, 0x03, 0x3F, 0xF8, 0xFF, 0xF3, 0x00, 0xEC, 0x01, 0xB0, 0x06, 0xC0, 0x1B, 0x00, 0x6C, 0x01, 0xB0, 0x06, 0xC0, 0x1C, +/* 0xD9 */ 0x03, 0x00, 0x7C, 0x03, 0x70, 0x19, 0x80, 0xF8, 0x03, 0xC3, 0x00, 0x78, 0x03, 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3E, 0x03, 0xB8, 0x38, 0xFF, 0x83, 0xF0, +/* 0xDA */ 0x03, 0x80, 0x18, 0x01, 0x80, 0x00, 0x0C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1E, 0x00, 0xF8, 0x0E, 0xE0, 0xE3, 0xFE, 0x0F, 0xC0, +/* 0xDB */ 0x0E, 0xE0, 0x66, 0x03, 0x60, 0x00, 0x0C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1E, 0x00, 0xF8, 0x0E, 0xE0, 0xE3, 0xFE, 0x0F, 0xC0, +/* 0xDC */ 0x0C, 0xC0, 0x66, 0x00, 0x01, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1F, 0x01, 0xDC, 0x1C, 0x7F, 0xC1, 0xF8, 0x00, +/* 0xDD */ 0x01, 0x80, 0x0C, 0x00, 0x60, 0x00, 0x00, 0xC0, 0x0F, 0x80, 0x76, 0x01, 0x9C, 0x0C, 0x38, 0x70, 0x61, 0x81, 0xCE, 0x03, 0x30, 0x0F, 0x80, 0x1E, 0x00, 0x30, 0x00, 0xC0, 0x03, 0x00, 0x0C, 0x00, 0x30, 0x00, 0xC0, 0x03, 0x00, 0x0C, 0x00, +/* 0xDE */ 0xFF, 0xFF, 0xFF, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x04, 0x00, 0x78, 0x01, 0x81, 0x18, 0x0F, 0x00, +/* 0xDF */ 0x1F, 0x0F, 0xF3, 0x87, 0x60, 0x6C, 0x0D, 0x81, 0xB0, 0x66, 0x38, 0xC7, 0xD8, 0x1B, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x3E, 0x0E, 0xCF, 0x99, 0xE0, +/* 0xE0 */ 0x0C, 0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 0x38, 0x37, 0x1C, 0xFE, 0x1F, 0x02, 0x00, 0xE0, 0x0C, 0x23, 0x07, 0x80, +/* 0xE8 */ 0x21, 0x0C, 0xC1, 0xE0, 0x78, 0x00, 0x07, 0xC3, 0xF9, 0x87, 0xE0, 0xF0, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0E, 0x0D, 0xC7, 0x3F, 0x87, 0xC0, +/* 0xE9 */ 0x03, 0x00, 0xC0, 0x30, 0x04, 0x00, 0x00, 0x3E, 0x0F, 0xE3, 0x8E, 0xE0, 0x78, 0x0F, 0xFF, 0xFF, 0xFC, 0x01, 0x80, 0x38, 0x1B, 0x86, 0x3F, 0x83, 0xE0, +/* 0xEA */ 0x1F, 0x07, 0xF1, 0x87, 0x60, 0x6C, 0x07, 0xFF, 0xFF, 0xFE, 0x00, 0xC0, 0x1C, 0x1D, 0x87, 0x1F, 0xC1, 0xF8, 0x06, 0x01, 0x80, 0x30, 0x06, 0x00, 0x78, +/* 0xEB */ 0x31, 0x86, 0x30, 0x00, 0x00, 0x01, 0xF0, 0x7F, 0x1C, 0x77, 0x03, 0xC0, 0x7F, 0xFF, 0xFF, 0xE0, 0x0C, 0x01, 0xC0, 0xDC, 0x31, 0xFC, 0x1F, 0x00, +/* 0xEC */ 0x31, 0x82, 0x60, 0x6C, 0x07, 0x00, 0x00, 0x3E, 0x0F, 0xE3, 0x8E, 0xE0, 0x78, 0x0F, 0xFF, 0xFF, 0xFC, 0x01, 0x80, 0x38, 0x1B, 0x86, 0x3F, 0x83, 0xE0, +/* 0xED */ 0x39, 0x99, 0x80, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0x31, 0x80, +/* 0xEE */ 0x71, 0xED, 0xA3, 0x00, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC0, +/* 0xEF */ 0x00, 0x67, 0x00, 0x66, 0x00, 0x64, 0x00, 0x6C, 0x00, 0x60, 0x1E, 0x60,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06, 0xC0, 0x78, 0x0E, 0x01, 0xC0, 0x30, 0x06, 0x01, 0xC0, 0xF0, 0x1C, 0x00, +/* 0xFE */ 0x61, 0x86, 0x3E, 0xF9, 0x86, 0x18, 0x61, 0x86, 0x18, 0x61, 0x87, 0x8E, 0x10, 0x83, 0xC3, 0x78, +/* 0xFF */ 0xF0, +}; + +const GFXglyph FreeSans12pt_Win1250Glyphs[] PROGMEM = { +/* 0x01 */ { 0, 19, 20, 21, 1, -17 }, +/* 0x02 */ { 48, 19, 20, 21, 1, -17 }, +/* 0x03 */ { 96, 21, 20, 23, 1, -17 }, +/* 0x04 */ { 149, 21, 20, 23, 1, -17 }, +/* 0x05 */ { 202, 20, 20, 22, 1, -17 }, +/* 0x06 */ { 252, 20, 20, 22, 1, -17 }, +/* 0x07 */ { 302, 0, 0, 8, 0, 0 }, +/* 0x08 */ { 302, 23, 20, 25, 1, -17 }, +/* 0x09 */ { 360, 23, 16, 25, 1, -16 }, +/* 0x0A */ { 406, 0, 0, 8, 0, 0 }, +/* 0x0B */ { 406, 21, 20, 23, 1, -17 }, +/* 0x0C */ { 459, 19, 18, 21, 1, -15 }, +/* 0x0D */ { 502, 0, 0, 8, 0, 0 }, +/* 0x0E */ { 502, 20, 20, 22, 1, -17 }, +/* 0x0F */ { 552, 21, 21, 23, 1, -18 }, +/* 0x10 */ { 608, 19, 20, 21, 1, -17 }, +/* 0x11 */ { 656, 21, 20, 23, 1, -17 }, +/* 0x12 */ { 709, 20, 20, 22, 1, -17 }, +/* 0x13 */ { 759, 21, 20, 23, 1, -17 }, +/* 0x14 */ { 812, 21, 20, 23, 1, -17 }, +/* 0x15 */ { 865, 22, 20, 24, 1, -17 }, +/* 0x16 */ { 920, 16, 20, 18, 1, -17 }, +/* 0x17 */ { 960, 21, 20, 23, 1, -17 }, +/* 0x18 */ { 1013, 23, 20, 25, 1, -17 }, +/* 0x19 */ { 1071, 21, 20, 23, 1, -17 }, +/* 0x1A */ { 1124, 15, 19, 17, 1, -16 }, +/* 0x1B */ { 1160, 24, 21, 26, 1, -18 }, +/* 0x1C */ { 1223, 21, 20, 23, 1, -17 }, +/* 0x1D */ { 1276, 21, 21, 23, 1, -18 }, +/* 0x1E */ { 1332, 20, 20, 22, 1, -17 }, +/* 0x1F */ { 1382, 15, 20, 17, 1, -17 }, +/* ' ' 0x20 */ { 1420, 0, 0, 6, 0, 0 }, +/* '!' 0x21 */ { 1420, 2, 18, 8, 3, -16 }, +/* '"' 0x22 */ { 1425, 6, 6, 8, 1, -15 }, +/* '#' 0x23 */ { 1430, 13, 16, 13, 0, -14 }, +/* '$' 0x24 */ { 1456, 11, 20, 13, 1, -16 }, +/* '%' 0x25 */ { 1484, 20, 17, 21, 1, -15 }, +/* '&' 0x26 */ { 1527, 14, 17, 16, 1, -15 }, +/* ''' 0x27 */ { 1557, 2, 6, 5, 1, -15 }, +/* '(' 0x28 */ { 1559, 5, 23, 8, 2, -16 }, +/* ')' 0x29 */ { 1574, 5, 23, 8, 1, -16 }, +/* '*' 0x2A */ { 1589, 7, 7, 9, 1, -16 }, +/* '+' 0x2B */ { 1596, 10, 11, 14, 2, -9 }, +/* ',' 0x2C */ { 1610, 2, 6, 7, 2, 0 }, +/* '-' 0x2D */ { 1612, 6, 2, 8, 1, -6 }, +/* '.' 0x2E */ { 1614, 2, 2, 6, 2, 0 }, +/* '/' 0x2F */ { 1615, 7, 18, 7, 0, -16 }, +/* '0' 0x30 */ { 1631, 11, 17, 13, 1, -15 }, +/* '1' 0x31 */ { 1655, 5, 17, 13, 3, -15 }, +/* '2' 0x32 */ { 1666, 11, 17, 13, 1, -15 }, +/* '3' 0x33 */ { 1690, 11, 17, 13, 1, -15 }, +/* '4' 0x34 */ { 1714, 11, 17, 13, 1, -15 }, +/* '5' 0x35 */ { 1738, 11, 17, 13, 1, -15 }, +/* '6' 0x36 */ { 1762, 11, 17, 13, 1, -15 }, +/* '7' 0x37 */ { 1786, 11, 17, 13, 1, -15 }, +/* '8' 0x38 */ { 1810, 11, 17, 13, 1, -15 }, +/* '9' 0x39 */ { 1834, 11, 17, 13, 1, -15 }, +/* ':' 0x3A */ { 1858, 2, 13, 6, 2, -11 }, +/* ';' 0x3B */ { 1862, 2, 16, 6, 2, -10 }, +/* '<' 0x3C */ { 1866, 12, 11, 14, 1, -9 }, +/* '=' 0x3D */ { 1883, 12, 6, 14, 1, -7 }, +/* '>' 0x3E */ { 1892, 12, 11, 14, 1, -9 }, +/* '?' 0x3F */ { 1909, 10, 18, 13, 2, -16 }, +/* '@' 0x40 */ { 1932, 22, 21, 24, 1, -16 }, +/* 'A' 0x41 */ { 1990, 14, 18, 16, 1, -16 }, +/* 'B' 0x42 */ { 2022, 13, 18, 16, 2, -16 }, +/* 'C' 0x43 */ { 2052, 15, 18, 17, 1, -16 }, +/* 'D' 0x44 */ { 2086, 14, 18, 17, 2, -16 }, +/* 'E' 0x45 */ { 2118, 12, 18, 15, 2, -16 }, +/* 'F' 0x46 */ { 2145, 11, 18, 14, 2, -16 }, +/* 'G' 0x47 */ { 2170, 16, 18, 18, 1, -16 }, +/* 'H' 0x48 */ { 2206, 13, 18, 17, 2, -16 }, +/* 'I' 0x49 */ { 2236, 2, 18, 7, 2, -16 }, +/* 'J' 0x4A */ { 2241, 9, 18, 13, 1, -16 }, +/* 'K' 0x4B */ { 2262, 13, 18, 16, 2, -16 }, +/* 'L' 0x4C */ { 2292, 10, 18, 14, 2, -16 }, +/* 'M' 0x4D */ { 2315, 16, 18, 20, 2, -16 }, +/* 'N' 0x4E */ { 2351, 13, 18, 18, 2, -16 }, +/* 'O' 0x4F */ { 2381, 17, 18, 19, 1, -16 }, +/* 'P' 0x50 */ { 2420, 12, 18, 16, 2, -16 }, +/* 'Q' 0x51 */ { 2447, 17, 19, 19, 1, -16 }, +/* 'R' 0x52 */ { 2488, 14, 18, 17, 2, -16 }, +/* 'S' 0x53 */ { 2520, 14, 18, 16, 1, -16 }, +/* 'T' 0x54 */ { 2552, 12, 18, 15, 1, -16 }, +/* 'U' 0x55 */ { 2579, 13, 18, 17, 2, -16 }, +/* 'V' 0x56 */ { 2609, 14, 18, 15, 1, -16 }, +/* 'W' 0x57 */ { 2641, 22, 18, 22, 0, -16 }, +/* 'X' 0x58 */ { 2691, 14, 18, 16, 1, -16 }, +/* 'Y' 0x59 */ { 2723, 14, 18, 16, 1, -16 }, +/* 'Z' 0x5A */ { 2755, 13, 18, 15, 1, -16 }, +/* '[' 0x5B */ { 2785, 4, 23, 7, 2, -16 }, +/* '\' 0x5C */ { 2797, 7, 18, 7, 0, -16 }, +/* ']' 0x5D */ { 2813, 4, 23, 7, 1, -16 }, +/* '^' 0x5E */ { 2825, 9, 9, 11, 1, -15 }, +/* '_' 0x5F */ { 2836, 15, 1, 13, -1, 5 }, +/* '`' 0x60 */ { 2838, 5, 4, 6, 1, -16 }, +/* 'a' 0x61 */ { 2841, 12, 13, 13, 1, -11 }, +/* 'b' 0x62 */ { 2861, 12, 18, 13, 1, -16 }, +/* 'c' 0x63 */ { 2888, 10, 13, 12, 1, -11 }, +/* 'd' 0x64 */ { 2905, 11, 18, 13, 1, -16 }, +/* 'e' 0x65 */ { 2930, 11, 13, 13, 1, -11 }, +/* 'f' 0x66 */ { 2948, 5, 18, 7, 1, -16 }, +/* 'g' 0x67 */ { 2960, 11, 18, 13, 1, -11 }, +/* 'h' 0x68 */ { 2985, 10, 18, 13, 1, -16 }, +/* 'i' 0x69 */ { 3008, 2, 18, 5, 2, -16 }, +/* 'j' 0x6A */ { 3013, 4, 23, 6, 0, -16 }, +/* 'k' 0x6B */ { 3025, 10, 18, 12, 1, -16 }, +/* 'l' 0x6C */ { 3048, 2, 18, 5, 1, -16 }, +/* 'm' 0x6D */ { 3053, 17, 13, 19, 1, -11 }, +/* 'n' 0x6E */ { 3081, 10, 13, 13, 1, -11 }, +/* 'o' 0x6F */ { 3098, 11, 13, 13, 1, -11 }, +/* 'p' 0x70 */ { 3116, 12, 17, 13, 1, -11 }, +/* 'q' 0x71 */ { 3142, 11, 17, 13, 1, -11 }, +/* 'r' 0x72 */ { 3166, 6, 13, 8, 1, -11 }, +/* 's' 0x73 */ { 3176, 10, 13, 12, 1, -11 }, +/* 't' 0x74 */ { 3193, 5, 16, 7, 1, -14 }, +/* 'u' 0x75 */ { 3203, 10, 13, 13, 1, -11 }, +/* 'v' 0x76 */ { 3220, 11, 13, 12, 0, -11 }, +/* 'w' 0x77 */ { 3238, 17, 13, 17, 0, -11 }, +/* 'x' 0x78 */ { 3266, 10, 13, 11, 1, -11 }, +/* 'y' 0x79 */ { 3283, 11, 18, 11, 0, -11 }, +/* 'z' 0x7A */ { 3308, 10, 13, 12, 1, -11 }, +/* '{' 0x7B */ { 3325, 5, 23, 8, 1, -16 }, +/* '|' 0x7C */ { 3340, 2, 23, 6, 2, -16 }, +/* '}' 0x7D */ { 3346, 5, 23, 8, 2, -16 }, +/* '~' 0x7E */ { 3361, 10, 5, 12, 1, -9 }, +/* 0x7F */ { 3368, 0, 0, 0, 0, 0 }, +/* 0x80 */ { 3368, 14, 17, 16, 1, -17 }, +/* 0x81 */ { 3398, 0, 0, 8, 0, 0 }, +/* 0x82 */ { 3398, 2, 5, 6, 2, -2 }, +/* 0x83 */ { 3400, 0, 0, 8, 0, 0 }, +/* 0x84 */ { 3400, 6, 5, 10, 2, -2 }, +/* 0x85 */ { 3404, 12, 2, 16, 2, -2 }, +/* 0x86 */ { 3407, 10, 21, 13, 2, -17 }, +/* 0x87 */ { 3434, 10, 20, 13, 2, -17 }, +/* 0x88 */ { 3459, 0, 0, 8, 0, 0 }, +/* 0x89 */ { 3459, 23, 18, 24, 0, -18 }, +/* 0x8A */ { 3511, 14, 21, 16, 1, -21 }, +/* 0x8B */ { 3548, 3, 8, 6, 1, -11 }, +/* 0x8C */ { 3551, 14, 22, 16, 1, -22 }, +/* 0x8D */ { 3590, 12, 21, 15, 1, -21 }, +/* 0x8E */ { 3622, 13, 21, 15, 1, -21 }, +/* 0x8F */ { 3657, 13, 22, 15, 1, -22 }, +/* 0x90 */ { 3693, 0, 0, 8, 0, 0 }, +/* 0x91 */ { 3693, 2, 6, 6, 2, -18 }, +/* 0x92 */ { 3695, 2, 6, 6, 2, -18 }, +/* 0x93 */ { 3697, 6, 6, 10, 2, -18 }, +/* 0x94 */ { 3702, 6, 6, 10, 2, -18 }, +/* 0x95 */ { 3707, 6, 6, 10, 2, -11 }, +/* 0x96 */ { 3712, 10, 2, 12, 1, -8 }, +/* 0x97 */ { 3715, 22, 2, 24, 1, -8 }, +/* 0x98 */ { 3721, 0, 0, 8, 0, 0 }, +/* 0x99 */ { 3721, 22, 13, 24, 2, -18 }, +/* 0x9A */ { 3757, 10, 18, 12, 1, -18 }, +/* 0x9B */ { 3780, 3, 8, 6, 2, -10 }, +/* 0x9C */ { 3783, 10, 18, 12, 1, -18 }, +/* 0x9D */ { 3806, 8, 18, 11, 1, -18 }, +/* 0x9E */ { 3824, 10, 18, 12, 1, -18 }, +/* 0x9F */ { 3847, 10, 18, 12, 1, -18 }, +/* 0xA0 */ { 3870, 0, 0, 7, 0, 0 }, +/* 0xA1 */ { 3870, 7, 4, 8, 0, -18 }, +/* 0xA2 */ { 3874, 7, 4, 8, 0, -18 }, +/* 0xA3 */ { 3878, 13, 18, 15, 1, -18 }, +/* 0xA4 */ { 3908, 9, 9, 13, 2, -13 }, +/* 0xA5 */ { 3919, 16, 23, 16, 1, -18 }, +/* 0xA6 */ { 3965, 2, 23, 6, 2, -18 }, +/* 0xA7 */ { 3971, 11, 23, 13, 1, -18 }, +/* 0xA8 */ { 4003, 6, 2, 8, 1, -17 }, +/* 0xA9 */ { 4005, 18, 17, 19, 1, -17 }, +/* 0xAA */ { 4044, 14, 23, 16, 1, -18 }, +/* 0xAB */ { 4085, 8, 8, 12, 2, -11 }, +/* 0xAC */ { 4093, 12, 6, 14, 1, -9 }, +/* 0xAD */ { 4102, 6, 2, 8, 1, -8 }, +/* 0xAE */ { 4104, 18, 17, 19, 1, -17 }, +/* 0xAF */ { 4143, 13, 21, 15, 1, -21 }, +/* 0xB0 */ { 4178, 7, 8, 15, 4, -17 }, +/* 0xB1 */ { 4185, 12, 15, 14, 1, -15 }, +/* 0xB2 */ { 4208, 5, 5, 8, 1, 0 }, +/* 0xB3 */ { 4212, 4, 18, 6, 1, -18 }, +/* 0xB4 */ { 4221, 5, 4, 8, 2, -18 }, +/* 0xB5 */ { 4224, 12, 17, 13, 2, -13 }, +/* 0xB6 */ { 4250, 11, 21, 13, 2, -18 }, +/* 0xB7 */ { 4279, 2, 2, 6, 2, -8 }, +/* 0xB8 */ { 4280, 6, 5, 8, 1, 0 }, +/* 0xB9 */ { 4284, 13, 18, 13, 1, -13 }, +/* 0xBA */ { 4314, 10, 18, 12, 1, -13 }, +/* 0xBB */ { 4337, 8, 8, 12, 2, -10 }, +/* 0xBC */ { 4345, 10, 18, 14, 2, -18 }, +/* 0xBD */ { 4368, 8, 4, 8, 0, -18 }, +/* 0xBE */ { 4372, 7, 18, 9, 1, -18 }, +/* 0xBF */ { 4388, 10, 17, 12, 1, -17 }, +/* 0xC0 */ { 4410, 14, 22, 17, 2, -22 }, +/* 0xC1 */ { 4449, 14, 22, 16, 1, -22 }, +/* 0xC2 */ { 4488, 14, 22, 16, 1, -22 }, +/* 0xC3 */ { 4527, 14, 22, 16, 1, -22 }, +/* 0xC4 */ { 4566, 14, 21, 16, 1, -21 }, +/* 0xC5 */ { 4603, 10, 22, 14, 2, -22 }, +/* 0xC6 */ { 4631, 15, 22, 17, 1, -22 }, +/* 0xC7 */ { 4673, 15, 23, 17, 1, -18 }, +/* 0xC8 */ { 4717, 15, 21, 17, 1, -21 }, +/* 0xC9 */ { 4757, 12, 22, 15, 2, -22 }, +/* 0xCA */ { 4790, 13, 23, 15, 2, -18 }, +/* 0xCB */ { 4828, 12, 21, 15, 2, -21 }, +/* 0xCC */ { 4860, 12, 21, 15, 2, -21 }, +/* 0xCD */ { 4892, 4, 22, 7, 1, -22 }, +/* 0xCE */ { 4903, 6, 22, 7, 0, -22 }, +/* 0xCF */ { 4920, 14, 21, 17, 2, -21 }, +/* 0xD0 */ { 4957, 15, 18, 17, 1, -18 }, +/* 0xD1 */ { 4991, 13, 22, 18, 2, -22 }, +/* 0xD2 */ { 5027, 13, 21, 18, 2, -21 }, +/* 0xD3 */ { 5062, 17, 22, 19, 1, -22 }, +/* 0xD4 */ { 5109, 17, 22, 19, 1, -22 }, +/* 0xD5 */ { 5156, 17, 22, 19, 1, -22 }, +/* 0xD6 */ { 5203, 17, 21, 19, 1, -21 }, +/* 0xD7 */ { 5248, 8, 9, 14, 3, -10 }, +/* 0xD8 */ { 5257, 14, 21, 17, 2, -21 }, +/* 0xD9 */ { 5294, 13, 24, 17, 2, -24 }, +/* 0xDA */ { 5333, 13, 22, 17, 2, -22 }, +/* 0xDB */ { 5369, 13, 22, 17, 2, -22 }, +/* 0xDC */ { 5405, 13, 21, 17, 2, -21 }, +/* 0xDD */ { 5440, 14, 22, 16, 1, -22 }, +/* 0xDE */ { 5479, 12, 23, 15, 1, -18 }, +/* 0xDF */ { 5514, 11, 18, 14, 2, -18 }, +/* 0xE0 */ { 5539, 6, 18, 8, 1, -18 }, +/* 0xE1 */ { 5553, 12, 18, 13, 1, -18 }, +/* 0xE2 */ { 5580, 12, 18, 13, 1, -18 }, +/* 0xE3 */ { 5607, 12, 18, 13, 1, -18 }, +/* 0xE4 */ { 5634, 12, 17, 13, 1, -17 }, +/* 0xE5 */ { 5660, 5, 22, 6, 0, -22 }, +/* 0xE6 */ { 5674, 10, 18, 12, 1, -18 }, +/* 0xE7 */ { 5697, 10, 18, 12, 1, -13 }, +/* 0xE8 */ { 5720, 10, 18, 12, 1, -18 }, +/* 0xE9 */ { 5743, 11, 18, 13, 1, -18 }, +/* 0xEA */ { 5768, 11, 18, 13, 1, -13 }, +/* 0xEB */ { 5793, 11, 17, 13, 1, -17 }, +/* 0xEC */ { 5817, 11, 18, 13, 1, -18 }, +/* 0xED */ { 5842, 5, 18, 5, 0, -18 }, +/* 0xEE */ { 5854, 6, 18, 6, 0, -18 }, +/* 0xEF */ { 5868, 16, 18, 18, 1, -18 }, +/* 0xF0 */ { 5904, 12, 18, 14, 1, -18 }, +/* 0xF1 */ { 5931, 10, 18, 13, 1, -18 }, +/* 0xF2 */ { 5954, 10, 18, 13, 1, -18 }, +/* 0xF3 */ { 5977, 11, 18, 13, 1, -18 }, +/* 0xF4 */ { 6002, 11, 18, 13, 1, -18 }, +/* 0xF5 */ { 6027, 11, 18, 13, 1, -18 }, +/* 0xF6 */ { 6052, 11, 17, 13, 1, -17 }, +/* 0xF7 */ { 6076, 12, 11, 14, 1, -11 }, +/* 0xF8 */ { 6093, 6, 18, 8, 1, -18 }, +/* 0xF9 */ { 6107, 10, 19, 13, 1, -19 }, +/* 0xFA */ { 6131, 10, 18, 13, 1, -18 }, +/* 0xFB */ { 6154, 10, 18, 13, 1, -18 }, +/* 0xFC */ { 6177, 10, 17, 13, 1, -17 }, +/* 0xFD */ { 6199, 11, 23, 11, 0, -18 }, +/* 0xFE */ { 6231, 6, 21, 7, 1, -16 }, +/* 0xFF */ { 6247, 2, 2, 8, 3, -17 }, +}; + +const GFXfont FreeSans12pt_Win1250 PROGMEM = { +(uint8_t*)FreeSans12pt_Win1250Bitmaps, +(GFXglyph*)FreeSans12pt_Win1250Glyphs, +0x01, 0xFF, 19 +}; diff --git a/src/graphics/niche/Fonts/FreeSans12pt_Win1251.h b/src/graphics/niche/Fonts/FreeSans12pt_Win1251.h new file mode 100644 index 000000000..d2972f836 --- /dev/null +++ b/src/graphics/niche/Fonts/FreeSans12pt_Win1251.h @@ -0,0 +1,527 @@ +// trunk-ignore-all(clang-format) +#pragma once +/* PROPERTIES + +FONT_NAME FreeSans12pt_Win1251 +*/ +const uint8_t FreeSans12pt_Win1251Bitmaps[] PROGMEM = { +/* 0x01 */ 0x00, 0x30, 0x00, 0x09, 0x00, 0x01, 0x20, 0x00, 0x24, 0x00, 0x04, 0x80, 0x01, 0x90, 0x00, 0x62, 0x00, 0x30, 0xFE, 0x04, 0x10, 0x5F, 0x02, 0x0B, 0x00, 0x7F, 0xE0, 0x0C, 0x1C, 0x02, 0x83, 0x81, 0x9F, 0xF0, 0x02, 0x1E, 0x00, 0x41, 0xC0, 0x0E, 0x7F, 0x81, 0x78, 0x18, 0x62, 0x00, 0xFF, 0xC0, +/* 0x02 */ 0x00, 0xFF, 0x80, 0x61, 0x13, 0xF0, 0x62, 0x60, 0x07, 0xFC, 0x00, 0x83, 0x80, 0x10, 0xF0, 0x33, 0xF6, 0x01, 0x41, 0xC0, 0x18, 0x38, 0x03, 0xFF, 0xE0, 0x47, 0x02, 0x08, 0x20, 0x61, 0xC4, 0x06, 0x17, 0x00, 0x22, 0x00, 0x02, 0x40, 0x00, 0x48, 0x00, 0x09, 0x00, 0x01, 0x20, 0x00, 0x3C, 0x00, +/* 0x03 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x04, 0x08, 0x48, 0x70, 0xE1, 0xC3, 0x87, 0x0E, 0x08, 0x10, 0x70, 0x00, 0x03, 0x80, 0x00, 0x14, 0x00, 0x00, 0xA1, 0x81, 0x8D, 0x87, 0xF0, 0x44, 0x00, 0x06, 0x30, 0x00, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x04 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x10, 0x02, 0x48, 0xE0, 0x61, 0xC1, 0xCC, 0x0E, 0x78, 0x1C, 0x70, 0x00, 0x03, 0x80, 0x00, 0x14, 0xFF, 0xFC, 0xA6, 0x00, 0xCD, 0x9F, 0xFE, 0x44, 0x71, 0xE6, 0x30, 0xFC, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x05 */ 0x00, 0x18, 0x00, 0x00, 0x40, 0x01, 0x90, 0x01, 0xF4, 0x08, 0x12, 0x23, 0xC1, 0x91, 0x2C, 0x1C, 0x8A, 0xC3, 0x64, 0x64, 0x13, 0x22, 0x41, 0x98, 0x26, 0x2C, 0xC4, 0x22, 0x60, 0x42, 0x13, 0x04, 0x30, 0x80, 0x61, 0xA4, 0x02, 0x18, 0x20, 0x03, 0x41, 0x00, 0x20, 0x08, 0x02, 0x00, 0x60, 0x40, 0x03, 0xF8, +/* 0x06 */ 0x00, 0x10, 0x00, 0x03, 0x00, 0x1C, 0x48, 0x00, 0xB4, 0x80, 0x09, 0xF9, 0xC0, 0xE0, 0xE4, 0x0C, 0x02, 0x8F, 0x80, 0x38, 0x88, 0x01, 0x0D, 0x00, 0x18, 0x30, 0x01, 0x60, 0x80, 0x13, 0x18, 0x03, 0xF2, 0xC0, 0x20, 0x26, 0x06, 0x07, 0xFF, 0xA0, 0x02, 0x39, 0x00, 0x14, 0x70, 0x01, 0xC3, 0x00, 0x18, 0x00, +/* 0x07 */ +/* 0x08 */ 0x00, 0x1F, 0x80, 0x00, 0x60, 0x80, 0x01, 0x00, 0x80, 0x06, 0x00, 0x80, 0x3C, 0x01, 0x01, 0x8C, 0x02, 0x02, 0x08, 0x04, 0x04, 0x08, 0x0C, 0x38, 0x00, 0x04, 0x80, 0x00, 0x06, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x2E, 0xC0, 0x01, 0x83, 0x7E, 0x0C, 0x10, 0x37, 0xE2, 0x61, 0x00, 0x0C, 0xC6, 0x10, 0x98, 0x0C, 0x63, 0x00, 0x00, 0xC6, 0x00, +/* 0x09 */ 0x00, 0x1F, 0x80, 0x00, 0x60, 0x80, 0x01, 0x00, 0x80, 0x06, 0x00, 0x80, 0x3C, 0x01, 0x01, 0x8C, 0x02, 0x02, 0x08, 0x04, 0x04, 0x08, 0x0C, 0x38, 0x00, 0x04, 0x80, 0x00, 0x06, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x2E, 0xC0, 0x01, 0x83, 0x7E, 0x0C, 0x00, 0x37, 0xE0, +/* 0x0A */ +/* 0x0B */ 0x1F, 0x07, 0xC1, 0x86, 0x41, 0x10, 0x0C, 0x04, 0x80, 0x40, 0x18, 0x00, 0x00, 0xC0, 0x00, 0x06, 0x00, 0x00, 0x30, 0x00, 0x01, 0x40, 0x00, 0x0A, 0x00, 0x00, 0x88, 0x00, 0x04, 0x40, 0x00, 0x41, 0x00, 0x02, 0x04, 0x00, 0x20, 0x20, 0x02, 0x00, 0x80, 0x20, 0x02, 0x02, 0x00, 0x08, 0x20, 0x00, 0x22, 0x00, 0x00, 0xE0, 0x00, +/* 0x0C */ 0x01, 0x00, 0x00, 0x38, 0x00, 0x04, 0xC0, 0x01, 0x08, 0x00, 0x18, 0x80, 0x1C, 0x10, 0x02, 0x07, 0x80, 0x81, 0x10, 0x1F, 0xC2, 0x02, 0x00, 0x60, 0x80, 0x1A, 0x20, 0x1C, 0x42, 0x1C, 0x08, 0xFE, 0x03, 0xA0, 0x01, 0x8C, 0x01, 0xC1, 0x43, 0xD0, 0x27, 0x81, 0xF8, +/* 0x0D */ +/* 0x0E */ 0x00, 0xE0, 0x00, 0x11, 0x00, 0x01, 0x10, 0x00, 0x0B, 0x00, 0x03, 0xF8, 0x00, 0x60, 0x60, 0x09, 0x02, 0x00, 0xA0, 0x10, 0x16, 0x01, 0x01, 0x40, 0x10, 0x10, 0x01, 0x01, 0x00, 0x08, 0x10, 0x00, 0x82, 0x1F, 0x08, 0x3F, 0x90, 0x44, 0x00, 0x06, 0xBF, 0xFF, 0xAF, 0xF0, 0xFF, 0xFF, 0x0F, 0xE3, 0xFB, 0xFC, +/* 0x0F */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x40, 0x12, 0x34, 0x00, 0x69, 0x40, 0x01, 0x49, 0xE0, 0xF1, 0xCD, 0x06, 0x8E, 0x28, 0x14, 0x71, 0x40, 0xA3, 0x8B, 0xFD, 0x14, 0x50, 0x68, 0xA2, 0x81, 0x4D, 0x97, 0xFA, 0x44, 0xBF, 0xD6, 0x31, 0x02, 0xE0, 0xC8, 0x16, 0x08, 0x61, 0x08, 0x21, 0xF0, 0x80, 0xF8, 0x78, 0x00, +/* 0x10 */ 0x00, 0xF0, 0x00, 0x3A, 0x00, 0x07, 0xC0, 0x00, 0xA8, 0x00, 0x1F, 0x00, 0x02, 0xB0, 0x00, 0x52, 0x00, 0x0A, 0x40, 0x02, 0x48, 0x00, 0x49, 0x00, 0x09, 0x30, 0x01, 0x22, 0x01, 0xC4, 0x70, 0xF0, 0x85, 0xE1, 0x10, 0x88, 0x37, 0x20, 0x03, 0x9C, 0x00, 0x37, 0x00, 0x06, 0x40, 0x01, 0x86, 0x00, +/* 0x11 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x60, 0x02, 0x36, 0x00, 0x09, 0x04, 0x0C, 0x48, 0x60, 0xC1, 0xC3, 0x0F, 0x0E, 0x00, 0x08, 0x70, 0x00, 0x23, 0x80, 0x63, 0x84, 0x01, 0x9F, 0x20, 0x0C, 0xFD, 0x80, 0x27, 0xE4, 0x03, 0x3F, 0x30, 0x33, 0xE0, 0xC0, 0x00, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x12 */ 0x00, 0xC2, 0x00, 0x1C, 0x24, 0x02, 0x18, 0x60, 0x64, 0x02, 0x02, 0x40, 0x20, 0x00, 0xF2, 0x03, 0x89, 0xE0, 0x7C, 0x80, 0x0E, 0x25, 0x80, 0xE1, 0x00, 0x1A, 0x08, 0x71, 0xB0, 0xC4, 0x39, 0x84, 0xC2, 0xCC, 0x40, 0x76, 0x7C, 0x05, 0xBB, 0x80, 0x4C, 0xE0, 0x0A, 0x78, 0x00, 0x9C, 0x00, 0x0F, 0x00, 0x00, +/* 0x13 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x00, 0x00, 0x48, 0x60, 0xC1, 0xC6, 0xC9, 0x0E, 0x00, 0x00, 0x70, 0x00, 0x03, 0x80, 0x00, 0x14, 0xFF, 0xF8, 0xA6, 0x00, 0xCD, 0x9F, 0xFE, 0x44, 0x71, 0xE6, 0x30, 0xFC, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x14 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x20, 0x22, 0x33, 0x01, 0x89, 0x20, 0x02, 0x48, 0x60, 0xE1, 0xC8, 0x80, 0x8E, 0x46, 0x46, 0x72, 0x32, 0x33, 0x9F, 0x9F, 0x94, 0x78, 0x78, 0xA0, 0x00, 0x0D, 0x80, 0x00, 0x44, 0x0E, 0x06, 0x30, 0x00, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x15 */ 0x03, 0xFC, 0x20, 0x38, 0x1C, 0x81, 0x80, 0x1D, 0x08, 0x00, 0x32, 0x60, 0x00, 0x89, 0x00, 0x02, 0x18, 0x00, 0x08, 0x61, 0xC3, 0x22, 0x8D, 0x93, 0x72, 0x00, 0x00, 0x48, 0x00, 0x01, 0x20, 0x00, 0x04, 0x9F, 0xFF, 0x92, 0x60, 0x0E, 0x44, 0xFF, 0xF2, 0x11, 0xC3, 0x88, 0x21, 0xF8, 0x40, 0x40, 0x02, 0x00, 0xC0, 0x30, 0x00, 0xFF, 0x00, +/* 0x16 */ 0x03, 0x80, 0x03, 0xC0, 0x01, 0xE0, 0x01, 0xE0, 0x03, 0xF0, 0x03, 0xF0, 0x27, 0xF0, 0x6F, 0x70, 0x6E, 0x60, 0xFC, 0x60, 0xFC, 0x7E, 0xFC, 0x7E, 0xFC, 0x3F, 0xF4, 0x1F, 0xF4, 0x1F, 0xF0, 0x0E, 0x70, 0x0E, 0x30, 0x1C, 0x38, 0x38, 0x0F, 0xF0, +/* 0x17 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x00, 0x00, 0x48, 0x00, 0x21, 0xC0, 0x02, 0x8E, 0x20, 0xF4, 0x70, 0x84, 0x11, 0x82, 0x40, 0x84, 0x01, 0x03, 0x20, 0x0F, 0x85, 0x80, 0x03, 0x04, 0x00, 0x04, 0x30, 0x78, 0x10, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x18 */ 0x00, 0xFC, 0x00, 0x02, 0x06, 0x00, 0x08, 0x24, 0x00, 0x21, 0xA4, 0x00, 0x4C, 0x48, 0x00, 0xA0, 0x50, 0x01, 0x92, 0x60, 0x03, 0x24, 0xC0, 0x06, 0x01, 0x81, 0x28, 0x03, 0x49, 0x6C, 0xC4, 0xAD, 0xD8, 0x16, 0xA4, 0xCC, 0xC4, 0x44, 0x86, 0x13, 0x05, 0x00, 0x28, 0x0A, 0x00, 0x50, 0x14, 0x00, 0x90, 0x48, 0x01, 0x20, 0x90, 0x02, 0x41, 0x20, 0x00, 0x00, +/* 0x19 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x00, 0x00, 0x49, 0xC3, 0x81, 0xC0, 0x00, 0x0E, 0x78, 0xF0, 0x77, 0xEF, 0xC3, 0xA7, 0x4E, 0x15, 0x0A, 0x10, 0xA7, 0x8F, 0x0D, 0x80, 0x00, 0x44, 0x00, 0x06, 0x33, 0xF0, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x1A */ 0xFF, 0xFF, 0x00, 0x06, 0x00, 0x0C, 0x3E, 0x18, 0x82, 0x32, 0x02, 0x64, 0x04, 0xC8, 0x09, 0x80, 0x23, 0x00, 0x86, 0x02, 0x0C, 0x08, 0x18, 0x10, 0x30, 0x00, 0x60, 0x00, 0xC0, 0x81, 0x80, 0x03, 0x00, 0x07, 0xFF, 0xF8, +/* 0x1B */ 0x00, 0xFE, 0x00, 0x03, 0x81, 0x80, 0x04, 0x00, 0x60, 0x08, 0x00, 0x30, 0x10, 0x00, 0x10, 0x30, 0x07, 0x88, 0x23, 0xC8, 0x08, 0x22, 0x00, 0x04, 0x60, 0x00, 0x44, 0x60, 0x00, 0x84, 0x63, 0x03, 0x04, 0x61, 0xFC, 0x04, 0x6B, 0x00, 0x9E, 0xA5, 0x01, 0x6A, 0xD5, 0x01, 0x43, 0xA8, 0x81, 0x05, 0xD0, 0x82, 0x0A, 0xA0, 0x82, 0x05, 0xC0, 0x82, 0x02, 0x61, 0xFF, 0x0C, 0x1E, 0x00, 0xF0, +/* 0x1C */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x30, 0x02, 0x32, 0x00, 0x09, 0x00, 0x00, 0x48, 0x20, 0x61, 0xC3, 0x84, 0x0E, 0x1C, 0x78, 0x70, 0x40, 0x03, 0x80, 0x00, 0x14, 0x00, 0x00, 0xA0, 0x03, 0x0D, 0x83, 0xF0, 0x44, 0x00, 0x06, 0x30, 0x00, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x1D */ 0x01, 0xFE, 0x00, 0x3A, 0x1C, 0x03, 0x00, 0x30, 0x23, 0x1E, 0xC3, 0x38, 0x03, 0x10, 0xC3, 0x09, 0x00, 0x18, 0x68, 0x00, 0xC1, 0x40, 0x00, 0x0A, 0x07, 0x80, 0x50, 0x46, 0x02, 0x80, 0x00, 0x1A, 0x1E, 0x00, 0xCB, 0x10, 0x0D, 0x03, 0x00, 0x48, 0x60, 0x06, 0x40, 0x00, 0x22, 0x0C, 0x02, 0x10, 0x60, 0x60, 0x43, 0xFC, 0x01, 0xE0, 0x00, 0x00, +/* 0x1E */ 0x01, 0xF0, 0x00, 0xEA, 0xC0, 0x31, 0x5F, 0x04, 0x5F, 0x88, 0x80, 0xA0, 0x48, 0x0E, 0x02, 0x8F, 0x40, 0x3C, 0x10, 0x21, 0x66, 0x87, 0x15, 0x98, 0x71, 0x41, 0x02, 0x14, 0x00, 0x01, 0x40, 0x00, 0x14, 0x00, 0x01, 0x21, 0xFE, 0x12, 0x00, 0x02, 0x10, 0x00, 0x60, 0x80, 0x0C, 0x06, 0x01, 0x80, 0x3F, 0xE0, +/* 0x1F */ 0x0E, 0x00, 0x13, 0x00, 0x23, 0x00, 0xF3, 0x01, 0x31, 0x01, 0x11, 0x03, 0xD3, 0x06, 0xF2, 0x30, 0x34, 0xC7, 0x25, 0x33, 0x2B, 0xC2, 0x57, 0x04, 0x3A, 0x08, 0x72, 0x30, 0xA3, 0xC3, 0x40, 0x04, 0x40, 0x18, 0x40, 0x60, 0x7F, 0x80, +/* ' ' 0x20 */ +/* '!' 0x21 */ 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, +/* '"' 0x22 */ 0xCF, 0x3C, 0xF3, 0x8A, 0x20, +/* '#' 0x23 */ 0x06, 0x30, 0x31, 0x03, 0x18, 0x18, 0xC7, 0xFF, 0xBF, 0xFC, 0x31, 0x01, 0x18, 0x18, 0xC7, 0xFF, 0xBF, 0xFC, 0x31, 0x01, 0x18, 0x18, 0xC0, 0xC6, 0x06, 0x30, +/* '$' 0x24 */ 0x04, 0x03, 0xE1, 0xFF, 0x72, 0x7C, 0x47, 0x88, 0xF1, 0x07, 0xA0, 0x7E, 0x03, 0xF0, 0x17, 0x02, 0x7C, 0x47, 0x88, 0xF1, 0x1B, 0x26, 0x7F, 0xC3, 0xE0, 0x10, 0x02, 0x00, +/* '%' 0x25 */ 0x00, 0x06, 0x03, 0xC0, 0x40, 0x7E, 0x0C, 0x0E, 0x70, 0x80, 0xC3, 0x18, 0x0C, 0x31, 0x00, 0xE7, 0x30, 0x07, 0xE6, 0x00, 0x3C, 0x40, 0x00, 0x0C, 0x7C, 0x00, 0x8F, 0xE0, 0x19, 0xC7, 0x01, 0x18, 0x30, 0x31, 0x83, 0x02, 0x1C, 0x70, 0x40, 0xFE, 0x04, 0x07, 0xC0, +/* '&' 0x26 */ 0x0F, 0x00, 0x7E, 0x03, 0x9C, 0x0C, 0x30, 0x30, 0xC0, 0xE7, 0x01, 0xF8, 0x03, 0x80, 0x3E, 0x01, 0xCC, 0x6E, 0x39, 0xB0, 0x7C, 0xC0, 0xF3, 0x03, 0xCE, 0x1F, 0x9F, 0xE6, 0x3E, 0x1C, +/* ''' 0x27 */ 0xFF, 0xA0, +/* '(' 0x28 */ 0x08, 0x8C, 0x46, 0x31, 0x98, 0xC6, 0x31, 0x8C, 0x63, 0x08, 0x63, 0x08, 0x61, 0x0C, 0x20, +/* ')' 0x29 */ 0x82, 0x18, 0xC3, 0x18, 0xC3, 0x18, 0xC6, 0x31, 0x8C, 0x62, 0x31, 0x88, 0xC4, 0x62, 0x00, +/* '*' 0x2A */ 0x10, 0x23, 0x5B, 0xE3, 0x8D, 0x91, 0x00, +/* '+' 0x2B */ 0x0C, 0x03, 0x00, 0xC0, 0x30, 0xFF, 0xFF, 0xF0, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, +/* ',' 0x2C */ 0xF5, 0x60, +/* '-' 0x2D */ 0xFF, 0xF0, +/* '.' 0x2E */ 0xF0, +/* '/' 0x2F */ 0x02, 0x0C, 0x10, 0x20, 0xC1, 0x02, 0x0C, 0x10, 0x20, 0xC1, 0x02, 0x0C, 0x10, 0x20, 0xC1, 0x00, +/* '0' 0x30 */ 0x1F, 0x07, 0xF1, 0xC7, 0x30, 0x6C, 0x0F, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3E, 0x0E, 0xC1, 0x9C, 0x71, 0xFC, 0x1F, 0x00, +/* '1' 0x31 */ 0x08, 0xCF, 0xFF, 0x8C, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18, +/* '2' 0x32 */ 0x1F, 0x0F, 0xF9, 0x87, 0x60, 0x7C, 0x06, 0x00, 0xC0, 0x18, 0x07, 0x01, 0xC0, 0xF0, 0x78, 0x1C, 0x06, 0x00, 0xC0, 0x30, 0x07, 0xFF, 0xFF, 0xE0, +/* '3' 0x33 */ 0x3F, 0x0F, 0xF3, 0x87, 0x60, 0x6C, 0x0C, 0x01, 0x80, 0x60, 0x78, 0x0F, 0x80, 0x18, 0x01, 0x80, 0x3C, 0x07, 0x80, 0xD8, 0x73, 0xFC, 0x3F, 0x00, +/* '4' 0x34 */ 0x01, 0x80, 0x70, 0x0E, 0x03, 0xC0, 0xD8, 0x1B, 0x06, 0x61, 0x8C, 0x21, 0x8C, 0x33, 0x06, 0x7F, 0xFF, 0xFE, 0x03, 0x00, 0x60, 0x0C, 0x01, 0x80, +/* '5' 0x35 */ 0x3F, 0xCF, 0xF9, 0x80, 0x30, 0x06, 0x00, 0xDE, 0x1F, 0xE7, 0x0E, 0x00, 0xE0, 0x0C, 0x01, 0x80, 0x30, 0x07, 0x81, 0xB8, 0x73, 0xFC, 0x1F, 0x00, +/* '6' 0x36 */ 0x0F, 0x07, 0xF9, 0xC3, 0x30, 0x74, 0x01, 0x80, 0x33, 0xC7, 0xFE, 0xF1, 0xDC, 0x1F, 0x01, 0xE0, 0x3C, 0x06, 0xC1, 0xDC, 0x71, 0xFC, 0x1F, 0x00, +/* '7' 0x37 */ 0xFF, 0xFF, 0xFC, 0x01, 0x00, 0x60, 0x18, 0x02, 0x00, 0xC0, 0x30, 0x06, 0x01, 0x80, 0x30, 0x04, 0x01, 0x80, 0x30, 0x06, 0x01, 0x80, 0x30, 0x00, +/* '8' 0x38 */ 0x1F, 0x07, 0xF1, 0xC7, 0x30, 0x66, 0x0C, 0xC1, 0x8C, 0x61, 0xF8, 0x3F, 0x8E, 0x3B, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xD8, 0x31, 0xFC, 0x1F, 0x00, +/* '9' 0x39 */ 0x1F, 0x07, 0xF1, 0xC7, 0x70, 0x6C, 0x07, 0x80, 0xF0, 0x1E, 0x07, 0x61, 0xEF, 0xFC, 0x79, 0x80, 0x30, 0x05, 0xC1, 0x98, 0x73, 0xFC, 0x1E, 0x00, +/* ':' 0x3A */ 0xF0, 0x00, 0x03, 0xC0, +/* ';' 0x3B */ 0xF0, 0x00, 0x0F, 0x56, +/* '<' 0x3C */ 0x00, 0x70, 0x1E, 0x0F, 0x83, 0xC0, 0xF0, 0x0E, 0x00, 0x7C, 0x00, 0xF0, 0x03, 0xC0, 0x0F, 0x00, 0x10, +/* '=' 0x3D */ 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, +/* '>' 0x3E */ 0xE0, 0x07, 0x80, 0x1F, 0x00, 0x7C, 0x00, 0xF0, 0x07, 0x01, 0xE0, 0xF0, 0x3C, 0x0F, 0x00, 0x80, 0x00, +/* '?' 0x3F */ 0x3F, 0x1F, 0xEE, 0x1F, 0x03, 0xC0, 0xC0, 0x30, 0x0C, 0x06, 0x03, 0x81, 0xC0, 0xE0, 0x30, 0x0C, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x03, 0x00, +/* '@' 0x40 */ 0x00, 0xFE, 0x00, 0x0F, 0xFE, 0x00, 0xF0, 0x3E, 0x07, 0x00, 0x3C, 0x38, 0x00, 0x38, 0xC1, 0xE0, 0x66, 0x0F, 0xD9, 0xD8, 0x61, 0xC3, 0xC3, 0x07, 0x0F, 0x1C, 0x1C, 0x3C, 0x60, 0x60, 0xF1, 0x81, 0x83, 0xC6, 0x06, 0x1B, 0x18, 0x38, 0xEE, 0x71, 0xE7, 0x18, 0xFD, 0xF8, 0x71, 0xE7, 0xC0, 0xE0, 0x00, 0x01, 0xE0, 0x00, 0x01, 0xFF, 0xC0, 0x01, 0xFC, 0x00, +/* 'A' 0x41 */ 0x07, 0x80, 0x1E, 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3, 0xFF, 0xCC, 0x03, 0xB0, 0x06, 0xC0, 0x1B, 0x00, 0x6C, 0x01, 0xB0, 0x06, 0xC0, 0x1B, 0x00, 0x70, +/* 'S' 0x53 */ 0x0F, 0xE0, 0x7F, 0xC3, 0x83, 0x98, 0x07, 0x60, 0x0D, 0x80, 0x07, 0x00, 0x1E, 0x00, 0x3F, 0x80, 0x3F, 0xC0, 0x0F, 0x80, 0x07, 0xC0, 0x0F, 0x00, 0x3E, 0x00, 0xDE, 0x0E, 0x3F, 0xF0, 0x3F, 0x80, +/* 'T' 0x54 */ 0xFF, 0xFF, 0xFF, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, +/* 'U' 0x55 */ 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x80, 0xEE, 0x0E, 0x3F, 0xE0, 0xFC, 0x00, +/* 'V' 0x56 */ 0xC0, 0x0F, 0x00, 0x7E, 0x01, 0x98, 0x06, 0x60, 0x39, 0xC0, 0xC3, 0x03, 0x0C, 0x1C, 0x38, 0x60, 0x61, 0x81, 0x8E, 0x07, 0x30, 0x0C, 0xC0, 0x37, 0x00, 0xF8, 0x01, 0xE0, 0x07, 0x80, 0x1C, 0x00, +/* 'W' 0x57 */ 0xE0, 0x30, 0x1D, 0x80, 0xE0, 0x76, 0x07, 0x81, 0xDC, 0x1E, 0x06, 0x70, 0x7C, 0x18, 0xC1, 0xB0, 0xE3, 0x0C, 0xC3, 0x8C, 0x33, 0x0C, 0x38, 0xC6, 0x30, 0x67, 0x18, 0xC1, 0x98, 0x67, 0x06, 0x61, 0xD8, 0x1D, 0x83, 0x60, 0x3C, 0x0D, 0x80, 0xF0, 0x3E, 0x03, 0xC0, 0x70, 0x0F, 0x01, 0xC0, 0x18, 0x07, 0x00, +/* 'X' 0x58 */ 0xE0, 0x1D, 0x80, 0xE7, 0x03, 0x0E, 0x1C, 0x18, 0x60, 0x73, 0x00, 0xFC, 0x01, 0xE0, 0x07, 0x00, 0x1E, 0x00, 0xF8, 0x03, 0x30, 0x1C, 0xE0, 0xE1, 0x83, 0x07, 0x1C, 0x0E, 0xE0, 0x1B, 0x00, 0x70, +/* 'Y' 0x59 */ 0xC0, 0x0F, 0x80, 0x76, 0x01, 0x9C, 0x0C, 0x38, 0x70, 0x61, 0x81, 0xCE, 0x03, 0x30, 0x0F, 0x80, 0x1E, 0x00, 0x30, 0x00, 0xC0, 0x03, 0x00, 0x0C, 0x00, 0x30, 0x00, 0xC0, 0x03, 0x00, 0x0C, 0x00, +/* 'Z' 0x5A */ 0xFF, 0xFF, 0xFF, 0xC0, 0x0E, 0x00, 0xE0, 0x0E, 0x00, 0x60, 0x07, 0x00, 0x70, 0x07, 0x00, 0x30, 0x03, 0x80, 0x38, 0x03, 0x80, 0x18, 0x01, 0xC0, 0x1C, 0x00, 0xFF, 0xFF, 0xFF, 0xC0, +/* '[' 0x5B */ 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCF, 0xF0, +/* '\' 0x5C */ 0x81, 0x81, 0x02, 0x06, 0x04, 0x08, 0x18, 0x10, 0x20, 0x60, 0x40, 0x81, 0x81, 0x02, 0x06, 0x04, +/* ']' 0x5D */ 0xFF, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3F, 0xF0, +/* '^' 0x5E */ 0x0C, 0x0E, 0x05, 0x86, 0xC3, 0x21, 0x19, 0x8C, 0x83, 0xC1, 0x80, +/* '_' 0x5F */ 0xFF, 0xFE, +/* '`' 0x60 */ 0xE3, 0x8C, 0x30, +/* 'a' 0x61 */ 0x3F, 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 0xC0, +/* '{' 0x7B */ 0x19, 0xCC, 0x63, 0x18, 0xC6, 0x31, 0x99, 0x86, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x1C, 0x60, +/* '|' 0x7C */ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, +/* '}' 0x7D */ 0xC7, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x0C, 0x33, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0x73, 0x00, +/* '~' 0x7E */ 0x70, 0x3E, 0x09, 0xE4, 0x1F, 0x03, 0x80, +/* 0x7F */ +/* 0x80 */ 0xFF, 0xE0, 0xFF, 0xE0, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x07, 0xFC, 0x07, 0xFE, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x1E, 0x00, 0x1C, +/* 0x81 */ 0x07, 0x01, 0xC0, 0x20, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x06, 0x00, 0xC0, 0x18, 0x03, 0x00, 0x60, 0x0C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x18, 0x03, 0x00, 0x60, 0x0C, 0x01, 0x80, 0x00, +/* 0x82 */ 0xF5, 0x80, +/* 0x83 */ 0x0C, 0x38, 0x61, 0x80, 0x1F, 0xFF, 0xE0, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x80, +/* 0x84 */ 0xCF, 0x34, 0x51, 0x88, +/* 0x85 */ 0xC6, 0x3C, 0x63, +/* 0x86 */ 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x3F, 0xFF, 0xFC, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x00, +/* 0x87 */ 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x3F, 0xFF, 0xFC, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x0F, 0xFF, 0xFF, 0x0C, 0x03, 0x00, 0xC0, 0x30, +/* 0x88 */ 0x01, 0xF0, 0x1F, 0xF0, 0xE0, 0xC7, 0x00, 0x18, 0x00, 0xC0, 0x07, 0xFF, 0x3F, 0xFC, 0x30, 0x01, 0xFF, 0x8F, 0xFC, 0x0C, 0x00, 0x18, 0x00, 0x70, 0x00, 0xE0, 0x81, 0xFE, 0x03, 0xF0, +/* 0x89 */ 0x38, 0x18, 0x00, 0xF8, 0x30, 0x03, 0x18, 0xC0, 0x04, 0x11, 0x80, 0x0C, 0x66, 0x00, 0x0F, 0x8C, 0x00, 0x0E, 0x30, 0x00, 0x00, 0x40, 0x00, 0x01, 0x80, 0x00, 0x06, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x31, 0xC0, 0xE0, 0x67, 0xC3, 0xC1, 0x98, 0xCC, 0xC3, 0x20, 0x90, 0x8C, 0x63, 0x33, 0x10, 0x7C, 0x3C, 0x60, 0x70, 0x38, +/* 0x8A */ 0x1F, 0xF8, 0x00, 0x3F, 0xF0, 0x00, 0x60, 0x60, 0x00, 0xC0, 0xC0, 0x01, 0x81, 0x80, 0x03, 0x03, 0x00, 0x06, 0x06, 0x00, 0x0C, 0x0C, 0x00, 0x18, 0x1F, 0xF0, 0x30, 0x3F, 0xF0, 0x60, 0x60, 0x30, 0xC0, 0xC0, 0x31, 0x81, 0x80, 0x66, 0x03, 0x00, 0xCC, 0x06, 0x01, 0xB8, 0x0C, 0x06, 0xE0, 0x1F, 0xFD, 0x80, 0x3F, 0xE0, +/* 0x8B */ 0x2F, 0x49, 0x99, +/* 0x8C */ 0xC0, 0x60, 0x06, 0x03, 0x00, 0x30, 0x18, 0x01, 0x80, 0xC0, 0x0C, 0x06, 0x00, 0x60, 0x30, 0x03, 0x01, 0x80, 0x18, 0x0C, 0x00, 0xFF, 0xFF, 0xC7, 0xFF, 0xFF, 0x30, 0x18, 0x1D, 0x80, 0xC0, 0x3C, 0x06, 0x01, 0xE0, 0x30, 0x0F, 0x01, 0x80, 0x78, 0x0C, 0x06, 0xC0, 0x7F, 0xF6, 0x03, 0xFE, 0x00, +/* 0x8D */ 0x03, 0x00, 0x60, 0x0C, 0x00, 0x00, 0xC0, 0x7C, 0x0E, 0xC1, 0xCC, 0x38, 0xC7, 0x0C, 0xE0, 0xDC, 0x0F, 0x80, 0xF0, 0x0F, 0x80, 0xDC, 0x0C, 0xE0, 0xC7, 0x0C, 0x30, 0xC3, 0x8C, 0x1C, 0xC0, 0xEC, 0x07, +/* 0x8E */ 0xFF, 0xE0, 0xFF, 0xE0, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x07, 0xFC, 0x07, 0xFE, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, +/* 0x8F */ 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xFF, 0xFF, 0xFF, 0xC0, 0xC0, 0x06, 0x00, 0x30, 0x00, +/* 0x90 */ 0x30, 0x0F, 0xF0, 0xFF, 0x03, 0x00, 0x30, 0x03, 0x3C, 0x37, 0xE3, 0xC7, 0x38, 0x33, 0x03, 0x30, 0x33, 0x03, 0x30, 0x33, 0x03, 0x30, 0x33, 0x03, 0x30, 0x33, 0x03, 0x00, 0x60, 0x06, 0x01, 0x80, 0x30, +/* 0x91 */ 0x6A, 0xF0, +/* 0x92 */ 0xF5, 0x60, +/* 0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 0x66, 0x01, 0xB8, 0x07, 0xC0, 0x0F, 0x00, 0x30, +/* 0xC1 */ 0xFF, 0xE7, 0xFF, 0x30, 0x01, 0x80, 0x0C, 0x00, 0x60, 0x03, 0x00, 0x1F, 0xF8, 0xFF, 0xF6, 0x01, 0xB0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x06, 0xFF, 0xF7, 0xFE, 0x00, +/* 0xC2 */ 0xFF, 0xC7, 0xFF, 0x30, 0x1D, 0x80, 0x6C, 0x03, 0x60, 0x1B, 0x00, 0xD8, 0x0C, 0xFF, 0xC7, 0xFF, 0x30, 0x0D, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x06, 0xFF, 0xF7, 0xFE, 0x00, +/* 0xC3 */ 0xFF, 0xFF, 0xFF, 0x00, 0x60, 0x0C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x18, 0x03, 0x00, 0x60, 0x0C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x18, 0x00, +/* 0xC4 */ 0x07, 0xFE, 0x01, 0xFF, 0x80, 0x60, 0x60, 0x18, 0x18, 0x06, 0x06, 0x01, 0x81, 0x80, 0x60, 0x60, 0x18, 0x18, 0x06, 0x06, 0x01, 0x81, 0x80, 0x60, 0x60, 0x18, 0x18, 0x0E, 0x06, 0x03, 0x01, 0x80, 0xC0, 0x60, 0x70, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x0F, 0x00, 0x03, 0xC0, 0x00, 0xC0, +/* 0xC5 */ 0xFF, 0xFF, 0xFF, 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xFF, 0xEF, 0xFE, 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xFF, 0xFF, 0xFF, +/* 0xC6 */ 0x70, 0x60, 0xE3, 0x06, 0x0C, 0x38, 0x61, 0xC1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0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, +/* 0xD1 */ 0x07, 0xE0, 0x3F, 0xF0, 0xE0, 0x73, 0x80, 0x76, 0x00, 0x6C, 0x00, 0x30, 0x00, 0x60, 0x00, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x6C, 0x00, 0xDC, 0x03, 0x1E, 0x0E, 0x1F, 0xF8, 0x0F, 0xC0, +/* 0xD2 */ 0xFF, 0xFF, 0xFF, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, +/* 0xD3 */ 0xC0, 0x1F, 0x01, 0xD8, 0x0C, 0xE0, 0xE3, 0x06, 0x1C, 0x70, 0x63, 0x03, 0xB8, 0x1D, 0x80, 0x7C, 0x03, 0xC0, 0x0E, 0x00, 0x60, 0x07, 0x00, 0x38, 0x03, 0x80, 0x1C, 0x01, 0xC0, 0x00, +/* 0xD4 */ 0x00, 0xC0, 0x00, 0x30, 0x00, 0xFF, 0xC0, 0xFF, 0xFC, 0x78, 0xC7, 0x98, 0x30, 0x6E, 0x0C, 0x1F, 0x03, 0x03, 0xC0, 0xC0, 0xF0, 0x30, 0x3C, 0x0C, 0x0F, 0x83, 0x07, 0x60, 0xC1, 0x9E, 0x31, 0xE3, 0xFF, 0xF0, 0x3F, 0xF0, 0x00, 0xC0, 0x00, 0x30, 0x00, +/* 0xD5 */ 0xE0, 0x1D, 0x80, 0xE7, 0x03, 0x0E, 0x1C, 0x18, 0x60, 0x73, 0x00, 0xFC, 0x01, 0xE0, 0x07, 0x00, 0x1E, 0x00, 0xF8, 0x03, 0x30, 0x1C, 0xE0, 0xE1, 0x83, 0x07, 0x1C, 0x0E, 0xE0, 0x1B, 0x00, 0x70, +/* 0xD6 */ 0xC0, 0x19, 0x80, 0x33, 0x00, 0x66, 0x00, 0xCC, 0x01, 0x98, 0x03, 0x30, 0x06, 0x60, 0x0C, 0xC0, 0x19, 0x80, 0x33, 0x00, 0x66, 0x00, 0xCC, 0x01, 0x98, 0x03, 0x30, 0x06, 0x60, 0x0C, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x18, 0x00, 0x30, 0x00, 0x60, +/* 0xD7 */ 0xC0, 0x3C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x37, 0xFF, 0x3F, 0xF0, 0x03, 0x00, 0x30, 0x03, 0x00, 0x30, 0x03, 0x00, 0x30, 0x03, +/* 0xD8 */ 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xFF, 0xFF, 0xFF, 0xFF, +/* 0xD9 */ 0xC1, 0x83, 0x30, 0x60, 0xCC, 0x18, 0x33, 0x06, 0x0C, 0xC1, 0x83, 0x30, 0x60, 0xCC, 0x18, 0x33, 0x06, 0x0C, 0xC1, 0x83, 0x30, 0x60, 0xCC, 0x18, 0x33, 0x06, 0x0C, 0xC1, 0x83, 0x30, 0x60, 0xCC, 0x18, 0x33, 0x06, 0x0C, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x0C, 0x00, 0x03, 0x00, 0x00, 0xC0, +/* 0xDA */ 0xFE, 0x00, 0x3F, 0x80, 0x00, 0x60, 0x00, 0x18, 0x00, 0x06, 0x00, 0x01, 0x80, 0x00, 0x60, 0x00, 0x1F, 0xF8, 0x07, 0xFF, 0x01, 0x80, 0xE0, 0x60, 0x1C, 0x18, 0x03, 0x06, 0x00, 0xC1, 0x80, 0x30, 0x60, 0x1C, 0x18, 0x0E, 0x07, 0xFF, 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 0x1F, 0xCF, 0xF7, 0x0D, 0x83, 0x60, 0xD8, 0x33, 0xFC, 0x7F, 0x0C, 0xC6, 0x33, 0x0D, 0x83, 0xC0, 0xC0, +}; + +const GFXglyph FreeSans12pt_Win1251Glyphs[] PROGMEM = { +/* 0x01 */ { 0, 19, 20, 21, 1, -17 }, +/* 0x02 */ { 48, 19, 20, 21, 1, -17 }, +/* 0x03 */ { 96, 21, 20, 23, 1, -17 }, +/* 0x04 */ { 149, 21, 20, 23, 1, -17 }, +/* 0x05 */ { 202, 20, 20, 22, 1, -17 }, +/* 0x06 */ { 252, 20, 20, 22, 1, -17 }, +/* 0x07 */ { 302, 0, 0, 8, 0, 0 }, +/* 0x08 */ { 302, 23, 20, 25, 1, -17 }, +/* 0x09 */ { 360, 23, 16, 25, 1, -16 }, +/* 0x0A */ { 406, 0, 0, 8, 0, 0 }, +/* 0x0B */ { 406, 21, 20, 23, 1, -17 }, +/* 0x0C */ { 459, 19, 18, 21, 1, -15 }, +/* 0x0D */ { 502, 0, 0, 8, 0, 0 }, +/* 0x0E */ { 502, 20, 20, 22, 1, -17 }, +/* 0x0F */ { 552, 21, 21, 23, 1, -18 }, +/* 0x10 */ { 608, 19, 20, 21, 1, -17 }, +/* 0x11 */ { 656, 21, 20, 23, 1, -17 }, +/* 0x12 */ { 709, 20, 20, 22, 1, -17 }, +/* 0x13 */ { 759, 21, 20, 23, 1, -17 }, +/* 0x14 */ { 812, 21, 20, 23, 1, -17 }, +/* 0x15 */ { 865, 22, 20, 24, 1, -17 }, +/* 0x16 */ { 920, 16, 20, 18, 1, -17 }, +/* 0x17 */ { 960, 21, 20, 23, 1, -17 }, +/* 0x18 */ { 1013, 23, 20, 25, 1, -17 }, +/* 0x19 */ { 1071, 21, 20, 23, 1, -17 }, +/* 0x1A */ { 1124, 15, 19, 17, 1, -16 }, +/* 0x1B */ { 1160, 24, 21, 26, 1, -18 }, +/* 0x1C */ { 1223, 21, 20, 23, 1, -17 }, +/* 0x1D */ { 1276, 21, 21, 23, 1, -18 }, +/* 0x1E */ { 1332, 20, 20, 22, 1, -17 }, +/* 0x1F */ { 1382, 15, 20, 17, 1, -17 }, +/* ' ' 0x20 */ { 1420, 0, 0, 6, 0, 0 }, +/* '!' 0x21 */ { 1420, 2, 18, 8, 3, -16 }, +/* '"' 0x22 */ { 1425, 6, 6, 8, 1, -15 }, +/* '#' 0x23 */ { 1430, 13, 16, 13, 0, -14 }, +/* '$' 0x24 */ { 1456, 11, 20, 13, 1, -16 }, +/* '%' 0x25 */ { 1484, 20, 17, 21, 1, -15 }, +/* '&' 0x26 */ { 1527, 14, 17, 16, 1, -15 }, +/* ''' 0x27 */ { 1557, 2, 6, 5, 1, -15 }, +/* '(' 0x28 */ { 1559, 5, 23, 8, 2, -16 }, +/* ')' 0x29 */ { 1574, 5, 23, 8, 1, -16 }, +/* '*' 0x2A */ { 1589, 7, 7, 9, 1, -16 }, +/* '+' 0x2B */ { 1596, 10, 11, 14, 2, -9 }, +/* ',' 0x2C */ { 1610, 2, 6, 7, 2, 0 }, +/* '-' 0x2D */ { 1612, 6, 2, 8, 1, -6 }, +/* '.' 0x2E */ { 1614, 2, 2, 6, 2, 0 }, +/* '/' 0x2F */ { 1615, 7, 18, 7, 0, -16 }, +/* '0' 0x30 */ { 1631, 11, 17, 13, 1, -15 }, +/* '1' 0x31 */ { 1655, 5, 17, 13, 3, -15 }, +/* '2' 0x32 */ { 1666, 11, 17, 13, 1, -15 }, +/* '3' 0x33 */ { 1690, 11, 17, 13, 1, -15 }, +/* '4' 0x34 */ { 1714, 11, 17, 13, 1, -15 }, +/* '5' 0x35 */ { 1738, 11, 17, 13, 1, -15 }, +/* '6' 0x36 */ { 1762, 11, 17, 13, 1, -15 }, +/* '7' 0x37 */ { 1786, 11, 17, 13, 1, -15 }, +/* '8' 0x38 */ { 1810, 11, 17, 13, 1, -15 }, +/* '9' 0x39 */ { 1834, 11, 17, 13, 1, -15 }, +/* ':' 0x3A */ { 1858, 2, 13, 6, 2, -11 }, +/* ';' 0x3B */ { 1862, 2, 16, 6, 2, -10 }, +/* '<' 0x3C */ { 1866, 12, 11, 14, 1, -9 }, +/* '=' 0x3D */ { 1883, 12, 6, 14, 1, -7 }, +/* '>' 0x3E */ { 1892, 12, 11, 14, 1, -9 }, +/* '?' 0x3F */ { 1909, 10, 18, 13, 2, -16 }, +/* '@' 0x40 */ { 1932, 22, 21, 24, 1, -16 }, +/* 'A' 0x41 */ { 1990, 14, 18, 16, 1, -16 }, +/* 'B' 0x42 */ { 2022, 13, 18, 16, 2, -16 }, +/* 'C' 0x43 */ { 2052, 15, 18, 17, 1, -16 }, +/* 'D' 0x44 */ { 2086, 14, 18, 17, 2, -16 }, +/* 'E' 0x45 */ { 2118, 12, 18, 15, 2, -16 }, +/* 'F' 0x46 */ { 2145, 11, 18, 14, 2, -16 }, +/* 'G' 0x47 */ { 2170, 16, 18, 18, 1, -16 }, +/* 'H' 0x48 */ { 2206, 13, 18, 17, 2, -16 }, +/* 'I' 0x49 */ { 2236, 2, 18, 7, 2, -16 }, +/* 'J' 0x4A */ { 2241, 9, 18, 13, 1, -16 }, +/* 'K' 0x4B */ { 2262, 13, 18, 16, 2, -16 }, +/* 'L' 0x4C */ { 2292, 10, 18, 14, 2, -16 }, +/* 'M' 0x4D */ { 2315, 16, 18, 20, 2, -16 }, +/* 'N' 0x4E */ { 2351, 13, 18, 18, 2, -16 }, +/* 'O' 0x4F */ { 2381, 17, 18, 19, 1, -16 }, +/* 'P' 0x50 */ { 2420, 12, 18, 16, 2, -16 }, +/* 'Q' 0x51 */ { 2447, 17, 19, 19, 1, -16 }, +/* 'R' 0x52 */ { 2488, 14, 18, 17, 2, -16 }, +/* 'S' 0x53 */ { 2520, 14, 18, 16, 1, -16 }, +/* 'T' 0x54 */ { 2552, 12, 18, 15, 1, -16 }, +/* 'U' 0x55 */ { 2579, 13, 18, 17, 2, -16 }, +/* 'V' 0x56 */ { 2609, 14, 18, 15, 1, -16 }, +/* 'W' 0x57 */ { 2641, 22, 18, 22, 0, -16 }, +/* 'X' 0x58 */ { 2691, 14, 18, 16, 1, -16 }, +/* 'Y' 0x59 */ { 2723, 14, 18, 16, 1, -16 }, +/* 'Z' 0x5A */ { 2755, 13, 18, 15, 1, -16 }, +/* '[' 0x5B */ { 2785, 4, 23, 7, 2, -16 }, +/* '\' 0x5C */ { 2797, 7, 18, 7, 0, -16 }, +/* ']' 0x5D */ { 2813, 4, 23, 7, 1, -16 }, +/* '^' 0x5E */ { 2825, 9, 9, 11, 1, -15 }, +/* '_' 0x5F */ { 2836, 15, 1, 13, -1, 5 }, +/* '`' 0x60 */ { 2838, 5, 4, 6, 1, -16 }, +/* 'a' 0x61 */ { 2841, 12, 13, 13, 1, -11 }, +/* 'b' 0x62 */ { 2861, 12, 18, 13, 1, -16 }, +/* 'c' 0x63 */ { 2888, 10, 13, 12, 1, -11 }, +/* 'd' 0x64 */ { 2905, 11, 18, 13, 1, -16 }, +/* 'e' 0x65 */ { 2930, 11, 13, 13, 1, -11 }, +/* 'f' 0x66 */ { 2948, 5, 18, 7, 1, -16 }, +/* 'g' 0x67 */ { 2960, 11, 18, 13, 1, -11 }, +/* 'h' 0x68 */ { 2985, 10, 18, 13, 1, -16 }, +/* 'i' 0x69 */ { 3008, 2, 18, 5, 2, -16 }, +/* 'j' 0x6A */ { 3013, 4, 23, 6, 0, -16 }, +/* 'k' 0x6B */ { 3025, 10, 18, 12, 1, -16 }, +/* 'l' 0x6C */ { 3048, 2, 18, 5, 1, -16 }, +/* 'm' 0x6D */ { 3053, 17, 13, 19, 1, -11 }, +/* 'n' 0x6E */ { 3081, 10, 13, 13, 1, -11 }, +/* 'o' 0x6F */ { 3098, 11, 13, 13, 1, -11 }, +/* 'p' 0x70 */ { 3116, 12, 17, 13, 1, -11 }, +/* 'q' 0x71 */ { 3142, 11, 17, 13, 1, -11 }, +/* 'r' 0x72 */ { 3166, 6, 13, 8, 1, -11 }, +/* 's' 0x73 */ { 3176, 10, 13, 12, 1, -11 }, +/* 't' 0x74 */ { 3193, 5, 16, 7, 1, -14 }, +/* 'u' 0x75 */ { 3203, 10, 13, 13, 1, -11 }, +/* 'v' 0x76 */ { 3220, 11, 13, 12, 0, -11 }, +/* 'w' 0x77 */ { 3238, 17, 13, 17, 0, -11 }, +/* 'x' 0x78 */ { 3266, 10, 13, 11, 1, -11 }, +/* 'y' 0x79 */ { 3283, 11, 18, 11, 0, -11 }, +/* 'z' 0x7A */ { 3308, 10, 13, 12, 1, -11 }, +/* '{' 0x7B */ { 3325, 5, 23, 8, 1, -16 }, +/* '|' 0x7C */ { 3340, 2, 23, 6, 2, -16 }, +/* '}' 0x7D */ { 3346, 5, 23, 8, 2, -16 }, +/* '~' 0x7E */ { 3361, 10, 5, 12, 1, -9 }, +/* 0x7F */ { 3368, 0, 0, 0, 0, 0 }, +/* 0x80 */ { 3368, 16, 22, 18, 1, -18 }, +/* 0x81 */ { 3412, 11, 22, 14, 2, -22 }, +/* 0x82 */ { 3443, 2, 5, 6, 2, -2 }, +/* 0x83 */ { 3445, 7, 18, 9, 1, -18 }, +/* 0x84 */ { 3461, 6, 5, 10, 2, -2 }, +/* 0x85 */ { 3465, 12, 2, 16, 2, -2 }, +/* 0x86 */ { 3468, 10, 21, 13, 2, -17 }, +/* 0x87 */ { 3495, 10, 20, 13, 2, -17 }, +/* 0x88 */ { 3520, 14, 17, 16, 1, -17 }, +/* 0x89 */ { 3550, 23, 18, 24, 0, -18 }, +/* 0x8A */ { 3602, 23, 18, 24, 0, -18 }, +/* 0x8B */ { 3654, 3, 8, 6, 1, -11 }, +/* 0x8C */ { 3657, 21, 18, 24, 2, -18 }, +/* 0x8D */ { 3705, 12, 22, 15, 2, -22 }, +/* 0x8E */ { 3738, 16, 18, 18, 1, -18 }, +/* 0x8F */ { 3774, 13, 21, 17, 2, -18 }, +/* 0x90 */ { 3809, 12, 22, 14, 0, -18 }, +/* 0x91 */ { 3842, 2, 6, 6, 2, -18 }, +/* 0x92 */ { 3844, 2, 6, 6, 2, -18 }, +/* 0x93 */ { 3846, 6, 6, 10, 2, -18 }, +/* 0x94 */ { 3851, 6, 6, 10, 2, -18 }, +/* 0x95 */ { 3856, 6, 6, 10, 2, -11 }, +/* 0x96 */ { 3861, 10, 2, 12, 1, -8 }, +/* 0x97 */ { 3864, 22, 2, 24, 1, -8 }, +/* 0x98 */ { 3870, 0, 0, 8, 0, 0 }, +/* 0x99 */ { 3870, 22, 13, 24, 2, -18 }, +/* 0x9A */ { 3906, 17, 13, 19, 1, -13 }, +/* 0x9B */ { 3934, 3, 8, 6, 2, -10 }, +/* 0x9C */ { 3937, 18, 13, 20, 1, -13 }, +/* 0x9D */ { 3967, 9, 18, 12, 1, -18 }, +/* 0x9E */ { 3988, 11, 18, 14, 1, -18 }, +/* 0x9F */ { 4013, 10, 15, 13, 1, -13 }, +/* 0xA0 */ { 4032, 0, 0, 7, 0, 0 }, +/* 0xA1 */ { 4032, 13, 22, 15, 1, -22 }, +/* 0xA2 */ { 4068, 11, 22, 11, 0, -17 }, +/* 0xA3 */ { 4099, 9, 18, 13, 1, -18 }, +/* 0xA4 */ { 4120, 9, 9, 13, 2, -13 }, +/* 0xA5 */ { 4131, 11, 20, 14, 2, -20 }, +/* 0xA6 */ { 4159, 2, 23, 6, 2, -18 }, +/* 0xA7 */ { 4165, 11, 23, 13, 1, -18 }, +/* 0xA8 */ { 4197, 12, 21, 15, 2, -21 }, +/* 0xA9 */ { 4229, 18, 17, 19, 1, -17 }, +/* 0xAA */ { 4268, 15, 18, 17, 1, -18 }, +/* 0xAB */ { 4302, 8, 8, 12, 2, -11 }, +/* 0xAC */ { 4310, 12, 6, 14, 1, -9 }, +/* 0xAD */ { 4319, 6, 2, 8, 1, -8 }, +/* 0xAE */ { 4321, 18, 17, 19, 1, -17 }, +/* 0xAF */ { 4360, 7, 21, 7, 0, -21 }, +/* 0xB0 */ { 4379, 7, 8, 15, 4, -17 }, +/* 0xB1 */ { 4386, 12, 15, 14, 1, -15 }, +/* 0xB2 */ { 4409, 2, 18, 7, 2, -18 }, +/* 0xB3 */ { 4414, 2, 18, 5, 2, -18 }, +/* 0xB4 */ { 4419, 8, 15, 9, 1, -15 }, +/* 0xB5 */ { 4434, 12, 17, 13, 2, -13 }, +/* 0xB6 */ { 4460, 11, 21, 13, 2, -18 }, +/* 0xB7 */ { 4489, 2, 2, 6, 2, -8 }, +/* 0xB8 */ { 4490, 11, 17, 13, 1, -17 }, +/* 0xB9 */ { 4514, 19, 18, 22, 2, -18 }, +/* 0xBA */ { 4557, 11, 13, 12, 0, -13 }, +/* 0xBB */ { 4575, 8, 8, 12, 2, -10 }, +/* 0xBC */ { 4583, 4, 23, 6, 0, -18 }, +/* 0xBD */ { 4595, 14, 18, 16, 1, -18 }, +/* 0xBE */ { 4627, 10, 13, 12, 1, -13 }, +/* 0xBF */ { 4644, 6, 17, 6, 0, -17 }, +/* 0xC0 */ { 4657, 14, 18, 16, 1, -18 }, +/* 0xC1 */ { 4689, 13, 18, 16, 2, -18 }, +/* 0xC2 */ { 4719, 13, 18, 16, 2, -18 }, +/* 0xC3 */ { 4749, 11, 18, 14, 2, -18 }, +/* 0xC4 */ { 4774, 18, 21, 19, 1, -18 }, +/* 0xC5 */ { 4822, 12, 18, 15, 2, -18 }, +/* 0xC6 */ { 4849, 20, 18, 22, 1, -18 }, +/* 0xC7 */ { 4894, 13, 18, 16, 1, -18 }, +/* 0xC8 */ { 4924, 13, 18, 18, 2, -18 }, +/* 0xC9 */ { 4954, 13, 22, 18, 2, -22 }, +/* 0xCA */ { 4990, 12, 18, 15, 2, -18 }, +/* 0xCB */ { 5017, 14, 18, 16, 0, -18 }, +/* 0xCC */ { 5049, 16, 18, 20, 2, -18 }, +/* 0xCD */ { 5085, 13, 18, 17, 2, -18 }, +/* 0xCE */ { 5115, 17, 18, 19, 1, -18 }, +/* 0xCF */ { 5154, 13, 18, 17, 2, -18 }, +/* 0xD0 */ { 5184, 12, 18, 16, 2, -18 }, +/* 0xD1 */ { 5211, 15, 18, 17, 1, -18 }, +/* 0xD2 */ { 5245, 12, 18, 15, 1, -18 }, +/* 0xD3 */ { 5272, 13, 18, 15, 1, -18 }, +/* 0xD4 */ { 5302, 18, 18, 20, 1, -18 }, +/* 0xD5 */ { 5343, 14, 18, 16, 1, -18 }, +/* 0xD6 */ { 5375, 15, 21, 18, 2, -18 }, +/* 0xD7 */ { 5415, 12, 18, 15, 1, -18 }, +/* 0xD8 */ { 5442, 16, 18, 20, 2, -18 }, +/* 0xD9 */ { 5478, 18, 21, 20, 2, -18 }, +/* 0xDA */ { 5526, 18, 18, 20, 1, -18 }, +/* 0xDB */ { 5567, 17, 18, 21, 2, -18 }, +/* 0xDC */ { 5606, 13, 18, 16, 2, -18 }, +/* 0xDD */ { 5636, 15, 18, 17, 1, -18 }, +/* 0xDE */ { 5670, 21, 18, 24, 2, -18 }, +/* 0xDF */ { 5718, 14, 18, 16, 0, -18 }, +/* 0xE0 */ { 5750, 12, 13, 13, 1, -13 }, +/* 0xE1 */ { 5770, 11, 19, 13, 1, -19 }, +/* 0xE2 */ { 5797, 10, 13, 12, 1, -13 }, +/* 0xE3 */ { 5814, 7, 13, 9, 1, -13 }, +/* 0xE4 */ { 5826, 14, 15, 14, 0, -13 }, +/* 0xE5 */ { 5853, 11, 13, 13, 1, -13 }, +/* 0xE6 */ { 5871, 16, 13, 18, 1, -13 }, +/* 0xE7 */ { 5897, 9, 13, 12, 1, -13 }, +/* 0xE8 */ { 5912, 11, 13, 13, 1, -13 }, +/* 0xE9 */ { 5930, 11, 17, 13, 1, -17 }, +/* 0xEA */ { 5954, 9, 13, 12, 1, -13 }, +/* 0xEB */ { 5969, 10, 13, 12, 0, -13 }, +/* 0xEC */ { 5986, 12, 13, 14, 1, -13 }, +/* 0xED */ { 6006, 10, 13, 13, 1, -13 }, +/* 0xEE */ { 6023, 11, 13, 13, 1, -13 }, +/* 0xEF */ { 6041, 10, 13, 13, 1, -13 }, +/* 0xF0 */ { 6058, 12, 17, 13, 1, -13 }, +/* 0xF1 */ { 6084, 10, 13, 12, 1, -13 }, +/* 0xF2 */ { 6101, 8, 13, 10, 1, -13 }, +/* 0xF3 */ { 6114, 11, 18, 11, 0, -13 }, +/* 0xF4 */ { 6139, 19, 20, 20, 1, -16 }, +/* 0xF5 */ { 6187, 10, 13, 11, 1, -13 }, +/* 0xF6 */ { 6204, 12, 15, 13, 1, -13 }, +/* 0xF7 */ { 6227, 9, 13, 12, 1, -13 }, +/* 0xF8 */ { 6242, 14, 13, 16, 1, -13 }, +/* 0xF9 */ { 6265, 16, 15, 17, 1, -13 }, +/* 0xFA */ { 6295, 14, 13, 15, 1, -13 }, +/* 0xFB */ { 6318, 14, 13, 16, 1, -13 }, +/* 0xFC */ { 6341, 10, 13, 12, 1, -13 }, +/* 0xFD */ { 6358, 11, 13, 12, 1, -13 }, +/* 0xFE */ { 6376, 16, 13, 18, 1, -13 }, +/* 0xFF */ { 6402, 10, 13, 13, 1, -13 }, +}; + +const GFXfont FreeSans12pt_Win1251 PROGMEM = { +(uint8_t*)FreeSans12pt_Win1251Bitmaps, +(GFXglyph*)FreeSans12pt_Win1251Glyphs, +0x01, 0xFF, 19 +}; diff --git a/src/graphics/niche/Fonts/FreeSans12pt_Win1252.h b/src/graphics/niche/Fonts/FreeSans12pt_Win1252.h new file mode 100644 index 000000000..752925d6d --- /dev/null +++ b/src/graphics/niche/Fonts/FreeSans12pt_Win1252.h @@ -0,0 +1,527 @@ +// trunk-ignore-all(clang-format) +#pragma once +/* PROPERTIES + +FONT_NAME FreeSans12pt_Win1252 +*/ +const uint8_t FreeSans12pt_Win1252Bitmaps[] PROGMEM = { +/* 0x01 */ 0x00, 0x30, 0x00, 0x09, 0x00, 0x01, 0x20, 0x00, 0x24, 0x00, 0x04, 0x80, 0x01, 0x90, 0x00, 0x62, 0x00, 0x30, 0xFE, 0x04, 0x10, 0x5F, 0x02, 0x0B, 0x00, 0x7F, 0xE0, 0x0C, 0x1C, 0x02, 0x83, 0x81, 0x9F, 0xF0, 0x02, 0x1E, 0x00, 0x41, 0xC0, 0x0E, 0x7F, 0x81, 0x78, 0x18, 0x62, 0x00, 0xFF, 0xC0, +/* 0x02 */ 0x00, 0xFF, 0x80, 0x61, 0x13, 0xF0, 0x62, 0x60, 0x07, 0xFC, 0x00, 0x83, 0x80, 0x10, 0xF0, 0x33, 0xF6, 0x01, 0x41, 0xC0, 0x18, 0x38, 0x03, 0xFF, 0xE0, 0x47, 0x02, 0x08, 0x20, 0x61, 0xC4, 0x06, 0x17, 0x00, 0x22, 0x00, 0x02, 0x40, 0x00, 0x48, 0x00, 0x09, 0x00, 0x01, 0x20, 0x00, 0x3C, 0x00, +/* 0x03 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x04, 0x08, 0x48, 0x70, 0xE1, 0xC3, 0x87, 0x0E, 0x08, 0x10, 0x70, 0x00, 0x03, 0x80, 0x00, 0x14, 0x00, 0x00, 0xA1, 0x81, 0x8D, 0x87, 0xF0, 0x44, 0x00, 0x06, 0x30, 0x00, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x04 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x10, 0x02, 0x48, 0xE0, 0x61, 0xC1, 0xCC, 0x0E, 0x78, 0x1C, 0x70, 0x00, 0x03, 0x80, 0x00, 0x14, 0xFF, 0xFC, 0xA6, 0x00, 0xCD, 0x9F, 0xFE, 0x44, 0x71, 0xE6, 0x30, 0xFC, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x05 */ 0x00, 0x18, 0x00, 0x00, 0x40, 0x01, 0x90, 0x01, 0xF4, 0x08, 0x12, 0x23, 0xC1, 0x91, 0x2C, 0x1C, 0x8A, 0xC3, 0x64, 0x64, 0x13, 0x22, 0x41, 0x98, 0x26, 0x2C, 0xC4, 0x22, 0x60, 0x42, 0x13, 0x04, 0x30, 0x80, 0x61, 0xA4, 0x02, 0x18, 0x20, 0x03, 0x41, 0x00, 0x20, 0x08, 0x02, 0x00, 0x60, 0x40, 0x03, 0xF8, +/* 0x06 */ 0x00, 0x10, 0x00, 0x03, 0x00, 0x1C, 0x48, 0x00, 0xB4, 0x80, 0x09, 0xF9, 0xC0, 0xE0, 0xE4, 0x0C, 0x02, 0x8F, 0x80, 0x38, 0x88, 0x01, 0x0D, 0x00, 0x18, 0x30, 0x01, 0x60, 0x80, 0x13, 0x18, 0x03, 0xF2, 0xC0, 0x20, 0x26, 0x06, 0x07, 0xFF, 0xA0, 0x02, 0x39, 0x00, 0x14, 0x70, 0x01, 0xC3, 0x00, 0x18, 0x00, +/* 0x07 */ +/* 0x08 */ 0x00, 0x1F, 0x80, 0x00, 0x60, 0x80, 0x01, 0x00, 0x80, 0x06, 0x00, 0x80, 0x3C, 0x01, 0x01, 0x8C, 0x02, 0x02, 0x08, 0x04, 0x04, 0x08, 0x0C, 0x38, 0x00, 0x04, 0x80, 0x00, 0x06, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x2E, 0xC0, 0x01, 0x83, 0x7E, 0x0C, 0x10, 0x37, 0xE2, 0x61, 0x00, 0x0C, 0xC6, 0x10, 0x98, 0x0C, 0x63, 0x00, 0x00, 0xC6, 0x00, +/* 0x09 */ 0x00, 0x1F, 0x80, 0x00, 0x60, 0x80, 0x01, 0x00, 0x80, 0x06, 0x00, 0x80, 0x3C, 0x01, 0x01, 0x8C, 0x02, 0x02, 0x08, 0x04, 0x04, 0x08, 0x0C, 0x38, 0x00, 0x04, 0x80, 0x00, 0x06, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x2E, 0xC0, 0x01, 0x83, 0x7E, 0x0C, 0x00, 0x37, 0xE0, +/* 0x0A */ +/* 0x0B */ 0x1F, 0x07, 0xC1, 0x86, 0x41, 0x10, 0x0C, 0x04, 0x80, 0x40, 0x18, 0x00, 0x00, 0xC0, 0x00, 0x06, 0x00, 0x00, 0x30, 0x00, 0x01, 0x40, 0x00, 0x0A, 0x00, 0x00, 0x88, 0x00, 0x04, 0x40, 0x00, 0x41, 0x00, 0x02, 0x04, 0x00, 0x20, 0x20, 0x02, 0x00, 0x80, 0x20, 0x02, 0x02, 0x00, 0x08, 0x20, 0x00, 0x22, 0x00, 0x00, 0xE0, 0x00, +/* 0x0C */ 0x01, 0x00, 0x00, 0x38, 0x00, 0x04, 0xC0, 0x01, 0x08, 0x00, 0x18, 0x80, 0x1C, 0x10, 0x02, 0x07, 0x80, 0x81, 0x10, 0x1F, 0xC2, 0x02, 0x00, 0x60, 0x80, 0x1A, 0x20, 0x1C, 0x42, 0x1C, 0x08, 0xFE, 0x03, 0xA0, 0x01, 0x8C, 0x01, 0xC1, 0x43, 0xD0, 0x27, 0x81, 0xF8, +/* 0x0D */ +/* 0x0E */ 0x00, 0xE0, 0x00, 0x11, 0x00, 0x01, 0x10, 0x00, 0x0B, 0x00, 0x03, 0xF8, 0x00, 0x60, 0x60, 0x09, 0x02, 0x00, 0xA0, 0x10, 0x16, 0x01, 0x01, 0x40, 0x10, 0x10, 0x01, 0x01, 0x00, 0x08, 0x10, 0x00, 0x82, 0x1F, 0x08, 0x3F, 0x90, 0x44, 0x00, 0x06, 0xBF, 0xFF, 0xAF, 0xF0, 0xFF, 0xFF, 0x0F, 0xE3, 0xFB, 0xFC, +/* 0x0F */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x40, 0x12, 0x34, 0x00, 0x69, 0x40, 0x01, 0x49, 0xE0, 0xF1, 0xCD, 0x06, 0x8E, 0x28, 0x14, 0x71, 0x40, 0xA3, 0x8B, 0xFD, 0x14, 0x50, 0x68, 0xA2, 0x81, 0x4D, 0x97, 0xFA, 0x44, 0xBF, 0xD6, 0x31, 0x02, 0xE0, 0xC8, 0x16, 0x08, 0x61, 0x08, 0x21, 0xF0, 0x80, 0xF8, 0x78, 0x00, +/* 0x10 */ 0x00, 0xF0, 0x00, 0x3A, 0x00, 0x07, 0xC0, 0x00, 0xA8, 0x00, 0x1F, 0x00, 0x02, 0xB0, 0x00, 0x52, 0x00, 0x0A, 0x40, 0x02, 0x48, 0x00, 0x49, 0x00, 0x09, 0x30, 0x01, 0x22, 0x01, 0xC4, 0x70, 0xF0, 0x85, 0xE1, 0x10, 0x88, 0x37, 0x20, 0x03, 0x9C, 0x00, 0x37, 0x00, 0x06, 0x40, 0x01, 0x86, 0x00, +/* 0x11 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x60, 0x02, 0x36, 0x00, 0x09, 0x04, 0x0C, 0x48, 0x60, 0xC1, 0xC3, 0x0F, 0x0E, 0x00, 0x08, 0x70, 0x00, 0x23, 0x80, 0x63, 0x84, 0x01, 0x9F, 0x20, 0x0C, 0xFD, 0x80, 0x27, 0xE4, 0x03, 0x3F, 0x30, 0x33, 0xE0, 0xC0, 0x00, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x12 */ 0x00, 0xC2, 0x00, 0x1C, 0x24, 0x02, 0x18, 0x60, 0x64, 0x02, 0x02, 0x40, 0x20, 0x00, 0xF2, 0x03, 0x89, 0xE0, 0x7C, 0x80, 0x0E, 0x25, 0x80, 0xE1, 0x00, 0x1A, 0x08, 0x71, 0xB0, 0xC4, 0x39, 0x84, 0xC2, 0xCC, 0x40, 0x76, 0x7C, 0x05, 0xBB, 0x80, 0x4C, 0xE0, 0x0A, 0x78, 0x00, 0x9C, 0x00, 0x0F, 0x00, 0x00, +/* 0x13 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x00, 0x00, 0x48, 0x60, 0xC1, 0xC6, 0xC9, 0x0E, 0x00, 0x00, 0x70, 0x00, 0x03, 0x80, 0x00, 0x14, 0xFF, 0xF8, 0xA6, 0x00, 0xCD, 0x9F, 0xFE, 0x44, 0x71, 0xE6, 0x30, 0xFC, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x14 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x20, 0x22, 0x33, 0x01, 0x89, 0x20, 0x02, 0x48, 0x60, 0xE1, 0xC8, 0x80, 0x8E, 0x46, 0x46, 0x72, 0x32, 0x33, 0x9F, 0x9F, 0x94, 0x78, 0x78, 0xA0, 0x00, 0x0D, 0x80, 0x00, 0x44, 0x0E, 0x06, 0x30, 0x00, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x15 */ 0x03, 0xFC, 0x20, 0x38, 0x1C, 0x81, 0x80, 0x1D, 0x08, 0x00, 0x32, 0x60, 0x00, 0x89, 0x00, 0x02, 0x18, 0x00, 0x08, 0x61, 0xC3, 0x22, 0x8D, 0x93, 0x72, 0x00, 0x00, 0x48, 0x00, 0x01, 0x20, 0x00, 0x04, 0x9F, 0xFF, 0x92, 0x60, 0x0E, 0x44, 0xFF, 0xF2, 0x11, 0xC3, 0x88, 0x21, 0xF8, 0x40, 0x40, 0x02, 0x00, 0xC0, 0x30, 0x00, 0xFF, 0x00, +/* 0x16 */ 0x03, 0x80, 0x03, 0xC0, 0x01, 0xE0, 0x01, 0xE0, 0x03, 0xF0, 0x03, 0xF0, 0x27, 0xF0, 0x6F, 0x70, 0x6E, 0x60, 0xFC, 0x60, 0xFC, 0x7E, 0xFC, 0x7E, 0xFC, 0x3F, 0xF4, 0x1F, 0xF4, 0x1F, 0xF0, 0x0E, 0x70, 0x0E, 0x30, 0x1C, 0x38, 0x38, 0x0F, 0xF0, +/* 0x17 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x00, 0x00, 0x48, 0x00, 0x21, 0xC0, 0x02, 0x8E, 0x20, 0xF4, 0x70, 0x84, 0x11, 0x82, 0x40, 0x84, 0x01, 0x03, 0x20, 0x0F, 0x85, 0x80, 0x03, 0x04, 0x00, 0x04, 0x30, 0x78, 0x10, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x18 */ 0x00, 0xFC, 0x00, 0x02, 0x06, 0x00, 0x08, 0x24, 0x00, 0x21, 0xA4, 0x00, 0x4C, 0x48, 0x00, 0xA0, 0x50, 0x01, 0x92, 0x60, 0x03, 0x24, 0xC0, 0x06, 0x01, 0x81, 0x28, 0x03, 0x49, 0x6C, 0xC4, 0xAD, 0xD8, 0x16, 0xA4, 0xCC, 0xC4, 0x44, 0x86, 0x13, 0x05, 0x00, 0x28, 0x0A, 0x00, 0x50, 0x14, 0x00, 0x90, 0x48, 0x01, 0x20, 0x90, 0x02, 0x41, 0x20, 0x00, 0x00, +/* 0x19 */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x00, 0x02, 0x30, 0x00, 0x09, 0x00, 0x00, 0x49, 0xC3, 0x81, 0xC0, 0x00, 0x0E, 0x78, 0xF0, 0x77, 0xEF, 0xC3, 0xA7, 0x4E, 0x15, 0x0A, 0x10, 0xA7, 0x8F, 0x0D, 0x80, 0x00, 0x44, 0x00, 0x06, 0x33, 0xF0, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x1A */ 0xFF, 0xFF, 0x00, 0x06, 0x00, 0x0C, 0x3E, 0x18, 0x82, 0x32, 0x02, 0x64, 0x04, 0xC8, 0x09, 0x80, 0x23, 0x00, 0x86, 0x02, 0x0C, 0x08, 0x18, 0x10, 0x30, 0x00, 0x60, 0x00, 0xC0, 0x81, 0x80, 0x03, 0x00, 0x07, 0xFF, 0xF8, +/* 0x1B */ 0x00, 0xFE, 0x00, 0x03, 0x81, 0x80, 0x04, 0x00, 0x60, 0x08, 0x00, 0x30, 0x10, 0x00, 0x10, 0x30, 0x07, 0x88, 0x23, 0xC8, 0x08, 0x22, 0x00, 0x04, 0x60, 0x00, 0x44, 0x60, 0x00, 0x84, 0x63, 0x03, 0x04, 0x61, 0xFC, 0x04, 0x6B, 0x00, 0x9E, 0xA5, 0x01, 0x6A, 0xD5, 0x01, 0x43, 0xA8, 0x81, 0x05, 0xD0, 0x82, 0x0A, 0xA0, 0x82, 0x05, 0xC0, 0x82, 0x02, 0x61, 0xFF, 0x0C, 0x1E, 0x00, 0xF0, +/* 0x1C */ 0x01, 0xFC, 0x00, 0x38, 0x18, 0x02, 0x00, 0x30, 0x20, 0x00, 0xC2, 0x30, 0x02, 0x32, 0x00, 0x09, 0x00, 0x00, 0x48, 0x20, 0x61, 0xC3, 0x84, 0x0E, 0x1C, 0x78, 0x70, 0x40, 0x03, 0x80, 0x00, 0x14, 0x00, 0x00, 0xA0, 0x03, 0x0D, 0x83, 0xF0, 0x44, 0x00, 0x06, 0x30, 0x00, 0x60, 0xC0, 0x06, 0x03, 0x80, 0x60, 0x07, 0xFC, 0x00, +/* 0x1D */ 0x01, 0xFE, 0x00, 0x3A, 0x1C, 0x03, 0x00, 0x30, 0x23, 0x1E, 0xC3, 0x38, 0x03, 0x10, 0xC3, 0x09, 0x00, 0x18, 0x68, 0x00, 0xC1, 0x40, 0x00, 0x0A, 0x07, 0x80, 0x50, 0x46, 0x02, 0x80, 0x00, 0x1A, 0x1E, 0x00, 0xCB, 0x10, 0x0D, 0x03, 0x00, 0x48, 0x60, 0x06, 0x40, 0x00, 0x22, 0x0C, 0x02, 0x10, 0x60, 0x60, 0x43, 0xFC, 0x01, 0xE0, 0x00, 0x00, +/* 0x1E */ 0x01, 0xF0, 0x00, 0xEA, 0xC0, 0x31, 0x5F, 0x04, 0x5F, 0x88, 0x80, 0xA0, 0x48, 0x0E, 0x02, 0x8F, 0x40, 0x3C, 0x10, 0x21, 0x66, 0x87, 0x15, 0x98, 0x71, 0x41, 0x02, 0x14, 0x00, 0x01, 0x40, 0x00, 0x14, 0x00, 0x01, 0x21, 0xFE, 0x12, 0x00, 0x02, 0x10, 0x00, 0x60, 0x80, 0x0C, 0x06, 0x01, 0x80, 0x3F, 0xE0, +/* 0x1F */ 0x0E, 0x00, 0x13, 0x00, 0x23, 0x00, 0xF3, 0x01, 0x31, 0x01, 0x11, 0x03, 0xD3, 0x06, 0xF2, 0x30, 0x34, 0xC7, 0x25, 0x33, 0x2B, 0xC2, 0x57, 0x04, 0x3A, 0x08, 0x72, 0x30, 0xA3, 0xC3, 0x40, 0x04, 0x40, 0x18, 0x40, 0x60, 0x7F, 0x80, +/* ' ' 0x20 */ +/* '!' 0x21 */ 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, +/* '"' 0x22 */ 0xCF, 0x3C, 0xF3, 0x8A, 0x20, +/* '#' 0x23 */ 0x06, 0x30, 0x31, 0x03, 0x18, 0x18, 0xC7, 0xFF, 0xBF, 0xFC, 0x31, 0x01, 0x18, 0x18, 0xC7, 0xFF, 0xBF, 0xFC, 0x31, 0x01, 0x18, 0x18, 0xC0, 0xC6, 0x06, 0x30, +/* '$' 0x24 */ 0x04, 0x03, 0xE1, 0xFF, 0x72, 0x7C, 0x47, 0x88, 0xF1, 0x07, 0xA0, 0x7E, 0x03, 0xF0, 0x17, 0x02, 0x7C, 0x47, 0x88, 0xF1, 0x1B, 0x26, 0x7F, 0xC3, 0xE0, 0x10, 0x02, 0x00, +/* '%' 0x25 */ 0x00, 0x06, 0x03, 0xC0, 0x40, 0x7E, 0x0C, 0x0E, 0x70, 0x80, 0xC3, 0x18, 0x0C, 0x31, 0x00, 0xE7, 0x30, 0x07, 0xE6, 0x00, 0x3C, 0x40, 0x00, 0x0C, 0x7C, 0x00, 0x8F, 0xE0, 0x19, 0xC7, 0x01, 0x18, 0x30, 0x31, 0x83, 0x02, 0x1C, 0x70, 0x40, 0xFE, 0x04, 0x07, 0xC0, +/* '&' 0x26 */ 0x0F, 0x00, 0x7E, 0x03, 0x9C, 0x0C, 0x30, 0x30, 0xC0, 0xE7, 0x01, 0xF8, 0x03, 0x80, 0x3E, 0x01, 0xCC, 0x6E, 0x39, 0xB0, 0x7C, 0xC0, 0xF3, 0x03, 0xCE, 0x1F, 0x9F, 0xE6, 0x3E, 0x1C, +/* ''' 0x27 */ 0xFF, 0xA0, +/* '(' 0x28 */ 0x08, 0x8C, 0x46, 0x31, 0x98, 0xC6, 0x31, 0x8C, 0x63, 0x08, 0x63, 0x08, 0x61, 0x0C, 0x20, +/* ')' 0x29 */ 0x82, 0x18, 0xC3, 0x18, 0xC3, 0x18, 0xC6, 0x31, 0x8C, 0x62, 0x31, 0x88, 0xC4, 0x62, 0x00, +/* '*' 0x2A */ 0x10, 0x23, 0x5B, 0xE3, 0x8D, 0x91, 0x00, +/* '+' 0x2B */ 0x0C, 0x03, 0x00, 0xC0, 0x30, 0xFF, 0xFF, 0xF0, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, +/* ',' 0x2C */ 0xF5, 0x60, +/* '-' 0x2D */ 0xFF, 0xF0, +/* '.' 0x2E */ 0xF0, +/* '/' 0x2F */ 0x02, 0x0C, 0x10, 0x20, 0xC1, 0x02, 0x0C, 0x10, 0x20, 0xC1, 0x02, 0x0C, 0x10, 0x20, 0xC1, 0x00, +/* '0' 0x30 */ 0x1F, 0x07, 0xF1, 0xC7, 0x30, 0x6C, 0x0F, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3E, 0x0E, 0xC1, 0x9C, 0x71, 0xFC, 0x1F, 0x00, +/* '1' 0x31 */ 0x08, 0xCF, 0xFF, 0x8C, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18, +/* '2' 0x32 */ 0x1F, 0x0F, 0xF9, 0x87, 0x60, 0x7C, 0x06, 0x00, 0xC0, 0x18, 0x07, 0x01, 0xC0, 0xF0, 0x78, 0x1C, 0x06, 0x00, 0xC0, 0x30, 0x07, 0xFF, 0xFF, 0xE0, +/* '3' 0x33 */ 0x3F, 0x0F, 0xF3, 0x87, 0x60, 0x6C, 0x0C, 0x01, 0x80, 0x60, 0x78, 0x0F, 0x80, 0x18, 0x01, 0x80, 0x3C, 0x07, 0x80, 0xD8, 0x73, 0xFC, 0x3F, 0x00, +/* '4' 0x34 */ 0x01, 0x80, 0x70, 0x0E, 0x03, 0xC0, 0xD8, 0x1B, 0x06, 0x61, 0x8C, 0x21, 0x8C, 0x33, 0x06, 0x7F, 0xFF, 0xFE, 0x03, 0x00, 0x60, 0x0C, 0x01, 0x80, +/* '5' 0x35 */ 0x3F, 0xCF, 0xF9, 0x80, 0x30, 0x06, 0x00, 0xDE, 0x1F, 0xE7, 0x0E, 0x00, 0xE0, 0x0C, 0x01, 0x80, 0x30, 0x07, 0x81, 0xB8, 0x73, 0xFC, 0x1F, 0x00, +/* '6' 0x36 */ 0x0F, 0x07, 0xF9, 0xC3, 0x30, 0x74, 0x01, 0x80, 0x33, 0xC7, 0xFE, 0xF1, 0xDC, 0x1F, 0x01, 0xE0, 0x3C, 0x06, 0xC1, 0xDC, 0x71, 0xFC, 0x1F, 0x00, +/* '7' 0x37 */ 0xFF, 0xFF, 0xFC, 0x01, 0x00, 0x60, 0x18, 0x02, 0x00, 0xC0, 0x30, 0x06, 0x01, 0x80, 0x30, 0x04, 0x01, 0x80, 0x30, 0x06, 0x01, 0x80, 0x30, 0x00, +/* '8' 0x38 */ 0x1F, 0x07, 0xF1, 0xC7, 0x30, 0x66, 0x0C, 0xC1, 0x8C, 0x61, 0xF8, 0x3F, 0x8E, 0x3B, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xD8, 0x31, 0xFC, 0x1F, 0x00, +/* '9' 0x39 */ 0x1F, 0x07, 0xF1, 0xC7, 0x70, 0x6C, 0x07, 0x80, 0xF0, 0x1E, 0x07, 0x61, 0xEF, 0xFC, 0x79, 0x80, 0x30, 0x05, 0xC1, 0x98, 0x73, 0xFC, 0x1E, 0x00, +/* ':' 0x3A */ 0xF0, 0x00, 0x03, 0xC0, +/* ';' 0x3B */ 0xF0, 0x00, 0x0F, 0x56, +/* '<' 0x3C */ 0x00, 0x70, 0x1E, 0x0F, 0x83, 0xC0, 0xF0, 0x0E, 0x00, 0x7C, 0x00, 0xF0, 0x03, 0xC0, 0x0F, 0x00, 0x10, +/* '=' 0x3D */ 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, +/* '>' 0x3E */ 0xE0, 0x07, 0x80, 0x1F, 0x00, 0x7C, 0x00, 0xF0, 0x07, 0x01, 0xE0, 0xF0, 0x3C, 0x0F, 0x00, 0x80, 0x00, +/* '?' 0x3F */ 0x3F, 0x1F, 0xEE, 0x1F, 0x03, 0xC0, 0xC0, 0x30, 0x0C, 0x06, 0x03, 0x81, 0xC0, 0xE0, 0x30, 0x0C, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x03, 0x00, +/* '@' 0x40 */ 0x00, 0xFE, 0x00, 0x0F, 0xFE, 0x00, 0xF0, 0x3E, 0x07, 0x00, 0x3C, 0x38, 0x00, 0x38, 0xC1, 0xE0, 0x66, 0x0F, 0xD9, 0xD8, 0x61, 0xC3, 0xC3, 0x07, 0x0F, 0x1C, 0x1C, 0x3C, 0x60, 0x60, 0xF1, 0x81, 0x83, 0xC6, 0x06, 0x1B, 0x18, 0x38, 0xEE, 0x71, 0xE7, 0x18, 0xFD, 0xF8, 0x71, 0xE7, 0xC0, 0xE0, 0x00, 0x01, 0xE0, 0x00, 0x01, 0xFF, 0xC0, 0x01, 0xFC, 0x00, +/* 'A' 0x41 */ 0x07, 0x80, 0x1E, 0x00, 0x78, 0x03, 0xF0, 0x0C, 0xC0, 0x33, 0x01, 0xCE, 0x06, 0x18, 0x18, 0x60, 0xE1, 0xC3, 0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0x00, 0x70, +/* 'S' 0x53 */ 0x0F, 0xE0, 0x7F, 0xC3, 0x83, 0x98, 0x07, 0x60, 0x0D, 0x80, 0x07, 0x00, 0x1E, 0x00, 0x3F, 0x80, 0x3F, 0xC0, 0x0F, 0x80, 0x07, 0xC0, 0x0F, 0x00, 0x3E, 0x00, 0xDE, 0x0E, 0x3F, 0xF0, 0x3F, 0x80, +/* 'T' 0x54 */ 0xFF, 0xFF, 0xFF, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, +/* 'U' 0x55 */ 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x80, 0xEE, 0x0E, 0x3F, 0xE0, 0xFC, 0x00, +/* 'V' 0x56 */ 0xC0, 0x0F, 0x00, 0x7E, 0x01, 0x98, 0x06, 0x60, 0x39, 0xC0, 0xC3, 0x03, 0x0C, 0x1C, 0x38, 0x60, 0x61, 0x81, 0x8E, 0x07, 0x30, 0x0C, 0xC0, 0x37, 0x00, 0xF8, 0x01, 0xE0, 0x07, 0x80, 0x1C, 0x00, +/* 'W' 0x57 */ 0xE0, 0x30, 0x1D, 0x80, 0xE0, 0x76, 0x07, 0x81, 0xDC, 0x1E, 0x06, 0x70, 0x7C, 0x18, 0xC1, 0xB0, 0xE3, 0x0C, 0xC3, 0x8C, 0x33, 0x0C, 0x38, 0xC6, 0x30, 0x67, 0x18, 0xC1, 0x98, 0x67, 0x06, 0x61, 0xD8, 0x1D, 0x83, 0x60, 0x3C, 0x0D, 0x80, 0xF0, 0x3E, 0x03, 0xC0, 0x70, 0x0F, 0x01, 0xC0, 0x18, 0x07, 0x00, +/* 'X' 0x58 */ 0xE0, 0x1D, 0x80, 0xE7, 0x03, 0x0E, 0x1C, 0x18, 0x60, 0x73, 0x00, 0xFC, 0x01, 0xE0, 0x07, 0x00, 0x1E, 0x00, 0xF8, 0x03, 0x30, 0x1C, 0xE0, 0xE1, 0x83, 0x07, 0x1C, 0x0E, 0xE0, 0x1B, 0x00, 0x70, +/* 'Y' 0x59 */ 0xC0, 0x0F, 0x80, 0x76, 0x01, 0x9C, 0x0C, 0x38, 0x70, 0x61, 0x81, 0xCE, 0x03, 0x30, 0x0F, 0x80, 0x1E, 0x00, 0x30, 0x00, 0xC0, 0x03, 0x00, 0x0C, 0x00, 0x30, 0x00, 0xC0, 0x03, 0x00, 0x0C, 0x00, +/* 'Z' 0x5A */ 0xFF, 0xFF, 0xFF, 0xC0, 0x0E, 0x00, 0xE0, 0x0E, 0x00, 0x60, 0x07, 0x00, 0x70, 0x07, 0x00, 0x30, 0x03, 0x80, 0x38, 0x03, 0x80, 0x18, 0x01, 0xC0, 0x1C, 0x00, 0xFF, 0xFF, 0xFF, 0xC0, +/* '[' 0x5B */ 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCF, 0xF0, +/* '\' 0x5C */ 0x81, 0x81, 0x02, 0x06, 0x04, 0x08, 0x18, 0x10, 0x20, 0x60, 0x40, 0x81, 0x81, 0x02, 0x06, 0x04, +/* ']' 0x5D */ 0xFF, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3F, 0xF0, +/* '^' 0x5E */ 0x0C, 0x0E, 0x05, 0x86, 0xC3, 0x21, 0x19, 0x8C, 0x83, 0xC1, 0x80, +/* '_' 0x5F */ 0xFF, 0xFE, +/* '`' 0x60 */ 0xE3, 0x8C, 0x30, +/* 'a' 0x61 */ 0x3F, 0x07, 0xF8, 0xE1, 0xCC, 0x0C, 0x00, 0xC0, 0x1C, 0x3F, 0xCF, 0x8C, 0xC0, 0xCC, 0x0C, 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, 0x63, 0x1C, 0x60, +/* '|' 0x7C */ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, +/* '}' 0x7D */ 0xC7, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x0C, 0x33, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0x73, 0x00, +/* '~' 0x7E */ 0x70, 0x3E, 0x09, 0xE4, 0x1F, 0x03, 0x80, +/* 0x7F */ +/* 0x80 */ 0x01, 0xF0, 0x1F, 0xF0, 0xE0, 0xC7, 0x00, 0x18, 0x00, 0xC0, 0x07, 0xFF, 0x3F, 0xFC, 0x30, 0x01, 0xFF, 0x8F, 0xFC, 0x0C, 0x00, 0x18, 0x00, 0x70, 0x00, 0xE0, 0x81, 0xFE, 0x03, 0xF0, +/* 0x81 */ +/* 0x82 */ 0xF5, 0x80, +/* 0x83 */ 0x1C, 0xF3, 0x0C, 0x31, 0xF7, 0xCC, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x33, 0xCE, 0x00, +/* 0x84 */ 0xCF, 0x34, 0x51, 0x88, +/* 0x85 */ 0xC6, 0x3C, 0x63, +/* 0x86 */ 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x3F, 0xFF, 0xFC, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x00, +/* 0x87 */ 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x3F, 0xFF, 0xFC, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x0F, 0xFF, 0xFF, 0x0C, 0x03, 0x00, 0xC0, 0x30, +/* 0x88 */ 0x38, 0xD9, 0xB6, 0x30, +/* 0x89 */ 0x38, 0x18, 0x00, 0xF8, 0x30, 0x03, 0x18, 0xC0, 0x04, 0x11, 0x80, 0x0C, 0x66, 0x00, 0x0F, 0x8C, 0x00, 0x0E, 0x30, 0x00, 0x00, 0x40, 0x00, 0x01, 0x80, 0x00, 0x06, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x31, 0xC0, 0xE0, 0x67, 0xC3, 0xC1, 0x98, 0xCC, 0xC3, 0x20, 0x90, 0x8C, 0x63, 0x33, 0x10, 0x7C, 0x3C, 0x60, 0x70, 0x38, +/* 0x8A */ 0x0C, 0x40, 0x1F, 0x00, 0x38, 0x03, 0xF8, 0x1F, 0xF0, 0xE0, 0xE6, 0x01, 0xD8, 0x03, 0x60, 0x01, 0xC0, 0x07, 0x80, 0x0F, 0xE0, 0x0F, 0xF0, 0x03, 0xE0, 0x01, 0xF0, 0x03, 0xC0, 0x0F, 0x80, 0x37, 0x83, 0x8F, 0xFC, 0x0F, 0xE0, +/* 0x8B */ 0x2F, 0x49, 0x99, +/* 0x8C */ 0x07, 0xCF, 0xFC, 0x7F, 0xFF, 0xF3, 0x83, 0xC0, 0x18, 0x07, 0x00, 0x60, 0x0C, 0x03, 0x00, 0x30, 0x0C, 0x00, 0xC0, 0x30, 0x03, 0x00, 0xC0, 0x0F, 0xFF, 0x00, 0x3F, 0xFC, 0x00, 0xC0, 0x30, 0x03, 0x00, 0xC0, 0x0C, 0x01, 0x80, 0x30, 0x07, 0x01, 0xC0, 0x0E, 0x0F, 0x00, 0x1F, 0xEF, 0xFC, 0x1F, 0x3F, 0xF0, +/* 0x8D */ +/* 0x8E */ 0x0C, 0xC0, 0x3C, 0x00, 0xE1, 0xFF, 0xFF, 0xFF, 0x80, 0x1C, 0x01, 0xC0, 0x1C, 0x00, 0xC0, 0x0E, 0x00, 0xE0, 0x0E, 0x00, 0x60, 0x07, 0x00, 0x70, 0x07, 0x00, 0x30, 0x03, 0x80, 0x38, 0x01, 0xFF, 0xFF, 0xFF, 0x80, +/* 0x8F */ +/* 0x90 */ +/* 0x91 */ 0x6A, 0xF0, +/* 0x92 */ 0xF5, 0x60, +/* 0x93 */ 0x4E, 0x28, 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F, 0xEF, 0xFC, 0x7C, 0x00, 0xC0, 0x0C, 0x00, 0xC0, 0x00, +/* 0xB6 */ 0x1F, 0xE7, 0xFD, 0xF3, 0x7E, 0x6F, 0xCD, 0xF9, 0xBF, 0x37, 0xE6, 0x7C, 0xCF, 0x98, 0xF3, 0x06, 0x60, 0xCC, 0x19, 0x83, 0x30, 0x66, 0x0C, 0xC1, 0x98, 0x33, 0x06, 0x60, 0xCC, +/* 0xB7 */ 0xF0, +/* 0xB8 */ 0x10, 0xF0, 0xE3, 0x78, +/* 0xB9 */ 0x2F, 0xB6, 0xDB, 0x6C, +/* 0xBA */ 0x79, 0x38, 0x61, 0x86, 0x1C, 0xDE, 0x00, 0x0F, 0xC0, +/* 0xBB */ 0x88, 0xC6, 0xE7, 0x21, 0x21, 0xE7, 0xC6, 0x88, +/* 0xBC */ 0x20, 0x08, 0x30, 0x0C, 0x38, 0x04, 0x0C, 0x06, 0x06, 0x02, 0x03, 0x02, 0x01, 0x81, 0x00, 0xC1, 0x06, 0x61, 0x87, 0x30, 0x83, 0x80, 0xC2, 0xC0, 0x42, 0x60, 0x43, 0x30, 0x21, 0xFC, 0x20, 0x0C, 0x30, 0x06, 0x10, 0x03, 0x00, +/* 0xBD */ 0x20, 0x00, 0x08, 0x02, 0x06, 0x01, 0x83, 0x80, 0x40, 0x60, 0x20, 0x18, 0x18, 0x06, 0x04, 0x01, 0x83, 0x00, 0x61, 0x9F, 0x98, 0x4E, 0x76, 0x33, 0x0C, 0x08, 0x03, 0x04, 0x03, 0x83, 0x01, 0x80, 0x81, 0x80, 0x60, 0xC0, 0x30, 0x3F, 0xC8, 0x0F, 0xF0, +/* 0xBE */ 0x7C, 0x00, 0x18, 0xC0, 0x43, 0x18, 0x18, 0x03, 0x02, 0x00, 0x60, 0xC0, 0x30, 0x10, 0x01, 0x84, 0x00, 0x31, 0x80, 0xC6, 0x20, 0xD8, 0xC8, 0x39, 0xF1, 0x07, 0x00, 0x41, 0x60, 0x18, 0x4C, 0x02, 0x11, 0x80, 0x83, 0xF8, 0x10, 0x06, 0x04, 0x00, 0xC1, 0x00, 0x18, +/* 0xBF */ 0x0C, 0x06, 0x00, 0x00, 0x00, 0xC0, 0x60, 0x60, 0x30, 0x30, 0x38, 0x38, 0x18, 0x0C, 0x06, 0x0F, 0x07, 0xC7, 0x7F, 0x1F, 0x00, +/* 0xC0 */ 0x0C, 0x00, 0x18, 0x00, 0x30, 0x00, 0x00, 0x07, 0x80, 0x1E, 0x00, 0x78, 0x03, 0xF0, 0x0C, 0xC0, 0x33, 0x01, 0xCE, 0x06, 0x18, 0x18, 0x60, 0xE1, 0xC3, 0x03, 0x0F, 0xFC, 0x7F, 0xF9, 0x80, 0x66, 0x01, 0xB8, 0x07, 0xC0, 0x0F, 0x00, 0x30, +/* 0xC1 */ 0x01, 0xC0, 0x0C, 0x00, 0x20, 0x00, 0x00, 0x07, 0x80, 0x1E, 0x00, 0x78, 0x03, 0xF0, 0x0C, 0xC0, 0x33, 0x01, 0xCE, 0x06, 0x18, 0x18, 0x60, 0xE1, 0xC3, 0x03, 0x0F, 0xFC, 0x7F, 0xF9, 0x80, 0x66, 0x01, 0xB8, 0x07, 0xC0, 0x0F, 0x00, 0x30, +/* 0xC2 */ 0x07, 0x00, 0x3E, 0x01, 0x8C, 0x00, 0x00, 0x07, 0x80, 0x1E, 0x00, 0x78, 0x03, 0xF0, 0x0C, 0xC0, 0x33, 0x01, 0xCE, 0x06, 0x18, 0x18, 0x60, 0xE1, 0xC3, 0x03, 0x0F, 0xFC, 0x7F, 0xF9, 0x80, 0x66, 0x01, 0xB8, 0x07, 0xC0, 0x0F, 0x00, 0x30, +/* 0xC3 */ 0x0E, 0x40, 0x7F, 0x01, 0x98, 0x00, 0x00, 0x07, 0x80, 0x1E, 0x00, 0x78, 0x03, 0xF0, 0x0C, 0xC0, 0x33, 0x01, 0xCE, 0x06, 0x18, 0x18, 0x60, 0xE1, 0xC3, 0x03, 0x0F, 0xFC, 0x7F, 0xF9, 0x80, 0x66, 0x01, 0xB8, 0x07, 0xC0, 0x0F, 0x00, 0x30, +/* 0xC4 */ 0x0C, 0xC0, 0x33, 0x00, 0x00, 0x01, 0xE0, 0x07, 0x80, 0x1E, 0x00, 0xFC, 0x03, 0x30, 0x0C, 0xC0, 0x73, 0x81, 0x86, 0x06, 0x18, 0x38, 0x70, 0xC0, 0xC3, 0xFF, 0x1F, 0xFE, 0x60, 0x19, 0x80, 0x6E, 0x01, 0xF0, 0x03, 0xC0, 0x0C, +/* 0xC5 */ 0x03, 0x00, 0x1E, 0x00, 0xEC, 0x03, 0x30, 0x0F, 0xC0, 0x1E, 0x00, 0x78, 0x01, 0xE0, 0x07, 0x80, 0x3F, 0x00, 0xCC, 0x03, 0x30, 0x1C, 0xE0, 0x61, 0x81, 0x86, 0x0E, 0x1C, 0x30, 0x30, 0xFF, 0xC7, 0xFF, 0x98, 0x06, 0x60, 0x1B, 0x80, 0x7C, 0x00, 0xF0, 0x03, +/* 0xC6 */ 0x01, 0xFF, 0xFC, 0x07, 0xFF, 0xF0, 0x31, 0x80, 0x00, 0xC6, 0x00, 0x07, 0x18, 0x00, 0x18, 0x60, 0x00, 0x61, 0x80, 0x03, 0x86, 0x00, 0x0C, 0x1F, 0xF8, 0x70, 0x7F, 0xE1, 0x81, 0x80, 0x07, 0xFE, 0x00, 0x3F, 0xF8, 0x00, 0xC0, 0x60, 0x07, 0x01, 0x80, 0x1C, 0x06, 0x00, 0x60, 0x1F, 0xFF, 0x80, 0x7F, 0xF0, +/* 0xC7 */ 0x07, 0xE0, 0x3F, 0xF0, 0xE0, 0x73, 0x80, 0x66, 0x00, 0x7C, 0x00, 0x30, 0x00, 0x60, 0x00, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x6C, 0x01, 0xDC, 0x03, 0x1C, 0x1E, 0x1F, 0xF8, 0x0F, 0xC0, 0x08, 0x00, 0x1E, 0x00, 0x0C, 0x01, 0x18, 0x01, 0xE0, 0x00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, +/* 0xCF */ 0xC7, 0x8C, 0x01, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x00, +/* 0xD0 */ 0x7F, 0xE0, 0xFF, 0xE1, 0x80, 0xE3, 0x00, 0xE6, 0x00, 0xCC, 0x01, 0xD8, 0x01, 0xB0, 0x03, 0xFE, 0x07, 0xFC, 0x0D, 0x80, 0x1B, 0x00, 0x36, 0x00, 0x6C, 0x01, 0x98, 0x07, 0x30, 0x1C, 0x7F, 0xF0, 0xFF, 0xC0, +/* 0xD1 */ 0x08, 0xC0, 0xFE, 0x05, 0xE0, 0x00, 0x0E, 0x01, 0xF0, 0x0F, 0xC0, 0x7E, 0x03, 0xD8, 0x1E, 0xE0, 0xF3, 0x07, 0x9C, 0x3C, 0x61, 0xE1, 0x8F, 0x0E, 0x78, 0x33, 0xC1, 0xDE, 0x06, 0xF0, 0x1F, 0x80, 0xFC, 0x03, 0xE0, 0x1C, +/* 0xD2 */ 0x07, 0x00, 0x01, 0x80, 0x00, 0x60, 0x00, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0xE0, 0xF0, 0x78, 0x60, 0x0C, 0x60, 0x03, 0x30, 0x01, 0xB0, 0x00, 0x78, 0x00, 0x3C, 0x00, 0x1E, 0x00, 0x0F, 0x00, 0x07, 0x80, 0x03, 0x60, 0x03, 0x30, 0x01, 0x8C, 0x01, 0x87, 0x83, 0xC1, 0xFF, 0xC0, 0x3F, 0x80, +/* 0xD3 */ 0x00, 0xE0, 0x00, 0x60, 0x00, 0x40, 0x00, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0xE0, 0xF0, 0x78, 0x60, 0x0C, 0x60, 0x03, 0x30, 0x01, 0xB0, 0x00, 0x78, 0x00, 0x3C, 0x00, 0x1E, 0x00, 0x0F, 0x00, 0x07, 0x80, 0x03, 0x60, 0x03, 0x30, 0x01, 0x8C, 0x01, 0x87, 0x83, 0xC1, 0xFF, 0xC0, 0x3F, 0x80, +/* 0xD4 */ 0x03, 0xC0, 0x01, 0xE0, 0x01, 0x98, 0x00, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0xE0, 0xF0, 0x78, 0x60, 0x0C, 0x60, 0x03, 0x30, 0x01, 0xB0, 0x00, 0x78, 0x00, 0x3C, 0x00, 0x1E, 0x00, 0x0F, 0x00, 0x07, 0x80, 0x03, 0x60, 0x03, 0x30, 0x01, 0x8C, 0x01, 0x87, 0x83, 0xC1, 0xFF, 0xC0, 0x3F, 0x80, +/* 0xD5 */ 0x07, 0x20, 0x03, 0xF0, 0x01, 0x38, 0x00, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0xE0, 0xF0, 0x78, 0x60, 0x0C, 0x60, 0x03, 0x30, 0x01, 0xB0, 0x00, 0x78, 0x00, 0x3C, 0x00, 0x1E, 0x00, 0x0F, 0x00, 0x07, 0x80, 0x03, 0x60, 0x03, 0x30, 0x01, 0x8C, 0x01, 0x87, 0x83, 0xC1, 0xFF, 0xC0, 0x3F, 0x80, +/* 0xD6 */ 0x06, 0x30, 0x03, 0x18, 0x00, 0x00, 0x00, 0xFE, 0x01, 0xFF, 0xC1, 0xE0, 0xF0, 0xC0, 0x18, 0xC0, 0x06, 0x60, 0x03, 0x60, 0x00, 0xF0, 0x00, 0x78, 0x00, 0x3C, 0x00, 0x1E, 0x00, 0x0F, 0x00, 0x06, 0xC0, 0x06, 0x60, 0x03, 0x18, 0x03, 0x0F, 0x07, 0x83, 0xFF, 0x80, 0x7F, 0x00, +/* 0xD7 */ 0x81, 0xC3, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0xC3, 0x81, +/* 0xD8 */ 0x07, 0xF0, 0x8F, 0xFE, 0x8F, 0x07, 0xC6, 0x00, 0xE6, 0x00, 0xF3, 0x00, 0xDF, 0x00, 0xC7, 0x80, 0xC3, 0xC0, 0xC1, 0xE0, 0xC0, 0xF0, 0xC0, 0x78, 0xC0, 0x3E, 0xC0, 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, 0x0F, 0x03, 0xC0, 0xF0, 0x3C, 0x1F, 0x8F, 0x7E, 0xCF, 0x30, +/* 0xFB */ 0x0C, 0x07, 0x81, 0x20, 0xCC, 0x00, 0x30, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x3C, 0x1F, 0x8F, 0x7E, 0xCF, 0x30, +/* 0xFC */ 0x31, 0x8C, 0x60, 0x00, 0x00, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x7E, 0x3D, 0xFB, 0x3C, 0xC0, +/* 0xFD */ 0x03, 0x80, 0x60, 0x18, 0x06, 0x00, 0x01, 0xC0, 0xD8, 0x1B, 0x06, 0x70, 0xC6, 0x18, 0xC6, 0x18, 0xC1, 0x98, 0x36, 0x06, 0xC0, 0x78, 0x0E, 0x01, 0xC0, 0x30, 0x06, 0x01, 0xC0, 0xF0, 0x1C, 0x00, +/* 0xFE */ 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xCF, 0x8F, 0xFC, 0xF0, 0xEE, 0x06, 0xC0, 0x3C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x3E, 0x06, 0xF0, 0xEF, 0xFC, 0xCF, 0x8C, 0x00, 0xC0, 0x0C, 0x00, 0xC0, 0x00, +/* 0xFF */ 0x19, 0x83, 0x30, 0x00, 0x00, 0x0E, 0x06, 0xC0, 0xD8, 0x33, 0x86, 0x30, 0xC6, 0x30, 0xC6, 0x0C, 0xC1, 0xB0, 0x36, 0x03, 0xC0, 0x70, 0x0E, 0x01, 0x80, 0x30, 0x0E, 0x07, 0x80, 0xE0, 0x00, +}; + +const GFXglyph FreeSans12pt_Win1252Glyphs[] PROGMEM = { +/* 0x01 */ { 0, 19, 20, 21, 1, -17 }, +/* 0x02 */ { 48, 19, 20, 21, 1, -17 }, +/* 0x03 */ { 96, 21, 20, 23, 1, -17 }, +/* 0x04 */ { 149, 21, 20, 23, 1, -17 }, +/* 0x05 */ { 202, 20, 20, 22, 1, -17 }, +/* 0x06 */ { 252, 20, 20, 22, 1, -17 }, +/* 0x07 */ { 302, 0, 0, 8, 0, 0 }, +/* 0x08 */ { 302, 23, 20, 25, 1, -17 }, +/* 0x09 */ { 360, 23, 16, 25, 1, -16 }, +/* 0x0A */ { 406, 0, 0, 8, 0, 0 }, +/* 0x0B */ { 406, 21, 20, 23, 1, -17 }, +/* 0x0C */ { 459, 19, 18, 21, 1, -15 }, +/* 0x0D */ { 502, 0, 0, 8, 0, 0 }, +/* 0x0E */ { 502, 20, 20, 22, 1, -17 }, +/* 0x0F */ { 552, 21, 21, 23, 1, -18 }, +/* 0x10 */ { 608, 19, 20, 21, 1, -17 }, +/* 0x11 */ { 656, 21, 20, 23, 1, -17 }, +/* 0x12 */ { 709, 20, 20, 22, 1, -17 }, +/* 0x13 */ { 759, 21, 20, 23, 1, -17 }, +/* 0x14 */ { 812, 21, 20, 23, 1, -17 }, +/* 0x15 */ { 865, 22, 20, 24, 1, -17 }, +/* 0x16 */ { 920, 16, 20, 18, 1, -17 }, +/* 0x17 */ { 960, 21, 20, 23, 1, -17 }, +/* 0x18 */ { 1013, 23, 20, 25, 1, -17 }, +/* 0x19 */ { 1071, 21, 20, 23, 1, -17 }, +/* 0x1A */ { 1124, 15, 19, 17, 1, -16 }, +/* 0x1B */ { 1160, 24, 21, 26, 1, -18 }, +/* 0x1C */ { 1223, 21, 20, 23, 1, -17 }, +/* 0x1D */ { 1276, 21, 21, 23, 1, -18 }, +/* 0x1E */ { 1332, 20, 20, 22, 1, -17 }, +/* 0x1F */ { 1382, 15, 20, 17, 1, -17 }, +/* ' ' 0x20 */ { 1420, 0, 0, 6, 0, 0 }, +/* '!' 0x21 */ { 1420, 2, 18, 8, 3, -16 }, +/* '"' 0x22 */ { 1425, 6, 6, 8, 1, -15 }, +/* '#' 0x23 */ { 1430, 13, 16, 13, 0, -14 }, +/* '$' 0x24 */ { 1456, 11, 20, 13, 1, -16 }, +/* '%' 0x25 */ { 1484, 20, 17, 21, 1, -15 }, +/* '&' 0x26 */ { 1527, 14, 17, 16, 1, -15 }, +/* ''' 0x27 */ { 1557, 2, 6, 5, 1, -15 }, +/* '(' 0x28 */ { 1559, 5, 23, 8, 2, -16 }, +/* ')' 0x29 */ { 1574, 5, 23, 8, 1, -16 }, +/* '*' 0x2A */ { 1589, 7, 7, 9, 1, -16 }, +/* '+' 0x2B */ { 1596, 10, 11, 14, 2, -9 }, +/* ',' 0x2C */ { 1610, 2, 6, 7, 2, 0 }, +/* '-' 0x2D */ { 1612, 6, 2, 8, 1, -6 }, +/* '.' 0x2E */ { 1614, 2, 2, 6, 2, 0 }, +/* '/' 0x2F */ { 1615, 7, 18, 7, 0, -16 }, +/* '0' 0x30 */ { 1631, 11, 17, 13, 1, -15 }, +/* '1' 0x31 */ { 1655, 5, 17, 13, 3, -15 }, +/* '2' 0x32 */ { 1666, 11, 17, 13, 1, -15 }, +/* '3' 0x33 */ { 1690, 11, 17, 13, 1, -15 }, +/* '4' 0x34 */ { 1714, 11, 17, 13, 1, -15 }, +/* '5' 0x35 */ { 1738, 11, 17, 13, 1, -15 }, +/* '6' 0x36 */ { 1762, 11, 17, 13, 1, -15 }, +/* '7' 0x37 */ { 1786, 11, 17, 13, 1, -15 }, +/* '8' 0x38 */ { 1810, 11, 17, 13, 1, -15 }, +/* '9' 0x39 */ { 1834, 11, 17, 13, 1, -15 }, +/* ':' 0x3A */ { 1858, 2, 13, 6, 2, -11 }, +/* ';' 0x3B */ { 1862, 2, 16, 6, 2, -10 }, +/* '<' 0x3C */ { 1866, 12, 11, 14, 1, -9 }, +/* '=' 0x3D */ { 1883, 12, 6, 14, 1, -7 }, +/* '>' 0x3E */ { 1892, 12, 11, 14, 1, -9 }, +/* '?' 0x3F */ { 1909, 10, 18, 13, 2, -16 }, +/* '@' 0x40 */ { 1932, 22, 21, 24, 1, -16 }, +/* 'A' 0x41 */ { 1990, 14, 18, 16, 1, -16 }, +/* 'B' 0x42 */ { 2022, 13, 18, 16, 2, -16 }, +/* 'C' 0x43 */ { 2052, 15, 18, 17, 1, -16 }, +/* 'D' 0x44 */ { 2086, 14, 18, 17, 2, -16 }, +/* 'E' 0x45 */ { 2118, 12, 18, 15, 2, -16 }, +/* 'F' 0x46 */ { 2145, 11, 18, 14, 2, -16 }, +/* 'G' 0x47 */ { 2170, 16, 18, 18, 1, -16 }, +/* 'H' 0x48 */ { 2206, 13, 18, 17, 2, -16 }, +/* 'I' 0x49 */ { 2236, 2, 18, 7, 2, -16 }, +/* 'J' 0x4A */ { 2241, 9, 18, 13, 1, -16 }, +/* 'K' 0x4B */ { 2262, 13, 18, 16, 2, -16 }, +/* 'L' 0x4C */ { 2292, 10, 18, 14, 2, -16 }, +/* 'M' 0x4D */ { 2315, 16, 18, 20, 2, -16 }, +/* 'N' 0x4E */ { 2351, 13, 18, 18, 2, -16 }, +/* 'O' 0x4F */ { 2381, 17, 18, 19, 1, -16 }, +/* 'P' 0x50 */ { 2420, 12, 18, 16, 2, -16 }, +/* 'Q' 0x51 */ { 2447, 17, 19, 19, 1, -16 }, +/* 'R' 0x52 */ { 2488, 14, 18, 17, 2, -16 }, +/* 'S' 0x53 */ { 2520, 14, 18, 16, 1, -16 }, +/* 'T' 0x54 */ { 2552, 12, 18, 15, 1, -16 }, +/* 'U' 0x55 */ { 2579, 13, 18, 17, 2, -16 }, +/* 'V' 0x56 */ { 2609, 14, 18, 15, 1, -16 }, +/* 'W' 0x57 */ { 2641, 22, 18, 22, 0, -16 }, +/* 'X' 0x58 */ { 2691, 14, 18, 16, 1, -16 }, +/* 'Y' 0x59 */ { 2723, 14, 18, 16, 1, -16 }, +/* 'Z' 0x5A */ { 2755, 13, 18, 15, 1, -16 }, +/* '[' 0x5B */ { 2785, 4, 23, 7, 2, -16 }, +/* '\' 0x5C */ { 2797, 7, 18, 7, 0, -16 }, +/* ']' 0x5D */ { 2813, 4, 23, 7, 1, -16 }, +/* '^' 0x5E */ { 2825, 9, 9, 11, 1, -15 }, +/* '_' 0x5F */ { 2836, 15, 1, 13, -1, 5 }, +/* '`' 0x60 */ { 2838, 5, 4, 6, 1, -16 }, +/* 'a' 0x61 */ { 2841, 12, 13, 13, 1, -11 }, +/* 'b' 0x62 */ { 2861, 12, 18, 13, 1, -16 }, +/* 'c' 0x63 */ { 2888, 10, 13, 12, 1, -11 }, +/* 'd' 0x64 */ { 2905, 11, 18, 13, 1, -16 }, +/* 'e' 0x65 */ { 2930, 11, 13, 13, 1, -11 }, +/* 'f' 0x66 */ { 2948, 5, 18, 7, 1, -16 }, +/* 'g' 0x67 */ { 2960, 11, 18, 13, 1, -11 }, +/* 'h' 0x68 */ { 2985, 10, 18, 13, 1, -16 }, +/* 'i' 0x69 */ { 3008, 2, 18, 5, 2, -16 }, +/* 'j' 0x6A */ { 3013, 4, 23, 6, 0, -16 }, +/* 'k' 0x6B */ { 3025, 10, 18, 12, 1, -16 }, +/* 'l' 0x6C */ { 3048, 2, 18, 5, 1, -16 }, +/* 'm' 0x6D */ { 3053, 17, 13, 19, 1, -11 }, +/* 'n' 0x6E */ { 3081, 10, 13, 13, 1, -11 }, +/* 'o' 0x6F */ { 3098, 11, 13, 13, 1, -11 }, +/* 'p' 0x70 */ { 3116, 12, 17, 13, 1, -11 }, +/* 'q' 0x71 */ { 3142, 11, 17, 13, 1, -11 }, +/* 'r' 0x72 */ { 3166, 6, 13, 8, 1, -11 }, +/* 's' 0x73 */ { 3176, 10, 13, 12, 1, -11 }, +/* 't' 0x74 */ { 3193, 5, 16, 7, 1, -14 }, +/* 'u' 0x75 */ { 3203, 10, 13, 13, 1, -11 }, +/* 'v' 0x76 */ { 3220, 11, 13, 12, 0, -11 }, +/* 'w' 0x77 */ { 3238, 17, 13, 17, 0, -11 }, +/* 'x' 0x78 */ { 3266, 10, 13, 11, 1, -11 }, +/* 'y' 0x79 */ { 3283, 11, 18, 11, 0, -11 }, +/* 'z' 0x7A */ { 3308, 10, 13, 12, 1, -11 }, +/* '{' 0x7B */ { 3325, 5, 23, 8, 1, -16 }, +/* '|' 0x7C */ { 3340, 2, 23, 6, 2, -16 }, +/* '}' 0x7D */ { 3346, 5, 23, 8, 2, -16 }, +/* '~' 0x7E */ { 3361, 10, 5, 12, 1, -9 }, +/* 0x7F */ { 3368, 0, 0, 0, 0, 0 }, +/* 0x80 */ { 3368, 14, 17, 16, 1, -15 }, +/* 0x81 */ { 3398, 0, 0, 8, 0, 0 }, +/* 0x82 */ { 3398, 2, 5, 6, 2, 0 }, +/* 0x83 */ { 3400, 6, 23, 7, 0, -16 }, +/* 0x84 */ { 3418, 6, 5, 10, 2, 0 }, +/* 0x85 */ { 3422, 12, 2, 16, 2, 0 }, +/* 0x86 */ { 3425, 10, 21, 13, 2, -15 }, +/* 0x87 */ { 3452, 10, 20, 13, 2, -15 }, +/* 0x88 */ { 3477, 7, 4, 8, 0, -16 }, +/* 0x89 */ { 3481, 23, 18, 24, 0, -16 }, +/* 0x8A */ { 3533, 14, 21, 16, 1, -19 }, +/* 0x8B */ { 3570, 3, 8, 6, 1, -9 }, +/* 0x8C */ { 3573, 22, 18, 24, 1, -16 }, +/* 0x8D */ { 3623, 0, 0, 8, 0, 0 }, +/* 0x8E */ { 3623, 13, 21, 15, 1, -19 }, +/* 0x8F */ { 3658, 0, 0, 8, 0, 0 }, +/* 0x90 */ { 3658, 0, 0, 8, 0, 0 }, +/* 0x91 */ { 3658, 2, 6, 6, 2, -16 }, +/* 0x92 */ { 3660, 2, 6, 6, 2, -16 }, +/* 0x93 */ { 3662, 6, 6, 10, 2, -16 }, +/* 0x94 */ { 3667, 6, 6, 10, 2, -16 }, +/* 0x95 */ { 3672, 6, 6, 10, 2, -9 }, +/* 0x96 */ { 3677, 10, 2, 12, 1, -6 }, +/* 0x97 */ { 3680, 22, 2, 24, 1, -6 }, +/* 0x98 */ { 3686, 7, 3, 8, 0, -16 }, +/* 0x99 */ { 3689, 22, 13, 24, 2, -16 }, +/* 0x9A */ { 3725, 10, 18, 12, 1, -16 }, +/* 0x9B */ { 3748, 3, 8, 6, 2, -8 }, +/* 0x9C */ { 3751, 20, 13, 22, 1, -11 }, +/* 0x9D */ { 3784, 0, 0, 8, 0, 0 }, +/* 0x9E */ { 3784, 10, 18, 12, 1, -16 }, +/* 0x9F */ { 3807, 14, 21, 16, 1, -19 }, +/* 0xA0 */ { 3844, 0, 0, 7, 0, 0 }, +/* 0xA1 */ { 3844, 2, 18, 8, 3, -11 }, +/* 0xA2 */ { 3849, 11, 17, 13, 1, -13 }, +/* 0xA3 */ { 3873, 12, 18, 13, 0, -16 }, +/* 0xA4 */ { 3900, 9, 9, 13, 2, -11 }, +/* 0xA5 */ { 3911, 12, 17, 13, 1, -15 }, +/* 0xA6 */ { 3937, 2, 23, 6, 2, -16 }, +/* 0xA7 */ { 3943, 11, 23, 13, 1, -16 }, +/* 0xA8 */ { 3975, 6, 2, 8, 1, -15 }, +/* 0xA9 */ { 3977, 18, 17, 19, 1, -15 }, +/* 0xAA */ { 4016, 7, 11, 9, 1, -16 }, +/* 0xAB */ { 4026, 8, 8, 12, 2, -9 }, +/* 0xAC */ { 4034, 12, 6, 14, 1, -7 }, +/* 0xAD */ { 4043, 6, 2, 8, 1, -6 }, +/* 0xAE */ { 4045, 18, 17, 19, 1, -15 }, +/* 0xAF */ { 4084, 6, 2, 8, 1, -15 }, +/* 0xB0 */ { 4086, 7, 8, 15, 4, -15 }, +/* 0xB1 */ { 4093, 12, 15, 14, 1, -13 }, +/* 0xB2 */ { 4116, 7, 10, 8, 1, -17 }, +/* 0xB3 */ { 4125, 7, 10, 8, 1, -17 }, +/* 0xB4 */ { 4134, 5, 4, 8, 2, -16 }, +/* 0xB5 */ { 4137, 12, 17, 13, 2, -11 }, +/* 0xB6 */ { 4163, 11, 21, 13, 2, -16 }, +/* 0xB7 */ { 4192, 2, 2, 6, 2, -6 }, +/* 0xB8 */ { 4193, 6, 5, 8, 1, 2 }, +/* 0xB9 */ { 4197, 3, 10, 8, 3, -18 }, +/* 0xBA */ { 4201, 6, 11, 9, 1, -16 }, +/* 0xBB */ { 4210, 8, 8, 12, 2, -8 }, +/* 0xBC */ { 4218, 17, 17, 21, 3, -15 }, +/* 0xBD */ { 4255, 18, 18, 21, 3, -16 }, +/* 0xBE */ { 4296, 19, 18, 21, 1, -16 }, +/* 0xBF */ { 4339, 9, 18, 13, 3, -11 }, +/* 0xC0 */ { 4360, 14, 22, 16, 1, -20 }, +/* 0xC1 */ { 4399, 14, 22, 16, 1, -20 }, +/* 0xC2 */ { 4438, 14, 22, 16, 1, -20 }, +/* 0xC3 */ { 4477, 14, 22, 16, 1, -20 }, +/* 0xC4 */ { 4516, 14, 21, 16, 1, -19 }, +/* 0xC5 */ { 4553, 14, 24, 16, 1, -22 }, +/* 0xC6 */ { 4595, 22, 18, 24, 0, -16 }, +/* 0xC7 */ { 4645, 15, 23, 17, 1, -16 }, +/* 0xC8 */ { 4689, 12, 22, 15, 2, -20 }, +/* 0xC9 */ { 4722, 12, 22, 15, 2, -20 }, +/* 0xCA */ { 4755, 12, 22, 15, 2, -20 }, +/* 0xCB */ { 4788, 12, 21, 15, 2, -19 }, +/* 0xCC */ { 4820, 4, 22, 7, 0, -20 }, +/* 0xCD */ { 4831, 4, 22, 7, 1, -20 }, +/* 0xCE */ { 4842, 6, 22, 7, 0, -20 }, +/* 0xCF */ { 4859, 7, 21, 7, 0, -19 }, +/* 0xD0 */ { 4878, 15, 18, 17, 1, -16 }, +/* 0xD1 */ { 4912, 13, 22, 18, 2, -20 }, +/* 0xD2 */ { 4948, 17, 22, 19, 1, -20 }, +/* 0xD3 */ { 4995, 17, 22, 19, 1, -20 }, +/* 0xD4 */ { 5042, 17, 22, 19, 1, -20 }, +/* 0xD5 */ { 5089, 17, 22, 19, 1, -20 }, +/* 0xD6 */ { 5136, 17, 21, 19, 1, -19 }, +/* 0xD7 */ { 5181, 8, 9, 14, 3, -8 }, +/* 0xD8 */ { 5190, 17, 18, 19, 1, -16 }, +/* 0xD9 */ { 5229, 13, 22, 17, 2, -20 }, +/* 0xDA */ { 5265, 13, 22, 17, 2, -20 }, +/* 0xDB */ { 5301, 13, 22, 17, 2, -20 }, +/* 0xDC */ { 5337, 13, 21, 17, 2, -19 }, +/* 0xDD */ { 5372, 14, 22, 16, 1, -20 }, +/* 0xDE */ { 5411, 12, 18, 15, 2, -16 }, +/* 0xDF */ { 5438, 11, 18, 14, 2, -16 }, +/* 0xE0 */ { 5463, 12, 18, 13, 1, -16 }, +/* 0xE1 */ { 5490, 12, 18, 13, 1, -16 }, +/* 0xE2 */ { 5517, 12, 18, 13, 1, -16 }, +/* 0xE3 */ { 5544, 12, 18, 13, 1, -16 }, +/* 0xE4 */ { 5571, 12, 17, 13, 1, -15 }, +/* 0xE5 */ { 5597, 12, 19, 13, 1, -17 }, +/* 0xE6 */ { 5626, 19, 13, 21, 1, -11 }, +/* 0xE7 */ { 5657, 10, 18, 12, 1, -11 }, +/* 0xE8 */ { 5680, 11, 18, 13, 1, -16 }, +/* 0xE9 */ { 5705, 11, 18, 13, 1, -16 }, +/* 0xEA */ { 5730, 11, 18, 13, 1, -16 }, +/* 0xEB */ { 5755, 11, 17, 13, 1, -15 }, +/* 0xEC */ { 5779, 4, 18, 5, 1, -16 }, +/* 0xED */ { 5788, 5, 18, 5, 0, -16 }, +/* 0xEE */ { 5800, 6, 18, 6, 0, -16 }, +/* 0xEF */ { 5814, 6, 17, 6, 0, -15 }, +/* 0xF0 */ { 5827, 11, 18, 13, 1, -16 }, +/* 0xF1 */ { 5852, 10, 18, 13, 1, -16 }, +/* 0xF2 */ { 5875, 11, 18, 13, 1, -16 }, +/* 0xF3 */ { 5900, 11, 18, 13, 1, -16 }, +/* 0xF4 */ { 5925, 11, 18, 13, 1, -16 }, +/* 0xF5 */ { 5950, 11, 18, 13, 1, -16 }, +/* 0xF6 */ { 5975, 11, 17, 13, 1, -15 }, +/* 0xF7 */ { 5999, 12, 11, 14, 1, -9 }, +/* 0xF8 */ { 6016, 11, 13, 13, 1, -11 }, +/* 0xF9 */ { 6034, 10, 18, 13, 1, -16 }, +/* 0xFA */ { 6057, 10, 18, 13, 1, -16 }, +/* 0xFB */ { 6080, 10, 18, 13, 1, -16 }, +/* 0xFC */ { 6103, 10, 17, 13, 1, -15 }, +/* 0xFD */ { 6125, 11, 23, 11, 0, -16 }, +/* 0xFE */ { 6157, 12, 21, 13, 1, -15 }, +/* 0xFF */ { 6189, 11, 22, 11, 0, -15 }, +}; + +const GFXfont FreeSans12pt_Win1252 PROGMEM = { +(uint8_t*)FreeSans12pt_Win1252Bitmaps, +(GFXglyph*)FreeSans12pt_Win1252Glyphs, +0x01, 0xFF, 19 +}; diff --git a/src/graphics/niche/InkHUD/Applet.cpp b/src/graphics/niche/InkHUD/Applet.cpp index 362a50d16..1e89ebe1b 100644 --- a/src/graphics/niche/InkHUD/Applet.cpp +++ b/src/graphics/niche/InkHUD/Applet.cpp @@ -8,8 +8,9 @@ using namespace NicheGraphics; -InkHUD::AppletFont InkHUD::Applet::fontLarge; // General purpose font. Set by setDefaultFonts -InkHUD::AppletFont InkHUD::Applet::fontSmall; // General purpose font. Set by setDefaultFonts +InkHUD::AppletFont InkHUD::Applet::fontLarge; // General purpose fonts. Set in nicheGraphics.h +InkHUD::AppletFont InkHUD::Applet::fontMedium; +InkHUD::AppletFont InkHUD::Applet::fontSmall; constexpr float InkHUD::Applet::LOGO_ASPECT_RATIO; // Ratio of the Meshtastic logo InkHUD::Applet::Applet() : GFX(0, 0) diff --git a/src/graphics/niche/InkHUD/Applet.h b/src/graphics/niche/InkHUD/Applet.h index c6a8a8aad..802186e6e 100644 --- a/src/graphics/niche/InkHUD/Applet.h +++ b/src/graphics/niche/InkHUD/Applet.h @@ -95,7 +95,7 @@ class Applet : public GFX static uint16_t getHeaderHeight(); // How tall the "standard" applet header is - static AppletFont fontSmall, fontLarge; // The general purpose fonts, used by all applets + static AppletFont fontSmall, fontMedium, fontLarge; // The general purpose fonts, used by all applets const char *name = nullptr; // Shown in applet selection menu. Also used as an identifier by InkHUD::getSystemApplet diff --git a/src/graphics/niche/InkHUD/AppletFont.h b/src/graphics/niche/InkHUD/AppletFont.h index 67348b8d3..e1fe37974 100644 --- a/src/graphics/niche/InkHUD/AppletFont.h +++ b/src/graphics/niche/InkHUD/AppletFont.h @@ -61,20 +61,26 @@ class AppletFont // Line padding has been adjusted manually, to compensate for a few *extra tall* diacritics // Central European +#include "graphics/niche/Fonts/FreeSans12pt_Win1250.h" #include "graphics/niche/Fonts/FreeSans6pt_Win1250.h" #include "graphics/niche/Fonts/FreeSans9pt_Win1250.h" +#define FREESANS_12PT_WIN1250 InkHUD::AppletFont(FreeSans12pt_Win1250, InkHUD::AppletFont::WINDOWS_1250, -3, 1) #define FREESANS_9PT_WIN1250 InkHUD::AppletFont(FreeSans9pt_Win1250, InkHUD::AppletFont::WINDOWS_1250, -1, -1) #define FREESANS_6PT_WIN1250 InkHUD::AppletFont(FreeSans6pt_Win1250, InkHUD::AppletFont::WINDOWS_1250, -1, -2) // Cyrillic +#include "graphics/niche/Fonts/FreeSans12pt_Win1251.h" #include "graphics/niche/Fonts/FreeSans6pt_Win1251.h" #include "graphics/niche/Fonts/FreeSans9pt_Win1251.h" +#define FREESANS_12PT_WIN1251 InkHUD::AppletFont(FreeSans12pt_Win1251, InkHUD::AppletFont::WINDOWS_1251, -3, 1) #define FREESANS_9PT_WIN1251 InkHUD::AppletFont(FreeSans9pt_Win1251, InkHUD::AppletFont::WINDOWS_1251, -2, -1) #define FREESANS_6PT_WIN1251 InkHUD::AppletFont(FreeSans6pt_Win1251, InkHUD::AppletFont::WINDOWS_1251, -1, -2) // Western European +#include "graphics/niche/Fonts/FreeSans12pt_Win1252.h" #include "graphics/niche/Fonts/FreeSans6pt_Win1252.h" #include "graphics/niche/Fonts/FreeSans9pt_Win1252.h" +#define FREESANS_12PT_WIN1252 InkHUD::AppletFont(FreeSans12pt_Win1252, InkHUD::AppletFont::WINDOWS_1252, -3, 1) #define FREESANS_9PT_WIN1252 InkHUD::AppletFont(FreeSans9pt_Win1252, InkHUD::AppletFont::WINDOWS_1252, -2, -1) #define FREESANS_6PT_WIN1252 InkHUD::AppletFont(FreeSans6pt_Win1252, InkHUD::AppletFont::WINDOWS_1252, -1, -2) diff --git a/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp b/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp index 7fa31b244..1b0bfa9d0 100644 --- a/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp @@ -168,11 +168,11 @@ void InkHUD::NodeListApplet::onRender() // Define two lines of text for the card // We will center our text on these lines - uint16_t lineAY = cardTopY + (fontLarge.lineHeight() / 2); - uint16_t lineBY = cardTopY + fontLarge.lineHeight() + (fontSmall.lineHeight() / 2); + uint16_t lineAY = cardTopY + (fontMedium.lineHeight() / 2); + uint16_t lineBY = cardTopY + fontMedium.lineHeight() + (fontSmall.lineHeight() / 2); // Print the short name - setFont(fontLarge); + setFont(fontMedium); printAt(0, lineAY, shortName, LEFT, MIDDLE); // Print the distance @@ -182,8 +182,8 @@ void InkHUD::NodeListApplet::onRender() // If we have a direct connection to the node, draw the signal indicator if (hopsAway == 0 && signal != SIGNAL_UNKNOWN) { uint16_t signalW = getTextWidth("Xkm"); // Indicator should be similar width to distance label - uint16_t signalH = fontLarge.lineHeight() * 0.75; - int16_t signalY = lineAY + (fontLarge.lineHeight() / 2) - (fontLarge.lineHeight() * 0.75); + uint16_t signalH = fontMedium.lineHeight() * 0.75; + int16_t signalY = lineAY + (fontMedium.lineHeight() / 2) - (fontMedium.lineHeight() * 0.75); int16_t signalX = width() - signalW; drawSignalIndicator(signalX, signalY, signalW, signalH, signal); } diff --git a/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.h b/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.h index 0abcad824..c2340027b 100644 --- a/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.h +++ b/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.h @@ -65,8 +65,8 @@ class NodeListApplet : public Applet, public MeshModule // Card Dimensions // - for rendering and for maxCards calc - const uint8_t cardMarginH = fontSmall.lineHeight() / 2; // Gap between cards - const uint16_t cardH = fontLarge.lineHeight() + fontSmall.lineHeight() + cardMarginH; // Height of card + uint8_t cardMarginH = fontSmall.lineHeight() / 2; // Gap between cards + uint16_t cardH = fontMedium.lineHeight() + fontSmall.lineHeight() + cardMarginH; // Height of card }; } // namespace NicheGraphics::InkHUD diff --git a/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp index d9a3bd2dd..858b1e132 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp @@ -15,7 +15,7 @@ InkHUD::LogoApplet::LogoApplet() : concurrency::OSThread("LogoApplet") // This behavior assists manufacturers during mass production, and should not be modified without good reason if (!settings->tips.safeShutdownSeen) { meshtastic_NodeInfoLite *ourNode = nodeDB->getMeshNode(nodeDB->getNodeNum()); - fontTitle = fontLarge; + fontTitle = fontMedium; textLeft = xstr(APP_VERSION_SHORT); textRight = parseShortName(ourNode); textTitle = "Meshtastic"; @@ -116,7 +116,7 @@ void InkHUD::LogoApplet::onShutdown() textLeft = ""; textRight = ""; textTitle = parseShortName(ourNode); - fontTitle = fontLarge; + fontTitle = fontMedium; // This is then drawn by InkHUD::Events::onShutdown, with a blocking FULL update, after InkHUD's flash write is complete } diff --git a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp index 27d1825d5..a1f79a28f 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp @@ -667,11 +667,11 @@ void InkHUD::MenuApplet::drawSystemInfoPanel(int16_t left, int16_t top, uint16_t // ==================== std::string clockString = getTimeString(); if (clockString.length() > 0) { - setFont(fontLarge); + setFont(fontMedium); printAt(width / 2, top, clockString, CENTER, TOP); - height += fontLarge.lineHeight(); - height += fontLarge.lineHeight() * 0.1; // Padding below clock + height += fontMedium.lineHeight(); + height += fontMedium.lineHeight() * 0.1; // Padding below clock } // Stats diff --git a/src/graphics/niche/InkHUD/Applets/System/Pairing/PairingApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Pairing/PairingApplet.cpp index 3f51c7f88..09931f109 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Pairing/PairingApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Pairing/PairingApplet.cpp @@ -12,13 +12,13 @@ InkHUD::PairingApplet::PairingApplet() void InkHUD::PairingApplet::onRender() { // Header - setFont(fontLarge); + setFont(fontMedium); printAt(X(0.5), Y(0.25), "Bluetooth", CENTER, BOTTOM); setFont(fontSmall); printAt(X(0.5), Y(0.25), "Enter this code", CENTER, TOP); // Passkey - setFont(fontLarge); + setFont(fontMedium); printThick(X(0.5), Y(0.5), passkey.substr(0, 3) + " " + passkey.substr(3), 3, 2); // Device's bluetooth name, if it will fit diff --git a/src/graphics/niche/InkHUD/Applets/System/Tips/TipsApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Tips/TipsApplet.cpp index 82a196cb1..ade44ab65 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Tips/TipsApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Tips/TipsApplet.cpp @@ -50,11 +50,11 @@ void InkHUD::TipsApplet::onRender() break; case Tip::FINISH_SETUP: { - setFont(fontLarge); + setFont(fontMedium); printAt(0, 0, "Tip: Finish Setup"); setFont(fontSmall); - int16_t cursorY = fontLarge.lineHeight() * 1.5; + int16_t cursorY = fontMedium.lineHeight() * 1.5; printAt(0, cursorY, "- connect antenna"); cursorY += fontSmall.lineHeight() * 1.2; @@ -80,7 +80,7 @@ void InkHUD::TipsApplet::onRender() } break; case Tip::SAFE_SHUTDOWN: { - setFont(fontLarge); + setFont(fontMedium); printAt(0, 0, "Tip: Shutdown"); setFont(fontSmall); @@ -88,29 +88,29 @@ void InkHUD::TipsApplet::onRender() shutdown += "Before removing power, please shut down from InkHUD menu, or a client app. \n"; shutdown += "\n"; shutdown += "This ensures data is saved."; - printWrapped(0, fontLarge.lineHeight() * 1.5, width(), shutdown); + printWrapped(0, fontMedium.lineHeight() * 1.5, width(), shutdown); printAt(0, Y(1.0), "Press button to continue", LEFT, BOTTOM); } break; case Tip::CUSTOMIZATION: { - setFont(fontLarge); + setFont(fontMedium); printAt(0, 0, "Tip: Customization"); setFont(fontSmall); - printWrapped(0, fontLarge.lineHeight() * 1.5, width(), + printWrapped(0, fontMedium.lineHeight() * 1.5, width(), "Configure & control display with the InkHUD menu. Optional features, layout, rotation, and more."); printAt(0, Y(1.0), "Press button to continue", LEFT, BOTTOM); } break; case Tip::BUTTONS: { - setFont(fontLarge); + setFont(fontMedium); printAt(0, 0, "Tip: Buttons"); setFont(fontSmall); - int16_t cursorY = fontLarge.lineHeight() * 1.5; + int16_t cursorY = fontMedium.lineHeight() * 1.5; printAt(0, cursorY, "User Button"); cursorY += fontSmall.lineHeight() * 1.2; @@ -123,11 +123,11 @@ void InkHUD::TipsApplet::onRender() } break; case Tip::ROTATION: { - setFont(fontLarge); + setFont(fontMedium); printAt(0, 0, "Tip: Rotation"); setFont(fontSmall); - printWrapped(0, fontLarge.lineHeight() * 1.5, width(), + printWrapped(0, fontMedium.lineHeight() * 1.5, width(), "To rotate the display, use the InkHUD menu. Long-press the user button > Options > Rotate."); printAt(0, Y(1.0), "Press button to continue", LEFT, BOTTOM); @@ -155,7 +155,7 @@ void InkHUD::TipsApplet::renderWelcome() uint16_t logoH = getLogoHeight(logoWLimit, logoHLimit); // Title size - setFont(fontLarge); + setFont(fontMedium); std::string title; if (width() >= 200) // Future proofing: hide if *tiny* display title = "meshtastic.org"; diff --git a/src/graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.cpp b/src/graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.cpp index 17d724aee..7c6232f3b 100644 --- a/src/graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.cpp @@ -101,15 +101,25 @@ void InkHUD::AllMessageApplet::onRender() // Extra gap below the header int16_t textTop = headerDivY + padDivH; - // Determine size if printed large + // Attempt to print with fontLarge + uint32_t textHeight; setFont(fontLarge); - uint32_t textHeight = getWrappedTextHeight(0, width(), text); + textHeight = getWrappedTextHeight(0, width(), text); + if (textHeight <= (uint32_t)height()) { + printWrapped(0, textTop, width(), text); + return; + } - // If too large, swap to small font - if (textHeight + textTop > (uint32_t)height()) // (compare signed and unsigned) - setFont(fontSmall); + // Fallback (too large): attempt to print with fontMedium + setFont(fontMedium); + textHeight = getWrappedTextHeight(0, width(), text); + if (textHeight <= (uint32_t)height()) { + printWrapped(0, textTop, width(), text); + return; + } - // Print text + // Fallback (too large): print with fontSmall + setFont(fontSmall); printWrapped(0, textTop, width(), text); } diff --git a/src/graphics/niche/InkHUD/Applets/User/DM/DMApplet.cpp b/src/graphics/niche/InkHUD/Applets/User/DM/DMApplet.cpp index dbf5c08fb..a3b9615a5 100644 --- a/src/graphics/niche/InkHUD/Applets/User/DM/DMApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/User/DM/DMApplet.cpp @@ -97,15 +97,25 @@ void InkHUD::DMApplet::onRender() // Extra gap below the header int16_t textTop = headerDivY + padDivH; - // Determine size if printed large + // Attempt to print with fontLarge + uint32_t textHeight; setFont(fontLarge); - uint32_t textHeight = getWrappedTextHeight(0, width(), text); + textHeight = getWrappedTextHeight(0, width(), text); + if (textHeight <= (uint32_t)height()) { + printWrapped(0, textTop, width(), text); + return; + } - // If too large, swap to small font - if (textHeight + textTop > (uint32_t)height()) // (compare signed and unsigned) - setFont(fontSmall); + // Fallback (too large): attempt to print with fontMedium + setFont(fontMedium); + textHeight = getWrappedTextHeight(0, width(), text); + if (textHeight <= (uint32_t)height()) { + printWrapped(0, textTop, width(), text); + return; + } - // Print text + // Fallback (too large): print with fontSmall + setFont(fontSmall); printWrapped(0, textTop, width(), text); } diff --git a/src/graphics/niche/InkHUD/docs/README.md b/src/graphics/niche/InkHUD/docs/README.md index c30d25845..e7821299e 100644 --- a/src/graphics/niche/InkHUD/docs/README.md +++ b/src/graphics/niche/InkHUD/docs/README.md @@ -312,18 +312,19 @@ As a general overview: ## Fonts -InkHUD uses AdafruitGFX fonts. The large and small font which are shared by all applets are set in nicheGraphics.h. +InkHUD uses AdafruitGFX fonts. Three shared fonts (small, medium, large) are available for use by all applets. These are set per-variant in nicheGraphics.h. ```cpp // Prepare fonts -InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; +InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; +InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252; InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Using a generic AdafruitGFX font instead: -// InkHUD::Applet::fontLarge = FreeSerif9pt7b; +// InkHUD::Applet::fontLarge = FreeSerif18pt7b; ``` -Any generic AdafruitGFX font may be used, but the fonts which are bundled with InkHUD have been customized with extended-ASCII character sets. +Any generic AdafruitGFX font may be used, but the fonts which are bundled with InkHUD have been customized with extended-ASCII character sets and emoji. ### Parsing Unicode Text @@ -351,10 +352,12 @@ InkHUD is bundled with extended-ASCII fonts for: The default builds use Windows-1252 encoding. This can be changed in nicheGraphics.h. ```cpp -InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1250; +InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1250; +InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1250; InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1250; -InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1251; +InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1251; +InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1251; InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1251; ``` diff --git a/variants/ELECROW-ThinkNode-M1/nicheGraphics.h b/variants/ELECROW-ThinkNode-M1/nicheGraphics.h index f3b709261..b4395114f 100644 --- a/variants/ELECROW-ThinkNode-M1/nicheGraphics.h +++ b/variants/ELECROW-ThinkNode-M1/nicheGraphics.h @@ -56,7 +56,8 @@ void setupNicheGraphics() inkhud->setDisplayResilience(10, 1.5); // Select fonts - InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; + InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252; InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Customize default settings diff --git a/variants/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h b/variants/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h index bbd530595..8f30a244f 100644 --- a/variants/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h +++ b/variants/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h @@ -55,8 +55,9 @@ void setupNicheGraphics() // Set how many FAST updates per FULL update. inkhud->setDisplayResilience(INKHUD_BUILDCONF_DISPLAYRESILIENCE); // Suggest roughly ten - // Prepare fonts - InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + // Select fonts + InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; + InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252; InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Init settings, and customize defaults diff --git a/variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h b/variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h index fe1c281bf..b6be70ff4 100644 --- a/variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h +++ b/variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h @@ -56,8 +56,9 @@ void setupNicheGraphics() // Set how many FAST updates per FULL update. inkhud->setDisplayResilience(INKHUD_BUILDCONF_DISPLAYRESILIENCE); // Suggest roughly ten - // Prepare fonts - InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + // Select fonts + InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; + InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252; InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Init settings, and customize defaults diff --git a/variants/heltec_mesh_pocket/nicheGraphics.h b/variants/heltec_mesh_pocket/nicheGraphics.h index 271a35d6d..f8202debb 100644 --- a/variants/heltec_mesh_pocket/nicheGraphics.h +++ b/variants/heltec_mesh_pocket/nicheGraphics.h @@ -50,7 +50,8 @@ void setupNicheGraphics() inkhud->setDisplayResilience(10, 1.5); // Select fonts - InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; + InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252; InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Customize default settings diff --git a/variants/heltec_vision_master_e213/nicheGraphics.h b/variants/heltec_vision_master_e213/nicheGraphics.h index 26f393f6c..5f443e4da 100644 --- a/variants/heltec_vision_master_e213/nicheGraphics.h +++ b/variants/heltec_vision_master_e213/nicheGraphics.h @@ -54,7 +54,8 @@ void setupNicheGraphics() inkhud->setDisplayResilience(10, 1.5); // Select fonts - InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; + InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252; InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Customize default settings diff --git a/variants/heltec_vision_master_e290/nicheGraphics.h b/variants/heltec_vision_master_e290/nicheGraphics.h index f3cf6355e..f29873c15 100644 --- a/variants/heltec_vision_master_e290/nicheGraphics.h +++ b/variants/heltec_vision_master_e290/nicheGraphics.h @@ -67,7 +67,8 @@ void setupNicheGraphics() inkhud->setDisplayResilience(7, 1.5); // Select fonts - InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; + InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252; InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Customize default settings diff --git a/variants/heltec_wireless_paper/nicheGraphics.h b/variants/heltec_wireless_paper/nicheGraphics.h index c8994b7f1..cbf80bc5e 100644 --- a/variants/heltec_wireless_paper/nicheGraphics.h +++ b/variants/heltec_wireless_paper/nicheGraphics.h @@ -51,7 +51,8 @@ void setupNicheGraphics() inkhud->setDisplayResilience(10, 1.5); // Select fonts - InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; + InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252; InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Customize default settings diff --git a/variants/seeed_wio_tracker_L1_eink/nicheGraphics.h b/variants/seeed_wio_tracker_L1_eink/nicheGraphics.h index 12ec4479a..a32753343 100644 --- a/variants/seeed_wio_tracker_L1_eink/nicheGraphics.h +++ b/variants/seeed_wio_tracker_L1_eink/nicheGraphics.h @@ -57,7 +57,8 @@ void setupNicheGraphics() inkhud->setDisplayResilience(7, 1.5); // Select fonts - InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; + InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252; InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Customize default settings diff --git a/variants/t-echo/nicheGraphics.h b/variants/t-echo/nicheGraphics.h index 03185cf5b..c89d816b9 100644 --- a/variants/t-echo/nicheGraphics.h +++ b/variants/t-echo/nicheGraphics.h @@ -57,7 +57,8 @@ void setupNicheGraphics() inkhud->setDisplayResilience(20, 1.5); // Select fonts - InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; + InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252; InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Customize default settings diff --git a/variants/tlora_t3s3_epaper/nicheGraphics.h b/variants/tlora_t3s3_epaper/nicheGraphics.h index 5184037e8..8f5e63653 100644 --- a/variants/tlora_t3s3_epaper/nicheGraphics.h +++ b/variants/tlora_t3s3_epaper/nicheGraphics.h @@ -51,7 +51,8 @@ void setupNicheGraphics() inkhud->setDisplayResilience(15, 1.5); // Select fonts - InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; + InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; + InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252; InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Customize default settings From 3fdefe82895040ab6e4e317de1c7d32184b007dc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 10:22:14 +1000 Subject: [PATCH 386/461] chore(deps): update sensirion i2c scd4x to v1.1.0 (#7207) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 7f55ab2b1..795f86eb9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -199,4 +199,4 @@ lib_deps = # renovate: datasource=custom.pio depName=Sensirion Core packageName=sensirion/library/Sensirion Core sensirion/Sensirion Core@0.7.1 # renovate: datasource=custom.pio depName=Sensirion I2C SCD4x packageName=sensirion/library/Sensirion I2C SCD4x - sensirion/Sensirion I2C SCD4x@1.0.0 + sensirion/Sensirion I2C SCD4x@1.1.0 From a6be2e46ed28254cd379f5e999bbecc16075fe6f Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 2 Jul 2025 20:50:49 -0500 Subject: [PATCH 387/461] 2.7 fixes w2 (#7148) * Initial work on splitting notification renderer into components for reuse * More progress * Fix notification popup * more fix, less crash * Adjustments for OLED on keeping menus tidy, added Bluetooth Toggle to Home frame. Also widen the frame slightly if you have a scroll bar * Small changes for EInk to not crowd elements * Change System frame menu over to better match actions; added color picker for T114 * Fix build errors and add T190 for testing * Logic gates are hard sometimes * Screen Color Picker changes, defined Yellow as a Color. * Additional colors and tuning * Abandon std::sort in NodeDB, and associated fixes (#7175) * Generate short name for nodes that don't have user yet * Add reboot menu * Sort fixes * noop sort option to avoid infinite loop * Refactor Overlay Banner * Continuing work on Color Picker * Add BaseUI menus to add and remove Favorited Nodes * Create TFT_MESH_OVERRIDE for variants.h and defined colors * Trigger a NodeStatus update at the end of setup() to get fresh data on display at boot. * T114 defaults to White, Yellow is now bright Yellow * Revert "T114 defaults to White, Yellow is now bright Yellow" This reverts commit 8d05e17f11eb48c42460176317893a50abd2eeb2. * Only show OEM text if not OLED * Adjust OEM logo to maximize visible area * Start plumbing in Color Picker changes * Finished plumbing * Fix warning * Revert "Fix warning" This reverts commit 2e8aecd52d6f5b9058e0bde09b72ece43a5f3a48. * Fix display not fully redrawing * T-Deck should get color too * Emote Revamp * Update emotes.cpp * Poo Emote fix * Trunk fix * Add secret test menu and number picker * Missed bits * Save colors between reboots * Save Clock Face election to protobuf * Make reboot first, then settings * Add padding for single line pop-ups * Compass saving and faster menus * Resolve build issue with Excluding GPS * Resolve issue with memory bars on EInk * Add brightness settings for supported screen (#7182) * Add brightness menu. * add loop destination selection. * Bring back color (and sanity) to the menus! * Trunk --------- Co-authored-by: Ben Meadors Co-authored-by: Jason P Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> Co-authored-by: Wilson --- protobufs | 2 +- src/commands.h | 3 +- src/graphics/Screen.cpp | 161 +++- src/graphics/Screen.h | 40 +- src/graphics/SharedUIDisplay.cpp | 26 + src/graphics/SharedUIDisplay.h | 5 + src/graphics/TFTDisplay.cpp | 7 +- src/graphics/draw/ClockRenderer.cpp | 1 - src/graphics/draw/ClockRenderer.h | 2 - src/graphics/draw/CompassRenderer.cpp | 2 +- src/graphics/draw/DebugRenderer.cpp | 5 +- src/graphics/draw/MenuHandler.cpp | 705 ++++++++++++++---- src/graphics/draw/MenuHandler.h | 21 +- src/graphics/draw/NodeListRenderer.cpp | 6 +- src/graphics/draw/NotificationRenderer.cpp | 368 +++++++-- src/graphics/draw/NotificationRenderer.h | 14 + src/graphics/draw/UIRenderer.cpp | 59 +- src/graphics/emotes.cpp | 154 ++-- src/graphics/emotes.h | 34 +- src/main.cpp | 5 +- src/mesh/NodeDB.cpp | 68 +- src/mesh/NodeDB.h | 35 +- src/modules/AdminModule.cpp | 2 +- src/modules/CannedMessageModule.cpp | 21 +- src/modules/KeyVerificationModule.cpp | 17 +- src/modules/SystemCommandsModule.cpp | 20 +- .../Telemetry/EnvironmentTelemetry.cpp | 2 +- src/modules/WaypointModule.cpp | 4 +- src/nimble/NimbleBluetooth.cpp | 61 +- src/shutdown.h | 2 +- variants/heltec_mesh_node_t114/variant.h | 3 + variants/picomputer-s3/variant.h | 2 +- variants/tracksenger/internal/variant.h | 2 +- variants/tracksenger/lcd/variant.h | 2 +- variants/tracksenger/oled/variant.h | 2 +- 35 files changed, 1441 insertions(+), 422 deletions(-) diff --git a/protobufs b/protobufs index 5ef7aec95..386fa53c1 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 5ef7aec9597c6f841152e63b84d9dd7608cdef81 +Subproject commit 386fa53c1596c8dfc547521f08df107f4cb3a275 diff --git a/src/commands.h b/src/commands.h index e0bfab330..603003e5c 100644 --- a/src/commands.h +++ b/src/commands.h @@ -13,5 +13,6 @@ enum class Cmd { START_FIRMWARE_UPDATE_SCREEN, STOP_BOOT_SCREEN, SHOW_PREV_FRAME, - SHOW_NEXT_FRAME + SHOW_NEXT_FRAME, + NOOP }; \ No newline at end of file diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index c8c9d8b74..067e4418f 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -69,6 +69,8 @@ using graphics::Emote; using graphics::emotes; using graphics::numEmotes; +extern uint16_t TFT_MESH; + #if HAS_WIFI && !defined(ARCH_PORTDUINO) #include "mesh/wifi/WiFiAPClient.h" #endif @@ -135,10 +137,66 @@ extern bool hasUnreadMessage; // Displays a temporary centered banner message (e.g., warning, status, etc.) // The banner appears in the center of the screen and disappears after the specified duration -// Called to trigger a banner with custom message and duration -void Screen::showOverlayBanner(const char *message, uint32_t durationMs, const char **optionsArrayPtr, uint8_t options, - std::function bannerCallback, int8_t InitialSelected) +void Screen::showSimpleBanner(const char *message, uint32_t durationMs) { + BannerOverlayOptions options; + options.message = message; + options.durationMs = durationMs; + options.notificationType = notificationTypeEnum::text_banner; + showOverlayBanner(options); +} + +// Called to trigger a banner with custom message and duration +void Screen::showOverlayBanner(BannerOverlayOptions banner_overlay_options) +{ +#ifdef USE_EINK + EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip full refresh for all overlay menus +#endif + // Store the message and set the expiration timestamp + strncpy(NotificationRenderer::alertBannerMessage, banner_overlay_options.message, 255); + NotificationRenderer::alertBannerMessage[255] = '\0'; // Ensure null termination + NotificationRenderer::alertBannerUntil = + (banner_overlay_options.durationMs == 0) ? 0 : millis() + banner_overlay_options.durationMs; + NotificationRenderer::optionsArrayPtr = banner_overlay_options.optionsArrayPtr; + NotificationRenderer::optionsEnumPtr = banner_overlay_options.optionsEnumPtr; + NotificationRenderer::alertBannerOptions = banner_overlay_options.optionsCount; + NotificationRenderer::alertBannerCallback = banner_overlay_options.bannerCallback; + NotificationRenderer::curSelected = banner_overlay_options.InitialSelected; + NotificationRenderer::pauseBanner = false; + NotificationRenderer::current_notification_type = notificationTypeEnum::selection_picker; + static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawBannercallback}; + ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); + ui->setTargetFPS(60); + ui->update(); +} + +// Called to trigger a banner with custom message and duration +void Screen::showNodePicker(const char *message, uint32_t durationMs, std::function bannerCallback) +{ +#ifdef USE_EINK + EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip full refresh for all overlay menus +#endif + nodeDB->pause_sort(true); + // Store the message and set the expiration timestamp + strncpy(NotificationRenderer::alertBannerMessage, message, 255); + NotificationRenderer::alertBannerMessage[255] = '\0'; // Ensure null termination + NotificationRenderer::alertBannerUntil = (durationMs == 0) ? 0 : millis() + durationMs; + NotificationRenderer::alertBannerCallback = bannerCallback; + NotificationRenderer::pauseBanner = false; + NotificationRenderer::curSelected = 0; + NotificationRenderer::current_notification_type = notificationTypeEnum::node_picker; + + static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawBannercallback}; + ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); + ui->setTargetFPS(60); + ui->update(); +} + +// Called to trigger a banner with custom message and duration +void Screen::showNumberPicker(const char *message, uint32_t durationMs, uint8_t digits, + std::function bannerCallback) +{ + LOG_WARN("Show Number Picker"); #ifdef USE_EINK EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip full refresh for all overlay menus #endif @@ -146,14 +204,16 @@ void Screen::showOverlayBanner(const char *message, uint32_t durationMs, const c strncpy(NotificationRenderer::alertBannerMessage, message, 255); NotificationRenderer::alertBannerMessage[255] = '\0'; // Ensure null termination NotificationRenderer::alertBannerUntil = (durationMs == 0) ? 0 : millis() + durationMs; - NotificationRenderer::optionsArrayPtr = optionsArrayPtr; - NotificationRenderer::alertBannerOptions = options; NotificationRenderer::alertBannerCallback = bannerCallback; - NotificationRenderer::curSelected = InitialSelected; NotificationRenderer::pauseBanner = false; - static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawAlertBannerOverlay}; + NotificationRenderer::curSelected = 0; + NotificationRenderer::current_notification_type = notificationTypeEnum::number_picker; + NotificationRenderer::numDigits = digits; + NotificationRenderer::currentNumber = 0; + + static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawBannercallback}; ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); - setFastFramerate(); // Draw ASAP + ui->setTargetFPS(60); ui->update(); } @@ -230,6 +290,20 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O : concurrency::OSThread("Screen"), address_found(address), model(screenType), geometry(geometry), cmdQueue(32) { graphics::normalFrames = new FrameCallback[MAX_NUM_NODES + NUM_EXTRA_FRAMES]; + + LOG_INFO("Protobuf Value uiconfig.screen_rgb_color: %d", uiconfig.screen_rgb_color); + int32_t rawRGB = uiconfig.screen_rgb_color; + if (rawRGB > 0 && rawRGB <= 255255255) { + uint8_t r = (rawRGB >> 16) & 0xFF; + uint8_t g = (rawRGB >> 8) & 0xFF; + uint8_t b = rawRGB & 0xFF; + LOG_INFO("Values of r,g,b: %d, %d, %d", r, g, b); + + if (r <= 255 && g <= 255 && b <= 255) { + TFT_MESH = COLOR565(r, g, b); + } + } + #if defined(USE_SH1106) || defined(USE_SH1107) || defined(USE_SH1107_128_64) dispdev = new SH1106Wire(address.address, -1, -1, geometry, (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); @@ -239,7 +313,7 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O ST7789_MISO, ST7789_SCK); #else dispdev = new ST7789Spi(&SPI1, ST7789_RESET, ST7789_RS, ST7789_NSS, GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT); - static_cast(dispdev)->setRGB(COLOR565(255, 255, 128)); + static_cast(dispdev)->setRGB(TFT_MESH); #endif #elif defined(USE_SSD1306) dispdev = new SSD1306Wire(address.address, -1, -1, geometry, @@ -386,9 +460,22 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) void Screen::setup() { + // === Enable display rendering === useDisplay = true; + // === Load saved brightness from UI config === + // For OLED displays (SSD1306), default brightness is 255 if not set + if (uiconfig.screen_brightness == 0) { +#if defined(USE_OLED) || defined(USE_SSD1306) || defined(USE_SH1106) || defined(USE_SH1107) + brightness = 255; // Default for OLED +#else + brightness = BRIGHTNESS_DEFAULT; +#endif + } else { + brightness = uiconfig.screen_brightness; + } + // === Detect OLED subtype (if supported by board variant) === #ifdef AutoOLEDWire_h if (isAUTOOled) @@ -416,6 +503,14 @@ void Screen::setup() ui->disableAllIndicators(); // Disable page indicator dots ui->getUiState()->userData = this; // Allow static callbacks to access Screen instance + // === Apply loaded brightness === +#if defined(ST7789_CS) + static_cast(dispdev)->setDisplayBrightness(brightness); +#elif defined(USE_OLED) || defined(USE_SSD1306) || defined(USE_SH1106) || defined(USE_SH1107) + dispdev->setBrightness(brightness); +#endif + LOG_INFO("Applied screen brightness: %d", brightness); + // === Set custom overlay callbacks === static OverlayCallback overlays[] = { graphics::UIRenderer::drawNavigationBar // Custom indicator icons for each frame @@ -562,7 +657,7 @@ int32_t Screen::runOnce() if (displayHeight == 0) { displayHeight = dispdev->getHeight(); } - menuHandler::handleMenuSwitch(); + menuHandler::handleMenuSwitch(dispdev); // Show boot screen for first logo_timeout seconds, then switch to normal operation. // serialSinceMsec adjusts for additional serial wait time during nRF52 bootup @@ -595,7 +690,7 @@ int32_t Screen::runOnce() } #endif if (!NotificationRenderer::isOverlayBannerShowing() && rebootAtMsec != 0) { - showOverlayBanner("Rebooting...", 0); + showSimpleBanner("Rebooting...", 0); } // Process incoming commands. @@ -642,6 +737,8 @@ int32_t Screen::runOnce() EINK_ADD_FRAMEFLAG(dispdev, COSMETIC); // E-Ink: Explicitly use full-refresh for next frame setFrames(); break; + case Cmd::NOOP: + break; default: LOG_ERROR("Invalid screen cmd"); } @@ -785,8 +882,8 @@ void Screen::setFrames(FrameFocus focus) #if defined(DISPLAY_CLOCK_FRAME) fsi.positions.clock = numframes; - normalFrames[numframes++] = graphics::ClockRenderer::digitalWatchFace ? graphics::ClockRenderer::drawDigitalClockFrame - : &graphics::ClockRenderer::drawAnalogClockFrame; + normalFrames[numframes++] = uiconfig.is_clockface_analog ? graphics::ClockRenderer::drawAnalogClockFrame + : graphics::ClockRenderer::drawDigitalClockFrame; indicatorIcons.push_back(digital_icon_clock); #endif @@ -842,8 +939,8 @@ void Screen::setFrames(FrameFocus focus) } #if !defined(DISPLAY_CLOCK_FRAME) fsi.positions.clock = numframes; - normalFrames[numframes++] = graphics::ClockRenderer::digitalWatchFace ? graphics::ClockRenderer::drawDigitalClockFrame - : graphics::ClockRenderer::drawAnalogClockFrame; + normalFrames[numframes++] = uiconfig.is_clockface_analog ? graphics::ClockRenderer::drawAnalogClockFrame + : graphics::ClockRenderer::drawDigitalClockFrame; indicatorIcons.push_back(digital_icon_clock); #endif @@ -909,7 +1006,7 @@ void Screen::setFrames(FrameFocus focus) ui->disableAllIndicators(); // Add overlays: frame icons and alert banner) - static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawAlertBannerOverlay}; + static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawBannercallback}; ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); prevFrame = -1; // Force drawNodeInfo to pick a new node (because our list @@ -937,6 +1034,9 @@ void Screen::setFrames(FrameFocus focus) // If no module requested focus, will show the first frame instead ui->switchToFrame(fsi.positions.clock); break; + case FOCUS_SYSTEM: + ui->switchToFrame(fsi.positions.memory); + break; case FOCUS_PRESERVE: // No more adjustment — force stay on same index @@ -1180,7 +1280,7 @@ int Screen::handleTextMessage(const meshtastic_MeshPacket *packet) } } - screen->showOverlayBanner(banner, 3000); + screen->showSimpleBanner(banner, 3000); } } @@ -1220,30 +1320,14 @@ int Screen::handleInputEvent(const InputEvent *event) #endif if (NotificationRenderer::isOverlayBannerShowing()) { NotificationRenderer::inEvent = event->inputEvent; - static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, - NotificationRenderer::drawAlertBannerOverlay}; + static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawBannercallback}; ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); setFastFramerate(); // Draw ASAP ui->update(); - menuHandler::handleMenuSwitch(); + menuHandler::handleMenuSwitch(dispdev); return 0; } - /* - #if defined(DISPLAY_CLOCK_FRAME) - // For the T-Watch, intercept touches to the 'toggle digital/analog watch face' button - uint8_t watchFaceFrame = error_code ? 1 : 0; - - if (this->ui->getUiState()->currentFrame == watchFaceFrame && event->touchX >= 204 && event->touchX <= 240 && - event->touchY >= 204 && event->touchY <= 240) { - screen->digitalWatchFace = !screen->digitalWatchFace; - - setFrames(); - - return 0; - } - #endif - */ // Use left or right input from a keyboard to move between frames, // so long as a mesh module isn't using these events for some other purpose @@ -1265,13 +1349,8 @@ int Screen::handleInputEvent(const InputEvent *event) } else if (event->inputEvent == INPUT_BROKER_SELECT) { if (this->ui->getUiState()->currentFrame == framesetInfo.positions.home) { menuHandler::homeBaseMenu(); -#if HAS_TFT } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.memory) { - menuHandler::switchToMUIMenu(); -#else - } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.memory) { - menuHandler::BuzzerModeMenu(); -#endif + menuHandler::systemBaseMenu(); #if HAS_GPS } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.gps && gps) { menuHandler::positionBaseMenu(); diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index ac7d9aa69..a486f99f8 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -5,10 +5,26 @@ #include "detect/ScanI2C.h" #include "mesh/generated/meshtastic/config.pb.h" #include +#include #include #include #define getStringCenteredX(s) ((SCREEN_WIDTH - display->getStringWidth(s)) / 2) +namespace graphics +{ +enum notificationTypeEnum { none, text_banner, selection_picker, node_picker, number_picker }; + +struct BannerOverlayOptions { + const char *message; + uint32_t durationMs = 30000; + const char **optionsArrayPtr = nullptr; + const int *optionsEnumPtr = nullptr; + uint8_t optionsCount = 0; + std::function bannerCallback = nullptr; + int8_t InitialSelected = 0; + notificationTypeEnum notificationType = notificationTypeEnum::text_banner; +}; +} // namespace graphics #if !HAS_SCREEN #include "power.h" @@ -25,6 +41,7 @@ class Screen FOCUS_TEXTMESSAGE, FOCUS_MODULE, // Note: target module should call requestFocus(), otherwise no info about which module to focus FOCUS_CLOCK, + FOCUS_SYSTEM, }; explicit Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY); @@ -39,10 +56,8 @@ class Screen void setFunctionSymbol(std::string) {} void removeFunctionSymbol(std::string) {} void startAlert(const char *) {} - void showOverlayBanner(const char *message, uint32_t durationMs = 3000, const char **optionsArrayPtr = nullptr, - uint8_t options = 0, std::function bannerCallback = NULL, int8_t InitialSelected = 0) - { - } + void showSimpleBanner(const char *message, uint32_t durationMs = 0) {} + void showOverlayBanner(BannerOverlayOptions) {} void setFrames(FrameFocus focus) {} void endAlert() {} }; @@ -199,6 +214,7 @@ class Screen : public concurrency::OSThread CallbackObserver(this, &Screen::handleAdminMessage); public: + OLEDDisplay *getDisplayDevice() { return dispdev; } explicit Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY); size_t frameCount = 0; // Total number of active frames ~Screen(); @@ -211,6 +227,7 @@ class Screen : public concurrency::OSThread FOCUS_TEXTMESSAGE, FOCUS_MODULE, // Note: target module should call requestFocus(), otherwise no info about which module to focus FOCUS_CLOCK, + FOCUS_SYSTEM, }; // Regenerate the normal set of frames, focusing a specific frame if requested @@ -225,8 +242,6 @@ class Screen : public concurrency::OSThread meshtastic_Config_DisplayConfig_OledType model; OLEDDISPLAY_GEOMETRY geometry; - bool ignoreCompass = false; - bool isOverlayBannerShowing(); // Stores the last 4 of our hardware ID, to make finding the device for pairing easier @@ -290,8 +305,11 @@ class Screen : public concurrency::OSThread enqueueCmd(cmd); } - void showOverlayBanner(const char *message, uint32_t durationMs = 3000, const char **optionsArrayPtr = nullptr, - uint8_t options = 0, std::function bannerCallback = NULL, int8_t InitialSelected = 0); + void showSimpleBanner(const char *message, uint32_t durationMs = 0); + void showOverlayBanner(BannerOverlayOptions); + + void showNodePicker(const char *message, uint32_t durationMs, std::function bannerCallback); + void showNumberPicker(const char *message, uint32_t durationMs, uint8_t digits, std::function bannerCallback); void startFirmwareUpdateScreen() { @@ -325,6 +343,12 @@ class Screen : public concurrency::OSThread /// Stops showing the boot screen. void stopBootScreen() { enqueueCmd(ScreenCmd{.cmd = Cmd::STOP_BOOT_SCREEN}); } + void runNow() + { + setFastFramerate(); + enqueueCmd(ScreenCmd{.cmd = Cmd::NOOP}); + } + /// Overrides the default utf8 character conversion, to replace empty space with question marks static char customFontTableLookup(const uint8_t ch) { diff --git a/src/graphics/SharedUIDisplay.cpp b/src/graphics/SharedUIDisplay.cpp index 07f2e5cde..9f2422748 100644 --- a/src/graphics/SharedUIDisplay.cpp +++ b/src/graphics/SharedUIDisplay.cpp @@ -343,4 +343,30 @@ const int *getTextPositions(OLEDDisplay *display) return textPositions; } +bool isAllowedPunctuation(char c) +{ + const std::string allowed = ".,!?;:-_()[]{}'\"@#$/\\&+=%~^ "; + return allowed.find(c) != std::string::npos; +} + +std::string sanitizeString(const std::string &input) +{ + std::string output; + bool inReplacement = false; + + for (char c : input) { + if (std::isalnum(static_cast(c)) || isAllowedPunctuation(c)) { + output += c; + inReplacement = false; + } else { + if (!inReplacement) { + output += 0xbf; // ISO-8859-1 for inverted question mark + inReplacement = true; + } + } + } + + return output; +} + } // namespace graphics diff --git a/src/graphics/SharedUIDisplay.h b/src/graphics/SharedUIDisplay.h index 2e97052a8..b8d82795e 100644 --- a/src/graphics/SharedUIDisplay.h +++ b/src/graphics/SharedUIDisplay.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace graphics { @@ -52,4 +53,8 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti const int *getTextPositions(OLEDDisplay *display); +bool isAllowedPunctuation(char c); + +std::string sanitizeString(const std::string &input); + } // namespace graphics diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index 92b2c3d02..3e9bafc6c 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -1,5 +1,6 @@ #include "configuration.h" #include "main.h" + #if ARCH_PORTDUINO #include "platform/portduino/PortduinoGlue.h" #endif @@ -14,8 +15,10 @@ extern SX1509 gpioExtender; #endif -#ifndef TFT_MESH -#define TFT_MESH COLOR565(0x67, 0xEA, 0x94) +#ifdef TFT_MESH_OVERRIDE +uint16_t TFT_MESH = TFT_MESH_OVERRIDE; +#else +uint16_t TFT_MESH = COLOR565(0x67, 0xEA, 0x94); #endif #if defined(ST7735S) diff --git a/src/graphics/draw/ClockRenderer.cpp b/src/graphics/draw/ClockRenderer.cpp index aa177078b..7ccb1c03c 100644 --- a/src/graphics/draw/ClockRenderer.cpp +++ b/src/graphics/draw/ClockRenderer.cpp @@ -21,7 +21,6 @@ namespace graphics namespace ClockRenderer { -bool digitalWatchFace = true; void drawSegmentedDisplayColon(OLEDDisplay *display, int x, int y, float scale) { diff --git a/src/graphics/draw/ClockRenderer.h b/src/graphics/draw/ClockRenderer.h index 9c3238b14..c8ba62868 100644 --- a/src/graphics/draw/ClockRenderer.h +++ b/src/graphics/draw/ClockRenderer.h @@ -11,8 +11,6 @@ class Screen; namespace ClockRenderer { -// Whether we are showing the digital watch face or the analog one -extern bool digitalWatchFace; // Clock frame functions void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); diff --git a/src/graphics/draw/CompassRenderer.cpp b/src/graphics/draw/CompassRenderer.cpp index 6d8051546..0e5a1d727 100644 --- a/src/graphics/draw/CompassRenderer.cpp +++ b/src/graphics/draw/CompassRenderer.cpp @@ -50,7 +50,7 @@ void drawCompassNorth(OLEDDisplay *display, int16_t compassX, int16_t compassY, radius += 4; } Point north(0, -radius); - if (!config.display.compass_north_top) + if (uiconfig.compass_mode != meshtastic_CompassMode_FIXED_RING) north.rotate(-myHeading); north.translate(compassX, compassY); diff --git a/src/graphics/draw/DebugRenderer.cpp b/src/graphics/draw/DebugRenderer.cpp index 92cf49610..b1a901f99 100644 --- a/src/graphics/draw/DebugRenderer.cpp +++ b/src/graphics/draw/DebugRenderer.cpp @@ -501,7 +501,10 @@ void drawMemoryUsage(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int line = 1; const int barHeight = 6; const int labelX = x; - const int barsOffset = (isHighResolution) ? 24 : 0; + int barsOffset = (isHighResolution) ? 24 : 0; +#ifdef USE_EINK + barsOffset -= 12; +#endif const int barX = x + 40 + barsOffset; auto drawUsageRow = [&](const char *label, uint32_t used, uint32_t total, bool isHeap = false) { diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 9736cf9d1..3681532bb 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -8,14 +8,19 @@ #include "NodeDB.h" #include "buzz.h" #include "graphics/Screen.h" +#include "graphics/SharedUIDisplay.h" #include "graphics/draw/UIRenderer.h" #include "main.h" #include "modules/AdminModule.h" #include "modules/CannedMessageModule.h" +extern uint16_t TFT_MESH; + namespace graphics { menuHandler::screenMenus menuHandler::menuQueue = menu_none; +bool test_enabled = false; +uint8_t test_count = 0; void menuHandler::LoraRegionPicker(uint32_t duration) { @@ -44,72 +49,92 @@ void menuHandler::LoraRegionPicker(uint32_t duration) "PH_868", "PH_915", "ANZ_433"}; - screen->showOverlayBanner( - "Set the LoRa region", duration, optionsArray, 23, - [](int selected) -> void { - if (selected != 0 && config.lora.region != _meshtastic_Config_LoRaConfig_RegionCode(selected)) { - config.lora.region = _meshtastic_Config_LoRaConfig_RegionCode(selected); - // This is needed as we wait til picking the LoRa region to generate keys for the first time. - if (!owner.is_licensed) { - bool keygenSuccess = false; - if (config.security.private_key.size == 32) { - // public key is derived from private, so this will always have the same result. - if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) { - keygenSuccess = true; - } - } else { - LOG_INFO("Generate new PKI keys"); - crypto->generateKeyPair(config.security.public_key.bytes, config.security.private_key.bytes); + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Set the LoRa region"; + bannerOptions.durationMs = duration; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 23; + bannerOptions.InitialSelected = 0; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected != 0 && config.lora.region != _meshtastic_Config_LoRaConfig_RegionCode(selected)) { + config.lora.region = _meshtastic_Config_LoRaConfig_RegionCode(selected); + // This is needed as we wait til picking the LoRa region to generate keys for the first time. + if (!owner.is_licensed) { + bool keygenSuccess = false; + if (config.security.private_key.size == 32) { + // public key is derived from private, so this will always have the same result. + if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) { keygenSuccess = true; } - if (keygenSuccess) { - config.security.public_key.size = 32; - config.security.private_key.size = 32; - owner.public_key.size = 32; - memcpy(owner.public_key.bytes, config.security.public_key.bytes, 32); - } + } else { + LOG_INFO("Generate new PKI keys"); + crypto->generateKeyPair(config.security.public_key.bytes, config.security.private_key.bytes); + keygenSuccess = true; } - config.lora.tx_enabled = true; - initRegion(); - if (myRegion->dutyCycle < 100) { - config.lora.ignore_mqtt = true; // Ignore MQTT by default if region has a duty cycle limit + if (keygenSuccess) { + config.security.public_key.size = 32; + config.security.private_key.size = 32; + owner.public_key.size = 32; + memcpy(owner.public_key.bytes, config.security.public_key.bytes, 32); } - service->reloadConfig(SEGMENT_CONFIG); - rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); } - }, - 0); + config.lora.tx_enabled = true; + initRegion(); + if (myRegion->dutyCycle < 100) { + config.lora.ignore_mqtt = true; // Ignore MQTT by default if region has a duty cycle limit + } + service->reloadConfig(SEGMENT_CONFIG); + rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); + } + }; + screen->showOverlayBanner(bannerOptions); } void menuHandler::TwelveHourPicker() { static const char *optionsArray[] = {"Back", "12-hour", "24-hour"}; - screen->showOverlayBanner("Time Format", 30000, optionsArray, 3, [](int selected) -> void { - if (selected == 0) { + enum optionsNumbers { Back = 0, twelve = 1, twentyfour = 2 }; + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Time Format"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 3; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == Back) { menuHandler::menuQueue = menuHandler::clock_menu; - } else if (selected == 1) { + screen->runNow(); + } else if (selected == twelve) { config.display.use_12h_clock = true; } else { config.display.use_12h_clock = false; } service->reloadConfig(SEGMENT_CONFIG); - }); + }; + screen->showOverlayBanner(bannerOptions); } void menuHandler::ClockFacePicker() { static const char *optionsArray[] = {"Back", "Digital", "Analog"}; - screen->showOverlayBanner("Which Face?", 30000, optionsArray, 3, [](int selected) -> void { - if (selected == 0) { + enum optionsNumbers { Back = 0, Digital = 1, Analog = 2 }; + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Which Face?"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 3; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == Back) { menuHandler::menuQueue = menuHandler::clock_menu; - } else if (selected == 1) { - graphics::ClockRenderer::digitalWatchFace = true; + screen->runNow(); + } else if (selected == Digital) { + uiconfig.is_clockface_analog = false; + nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, &uiconfig); screen->setFrames(Screen::FOCUS_CLOCK); } else { - graphics::ClockRenderer::digitalWatchFace = false; + uiconfig.is_clockface_analog = true; + nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, &uiconfig); screen->setFrames(Screen::FOCUS_CLOCK); } - }); + }; + screen->showOverlayBanner(bannerOptions); } void menuHandler::TZPicker() @@ -133,9 +158,14 @@ void menuHandler::TZPicker() "AU/ACST", "AU/AEST", "Pacific/NZ"}; - screen->showOverlayBanner("Pick Timezone", 30000, optionsArray, 17, [](int selected) -> void { + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Pick Timezone"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 17; + bannerOptions.bannerCallback = [](int selected) -> void { if (selected == 0) { menuHandler::menuQueue = menuHandler::clock_menu; + screen->runNow(); } else if (selected == 1) { // Hawaii strncpy(config.device.tzdef, "HST10", sizeof(config.device.tzdef)); } else if (selected == 2) { // Alaska @@ -175,27 +205,31 @@ void menuHandler::TZPicker() setenv("TZ", config.device.tzdef, 1); service->reloadConfig(SEGMENT_CONFIG); } - }); + }; + screen->showOverlayBanner(bannerOptions); } void menuHandler::clockMenu() { static const char *optionsArray[] = {"Back", "Clock Face", "Time Format", "Timezone"}; - screen->showOverlayBanner("Clock Action", 30000, optionsArray, 4, [](int selected) -> void { - if (selected == 1) { + enum optionsNumbers { Back = 0, Clock = 1, Time = 2, Timezone = 3 }; + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Clock Action"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 4; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == Clock) { menuHandler::menuQueue = menuHandler::clock_face_picker; - screen->setInterval(0); - runASAP = true; - } else if (selected == 2) { + screen->runNow(); + } else if (selected == Time) { menuHandler::menuQueue = menuHandler::twelve_hour_picker; - screen->setInterval(0); - runASAP = true; - } else if (selected == 3) { + screen->runNow(); + } else if (selected == Timezone) { menuHandler::menuQueue = menuHandler::TZ_picker; - screen->setInterval(0); - runASAP = true; + screen->runNow(); } - }); + }; + screen->showOverlayBanner(bannerOptions); } void menuHandler::messageResponseMenu() @@ -203,6 +237,7 @@ void menuHandler::messageResponseMenu() static const char **optionsArrayPtr; int options; + enum optionsNumbers { Back = 0, Dismiss = 1, Preset = 2, Freetext = 3 }; if (kb_found) { static const char *optionsArray[] = {"Back", "Dismiss", "Reply via Preset", "Reply via Freetext"}; optionsArrayPtr = optionsArray; @@ -217,16 +252,20 @@ void menuHandler::messageResponseMenu() optionsArrayPtr = optionsArray; options = 5; #endif - screen->showOverlayBanner("Message Action", 30000, optionsArrayPtr, options, [](int selected) -> void { - if (selected == 1) { + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Message Action"; + bannerOptions.optionsArrayPtr = optionsArrayPtr; + bannerOptions.optionsCount = options; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == Dismiss) { screen->dismissCurrentFrame(); - } else if (selected == 2) { + } else if (selected == Preset) { if (devicestate.rx_text_message.to == NODENUM_BROADCAST) { cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST, devicestate.rx_text_message.channel); } else { cannedMessageModule->LaunchWithDestination(devicestate.rx_text_message.from); } - } else if (selected == 3) { + } else if (selected == Freetext) { if (devicestate.rx_text_message.to == NODENUM_BROADCAST) { cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST, devicestate.rx_text_message.channel); } else { @@ -241,51 +280,138 @@ void menuHandler::messageResponseMenu() audioThread->readAloud(msg); } #endif - }); + }; + screen->showOverlayBanner(bannerOptions); } void menuHandler::homeBaseMenu() { - int options; - static const char **optionsArrayPtr; + enum optionsNumbers { Back, Backlight, Position, Preset, Freetext, Bluetooth, Sleep }; + static const char *optionsArray[6] = {"Back"}; + static int optionsEnumArray[6] = {Back}; + int options = 1; + +#ifdef PIN_EINK_EN + optionsArray[options] = "Toggle Backlight"; + optionsEnumArray[options++] = Backlight; +#else + optionsArray[options] = "Sleep Screen"; + optionsEnumArray[options++] = Sleep; +#endif + + optionsArray[options] = "Send Position"; + optionsEnumArray[options++] = Position; + optionsArray[options] = "New Preset Msg"; + optionsEnumArray[options++] = Preset; if (kb_found) { -#ifdef PIN_EINK_EN - static const char *optionsArray[] = {"Back", "Toggle Backlight", "Send Position", "New Preset Msg", "New Freetext Msg"}; -#else - static const char *optionsArray[] = {"Back", "Sleep Screen", "Send Position", "New Preset Msg", "New Freetext Msg"}; -#endif - optionsArrayPtr = optionsArray; - options = 5; - } else { -#ifdef PIN_EINK_EN - static const char *optionsArray[] = {"Back", "Toggle Backlight", "Send Position", "New Preset Msg"}; -#else - static const char *optionsArray[] = {"Back", "Sleep Screen", "Send Position", "New Preset Msg"}; -#endif - optionsArrayPtr = optionsArray; - options = 4; + optionsArray[options] = "New Freetext Msg"; + optionsEnumArray[options++] = Freetext; } - screen->showOverlayBanner("Home Action", 30000, optionsArrayPtr, options, [](int selected) -> void { - if (selected == 1) { + optionsArray[options] = "Bluetooth Toggle"; + optionsEnumArray[options++] = Bluetooth; + + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Home Action"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsEnumPtr = optionsEnumArray; + bannerOptions.optionsCount = options; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == Backlight) { #ifdef PIN_EINK_EN if (digitalRead(PIN_EINK_EN) == HIGH) { digitalWrite(PIN_EINK_EN, LOW); } else { digitalWrite(PIN_EINK_EN, HIGH); } -#else - screen->setOn(false); #endif - } else if (selected == 2) { - InputEvent event = {.inputEvent = (input_broker_event)175, .kbchar = 175, .touchX = 0, .touchY = 0}; + } else if (selected == Sleep) { + screen->setOn(false); + } else if (selected == Position) { + InputEvent event = {.inputEvent = (input_broker_event)INPUT_BROKER_SEND_PING, .kbchar = 0, .touchX = 0, .touchY = 0}; inputBroker->injectInputEvent(&event); - } else if (selected == 3) { + } else if (selected == Preset) { cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST); - } else if (selected == 4) { + } else if (selected == Freetext) { cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST); + } else if (selected == Bluetooth) { + InputEvent event = {.inputEvent = (input_broker_event)170, .kbchar = 170, .touchX = 0, .touchY = 0}; + inputBroker->injectInputEvent(&event); } - }); + }; + screen->showOverlayBanner(bannerOptions); +} + +void menuHandler::systemBaseMenu() +{ + + // Check if brightness is supported + bool hasSupportBrightness = false; +#if defined(ST7789_CS) || defined(USE_OLED) || defined(USE_SSD1306) || defined(USE_SH1106) || defined(USE_SH1107) || HAS_TFT + hasSupportBrightness = true; +#endif + + enum optionsNumbers { Back, Beeps, Brightness, Reboot, Color, MUI, Test }; + static const char *optionsArray[6] = {"Back"}; + static int optionsEnumArray[6] = {Back}; + int options = 1; + + optionsArray[options] = "Beeps Action"; + optionsEnumArray[options++] = Beeps; + + if (hasSupportBrightness) { + optionsArray[options] = "Brightness"; + optionsEnumArray[options++] = Brightness; + } + + optionsArray[options] = "Reboot"; + optionsEnumArray[options++] = Reboot; + +#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || HAS_TFT + optionsArray[options] = "Screen Color"; + optionsEnumArray[options++] = Color; +#endif +#if HAS_TFT + optionsArray[options] = "Switch to MUI"; + optionsEnumArray[options++] = MUI; +#endif + if (test_enabled) { + optionsArray[options] = "Test Menu"; + optionsEnumArray[options++] = Test; + } + + BannerOverlayOptions bannerOptions; + bannerOptions.message = "System Action"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = options; + bannerOptions.optionsEnumPtr = optionsEnumArray; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == Beeps) { + menuHandler::menuQueue = menuHandler::buzzermodemenupicker; + screen->runNow(); + } else if (selected == Brightness) { + menuHandler::menuQueue = menuHandler::brightness_picker; + screen->runNow(); + } else if (selected == Reboot) { + menuHandler::menuQueue = menuHandler::reboot_menu; + screen->runNow(); + } else if (selected == MUI) { + menuHandler::menuQueue = menuHandler::mui_picker; + screen->runNow(); + } else if (selected == Color) { + menuHandler::menuQueue = menuHandler::tftcolormenupicker; + screen->runNow(); + } else if (selected == Test) { + menuHandler::menuQueue = menuHandler::test_menu; + screen->runNow(); + } else if (selected == Back && !test_enabled) { + test_count++; + if (test_count > 4) { + test_enabled = true; + } + } + }; + screen->showOverlayBanner(bannerOptions); } void menuHandler::favoriteBaseMenu() @@ -294,21 +420,29 @@ void menuHandler::favoriteBaseMenu() static const char **optionsArrayPtr; if (kb_found) { - static const char *optionsArray[] = {"Back", "New Preset Msg", "New Freetext Msg"}; + static const char *optionsArray[] = {"Back", "New Preset Msg", "New Freetext Msg", "Remove Favorite"}; + optionsArrayPtr = optionsArray; + options = 4; + } else { + static const char *optionsArray[] = {"Back", "New Preset Msg", "Remove Favorite"}; optionsArrayPtr = optionsArray; options = 3; - } else { - static const char *optionsArray[] = {"Back", "New Preset Msg"}; - optionsArrayPtr = optionsArray; - options = 2; } - screen->showOverlayBanner("Favorites Action", 30000, optionsArrayPtr, options, [](int selected) -> void { + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Favorites Action"; + bannerOptions.optionsArrayPtr = optionsArrayPtr; + bannerOptions.optionsCount = options; + bannerOptions.bannerCallback = [](int selected) -> void { if (selected == 1) { cannedMessageModule->LaunchWithDestination(graphics::UIRenderer::currentFavoriteNodeNum); - } else if (selected == 2) { + } else if (selected == 2 && kb_found) { cannedMessageModule->LaunchFreetextWithDestination(graphics::UIRenderer::currentFavoriteNodeNum); + } else if ((!kb_found && selected == 2) || (selected == 3 && kb_found)) { + menuHandler::menuQueue = menuHandler::remove_favorite; + screen->runNow(); } - }); + }; + screen->showOverlayBanner(bannerOptions); } void menuHandler::positionBaseMenu() @@ -325,127 +459,385 @@ void menuHandler::positionBaseMenu() optionsArrayPtr = optionsArray; options = 3; } - screen->showOverlayBanner("Position Action", 30000, optionsArrayPtr, options, [](int selected) -> void { + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Position Action"; + bannerOptions.optionsArrayPtr = optionsArrayPtr; + bannerOptions.optionsCount = options; + bannerOptions.bannerCallback = [](int selected) -> void { if (selected == 1) { #if MESHTASTIC_EXCLUDE_GPS menuQueue = menu_none; #else menuQueue = gps_toggle_menu; + screen->runNow(); #endif } else if (selected == 2) { menuQueue = compass_point_north_menu; + screen->runNow(); } else if (selected == 3) { accelerometerThread->calibrate(30); } - }); + }; + screen->showOverlayBanner(bannerOptions); } void menuHandler::nodeListMenu() { - static const char *optionsArray[] = {"Back", "Reset NodeDB"}; - screen->showOverlayBanner("Node Action", 30000, optionsArray, 2, [](int selected) -> void { + static const char *optionsArray[] = {"Back", "Add Favorite", "Reset NodeDB"}; + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Node Action"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 3; + bannerOptions.bannerCallback = [](int selected) -> void { if (selected == 1) { + menuQueue = add_favorite; + screen->runNow(); + } else if (selected == 2) { menuQueue = reset_node_db_menu; + screen->runNow(); } - }); + }; + screen->showOverlayBanner(bannerOptions); } void menuHandler::resetNodeDBMenu() { static const char *optionsArray[] = {"Back", "Confirm"}; - screen->showOverlayBanner("Confirm Reset NodeDB", 30000, optionsArray, 2, [](int selected) -> void { + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Confirm Reset NodeDB"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 2; + bannerOptions.bannerCallback = [](int selected) -> void { if (selected == 1) { disableBluetooth(); LOG_INFO("Initiate node-db reset"); nodeDB->resetNodes(); rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); } - }); + }; + screen->showOverlayBanner(bannerOptions); } void menuHandler::compassNorthMenu() { static const char *optionsArray[] = {"Back", "Dynamic", "Fixed Ring", "Freeze Heading"}; - screen->showOverlayBanner("North Directions?", 30000, optionsArray, 4, [](int selected) -> void { + BannerOverlayOptions bannerOptions; + bannerOptions.message = "North Directions?"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 4; + bannerOptions.InitialSelected = uiconfig.compass_mode + 1; + bannerOptions.bannerCallback = [](int selected) -> void { if (selected == 1) { - if (config.display.compass_north_top != false) { - config.display.compass_north_top = false; - service->reloadConfig(SEGMENT_CONFIG); + if (uiconfig.compass_mode != meshtastic_CompassMode_DYNAMIC) { + uiconfig.compass_mode = meshtastic_CompassMode_DYNAMIC; + nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, + &uiconfig); + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); } - screen->ignoreCompass = false; - screen->setFrames(graphics::Screen::FOCUS_PRESERVE); } else if (selected == 2) { - if (config.display.compass_north_top != true) { - config.display.compass_north_top = true; - service->reloadConfig(SEGMENT_CONFIG); + if (uiconfig.compass_mode != meshtastic_CompassMode_FIXED_RING) { + uiconfig.compass_mode = meshtastic_CompassMode_FIXED_RING; + nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, + &uiconfig); + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); } - screen->ignoreCompass = false; - screen->setFrames(graphics::Screen::FOCUS_PRESERVE); } else if (selected == 3) { - if (config.display.compass_north_top != true) { - config.display.compass_north_top = true; - service->reloadConfig(SEGMENT_CONFIG); + if (uiconfig.compass_mode != meshtastic_CompassMode_FREEZE_HEADING) { + uiconfig.compass_mode = meshtastic_CompassMode_FREEZE_HEADING; + nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, + &uiconfig); + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); } - screen->ignoreCompass = true; - screen->setFrames(graphics::Screen::FOCUS_PRESERVE); } else if (selected == 0) { menuQueue = position_base_menu; + screen->runNow(); } - }); + }; + screen->showOverlayBanner(bannerOptions); } #if !MESHTASTIC_EXCLUDE_GPS void menuHandler::GPSToggleMenu() { static const char *optionsArray[] = {"Back", "Enabled", "Disabled"}; - screen->showOverlayBanner( - "Toggle GPS", 30000, optionsArray, 3, - [](int selected) -> void { - if (selected == 1) { - config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_ENABLED; - playGPSEnableBeep(); - gps->enable(); - service->reloadConfig(SEGMENT_CONFIG); - } else if (selected == 2) { - config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_DISABLED; - playGPSDisableBeep(); - gps->disable(); - service->reloadConfig(SEGMENT_CONFIG); - } else { - menuQueue = position_base_menu; - } - }, - config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED ? 1 : 2); // set inital selection + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Toggle GPS"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 3; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == 1) { + config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_ENABLED; + playGPSEnableBeep(); + gps->enable(); + service->reloadConfig(SEGMENT_CONFIG); + } else if (selected == 2) { + config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_DISABLED; + playGPSDisableBeep(); + gps->disable(); + service->reloadConfig(SEGMENT_CONFIG); + } else { + menuQueue = position_base_menu; + screen->runNow(); + } + }; + bannerOptions.InitialSelected = config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED ? 1 : 2; + screen->showOverlayBanner(bannerOptions); } #endif void menuHandler::BuzzerModeMenu() { static const char *optionsArray[] = {"All Enabled", "Disabled", "Notifications", "System Only"}; - screen->showOverlayBanner( - "Beep Action", 30000, optionsArray, 4, - [](int selected) -> void { - config.device.buzzer_mode = (meshtastic_Config_DeviceConfig_BuzzerMode)selected; - service->reloadConfig(SEGMENT_CONFIG); - }, - config.device.buzzer_mode); + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Beep Action"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 4; + bannerOptions.bannerCallback = [](int selected) -> void { + config.device.buzzer_mode = (meshtastic_Config_DeviceConfig_BuzzerMode)selected; + service->reloadConfig(SEGMENT_CONFIG); + }; + bannerOptions.InitialSelected = config.device.buzzer_mode; + screen->showOverlayBanner(bannerOptions); +} + +void menuHandler::BrightnessPickerMenu() +{ + static const char *optionsArray[] = {"Back", "Low", "Medium", "High", "Very High"}; + + // Get current brightness level to set initial selection + int currentSelection = 1; // Default to Low + if (uiconfig.screen_brightness >= 255) { + currentSelection = 4; // Very High + } else if (uiconfig.screen_brightness >= 128) { + currentSelection = 3; // High + } else if (uiconfig.screen_brightness >= 64) { + currentSelection = 2; // Medium + } else { + currentSelection = 1; // Low + } + + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Brightness"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 5; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == 1) { // Low + uiconfig.screen_brightness = 1; + } else if (selected == 2) { // Medium + uiconfig.screen_brightness = 64; + } else if (selected == 3) { // High + uiconfig.screen_brightness = 128; + } else if (selected == 4) { // Very High + uiconfig.screen_brightness = 255; + } + + if (selected != 0) { // Not "Back" + // Apply brightness immediately +#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || defined(HELTEC_VISION_MASTER_E213) || \ + defined(HELTEC_VISION_MASTER_E290) + // For HELTEC devices, use analogWrite to control backlight + analogWrite(VTFT_LEDA, uiconfig.screen_brightness); +#elif defined(ST7789_CS) + static_cast(screen->getDisplayDevice())->setDisplayBrightness(uiconfig.screen_brightness); +#elif defined(USE_OLED) || defined(USE_SSD1306) || defined(USE_SH1106) || defined(USE_SH1107) + screen->getDisplayDevice()->setBrightness(uiconfig.screen_brightness); +#endif + + // Save to device + nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, &uiconfig); + + LOG_INFO("Screen brightness set to %d", uiconfig.screen_brightness); + } + }; + bannerOptions.InitialSelected = currentSelection; + screen->showOverlayBanner(bannerOptions); } void menuHandler::switchToMUIMenu() { static const char *optionsArray[] = {"Yes", "No"}; - screen->showOverlayBanner("Switch to MUI?", 30000, optionsArray, 2, [](int selected) -> void { + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Switch to MUI?"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 2; + bannerOptions.bannerCallback = [](int selected) -> void { if (selected == 0) { config.display.displaymode = meshtastic_Config_DisplayConfig_DisplayMode_COLOR; config.bluetooth.enabled = false; service->reloadConfig(SEGMENT_CONFIG); rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); } + }; + screen->showOverlayBanner(bannerOptions); +} + +void menuHandler::TFTColorPickerMenu(OLEDDisplay *display) +{ + static const char *optionsArray[] = {"Back", "Default", "Meshtastic Green", "Yellow", "Red", "Orange", "Purple", "Teal", + "Pink", "White"}; + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Select Screen Color"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 10; + bannerOptions.bannerCallback = [display](int selected) -> void { + uint8_t r = 0; + uint8_t g = 0; + uint8_t b = 0; + if (selected == 1) { + LOG_INFO("Setting color to system default or defined variant"); + // Given just before we set all these to zero, we will allow this to go through + } else if (selected == 2) { + LOG_INFO("Setting color to Meshtastic Green"); + r = 103; + g = 234; + b = 148; + } else if (selected == 3) { + LOG_INFO("Setting color to Yellow"); + r = 255; + g = 255; + b = 128; + } else if (selected == 4) { + LOG_INFO("Setting color to Red"); + r = 255; + g = 64; + b = 64; + } else if (selected == 5) { + LOG_INFO("Setting color to Orange"); + r = 255; + g = 160; + b = 20; + } else if (selected == 6) { + LOG_INFO("Setting color to Purple"); + r = 204; + g = 153; + b = 255; + } else if (selected == 7) { + LOG_INFO("Setting color to Teal"); + r = 64; + g = 224; + b = 208; + } else if (selected == 8) { + LOG_INFO("Setting color to Pink"); + r = 255; + g = 105; + b = 180; + } else if (selected == 9) { + LOG_INFO("Setting color to White"); + r = 255; + g = 255; + b = 255; + } + +#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || HAS_TFT + if (selected != 0) { + display->setColor(BLACK); + display->fillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + display->setColor(WHITE); + + if (r == 0 && g == 0 && b == 0) { +#ifdef TFT_MESH_OVERRIDE + TFT_MESH = TFT_MESH_OVERRIDE; +#else + TFT_MESH = COLOR565(0x67, 0xEA, 0x94); +#endif + } else { + TFT_MESH = COLOR565(r, g, b); + } + +#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) + static_cast(screen->getDisplayDevice())->setRGB(TFT_MESH); +#endif + + screen->setFrames(graphics::Screen::FOCUS_SYSTEM); + if (r == 0 && g == 0 && b == 0) { + uiconfig.screen_rgb_color = 0; + } else { + uiconfig.screen_rgb_color = (r << 16) | (g << 8) | b; + } + LOG_INFO("Storing Value of %d to uiconfig.screen_rgb_color", uiconfig.screen_rgb_color); + nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, &uiconfig); + } +#endif + }; + screen->showOverlayBanner(bannerOptions); +} + +void menuHandler::rebootMenu() +{ + static const char *optionsArray[] = {"Back", "Confirm"}; + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Reboot Device?"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 2; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == 1) { + IF_SCREEN(screen->showSimpleBanner("Rebooting...", 0)); + nodeDB->saveToDisk(); + rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000; + } + }; + screen->showOverlayBanner(bannerOptions); +} + +void menuHandler::addFavoriteMenu() +{ + screen->showNodePicker("Node To Favorite", 30000, [](int nodenum) -> void { + LOG_WARN("Nodenum: %u", nodenum); + nodeDB->set_favorite(true, nodenum); + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); }); } -void menuHandler::handleMenuSwitch() +void menuHandler::removeFavoriteMenu() { + + static const char *optionsArray[] = {"Back", "Yes"}; + BannerOverlayOptions bannerOptions; + std::string message = "Unfavorite This Node?\n"; + auto node = nodeDB->getMeshNode(graphics::UIRenderer::currentFavoriteNodeNum); + if (node && node->has_user) { + message += sanitizeString(node->user.long_name).substr(0, 15); + } + bannerOptions.message = message.c_str(); + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 2; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == 1) { + nodeDB->set_favorite(false, graphics::UIRenderer::currentFavoriteNodeNum); + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); + } + }; + screen->showOverlayBanner(bannerOptions); +} + +void menuHandler::testMenu() +{ + + static const char *optionsArray[] = {"Back", "Number Picker"}; + BannerOverlayOptions bannerOptions; + std::string message = "Test to Run?\n"; + bannerOptions.message = message.c_str(); + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 2; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == 1) { + menuQueue = number_test; + screen->runNow(); + } + }; + screen->showOverlayBanner(bannerOptions); +} + +void menuHandler::numberTest() +{ + screen->showNumberPicker("Pick a number\n ", 30000, 4, + [](int number_picked) -> void { LOG_WARN("Nodenum: %u", number_picked); }); +} + +void menuHandler::handleMenuSwitch(OLEDDisplay *display) +{ + if (menuQueue != menu_none) + test_count = 0; switch (menuQueue) { case menu_none: break; @@ -478,6 +870,33 @@ void menuHandler::handleMenuSwitch() case reset_node_db_menu: resetNodeDBMenu(); break; + case buzzermodemenupicker: + BuzzerModeMenu(); + break; + case mui_picker: + switchToMUIMenu(); + break; + case tftcolormenupicker: + TFTColorPickerMenu(display); + break; + case brightness_picker: + BrightnessPickerMenu(); + break; + case reboot_menu: + rebootMenu(); + break; + case add_favorite: + addFavoriteMenu(); + break; + case remove_favorite: + removeFavoriteMenu(); + break; + case test_menu: + testMenu(); + break; + case number_test: + numberTest(); + break; } menuQueue = menu_none; } diff --git a/src/graphics/draw/MenuHandler.h b/src/graphics/draw/MenuHandler.h index 5a5ee8bf6..09279b041 100644 --- a/src/graphics/draw/MenuHandler.h +++ b/src/graphics/draw/MenuHandler.h @@ -17,26 +17,43 @@ class menuHandler gps_toggle_menu, #endif compass_point_north_menu, - reset_node_db_menu + reset_node_db_menu, + buzzermodemenupicker, + mui_picker, + tftcolormenupicker, + brightness_picker, + reboot_menu, + add_favorite, + remove_favorite, + test_menu, + number_test }; static screenMenus menuQueue; static void LoraRegionPicker(uint32_t duration = 30000); - static void handleMenuSwitch(); + static void handleMenuSwitch(OLEDDisplay *display); static void clockMenu(); static void TZPicker(); static void TwelveHourPicker(); static void ClockFacePicker(); static void messageResponseMenu(); static void homeBaseMenu(); + static void systemBaseMenu(); static void favoriteBaseMenu(); static void positionBaseMenu(); static void compassNorthMenu(); static void GPSToggleMenu(); static void BuzzerModeMenu(); static void switchToMUIMenu(); + static void TFTColorPickerMenu(OLEDDisplay *display); static void nodeListMenu(); static void resetNodeDBMenu(); + static void BrightnessPickerMenu(); + static void rebootMenu(); + static void addFavoriteMenu(); + static void removeFavoriteMenu(); + static void testMenu(); + static void numberTest(); }; } // namespace graphics \ No newline at end of file diff --git a/src/graphics/draw/NodeListRenderer.cpp b/src/graphics/draw/NodeListRenderer.cpp index 3f47a3a09..d8746fb69 100644 --- a/src/graphics/draw/NodeListRenderer.cpp +++ b/src/graphics/draw/NodeListRenderer.cpp @@ -66,10 +66,10 @@ const char *getSafeNodeName(meshtastic_NodeInfoLite *node) strncpy(nodeName, name, sizeof(nodeName) - 1); nodeName[sizeof(nodeName) - 1] = '\0'; } else { - snprintf(nodeName, sizeof(nodeName), "%04X", (uint16_t)(node->num & 0xFFFF)); + snprintf(nodeName, sizeof(nodeName), "(%04X)", (uint16_t)(node->num & 0xFFFF)); } } else { - strcpy(nodeName, "?"); + snprintf(nodeName, sizeof(nodeName), "(%04X)", (uint16_t)(node->num & 0xFFFF)); } return nodeName; } @@ -522,7 +522,7 @@ void drawNodeListWithCompasses(OLEDDisplay *display, OLEDDisplayUiState *state, double lat = DegD(ourNode->position.latitude_i); double lon = DegD(ourNode->position.longitude_i); - if (!screen->ignoreCompass) { + if (uiconfig.compass_mode != meshtastic_CompassMode_FREEZE_HEADING) { #if HAS_GPS if (screen->hasHeading()) { heading = screen->getHeading(); // degrees diff --git a/src/graphics/draw/NotificationRenderer.cpp b/src/graphics/draw/NotificationRenderer.cpp index 4866b4060..3b682cc55 100644 --- a/src/graphics/draw/NotificationRenderer.cpp +++ b/src/graphics/draw/NotificationRenderer.cpp @@ -32,8 +32,21 @@ char NotificationRenderer::alertBannerMessage[256] = {0}; uint32_t NotificationRenderer::alertBannerUntil = 0; // 0 is a special case meaning forever uint8_t NotificationRenderer::alertBannerOptions = 0; // last x lines are seelctable options const char **NotificationRenderer::optionsArrayPtr = nullptr; +const int *NotificationRenderer::optionsEnumPtr = nullptr; std::function NotificationRenderer::alertBannerCallback = NULL; bool NotificationRenderer::pauseBanner = false; +notificationTypeEnum NotificationRenderer::current_notification_type = notificationTypeEnum::none; +uint32_t NotificationRenderer::numDigits = 0; +uint32_t NotificationRenderer::currentNumber = 0; + +uint32_t pow_of_10(uint32_t n) +{ + uint32_t ret = 1; + for (int i = 0; i < n; i++) { + ret *= 10; + } + return ret; +} // Used on boot when a certificate is being created void NotificationRenderer::drawSSLScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) @@ -55,29 +68,214 @@ void NotificationRenderer::drawSSLScreen(OLEDDisplay *display, OLEDDisplayUiStat } } -void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisplayUiState *state) +void NotificationRenderer::resetBanner() +{ + alertBannerMessage[0] = '\0'; + current_notification_type = notificationTypeEnum::none; + nodeDB->pause_sort(false); +} + +void NotificationRenderer::drawBannercallback(OLEDDisplay *display, OLEDDisplayUiState *state) { if (!isOverlayBannerShowing() || pauseBanner) return; + switch (current_notification_type) { + case notificationTypeEnum::text_banner: + case notificationTypeEnum::selection_picker: + drawAlertBannerOverlay(display, state); + break; + case notificationTypeEnum::node_picker: + drawNodePicker(display, state); + break; + case notificationTypeEnum::number_picker: + drawNumberPicker(display, state); + break; + } +} + +void NotificationRenderer::drawNumberPicker(OLEDDisplay *display, OLEDDisplayUiState *state) +{ + const char *lineStarts[MAX_LINES + 1] = {0}; + uint16_t lineCount = 0; + + // Parse lines + char *alertEnd = alertBannerMessage + strnlen(alertBannerMessage, sizeof(alertBannerMessage)); + lineStarts[lineCount] = alertBannerMessage; + + // Find lines + while ((lineCount < MAX_LINES) && (lineStarts[lineCount] < alertEnd)) { + lineStarts[lineCount + 1] = std::find((char *)lineStarts[lineCount], alertEnd, '\n'); + if (lineStarts[lineCount + 1][0] == '\n') + lineStarts[lineCount + 1] += 1; + lineCount++; + } + // modulo to extract + uint8_t this_digit = (currentNumber % (pow_of_10(numDigits - curSelected))) / (pow_of_10(numDigits - curSelected - 1)); + // Handle input + if (inEvent == INPUT_BROKER_UP || inEvent == INPUT_BROKER_ALT_PRESS) { + if (this_digit == 9) { + currentNumber -= 9 * (pow_of_10(numDigits - curSelected - 1)); + } else { + currentNumber += (pow_of_10(numDigits - curSelected - 1)); + } + } else if (inEvent == INPUT_BROKER_DOWN || inEvent == INPUT_BROKER_USER_PRESS) { + if (this_digit == 0) { + currentNumber += 9 * (pow_of_10(numDigits - curSelected - 1)); + } else { + currentNumber -= (pow_of_10(numDigits - curSelected - 1)); + } + } else if (inEvent == INPUT_BROKER_SELECT || inEvent == INPUT_BROKER_RIGHT) { + curSelected++; + } else if (inEvent == INPUT_BROKER_LEFT) { + curSelected--; + } else if ((inEvent == INPUT_BROKER_CANCEL || inEvent == INPUT_BROKER_ALT_LONG) && alertBannerUntil != 0) { + resetBanner(); + } + if (curSelected == numDigits) { + resetBanner(); + alertBannerCallback(currentNumber); + } + + inEvent = INPUT_BROKER_NONE; + if (alertBannerMessage[0] == '\0') + return; + + uint16_t totalLines = lineCount + 2; + const char *linePointers[totalLines + 1] = {0}; // this is sort of a dynamic allocation + + // copy the linestarts to display to the linePointers holder + for (int i = 0; i < lineCount; i++) { + linePointers[i] = lineStarts[i]; + } + std::string digits = " "; + std::string arrowPointer = " "; + for (int i = 0; i < numDigits; i++) { + // Modulo minus modulo to return just the current number + digits += std::to_string((currentNumber % (pow_of_10(numDigits - i))) / (pow_of_10(numDigits - i - 1))) + " "; + if (curSelected == i) { + arrowPointer += "^ "; + } else { + arrowPointer += "_ "; + } + } + + linePointers[lineCount++] = digits.c_str(); + linePointers[lineCount++] = arrowPointer.c_str(); + + drawNotificationBox(display, state, linePointers, totalLines, 0); +} + +void NotificationRenderer::drawNodePicker(OLEDDisplay *display, OLEDDisplayUiState *state) +{ + static uint32_t selectedNodenum = 0; // === Layout Configuration === - constexpr uint16_t hPadding = 5; constexpr uint16_t vPadding = 2; - constexpr uint8_t lineSpacing = 1; + alertBannerOptions = nodeDB->getNumMeshNodes() - 1; - bool needs_bell = (strstr(alertBannerMessage, "Alert Received") != nullptr); + // let the box drawing function calculate the widths? - // Setup font and alignment - display->setFont(FONT_SMALL); - display->setTextAlignment(TEXT_ALIGN_LEFT); + const char *lineStarts[MAX_LINES + 1] = {0}; + uint16_t lineCount = 0; + + // Parse lines + char *alertEnd = alertBannerMessage + strnlen(alertBannerMessage, sizeof(alertBannerMessage)); + lineStarts[lineCount] = alertBannerMessage; + + while ((lineCount < MAX_LINES) && (lineStarts[lineCount] < alertEnd)) { + lineStarts[lineCount + 1] = std::find((char *)lineStarts[lineCount], alertEnd, '\n'); + if (lineStarts[lineCount + 1][0] == '\n') + lineStarts[lineCount + 1] += 1; + lineCount++; + } + + // Handle input + if (inEvent == INPUT_BROKER_UP || inEvent == INPUT_BROKER_ALT_PRESS) { + curSelected--; + } else if (inEvent == INPUT_BROKER_DOWN || inEvent == INPUT_BROKER_USER_PRESS) { + curSelected++; + } else if (inEvent == INPUT_BROKER_SELECT) { + resetBanner(); + alertBannerCallback(selectedNodenum); + + } else if ((inEvent == INPUT_BROKER_CANCEL || inEvent == INPUT_BROKER_ALT_LONG) && alertBannerUntil != 0) { + resetBanner(); + } + + if (curSelected == -1) + curSelected = alertBannerOptions - 1; + if (curSelected == alertBannerOptions) + curSelected = 0; + + inEvent = INPUT_BROKER_NONE; + if (alertBannerMessage[0] == '\0') + return; + + uint16_t totalLines = lineCount + alertBannerOptions; + uint16_t screenHeight = display->height(); + uint8_t effectiveLineHeight = FONT_HEIGHT_SMALL - 3; + uint8_t visibleTotalLines = std::min(totalLines, (screenHeight - vPadding * 2) / effectiveLineHeight); + uint8_t linesShown = lineCount; + const char *linePointers[visibleTotalLines + 1] = {0}; // this is sort of a dynamic allocation + + // copy the linestarts to display to the linePointers holder + for (int i = 0; i < lineCount; i++) { + linePointers[i] = lineStarts[i]; + } + char scratchLineBuffer[visibleTotalLines - lineCount][40]; + + uint8_t firstOptionToShow = 0; + if (curSelected > 1 && alertBannerOptions > visibleTotalLines - lineCount) { + if (curSelected > alertBannerOptions - visibleTotalLines + lineCount) + firstOptionToShow = alertBannerOptions - visibleTotalLines + lineCount; + else + firstOptionToShow = curSelected - 1; + } else { + firstOptionToShow = 0; + } + int scratchLineNum = 0; + for (int i = firstOptionToShow; i < alertBannerOptions && linesShown < visibleTotalLines; i++, linesShown++) { + char temp_name[16] = {0}; + if (nodeDB->getMeshNodeByIndex(i + 1)->has_user) { + std::string sanitized = sanitizeString(nodeDB->getMeshNodeByIndex(i + 1)->user.long_name); + strncpy(temp_name, sanitized.c_str(), sizeof(temp_name) - 1); + + } else { + snprintf(temp_name, sizeof(temp_name), "(%04X)", (uint16_t)(nodeDB->getMeshNodeByIndex(i + 1)->num & 0xFFFF)); + } + // make temp buffer for name + // fi + if (i == curSelected) { + selectedNodenum = nodeDB->getMeshNodeByIndex(i + 1)->num; + if (isHighResolution) { + strncpy(scratchLineBuffer[scratchLineNum], "> ", 3); + strncpy(scratchLineBuffer[scratchLineNum] + 2, temp_name, 36); + strncpy(scratchLineBuffer[scratchLineNum] + strlen(temp_name) + 2, " <", 3); + } else { + strncpy(scratchLineBuffer[scratchLineNum], ">", 2); + strncpy(scratchLineBuffer[scratchLineNum] + 1, temp_name, 37); + strncpy(scratchLineBuffer[scratchLineNum] + strlen(temp_name) + 1, "<", 2); + } + scratchLineBuffer[scratchLineNum][39] = '\0'; + } else { + strncpy(scratchLineBuffer[scratchLineNum], temp_name, 36); + } + linePointers[linesShown] = scratchLineBuffer[scratchLineNum++]; + } + drawNotificationBox(display, state, linePointers, totalLines, firstOptionToShow); +} + +void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisplayUiState *state) +{ + // === Layout Configuration === + constexpr uint16_t vPadding = 2; - constexpr int MAX_LINES = 5; uint16_t optionWidths[alertBannerOptions] = {0}; uint16_t maxWidth = 0; uint16_t arrowsWidth = display->getStringWidth("> <", 4, true); uint16_t lineWidths[MAX_LINES] = {0}; uint16_t lineLengths[MAX_LINES] = {0}; - char *lineStarts[MAX_LINES + 1]; + const char *lineStarts[MAX_LINES + 1] = {0}; uint16_t lineCount = 0; char lineBuffer[40] = {0}; @@ -86,7 +284,7 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp lineStarts[lineCount] = alertBannerMessage; while ((lineCount < MAX_LINES) && (lineStarts[lineCount] < alertEnd)) { - lineStarts[lineCount + 1] = std::find(lineStarts[lineCount], alertEnd, '\n'); + lineStarts[lineCount + 1] = std::find((char *)lineStarts[lineCount], alertEnd, '\n'); lineLengths[lineCount] = lineStarts[lineCount + 1] - lineStarts[lineCount]; if (lineStarts[lineCount + 1][0] == '\n') lineStarts[lineCount + 1] += 1; @@ -112,10 +310,15 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp } else if (inEvent == INPUT_BROKER_DOWN || inEvent == INPUT_BROKER_USER_PRESS) { curSelected++; } else if (inEvent == INPUT_BROKER_SELECT) { - alertBannerCallback(curSelected); - alertBannerMessage[0] = '\0'; + if (optionsEnumPtr != nullptr) { + alertBannerCallback(optionsEnumPtr[curSelected]); + optionsEnumPtr = nullptr; + } else { + alertBannerCallback(curSelected); + } + resetBanner(); } else if ((inEvent == INPUT_BROKER_CANCEL || inEvent == INPUT_BROKER_ALT_LONG) && alertBannerUntil != 0) { - alertBannerMessage[0] = '\0'; + resetBanner(); } if (curSelected == -1) @@ -124,7 +327,7 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp curSelected = 0; } else { if (inEvent == INPUT_BROKER_SELECT || inEvent == INPUT_BROKER_ALT_LONG || inEvent == INPUT_BROKER_CANCEL) { - alertBannerMessage[0] = '\0'; + resetBanner(); } } @@ -132,7 +335,91 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp if (alertBannerMessage[0] == '\0') return; - // === Box Size Calculation === + uint16_t totalLines = lineCount + alertBannerOptions; + + uint16_t screenHeight = display->height(); + uint8_t effectiveLineHeight = FONT_HEIGHT_SMALL - 3; + uint8_t visibleTotalLines = std::min(totalLines, (screenHeight - vPadding * 2) / effectiveLineHeight); + uint8_t linesShown = lineCount; + const char *linePointers[visibleTotalLines + 1] = {0}; // this is sort of a dynamic allocation + + // copy the linestarts to display to the linePointers holder + for (int i = 0; i < lineCount; i++) { + linePointers[i] = lineStarts[i]; + } + + uint8_t firstOptionToShow = 0; + if (alertBannerOptions > 0) { + if (curSelected > 1 && alertBannerOptions > visibleTotalLines - lineCount) { + if (curSelected > alertBannerOptions - visibleTotalLines + lineCount) + firstOptionToShow = alertBannerOptions - visibleTotalLines + lineCount; + else + firstOptionToShow = curSelected - 1; + } else { + firstOptionToShow = 0; + } + } + + for (int i = firstOptionToShow; i < alertBannerOptions && linesShown < visibleTotalLines; i++, linesShown++) { + if (i == curSelected) { + if (isHighResolution) { + strncpy(lineBuffer, "> ", 3); + strncpy(lineBuffer + 2, optionsArrayPtr[i], 36); + strncpy(lineBuffer + strlen(optionsArrayPtr[i]) + 2, " <", 3); + } else { + strncpy(lineBuffer, ">", 2); + strncpy(lineBuffer + 1, optionsArrayPtr[i], 37); + strncpy(lineBuffer + strlen(optionsArrayPtr[i]) + 1, "<", 2); + } + lineBuffer[39] = '\0'; + linePointers[linesShown] = lineBuffer; + } else { + linePointers[linesShown] = optionsArrayPtr[i]; + } + } + if (alertBannerOptions > 0) { + drawNotificationBox(display, state, linePointers, totalLines, firstOptionToShow, maxWidth); + } else { + drawNotificationBox(display, state, linePointers, totalLines, firstOptionToShow); + } +} + +void NotificationRenderer::drawNotificationBox(OLEDDisplay *display, OLEDDisplayUiState *state, const char *lines[], + uint16_t totalLines, uint8_t firstOptionToShow, uint16_t maxWidth) +{ + + bool is_picker = false; + uint16_t lineCount = 0; + // === Layout Configuration === + constexpr uint16_t hPadding = 5; + constexpr uint16_t vPadding = 2; + bool needs_bell = false; + uint16_t lineWidths[totalLines] = {0}; + uint16_t lineLengths[totalLines] = {0}; + + if (maxWidth != 0) + is_picker = true; + + // Setup font and alignment + display->setFont(FONT_SMALL); + display->setTextAlignment(TEXT_ALIGN_LEFT); + + while (lines[lineCount] != nullptr) { + auto newlinePointer = strchr(lines[lineCount], '\n'); + if (newlinePointer) + lineLengths[lineCount] = (newlinePointer - lines[lineCount]); // Check for newlines first + else // if the newline wasn't found, then pull string length from strlen + lineLengths[lineCount] = strlen(lines[lineCount]); + lineWidths[lineCount] = display->getStringWidth(lines[lineCount], lineLengths[lineCount], true); + if (!is_picker) { + needs_bell |= (strstr(alertBannerMessage, "Alert Received") != nullptr); + if (lineWidths[lineCount] > maxWidth) + maxWidth = lineWidths[lineCount]; + } + lineCount++; + } + // count lines + uint16_t boxWidth = hPadding * 2 + maxWidth; if (needs_bell) { if (isHighResolution && boxWidth <= 150) @@ -141,14 +428,19 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp boxWidth += 20; } - uint16_t totalLines = lineCount + alertBannerOptions; uint16_t screenHeight = display->height(); uint8_t effectiveLineHeight = FONT_HEIGHT_SMALL - 3; - uint8_t visibleTotalLines = std::min(totalLines, (screenHeight - vPadding * 2) / effectiveLineHeight); + uint8_t visibleTotalLines = std::min(lineCount, (screenHeight - vPadding * 2) / effectiveLineHeight); uint16_t contentHeight = visibleTotalLines * effectiveLineHeight; uint16_t boxHeight = contentHeight + vPadding * 2; + if (visibleTotalLines == 1) { + boxHeight += (isHighResolution) ? 4 : 3; + } int16_t boxLeft = (display->width() / 2) - (boxWidth / 2); + if (totalLines > visibleTotalLines) { + boxWidth += (isHighResolution) ? 4 : 2; + } int16_t boxTop = (display->height() / 2) - (boxHeight / 2); // === Draw Box === @@ -169,21 +461,18 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp // === Draw Content === int16_t lineY = boxTop + vPadding; - uint8_t linesShown = 0; - - for (int i = 0; i < lineCount && linesShown < visibleTotalLines; i++, linesShown++) { - strncpy(lineBuffer, lineStarts[i], 40); - lineBuffer[lineLengths[i] > 39 ? 39 : lineLengths[i]] = '\0'; - + for (int i = 0; i < lineCount; i++) { int16_t textX = boxLeft + (boxWidth - lineWidths[i]) / 2; if (needs_bell && i == 0) { int bellY = lineY + (FONT_HEIGHT_SMALL - 8) / 2; display->drawXbm(textX - 10, bellY, 8, 8, bell_alert); display->drawXbm(textX + lineWidths[i] + 2, bellY, 8, 8, bell_alert); } - + char lineBuffer[lineLengths[i] + 1]; + strncpy(lineBuffer, lines[i], lineLengths[i]); + lineBuffer[lineLengths[i]] = '\0'; // Determine if this is a pop-up or a pick list - if (alertBannerOptions > 0) { + if (alertBannerOptions > 0 && i == 0) { // Pick List display->setColor(WHITE); int background_yOffset = 1; @@ -199,39 +488,14 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp lineY += (effectiveLineHeight - 2 - background_yOffset); } else { // Pop-up - display->drawString(textX, lineY - 2, lineBuffer); + display->drawString(textX, lineY, lineBuffer); lineY += (effectiveLineHeight); } } - uint8_t firstOptionToShow = 0; - if (alertBannerOptions > 0) { - if (curSelected > 1 && alertBannerOptions > visibleTotalLines - lineCount) - firstOptionToShow = curSelected - 1; - else - firstOptionToShow = 0; - } - - for (int i = firstOptionToShow; i < alertBannerOptions && linesShown < visibleTotalLines; i++, linesShown++) { - if (i == curSelected) { - strncpy(lineBuffer, "> ", 3); - strncpy(lineBuffer + 2, optionsArrayPtr[i], 36); - strncpy(lineBuffer + strlen(optionsArrayPtr[i]) + 2, " <", 3); - lineBuffer[39] = '\0'; - } else { - strncpy(lineBuffer, optionsArrayPtr[i], 40); - lineBuffer[39] = '\0'; - } - - int16_t textX = boxLeft + (boxWidth - optionWidths[i] - (i == curSelected ? arrowsWidth : 0)) / 2; - display->drawString(textX, lineY, lineBuffer); - lineY += effectiveLineHeight; - } - // === Scroll Bar (Thicker, inside box, not over title) === if (totalLines > visibleTotalLines) { const uint8_t scrollBarWidth = 5; - const uint8_t scrollPadding = 2; int16_t scrollBarX = boxLeft + boxWidth - scrollBarWidth - 2; int16_t scrollBarY = boxTop + vPadding + effectiveLineHeight; // start after title line @@ -239,7 +503,7 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp float ratio = (float)visibleTotalLines / totalLines; uint16_t indicatorHeight = std::max((int)(scrollBarHeight * ratio), 4); - float scrollRatio = (float)(firstOptionToShow + linesShown - visibleTotalLines) / (totalLines - visibleTotalLines); + float scrollRatio = (float)(firstOptionToShow + lineCount - visibleTotalLines) / (totalLines - visibleTotalLines); uint16_t indicatorY = scrollBarY + scrollRatio * (scrollBarHeight - indicatorHeight); display->drawRect(scrollBarX, scrollBarY, scrollBarWidth, scrollBarHeight); diff --git a/src/graphics/draw/NotificationRenderer.h b/src/graphics/draw/NotificationRenderer.h index 2ec5fd9ec..97a404d11 100644 --- a/src/graphics/draw/NotificationRenderer.h +++ b/src/graphics/draw/NotificationRenderer.h @@ -2,6 +2,8 @@ #include "OLEDDisplay.h" #include "OLEDDisplayUi.h" +#include "graphics/Screen.h" +#define MAX_LINES 5 namespace graphics { @@ -14,16 +16,28 @@ class NotificationRenderer static char alertBannerMessage[256]; static uint32_t alertBannerUntil; // 0 is a special case meaning forever static const char **optionsArrayPtr; + static const int *optionsEnumPtr; static uint8_t alertBannerOptions; // last x lines are seelctable options static std::function alertBannerCallback; + static uint32_t numDigits; + static uint32_t currentNumber; static bool pauseBanner; + static void resetBanner(); + static void drawBannercallback(OLEDDisplay *display, OLEDDisplayUiState *state); static void drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisplayUiState *state); + static void drawNumberPicker(OLEDDisplay *display, OLEDDisplayUiState *state); + static void drawNodePicker(OLEDDisplay *display, OLEDDisplayUiState *state); + static void drawNotificationBox(OLEDDisplay *display, OLEDDisplayUiState *state, const char *lines[MAX_LINES + 1], + uint16_t totalLines, uint8_t firstOptionToShow, uint16_t maxWidth = 0); + static void drawCriticalFaultFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); static void drawSSLScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); static void drawFrameFirmware(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); static bool isOverlayBannerShowing(); + + static graphics::notificationTypeEnum current_notification_type; }; } // namespace graphics diff --git a/src/graphics/draw/UIRenderer.cpp b/src/graphics/draw/UIRenderer.cpp index 9c3a9eabb..9be8b04f4 100644 --- a/src/graphics/draw/UIRenderer.cpp +++ b/src/graphics/draw/UIRenderer.cpp @@ -18,32 +18,6 @@ #include #include -bool isAllowedPunctuation(char c) -{ - const std::string allowed = ".,!?;:-_()[]{}'\"@#$/\\&+=%~^ "; - return allowed.find(c) != std::string::npos; -} - -std::string sanitizeString(const std::string &input) -{ - std::string output; - bool inReplacement = false; - - for (char c : input) { - if (std::isalnum(static_cast(c)) || isAllowedPunctuation(c)) { - output += c; - inReplacement = false; - } else { - if (!inReplacement) { - output += 0xbf; // ISO-8859-1 for inverted question mark - inReplacement = true; - } - } - } - - return output; -} - // External variables extern graphics::Screen *screen; @@ -443,7 +417,7 @@ void UIRenderer::drawNodeInfo(OLEDDisplay *display, const OLEDDisplayUiState *st GeoCoord::latLongToMeter(DegD(p.latitude_i), DegD(p.longitude_i), DegD(op.latitude_i), DegD(op.longitude_i)); */ float bearing = GeoCoord::bearing(DegD(op.latitude_i), DegD(op.longitude_i), DegD(p.latitude_i), DegD(p.longitude_i)); - if (screen->ignoreCompass) { + if (uiconfig.compass_mode == meshtastic_CompassMode_FREEZE_HEADING) { myHeading = 0; } else { bearing -= myHeading; @@ -488,7 +462,7 @@ void UIRenderer::drawNodeInfo(OLEDDisplay *display, const OLEDDisplayUiState *st const auto &op = ourNode->position; float myHeading = 0; - if (!screen->ignoreCompass) { + if (uiconfig.compass_mode != meshtastic_CompassMode_FREEZE_HEADING) { myHeading = screen->hasHeading() ? screen->getHeading() * PI / 180 : screen->estimatedHeading(DegD(op.latitude_i), DegD(op.longitude_i)); } @@ -500,7 +474,7 @@ void UIRenderer::drawNodeInfo(OLEDDisplay *display, const OLEDDisplayUiState *st GeoCoord::latLongToMeter(DegD(p.latitude_i), DegD(p.longitude_i), DegD(op.latitude_i), DegD(op.longitude_i)); */ float bearing = GeoCoord::bearing(DegD(op.latitude_i), DegD(op.longitude_i), DegD(p.latitude_i), DegD(p.longitude_i)); - if (!screen->ignoreCompass) + if (uiconfig.compass_mode != meshtastic_CompassMode_FREEZE_HEADING) bearing -= myHeading; graphics::CompassRenderer::drawNodeHeading(display, compassX, compassY, compassRadius * 2, bearing); @@ -600,7 +574,11 @@ void UIRenderer::drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *sta int chutil_bar_width = (isHighResolution) ? 100 : 50; if (!config.bluetooth.enabled) { +#if defined(USE_EINK) + chutil_bar_width = (isHighResolution) ? 50 : 30; +#else chutil_bar_width = (isHighResolution) ? 80 : 40; +#endif } int chutil_bar_height = (isHighResolution) ? 12 : 7; int extraoffset = (isHighResolution) ? 6 : 3; @@ -933,7 +911,7 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU // === Determine Compass Heading === float heading = 0; bool validHeading = false; - if (screen->ignoreCompass) { + if (uiconfig.compass_mode == meshtastic_CompassMode_FREEZE_HEADING) { validHeading = true; } else { if (screen->hasHeading()) { @@ -999,7 +977,7 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU // "N" label float northAngle = 0; - if (!config.display.compass_north_top) + if (uiconfig.compass_mode != meshtastic_CompassMode_FIXED_RING) northAngle = -heading; float radius = compassRadius; int16_t nX = compassX + (radius - 1) * sin(northAngle); @@ -1042,7 +1020,7 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU // "N" label float northAngle = 0; - if (!config.display.compass_north_top) + if (uiconfig.compass_mode != meshtastic_CompassMode_FIXED_RING) northAngle = -heading; float radius = compassRadius; int16_t nX = compassX + (radius - 1) * sin(northAngle); @@ -1066,9 +1044,16 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU void UIRenderer::drawOEMIconScreen(const char *upperMsg, OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { static const uint8_t xbm[] = USERPREFS_OEM_IMAGE_DATA; - display->drawXbm(x + (SCREEN_WIDTH - USERPREFS_OEM_IMAGE_WIDTH) / 2, - y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - USERPREFS_OEM_IMAGE_HEIGHT) / 2 + 2, USERPREFS_OEM_IMAGE_WIDTH, - USERPREFS_OEM_IMAGE_HEIGHT, xbm); + if (isHighResolution) { + display->drawXbm(x + (SCREEN_WIDTH - USERPREFS_OEM_IMAGE_WIDTH) / 2, + y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - USERPREFS_OEM_IMAGE_HEIGHT) / 2 + 2, USERPREFS_OEM_IMAGE_WIDTH, + USERPREFS_OEM_IMAGE_HEIGHT, xbm); + } else { + + display->drawXbm(x + (SCREEN_WIDTH - USERPREFS_OEM_IMAGE_WIDTH) / 2, + y + (SCREEN_HEIGHT - USERPREFS_OEM_IMAGE_HEIGHT) / 2 + 2, USERPREFS_OEM_IMAGE_WIDTH, + USERPREFS_OEM_IMAGE_HEIGHT, xbm); + } switch (USERPREFS_OEM_FONT_SIZE) { case 0: @@ -1084,7 +1069,9 @@ void UIRenderer::drawOEMIconScreen(const char *upperMsg, OLEDDisplay *display, O display->setTextAlignment(TEXT_ALIGN_LEFT); const char *title = USERPREFS_OEM_TEXT; - display->drawString(x + getStringCenteredX(title), y + SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM, title); + if (isHighResolution) { + display->drawString(x + getStringCenteredX(title), y + SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM, title); + } display->setFont(FONT_SMALL); // Draw region in upper left diff --git a/src/graphics/emotes.cpp b/src/graphics/emotes.cpp index 205d5c660..e1a105d20 100644 --- a/src/graphics/emotes.cpp +++ b/src/graphics/emotes.cpp @@ -11,11 +11,11 @@ const Emote emotes[] = { {"\U0001F44E", thumbdown, thumbs_width, thumbs_height}, // 👎 Thumbs Down // --- Smileys (Multiple Unicode Aliases) --- - {"\U0001F60A", smiley, smiley_width, smiley_height}, // 😊 Smiling Face with Smiling Eyes - {"\U0001F600", smiley, smiley_width, smiley_height}, // 😀 Grinning Face - {"\U0001F642", smiley, smiley_width, smiley_height}, // 🙂 Slightly Smiling Face - {"\U0001F609", smiley, smiley_width, smiley_height}, // 😉 Winking Face - {"\U0001F601", smiley, smiley_width, smiley_height}, // 😁 Grinning Face with Smiling Eyes + {"\U0001F60A", Smiling_Eyes, Smiling_Eyes_width, Smiling_Eyes_height}, // 😊 Smiling Eyes + {"\U0001F600", Grinning, Grinning_width, Grinning_height}, // 😀 Grinning Face + {"\U0001F642", Slightly_Smiling, Slightly_Smiling_width, Slightly_Smiling_height}, // 🙂 Slightly Smiling Face + {"\U0001F609", Winking_Face, Winking_Face_width, Winking_Face_height}, // 😉 Winking Face + {"\U0001F601", Grinning_Smiling_Eyes, Grinning_Smiling_Eyes_width, Grinning_Smiling_Eyes_height}, // 😁 Grinning Smiling Eyes // --- Question/Alert --- {"\u2753", question, question_width, question_height}, // ❓ Question Mark @@ -23,10 +23,11 @@ const Emote emotes[] = { // --- Laughing Faces --- {"\U0001F602", haha, haha_width, haha_height}, // 😂 Face with Tears of Joy - {"\U0001F923", haha, haha_width, haha_height}, // 🤣 Rolling on the Floor Laughing - {"\U0001F606", haha, haha_width, haha_height}, // 😆 Smiling with Open Mouth and Closed Eyes - {"\U0001F605", haha, haha_width, haha_height}, // 😅 Smiling with Sweat - {"\U0001F604", haha, haha_width, haha_height}, // 😄 Grinning Face with Smiling Eyes + {"\U0001F923", ROFL, ROFL_width, ROFL_height}, // 🤣 Rolling on the Floor Laughing + {"\U0001F606", Smiling_Closed_Eyes, Smiling_Closed_Eyes_width, Smiling_Closed_Eyes_height}, // 😆 Smiling Closed Eyes + {"\U0001F605", haha, haha_width, haha_height}, // 😅 Smiling with Sweat + {"\U0001F604", Grinning_SmilingEyes2, Grinning_SmilingEyes2_width, + Grinning_SmilingEyes2_height}, // 😄 Grinning Face with Smiling Eyes // --- Gestures and People --- {"\U0001F44B", wave_icon, wave_icon_width, wave_icon_height}, // 👋 Waving Hand @@ -78,13 +79,45 @@ const unsigned char thumbdown[] PROGMEM = { 0x80, 0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, }; -const unsigned char smiley[] PROGMEM = { - 0x00, 0xfe, 0x0f, 0x00, 0x80, 0x01, 0x30, 0x00, 0x40, 0x00, 0xc0, 0x00, 0x20, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x02, - 0x08, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x10, 0x02, 0x0e, 0x0e, 0x10, 0x02, 0x09, 0x12, 0x10, - 0x01, 0x09, 0x12, 0x20, 0x01, 0x0f, 0x1e, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, - 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x81, 0x00, 0x20, 0x20, - 0x82, 0x00, 0x20, 0x10, 0x02, 0x01, 0x10, 0x10, 0x04, 0x02, 0x08, 0x08, 0x04, 0xfc, 0x07, 0x08, 0x08, 0x00, 0x00, 0x04, - 0x10, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00, 0x01, 0x40, 0x00, 0xc0, 0x00, 0x80, 0x01, 0x30, 0x00, 0x00, 0xfe, 0x0f, 0x00}; +const unsigned char Smiling_Eyes[] PROGMEM = { + 0x00, 0xf8, 0x03, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xe0, 0xff, 0xff, 0xc1, + 0xf0, 0xff, 0xff, 0xc3, 0xf8, 0xff, 0xff, 0xc7, 0xf8, 0xff, 0xff, 0xcf, 0xfc, 0xff, 0xff, 0xcf, 0xfc, 0xff, 0xff, 0xcf, + 0x7e, 0xf8, 0xc3, 0xdf, 0x3e, 0xf0, 0x81, 0xdf, 0xbf, 0xf7, 0xbd, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0x3f, 0xff, + 0x6f, 0xff, 0xdf, 0xfe, 0x6f, 0xff, 0xdf, 0xfe, 0x9f, 0xff, 0x3f, 0xff, 0xfe, 0xff, 0xff, 0xdf, 0x7e, 0xff, 0xdf, 0xdf, + 0x7c, 0xff, 0xdf, 0xcf, 0xfc, 0xfe, 0xef, 0xcf, 0xf8, 0xf9, 0xf7, 0xc7, 0xf8, 0x03, 0xf8, 0xc7, 0xf0, 0xff, 0xff, 0xc3, + 0xe0, 0xff, 0xff, 0xc1, 0xc0, 0xff, 0xff, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x00, 0xf8, 0x07, 0xc0}; + +const unsigned char Grinning[] PROGMEM = { + 0x00, 0xf8, 0x03, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xe0, 0xff, 0xff, 0xc1, + 0xf0, 0xff, 0xff, 0xc3, 0xf8, 0xff, 0xff, 0xc7, 0xf8, 0xff, 0xff, 0xcf, 0xfc, 0xf9, 0xf3, 0xcf, 0xfc, 0xf0, 0xe1, 0xcf, + 0xfe, 0xf0, 0xe1, 0xdf, 0xfe, 0xf0, 0xe1, 0xdf, 0xff, 0xf0, 0xe1, 0xff, 0xff, 0xf9, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x80, 0xff, 0xbe, 0xff, 0xbf, 0xdf, 0x7e, 0x00, 0xc0, 0xdf, + 0x7c, 0x00, 0xc0, 0xcf, 0xfc, 0x00, 0xe0, 0xcf, 0xf8, 0x01, 0xf0, 0xc7, 0xf8, 0x03, 0xf8, 0xc7, 0xf0, 0xff, 0xff, 0xc3, + 0xe0, 0xff, 0xff, 0xc1, 0xc0, 0xff, 0xff, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x00, 0xf8, 0x03, 0xc0}; + +const unsigned char Slightly_Smiling[] PROGMEM = { + 0x00, 0xf8, 0x03, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xe0, 0xff, 0xff, 0xc1, + 0xf0, 0xff, 0xff, 0xc3, 0xf8, 0xff, 0xff, 0xc7, 0xf8, 0xff, 0xff, 0xcf, 0xfc, 0xf9, 0xf3, 0xcf, 0xfc, 0xf0, 0xe1, 0xcf, + 0xfe, 0xf0, 0xe1, 0xdf, 0xfe, 0xf0, 0xe1, 0xdf, 0xff, 0xf0, 0xe1, 0xff, 0xff, 0xf9, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xdf, 0x7e, 0xff, 0xdf, 0xdf, + 0x7c, 0xff, 0xdf, 0xcf, 0xfc, 0xfe, 0xef, 0xcf, 0xf8, 0xf9, 0xf7, 0xc7, 0xf8, 0x03, 0xf8, 0xc7, 0xf0, 0xff, 0xff, 0xc3, + 0xe0, 0xff, 0xff, 0xc1, 0xc0, 0xff, 0xff, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x00, 0xf8, 0x03, 0xc0}; + +const unsigned char Winking_Face[] PROGMEM = { + 0x00, 0xf8, 0x03, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xe0, 0xff, 0xff, 0xc1, + 0xf0, 0xf0, 0xff, 0xc3, 0x78, 0xef, 0xc3, 0xc7, 0xb8, 0xdf, 0xbd, 0xcf, 0xfc, 0xf9, 0x7f, 0xcf, 0xfc, 0xf0, 0xff, 0xcf, + 0xfe, 0xf0, 0xc3, 0xdf, 0xfe, 0xf0, 0x81, 0xdf, 0xff, 0xf0, 0xbf, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xdf, 0x7e, 0xff, 0xdf, 0xdf, + 0x7c, 0xff, 0xdf, 0xcf, 0xfc, 0xfe, 0xef, 0xcf, 0xf8, 0xf9, 0xf7, 0xc7, 0xf8, 0x03, 0xf8, 0xc7, 0xf0, 0xff, 0xff, 0xc3, + 0xe0, 0xff, 0xff, 0xc1, 0xc0, 0xff, 0xff, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x00, 0xf8, 0x07, 0xc0}; + +const unsigned char Grinning_Smiling_Eyes[] PROGMEM = { + 0x00, 0xf8, 0x03, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xe0, 0xff, 0xff, 0xc1, + 0xf0, 0xff, 0xff, 0xc3, 0xf8, 0xff, 0xff, 0xc7, 0xf8, 0xff, 0xff, 0xcf, 0xfc, 0xf8, 0xe3, 0xcf, 0x7c, 0xf7, 0xdd, 0xcf, + 0xbe, 0xef, 0xbe, 0xdf, 0xbe, 0xef, 0xbe, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0x5e, 0x55, 0x55, 0xdf, 0x5e, 0x55, 0x55, 0xdf, + 0x3c, 0x00, 0x80, 0xcf, 0x7c, 0x55, 0xd5, 0xcf, 0xf8, 0x54, 0xe5, 0xc7, 0xf8, 0x03, 0xf8, 0xc7, 0xf0, 0xff, 0xff, 0xc3, + 0xe0, 0xff, 0xff, 0xc1, 0xc0, 0xff, 0xff, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x00, 0xf8, 0x03, 0xc0}; const unsigned char question[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x80, 0xFF, 0x01, 0x00, 0xC0, 0xFF, 0x07, 0x00, 0xE0, 0xFF, 0x07, 0x00, @@ -104,31 +137,52 @@ const unsigned char bang[] PROGMEM = { }; const unsigned char haha[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, - 0x00, 0xFC, 0x0F, 0x00, 0x00, 0x1F, 0x3E, 0x00, 0x80, 0x03, 0x70, 0x00, 0xC0, 0x01, 0xE0, 0x00, 0xC0, 0x00, 0xC2, 0x00, - 0x60, 0x00, 0x03, 0x00, 0x60, 0x00, 0xC1, 0x1F, 0x60, 0x80, 0x8F, 0x31, 0x30, 0x0E, 0x80, 0x31, 0x30, 0x10, 0x30, 0x1F, - 0x30, 0x08, 0x58, 0x00, 0x30, 0x04, 0x6C, 0x03, 0x60, 0x00, 0xF3, 0x01, 0x60, 0xC0, 0xFC, 0x01, 0x80, 0x38, 0xBF, 0x01, - 0xE0, 0xC5, 0xDF, 0x00, 0xB0, 0xF9, 0xEF, 0x00, 0x30, 0xF1, 0x73, 0x00, 0xB0, 0x1D, 0x3E, 0x00, 0xF0, 0xFD, 0x0F, 0x00, - 0xE0, 0xE0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; + 0x00, 0xf8, 0x03, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0xc0, 0xff, 0x7f, 0xc0, 0xe0, 0xf9, 0xf3, 0xc0, + 0xf0, 0xfe, 0xef, 0xc1, 0x38, 0xff, 0x9f, 0xc3, 0xd8, 0xff, 0x7f, 0xc3, 0xfc, 0xf8, 0xe3, 0xc7, 0x7c, 0xf7, 0xdd, 0xcf, + 0xbe, 0xef, 0xbe, 0xcf, 0xfe, 0xff, 0xff, 0xcf, 0xef, 0xff, 0xff, 0xde, 0xe7, 0xff, 0xff, 0xdc, 0xeb, 0xff, 0xff, 0xda, + 0xed, 0xff, 0xff, 0xd6, 0xee, 0xff, 0xff, 0xce, 0x36, 0x00, 0x80, 0xcd, 0xb8, 0xff, 0xbf, 0xc3, 0x7e, 0x00, 0xc0, 0xdf, + 0x7c, 0x00, 0xc0, 0xcf, 0xfc, 0x00, 0xe0, 0xcf, 0xf8, 0x01, 0xf0, 0xc7, 0xf8, 0x03, 0xf8, 0xc7, 0xf0, 0xff, 0xff, 0xc3, + 0xe0, 0xff, 0xff, 0xc1, 0xc0, 0xff, 0xff, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x00, 0xf8, 0x03, 0xc0}; + +const unsigned char ROFL[] PROGMEM = { + 0x00, 0x00, 0x00, 0xc0, 0x00, 0xfc, 0x07, 0xc0, 0x00, 0xff, 0x1f, 0xc0, 0x80, 0xff, 0x7f, 0xc0, 0xc0, 0xff, 0xff, 0xc0, + 0xe0, 0x9f, 0xff, 0xc1, 0xf0, 0x9f, 0xff, 0xc0, 0xf8, 0x9f, 0x7f, 0xcb, 0xf8, 0x9f, 0xbf, 0xcb, 0xfc, 0x9f, 0xdf, 0xdb, + 0xfc, 0x1f, 0x08, 0xdc, 0xfe, 0x1f, 0xf8, 0xfe, 0xfe, 0xff, 0xff, 0xfe, 0x1e, 0xf0, 0x7f, 0xfe, 0x1e, 0xf0, 0xbf, 0xfe, + 0xfe, 0xf3, 0xdf, 0xfe, 0xfe, 0xf3, 0x6f, 0xfe, 0xfe, 0xf3, 0x37, 0xfe, 0xfe, 0xeb, 0x1b, 0xfe, 0xfc, 0xef, 0x0d, 0xde, + 0xfc, 0xe7, 0x06, 0xcf, 0xf8, 0x6b, 0x83, 0xcf, 0xf8, 0x0d, 0xc0, 0xc7, 0xf0, 0xed, 0xff, 0xc7, 0xe0, 0xee, 0xff, 0xc3, + 0xc0, 0xee, 0xff, 0xc1, 0x80, 0xee, 0xff, 0xc0, 0x00, 0xe6, 0x3f, 0xc0, 0x00, 0xf0, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0xc0}; + +const unsigned char Smiling_Closed_Eyes[] PROGMEM = { + 0x00, 0xf8, 0x03, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xe0, 0xff, 0xff, 0xc1, + 0xf0, 0xff, 0xff, 0xc3, 0xf8, 0xff, 0xff, 0xc7, 0xf8, 0xff, 0xff, 0xcf, 0x7c, 0xfe, 0xcf, 0xcf, 0xfc, 0xfc, 0xe7, 0xcf, + 0xfe, 0xf9, 0xf3, 0xdf, 0xfe, 0xf3, 0xf9, 0xdf, 0xff, 0xf9, 0xf3, 0xff, 0xff, 0xfc, 0xe7, 0xff, 0x7f, 0xfe, 0xcf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x80, 0xff, 0xbe, 0xff, 0xbf, 0xdf, 0x7e, 0x00, 0xc0, 0xdf, + 0x7c, 0x00, 0xc0, 0xcf, 0xfc, 0x00, 0xe0, 0xcf, 0xf8, 0x01, 0xf0, 0xc7, 0xf8, 0x03, 0xf8, 0xc7, 0xf0, 0xff, 0xff, 0xc3, + 0xe0, 0xff, 0xff, 0xc1, 0xc0, 0xff, 0xff, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x00, 0xf8, 0x03, 0xc0}; + +const unsigned char Grinning_SmilingEyes2[] PROGMEM = { + 0x00, 0xf8, 0x03, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0xc0, 0xff, 0x7f, 0xc0, 0xe0, 0xff, 0xff, 0xc0, + 0xf0, 0xff, 0xff, 0xc1, 0xf8, 0xff, 0xff, 0xc3, 0xf8, 0xff, 0xff, 0xc3, 0xfc, 0xf8, 0xe3, 0xc7, 0x7c, 0xf7, 0xdd, 0xc7, + 0xbe, 0xef, 0xbe, 0xcf, 0xfe, 0xff, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xff, 0xdf, + 0xff, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xff, 0xdf, 0x3f, 0x00, 0x80, 0xdf, 0xbe, 0xff, 0xbf, 0xcf, 0x7e, 0x00, 0xc0, 0xcf, + 0x7c, 0x00, 0xc0, 0xc7, 0xfc, 0x00, 0xe0, 0xc7, 0xf8, 0x01, 0xf0, 0xc3, 0xf8, 0x03, 0xf8, 0xc3, 0xf0, 0xff, 0xff, 0xc1, + 0xe0, 0xff, 0xff, 0xc0, 0xc0, 0xff, 0x7f, 0xc0, 0x80, 0xff, 0x3f, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x00, 0xf8, 0x03, 0xc0}; const unsigned char wave_icon[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xC0, 0x00, - 0x00, 0x0C, 0x9C, 0x01, 0x80, 0x17, 0x20, 0x01, 0x80, 0x26, 0x46, 0x02, 0x80, 0x44, 0x88, 0x02, 0xC0, 0x89, 0x8A, 0x02, - 0x40, 0x93, 0x8B, 0x02, 0x40, 0x26, 0x13, 0x00, 0x80, 0x44, 0x16, 0x00, 0xC0, 0x89, 0x24, 0x00, 0x40, 0x93, 0x60, 0x00, - 0x40, 0x26, 0x40, 0x00, 0x80, 0x0C, 0x80, 0x00, 0x00, 0x09, 0x80, 0x00, 0x00, 0x02, 0x80, 0x00, 0x40, 0x06, 0x80, 0x00, - 0x50, 0x0C, 0x80, 0x00, 0x50, 0x08, 0x40, 0x00, 0x90, 0x10, 0x20, 0x00, 0xB0, 0x21, 0x10, 0x00, 0x20, 0x47, 0x18, 0x00, - 0x40, 0x80, 0x0F, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; + 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00, 0xc0, 0xc1, 0x00, 0x00, 0x00, 0xc7, + 0x00, 0x00, 0x1e, 0xcc, 0x00, 0x00, 0x30, 0xc8, 0x00, 0x00, 0x60, 0xd8, 0x00, 0x08, 0xc0, 0xd0, 0x00, 0x1a, 0x81, 0xd1, + 0x00, 0x36, 0x03, 0xd3, 0x80, 0x6d, 0x06, 0xd2, 0x00, 0xdb, 0x0c, 0xc2, 0x80, 0xb6, 0x1d, 0xc0, 0x80, 0x6d, 0x1f, 0xc0, + 0x00, 0xdb, 0x3f, 0xc0, 0x00, 0xf6, 0x7f, 0xc0, 0x00, 0xfc, 0x7f, 0xc0, 0x08, 0xf8, 0x7f, 0xc0, 0x48, 0xf0, 0x7f, 0xc0, + 0x48, 0xe0, 0x7f, 0xc0, 0xc8, 0xc0, 0x3f, 0xc0, 0x98, 0x81, 0x1f, 0xc0, 0x10, 0x03, 0x00, 0xc0, 0x30, 0x0e, 0x00, 0xc0, + 0x20, 0x38, 0x00, 0xc0, 0xe0, 0x00, 0x00, 0xc0, 0x80, 0x07, 0x00, 0xc0, 0x00, 0x1e, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0}; const unsigned char cowboy[] PROGMEM = { - 0x00, 0xF0, 0x03, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x00, 0xFE, 0x1F, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x3C, 0xFE, 0x1F, 0x0F, - 0xFE, 0xFE, 0xDF, 0x1F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, - 0x3E, 0xC0, 0x00, 0x1F, 0x1E, 0x00, 0x00, 0x1E, 0x0C, 0x0C, 0x0C, 0x0C, 0x08, 0x0E, 0x1C, 0x04, 0x00, 0x0E, 0x1C, 0x00, - 0x04, 0x0E, 0x1C, 0x08, 0x04, 0x0E, 0x1C, 0x08, 0x04, 0x04, 0x08, 0x08, 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x08, - 0x8C, 0x07, 0x70, 0x0C, 0x88, 0xFC, 0x4F, 0x04, 0x88, 0x01, 0x40, 0x04, 0x90, 0xFF, 0x7F, 0x02, 0x30, 0x03, 0x30, 0x03, - 0x60, 0x0E, 0x9C, 0x01, 0xC0, 0xF8, 0xC7, 0x00, 0x80, 0x01, 0x60, 0x00, 0x00, 0x0E, 0x1C, 0x00, 0x00, 0xF8, 0x07, 0x00, -}; + 0x00, 0x0c, 0x0c, 0xc0, 0x00, 0x02, 0x10, 0xc0, 0x00, 0x01, 0x20, 0xc0, 0xbc, 0x00, 0x40, 0xcf, 0xc2, 0x01, 0xe0, 0xd0, + 0x01, 0x01, 0x20, 0xe0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, + 0xc1, 0x3f, 0xff, 0xe0, 0xe1, 0xff, 0xff, 0xe1, 0xf2, 0xf3, 0xf3, 0xd3, 0xf4, 0xf1, 0xe3, 0xcb, 0xfc, 0xf1, 0xe3, 0xc7, + 0xf8, 0xf1, 0xe3, 0xc7, 0xf8, 0xf1, 0xe3, 0xc7, 0xf8, 0xfb, 0xf7, 0xc7, 0xf8, 0xff, 0xff, 0xc7, 0xf8, 0xff, 0xff, 0xc7, + 0x70, 0xf8, 0x8f, 0xc3, 0x70, 0x03, 0xb0, 0xc3, 0x70, 0xfe, 0xbf, 0xc3, 0x60, 0x00, 0x80, 0xc1, 0xc0, 0x00, 0xc0, 0xc0, + 0x80, 0x01, 0x60, 0xc0, 0x00, 0x07, 0x38, 0xc0, 0x00, 0xfe, 0x1f, 0xc0, 0x00, 0xf0, 0x03, 0xc0, 0x00, 0x00, 0x00, 0xc0}; const unsigned char deadmau5[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x07, 0x00, @@ -181,13 +235,12 @@ const unsigned char fog[] PROGMEM = { }; const unsigned char devil[] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x10, 0x03, 0xC0, 0x01, 0x38, 0x07, 0x7C, 0x0F, 0x38, 0x1F, 0x03, 0x30, 0x1E, - 0xFE, 0x01, 0xE0, 0x1F, 0x7E, 0x00, 0x80, 0x1F, 0x3C, 0x00, 0x00, 0x0F, 0x1C, 0x00, 0x00, 0x0E, 0x18, 0x00, 0x00, 0x06, - 0x08, 0x00, 0x00, 0x04, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x0E, 0x1C, 0x0C, - 0x0C, 0x18, 0x06, 0x0C, 0x0C, 0x1C, 0x06, 0x0C, 0x0C, 0x1C, 0x0E, 0x0C, 0x0C, 0x1C, 0x0E, 0x0C, 0x0C, 0x0C, 0x06, 0x0C, - 0x08, 0x00, 0x00, 0x06, 0x18, 0x02, 0x10, 0x06, 0x10, 0x0C, 0x0C, 0x03, 0x30, 0xF8, 0x07, 0x03, 0x60, 0xE0, 0x80, 0x01, - 0xC0, 0x00, 0xC0, 0x00, 0x80, 0x01, 0x70, 0x00, 0x00, 0x06, 0x1C, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, -}; + 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xf0, 0x0f, 0xfc, 0x0f, 0xfc, + 0x3f, 0xff, 0x3f, 0xff, 0xfe, 0xff, 0xff, 0xdf, 0xfe, 0xff, 0xff, 0xdf, 0xfe, 0xff, 0xff, 0xdf, 0xfc, 0xff, 0xff, 0xcf, + 0xfc, 0xff, 0xff, 0xcf, 0xf8, 0xff, 0xff, 0xc7, 0xf0, 0xff, 0xff, 0xc3, 0xf0, 0xff, 0xff, 0xc3, 0xf0, 0xf1, 0xe3, 0xc3, + 0xf0, 0xe7, 0xf9, 0xc3, 0xf0, 0xe7, 0xf9, 0xc3, 0xf0, 0xe3, 0xf1, 0xc3, 0xf0, 0xe3, 0xf1, 0xc3, 0xf0, 0xe7, 0xf9, 0xc3, + 0xf0, 0xff, 0xff, 0xc3, 0xe0, 0xfd, 0xef, 0xc1, 0xe0, 0xf3, 0xf3, 0xc1, 0xc0, 0x07, 0xf8, 0xc0, 0x80, 0x1f, 0x7e, 0xc0, + 0x00, 0xff, 0x3f, 0xc0, 0x00, 0xfe, 0x0f, 0xc0, 0x00, 0xf8, 0x03, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0}; const unsigned char heart[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0xF0, 0x00, 0xF8, 0x0F, 0xFC, 0x07, 0xFC, 0x1F, 0x06, 0x0E, 0xFE, 0x3F, 0x03, 0x18, @@ -199,13 +252,12 @@ const unsigned char heart[] PROGMEM = { }; const unsigned char poo[] PROGMEM = { - 0x00, 0x1C, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xEC, 0x01, 0x00, 0x00, 0x8C, 0x07, 0x00, 0x00, 0x0C, 0x06, 0x00, - 0x00, 0x24, 0x0C, 0x00, 0x00, 0x34, 0x08, 0x00, 0x00, 0x1F, 0x08, 0x00, 0xC0, 0x0F, 0x08, 0x00, 0xC0, 0x00, 0x3C, 0x00, - 0x60, 0x00, 0x7C, 0x00, 0x60, 0x00, 0xC6, 0x00, 0x20, 0x00, 0xCB, 0x00, 0xA0, 0xC7, 0xFF, 0x00, 0xE0, 0x7F, 0xF7, 0x00, - 0xF0, 0x18, 0xE3, 0x03, 0x78, 0x18, 0x41, 0x03, 0x6C, 0x9B, 0x5D, 0x06, 0x64, 0x9B, 0x5D, 0x04, 0x44, 0x1A, 0x41, 0x04, - 0x4C, 0xD8, 0x63, 0x06, 0xF8, 0xFC, 0x36, 0x06, 0xFE, 0x0F, 0x9C, 0x1F, 0x07, 0x03, 0xC0, 0x30, 0x03, 0x00, 0x78, 0x20, - 0x01, 0x00, 0x1F, 0x20, 0x03, 0xE0, 0x03, 0x20, 0x07, 0x7E, 0x04, 0x30, 0xFE, 0x0F, 0xFC, 0x1F, 0xF0, 0x00, 0xF0, 0x0F, -}; + 0x00, 0x1c, 0x00, 0xc0, 0x00, 0x7c, 0x00, 0xc0, 0x00, 0xfc, 0x00, 0xc0, 0x00, 0x7c, 0x03, 0xc0, 0x00, 0xbe, 0x03, 0xc0, + 0x00, 0xdf, 0x0f, 0xc0, 0x80, 0xcf, 0x0f, 0xc0, 0xc0, 0xf1, 0x0f, 0xc0, 0x60, 0xfc, 0x0f, 0xc0, 0x30, 0xff, 0x07, 0xc0, + 0x90, 0xff, 0x3b, 0xc0, 0xc0, 0xff, 0x7d, 0xc0, 0xf8, 0xff, 0xfc, 0xc0, 0xf8, 0x3f, 0xf0, 0xc0, 0x78, 0x88, 0xc0, 0xc0, + 0x20, 0xe3, 0x18, 0xc0, 0x98, 0xe7, 0xbc, 0xc1, 0x9c, 0x64, 0xa4, 0xc3, 0x9e, 0x64, 0xa4, 0xc7, 0xbe, 0xe4, 0xa4, 0xc7, + 0xbc, 0x27, 0xbc, 0xc7, 0x38, 0x03, 0xd9, 0xc3, 0x00, 0xf0, 0x63, 0xc0, 0xf8, 0xfc, 0x3f, 0xcf, 0xfc, 0xff, 0x87, 0xdf, + 0xfe, 0xff, 0xe0, 0xdf, 0xfc, 0x1f, 0xfe, 0xdf, 0xf8, 0x07, 0xf8, 0xcf, 0xf0, 0x03, 0xe0, 0xc7, 0x00, 0x00, 0x00, 0xc0}; const unsigned char bell_icon[] PROGMEM = { 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b11110000, diff --git a/src/graphics/emotes.h b/src/graphics/emotes.h index 5640ac04a..30b164cbc 100644 --- a/src/graphics/emotes.h +++ b/src/graphics/emotes.h @@ -22,9 +22,25 @@ extern const int numEmotes; extern const unsigned char thumbup[] PROGMEM; extern const unsigned char thumbdown[] PROGMEM; -#define smiley_height 30 -#define smiley_width 30 -extern const unsigned char smiley[] PROGMEM; +#define Smiling_Eyes_height 30 +#define Smiling_Eyes_width 30 +extern const unsigned char Smiling_Eyes[] PROGMEM; + +#define Grinning_height 30 +#define Grinning_width 30 +extern const unsigned char Grinning[] PROGMEM; + +#define Slightly_Smiling_height 30 +#define Slightly_Smiling_width 30 +extern const unsigned char Slightly_Smiling[] PROGMEM; + +#define Winking_Face_height 30 +#define Winking_Face_width 30 +extern const unsigned char Winking_Face[] PROGMEM; + +#define Grinning_Smiling_Eyes_height 30 +#define Grinning_Smiling_Eyes_width 30 +extern const unsigned char Grinning_Smiling_Eyes[] PROGMEM; #define question_height 25 #define question_width 25 @@ -38,6 +54,18 @@ extern const unsigned char bang[] PROGMEM; #define haha_width 30 extern const unsigned char haha[] PROGMEM; +#define ROFL_height 30 +#define ROFL_width 30 +extern const unsigned char ROFL[] PROGMEM; + +#define Smiling_Closed_Eyes_height 30 +#define Smiling_Closed_Eyes_width 30 +extern const unsigned char Smiling_Closed_Eyes[] PROGMEM; + +#define Grinning_SmilingEyes2_height 30 +#define Grinning_SmilingEyes2_width 30 +extern const unsigned char Grinning_SmilingEyes2[] PROGMEM; + #define wave_icon_height 30 #define wave_icon_width 30 extern const unsigned char wave_icon[] PROGMEM; diff --git a/src/main.cpp b/src/main.cpp index 9e0985a3a..773145951 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1363,7 +1363,7 @@ void setup() if (!rIf->reconfigure()) { LOG_WARN("Reconfigure failed, rebooting"); if (screen) { - screen->showOverlayBanner("Rebooting..."); + screen->showSimpleBanner("Rebooting..."); } rebootAtMsec = millis() + 5000; } @@ -1436,6 +1436,9 @@ void setup() LOG_DEBUG("Free heap : %7d bytes", ESP.getFreeHeap()); LOG_DEBUG("Free PSRAM : %7d bytes", ESP.getFreePsram()); #endif + + // We manually run this to update the NodeStatus + nodeDB->notifyObservers(true); } #endif diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 79047cbd8..5630a4ea3 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -407,6 +407,7 @@ NodeDB::NodeDB() #endif } #endif + sortMeshDB(); saveToDisk(saveWhat); } @@ -1000,7 +1001,10 @@ void NodeDB::cleanupMeshDB() meshNodes->at(i).user.public_key.size = 0; } } - meshNodes->at(newPos++) = meshNodes->at(i); + if (newPos != i) + meshNodes->at(newPos++) = meshNodes->at(i); + else + newPos++; } else { removed++; } @@ -1087,8 +1091,8 @@ LoadFileResult NodeDB::loadProto(const char *filename, size_t protoSize, size_t if (f) { LOG_INFO("Load %s", filename); pb_istream_t stream = {&readcb, &f, protoSize}; - - memset(dest_struct, 0, objSize); + if (fields != &meshtastic_NodeDatabase_msg) // contains a vector object + memset(dest_struct, 0, objSize); if (!pb_decode(&stream, fields, dest_struct)) { LOG_ERROR("Error: can't decode protobuf %s", PB_GET_ERROR(&stream)); state = LoadFileResult::DECODE_FAILED; @@ -1156,7 +1160,7 @@ void NodeDB::loadFromDisk() LOG_WARN("Node count %d exceeds MAX_NUM_NODES %d, truncating", numMeshNodes, MAX_NUM_NODES); numMeshNodes = MAX_NUM_NODES; } - meshNodes->resize(MAX_NUM_NODES + 1); // The rp2040, rp2035, and maybe other targets, have a problem doing a sort() when full + meshNodes->resize(MAX_NUM_NODES); // static DeviceState scratch; We no longer read into a tempbuf because this structure is 15KB of valuable RAM state = loadProto(deviceStateFileName, meshtastic_DeviceState_size, sizeof(meshtastic_DeviceState), @@ -1690,26 +1694,48 @@ void NodeDB::updateFrom(const meshtastic_MeshPacket &mp) } } +void NodeDB::set_favorite(bool is_favorite, uint32_t nodeId) +{ + meshtastic_NodeInfoLite *lite = getMeshNode(nodeId); + if (lite && lite->is_favorite != is_favorite) { + lite->is_favorite = is_favorite; + sortMeshDB(); + saveNodeDatabaseToDisk(); + } +} + +void NodeDB::pause_sort(bool paused) +{ + sortingIsPaused = paused; +} + void NodeDB::sortMeshDB() { - if (!Throttle::isWithinTimespanMs(lastSort, 1000 * 5)) { + if (!sortingIsPaused && (lastSort == 0 || !Throttle::isWithinTimespanMs(lastSort, 1000 * 5))) { lastSort = millis(); - std::sort(meshNodes->begin(), meshNodes->begin() + numMeshNodes, - [](const meshtastic_NodeInfoLite &a, const meshtastic_NodeInfoLite &b) { - if (a.num == myNodeInfo.my_node_num && b.num == myNodeInfo.my_node_num) // in theory impossible - return false; - if (a.num == myNodeInfo.my_node_num) { - return true; - } - if (b.num == myNodeInfo.my_node_num) { - return false; - } - bool aFav = a.is_favorite; - bool bFav = b.is_favorite; - if (aFav != bFav) - return aFav; - return a.last_heard > b.last_heard; - }); + bool changed = true; + while (changed) { // dumb reverse bubble sort, but probably not bad for what we're doing + changed = false; + for (int i = numMeshNodes - 1; i > 0; i--) { // lowest case this should examine is i == 1 + if (meshNodes->at(i - 1).num == getNodeNum()) { + // noop + } else if (meshNodes->at(i).num == + getNodeNum()) { // in the oddball case our own node num is not at location 0, put it there + // TODO: Look for at(i-1) also matching own node num, and throw the DB in the trash + std::swap(meshNodes->at(i), meshNodes->at(i - 1)); + changed = true; + } else if (meshNodes->at(i).is_favorite && !meshNodes->at(i - 1).is_favorite) { + std::swap(meshNodes->at(i), meshNodes->at(i - 1)); + changed = true; + } else if (!meshNodes->at(i).is_favorite && meshNodes->at(i - 1).is_favorite) { + // noop + } else if (meshNodes->at(i).last_heard > meshNodes->at(i - 1).last_heard) { + std::swap(meshNodes->at(i), meshNodes->at(i - 1)); + changed = true; + } + } + } + LOG_INFO("Sort took %u milliseconds", millis() - lastSort); } } diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index b6e4d600b..845f42c76 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -191,6 +191,16 @@ class NodeDB */ bool updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelIndex = 0); + /* + * Sets a node either favorite or unfavorite + */ + void set_favorite(bool is_favorite, uint32_t nodeId); + + /** + * Other functions like the node picker can request a pause in the node sorting + */ + void pause_sort(bool paused); + /// @return our node number NodeNum getNodeNum() { return myNodeInfo.my_node_num; } @@ -208,9 +218,6 @@ class NodeDB their denial?) */ - /// pick a provisional nodenum we hope no one is using - void pickNewNodeNum(); - // get channel channel index we heard a nodeNum on, defaults to 0 if not found uint8_t getMeshNodeChannel(NodeNum n); @@ -278,6 +285,14 @@ class NodeDB bool restorePreferences(meshtastic_AdminMessage_BackupLocation location, int restoreWhat = SEGMENT_CONFIG | SEGMENT_MODULECONFIG | SEGMENT_DEVICESTATE | SEGMENT_CHANNELS); + /// Notify observers of changes to the DB + void notifyObservers(bool forceUpdate = false) + { + // Notify observers of the current node state + const meshtastic::NodeStatus status = meshtastic::NodeStatus(getNumOnlineMeshNodes(), getNumMeshNodes(), forceUpdate); + newStatus.notifyObservers(&status); + } + private: bool duplicateWarned = false; uint32_t lastNodeDbSave = 0; // when we last saved our db to flash @@ -286,13 +301,13 @@ class NodeDB /// Find a node in our DB, create an empty NodeInfoLite if missing meshtastic_NodeInfoLite *getOrCreateMeshNode(NodeNum n); - /// Notify observers of changes to the DB - void notifyObservers(bool forceUpdate = false) - { - // Notify observers of the current node state - const meshtastic::NodeStatus status = meshtastic::NodeStatus(getNumOnlineMeshNodes(), getNumMeshNodes(), forceUpdate); - newStatus.notifyObservers(&status); - } + /* + * Internal boolean to track sorting paused + */ + bool sortingIsPaused = false; + + /// pick a provisional nodenum we hope no one is using + void pickNewNodeNum(); /// read our db from flash void loadFromDisk(); diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index aad7f5f06..12a586cd7 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -1190,7 +1190,7 @@ void AdminModule::reboot(int32_t seconds) { LOG_INFO("Reboot in %d seconds", seconds); if (screen) - screen->showOverlayBanner("Rebooting...", 0); // stays on screen + screen->showSimpleBanner("Rebooting...", 0); // stays on screen rebootAtMsec = (seconds < 0) ? 0 : (millis() + seconds * 1000); } diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 4d8d6ce4b..1ab4af02d 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -442,9 +442,13 @@ int CannedMessageModule::handleDestinationSelectionInput(const InputEvent *event return 1; } - // UP - if (isUp && destIndex > 0) { - destIndex--; + if (isUp) { + if (destIndex > 0) { + destIndex--; + } else if (totalEntries > 0) { + destIndex = totalEntries - 1; + } + if ((destIndex / columns) < scrollIndex) scrollIndex = destIndex / columns; else if ((destIndex / columns) >= (scrollIndex + visibleRows)) @@ -454,9 +458,14 @@ int CannedMessageModule::handleDestinationSelectionInput(const InputEvent *event return 1; } - // DOWN - if (isDown && destIndex + 1 < totalEntries) { - destIndex++; + if (isDown) { + if (destIndex + 1 < totalEntries) { + destIndex++; + } else if (totalEntries > 0) { + destIndex = 0; + scrollIndex = 0; + } + if ((destIndex / columns) >= (scrollIndex + visibleRows)) scrollIndex = (destIndex / columns) - visibleRows + 1; diff --git a/src/modules/KeyVerificationModule.cpp b/src/modules/KeyVerificationModule.cpp index c0972c155..408d29126 100644 --- a/src/modules/KeyVerificationModule.cpp +++ b/src/modules/KeyVerificationModule.cpp @@ -59,7 +59,7 @@ bool KeyVerificationModule::handleReceivedProtobuf(const meshtastic_MeshPacket & r->hash1.size == 0) { memcpy(hash2, r->hash2.bytes, 32); if (screen) - screen->showOverlayBanner("Enter Security Number", 30000); + screen->showSimpleBanner("Enter Security Number", 30000); meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); cn->level = meshtastic_LogRecord_Level_WARNING; @@ -82,12 +82,19 @@ bool KeyVerificationModule::handleReceivedProtobuf(const meshtastic_MeshPacket & static const char *optionsArray[] = {"ACCEPT", "REJECT"}; LOG_INFO("Hash1 matches!"); if (screen) { - screen->showOverlayBanner(message, 30000, optionsArray, 2, [=](int selected) { + graphics::BannerOverlayOptions options; + options.message = message; + options.durationMs = 30000; + options.optionsArrayPtr = optionsArray; + options.optionsCount = 2; + options.notificationType = graphics::notificationTypeEnum::selection_picker; + options.bannerCallback = [=](int selected) { if (selected == 0) { auto remoteNodePtr = nodeDB->getMeshNode(currentRemoteNode); remoteNodePtr->bitfield |= NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK; } - }); + }; + screen->showOverlayBanner(options); } meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); cn->level = meshtastic_LogRecord_Level_WARNING; @@ -185,7 +192,7 @@ meshtastic_MeshPacket *KeyVerificationModule::allocReply() responsePacket->pki_encrypted = true; if (screen) { snprintf(message, 25, "Security Number \n%03u %03u", currentSecurityNumber / 1000, currentSecurityNumber % 1000); - screen->showOverlayBanner(message, 30000); + screen->showSimpleBanner(message, 30000); LOG_WARN("%s", message); } meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); @@ -255,7 +262,7 @@ void KeyVerificationModule::processSecurityNumber(uint32_t incomingNumber) sprintf(message, "Verification: \n"); generateVerificationCode(message + 15); // send the toPhone packet if (screen) { - screen->showOverlayBanner(message, 30000); + screen->showSimpleBanner(message, 30000); } meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); cn->level = meshtastic_LogRecord_Level_WARNING; diff --git a/src/modules/SystemCommandsModule.cpp b/src/modules/SystemCommandsModule.cpp index 08c87ec64..ab9439b39 100644 --- a/src/modules/SystemCommandsModule.cpp +++ b/src/modules/SystemCommandsModule.cpp @@ -47,7 +47,7 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event) bool isMuted = externalNotificationModule->getMute(); externalNotificationModule->setMute(!isMuted); IF_SCREEN(graphics::isMuted = !isMuted; if (!isMuted) externalNotificationModule->stopNow(); - screen->showOverlayBanner(isMuted ? "Notifications\nEnabled" : "Notifications\nDisabled", 3000);) + screen->showSimpleBanner(isMuted ? "Notifications\nEnabled" : "Notifications\nDisabled", 3000);) } return 0; // Bluetooth @@ -58,24 +58,24 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event) #if defined(ARDUINO_ARCH_NRF52) if (!config.bluetooth.enabled) { disableBluetooth(); - IF_SCREEN(screen->showOverlayBanner("Bluetooth OFF\nRebooting", 3000)); + IF_SCREEN(screen->showSimpleBanner("Bluetooth OFF\nRebooting", 3000)); rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 2000; } else { - IF_SCREEN(screen->showOverlayBanner("Bluetooth ON\nRebooting", 3000)); + IF_SCREEN(screen->showSimpleBanner("Bluetooth ON\nRebooting", 3000)); rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000; } #else if (!config.bluetooth.enabled) { disableBluetooth(); - IF_SCREEN(screen->showOverlayBanner("Bluetooth OFF", 3000)); + IF_SCREEN(screen->showSimpleBanner("Bluetooth OFF", 3000)); } else { - IF_SCREEN(screen->showOverlayBanner("Bluetooth ON\nRebooting", 3000)); + IF_SCREEN(screen->showSimpleBanner("Bluetooth ON\nRebooting", 3000)); rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000; } #endif return 0; case INPUT_BROKER_MSG_REBOOT: - IF_SCREEN(screen->showOverlayBanner("Rebooting...", 0)); + IF_SCREEN(screen->showSimpleBanner("Rebooting...", 0)); nodeDB->saveToDisk(); rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000; // runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; @@ -92,7 +92,7 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event) gps->toggleGpsMode(); const char *msg = (config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED) ? "GPS Enabled" : "GPS Disabled"; - IF_SCREEN(screen->forceDisplay(); screen->showOverlayBanner(msg, 3000);) + IF_SCREEN(screen->forceDisplay(); screen->showSimpleBanner(msg, 3000);) } #endif return true; @@ -100,15 +100,15 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event) case INPUT_BROKER_SEND_PING: service->refreshLocalMeshNode(); if (service->trySendPosition(NODENUM_BROADCAST, true)) { - IF_SCREEN(screen->showOverlayBanner("Position\nSent", 3000)); + IF_SCREEN(screen->showSimpleBanner("Position\nSent", 3000)); } else { - IF_SCREEN(screen->showOverlayBanner("Node Info\nSent", 3000)); + IF_SCREEN(screen->showSimpleBanner("Node Info\nSent", 3000)); } return true; // Power control case INPUT_BROKER_SHUTDOWN: LOG_ERROR("Shutting Down"); - IF_SCREEN(screen->showOverlayBanner("Shutting Down...")); + IF_SCREEN(screen->showSimpleBanner("Shutting Down...")); nodeDB->saveToDisk(); shutdownAtMsec = millis() + DEFAULT_SHUTDOWN_SECONDS * 1000; // runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index 46a24a816..d1b10fa82 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -450,7 +450,7 @@ void EnvironmentTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiSt if (isOwnTelemetry && bannerMsg && isCooldownOver) { LOG_INFO("drawFrame: IAQ %d (own) — showing banner: %s", m.iaq, bannerMsg); - screen->showOverlayBanner(bannerMsg, 3000); + screen->showSimpleBanner(bannerMsg, 3000); // Only buzz if IAQ is over 200 if (m.iaq > 200 && moduleConfig.external_notification.enabled && !externalNotificationModule->getMute()) { diff --git a/src/modules/WaypointModule.cpp b/src/modules/WaypointModule.cpp index cab668406..aab3ed6bc 100644 --- a/src/modules/WaypointModule.cpp +++ b/src/modules/WaypointModule.cpp @@ -137,7 +137,7 @@ void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, if (ourNode && (nodeDB->hasValidPosition(ourNode) || screen->hasHeading())) { const meshtastic_PositionLite &op = ourNode->position; float myHeading; - if (screen->ignoreCompass) { + if (uiconfig.compass_mode == meshtastic_CompassMode_FREEZE_HEADING) { myHeading = 0; } else { if (screen->hasHeading()) @@ -152,7 +152,7 @@ void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, GeoCoord::bearing(DegD(op.latitude_i), DegD(op.longitude_i), DegD(wp.latitude_i), DegD(wp.longitude_i)); // If the top of the compass is a static north then bearingToOther can be drawn on the compass directly // If the top of the compass is not a static north we need adjust bearingToOther based on heading - if (!screen->ignoreCompass) + if (uiconfig.compass_mode != meshtastic_CompassMode_FREEZE_HEADING) bearingToOther -= myHeading; graphics::CompassRenderer::drawNodeHeading(display, compassX, compassY, compassDiam, bearingToOther); diff --git a/src/nimble/NimbleBluetooth.cpp b/src/nimble/NimbleBluetooth.cpp index 3ab06695b..8f53c9229 100644 --- a/src/nimble/NimbleBluetooth.cpp +++ b/src/nimble/NimbleBluetooth.cpp @@ -9,6 +9,7 @@ #include "mesh/mesh-pb-constants.h" #include "sleep.h" #include +#include NimBLECharacteristic *fromNumCharacteristic; NimBLECharacteristic *BatteryCharacteristic; @@ -17,8 +18,36 @@ NimBLEServer *bleServer; static bool passkeyShowing; -class BluetoothPhoneAPI : public PhoneAPI +class BluetoothPhoneAPI : public PhoneAPI, public concurrency::OSThread { + public: + BluetoothPhoneAPI() : concurrency::OSThread("NimbleBluetooth") { nimble_queue.resize(3); } + std::vector nimble_queue; + std::mutex nimble_mutex; + uint8_t queue_size = 0; + bool has_fromRadio = false; + uint8_t fromRadioBytes[meshtastic_FromRadio_size] = {0}; + size_t numBytes = 0; + bool hasChecked = false; + + protected: + virtual int32_t runOnce() override + { + std::lock_guard guard(nimble_mutex); + if (queue_size > 0) { + for (uint8_t i = 0; i < queue_size; i++) { + handleToRadio(nimble_queue.at(i).data(), nimble_queue.at(i).length()); + } + LOG_WARN("Queue_size %u", queue_size); + queue_size = 0; + } + if (hasChecked == false) { + numBytes = getFromRadio(fromRadioBytes); + hasChecked = true; + } + + return 100; + } /** * Subclasses can use this as a hook to provide custom notifications for their transport (i.e. bluetooth notifies) */ @@ -51,15 +80,16 @@ class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks { virtual void onWrite(NimBLECharacteristic *pCharacteristic) { - LOG_DEBUG("To Radio onwrite"); auto val = pCharacteristic->getValue(); if (memcmp(lastToRadio, val.data(), val.length()) != 0) { - LOG_DEBUG("New ToRadio packet"); - memcpy(lastToRadio, val.data(), val.length()); - bluetoothPhoneAPI->handleToRadio(val.data(), val.length()); - } else { - LOG_DEBUG("Drop dup ToRadio packet we just saw"); + if (bluetoothPhoneAPI->queue_size < 3) { + memcpy(lastToRadio, val.data(), val.length()); + std::lock_guard guard(bluetoothPhoneAPI->nimble_mutex); + bluetoothPhoneAPI->nimble_queue.at(bluetoothPhoneAPI->queue_size) = val; + bluetoothPhoneAPI->queue_size++; + bluetoothPhoneAPI->setIntervalFromNow(0); + } } } }; @@ -68,12 +98,19 @@ class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks { virtual void onRead(NimBLECharacteristic *pCharacteristic) { - uint8_t fromRadioBytes[meshtastic_FromRadio_size]; - size_t numBytes = bluetoothPhoneAPI->getFromRadio(fromRadioBytes); - - std::string fromRadioByteString(fromRadioBytes, fromRadioBytes + numBytes); - + while (!bluetoothPhoneAPI->hasChecked) { + bluetoothPhoneAPI->setIntervalFromNow(0); + delay(20); + } + std::lock_guard guard(bluetoothPhoneAPI->nimble_mutex); + std::string fromRadioByteString(bluetoothPhoneAPI->fromRadioBytes, + bluetoothPhoneAPI->fromRadioBytes + bluetoothPhoneAPI->numBytes); pCharacteristic->setValue(fromRadioByteString); + + if (bluetoothPhoneAPI->numBytes != 0) // if we did send something, queue it up right away to reload + bluetoothPhoneAPI->setIntervalFromNow(0); + bluetoothPhoneAPI->numBytes = 0; + bluetoothPhoneAPI->hasChecked = false; } }; diff --git a/src/shutdown.h b/src/shutdown.h index 998944677..7e2120149 100644 --- a/src/shutdown.h +++ b/src/shutdown.h @@ -42,7 +42,7 @@ void powerCommandsCheck() #if defined(ARCH_ESP32) || defined(ARCH_NRF52) if (shutdownAtMsec && screen) { - screen->showOverlayBanner("Shutting Down...", 0); // stays on screen + screen->showSimpleBanner("Shutting Down...", 0); // stays on screen } #endif diff --git a/variants/heltec_mesh_node_t114/variant.h b/variants/heltec_mesh_node_t114/variant.h index 798c3538a..f4f0baf13 100644 --- a/variants/heltec_mesh_node_t114/variant.h +++ b/variants/heltec_mesh_node_t114/variant.h @@ -57,6 +57,9 @@ extern "C" { #define TFT_OFFSET_X 0 #define TFT_OFFSET_Y 0 +// T114 gets a muted yellow on black display +#define TFT_MESH_OVERRIDE COLOR565(255, 255, 128) + // #define TFT_OFFSET_ROTATION 0 // #define SCREEN_ROTATE // #define SCREEN_TRANSITION_FRAMERATE 5 diff --git a/variants/picomputer-s3/variant.h b/variants/picomputer-s3/variant.h index ff8faa6f4..8252e841c 100644 --- a/variants/picomputer-s3/variant.h +++ b/variants/picomputer-s3/variant.h @@ -49,7 +49,7 @@ #define SCREEN_TRANSITION_FRAMERATE 5 // Picomputer gets a white on black display -#define TFT_MESH COLOR565(0xFF, 0xFF, 0xFF) +#define TFT_MESH_OVERRIDE COLOR565(255, 255, 255) #define CANNED_MESSAGE_MODULE_ENABLE 1 diff --git a/variants/tracksenger/internal/variant.h b/variants/tracksenger/internal/variant.h index 57ead848d..6f75ad0e2 100644 --- a/variants/tracksenger/internal/variant.h +++ b/variants/tracksenger/internal/variant.h @@ -72,7 +72,7 @@ #define SX126X_DIO3_TCXO_VOLTAGE 1.8 // Picomputer gets a white on black display -#define TFT_MESH COLOR565(0xFF, 0xFF, 0xFF) +#define TFT_MESH_OVERRIDE COLOR565(255, 255, 255) // keyboard changes diff --git a/variants/tracksenger/lcd/variant.h b/variants/tracksenger/lcd/variant.h index ecf4e854e..843bf3924 100644 --- a/variants/tracksenger/lcd/variant.h +++ b/variants/tracksenger/lcd/variant.h @@ -96,7 +96,7 @@ #define SX126X_DIO3_TCXO_VOLTAGE 1.8 // Picomputer gets a white on black display -#define TFT_MESH COLOR565(0xFF, 0xFF, 0xFF) +#define TFT_MESH_OVERRIDE COLOR565(255, 255, 255) // keyboard changes diff --git a/variants/tracksenger/oled/variant.h b/variants/tracksenger/oled/variant.h index 70f0f3209..85cc019c4 100644 --- a/variants/tracksenger/oled/variant.h +++ b/variants/tracksenger/oled/variant.h @@ -74,7 +74,7 @@ #define SX126X_DIO3_TCXO_VOLTAGE 1.8 // Picomputer gets a white on black display -#define TFT_MESH COLOR565(0xFF, 0xFF, 0xFF) +#define TFT_MESH_OVERRIDE COLOR565(255, 255, 255) // keyboard changes From 409dfe22aea40b58a5702ff5e4bf9947e53fa848 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 2 Jul 2025 20:58:15 -0500 Subject: [PATCH 388/461] Fix Seeed L1 board to enable consistent PIO flashing (#7211) --- boards/seeed_wio_tracker_L1.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/boards/seeed_wio_tracker_L1.json b/boards/seeed_wio_tracker_L1.json index 7c7bc62fa..e2bb93573 100644 --- a/boards/seeed_wio_tracker_L1.json +++ b/boards/seeed_wio_tracker_L1.json @@ -7,7 +7,10 @@ "cpu": "cortex-m4", "extra_flags": "-DARDUINO_MDBT50Q_RX -DNRF52840_XXAA", "f_cpu": "64000000L", - "hwids": [["0x2886", "0x1668"]], + "hwids": [ + ["0x2886", "0x1668"], + ["0x2886", "0x1667"] + ], "usb_product": "TRACKER L1", "mcu": "nrf52840", "variant": "seeed_wio_tracker_L1", From 549250b91a6e21c480ade3f6b711e662abaebd6d Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 2 Jul 2025 22:39:29 -0500 Subject: [PATCH 389/461] Good bot -- make array large enough to handle all the possible options --- src/graphics/draw/MenuHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 3681532bb..8995eb4cd 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -352,8 +352,8 @@ void menuHandler::systemBaseMenu() #endif enum optionsNumbers { Back, Beeps, Brightness, Reboot, Color, MUI, Test }; - static const char *optionsArray[6] = {"Back"}; - static int optionsEnumArray[6] = {Back}; + static const char *optionsArray[7] = {"Back"}; + static int optionsEnumArray[7] = {Back}; int options = 1; optionsArray[options] = "Beeps Action"; From 81828c6244daede254cf759a0f2bd939b2e7dd65 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 2 Jul 2025 23:52:55 -0500 Subject: [PATCH 390/461] Don't set non-existent pin on e290 (#7213) * Don't set non-existent pin on e290 * Don't twiddle imaginary pins on the e213, either --- src/graphics/draw/MenuHandler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 8995eb4cd..92954bf2e 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -633,8 +633,7 @@ void menuHandler::BrightnessPickerMenu() if (selected != 0) { // Not "Back" // Apply brightness immediately -#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || defined(HELTEC_VISION_MASTER_E213) || \ - defined(HELTEC_VISION_MASTER_E290) +#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) // For HELTEC devices, use analogWrite to control backlight analogWrite(VTFT_LEDA, uiconfig.screen_brightness); #elif defined(ST7789_CS) From b02e58521dc967b3664e0176bedbf88673cd43ea Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 3 Jul 2025 06:53:27 -0500 Subject: [PATCH 391/461] Add GPIO edge for Native Trackball/Joystick (#7212) Co-authored-by: Ben Meadors --- bin/config.d/display-waveshare-1-44.yaml | 2 +- src/input/TrackballInterruptBase.h | 5 +++++ src/platform/portduino/PortduinoGlue.cpp | 5 +++++ src/platform/portduino/PortduinoGlue.h | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/config.d/display-waveshare-1-44.yaml b/bin/config.d/display-waveshare-1-44.yaml index 1d85a4a3b..d37f6cf6a 100644 --- a/bin/config.d/display-waveshare-1-44.yaml +++ b/bin/config.d/display-waveshare-1-44.yaml @@ -22,5 +22,5 @@ Input: TrackballLeft: 5 TrackballRight: 26 TrackballPress: 13 - + TrackballDirection: FALLING # User: 21 diff --git a/src/input/TrackballInterruptBase.h b/src/input/TrackballInterruptBase.h index 2397839b9..92db8720e 100644 --- a/src/input/TrackballInterruptBase.h +++ b/src/input/TrackballInterruptBase.h @@ -4,8 +4,13 @@ #include "mesh/NodeDB.h" #ifndef TB_DIRECTION +#if ARCH_PORTDUINO +#include "PortduinoGlue.h" +#define TB_DIRECTION (PinStatus) settingsMap[tbDirection] +#else #define TB_DIRECTION RISING #endif +#endif class TrackballInterruptBase : public Observable, public concurrency::OSThread { diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index f582a116d..49d1acb4c 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -642,6 +642,11 @@ bool loadConfig(const char *configPath) settingsMap[tbLeftPin] = yamlConfig["Input"]["TrackballLeft"].as(RADIOLIB_NC); settingsMap[tbRightPin] = yamlConfig["Input"]["TrackballRight"].as(RADIOLIB_NC); settingsMap[tbPressPin] = yamlConfig["Input"]["TrackballPress"].as(RADIOLIB_NC); + if (yamlConfig["Input"]["TrackballDirection"].as("RISING") == "RISING") { + settingsMap[tbDirection] = 4; + } else if (yamlConfig["Input"]["TrackballDirection"].as("RISING") == "FALLING") { + settingsMap[tbDirection] = 3; + } } if (yamlConfig["Webserver"]) { diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index 5795f0d8d..e404b7f1c 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -63,6 +63,7 @@ enum configNames { tbLeftPin, tbRightPin, tbPressPin, + tbDirection, spidev, spiSpeed, i2cdev, From 6fa597bc5d80b7f54ac5880727da18e1856744a7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 08:17:42 -0500 Subject: [PATCH 392/461] [create-pull-request] automated change (#7216) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/config.pb.h | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/protobufs b/protobufs index 386fa53c1..584f0a3a3 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 386fa53c1596c8dfc547521f08df107f4cb3a275 +Subproject commit 584f0a3a359103acf0bfce506c1b1fc32c639841 diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index ed1849be8..f28daadbd 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -285,7 +285,11 @@ typedef enum _meshtastic_Config_LoRaConfig_RegionCode { /* Philippines 915mhz */ meshtastic_Config_LoRaConfig_RegionCode_PH_915 = 21, /* Australia / New Zealand 433MHz */ - meshtastic_Config_LoRaConfig_RegionCode_ANZ_433 = 22 + meshtastic_Config_LoRaConfig_RegionCode_ANZ_433 = 22, + /* Kazakhstan 433MHz */ + meshtastic_Config_LoRaConfig_RegionCode_KZ_433 = 23, + /* Kazakhstan 863MHz */ + meshtastic_Config_LoRaConfig_RegionCode_KZ_863 = 24 } meshtastic_Config_LoRaConfig_RegionCode; /* Standard predefined channel settings @@ -681,8 +685,8 @@ extern "C" { #define _meshtastic_Config_DisplayConfig_CompassOrientation_ARRAYSIZE ((meshtastic_Config_DisplayConfig_CompassOrientation)(meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270_INVERTED+1)) #define _meshtastic_Config_LoRaConfig_RegionCode_MIN meshtastic_Config_LoRaConfig_RegionCode_UNSET -#define _meshtastic_Config_LoRaConfig_RegionCode_MAX meshtastic_Config_LoRaConfig_RegionCode_ANZ_433 -#define _meshtastic_Config_LoRaConfig_RegionCode_ARRAYSIZE ((meshtastic_Config_LoRaConfig_RegionCode)(meshtastic_Config_LoRaConfig_RegionCode_ANZ_433+1)) +#define _meshtastic_Config_LoRaConfig_RegionCode_MAX meshtastic_Config_LoRaConfig_RegionCode_KZ_863 +#define _meshtastic_Config_LoRaConfig_RegionCode_ARRAYSIZE ((meshtastic_Config_LoRaConfig_RegionCode)(meshtastic_Config_LoRaConfig_RegionCode_KZ_863+1)) #define _meshtastic_Config_LoRaConfig_ModemPreset_MIN meshtastic_Config_LoRaConfig_ModemPreset_LONG_FAST #define _meshtastic_Config_LoRaConfig_ModemPreset_MAX meshtastic_Config_LoRaConfig_ModemPreset_SHORT_TURBO From f2d3f548242c80dd460924d3da64dee425f759df Mon Sep 17 00:00:00 2001 From: Austin Date: Thu, 3 Jul 2025 16:10:35 -0400 Subject: [PATCH 393/461] No routers allowed! (#7220) --- src/modules/AdminModule.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 12a586cd7..0ba0e1164 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -630,6 +630,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) #if USERPREFS_EVENT_MODE // If we're in event mode, nobody is a Router or Repeater if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER || + config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER_LATE || config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) { config.device.role = meshtastic_Config_DeviceConfig_Role_CLIENT; } From 2254d551f4afb8ba1196eed125ec98ff5e3a64b6 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Fri, 4 Jul 2025 08:40:43 +1200 Subject: [PATCH 394/461] Honor custom userPrefs boot-screens in InkHUD (#7217) * Honor custom boot screen from userPrefs.jsonc * Meshtastic logo when powered off, userPrefs logo at boot --------- Co-authored-by: Ben Meadors --- .../InkHUD/Applets/System/Logo/LogoApplet.cpp | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp index 858b1e132..ecaa7cea3 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Logo/LogoApplet.cpp @@ -52,6 +52,40 @@ void InkHUD::LogoApplet::onRender() setTextColor(WHITE); } +#ifdef USERPREFS_OEM_IMAGE_DATA // Custom boot screen, if defined in userPrefs.jsonc + + // Only show the custom screen at startup + // This allows us to draw the usual Meshtastic logo at shutdown + // The effect is similar to the two-stage userPrefs boot screen used by BaseUI + if (millis() < 10 * 1000UL) { + + // Draw the custom logo + const uint8_t logo[] = USERPREFS_OEM_IMAGE_DATA; + drawXBitmap(logoCX - (USERPREFS_OEM_IMAGE_WIDTH / 2), // Left + logoCY - (USERPREFS_OEM_IMAGE_HEIGHT / 2), // Top + logo, // XBM data + USERPREFS_OEM_IMAGE_WIDTH, // Width + USERPREFS_OEM_IMAGE_HEIGHT, // Height + inverted ? WHITE : BLACK // Color + ); + + // Select the largest font which will still comfortably fit the custom text + setFont(fontLarge); + if (getTextWidth(USERPREFS_OEM_TEXT) > 0.8 * width()) + setFont(fontMedium); + if (getTextWidth(USERPREFS_OEM_TEXT) > 0.8 * width()) + setFont(fontSmall); + + // Draw custom text below logo + int16_t logoB = logoCY + (USERPREFS_OEM_IMAGE_HEIGHT / 2); // Bottom of the logo + printAt(X(0.5), logoB + Y(0.1), USERPREFS_OEM_TEXT, CENTER, TOP); + + // Don't draw the normal boot screen, we've already drawn our custom version + return; + } + +#endif + drawLogo(logoCX, logoCY, logoW, logoH, inverted ? WHITE : BLACK); if (!textLeft.empty()) { From 93132fad284464adfc3129eb912aaa7827ad348a Mon Sep 17 00:00:00 2001 From: Jason P Date: Thu, 3 Jul 2025 17:20:51 -0500 Subject: [PATCH 395/461] Battery Layout Updates and Icons Changes (#7221) * Testing battery states with some info lines in the drawCommonHeader * Update logic of USB connected, update images for states * Tweak battery layout for isHighResolution * Hide the magic 101% * Adjust padding for SENSECAP_INDICATOR * Excessive logs are unnecessary as troubleshooting is done. * Reduce excess code - simplify readability * Restore Lightning Bolt for Charging and related alignment issues --------- Co-authored-by: Jonathan Bennett --- src/graphics/SharedUIDisplay.cpp | 94 ++++++++++++++++++----------- src/graphics/draw/ClockRenderer.cpp | 3 + src/graphics/images.h | 5 +- 3 files changed, 65 insertions(+), 37 deletions(-) diff --git a/src/graphics/SharedUIDisplay.cpp b/src/graphics/SharedUIDisplay.cpp index 9f2422748..7cd876ac5 100644 --- a/src/graphics/SharedUIDisplay.cpp +++ b/src/graphics/SharedUIDisplay.cpp @@ -99,10 +99,17 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti // === Battery State === int chargePercent = powerStatus->getBatteryChargePercent(); - bool isCharging = powerStatus->getIsCharging() == meshtastic::OptionalBool::OptTrue; - if (chargePercent == 100) { + bool isCharging = powerStatus->getIsCharging(); + bool usbPowered = powerStatus->getHasUSB(); + + if (chargePercent >= 100) { isCharging = false; } + if (chargePercent == 101) { + usbPowered = true; // Forcing this flag on for the express purpose that some devices have no concept of having a USB cable + // plugged in + } + uint32_t now = millis(); #ifndef USE_EINK @@ -115,48 +122,63 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti bool useHorizontalBattery = (isHighResolution && screenW >= screenH); const int textY = y + (highlightHeight - FONT_HEIGHT_SMALL) / 2; + int batteryX = 1; + int batteryY = HEADER_OFFSET_Y + 1; + // === Battery Icons === - if (useHorizontalBattery) { - int batteryX = 2; - int batteryY = HEADER_OFFSET_Y + 3; - display->drawXbm(batteryX, batteryY, 9, 13, batteryBitmap_h_bottom); - display->drawXbm(batteryX + 9, batteryY, 9, 13, batteryBitmap_h_top); - if (isCharging && isBoltVisibleShared) - display->drawXbm(batteryX + 4, batteryY, 9, 13, lightning_bolt_h); - else { - display->drawLine(batteryX + 5, batteryY, batteryX + 10, batteryY); - display->drawLine(batteryX + 5, batteryY + 12, batteryX + 10, batteryY + 12); - int fillWidth = 14 * chargePercent / 100; - display->fillRect(batteryX + 1, batteryY + 1, fillWidth, 11); + if (usbPowered && !isCharging) { // This is a basic check to determine USB Powered is flagged but not charging + batteryX += 1; + batteryY += 2; + if (isHighResolution) { + display->drawXbm(batteryX, batteryY, 19, 12, imgUSB_HighResolution); + batteryX += 20; // Icon + 1 pixel + } else { + display->drawXbm(batteryX, batteryY, 10, 8, imgUSB); + batteryX += 11; // Icon + 1 pixel } } else { - int batteryX = 1; - int batteryY = HEADER_OFFSET_Y + 1; + if (useHorizontalBattery) { + batteryX += 1; + batteryY += 2; + display->drawXbm(batteryX, batteryY, 9, 13, batteryBitmap_h_bottom); + display->drawXbm(batteryX + 9, batteryY, 9, 13, batteryBitmap_h_top); + if (isCharging && isBoltVisibleShared) + display->drawXbm(batteryX + 4, batteryY, 9, 13, lightning_bolt_h); + else { + display->drawLine(batteryX + 5, batteryY, batteryX + 10, batteryY); + display->drawLine(batteryX + 5, batteryY + 12, batteryX + 10, batteryY + 12); + int fillWidth = 14 * chargePercent / 100; + display->fillRect(batteryX + 1, batteryY + 1, fillWidth, 11); + } + batteryX += 18; // Icon + 2 pixels + } else { #ifdef USE_EINK - batteryY += 2; + batteryY += 2; #endif - display->drawXbm(batteryX, batteryY, 7, 11, batteryBitmap_v); - if (isCharging && isBoltVisibleShared) - display->drawXbm(batteryX + 1, batteryY + 3, 5, 5, lightning_bolt_v); - else { - display->drawXbm(batteryX - 1, batteryY + 4, 8, 3, batteryBitmap_sidegaps_v); - int fillHeight = 8 * chargePercent / 100; - int fillY = batteryY - fillHeight; - display->fillRect(batteryX + 1, fillY + 10, 5, fillHeight); + display->drawXbm(batteryX, batteryY, 7, 11, batteryBitmap_v); + if (isCharging && isBoltVisibleShared) + display->drawXbm(batteryX + 1, batteryY + 3, 5, 5, lightning_bolt_v); + else { + display->drawXbm(batteryX - 1, batteryY + 4, 8, 3, batteryBitmap_sidegaps_v); + int fillHeight = 8 * chargePercent / 100; + int fillY = batteryY - fillHeight; + display->fillRect(batteryX + 1, fillY + 10, 5, fillHeight); + } + batteryX += 9; // Icon + 2 pixels } } - // === Battery % Display === - char chargeStr[4]; - snprintf(chargeStr, sizeof(chargeStr), "%d", chargePercent); - int chargeNumWidth = display->getStringWidth(chargeStr); - const int batteryOffset = useHorizontalBattery ? 19 : 9; - const int percentX = x + batteryOffset; - display->drawString(percentX, textY, chargeStr); - display->drawString(percentX + chargeNumWidth - 1, textY, "%"); - if (isBold) { - display->drawString(percentX + 1, textY, chargeStr); - display->drawString(percentX + chargeNumWidth, textY, "%"); + if (chargePercent != 101) { + // === Battery % Display === + char chargeStr[4]; + snprintf(chargeStr, sizeof(chargeStr), "%d", chargePercent); + int chargeNumWidth = display->getStringWidth(chargeStr); + display->drawString(batteryX, textY, chargeStr); + display->drawString(batteryX + chargeNumWidth - 1, textY, "%"); + if (isBold) { + display->drawString(batteryX + 1, textY, chargeStr); + display->drawString(batteryX + chargeNumWidth, textY, "%"); + } } // === Time and Right-aligned Icons === diff --git a/src/graphics/draw/ClockRenderer.cpp b/src/graphics/draw/ClockRenderer.cpp index 7ccb1c03c..8d7e91000 100644 --- a/src/graphics/draw/ClockRenderer.cpp +++ b/src/graphics/draw/ClockRenderer.cpp @@ -283,6 +283,9 @@ void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int1 xOffset += (isHighResolution) ? 32 : 18; } int yOffset = (isHighResolution) ? 3 : 1; +#ifdef SENSECAP_INDICATOR + yOffset -= 3; +#endif if (config.display.use_12h_clock) { display->drawString(startingHourMinuteTextX + xOffset, (display->getHeight() - hourMinuteTextY) - yOffset - 2, isPM ? "pm" : "am"); diff --git a/src/graphics/images.h b/src/graphics/images.h index c5865878a..beef3a1b2 100644 --- a/src/graphics/images.h +++ b/src/graphics/images.h @@ -12,7 +12,10 @@ const uint8_t imgSatellite[] PROGMEM = { 0b00000000, 0b00000000, 0b00000000, 0b00011000, 0b11011011, 0b11111111, 0b11011011, 0b00011000, }; -const uint8_t imgUSB[] PROGMEM = {0x60, 0x60, 0x30, 0x18, 0x18, 0x18, 0x24, 0x42, 0x42, 0x42, 0x42, 0x7E, 0x24, 0x24, 0x24, 0x3C}; +const uint8_t imgUSB[] PROGMEM = {0x00, 0xfc, 0xf0, 0xfc, 0x88, 0xff, 0x86, 0xfe, 0x85, 0xfe, 0x89, 0xff, 0xf1, 0xfc, 0x00, 0xfc}; +const uint8_t imgUSB_HighResolution[] PROGMEM = {0x00, 0x3e, 0xf8, 0x80, 0x43, 0xf8, 0xc0, 0xc2, 0xff, 0x60, 0x42, 0xfc, + 0x3c, 0xc2, 0xff, 0x22, 0x42, 0xf8, 0x3d, 0x42, 0xf8, 0x22, 0xc2, 0xff, + 0x61, 0x42, 0xfc, 0xc0, 0xc2, 0xff, 0x80, 0x43, 0xf8, 0x00, 0x3e, 0xf8}; const uint8_t imgPower[] PROGMEM = {0x40, 0x40, 0x40, 0x58, 0x48, 0x08, 0x08, 0x08, 0x1C, 0x22, 0x22, 0x41, 0x7F, 0x22, 0x22, 0x22}; const uint8_t imgUser[] PROGMEM = {0x3C, 0x42, 0x99, 0xA5, 0xA5, 0x99, 0x42, 0x3C}; From c1431f4f9ad090cd670edaf56b3600403aa4408d Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 3 Jul 2025 18:34:04 -0500 Subject: [PATCH 396/461] Disable low brightness, as this soft-bricks at least the L1 (#7223) --- src/graphics/draw/MenuHandler.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 92954bf2e..6dbba853e 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -602,32 +602,28 @@ void menuHandler::BuzzerModeMenu() void menuHandler::BrightnessPickerMenu() { - static const char *optionsArray[] = {"Back", "Low", "Medium", "High", "Very High"}; + static const char *optionsArray[] = {"Back", "Low", "Medium", "High"}; // Get current brightness level to set initial selection - int currentSelection = 1; // Default to Low + int currentSelection = 1; // Default to Medium if (uiconfig.screen_brightness >= 255) { - currentSelection = 4; // Very High + currentSelection = 3; // Very High } else if (uiconfig.screen_brightness >= 128) { - currentSelection = 3; // High - } else if (uiconfig.screen_brightness >= 64) { - currentSelection = 2; // Medium + currentSelection = 2; // High } else { - currentSelection = 1; // Low + currentSelection = 1; // Medium } BannerOverlayOptions bannerOptions; bannerOptions.message = "Brightness"; bannerOptions.optionsArrayPtr = optionsArray; - bannerOptions.optionsCount = 5; + bannerOptions.optionsCount = 4; bannerOptions.bannerCallback = [](int selected) -> void { - if (selected == 1) { // Low - uiconfig.screen_brightness = 1; - } else if (selected == 2) { // Medium + if (selected == 1) { // Medium uiconfig.screen_brightness = 64; - } else if (selected == 3) { // High + } else if (selected == 2) { // High uiconfig.screen_brightness = 128; - } else if (selected == 4) { // Very High + } else if (selected == 3) { // Very High uiconfig.screen_brightness = 255; } From f13dc5b903067b2d10d85217524b8690946ea68c Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Fri, 4 Jul 2025 07:34:46 +0800 Subject: [PATCH 397/461] Add Kazakhstan frequencies (#7209) As reported by @KZ1R , Kazakhstan has frequencies in use for Lora devices that are not covered by our existing band selections. This adds * KZ_433 433.075 - 434.775 MHz <10 mW EIRP, Low Powered Devices (LPD) * KZ_863 863 - 868 MHz <25 mW EIRP, 500kHz channels allowed, must not be used at airfields Legal ref provided in https://github.com/meshtastic/firmware/issues/7204 and verified. https://www.gov.kz/memleket/entities/mdai/press/article/details/6128 Order of the Ministry of Investments and Development of the Republic of Kazakhstan No. 34 dated January 21, 2015. Published on 01 July 2024 19:03 Updated on 01 July 2024 Fixes https://github.com/meshtastic/firmware/issues/7204 --- src/mesh/RadioInterface.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 4db05b4d4..3632378a5 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -161,6 +161,14 @@ const RegionInfo regions[] = { RDEF(PH_433, 433.0f, 434.7f, 100, 0, 10, true, false, false), RDEF(PH_868, 868.0f, 869.4f, 100, 0, 14, true, false, false), RDEF(PH_915, 915.0f, 918.0f, 100, 0, 24, true, false, false), + /* + Kazakhstan + 433.075 - 434.775 MHz <10 mW EIRP, Low Powered Devices (LPD) + 863 - 868 MHz <25 mW EIRP, 500kHz channels allowed, must not be used at airfields + https://github.com/meshtastic/firmware/issues/7204 + */ + RDEF(KZ_433, 433.075f, 434.775f, 100, 0, 10, true, false, false), RDEF(KZ_863, 863.0f, 868.0f, 100, 0, 30, true, false, true), + /* 2.4 GHZ WLAN Band equivalent. Only for SX128x chips. */ @@ -681,4 +689,4 @@ size_t RadioInterface::beginSending(meshtastic_MeshPacket *p) sendingPacket = p; return p->encrypted.size + sizeof(PacketHeader); -} \ No newline at end of file +} From ff4eed08bcb5c0f99fbb8fbcd443d3896e08547a Mon Sep 17 00:00:00 2001 From: Matt Smith Date: Thu, 3 Jul 2025 20:41:17 -0400 Subject: [PATCH 398/461] Fixed --change-mode option since it was broken (#7144) getopts can't parse double-dash options so it had to be done separately. Also fixed where CHANGE_MODE was checked since it wasn't working either. --- bin/device-update.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/bin/device-update.sh b/bin/device-update.sh index 6adfe4e0e..2a39cdef7 100755 --- a/bin/device-update.sh +++ b/bin/device-update.sh @@ -30,6 +30,18 @@ Flash image file to device, leave existing system intact." EOF } +# Check for --change-mode and remove it from arguments +NEW_ARGS="" +for arg in "$@"; do + if [ "$arg" = "--change-mode" ]; then + CHANGE_MODE=true + else + NEW_ARGS="$NEW_ARGS \"\$arg\"" + fi +done + +# Reset positional parameters to filtered list +eval set -- $NEW_ARGS while getopts ":hp:P:f:" opt; do case "${opt}" in @@ -43,9 +55,6 @@ while getopts ":hp:P:f:" opt; do ;; f) FILENAME=${OPTARG} ;; - --change-mode) - CHANGE_MODE=true - ;; *) echo "Invalid flag." show_help >&2 @@ -55,7 +64,7 @@ while getopts ":hp:P:f:" opt; do done shift "$((OPTIND-1))" -if [[ $CHANGE_MODE == true ]]; then +if [ "$CHANGE_MODE" = true ]; then $ESPTOOL_CMD --baud 1200 --after no_reset read_flash_status exit 0 fi From dfb07e8bd2d8a1b8fe4bb03bba460fa3503a7f7b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 20:16:53 -0500 Subject: [PATCH 399/461] chore(deps): update meshtastic-esp32_https_server digest to 3223704 (#7225) --- arch/esp32/esp32.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index cba84181b..faeca342f 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -49,7 +49,7 @@ lib_deps = ${environmental_extra.lib_deps} ${radiolib_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master - https://github.com/meshtastic/esp32_https_server/archive/896f1771ceb5979987a0b41028bf1b4e7aad419b.zip + https://github.com/meshtastic/esp32_https_server/archive/3223704846752e6d545139204837bdb2a55459ca.zip # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino h2zero/NimBLE-Arduino@^1.4.3 # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master From 0f96bd7a26e5a435e90f03492d934121346cf5d2 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 3 Jul 2025 21:31:09 -0500 Subject: [PATCH 400/461] Add Kazakhstan to the BaseUI LoRa chooser (#7224) --- src/graphics/draw/MenuHandler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 6dbba853e..7e5063fef 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -48,12 +48,14 @@ void menuHandler::LoraRegionPicker(uint32_t duration) "PH_433", "PH_868", "PH_915", - "ANZ_433"}; + "ANZ_433", + "KZ_433", + "KZ_863"}; BannerOverlayOptions bannerOptions; bannerOptions.message = "Set the LoRa region"; bannerOptions.durationMs = duration; bannerOptions.optionsArrayPtr = optionsArray; - bannerOptions.optionsCount = 23; + bannerOptions.optionsCount = 25; bannerOptions.InitialSelected = 0; bannerOptions.bannerCallback = [](int selected) -> void { if (selected != 0 && config.lora.region != _meshtastic_Config_LoRaConfig_RegionCode(selected)) { From abbeb4874d6dcf983f298554c4a40f0874f2d634 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 4 Jul 2025 13:12:24 +0800 Subject: [PATCH 401/461] chore(deps): update xpowerslib to v0.3.0 (#7210) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/esp32/esp32.ini | 2 +- arch/esp32/esp32c6.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index faeca342f..6b9ebcb24 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -55,7 +55,7 @@ lib_deps = # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib - lewisxhe/XPowersLib@^0.2.7 + lewisxhe/XPowersLib@0.3.0 # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto diff --git a/arch/esp32/esp32c6.ini b/arch/esp32/esp32c6.ini index 26b5c0f5b..1afb9b547 100644 --- a/arch/esp32/esp32c6.ini +++ b/arch/esp32/esp32c6.ini @@ -28,7 +28,7 @@ lib_deps = ${environmental_extra.lib_deps} ${radiolib_base.lib_deps} # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib - lewisxhe/XPowersLib@^0.2.7 + lewisxhe/XPowersLib@0.3.0 # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto From f35ca812a32f26750aff1008428128f2ca8388f3 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 4 Jul 2025 05:30:56 -0500 Subject: [PATCH 402/461] Add a WiFi menu that can toggle back to Bluetooth (#7226) * Add Kazakhstan to the BaseUI LoRa chooser * Add a WiFi menu that can toggle back to Bluetooth --- src/graphics/Screen.cpp | 2 ++ src/graphics/draw/MenuHandler.cpp | 41 +++++++++++++++++++++++++++++++ src/graphics/draw/MenuHandler.h | 7 +++--- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 067e4418f..ed8119738 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1373,6 +1373,8 @@ int Screen::handleInputEvent(const InputEvent *event) this->ui->getUiState()->currentFrame == framesetInfo.positions.nodelist_hopsignal || this->ui->getUiState()->currentFrame == framesetInfo.positions.nodelist_bearings) { menuHandler::nodeListMenu(); + } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.wifi) { + menuHandler::wifiBaseMenu(); } } else if (event->inputEvent == INPUT_BROKER_BACK) { showPrevFrame(); diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 7e5063fef..43c226896 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -831,6 +831,44 @@ void menuHandler::numberTest() [](int number_picked) -> void { LOG_WARN("Nodenum: %u", number_picked); }); } +void menuHandler::wifiBaseMenu() +{ + enum optionsNumbers { Back, Wifi_toggle }; + + static const char *optionsArray[] = {"Back", "WiFi Toggle"}; + BannerOverlayOptions bannerOptions; + bannerOptions.message = "WiFi Menu"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 2; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == Wifi_toggle) { + menuQueue = wifi_toggle_menu; + screen->runNow(); + } + }; + screen->showOverlayBanner(bannerOptions); +} + +void menuHandler::wifiToggleMenu() +{ + enum optionsNumbers { Back, Wifi_toggle }; + + static const char *optionsArray[] = {"Back", "Disable"}; + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Disable Wifi and\nEnable Bluetooth?"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 2; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == Wifi_toggle) { + config.network.wifi_enabled = false; + config.bluetooth.enabled = true; + service->reloadConfig(SEGMENT_CONFIG); + rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); + } + }; + screen->showOverlayBanner(bannerOptions); +} + void menuHandler::handleMenuSwitch(OLEDDisplay *display) { if (menuQueue != menu_none) @@ -894,6 +932,9 @@ void menuHandler::handleMenuSwitch(OLEDDisplay *display) case number_test: numberTest(); break; + case wifi_toggle_menu: + wifiToggleMenu(); + break; } menuQueue = menu_none; } diff --git a/src/graphics/draw/MenuHandler.h b/src/graphics/draw/MenuHandler.h index 09279b041..8824e38ed 100644 --- a/src/graphics/draw/MenuHandler.h +++ b/src/graphics/draw/MenuHandler.h @@ -13,9 +13,7 @@ class menuHandler clock_face_picker, clock_menu, position_base_menu, -#if !MESHTASTIC_EXCLUDE_GPS gps_toggle_menu, -#endif compass_point_north_menu, reset_node_db_menu, buzzermodemenupicker, @@ -26,7 +24,8 @@ class menuHandler add_favorite, remove_favorite, test_menu, - number_test + number_test, + wifi_toggle_menu }; static screenMenus menuQueue; @@ -54,6 +53,8 @@ class menuHandler static void removeFavoriteMenu(); static void testMenu(); static void numberTest(); + static void wifiBaseMenu(); + static void wifiToggleMenu(); }; } // namespace graphics \ No newline at end of file From 1994bb3cd193c2b3a107ad986bb0a9918841df52 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Jul 2025 08:10:23 -0500 Subject: [PATCH 403/461] automated bumps (#7227) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 7 +++++-- version.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index ed57386a3..47082718a 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.2 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.1 diff --git a/debian/changelog b/debian/changelog index 70a01bab4..42488692b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.7.1.0) UNRELEASED; urgency=medium +meshtasticd (2.7.2.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging @@ -25,4 +25,7 @@ meshtasticd (2.7.1.0) UNRELEASED; urgency=medium [ ] * GitHub Actions Automatic version bump - -- Fri, 27 Jun 2025 20:12:21 +0000 + [ ] + * GitHub Actions Automatic version bump + + -- Fri, 04 Jul 2025 11:58:01 +0000 diff --git a/version.properties b/version.properties index 3fe1aa385..69f2d6af5 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 7 -build = 1 +build = 2 From 29893e0c281c7266eeeffe956a5b1c367dfc9417 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 4 Jul 2025 14:22:59 -0500 Subject: [PATCH 404/461] Don't run ble getFromRadio() unless the phone has requested a packet (#7231) --- src/nimble/NimbleBluetooth.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/nimble/NimbleBluetooth.cpp b/src/nimble/NimbleBluetooth.cpp index 8f53c9229..834184292 100644 --- a/src/nimble/NimbleBluetooth.cpp +++ b/src/nimble/NimbleBluetooth.cpp @@ -29,6 +29,7 @@ class BluetoothPhoneAPI : public PhoneAPI, public concurrency::OSThread uint8_t fromRadioBytes[meshtastic_FromRadio_size] = {0}; size_t numBytes = 0; bool hasChecked = false; + bool phoneWants = false; protected: virtual int32_t runOnce() override @@ -38,10 +39,10 @@ class BluetoothPhoneAPI : public PhoneAPI, public concurrency::OSThread for (uint8_t i = 0; i < queue_size; i++) { handleToRadio(nimble_queue.at(i).data(), nimble_queue.at(i).length()); } - LOG_WARN("Queue_size %u", queue_size); + LOG_DEBUG("Queue_size %u", queue_size); queue_size = 0; } - if (hasChecked == false) { + if (hasChecked == false && phoneWants == true) { numBytes = getFromRadio(fromRadioBytes); hasChecked = true; } @@ -98,9 +99,12 @@ class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks { virtual void onRead(NimBLECharacteristic *pCharacteristic) { - while (!bluetoothPhoneAPI->hasChecked) { + int tries = 0; + bluetoothPhoneAPI->phoneWants = true; + while (!bluetoothPhoneAPI->hasChecked && tries < 100) { bluetoothPhoneAPI->setIntervalFromNow(0); delay(20); + tries++; } std::lock_guard guard(bluetoothPhoneAPI->nimble_mutex); std::string fromRadioByteString(bluetoothPhoneAPI->fromRadioBytes, @@ -111,6 +115,7 @@ class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks bluetoothPhoneAPI->setIntervalFromNow(0); bluetoothPhoneAPI->numBytes = 0; bluetoothPhoneAPI->hasChecked = false; + bluetoothPhoneAPI->phoneWants = false; } }; @@ -186,7 +191,12 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED)); if (bluetoothPhoneAPI) { + std::lock_guard guard(bluetoothPhoneAPI->nimble_mutex); bluetoothPhoneAPI->close(); + bluetoothPhoneAPI->hasChecked = false; + bluetoothPhoneAPI->phoneWants = false; + bluetoothPhoneAPI->numBytes = 0; + bluetoothPhoneAPI->queue_size = 0; } } }; From 798b1f4d861e756ecd2324083726c098cfb7325e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 5 Jul 2025 07:35:20 -0500 Subject: [PATCH 405/461] Add HWIDs for T1000-E in DFU mode (#7235) --- boards/tracker-t1000-e.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boards/tracker-t1000-e.json b/boards/tracker-t1000-e.json index 2be716e22..9e8870041 100644 --- a/boards/tracker-t1000-e.json +++ b/boards/tracker-t1000-e.json @@ -11,7 +11,8 @@ ["0x239A", "0x8029"], ["0x239A", "0x0029"], ["0x239A", "0x002A"], - ["0x239A", "0x802A"] + ["0x239A", "0x802A"], + ["0x2886", "0x0057"] ], "usb_product": "T1000-E-BOOT", "mcu": "nrf52840", From 98d010761e5a8c0f5651974268adcb09ef2f6639 Mon Sep 17 00:00:00 2001 From: Aiden Fox Ivey Date: Fri, 20 Jun 2025 16:07:23 -0400 Subject: [PATCH 406/461] Add constant time compare to AES-CCM Signed-off-by: Aiden Fox Ivey --- src/mesh/aes-ccm.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/mesh/aes-ccm.cpp b/src/mesh/aes-ccm.cpp index a650ba2fc..a73c9473e 100644 --- a/src/mesh/aes-ccm.cpp +++ b/src/mesh/aes-ccm.cpp @@ -10,6 +10,31 @@ #include "aes-ccm.h" #if !MESHTASTIC_EXCLUDE_PKI +/** + * Constant-time comparison of two byte arrays + * + * @param a First byte array to compare + * @param b Second byte array to compare + * @param len Number of bytes to compare + * @return 0 if arrays are equal, 1 if different or if inputs are invalid + */ +static int constant_time_compare(const void *a_, const void *b_, size_t len) +{ + // Cast to volatile to prevent the compiler from optimizing out their comparison. + const volatile uint8_t *volatile a = (const volatile uint8_t *volatile) a_; + const volatile uint8_t *volatile b = (const volatile uint8_t *volatile) b_; + if (len == 0) + return 0; + if (a == NULL || b == NULL) + return 1; + size_t i; + volatile uint8_t d = 0U; + for (i = 0U; i < len; i++) { + d |= (a[i] ^ b[i]); + } + return (1 & ((d - 1) >> 8)) - 1; +} + static void WPA_PUT_BE16(uint8_t *a, uint16_t val) { a[0] = val >> 8; @@ -146,7 +171,7 @@ bool aes_ccm_ad(const uint8_t *key, size_t key_len, const uint8_t *nonce, size_t aes_ccm_encr(L, crypt, crypt_len, plain, a); aes_ccm_auth_start(M, L, nonce, aad, aad_len, crypt_len, x); aes_ccm_auth(plain, crypt_len, x); - if (memcmp(x, t, M) != 0) { // FIXME make const comp + if (constant_time_compare(x, t, M) != 0) { return false; } return true; From 13786572066c570d053a9669a59c1804c2ca7aa8 Mon Sep 17 00:00:00 2001 From: Aiden Fox Ivey Date: Sat, 21 Jun 2025 00:12:09 -0400 Subject: [PATCH 407/461] Fix documentation comments. --- src/mesh/aes-ccm.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mesh/aes-ccm.cpp b/src/mesh/aes-ccm.cpp index a73c9473e..e1c65c7aa 100644 --- a/src/mesh/aes-ccm.cpp +++ b/src/mesh/aes-ccm.cpp @@ -16,22 +16,23 @@ * @param a First byte array to compare * @param b Second byte array to compare * @param len Number of bytes to compare - * @return 0 if arrays are equal, 1 if different or if inputs are invalid + * @return 0 if arrays are equal, -1 if different or if inputs are invalid */ static int constant_time_compare(const void *a_, const void *b_, size_t len) { - // Cast to volatile to prevent the compiler from optimizing out their comparison. + /* Cast to volatile to prevent the compiler from optimizing out their comparison. */ const volatile uint8_t *volatile a = (const volatile uint8_t *volatile) a_; const volatile uint8_t *volatile b = (const volatile uint8_t *volatile) b_; if (len == 0) return 0; if (a == NULL || b == NULL) - return 1; + return -1; size_t i; volatile uint8_t d = 0U; for (i = 0U; i < len; i++) { d |= (a[i] ^ b[i]); } + /* Constant time bit arithmetic to convert d > 0 to -1 and d = 0 to 0. */ return (1 & ((d - 1) >> 8)) - 1; } From 2a2620988928ceaf78f61b025529cf6d6eb13fea Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 5 Jul 2025 12:56:29 -0500 Subject: [PATCH 408/461] Trunk --- src/mesh/aes-ccm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh/aes-ccm.cpp b/src/mesh/aes-ccm.cpp index e1c65c7aa..420d80e9a 100644 --- a/src/mesh/aes-ccm.cpp +++ b/src/mesh/aes-ccm.cpp @@ -21,8 +21,8 @@ static int constant_time_compare(const void *a_, const void *b_, size_t len) { /* Cast to volatile to prevent the compiler from optimizing out their comparison. */ - const volatile uint8_t *volatile a = (const volatile uint8_t *volatile) a_; - const volatile uint8_t *volatile b = (const volatile uint8_t *volatile) b_; + const volatile uint8_t *volatile a = (const volatile uint8_t *volatile)a_; + const volatile uint8_t *volatile b = (const volatile uint8_t *volatile)b_; if (len == 0) return 0; if (a == NULL || b == NULL) From 708978911ba64c97af25751e1b4927a771a5d84d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 5 Jul 2025 19:26:20 -0500 Subject: [PATCH 409/461] chore(deps): update meshtastic/device-ui digest to 8c7092c (#7238) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 795f86eb9..5ba5e63e0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -109,7 +109,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/4b7bf369adfa5a7bd419fa8293d21206576d52d0.zip + https://github.com/meshtastic/device-ui/archive/8c7092c73425adfda1aac8c6960df06cd85f6d92.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 40c586ca97dfd10aeaeb73fc9b5d7ebf54fab60e Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 6 Jul 2025 16:36:22 -0500 Subject: [PATCH 410/461] Automatically bail user out of displaymode_color when not HAS_TFT (#7248) --- src/mesh/NodeDB.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 5630a4ea3..a20acfda0 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -369,6 +369,14 @@ NodeDB::NodeDB() config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_LOCAL_ONLY; } +#if !HAS_TFT + if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + // On a device without MUI, this display mode makes no sense, and will break logic. + config.display.displaymode = meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT; + config.bluetooth.enabled = true; + } +#endif + if (devicestateCRC != crc32Buffer(&devicestate, sizeof(devicestate))) saveWhat |= SEGMENT_DEVICESTATE; if (nodeDatabaseCRC != crc32Buffer(&nodeDatabase, sizeof(nodeDatabase))) From 09d4ee1ea7ab6bc77b59ad943008ac831f8afdfc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 06:37:15 -0500 Subject: [PATCH 411/461] Upgrade trunk (#7254) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 2ddebdf1d..1dfff137a 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,14 +9,14 @@ plugins: lint: enabled: - checkov@3.2.447 - - renovate@41.17.2 + - renovate@41.19.0 - prettier@3.6.2 - trufflehog@3.89.2 - yamllint@1.37.1 - bandit@1.8.5 - - trivy@0.64.0 + - trivy@0.64.1 - taplo@0.9.3 - - ruff@0.12.1 + - ruff@0.12.2 - isort@6.0.1 - markdownlint@0.45.0 - oxipng@9.1.5 From f95c77b8bd8babd071e7cc2b36f0e3952bf4ed92 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 7 Jul 2025 15:50:13 +0300 Subject: [PATCH 412/461] Fast fix, remove saving tx power inside limitPower() (#7255) --- src/mesh/RadioInterface.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 3632378a5..faa67a1c2 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -645,10 +645,6 @@ void RadioInterface::limitPower(int8_t loraMaxPower) if (power > loraMaxPower) // Clamp power to maximum defined level power = loraMaxPower; - if (TX_GAIN_LORA == 0) { // Setting power in config with defined TX_GAIN_LORA will cause decreasing power on each reboot - config.lora.tx_power = power; // Set limited power in config - } - LOG_INFO("Final Tx power: %d dBm", power); } From f2fb473ecf1a0e0c19b12134c5250f76efdf252d Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 7 Jul 2025 20:34:25 -0400 Subject: [PATCH 413/461] GitHub Actions faster!! (#7244) Use new meshtastic/gh-action-firmware Action Co-authored-by: Ben Meadors --- .github/workflows/build_esp32.yml | 33 +++++++++++---------- .github/workflows/build_esp32_c3.yml | 33 +++++++++++---------- .github/workflows/build_esp32_c6.yml | 33 +++++++++++---------- .github/workflows/build_esp32_s3.yml | 33 +++++++++++---------- .github/workflows/build_nrf52.yml | 24 ++++++++++----- .github/workflows/build_rpi2040.yml | 22 ++++++++++---- .github/workflows/build_stm32.yml | 22 ++++++++++---- .github/workflows/main_matrix.yml | 1 + .github/workflows/nightly.yml | 2 ++ .github/workflows/sec_sast_semgrep_cron.yml | 1 + .github/workflows/stale_bot.yml | 1 + .github/workflows/tests.yml | 2 ++ bin/{build-rpi2040.sh => build-rp2xx0.sh} | 0 bin/{build-stm32.sh => build-stm32wl.sh} | 0 14 files changed, 127 insertions(+), 80 deletions(-) rename bin/{build-rpi2040.sh => build-rp2xx0.sh} (100%) rename bin/{build-stm32.sh => build-stm32wl.sh} (100%) diff --git a/.github/workflows/build_esp32.yml b/.github/workflows/build_esp32.yml index 616f51746..4ec5d12db 100644 --- a/.github/workflows/build_esp32.yml +++ b/.github/workflows/build_esp32.yml @@ -15,23 +15,26 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build ESP32 id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - remove-debug-flags: >- - ./arch/esp32/esp32.ini - ./arch/esp32/esp32s2.ini - ./arch/esp32/esp32s3.ini - ./arch/esp32/esp32c3.ini - ./arch/esp32/esp32c6.ini - build-script-path: bin/build-esp32.sh - ota-firmware-source: firmware.bin - ota-firmware-target: release/bleota.bin - artifact-paths: | + pio_platform: esp32 + pio_env: ${{ inputs.board }} + pio_target: build + ota_firmware_source: firmware.bin + ota_firmware_target: release/bleota.bin + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-esp32-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.bin release/*.elf - #include-web-ui: true - arch: esp32 diff --git a/.github/workflows/build_esp32_c3.yml b/.github/workflows/build_esp32_c3.yml index 1b6b832e9..335acaa2e 100644 --- a/.github/workflows/build_esp32_c3.yml +++ b/.github/workflows/build_esp32_c3.yml @@ -15,23 +15,26 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build ESP32-C3 id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - remove-debug-flags: >- - ./arch/esp32/esp32.ini - ./arch/esp32/esp32s2.ini - ./arch/esp32/esp32s3.ini - ./arch/esp32/esp32c3.ini - ./arch/esp32/esp32c6.ini - build-script-path: bin/build-esp32.sh - ota-firmware-source: firmware-c3.bin - ota-firmware-target: release/bleota-c3.bin - artifact-paths: | + pio_platform: esp32 + pio_env: ${{ inputs.board }} + pio_target: build + ota_firmware_source: firmware-c3.bin + ota_firmware_target: release/bleota-c3.bin + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-esp32c3-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.bin release/*.elf - #include-web-ui: true - arch: esp32c3 diff --git a/.github/workflows/build_esp32_c6.yml b/.github/workflows/build_esp32_c6.yml index 29dac51e1..6ab588dde 100644 --- a/.github/workflows/build_esp32_c6.yml +++ b/.github/workflows/build_esp32_c6.yml @@ -15,23 +15,26 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build ESP32-C6 id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - remove-debug-flags: >- - ./arch/esp32/esp32.ini - ./arch/esp32/esp32s2.ini - ./arch/esp32/esp32s3.ini - ./arch/esp32/esp32c3.ini - ./arch/esp32/esp32c6.ini - build-script-path: bin/build-esp32.sh - ota-firmware-source: firmware-c3.bin - ota-firmware-target: release/bleota-c3.bin - artifact-paths: | + pio_platform: esp32 + pio_env: ${{ inputs.board }} + pio_target: build + ota_firmware_source: firmware-c3.bin + ota_firmware_target: release/bleota-c3.bin + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-esp32c6-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.bin release/*.elf - #include-web-ui: true - arch: esp32c6 diff --git a/.github/workflows/build_esp32_s3.yml b/.github/workflows/build_esp32_s3.yml index 7e0373503..dba0d7999 100644 --- a/.github/workflows/build_esp32_s3.yml +++ b/.github/workflows/build_esp32_s3.yml @@ -15,23 +15,26 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build ESP32-S3 id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - remove-debug-flags: >- - ./arch/esp32/esp32.ini - ./arch/esp32/esp32s2.ini - ./arch/esp32/esp32s3.ini - ./arch/esp32/esp32c3.ini - ./arch/esp32/esp32c6.ini - build-script-path: bin/build-esp32.sh - ota-firmware-source: firmware-s3.bin - ota-firmware-target: release/bleota-s3.bin - artifact-paths: | + pio_platform: esp32 + pio_env: ${{ inputs.board }} + pio_target: build + ota_firmware_source: firmware-s3.bin + ota_firmware_target: release/bleota-s3.bin + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-esp32s3-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.bin release/*.elf - #include-web-ui: true - arch: esp32s3 diff --git a/.github/workflows/build_nrf52.yml b/.github/workflows/build_nrf52.yml index 786508f86..bafaf2fb2 100644 --- a/.github/workflows/build_nrf52.yml +++ b/.github/workflows/build_nrf52.yml @@ -15,16 +15,24 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build NRF52 id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - build-script-path: bin/build-nrf52.sh - artifact-paths: | - release/*.hex + pio_platform: nrf52 + pio_env: ${{ inputs.board }} + pio_target: build + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-nrf52840-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.uf2 release/*.elf - release/*.zip - arch: nrf52840 diff --git a/.github/workflows/build_rpi2040.yml b/.github/workflows/build_rpi2040.yml index 53fee34d2..2aa0c477a 100644 --- a/.github/workflows/build_rpi2040.yml +++ b/.github/workflows/build_rpi2040.yml @@ -15,14 +15,24 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build Raspberry Pi 2040 id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - build-script-path: bin/build-rpi2040.sh - artifact-paths: | + pio_platform: rp2xx0 + pio_env: ${{ inputs.board }} + pio_target: build + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-rp2040-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.uf2 release/*.elf - arch: rp2040 diff --git a/.github/workflows/build_stm32.yml b/.github/workflows/build_stm32.yml index dc469d994..dd14d9d0f 100644 --- a/.github/workflows/build_stm32.yml +++ b/.github/workflows/build_stm32.yml @@ -15,15 +15,25 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build STM32WL id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - build-script-path: bin/build-stm32.sh - artifact-paths: | + pio_platform: stm32wl + pio_env: ${{ inputs.board }} + pio_target: build + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-stm32-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.hex release/*.bin release/*.elf - arch: stm32 diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 03e61d572..a6112e0e4 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -135,6 +135,7 @@ jobs: board: ${{ matrix.board }} build-debian-src: + if: github.repository == 'meshtastic/firmware' uses: ./.github/workflows/build_debian_src.yml with: series: UNRELEASED diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 36ec22f17..309772b12 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -8,6 +8,7 @@ permissions: read-all jobs: trunk_check: + if: github.repository == 'meshtastic/firmware' name: Trunk Check and Upload runs-on: ubuntu-24.04 @@ -21,6 +22,7 @@ jobs: trunk-token: ${{ secrets.TRUNK_TOKEN }} trunk_upgrade: + if: github.repository == 'meshtastic/firmware' # See: https://github.com/trunk-io/trunk-action/blob/v1/readme.md#automatic-upgrades name: Trunk Upgrade (PR) runs-on: ubuntu-24.04 diff --git a/.github/workflows/sec_sast_semgrep_cron.yml b/.github/workflows/sec_sast_semgrep_cron.yml index d7eef29b4..e391aa07b 100644 --- a/.github/workflows/sec_sast_semgrep_cron.yml +++ b/.github/workflows/sec_sast_semgrep_cron.yml @@ -13,6 +13,7 @@ permissions: jobs: semgrep-full: + if: github.repository == 'meshtastic/firmware' runs-on: ubuntu-24.04 container: image: semgrep/semgrep diff --git a/.github/workflows/stale_bot.yml b/.github/workflows/stale_bot.yml index 5ae6bdfc9..5a11fdfa8 100644 --- a/.github/workflows/stale_bot.yml +++ b/.github/workflows/stale_bot.yml @@ -11,6 +11,7 @@ permissions: jobs: stale_issues: + if: github.repository == 'meshtastic/firmware' name: Close Stale Issues runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 28b6a40a5..34b28b39c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,9 +12,11 @@ permissions: jobs: native-tests: + if: github.repository == 'meshtastic/firmware' uses: ./.github/workflows/test_native.yml hardware-tests: + if: github.repository == 'meshtastic/firmware' runs-on: test-runner steps: - name: Checkout code diff --git a/bin/build-rpi2040.sh b/bin/build-rp2xx0.sh similarity index 100% rename from bin/build-rpi2040.sh rename to bin/build-rp2xx0.sh diff --git a/bin/build-stm32.sh b/bin/build-stm32wl.sh similarity index 100% rename from bin/build-stm32.sh rename to bin/build-stm32wl.sh From 415dc4aa471640cd4e55967e4381fb62ff59203d Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 7 Jul 2025 19:35:57 -0500 Subject: [PATCH 414/461] Try-fix: L76K spamming bad times can crash nodes (#7261) * Try-fix: Clear GPS buffer when we encounter a bad time in NMEA * Fix signed int warnings --- src/gps/GPS.cpp | 5 ++++- src/gps/RTC.cpp | 12 ++++++------ src/gps/RTC.h | 13 +++++++++++-- src/graphics/draw/NotificationRenderer.cpp | 9 ++++++--- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 142241c43..345c738d6 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -1536,7 +1536,10 @@ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of s if (t.tm_mon > -1) { LOG_DEBUG("NMEA GPS time %02d-%02d-%02d %02d:%02d:%02d age %d", d.year(), d.month(), t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, ti.age()); - perhapsSetRTC(RTCQualityGPS, t); + if (perhapsSetRTC(RTCQualityGPS, t) == RTCSetResultInvalidTime) { + // Clear the GPS buffer if we got an invalid time + clearBuffer(); + } return true; } else return false; diff --git a/src/gps/RTC.cpp b/src/gps/RTC.cpp index 219a593e0..5054be3f0 100644 --- a/src/gps/RTC.cpp +++ b/src/gps/RTC.cpp @@ -105,7 +105,7 @@ void readFromRTC() * * If we haven't yet set our RTC this boot, set it from a GPS derived time */ -bool perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpdate) +RTCSetResult perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpdate) { static uint32_t lastSetMsec = 0; uint32_t now = millis(); @@ -113,7 +113,7 @@ bool perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpdate) #ifdef BUILD_EPOCH if (tv->tv_sec < BUILD_EPOCH) { LOG_WARN("Ignore time (%ld) before build epoch (%ld)!", printableEpoch, BUILD_EPOCH); - return false; + return RTCSetResultInvalidTime; } #endif @@ -184,9 +184,9 @@ bool perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpdate) readFromRTC(); #endif - return true; + return RTCSetResultSuccess; } else { - return false; + return RTCSetResultNotSet; // RTC was already set with a higher quality time } } @@ -215,7 +215,7 @@ const char *RtcName(RTCQuality quality) * @param t The time to potentially set the RTC to. * @return True if the RTC was set to the provided time, false otherwise. */ -bool perhapsSetRTC(RTCQuality q, struct tm &t) +RTCSetResult perhapsSetRTC(RTCQuality q, struct tm &t) { /* Convert to unix time The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 @@ -231,7 +231,7 @@ bool perhapsSetRTC(RTCQuality q, struct tm &t) // LOG_DEBUG("Got time from GPS month=%d, year=%d, unixtime=%ld", t.tm_mon, t.tm_year, tv.tv_sec); if (t.tm_year < 0 || t.tm_year >= 300) { // LOG_DEBUG("Ignore invalid GPS month=%d, year=%d, unixtime=%ld", t.tm_mon, t.tm_year, tv.tv_sec); - return false; + return RTCSetResultInvalidTime; } else { return perhapsSetRTC(q, &tv); } diff --git a/src/gps/RTC.h b/src/gps/RTC.h index caa48dc06..96dec575b 100644 --- a/src/gps/RTC.h +++ b/src/gps/RTC.h @@ -22,13 +22,22 @@ enum RTCQuality { RTCQualityGPS = 4 }; +/// The RTC set result codes +/// Used to indicate the result of an attempt to set the RTC. +enum RTCSetResult { + RTCSetResultNotSet = 0, ///< RTC was set successfully + RTCSetResultSuccess = 1, ///< RTC was set successfully + RTCSetResultInvalidTime = 3, ///< The provided time was invalid (e.g., before the build epoch) + RTCSetResultError = 4 ///< An error occurred while setting the RTC +}; + RTCQuality getRTCQuality(); extern uint32_t lastSetFromPhoneNtpOrGps; /// If we haven't yet set our RTC this boot, set it from a GPS derived time -bool perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpdate = false); -bool perhapsSetRTC(RTCQuality q, struct tm &t); +RTCSetResult perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpdate = false); +RTCSetResult perhapsSetRTC(RTCQuality q, struct tm &t); /// Return a string name for the quality const char *RtcName(RTCQuality quality); diff --git a/src/graphics/draw/NotificationRenderer.cpp b/src/graphics/draw/NotificationRenderer.cpp index 3b682cc55..057c91008 100644 --- a/src/graphics/draw/NotificationRenderer.cpp +++ b/src/graphics/draw/NotificationRenderer.cpp @@ -42,7 +42,7 @@ uint32_t NotificationRenderer::currentNumber = 0; uint32_t pow_of_10(uint32_t n) { uint32_t ret = 1; - for (int i = 0; i < n; i++) { + for (uint32_t i = 0; i < n; i++) { ret *= 10; } return ret; @@ -80,6 +80,9 @@ void NotificationRenderer::drawBannercallback(OLEDDisplay *display, OLEDDisplayU if (!isOverlayBannerShowing() || pauseBanner) return; switch (current_notification_type) { + case notificationTypeEnum::none: + // Do nothing - no notification to display + break; case notificationTypeEnum::text_banner: case notificationTypeEnum::selection_picker: drawAlertBannerOverlay(display, state); @@ -144,12 +147,12 @@ void NotificationRenderer::drawNumberPicker(OLEDDisplay *display, OLEDDisplayUiS const char *linePointers[totalLines + 1] = {0}; // this is sort of a dynamic allocation // copy the linestarts to display to the linePointers holder - for (int i = 0; i < lineCount; i++) { + for (uint16_t i = 0; i < lineCount; i++) { linePointers[i] = lineStarts[i]; } std::string digits = " "; std::string arrowPointer = " "; - for (int i = 0; i < numDigits; i++) { + for (uint16_t i = 0; i < numDigits; i++) { // Modulo minus modulo to return just the current number digits += std::to_string((currentNumber % (pow_of_10(numDigits - i))) / (pow_of_10(numDigits - i - 1))) + " "; if (curSelected == i) { From e1f40c2db91b753831be2f29ce074274bd029f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ing=2E=20Jan=20Kal=C3=A1b?= Date: Tue, 8 Jul 2025 02:36:21 +0200 Subject: [PATCH 415/461] Fix install script (#7259) This partially reverse 2ab717c (#7143), fixing the install script. It looks like a bad/missed copy/paste. --- bin/device-install.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bin/device-install.sh b/bin/device-install.sh index 42d0c4089..4674113b6 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -7,12 +7,7 @@ MCU="" # Variant groups BIGDB_8MB=( - # Check if FILENAME contains "-tft-" and set target partitionScheme accordingly. -if [[ $FILENAME == *"-tft-"* ]]; then - TFT_BUILD=true -fi - -# Extract BASENAME from %FILENAME% for later use.r-s3" + "picomputer-s3" "unphone" "seeed-sensecap-indicator" "crowpanel-esp32s3" From fa23be442444497c1aa729faa90cea9ae9c3ecde Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 7 Jul 2025 19:50:44 -0500 Subject: [PATCH 416/461] Revert "GitHub Actions faster!! (#7244)" (#7262) This reverts commit f2fb473ecf1a0e0c19b12134c5250f76efdf252d. --- .github/workflows/build_esp32.yml | 33 ++++++++++----------- .github/workflows/build_esp32_c3.yml | 33 ++++++++++----------- .github/workflows/build_esp32_c6.yml | 33 ++++++++++----------- .github/workflows/build_esp32_s3.yml | 33 ++++++++++----------- .github/workflows/build_nrf52.yml | 24 +++++---------- .github/workflows/build_rpi2040.yml | 22 ++++---------- .github/workflows/build_stm32.yml | 22 ++++---------- .github/workflows/main_matrix.yml | 1 - .github/workflows/nightly.yml | 2 -- .github/workflows/sec_sast_semgrep_cron.yml | 1 - .github/workflows/stale_bot.yml | 1 - .github/workflows/tests.yml | 2 -- bin/{build-rp2xx0.sh => build-rpi2040.sh} | 0 bin/{build-stm32wl.sh => build-stm32.sh} | 0 14 files changed, 80 insertions(+), 127 deletions(-) rename bin/{build-rp2xx0.sh => build-rpi2040.sh} (100%) rename bin/{build-stm32wl.sh => build-stm32.sh} (100%) diff --git a/.github/workflows/build_esp32.yml b/.github/workflows/build_esp32.yml index 4ec5d12db..616f51746 100644 --- a/.github/workflows/build_esp32.yml +++ b/.github/workflows/build_esp32.yml @@ -15,26 +15,23 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - name: Build ESP32 id: build - uses: meshtastic/gh-action-firmware@main + uses: ./.github/actions/build-variant with: - pio_platform: esp32 - pio_env: ${{ inputs.board }} - pio_target: build - ota_firmware_source: firmware.bin - ota_firmware_target: release/bleota.bin - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-esp32-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip - overwrite: true - path: | + github_token: ${{ secrets.GITHUB_TOKEN }} + board: ${{ inputs.board }} + remove-debug-flags: >- + ./arch/esp32/esp32.ini + ./arch/esp32/esp32s2.ini + ./arch/esp32/esp32s3.ini + ./arch/esp32/esp32c3.ini + ./arch/esp32/esp32c6.ini + build-script-path: bin/build-esp32.sh + ota-firmware-source: firmware.bin + ota-firmware-target: release/bleota.bin + artifact-paths: | release/*.bin release/*.elf + #include-web-ui: true + arch: esp32 diff --git a/.github/workflows/build_esp32_c3.yml b/.github/workflows/build_esp32_c3.yml index 335acaa2e..1b6b832e9 100644 --- a/.github/workflows/build_esp32_c3.yml +++ b/.github/workflows/build_esp32_c3.yml @@ -15,26 +15,23 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - name: Build ESP32-C3 id: build - uses: meshtastic/gh-action-firmware@main + uses: ./.github/actions/build-variant with: - pio_platform: esp32 - pio_env: ${{ inputs.board }} - pio_target: build - ota_firmware_source: firmware-c3.bin - ota_firmware_target: release/bleota-c3.bin - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-esp32c3-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip - overwrite: true - path: | + github_token: ${{ secrets.GITHUB_TOKEN }} + board: ${{ inputs.board }} + remove-debug-flags: >- + ./arch/esp32/esp32.ini + ./arch/esp32/esp32s2.ini + ./arch/esp32/esp32s3.ini + ./arch/esp32/esp32c3.ini + ./arch/esp32/esp32c6.ini + build-script-path: bin/build-esp32.sh + ota-firmware-source: firmware-c3.bin + ota-firmware-target: release/bleota-c3.bin + artifact-paths: | release/*.bin release/*.elf + #include-web-ui: true + arch: esp32c3 diff --git a/.github/workflows/build_esp32_c6.yml b/.github/workflows/build_esp32_c6.yml index 6ab588dde..29dac51e1 100644 --- a/.github/workflows/build_esp32_c6.yml +++ b/.github/workflows/build_esp32_c6.yml @@ -15,26 +15,23 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - name: Build ESP32-C6 id: build - uses: meshtastic/gh-action-firmware@main + uses: ./.github/actions/build-variant with: - pio_platform: esp32 - pio_env: ${{ inputs.board }} - pio_target: build - ota_firmware_source: firmware-c3.bin - ota_firmware_target: release/bleota-c3.bin - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-esp32c6-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip - overwrite: true - path: | + github_token: ${{ secrets.GITHUB_TOKEN }} + board: ${{ inputs.board }} + remove-debug-flags: >- + ./arch/esp32/esp32.ini + ./arch/esp32/esp32s2.ini + ./arch/esp32/esp32s3.ini + ./arch/esp32/esp32c3.ini + ./arch/esp32/esp32c6.ini + build-script-path: bin/build-esp32.sh + ota-firmware-source: firmware-c3.bin + ota-firmware-target: release/bleota-c3.bin + artifact-paths: | release/*.bin release/*.elf + #include-web-ui: true + arch: esp32c6 diff --git a/.github/workflows/build_esp32_s3.yml b/.github/workflows/build_esp32_s3.yml index dba0d7999..7e0373503 100644 --- a/.github/workflows/build_esp32_s3.yml +++ b/.github/workflows/build_esp32_s3.yml @@ -15,26 +15,23 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - name: Build ESP32-S3 id: build - uses: meshtastic/gh-action-firmware@main + uses: ./.github/actions/build-variant with: - pio_platform: esp32 - pio_env: ${{ inputs.board }} - pio_target: build - ota_firmware_source: firmware-s3.bin - ota_firmware_target: release/bleota-s3.bin - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-esp32s3-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip - overwrite: true - path: | + github_token: ${{ secrets.GITHUB_TOKEN }} + board: ${{ inputs.board }} + remove-debug-flags: >- + ./arch/esp32/esp32.ini + ./arch/esp32/esp32s2.ini + ./arch/esp32/esp32s3.ini + ./arch/esp32/esp32c3.ini + ./arch/esp32/esp32c6.ini + build-script-path: bin/build-esp32.sh + ota-firmware-source: firmware-s3.bin + ota-firmware-target: release/bleota-s3.bin + artifact-paths: | release/*.bin release/*.elf + #include-web-ui: true + arch: esp32s3 diff --git a/.github/workflows/build_nrf52.yml b/.github/workflows/build_nrf52.yml index bafaf2fb2..786508f86 100644 --- a/.github/workflows/build_nrf52.yml +++ b/.github/workflows/build_nrf52.yml @@ -15,24 +15,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - name: Build NRF52 id: build - uses: meshtastic/gh-action-firmware@main + uses: ./.github/actions/build-variant with: - pio_platform: nrf52 - pio_env: ${{ inputs.board }} - pio_target: build - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-nrf52840-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip - overwrite: true - path: | + github_token: ${{ secrets.GITHUB_TOKEN }} + board: ${{ inputs.board }} + build-script-path: bin/build-nrf52.sh + artifact-paths: | + release/*.hex release/*.uf2 release/*.elf + release/*.zip + arch: nrf52840 diff --git a/.github/workflows/build_rpi2040.yml b/.github/workflows/build_rpi2040.yml index 2aa0c477a..53fee34d2 100644 --- a/.github/workflows/build_rpi2040.yml +++ b/.github/workflows/build_rpi2040.yml @@ -15,24 +15,14 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - name: Build Raspberry Pi 2040 id: build - uses: meshtastic/gh-action-firmware@main + uses: ./.github/actions/build-variant with: - pio_platform: rp2xx0 - pio_env: ${{ inputs.board }} - pio_target: build - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-rp2040-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip - overwrite: true - path: | + github_token: ${{ secrets.GITHUB_TOKEN }} + board: ${{ inputs.board }} + build-script-path: bin/build-rpi2040.sh + artifact-paths: | release/*.uf2 release/*.elf + arch: rp2040 diff --git a/.github/workflows/build_stm32.yml b/.github/workflows/build_stm32.yml index dd14d9d0f..dc469d994 100644 --- a/.github/workflows/build_stm32.yml +++ b/.github/workflows/build_stm32.yml @@ -15,25 +15,15 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - name: Build STM32WL id: build - uses: meshtastic/gh-action-firmware@main + uses: ./.github/actions/build-variant with: - pio_platform: stm32wl - pio_env: ${{ inputs.board }} - pio_target: build - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-stm32-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip - overwrite: true - path: | + github_token: ${{ secrets.GITHUB_TOKEN }} + board: ${{ inputs.board }} + build-script-path: bin/build-stm32.sh + artifact-paths: | release/*.hex release/*.bin release/*.elf + arch: stm32 diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index a6112e0e4..03e61d572 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -135,7 +135,6 @@ jobs: board: ${{ matrix.board }} build-debian-src: - if: github.repository == 'meshtastic/firmware' uses: ./.github/workflows/build_debian_src.yml with: series: UNRELEASED diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 309772b12..36ec22f17 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -8,7 +8,6 @@ permissions: read-all jobs: trunk_check: - if: github.repository == 'meshtastic/firmware' name: Trunk Check and Upload runs-on: ubuntu-24.04 @@ -22,7 +21,6 @@ jobs: trunk-token: ${{ secrets.TRUNK_TOKEN }} trunk_upgrade: - if: github.repository == 'meshtastic/firmware' # See: https://github.com/trunk-io/trunk-action/blob/v1/readme.md#automatic-upgrades name: Trunk Upgrade (PR) runs-on: ubuntu-24.04 diff --git a/.github/workflows/sec_sast_semgrep_cron.yml b/.github/workflows/sec_sast_semgrep_cron.yml index e391aa07b..d7eef29b4 100644 --- a/.github/workflows/sec_sast_semgrep_cron.yml +++ b/.github/workflows/sec_sast_semgrep_cron.yml @@ -13,7 +13,6 @@ permissions: jobs: semgrep-full: - if: github.repository == 'meshtastic/firmware' runs-on: ubuntu-24.04 container: image: semgrep/semgrep diff --git a/.github/workflows/stale_bot.yml b/.github/workflows/stale_bot.yml index 5a11fdfa8..5ae6bdfc9 100644 --- a/.github/workflows/stale_bot.yml +++ b/.github/workflows/stale_bot.yml @@ -11,7 +11,6 @@ permissions: jobs: stale_issues: - if: github.repository == 'meshtastic/firmware' name: Close Stale Issues runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 34b28b39c..28b6a40a5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,11 +12,9 @@ permissions: jobs: native-tests: - if: github.repository == 'meshtastic/firmware' uses: ./.github/workflows/test_native.yml hardware-tests: - if: github.repository == 'meshtastic/firmware' runs-on: test-runner steps: - name: Checkout code diff --git a/bin/build-rp2xx0.sh b/bin/build-rpi2040.sh similarity index 100% rename from bin/build-rp2xx0.sh rename to bin/build-rpi2040.sh diff --git a/bin/build-stm32wl.sh b/bin/build-stm32.sh similarity index 100% rename from bin/build-stm32wl.sh rename to bin/build-stm32.sh From 19af2d9e3b1b3ea7912cc04b03052c3686be8ff8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 06:22:24 -0500 Subject: [PATCH 417/461] Upgrade trunk (#7266) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 1dfff137a..0986e6eb0 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,11 +9,11 @@ plugins: lint: enabled: - checkov@3.2.447 - - renovate@41.19.0 + - renovate@41.23.4 - prettier@3.6.2 - trufflehog@3.89.2 - yamllint@1.37.1 - - bandit@1.8.5 + - bandit@1.8.6 - trivy@0.64.1 - taplo@0.9.3 - ruff@0.12.2 From 88b299dd416480a0ccdde8a1dccf23a3a065e9a3 Mon Sep 17 00:00:00 2001 From: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> Date: Tue, 8 Jul 2025 07:22:57 -0400 Subject: [PATCH 418/461] Modules and favorite screen fix (#7264) * T-watch screen misalignment fix * Trunk fix * Fix for favorite frame when module screen is enabled --- src/graphics/Screen.cpp | 49 +++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index ed8119738..d8a60f1f4 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -944,22 +944,6 @@ void Screen::setFrames(FrameFocus focus) indicatorIcons.push_back(digital_icon_clock); #endif - // We don't show the node info of our node (if we have it yet - we should) - size_t numMeshNodes = nodeDB->getNumMeshNodes(); - if (numMeshNodes > 0) - numMeshNodes--; - - for (size_t i = 0; i < nodeDB->getNumMeshNodes(); i++) { - const meshtastic_NodeInfoLite *n = nodeDB->getMeshNodeByIndex(i); - if (n && n->num != nodeDB->getNodeNum() && n->is_favorite) { - if (fsi.positions.firstFavorite == 255) - fsi.positions.firstFavorite = numframes; - fsi.positions.lastFavorite = numframes; - normalFrames[numframes++] = graphics::UIRenderer::drawNodeInfo; - indicatorIcons.push_back(icon_node); - } - } - #if HAS_WIFI && !defined(ARCH_PORTDUINO) if (!dismissedFrames.wifi && isWifiAvailable()) { fsi.positions.wifi = numframes; @@ -969,7 +953,7 @@ void Screen::setFrames(FrameFocus focus) #endif // Beware of what changes you make in this code! - // We pass numfames into GetMeshModulesWithUIFrames() which is highly important! + // We pass numframes into GetMeshModulesWithUIFrames() which is highly important! // Inside of that callback, goes over to MeshModule.cpp and we run // modulesWithUIFrames.resize(startIndex, nullptr), to insert nullptr // entries until we're ready to start building the matching entries. @@ -998,6 +982,34 @@ void Screen::setFrames(FrameFocus focus) LOG_DEBUG("Added modules. numframes: %d", numframes); + // We don't show the node info of our node (if we have it yet - we should) + size_t numMeshNodes = nodeDB->getNumMeshNodes(); + if (numMeshNodes > 0) + numMeshNodes--; + + // Temporary array to hold favorite node frames + std::vector favoriteFrames; + + for (size_t i = 0; i < nodeDB->getNumMeshNodes(); i++) { + const meshtastic_NodeInfoLite *n = nodeDB->getMeshNodeByIndex(i); + if (n && n->num != nodeDB->getNodeNum() && n->is_favorite) { + favoriteFrames.push_back(graphics::UIRenderer::drawNodeInfo); + } + } + + // Insert favorite frames *after* collecting them all + if (!favoriteFrames.empty()) { + fsi.positions.firstFavorite = numframes; + for (auto &f : favoriteFrames) { + normalFrames[numframes++] = f; + indicatorIcons.push_back(icon_node); + } + fsi.positions.lastFavorite = numframes - 1; + } else { + fsi.positions.firstFavorite = 255; + fsi.positions.lastFavorite = 255; + } + fsi.frameCount = numframes; // Total framecount is used to apply FOCUS_PRESERVE this->frameCount = numframes; // ✅ Save frame count for use in custom overlay LOG_DEBUG("Finished build frames. numframes: %d", numframes); @@ -1009,8 +1021,7 @@ void Screen::setFrames(FrameFocus focus) static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawBannercallback}; ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); - prevFrame = -1; // Force drawNodeInfo to pick a new node (because our list - // just changed) + prevFrame = -1; // Force drawNodeInfo to pick a new node (because our list just changed) // Focus on a specific frame, in the frame set we just created switch (focus) { From 9c08220d247011fc30aa6a02dd73158ac9c8d31f Mon Sep 17 00:00:00 2001 From: Jason P Date: Tue, 8 Jul 2025 06:24:12 -0500 Subject: [PATCH 419/461] TFT_MESH Fixes Across Various Devices (#7247) * Rename "r,g,b" variables to having a TFT_MESH_ prefix * Reboot and then user options * Restore TFT_MESH on any ST7789Spi driver --- src/graphics/Screen.cpp | 14 +++---- src/graphics/draw/MenuHandler.cpp | 68 +++++++++++++++---------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index d8a60f1f4..5d33feb4d 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -294,13 +294,13 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O LOG_INFO("Protobuf Value uiconfig.screen_rgb_color: %d", uiconfig.screen_rgb_color); int32_t rawRGB = uiconfig.screen_rgb_color; if (rawRGB > 0 && rawRGB <= 255255255) { - uint8_t r = (rawRGB >> 16) & 0xFF; - uint8_t g = (rawRGB >> 8) & 0xFF; - uint8_t b = rawRGB & 0xFF; - LOG_INFO("Values of r,g,b: %d, %d, %d", r, g, b); + uint8_t TFT_MESH_r = (rawRGB >> 16) & 0xFF; + uint8_t TFT_MESH_g = (rawRGB >> 8) & 0xFF; + uint8_t TFT_MESH_b = rawRGB & 0xFF; + LOG_INFO("Values of r,g,b: %d, %d, %d", TFT_MESH_r, TFT_MESH_g, TFT_MESH_b); - if (r <= 255 && g <= 255 && b <= 255) { - TFT_MESH = COLOR565(r, g, b); + if (TFT_MESH_r <= 255 && TFT_MESH_g <= 255 && TFT_MESH_b <= 255) { + TFT_MESH = COLOR565(TFT_MESH_r, TFT_MESH_g, TFT_MESH_b); } } @@ -313,8 +313,8 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O ST7789_MISO, ST7789_SCK); #else dispdev = new ST7789Spi(&SPI1, ST7789_RESET, ST7789_RS, ST7789_NSS, GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT); - static_cast(dispdev)->setRGB(TFT_MESH); #endif + static_cast(dispdev)->setRGB(TFT_MESH); #elif defined(USE_SSD1306) dispdev = new SSD1306Wire(address.address, -1, -1, geometry, (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 43c226896..a66ccd983 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -358,6 +358,9 @@ void menuHandler::systemBaseMenu() static int optionsEnumArray[7] = {Back}; int options = 1; + optionsArray[options] = "Reboot"; + optionsEnumArray[options++] = Reboot; + optionsArray[options] = "Beeps Action"; optionsEnumArray[options++] = Beeps; @@ -366,9 +369,6 @@ void menuHandler::systemBaseMenu() optionsEnumArray[options++] = Brightness; } - optionsArray[options] = "Reboot"; - optionsEnumArray[options++] = Reboot; - #if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || HAS_TFT optionsArray[options] = "Screen Color"; optionsEnumArray[options++] = Color; @@ -677,52 +677,52 @@ void menuHandler::TFTColorPickerMenu(OLEDDisplay *display) bannerOptions.optionsArrayPtr = optionsArray; bannerOptions.optionsCount = 10; bannerOptions.bannerCallback = [display](int selected) -> void { - uint8_t r = 0; - uint8_t g = 0; - uint8_t b = 0; + uint8_t TFT_MESH_r = 0; + uint8_t TFT_MESH_g = 0; + uint8_t TFT_MESH_b = 0; if (selected == 1) { LOG_INFO("Setting color to system default or defined variant"); // Given just before we set all these to zero, we will allow this to go through } else if (selected == 2) { LOG_INFO("Setting color to Meshtastic Green"); - r = 103; - g = 234; - b = 148; + TFT_MESH_r = 103; + TFT_MESH_g = 234; + TFT_MESH_b = 148; } else if (selected == 3) { LOG_INFO("Setting color to Yellow"); - r = 255; - g = 255; - b = 128; + TFT_MESH_r = 255; + TFT_MESH_g = 255; + TFT_MESH_b = 128; } else if (selected == 4) { LOG_INFO("Setting color to Red"); - r = 255; - g = 64; - b = 64; + TFT_MESH_r = 255; + TFT_MESH_g = 64; + TFT_MESH_b = 64; } else if (selected == 5) { LOG_INFO("Setting color to Orange"); - r = 255; - g = 160; - b = 20; + TFT_MESH_r = 255; + TFT_MESH_g = 160; + TFT_MESH_b = 20; } else if (selected == 6) { LOG_INFO("Setting color to Purple"); - r = 204; - g = 153; - b = 255; + TFT_MESH_r = 204; + TFT_MESH_g = 153; + TFT_MESH_b = 255; } else if (selected == 7) { LOG_INFO("Setting color to Teal"); - r = 64; - g = 224; - b = 208; + TFT_MESH_r = 64; + TFT_MESH_g = 224; + TFT_MESH_b = 208; } else if (selected == 8) { LOG_INFO("Setting color to Pink"); - r = 255; - g = 105; - b = 180; + TFT_MESH_r = 255; + TFT_MESH_g = 105; + TFT_MESH_b = 180; } else if (selected == 9) { LOG_INFO("Setting color to White"); - r = 255; - g = 255; - b = 255; + TFT_MESH_r = 255; + TFT_MESH_g = 255; + TFT_MESH_b = 255; } #if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || HAS_TFT @@ -731,14 +731,14 @@ void menuHandler::TFTColorPickerMenu(OLEDDisplay *display) display->fillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); display->setColor(WHITE); - if (r == 0 && g == 0 && b == 0) { + if (TFT_MESH_r == 0 && TFT_MESH_g == 0 && TFT_MESH_b == 0) { #ifdef TFT_MESH_OVERRIDE TFT_MESH = TFT_MESH_OVERRIDE; #else TFT_MESH = COLOR565(0x67, 0xEA, 0x94); #endif } else { - TFT_MESH = COLOR565(r, g, b); + TFT_MESH = COLOR565(TFT_MESH_r, TFT_MESH_g, TFT_MESH_b); } #if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) @@ -746,10 +746,10 @@ void menuHandler::TFTColorPickerMenu(OLEDDisplay *display) #endif screen->setFrames(graphics::Screen::FOCUS_SYSTEM); - if (r == 0 && g == 0 && b == 0) { + if (TFT_MESH_r == 0 && TFT_MESH_g == 0 && TFT_MESH_b == 0) { uiconfig.screen_rgb_color = 0; } else { - uiconfig.screen_rgb_color = (r << 16) | (g << 8) | b; + uiconfig.screen_rgb_color = (TFT_MESH_r << 16) | (TFT_MESH_g << 8) | TFT_MESH_b; } LOG_INFO("Storing Value of %d to uiconfig.screen_rgb_color", uiconfig.screen_rgb_color); nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, &uiconfig); From db4e4e6e5382baeef579556947c2b96d299b58eb Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Wed, 9 Jul 2025 06:01:48 +1200 Subject: [PATCH 420/461] Heltec Wireless Paper, VM-E213 Hardware Revisions (#7258) * Tests to identify display model * (InkHUD) SSD1682 controller IC Has a few quirks, gets its own base class * (InkHUD) E0213A367 Display For Heltec Wireless Paper V1.1.1, V1.2 For Heltec VM-E213 V1.1 * (InkHUD) Select display model at boot * (BaseUI) Wrapper to combine multiple GxEPD2 drivers Workaround for issue of GxEPD2_BW objects not having a shared base class. Allows us to select a driver at runtime. https://github.com/meshtastic/firmware/issues/6851#issuecomment-2905353447 * (BaseUI) Select E-Ink model at boot * (InkHUD) SSD1682 deep sleep * (InkHUD) No deep sleep for SSD1682 * (InkHUD) Fully no-op deep sleep for SSD1682 --- src/graphics/EInkDisplay2.cpp | 26 +++- src/graphics/EInkDisplay2.h | 13 +- src/graphics/GxEPD2Multi.h | 135 ++++++++++++++++++ src/graphics/niche/Drivers/EInk/E0213A367.cpp | 84 +++++++++++ src/graphics/niche/Drivers/EInk/E0213A367.h | 41 ++++++ src/graphics/niche/Drivers/EInk/SSD1682.cpp | 41 ++++++ src/graphics/niche/Drivers/EInk/SSD1682.h | 31 ++++ .../heltec_vision_master_e213/einkDetect.h | 35 +++++ .../heltec_vision_master_e213/nicheGraphics.h | 24 +++- .../heltec_vision_master_e213/platformio.ini | 5 +- variants/heltec_wireless_paper/einkDetect.h | 35 +++++ .../heltec_wireless_paper/nicheGraphics.h | 22 ++- variants/heltec_wireless_paper/platformio.ini | 5 +- 13 files changed, 483 insertions(+), 14 deletions(-) create mode 100644 src/graphics/GxEPD2Multi.h create mode 100644 src/graphics/niche/Drivers/EInk/E0213A367.cpp create mode 100644 src/graphics/niche/Drivers/EInk/E0213A367.h create mode 100644 src/graphics/niche/Drivers/EInk/SSD1682.cpp create mode 100644 src/graphics/niche/Drivers/EInk/SSD1682.h create mode 100644 variants/heltec_vision_master_e213/einkDetect.h create mode 100644 variants/heltec_wireless_paper/einkDetect.h diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 5a2749482..66c7938b5 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -6,6 +6,10 @@ #include "main.h" #include +#ifdef GXEPD2_DRIVER_0 +#include "einkDetect.h" +#endif + /* The macros EINK_DISPLAY_MODEL, EINK_WIDTH, and EINK_HEIGHT are defined as build_flags in a variant's platformio.ini Previously, these macros were defined at the top of this file. @@ -174,9 +178,8 @@ bool EInkDisplay::connect() } } -#elif defined(HELTEC_WIRELESS_PAPER_V1_0) || defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_VISION_MASTER_E213) || \ - defined(HELTEC_VISION_MASTER_E290) || defined(TLORA_T3S3_EPAPER) || defined(CROWPANEL_ESP32S3_5_EPAPER) || \ - defined(CROWPANEL_ESP32S3_4_EPAPER) || defined(CROWPANEL_ESP32S3_2_EPAPER) +#elif defined(HELTEC_WIRELESS_PAPER_V1_0) || defined(HELTEC_VISION_MASTER_E290) || defined(TLORA_T3S3_EPAPER) || \ + defined(CROWPANEL_ESP32S3_5_EPAPER) || defined(CROWPANEL_ESP32S3_4_EPAPER) || defined(CROWPANEL_ESP32S3_2_EPAPER) { // Start HSPI hspi = new SPIClass(HSPI); @@ -232,6 +235,23 @@ bool EInkDisplay::connect() adafruitDisplay->init(); adafruitDisplay->setRotation(3); } +#elif defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_VISION_MASTER_E213) + + // Detect display model, before starting SPI + EInkDetectionResult displayModel = detectEInk(); + + // Start HSPI + hspi = new SPIClass(HSPI); + hspi->begin(PIN_EINK_SCLK, -1, PIN_EINK_MOSI, PIN_EINK_CS); // SCLK, MISO, MOSI, SS + + // Create GxEPD2 object + adafruitDisplay = new GxEPD2_Multi((uint8_t)displayModel, PIN_EINK_CS, PIN_EINK_DC, + PIN_EINK_RES, PIN_EINK_BUSY, *hspi); + + // Init GxEPD2 + adafruitDisplay->init(); + adafruitDisplay->setRotation(3); + #endif return true; diff --git a/src/graphics/EInkDisplay2.h b/src/graphics/EInkDisplay2.h index 93be197b0..284337627 100644 --- a/src/graphics/EInkDisplay2.h +++ b/src/graphics/EInkDisplay2.h @@ -5,6 +5,10 @@ #include "GxEPD2_BW.h" #include +#ifdef GXEPD2_DRIVER_0 // If variant has multiple possible display models +#include "GxEPD2Multi.h" +#endif + /** * An adapter class that allows using the GxEPD2 library as if it was an OLEDDisplay implementation. * @@ -63,8 +67,15 @@ class EInkDisplay : public OLEDDisplay // Connect to the display virtual bool connect() override; - // AdafruitGFX display object - instantiated in connect(), variant specific +#ifdef GXEPD2_DRIVER_0 + // AdafruitGFX display object - wrapper for multiple drivers + // Allows runtime detection of multiple displays + // Avoid this situation if possible! + GxEPD2_Multi *adafruitDisplay = NULL; +#else + // AdafruitGFX display object (for single display model) - instantiated in connect(), variant specific GxEPD2_BW *adafruitDisplay = NULL; +#endif // If display uses HSPI #if defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_WIRELESS_PAPER_V1_0) || defined(HELTEC_VISION_MASTER_E213) || \ diff --git a/src/graphics/GxEPD2Multi.h b/src/graphics/GxEPD2Multi.h new file mode 100644 index 000000000..f3807c9de --- /dev/null +++ b/src/graphics/GxEPD2Multi.h @@ -0,0 +1,135 @@ +// Wrapper class for GxEPD2_BW + +// Generic signature at build-time, so that we can detect display model at run-time +// Workaround for issue of GxEPD2_BW objects not having a shared base class +// Only exposes methods which we are actually using + +template class GxEPD2_Multi +{ + public: + void drawPixel(int16_t x, int16_t y, uint16_t color) + { + if (which == 0) + driver0->drawPixel(x, y, color); + else + driver1->drawPixel(x, y, color); + } + + bool nextPage() + { + if (which == 0) + return driver0->nextPage(); + else + return driver1->nextPage(); + } + + void hibernate() + { + if (which == 0) + driver0->hibernate(); + else + driver1->hibernate(); + } + + void init(uint32_t serial_diag_bitrate = 0) + { + if (which == 0) + driver0->init(serial_diag_bitrate); + else + driver1->init(serial_diag_bitrate); + } + + void init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration = 20, bool pulldown_rst_mode = false) + { + if (which == 0) + driver0->init(serial_diag_bitrate, initial, reset_duration, pulldown_rst_mode); + else + driver1->init(serial_diag_bitrate, initial, reset_duration, pulldown_rst_mode); + } + + void setRotation(uint8_t x) + { + if (which == 0) + driver0->setRotation(x); + else + driver1->setRotation(x); + } + + void setPartialWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h) + { + if (which == 0) + driver0->setPartialWindow(x, y, w, h); + else + driver1->setPartialWindow(x, y, w, h); + } + + void setFullWindow() + { + if (which == 0) + driver0->setFullWindow(); + else + driver1->setFullWindow(); + } + + int16_t width() + { + if (which == 0) + return driver0->width(); + else + return driver1->width(); + } + + int16_t height() + { + if (which == 0) + return driver0->height(); + else + return driver1->height(); + } + + void clearScreen(uint8_t value = 0xFF) + { + if (which == 0) + driver0->clearScreen(); + else + driver1->clearScreen(); + } + + void endAsyncFull() + { + if (which == 0) + driver0->endAsyncFull(); + else + driver1->endAsyncFull(); + } + + // Exposes methods of the GxEPD2_EPD object which is usually available as GxEPD2_BW::epd + class Epd2Wrapper + { + public: + bool isBusy() { return m_epd2->isBusy(); } + GxEPD2_EPD *m_epd2; + } epd2; + + // Constructor + // Select driver by passing whichDriver as 0 or 1 + GxEPD2_Multi(uint8_t whichDriver, int16_t cs, int16_t dc, int16_t rst, int16_t busy, SPIClass &spi) + { + assert(whichDriver == 0 || whichDriver == 1); + which = whichDriver; + LOG_DEBUG("GxEPD2_Multi driver: %d", which); + + if (which == 0) { + driver0 = new GxEPD2_BW(Driver0(cs, dc, rst, busy, spi)); + epd2.m_epd2 = &(driver0->epd2); + } else if (which == 1) { + driver1 = new GxEPD2_BW(Driver1(cs, dc, rst, busy, spi)); + epd2.m_epd2 = &(driver1->epd2); + } + } + + private: + uint8_t which; + GxEPD2_BW *driver0; + GxEPD2_BW *driver1; +}; \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/E0213A367.cpp b/src/graphics/niche/Drivers/EInk/E0213A367.cpp new file mode 100644 index 000000000..f19cb4ff7 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/E0213A367.cpp @@ -0,0 +1,84 @@ +#include "./E0213A367.h" + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +using namespace NicheGraphics::Drivers; + +// Map the display controller IC's output to the connected panel +void E0213A367::configScanning() +{ + // "Driver output control" + // Scan gates from 0 to 249 (vertical resolution 250px) + sendCommand(0x01); + sendData(0xF9); + sendData(0x00); +} + +// Specify which information is used to control the sequence of voltages applied to move the pixels +void E0213A367::configWaveform() +{ + // This command (0x37) is poorly documented + // As of July 2025, the datasheet for this display's controller IC is unavailable + // The values are supplied by Heltec, who presumably have privileged access to information from the display manufacturer + // Datasheet for the similar SSD1680 IC hints at the function of this command: + + // "Spare VCOM OTP selection": + // Unclear why 0x40 is set. Sane values for related SSD1680 seem to be 0x80 or 0x00. + // Maybe value is redundant? No noticeable impact when set to 0x00. + // We'll leave it set to 0x40, following Heltec's lead, just in case. + + // "Display Mode" + // Seems to specify whether a waveform stored in OTP should use display mode 1 or 2 (full refresh or differential refresh) + + // Unusual that waveforms are programmed to OTP, but this meta information is not ..? + + sendCommand(0x37); // "Write Register for Display Option" ? + sendData(0x40); // "Spare VCOM OTP selection" ? + sendData(0x80); // "Display Mode for WS[7:0]" ? + sendData(0x03); // "Display Mode for WS[15:8]" ? + sendData(0x0E); // "Display Mode [23:16]" ? + + switch (updateType) { + case FAST: + sendCommand(0x3C); // Border waveform: + sendData(0x81); // As specified by Heltec. Actually VCOM (0x80)?. Bit 0 seems redundant here. + break; + case FULL: + default: + sendCommand(0x3C); // Border waveform: + sendData(0x01); // Follow LUT 1 (blink same as white pixels) + break; + } +} + +// Tell controller IC which operations to run +void E0213A367::configUpdateSequence() +{ + switch (updateType) { + case FAST: + sendCommand(0x22); // Set "update sequence" + sendData(0xFF); // Will load LUT from OTP memory, Display mode 2 "differential refresh" + break; + case FULL: + default: + sendCommand(0x22); // Set "update sequence" + sendData(0xF7); // Will load LUT from OTP memory, Display mode 1 "full refresh" + break; + } +} + +// Once the refresh operation has been started, +// begin periodically polling the display to check for completion, using the normal Meshtastic threading code +// Only used when refresh is "async" +void E0213A367::detachFromUpdate() +{ + switch (updateType) { + case FAST: + return beginPolling(50, 500); // At least 500ms for fast refresh + case FULL: + default: + return beginPolling(100, 1500); // At least 1.5 seconds for full refresh + } +} + +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/E0213A367.h b/src/graphics/niche/Drivers/EInk/E0213A367.h new file mode 100644 index 000000000..a36fcb407 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/E0213A367.h @@ -0,0 +1,41 @@ +/* + +E-Ink display driver + - SSD1682 + - Manufacturer: SEEKINK + - Size: 2.13 inch + - Resolution: 122px x 255px + - Flex connector marking: HINK-E0213A162-A1 (hidden, printed on reverse) + +*/ + +#pragma once + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +#include "configuration.h" + +#include "./SSD1682.h" + +namespace NicheGraphics::Drivers +{ +class E0213A367 : public SSD1682 +{ + // Display properties + private: + static constexpr uint32_t width = 122; + static constexpr uint32_t height = 250; + static constexpr UpdateTypes supported = (UpdateTypes)(FULL | FAST); + + public: + E0213A367() : SSD1682(width, height, supported, 0) {} + + protected: + void configScanning() override; + void configWaveform() override; + void configUpdateSequence() override; + void detachFromUpdate() override; +}; + +} // namespace NicheGraphics::Drivers +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/SSD1682.cpp b/src/graphics/niche/Drivers/EInk/SSD1682.cpp new file mode 100644 index 000000000..c3d7f7786 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/SSD1682.cpp @@ -0,0 +1,41 @@ +#include "./SSD1682.h" + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +using namespace NicheGraphics::Drivers; + +SSD1682::SSD1682(uint16_t width, uint16_t height, EInk::UpdateTypes supported, uint8_t bufferOffsetX) + : SSD16XX(width, height, supported, bufferOffsetX) +{ +} + +// SSD1682 only accepts single-byte x and y values +// This causes an incompatibility with the default SSD16XX::configFullscreen +void SSD1682::configFullscreen() +{ + // Define the boundaries of the "fullscreen" region, for the controller IC + static const uint8_t sx = bufferOffsetX; // Notice the offset + static const uint8_t sy = 0; + static const uint8_t ex = bufferRowSize + bufferOffsetX - 1; // End is "max index", not "count". Minus 1 handles this + static const uint8_t ey = height; + + // Data entry mode - Left to Right, Top to Bottom + sendCommand(0x11); + sendData(0x03); + + // Select controller IC memory region to display a fullscreen image + sendCommand(0x44); // Memory X start - end + sendData(sx); + sendData(ex); + sendCommand(0x45); // Memory Y start - end + sendData(sy); + sendData(ey); + + // Place the cursor at the start of this memory region, ready to send image data x=0 y=0 + sendCommand(0x4E); // Memory cursor X + sendData(sx); + sendCommand(0x4F); // Memory cursor y + sendData(sy); +} + +#endif \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/SSD1682.h b/src/graphics/niche/Drivers/EInk/SSD1682.h new file mode 100644 index 000000000..ba3008537 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/SSD1682.h @@ -0,0 +1,31 @@ +/* + +E-Ink base class for displays based on SSD1682 + +SSD1682 has a few quirks. We're implementing them here in a new base class, +to avoid re-implementing them every time we need to add a new SSD1682-based display. + +*/ + +#pragma once + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +#include "configuration.h" + +#include "./SSD16XX.h" + +namespace NicheGraphics::Drivers +{ + +class SSD1682 : public SSD16XX +{ + public: + SSD1682(uint16_t width, uint16_t height, EInk::UpdateTypes supported, uint8_t bufferOffsetX = 0); + virtual void configFullscreen(); // Select memory region on controller IC + virtual void deepSleep() {} // Not usable (image memory not retained) +}; + +} // namespace NicheGraphics::Drivers + +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/variants/heltec_vision_master_e213/einkDetect.h b/variants/heltec_vision_master_e213/einkDetect.h new file mode 100644 index 000000000..35140db60 --- /dev/null +++ b/variants/heltec_vision_master_e213/einkDetect.h @@ -0,0 +1,35 @@ +#pragma once + +#include "configuration.h" + +enum class EInkDetectionResult : uint8_t { + LCMEN213EFC1 = 0, // Initial version + E0213A367 = 1, // E213 PCB marked V1.1 (Mid 2025) +}; + +EInkDetectionResult detectEInk() +{ + // Test 1: Logic of BUSY pin + + // Determines controller IC manufacturer + // Fitipower: busy when LOW + // Solomon Systech: busy when HIGH + + // Force display BUSY by holding reset pin active + pinMode(PIN_EINK_RES, OUTPUT); + digitalWrite(PIN_EINK_RES, LOW); + + delay(10); + + // Read whether pin is HIGH or LOW while busy + pinMode(PIN_EINK_BUSY, INPUT); + bool busyLogic = digitalRead(PIN_EINK_BUSY); + + // Test complete. Release pin + pinMode(PIN_EINK_RES, INPUT); + + if (busyLogic == LOW) + return EInkDetectionResult::LCMEN213EFC1; + else // busy HIGH + return EInkDetectionResult::E0213A367; +} \ No newline at end of file diff --git a/variants/heltec_vision_master_e213/nicheGraphics.h b/variants/heltec_vision_master_e213/nicheGraphics.h index 5f443e4da..6a75ad90d 100644 --- a/variants/heltec_vision_master_e213/nicheGraphics.h +++ b/variants/heltec_vision_master_e213/nicheGraphics.h @@ -18,16 +18,22 @@ // Shared NicheGraphics components // -------------------------------- +#include "graphics/niche/Drivers/EInk/E0213A367.h" #include "graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h" #include "graphics/niche/Inputs/TwoButton.h" -// Button feedback -#include "buzz.h" +#include "buzz.h" // Button feedback +#include "einkDetect.h" // Detect display model at runtime void setupNicheGraphics() { using namespace NicheGraphics; + // Detect E-Ink Model + // ------------------- + + EInkDetectionResult displayModel = detectEInk(); + // SPI // ----------------------------- @@ -38,7 +44,13 @@ void setupNicheGraphics() // E-Ink Driver // ----------------------------- - Drivers::EInk *driver = new Drivers::LCMEN213EFC1; + Drivers::EInk *driver; + + if (displayModel == EInkDetectionResult::LCMEN213EFC1) // V1 (unmarked) + driver = new Drivers::LCMEN213EFC1; + else if (displayModel == EInkDetectionResult::E0213A367) // V1.1 + driver = new Drivers::E0213A367; + driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); // InkHUD @@ -51,7 +63,11 @@ void setupNicheGraphics() // Set how many FAST updates per FULL update // Set how unhealthy additional FAST updates beyond this number are - inkhud->setDisplayResilience(10, 1.5); + + if (displayModel == EInkDetectionResult::LCMEN213EFC1) // V1 (unmarked) + inkhud->setDisplayResilience(10, 1.5); + else if (displayModel == EInkDetectionResult::E0213A367) // V1.1 + inkhud->setDisplayResilience(15, 3); // Select fonts InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; diff --git a/variants/heltec_vision_master_e213/platformio.ini b/variants/heltec_vision_master_e213/platformio.ini index 34cebb6e3..028caaeff 100644 --- a/variants/heltec_vision_master_e213/platformio.ini +++ b/variants/heltec_vision_master_e213/platformio.ini @@ -7,7 +7,8 @@ build_flags = -Ivariants/heltec_vision_master_e213 -DHELTEC_VISION_MASTER_E213 -DUSE_EINK - -DEINK_DISPLAY_MODEL=GxEPD2_213_FC1 + -DGXEPD2_DRIVER_0=GxEPD2_213_FC1 + -DGXEPD2_DRIVER_1=GxEPD2_213_E0213A367 -DEINK_WIDTH=250 -DEINK_HEIGHT=122 -DUSE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk @@ -16,7 +17,7 @@ build_flags = -DEINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting" lib_deps = ${esp32s3_base.lib_deps} - https://github.com/meshtastic/GxEPD2/archive/b202ebfec6a4821e098cf7a625ba0f6f2400292d.zip + https://github.com/meshtastic/GxEPD2/archive/1655054ba298e0e29fc2044741940f927f9c2a43.zip lewisxhe/PCF8563_Library@^1.0.1 upload_speed = 115200 diff --git a/variants/heltec_wireless_paper/einkDetect.h b/variants/heltec_wireless_paper/einkDetect.h new file mode 100644 index 000000000..93b3f86e3 --- /dev/null +++ b/variants/heltec_wireless_paper/einkDetect.h @@ -0,0 +1,35 @@ +#pragma once + +#include "configuration.h" + +enum class EInkDetectionResult : uint8_t { + LCMEN213EFC1 = 0, // V1.1 + E0213A367 = 1, // V1.1.1, V1.2 +}; + +EInkDetectionResult detectEInk() +{ + // Test 1: Logic of BUSY pin + + // Determines controller IC manufacturer + // Fitipower: busy when LOW + // Solomon Systech: busy when HIGH + + // Force display BUSY by holding reset pin active + pinMode(PIN_EINK_RES, OUTPUT); + digitalWrite(PIN_EINK_RES, LOW); + + delay(10); + + // Read whether pin is HIGH or LOW while busy + pinMode(PIN_EINK_BUSY, INPUT); + bool busyLogic = digitalRead(PIN_EINK_BUSY); + + // Test complete. Release pin + pinMode(PIN_EINK_RES, INPUT); + + if (busyLogic == LOW) + return EInkDetectionResult::LCMEN213EFC1; + else // busy HIGH + return EInkDetectionResult::E0213A367; +} \ No newline at end of file diff --git a/variants/heltec_wireless_paper/nicheGraphics.h b/variants/heltec_wireless_paper/nicheGraphics.h index cbf80bc5e..445b57714 100644 --- a/variants/heltec_wireless_paper/nicheGraphics.h +++ b/variants/heltec_wireless_paper/nicheGraphics.h @@ -18,13 +18,21 @@ // Shared NicheGraphics components // -------------------------------- +#include "graphics/niche/Drivers/EInk/E0213A367.h" #include "graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h" #include "graphics/niche/Inputs/TwoButton.h" +#include "einkDetect.h" // Detect display model at runtime + void setupNicheGraphics() { using namespace NicheGraphics; + // Detect E-Ink Model + // ------------------- + + EInkDetectionResult displayModel = detectEInk(); + // SPI // ----------------------------- @@ -35,7 +43,13 @@ void setupNicheGraphics() // E-Ink Driver // ----------------------------- - Drivers::EInk *driver = new Drivers::LCMEN213EFC1; + Drivers::EInk *driver; + + if (displayModel == EInkDetectionResult::LCMEN213EFC1) // V1.1 + driver = new Drivers::LCMEN213EFC1; + else if (displayModel == EInkDetectionResult::E0213A367) // V1.1.1, V1.2 + driver = new Drivers::E0213A367; + driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); // InkHUD @@ -48,7 +62,11 @@ void setupNicheGraphics() // Set how many FAST updates per FULL update // Set how unhealthy additional FAST updates beyond this number are - inkhud->setDisplayResilience(10, 1.5); + + if (displayModel == EInkDetectionResult::LCMEN213EFC1) // V1.1 (unmarked) + inkhud->setDisplayResilience(10, 1.5); + else if (displayModel == EInkDetectionResult::E0213A367) // V1.1.1, V1.2 + inkhud->setDisplayResilience(15, 3); // Select fonts InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; diff --git a/variants/heltec_wireless_paper/platformio.ini b/variants/heltec_wireless_paper/platformio.ini index ce5b5e533..790646056 100644 --- a/variants/heltec_wireless_paper/platformio.ini +++ b/variants/heltec_wireless_paper/platformio.ini @@ -7,7 +7,8 @@ build_flags = ${esp32s3_base.build_flags} -I variants/heltec_wireless_paper -D HELTEC_WIRELESS_PAPER - -D EINK_DISPLAY_MODEL=GxEPD2_213_FC1 + -D GXEPD2_DRIVER_0=GxEPD2_213_FC1 + -D GXEPD2_DRIVER_1=GxEPD2_213_E0213A367 -D EINK_WIDTH=250 -D EINK_HEIGHT=122 -D USE_EINK @@ -17,7 +18,7 @@ build_flags = -D EINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting" lib_deps = ${esp32s3_base.lib_deps} - https://github.com/meshtastic/GxEPD2/archive/b202ebfec6a4821e098cf7a625ba0f6f2400292d.zip + https://github.com/meshtastic/GxEPD2/archive/1655054ba298e0e29fc2044741940f927f9c2a43.zip lewisxhe/PCF8563_Library@^1.0.1 upload_speed = 115200 From 916587c2a6344675a4ddd4701a2501f078f7b6a8 Mon Sep 17 00:00:00 2001 From: Jason P Date: Tue, 8 Jul 2025 13:38:07 -0500 Subject: [PATCH 421/461] Update Bluetooth Toggle to match other variants (#7269) --- src/graphics/draw/MenuHandler.cpp | 24 ++++++++++++++++++++++-- src/graphics/draw/MenuHandler.h | 4 +++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index a66ccd983..978700fd7 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -337,8 +337,8 @@ void menuHandler::homeBaseMenu() } else if (selected == Freetext) { cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST); } else if (selected == Bluetooth) { - InputEvent event = {.inputEvent = (input_broker_event)170, .kbchar = 170, .touchX = 0, .touchY = 0}; - inputBroker->injectInputEvent(&event); + menuQueue = bluetooth_toggle_menu; + screen->runNow(); } }; screen->showOverlayBanner(bannerOptions); @@ -587,6 +587,23 @@ void menuHandler::GPSToggleMenu() } #endif +void menuHandler::BluetoothToggleMenu() +{ + static const char *optionsArray[] = {"Back", "Enabled", "Disabled"}; + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Toggle Bluetooth"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 3; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == 1 || selected == 2) { + InputEvent event = {.inputEvent = (input_broker_event)170, .kbchar = 170, .touchX = 0, .touchY = 0}; + inputBroker->injectInputEvent(&event); + } + }; + bannerOptions.InitialSelected = config.bluetooth.enabled ? 1 : 2; + screen->showOverlayBanner(bannerOptions); +} + void menuHandler::BuzzerModeMenu() { static const char *optionsArray[] = {"All Enabled", "Disabled", "Notifications", "System Only"}; @@ -935,6 +952,9 @@ void menuHandler::handleMenuSwitch(OLEDDisplay *display) case wifi_toggle_menu: wifiToggleMenu(); break; + case bluetooth_toggle_menu: + BluetoothToggleMenu(); + break; } menuQueue = menu_none; } diff --git a/src/graphics/draw/MenuHandler.h b/src/graphics/draw/MenuHandler.h index 8824e38ed..d2169ca3c 100644 --- a/src/graphics/draw/MenuHandler.h +++ b/src/graphics/draw/MenuHandler.h @@ -25,7 +25,8 @@ class menuHandler remove_favorite, test_menu, number_test, - wifi_toggle_menu + wifi_toggle_menu, + bluetooth_toggle_menu }; static screenMenus menuQueue; @@ -55,6 +56,7 @@ class menuHandler static void numberTest(); static void wifiBaseMenu(); static void wifiToggleMenu(); + static void BluetoothToggleMenu(); }; } // namespace graphics \ No newline at end of file From 999e1207a5a959bd6aca1a2732915b54523981ca Mon Sep 17 00:00:00 2001 From: Jason P Date: Tue, 8 Jul 2025 14:38:38 -0500 Subject: [PATCH 422/461] Show user which option is currently elected (#7271) --- src/graphics/draw/MenuHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 978700fd7..c750b72c9 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -136,6 +136,7 @@ void menuHandler::ClockFacePicker() screen->setFrames(Screen::FOCUS_CLOCK); } }; + bannerOptions.InitialSelected = uiconfig.is_clockface_analog ? 2 : 1; screen->showOverlayBanner(bannerOptions); } From 354f14933884d916ca29424e004a6ffc3b6372c6 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 8 Jul 2025 15:12:44 -0500 Subject: [PATCH 423/461] Make PacketHistory logging less chatty (#7272) --- boards/heltec_mesh_node_t114.json | 3 ++- src/mesh/PacketHistory.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/boards/heltec_mesh_node_t114.json b/boards/heltec_mesh_node_t114.json index d516c9701..eda0ac3df 100644 --- a/boards/heltec_mesh_node_t114.json +++ b/boards/heltec_mesh_node_t114.json @@ -10,7 +10,8 @@ "hwids": [ ["0x239A", "0x4405"], ["0x239A", "0x0029"], - ["0x239A", "0x002A"] + ["0x239A", "0x002A"], + ["0x2886", "0x1667"] ], "usb_product": "HT-n5262", "mcu": "nrf52840", diff --git a/src/mesh/PacketHistory.cpp b/src/mesh/PacketHistory.cpp index f42b151c8..8cac31a3e 100644 --- a/src/mesh/PacketHistory.cpp +++ b/src/mesh/PacketHistory.cpp @@ -246,8 +246,10 @@ void PacketHistory::insert(PacketRecord &r) #if RECENT_WARN_AGE > 0 if (tu->rxTimeMsec && (OldtrxTimeMsec < RECENT_WARN_AGE)) { if (!(tu->id == r.id && tu->sender == r.sender)) { +#if VERBOSE_PACKET_HISTORY LOG_WARN("Packet History - insert: Reusing slot aged %ds < %ds RECENT_WARN_AGE", OldtrxTimeMsec / 1000, RECENT_WARN_AGE / 1000); +#endif } else { // debug only #if VERBOSE_PACKET_HISTORY @@ -275,7 +277,9 @@ void PacketHistory::insert(PacketRecord &r) #endif if (r.rxTimeMsec == 0) { +#if VERBOSE_PACKET_HISTORY LOG_WARN("Packet History - insert: I will not store packet with rxTimeMsec = 0."); +#endif return; // Return early if we can't update the history } From 00495140bd8f2651158fb268bb175a2190110d74 Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 8 Jul 2025 16:14:05 -0400 Subject: [PATCH 424/461] GitHub Actions faster!! (#7268) Use new meshtastic/gh-action-firmware Action Co-authored-by: Ben Meadors --- .github/workflows/build_esp32.yml | 35 +++++++++++---------- .github/workflows/build_esp32_c3.yml | 35 +++++++++++---------- .github/workflows/build_esp32_c6.yml | 35 +++++++++++---------- .github/workflows/build_esp32_s3.yml | 35 +++++++++++---------- .github/workflows/build_nrf52.yml | 26 +++++++++------ .github/workflows/build_rpi2040.yml | 24 +++++++++----- .github/workflows/build_stm32.yml | 24 +++++++++----- .github/workflows/main_matrix.yml | 3 +- .github/workflows/nightly.yml | 2 ++ .github/workflows/sec_sast_semgrep_cron.yml | 1 + .github/workflows/stale_bot.yml | 1 + .github/workflows/tests.yml | 2 ++ bin/{build-rpi2040.sh => build-rp2xx0.sh} | 0 bin/{build-stm32.sh => build-stm32wl.sh} | 0 14 files changed, 135 insertions(+), 88 deletions(-) rename bin/{build-rpi2040.sh => build-rp2xx0.sh} (100%) rename bin/{build-stm32.sh => build-stm32wl.sh} (100%) diff --git a/.github/workflows/build_esp32.yml b/.github/workflows/build_esp32.yml index 616f51746..32cd45000 100644 --- a/.github/workflows/build_esp32.yml +++ b/.github/workflows/build_esp32.yml @@ -11,27 +11,30 @@ permissions: read-all jobs: build-esp32: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build ESP32 id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - remove-debug-flags: >- - ./arch/esp32/esp32.ini - ./arch/esp32/esp32s2.ini - ./arch/esp32/esp32s3.ini - ./arch/esp32/esp32c3.ini - ./arch/esp32/esp32c6.ini - build-script-path: bin/build-esp32.sh - ota-firmware-source: firmware.bin - ota-firmware-target: release/bleota.bin - artifact-paths: | + pio_platform: esp32 + pio_env: ${{ inputs.board }} + pio_target: build + ota_firmware_source: firmware.bin + ota_firmware_target: release/bleota.bin + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-esp32-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.bin release/*.elf - #include-web-ui: true - arch: esp32 diff --git a/.github/workflows/build_esp32_c3.yml b/.github/workflows/build_esp32_c3.yml index 1b6b832e9..161786f99 100644 --- a/.github/workflows/build_esp32_c3.yml +++ b/.github/workflows/build_esp32_c3.yml @@ -11,27 +11,30 @@ permissions: read-all jobs: build-esp32-c3: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build ESP32-C3 id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - remove-debug-flags: >- - ./arch/esp32/esp32.ini - ./arch/esp32/esp32s2.ini - ./arch/esp32/esp32s3.ini - ./arch/esp32/esp32c3.ini - ./arch/esp32/esp32c6.ini - build-script-path: bin/build-esp32.sh - ota-firmware-source: firmware-c3.bin - ota-firmware-target: release/bleota-c3.bin - artifact-paths: | + pio_platform: esp32 + pio_env: ${{ inputs.board }} + pio_target: build + ota_firmware_source: firmware-c3.bin + ota_firmware_target: release/bleota-c3.bin + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-esp32c3-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.bin release/*.elf - #include-web-ui: true - arch: esp32c3 diff --git a/.github/workflows/build_esp32_c6.yml b/.github/workflows/build_esp32_c6.yml index 29dac51e1..90cdcc78e 100644 --- a/.github/workflows/build_esp32_c6.yml +++ b/.github/workflows/build_esp32_c6.yml @@ -11,27 +11,30 @@ permissions: read-all jobs: build-esp32-c6: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build ESP32-C6 id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - remove-debug-flags: >- - ./arch/esp32/esp32.ini - ./arch/esp32/esp32s2.ini - ./arch/esp32/esp32s3.ini - ./arch/esp32/esp32c3.ini - ./arch/esp32/esp32c6.ini - build-script-path: bin/build-esp32.sh - ota-firmware-source: firmware-c3.bin - ota-firmware-target: release/bleota-c3.bin - artifact-paths: | + pio_platform: esp32 + pio_env: ${{ inputs.board }} + pio_target: build + ota_firmware_source: firmware-c3.bin + ota_firmware_target: release/bleota-c3.bin + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-esp32c6-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.bin release/*.elf - #include-web-ui: true - arch: esp32c6 diff --git a/.github/workflows/build_esp32_s3.yml b/.github/workflows/build_esp32_s3.yml index 7e0373503..e5ed48e3e 100644 --- a/.github/workflows/build_esp32_s3.yml +++ b/.github/workflows/build_esp32_s3.yml @@ -11,27 +11,30 @@ permissions: read-all jobs: build-esp32-s3: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build ESP32-S3 id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - remove-debug-flags: >- - ./arch/esp32/esp32.ini - ./arch/esp32/esp32s2.ini - ./arch/esp32/esp32s3.ini - ./arch/esp32/esp32c3.ini - ./arch/esp32/esp32c6.ini - build-script-path: bin/build-esp32.sh - ota-firmware-source: firmware-s3.bin - ota-firmware-target: release/bleota-s3.bin - artifact-paths: | + pio_platform: esp32 + pio_env: ${{ inputs.board }} + pio_target: build + ota_firmware_source: firmware-s3.bin + ota_firmware_target: release/bleota-s3.bin + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-esp32s3-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.bin release/*.elf - #include-web-ui: true - arch: esp32s3 diff --git a/.github/workflows/build_nrf52.yml b/.github/workflows/build_nrf52.yml index 786508f86..5fe00abed 100644 --- a/.github/workflows/build_nrf52.yml +++ b/.github/workflows/build_nrf52.yml @@ -11,20 +11,28 @@ permissions: read-all jobs: build-nrf52: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build NRF52 id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - build-script-path: bin/build-nrf52.sh - artifact-paths: | - release/*.hex + pio_platform: nrf52 + pio_env: ${{ inputs.board }} + pio_target: build + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-nrf52840-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.uf2 release/*.elf - release/*.zip - arch: nrf52840 diff --git a/.github/workflows/build_rpi2040.yml b/.github/workflows/build_rpi2040.yml index 53fee34d2..2abd7a839 100644 --- a/.github/workflows/build_rpi2040.yml +++ b/.github/workflows/build_rpi2040.yml @@ -11,18 +11,28 @@ permissions: read-all jobs: build-rpi2040: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build Raspberry Pi 2040 id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - build-script-path: bin/build-rpi2040.sh - artifact-paths: | + pio_platform: rp2xx0 + pio_env: ${{ inputs.board }} + pio_target: build + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-rp2040-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.uf2 release/*.elf - arch: rp2040 diff --git a/.github/workflows/build_stm32.yml b/.github/workflows/build_stm32.yml index dc469d994..10680f422 100644 --- a/.github/workflows/build_stm32.yml +++ b/.github/workflows/build_stm32.yml @@ -11,19 +11,29 @@ permissions: read-all jobs: build-stm32: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + - name: Get release version string + shell: bash + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + - name: Build STM32WL id: build - uses: ./.github/actions/build-variant + uses: meshtastic/gh-action-firmware@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} - board: ${{ inputs.board }} - build-script-path: bin/build-stm32.sh - artifact-paths: | + pio_platform: stm32wl + pio_env: ${{ inputs.board }} + pio_target: build + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-stm32-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + overwrite: true + path: | release/*.hex release/*.bin release/*.elf - arch: stm32 diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 03e61d572..a676efa1e 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -135,6 +135,7 @@ jobs: board: ${{ matrix.board }} build-debian-src: + if: github.repository == 'meshtastic/firmware' uses: ./.github/workflows/build_debian_src.yml with: series: UNRELEASED @@ -425,7 +426,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} publish-firmware: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 if: ${{ github.event_name == 'workflow_dispatch' }} needs: [release-firmware] env: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 36ec22f17..309772b12 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -8,6 +8,7 @@ permissions: read-all jobs: trunk_check: + if: github.repository == 'meshtastic/firmware' name: Trunk Check and Upload runs-on: ubuntu-24.04 @@ -21,6 +22,7 @@ jobs: trunk-token: ${{ secrets.TRUNK_TOKEN }} trunk_upgrade: + if: github.repository == 'meshtastic/firmware' # See: https://github.com/trunk-io/trunk-action/blob/v1/readme.md#automatic-upgrades name: Trunk Upgrade (PR) runs-on: ubuntu-24.04 diff --git a/.github/workflows/sec_sast_semgrep_cron.yml b/.github/workflows/sec_sast_semgrep_cron.yml index d7eef29b4..e391aa07b 100644 --- a/.github/workflows/sec_sast_semgrep_cron.yml +++ b/.github/workflows/sec_sast_semgrep_cron.yml @@ -13,6 +13,7 @@ permissions: jobs: semgrep-full: + if: github.repository == 'meshtastic/firmware' runs-on: ubuntu-24.04 container: image: semgrep/semgrep diff --git a/.github/workflows/stale_bot.yml b/.github/workflows/stale_bot.yml index 5ae6bdfc9..5a11fdfa8 100644 --- a/.github/workflows/stale_bot.yml +++ b/.github/workflows/stale_bot.yml @@ -11,6 +11,7 @@ permissions: jobs: stale_issues: + if: github.repository == 'meshtastic/firmware' name: Close Stale Issues runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 28b6a40a5..34b28b39c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,9 +12,11 @@ permissions: jobs: native-tests: + if: github.repository == 'meshtastic/firmware' uses: ./.github/workflows/test_native.yml hardware-tests: + if: github.repository == 'meshtastic/firmware' runs-on: test-runner steps: - name: Checkout code diff --git a/bin/build-rpi2040.sh b/bin/build-rp2xx0.sh similarity index 100% rename from bin/build-rpi2040.sh rename to bin/build-rp2xx0.sh diff --git a/bin/build-stm32.sh b/bin/build-stm32wl.sh similarity index 100% rename from bin/build-stm32.sh rename to bin/build-stm32wl.sh From 19d831d20d30a19375c1d198f40d70f1dead4d91 Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 8 Jul 2025 21:33:59 -0400 Subject: [PATCH 425/461] Whoops! Re-Add nRF52 OTA zips (#7275) --- .github/workflows/build_nrf52.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_nrf52.yml b/.github/workflows/build_nrf52.yml index 5fe00abed..0ff3ce934 100644 --- a/.github/workflows/build_nrf52.yml +++ b/.github/workflows/build_nrf52.yml @@ -36,3 +36,4 @@ jobs: path: | release/*.uf2 release/*.elf + release/*-ota.zip From f6d378255c3bec3b116bfd19c901b9cd80e89d9c Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 8 Jul 2025 23:53:51 -0400 Subject: [PATCH 426/461] Actions: Re-Add nrf52 hex release (rak4631) (#7276) --- .github/workflows/build_nrf52.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_nrf52.yml b/.github/workflows/build_nrf52.yml index 0ff3ce934..312aeb372 100644 --- a/.github/workflows/build_nrf52.yml +++ b/.github/workflows/build_nrf52.yml @@ -36,4 +36,5 @@ jobs: path: | release/*.uf2 release/*.elf + release/*.hex release/*-ota.zip From a7e516d6f61abc7a8cf5d2649b0ab51afec579f9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 15:11:05 +0800 Subject: [PATCH 427/461] Update Adafruit INA260 to v1.5.3 (#7270) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 5ba5e63e0..89720f0ad 100644 --- a/platformio.ini +++ b/platformio.ini @@ -129,7 +129,7 @@ lib_deps = # renovate: datasource=custom.pio depName=Adafruit MCP9808 packageName=adafruit/library/Adafruit MCP9808 Library adafruit/Adafruit MCP9808 Library@2.0.2 # renovate: datasource=custom.pio depName=Adafruit INA260 packageName=adafruit/library/Adafruit INA260 Library - adafruit/Adafruit INA260 Library@1.5.2 + adafruit/Adafruit INA260 Library@1.5.3 # renovate: datasource=custom.pio depName=Adafruit INA219 packageName=adafruit/library/Adafruit INA219 adafruit/Adafruit INA219@1.2.3 # renovate: datasource=custom.pio depName=Adafruit PM25 AQI Sensor packageName=adafruit/library/Adafruit PM25 AQI Sensor From 0795b21c2b24addab178d26bc4880f2d97ec625c Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 10 Jul 2025 09:45:36 -0500 Subject: [PATCH 428/461] Key verification flow on BaseUI (#7240) --- src/graphics/Screen.cpp | 5 +- src/graphics/Screen.h | 9 +- src/graphics/draw/MenuHandler.cpp | 155 +++++++++++++-------- src/graphics/draw/MenuHandler.h | 12 +- src/graphics/draw/NotificationRenderer.cpp | 72 +++++++--- src/graphics/draw/NotificationRenderer.h | 3 +- src/meshUtils.h | 5 +- src/modules/CannedMessageModule.cpp | 6 +- src/modules/KeyVerificationModule.cpp | 62 ++++----- src/modules/KeyVerificationModule.h | 7 +- variants/t-deck/variant.h | 1 + 11 files changed, 211 insertions(+), 126 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 5d33feb4d..2bade47b2 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -171,7 +171,7 @@ void Screen::showOverlayBanner(BannerOverlayOptions banner_overlay_options) } // Called to trigger a banner with custom message and duration -void Screen::showNodePicker(const char *message, uint32_t durationMs, std::function bannerCallback) +void Screen::showNodePicker(const char *message, uint32_t durationMs, std::function bannerCallback) { #ifdef USE_EINK EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip full refresh for all overlay menus @@ -196,7 +196,6 @@ void Screen::showNodePicker(const char *message, uint32_t durationMs, std::funct void Screen::showNumberPicker(const char *message, uint32_t durationMs, uint8_t digits, std::function bannerCallback) { - LOG_WARN("Show Number Picker"); #ifdef USE_EINK EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip full refresh for all overlay menus #endif @@ -1330,7 +1329,7 @@ int Screen::handleInputEvent(const InputEvent *event) setFastFramerate(); // Draw ASAP #endif if (NotificationRenderer::isOverlayBannerShowing()) { - NotificationRenderer::inEvent = event->inputEvent; + NotificationRenderer::inEvent = *event; static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawBannercallback}; ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); setFastFramerate(); // Draw ASAP diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index a486f99f8..4deeb7395 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -92,6 +92,7 @@ class Screen #include "commands.h" #include "concurrency/LockGuard.h" #include "concurrency/OSThread.h" +#include "graphics/draw/MenuHandler.h" #include "input/InputBroker.h" #include "mesh/MeshModule.h" #include "modules/AdminModule.h" @@ -308,9 +309,15 @@ class Screen : public concurrency::OSThread void showSimpleBanner(const char *message, uint32_t durationMs = 0); void showOverlayBanner(BannerOverlayOptions); - void showNodePicker(const char *message, uint32_t durationMs, std::function bannerCallback); + void showNodePicker(const char *message, uint32_t durationMs, std::function bannerCallback); void showNumberPicker(const char *message, uint32_t durationMs, uint8_t digits, std::function bannerCallback); + void requestMenu(graphics::menuHandler::screenMenus menuToShow) + { + graphics::menuHandler::menuQueue = menuToShow; + runNow(); + } + void startFirmwareUpdateScreen() { ScreenCmd cmd; diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index c750b72c9..c3a035c4f 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -13,6 +13,7 @@ #include "main.h" #include "modules/AdminModule.h" #include "modules/CannedMessageModule.h" +#include "modules/KeyVerificationModule.h" extern uint16_t TFT_MESH; @@ -237,27 +238,25 @@ void menuHandler::clockMenu() void menuHandler::messageResponseMenu() { + enum optionsNumbers { Back = 0, Dismiss = 1, Preset = 2, Freetext = 3, Aloud = 4, enumEnd = 5 }; + + static const char *optionsArray[enumEnd] = {"Back", "Dismiss", "Reply via Preset"}; + static int optionsEnumArray[enumEnd] = {Back, Dismiss, Preset}; + int options = 3; - static const char **optionsArrayPtr; - int options; - enum optionsNumbers { Back = 0, Dismiss = 1, Preset = 2, Freetext = 3 }; if (kb_found) { - static const char *optionsArray[] = {"Back", "Dismiss", "Reply via Preset", "Reply via Freetext"}; - optionsArrayPtr = optionsArray; - options = 4; - } else { - static const char *optionsArray[] = {"Back", "Dismiss", "Reply via Preset"}; - optionsArrayPtr = optionsArray; - options = 3; + optionsArray[options] = "Reply via Freetext"; + optionsEnumArray[options++] = Freetext; } + #ifdef HAS_I2S - static const char *optionsArray[] = {"Back", "Dismiss", "Reply via Preset", "Reply via Freetext", "Read Aloud"}; - optionsArrayPtr = optionsArray; - options = 5; + optionsArray[options] = "Read Aloud"; + optionsEnumArray[options++] = Aloud; #endif BannerOverlayOptions bannerOptions; bannerOptions.message = "Message Action"; - bannerOptions.optionsArrayPtr = optionsArrayPtr; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsEnumPtr = optionsEnumArray; bannerOptions.optionsCount = options; bannerOptions.bannerCallback = [](int selected) -> void { if (selected == Dismiss) { @@ -276,7 +275,7 @@ void menuHandler::messageResponseMenu() } } #ifdef HAS_I2S - else if (selected == 4) { + else if (selected == Aloud) { const meshtastic_MeshPacket &mp = devicestate.rx_text_message; const char *msg = reinterpret_cast(mp.decoded.payload.bytes); @@ -289,10 +288,10 @@ void menuHandler::messageResponseMenu() void menuHandler::homeBaseMenu() { - enum optionsNumbers { Back, Backlight, Position, Preset, Freetext, Bluetooth, Sleep }; + enum optionsNumbers { Back, Backlight, Position, Preset, Freetext, Bluetooth, Sleep, enumEnd }; - static const char *optionsArray[6] = {"Back"}; - static int optionsEnumArray[6] = {Back}; + static const char *optionsArray[enumEnd] = {"Back"}; + static int optionsEnumArray[enumEnd] = {Back}; int options = 1; #ifdef PIN_EINK_EN @@ -354,9 +353,9 @@ void menuHandler::systemBaseMenu() hasSupportBrightness = true; #endif - enum optionsNumbers { Back, Beeps, Brightness, Reboot, Color, MUI, Test }; - static const char *optionsArray[7] = {"Back"}; - static int optionsEnumArray[7] = {Back}; + enum optionsNumbers { Back, Beeps, Brightness, Reboot, Color, MUI, Test, enumEnd }; + static const char *optionsArray[enumEnd] = {"Back"}; + static int optionsEnumArray[enumEnd] = {Back}; int options = 1; optionsArray[options] = "Reboot"; @@ -419,21 +418,22 @@ void menuHandler::systemBaseMenu() void menuHandler::favoriteBaseMenu() { - int options; - static const char **optionsArrayPtr; + enum optionsNumbers { Back, Preset, Freetext, Remove, enumEnd }; + static const char *optionsArray[enumEnd] = {"Back", "New Preset Msg"}; + static int optionsEnumArray[enumEnd] = {Back, Preset}; + int options = 2; if (kb_found) { - static const char *optionsArray[] = {"Back", "New Preset Msg", "New Freetext Msg", "Remove Favorite"}; - optionsArrayPtr = optionsArray; - options = 4; - } else { - static const char *optionsArray[] = {"Back", "New Preset Msg", "Remove Favorite"}; - optionsArrayPtr = optionsArray; - options = 3; + optionsArray[options] = "New Freetext Msg"; + optionsEnumArray[options++] = Freetext; } + optionsArray[options] = "Remove Favorite"; + optionsEnumArray[options++] = Remove; + BannerOverlayOptions bannerOptions; bannerOptions.message = "Favorites Action"; - bannerOptions.optionsArrayPtr = optionsArrayPtr; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsEnumPtr = optionsEnumArray; bannerOptions.optionsCount = options; bannerOptions.bannerCallback = [](int selected) -> void { if (selected == 1) { @@ -450,34 +450,29 @@ void menuHandler::favoriteBaseMenu() void menuHandler::positionBaseMenu() { - int options; - static const char **optionsArrayPtr; - static const char *optionsArray[] = {"Back", "GPS Toggle", "Compass"}; - static const char *optionsArrayCalibrate[] = {"Back", "GPS Toggle", "Compass", "Compass Calibrate"}; + enum optionsNumbers { Back, GPSToggle, CompassMenu, CompassCalibrate, enumEnd }; + + static const char *optionsArray[enumEnd] = {"Back", "GPS Toggle", "Compass"}; + static int optionsEnumArray[enumEnd] = {Back, GPSToggle, CompassMenu}; + int options = 3; if (accelerometerThread) { - optionsArrayPtr = optionsArrayCalibrate; - options = 4; - } else { - optionsArrayPtr = optionsArray; - options = 3; + optionsArray[options] = "Compass Calibrate"; + optionsEnumArray[options++] = CompassCalibrate; } BannerOverlayOptions bannerOptions; bannerOptions.message = "Position Action"; - bannerOptions.optionsArrayPtr = optionsArrayPtr; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsEnumPtr = optionsEnumArray; bannerOptions.optionsCount = options; bannerOptions.bannerCallback = [](int selected) -> void { - if (selected == 1) { -#if MESHTASTIC_EXCLUDE_GPS - menuQueue = menu_none; -#else + if (selected == GPSToggle) { menuQueue = gps_toggle_menu; screen->runNow(); -#endif - } else if (selected == 2) { + } else if (selected == CompassMenu) { menuQueue = compass_point_north_menu; screen->runNow(); - } else if (selected == 3) { + } else if (selected == CompassCalibrate) { accelerometerThread->calibrate(30); } }; @@ -486,16 +481,20 @@ void menuHandler::positionBaseMenu() void menuHandler::nodeListMenu() { - static const char *optionsArray[] = {"Back", "Add Favorite", "Reset NodeDB"}; + enum optionsNumbers { Back, Favorite, Verify, Reset }; + static const char *optionsArray[] = {"Back", "Add Favorite", "Key Verification", "Reset NodeDB"}; BannerOverlayOptions bannerOptions; bannerOptions.message = "Node Action"; bannerOptions.optionsArrayPtr = optionsArray; - bannerOptions.optionsCount = 3; + bannerOptions.optionsCount = 4; bannerOptions.bannerCallback = [](int selected) -> void { - if (selected == 1) { + if (selected == Favorite) { menuQueue = add_favorite; screen->runNow(); - } else if (selected == 2) { + } else if (selected == Verify) { + menuQueue = key_verification_init; + screen->runNow(); + } else if (selected == Reset) { menuQueue = reset_node_db_menu; screen->runNow(); } @@ -523,6 +522,7 @@ void menuHandler::resetNodeDBMenu() void menuHandler::compassNorthMenu() { + enum optionsNumbers { Back, Dynamic, Fixed, Freeze }; static const char *optionsArray[] = {"Back", "Dynamic", "Fixed Ring", "Freeze Heading"}; BannerOverlayOptions bannerOptions; bannerOptions.message = "North Directions?"; @@ -530,28 +530,28 @@ void menuHandler::compassNorthMenu() bannerOptions.optionsCount = 4; bannerOptions.InitialSelected = uiconfig.compass_mode + 1; bannerOptions.bannerCallback = [](int selected) -> void { - if (selected == 1) { + if (selected == Dynamic) { if (uiconfig.compass_mode != meshtastic_CompassMode_DYNAMIC) { uiconfig.compass_mode = meshtastic_CompassMode_DYNAMIC; nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, &uiconfig); screen->setFrames(graphics::Screen::FOCUS_PRESERVE); } - } else if (selected == 2) { + } else if (selected == Fixed) { if (uiconfig.compass_mode != meshtastic_CompassMode_FIXED_RING) { uiconfig.compass_mode = meshtastic_CompassMode_FIXED_RING; nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, &uiconfig); screen->setFrames(graphics::Screen::FOCUS_PRESERVE); } - } else if (selected == 3) { + } else if (selected == Freeze) { if (uiconfig.compass_mode != meshtastic_CompassMode_FREEZE_HEADING) { uiconfig.compass_mode = meshtastic_CompassMode_FREEZE_HEADING; nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, &uiconfig); screen->setFrames(graphics::Screen::FOCUS_PRESERVE); } - } else if (selected == 0) { + } else if (selected == Back) { menuQueue = position_base_menu; screen->runNow(); } @@ -562,6 +562,7 @@ void menuHandler::compassNorthMenu() #if !MESHTASTIC_EXCLUDE_GPS void menuHandler::GPSToggleMenu() { + static const char *optionsArray[] = {"Back", "Enabled", "Disabled"}; BannerOverlayOptions bannerOptions; bannerOptions.message = "Toggle GPS"; @@ -796,7 +797,7 @@ void menuHandler::rebootMenu() void menuHandler::addFavoriteMenu() { - screen->showNodePicker("Node To Favorite", 30000, [](int nodenum) -> void { + screen->showNodePicker("Node To Favorite", 30000, [](uint32_t nodenum) -> void { LOG_WARN("Nodenum: %u", nodenum); nodeDB->set_favorite(true, nodenum); screen->setFrames(graphics::Screen::FOCUS_PRESERVE); @@ -887,6 +888,37 @@ void menuHandler::wifiToggleMenu() screen->showOverlayBanner(bannerOptions); } +void menuHandler::keyVerificationInitMenu() +{ + screen->showNodePicker("Node to Verify", 30000, + [](uint32_t selected) -> void { keyVerificationModule->sendInitialRequest(selected); }); +} + +void menuHandler::keyVerificationFinalPrompt() +{ + char message[40] = {0}; + memset(message, 0, sizeof(message)); + sprintf(message, "Verification: \n"); + keyVerificationModule->generateVerificationCode(message + 15); // send the toPhone packet + + if (screen) { + static const char *optionsArray[] = {"Reject", "Accept"}; + graphics::BannerOverlayOptions options; + options.message = message; + options.durationMs = 30000; + options.optionsArrayPtr = optionsArray; + options.optionsCount = 2; + options.notificationType = graphics::notificationTypeEnum::selection_picker; + options.bannerCallback = [=](int selected) { + if (selected == 1) { + auto remoteNodePtr = nodeDB->getMeshNode(keyVerificationModule->getCurrentRemoteNode()); + remoteNodePtr->bitfield |= NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK; + } + }; + screen->showOverlayBanner(options); + } +} + void menuHandler::handleMenuSwitch(OLEDDisplay *display) { if (menuQueue != menu_none) @@ -953,9 +985,18 @@ void menuHandler::handleMenuSwitch(OLEDDisplay *display) case wifi_toggle_menu: wifiToggleMenu(); break; + case key_verification_init: + keyVerificationInitMenu(); + break; + case key_verification_final_prompt: + keyVerificationFinalPrompt(); + break; case bluetooth_toggle_menu: BluetoothToggleMenu(); break; + case throttle_message: + screen->showSimpleBanner("Too Many Attempts\nTry again in 60 seconds.", 5000); + break; } menuQueue = menu_none; } diff --git a/src/graphics/draw/MenuHandler.h b/src/graphics/draw/MenuHandler.h index d2169ca3c..5846a3c91 100644 --- a/src/graphics/draw/MenuHandler.h +++ b/src/graphics/draw/MenuHandler.h @@ -1,3 +1,5 @@ +#pragma once +#if HAS_SCREEN #include "configuration.h" namespace graphics { @@ -26,7 +28,10 @@ class menuHandler test_menu, number_test, wifi_toggle_menu, - bluetooth_toggle_menu + key_verification_init, + key_verification_final_prompt, + bluetooth_toggle_menu, + throttle_message }; static screenMenus menuQueue; @@ -56,7 +61,10 @@ class menuHandler static void numberTest(); static void wifiBaseMenu(); static void wifiToggleMenu(); + static void keyVerificationInitMenu(); + static void keyVerificationFinalPrompt(); static void BluetoothToggleMenu(); }; -} // namespace graphics \ No newline at end of file +} // namespace graphics +#endif \ No newline at end of file diff --git a/src/graphics/draw/NotificationRenderer.cpp b/src/graphics/draw/NotificationRenderer.cpp index 057c91008..7350c204f 100644 --- a/src/graphics/draw/NotificationRenderer.cpp +++ b/src/graphics/draw/NotificationRenderer.cpp @@ -26,7 +26,7 @@ extern bool hasUnreadMessage; namespace graphics { -char NotificationRenderer::inEvent = INPUT_BROKER_NONE; +InputEvent NotificationRenderer::inEvent; int8_t NotificationRenderer::curSelected = 0; char NotificationRenderer::alertBannerMessage[256] = {0}; uint32_t NotificationRenderer::alertBannerUntil = 0; // 0 is a special case meaning forever @@ -72,11 +72,25 @@ void NotificationRenderer::resetBanner() { alertBannerMessage[0] = '\0'; current_notification_type = notificationTypeEnum::none; + + inEvent.inputEvent = INPUT_BROKER_NONE; + inEvent.kbchar = 0; + curSelected = 0; + alertBannerOptions = 0; // last x lines are seelctable options + optionsArrayPtr = nullptr; + optionsEnumPtr = nullptr; + alertBannerCallback = NULL; + pauseBanner = false; + numDigits = 0; + currentNumber = 0; + nodeDB->pause_sort(false); } void NotificationRenderer::drawBannercallback(OLEDDisplay *display, OLEDDisplayUiState *state) { + if (!isOverlayBannerShowing() && alertBannerMessage[0] != '\0') + resetBanner(); if (!isOverlayBannerShowing() || pauseBanner) return; switch (current_notification_type) { @@ -115,31 +129,40 @@ void NotificationRenderer::drawNumberPicker(OLEDDisplay *display, OLEDDisplayUiS // modulo to extract uint8_t this_digit = (currentNumber % (pow_of_10(numDigits - curSelected))) / (pow_of_10(numDigits - curSelected - 1)); // Handle input - if (inEvent == INPUT_BROKER_UP || inEvent == INPUT_BROKER_ALT_PRESS) { + if (inEvent.inputEvent == INPUT_BROKER_UP || inEvent.inputEvent == INPUT_BROKER_ALT_PRESS) { if (this_digit == 9) { currentNumber -= 9 * (pow_of_10(numDigits - curSelected - 1)); } else { currentNumber += (pow_of_10(numDigits - curSelected - 1)); } - } else if (inEvent == INPUT_BROKER_DOWN || inEvent == INPUT_BROKER_USER_PRESS) { + } else if (inEvent.inputEvent == INPUT_BROKER_DOWN || inEvent.inputEvent == INPUT_BROKER_USER_PRESS) { if (this_digit == 0) { currentNumber += 9 * (pow_of_10(numDigits - curSelected - 1)); } else { currentNumber -= (pow_of_10(numDigits - curSelected - 1)); } - } else if (inEvent == INPUT_BROKER_SELECT || inEvent == INPUT_BROKER_RIGHT) { + } else if (inEvent.inputEvent == INPUT_BROKER_ANYKEY) { + if (inEvent.kbchar > 47 && inEvent.kbchar < 58) { // have a digit + currentNumber -= this_digit * (pow_of_10(numDigits - curSelected - 1)); + currentNumber += (inEvent.kbchar - 48) * (pow_of_10(numDigits - curSelected - 1)); + curSelected++; + } + } else if (inEvent.inputEvent == INPUT_BROKER_SELECT || inEvent.inputEvent == INPUT_BROKER_RIGHT) { curSelected++; - } else if (inEvent == INPUT_BROKER_LEFT) { + } else if (inEvent.inputEvent == INPUT_BROKER_LEFT) { curSelected--; - } else if ((inEvent == INPUT_BROKER_CANCEL || inEvent == INPUT_BROKER_ALT_LONG) && alertBannerUntil != 0) { + } else if ((inEvent.inputEvent == INPUT_BROKER_CANCEL || inEvent.inputEvent == INPUT_BROKER_ALT_LONG) && + alertBannerUntil != 0) { resetBanner(); + return; } if (curSelected == numDigits) { - resetBanner(); alertBannerCallback(currentNumber); + resetBanner(); + return; } - inEvent = INPUT_BROKER_NONE; + inEvent.inputEvent = INPUT_BROKER_NONE; if (alertBannerMessage[0] == '\0') return; @@ -193,16 +216,18 @@ void NotificationRenderer::drawNodePicker(OLEDDisplay *display, OLEDDisplayUiSta } // Handle input - if (inEvent == INPUT_BROKER_UP || inEvent == INPUT_BROKER_ALT_PRESS) { + if (inEvent.inputEvent == INPUT_BROKER_UP || inEvent.inputEvent == INPUT_BROKER_ALT_PRESS) { curSelected--; - } else if (inEvent == INPUT_BROKER_DOWN || inEvent == INPUT_BROKER_USER_PRESS) { + } else if (inEvent.inputEvent == INPUT_BROKER_DOWN || inEvent.inputEvent == INPUT_BROKER_USER_PRESS) { curSelected++; - } else if (inEvent == INPUT_BROKER_SELECT) { - resetBanner(); + } else if (inEvent.inputEvent == INPUT_BROKER_SELECT) { alertBannerCallback(selectedNodenum); - - } else if ((inEvent == INPUT_BROKER_CANCEL || inEvent == INPUT_BROKER_ALT_LONG) && alertBannerUntil != 0) { resetBanner(); + return; + } else if ((inEvent.inputEvent == INPUT_BROKER_CANCEL || inEvent.inputEvent == INPUT_BROKER_ALT_LONG) && + alertBannerUntil != 0) { + resetBanner(); + return; } if (curSelected == -1) @@ -210,7 +235,7 @@ void NotificationRenderer::drawNodePicker(OLEDDisplay *display, OLEDDisplayUiSta if (curSelected == alertBannerOptions) curSelected = 0; - inEvent = INPUT_BROKER_NONE; + inEvent.inputEvent = INPUT_BROKER_NONE; if (alertBannerMessage[0] == '\0') return; @@ -308,11 +333,11 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp // Handle input if (alertBannerOptions > 0) { - if (inEvent == INPUT_BROKER_UP || inEvent == INPUT_BROKER_ALT_PRESS) { + if (inEvent.inputEvent == INPUT_BROKER_UP || inEvent.inputEvent == INPUT_BROKER_ALT_PRESS) { curSelected--; - } else if (inEvent == INPUT_BROKER_DOWN || inEvent == INPUT_BROKER_USER_PRESS) { + } else if (inEvent.inputEvent == INPUT_BROKER_DOWN || inEvent.inputEvent == INPUT_BROKER_USER_PRESS) { curSelected++; - } else if (inEvent == INPUT_BROKER_SELECT) { + } else if (inEvent.inputEvent == INPUT_BROKER_SELECT) { if (optionsEnumPtr != nullptr) { alertBannerCallback(optionsEnumPtr[curSelected]); optionsEnumPtr = nullptr; @@ -320,8 +345,11 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp alertBannerCallback(curSelected); } resetBanner(); - } else if ((inEvent == INPUT_BROKER_CANCEL || inEvent == INPUT_BROKER_ALT_LONG) && alertBannerUntil != 0) { + return; + } else if ((inEvent.inputEvent == INPUT_BROKER_CANCEL || inEvent.inputEvent == INPUT_BROKER_ALT_LONG) && + alertBannerUntil != 0) { resetBanner(); + return; } if (curSelected == -1) @@ -329,12 +357,14 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp if (curSelected == alertBannerOptions) curSelected = 0; } else { - if (inEvent == INPUT_BROKER_SELECT || inEvent == INPUT_BROKER_ALT_LONG || inEvent == INPUT_BROKER_CANCEL) { + if (inEvent.inputEvent == INPUT_BROKER_SELECT || inEvent.inputEvent == INPUT_BROKER_ALT_LONG || + inEvent.inputEvent == INPUT_BROKER_CANCEL) { resetBanner(); + return; } } - inEvent = INPUT_BROKER_NONE; + inEvent.inputEvent = INPUT_BROKER_NONE; if (alertBannerMessage[0] == '\0') return; diff --git a/src/graphics/draw/NotificationRenderer.h b/src/graphics/draw/NotificationRenderer.h index 97a404d11..9c30b329c 100644 --- a/src/graphics/draw/NotificationRenderer.h +++ b/src/graphics/draw/NotificationRenderer.h @@ -11,7 +11,8 @@ namespace graphics class NotificationRenderer { public: - static char inEvent; + static InputEvent inEvent; + static char inKeypress; static int8_t curSelected; static char alertBannerMessage[256]; static uint32_t alertBannerUntil; // 0 is a special case meaning forever diff --git a/src/meshUtils.h b/src/meshUtils.h index 35b88e8b2..9fcf6f8a8 100644 --- a/src/meshUtils.h +++ b/src/meshUtils.h @@ -13,8 +13,9 @@ template constexpr const T &clamp(const T &v, const T &lo, const T &hi #if HAS_SCREEN #define IF_SCREEN(X) \ - if (screen) \ - X; + if (screen) { \ + X; \ + } #else #define IF_SCREEN(...) #endif diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 1ab4af02d..06a4993a7 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -716,7 +716,7 @@ bool CannedMessageModule::handleFreeTextInput(const InputEvent *event) } // Backspace - if (event->inputEvent == INPUT_BROKER_BACK) { + if (event->inputEvent == INPUT_BROKER_BACK && this->freetext.length() > 0) { payload = 0x08; lastTouchMillis = millis(); runOnce(); @@ -739,7 +739,8 @@ bool CannedMessageModule::handleFreeTextInput(const InputEvent *event) } // Cancel (dismiss freetext screen) - if (event->inputEvent == INPUT_BROKER_CANCEL || event->inputEvent == INPUT_BROKER_ALT_LONG) { + if (event->inputEvent == INPUT_BROKER_CANCEL || event->inputEvent == INPUT_BROKER_ALT_LONG || + (event->inputEvent == INPUT_BROKER_BACK && this->freetext.length() == 0)) { runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; freetext = ""; cursor = 0; @@ -989,6 +990,7 @@ int32_t CannedMessageModule::runOnce() } this->cursor--; } + } else { } break; case INPUT_BROKER_MSG_TAB: // Tab key: handled by input handler diff --git a/src/modules/KeyVerificationModule.cpp b/src/modules/KeyVerificationModule.cpp index 408d29126..574f231eb 100644 --- a/src/modules/KeyVerificationModule.cpp +++ b/src/modules/KeyVerificationModule.cpp @@ -2,6 +2,7 @@ #include "KeyVerificationModule.h" #include "MeshService.h" #include "RTC.h" +#include "graphics/draw/MenuHandler.h" #include "main.h" #include "modules/AdminModule.h" #include @@ -48,18 +49,22 @@ AdminMessageHandleResult KeyVerificationModule::handleAdminMessageForModule(cons bool KeyVerificationModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_KeyVerification *r) { updateState(); - if (mp.pki_encrypted == false) + if (mp.pki_encrypted == false) { return false; - if (mp.from != currentRemoteNode) // because the inital connection request is handled in allocReply() + } + if (mp.from != currentRemoteNode) { // because the inital connection request is handled in allocReply() return false; + } if (currentState == KEY_VERIFICATION_IDLE) { return false; // if we're idle, the only acceptable message is an init, which should be handled by allocReply() + } - } else if (currentState == KEY_VERIFICATION_SENDER_HAS_INITIATED && r->nonce == currentNonce && r->hash2.size == 32 && - r->hash1.size == 0) { + if (currentState == KEY_VERIFICATION_SENDER_HAS_INITIATED && r->nonce == currentNonce && r->hash2.size == 32 && + r->hash1.size == 0) { memcpy(hash2, r->hash2.bytes, 32); - if (screen) - screen->showSimpleBanner("Enter Security Number", 30000); + IF_SCREEN(screen->showNumberPicker("Enter Security Number", 60000, 6, [](int number_picked) -> void { + keyVerificationModule->processSecurityNumber(number_picked); + });) meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); cn->level = meshtastic_LogRecord_Level_WARNING; @@ -79,23 +84,19 @@ bool KeyVerificationModule::handleReceivedProtobuf(const meshtastic_MeshPacket & memset(message, 0, sizeof(message)); sprintf(message, "Verification: \n"); generateVerificationCode(message + 15); - static const char *optionsArray[] = {"ACCEPT", "REJECT"}; + static const char *optionsArray[] = {"Reject", "Accept"}; LOG_INFO("Hash1 matches!"); - if (screen) { - graphics::BannerOverlayOptions options; - options.message = message; - options.durationMs = 30000; - options.optionsArrayPtr = optionsArray; - options.optionsCount = 2; - options.notificationType = graphics::notificationTypeEnum::selection_picker; - options.bannerCallback = [=](int selected) { - if (selected == 0) { - auto remoteNodePtr = nodeDB->getMeshNode(currentRemoteNode); - remoteNodePtr->bitfield |= NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK; - } - }; - screen->showOverlayBanner(options); - } + IF_SCREEN(graphics::BannerOverlayOptions options; options.message = message; options.durationMs = 30000; + options.optionsArrayPtr = optionsArray; options.optionsCount = 2; + options.notificationType = graphics::notificationTypeEnum::selection_picker; + options.bannerCallback = + [=](int selected) { + if (selected == 1) { + auto remoteNodePtr = nodeDB->getMeshNode(currentRemoteNode); + remoteNodePtr->bitfield |= NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK; + } + }; + screen->showOverlayBanner(options);) meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); cn->level = meshtastic_LogRecord_Level_WARNING; sprintf(cn->message, "Final confirmation for incoming manual key verification %s", message); @@ -120,6 +121,7 @@ bool KeyVerificationModule::sendInitialRequest(NodeNum remoteNode) // generate nonce updateState(); if (currentState != KEY_VERIFICATION_IDLE) { + graphics::menuHandler::menuQueue = graphics::menuHandler::throttle_message; return false; } currentNonce = random(); @@ -190,11 +192,8 @@ meshtastic_MeshPacket *KeyVerificationModule::allocReply() responsePacket = allocDataProtobuf(response); responsePacket->pki_encrypted = true; - if (screen) { - snprintf(message, 25, "Security Number \n%03u %03u", currentSecurityNumber / 1000, currentSecurityNumber % 1000); - screen->showSimpleBanner(message, 30000); - LOG_WARN("%s", message); - } + IF_SCREEN(snprintf(message, 25, "Security Number \n%03u %03u", currentSecurityNumber / 1000, currentSecurityNumber % 1000); + screen->showSimpleBanner(message, 30000); LOG_WARN("%s", message);) meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); cn->level = meshtastic_LogRecord_Level_WARNING; sprintf(cn->message, "Incoming Key Verification.\nSecurity Number\n%03u %03u", currentSecurityNumber / 1000, @@ -258,12 +257,7 @@ void KeyVerificationModule::processSecurityNumber(uint32_t incomingNumber) p->priority = meshtastic_MeshPacket_Priority_HIGH; service->sendToMesh(p, RX_SRC_LOCAL, true); currentState = KEY_VERIFICATION_SENDER_AWAITING_USER; - memset(message, 0, sizeof(message)); - sprintf(message, "Verification: \n"); - generateVerificationCode(message + 15); // send the toPhone packet - if (screen) { - screen->showSimpleBanner(message, 30000); - } + IF_SCREEN(screen->requestMenu(graphics::menuHandler::key_verification_final_prompt);) meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); cn->level = meshtastic_LogRecord_Level_WARNING; sprintf(cn->message, "Final confirmation for outgoing manual key verification %s", message); @@ -282,7 +276,7 @@ void KeyVerificationModule::processSecurityNumber(uint32_t incomingNumber) void KeyVerificationModule::updateState() { if (currentState != KEY_VERIFICATION_IDLE) { - // check for the 30 second timeout + // check for the 60 second timeout if (currentNonceTimestamp < getTime() - 60) { resetToIdle(); } else { diff --git a/src/modules/KeyVerificationModule.h b/src/modules/KeyVerificationModule.h index f659e961a..d5dba01d7 100644 --- a/src/modules/KeyVerificationModule.h +++ b/src/modules/KeyVerificationModule.h @@ -27,6 +27,8 @@ class KeyVerificationModule : public ProtobufModule }*/ virtual bool wantUIFrame() { return false; }; bool sendInitialRequest(NodeNum remoteNode); + void generateVerificationCode(char *); // fills char with the user readable verification code + uint32_t getCurrentRemoteNode() { return currentRemoteNode; } protected: /* Called to handle a particular incoming message @@ -56,9 +58,8 @@ class KeyVerificationModule : public ProtobufModule char message[40] = {0}; void processSecurityNumber(uint32_t); - void updateState(); // check the timeouts and maybe reset the state to idle - void resetToIdle(); // Zero out module state - void generateVerificationCode(char *); // fills char with the user readable verification code + void updateState(); // check the timeouts and maybe reset the state to idle + void resetToIdle(); // Zero out module state }; extern KeyVerificationModule *keyVerificationModule; \ No newline at end of file diff --git a/variants/t-deck/variant.h b/variants/t-deck/variant.h index 9fa0018ec..9b0de631a 100644 --- a/variants/t-deck/variant.h +++ b/variants/t-deck/variant.h @@ -68,6 +68,7 @@ #define TB_LEFT 1 #define TB_RIGHT 2 #define TB_PRESS 0 // BUTTON_PIN +#define TB_DIRECTION FALLING // microphone #define ES7210_SCK 47 From 107dec22bdd899501a5686a8c7f9eb445e625f0c Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 10 Jul 2025 10:12:02 -0500 Subject: [PATCH 429/461] Remove bogus validation check --- src/modules/AdminModule.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 0ba0e1164..8d3e710df 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -1327,12 +1327,6 @@ void AdminModule::handleSendInputEvent(const meshtastic_AdminMessage_InputEvent LOG_DEBUG("Processing input event: event_code=%u, kb_char=%u, touch_x=%u, touch_y=%u", inputEvent.event_code, inputEvent.kb_char, inputEvent.touch_x, inputEvent.touch_y); - // Validate input parameters - if (inputEvent.event_code > INPUT_BROKER_ANYKEY) { - LOG_WARN("Invalid input event code: %u", inputEvent.event_code); - return; - } - // Create InputEvent for injection InputEvent event = {.inputEvent = (input_broker_event)inputEvent.event_code, .kbchar = (unsigned char)inputEvent.kb_char, From 74c735d5fb71ebf36570ce8754b52a6f1a4c39f2 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 10 Jul 2025 10:20:44 -0500 Subject: [PATCH 430/461] Gate screen code behind IF_SCREEN() --- src/modules/KeyVerificationModule.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/modules/KeyVerificationModule.cpp b/src/modules/KeyVerificationModule.cpp index 574f231eb..f0ede345f 100644 --- a/src/modules/KeyVerificationModule.cpp +++ b/src/modules/KeyVerificationModule.cpp @@ -84,11 +84,10 @@ bool KeyVerificationModule::handleReceivedProtobuf(const meshtastic_MeshPacket & memset(message, 0, sizeof(message)); sprintf(message, "Verification: \n"); generateVerificationCode(message + 15); - static const char *optionsArray[] = {"Reject", "Accept"}; LOG_INFO("Hash1 matches!"); - IF_SCREEN(graphics::BannerOverlayOptions options; options.message = message; options.durationMs = 30000; - options.optionsArrayPtr = optionsArray; options.optionsCount = 2; - options.notificationType = graphics::notificationTypeEnum::selection_picker; + IF_SCREEN(static const char *optionsArray[] = {"Reject", "Accept"}; graphics::BannerOverlayOptions options; + options.message = message; options.durationMs = 30000; options.optionsArrayPtr = optionsArray; + options.optionsCount = 2; options.notificationType = graphics::notificationTypeEnum::selection_picker; options.bannerCallback = [=](int selected) { if (selected == 1) { @@ -121,7 +120,7 @@ bool KeyVerificationModule::sendInitialRequest(NodeNum remoteNode) // generate nonce updateState(); if (currentState != KEY_VERIFICATION_IDLE) { - graphics::menuHandler::menuQueue = graphics::menuHandler::throttle_message; + IF_SCREEN(graphics::menuHandler::menuQueue = graphics::menuHandler::throttle_message;) return false; } currentNonce = random(); From 5f5698ccc00777213784002f49162fc2ff147940 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 10 Jul 2025 10:29:33 -0500 Subject: [PATCH 431/461] Explicitly include meshUtils.h --- src/modules/KeyVerificationModule.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/KeyVerificationModule.cpp b/src/modules/KeyVerificationModule.cpp index f0ede345f..b1e23e807 100644 --- a/src/modules/KeyVerificationModule.cpp +++ b/src/modules/KeyVerificationModule.cpp @@ -4,6 +4,7 @@ #include "RTC.h" #include "graphics/draw/MenuHandler.h" #include "main.h" +#include "meshUtils.h" #include "modules/AdminModule.h" #include From 6d8c815558f6288b817d8d2c2c53d2c89ce3bbde Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 11:31:40 -0500 Subject: [PATCH 432/461] automated bumps (#7293) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 7 +++++-- version.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 47082718a..291fe7a7c 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.3 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.2 diff --git a/debian/changelog b/debian/changelog index 42488692b..b5009028a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.7.2.0) UNRELEASED; urgency=medium +meshtasticd (2.7.3.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging @@ -28,4 +28,7 @@ meshtasticd (2.7.2.0) UNRELEASED; urgency=medium [ ] * GitHub Actions Automatic version bump - -- Fri, 04 Jul 2025 11:58:01 +0000 + [ Ubuntu ] + * GitHub Actions Automatic version bump + + -- Ubuntu Thu, 10 Jul 2025 16:29:27 +0000 diff --git a/version.properties b/version.properties index 69f2d6af5..5de810523 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 7 -build = 2 +build = 3 From 6030bf50e04dc0e7d1c657a5dba50bd5aad0a09f Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 10 Jul 2025 11:39:38 -0500 Subject: [PATCH 433/461] Unbreak the macro --- src/modules/KeyVerificationModule.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/KeyVerificationModule.cpp b/src/modules/KeyVerificationModule.cpp index b1e23e807..3b8225763 100644 --- a/src/modules/KeyVerificationModule.cpp +++ b/src/modules/KeyVerificationModule.cpp @@ -86,9 +86,11 @@ bool KeyVerificationModule::handleReceivedProtobuf(const meshtastic_MeshPacket & sprintf(message, "Verification: \n"); generateVerificationCode(message + 15); LOG_INFO("Hash1 matches!"); - IF_SCREEN(static const char *optionsArray[] = {"Reject", "Accept"}; graphics::BannerOverlayOptions options; - options.message = message; options.durationMs = 30000; options.optionsArrayPtr = optionsArray; - options.optionsCount = 2; options.notificationType = graphics::notificationTypeEnum::selection_picker; + static const char *optionsArray[] = {"Reject", "Accept"}; + // Don't try to put the array definition in the macro. Does not work with curly braces. + IF_SCREEN(graphics::BannerOverlayOptions options; options.message = message; options.durationMs = 30000; + options.optionsArrayPtr = optionsArray; options.optionsCount = 2; + options.notificationType = graphics::notificationTypeEnum::selection_picker; options.bannerCallback = [=](int selected) { if (selected == 1) { From 57c1c9286b9baa07047300cb0fba1f62d103a1de Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:11:00 -0500 Subject: [PATCH 434/461] Update RadioLib to v7.2.1 (#7287) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 89720f0ad..59349139b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -104,7 +104,7 @@ lib_deps = [radiolib_base] lib_deps = # renovate: datasource=custom.pio depName=RadioLib packageName=jgromes/library/RadioLib - jgromes/RadioLib@7.2.0 + jgromes/RadioLib@7.2.1 [device-ui_base] lib_deps = From 1aad442ccc253133467c0cb5824445a9887523e1 Mon Sep 17 00:00:00 2001 From: Kongduino Date: Fri, 11 Jul 2025 06:11:19 +0800 Subject: [PATCH 435/461] Update platformio.ini (#7289) The link to the product should point to the vendor's website, not a random distributor. Co-authored-by: Ben Meadors Co-authored-by: Jonathan Bennett --- variants/seeed_xiao_nrf52840_kit/platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/seeed_xiao_nrf52840_kit/platformio.ini b/variants/seeed_xiao_nrf52840_kit/platformio.ini index 8c4c5a57b..0e1e94cd5 100644 --- a/variants/seeed_xiao_nrf52840_kit/platformio.ini +++ b/variants/seeed_xiao_nrf52840_kit/platformio.ini @@ -1,4 +1,4 @@ -; Seeed Xiao BLE: https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/102010448/16652893 +; Seeed Xiao BLE: https://wiki.seeedstudio.com/XIAO_BLE/ [env:seeed_xiao_nrf52840_kit] extends = nrf52840_base board = xiao_ble_sense From fe534eae3784dbc5aa89d1cb1b016a332cf70f91 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:12:25 -0500 Subject: [PATCH 436/461] Update Adafruit BusIO to v1.17.2 (#7277) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 59349139b..eb6d4f683 100644 --- a/platformio.ini +++ b/platformio.ini @@ -115,7 +115,7 @@ lib_deps = [environmental_base] lib_deps = # renovate: datasource=custom.pio depName=Adafruit BusIO packageName=adafruit/library/Adafruit BusIO - adafruit/Adafruit BusIO@1.17.1 + adafruit/Adafruit BusIO@1.17.2 # renovate: datasource=custom.pio depName=Adafruit Unified Sensor packageName=adafruit/library/Adafruit Unified Sensor adafruit/Adafruit Unified Sensor@1.1.15 # renovate: datasource=custom.pio depName=Adafruit BMP280 packageName=adafruit/library/Adafruit BMP280 Library From 093868f3edb11b71326c882eeab682af2b64e00b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:12:39 -0500 Subject: [PATCH 437/461] Update dorny/test-reporter action to v2.1.1 (#7284) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/test_native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_native.yml b/.github/workflows/test_native.yml index 536d93665..dc05959fd 100644 --- a/.github/workflows/test_native.yml +++ b/.github/workflows/test_native.yml @@ -143,7 +143,7 @@ jobs: merge-multiple: true - name: Test Report - uses: dorny/test-reporter@v2.1.0 + uses: dorny/test-reporter@v2.1.1 with: name: PlatformIO Tests path: testreport.xml From be75f111560086e1bef91e49743fb919e287e084 Mon Sep 17 00:00:00 2001 From: Jason P Date: Thu, 10 Jul 2025 19:49:15 -0500 Subject: [PATCH 438/461] Update Screen Wake Default Behavior (#7282) * feat(display): enable screen wake on received messages * feat(menu): add Screen Wakeup option in system menu * feat(ui): update wake on message configuration and refactor save logic * feat(TextMessageModule): conditionally trigger screen wake on received message * Refactoring system menu options for notification and screen. * Fix MUI options in the system menu. * Build out Reboot/Shutdown Menu and consolidate options within it * Trunk fixes * Protobuf ref * Revert generated files * Update plumbing for screen_wakeup_menu * Begin work on crafting a method to stop screen wake for received messages * SharedUIDisplay.cpp doesn't need ExternalNotificationModule.h * Stop screen wake if External Notification is enabled * Removing extra log lines * Add role and battery state checks for not waking screen. Menu updates to resolve some Back options not being linked * Resolve some additional merge conflict related issues * Shouldn't throttle the power menu * Finalize renames of some menus * Flip Flop MUI Menu to avoid accidental clicks * NULL check for powerStatus * Remove "Wakeup" eNum * Update src/graphics/Screen.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * CoPilot was close this should fix the builds --------- Co-authored-by: whywilson Co-authored-by: Ben Meadors Co-authored-by: Jonathan Bennett Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/graphics/Screen.cpp | 79 +++++++---- src/graphics/Screen.h | 4 + src/graphics/draw/MenuHandler.cpp | 229 ++++++++++++++++++++++++------ src/graphics/draw/MenuHandler.h | 14 +- src/modules/TextMessageModule.cpp | 7 +- 5 files changed, 261 insertions(+), 72 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 2bade47b2..f670225c3 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -83,6 +83,29 @@ extern uint16_t TFT_MESH; #include "platform/portduino/PortduinoGlue.h" #endif +bool shouldWakeOnReceivedMessage() +{ + /* + The goal here is to determine when we do NOT wake up the screen on message received: + - Any ext. notifications are turned on + - If role is not client / client_mute + - If the battery level is very low + */ + if (moduleConfig.external_notification.enabled) { + return false; + } + if (config.device.role != meshtastic_Config_DeviceConfig_Role_CLIENT && + config.device.role != meshtastic_Config_DeviceConfig_Role_CLIENT_MUTE) { + return false; + } + if (powerStatus && powerStatus->getBatteryChargePercent() < 10) { + return false; + } + return true; +} + +bool wake_on_received_message = shouldWakeOnReceivedMessage(); // Master Switch to enable here + using namespace meshtastic; /** @todo remove */ namespace graphics @@ -1257,40 +1280,46 @@ int Screen::handleTextMessage(const meshtastic_MeshPacket *packet) devicestate.has_rx_text_message = true; // Needed to include the message frame hasUnreadMessage = true; // Enables mail icon in the header setFrames(FOCUS_PRESERVE); // Refresh frame list without switching view - forceDisplay(); // Forces screen redraw - // === Prepare banner content === - const meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(packet->from); - const char *longName = (node && node->has_user) ? node->user.long_name : nullptr; + // Only wake/force display if the configuration allows it + wake_on_received_message = shouldWakeOnReceivedMessage(); + if (wake_on_received_message) { + setOn(true); // Wake up the screen first + forceDisplay(); // Forces screen redraw - const char *msgRaw = reinterpret_cast(packet->decoded.payload.bytes); + // === Prepare banner content === + const meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(packet->from); + const char *longName = (node && node->has_user) ? node->user.long_name : nullptr; - char banner[256]; + const char *msgRaw = reinterpret_cast(packet->decoded.payload.bytes); - // Check for bell character in message to determine alert type - bool isAlert = false; - for (size_t i = 0; i < packet->decoded.payload.size && i < 100; i++) { - if (msgRaw[i] == '\x07') { - isAlert = true; - break; + char banner[256]; + + // Check for bell character in message to determine alert type + bool isAlert = false; + for (size_t i = 0; i < packet->decoded.payload.size && i < 100; i++) { + if (msgRaw[i] == '\x07') { + isAlert = true; + break; + } } - } - if (isAlert) { - if (longName && longName[0]) { - snprintf(banner, sizeof(banner), "Alert Received from\n%s", longName); + if (isAlert) { + if (longName && longName[0]) { + snprintf(banner, sizeof(banner), "Alert Received from\n%s", longName); + } else { + strcpy(banner, "Alert Received"); + } } else { - strcpy(banner, "Alert Received"); + if (longName && longName[0]) { + snprintf(banner, sizeof(banner), "New Message from\n%s", longName); + } else { + strcpy(banner, "New Message"); + } } - } else { - if (longName && longName[0]) { - snprintf(banner, sizeof(banner), "New Message from\n%s", longName); - } else { - strcpy(banner, "New Message"); - } - } - screen->showSimpleBanner(banner, 3000); + screen->showSimpleBanner(banner, 3000); + } } } diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index 4deeb7395..19d14ecca 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -26,6 +26,8 @@ struct BannerOverlayOptions { }; } // namespace graphics +bool shouldWakeOnReceivedMessage(); + #if !HAS_SCREEN #include "power.h" namespace graphics @@ -123,6 +125,8 @@ class Screen #define SEGMENT_WIDTH 16 #define SEGMENT_HEIGHT 4 +extern bool wake_on_received_message; + /// Convert an integer GPS coords to a floating point #define DegD(i) (i * 1e-7) extern bool hasUnreadMessage; diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index c3a035c4f..f6b250ebc 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -129,11 +129,11 @@ void menuHandler::ClockFacePicker() screen->runNow(); } else if (selected == Digital) { uiconfig.is_clockface_analog = false; - nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, &uiconfig); + saveUIConfig(); screen->setFrames(Screen::FOCUS_CLOCK); } else { uiconfig.is_clockface_analog = true; - nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, &uiconfig); + saveUIConfig(); screen->setFrames(Screen::FOCUS_CLOCK); } }; @@ -346,37 +346,28 @@ void menuHandler::homeBaseMenu() void menuHandler::systemBaseMenu() { - // Check if brightness is supported bool hasSupportBrightness = false; #if defined(ST7789_CS) || defined(USE_OLED) || defined(USE_SSD1306) || defined(USE_SH1106) || defined(USE_SH1107) || HAS_TFT hasSupportBrightness = true; #endif - enum optionsNumbers { Back, Beeps, Brightness, Reboot, Color, MUI, Test, enumEnd }; + enum optionsNumbers { Back, Notifications, ScreenOptions, PowerMenu, Test, enumEnd }; static const char *optionsArray[enumEnd] = {"Back"}; static int optionsEnumArray[enumEnd] = {Back}; int options = 1; - optionsArray[options] = "Reboot"; - optionsEnumArray[options++] = Reboot; - - optionsArray[options] = "Beeps Action"; - optionsEnumArray[options++] = Beeps; - - if (hasSupportBrightness) { - optionsArray[options] = "Brightness"; - optionsEnumArray[options++] = Brightness; - } - -#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || HAS_TFT - optionsArray[options] = "Screen Color"; - optionsEnumArray[options++] = Color; -#endif -#if HAS_TFT - optionsArray[options] = "Switch to MUI"; - optionsEnumArray[options++] = MUI; + optionsArray[options] = "Notifications"; + optionsEnumArray[options++] = Notifications; +#if defined(ST7789_CS) || defined(USE_OLED) || defined(USE_SSD1306) || defined(USE_SH1106) || defined(USE_SH1107) || \ + defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || HAS_TFT + optionsArray[options] = "Screen Options"; + optionsEnumArray[options++] = ScreenOptions; #endif + + optionsArray[options] = "Reboot/Shutdown"; + optionsEnumArray[options++] = PowerMenu; + if (test_enabled) { optionsArray[options] = "Test Menu"; optionsEnumArray[options++] = Test; @@ -388,20 +379,14 @@ void menuHandler::systemBaseMenu() bannerOptions.optionsCount = options; bannerOptions.optionsEnumPtr = optionsEnumArray; bannerOptions.bannerCallback = [](int selected) -> void { - if (selected == Beeps) { - menuHandler::menuQueue = menuHandler::buzzermodemenupicker; + if (selected == Notifications) { + menuHandler::menuQueue = menuHandler::notifications_menu; screen->runNow(); - } else if (selected == Brightness) { - menuHandler::menuQueue = menuHandler::brightness_picker; + } else if (selected == ScreenOptions) { + menuHandler::menuQueue = menuHandler::screen_options_menu; screen->runNow(); - } else if (selected == Reboot) { - menuHandler::menuQueue = menuHandler::reboot_menu; - screen->runNow(); - } else if (selected == MUI) { - menuHandler::menuQueue = menuHandler::mui_picker; - screen->runNow(); - } else if (selected == Color) { - menuHandler::menuQueue = menuHandler::tftcolormenupicker; + } else if (selected == PowerMenu) { + menuHandler::menuQueue = menuHandler::power_menu; screen->runNow(); } else if (selected == Test) { menuHandler::menuQueue = menuHandler::test_menu; @@ -533,22 +518,19 @@ void menuHandler::compassNorthMenu() if (selected == Dynamic) { if (uiconfig.compass_mode != meshtastic_CompassMode_DYNAMIC) { uiconfig.compass_mode = meshtastic_CompassMode_DYNAMIC; - nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, - &uiconfig); + saveUIConfig(); screen->setFrames(graphics::Screen::FOCUS_PRESERVE); } } else if (selected == Fixed) { if (uiconfig.compass_mode != meshtastic_CompassMode_FIXED_RING) { uiconfig.compass_mode = meshtastic_CompassMode_FIXED_RING; - nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, - &uiconfig); + saveUIConfig(); screen->setFrames(graphics::Screen::FOCUS_PRESERVE); } } else if (selected == Freeze) { if (uiconfig.compass_mode != meshtastic_CompassMode_FREEZE_HEADING) { uiconfig.compass_mode = meshtastic_CompassMode_FREEZE_HEADING; - nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, - &uiconfig); + saveUIConfig(); screen->setFrames(graphics::Screen::FOCUS_PRESERVE); } } else if (selected == Back) { @@ -610,7 +592,7 @@ void menuHandler::BuzzerModeMenu() { static const char *optionsArray[] = {"All Enabled", "Disabled", "Notifications", "System Only"}; BannerOverlayOptions bannerOptions; - bannerOptions.message = "Beep Action"; + bannerOptions.message = "Buzzer Mode"; bannerOptions.optionsArrayPtr = optionsArray; bannerOptions.optionsCount = 4; bannerOptions.bannerCallback = [](int selected) -> void { @@ -660,7 +642,7 @@ void menuHandler::BrightnessPickerMenu() #endif // Save to device - nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, &uiconfig); + saveUIConfig(); LOG_INFO("Screen brightness set to %d", uiconfig.screen_brightness); } @@ -671,13 +653,13 @@ void menuHandler::BrightnessPickerMenu() void menuHandler::switchToMUIMenu() { - static const char *optionsArray[] = {"Yes", "No"}; + static const char *optionsArray[] = {"No", "Yes"}; BannerOverlayOptions bannerOptions; bannerOptions.message = "Switch to MUI?"; bannerOptions.optionsArrayPtr = optionsArray; bannerOptions.optionsCount = 2; bannerOptions.bannerCallback = [](int selected) -> void { - if (selected == 0) { + if (selected == 1) { config.display.displaymode = meshtastic_Config_DisplayConfig_DisplayMode_COLOR; config.bluetooth.enabled = false; service->reloadConfig(SEGMENT_CONFIG); @@ -742,6 +724,9 @@ void menuHandler::TFTColorPickerMenu(OLEDDisplay *display) TFT_MESH_r = 255; TFT_MESH_g = 255; TFT_MESH_b = 255; + } else { + menuQueue = system_base_menu; + screen->runNow(); } #if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || HAS_TFT @@ -771,7 +756,7 @@ void menuHandler::TFTColorPickerMenu(OLEDDisplay *display) uiconfig.screen_rgb_color = (TFT_MESH_r << 16) | (TFT_MESH_g << 8) | TFT_MESH_b; } LOG_INFO("Storing Value of %d to uiconfig.screen_rgb_color", uiconfig.screen_rgb_color); - nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, &uiconfig); + saveUIConfig(); } #endif }; @@ -790,6 +775,29 @@ void menuHandler::rebootMenu() IF_SCREEN(screen->showSimpleBanner("Rebooting...", 0)); nodeDB->saveToDisk(); rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000; + } else { + menuQueue = power_menu; + screen->runNow(); + } + }; + screen->showOverlayBanner(bannerOptions); +} + +void menuHandler::shutdownMenu() +{ + static const char *optionsArray[] = {"Back", "Confirm"}; + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Shutdown Device?"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 2; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == 1) { + IF_SCREEN(screen->showSimpleBanner("Shutting Down...", 0)); + nodeDB->saveToDisk(); + power->shutdown(); + } else { + menuQueue = power_menu; + screen->runNow(); } }; screen->showOverlayBanner(bannerOptions); @@ -888,6 +896,117 @@ void menuHandler::wifiToggleMenu() screen->showOverlayBanner(bannerOptions); } +void menuHandler::notificationsMenu() +{ + enum optionsNumbers { Back, BuzzerActions }; + static const char *optionsArray[] = {"Back", "Buzzer Actions"}; + static int optionsEnumArray[] = {Back, BuzzerActions}; + int options = 2; + + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Notifications"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = options; + bannerOptions.optionsEnumPtr = optionsEnumArray; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == BuzzerActions) { + menuHandler::menuQueue = menuHandler::buzzermodemenupicker; + screen->runNow(); + } else { + menuQueue = system_base_menu; + screen->runNow(); + } + }; + screen->showOverlayBanner(bannerOptions); +} + +void menuHandler::screenOptionsMenu() +{ + // Check if brightness is supported + bool hasSupportBrightness = false; +#if defined(ST7789_CS) || defined(USE_OLED) || defined(USE_SSD1306) || defined(USE_SH1106) || defined(USE_SH1107) || HAS_TFT + hasSupportBrightness = true; +#endif + + enum optionsNumbers { Back, Brightness, ScreenColor }; + static const char *optionsArray[4] = {"Back"}; + static int optionsEnumArray[4] = {Back}; + int options = 1; + + // Only show brightness for B&W displays + if (hasSupportBrightness && !HAS_TFT) { + optionsArray[options] = "Brightness"; + optionsEnumArray[options++] = Brightness; + } + + // Only show screen color for TFT displays +#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || HAS_TFT + optionsArray[options] = "Screen Color"; + optionsEnumArray[options++] = ScreenColor; +#endif + + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Screen Options"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = options; + bannerOptions.optionsEnumPtr = optionsEnumArray; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == Brightness) { + menuHandler::menuQueue = menuHandler::brightness_picker; + screen->runNow(); + } else if (selected == ScreenColor) { + menuHandler::menuQueue = menuHandler::tftcolormenupicker; + screen->runNow(); + } else { + menuQueue = system_base_menu; + screen->runNow(); + } + }; + screen->showOverlayBanner(bannerOptions); +} + +void menuHandler::powerMenu() +{ + + enum optionsNumbers { Back, Reboot, Shutdown, MUI }; + static const char *optionsArray[4] = {"Back"}; + static int optionsEnumArray[4] = {Back}; + int options = 1; + + optionsArray[options] = "Reboot"; + optionsEnumArray[options++] = Reboot; + + optionsArray[options] = "Shutdown"; + optionsEnumArray[options++] = Shutdown; + +#if HAS_TFT + optionsArray[options] = "Switch to MUI"; + optionsEnumArray[options++] = MUI; +#endif + + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Reboot / Shutdown"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = options; + bannerOptions.optionsEnumPtr = optionsEnumArray; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == Reboot) { + menuHandler::menuQueue = menuHandler::reboot_menu; + screen->runNow(); + } else if (selected == Shutdown) { + menuHandler::menuQueue = menuHandler::shutdown_menu; + screen->runNow(); + } else if (selected == MUI) { + menuHandler::menuQueue = menuHandler::mui_picker; + screen->runNow(); + } else { + menuQueue = system_base_menu; + screen->runNow(); + } + }; + screen->showOverlayBanner(bannerOptions); +} + void menuHandler::keyVerificationInitMenu() { screen->showNodePicker("Node to Verify", 30000, @@ -941,6 +1060,9 @@ void menuHandler::handleMenuSwitch(OLEDDisplay *display) case clock_menu: clockMenu(); break; + case system_base_menu: + systemBaseMenu(); + break; case position_base_menu: positionBaseMenu(); break; @@ -970,6 +1092,9 @@ void menuHandler::handleMenuSwitch(OLEDDisplay *display) case reboot_menu: rebootMenu(); break; + case shutdown_menu: + shutdownMenu(); + break; case add_favorite: addFavoriteMenu(); break; @@ -994,6 +1119,15 @@ void menuHandler::handleMenuSwitch(OLEDDisplay *display) case bluetooth_toggle_menu: BluetoothToggleMenu(); break; + case notifications_menu: + notificationsMenu(); + break; + case screen_options_menu: + screenOptionsMenu(); + break; + case power_menu: + powerMenu(); + break; case throttle_message: screen->showSimpleBanner("Too Many Attempts\nTry again in 60 seconds.", 5000); break; @@ -1001,6 +1135,11 @@ void menuHandler::handleMenuSwitch(OLEDDisplay *display) menuQueue = menu_none; } +void menuHandler::saveUIConfig() +{ + nodeDB->saveProto("/prefs/uiconfig.proto", meshtastic_DeviceUIConfig_size, &meshtastic_DeviceUIConfig_msg, &uiconfig); +} + } // namespace graphics #endif \ No newline at end of file diff --git a/src/graphics/draw/MenuHandler.h b/src/graphics/draw/MenuHandler.h index 5846a3c91..2273dbbed 100644 --- a/src/graphics/draw/MenuHandler.h +++ b/src/graphics/draw/MenuHandler.h @@ -23,14 +23,19 @@ class menuHandler tftcolormenupicker, brightness_picker, reboot_menu, + shutdown_menu, add_favorite, remove_favorite, test_menu, number_test, wifi_toggle_menu, + bluetooth_toggle_menu, + notifications_menu, + screen_options_menu, + power_menu, + system_base_menu, key_verification_init, key_verification_final_prompt, - bluetooth_toggle_menu, throttle_message }; static screenMenus menuQueue; @@ -55,12 +60,19 @@ class menuHandler static void resetNodeDBMenu(); static void BrightnessPickerMenu(); static void rebootMenu(); + static void shutdownMenu(); static void addFavoriteMenu(); static void removeFavoriteMenu(); static void testMenu(); static void numberTest(); static void wifiBaseMenu(); static void wifiToggleMenu(); + static void notificationsMenu(); + static void screenOptionsMenu(); + static void powerMenu(); + + private: + static void saveUIConfig(); static void keyVerificationInitMenu(); static void keyVerificationFinalPrompt(); static void BluetoothToggleMenu(); diff --git a/src/modules/TextMessageModule.cpp b/src/modules/TextMessageModule.cpp index f1d01ad16..f0835073b 100644 --- a/src/modules/TextMessageModule.cpp +++ b/src/modules/TextMessageModule.cpp @@ -4,6 +4,7 @@ #include "PowerFSM.h" #include "buzz.h" #include "configuration.h" +#include "graphics/Screen.h" TextMessageModule *textMessageModule; ProcessMessage TextMessageModule::handleReceived(const meshtastic_MeshPacket &mp) @@ -17,7 +18,11 @@ ProcessMessage TextMessageModule::handleReceived(const meshtastic_MeshPacket &mp devicestate.rx_text_message = mp; devicestate.has_rx_text_message = true; - powerFSM.trigger(EVENT_RECEIVED_MSG); + wake_on_received_message = shouldWakeOnReceivedMessage(); + // Only trigger screen wake if configuration allows it + if (wake_on_received_message) { + powerFSM.trigger(EVENT_RECEIVED_MSG); + } notifyObservers(&mp); return ProcessMessage::CONTINUE; // Let others look at this message also if they want From 4bab148e3b75a51bdcd8aaa91ba0f904cf8a4a95 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 10 Jul 2025 22:51:43 -0500 Subject: [PATCH 439/461] Make the shouldWake function always available, and remove the bool (#7300) --- src/graphics/Screen.cpp | 46 ++++++++++++++----------------- src/graphics/Screen.h | 2 -- src/modules/TextMessageModule.cpp | 3 +- 3 files changed, 22 insertions(+), 29 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index f670225c3..59888c938 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -83,29 +83,6 @@ extern uint16_t TFT_MESH; #include "platform/portduino/PortduinoGlue.h" #endif -bool shouldWakeOnReceivedMessage() -{ - /* - The goal here is to determine when we do NOT wake up the screen on message received: - - Any ext. notifications are turned on - - If role is not client / client_mute - - If the battery level is very low - */ - if (moduleConfig.external_notification.enabled) { - return false; - } - if (config.device.role != meshtastic_Config_DeviceConfig_Role_CLIENT && - config.device.role != meshtastic_Config_DeviceConfig_Role_CLIENT_MUTE) { - return false; - } - if (powerStatus && powerStatus->getBatteryChargePercent() < 10) { - return false; - } - return true; -} - -bool wake_on_received_message = shouldWakeOnReceivedMessage(); // Master Switch to enable here - using namespace meshtastic; /** @todo remove */ namespace graphics @@ -1282,8 +1259,7 @@ int Screen::handleTextMessage(const meshtastic_MeshPacket *packet) setFrames(FOCUS_PRESERVE); // Refresh frame list without switching view // Only wake/force display if the configuration allows it - wake_on_received_message = shouldWakeOnReceivedMessage(); - if (wake_on_received_message) { + if (shouldWakeOnReceivedMessage()) { setOn(true); // Wake up the screen first forceDisplay(); // Forces screen redraw @@ -1452,3 +1428,23 @@ bool Screen::isOverlayBannerShowing() #else graphics::Screen::Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY) {} #endif // HAS_SCREEN + +bool shouldWakeOnReceivedMessage() +{ + /* + The goal here is to determine when we do NOT wake up the screen on message received: + - Any ext. notifications are turned on + - If role is not client / client_mute + - If the battery level is very low + */ + if (moduleConfig.external_notification.enabled) { + return false; + } + if (!meshtastic_Config_DeviceConfig_Role_CLIENT && !meshtastic_Config_DeviceConfig_Role_CLIENT_MUTE) { + return false; + } + if (powerStatus && powerStatus->getBatteryChargePercent() < 10) { + return false; + } + return true; +} \ No newline at end of file diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index 19d14ecca..265900131 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -125,8 +125,6 @@ class Screen #define SEGMENT_WIDTH 16 #define SEGMENT_HEIGHT 4 -extern bool wake_on_received_message; - /// Convert an integer GPS coords to a floating point #define DegD(i) (i * 1e-7) extern bool hasUnreadMessage; diff --git a/src/modules/TextMessageModule.cpp b/src/modules/TextMessageModule.cpp index f0835073b..970f4429c 100644 --- a/src/modules/TextMessageModule.cpp +++ b/src/modules/TextMessageModule.cpp @@ -18,9 +18,8 @@ ProcessMessage TextMessageModule::handleReceived(const meshtastic_MeshPacket &mp devicestate.rx_text_message = mp; devicestate.has_rx_text_message = true; - wake_on_received_message = shouldWakeOnReceivedMessage(); // Only trigger screen wake if configuration allows it - if (wake_on_received_message) { + if (shouldWakeOnReceivedMessage()) { powerFSM.trigger(EVENT_RECEIVED_MSG); } notifyObservers(&mp); From 13ac182142ca4f5691aec8aa0c31f8c6b794c7cf Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 10 Jul 2025 23:19:58 -0500 Subject: [PATCH 440/461] Pick up nodedb.h in Screen.cpp regardless of HAS_SCREEN state --- src/graphics/Screen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 59888c938..57ea64fa9 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -21,6 +21,7 @@ along with this program. If not, see . */ #include "Screen.h" +#include "NodeDB.h" #include "PowerMon.h" #include "Throttle.h" #include "configuration.h" @@ -44,7 +45,6 @@ along with this program. If not, see . #endif #include "FSCommon.h" #include "MeshService.h" -#include "NodeDB.h" #include "RadioLibInterface.h" #include "error.h" #include "gps/GeoCoord.h" From 1063ef903495659a769290f36e9b2d1fabb2f4ce Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Fri, 11 Jul 2025 17:30:48 +1200 Subject: [PATCH 441/461] Shorter audio feedback for InkHUD buttons (#7301) --- src/graphics/niche/InkHUD/Events.cpp | 8 ++++---- variants/ELECROW-ThinkNode-M1/nicheGraphics.h | 4 ++-- variants/heltec_vision_master_e213/nicheGraphics.h | 2 +- variants/heltec_vision_master_e290/nicheGraphics.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/graphics/niche/InkHUD/Events.cpp b/src/graphics/niche/InkHUD/Events.cpp index 2abe30793..cdda1638d 100644 --- a/src/graphics/niche/InkHUD/Events.cpp +++ b/src/graphics/niche/InkHUD/Events.cpp @@ -39,8 +39,8 @@ void InkHUD::Events::begin() void InkHUD::Events::onButtonShort() { // Audio feedback (via buzzer) - // Short low tone - playBoop(); + // Short tone + playChirp(); // Cancel any beeping, buzzing, blinking // Some button handling suppressed if we are dismissing an external notification (see below) bool dismissedExt = dismissExternalNotification(); @@ -64,8 +64,8 @@ void InkHUD::Events::onButtonShort() void InkHUD::Events::onButtonLong() { // Audio feedback (via buzzer) - // Low tone, longer than playBoop - playBeep(); + // Slightly longer than playChirp + playBoop(); // Check which system applet wants to handle the button press (if any) SystemApplet *consumer = nullptr; diff --git a/variants/ELECROW-ThinkNode-M1/nicheGraphics.h b/variants/ELECROW-ThinkNode-M1/nicheGraphics.h index b4395114f..f64de9d07 100644 --- a/variants/ELECROW-ThinkNode-M1/nicheGraphics.h +++ b/variants/ELECROW-ThinkNode-M1/nicheGraphics.h @@ -104,11 +104,11 @@ void setupNicheGraphics() buttons->setHandlerDown(1, [backlight]() { backlight->peek(); }); buttons->setHandlerLongPress(1, [backlight]() { backlight->latch(); - playBeep(); + playBoop(); }); buttons->setHandlerShortPress(1, [backlight]() { backlight->off(); - playBoop(); + playChirp(); }); // Begin handling button events diff --git a/variants/heltec_vision_master_e213/nicheGraphics.h b/variants/heltec_vision_master_e213/nicheGraphics.h index 6a75ad90d..1b1291424 100644 --- a/variants/heltec_vision_master_e213/nicheGraphics.h +++ b/variants/heltec_vision_master_e213/nicheGraphics.h @@ -107,7 +107,7 @@ void setupNicheGraphics() buttons->setWiring(1, PIN_BUTTON2); buttons->setHandlerShortPress(1, [inkhud]() { inkhud->nextTile(); - playBoop(); + playChirp(); }); // Begin handling button events diff --git a/variants/heltec_vision_master_e290/nicheGraphics.h b/variants/heltec_vision_master_e290/nicheGraphics.h index f29873c15..61b08c740 100644 --- a/variants/heltec_vision_master_e290/nicheGraphics.h +++ b/variants/heltec_vision_master_e290/nicheGraphics.h @@ -104,7 +104,7 @@ void setupNicheGraphics() buttons->setWiring(1, PIN_BUTTON2); buttons->setHandlerShortPress(1, [inkhud]() { inkhud->nextTile(); - playBoop(); + playChirp(); }); // Begin handling button events From f7ecf141b53428327448b6c5ff80867db307ff43 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 06:45:18 -0500 Subject: [PATCH 442/461] Update meshtastic/device-ui digest to 404c6e0 (#7302) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index eb6d4f683..352d7e8d4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -109,7 +109,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/8c7092c73425adfda1aac8c6960df06cd85f6d92.zip + https://github.com/meshtastic/device-ui/archive/404c6e06ecfda8dd2dc9e6d5fe417ae028f8029f.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 72f3d19d5af3b4b525a5cb5edc7e351be566c08c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 06:51:33 -0500 Subject: [PATCH 443/461] Upgrade trunk (#7278) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 0986e6eb0..f0271c856 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,8 +8,8 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.447 - - renovate@41.23.4 + - checkov@3.2.450 + - renovate@41.29.1 - prettier@3.6.2 - trufflehog@3.89.2 - yamllint@1.37.1 From d42bde135f3b6308064b3313f64ef9db6bfd9003 Mon Sep 17 00:00:00 2001 From: Mictronics Date: Fri, 11 Jul 2025 13:54:37 +0200 Subject: [PATCH 444/461] Support native configuration Waveshare Pico LoRa module on Orange Pi Zero3 (#7295) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28 * Merge PR #420 * Fixed double and missing Default class. * Use correct format specifier and fixed typo. * Removed duplicate code. * Fix error: #if with no expression * Fix warning: extra tokens at end of #endif directive. * Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board. * Fix deprecated macros. * Set RP2040 in dormant mode when deep sleep is triggered. * Fix array out of bounds read. * Admin key count needs to be set otherwise the key will be zero loaded after reset. * Don't reset the admin key size when loading defaults. Preserve an existing key in config if possible. * Remove log spam when reading INA voltage sensor. * Remove static declaration for admin keys from userPrefs.h. Load hard coded admin keys in case config file has empty slots. * Removed newlines from log. * Fix issue #5665. * Fix build for Pico2 RP2350 platform. * Enable Wifi client on Pico2W. * Use correct processor on Pico2. * Fix deprecated warning. * Update platform and framework for RP2350. * Added Pico2W variant including Wifi support. * Fix typo in used variant. * Remove obsolete define. * Fix for native Linux build. * Simplify RP2350 platform tag reference. Co-authored-by: Austin * Cast user prefs strings. * Update to last successfully building platform package. * Define I2C GPIOs to ensure usage of both ports. Possibly fixes #5361 * RAK11310 support for RAK12002 RTC added. * Update platform and framework packages to 4.4.3. * Use RP2040 base platform and framework package. Use RAK11300 board definition in arduino-pico framework. * Use RAK11300 board definition in arduino-pico framework. * Fix build when MESHTASTIC_EXCLUDE_GPS is defined. * Added configuration for Waveshare Pico LoRa module in combination with Orange Pi Zero3. * Equal to upstream master. --------- Co-authored-by: Ben Meadors Co-authored-by: Thomas Göttgens Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Co-authored-by: Austin Co-authored-by: Tom Fifield --- ...lora-ws-raspberry-pico-to-orangepi-03.yaml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 bin/config.d/lora-ws-raspberry-pico-to-orangepi-03.yaml diff --git a/bin/config.d/lora-ws-raspberry-pico-to-orangepi-03.yaml b/bin/config.d/lora-ws-raspberry-pico-to-orangepi-03.yaml new file mode 100644 index 000000000..37d7e27d2 --- /dev/null +++ b/bin/config.d/lora-ws-raspberry-pico-to-orangepi-03.yaml @@ -0,0 +1,52 @@ +# https://www.waveshare.com/pico-lora-sx1262-868m.htm +# http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-Zero-3.html +# +# See Orange Pi Zero3 manual, chapter 3.16, page 124 for 26-pin header pinout +# +# Pin Connection +# Waveshare Orange Pi Zero3 +# 36 3.3V 17 +# 15 MOSI 19 +# 16 MISO 21 +# 14 CLK 23 +# 38 GND 25 +# 4 BUSY 18 +# 20 RESET 22 +# 5 CS 24 +# 26 DIO1/IRQ 26 + +Lora: + Module: sx1262 # Waveshare Raspberry Pico Lora module + DIO2_AS_RF_SWITCH: true + DIO3_TCXO_VOLTAGE: true + # Specify either the spidev1_1 or the CS below, not both! + # On DietPi Linux, when using the user overlay dietpi-spi1_1.dtbo, CS will be configured with spidev1.1 + spidev: spidev1.1 # See Orange Pi Zero3 manual, chapter 3.18.3, page 130 +# CS: # CS PIN_24 -> chip 1, line 233 +# pin: 24 +# gpiochip: 1 +# line: 233 + SCK: # SCK PIN_23 -> chip 1, line 230 + pin: 23 + gpiochip: 1 + line: 230 + Busy: # BUSY PIN_18 -> chip 1, line 78 + pin: 18 + gpiochip: 1 + line: 78 + MOSI: # MOSI PIN_19 -> chip 1, line 231 + pin: 19 + gpiochip: 1 + line: 231 + MISO: # MISO PIN_21 -> chip 1, line 232 + pin: 21 + gpiochip: 1 + line: 232 + Reset: # NRST PIN_22 -> chip 1, line 71 + pin: 22 + gpiochip: 1 + line: 71 + IRQ: # DIO1 PIN_26 -> chip 1, line 74 + pin: 26 + gpiochip: 1 + line: 74 From e9a551ae903bdd1269dbce5a1b7ee6dd9357f250 Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 11 Jul 2025 09:09:46 -0400 Subject: [PATCH 445/461] Load ringtone from userPrefs (#7298) * Load ringtone from userPrefs * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Ben Meadors Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/modules/ExternalNotificationModule.cpp | 6 +++--- userPrefs.jsonc | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index 956508ce5..c17fcc4fa 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -362,9 +362,9 @@ ExternalNotificationModule::ExternalNotificationModule() if (nodeDB->loadProto(rtttlConfigFile, meshtastic_RTTTLConfig_size, sizeof(meshtastic_RTTTLConfig), &meshtastic_RTTTLConfig_msg, &rtttlConfig) != LoadFileResult::LOAD_SUCCESS) { memset(rtttlConfig.ringtone, 0, sizeof(rtttlConfig.ringtone)); - strncpy(rtttlConfig.ringtone, - "24:d=32,o=5,b=565:f6,p,f6,4p,p,f6,p,f6,2p,p,b6,p,b6,p,b6,p,b6,p,b,p,b,p,b,p,b,p,b,p,b,p,b,p,b,1p.,2p.,p", - sizeof(rtttlConfig.ringtone)); + // The default ringtone is always loaded from userPrefs.jsonc + strncpy(rtttlConfig.ringtone, USERPREFS_RINGTONE, sizeof(rtttlConfig.ringtone)); + rtttlConfig.ringtone[sizeof(rtttlConfig.ringtone) - 1] = '\0'; // Ensure null termination } LOG_INFO("Init External Notification Module"); diff --git a/userPrefs.jsonc b/userPrefs.jsonc index fc9e6ed72..c32bc7841 100644 --- a/userPrefs.jsonc +++ b/userPrefs.jsonc @@ -53,5 +53,6 @@ // "USERPREFS_MQTT_ENCRYPTION_ENABLED": "true", // "USERPREFS_MQTT_TLS_ENABLED": "false", // "USERPREFS_MQTT_ROOT_TOPIC": "event/REPLACEME", + "USERPREFS_RINGTONE": "24:d=32,o=5,b=565:f6,p,f6,4p,p,f6,p,f6,2p,p,b6,p,b6,p,b6,p,b6,p,b,p,b,p,b,p,b,p,b,p,b,p,b,p,b,1p.,2p.,p", "USERPREFS_TZ_STRING": "tzplaceholder " } From 9798a91e7b464e92cadd5ae9e1763b5799a1f030 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 11 Jul 2025 08:22:50 -0500 Subject: [PATCH 446/461] Delete ringtone.proto file for factory reset (#7303) --- src/mesh/NodeDB.cpp | 3 +++ src/modules/ExternalNotificationModule.cpp | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index a20acfda0..212b0dc33 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -474,6 +474,9 @@ bool NodeDB::factoryReset(bool eraseBleBonds) if (FSCom.exists("/static/rangetest.csv") && !FSCom.remove("/static/rangetest.csv")) { LOG_ERROR("Could not remove rangetest.csv file"); } + if (FSCom.exists("/prefs/ringtone.proto") && !FSCom.remove("/prefs/ringtone.proto")) { + LOG_ERROR("Could not remove ringtone.proto file"); + } #endif spiLock->unlock(); // second, install default state (this will deal with the duplicate mac address issue) diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index c17fcc4fa..76566d4da 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -364,7 +364,6 @@ ExternalNotificationModule::ExternalNotificationModule() memset(rtttlConfig.ringtone, 0, sizeof(rtttlConfig.ringtone)); // The default ringtone is always loaded from userPrefs.jsonc strncpy(rtttlConfig.ringtone, USERPREFS_RINGTONE, sizeof(rtttlConfig.ringtone)); - rtttlConfig.ringtone[sizeof(rtttlConfig.ringtone) - 1] = '\0'; // Ensure null termination } LOG_INFO("Init External Notification Module"); From 5ae8021aa6d01f1a36ff509c594d0481517f11ec Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 11 Jul 2025 08:28:21 -0500 Subject: [PATCH 447/461] I'm dumb --- src/mesh/NodeDB.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 212b0dc33..a20acfda0 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -474,9 +474,6 @@ bool NodeDB::factoryReset(bool eraseBleBonds) if (FSCom.exists("/static/rangetest.csv") && !FSCom.remove("/static/rangetest.csv")) { LOG_ERROR("Could not remove rangetest.csv file"); } - if (FSCom.exists("/prefs/ringtone.proto") && !FSCom.remove("/prefs/ringtone.proto")) { - LOG_ERROR("Could not remove ringtone.proto file"); - } #endif spiLock->unlock(); // second, install default state (this will deal with the duplicate mac address issue) From 1ca0584ba0db95a53136d4838f69bf46dff8a844 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 11 Jul 2025 16:09:59 -0500 Subject: [PATCH 448/461] Add first config override for Native (#7306) --- bin/config-dist.yaml | 4 ++++ src/mesh/NodeDB.cpp | 7 +++++++ src/platform/portduino/PortduinoGlue.cpp | 15 +++++++++++++++ src/platform/portduino/PortduinoGlue.h | 4 +++- 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/bin/config-dist.yaml b/bin/config-dist.yaml index b40fb85a5..b4cc81792 100644 --- a/bin/config-dist.yaml +++ b/bin/config-dist.yaml @@ -199,6 +199,10 @@ HostMetrics: # UserStringCommand: cat /sys/firmware/devicetree/base/serial-number # Command to execute, to send the results as the userString +Config: +# DisplayMode: TWOCOLOR # uncomment to force BaseUI +# DisplayMode: COLOR # uncomment to force MUI + General: MaxNodes: 200 MaxMessageQueue: 100 diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index a20acfda0..5ca515dd4 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1309,6 +1309,13 @@ void NodeDB::loadFromDisk() saveToDisk(SEGMENT_MODULECONFIG); } +#if ARCH_PORTDUINO + // set any config overrides + if (settingsMap[has_configDisplayMode]) { + config.display.displaymode = (_meshtastic_Config_DisplayConfig_DisplayMode)settingsMap[configDisplayMode]; + } + +#endif } /** Save a protobuf from a file, return true for success */ diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 49d1acb4c..4ece2418d 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -665,6 +665,21 @@ bool loadConfig(const char *configPath) settingsStrings[hostMetrics_user_command] = (yamlConfig["HostMetrics"]["UserStringCommand"]).as(""); } + if (yamlConfig["Config"]) { + if (yamlConfig["Config"]["DisplayMode"]) { + settingsMap[has_configDisplayMode] = true; + if ((yamlConfig["Config"]["DisplayMode"]).as("") == "TWOCOLOR") { + settingsMap[configDisplayMode] = meshtastic_Config_DisplayConfig_DisplayMode_TWOCOLOR; + } else if ((yamlConfig["Config"]["DisplayMode"]).as("") == "INVERTED") { + settingsMap[configDisplayMode] = meshtastic_Config_DisplayConfig_DisplayMode_INVERTED; + } else if ((yamlConfig["Config"]["DisplayMode"]).as("") == "COLOR") { + settingsMap[configDisplayMode] = meshtastic_Config_DisplayConfig_DisplayMode_COLOR; + } else { + settingsMap[configDisplayMode] = meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT; + } + } + } + if (yamlConfig["General"]) { settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as(200); settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as(100); diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index e404b7f1c..288870eef 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -109,7 +109,9 @@ enum configNames { mac_address, hostMetrics_interval, hostMetrics_channel, - hostMetrics_user_command + hostMetrics_user_command, + configDisplayMode, + has_configDisplayMode }; enum { no_screen, x11, fb, st7789, st7735, st7735s, st7796, ili9341, ili9342, ili9486, ili9488, hx8357d }; enum { no_touchscreen, xpt2046, stmpe610, gt911, ft5x06 }; From 05c32c99e44339eed83119eca6f49515d8c9801c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 18:46:29 -0500 Subject: [PATCH 449/461] Update meshtastic/device-ui digest to 86a09a7 (#7308) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 352d7e8d4..b1f89e5b4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -109,7 +109,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/404c6e06ecfda8dd2dc9e6d5fe417ae028f8029f.zip + https://github.com/meshtastic/device-ui/archive/86a09a7360f92d10053fbbf8d74f67f85b0ceb09.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From deed6cd96a47404855c6dbe9cd22bf0caaa51c78 Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 12 Jul 2025 07:27:45 -0400 Subject: [PATCH 450/461] STM32: Properly ignore OneButton (#7311) --- arch/stm32/stm32.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/stm32/stm32.ini b/arch/stm32/stm32.ini index 1a0890b8a..be1ed662f 100644 --- a/arch/stm32/stm32.ini +++ b/arch/stm32/stm32.ini @@ -47,4 +47,4 @@ lib_deps = https://github.com/caveman99/Crypto/archive/eae9c768054118a9399690f8af202853d1ae8516.zip lib_ignore = - mathertel/OneButton@2.6.1 + OneButton From cb47325f0805ad2930ce3b433ff05df7c29782e9 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 12 Jul 2025 12:36:44 -0500 Subject: [PATCH 451/461] Seesaw Rotary (#7310) * Initial add of Adafruit seesaw encoder * Fully wire up seesaw * Trunk * Add #include configuration.h back to unbreak logging * Tryfix the dumb compilation error --------- Co-authored-by: Ben Meadors --- arch/portduino/portduino.ini | 7 ++- src/input/SeesawRotary.cpp | 83 ++++++++++++++++++++++++++++++++++++ src/input/SeesawRotary.h | 29 +++++++++++++ src/modules/Modules.cpp | 7 ++- 4 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 src/input/SeesawRotary.cpp create mode 100644 src/input/SeesawRotary.h diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 429e010f5..874f0c868 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -30,6 +30,8 @@ lib_deps = lovyan03/LovyanGFX@^1.2.0 # renovate: datasource=git-refs depName=libch341-spi-userspace packageName=https://github.com/pine64/libch341-spi-userspace gitBranch=main https://github.com/pine64/libch341-spi-userspace/archive/af9bc27c9c30fa90772279925b7c5913dff789b4.zip + # renovate: datasource=custom.pio depName=adafruit/Adafruit seesaw Library packageName=adafruit/library/Adafruit seesaw Library + adafruit/Adafruit seesaw Library@1.7.9 build_flags = ${arduino_base.build_flags} @@ -48,4 +50,7 @@ build_flags = -std=gnu17 -std=c++17 -lib_ignore = Adafruit NeoPixel +lib_ignore = + Adafruit NeoPixel + Adafruit ST7735 and ST7789 Library + SD diff --git a/src/input/SeesawRotary.cpp b/src/input/SeesawRotary.cpp new file mode 100644 index 000000000..c212773c4 --- /dev/null +++ b/src/input/SeesawRotary.cpp @@ -0,0 +1,83 @@ +#ifdef ARCH_PORTDUINO +#include "SeesawRotary.h" +#include "input/InputBroker.h" + +using namespace concurrency; + +SeesawRotary *seesawRotary; + +SeesawRotary::SeesawRotary(const char *name) : OSThread(name) +{ + _originName = name; +} + +bool SeesawRotary::init() +{ + if (inputBroker) + inputBroker->registerSource(this); + + if (!ss.begin(SEESAW_ADDR)) { + return false; + } + // attachButtonInterrupts(); + + uint32_t version = ((ss.getVersion() >> 16) & 0xFFFF); + if (version != 4991) { + LOG_WARN("Wrong firmware loaded? %u", version); + } else { + LOG_INFO("Found Product 4991"); + } + /* + #ifdef ARCH_ESP32 + // Register callbacks for before and after lightsleep + // Used to detach and reattach interrupts + lsObserver.observe(¬ifyLightSleep); + lsEndObserver.observe(¬ifyLightSleepEnd); + #endif + */ + ss.pinMode(SS_SWITCH, INPUT_PULLUP); + + // get starting position + encoder_position = ss.getEncoderPosition(); + + ss.setGPIOInterrupts((uint32_t)1 << SS_SWITCH, 1); + ss.enableEncoderInterrupt(); + canSleep = true; // Assume we should not keep the board awake + + return true; +} + +int32_t SeesawRotary::runOnce() +{ + InputEvent e; + e.inputEvent = INPUT_BROKER_NONE; + bool currentlyPressed = !ss.digitalRead(SS_SWITCH); + + if (currentlyPressed && !wasPressed) { + e.inputEvent = INPUT_BROKER_SELECT; + } + wasPressed = currentlyPressed; + + int32_t new_position = ss.getEncoderPosition(); + // did we move arounde? + if (encoder_position != new_position) { + if (encoder_position == 0 && new_position != 1) { + e.inputEvent = INPUT_BROKER_ALT_PRESS; + } else if (new_position == 0 && encoder_position != 1) { + e.inputEvent = INPUT_BROKER_USER_PRESS; + } else if (new_position > encoder_position) { + e.inputEvent = INPUT_BROKER_USER_PRESS; + } else { + e.inputEvent = INPUT_BROKER_ALT_PRESS; + } + encoder_position = new_position; + } + if (e.inputEvent != INPUT_BROKER_NONE) { + e.source = this->_originName; + e.kbchar = 0x00; + this->notifyObservers(&e); + } + + return 50; +} +#endif \ No newline at end of file diff --git a/src/input/SeesawRotary.h b/src/input/SeesawRotary.h new file mode 100644 index 000000000..3812b130a --- /dev/null +++ b/src/input/SeesawRotary.h @@ -0,0 +1,29 @@ +#pragma once +#ifdef ARCH_PORTDUINO + +#include "Adafruit_seesaw.h" +#include "InputBroker.h" +#include "concurrency/OSThread.h" +#include "configuration.h" + +#define SS_SWITCH 24 +#define SS_NEOPIX 6 + +#define SEESAW_ADDR 0x36 + +class SeesawRotary : public Observable, public concurrency::OSThread +{ + public: + const char *_originName; + bool init(); + SeesawRotary(const char *name); + int32_t runOnce() override; + + private: + Adafruit_seesaw ss; + int32_t encoder_position; + bool wasPressed = false; +}; + +extern SeesawRotary *seesawRotary; +#endif \ No newline at end of file diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp index 403f36a04..3528f57f5 100644 --- a/src/modules/Modules.cpp +++ b/src/modules/Modules.cpp @@ -53,6 +53,7 @@ #endif #if ARCH_PORTDUINO #include "input/LinuxInputImpl.h" +#include "input/SeesawRotary.h" #include "modules/Telemetry/HostMetrics.h" #if !MESHTASTIC_EXCLUDE_STOREFORWARD #include "modules/StoreForwardModule.h" @@ -163,7 +164,6 @@ void setupModules() // Example: Put your module here // new ReplyModule(); #if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER - if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1(); if (!rotaryEncoderInterruptImpl1->init()) { @@ -189,6 +189,11 @@ void setupModules() #endif // HAS_BUTTON #if ARCH_PORTDUINO if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + seesawRotary = new SeesawRotary("SeesawRotary"); + if (!seesawRotary->init()) { + delete seesawRotary; + seesawRotary = nullptr; + } aLinuxInputImpl = new LinuxInputImpl(); aLinuxInputImpl->init(); } From 41f52a65664966636b3084afce680ecabfa45b88 Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 12 Jul 2025 15:35:57 -0400 Subject: [PATCH 452/461] Build: Update platformio with `pkg install` (#7315) --- bin/build-esp32.sh | 2 +- bin/build-native.sh | 2 +- bin/build-nrf52.sh | 2 +- bin/build-rp2xx0.sh | 2 +- bin/build-stm32wl.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/build-esp32.sh b/bin/build-esp32.sh index 96578e914..92836db23 100755 --- a/bin/build-esp32.sh +++ b/bin/build-esp32.sh @@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware* rm -r $OUTDIR/* || true # Important to pull latest version of libs into all device flavors, otherwise some devices might be stale -platformio pkg update -e $1 +platformio pkg install -e $1 echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS" rm -f .pio/build/$1/firmware.* diff --git a/bin/build-native.sh b/bin/build-native.sh index 51379ad76..fff86e87e 100755 --- a/bin/build-native.sh +++ b/bin/build-native.sh @@ -25,7 +25,7 @@ mkdir -p $OUTDIR/ rm -r $OUTDIR/* || true # Important to pull latest version of libs into all device flavors, otherwise some devices might be stale -pio pkg update --environment "$PIO_ENV" || platformioFailed +pio pkg install --environment "$PIO_ENV" || platformioFailed pio run --environment "$PIO_ENV" || platformioFailed cp ".pio/build/$PIO_ENV/program" "$OUTDIR/meshtasticd_linux_$(uname -m)" cp bin/native-install.* $OUTDIR diff --git a/bin/build-nrf52.sh b/bin/build-nrf52.sh index 9d0b3dfdd..deca209d2 100755 --- a/bin/build-nrf52.sh +++ b/bin/build-nrf52.sh @@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware* rm -r $OUTDIR/* || true # Important to pull latest version of libs into all device flavors, otherwise some devices might be stale -platformio pkg update -e $1 +platformio pkg install -e $1 echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS" rm -f .pio/build/$1/firmware.* diff --git a/bin/build-rp2xx0.sh b/bin/build-rp2xx0.sh index dad6a7e67..cb4865914 100755 --- a/bin/build-rp2xx0.sh +++ b/bin/build-rp2xx0.sh @@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware* rm -r $OUTDIR/* || true # Important to pull latest version of libs into all device flavors, otherwise some devices might be stale -platformio pkg update -e $1 +platformio pkg install -e $1 echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS" rm -f .pio/build/$1/firmware.* diff --git a/bin/build-stm32wl.sh b/bin/build-stm32wl.sh index 76c5a75fb..f62df4842 100755 --- a/bin/build-stm32wl.sh +++ b/bin/build-stm32wl.sh @@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware* rm -r $OUTDIR/* || true # Important to pull latest version of libs into all device flavors, otherwise some devices might be stale -platformio pkg update -e $1 +platformio pkg install -e $1 echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS" rm -f .pio/build/$1/firmware.* From 4342d51f5aef8868b80aca98abda38423d32e6fc Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 12 Jul 2025 14:44:58 -0500 Subject: [PATCH 453/461] Bump Framework-native and set version string. (#7317) --- arch/portduino/portduino.ini | 2 +- src/platform/portduino/PortduinoGlue.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 874f0c868..03a8a6583 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/681ee029207e9fd040afa223df6e54074cbbe084.zip + https://github.com/meshtastic/platform-native/archive/6cb7a455b440dd0738e8ed74a18136ed5cf7ea63.zip framework = arduino build_src_filter = diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 4ece2418d..685f0d077 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -35,6 +35,8 @@ char *configPath = nullptr; char *optionMac = nullptr; bool forceSimulated = false; +const char *argp_program_version = optstr(APP_VERSION); + // FIXME - move setBluetoothEnable into a HALPlatform class void setBluetoothEnable(bool enable) { From 86be2ac12fe2668a7fda8ddce098e827a8592b57 Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 12 Jul 2025 17:26:25 -0400 Subject: [PATCH 454/461] userPrefs: Set default ringtone nag time (#7314) --- src/mesh/Default.h | 5 +++++ src/mesh/NodeDB.cpp | 8 ++++---- src/modules/ExternalNotificationModule.cpp | 2 +- userPrefs.jsonc | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/mesh/Default.h b/src/mesh/Default.h index 7a38e21f1..2f05da98d 100644 --- a/src/mesh/Default.h +++ b/src/mesh/Default.h @@ -24,6 +24,11 @@ #define min_node_info_broadcast_secs 60 * 60 // No regular broadcasts of more than once an hour #define min_neighbor_info_broadcast_secs 4 * 60 * 60 #define default_map_publish_interval_secs 60 * 60 +#ifdef USERPREFS_RINGTONE_NAG_SECS +#define default_ringtone_nag_secs USERPREFS_RINGTONE_NAG_SECS +#else +#define default_ringtone_nag_secs 60 +#endif #define default_mqtt_address "mqtt.meshtastic.org" #define default_mqtt_username "meshdev" diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 5ca515dd4..270db6b2c 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -778,7 +778,7 @@ void NodeDB::installDefaultModuleConfig() moduleConfig.external_notification.output_buzzer = PIN_BUZZER; moduleConfig.external_notification.use_pwm = true; moduleConfig.external_notification.alert_message_buzzer = true; - moduleConfig.external_notification.nag_timeout = 60; + moduleConfig.external_notification.nag_timeout = default_ringtone_nag_secs; #endif #if defined(RAK4630) || defined(RAK11310) || defined(RAK3312) // Default to RAK led pin 2 (blue) @@ -787,7 +787,7 @@ void NodeDB::installDefaultModuleConfig() moduleConfig.external_notification.active = true; moduleConfig.external_notification.alert_message = true; moduleConfig.external_notification.output_ms = 1000; - moduleConfig.external_notification.nag_timeout = 60; + moduleConfig.external_notification.nag_timeout = default_ringtone_nag_secs; #endif #ifdef HAS_I2S @@ -796,10 +796,10 @@ void NodeDB::installDefaultModuleConfig() moduleConfig.external_notification.use_i2s_as_buzzer = true; moduleConfig.external_notification.alert_message_buzzer = true; #if HAS_TFT - if (moduleConfig.external_notification.nag_timeout == 60) + if (moduleConfig.external_notification.nag_timeout == default_ringtone_nag_secs) moduleConfig.external_notification.nag_timeout = 0; #else - moduleConfig.external_notification.nag_timeout = 60; + moduleConfig.external_notification.nag_timeout = default_ringtone_nag_secs; #endif #endif #ifdef NANO_G2_ULTRA diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index 76566d4da..5d7233279 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -363,7 +363,7 @@ ExternalNotificationModule::ExternalNotificationModule() &meshtastic_RTTTLConfig_msg, &rtttlConfig) != LoadFileResult::LOAD_SUCCESS) { memset(rtttlConfig.ringtone, 0, sizeof(rtttlConfig.ringtone)); // The default ringtone is always loaded from userPrefs.jsonc - strncpy(rtttlConfig.ringtone, USERPREFS_RINGTONE, sizeof(rtttlConfig.ringtone)); + strncpy(rtttlConfig.ringtone, USERPREFS_RINGTONE_RTTTL, sizeof(rtttlConfig.ringtone)); } LOG_INFO("Init External Notification Module"); diff --git a/userPrefs.jsonc b/userPrefs.jsonc index c32bc7841..3da8e7ba6 100644 --- a/userPrefs.jsonc +++ b/userPrefs.jsonc @@ -53,6 +53,7 @@ // "USERPREFS_MQTT_ENCRYPTION_ENABLED": "true", // "USERPREFS_MQTT_TLS_ENABLED": "false", // "USERPREFS_MQTT_ROOT_TOPIC": "event/REPLACEME", - "USERPREFS_RINGTONE": "24:d=32,o=5,b=565:f6,p,f6,4p,p,f6,p,f6,2p,p,b6,p,b6,p,b6,p,b6,p,b,p,b,p,b,p,b,p,b,p,b,p,b,p,b,1p.,2p.,p", + // "USERPREFS_RINGTONE_NAG_SECS": "60", + "USERPREFS_RINGTONE_RTTTL": "24:d=32,o=5,b=565:f6,p,f6,4p,p,f6,p,f6,2p,p,b6,p,b6,p,b6,p,b6,p,b,p,b,p,b,p,b,p,b,p,b,p,b,p,b,1p.,2p.,p", "USERPREFS_TZ_STRING": "tzplaceholder " } From 77768e9023f533789f6e9493f73d763b89683623 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 13 Jul 2025 00:39:20 -0400 Subject: [PATCH 455/461] Remove Ubuntu oracular (#7322) --- .github/workflows/daily_packaging.yml | 2 +- .github/workflows/release_channels.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/daily_packaging.yml b/.github/workflows/daily_packaging.yml index 18939d567..63d24687b 100644 --- a/.github/workflows/daily_packaging.yml +++ b/.github/workflows/daily_packaging.yml @@ -30,7 +30,7 @@ jobs: strategy: fail-fast: false matrix: - series: [plucky, oracular, noble, jammy] + series: [plucky, noble, jammy] uses: ./.github/workflows/package_ppa.yml with: ppa_repo: ppa:meshtastic/daily diff --git a/.github/workflows/release_channels.yml b/.github/workflows/release_channels.yml index aac57fcbf..ed2de1717 100644 --- a/.github/workflows/release_channels.yml +++ b/.github/workflows/release_channels.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - series: [plucky, oracular, noble, jammy] + series: [plucky, noble, jammy] uses: ./.github/workflows/package_ppa.yml with: ppa_repo: |- From fd414ed1499a9245fd829bfe97f7e9d3c8b2c559 Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Sun, 13 Jul 2025 15:58:01 +0800 Subject: [PATCH 456/461] feat: DIY Seeed XIAO nRF52840 + EBYTE E22 variants, pin-compatible with Wio-SX1262 kit (#7105) These DIY builds are functionally similar to the legacy xiao_ble variant, but use a pinout harmonized with the officially-supported XIAO nRF52840 & Wio-SX1262 Kit for Meshtastic (SKU 102010710). An additional E22-900M33S variant is provided to ensure SX1262 transmit power is set below the maximum PA input for that module, to avoid damaging it. - seeed_xiao_nrf52840_e22_900m30s: - XIAO nRF52840 + EBYTE E22-900M30S - EBYTE E22 pinout matching Wio-SX1262 (SKU 113010003) - I2C - SDA: D6 - SCL: D7 - User button: D0 - Gain is programmed in firmware - user Tx power setting is the desired final output power - seeed_xiao_nrf52840_e22_900m33s: - XIAO nRF52840 + EBYTE E22-900M33S - EBYTE E22 pinout matching Wio-SX1262 (SKU 113010003) - I2C - SDA: D6 - SCL: D7 - User button: D0 - Gain is programmed in firmware - user Tx power setting is the desired final output power Signed-off-by: Andrew Yong --- variants/diy/platformio.ini | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/variants/diy/platformio.ini b/variants/diy/platformio.ini index 153796daf..f6b1c6766 100644 --- a/variants/diy/platformio.ini +++ b/variants/diy/platformio.ini @@ -96,6 +96,20 @@ board_level = extra build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -D PRIVATE_HW -DXIAO_BLE_LEGACY_PINOUT -DEBYTE_E22 -DEBYTE_E22_900M30S build_unflags = -DGPS_L76K +; Seeed XIAO nRF52840 + EBYTE E22-900M30S - Pinout matching Wio-SX1262 (SKU 113010003) +[env:seeed_xiao_nrf52840_e22_900m30s] +extends = env:seeed_xiao_nrf52840_kit +board_level = extra +build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -D PRIVATE_HW -DEBYTE_E22 -DEBYTE_E22_900M30S +build_unflags = -DGPS_L76K + +; Seeed XIAO nRF52840 + EBYTE E22-900M33S - Pinout matching Wio-SX1262 (SKU 113010003) +[env:seeed_xiao_nrf52840_e22_900m33s] +extends = env:seeed_xiao_nrf52840_kit +board_level = extra +build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -D PRIVATE_HW -DEBYTE_E22 -DEBYTE_E22_900M33S +build_unflags = -DGPS_L76K + ; Seeed XIAO nRF52840 + XIAO Wio SX1262 DIY [env:seeed-xiao-nrf52840-wio-sx1262] board = xiao_ble_sense From 0133c5dc9e536a35f85f64319e52482fa0dbbd69 Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Sun, 13 Jul 2025 19:12:24 +0800 Subject: [PATCH 457/461] feat: New variant esp32c3_super_mini (#7133) https://www.espboards.dev/esp32/esp32-c3-super-mini/ DIY build by @AntonKartajaya on Meshtastic Discord and a PCB version WIP by https://github.com/NomDeTom. - I2C - I2C_SDA: 1 - I2C_SCL: 0 - OLED: SSD1306 - GPS - GPS_RX_PIN: 20 - GPS_TX_PIN: 21 - Button - BUTTON_PIN: 9 - SPI - SCK: 10 - MISO: 6 - MOSI: 7 - CS: 8 - LoRa: SX1262 - LORA_RESET: 5 - LORA_DIO1: 3 - LORA_RXEN: 2 - LORA_BUSY: 4 Signed-off-by: Andrew Yong --- .../diy/esp32c3_super_mini/pins_arduino.h | 24 ++++++++ variants/diy/esp32c3_super_mini/variant.h | 61 +++++++++++++++++++ variants/diy/platformio.ini | 13 ++++ 3 files changed, 98 insertions(+) create mode 100644 variants/diy/esp32c3_super_mini/pins_arduino.h create mode 100644 variants/diy/esp32c3_super_mini/variant.h diff --git a/variants/diy/esp32c3_super_mini/pins_arduino.h b/variants/diy/esp32c3_super_mini/pins_arduino.h new file mode 100644 index 000000000..a325b81eb --- /dev/null +++ b/variants/diy/esp32c3_super_mini/pins_arduino.h @@ -0,0 +1,24 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +static const uint8_t TX = 21; +static const uint8_t RX = 20; + +static const uint8_t SDA = 1; +static const uint8_t SCL = 0; + +static const uint8_t SS = 8; +static const uint8_t MOSI = 7; +static const uint8_t MISO = 6; +static const uint8_t SCK = 10; + +static const uint8_t A0 = 0; +static const uint8_t A1 = 1; +static const uint8_t A2 = 2; +static const uint8_t A3 = 3; +static const uint8_t A4 = 4; +static const uint8_t A5 = 5; + +#endif /* Pins_Arduino_h */ diff --git a/variants/diy/esp32c3_super_mini/variant.h b/variants/diy/esp32c3_super_mini/variant.h new file mode 100644 index 000000000..48c275912 --- /dev/null +++ b/variants/diy/esp32c3_super_mini/variant.h @@ -0,0 +1,61 @@ +#ifndef _VARIANT_ESP32C3_SUPER_MINI_ +#define _VARIANT_ESP32C3_SUPER_MINI_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// I2C (Wire) & OLED +#define WIRE_INTERFACES_COUNT (1) +#define I2C_SDA (1) +#define I2C_SCL (0) + +#define USE_SSD1306 + +// GPS +#undef GPS_RX_PIN +#undef GPS_TX_PIN +#define GPS_RX_PIN (20) +#define GPS_TX_PIN (21) + +// Button +#define BUTTON_PIN (9) // BOOT button + +// LoRa +#define USE_LLCC68 +#define USE_SX1262 +// #define USE_RF95 +#define USE_SX1268 + +#define LORA_DIO0 RADIOLIB_NC +#define LORA_RESET (5) +#define LORA_DIO1 (3) +#define LORA_RXEN (2) +#define LORA_BUSY (4) +#define LORA_SCK (10) +#define LORA_MISO (6) +#define LORA_MOSI (7) +#define LORA_CS (8) + +#define SX126X_CS LORA_CS +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_BUSY +#define SX126X_RESET LORA_RESET +#define SX126X_RXEN LORA_RXEN + +#define SX126X_DIO3_TCXO_VOLTAGE (1.8) +#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#endif diff --git a/variants/diy/platformio.ini b/variants/diy/platformio.ini index f6b1c6766..1f0f6d126 100644 --- a/variants/diy/platformio.ini +++ b/variants/diy/platformio.ini @@ -141,3 +141,16 @@ build_flags = -D ARDUINO_USB_MODE=0 -D ARDUINO_USB_CDC_ON_BOOT=1 -I variants/diy/t-energy-s3_e22 + +; ESP32 C3 Super Mini Development Board +; https://www.espboards.dev/esp32/esp32-c3-super-mini/ +[env:esp32c3_super_mini] +extends = esp32c3_base +board = esp32-c3-devkitm-1 +build_flags = + ${esp32_base.build_flags} + -D PRIVATE_HW + -I variants/diy/esp32c3_super_mini + -D ARDUINO_USB_MODE=1 + -D ARDUINO_USB_CDC_ON_BOOT=1 +board_level = extra From b49e59b9048dbcc86ed7af9fd41e3fbe892ba40e Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Sun, 13 Jul 2025 19:17:50 +0800 Subject: [PATCH 458/461] xiao_ble README.md updates (#7283) * docs(xiao_ble): Simplify building and flashing instructions - **Update Bootloader** - deleted this section, as Meshtastic now builds-in a compatible SoftDevice - **PlatformIO Environment Preparation** - deleted this section, as Meshtastic now builds-in a compatible SoftDevice - **Build Meshtastic** - simplified it greatly by referring to Meshtastic documentation - **Flash the firmware to the Xiao BLE** - simplified it greatly as Meshtastic now builds firmware.uf2; added some observations for a succesful flash Light cleanup of Markdown and renumbering of sections. Signed-off-by: Andrew Yong * docs(xiao_ble): Replace some HTML with Markdown, cleanup Markdown Signed-off-by: Andrew Yong * docs(xiao_ble): Update SX126X_TXEN definition location Signed-off-by: Andrew Yong * docs(xiao_ble): Fresher information about E22 modules Signed-off-by: Andrew Yong * docs(xiao_ble): Instructions for E22...M33S modules Also re-order the Build section to come after the Wiring section since the build instructions require special attention if the wiring/modules differ from the variant's expected pins/module. Signed-off-by: Andrew Yong * docs(xiao_ble): Rename all XIAO BLE to XIAO nRF52840 Signed-off-by: Andrew Yong * docs(xiao_ble): Remove note about Linux since shell script is gone Signed-off-by: Andrew Yong * docs(xiao_ble): trunk fmt and fix links Signed-off-by: Andrew Yong --------- Signed-off-by: Andrew Yong --- variants/diy/xiao_ble/README.md | 308 +++++++++++--------------------- 1 file changed, 106 insertions(+), 202 deletions(-) diff --git a/variants/diy/xiao_ble/README.md b/variants/diy/xiao_ble/README.md index 2a08138ba..fe6dcba2d 100644 --- a/variants/diy/xiao_ble/README.md +++ b/variants/diy/xiao_ble/README.md @@ -1,264 +1,168 @@ -# +# XIAO nrf52840/nrf52840 Sense + Ebyte E22-900M30S -

- Xiao BLE/BLE Sense + Ebyte E22-900M30S -

- -

- A step-by-step guide for macOS and Linux -

+_A step-by-step guide for macOS and Linux._ ## Introduction -This guide will walk you through everything needed to get the Xiao BLE (or BLE Sense) running Meshtastic using an Ebyte E22-900M30S LoRa module. The combination of the E22 with an nRF52840 MCU is desirable because it allows for both very low idle (Rx) power draw and high transmit power. The Xiao BLE is a small but surprisingly well-appointed nRF52840 board, with enough GPIO for most Meshtastic applications and a built-in LiPo charger. The E22, on the other hand, is a famously inscrutable and mysterious beast. It is one of the more readily available LoRa modules capable of transmitting at 30 dBm, and includes an LNA to boost its Rx sensitivity a few dB beyond that of the SX1262. However, its documentation is relatively sparse overall, and seems to merely hint at (or completely omit) several key details regarding its functionality. Thus, much of what follows is a synthesis of my observations and inferences over the course of many hours of trial and error. +This guide will walk you through everything needed to get the XIAO nrf52840 (or XIAO nrf52840 Sense) running Meshtastic using an Ebyte E22-900M30S LoRa module. The combination of the E22 with an nRF52840 MCU is desirable because it allows for both very low idle (Rx) power draw _and_ high transmit power. -

Acknowledgement and friendly disclaimer

+The XIAO nrf52840 is a small but surprisingly well-appointed nRF52840 board, with enough GPIO for most Meshtastic applications and a built-in LiPo charger. + +The E22, on the other hand, is a famously inscrutable and mysterious beast. It is one of the more readily available LoRa modules capable of transmitting at 30 dBm, and includes an LNA to boost its Rx sensitivity a few dB beyond that of the SX1262. + +However, its documentation is relatively sparse overall, and seems to merely hint at (or completely omit) several key details regarding its functionality. Thus, much of what follows is a synthesis of my observations and inferences over the course of many hours of trial and error. + +### Acknowledgement and Friendly Disclaimer Huge thanks to those in the community who have forged the way with the E22, without whose hard work none of this would have been possible! (thebentern, riddick, rainer_vie, beegee-tokyo, geeksville, caveman99, Der_Bear, PlumRugOfDoom, BigCorvus, and many others.) -
- Please take the conclusions here as a tentative work in progress, representing my current (and fairly limited) understanding of the E22 when paired with this particular MCU. It is my hope that this guide will be helpful to others who are interested in trying a DIY Meshtastic build, and also be subject to revision by folks with more experience and better test equipment. -### Obligatory liability disclaimer +### Obligatory Liability Disclaimer This guide and all associated content is for informational purposes only. The information presented is intended for consumption only by persons having appropriate technical skill and judgement, to be used entirely at their own discretion and risk. The authors of this guide in no way provide any warranty, express or implied, toward the content herein, nor its correctness, safety, or suitability to any particular purpose. By following the instructions in this guide in part or in full, you assume all responsibility for all potential risks, including but not limited to fire, property damage, bodily injury, and death. -### Note +## 1. Wire the board -These instructions assume you are running macOS or Linux, but it should be relatively easy to translate each command for Windows. (In this case, in step 2 below, each line of `xiao_ble.sh` would also need to be converted to the equivalent Windows CLI command and run individually.) +Connecting the E22 to the XIAO nrf52840 is straightforward, but there are a few gotchas to be mindful of. -## 1. Update Bootloader +### On the XIAO nrf52840 -The first thing you will need to do is update the Xiao BLE's bootloader. The stock bootloader is functionally very similar to the Adafruit nRF52 UF2 bootloader, but apparently not quite enough so to work with Meshtastic out of the box. +- Pins D4 and D5 are currently mapped to `PIN_WIRE_SDA` and `PIN_WIRE_SCL`, respectively. If you are not using I²C and would like to free up pins D4 and D5 for use as GPIO, `PIN_WIRE_SDA` and `PIN_WIRE_SCL` can be reassigned to any two other unused pin numbers. +- Pins D6 and D7 were originally mapped to the TX and RX pins for serial interface 1 (`PIN_SERIAL1_RX` and `PIN_SERIAL1_TX`) but are currently set to -1 in `variant.h`. If you need to expose a serial interface, you can restore these pins and move e.g. `SX126X_RXEN` to pin 4 or 5 (the opposite should work too). -1. Connect the Xiao BLE to your computer via USB-C. +### On the E22 -2. Install `adafruit-nrfutil` by following the instructions
here. +- There are two options for the E22's `TXEN` pin: + 1. It can be connected to the MCU on the pin defined as `SX126X_TXEN` in `variant.h`. In this configuration, the MCU will control Tx/Rx switching "manually". As long as `SX126X_TXEN` and `SX126X_RXEN` are both defined in `variant.h` (and neither is set to `RADIOLIB_NC`), `SX126xInterface.cpp` will initialize the E22 correctly for this mode. + 2. Alternately, it can be connected to the E22's `DIO2` pin only, with neither `TXEN` nor `DIO2` being connected to the MCU. In this configuration, the E22 will control Tx/Rx switching automatically. In `variant.h`, as long as `SX126X_TXEN` is defined as `RADIOLIB_NC`, and `SX126X_RXEN` is defined and connected to the E22's `RXEN` pin, and `E22_TXEN_CONNECTED_TO_DIO2` is defined, `SX126xInterface.cpp` will initialize the E22 correctly for this mode. This configuration frees up a GPIO, and presents no drawbacks that I have found. +- Note that any combination other than the two described above will likely result in unexpected behavior. In my testing, some of these other configurations appeared to "work" at first glance, but every one I tried had at least one of the following flaws: weak Tx power, extremely poor Rx sensitivity, or the E22 overheating because TXEN was never pulled low, causing its PA to stay on indefinitely. +- Along the same lines, it is a good idea to check the E22's temperature frequently by lightly touching the shield. If you feel the shield getting hot (i.e. approaching uncomfortable to touch) near pins 1, 2, and 3, something is probably misconfigured; disconnect both the XIAO nrf52840 and E22 from power and double check wiring and pin mapping. +- Whether you opt to let the E22 control Rx and Tx or handle this manually, **the E22's `RXEN` pin must always be connected to the MCU** on the pin defined as `SX126X_RXEN` in `variant.h`. -3. Open a terminal window and navigate to `firmware/variants/xiao_ble` (where `firmware` is the directory into which you have cloned the Meshtastic firmware repo). +#### Note -4. Run the following command, replacing `/dev/cu.usbmodem2101` with the serial port your Xiao BLE is connected to: +The default pin mapping in `variant.h` uses "Automatic Tx/Rx switching" mode. - ```bash - adafruit-nrfutil --verbose dfu serial --package xiao_nrf52840_ble_bootloader-0.7.0-22-g277a0c8_s140_7.3.0.zip --port /dev/cu.usbmodem2101 -b 115200 --singlebank --touch 1200 - ``` +If you wire your board for Manual Tx/Rx Switching Mode, `SX126X_TXEN` must be defined (`#define #define SX126X_TXEN D6`) in `variants/seeed_xiao_nrf52840_kit/variant.h` in the code block following: -5. If all goes well, the Xiao BLE's red LED should start to pulse slowly, and you should see a new USB storage device called `XIAO-BOOT` appear under `Locations` in Finder. +```c +#ifdef XIAO_BLE_LEGACY_PINOUT +// Legacy xiao_ble variant pinout for third-party SX126x modules e.g. EBYTE E22 +``` -  +### Example Wiring for Automatic Tx/Rx Switching Mode -## 2. PlatformIO Environment Preparation +#### MCU -> E22 Connections -Before building Meshtastic for the Xiao BLE + E22, it is necessary to pull in SoftDevice 7.3.0 and its associated linker script (nrf52840_s140_v7.ld) from Seeed Studio's Arduino core. The `xiao_ble.sh` script does this. +| XIAO nrf52840 pin | variant.h definition | E22 pin | Notes | +| :---------------- | :------------------- | :-------- | :------------------------------------------------------------------------------------------------------------------- | +| D0 | SX126X_CS | 19 (NSS) | | +| D1 | SX126X_DIO1 | 13 (DIO1) | | +| D2 | SX126X_BUSY | 14 (BUSY) | | +| D3 | SX126X_RESET | 15 (NRST) | | +| D7 | SX126X_RXEN | 6 (RXEN) | These pins must still be connected, and `SX126X_RXEN` defined in `variant.h`, otherwise Rx sensitivity will be poor. | +| D8 | PIN_SPI_SCK | 18 (SCK) | | +| D9 | PIN_SPI_MISO | 16 (MISO) | | +| D10 | PIN_SPI_MOSI | 17 (MOSI) | | -1. In your terminal window, run the following command: - - ```bash - sudo ./xiao_ble.sh - ``` - -  - -## 3. Build Meshtastic - -At this point, you should be able to build the firmware successfully. - -1. In VS Code, press `Command Shift P` to bring up the command palette. - -2. Search for and run the `Developer: Reload Window` command. - -3. Bring up the command palette again with `Command Shift P`. Search for and run the `PlatformIO: Pick Project Environment` command. - -4. In the list of environments, select `env:xiao_ble`. PlatformIO may update itself for a minute or two, and should let you know once done. - -5. Return to the command palette once again (`Command Shift P`). Search for and run the `PlatformIO: Build` command. - -6. PlatformIO will build the project. After a few minutes you should see a green `SUCCESS` message. - -  - -## 4. Wire the board - -Connecting the E22 to the Xiao BLE is straightforward, but there are a few gotchas to be mindful of. - -- On the Xiao BLE: - - - Pins D4 and D5 are currently mapped to `PIN_WIRE_SDA` and `PIN_WIRE_SCL`, respectively. If you are not using I²C and would like to free up pins D4 and D5 for use as GPIO, `PIN_WIRE_SDA` and `PIN_WIRE_SCL` can be reassigned to any two other unused pin numbers. - - - Pins D6 and D7 were originally mapped to the TX and RX pins for serial interface 1 (`PIN_SERIAL1_RX` and `PIN_SERIAL1_TX`) but are currently set to -1 in `variant.h`. If you need to expose a serial interface, you can restore these pins and move e.g. `SX126X_RXEN` to pin 4 or 5 (the opposite should work too). - -- On the E22: - - - There are two options for the E22's `TXEN` pin: - - 1. It can be connected to the MCU on the pin defined as `SX126X_TXEN` in `variant.h`. In this configuration, the MCU will control Tx/Rx switching "manually". As long as `SX126X_TXEN` and `SX126X_RXEN` are both defined in `variant.h` (and neither is set to `RADIOLIB_NC`), `SX126xInterface.cpp` will initialize the E22 correctly for this mode. - - 2. Alternately, it can be connected to the E22's `DIO2` pin only, with neither `TXEN` nor `DIO2` being connected to the MCU. In this configuration, the E22 will control Tx/Rx switching automatically. In `variant.h`, as long as `SX126X_TXEN` is defined as `RADIOLIB_NC`, and `SX126X_RXEN` is defined and connected to the E22's `RXEN` pin, and `E22_TXEN_CONNECTED_TO_DIO2` is defined, `SX126xInterface.cpp` will initialize the E22 correctly for this mode. This configuration frees up a GPIO, and presents no drawbacks that I have found. - - - Note that any combination other than the two described above will likely result in unexpected behavior. In my testing, some of these other configurations appeared to "work" at first glance, but every one I tried had at least one of the following flaws: weak Tx power, extremely poor Rx sensitivity, or the E22 overheating because TXEN was never pulled low, causing its PA to stay on indefinitely. - - - Along the same lines, it is a good idea to check the E22's temperature frequently by lightly touching the shield. If you feel the shield getting hot (i.e. approaching uncomfortable to touch) near pins 1, 2, and 3, something is probably misconfigured; disconnect both the Xiao BLE and E22 from power and double check wiring and pin mapping. - - - Whether you opt to let the E22 control Rx and Tx or handle this manually, the E22's `RXEN` pin must always be connected to the MCU on the pin defined as `SX126X_RXEN` in `variant.h`. - -

Note

- -The default pin mapping in `variant.h` uses 'automatic Tx/Rx switching' mode. If you wire your board for manual Rx/Tx switching, make sure to update `variant.h` accordingly by commenting/uncommenting the necessary lines in the 'E22 Tx/Rx control options' section. - -  - ---- - -  - -

Example wiring for "E22 automatic Tx/Rx switching" mode:

-  - -MCU -> E22 connections - -| Xiao BLE pin | variant.h definition | E22 pin | Notes | -| :----------- | :------------------- | :-------- | :------------------------------------------------------------------------------------------------------------------- | -| D0 | SX126X_CS | 19 (NSS) | | -| D1 | SX126X_DIO1 | 13 (DIO1) | | -| D2 | SX126X_BUSY | 14 (BUSY) | | -| D3 | SX126X_RESET | 15 (NRST) | | -| D7 | SX126X_RXEN | 6 (RXEN) | These pins must still be connected, and `SX126X_RXEN` defined in `variant.h`, otherwise Rx sensitivity will be poor. | -| D8 | PIN_SPI_SCK | 18 (SCK) | | -| D9 | PIN_SPI_MISO | 16 (MISO) | | -| D10 | PIN_SPI_MOSI | 17 (MOSI) | | - -  -  - -E22 -> E22 connections: +#### E22 -> E22 Connections | E22 pin | E22 pin | Notes | | :------ | :------ | :------------------------------------------------------------------------ | | TXEN | DIO2 | These must be physically connected for automatic Tx/Rx switching to work. | -

Note

+#### Note The schematic (`xiao-ble-e22-schematic.png`) in the `eagle-project` directory uses this wiring. -  +### Example Wiring for Manual Tx/Rx Switching Mode ---- +#### MCU -> E22 Connections -  +| XIAO nrf52840 pin | variant.h definition | E22 pin | Notes | +| :---------------- | :------------------- | :-------- | :---- | +| D0 | SX126X_CS | 19 (NSS) | | +| D1 | SX126X_DIO1 | 13 (DIO1) | | +| D2 | SX126X_BUSY | 14 (BUSY) | | +| D3 | SX126X_RESET | 15 (NRST) | | +| D6 | SX126X_TXEN | 7 (TXEN) | | +| D7 | SX126X_RXEN | 6 (RXEN) | | +| D8 | PIN_SPI_SCK | 18 (SCK) | | +| D9 | PIN_SPI_MISO | 16 (MISO) | | +| D10 | PIN_SPI_MOSI | 17 (MOSI) | | -

Example wiring for "Manual Tx/Rx switching" mode:

+#### E22 -> E22 connections -MCU -> E22 connections +_(none)_ -| Xiao BLE pin | variant.h definition | E22 pin | Notes | -| :----------- | :------------------- | :-------- | :---- | -| D0 | SX126X_CS | 19 (NSS) | | -| D1 | SX126X_DIO1 | 13 (DIO1) | | -| D2 | SX126X_BUSY | 14 (BUSY) | | -| D3 | SX126X_RESET | 15 (NRST) | | -| D6 | SX126X_TXEN | 7 (TXEN) | | -| D7 | SX126X_RXEN | 6 (RXEN) | | -| D8 | PIN_SPI_SCK | 18 (SCK) | | -| D9 | PIN_SPI_MISO | 16 (MISO) | | -| D10 | PIN_SPI_MOSI | 17 (MOSI) | | +## 2. Build Meshtastic -E22 -> E22 connections: (none) +1. Follow the [Building Meshtastic Firmware](https://meshtastic.org/docs/development/firmware/build/) documentation, stop after **Build** → **Step 2** +2. For **Build** → **Step 3**, select `xiao_ble` as your target +3. Adjust source code if you: + - Wired your board for Manual Tx/Rx Switching Mode: see [Wire the Board](#1-wire-the-board) + - Used an E22-900M33S module + (this step is important to avoid **damaging the power amplifier** in the M33S module and **transmitting power above legal limits**!): + 1. Open `variants/diy/platformio.ini` + 2. Search for `[env:xiao_ble]` + 3. In the line starting with `build_flags` within this section, change `-DEBYTE_E22_900M30S` to `-DEBYTE_E22_900M33S` +4. Follow **Build** → **Step 4** to build the firmware +5. Stop here, because the **PlatformIO: Upload** step does not work for factory-fresh XIAO nrf52840 (the automatic reset to bootloader only works if Meshtastic firmware is already running) +6. The built `firmware.uf2` binary can be found in the folder `.pio/build/xiao_ble/firmware.uf2` (relative to where you cloned the Git repository to), we will need it for [flashing the firmware](#3-flash-the-firmware-to-the-xiao-nrf52840) (manually) -  +## 3. Flash the Firmware to the XIAO nrf52840 -## 5. Flash the firmware to the Xiao BLE +1. Double press the XIAO nrf52840's `reset` button to put it in bootloader mode, and a USB volume named `XIAO SENSE` will appear +2. Copy the `firmware.uf2` file to the `XIAO SENSE` volume (refer to the last step of [Build Meshtastic](#2-build-meshtastic)) +3. The XIAO nrf52840's red LED will flash for several seconds as the firmware is copied +4. Once Meshtastic firmware succesfully boots, the: + 1. Green LED will turn on + 2. Red LED will flash several times to indicate flash memory writes during initial settings file creation + 3. Green LED will blink every second once the firmware is running normally +5. If you do not see the above LED patters, proceed to [Troubleshooting](#4-troubleshooting) -1. Double press the Xiao's `reset` button to put it in bootloader mode. -2. In a terminal window, navigate to the Meshtastic firmware repo's root directory, and from there to `.pio/build/xiao_ble`. -3. Convert the generated `.hex` file into a `.uf2` file: - - ```bash - ../../../bin/uf2conv.py firmware.hex -c -o firmware.uf2 -f 0xADA52840 - ``` - -4. Copy the new `.uf2` file to the Xiao's mass storage volume: - - ```bash - cp firmware.uf2 /Volumes/XIAO-BOOT - ``` - -5. The Xiao's red LED will flash for several seconds as the firmware is copied. -6. Once the firmware is copied, to verify it is running, run the following command: - - ```bash - meshtastic --noproto - ``` - -7. Then, press the Xiao's `reset` button again. You should see a lot of debug output logged in the terminal window. - -  - -## 6. Troubleshooting - -- If after flashing Meshtastic, the Xiao is bootlooped, look at the serial output (you can see this by running `meshtastic --noproto` with the device connected to your computer via USB). +## 4. Troubleshooting +- If after flashing Meshtastic, the XIAO is bootlooped, look at the serial output (you can see this by running `meshtastic --noproto` with the device connected to your computer via USB). - If you see that the SX1262 init result was -2, this likely indicates a wiring problem; double check your wiring and pin mapping in `variant.h`. - - - If you see an error mentioning tinyFS, this may mean you need to reformat the Xiao's storage: - - 1. Double press the `reset` button to put the Xiao in bootloader mode. - - 2. In a terminal window, navigate to the Meshtastic firmware repo's root directory, and from there to `variants/xiao_ble`. - - 3. Run the following command:  `cp xiao-ble-internal-format.uf2 /Volumes/XIAO-BOOT` - - 4. The Xiao's red LED will flash briefly as the filesystem format firmware is copied. - - 5. Run the following command:  `meshtastic --noproto` - - 6. In the output of the above command, you should see a message saying "Formatting...done". - - 7. To flash Meshtastic again, repeat the steps in section 5 above. - + - If you see an error mentioning tinyFS, this may mean you need to reformat the XIAO's storage: + 1. Open the [Meshtastic web flasher](https://flasher.meshtastic.org/) + 2. Select the **_Seeed XIAO NRF52840 Kit_** + 3. Click the **_trash can icon_** to the right of **_Flash_** + 4. Follow the instructions on the screen + **Do not flash the Seeed XIAO NRF52840 Kit firmware** if you have wired the LoRa module according to this variant, as the Seeed XIAO NRF52840 Kit uses different wiring for the SX1262 LoRa chip - If you don't see any specific error message, but the boot process is stuck or not proceeding as expected, this might also mean there is a conflict in `variant.h`. If you have made any changes to the pin mapping, ensure they do not result in a conflict. If all else fails, try reverting your changes and using the known-good configuration included here. - - The above might also mean something is wired incorrectly. Try reverting to one of the known-good example wirings in section 4. - - If the E22 gets hot to the touch: - - The power amplifier is likely running continually. Disconnect it and the Xiao from power immediately, and double check wiring and pin mapping. In my experimentation this occurred in cases where TXEN was inadvertenly high (usually due to a pin mapping conflict). + - The power amplifier is likely running continually. Disconnect it and the XIAO from power immediately, and double check wiring and pin mapping. In my experimentation this occurred in cases where TXEN was inadvertenly high (usually due to a pin mapping conflict). -  +## 5. Notes -## 7. Notes +- **Transmit Power** + - There is a power amplifier after the SX1262's Tx, so the actual Tx power is just over 7 dB greater than the SX1262's set Tx power (the E22-900M30S actually tops out just over 29dB at 5V according to the datasheet) + - Meshtastic firmware is aware of the gain of the E22-900M30S module, so the Meshtastic clients' Tx power setting reflects the actual output power, i.e. setting 30 dBm in the Meshtastic app programs the E22 module to correctly output 30 dBm, setting 24 dBm will output 24 dBm, etc. +- **Adequate 5V Power Supply to the E22 Module** + - Have a bypass capacitor from its 5V supply to ground; 100 µF works well + - Voltage must be between 5V–5.5V, lower supply voltage results in less output power; for example, with a fully charged LiPo at 4.2V, Tx power appears to max out around 26-27 dBm -- There are several anecdotal recommendations regarding the Tx power the E22's internal SX1262 should be set to in order to achieve the advertised output of 30 dBm, ranging from 4 (per this article in the RadioLib github repo) to 22 (per this conversation from the Meshtastic Discord). When paired with the Xiao BLE in the configurations described above, I observed that the output is at its maximum when Tx power is set to 22. +### Additional Reading -- To achieve its full output, the E22 should have a bypass capacitor from its 5V supply to ground. 100 µF works well. +- [S5NC/CDEBYTE_Modules](https://github.com/S5NC/CDEBYTE_Modules) has additional information about EBYTE E22 modules' internal workings, including photographs +- [RadioLib High power Radio Modules Guide](https://github.com/jgromes/RadioLib/wiki/High-power-Radio-Modules-Guide) -- The E22 will happily run on voltages lower than 5V, but the full output power will not be realized. For example, with a fully charged LiPo at 4.2V, Tx power appears to max out around 26-27 dBm. - -  - -## 8. Testing Methodology +## 6. Testing Methodology During what became a fairly long trial-and-error process, I did a lot of careful testing of Tx power and Rx sensitivity. My methodology in these tests was as follows: - All tests were conducted between two nodes: - - 1. The Xiao BLE + E22 coupled with an Abracon ARRKP4065-S915A ceramic patch antenna - - 2. A RAK 5005/4631 coupled with a Laird MA9-5N antenna via a 4" U.FL to Type N pigtail. - + 1. The XIAO nrf52840 + E22 coupled with an [Abracon ARRKP4065-S915A](https://www.digikey.com/en/products/detail/abracon-llc/ARRKP4065-S915A/8593263") ceramic patch antenna + 2. A RAK 5005/4631 coupled with a [Laird MA9-5N](https://www.streakwave.com/laird-technologies-ma9-5n-55dbi-900mhz-mobile-omni-select-mount) antenna via a 4" U.FL to Type N pigtail. - No other nodes were powered up onsite or nearby. - -
- - Each node and its antenna was kept in exactly the same position and orientation throughout testing. - - Other environmental factors (e.g. the location and resting position of my body in the room while testing) were controlled as carefully as possible. - - Each test comprised at least five (and often ten) runs, after which the results were averaged. - - All testing was done by sending single-character messages between nodes and observing the received RSSI reported in the message acknowledgement. Messages were sent one by one, waiting for each to be acknowledged or time out before sending the next. - -- The E22's Tx power was observed by sending messages from the RAK to the Xiao BLE + E22 and recording the received RSSI. - -- The opposite was done to observe the E22's Rx sensitivity: messages were sent from the Xiao BLE + E22 to the RAK, and the received RSSI was recorded. - -While this cannot match the level of accuracy achievable with actual test equipment in a lab setting, it was nonetheless sufficient to demonstrate the (sometimes very large) differences in Tx power and Rx sensitivity between various configurations. +- The E22's Tx power was observed by sending messages from the RAK to the XIAO nrf52840 + E22 and recording the received RSSI. +- The opposite was done to observe the E22's Rx sensitivity: messages were sent from the XIAO nrf52840 + E22 to the RAK, and the received RSSI was recorded. + While this cannot match the level of accuracy achievable with actual test equipment in a lab setting, it was nonetheless sufficient to demonstrate the (sometimes very large) differences in Tx power and Rx sensitivity between various configurations. From 622023de8b5f74db623db96a030874e72317f014 Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Sun, 13 Jul 2025 07:19:58 -0400 Subject: [PATCH 459/461] fix(device-update.sh): safely filter args without breaking parsing (#7305) The previous method of removing `--change-mode` from the argument list used a string (`NEW_ARGS`) and `eval set -- $NEW_ARGS` to reconstruct the positional parameters. This was both unsafe and incorrect. Because `NEW_ARGS` was built using quoted literal `$arg` strings instead of the actual values, it resulted in all filtered arguments being set to the same last value of `$arg`. This caused `getopts` to receive incorrect input and silently fail to parse options like `-p` and `-f`, leading to broken behavior and unset variables (e.g., `ESPTOOL_CMD` never got a port). This patch rewrites the logic to use an array (`NEW_ARGS+=("$arg")`), and resets positional parameters via `set -- "${NEW_ARGS[@]}"`. This preserves argument integrity and avoids the unsafe use of `eval`. Example of the broken behavior before this fix: ./device-update.sh -p /dev/ttyACM0 -f firmware.bin Resulted in: set -- firmware.bin firmware.bin firmware.bin firmware.bin Now: set -- -p /dev/ttyACM0 -f firmware.bin as expected. Signed-off-by: Neil Hanlon --- bin/device-update.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/device-update.sh b/bin/device-update.sh index 2a39cdef7..ce0b5e434 100755 --- a/bin/device-update.sh +++ b/bin/device-update.sh @@ -31,17 +31,16 @@ EOF } # Check for --change-mode and remove it from arguments -NEW_ARGS="" +NEW_ARGS=() for arg in "$@"; do if [ "$arg" = "--change-mode" ]; then CHANGE_MODE=true else - NEW_ARGS="$NEW_ARGS \"\$arg\"" + NEW_ARGS+=("$arg") fi done -# Reset positional parameters to filtered list -eval set -- $NEW_ARGS +set -- "${NEW_ARGS[@]}" while getopts ":hp:P:f:" opt; do case "${opt}" in From 5e28ee6d1e0e46f3ffa32364d5f5f92927e28acb Mon Sep 17 00:00:00 2001 From: Styne13 <6253936+Styne13@users.noreply.github.com> Date: Sun, 13 Jul 2025 13:26:35 +0200 Subject: [PATCH 460/461] NodeDB.cpp: Fix iOS bluetooth crash by ensuring UINT32_MAX is not used (#7312) Signed-off-by: Marcel <6253936+Styne13@users.noreply.github.com> Co-authored-by: Ben Meadors --- src/mesh/NodeDB.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 270db6b2c..185ea0744 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -344,6 +344,22 @@ NodeDB::NodeDB() config.device.node_info_broadcast_secs = MAX_INTERVAL; if (config.position.position_broadcast_secs > MAX_INTERVAL) config.position.position_broadcast_secs = MAX_INTERVAL; + if (config.position.gps_update_interval > MAX_INTERVAL) + config.position.gps_update_interval = MAX_INTERVAL; + if (config.position.gps_attempt_time > MAX_INTERVAL) + config.position.gps_attempt_time = MAX_INTERVAL; + if (config.position.position_flags > MAX_INTERVAL) + config.position.position_flags = MAX_INTERVAL; + if (config.position.rx_gpio > MAX_INTERVAL) + config.position.rx_gpio = MAX_INTERVAL; + if (config.position.tx_gpio > MAX_INTERVAL) + config.position.tx_gpio = MAX_INTERVAL; + if (config.position.broadcast_smart_minimum_distance > MAX_INTERVAL) + config.position.broadcast_smart_minimum_distance = MAX_INTERVAL; + if (config.position.broadcast_smart_minimum_interval_secs > MAX_INTERVAL) + config.position.broadcast_smart_minimum_interval_secs = MAX_INTERVAL; + if (config.position.gps_en_gpio > MAX_INTERVAL) + config.position.gps_en_gpio = MAX_INTERVAL; if (moduleConfig.neighbor_info.update_interval > MAX_INTERVAL) moduleConfig.neighbor_info.update_interval = MAX_INTERVAL; if (moduleConfig.telemetry.device_update_interval > MAX_INTERVAL) From 2ecbf704d0caff3ba0b02cd516299165075ce163 Mon Sep 17 00:00:00 2001 From: TSAO Date: Sun, 13 Jul 2025 21:28:05 +0800 Subject: [PATCH 461/461] Improve OLED UI Responsiveness and Force Redraws for Canned message module (#7324) * No delay between UI frame rendering for OLED * force redraw the display --------- Co-authored-by: Ben Meadors Co-authored-by: Jason P --- src/graphics/Screen.cpp | 7 ++++++- src/modules/CannedMessageModule.cpp | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 57ea64fa9..1f2e7e4d9 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -640,6 +640,11 @@ void Screen::forceDisplay(bool forceUiUpdate) // Tell EInk class to update the display static_cast(dispdev)->forceDisplay(); +#else + // No delay between UI frame rendering + if (forceUiUpdate) { + setFastFramerate(); + } #endif } @@ -1447,4 +1452,4 @@ bool shouldWakeOnReceivedMessage() return false; } return true; -} \ No newline at end of file +} diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 06a4993a7..a1b89e0f8 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -454,7 +454,7 @@ int CannedMessageModule::handleDestinationSelectionInput(const InputEvent *event else if ((destIndex / columns) >= (scrollIndex + visibleRows)) scrollIndex = (destIndex / columns) - visibleRows + 1; - screen->forceDisplay(); + screen->forceDisplay(true); return 1; } @@ -469,7 +469,7 @@ int CannedMessageModule::handleDestinationSelectionInput(const InputEvent *event if ((destIndex / columns) >= (scrollIndex + visibleRows)) scrollIndex = (destIndex / columns) - visibleRows + 1; - screen->forceDisplay(); + screen->forceDisplay(true); return 1; } @@ -491,7 +491,7 @@ int CannedMessageModule::handleDestinationSelectionInput(const InputEvent *event runState = returnToCannedList ? CANNED_MESSAGE_RUN_STATE_ACTIVE : CANNED_MESSAGE_RUN_STATE_FREETEXT; returnToCannedList = false; - screen->forceDisplay(); + screen->forceDisplay(true); return 1; } @@ -504,7 +504,7 @@ int CannedMessageModule::handleDestinationSelectionInput(const InputEvent *event // UIFrameEvent e; // e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; // notifyObservers(&e); - screen->forceDisplay(); + screen->forceDisplay(true); return 1; } @@ -2077,4 +2077,4 @@ String CannedMessageModule::drawWithCursor(String text, int cursor) return result; } -#endif \ No newline at end of file +#endif