mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-25 09:42:35 +00:00
NRF52 - Remove file totally before opening write (#5916)
* Remove prefs first * Remove file first * Remove truncate * No longer needed * Missed a param * That wasn't supposed to be there * Remove vestigal lfs assert * Durr
This commit is contained in:
parent
3b40fe9805
commit
0d860882a8
@ -8,9 +8,8 @@ static File openFile(const char *filename, bool fullAtomic)
|
|||||||
concurrency::LockGuard g(spiLock);
|
concurrency::LockGuard g(spiLock);
|
||||||
LOG_DEBUG("Opening %s, fullAtomic=%d", filename, fullAtomic);
|
LOG_DEBUG("Opening %s, fullAtomic=%d", filename, fullAtomic);
|
||||||
#ifdef ARCH_NRF52
|
#ifdef ARCH_NRF52
|
||||||
File file = FSCom.open(filename, FILE_O_WRITE);
|
FSCom.remove(filename);
|
||||||
file.seek(0);
|
return FSCom.open(filename, FILE_O_WRITE);
|
||||||
return file;
|
|
||||||
#endif
|
#endif
|
||||||
if (!fullAtomic)
|
if (!fullAtomic)
|
||||||
FSCom.remove(filename); // Nuke the old file to make space (ignore if it !exists)
|
FSCom.remove(filename); // Nuke the old file to make space (ignore if it !exists)
|
||||||
@ -59,9 +58,6 @@ bool SafeFile::close()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
spiLock->lock();
|
spiLock->lock();
|
||||||
#ifdef ARCH_NRF52
|
|
||||||
f.truncate();
|
|
||||||
#endif
|
|
||||||
f.close();
|
f.close();
|
||||||
spiLock->unlock();
|
spiLock->unlock();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user