From da1d8edfa1dcc024c901db3ff3e608dad6270379 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Mon, 10 May 2021 11:31:40 -0700 Subject: [PATCH] no sd if early fatal (#2680) --- firmware/hw_layer/mmc_card.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/firmware/hw_layer/mmc_card.cpp b/firmware/hw_layer/mmc_card.cpp index ffcaeb0976..4c66ca7fc4 100644 --- a/firmware/hw_layer/mmc_card.cpp +++ b/firmware/hw_layer/mmc_card.cpp @@ -327,6 +327,11 @@ void onUsbConnectedNotifyMmcI() { * Returns a BaseBlockDevice* corresponding to the SD card if successful, otherwise nullptr. */ static BaseBlockDevice* initializeMmcBlockDevice() { + // Don't try to mount SD card in case of fatal error - hardware may be in an unexpected state + if (hasFirmwareError()) { + return nullptr; + } + if (!CONFIG(isSdCardEnabled)) { return nullptr; }