Browse Source

Option to refresh/resort SDcard files when flashAir type is selected

Alex Voinea 4 years ago
parent
commit
d1968f6ff0
2 changed files with 12 additions and 3 deletions
  1. 1 1
      Firmware/messages.c
  2. 11 2
      Firmware/ultralcd.cpp

+ 1 - 1
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

+ 11 - 2
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();
+#else
+  card.presort();
+#endif
   menu_top = 0;
+  lcd_encoder = 0;
+  lcd_scrollTimer.start();
+  menu_entering = 1;
 }
-#endif
+
 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);