mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-16 01:52:04 +00:00
Merge pull request #1386 from meshtastic/patch-1
Remove References to Pre-1.2 Preffile
This commit is contained in:
commit
cf45e4fce5
@ -276,11 +276,9 @@ void NodeDB::pickNewNodeNum()
|
|||||||
myNodeInfo.my_node_num = r;
|
myNodeInfo.my_node_num = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *preffileOld = "/db.proto";
|
|
||||||
static const char *preffile = "/prefs/db.proto";
|
static const char *preffile = "/prefs/db.proto";
|
||||||
static const char *radiofile = "/prefs/radio.proto";
|
static const char *radiofile = "/prefs/radio.proto";
|
||||||
static const char *channelfile = "/prefs/channels.proto";
|
static const char *channelfile = "/prefs/channels.proto";
|
||||||
// const char *preftmp = "/db.proto.tmp";
|
|
||||||
|
|
||||||
/** Load a protobuf from a file, return true for success */
|
/** Load a protobuf from a file, return true for success */
|
||||||
bool loadProto(const char *filename, size_t protoSize, size_t objSize, const pb_msgdesc_t *fields, void *dest_struct)
|
bool loadProto(const char *filename, size_t protoSize, size_t objSize, const pb_msgdesc_t *fields, void *dest_struct)
|
||||||
@ -290,13 +288,6 @@ bool loadProto(const char *filename, size_t protoSize, size_t objSize, const pb_
|
|||||||
|
|
||||||
auto f = FSCom.open(filename);
|
auto f = FSCom.open(filename);
|
||||||
|
|
||||||
// FIXME, temporary hack until every node in the universe is 1.2 or later - look for prefs in the old location (so we can
|
|
||||||
// preserve region)
|
|
||||||
if (!f && filename == preffile) {
|
|
||||||
filename = preffileOld;
|
|
||||||
f = FSCom.open(filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool okay = false;
|
bool okay = false;
|
||||||
if (f) {
|
if (f) {
|
||||||
DEBUG_MSG("Loading %s\n", filename);
|
DEBUG_MSG("Loading %s\n", filename);
|
||||||
@ -399,8 +390,6 @@ void NodeDB::saveToDisk()
|
|||||||
saveProto(radiofile, RadioConfig_size, sizeof(RadioConfig), RadioConfig_fields, &radioConfig);
|
saveProto(radiofile, RadioConfig_size, sizeof(RadioConfig), RadioConfig_fields, &radioConfig);
|
||||||
saveChannelsToDisk();
|
saveChannelsToDisk();
|
||||||
|
|
||||||
// remove any pre 1.2 pref files, turn on after 1.2 is in beta
|
|
||||||
// if(okay) FSCom.remove(preffileOld);
|
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG("***** DEVELOPMENT MODE - DO NOT RELEASE - not saving to flash *****\n");
|
DEBUG_MSG("***** DEVELOPMENT MODE - DO NOT RELEASE - not saving to flash *****\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user