Apply SDCARD_SORT_ALPHA changes from 2.0.x
This commit is contained in:
@@ -70,6 +70,8 @@ public:
|
||||
void updir();
|
||||
void setroot();
|
||||
|
||||
uint16_t get_num_Files();
|
||||
|
||||
#if ENABLED(SDCARD_SORT_ALPHA)
|
||||
void presort();
|
||||
void getfilename_sorted(const uint16_t nr);
|
||||
@@ -112,6 +114,12 @@ private:
|
||||
uint8_t sort_order[SDSORT_LIMIT];
|
||||
#endif
|
||||
|
||||
#if ENABLED(SDSORT_USES_RAM) && ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
|
||||
#define SORTED_LONGNAME_MAXLEN ((SDSORT_CACHE_VFATS) * (FILENAME_LENGTH) + 1)
|
||||
#else
|
||||
#define SORTED_LONGNAME_MAXLEN LONG_FILENAME_LENGTH
|
||||
#endif
|
||||
|
||||
// Cache filenames to speed up SD menus.
|
||||
#if ENABLED(SDSORT_USES_RAM)
|
||||
|
||||
@@ -121,10 +129,10 @@ private:
|
||||
char **sortshort, **sortnames;
|
||||
#else
|
||||
char sortshort[SDSORT_LIMIT][FILENAME_LENGTH];
|
||||
char sortnames[SDSORT_LIMIT][SDSORT_CACHE_VFATS * FILENAME_LENGTH + 1];
|
||||
char sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN];
|
||||
#endif
|
||||
#elif DISABLED(SDSORT_USES_STACK)
|
||||
char sortnames[SDSORT_LIMIT][LONG_FILENAME_LENGTH];
|
||||
char sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN];
|
||||
#endif
|
||||
|
||||
// Folder sorting uses an isDir array when caching items.
|
||||
|
||||
Reference in New Issue
Block a user