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
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
257
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
258
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
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
 // The hardware watchdog should reset the Microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
265
 // The hardware watchdog should reset the Microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
261
 //#define USE_WATCHDOG
266
 //#define USE_WATCHDOG
262
 
267
 
380
     #define FILAMENTCHANGE_FINALRETRACT -100
385
     #define FILAMENTCHANGE_FINALRETRACT -100
381
   #endif
386
   #endif
382
 #endif
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
 //=============================  Define Defines  ============================
396
 //=============================  Define Defines  ============================

+ 8
- 2
Marlin/ultralcd.cpp View File

420
     START_MENU();
420
     START_MENU();
421
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
421
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
422
 #ifdef SDSUPPORT
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
 #endif
426
 #endif
425
     MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
427
     MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
426
     MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
428
     MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
792
     {
794
     {
793
         if (_menuItemNr == _lineNr)
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
             if (card.filenameIsDir)
802
             if (card.filenameIsDir)
797
             {
803
             {
798
                 MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);
804
                 MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);

Loading…
Cancel
Save