Sfoglia il codice sorgente

Move lcd_map_control to UBL

For parity with bugfix-2.0.x
Scott Lahteine 6 anni fa
parent
commit
99b71c1dde
7 ha cambiato i file con 23 aggiunte e 17 eliminazioni
  1. 2
    2
      Marlin/Marlin_main.cpp
  2. 5
    5
      Marlin/stepper.cpp
  3. 4
    0
      Marlin/ubl.cpp
  4. 7
    3
      Marlin/ubl.h
  5. 2
    2
      Marlin/ubl_G29.cpp
  6. 3
    4
      Marlin/ultralcd.cpp
  7. 0
    1
      Marlin/ultralcd.h

+ 2
- 2
Marlin/Marlin_main.cpp Vedi File

@@ -8414,7 +8414,7 @@ inline void gcode_M18_M84() {
8414 8414
     }
8415 8415
 
8416 8416
     #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)  // Only needed with an LCD
8417
-      ubl_lcd_map_control = defer_return_to_status = false;
8417
+      ubl.lcd_map_control = defer_return_to_status = false;
8418 8418
     #endif
8419 8419
   }
8420 8420
 }
@@ -13483,7 +13483,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
13483 13483
       disable_e_steppers();
13484 13484
     #endif
13485 13485
     #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)  // Only needed with an LCD
13486
-      ubl_lcd_map_control = defer_return_to_status = false;
13486
+      ubl.lcd_map_control = defer_return_to_status = false;
13487 13487
     #endif
13488 13488
   }
13489 13489
 

+ 5
- 5
Marlin/stepper.cpp Vedi File

@@ -54,6 +54,10 @@
54 54
 #include "cardreader.h"
55 55
 #include "speed_lookuptable.h"
56 56
 
57
+#if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL)
58
+  #include "ubl.h"
59
+#endif
60
+
57 61
 #if HAS_DIGIPOTSS
58 62
   #include <SPI.h>
59 63
 #endif
@@ -62,10 +66,6 @@ Stepper stepper; // Singleton
62 66
 
63 67
 // public:
64 68
 
65
-#if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL)
66
-  extern bool ubl_lcd_map_control;
67
-#endif
68
-
69 69
 block_t* Stepper::current_block = NULL;  // A pointer to the block currently being traced
70 70
 
71 71
 #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
@@ -1224,7 +1224,7 @@ void Stepper::finish_and_disable() {
1224 1224
 
1225 1225
 void Stepper::quick_stop() {
1226 1226
   #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL)
1227
-    if (!ubl_lcd_map_control)
1227
+    if (!ubl.lcd_map_control)
1228 1228
       cleaning_buffer_counter = 5000;
1229 1229
   #else
1230 1230
     cleaning_buffer_counter = 5000;

+ 4
- 0
Marlin/ubl.cpp Vedi File

@@ -73,6 +73,10 @@
73 73
   bool unified_bed_leveling::g26_debug_flag = false,
74 74
        unified_bed_leveling::has_control_of_lcd_panel = false;
75 75
 
76
+  #if ENABLED(ULTIPANEL)
77
+    bool unified_bed_leveling::lcd_map_control = false;
78
+  #endif
79
+
76 80
   volatile int unified_bed_leveling::encoder_diff;
77 81
 
78 82
   unified_bed_leveling::unified_bed_leveling() {

+ 7
- 3
Marlin/ubl.h Vedi File

@@ -46,9 +46,9 @@
46 46
 
47 47
   // ubl.cpp
48 48
 
49
-void bit_clear(uint16_t bits[16], const uint8_t x, const uint8_t y);
50
-void bit_set(uint16_t bits[16], const uint8_t x, const uint8_t y);
51
-bool is_bit_set(uint16_t bits[16], const uint8_t x, const uint8_t y);
49
+  void bit_clear(uint16_t bits[16], const uint8_t x, const uint8_t y);
50
+  void bit_set(uint16_t bits[16], const uint8_t x, const uint8_t y);
51
+  bool is_bit_set(uint16_t bits[16], const uint8_t x, const uint8_t y);
52 52
 
53 53
   // ubl_motion.cpp
54 54
 
@@ -191,6 +191,10 @@ bool is_bit_set(uint16_t bits[16], const uint8_t x, const uint8_t y);
191 191
 
192 192
       static bool g26_debug_flag, has_control_of_lcd_panel;
193 193
 
194
+      #if ENABLED(ULTIPANEL)
195
+        static bool lcd_map_control;
196
+      #endif
197
+
194 198
       static volatile int encoder_diff; // Volatile because it's changed at interrupt time.
195 199
 
196 200
       unified_bed_leveling();

+ 2
- 2
Marlin/ubl_G29.cpp Vedi File

@@ -1526,7 +1526,7 @@
1526 1526
           idle();
1527 1527
         } while (!ubl_lcd_clicked());
1528 1528
 
1529
-        if (!ubl_lcd_map_control) lcd_return_to_status();
1529
+        if (!lcd_map_control) lcd_return_to_status();
1530 1530
 
1531 1531
         // The technique used here generates a race condition for the encoder click.
1532 1532
         // It could get detected in lcd_mesh_edit (actually _lcd_mesh_fine_tune) or here.
@@ -1571,7 +1571,7 @@
1571 1571
       LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH);
1572 1572
       SERIAL_ECHOLNPGM("Done Editing Mesh");
1573 1573
 
1574
-      if (ubl_lcd_map_control)
1574
+      if (lcd_map_control)
1575 1575
         lcd_goto_screen(_lcd_ubl_output_map_lcd);
1576 1576
       else
1577 1577
         lcd_return_to_status();

+ 3
- 4
Marlin/ultralcd.cpp Vedi File

@@ -50,7 +50,6 @@
50 50
 
51 51
 #if ENABLED(AUTO_BED_LEVELING_UBL)
52 52
   #include "ubl.h"
53
-  bool ubl_lcd_map_control = false;
54 53
 #elif HAS_ABL
55 54
   #include "planner.h"
56 55
 #elif ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING)
@@ -514,14 +513,14 @@ uint16_t max_display_update_time = 0;
514 513
       if (screen == lcd_status_screen) {
515 514
         defer_return_to_status = false;
516 515
         #if ENABLED(AUTO_BED_LEVELING_UBL)
517
-          ubl_lcd_map_control = false;
516
+          ubl.lcd_map_control = false;
518 517
         #endif
519 518
         screen_history_depth = 0;
520 519
       }
521 520
       lcd_implementation_clear();
522 521
       // Re-initialize custom characters that may be re-used
523 522
       #if DISABLED(DOGLCD) && ENABLED(AUTO_BED_LEVELING_UBL)
524
-        if (!ubl_lcd_map_control) {
523
+        if (!ubl.lcd_map_control) {
525 524
           lcd_set_custom_characters(
526 525
             #if ENABLED(LCD_PROGRESS_BAR)
527 526
               screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU
@@ -2358,7 +2357,7 @@ void kill_screen(const char* lcd_msg) {
2358 2357
 
2359 2358
     void _lcd_ubl_map_homing() {
2360 2359
       defer_return_to_status = true;
2361
-      ubl_lcd_map_control = true; // Return to the map screen
2360
+      ubl.lcd_map_control = true; // Return to the map screen
2362 2361
       if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT < 3 ? 0 : (LCD_HEIGHT > 4 ? 2 : 1), PSTR(MSG_LEVEL_BED_HOMING));
2363 2362
       lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW;
2364 2363
       if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])

+ 0
- 1
Marlin/ultralcd.h Vedi File

@@ -193,7 +193,6 @@
193 193
 void lcd_reset_status();
194 194
 
195 195
 #if ENABLED(AUTO_BED_LEVELING_UBL)
196
-  extern bool ubl_lcd_map_control;
197 196
   void lcd_mesh_edit_setup(float initial);
198 197
   float lcd_mesh_edit();
199 198
   void lcd_z_offset_edit_setup(float);

Loading…
Annulla
Salva