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.
master
bkubicek 11 years ago
parent 73c82e7ad8
commit 7fad13a1e2

@ -257,6 +257,11 @@
#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? #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 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. // 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 //#define USE_WATCHDOG
@ -381,6 +386,12 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#endif #endif
#endif #endif
#ifdef FILAMENTCHANGEENABLE
#ifdef EXTRUDER_RUNOUT_PREVENT
#error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
#endif
#endif
//=========================================================================== //===========================================================================
//============================= Define Defines ============================ //============================= Define Defines ============================
//=========================================================================== //===========================================================================

@ -420,7 +420,9 @@ static void lcd_prepare_menu()
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_MAIN, lcd_main_menu); MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
#ifdef SDSUPPORT #ifdef SDSUPPORT
//MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd); #ifdef MENU_ADDAUTOSTART
MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd);
#endif
#endif #endif
MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
@ -792,7 +794,11 @@ void lcd_sdcard_menu()
{ {
if (_menuItemNr == _lineNr) if (_menuItemNr == _lineNr)
{ {
#ifndef SDCARD_RATHERRECENTFIRST
card.getfilename(i); card.getfilename(i);
#else
card.getfilename(fileCnt-1-i);
#endif
if (card.filenameIsDir) if (card.filenameIsDir)
{ {
MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename); MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);

Loading…
Cancel
Save