Portduino config refactor (#7796)

* Start portduino_config refactor

* refactor GPIOs to new portduino_config

* More portduino_config work

* More conversion to portduino_config

* Finish portduino_config transition

* trunk

* yaml output work

* Simplify the GPIO config

* Trunk
This commit is contained in:
Jonathan Bennett
2025-09-03 17:50:26 -05:00
committed by Ben Meadors
parent 6a92358b68
commit cc579dd0bd
25 changed files with 855 additions and 646 deletions

View File

@@ -9,11 +9,11 @@
int32_t HostMetricsModule::runOnce()
{
#if ARCH_PORTDUINO
if (settingsMap[hostMetrics_interval] == 0) {
if (portduino_config.hostMetrics_interval == 0) {
return disable();
} else {
sendMetrics();
return 60 * 1000 * settingsMap[hostMetrics_interval];
return 60 * 1000 * portduino_config.hostMetrics_interval;
}
#else
return disable();
@@ -110,8 +110,8 @@ meshtastic_Telemetry HostMetricsModule::getHostMetrics()
proc_loadavg.close();
}
}
if (settingsStrings[hostMetrics_user_command] != "") {
std::string userCommandResult = exec(settingsStrings[hostMetrics_user_command].c_str());
if (portduino_config.hostMetrics_user_command != "") {
std::string userCommandResult = exec(portduino_config.hostMetrics_user_command.c_str());
if (userCommandResult.length() > 1) {
strncpy(t.variant.host_metrics.user_string, userCommandResult.c_str(), sizeof(t.variant.host_metrics.user_string));
t.variant.host_metrics.user_string[sizeof(t.variant.host_metrics.user_string) - 1] = '\0';
@@ -135,7 +135,7 @@ bool HostMetricsModule::sendMetrics()
p->to = NODENUM_BROADCAST;
p->decoded.want_response = false;
p->priority = meshtastic_MeshPacket_Priority_BACKGROUND;
p->channel = settingsMap[hostMetrics_channel];
p->channel = portduino_config.hostMetrics_channel;
LOG_INFO("Send packet to mesh");
service->sendToMesh(p, RX_SRC_LOCAL, true);
return true;