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 6cc7b0eeec
commit 370eb0d5a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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. * Returns a BaseBlockDevice* corresponding to the SD card if successful, otherwise nullptr.
*/ */
static BaseBlockDevice* initializeMmcBlockDevice() { 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)) { if (!CONFIG(isSdCardEnabled)) {
return nullptr; return nullptr;
} }