Browse Source

Don't draw current screen if simply changing screens

Scott Lahteine 8 years ago
parent
commit
d17b161832
1 changed files with 10 additions and 9 deletions
  1. 10
    9
      Marlin/ultralcd.cpp

+ 10
- 9
Marlin/ultralcd.cpp View File

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

Loading…
Cancel
Save