summaryrefslogtreecommitdiff
path: root/src/tangara/system_fsm/running.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tangara/system_fsm/running.cpp')
-rw-r--r--src/tangara/system_fsm/running.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/tangara/system_fsm/running.cpp b/src/tangara/system_fsm/running.cpp
index ac36ec64..c808e9da 100644
--- a/src/tangara/system_fsm/running.cpp
+++ b/src/tangara/system_fsm/running.cpp
@@ -82,22 +82,14 @@ void Running::react(const SdDetectChanged& ev) {
// supriously. FIXME: Why?
// Instead, check whether or not the card has actually gone away.
if (sStorage) {
- FRESULT res;
FF_DIR dir;
- {
- auto lock = drivers::acquire_spi();
- res = f_opendir(&dir, "/");
- }
-
+ FRESULT res = f_opendir(&dir, "/");
if (res != FR_OK) {
ESP_LOGW(kTag, "sd card ejected unsafely!");
unmountStorage();
}
- {
- auto lock = drivers::acquire_spi();
- f_closedir(&dir);
- }
+ f_closedir(&dir);
}
}