mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-22 17:34:25 +00:00
don't double lock
This commit is contained in:
parent
9d20201580
commit
f9c8434529
@ -328,14 +328,14 @@ void listDir(const char *dirname, uint8_t levels, bool del)
|
|||||||
void rmDir(const char *dirname)
|
void rmDir(const char *dirname)
|
||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
spiLock->lock();
|
|
||||||
#if (defined(ARCH_ESP32) || defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
#if (defined(ARCH_ESP32) || defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
listDir(dirname, 10, true);
|
listDir(dirname, 10, true);
|
||||||
#elif defined(ARCH_NRF52)
|
#elif defined(ARCH_NRF52)
|
||||||
// nRF52 implementation of LittleFS has a recursive delete function
|
// nRF52 implementation of LittleFS has a recursive delete function
|
||||||
FSCom.rmdir_r(dirname);
|
FSCom.rmdir_r(dirname);
|
||||||
#endif
|
#endif
|
||||||
spiLock->unlock();
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,8 +352,9 @@ bool NodeDB::factoryReset(bool eraseBleBonds)
|
|||||||
{
|
{
|
||||||
LOG_INFO("Perform factory reset!");
|
LOG_INFO("Perform factory reset!");
|
||||||
// first, remove the "/prefs" (this removes most prefs)
|
// first, remove the "/prefs" (this removes most prefs)
|
||||||
rmDir("/prefs"); // this uses spilock internally...
|
|
||||||
spiLock->lock();
|
spiLock->lock();
|
||||||
|
rmDir("/prefs"); // this uses spilock internally...
|
||||||
|
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
if (FSCom.exists("/static/rangetest.csv") && !FSCom.remove("/static/rangetest.csv")) {
|
if (FSCom.exists("/static/rangetest.csv") && !FSCom.remove("/static/rangetest.csv")) {
|
||||||
LOG_ERROR("Could not remove rangetest.csv file");
|
LOG_ERROR("Could not remove rangetest.csv file");
|
||||||
|
Loading…
Reference in New Issue
Block a user