gps: wipe FLASH config only once

This commit is contained in:
Alexander Lerach
2025-11-24 13:31:40 +01:00
parent 932abfd558
commit c4a459838e
+7 -1
View File
@@ -178,6 +178,7 @@ private:
char _port[20] {}; ///< device / serial port path
bool _healthy{false}; ///< flag to signal if the GPS is ok
bool _cfg_wiped{false}; ///< flag to signal if the config was already wiped
bool _mode_auto; ///< if true, auto-detect which GPS is attached
gps_driver_mode_t _mode; ///< current mode
@@ -939,7 +940,7 @@ GPS::run()
param_get(handle, &gps_cfg_wipe);
}
gpsConfig.cfg_wipe = static_cast<bool>(gps_cfg_wipe);
gpsConfig.cfg_wipe = static_cast<bool>(gps_cfg_wipe) && !_cfg_wiped;
if (_helper && _helper->configure(_baudrate, gpsConfig) == 0) {
@@ -1068,6 +1069,11 @@ GPS::run()
// PX4_WARN("module found: %s", mode_str);
_healthy = true;
}
/* Do not wipe the FLASH config multiple times. */
if (!_cfg_wiped) {
_cfg_wiped = true;
}
}
if (_healthy) {