add FS macro guards

This commit is contained in:
Thomas Göttgens 2024-03-18 15:09:23 +01:00
parent 9be3b7bdc5
commit 72664b04f1
2 changed files with 4 additions and 0 deletions

View File

@ -115,9 +115,11 @@ bool NodeDB::factoryReset()
LOG_INFO("Performing factory reset!\n");
// first, remove the "/prefs" (this removes most prefs)
rmDir("/prefs");
#ifdef FSCom
if (FSCom.exists("/static/rangetest.csv") && !FSCom.remove("/static/rangetest.csv")) {
LOG_WARN("Could not remove rangetest.csv file\n");
}
#endif
// second, install default state (this will deal with the duplicate mac address issue)
installDefaultDeviceState();
installDefaultConfig();

View File

@ -198,11 +198,13 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
}
case meshtastic_AdminMessage_delete_file_request_tag: {
LOG_DEBUG("Client is requesting to delete file: %s\n", r->delete_file_request);
#ifdef FSCom
if (FSCom.remove(r->delete_file_request)) {
LOG_DEBUG("Successfully deleted file\n");
} else {
LOG_DEBUG("Failed to delete file\n");
}
#endif
break;
}
#ifdef ARCH_PORTDUINO