Browse Source

SDCARD_RATHERRECENTFIRST with SDCARD_SORT_ALPHA

Scott Lahteine 6 years ago
parent
commit
20a41e2f7b
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      Marlin/src/sd/cardreader.cpp

+ 5
- 1
Marlin/src/sd/cardreader.cpp View File

@@ -813,7 +813,11 @@ void CardReader::setroot() {
813 813
 
814 814
         // Init sort order.
815 815
         for (uint16_t i = 0; i < fileCnt; i++) {
816
-          sort_order[i] = i;
816
+          sort_order[i] = (
817
+            #if ENABLED(SDCARD_RATHERRECENTFIRST)
818
+              fileCnt - 1 -
819
+            #endif
820
+          i);
817 821
           // If using RAM then read all filenames now.
818 822
           #if ENABLED(SDSORT_USES_RAM)
819 823
             getfilename(i);

Loading…
Cancel
Save