From 7fad13a1e2cc35e577420801cd82e5feaa5d9c27 Mon Sep 17 00:00:00 2001 From: bkubicek Date: Sat, 12 Oct 2013 13:24:55 +0200 Subject: [PATCH] Reverse SD card file name order. This is _not_ automatically the cronological, since deleting a file will free the filesystem descriptor for it, which then will be used by the next file copied on it. Since this makes the auto0.g file very inaccessible, I put the option back, to have it in the prepare menu. this should satisfy https://github.com/ErikZalm/Marlin/pull/373 as a reminder, auto0.g will be executed every time after a boot with sd card present and file present. thereafter, if there is a file auto1.g this will be done. Thats IMHO the best place to put settings, and prepare heating. I also execute again after each (now again via the prepare menu) before starting a new print/ after a failed one. It for me 100% replaces any start.gcode form the slicers. --- Marlin/Configuration_adv.h | 11 +++++++++++ Marlin/ultralcd.cpp | 10 ++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 0392acaac7..23ca5efec8 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -257,6 +257,11 @@ #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place. +#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the filesystem block order. +// if a file is deleted, it frees a block. hence, the order is not purely cronological. To still have auto0.g accessible, there is again the option to do that. +// using: +//#define MENU_ADDAUTOSTART + // The hardware watchdog should reset the Microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG @@ -380,6 +385,12 @@ const unsigned int dropsegments=5; //everything with less than this number of st #define FILAMENTCHANGE_FINALRETRACT -100 #endif #endif + +#ifdef FILAMENTCHANGEENABLE + #ifdef EXTRUDER_RUNOUT_PREVENT + #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE + #endif +#endif //=========================================================================== //============================= Define Defines ============================ diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 0e8c8697d4..12a9e23bc3 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -420,7 +420,9 @@ static void lcd_prepare_menu() START_MENU(); MENU_ITEM(back, MSG_MAIN, lcd_main_menu); #ifdef SDSUPPORT - //MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd); + #ifdef MENU_ADDAUTOSTART + MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd); + #endif #endif MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); @@ -792,7 +794,11 @@ void lcd_sdcard_menu() { if (_menuItemNr == _lineNr) { - card.getfilename(i); + #ifndef SDCARD_RATHERRECENTFIRST + card.getfilename(i); + #else + card.getfilename(fileCnt-1-i); + #endif if (card.filenameIsDir) { MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);