no sd if early fatal (#2680)

This commit is contained in:
Matthew Kennedy 2021-05-10 11:31:40 -07:00 committed by GitHub
parent 61b0e85e0a
commit da1d8edfa1
1 changed files with 5 additions and 0 deletions

View File

@ -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;
}