Skip to content

Commit 2979da7

Browse files
Fix Anycubic I3 Mega (S) original screen % display (MarlinFirmware#19210)
1 parent d3ac4ba commit 2979da7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "../../../../inc/MarlinConfig.h"
2929
#include "../../ui_api.h"
3030
#include "../../../../MarlinCore.h" // for quickstop_stepper and disable_steppers
31+
#include "../../../../module/motion.h" // for A20 read printing speed feedrate_percentage
3132

3233
// command sending macro's with debugging capability
3334
#define SEND_PGM(x) send_P(PSTR(x))
@@ -412,6 +413,7 @@ void AnycubicTFTClass::RenderCurrentFileList() {
412413
uint16_t selectedNumber = 0;
413414
SelectedDirectory[0] = 0;
414415
SelectedFile[0] = 0;
416+
ExtUI::FileList currentFileList;
415417

416418
SENDLINE_PGM("FN "); // Filelist start
417419

@@ -427,7 +429,7 @@ void AnycubicTFTClass::RenderCurrentFileList() {
427429

428430
if (SpecialMenu)
429431
RenderSpecialMenu(selectedNumber);
430-
else
432+
else if (selectedNumber <= currentFileList.count())
431433
RenderCurrentFolder(selectedNumber);
432434
}
433435
SENDLINE_PGM("END"); // Filelist stop
@@ -804,7 +806,6 @@ void AnycubicTFTClass::GetCommandFromTFT() {
804806
break;
805807

806808
case 20: { // A20 read printing speed
807-
int16_t feedrate_percentage = 100;
808809

809810
if (CodeSeen('S'))
810811
feedrate_percentage = constrain(CodeValue(), 40, 999);

0 commit comments

Comments
 (0)