mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-17 10:43:24 +00:00
Only save devicestate on GPS reset (#1587)
This commit is contained in:
parent
fab20f5acf
commit
874d308b50
@ -330,7 +330,7 @@ int32_t GPS::runOnce()
|
||||
if(devicestate.did_gps_reset && (millis() > 60000) && !hasFlow()) {
|
||||
DEBUG_MSG("GPS is not communicating, trying factory reset on next bootup.\n");
|
||||
devicestate.did_gps_reset = false;
|
||||
nodeDB.saveToDisk();
|
||||
nodeDB.saveDeviceStateToDisk();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -435,6 +435,16 @@ void NodeDB::saveChannelsToDisk()
|
||||
}
|
||||
}
|
||||
|
||||
void NodeDB::saveDeviceStateToDisk()
|
||||
{
|
||||
if (!devicestate.no_save) {
|
||||
#ifdef FSCom
|
||||
FSCom.mkdir("/prefs");
|
||||
#endif
|
||||
saveProto(prefFileName, DeviceState_size, sizeof(devicestate), DeviceState_fields, &devicestate);
|
||||
}
|
||||
}
|
||||
|
||||
void NodeDB::saveToDisk()
|
||||
{
|
||||
if (!devicestate.no_save) {
|
||||
|
@ -44,7 +44,7 @@ class NodeDB
|
||||
void init();
|
||||
|
||||
/// write to flash
|
||||
void saveToDisk(), saveChannelsToDisk();
|
||||
void saveToDisk(), saveChannelsToDisk(), saveDeviceStateToDisk();
|
||||
|
||||
/** Reinit radio config if needed, because either:
|
||||
* a) sometimes a buggy android app might send us bogus settings or
|
||||
|
Loading…
Reference in New Issue
Block a user