Reboot before formatting LittleFS (#5900)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Eric Severance
2025-01-20 09:43:35 -08:00
committed by GitHub
parent 0f981153eb
commit c4fcbad372
4 changed files with 61 additions and 31 deletions

View File

@@ -8,7 +8,6 @@ static File openFile(const char *filename, bool fullAtomic)
concurrency::LockGuard g(spiLock);
LOG_DEBUG("Opening %s, fullAtomic=%d", filename, fullAtomic);
#ifdef ARCH_NRF52
lfs_assert_failed = false;
File file = FSCom.open(filename, FILE_O_WRITE);
file.seek(0);
return file;
@@ -20,7 +19,6 @@ static File openFile(const char *filename, bool fullAtomic)
filenameTmp += ".tmp";
// clear any previous LFS errors
lfs_assert_failed = false;
return FSCom.open(filenameTmp.c_str(), FILE_O_WRITE);
}
@@ -96,8 +94,6 @@ bool SafeFile::close()
bool SafeFile::testReadback()
{
concurrency::LockGuard g(spiLock);
bool lfs_failed = lfs_assert_failed;
lfs_assert_failed = false;
String filenameTmp = filename;
filenameTmp += ".tmp";
@@ -119,7 +115,7 @@ bool SafeFile::testReadback()
return false;
}
return !lfs_failed;
return true;
}
#endif