From da13c5e36e7dc9eb7c8eeaf3a237762006636645 Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Sat, 21 Dec 2024 12:19:08 +0100 Subject: [PATCH] fix lock in setupSDCard() --- src/FSCommon.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/FSCommon.cpp b/src/FSCommon.cpp index ef96deda3..83bdb2879 100644 --- a/src/FSCommon.cpp +++ b/src/FSCommon.cpp @@ -363,7 +363,7 @@ void fsInit() void setupSDCard() { #ifdef HAS_SDCARD - spiLock->lock(); + concurrency::LockGuard g(spiLock); SDHandler.begin(SPI_SCK, SPI_MISO, SPI_MOSI); if (!SD.begin(SDCARD_CS, SDHandler)) { @@ -390,6 +390,5 @@ void setupSDCard() LOG_DEBUG("SD Card Size: %lu MB", (uint32_t)cardSize); LOG_DEBUG("Total space: %lu MB", (uint32_t)(SD.totalBytes() / (1024 * 1024))); LOG_DEBUG("Used space: %lu MB", (uint32_t)(SD.usedBytes() / (1024 * 1024))); - spiLock->unlock(); #endif -} \ No newline at end of file +}