diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 57d7ba3503..7c48e83d33 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -163,15 +163,13 @@ CardReader::CardReader() { static uint8_t sort_order_static[SDSORT_LIMIT]; sort_order = sort_order_static; #endif - #if ENABLED(SDSORT_CACHE_NAMES) - #if DISABLED(SDSORT_DYNAMIC_RAM) - static char sortshort_static[SDSORT_LIMIT][FILENAME_LENGTH]; - sortshort = sortshort_static; - #endif - #if !ALL(SDSORT_DYNAMIC_RAM, SDSORT_USES_STACK) - static char sortnames_static[SDSORT_LIMIT][SORTED_LONGNAME_STORAGE]; - sortnames = sortnames_static; - #endif + #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM) + static char sortshort_static[SDSORT_LIMIT][FILENAME_LENGTH]; + sortshort = sortshort_static; + #endif + #if ENABLED(SDSORT_USES_RAM) && DISABLED(SDSORT_DYNAMIC_RAM) && (ENABLED(SDSORT_CACHE_NAMES) || DISABLED(SDSORT_USES_STACK)) + static char sortnames_static[SDSORT_LIMIT][SORTED_LONGNAME_STORAGE]; + sortnames = sortnames_static; #endif sort_count = 0; diff --git a/buildroot/tests/LPC1768/config-07.ini b/buildroot/tests/LPC1768/config-07.ini new file mode 100644 index 0000000000..e53477c448 --- /dev/null +++ b/buildroot/tests/LPC1768/config-07.ini @@ -0,0 +1,13 @@ +# +# Marlin Firmware +# Test: LPC1768/config-07.ini +# +# MKS SBASE with SD sorting using RAM without name caching. +# + +[config:base] +motherboard = BOARD_MKS_SBASE +reprap_discount_smart_controller = on +sdsupport = on +sdcard_sort_alpha = on +sdsort_uses_ram = true