From 2979da73cf9267ae11eff566335c28565b67a18e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= <43587190+stef-ladefense@users.noreply.github.com> Date: Tue, 1 Sep 2020 05:27:42 +0200 Subject: [PATCH] Fix Anycubic I3 Mega (S) original screen % display (#19210) --- .../lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp index 1c9b9299f..1de962826 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -28,6 +28,7 @@ #include "../../../../inc/MarlinConfig.h" #include "../../ui_api.h" #include "../../../../MarlinCore.h" // for quickstop_stepper and disable_steppers +#include "../../../../module/motion.h" // for A20 read printing speed feedrate_percentage // command sending macro's with debugging capability #define SEND_PGM(x) send_P(PSTR(x)) @@ -412,6 +413,7 @@ void AnycubicTFTClass::RenderCurrentFileList() { uint16_t selectedNumber = 0; SelectedDirectory[0] = 0; SelectedFile[0] = 0; + ExtUI::FileList currentFileList; SENDLINE_PGM("FN "); // Filelist start @@ -427,7 +429,7 @@ void AnycubicTFTClass::RenderCurrentFileList() { if (SpecialMenu) RenderSpecialMenu(selectedNumber); - else + else if (selectedNumber <= currentFileList.count()) RenderCurrentFolder(selectedNumber); } SENDLINE_PGM("END"); // Filelist stop @@ -804,7 +806,6 @@ void AnycubicTFTClass::GetCommandFromTFT() { break; case 20: { // A20 read printing speed - int16_t feedrate_percentage = 100; if (CodeSeen('S')) feedrate_percentage = constrain(CodeValue(), 40, 999);