Portduino fixes (#5479)

* Set config.yaml defaults even if General is missing

* Unsigned values should get %u in logging
This commit is contained in:
Jonathan Bennett authored and GitHub committed 2024-11-30 11:29:45 +08:00
1 parent fe8e0713cc
commit 43b8972171
2 files changed
+5 -7

No files matched your search

+3 -5
View File
@@ -400,11 +400,9 @@ bool loadConfig(const char *configPath)
settingsStrings[webserverrootpath] = (yamlConfig["Webserver"]["RootPath"]).as<std::string>("");
}
if (yamlConfig["General"]) {
settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as<int>(200);
settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as<int>(100);
settingsStrings[config_directory] = (yamlConfig["General"]["ConfigDirectory"]).as<std::string>("");
}
settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as<int>(200);
settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as<int>(100);
settingsStrings[config_directory] = (yamlConfig["General"]["ConfigDirectory"]).as<std::string>("");
} catch (YAML::Exception &e) {
std::cout << "*** Exception " << e.what() << std::endl;