Skip to content

Commit 799cf0e

Browse files
fifieldtthebenternOnyxClaweDanielCao0github-actions[bot]
authored
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 <[email protected]> * Add support for RAK WISMESH TAP V2 by enabling SDCARD_CS pin during deep sleep (#8429) * Upgrade trunk (#8369) Co-authored-by: vidplace7 <[email protected]> * 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 <[email protected]> --------- Co-authored-by: Ben Meadors <[email protected]> Co-authored-by: Copilot <[email protected]> * InkHUD crash fix when nodes get deleted from NodeDB (#8428) * InkHUD crash fix * trunk fix --------- Co-authored-by: Ben Meadors <[email protected]> Co-authored-by: Onyx Clawe <[email protected]> Co-authored-by: Daniel.Cao <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: vidplace7 <[email protected]> Co-authored-by: korbinianbauer <[email protected]> Co-authored-by: Jason P <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: HarukiToreda <[email protected]>
1 parent 07d354f commit 799cf0e

File tree

6 files changed

+25
-12
lines changed

6 files changed

+25
-12
lines changed

.trunk/trunk.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ plugins:
88
uri: https://github.com/trunk-io/plugins
99
lint:
1010
enabled:
11-
12-
- renovate@41.148.2
11+
12+
- renovate@41.157.0
1313
14-
14+
1515
1616
1717
1818
19-
19+
2020
2121
2222

src/graphics/niche/InkHUD/Applets/Bases/NodeList/NodeListApplet.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ void InkHUD::NodeListApplet::onRender()
127127
// Y value (top) of the current card. Increases as we draw.
128128
uint16_t cardTopY = headerDivY + padDivH;
129129

130+
// Clean up deleted nodes before drawing
131+
cards.erase(
132+
std::remove_if(cards.begin(), cards.end(), [](const CardInfo &c) { return nodeDB->getMeshNode(c.nodeNum) == nullptr; }),
133+
cards.end());
134+
130135
// -- Each node in list --
131136
for (auto card = cards.begin(); card != cards.end(); ++card) {
132137

@@ -141,6 +146,11 @@ void InkHUD::NodeListApplet::onRender()
141146

142147
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeNum);
143148

149+
// Skip deleted nodes
150+
if (!node) {
151+
continue;
152+
}
153+
144154
// -- Shortname --
145155
// Parse special chars in the short name
146156
// Use "?" if unknown
@@ -188,7 +198,7 @@ void InkHUD::NodeListApplet::onRender()
188198
drawSignalIndicator(signalX, signalY, signalW, signalH, signal);
189199
}
190200
// Otherwise, print "hops away" info, if available
191-
else if (hopsAway != CardInfo::HOPS_UNKNOWN) {
201+
else if (hopsAway != CardInfo::HOPS_UNKNOWN && node) {
192202
std::string hopString = to_string(node->hops_away);
193203
hopString += " Hop";
194204
if (node->hops_away != 1)

src/mesh/Default.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#ifdef USERPREFS_RINGTONE_NAG_SECS
2828
#define default_ringtone_nag_secs USERPREFS_RINGTONE_NAG_SECS
2929
#else
30-
#define default_ringtone_nag_secs 60
30+
#define default_ringtone_nag_secs 15
3131
#endif
3232

3333
#define default_mqtt_address "mqtt.meshtastic.org"
@@ -84,4 +84,4 @@ class Default
8484
return 1.0 + (nodesOverForty * throttlingFactor); // Each number of online node scales by 0.075 (default)
8585
}
8686
}
87-
};
87+
};

src/mesh/RadioInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,10 @@ uint32_t RadioInterface::getTxDelayMsec()
272272
uint8_t RadioInterface::getCWsize(float snr)
273273
{
274274
// The minimum value for a LoRa SNR
275-
const uint32_t SNR_MIN = -20;
275+
const int32_t SNR_MIN = -20;
276276

277277
// The maximum value for a LoRa SNR
278-
const uint32_t SNR_MAX = 10;
278+
const int32_t SNR_MAX = 10;
279279

280280
return map(snr, SNR_MIN, SNR_MAX, CWmin, CWmax);
281281
}

src/modules/ExternalNotificationModule.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,15 @@ int32_t ExternalNotificationModule::runOnce()
9494
// audioThread->isPlaying() also handles actually playing the RTTTL, needs to be called in loop
9595
isRtttlPlaying = isRtttlPlaying || audioThread->isPlaying();
9696
#endif
97-
if ((nagCycleCutoff < millis()) && !isRtttlPlaying) {
98-
// let the song finish if we reach timeout
97+
if ((nagCycleCutoff <= millis())) {
98+
// Turn off external notification immediately when timeout is reached, regardless of song state
9999
nagCycleCutoff = UINT32_MAX;
100100
LOG_INFO("Turning off external notification: ");
101101
for (int i = 0; i < 3; i++) {
102102
setExternalState(i, false);
103103
externalTurnedOn[i] = 0;
104104
LOG_INFO("%d ", i);
105105
}
106-
LOG_INFO("");
107106
#ifdef HAS_I2S
108107
// GPIO0 is used as mclk for I2S audio and set to OUTPUT by the sound library
109108
// T-Deck uses GPIO0 as trackball button, so restore the mode

src/sleep.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false, bool skipSaveN
244244
// pinMode(PIN_POWER_EN1, INPUT_PULLDOWN);
245245
#endif
246246

247+
#ifdef RAK_WISMESH_TAP_V2
248+
digitalWrite(SDCARD_CS, LOW);
249+
#endif
250+
247251
#ifdef TRACKER_T1000_E
248252
#ifdef GNSS_AIROHA
249253
digitalWrite(GPS_VRTC_EN, LOW);

0 commit comments

Comments
 (0)