kopia lustrzana https://github.com/meshtastic/firmware
NRF52 SafeFile should not remove / rename files (#5840)
rodzic
89a9e0b99d
commit
1c0f43c8e2
|
@ -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;
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue