From d1968f6ff0b324fbec4b7c0129054dba42ca25ca Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Tue, 3 Mar 2020 15:17:50 +0200 Subject: [PATCH] Option to refresh/resort SDcard files when flashAir type is selected --- Firmware/messages.c | 2 +- Firmware/ultralcd.cpp | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Firmware/messages.c b/Firmware/messages.c index 4e229ba7..48522841 100644 --- a/Firmware/messages.c +++ b/Firmware/messages.c @@ -65,7 +65,7 @@ const char MSG_PRESS_TO_UNLOAD[] PROGMEM_I1 = ISTR("Please press the knob to unl const char MSG_PRINT_ABORTED[] PROGMEM_I1 = ISTR("Print aborted"); ////c=20 const char MSG_PULL_OUT_FILAMENT[] PROGMEM_I1 = ISTR("Please pull out filament immediately"); ////c=20 r=4 const char MSG_RECOVER_PRINT[] PROGMEM_I1 = ISTR("Blackout occurred. Recover print?"); ////c=20 r=2 -const char MSG_REFRESH[] PROGMEM_I1 = ISTR("\xF8" "Refresh"); //// +const char MSG_REFRESH[] PROGMEM_I1 = ISTR("\x04" "Refresh"); //// const char MSG_RESUMING_PRINT[] PROGMEM_I1 = ISTR("Resuming print"); //// const char MSG_REMOVE_STEEL_SHEET[] PROGMEM_I1 = ISTR("Please remove steel sheet from heatbed."); ////c=20 r=4 const char MSG_SELFTEST_COOLING_FAN[] PROGMEM_I1 = ISTR("Front print fan?"); ////c=20 diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index ec7ced9b..33d786c1 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -7162,13 +7162,20 @@ static void lcd_control_temperature_menu() } -#if SDCARDDETECT == -1 + static void lcd_sd_refresh() { +#if SDCARDDETECT == -1 card.initsd(); - menu_top = 0; -} +#else + card.presort(); #endif + menu_top = 0; + lcd_encoder = 0; + lcd_scrollTimer.start(); + menu_entering = 1; +} + static void lcd_sd_updir() { card.updir(); @@ -7304,6 +7311,8 @@ void lcd_sdcard_menu() { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); +#else + if (card.ToshibaFlashAir_isEnabled()) MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #endif } else { MENU_ITEM_FUNCTION_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir);