Tweak and use SD_ORDER
This commit is contained in:
@ -947,7 +947,7 @@ void CardReader::cdroot() {
|
||||
|
||||
// Init sort order.
|
||||
for (uint16_t i = 0; i < fileCnt; i++) {
|
||||
sort_order[i] = SD_ORDER(i, fileCnt);
|
||||
sort_order[i] = i;
|
||||
// If using RAM then read all filenames now.
|
||||
#if ENABLED(SDSORT_USES_RAM)
|
||||
selectFileByIndex(i);
|
||||
|
@ -31,7 +31,11 @@
|
||||
#define SD_RESORT 1
|
||||
#endif
|
||||
|
||||
#define SD_ORDER(N,C) (TERN(SDCARD_RATHERRECENTFIRST, C - 1 - (N), N))
|
||||
#if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA)
|
||||
#define SD_ORDER(N,C) ((C) - 1 - (N))
|
||||
#else
|
||||
#define SD_ORDER(N,C) N
|
||||
#endif
|
||||
|
||||
#define MAX_DIR_DEPTH 10 // Maximum folder depth
|
||||
#define MAXDIRNAMELENGTH 8 // DOS folder name size
|
||||
|
Reference in New Issue
Block a user