Browse Source

Move lcd_map_control to UBL

For parity with bugfix-2.0.x
Scott Lahteine 7 years ago
parent
commit
99b71c1dde
7 changed files with 23 additions and 17 deletions
  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 View File

8414
     }
8414
     }
8415
 
8415
 
8416
     #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)  // Only needed with an LCD
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
     #endif
8418
     #endif
8419
   }
8419
   }
8420
 }
8420
 }
13483
       disable_e_steppers();
13483
       disable_e_steppers();
13484
     #endif
13484
     #endif
13485
     #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)  // Only needed with an LCD
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
     #endif
13487
     #endif
13488
   }
13488
   }
13489
 
13489
 

+ 5
- 5
Marlin/stepper.cpp View File

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

+ 4
- 0
Marlin/ubl.cpp View File

73
   bool unified_bed_leveling::g26_debug_flag = false,
73
   bool unified_bed_leveling::g26_debug_flag = false,
74
        unified_bed_leveling::has_control_of_lcd_panel = false;
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
   volatile int unified_bed_leveling::encoder_diff;
80
   volatile int unified_bed_leveling::encoder_diff;
77
 
81
 
78
   unified_bed_leveling::unified_bed_leveling() {
82
   unified_bed_leveling::unified_bed_leveling() {

+ 7
- 3
Marlin/ubl.h View File

46
 
46
 
47
   // ubl.cpp
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
   // ubl_motion.cpp
53
   // ubl_motion.cpp
54
 
54
 
191
 
191
 
192
       static bool g26_debug_flag, has_control_of_lcd_panel;
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
       static volatile int encoder_diff; // Volatile because it's changed at interrupt time.
198
       static volatile int encoder_diff; // Volatile because it's changed at interrupt time.
195
 
199
 
196
       unified_bed_leveling();
200
       unified_bed_leveling();

+ 2
- 2
Marlin/ubl_G29.cpp View File

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

+ 3
- 4
Marlin/ultralcd.cpp View File

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

+ 0
- 1
Marlin/ultralcd.h View File

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

Loading…
Cancel
Save