kopia lustrzana https://github.com/meshtastic/firmware
don't grow nodedb if memory is tight.
also remove unconditional reboot on low heap. This is counter productive with this changepull/2298/head
rodzic
a284439d7e
commit
5d41e9fe9d
|
@ -142,15 +142,6 @@ static int32_t ledBlinker()
|
|||
|
||||
setLed(ledOn);
|
||||
|
||||
auto newHeap = memGet.getFreeHeap();
|
||||
if (newHeap < 10000) {
|
||||
LOG_DEBUG("\n\n====== heap too low [10000] -> reboot in 1s ======\n\n");
|
||||
#ifdef HAS_SCREEN
|
||||
screen->startRebootScreen();
|
||||
#endif
|
||||
rebootAtMsec = millis() + 900;
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
|
|
@ -767,7 +767,7 @@ meshtastic_NodeInfo *NodeDB::getOrCreateNode(NodeNum n)
|
|||
meshtastic_NodeInfo *info = getNode(n);
|
||||
|
||||
if (!info) {
|
||||
if (*numNodes >= MAX_NUM_NODES) {
|
||||
if ((*numNodes >= MAX_NUM_NODES) || (memGet.getFreeHeap() < meshtastic_NodeInfo_size * 3)) {
|
||||
screen->print("warning: node_db full! erasing oldest entry\n");
|
||||
// look for oldest node and erase it
|
||||
uint32_t oldest = UINT32_MAX;
|
||||
|
|
Ładowanie…
Reference in New Issue