Browse Source

Sanity check 3-point defines

Fixes #17870
Scott Lahteine 5 years ago
parent
commit
86c1125380
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      Marlin/src/inc/Conditionals_post.h

+ 5
- 1
Marlin/src/inc/Conditionals_post.h View File

@@ -2338,9 +2338,13 @@
2338 2338
   #undef MESH_MAX_Y
2339 2339
 #endif
2340 2340
 
2341
-#if defined(PROBE_PT_1_X) && defined(PROBE_PT_2_X) && defined(PROBE_PT_3_X) && defined(PROBE_PT_1_Y) && defined(PROBE_PT_2_Y) && defined(PROBE_PT_3_Y)
2341
+#define _POINT_COUNT (defined(PROBE_PT_1_X) + defined(PROBE_PT_2_X) + defined(PROBE_PT_3_X) + defined(PROBE_PT_1_Y) + defined(PROBE_PT_2_Y) + defined(PROBE_PT_3_Y))
2342
+#if _POINT_COUNT == 6
2342 2343
   #define HAS_FIXED_3POINT 1
2344
+#elif _POINT_COUNT > 0
2345
+  #error "For 3-Point Leveling all XY points must be defined (or none for the defaults)."
2343 2346
 #endif
2347
+#undef _POINT_COUNT
2344 2348
 
2345 2349
 /**
2346 2350
  * Buzzer/Speaker

Loading…
Cancel
Save