Procházet zdrojové kódy

Cleanups for leveling-related code

Scott Lahteine před 6 roky
rodič
revize
44fa7fb18c

+ 1
- 0
Marlin/src/feature/bedlevel/abl/abl.cpp Zobrazit soubor

@@ -25,6 +25,7 @@
25 25
 #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
26 26
 
27 27
 #include "abl.h"
28
+#include "../bedlevel.h"
28 29
 
29 30
 #include "../../../module/motion.h"
30 31
 

+ 16
- 20
Marlin/src/feature/bedlevel/abl/abl.h Zobrazit soubor

@@ -21,27 +21,23 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
-#include "../../../inc/MarlinConfig.h"
24
+#include "../../../inc/MarlinConfigPre.h"
25 25
 
26
-#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
26
+extern int bilinear_grid_spacing[2], bilinear_start[2];
27
+extern float bilinear_grid_factor[2],
28
+             z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
29
+float bilinear_z_offset(const float raw[XYZ]);
27 30
 
28
-  #include "../bedlevel.h"
31
+void extrapolate_unprobed_bed_level();
32
+void print_bilinear_leveling_grid();
33
+void refresh_bed_level();
34
+#if ENABLED(ABL_BILINEAR_SUBDIVISION)
35
+  void print_bilinear_leveling_grid_virt();
36
+  void bed_level_virt_interpolate();
37
+#endif
29 38
 
30
-  extern int bilinear_grid_spacing[2], bilinear_start[2];
31
-  extern float bilinear_grid_factor[2],
32
-               z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
33
-  float bilinear_z_offset(const float raw[XYZ]);
39
+#if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES)
40
+  void bilinear_line_to_destination(const float fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF);
41
+#endif
34 42
 
35
-  void extrapolate_unprobed_bed_level();
36
-  void print_bilinear_leveling_grid();
37
-  void refresh_bed_level();
38
-  #if ENABLED(ABL_BILINEAR_SUBDIVISION)
39
-    void print_bilinear_leveling_grid_virt();
40
-    void bed_level_virt_interpolate();
41
-  #endif
42
-
43
-  #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES)
44
-    void bilinear_line_to_destination(const float fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF);
45
-  #endif
46
-
47
-#endif // AUTO_BED_LEVELING_BILINEAR
43
+#define Z_VALUES(X,Y) z_values[X][Y]

+ 1
- 1
Marlin/src/feature/bedlevel/bedlevel.h Zobrazit soubor

@@ -80,6 +80,6 @@ void reset_bed_level();
80 80
   #include "mbl/mesh_bed_leveling.h"
81 81
 #elif ENABLED(AUTO_BED_LEVELING_UBL)
82 82
   #include "ubl/ubl.h"
83
-#elif HAS_ABL
83
+#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
84 84
   #include "abl/abl.h"
85 85
 #endif

+ 2
- 0
Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h Zobrazit soubor

@@ -118,3 +118,5 @@ public:
118 118
 };
119 119
 
120 120
 extern mesh_bed_leveling mbl;
121
+
122
+#define Z_VALUES(X,Y) mbl.z_values[X][Y]

+ 2
- 0
Marlin/src/feature/bedlevel/ubl/ubl.h Zobrazit soubor

@@ -370,3 +370,5 @@ class unified_bed_leveling {
370 370
 }; // class unified_bed_leveling
371 371
 
372 372
 extern unified_bed_leveling ubl;
373
+
374
+#define Z_VALUES(X,Y) ubl.z_values[X][Y]

+ 0
- 6
Marlin/src/gcode/bedlevel/M420.cpp Zobrazit soubor

@@ -105,12 +105,6 @@ void GcodeSuite::M420() {
105 105
 
106 106
   #if HAS_MESH
107 107
 
108
-    #if ENABLED(MESH_BED_LEVELING)
109
-      #define Z_VALUES(X,Y) mbl.z_values[X][Y]
110
-    #else
111
-      #define Z_VALUES(X,Y) z_values[X][Y]
112
-    #endif
113
-
114 108
     // Subtract the given value or the mean from all mesh values
115 109
     if (leveling_is_valid() && parser.seen('C')) {
116 110
       const float cval = parser.value_float();

+ 8
- 4
Marlin/src/inc/Conditionals_LCD.h Zobrazit soubor

@@ -19,15 +19,13 @@
19 19
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 20
  *
21 21
  */
22
+#pragma once
22 23
 
23 24
 /**
24 25
  * Conditionals_LCD.h
25 26
  * Conditionals that need to be set before Configuration_adv.h or pins.h
26 27
  */
27 28
 
28
-#ifndef CONDITIONALS_LCD_H // Get the LCD defines which are needed first
29
-#define CONDITIONALS_LCD_H
30
-
31 29
 #define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT))
32 30
 
33 31
 #if ENABLED(CARTESIO_UI)
@@ -557,6 +555,10 @@
557 555
 
558 556
 #define HOMING_Z_WITH_PROBE (HAS_BED_PROBE && Z_HOME_DIR < 0 && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN))
559 557
 
558
+#ifdef GRID_MAX_POINTS_X
559
+  #define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y))
560
+#endif
561
+
560 562
 #define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS))
561 563
 #define HAS_RESUME_CONTINUE (ENABLED(EXTENSIBLE_UI) || ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER))
562 564
 #define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED))
@@ -566,4 +568,6 @@
566 568
 #define Z_MULTI_STEPPER_DRIVERS (ENABLED(Z_DUAL_STEPPER_DRIVERS) || ENABLED(Z_TRIPLE_STEPPER_DRIVERS))
567 569
 #define Z_MULTI_ENDSTOPS (ENABLED(Z_DUAL_ENDSTOPS) || ENABLED(Z_TRIPLE_ENDSTOPS))
568 570
 
569
-#endif // CONDITIONALS_LCD_H
571
+#define IS_SCARA     (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA))
572
+#define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA)
573
+#define IS_CARTESIAN !IS_KINEMATIC

+ 0
- 7
Marlin/src/inc/Conditionals_post.h Zobrazit soubor

@@ -43,10 +43,6 @@
43 43
   #define NOT_A_PIN 0 // For PINS_DEBUGGING
44 44
 #endif
45 45
 
46
-#define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA))
47
-#define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA)
48
-#define IS_CARTESIAN !IS_KINEMATIC
49
-
50 46
 #define HAS_CLASSIC_JERK (IS_KINEMATIC || DISABLED(JUNCTION_DEVIATION))
51 47
 
52 48
 /**
@@ -1538,9 +1534,6 @@
1538 1534
   #define LCD_TIMEOUT_TO_STATUS 15000
1539 1535
 #endif
1540 1536
 
1541
-// Shorthand
1542
-#define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y))
1543
-
1544 1537
 // Add commands that need sub-codes to this list
1545 1538
 #define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET) || ENABLED(CNC_COORDINATE_SYSTEMS) || ENABLED(POWER_LOSS_RECOVERY)
1546 1539
 

+ 0
- 2
Marlin/src/lcd/ultralcd.h Zobrazit soubor

@@ -320,8 +320,6 @@
320 320
     #if ENABLED(AUTO_BED_LEVELING_UBL)
321 321
       void lcd_mesh_edit_setup(const float &initial);
322 322
       float lcd_mesh_edit();
323
-      void lcd_z_offset_edit_setup(const float &initial);
324
-      float lcd_z_offset_edit();
325 323
     #endif
326 324
 
327 325
     #if ENABLED(SCROLL_LONG_FILENAMES)

Loading…
Zrušit
Uložit