Browse Source

Merge pull request #5140 from esenapaj/Follow-up-the-PR-#5089

Follow-up the PR #5089 (Centralize click-handling in the LCD loop)
Scott Lahteine 8 years ago
parent
commit
1ee0fdcad7
1 changed files with 10 additions and 10 deletions
  1. 10
    10
      Marlin/ultralcd.cpp

+ 10
- 10
Marlin/ultralcd.cpp View File

416
     }
416
     }
417
   }
417
   }
418
 
418
 
419
-  static void lcd_goto_previous_menu(bool feedback=false) {
419
+  static void lcd_goto_previous_menu() {
420
     if (screen_history_depth > 0) {
420
     if (screen_history_depth > 0) {
421
       --screen_history_depth;
421
       --screen_history_depth;
422
       lcd_goto_screen(
422
       lcd_goto_screen(
648
     long babysteps_done = 0;
648
     long babysteps_done = 0;
649
 
649
 
650
     static void _lcd_babystep(const AxisEnum axis, const char* msg) {
650
     static void _lcd_babystep(const AxisEnum axis, const char* msg) {
651
-      if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(true); }
651
+      if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(); }
652
       ENCODER_DIRECTION_NORMAL();
652
       ENCODER_DIRECTION_NORMAL();
653
       if (encoderPosition) {
653
       if (encoderPosition) {
654
         int babystep_increment = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
654
         int babystep_increment = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
1357
    */
1357
    */
1358
 
1358
 
1359
   static void _lcd_move_xyz(const char* name, AxisEnum axis) {
1359
   static void _lcd_move_xyz(const char* name, AxisEnum axis) {
1360
-    if (lcd_clicked) { return lcd_goto_previous_menu(true); }
1360
+    if (lcd_clicked) { return lcd_goto_previous_menu(); }
1361
     ENCODER_DIRECTION_NORMAL();
1361
     ENCODER_DIRECTION_NORMAL();
1362
     if (encoderPosition) {
1362
     if (encoderPosition) {
1363
       refresh_cmd_timeout();
1363
       refresh_cmd_timeout();
1397
       int8_t eindex=-1
1397
       int8_t eindex=-1
1398
     #endif
1398
     #endif
1399
   ) {
1399
   ) {
1400
-    if (lcd_clicked) { return lcd_goto_previous_menu(true); }
1400
+    if (lcd_clicked) { return lcd_goto_previous_menu(); }
1401
     ENCODER_DIRECTION_NORMAL();
1401
     ENCODER_DIRECTION_NORMAL();
1402
     if (encoderPosition) {
1402
     if (encoderPosition) {
1403
       current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale;
1403
       current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale;
1884
    */
1884
    */
1885
   #if HAS_LCD_CONTRAST
1885
   #if HAS_LCD_CONTRAST
1886
     static void lcd_set_contrast() {
1886
     static void lcd_set_contrast() {
1887
-      if (lcd_clicked) { return lcd_goto_previous_menu(true); }
1887
+      if (lcd_clicked) { return lcd_goto_previous_menu(); }
1888
       ENCODER_DIRECTION_NORMAL();
1888
       ENCODER_DIRECTION_NORMAL();
1889
       if (encoderPosition) {
1889
       if (encoderPosition) {
1890
         set_lcd_contrast(lcd_contrast + encoderPosition);
1890
         set_lcd_contrast(lcd_contrast + encoderPosition);
1997
        *
1997
        *
1998
        */
1998
        */
1999
       static void lcd_info_stats_menu() {
1999
       static void lcd_info_stats_menu() {
2000
-        if (lcd_clicked) { return lcd_goto_previous_menu(true); }
2000
+        if (lcd_clicked) { return lcd_goto_previous_menu(); }
2001
 
2001
 
2002
         char buffer[21];
2002
         char buffer[21];
2003
         printStatistics stats = print_job_timer.getStats();
2003
         printStatistics stats = print_job_timer.getStats();
2031
      *
2031
      *
2032
      */
2032
      */
2033
     static void lcd_info_thermistors_menu() {
2033
     static void lcd_info_thermistors_menu() {
2034
-      if (lcd_clicked) { return lcd_goto_previous_menu(true); }
2034
+      if (lcd_clicked) { return lcd_goto_previous_menu(); }
2035
       START_SCREEN();
2035
       START_SCREEN();
2036
       #define THERMISTOR_ID TEMP_SENSOR_0
2036
       #define THERMISTOR_ID TEMP_SENSOR_0
2037
       #include "thermistornames.h"
2037
       #include "thermistornames.h"
2083
      *
2083
      *
2084
      */
2084
      */
2085
     static void lcd_info_board_menu() {
2085
     static void lcd_info_board_menu() {
2086
-      if (lcd_clicked) { return lcd_goto_previous_menu(true); }
2086
+      if (lcd_clicked) { return lcd_goto_previous_menu(); }
2087
       START_SCREEN();
2087
       START_SCREEN();
2088
       STATIC_ITEM(BOARD_NAME, true, true);                           // MyPrinterController
2088
       STATIC_ITEM(BOARD_NAME, true, true);                           // MyPrinterController
2089
       STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000
2089
       STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000
2104
      *
2104
      *
2105
      */
2105
      */
2106
     static void lcd_info_printer_menu() {
2106
     static void lcd_info_printer_menu() {
2107
-      if (lcd_clicked) { return lcd_goto_previous_menu(true); }
2107
+      if (lcd_clicked) { return lcd_goto_previous_menu(); }
2108
       START_SCREEN();
2108
       START_SCREEN();
2109
       STATIC_ITEM(MSG_MARLIN, true, true);                             // Marlin
2109
       STATIC_ITEM(MSG_MARLIN, true, true);                             // Marlin
2110
       STATIC_ITEM(SHORT_BUILD_VERSION, true);                          // x.x.x-Branch
2110
       STATIC_ITEM(SHORT_BUILD_VERSION, true);                          // x.x.x-Branch
2300
         lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \
2300
         lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \
2301
       if (lcd_clicked) { \
2301
       if (lcd_clicked) { \
2302
         *((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \
2302
         *((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \
2303
-        lcd_goto_previous_menu(true); \
2303
+        lcd_goto_previous_menu(); \
2304
       } \
2304
       } \
2305
       return lcd_clicked; \
2305
       return lcd_clicked; \
2306
     } \
2306
     } \

Loading…
Cancel
Save