Merge pull request #1987 from lewisxhe/master

Add t-echo to the operation after the flash operation fails
This commit is contained in:
Ben Meadors 2022-11-26 06:59:03 -06:00 committed by GitHub
commit 5e9d722b7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -475,6 +475,15 @@ bool saveProto(const char *filename, size_t protoSize, size_t objSize, const pb_
DEBUG_MSG("Error: can't rename new pref file\n");
} else {
DEBUG_MSG("Can't write prefs\n");
#ifdef ARCH_NRF52
static uint8_t failedCounter = 0;
failedCounter++;
if(failedCounter >= 2){
FSCom.format();
//After formatting, the device needs to be restarted
nodeDB.resetRadioConfig(true);
}
#endif
}
#else
DEBUG_MSG("ERROR: Filesystem not implemented\n");