Browse Source

Clean up probe accessors

Scott Lahteine 5 years ago
parent
commit
47c19aa2b3
1 changed files with 25 additions and 19 deletions
  1. 25
    19
      Marlin/src/module/probe.h

+ 25
- 19
Marlin/src/module/probe.h View File

62
 
62
 
63
 #if HAS_BED_PROBE || ENABLED(PROBE_MANUALLY)
63
 #if HAS_BED_PROBE || ENABLED(PROBE_MANUALLY)
64
   #if IS_KINEMATIC
64
   #if IS_KINEMATIC
65
-    constexpr float printable_radius =
65
+    constexpr float printable_radius = (
66
       #if ENABLED(DELTA)
66
       #if ENABLED(DELTA)
67
-        DELTA_PRINTABLE_RADIUS;
67
+        DELTA_PRINTABLE_RADIUS
68
       #elif IS_SCARA
68
       #elif IS_SCARA
69
-        SCARA_PRINTABLE_RADIUS;
69
+        SCARA_PRINTABLE_RADIUS
70
       #endif
70
       #endif
71
-    
71
+    );
72
+
72
     inline float probe_radius() {
73
     inline float probe_radius() {
73
-      return printable_radius -
74
+      return printable_radius - (
74
         #if HAS_BED_PROBE
75
         #if HAS_BED_PROBE
75
-          _MAX(MIN_PROBE_EDGE, HYPOT(probe_offset.x, probe_offset.y));
76
+          _MAX(MIN_PROBE_EDGE, HYPOT(probe_offset.x, probe_offset.y))
76
         #else
77
         #else
77
-          MIN_PROBE_EDGE;
78
+          MIN_PROBE_EDGE
78
         #endif
79
         #endif
80
+      );
79
     }
81
     }
80
   #endif
82
   #endif
81
 
83
 
82
   inline float probe_min_x() {
84
   inline float probe_min_x() {
83
-    return
85
+    return (
84
       #if IS_KINEMATIC
86
       #if IS_KINEMATIC
85
-        (X_CENTER) - probe_radius();
87
+        (X_CENTER) - probe_radius()
86
       #else
88
       #else
87
-        _MAX((X_MIN_BED) + (MIN_PROBE_EDGE_LEFT), (X_MIN_POS) + probe_offset.x);
89
+        _MAX((X_MIN_BED) + (MIN_PROBE_EDGE_LEFT), (X_MIN_POS) + probe_offset.x)
88
       #endif
90
       #endif
91
+    );
89
   }
92
   }
90
   inline float probe_max_x() {
93
   inline float probe_max_x() {
91
-    return
94
+    return (
92
       #if IS_KINEMATIC
95
       #if IS_KINEMATIC
93
-        (X_CENTER) + probe_radius();
96
+        (X_CENTER) + probe_radius()
94
       #else
97
       #else
95
-        _MIN((X_MAX_BED) - (MIN_PROBE_EDGE_RIGHT), (X_MAX_POS) + probe_offset.x);
98
+        _MIN((X_MAX_BED) - (MIN_PROBE_EDGE_RIGHT), (X_MAX_POS) + probe_offset.x)
96
       #endif
99
       #endif
100
+    );
97
   }
101
   }
98
   inline float probe_min_y() {
102
   inline float probe_min_y() {
99
-    return 
103
+    return (
100
       #if IS_KINEMATIC
104
       #if IS_KINEMATIC
101
-        (Y_CENTER) - probe_radius();
105
+        (Y_CENTER) - probe_radius()
102
       #else
106
       #else
103
-        _MAX((Y_MIN_BED) + (MIN_PROBE_EDGE_FRONT), (Y_MIN_POS) + probe_offset.y);
107
+        _MAX((Y_MIN_BED) + (MIN_PROBE_EDGE_FRONT), (Y_MIN_POS) + probe_offset.y)
104
       #endif
108
       #endif
109
+    );
105
   }
110
   }
106
   inline float probe_max_y() {
111
   inline float probe_max_y() {
107
-    return 
112
+    return (
108
       #if IS_KINEMATIC
113
       #if IS_KINEMATIC
109
-        (Y_CENTER) + probe_radius();
114
+        (Y_CENTER) + probe_radius()
110
       #else
115
       #else
111
-        _MIN((Y_MAX_BED) - (MIN_PROBE_EDGE_BACK), (Y_MAX_POS) + probe_offset.y);
116
+        _MIN((Y_MAX_BED) - (MIN_PROBE_EDGE_BACK), (Y_MAX_POS) + probe_offset.y)
112
       #endif
117
       #endif
118
+    );
113
   }
119
   }
114
 
120
 
115
   #if NEEDS_THREE_PROBE_POINTS
121
   #if NEEDS_THREE_PROBE_POINTS

Loading…
Cancel
Save