tolerate no SPI device
This commit is contained in:
parent
c6da63eb66
commit
1f83047ddd
|
@ -332,15 +332,13 @@ static BaseBlockDevice* initializeMmcBlockDevice() {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!engineConfiguration->isSdCardEnabled) {
|
if (!engineConfiguration->isSdCardEnabled || mmcSpiDevice == SPI_NONE) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configures and activates the MMC peripheral.
|
// Configures and activates the MMC peripheral.
|
||||||
mmcSpiDevice = engineConfiguration->sdCardSpiDevice;
|
mmcSpiDevice = engineConfiguration->sdCardSpiDevice;
|
||||||
|
|
||||||
efiAssert(OBD_PCM_Processor_Fault, mmcSpiDevice != SPI_NONE, "SD card enabled, but no SPI device configured!", nullptr);
|
|
||||||
|
|
||||||
// todo: reuse initSpiCs method?
|
// todo: reuse initSpiCs method?
|
||||||
mmc_hs_spicfg.ssport = mmc_ls_spicfg.ssport = getHwPort("mmc", engineConfiguration->sdCardCsPin);
|
mmc_hs_spicfg.ssport = mmc_ls_spicfg.ssport = getHwPort("mmc", engineConfiguration->sdCardCsPin);
|
||||||
mmc_hs_spicfg.sspad = mmc_ls_spicfg.sspad = getHwPin("mmc", engineConfiguration->sdCardCsPin);
|
mmc_hs_spicfg.sspad = mmc_ls_spicfg.sspad = getHwPin("mmc", engineConfiguration->sdCardCsPin);
|
||||||
|
|
Loading…
Reference in New Issue