|
@@ -204,50 +204,55 @@
|
204
|
204
|
* Probes
|
205
|
205
|
*/
|
206
|
206
|
|
207
|
|
-/**
|
208
|
|
- * A probe needs a pin
|
209
|
|
- */
|
210
|
|
-#if (!((HAS_Z_MIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) || HAS_Z_PROBE )) && ( ENABLED(FIX_MOUNTED_PROBE) || defined(Z_ENDSTOP_SERVO_NR) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_SLED))
|
211
|
|
- #error A probe needs a pin! [Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN || HAS_Z_PROBE]
|
212
|
|
-#endif
|
|
207
|
+#if PROBE_SELECTED
|
213
|
208
|
|
214
|
|
-#if ((HAS_Z_MIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) && HAS_Z_PROBE) && ( ENABLED(FIX_MOUNTED_PROBE) || defined(Z_ENDSTOP_SERVO_NR) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_SLED))
|
215
|
|
- #error A probe should not be connected to more than one pin! [Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN || HAS_Z_PROBE]
|
216
|
|
-#endif
|
|
209
|
+ /**
|
|
210
|
+ * A probe needs a pin
|
|
211
|
+ */
|
|
212
|
+ #if !PROBE_PIN_CONFIGURED
|
|
213
|
+ #error A probe needs a pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN.
|
|
214
|
+ #endif
|
217
|
215
|
|
218
|
|
-/**
|
219
|
|
- * Require one kind of probe
|
220
|
|
- */
|
221
|
|
-#if ENABLED(AUTO_BED_LEVELING_FEATURE) && !( ENABLED(FIX_MOUNTED_PROBE) || defined(Z_ENDSTOP_SERVO_NR) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_SLED))
|
222
|
|
- #error For AUTO_BED_LEVELING_FEATURE define one kind of probe! [Servo | MECHANICAL_PROBE | Z_PROBE_SLED | FIX_MOUNTED_PROBE]
|
223
|
|
-#endif
|
|
216
|
+ /**
|
|
217
|
+ * Z_MIN_PIN and Z_MIN_PROBE_PIN can't co-exist when Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
|
|
218
|
+ */
|
|
219
|
+ #if HAS_Z_MIN && HAS_Z_MIN_PROBE_PIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
|
|
220
|
+ #error A probe cannot have more than one pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN.
|
|
221
|
+ #endif
|
224
|
222
|
|
225
|
|
-// To do: Fail with more than one probe defined
|
|
223
|
+ /**
|
|
224
|
+ * Make sure the plug is enabled if it's used
|
|
225
|
+ */
|
|
226
|
+ #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && DISABLED(USE_ZMIN_PLUG)
|
|
227
|
+ #error You must enable USE_ZMIN_PLUG if any probe or endstop is connected to the ZMIN plug.
|
|
228
|
+ #endif
|
226
|
229
|
|
227
|
|
-/**
|
228
|
|
- * Auto Bed Leveling
|
229
|
|
- */
|
230
|
|
-#if ENABLED(AUTO_BED_LEVELING_FEATURE)
|
|
230
|
+ /**
|
|
231
|
+ * Only allow one probe option to be defined
|
|
232
|
+ */
|
|
233
|
+ #if (ENABLED(FIX_MOUNTED_PROBE) && (ENABLED(MECHANICAL_PROBE) || HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED))) \
|
|
234
|
+ || (ENABLED(MECHANICAL_PROBE) && (HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED))) \
|
|
235
|
+ || (HAS_Z_ENDSTOP_SERVO && ENABLED(Z_PROBE_SLED))
|
|
236
|
+ #error Please define only one type of probe: Z Servo, MECHANICAL_PROBE, Z_PROBE_SLED, or FIX_MOUNTED_PROBE.
|
|
237
|
+ #endif
|
231
|
238
|
|
232
|
239
|
/**
|
233
|
|
- * Require a Z min pin
|
|
240
|
+ * Don't allow nonsense probe-pin settings
|
234
|
241
|
*/
|
235
|
|
- #if !PIN_EXISTS(Z_MIN)
|
236
|
|
- #if !PIN_EXISTS(Z_MIN_PROBE) || (DISABLED(Z_MIN_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z probe, but not enable it.
|
237
|
|
- #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
|
238
|
|
- #error You must have a Z_MIN or Z_PROBE endstop to enable Z_MIN_PROBE_REPEATABILITY_TEST.
|
239
|
|
- #else
|
240
|
|
- #error AUTO_BED_LEVELING_FEATURE requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_MIN_PROBE_PIN must point to a valid hardware pin.
|
241
|
|
- #endif
|
242
|
|
- #endif
|
|
242
|
+ #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && ENABLED(Z_MIN_PROBE_ENDSTOP)
|
|
243
|
+ #error You can't enable both Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN and Z_MIN_PROBE_ENDSTOP.
|
|
244
|
+ #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)
|
|
245
|
+ #error Don't enable DISABLE_Z_MIN_PROBE_ENDSTOP with Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN.
|
|
246
|
+ #elif ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP) && DISABLED(Z_MIN_PROBE_ENDSTOP)
|
|
247
|
+ #error DISABLE_Z_MIN_PROBE_ENDSTOP requires Z_MIN_PROBE_ENDSTOP to be set.
|
243
|
248
|
#endif
|
244
|
249
|
|
245
|
250
|
/**
|
246
|
251
|
* Require a Z probe pin if Z_MIN_PROBE_ENDSTOP is enabled.
|
247
|
252
|
*/
|
248
|
253
|
#if ENABLED(Z_MIN_PROBE_ENDSTOP)
|
249
|
|
- #if !PIN_EXISTS(Z_MIN_PROBE)
|
250
|
|
- #error You must have a Z_MIN_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_MIN_PROBE_ENDSTOP.
|
|
254
|
+ #if !HAS_Z_MIN_PROBE_PIN
|
|
255
|
+ #error Z_MIN_PROBE_ENDSTOP requires a Z_MIN_PROBE_PIN in your board's pins_XXXX.h file.
|
251
|
256
|
#endif
|
252
|
257
|
// Forcing Servo definitions can break some hall effect sensor setups. Leaving these here for further comment.
|
253
|
258
|
//#ifndef NUM_SERVOS
|
|
@@ -263,6 +268,36 @@
|
263
|
268
|
// #error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_MIN_PROBE_ENDSTOP.
|
264
|
269
|
//#endif
|
265
|
270
|
#endif
|
|
271
|
+
|
|
272
|
+#else
|
|
273
|
+
|
|
274
|
+ /**
|
|
275
|
+ * Require some kind of probe for bed leveling
|
|
276
|
+ */
|
|
277
|
+ #if ENABLED(AUTO_BED_LEVELING_FEATURE)
|
|
278
|
+ #error AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, MECHANICAL_PROBE, Z_PROBE_SLED, or FIX_MOUNTED_PROBE.
|
|
279
|
+ #endif
|
|
280
|
+
|
|
281
|
+#endif
|
|
282
|
+
|
|
283
|
+/**
|
|
284
|
+ * Auto Bed Leveling
|
|
285
|
+ */
|
|
286
|
+#if ENABLED(AUTO_BED_LEVELING_FEATURE)
|
|
287
|
+
|
|
288
|
+ /**
|
|
289
|
+ * Require a Z min pin
|
|
290
|
+ */
|
|
291
|
+ #if !PIN_EXISTS(Z_MIN)
|
|
292
|
+ #if !PIN_EXISTS(Z_MIN_PROBE) || (DISABLED(Z_MIN_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z probe, but not enable it.
|
|
293
|
+ #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
|
|
294
|
+ #error You must have a Z_MIN or Z_PROBE endstop to enable Z_MIN_PROBE_REPEATABILITY_TEST.
|
|
295
|
+ #else
|
|
296
|
+ #error AUTO_BED_LEVELING_FEATURE requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_MIN_PROBE_PIN must point to a valid hardware pin.
|
|
297
|
+ #endif
|
|
298
|
+ #endif
|
|
299
|
+ #endif
|
|
300
|
+
|
266
|
301
|
/**
|
267
|
302
|
* Check if Probe_Offset * Grid Points is greater than Probing Range
|
268
|
303
|
*/
|