From b1972fdcee97808a2f523193d0292c2e10864c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Wed, 28 Jul 2021 16:47:47 +0000 Subject: [PATCH] Fixes https://github.com/prusa3d/Prusa-Firmware/issues/3252 --- Firmware/ultralcd.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 658e6b01..ef5cf1e5 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -8844,6 +8844,22 @@ void menu_lcd_lcdupdate_func(void) #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) { + if(menu_menu == lcd_sdcard_menu) { + // If the user is either inside the submenus + // 1. 'Print from SD' --> and SD card is removed + // 2. 'No SD card' --> and SD card is inserted + // + // 1. 'Print from SD': We want to back out of this submenu + // and instead show the submenu title 'No SD card'. + // + // 2. 'No SD card': When the user inserts the SD card we want + // to back out of this submenu. Not only to show + // 'Print from SD' submenu title but also because the user + // will be prompted with another menu with the sorted list of files. + // Without backing out of the menu, the list will appear empty and + // The user will need to back out of two nested submenus. + menu_back(); + } lcd_draw_update = 2; lcd_oldcardstatus = IS_SD_INSERTED; lcd_refresh(); // to maybe revive the LCD if static electricity killed it. @@ -8861,8 +8877,6 @@ void menu_lcd_lcdupdate_func(void) } else { - if(menu_menu==lcd_sdcard_menu) - menu_back(); card.release(); LCD_MESSAGERPGM(_i("Card removed"));////MSG_SD_REMOVED c=20 }