mirror of
https://github.com/meshtastic/firmware.git
synced 2026-09-19 20:39:09 -04:00
Fix spiLock deadlocks / frequent watchdog restarts in WarmNodeStore::save() (#10809)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
1 parent
0488a46a3c
commit
b44ed4552f
2 files changed
+22
-6
No files matched your search
@@ -354,10 +354,16 @@ void MessageStore::clearAllMessages()
|
||||
resetMessagePool();
|
||||
|
||||
#ifdef FSCom
|
||||
concurrency::LockGuard guard(spiLock);
|
||||
SafeFile f(filename.c_str(), false);
|
||||
uint8_t count = 0;
|
||||
f.write(&count, 1); // write "0 messages"
|
||||
|
||||
// SafeFile already does its own spiLock in its constructor and close().
|
||||
// Avoid nesting spiLocks, as this will hang until watchdog reset!
|
||||
{
|
||||
concurrency::LockGuard guard(spiLock);
|
||||
f.write(&count, 1); // write "0 messages"
|
||||
}
|
||||
|
||||
f.close();
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user