Skip to content

Commit 43b8972

Browse files
authored
Portduino fixes (#5479)
* Set config.yaml defaults even if General is missing * Unsigned values should get %u in logging
1 parent fe8e071 commit 43b8972

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/mesh/NodeDB.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n)
13491349

13501350
if (!lite) {
13511351
if (isFull()) {
1352-
LOG_INFO("Node database full with %i nodes and %i bytes free. Erasing oldest entry", numMeshNodes,
1352+
LOG_INFO("Node database full with %i nodes and %u bytes free. Erasing oldest entry", numMeshNodes,
13531353
memGet.getFreeHeap());
13541354
// look for oldest node and erase it
13551355
uint32_t oldest = UINT32_MAX;
@@ -1385,7 +1385,7 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n)
13851385
// everything is missing except the nodenum
13861386
memset(lite, 0, sizeof(*lite));
13871387
lite->num = n;
1388-
LOG_INFO("Adding node to database with %i nodes and %i bytes free!", numMeshNodes, memGet.getFreeHeap());
1388+
LOG_INFO("Adding node to database with %i nodes and %u bytes free!", numMeshNodes, memGet.getFreeHeap());
13891389
}
13901390

13911391
return lite;

src/platform/portduino/PortduinoGlue.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,9 @@ bool loadConfig(const char *configPath)
400400
settingsStrings[webserverrootpath] = (yamlConfig["Webserver"]["RootPath"]).as<std::string>("");
401401
}
402402

403-
if (yamlConfig["General"]) {
404-
settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as<int>(200);
405-
settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as<int>(100);
406-
settingsStrings[config_directory] = (yamlConfig["General"]["ConfigDirectory"]).as<std::string>("");
407-
}
403+
settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as<int>(200);
404+
settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as<int>(100);
405+
settingsStrings[config_directory] = (yamlConfig["General"]["ConfigDirectory"]).as<std::string>("");
408406

409407
} catch (YAML::Exception &e) {
410408
std::cout << "*** Exception " << e.what() << std::endl;

0 commit comments

Comments
 (0)