From abaeaa0479602a4c4abeb12e0e067045c7a30d74 Mon Sep 17 00:00:00 2001 From: philmoz Date: Mon, 30 Oct 2023 16:03:26 +1100 Subject: [PATCH] Don't update YAML files on the SD card if the radio is in emergency mode. --- radio/src/storage/sdcard_common.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/radio/src/storage/sdcard_common.cpp b/radio/src/storage/sdcard_common.cpp index 74badbb1b43..0b078db4b45 100644 --- a/radio/src/storage/sdcard_common.cpp +++ b/radio/src/storage/sdcard_common.cpp @@ -75,6 +75,9 @@ void storageFormat() void storageCheck(bool immediately) { + // Don't write anything to SD card if in EM + if (globalData.unexpectedShutdown) return; + if (storageDirtyMsk & EE_GENERAL) { TRACE("eeprom write general"); storageDirtyMsk &= ~EE_GENERAL;