Browse Source

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.
bkubicek 10 years ago
parent
commit
7fad13a1e2
2 changed files with 19 additions and 2 deletions
  1. 11
    0
      Marlin/Configuration_adv.h
  2. 8
    2
      Marlin/ultralcd.cpp

+ 11
- 0
Marlin/Configuration_adv.h View File

@@ -257,6 +257,11 @@
257 257
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
258 258
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
259 259
 
260
+#define SDCARD_RATHERRECENTFIRST  //reverse file order of sd card menu display. Its sorted practically after the filesystem block order. 
261
+// 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.
262
+// using:
263
+//#define MENU_ADDAUTOSTART
264
+
260 265
 // The hardware watchdog should reset the Microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
261 266
 //#define USE_WATCHDOG
262 267
 
@@ -380,6 +385,12 @@ const unsigned int dropsegments=5; //everything with less than this number of st
380 385
     #define FILAMENTCHANGE_FINALRETRACT -100
381 386
   #endif
382 387
 #endif
388
+
389
+#ifdef FILAMENTCHANGEENABLE
390
+  #ifdef EXTRUDER_RUNOUT_PREVENT
391
+    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
392
+  #endif 
393
+#endif
383 394
  
384 395
 //===========================================================================
385 396
 //=============================  Define Defines  ============================

+ 8
- 2
Marlin/ultralcd.cpp View File

@@ -420,7 +420,9 @@ static void lcd_prepare_menu()
420 420
     START_MENU();
421 421
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
422 422
 #ifdef SDSUPPORT
423
-    //MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd);
423
+    #ifdef MENU_ADDAUTOSTART
424
+      MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd);
425
+    #endif
424 426
 #endif
425 427
     MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
426 428
     MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
@@ -792,7 +794,11 @@ void lcd_sdcard_menu()
792 794
     {
793 795
         if (_menuItemNr == _lineNr)
794 796
         {
795
-            card.getfilename(i);
797
+            #ifndef SDCARD_RATHERRECENTFIRST
798
+              card.getfilename(i);
799
+            #else
800
+              card.getfilename(fileCnt-1-i);
801
+            #endif
796 802
             if (card.filenameIsDir)
797 803
             {
798 804
                 MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);

Loading…
Cancel
Save