Skip to content

Commit

Permalink
♻️ FOLDER_SORTING => SDSORT_FOLDERS
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Feb 8, 2024
1 parent 73ed511 commit 20ee8dd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@
// SD Card Sorting options
#if ENABLED(SDCARD_SORT_ALPHA)
#define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each.
#define FOLDER_SORTING -1 // -1=above 0=none 1=below
#define SDSORT_FOLDERS -1 // -1=above 0=none 1=below
#define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 G-code.
#define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting.
#define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -3404,8 +3404,8 @@
#define SDSORT_USES_RAM true
#define SDSORT_USES_STACK false
#define SDSORT_CACHE_NAMES true
#ifndef FOLDER_SORTING
#define FOLDER_SORTING -1
#ifndef SDSORT_FOLDERS
#define SDSORT_FOLDERS -1
#endif
#ifndef SDSORT_GCODE
#define SDSORT_GCODE false
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/sd/cardreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ CardReader::CardReader() {
sort_count = 0;
#if ENABLED(SDSORT_GCODE)
sort_alpha = true;
sort_folders = FOLDER_SORTING;
sort_folders = SDSORT_FOLDERS;
//sort_reverse = false;
#endif
#endif
Expand Down Expand Up @@ -1210,7 +1210,7 @@ void CardReader::cdroot() {
#if ENABLED(SDSORT_GCODE)
sort_folders ? _SORT_CMP_DIR(sort_folders) : _SORT_CMP_NODIR()
#else
_SORT_CMP_DIR(FOLDER_SORTING)
_SORT_CMP_DIR(SDSORT_FOLDERS)
#endif
#else
_SORT_CMP_NODIR()
Expand Down
5 changes: 4 additions & 1 deletion Marlin/src/sd/cardreader.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ extern const char M23_STR[], M24_STR[];
#if ENABLED(SDSORT_DYNAMIC_RAM)
#define SD_RESORT 1
#endif
#if FOLDER_SORTING || ENABLED(SDSORT_GCODE)
#ifndef SDSORT_FOLDERS
#define SDSORT_FOLDERS 0
#endif
#if SDSORT_FOLDERS || ENABLED(SDSORT_GCODE)
#define HAS_FOLDER_SORTING 1
#endif
#endif
Expand Down

0 comments on commit 20ee8dd

Please sign in to comment.