stability: add SPI lock before saving via littleFS

This commit is contained in:
mverch67
2024-10-25 16:09:49 +02:00
committed by Thomas Göttgens
parent 2568d4fcd8
commit a8bd1ee0da
2 changed files with 6 additions and 1 deletions

View File

@@ -32,6 +32,7 @@
#if HAS_WIFI
#include "mesh/wifi/WiFiAPClient.h"
#endif
#include "SPILock.h"
#include "modules/StoreForwardModule.h"
#include <Preferences.h>
#include <esp_efuse.h>
@@ -870,6 +871,9 @@ void NodeDB::loadFromDisk()
bool NodeDB::saveProto(const char *filename, size_t protoSize, const pb_msgdesc_t *fields, const void *dest_struct,
bool fullAtomic)
{
#ifdef ARCH_ESP32
concurrency::LockGuard g(spiLock);
#endif
bool okay = false;
#ifdef FSCom
auto f = SafeFile(filename, fullAtomic);