Parcourir la source

Don't draw current screen if simply changing screens

Scott Lahteine il y a 8 ans
Parent
révision
d17b161832
1 fichiers modifiés avec 10 ajouts et 9 suppressions
  1. 10
    9
      Marlin/ultralcd.cpp

+ 10
- 9
Marlin/ultralcd.cpp Voir le fichier

@@ -677,6 +677,7 @@ void kill_screen(const char* lcd_msg) {
677 677
     long babysteps_done = 0;
678 678
 
679 679
     static void _lcd_babystep(const AxisEnum axis, const char* msg) {
680
+      if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
680 681
       ENCODER_DIRECTION_NORMAL();
681 682
       if (encoderPosition) {
682 683
         int babystep_increment = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
@@ -689,7 +690,6 @@ void kill_screen(const char* lcd_msg) {
689 690
         lcd_implementation_drawedit(msg, ftostr43sign(
690 691
           ((1000 * babysteps_done) / planner.axis_steps_per_mm[axis]) * 0.001f
691 692
         ));
692
-      if (LCD_CLICKED) lcd_goto_previous_menu(true);
693 693
     }
694 694
 
695 695
     #if ENABLED(BABYSTEP_XY)
@@ -1344,6 +1344,7 @@ void kill_screen(const char* lcd_msg) {
1344 1344
   float move_menu_scale;
1345 1345
 
1346 1346
   static void _lcd_move_xyz(const char* name, AxisEnum axis, float min, float max) {
1347
+    if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
1347 1348
     ENCODER_DIRECTION_NORMAL();
1348 1349
     if (encoderPosition) {
1349 1350
       refresh_cmd_timeout();
@@ -1355,7 +1356,6 @@ void kill_screen(const char* lcd_msg) {
1355 1356
       lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
1356 1357
     }
1357 1358
     if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr41sign(current_position[axis]));
1358
-    if (LCD_CLICKED) lcd_goto_previous_menu(true);
1359 1359
   }
1360 1360
   #if ENABLED(DELTA)
1361 1361
     static float delta_clip_radius_2 =  (DELTA_PRINTABLE_RADIUS) * (DELTA_PRINTABLE_RADIUS);
@@ -1372,6 +1372,7 @@ void kill_screen(const char* lcd_msg) {
1372 1372
       int8_t eindex = -1
1373 1373
     #endif
1374 1374
   ) {
1375
+    if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
1375 1376
     ENCODER_DIRECTION_NORMAL();
1376 1377
     if (encoderPosition) {
1377 1378
       current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale;
@@ -1401,7 +1402,6 @@ void kill_screen(const char* lcd_msg) {
1401 1402
       #endif //EXTRUDERS > 1
1402 1403
       lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS]));
1403 1404
     }
1404
-    if (LCD_CLICKED) lcd_goto_previous_menu(true);
1405 1405
   }
1406 1406
 
1407 1407
   #if EXTRUDERS > 1
@@ -1860,6 +1860,7 @@ void kill_screen(const char* lcd_msg) {
1860 1860
    */
1861 1861
   #if HAS_LCD_CONTRAST
1862 1862
     static void lcd_set_contrast() {
1863
+      if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
1863 1864
       ENCODER_DIRECTION_NORMAL();
1864 1865
       if (encoderPosition) {
1865 1866
         set_lcd_contrast(lcd_contrast + encoderPosition);
@@ -1875,7 +1876,6 @@ void kill_screen(const char* lcd_msg) {
1875 1876
           #endif
1876 1877
         );
1877 1878
       }
1878
-      if (LCD_CLICKED) lcd_goto_previous_menu(true);
1879 1879
     }
1880 1880
   #endif // HAS_LCD_CONTRAST
1881 1881
 
@@ -1967,10 +1967,12 @@ void kill_screen(const char* lcd_msg) {
1967 1967
     #if ENABLED(PRINTCOUNTER)
1968 1968
       /**
1969 1969
        *
1970
-       * About Printer > Stastics submenu
1970
+       * About Printer > Statistics submenu
1971 1971
        *
1972 1972
        */
1973 1973
       static void lcd_info_stats_menu() {
1974
+        if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
1975
+
1974 1976
         PrintCounter print_job_counter = PrintCounter();
1975 1977
         print_job_counter.loadStats();
1976 1978
         printStatistics stats = print_job_counter.getStats();
@@ -1978,7 +1980,6 @@ void kill_screen(const char* lcd_msg) {
1978 1980
         char printTime[6];
1979 1981
         sprintf(printTime, "%02d:%02d", int(stats.printTime / 60), int(stats.printTime % 60));
1980 1982
 
1981
-        if (LCD_CLICKED) lcd_goto_previous_menu(true);
1982 1983
         START_SCREEN();
1983 1984
         STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints));        // Print Count : 999
1984 1985
         STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": ", false, false, itostr3left(stats.finishedPrints)); // Finished    : 666
@@ -1993,7 +1994,7 @@ void kill_screen(const char* lcd_msg) {
1993 1994
      *
1994 1995
      */
1995 1996
     static void lcd_info_thermistors_menu() {
1996
-      if (LCD_CLICKED) lcd_goto_previous_menu(true);
1997
+      if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
1997 1998
       START_SCREEN();
1998 1999
       #define THERMISTOR_ID TEMP_SENSOR_0
1999 2000
       #include "thermistornames.h"
@@ -2045,7 +2046,7 @@ void kill_screen(const char* lcd_msg) {
2045 2046
      *
2046 2047
      */
2047 2048
     static void lcd_info_board_menu() {
2048
-      if (LCD_CLICKED) lcd_goto_previous_menu(true);
2049
+      if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
2049 2050
       START_SCREEN();
2050 2051
       STATIC_ITEM(BOARD_NAME, true, true);                     // MyPrinterController
2051 2052
       STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE)); // Baud: 250000
@@ -2066,7 +2067,7 @@ void kill_screen(const char* lcd_msg) {
2066 2067
      *
2067 2068
      */
2068 2069
     static void lcd_info_printer_menu() {
2069
-      if (LCD_CLICKED) lcd_goto_previous_menu(true);
2070
+      if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
2070 2071
       START_SCREEN();
2071 2072
       STATIC_ITEM(MSG_MARLIN, true, true);                       // Marlin
2072 2073
       STATIC_ITEM(SHORT_BUILD_VERSION);                          // x.x.x-Branch

Chargement…
Annuler
Enregistrer