mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 02:32:23 +00:00
SERIOUS BUG: we've been discarding devicestate when we should not
This commit is contained in:
2
proto
2
proto
Submodule proto updated: 5c1062ea83...e63f9713f7
@@ -145,6 +145,7 @@ void NodeDB::installDefaultDeviceState()
|
|||||||
devicestate.has_my_node = true;
|
devicestate.has_my_node = true;
|
||||||
devicestate.has_owner = true;
|
devicestate.has_owner = true;
|
||||||
devicestate.node_db_count = 0;
|
devicestate.node_db_count = 0;
|
||||||
|
devicestate.version = DEVICESTATE_CUR_VER;
|
||||||
devicestate.receive_queue_count = 0; // Not yet implemented FIXME
|
devicestate.receive_queue_count = 0; // Not yet implemented FIXME
|
||||||
|
|
||||||
// default to no GPS, until one has been found by probing
|
// default to no GPS, until one has been found by probing
|
||||||
@@ -308,7 +309,7 @@ void NodeDB::loadFromDisk()
|
|||||||
installDefaultDeviceState(); // Our in RAM copy might now be corrupt
|
installDefaultDeviceState(); // Our in RAM copy might now be corrupt
|
||||||
} else {
|
} else {
|
||||||
if (devicestate.version < DEVICESTATE_MIN_VER) {
|
if (devicestate.version < DEVICESTATE_MIN_VER) {
|
||||||
DEBUG_MSG("Warn: devicestate is old, discarding\n");
|
DEBUG_MSG("Warn: devicestate %d is old, discarding\n", devicestate.version);
|
||||||
installDefaultDeviceState();
|
installDefaultDeviceState();
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG("Loaded saved preferences version %d\n", devicestate.version);
|
DEBUG_MSG("Loaded saved preferences version %d\n", devicestate.version);
|
||||||
|
|||||||
Reference in New Issue
Block a user