From 349bddc652d7b6986c9613152de52da5bb58fb5a Mon Sep 17 00:00:00 2001 From: Serhiy-K <52166448+Serhiy-K@users.noreply.github.com> Date: Wed, 19 Aug 2020 10:58:41 +0300 Subject: [PATCH] "SD init fail" status error (#19064) --- Marlin/src/lcd/language/language_en.h | 1 + Marlin/src/sd/cardreader.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 9f6178ae50..3791a4ad18 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -48,6 +48,7 @@ namespace Language_en { PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Media Inserted"); PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Media Removed"); 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_USB_REMOVED = _UxGT("USB device removed"); PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("USB start failed"); diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 864552516b..3aa7156e7b 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -376,8 +376,13 @@ void CardReader::mount() { flag.mounted = true; 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(); }