diff --git a/src/SafeFile.cpp b/src/SafeFile.cpp index c5d7b335e8..825ba30280 100644 --- a/src/SafeFile.cpp +++ b/src/SafeFile.cpp @@ -6,6 +6,11 @@ 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; + return FSCom.open(filename, FILE_O_WRITE); +#endif if (!fullAtomic) FSCom.remove(filename); // Nuke the old file to make space (ignore if it !exists) @@ -14,7 +19,6 @@ static File openFile(const char *filename, bool fullAtomic) // clear any previous LFS errors lfs_assert_failed = false; - return FSCom.open(filenameTmp.c_str(), FILE_O_WRITE); } @@ -57,6 +61,10 @@ bool SafeFile::close() spiLock->lock(); f.close(); spiLock->unlock(); + +#ifdef ARCH_NRF52 + return true; +#endif if (!testReadback()) return false;