diff --git a/Marlin/src/lcd/extensible_ui/ui_api.cpp b/Marlin/src/lcd/extensible_ui/ui_api.cpp index b11e5f8ef..f9963076a 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.cpp +++ b/Marlin/src/lcd/extensible_ui/ui_api.cpp @@ -570,11 +570,7 @@ namespace UI { #endif pos; - #if ENABLED(SDCARD_SORT_ALPHA) - card.getfilename_sorted(nr); - #else - card.getfilename(nr); - #endif + card.getfilename_sorted(nr); return card.filename && card.filename[0] != '\0'; #endif } diff --git a/Marlin/src/lcd/menu/menu_sdcard.cpp b/Marlin/src/lcd/menu/menu_sdcard.cpp index 7b7eba814..1384ce515 100644 --- a/Marlin/src/lcd/menu/menu_sdcard.cpp +++ b/Marlin/src/lcd/menu/menu_sdcard.cpp @@ -116,11 +116,7 @@ void menu_sdcard() { #endif i; - #if ENABLED(SDCARD_SORT_ALPHA) - card.getfilename_sorted(nr); - #else - card.getfilename(nr); - #endif + card.getfilename_sorted(nr); if (card.filenameIsDir) MENU_ITEM(sddirectory, MSG_CARD_MENU, card); diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index a92196f98..b3c754cc9 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -103,6 +103,8 @@ public: FORCE_INLINE void setSortFolders(int i) { sort_folders = i; presort(); } //FORCE_INLINE void setSortReverse(bool b) { sort_reverse = b; } #endif + #else + FORCE_INLINE void getfilename_sorted(const uint16_t nr) { getfilename(nr); } #endif #if ENABLED(POWER_LOSS_RECOVERY)