"SD init fail" status error (#19064)

This commit is contained in:
Serhiy-K 2020-08-19 10:58:41 +03:00 committed by Scott Lahteine
parent acc90ad09f
commit 349bddc652
2 changed files with 7 additions and 1 deletions

View File

@ -48,6 +48,7 @@ namespace Language_en {
PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Media Inserted"); PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Media Inserted");
PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Media Removed"); PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Media Removed");
PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Waiting for media"); PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Waiting for media");
PROGMEM Language_Str MSG_SD_INIT_FAIL = _UxGT("SD Init Fail");
PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Media read error"); PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Media read error");
PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB device removed"); PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB device removed");
PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("USB start failed"); PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("USB start failed");

View File

@ -376,8 +376,13 @@ void CardReader::mount() {
flag.mounted = true; flag.mounted = true;
SERIAL_ECHO_MSG(STR_SD_CARD_OK); SERIAL_ECHO_MSG(STR_SD_CARD_OK);
} }
cdroot();
if (flag.mounted)
cdroot();
else {
spiInit(SPI_SPEED); // Return to base SPI speed
ui.set_status_P(GET_TEXT(MSG_SD_INIT_FAIL), -1);
}
ui.refresh(); ui.refresh();
} }