Browse Source

Fix Anycubic I3 Mega (S) original screen % display (#19210)

Stéphane 4 years ago
parent
commit
2979da73cf
No account linked to committer's email address

+ 3
- 2
Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp View File

28
 #include "../../../../inc/MarlinConfig.h"
28
 #include "../../../../inc/MarlinConfig.h"
29
 #include "../../ui_api.h"
29
 #include "../../ui_api.h"
30
 #include "../../../../MarlinCore.h" // for quickstop_stepper and disable_steppers
30
 #include "../../../../MarlinCore.h" // for quickstop_stepper and disable_steppers
31
+#include "../../../../module/motion.h"	// for A20 read printing speed feedrate_percentage
31
 
32
 
32
 // command sending macro's with debugging capability
33
 // command sending macro's with debugging capability
33
 #define SEND_PGM(x)                                 send_P(PSTR(x))
34
 #define SEND_PGM(x)                                 send_P(PSTR(x))
412
     uint16_t selectedNumber = 0;
413
     uint16_t selectedNumber = 0;
413
     SelectedDirectory[0] = 0;
414
     SelectedDirectory[0] = 0;
414
     SelectedFile[0] = 0;
415
     SelectedFile[0] = 0;
416
+    ExtUI::FileList currentFileList;                                 
415
 
417
 
416
     SENDLINE_PGM("FN "); // Filelist start
418
     SENDLINE_PGM("FN "); // Filelist start
417
 
419
 
427
 
429
 
428
       if (SpecialMenu)
430
       if (SpecialMenu)
429
         RenderSpecialMenu(selectedNumber);
431
         RenderSpecialMenu(selectedNumber);
430
-      else
432
+      else if (selectedNumber <= currentFileList.count())
431
         RenderCurrentFolder(selectedNumber);
433
         RenderCurrentFolder(selectedNumber);
432
     }
434
     }
433
     SENDLINE_PGM("END"); // Filelist stop
435
     SENDLINE_PGM("END"); // Filelist stop
804
             break;
806
             break;
805
 
807
 
806
           case 20: { // A20 read printing speed
808
           case 20: { // A20 read printing speed
807
-            int16_t feedrate_percentage = 100;
808
 
809
 
809
             if (CodeSeen('S'))
810
             if (CodeSeen('S'))
810
               feedrate_percentage = constrain(CodeValue(), 40, 999);
811
               feedrate_percentage = constrain(CodeValue(), 40, 999);

Loading…
Cancel
Save