From 799cf0e8b3fbb90d87f2c7f7c13303a2f38fff95 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Fri, 24 Oct 2025 10:37:38 +1100 Subject: [PATCH] Master --> develop (#8436) * Issue: #7944 External notification module: Adjusted default nag timeout to 15s (from 60s) (#7946) * External notification module: Adjusted default nag timeout to 5s (from 60s) * Change nag to 15s --------- Co-authored-by: Tom Fifield * Add support for RAK WISMESH TAP V2 by enabling SDCARD_CS pin during deep sleep (#8429) * Upgrade trunk (#8369) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> * Don't assign negative SNR to unsigned int type SNR-based contention windows are broken on systems with 64-bit long integers. Fixes #8430 * Allow vibra or buzzer only notifications to obey cutoff (#8342) * Allow vibra or buzzer only notifications to obey cutoff * Update src/modules/ExternalNotificationModule.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> * InkHUD crash fix when nodes get deleted from NodeDB (#8428) * InkHUD crash fix * trunk fix --------- Co-authored-by: Ben Meadors Co-authored-by: Onyx Clawe <58921814+OnyxClawe@users.noreply.github.com> Co-authored-by: Daniel.Cao <144674500+DanielCao0@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: korbinianbauer <64415847+korbinianbauer@users.noreply.github.com> Co-authored-by: Jason P Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> --- .trunk/trunk.yaml | 8 ++++---- .../InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp | 12 +++++++++++- src/mesh/Default.h | 4 ++-- src/mesh/RadioInterface.cpp | 4 ++-- src/modules/ExternalNotificationModule.cpp | 5 ++--- src/sleep.cpp | 4 ++++ 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 5bec39ae2..0a43c3079 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.483 - - renovate@41.148.2 + - checkov@3.2.486 + - renovate@41.157.0 - prettier@3.6.2 - - trufflehog@3.90.8 + - trufflehog@3.90.11 - yamllint@1.37.1 - bandit@1.8.6 - trivy@0.67.2 - taplo@0.10.0 - - ruff@0.14.0 + - ruff@0.14.1 - isort@7.0.0 - markdownlint@0.45.0 - oxipng@9.1.5 diff --git a/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp b/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp index 1b0bfa9d0..5c9906fba 100644 --- a/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp @@ -127,6 +127,11 @@ void InkHUD::NodeListApplet::onRender() // Y value (top) of the current card. Increases as we draw. uint16_t cardTopY = headerDivY + padDivH; + // Clean up deleted nodes before drawing + cards.erase( + std::remove_if(cards.begin(), cards.end(), [](const CardInfo &c) { return nodeDB->getMeshNode(c.nodeNum) == nullptr; }), + cards.end()); + // -- Each node in list -- for (auto card = cards.begin(); card != cards.end(); ++card) { @@ -141,6 +146,11 @@ void InkHUD::NodeListApplet::onRender() meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeNum); + // Skip deleted nodes + if (!node) { + continue; + } + // -- Shortname -- // Parse special chars in the short name // Use "?" if unknown @@ -188,7 +198,7 @@ void InkHUD::NodeListApplet::onRender() drawSignalIndicator(signalX, signalY, signalW, signalH, signal); } // Otherwise, print "hops away" info, if available - else if (hopsAway != CardInfo::HOPS_UNKNOWN) { + else if (hopsAway != CardInfo::HOPS_UNKNOWN && node) { std::string hopString = to_string(node->hops_away); hopString += " Hop"; if (node->hops_away != 1) diff --git a/src/mesh/Default.h b/src/mesh/Default.h index 2f05da98d..d0d4678ff 100644 --- a/src/mesh/Default.h +++ b/src/mesh/Default.h @@ -27,7 +27,7 @@ #ifdef USERPREFS_RINGTONE_NAG_SECS #define default_ringtone_nag_secs USERPREFS_RINGTONE_NAG_SECS #else -#define default_ringtone_nag_secs 60 +#define default_ringtone_nag_secs 15 #endif #define default_mqtt_address "mqtt.meshtastic.org" @@ -84,4 +84,4 @@ class Default return 1.0 + (nodesOverForty * throttlingFactor); // Each number of online node scales by 0.075 (default) } } -}; \ No newline at end of file +}; diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 31ec5acc5..3c0da4494 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -272,10 +272,10 @@ uint32_t RadioInterface::getTxDelayMsec() uint8_t RadioInterface::getCWsize(float snr) { // The minimum value for a LoRa SNR - const uint32_t SNR_MIN = -20; + const int32_t SNR_MIN = -20; // The maximum value for a LoRa SNR - const uint32_t SNR_MAX = 10; + const int32_t SNR_MAX = 10; return map(snr, SNR_MIN, SNR_MAX, CWmin, CWmax); } diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index ffc789275..2b1730e9c 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -94,8 +94,8 @@ int32_t ExternalNotificationModule::runOnce() // audioThread->isPlaying() also handles actually playing the RTTTL, needs to be called in loop isRtttlPlaying = isRtttlPlaying || audioThread->isPlaying(); #endif - if ((nagCycleCutoff < millis()) && !isRtttlPlaying) { - // let the song finish if we reach timeout + if ((nagCycleCutoff <= millis())) { + // Turn off external notification immediately when timeout is reached, regardless of song state nagCycleCutoff = UINT32_MAX; LOG_INFO("Turning off external notification: "); for (int i = 0; i < 3; i++) { @@ -103,7 +103,6 @@ int32_t ExternalNotificationModule::runOnce() externalTurnedOn[i] = 0; LOG_INFO("%d ", i); } - LOG_INFO(""); #ifdef HAS_I2S // GPIO0 is used as mclk for I2S audio and set to OUTPUT by the sound library // T-Deck uses GPIO0 as trackball button, so restore the mode diff --git a/src/sleep.cpp b/src/sleep.cpp index c6efb0efd..756582c74 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -244,6 +244,10 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false, bool skipSaveN // pinMode(PIN_POWER_EN1, INPUT_PULLDOWN); #endif +#ifdef RAK_WISMESH_TAP_V2 + digitalWrite(SDCARD_CS, LOW); +#endif + #ifdef TRACKER_T1000_E #ifdef GNSS_AIROHA digitalWrite(GPS_VRTC_EN, LOW);