Browse Source

Changes for ubl_lcd_map_control patch

Scott Lahteine 7 years ago
parent
commit
f17bae1f70
4 changed files with 17 additions and 22 deletions
  1. 4
    8
      Marlin/Marlin_main.cpp
  2. 2
    2
      Marlin/ubl_G29.cpp
  3. 10
    12
      Marlin/ultralcd.cpp
  4. 1
    0
      Marlin/ultralcd.h

+ 4
- 8
Marlin/Marlin_main.cpp View File

@@ -333,7 +333,6 @@
333 333
 #if ENABLED(AUTO_BED_LEVELING_UBL)
334 334
   #include "ubl.h"
335 335
   extern bool defer_return_to_status;
336
-  extern bool ubl_lcd_map_control;
337 336
   unified_bed_leveling ubl;
338 337
   #define UBL_MESH_VALID !( ( ubl.z_values[0][0] == ubl.z_values[0][1] && ubl.z_values[0][1] == ubl.z_values[0][2] \
339 338
                            && ubl.z_values[1][0] == ubl.z_values[1][1] && ubl.z_values[1][1] == ubl.z_values[1][2] \
@@ -7742,11 +7741,9 @@ inline void gcode_M18_M84() {
7742 7741
       #endif
7743 7742
     }
7744 7743
 
7745
-    #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)  //only needed if have an LCD
7746
-      ubl_lcd_map_control = false;
7747
-      defer_return_to_status = false;
7744
+    #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)  // Only needed with an LCD
7745
+      ubl_lcd_map_control = defer_return_to_status = false;
7748 7746
     #endif
7749
-
7750 7747
   }
7751 7748
 }
7752 7749
 
@@ -12637,9 +12634,8 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
12637 12634
     #if ENABLED(DISABLE_INACTIVE_E)
12638 12635
       disable_e_steppers();
12639 12636
     #endif
12640
-    #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)  //only needed if have an LCD
12641
-      ubl_lcd_map_control = false;
12642
-      defer_return_to_status = false;
12637
+    #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)  // Only needed with an LCD
12638
+      ubl_lcd_map_control = defer_return_to_status = false;
12643 12639
     #endif
12644 12640
   }
12645 12641
 

+ 2
- 2
Marlin/ubl_G29.cpp View File

@@ -54,7 +54,6 @@
54 54
   extern float probe_pt(const float &x, const float &y, bool, int);
55 55
   extern bool set_probe_deployed(bool);
56 56
   extern void set_bed_leveling_enabled(bool);
57
-  extern bool ubl_lcd_map_control;
58 57
   typedef void (*screenFunc_t)();
59 58
   extern void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0);
60 59
 
@@ -1569,7 +1568,8 @@
1569 1568
 
1570 1569
       if (ubl_lcd_map_control)
1571 1570
         lcd_goto_screen(_lcd_ubl_output_map_lcd);
1572
-      else lcd_return_to_status();
1571
+      else
1572
+        lcd_return_to_status();
1573 1573
     }
1574 1574
 
1575 1575
   #endif // NEWPANEL

+ 10
- 12
Marlin/ultralcd.cpp View File

@@ -470,8 +470,14 @@ uint16_t max_display_update_time = 0;
470 470
         screen_history_depth = 0;
471 471
       }
472 472
       lcd_implementation_clear();
473
-      #if ENABLED(LCD_PROGRESS_BAR)
474
-        // For LCD_PROGRESS_BAR re-initialize custom characters
473
+      // Re-initialize custom characters that may be re-used
474
+      #if DISABLED(DOGLCD) && ENABLED(AUTO_BED_LEVELING_UBL)
475
+        if (!ubl_lcd_map_control) lcd_set_custom_characters(
476
+          #if ENABLED(LCD_PROGRESS_BAR)
477
+            screen == lcd_status_screen
478
+          #endif
479
+        );
480
+      #elif ENABLED(LCD_PROGRESS_BAR)
475 481
         lcd_set_custom_characters(screen == lcd_status_screen);
476 482
       #endif
477 483
       lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
@@ -547,15 +553,6 @@ uint16_t max_display_update_time = 0;
547 553
 
548 554
 void lcd_status_screen() {
549 555
 
550
-  #if DISABLED(DOGLCD) && ENABLED(AUTO_BED_LEVELING_UBL)
551
-    if(!ubl_lcd_map_control)
552
-      lcd_set_custom_characters(
553
-       #if ENABLED(LCD_PROGRESS_BAR)
554
-        const bool info_screen_charset = true
555
-       #endif
556
-      );
557
-  #endif
558
-
559 556
   #if ENABLED(ULTIPANEL)
560 557
     ENCODER_DIRECTION_NORMAL();
561 558
     ENCODER_RATE_MULTIPLY(false);
@@ -2151,6 +2148,7 @@ void kill_screen(const char* lcd_msg) {
2151 2148
     void _lcd_ubl_output_map_lcd();
2152 2149
 
2153 2150
     void _lcd_ubl_map_homing() {
2151
+      defer_return_to_status = true;
2154 2152
       if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL);
2155 2153
       lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW;
2156 2154
       if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) {
@@ -2260,7 +2258,7 @@ void kill_screen(const char* lcd_msg) {
2260 2258
      * UBL Homing before LCD map
2261 2259
      */
2262 2260
     void _lcd_ubl_output_map_lcd_cmd() {
2263
-      ubl_lcd_map_control = true; // Used for returning to the map screen
2261
+      ubl_lcd_map_control = true; // Return to the map screen (and don't restore the character set)
2264 2262
       if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]))
2265 2263
         enqueue_and_echo_commands_P(PSTR("G28"));
2266 2264
       lcd_goto_screen(_lcd_ubl_map_homing);

+ 1
- 0
Marlin/ultralcd.h View File

@@ -188,6 +188,7 @@
188 188
 void lcd_reset_status();
189 189
 
190 190
 #if ENABLED(AUTO_BED_LEVELING_UBL)
191
+  extern bool ubl_lcd_map_control;
191 192
   void lcd_mesh_edit_setup(float initial);
192 193
   float lcd_mesh_edit();
193 194
   void lcd_z_offset_edit_setup(float);

Loading…
Cancel
Save