From f10aa3daa250a9f733888448e6c6f8b650b2cbb9 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 26 Nov 2025 11:30:34 -0600 Subject: [PATCH 1/8] Fixes --- src/Power.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Power.cpp b/src/Power.cpp index 0ac89670f..a2c559d91 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -707,7 +707,6 @@ bool Power::setup() []() { power->setIntervalFromNow(0); runASAP = true; - BaseType_t higherWake = 0; }, CHANGE); #endif @@ -717,7 +716,6 @@ bool Power::setup() []() { power->setIntervalFromNow(0); runASAP = true; - BaseType_t higherWake = 0; }, CHANGE); #endif @@ -777,7 +775,7 @@ void Power::shutdown() if (screen) { #ifdef T_DECK_PRO screen->showSimpleBanner("Device is powered off.\nConnect USB to start!", 0); // T-Deck Pro has no power button -#elif USE_EINK +#elif defined(USE_EINK) screen->showSimpleBanner("Shutting Down...", 2250); // dismiss after 3 seconds to avoid the banner on the sleep screen #else screen->showSimpleBanner("Shutting Down...", 0); // stays on screen From 9bfef80e308b9010c54765cb2352dd88c3d35135 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 27 Nov 2025 06:01:03 -0600 Subject: [PATCH 2/8] Add requestFocus() in CannedMessages (#8770) Certain actions in CannedMessages can trigger the module losing the requestFocus bit, which puts the UI into a slightly frozen state. --- src/modules/CannedMessageModule.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index f435f6060..9cbacc877 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -836,6 +836,7 @@ bool CannedMessageModule::handleFreeTextInput(const InputEvent *event) if (event->inputEvent == INPUT_BROKER_BACK && this->freetext.length() > 0) { payload = 0x08; lastTouchMillis = millis(); + requestFocus(); runOnce(); return true; } @@ -844,6 +845,7 @@ bool CannedMessageModule::handleFreeTextInput(const InputEvent *event) if (event->inputEvent == INPUT_BROKER_LEFT) { payload = INPUT_BROKER_LEFT; lastTouchMillis = millis(); + requestFocus(); runOnce(); return true; } @@ -851,6 +853,7 @@ bool CannedMessageModule::handleFreeTextInput(const InputEvent *event) if (event->inputEvent == INPUT_BROKER_RIGHT) { payload = INPUT_BROKER_RIGHT; lastTouchMillis = millis(); + requestFocus(); runOnce(); return true; } From f7ae7aa2c13473d5971bb3f2a2a4992ae80ec190 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 06:11:14 -0600 Subject: [PATCH 3/8] Upgrade trunk (#8623) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 1fd8790f2..ccb426745 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -4,31 +4,31 @@ cli: plugins: sources: - id: trunk - ref: v1.7.3 + ref: v1.7.4 uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.492 - - renovate@42.5.4 + - checkov@3.2.495 + - renovate@42.24.1 - prettier@3.6.2 - - trufflehog@3.90.13 + - trufflehog@3.91.1 - yamllint@1.37.1 - - bandit@1.8.6 + - bandit@1.9.2 - trivy@0.67.2 - taplo@0.10.0 - - ruff@0.14.4 + - ruff@0.14.6 - isort@7.0.0 - - markdownlint@0.45.0 + - markdownlint@0.46.0 - oxipng@9.1.5 - svgo@4.0.0 - - actionlint@1.7.8 + - actionlint@1.7.9 - flake8@7.3.0 - hadolint@2.14.0 - shfmt@3.6.0 - shellcheck@0.11.0 - black@25.11.0 - git-diff-check - - gitleaks@8.29.0 + - gitleaks@8.30.0 - clang-format@16.0.3 ignore: - linters: [ALL] From a6d1ce2048fae6a2f98837a8893186ad6e8deb0b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 06:14:49 -0600 Subject: [PATCH 4/8] Update Sensirion Core to v0.7.2 (#8551) 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 d6ff155e4..9f7faeca5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -213,6 +213,6 @@ lib_deps = # 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=custom.pio depName=Sensirion Core packageName=sensirion/library/Sensirion Core - sensirion/Sensirion Core@0.7.1 + sensirion/Sensirion Core@0.7.2 # renovate: datasource=custom.pio depName=Sensirion I2C SCD4x packageName=sensirion/library/Sensirion I2C SCD4x sensirion/Sensirion I2C SCD4x@1.1.0 From d0c6ec28dbae79d8dd9c8ec78e97b61aeddfdc48 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 06:15:36 -0600 Subject: [PATCH 5/8] Update INA226 to v0.6.5 (#8645) 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 9f7faeca5..217ab0af8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -169,7 +169,7 @@ lib_deps = # 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 + robtillaart/INA226@0.6.5 # 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 # renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library From 7cb7a6cd3ee7705dcf9eb1ba881beb8fd5d2bc2f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 06:16:12 -0600 Subject: [PATCH 6/8] Update NonBlockingRTTTL to v1.4.0 (#8541) 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 217ab0af8..1363a63fc 100644 --- a/platformio.ini +++ b/platformio.ini @@ -90,7 +90,7 @@ framework = arduino lib_deps = ${env.lib_deps} # renovate: datasource=custom.pio depName=NonBlockingRTTTL packageName=end2endzone/library/NonBlockingRTTTL - end2endzone/NonBlockingRTTTL@1.3.0 + end2endzone/NonBlockingRTTTL@1.4.0 build_flags = ${env.build_flags} -Os build_src_filter = ${env.build_src_filter} - - From bc3ed4a7f34ea0f1b9a69eb081093e2aa45edbc4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 06:16:50 -0600 Subject: [PATCH 7/8] Update platformio/ststm32 to v19.4.0 (#8433) 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 7732533c9..1a9fd10ce 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.3.0 + platformio/ststm32@19.4.0 platform_packages = # TODO renovate platformio/framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32/archive/2.10.1.zip From 1523368c53f9f0a04c6813ba7c95ba1095aa41c1 Mon Sep 17 00:00:00 2001 From: Nasimovy Date: Thu, 27 Nov 2025 13:18:52 +0100 Subject: [PATCH 8/8] adding support for the ST7796 + creating a new variant of the T-beam (#6575) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove duplicate HAS_LP5562 introduced by #6422 * add ST7796 * changes to get display centered+lib update * seperated from tbeam * forgot the simple scan case * lowered speeds to 1/4 * added SPI Speed to constructor+ cleaned up variant.h * even slower speeds.... * add ST7796 * changes to get display centered+lib update * seperated from tbeam * forgot the simple scan case * lowered speeds to 1/4 * added SPI Speed to constructor+ cleaned up variant.h * even slower speeds.... * changed variant name to tbeam-displayshield * modified variant.h and merged ini file+testing on lower spi frequency for the lora module, display shield pumps out EMI? * try higher speeds + HSPI * cleanup of redundant code * refelct changes? * trunk fmt * testing touchscreen code * further testing * changed to sensorlib 0.3.1 * i broke it , dont know how to fix at the moment will investigate * add -1 functionality for touch IRQ * revert to working example? * it works.... is pressed was not working properly * working touchscreen but gestures not moving display * swap XY+ mirror X * cleanup + addition of defines for on screen keyboard and canned message module * removed debug lines, disabled bluetooth for now because of stack smashing protect failure * reverted the revert #6640 + increased speed, bleutooth is stable now on reconnection cold booth etc , GPS is still not working though * remove debug + add fixed baudrate for gps * fmt * revert NIMble * changed display library to meshtastic org * removed baudrate of 115200 and some commented out code * Correct spelling Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * display speed x10 * resolve conflicts * undo * revert speed increase CPU * add SCREEN_TRANSITION_FRAMERATE 5 * spi speed increase of the display * using the original touchscreen implementation * removal of H file line * add USE_ST7796 to missing places * removed is pressed + interrupt * revert changes of settings.json * update to screen.cpp * test identification of CST226 and CST328 * Update src/configuration.h typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * made changes to detection because it was completely wrong, CST226SE has 2 posible adresses * add merge queue * try vars * kerning in yaml. * update comment * lint etc * touching to check grandfathering * explicit ignores * add WIP for Unit C6L (#7433) * add WIP for Unit C6L * adapt to new config structure * Add c6l BLE and screen support (#7991) * Minor c6l fix * Move out of PRIVATE_HW --------- Co-authored-by: Austin Co-authored-by: Ben Meadors Co-authored-by: Jonathan Bennett Co-authored-by: Jason P Co-authored-by: Markus * Update Adafruit BusIO to v1.17.3 (#8018) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update actions/checkout action to v5 (#8020) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update actions/setup-python action to v6 (#8023) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Upgrade trunk (#8025) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> * Update actions/download-artifact action to v5 (#8021) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Fix init for InputEvent (#8015) * Automated version bumps (#8028) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Allow Left / Right Events for selection and improve encoder responsives (#8016) * Allow Left / Right Events for selection and improve encoder responsives * add define for ROTARY_DELAY * T-Lora Pager: Support LR1121 and SX1280 models (#7956) * T-Lora Pager: Support LR1121 and SX1280 models * Remove ifdefs * (resubmission) Manual GitHub actions to allow building one target or arch (#7997) * Reset the modified files * Fix some changes * Fix some changes * Trunk. That is all. --------- Co-authored-by: Tom <116762865+Nestpebble@users.noreply.github.com> * BaseUI Show/Hide Frame Functionality (#7382) * Rename System Frame (from Memory) in code base * Create menu options to Show/Hide frames: Node Lists, Bearings, Position, LoRa, Clock and Favorites frames * Move Region Picker into submenu * Tweak wording for Send Position vs Node Info if the device has GPS * Update actions/checkout action to v5 (#8031) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update actions/download-artifact action to v5 (#8032) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update actions/setup-python action to v6 (#8033) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Phone GPS display on Position Screen for BaseUI (#7875) * Phone GPS display on Position Screen This is a PR to show when a phone shares GPS location with the node so you can reliably know what coordinate is being shared with the Mesh. * Merge pull request #8004 from compumike/compumike/debug-heap-add-free-heap-debugging-to-all-log-lines When `DEBUG_HEAP` is defined, add free heap bytes to every log line in `RedirectablePrint::log_to_serial` * Feature: Seamless Cross-Preset Communication via UDP Multicast Bridging (#7753) * Added compatibility between nodes on different Presets through `Mesh via UDP` * Optimize multicast handling and channel mapping - FloodingRouter: remove redundant UDP-encrypted rebroadcast suppression. - Router: guard multicast fallback with HAS_UDP_MULTICAST and map fallback-decoded packets to the local default channel via isDefaultChannel() - UdpMulticastHandler: set transport_mechanism only after successful decode * trunk fmt * Move setting transport mechanism. --------- Co-authored-by: GUVWAF * Auto-favorite remote admin node * Merge pull request #7873 from compumike/compumike/client-base-role Add `CLIENT_BASE` role: `ROUTER` for favorites, `CLIENT` otherwise (for attic/roof nodes!) * Fixes * BaseUI Updates (#7787) * Account for low resolution wide screen OLEDs * Allow picking of Device Role and new Display Formatter for Device Role * Add remainder of client roles to display formatter * Don't update the role unless you pick a value * Mascots are fun * Fix warnings during compile time * Improve some menus * Mascots need to work everywhere * Update Chirpy image * Fix Trunk * Update protobufs * Add date to Clock screen * Analog clocks love dates too * Finalize date moves for analog clock * Added Last Coordinate counter to Position screen (#7865) Adding a counter to show the last time a GPS coordinate was detected to ensure the user is aware how long since the coordinate updated or to identify any errors. * Fix * Portduino config refactor (#7796) * Start portduino_config refactor * refactor GPIOs to new portduino_config * More portduino_config work * More conversion to portduino_config * Finish portduino_config transition * trunk * yaml output work * Simplify the GPIO config * Trunk * updated shebang to use a more standard path for bash (#7922) Signed-off-by: Trenton VanderWert * Show GPS Date properly in drawCommonHeader (#7887) * Commit good code that is sustainable * Fix new build errors * BaseUI Updates (#7787) * Account for low resolution wide screen OLEDs * Allow picking of Device Role and new Display Formatter for Device Role * Add remainder of client roles to display formatter * Don't update the role unless you pick a value * Mascots are fun * Fix warnings during compile time * Improve some menus * Mascots need to work everywhere * Update Chirpy image * Fix Trunk * Update protobufs * Add date to Clock screen * Analog clocks love dates too * Finalize date moves for analog clock * Add formatting and menu picking for other GPS format options (#7974) * Add back options for other GPS format options * Rename variables and don't overlap elements * Fix default value * Should probably add a menu while I'm here! * Shorten names just a bit to fit on screens * Fix off by one * Labels try to make things better * Missed a label * Update protobufs (#8038) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Add formatting and menu picking for other GPS format options (#7974) * Add back options for other GPS format options * Rename variables and don't overlap elements * Fix default value * Should probably add a menu while I'm here! * Shorten names just a bit to fit on screens * Fix off by one * Labels try to make things better * Missed a label * Add a new GPS model CM121. (#7852) * Add a new GPS model CM121. * Add CM121 to Unicore. * Trunk fixes, remove unneded NMEA lines --------- Co-authored-by: Tom Fifield * (resubmission) Manual GitHub actions to allow building one target or arch (#7997) * Reset the modified files * Fix some changes * Fix some changes * Trunk. That is all. --------- Co-authored-by: Tom <116762865+Nestpebble@users.noreply.github.com> * PPA: Enable Ubuntu 25.10 (questing) (#7940) * Update Protobuf usage, add MLS, fix clock (#8041) * Update protobufs (#8045) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Fix icon * C6l fixes (#8047) * fix build with HAS_TELEMETRY 0 (#8051) * Make sure to ACK ACKs/replies if next-hop routing is used (#8052) * Make sure to ACK ACKs/replies if next-hop routing is used To stop their retransmissions; hop limit of 0 is enough * Update src/mesh/ReliableRouter.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> * move HTTP contentTypes to Flash - saves 768 Bytes of RAM (#8055) * Use `lora.use_preset` config to get name (#8057) * Update RadioLib to v7.3.0 (#8065) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Fix Rotary Encoder Button (#8001) this fixes the Rotary Encoder Button, currenlty its not working at all. Currently the action `ROTARY_ACTION_PRESSED` is only triggerd with a IRQ on RISING, which results in nothing since the function detects the "not longer" pressed button --> no action. the `ROTARY_ACTION_PRESSED` implementation needs to be called on both edges (on press and release of the button) changing the interupt setting to `CHANGE` fixes the problem. * Add another seeed_xiao_nrf52840_kit build environment for I2C pinout (#8036) * Update platformio.ini * Remove some more extraneous lines * Add heltec_v4 board. (#7845) * add heltec_v4 board. * Update variants/esp32s3/heltec_v4/platformio.ini Co-authored-by: Austin * Limit the maximum output power. * Trunk fixes Fixes formatting to match meshtastic trunk linter. * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Ben Meadors Co-authored-by: Austin Co-authored-by: Tom Fifield Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Upgrade trunk (#8078) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> * portduino bump to fix gpiod bug (#8083) An earlier portduino causes problems with initializing gpiod lines. This pulls in the fix. * Handle ext. notification module things even if not enabled (#8089) * tlora-pager wake on button, and kb backlight toggling (#8090) * Try-fix: Unstick that PhoneAPI state (#8091) Co-authored-by: Jonathan Bennett * Also pull a deviceID from esp32c6 devices (#8092) * Remove line from BLE pin screen, to make pin readible on tiny screens * Fix build errors (#8067) * Heltec V4 is 16mb * Clear lasttoradio on BLE disconnect (#8095) * On disconnect, clear the lastToRadio buffer * Move it, bucko! * Revert "Fix build errors (#8067)" This reverts commit d998f70b5633e8b2f88823cfb73761625bbc3423. * Automated version bumps (#8100) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Upgrade trunk (#8094) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> * Update Adafruit BusIO to v1.17.4 (#8098) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Add three expansion screens for heltec mesh solar. (#7995) * Add three expansion screens for heltec mesh solar. * delete whitespace Update variants/nrf52840/heltec_mesh_solar/variant.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * delete whitespace Update variants/nrf52840/heltec_mesh_solar/platformio.ini Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ben Meadors * Trunk --------- Signed-off-by: Trenton VanderWert Co-authored-by: Thomas Göttgens Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ben Meadors Co-authored-by: Dane Evans Co-authored-by: Austin Co-authored-by: Jonathan Bennett Co-authored-by: Jason P Co-authored-by: Markus Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> Co-authored-by: Markus <974709+Links2004@users.noreply.github.com> Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> Co-authored-by: WillyJL Co-authored-by: Tom <116762865+NomDeTom@users.noreply.github.com> Co-authored-by: Tom <116762865+Nestpebble@users.noreply.github.com> Co-authored-by: Jason P Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> Co-authored-by: Michael Co-authored-by: GUVWAF Co-authored-by: Trent V. Co-authored-by: Quency-D <55523105+Quency-D@users.noreply.github.com> Co-authored-by: Tom Fifield Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com> --- src/configuration.h | 3 +- src/detect/ScanI2C.h | 3 +- src/detect/ScanI2CTwoWire.cpp | 21 +++++++-- src/graphics/Screen.cpp | 45 ++++++++++++++++++- src/graphics/Screen.h | 2 + src/graphics/ScreenFonts.h | 2 +- src/graphics/draw/DebugRenderer.cpp | 8 ++-- src/graphics/draw/UIRenderer.cpp | 2 +- src/graphics/images.h | 3 +- src/main.cpp | 4 +- src/mesh/NodeDB.cpp | 2 +- .../tbeam_displayshield/variant.cpp | 43 ++++++++++++++++++ variants/esp32/tbeam/platformio.ini | 18 ++++++-- variants/esp32/tbeam/variant.h | 33 +++++++++++++- 14 files changed, 167 insertions(+), 22 deletions(-) create mode 100644 src/platform/extra_variants/tbeam_displayshield/variant.cpp diff --git a/src/configuration.h b/src/configuration.h index d37269995..d30280d8b 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -250,8 +250,9 @@ along with this program. If not, see . // Touchscreen // ----------------------------------------------------------------------------- #define FT6336U_ADDR 0x48 -#define CST328_ADDR 0x1A +#define CST328_ADDR 0x1A // same address as CST226SE #define CHSC6X_ADDR 0x2E +#define CST226SE_ADDR_ALT 0x5A // ----------------------------------------------------------------------------- // RAK12035VB Soil Monitor (using RAK12023 up to 3 RAK12035 monitors can be connected) diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index 55980face..cced980a6 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -85,7 +85,8 @@ class ScanI2C DRV2605, BH1750, DA217, - CHSC6X + CHSC6X, + CST226SE } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index bcf49286e..db269ac64 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -499,7 +499,18 @@ 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(CST328_ADDR, CST328, "CST328", (uint8_t)addr.address); + case CST328_ADDR: + // Do we have the CST328 or the CST226SE + registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xAB), 1); + if (registerValue == 0xA9) { + type = CST226SE; + logFoundDevice("CST226SE", (uint8_t)addr.address); + } else { + type = CST328; + logFoundDevice("CST328", (uint8_t)addr.address); + } + break; + SCAN_SIMPLE_CASE(CHSC6X_ADDR, CHSC6X, "CHSC6X", (uint8_t)addr.address); case LTR553ALS_ADDR: registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x86), 1); // Part ID register @@ -528,8 +539,12 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) #endif case MLX90614_ADDR_DEF: - registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0e), 1); - if (registerValue == 0x5a) { + // Do we have the MLX90614 or the MPR121KB or the CST226SE + registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x06), 1); + if (registerValue == 0xAB) { + type = CST226SE; + logFoundDevice("CST226SE", (uint8_t)addr.address); + } else if (getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0e), 1) == 0x5a) { type = MLX90614; logFoundDevice("MLX90614", (uint8_t)addr.address); } else { diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index dc9806156..e8c2e4b88 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -324,7 +324,7 @@ static int8_t prevFrame = -1; // 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) +#if defined(ESP_PLATFORM) && (defined(USE_ST7789) || defined(USE_ST7796)) SPIClass SPI1(HSPI); #endif @@ -356,7 +356,18 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O #else dispdev = new ST7789Spi(&SPI1, ST7789_RESET, ST7789_RS, ST7789_NSS, GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT); #endif +#elif defined(USE_ST7796) +#ifdef ESP_PLATFORM + dispdev = new ST7796Spi(&SPI1, ST7796_RESET, ST7796_RS, ST7796_NSS, GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT, ST7796_SDA, + ST7796_MISO, ST7796_SCK, TFT_SPI_FREQUENCY); +#else + dispdev = new ST7796Spi(&SPI1, ST7796_RESET, ST7796_RS, ST7796_NSS, GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT); +#endif +#if defined(USE_ST7789) static_cast(dispdev)->setRGB(TFT_MESH); +#elif defined(USE_ST7796) + static_cast(dispdev)->setRGB(TFT_MESH); +#endif #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); @@ -474,6 +485,15 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) pinMode(VTFT_LEDA, OUTPUT); digitalWrite(VTFT_LEDA, TFT_BACKLIGHT_ON); #endif +#endif +#ifdef USE_ST7796 + ui->init(); +#ifdef ESP_PLATFORM + analogWrite(VTFT_LEDA, BRIGHTNESS_DEFAULT); +#else + pinMode(VTFT_LEDA, OUTPUT); + digitalWrite(VTFT_LEDA, TFT_BACKLIGHT_ON); +#endif #endif enabled = true; setInterval(0); // Draw ASAP @@ -512,6 +532,21 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) nrf_gpio_cfg_default(ST7789_NSS); #endif #endif +#ifdef USE_ST7796 + SPI1.end(); +#if defined(ARCH_ESP32) + pinMode(VTFT_LEDA, OUTPUT); + digitalWrite(VTFT_LEDA, LOW); + pinMode(ST7796_RESET, ANALOG); + pinMode(ST7796_RS, ANALOG); + pinMode(ST7796_NSS, ANALOG); +#else + nrf_gpio_cfg_default(VTFT_LEDA); + nrf_gpio_cfg_default(ST7796_RESET); + nrf_gpio_cfg_default(ST7796_RS); + nrf_gpio_cfg_default(ST7796_NSS); +#endif +#endif #ifdef T_WATCH_S3 PMU->disablePowerOutput(XPOWERS_ALDO2); @@ -557,6 +592,10 @@ void Screen::setup() #if defined(MUZI_BASE) dispdev->delayPoweron = true; #endif +#if defined(USE_ST7796) && defined(TFT_MESH) + // Custom text color, if defined in variant.h + static_cast(dispdev)->setRGB(TFT_MESH); +#endif // === Initialize display and UI system === ui->init(); @@ -620,6 +659,8 @@ void Screen::setup() static_cast(dispdev)->flipScreenVertically(); #elif defined(USE_ST7789) static_cast(dispdev)->flipScreenVertically(); +#elif defined(USE_ST7796) + static_cast(dispdev)->mirrorScreen(); #elif !defined(M5STACK_UNITC6L) dispdev->flipScreenVertically(); #endif @@ -652,7 +693,7 @@ void Screen::setup() touchScreenImpl1->init(); } } -#elif HAS_TOUCHSCREEN && !defined(USE_EINK) +#elif HAS_TOUCHSCREEN && !defined(USE_EINK) && !HAS_CST226SE touchScreenImpl1 = new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast(dispdev)->getTouch); touchScreenImpl1->init(); diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index 375bc2805..a40579ff5 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -83,6 +83,8 @@ class Screen #include #elif defined(USE_SPISSD1306) #include +#elif defined(USE_ST7796) +#include #else // the SH1106/SSD1306 variant is auto-detected #include diff --git a/src/graphics/ScreenFonts.h b/src/graphics/ScreenFonts.h index c497a27b2..bcb4c4987 100644 --- a/src/graphics/ScreenFonts.h +++ b/src/graphics/ScreenFonts.h @@ -73,7 +73,7 @@ #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(ST7796_CS)) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST7796_CS) || defined(USE_ST7796)) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) // The screen is bigger so use bigger fonts #define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19 diff --git a/src/graphics/draw/DebugRenderer.cpp b/src/graphics/draw/DebugRenderer.cpp index 79c1e7e61..6bccb1653 100644 --- a/src/graphics/draw/DebugRenderer.cpp +++ b/src/graphics/draw/DebugRenderer.cpp @@ -97,7 +97,8 @@ void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16 (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) || defined(ST7796_CS) || \ - ARCH_PORTDUINO) && \ + defined(USE_ST7796) || \ + 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); @@ -109,7 +110,7 @@ void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, 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(ILI9488_CS) || defined(HX8357_CS) || defined(ST7796_CS)) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || defined(ST7796_CS) || defined(USE_ST7796)) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(screen->ourId), y + 3 + FONT_HEIGHT_SMALL, 16, 8, imgSFL1); @@ -125,7 +126,8 @@ void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16 // 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) || defined(ST7796_CS) || \ - ARCH_PORTDUINO) && \ + defined(USE_ST7796) || \ + 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); diff --git a/src/graphics/draw/UIRenderer.cpp b/src/graphics/draw/UIRenderer.cpp index c50fe5cf1..3d23acc9f 100644 --- a/src/graphics/draw/UIRenderer.cpp +++ b/src/graphics/draw/UIRenderer.cpp @@ -257,7 +257,7 @@ void UIRenderer::drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const mes } #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(ST7796_CS)) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || defined(ST7796_CS) || defined(USE_ST7796)) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) if (isHighResolution) { diff --git a/src/graphics/images.h b/src/graphics/images.h index 8670d78d9..998fe8e2a 100644 --- a/src/graphics/images.h +++ b/src/graphics/images.h @@ -27,8 +27,7 @@ const uint8_t bluetoothConnectedIcon[36] PROGMEM = {0xfe, 0x01, 0xff, 0x03, 0x03 0xfe, 0x31, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0x3f, 0xe0, 0x1f}; #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(ST7796_CS) || \ - ARCH_PORTDUINO) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(USE_ST7796) || defined(ST7796_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 8fc2c097b..da2e39604 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -877,7 +877,7 @@ void setup() 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) || defined(ST7796_CS) || \ + defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(ST7796_CS) || defined(USE_ST7796) || \ defined(USE_SPISSD1306) screen = new graphics::Screen(screen_found, screen_model, screen_geometry); #elif defined(ARCH_PORTDUINO) @@ -1154,7 +1154,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(ILI9488_CS) || defined(ST7796_CS) || \ + defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(ST7796_CS) || defined(USE_ST7796) || \ defined(USE_SPISSD1306) if (screen) screen->setup(); diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index ff76baaa1..4e99a22ef 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -664,7 +664,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(ILI9488_CS) || defined(ST7796_CS) || defined(USE_SPISSD1306) + defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(ST7796_CS) || defined(USE_SPISSD1306) || defined(USE_ST7796) 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); diff --git a/src/platform/extra_variants/tbeam_displayshield/variant.cpp b/src/platform/extra_variants/tbeam_displayshield/variant.cpp new file mode 100644 index 000000000..7beac2293 --- /dev/null +++ b/src/platform/extra_variants/tbeam_displayshield/variant.cpp @@ -0,0 +1,43 @@ +#include "configuration.h" + +#ifdef HAS_CST226SE + +#include "TouchDrvCSTXXX.hpp" +#include "input/TouchScreenImpl1.h" +#include + +TouchDrvCSTXXX tsPanel; +static constexpr uint8_t PossibleAddresses[2] = {CST328_ADDR, CST226SE_ADDR_ALT}; +uint8_t i2cAddress = 0; + +bool readTouch(int16_t *x, int16_t *y) +{ + int16_t x_array[1], y_array[1]; + uint8_t touched = tsPanel.getPoint(x_array, y_array, 1); + if (touched > 0) { + *y = x_array[0]; + *x = (TFT_WIDTH - y_array[0]); + // Check bounds + if (*x < 0 || *x >= TFT_WIDTH || *y < 0 || *y >= TFT_HEIGHT) { + return false; + } + return true; // Valid touch detected + } + return false; // No valid touch data +} + +void lateInitVariant() +{ + tsPanel.setTouchDrvModel(TouchDrv_CST226); + for (uint8_t addr : PossibleAddresses) { + if (tsPanel.begin(Wire, addr, I2C_SDA, I2C_SCL)) { + i2cAddress = addr; + LOG_DEBUG("CST226SE init OK at address 0x%02X", addr); + touchScreenImpl1 = new TouchScreenImpl1(TFT_WIDTH, TFT_HEIGHT, readTouch); + touchScreenImpl1->init(); + return; + } + } + LOG_ERROR("CST226SE init failed at all known addresses"); +} +#endif diff --git a/variants/esp32/tbeam/platformio.ini b/variants/esp32/tbeam/platformio.ini index e53f22d30..c635081ff 100644 --- a/variants/esp32/tbeam/platformio.ini +++ b/variants/esp32/tbeam/platformio.ini @@ -4,12 +4,22 @@ extends = esp32_base board = ttgo-t-beam board_level = pr board_check = true -lib_deps = - ${esp32_base.lib_deps} -build_flags = - ${esp32_base.build_flags} +lib_deps = ${esp32_base.lib_deps} +build_flags = ${esp32_base.build_flags} -D TBEAM_V10 -I variants/esp32/tbeam -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue upload_speed = 921600 + +[env:tbeam-displayshield] +extends = env:tbeam + +build_flags = + ${env:tbeam.build_flags} + -D USE_ST7796 + +lib_deps = + ${env:tbeam.lib_deps} + https://github.com/meshtastic/st7796/archive/refs/tags/1.0.5.zip ; display addon + lewisxhe/SensorLib@0.3.1 ; touchscreen addon \ No newline at end of file diff --git a/variants/esp32/tbeam/variant.h b/variants/esp32/tbeam/variant.h index 5b521a2de..2d144a888 100644 --- a/variants/esp32/tbeam/variant.h +++ b/variants/esp32/tbeam/variant.h @@ -42,4 +42,35 @@ #define GPS_UBLOX #define GPS_RX_PIN 34 #define GPS_TX_PIN 12 -// #define GPS_DEBUG \ No newline at end of file +// #define GPS_DEBUG + +// Used when the display shield is chosen +#ifdef USE_ST7796 + +#undef EXT_NOTIFY_OUT +#undef LED_STATE_ON +#undef LED_PIN + +#define HAS_CST226SE 1 +#define HAS_TOUCHSCREEN 1 +// #define TOUCH_IRQ 35 // broken in this version of the lib 0.3.1 +#ifndef TOUCH_IRQ +#define TOUCH_IRQ -1 +#endif +#define CANNED_MESSAGE_MODULE_ENABLE 1 +#define USE_VIRTUAL_KEYBOARD 1 + +#define ST7796_NSS 25 +#define ST7796_RS 13 // DC +#define ST7796_SDA 14 // MOSI +#define ST7796_SCK 15 +#define ST7796_RESET 2 +#define ST7796_MISO -1 +#define ST7796_BUSY -1 +#define VTFT_LEDA 4 +#define TFT_SPI_FREQUENCY 60000000 +#define TFT_HEIGHT 222 +#define TFT_WIDTH 480 +#define BRIGHTNESS_DEFAULT 100 // Medium Low Brightness +#define SCREEN_TRANSITION_FRAMERATE 5 // fps +#endif \ No newline at end of file