Do SD sort order in CardReader
This commit is contained in:
@ -924,7 +924,7 @@ void CardReader::cdroot() {
|
||||
|
||||
// Init sort order.
|
||||
for (uint16_t i = 0; i < fileCnt; i++) {
|
||||
sort_order[i] = TERN(SDCARD_RATHERRECENTFIRST, fileCnt - 1 - i, i);
|
||||
sort_order[i] = SD_ORDER(i, fileCnt);
|
||||
// If using RAM then read all filenames now.
|
||||
#if ENABLED(SDSORT_USES_RAM)
|
||||
selectFileByIndex(i);
|
||||
|
@ -29,6 +29,8 @@
|
||||
#define SD_RESORT 1
|
||||
#endif
|
||||
|
||||
#define SD_ORDER(N,C) (TERN(SDCARD_RATHERRECENTFIRST, C - 1 - (N), N))
|
||||
|
||||
#define MAX_DIR_DEPTH 10 // Maximum folder depth
|
||||
#define MAXDIRNAMELENGTH 8 // DOS folder name size
|
||||
#define MAXPATHNAMELENGTH (1 + (MAXDIRNAMELENGTH + 1) * (MAX_DIR_DEPTH) + 1 + FILENAME_LENGTH) // "/" + N * ("ADIRNAME/") + "filename.ext"
|
||||
|
Reference in New Issue
Block a user