Remove devicestate no_save (#3424)

This commit is contained in:
Ben Meadors 2024-03-17 08:16:22 -05:00 committed by GitHub
parent e27f029d09
commit bb57ccfc9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,13 +97,6 @@ bool NodeDB::resetRadioConfig(bool factory_reset)
channels.onConfigChanged();
// temp hack for quicker testing
// devicestate.no_save = true;
if (devicestate.no_save) {
LOG_DEBUG("***** DEVELOPMENT MODE - DO NOT RELEASE *****\n");
// Put your development config changes here
}
// Update the global myRegion
initRegion();
@ -644,27 +637,21 @@ bool NodeDB::saveProto(const char *filename, size_t protoSize, const pb_msgdesc_
void NodeDB::saveChannelsToDisk()
{
if (!devicestate.no_save) {
#ifdef FSCom
FSCom.mkdir("/prefs");
#endif
saveProto(channelFileName, meshtastic_ChannelFile_size, &meshtastic_ChannelFile_msg, &channelFile);
}
}
void NodeDB::saveDeviceStateToDisk()
{
if (!devicestate.no_save) {
#ifdef FSCom
FSCom.mkdir("/prefs");
#endif
saveProto(prefFileName, meshtastic_DeviceState_size, &meshtastic_DeviceState_msg, &devicestate);
}
}
void NodeDB::saveToDisk(int saveWhat)
{
if (!devicestate.no_save) {
#ifdef FSCom
FSCom.mkdir("/prefs");
#endif
@ -697,9 +684,6 @@ void NodeDB::saveToDisk(int saveWhat)
if (saveWhat & SEGMENT_CHANNELS) {
saveChannelsToDisk();
}
} else {
LOG_DEBUG("***** DEVELOPMENT MODE - DO NOT RELEASE - not saving to flash *****\n");
}
}
const meshtastic_NodeInfoLite *NodeDB::readNextMeshNode(uint32_t &readIndex)