From 000c489b63eb773849fcb65dcde53c0c476a4adf Mon Sep 17 00:00:00 2001 From: Knutwurst <36196269+knutwurst@users.noreply.github.com> Date: Sat, 10 Jun 2023 17:32:34 +0200 Subject: [PATCH] Restructure fileList to load faster. --- Marlin/src/inc/Version.h | 2 +- .../lcd/extui/knutwurst/anycubic_touchscreen.cpp | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index b13f781f..4670e420 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ - #define CUSTOM_BUILD_VERSION "1.5.1-pre" + #define CUSTOM_BUILD_VERSION "1.5.1" #ifndef STRING_DISTRIBUTION_DATE #define STRING_DISTRIBUTION_DATE "2023-06-09" diff --git a/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp b/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp index 3e1b500b..1ac29ec0 100755 --- a/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp +++ b/Marlin/src/lcd/extui/knutwurst/anycubic_touchscreen.cpp @@ -646,11 +646,17 @@ void AnycubicTouchscreenClass::RenderCurrentFileList() { currentFileOrDirectory[0] = 0; - + uint16_t selectedNumber = 0; + FileList currentFileList; + if (SpecialMenu == false) { currentTouchscreenSelection[0] = 0; } + if (CodeSeen('S')) { + selectedNumber = CodeValue(); + } + // Filelist start SEND_PGM("FN "); SENDLINE_PGM(""); @@ -659,13 +665,6 @@ void AnycubicTouchscreenClass::RenderCurrentFileList() { SENDLINE_PGM(SM_SPECIAL_MENU_S); SENDLINE_PGM(SM_SPECIAL_MENU_L); } else { - uint16_t selectedNumber = 0; - FileList currentFileList; - - if (CodeSeen('S')) { - selectedNumber = CodeValue(); - } - if (SpecialMenu) { RenderSpecialMenu(selectedNumber); } else if (selectedNumber <= currentFileList.count()) {