From 1f83047ddd72c93a09c059a4f2e5a3eaad4dc9f6 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 21 Dec 2022 15:46:59 -0800 Subject: [PATCH] tolerate no SPI device --- firmware/hw_layer/mmc_card.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/firmware/hw_layer/mmc_card.cpp b/firmware/hw_layer/mmc_card.cpp index 699b7d643c..00cc6e6842 100644 --- a/firmware/hw_layer/mmc_card.cpp +++ b/firmware/hw_layer/mmc_card.cpp @@ -332,15 +332,13 @@ static BaseBlockDevice* initializeMmcBlockDevice() { return nullptr; } - if (!engineConfiguration->isSdCardEnabled) { + if (!engineConfiguration->isSdCardEnabled || mmcSpiDevice == SPI_NONE) { return nullptr; } // Configures and activates the MMC peripheral. mmcSpiDevice = engineConfiguration->sdCardSpiDevice; - efiAssert(OBD_PCM_Processor_Fault, mmcSpiDevice != SPI_NONE, "SD card enabled, but no SPI device configured!", nullptr); - // todo: reuse initSpiCs method? mmc_hs_spicfg.ssport = mmc_ls_spicfg.ssport = getHwPort("mmc", engineConfiguration->sdCardCsPin); mmc_hs_spicfg.sspad = mmc_ls_spicfg.sspad = getHwPin("mmc", engineConfiguration->sdCardCsPin);