浏览代码

Changes for ubl_lcd_map_control patch

Scott Lahteine 8 年前
父节点
当前提交
f17bae1f70
共有 4 个文件被更改,包括 17 次插入22 次删除
  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 查看文件

333
 #if ENABLED(AUTO_BED_LEVELING_UBL)
333
 #if ENABLED(AUTO_BED_LEVELING_UBL)
334
   #include "ubl.h"
334
   #include "ubl.h"
335
   extern bool defer_return_to_status;
335
   extern bool defer_return_to_status;
336
-  extern bool ubl_lcd_map_control;
337
   unified_bed_leveling ubl;
336
   unified_bed_leveling ubl;
338
   #define UBL_MESH_VALID !( ( ubl.z_values[0][0] == ubl.z_values[0][1] && ubl.z_values[0][1] == ubl.z_values[0][2] \
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
                            && ubl.z_values[1][0] == ubl.z_values[1][1] && ubl.z_values[1][1] == ubl.z_values[1][2] \
338
                            && ubl.z_values[1][0] == ubl.z_values[1][1] && ubl.z_values[1][1] == ubl.z_values[1][2] \
7742
       #endif
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
     #endif
7746
     #endif
7749
-
7750
   }
7747
   }
7751
 }
7748
 }
7752
 
7749
 
12637
     #if ENABLED(DISABLE_INACTIVE_E)
12634
     #if ENABLED(DISABLE_INACTIVE_E)
12638
       disable_e_steppers();
12635
       disable_e_steppers();
12639
     #endif
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
     #endif
12639
     #endif
12644
   }
12640
   }
12645
 
12641
 

+ 2
- 2
Marlin/ubl_G29.cpp 查看文件

54
   extern float probe_pt(const float &x, const float &y, bool, int);
54
   extern float probe_pt(const float &x, const float &y, bool, int);
55
   extern bool set_probe_deployed(bool);
55
   extern bool set_probe_deployed(bool);
56
   extern void set_bed_leveling_enabled(bool);
56
   extern void set_bed_leveling_enabled(bool);
57
-  extern bool ubl_lcd_map_control;
58
   typedef void (*screenFunc_t)();
57
   typedef void (*screenFunc_t)();
59
   extern void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0);
58
   extern void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0);
60
 
59
 
1569
 
1568
 
1570
       if (ubl_lcd_map_control)
1569
       if (ubl_lcd_map_control)
1571
         lcd_goto_screen(_lcd_ubl_output_map_lcd);
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
   #endif // NEWPANEL
1575
   #endif // NEWPANEL

+ 10
- 12
Marlin/ultralcd.cpp 查看文件

470
         screen_history_depth = 0;
470
         screen_history_depth = 0;
471
       }
471
       }
472
       lcd_implementation_clear();
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
         lcd_set_custom_characters(screen == lcd_status_screen);
481
         lcd_set_custom_characters(screen == lcd_status_screen);
476
       #endif
482
       #endif
477
       lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
483
       lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
547
 
553
 
548
 void lcd_status_screen() {
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
   #if ENABLED(ULTIPANEL)
556
   #if ENABLED(ULTIPANEL)
560
     ENCODER_DIRECTION_NORMAL();
557
     ENCODER_DIRECTION_NORMAL();
561
     ENCODER_RATE_MULTIPLY(false);
558
     ENCODER_RATE_MULTIPLY(false);
2151
     void _lcd_ubl_output_map_lcd();
2148
     void _lcd_ubl_output_map_lcd();
2152
 
2149
 
2153
     void _lcd_ubl_map_homing() {
2150
     void _lcd_ubl_map_homing() {
2151
+      defer_return_to_status = true;
2154
       if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL);
2152
       if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL);
2155
       lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW;
2153
       lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW;
2156
       if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) {
2154
       if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) {
2260
      * UBL Homing before LCD map
2258
      * UBL Homing before LCD map
2261
      */
2259
      */
2262
     void _lcd_ubl_output_map_lcd_cmd() {
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
       if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]))
2262
       if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]))
2265
         enqueue_and_echo_commands_P(PSTR("G28"));
2263
         enqueue_and_echo_commands_P(PSTR("G28"));
2266
       lcd_goto_screen(_lcd_ubl_map_homing);
2264
       lcd_goto_screen(_lcd_ubl_map_homing);

+ 1
- 0
Marlin/ultralcd.h 查看文件

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

正在加载...
取消
保存