https://github.com/meshcore-dev/MeshCore/issues/989 - persist GPS enabled state to preferences
Add GPS configuration to NodePrefs structure and persist the GPS enabled state when toggled via UI. This ensures GPS settings are retained across device restarts.
This commit is contained in:
@@ -863,13 +863,16 @@ void UITask::toggleGPS() {
|
||||
if (strcmp(_sensors->getSettingName(i), "gps") == 0) {
|
||||
if (strcmp(_sensors->getSettingValue(i), "1") == 0) {
|
||||
_sensors->setSettingValue("gps", "0");
|
||||
_node_prefs->gps_enabled = 0;
|
||||
notify(UIEventType::ack);
|
||||
showAlert("GPS: Disabled", 800);
|
||||
} else {
|
||||
_sensors->setSettingValue("gps", "1");
|
||||
_node_prefs->gps_enabled = 1;
|
||||
notify(UIEventType::ack);
|
||||
showAlert("GPS: Enabled", 800);
|
||||
}
|
||||
the_mesh.savePrefs();
|
||||
_next_refresh = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user