Browse Source

Merge pull request #4451 from thinkyhead/rc_arduino_160_minimum

Prevent compiling with old Arduino sooner
Scott Lahteine 8 years ago
parent
commit
5d8d18d03d
3 changed files with 707 additions and 737 deletions
  1. 1
    0
      Marlin/MarlinConfig.h
  2. 0
    735
      Marlin/SanityCheck.cpp
  3. 706
    2
      Marlin/SanityCheck.h

+ 1
- 0
Marlin/MarlinConfig.h View File

@@ -35,5 +35,6 @@
35 35
 #endif
36 36
 #include "Arduino.h"
37 37
 #include "Conditionals_post.h"
38
+#include "SanityCheck.h"
38 39
 
39 40
 #endif // MARLIN_CONFIG_H

+ 0
- 735
Marlin/SanityCheck.cpp View File

@@ -1,735 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
- *
5
- * Based on Sprinter and grbl.
6
- * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation, either version 3 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
- *
21
- */
22
-
23
-/**
24
- * SanityCheck.cpp
25
- *
26
- * Test configuration values for errors at compile-time.
27
- * This is done only once, here, to speed up compilation time.
28
- */
29
-#include "MarlinConfig.h"
30
-
31
-/**
32
- * Due to the high number of issues related with old versions of Arduino IDE
33
- * we are now warning our users to update their toolkits. In a future Marlin
34
- * release we will stop supporting old IDE versions and will require user
35
- * action to proceed with compilation in such environments.
36
- */
37
-#if !defined(ARDUINO) || ARDUINO < 10600
38
-  #error "Versions of Arduino IDE prior to 1.6.0 are no longer supported, please update your toolkit."
39
-#endif
40
-
41
-/**
42
- * We try our best to include sanity checks for all the changes configuration
43
- * directives because people have a tendency to use outdated config files with
44
- * the bleding edge source code, but sometimes this is not enough. This check
45
- * will force a minimum config file revision, otherwise Marlin will not build.
46
- */
47
-#if ! defined(CONFIGURATION_H_VERSION) || CONFIGURATION_H_VERSION < REQUIRED_CONFIGURATION_H_VERSION
48
-  #error "You are using an old Configuration.h file, update it before building Marlin."
49
-#endif
50
-
51
-#if ! defined(CONFIGURATION_ADV_H_VERSION) || CONFIGURATION_ADV_H_VERSION < REQUIRED_CONFIGURATION_ADV_H_VERSION
52
-  #error "You are using an old Configuration_adv.h file, update it before building Marlin."
53
-#endif
54
-
55
-/**
56
- * Marlin release, version and default string
57
- */
58
-#ifndef SHORT_BUILD_VERSION
59
-  #error "SHORT_BUILD_VERSION must be specified."
60
-#elif !defined(DETAILED_BUILD_VERSION)
61
-  #error "BUILD_VERSION must be specified."
62
-#elif !defined(STRING_DISTRIBUTION_DATE)
63
-  #error "STRING_DISTRIBUTION_DATE must be specified."
64
-#elif !defined(PROTOCOL_VERSION)
65
-  #error "PROTOCOL_VERSION must be specified."
66
-#elif !defined(MACHINE_NAME)
67
-  #error "MACHINE_NAME must be specified."
68
-#elif !defined(SOURCE_CODE_URL)
69
-  #error "SOURCE_CODE_URL must be specified."
70
-#elif !defined(DEFAULT_MACHINE_UUID)
71
-  #error "DEFAULT_MACHINE_UUID must be specified."
72
-#elif !defined(WEBSITE_URL)
73
-  #error "WEBSITE_URL must be specified."
74
-#endif
75
-
76
-/**
77
- * Dual Stepper Drivers
78
- */
79
-#if ENABLED(X_DUAL_STEPPER_DRIVERS) && ENABLED(DUAL_X_CARRIAGE)
80
-  #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS."
81
-#elif ENABLED(X_DUAL_STEPPER_DRIVERS) && (!HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR)
82
-  #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)."
83
-#elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && (!HAS_Y2_ENABLE || !HAS_Y2_STEP || !HAS_Y2_DIR)
84
-  #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)."
85
-#elif ENABLED(Z_DUAL_STEPPER_DRIVERS) && (!HAS_Z2_ENABLE || !HAS_Z2_STEP || !HAS_Z2_DIR)
86
-  #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)."
87
-#endif
88
-
89
-/**
90
- * Progress Bar
91
- */
92
-#if ENABLED(LCD_PROGRESS_BAR)
93
-  #if DISABLED(SDSUPPORT)
94
-    #error "LCD_PROGRESS_BAR requires SDSUPPORT."
95
-  #endif
96
-  #if ENABLED(DOGLCD)
97
-    #error "LCD_PROGRESS_BAR does not apply to graphical displays."
98
-  #endif
99
-  #if ENABLED(FILAMENT_LCD_DISPLAY)
100
-    #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both."
101
-  #endif
102
-#endif
103
-
104
-/**
105
- * Babystepping
106
- */
107
-#if ENABLED(BABYSTEPPING)
108
-  #if DISABLED(ULTRA_LCD)
109
-    #error "BABYSTEPPING requires an LCD controller."
110
-  #endif
111
-  #if ENABLED(SCARA)
112
-    #error "BABYSTEPPING is not implemented for SCARA yet."
113
-  #endif
114
-  #if ENABLED(DELTA) && ENABLED(BABYSTEP_XY)
115
-    #error "BABYSTEPPING only implemented for Z axis on deltabots."
116
-  #endif
117
-#endif
118
-
119
-/**
120
- * Filament Runout needs a pin and either SD Support or Auto print start detection
121
- */
122
-#if ENABLED(FILAMENT_RUNOUT_SENSOR)
123
-  #if !HAS_FIL_RUNOUT
124
-    #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
125
-  #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART)
126
-    #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART."
127
-  #endif
128
-#endif
129
-
130
-/**
131
- * Filament Change with Extruder Runout Prevention
132
- */
133
-#if ENABLED(FILAMENT_CHANGE_FEATURE) && ENABLED(EXTRUDER_RUNOUT_PREVENT)
134
-  #error "EXTRUDER_RUNOUT_PREVENT is incompatible with FILAMENT_CHANGE_FEATURE."
135
-#endif
136
-
137
-/**
138
- * Individual axis homing is useless for DELTAS
139
- */
140
-#if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) && ENABLED(DELTA)
141
-  #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
142
-#endif
143
-
144
-/**
145
- * Options only for EXTRUDERS > 1
146
- */
147
-#if EXTRUDERS > 1
148
-
149
-  #if EXTRUDERS > 4
150
-    #error "The maximum number of EXTRUDERS in Marlin is 4."
151
-  #endif
152
-
153
-  #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
154
-    #error "EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT."
155
-  #endif
156
-
157
-  #if ENABLED(HEATERS_PARALLEL)
158
-    #error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
159
-  #endif
160
-
161
-#elif ENABLED(SINGLENOZZLE)
162
-  #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
163
-#endif
164
-
165
-/**
166
- * Only one type of extruder allowed
167
- */
168
-#if (ENABLED(SWITCHING_EXTRUDER) && (ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER))) \
169
-  || (ENABLED(SINGLENOZZLE) && ENABLED(MIXING_EXTRUDER))
170
-    #error "Please define only one type of extruder: SINGLENOZZLE, SWITCHING_EXTRUDER, or MIXING_EXTRUDER."
171
-#endif
172
-
173
-/**
174
- * Single Stepper Dual Extruder with switching servo
175
- */
176
-#if ENABLED(SWITCHING_EXTRUDER)
177
-  #if ENABLED(DUAL_X_CARRIAGE)
178
-    #error "SWITCHING_EXTRUDER and DUAL_X_CARRIAGE are incompatible."
179
-  #elif EXTRUDERS != 2
180
-    #error "SWITCHING_EXTRUDER requires exactly 2 EXTRUDERS."
181
-  #elif NUM_SERVOS < 1
182
-    #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
183
-  #endif
184
-#endif
185
-
186
-/**
187
- * Mixing Extruder requirements
188
- */
189
-#if ENABLED(MIXING_EXTRUDER)
190
-  #if EXTRUDERS > 1
191
-    #error "MIXING_EXTRUDER currently only supports one extruder."
192
-  #endif
193
-  #if MIXING_STEPPERS < 2
194
-    #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
195
-  #endif
196
-  #if ENABLED(FILAMENT_SENSOR)
197
-    #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway."
198
-  #endif
199
-#endif
200
-
201
-/**
202
- * Limited number of servos
203
- */
204
-#if defined(NUM_SERVOS) && NUM_SERVOS > 0
205
-  #if NUM_SERVOS > 4
206
-    #error "The maximum number of SERVOS in Marlin is 4."
207
-  #elif HAS_Z_SERVO_ENDSTOP && Z_ENDSTOP_SERVO_NR >= NUM_SERVOS
208
-    #error "Z_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS."
209
-  #endif
210
-#endif
211
-
212
-/**
213
- * Servo deactivation depends on servo endstops
214
- */
215
-#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_ENDSTOP
216
-  #error "Z_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE."
217
-#endif
218
-
219
-/**
220
- * Required LCD language
221
- */
222
-#if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780)
223
-  #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller."
224
-#endif
225
-
226
-/**
227
- * Bed Heating Options - PID vs Limit Switching
228
- */
229
-#if ENABLED(PIDTEMPBED) && ENABLED(BED_LIMIT_SWITCHING)
230
-  #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED."
231
-#endif
232
-
233
-/**
234
- * Mesh Bed Leveling
235
- */
236
-#if ENABLED(MESH_BED_LEVELING)
237
-  #if ENABLED(DELTA)
238
-    #error "MESH_BED_LEVELING does not yet support DELTA printers."
239
-  #elif ENABLED(AUTO_BED_LEVELING_FEATURE)
240
-    #error "Select AUTO_BED_LEVELING_FEATURE or MESH_BED_LEVELING, not both."
241
-  #elif MESH_NUM_X_POINTS > 9 || MESH_NUM_Y_POINTS > 9
242
-    #error "MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS must be less than 10."
243
-  #endif
244
-#elif ENABLED(MANUAL_BED_LEVELING)
245
-  #error "MESH_BED_LEVELING is required for MANUAL_BED_LEVELING."
246
-#endif
247
-
248
-/**
249
- * Probes
250
- */
251
-
252
-#if PROBE_SELECTED
253
-
254
-  #if ENABLED(Z_PROBE_SLED) && ENABLED(DELTA)
255
-    #error "You cannot use Z_PROBE_SLED with DELTA."
256
-  #endif
257
-
258
-  /**
259
-   * NUM_SERVOS is required for a Z servo probe
260
-   */
261
-  #if HAS_Z_SERVO_ENDSTOP
262
-    #ifndef NUM_SERVOS
263
-      #error "You must set NUM_SERVOS for a Z servo probe (Z_ENDSTOP_SERVO_NR)."
264
-    #elif Z_ENDSTOP_SERVO_NR >= NUM_SERVOS
265
-      #error "Z_ENDSTOP_SERVO_NR must be less than NUM_SERVOS."
266
-    #endif
267
-  #endif
268
-
269
-  /**
270
-   * A probe needs a pin
271
-   */
272
-  #if !PROBE_PIN_CONFIGURED
273
-    #error "A probe needs a pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN."
274
-  #endif
275
-
276
-  /**
277
-   * Z_MIN_PIN and Z_MIN_PROBE_PIN can't co-exist when Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
278
-   */
279
-  #if HAS_Z_MIN && HAS_Z_MIN_PROBE_PIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
280
-    #error "A probe cannot have more than one pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN."
281
-  #endif
282
-
283
-  /**
284
-   * Make sure the plug is enabled if it's used
285
-   */
286
-  #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && DISABLED(USE_ZMIN_PLUG)
287
-    #error "You must enable USE_ZMIN_PLUG if any probe or endstop is connected to the ZMIN plug."
288
-  #endif
289
-
290
-  /**
291
-   * Only allow one probe option to be defined
292
-   */
293
-  #if (ENABLED(FIX_MOUNTED_PROBE) && (ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \
294
-       || (ENABLED(Z_PROBE_ALLEN_KEY) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \
295
-       || (HAS_Z_SERVO_ENDSTOP && ENABLED(Z_PROBE_SLED))
296
-    #error "Please define only one type of probe: Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE."
297
-  #endif
298
-
299
-  /**
300
-   * Don't allow nonsense probe-pin settings
301
-   */
302
-  #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && ENABLED(Z_MIN_PROBE_ENDSTOP)
303
-    #error "You can't enable both Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN and Z_MIN_PROBE_ENDSTOP."
304
-  #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)
305
-    #error "Don't enable DISABLE_Z_MIN_PROBE_ENDSTOP with Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN."
306
-  #elif ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP) && DISABLED(Z_MIN_PROBE_ENDSTOP)
307
-    #error "DISABLE_Z_MIN_PROBE_ENDSTOP requires Z_MIN_PROBE_ENDSTOP to be set."
308
-  #endif
309
-
310
-  /**
311
-   * Require a Z probe pin if Z_MIN_PROBE_ENDSTOP is enabled.
312
-   */
313
-  #if ENABLED(Z_MIN_PROBE_ENDSTOP)
314
-    #if !HAS_Z_MIN_PROBE_PIN
315
-      #error "Z_MIN_PROBE_ENDSTOP requires a Z_MIN_PROBE_PIN in your board's pins_XXXX.h file."
316
-    #endif
317
-    // Forcing Servo definitions can break some hall effect sensor setups. Leaving these here for further comment.
318
-    //#ifndef NUM_SERVOS
319
-    //  #error "You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_MIN_PROBE_ENDSTOP."
320
-    //#endif
321
-    //#if defined(NUM_SERVOS) && NUM_SERVOS < 1
322
-    //  #error "You must have at least 1 servo defined for NUM_SERVOS to use Z_MIN_PROBE_ENDSTOP."
323
-    //#endif
324
-    //#if Z_ENDSTOP_SERVO_NR < 0
325
-    //  #error "You must have Z_ENDSTOP_SERVO_NR set to at least 0 or above to use Z_MIN_PROBE_ENDSTOP."
326
-    //#endif
327
-    //#ifndef Z_SERVO_ANGLES
328
-    //  #error "You must have Z_SERVO_ANGLES defined for Z Extend and Retract to use Z_MIN_PROBE_ENDSTOP."
329
-    //#endif
330
-  #endif
331
-
332
-  /**
333
-   * Make sure Z raise values are set
334
-   */
335
-  #if defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING)
336
-    #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_RAISE_PROBE_DEPLOY_STOW instead."
337
-  #elif !defined(Z_RAISE_PROBE_DEPLOY_STOW)
338
-    #error "You must set Z_RAISE_PROBE_DEPLOY_STOW in your configuration."
339
-  #elif !defined(Z_RAISE_BETWEEN_PROBINGS)
340
-    #error "You must set Z_RAISE_BETWEEN_PROBINGS in your configuration."
341
-  #elif Z_RAISE_PROBE_DEPLOY_STOW < 0
342
-    #error "Probes need Z_RAISE_PROBE_DEPLOY_STOW >= 0."
343
-  #elif Z_RAISE_BETWEEN_PROBINGS < 0
344
-    #error "Probes need Z_RAISE_BETWEEN_PROBINGS >= 0."
345
-  #endif
346
-
347
-#else
348
-
349
-  /**
350
-   * Require some kind of probe for bed leveling and probe testing
351
-   */
352
-  #if ENABLED(AUTO_BED_LEVELING_FEATURE)
353
-    #error "AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE."
354
-  #elif ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
355
-    #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE."
356
-  #endif
357
-
358
-#endif
359
-
360
-/**
361
- * Make sure Z_SAFE_HOMING point is reachable
362
- */
363
-#if ENABLED(Z_SAFE_HOMING)
364
-  #if Z_SAFE_HOMING_X_POINT < MIN_PROBE_X || Z_SAFE_HOMING_X_POINT > MAX_PROBE_X
365
-    #if HAS_BED_PROBE
366
-      #error "Z_SAFE_HOMING_X_POINT can't be reached by the Z probe."
367
-    #else
368
-      #error "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle."
369
-    #endif
370
-  #elif Z_SAFE_HOMING_Y_POINT < MIN_PROBE_Y || Z_SAFE_HOMING_Y_POINT > MAX_PROBE_Y
371
-    #if HAS_BED_PROBE
372
-      #error "Z_SAFE_HOMING_Y_POINT can't be reached by the Z probe."
373
-    #else
374
-      #error "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle."
375
-    #endif
376
-  #endif
377
-#endif // Z_SAFE_HOMING
378
-
379
-/**
380
- * Auto Bed Leveling
381
- */
382
-#if ENABLED(AUTO_BED_LEVELING_FEATURE)
383
-
384
-  /**
385
-   * Delta has limited bed leveling options
386
-   */
387
-  #if ENABLED(DELTA) && DISABLED(AUTO_BED_LEVELING_GRID)
388
-    #error "You must use AUTO_BED_LEVELING_GRID for DELTA bed leveling."
389
-  #endif
390
-
391
-  /**
392
-   * Require a Z min pin
393
-   */
394
-  #if !PIN_EXISTS(Z_MIN)
395
-    #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.
396
-      #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."
397
-    #endif
398
-  #endif
399
-
400
-  /**
401
-   * Check if Probe_Offset * Grid Points is greater than Probing Range
402
-   */
403
-  #if ENABLED(AUTO_BED_LEVELING_GRID)
404
-    #ifndef DELTA_PROBEABLE_RADIUS
405
-      // Be sure points are in the right order
406
-      #if LEFT_PROBE_BED_POSITION > RIGHT_PROBE_BED_POSITION
407
-        #error "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION."
408
-      #elif FRONT_PROBE_BED_POSITION > BACK_PROBE_BED_POSITION
409
-        #error "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION."
410
-      #endif
411
-      // Make sure probing points are reachable
412
-      #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
413
-        #error "The given LEFT_PROBE_BED_POSITION can't be reached by the Z probe."
414
-      #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X
415
-        #error "The given RIGHT_PROBE_BED_POSITION can't be reached by the Z probe."
416
-      #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y
417
-        #error "The given FRONT_PROBE_BED_POSITION can't be reached by the Z probe."
418
-      #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y
419
-        #error "The given BACK_PROBE_BED_POSITION can't be reached by the Z probe."
420
-      #endif
421
-    #endif
422
-  #else // !AUTO_BED_LEVELING_GRID
423
-
424
-    // Check the triangulation points
425
-    #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X
426
-      #error "The given ABL_PROBE_PT_1_X can't be reached by the Z probe."
427
-    #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X
428
-      #error "The given ABL_PROBE_PT_2_X can't be reached by the Z probe."
429
-    #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X
430
-      #error "The given ABL_PROBE_PT_3_X can't be reached by the Z probe."
431
-    #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y
432
-      #error "The given ABL_PROBE_PT_1_Y can't be reached by the Z probe."
433
-    #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y
434
-      #error "The given ABL_PROBE_PT_2_Y can't be reached by the Z probe."
435
-    #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y
436
-      #error "The given ABL_PROBE_PT_3_Y can't be reached by the Z probe."
437
-    #endif
438
-
439
-  #endif // !AUTO_BED_LEVELING_GRID
440
-
441
-#endif // AUTO_BED_LEVELING_FEATURE
442
-
443
-/**
444
- * Advance Extrusion
445
- */
446
-#if ENABLED(ADVANCE) && ENABLED(LIN_ADVANCE)
447
-  #error "You can enable ADVANCE or LIN_ADVANCE, but not both."
448
-#endif
449
-
450
-/**
451
- * Filament Width Sensor
452
- */
453
-#if ENABLED(FILAMENT_WIDTH_SENSOR) && !HAS_FILAMENT_WIDTH_SENSOR
454
-  #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
455
-#endif
456
-
457
-/**
458
- * ULTIPANEL encoder
459
- */
460
-#if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
461
-  #error "ULTIPANEL requires some kind of encoder."
462
-#endif
463
-
464
-#if ENCODER_PULSES_PER_STEP < 0
465
-  #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead."
466
-#endif
467
-
468
-/**
469
- * SAV_3DGLCD display options
470
- */
471
-#if ENABLED(U8GLIB_SSD1306) && ENABLED(U8GLIB_SH1106)
472
-  #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
473
-#endif
474
-
475
-/**
476
- * Don't set more than one kinematic type
477
- */
478
-#if (ENABLED(DELTA) && (ENABLED(SCARA) || ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ))) \
479
- || (ENABLED(SCARA) && (ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ))) \
480
- || (ENABLED(COREXY) && (ENABLED(COREXZ) || ENABLED(COREYZ))) \
481
- || (ENABLED(COREXZ) && ENABLED(COREYZ))
482
-  #error "Please enable only one of DELTA, SCARA, COREXY, COREXZ, or COREYZ."
483
-#endif
484
-
485
-/**
486
- * Allen Key
487
- * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
488
- */
489
-#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
490
-  #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY"
491
-#endif
492
-
493
-/**
494
- * Dual X Carriage requirements
495
- */
496
-#if ENABLED(DUAL_X_CARRIAGE)
497
-  #if EXTRUDERS == 1
498
-    #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
499
-  #elif ENABLED(COREXY) || ENABLED(COREXZ)
500
-    #error "DUAL_X_CARRIAGE cannot be used with COREXY or COREXZ."
501
-  #elif !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR
502
-    #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
503
-  #elif !HAS_X_MAX
504
-    #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop."
505
-  #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
506
-    #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
507
-  #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1
508
-    #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1."
509
-  #endif
510
-#endif // DUAL_X_CARRIAGE
511
-
512
-/**
513
- * Make sure auto fan pins don't conflict with the fan pin
514
- */
515
-#if HAS_AUTO_FAN
516
-  #if HAS_FAN0
517
-    #if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN
518
-      #error "You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN."
519
-    #elif EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN
520
-      #error "You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to FAN_PIN."
521
-    #elif EXTRUDER_2_AUTO_FAN_PIN == FAN_PIN
522
-      #error "You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to FAN_PIN."
523
-    #elif EXTRUDER_3_AUTO_FAN_PIN == FAN_PIN
524
-      #error "You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to FAN_PIN."
525
-    #endif
526
-  #endif
527
-#endif
528
-
529
-#if HAS_FAN0 && CONTROLLERFAN_PIN == FAN_PIN
530
-  #error "You cannot set CONTROLLERFAN_PIN equal to FAN_PIN."
531
-#endif
532
-
533
-#if HAS_CONTROLLERFAN
534
-  #if EXTRUDER_0_AUTO_FAN_PIN == CONTROLLERFAN_PIN
535
-    #error "You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN."
536
-  #elif EXTRUDER_1_AUTO_FAN_PIN == CONTROLLERFAN_PIN
537
-    #error "You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN."
538
-  #elif EXTRUDER_2_AUTO_FAN_PIN == CONTROLLERFAN_PIN
539
-    #error "You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN."
540
-  #elif EXTRUDER_3_AUTO_FAN_PIN == CONTROLLERFAN_PIN
541
-    #error "You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN."
542
-  #endif
543
-#endif
544
-
545
-/**
546
- * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set.
547
- */
548
-#if !HAS_HEATER_0
549
-  #error "HEATER_0_PIN not defined for this board."
550
-#elif !PIN_EXISTS(TEMP_0)
551
-  #error "TEMP_0_PIN not defined for this board."
552
-#elif !PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE)
553
-  #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
554
-#elif TEMP_SENSOR_0 == 0
555
-  #error "TEMP_SENSOR_0 is required."
556
-#endif
557
-
558
-#if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)
559
-  #if !HAS_HEATER_1
560
-    #error "HEATER_1_PIN not defined for this board."
561
-  #endif
562
-#endif
563
-
564
-#if HOTENDS > 1
565
-  #if TEMP_SENSOR_1 == 0
566
-    #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
567
-  #elif !PIN_EXISTS(TEMP_1)
568
-    #error "TEMP_1_PIN not defined for this board."
569
-  #endif
570
-  #if HOTENDS > 2
571
-    #if TEMP_SENSOR_2 == 0
572
-      #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
573
-    #elif !HAS_HEATER_2
574
-      #error "HEATER_2_PIN not defined for this board."
575
-    #elif !PIN_EXISTS(TEMP_2)
576
-      #error "TEMP_2_PIN not defined for this board."
577
-    #endif
578
-    #if HOTENDS > 3
579
-      #if TEMP_SENSOR_3 == 0
580
-        #error "TEMP_SENSOR_3 is required with 4 HOTENDS."
581
-      #elif !HAS_HEATER_3
582
-        #error "HEATER_3_PIN not defined for this board."
583
-      #elif !PIN_EXISTS(TEMP_3)
584
-        #error "TEMP_3_PIN not defined for this board."
585
-      #endif
586
-    #elif TEMP_SENSOR_3 != 0
587
-      #error "TEMP_SENSOR_3 shouldn't be set with only 3 extruders."
588
-    #endif
589
-  #elif TEMP_SENSOR_2 != 0
590
-    #error "TEMP_SENSOR_2 shouldn't be set with only 2 extruders."
591
-  #elif TEMP_SENSOR_3 != 0
592
-    #error "TEMP_SENSOR_3 shouldn't be set with only 2 extruders."
593
-  #endif
594
-#elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT)
595
-  #error "TEMP_SENSOR_1 shouldn't be set with only 1 extruder."
596
-#elif TEMP_SENSOR_2 != 0
597
-  #error "TEMP_SENSOR_2 shouldn't be set with only 1 extruder."
598
-#elif TEMP_SENSOR_3 != 0
599
-  #error "TEMP_SENSOR_3 shouldn't be set with only 1 extruder."
600
-#endif
601
-
602
-#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0
603
-  #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
604
-#endif
605
-
606
-/**
607
- * Basic 2-nozzle duplication mode
608
- */
609
-#if ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
610
-  #if HOTENDS != 2
611
-    #error "DUAL_NOZZLE_DUPLICATION_MODE requires exactly 2 hotends."
612
-  #elif ENABLED(DUAL_X_CARRIAGE)
613
-    #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with DUAL_X_CARRIAGE."
614
-  #elif ENABLED(SINGLENOZZLE)
615
-    #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SINGLENOZZLE."
616
-  #elif ENABLED(MIXING_EXTRUDER)
617
-    #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with MIXING_EXTRUDER."
618
-  #elif ENABLED(SWITCHING_EXTRUDER)
619
-    #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SWITCHING_EXTRUDER."
620
-  #endif
621
-#endif
622
-
623
-/**
624
- * Test Extruder Pins
625
- */
626
-#if EXTRUDERS > 3
627
-  #if !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE)
628
-    #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
629
-  #endif
630
-#elif EXTRUDERS > 2
631
-  #if !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE)
632
-    #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
633
-  #endif
634
-#elif EXTRUDERS > 1
635
-  #if !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE)
636
-    #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
637
-  #endif
638
-#endif
639
-
640
-/**
641
- * Endstops
642
- */
643
-#if DISABLED(USE_XMIN_PLUG) && DISABLED(USE_XMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _XMAX_ && Z2_USE_ENDSTOP <= _XMIN_)
644
- #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG"
645
-#elif DISABLED(USE_YMIN_PLUG) && DISABLED(USE_YMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _YMAX_ && Z2_USE_ENDSTOP <= _YMIN_)
646
- #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG"
647
-#elif DISABLED(USE_ZMIN_PLUG) && DISABLED(USE_ZMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _ZMAX_ && Z2_USE_ENDSTOP <= _ZMIN_)
648
- #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG"
649
-#elif ENABLED(Z_DUAL_ENDSTOPS) && !Z2_USE_ENDSTOP
650
- #error "You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS"
651
-#endif
652
-
653
-/**
654
- * emergency-command parser
655
- */
656
-#if ENABLED(EMERGENCY_PARSER) && ENABLED(USBCON)
657
-  #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
658
-#endif
659
-
660
- /**
661
- * Warnings for old configurations
662
- */
663
-#if WATCH_TEMP_PERIOD > 500
664
-  #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds."
665
-#elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
666
-  #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS."
667
-#elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
668
-  #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED."
669
-#elif ENABLED(COREXZ) && ENABLED(Z_LATE_ENABLE)
670
-  #error "Z_LATE_ENABLE can't be used with COREXZ."
671
-#elif defined(X_HOME_RETRACT_MM)
672
-  #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM."
673
-#elif defined(BEEPER)
674
-  #error "BEEPER is now BEEPER_PIN. Please update your pins definitions."
675
-#elif defined(SDCARDDETECT)
676
-  #error "SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions."
677
-#elif defined(SDCARDDETECTINVERTED)
678
-  #error "SDCARDDETECTINVERTED is now SD_DETECT_INVERTED. Please update your configuration."
679
-#elif defined(BTENABLED)
680
-  #error "BTENABLED is now BLUETOOTH. Please update your configuration."
681
-#elif defined(CUSTOM_MENDEL_NAME)
682
-  #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration."
683
-#elif defined(HAS_AUTOMATIC_VERSIONING)
684
-  #error "HAS_AUTOMATIC_VERSIONING is now USE_AUTOMATIC_VERSIONING. Please update your configuration."
685
-#elif defined(ENABLE_AUTO_BED_LEVELING)
686
-  #error "ENABLE_AUTO_BED_LEVELING is now AUTO_BED_LEVELING_FEATURE. Please update your configuration."
687
-#elif defined(SDSLOW)
688
-  #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead."
689
-#elif defined(SDEXTRASLOW)
690
-  #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead."
691
-#elif defined(Z_RAISE_BEFORE_HOMING)
692
-  #error "Z_RAISE_BEFORE_HOMING is deprecated. Use MIN_Z_HEIGHT_FOR_HOMING instead."
693
-#elif defined(FILAMENT_SENSOR)
694
-  #error "FILAMENT_SENSOR is deprecated. Use FILAMENT_WIDTH_SENSOR instead."
695
-#elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
696
-  #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead."
697
-#elif ENABLED(Z_DUAL_ENDSTOPS) && !defined(Z2_USE_ENDSTOP)
698
-  #error "Z_DUAL_ENDSTOPS settings are simplified. Just set Z2_USE_ENDSTOP to the endstop you want to repurpose for Z2"
699
-#elif defined(LANGUAGE_INCLUDE)
700
-  #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration."
701
-#elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y)
702
-  #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead."
703
-#elif defined(PID_PARAMS_PER_EXTRUDER)
704
-  #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead."
705
-#elif defined(EXTRUDER_WATTS)
706
-  #error "EXTRUDER_WATTS is deprecated. Use HOTEND_WATTS instead."
707
-#elif defined(SERVO_ENDSTOP_ANGLES)
708
-  #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
709
-#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
710
-  #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
711
-#elif defined(XY_TRAVEL_SPEED)
712
-  #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead."
713
-#elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
714
-  #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead."
715
-#elif defined(SERVO_DEACTIVATION_DELAY)
716
-  #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead."
717
-#elif ENABLED(FILAMENTCHANGEENABLE)
718
-  #error "FILAMENTCHANGEENABLE is now FILAMENT_CHANGE_FEATURE. Please update your configuration."
719
-#elif defined(PLA_PREHEAT_HOTEND_TEMP)
720
-  #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration."
721
-#elif defined(PLA_PREHEAT_HPB_TEMP)
722
-  #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration."
723
-#elif defined(PLA_PREHEAT_FAN_SPEED)
724
-  #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration."
725
-#elif defined(ABS_PREHEAT_HOTEND_TEMP)
726
-  #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration."
727
-#elif defined(ABS_PREHEAT_HPB_TEMP)
728
-  #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration."
729
-#elif defined(ABS_PREHEAT_FAN_SPEED)
730
-  #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration."
731
-#elif defined(ENDSTOPS_ONLY_FOR_HOMING)
732
-  #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead."
733
-#elif defined(HOMING_FEEDRATE)
734
-  #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead."
735
-#endif

+ 706
- 2
Marlin/SanityCheck.h View File

@@ -22,6 +22,710 @@
22 22
 
23 23
 /**
24 24
  * SanityCheck.h
25
- * OBSOLETE: Moved to SanityCheck.cpp
25
+ *
26
+ * Test configuration values for errors at compile-time.
27
+ */
28
+
29
+/**
30
+ * Due to the high number of issues related with old versions of Arduino IDE
31
+ * we now prevent Marlin from compiling with older toolkits.
32
+ */
33
+#if !defined(ARDUINO) || ARDUINO < 10600
34
+  #error "Versions of Arduino IDE prior to 1.6.0 are no longer supported, please update your toolkit."
35
+#endif
36
+
37
+/**
38
+ * We try our best to include sanity checks for all the changes configuration
39
+ * directives because people have a tendency to use outdated config files with
40
+ * the bleding edge source code, but sometimes this is not enough. This check
41
+ * will force a minimum config file revision, otherwise Marlin will not build.
42
+ */
43
+#if ! defined(CONFIGURATION_H_VERSION) || CONFIGURATION_H_VERSION < REQUIRED_CONFIGURATION_H_VERSION
44
+  #error "You are using an old Configuration.h file, update it before building Marlin."
45
+#endif
46
+
47
+#if ! defined(CONFIGURATION_ADV_H_VERSION) || CONFIGURATION_ADV_H_VERSION < REQUIRED_CONFIGURATION_ADV_H_VERSION
48
+  #error "You are using an old Configuration_adv.h file, update it before building Marlin."
49
+#endif
50
+
51
+/**
52
+ * Marlin release, version and default string
53
+ */
54
+#ifndef SHORT_BUILD_VERSION
55
+  #error "SHORT_BUILD_VERSION must be specified."
56
+#elif !defined(DETAILED_BUILD_VERSION)
57
+  #error "BUILD_VERSION must be specified."
58
+#elif !defined(STRING_DISTRIBUTION_DATE)
59
+  #error "STRING_DISTRIBUTION_DATE must be specified."
60
+#elif !defined(PROTOCOL_VERSION)
61
+  #error "PROTOCOL_VERSION must be specified."
62
+#elif !defined(MACHINE_NAME)
63
+  #error "MACHINE_NAME must be specified."
64
+#elif !defined(SOURCE_CODE_URL)
65
+  #error "SOURCE_CODE_URL must be specified."
66
+#elif !defined(DEFAULT_MACHINE_UUID)
67
+  #error "DEFAULT_MACHINE_UUID must be specified."
68
+#elif !defined(WEBSITE_URL)
69
+  #error "WEBSITE_URL must be specified."
70
+#endif
71
+
72
+/**
73
+ * Dual Stepper Drivers
74
+ */
75
+#if ENABLED(X_DUAL_STEPPER_DRIVERS) && ENABLED(DUAL_X_CARRIAGE)
76
+  #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS."
77
+#elif ENABLED(X_DUAL_STEPPER_DRIVERS) && (!HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR)
78
+  #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)."
79
+#elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && (!HAS_Y2_ENABLE || !HAS_Y2_STEP || !HAS_Y2_DIR)
80
+  #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)."
81
+#elif ENABLED(Z_DUAL_STEPPER_DRIVERS) && (!HAS_Z2_ENABLE || !HAS_Z2_STEP || !HAS_Z2_DIR)
82
+  #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)."
83
+#endif
84
+
85
+/**
86
+ * Progress Bar
87
+ */
88
+#if ENABLED(LCD_PROGRESS_BAR)
89
+  #if DISABLED(SDSUPPORT)
90
+    #error "LCD_PROGRESS_BAR requires SDSUPPORT."
91
+  #endif
92
+  #if ENABLED(DOGLCD)
93
+    #error "LCD_PROGRESS_BAR does not apply to graphical displays."
94
+  #endif
95
+  #if ENABLED(FILAMENT_LCD_DISPLAY)
96
+    #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both."
97
+  #endif
98
+#endif
99
+
100
+/**
101
+ * Babystepping
102
+ */
103
+#if ENABLED(BABYSTEPPING)
104
+  #if DISABLED(ULTRA_LCD)
105
+    #error "BABYSTEPPING requires an LCD controller."
106
+  #endif
107
+  #if ENABLED(SCARA)
108
+    #error "BABYSTEPPING is not implemented for SCARA yet."
109
+  #endif
110
+  #if ENABLED(DELTA) && ENABLED(BABYSTEP_XY)
111
+    #error "BABYSTEPPING only implemented for Z axis on deltabots."
112
+  #endif
113
+#endif
114
+
115
+/**
116
+ * Filament Runout needs a pin and either SD Support or Auto print start detection
117
+ */
118
+#if ENABLED(FILAMENT_RUNOUT_SENSOR)
119
+  #if !HAS_FIL_RUNOUT
120
+    #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
121
+  #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART)
122
+    #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART."
123
+  #endif
124
+#endif
125
+
126
+/**
127
+ * Filament Change with Extruder Runout Prevention
128
+ */
129
+#if ENABLED(FILAMENT_CHANGE_FEATURE) && ENABLED(EXTRUDER_RUNOUT_PREVENT)
130
+  #error "EXTRUDER_RUNOUT_PREVENT is incompatible with FILAMENT_CHANGE_FEATURE."
131
+#endif
132
+
133
+/**
134
+ * Individual axis homing is useless for DELTAS
135
+ */
136
+#if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) && ENABLED(DELTA)
137
+  #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
138
+#endif
139
+
140
+/**
141
+ * Options only for EXTRUDERS > 1
142
+ */
143
+#if EXTRUDERS > 1
144
+
145
+  #if EXTRUDERS > 4
146
+    #error "The maximum number of EXTRUDERS in Marlin is 4."
147
+  #endif
148
+
149
+  #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
150
+    #error "EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT."
151
+  #endif
152
+
153
+  #if ENABLED(HEATERS_PARALLEL)
154
+    #error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
155
+  #endif
156
+
157
+#elif ENABLED(SINGLENOZZLE)
158
+  #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
159
+#endif
160
+
161
+/**
162
+ * Only one type of extruder allowed
163
+ */
164
+#if (ENABLED(SWITCHING_EXTRUDER) && (ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER))) \
165
+  || (ENABLED(SINGLENOZZLE) && ENABLED(MIXING_EXTRUDER))
166
+    #error "Please define only one type of extruder: SINGLENOZZLE, SWITCHING_EXTRUDER, or MIXING_EXTRUDER."
167
+#endif
168
+
169
+/**
170
+ * Single Stepper Dual Extruder with switching servo
171
+ */
172
+#if ENABLED(SWITCHING_EXTRUDER)
173
+  #if ENABLED(DUAL_X_CARRIAGE)
174
+    #error "SWITCHING_EXTRUDER and DUAL_X_CARRIAGE are incompatible."
175
+  #elif EXTRUDERS != 2
176
+    #error "SWITCHING_EXTRUDER requires exactly 2 EXTRUDERS."
177
+  #elif NUM_SERVOS < 1
178
+    #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
179
+  #endif
180
+#endif
181
+
182
+/**
183
+ * Mixing Extruder requirements
184
+ */
185
+#if ENABLED(MIXING_EXTRUDER)
186
+  #if EXTRUDERS > 1
187
+    #error "MIXING_EXTRUDER currently only supports one extruder."
188
+  #endif
189
+  #if MIXING_STEPPERS < 2
190
+    #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
191
+  #endif
192
+  #if ENABLED(FILAMENT_SENSOR)
193
+    #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway."
194
+  #endif
195
+#endif
196
+
197
+/**
198
+ * Limited number of servos
199
+ */
200
+#if defined(NUM_SERVOS) && NUM_SERVOS > 0
201
+  #if NUM_SERVOS > 4
202
+    #error "The maximum number of SERVOS in Marlin is 4."
203
+  #elif HAS_Z_SERVO_ENDSTOP && Z_ENDSTOP_SERVO_NR >= NUM_SERVOS
204
+    #error "Z_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS."
205
+  #endif
206
+#endif
207
+
208
+/**
209
+ * Servo deactivation depends on servo endstops
210
+ */
211
+#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_ENDSTOP
212
+  #error "Z_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE."
213
+#endif
214
+
215
+/**
216
+ * Required LCD language
217
+ */
218
+#if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780)
219
+  #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller."
220
+#endif
221
+
222
+/**
223
+ * Bed Heating Options - PID vs Limit Switching
224
+ */
225
+#if ENABLED(PIDTEMPBED) && ENABLED(BED_LIMIT_SWITCHING)
226
+  #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED."
227
+#endif
228
+
229
+/**
230
+ * Mesh Bed Leveling
231
+ */
232
+#if ENABLED(MESH_BED_LEVELING)
233
+  #if ENABLED(DELTA)
234
+    #error "MESH_BED_LEVELING does not yet support DELTA printers."
235
+  #elif ENABLED(AUTO_BED_LEVELING_FEATURE)
236
+    #error "Select AUTO_BED_LEVELING_FEATURE or MESH_BED_LEVELING, not both."
237
+  #elif MESH_NUM_X_POINTS > 9 || MESH_NUM_Y_POINTS > 9
238
+    #error "MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS must be less than 10."
239
+  #endif
240
+#elif ENABLED(MANUAL_BED_LEVELING)
241
+  #error "MESH_BED_LEVELING is required for MANUAL_BED_LEVELING."
242
+#endif
243
+
244
+/**
245
+ * Probes
246
+ */
247
+
248
+#if PROBE_SELECTED
249
+
250
+  #if ENABLED(Z_PROBE_SLED) && ENABLED(DELTA)
251
+    #error "You cannot use Z_PROBE_SLED with DELTA."
252
+  #endif
253
+
254
+  /**
255
+   * NUM_SERVOS is required for a Z servo probe
256
+   */
257
+  #if HAS_Z_SERVO_ENDSTOP
258
+    #ifndef NUM_SERVOS
259
+      #error "You must set NUM_SERVOS for a Z servo probe (Z_ENDSTOP_SERVO_NR)."
260
+    #elif Z_ENDSTOP_SERVO_NR >= NUM_SERVOS
261
+      #error "Z_ENDSTOP_SERVO_NR must be less than NUM_SERVOS."
262
+    #endif
263
+  #endif
264
+
265
+  /**
266
+   * A probe needs a pin
267
+   */
268
+  #if !PROBE_PIN_CONFIGURED
269
+    #error "A probe needs a pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN."
270
+  #endif
271
+
272
+  /**
273
+   * Z_MIN_PIN and Z_MIN_PROBE_PIN can't co-exist when Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
274
+   */
275
+  #if HAS_Z_MIN && HAS_Z_MIN_PROBE_PIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
276
+    #error "A probe cannot have more than one pin! Use Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN or Z_MIN_PROBE_PIN."
277
+  #endif
278
+
279
+  /**
280
+   * Make sure the plug is enabled if it's used
281
+   */
282
+  #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && DISABLED(USE_ZMIN_PLUG)
283
+    #error "You must enable USE_ZMIN_PLUG if any probe or endstop is connected to the ZMIN plug."
284
+  #endif
285
+
286
+  /**
287
+   * Only allow one probe option to be defined
288
+   */
289
+  #if (ENABLED(FIX_MOUNTED_PROBE) && (ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \
290
+       || (ENABLED(Z_PROBE_ALLEN_KEY) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \
291
+       || (HAS_Z_SERVO_ENDSTOP && ENABLED(Z_PROBE_SLED))
292
+    #error "Please define only one type of probe: Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE."
293
+  #endif
294
+
295
+  /**
296
+   * Don't allow nonsense probe-pin settings
297
+   */
298
+  #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && ENABLED(Z_MIN_PROBE_ENDSTOP)
299
+    #error "You can't enable both Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN and Z_MIN_PROBE_ENDSTOP."
300
+  #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)
301
+    #error "Don't enable DISABLE_Z_MIN_PROBE_ENDSTOP with Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN."
302
+  #elif ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP) && DISABLED(Z_MIN_PROBE_ENDSTOP)
303
+    #error "DISABLE_Z_MIN_PROBE_ENDSTOP requires Z_MIN_PROBE_ENDSTOP to be set."
304
+  #endif
305
+
306
+  /**
307
+   * Require a Z probe pin if Z_MIN_PROBE_ENDSTOP is enabled.
308
+   */
309
+  #if ENABLED(Z_MIN_PROBE_ENDSTOP)
310
+    #if !HAS_Z_MIN_PROBE_PIN
311
+      #error "Z_MIN_PROBE_ENDSTOP requires a Z_MIN_PROBE_PIN in your board's pins_XXXX.h file."
312
+    #endif
313
+    // Forcing Servo definitions can break some hall effect sensor setups. Leaving these here for further comment.
314
+    //#ifndef NUM_SERVOS
315
+    //  #error "You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_MIN_PROBE_ENDSTOP."
316
+    //#endif
317
+    //#if defined(NUM_SERVOS) && NUM_SERVOS < 1
318
+    //  #error "You must have at least 1 servo defined for NUM_SERVOS to use Z_MIN_PROBE_ENDSTOP."
319
+    //#endif
320
+    //#if Z_ENDSTOP_SERVO_NR < 0
321
+    //  #error "You must have Z_ENDSTOP_SERVO_NR set to at least 0 or above to use Z_MIN_PROBE_ENDSTOP."
322
+    //#endif
323
+    //#ifndef Z_SERVO_ANGLES
324
+    //  #error "You must have Z_SERVO_ANGLES defined for Z Extend and Retract to use Z_MIN_PROBE_ENDSTOP."
325
+    //#endif
326
+  #endif
327
+
328
+  /**
329
+   * Make sure Z raise values are set
330
+   */
331
+  #if defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING)
332
+    #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_RAISE_PROBE_DEPLOY_STOW instead."
333
+  #elif !defined(Z_RAISE_PROBE_DEPLOY_STOW)
334
+    #error "You must set Z_RAISE_PROBE_DEPLOY_STOW in your configuration."
335
+  #elif !defined(Z_RAISE_BETWEEN_PROBINGS)
336
+    #error "You must set Z_RAISE_BETWEEN_PROBINGS in your configuration."
337
+  #elif Z_RAISE_PROBE_DEPLOY_STOW < 0
338
+    #error "Probes need Z_RAISE_PROBE_DEPLOY_STOW >= 0."
339
+  #elif Z_RAISE_BETWEEN_PROBINGS < 0
340
+    #error "Probes need Z_RAISE_BETWEEN_PROBINGS >= 0."
341
+  #endif
342
+
343
+#else
344
+
345
+  /**
346
+   * Require some kind of probe for bed leveling and probe testing
347
+   */
348
+  #if ENABLED(AUTO_BED_LEVELING_FEATURE)
349
+    #error "AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE."
350
+  #elif ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
351
+    #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE."
352
+  #endif
353
+
354
+#endif
355
+
356
+/**
357
+ * Make sure Z_SAFE_HOMING point is reachable
358
+ */
359
+#if ENABLED(Z_SAFE_HOMING)
360
+  #if Z_SAFE_HOMING_X_POINT < MIN_PROBE_X || Z_SAFE_HOMING_X_POINT > MAX_PROBE_X
361
+    #if HAS_BED_PROBE
362
+      #error "Z_SAFE_HOMING_X_POINT can't be reached by the Z probe."
363
+    #else
364
+      #error "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle."
365
+    #endif
366
+  #elif Z_SAFE_HOMING_Y_POINT < MIN_PROBE_Y || Z_SAFE_HOMING_Y_POINT > MAX_PROBE_Y
367
+    #if HAS_BED_PROBE
368
+      #error "Z_SAFE_HOMING_Y_POINT can't be reached by the Z probe."
369
+    #else
370
+      #error "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle."
371
+    #endif
372
+  #endif
373
+#endif // Z_SAFE_HOMING
374
+
375
+/**
376
+ * Auto Bed Leveling
377
+ */
378
+#if ENABLED(AUTO_BED_LEVELING_FEATURE)
379
+
380
+  /**
381
+   * Delta has limited bed leveling options
382
+   */
383
+  #if ENABLED(DELTA) && DISABLED(AUTO_BED_LEVELING_GRID)
384
+    #error "You must use AUTO_BED_LEVELING_GRID for DELTA bed leveling."
385
+  #endif
386
+
387
+  /**
388
+   * Require a Z min pin
389
+   */
390
+  #if !PIN_EXISTS(Z_MIN)
391
+    #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.
392
+      #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."
393
+    #endif
394
+  #endif
395
+
396
+  /**
397
+   * Check if Probe_Offset * Grid Points is greater than Probing Range
398
+   */
399
+  #if ENABLED(AUTO_BED_LEVELING_GRID)
400
+    #ifndef DELTA_PROBEABLE_RADIUS
401
+      // Be sure points are in the right order
402
+      #if LEFT_PROBE_BED_POSITION > RIGHT_PROBE_BED_POSITION
403
+        #error "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION."
404
+      #elif FRONT_PROBE_BED_POSITION > BACK_PROBE_BED_POSITION
405
+        #error "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION."
406
+      #endif
407
+      // Make sure probing points are reachable
408
+      #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
409
+        #error "The given LEFT_PROBE_BED_POSITION can't be reached by the Z probe."
410
+      #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X
411
+        #error "The given RIGHT_PROBE_BED_POSITION can't be reached by the Z probe."
412
+      #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y
413
+        #error "The given FRONT_PROBE_BED_POSITION can't be reached by the Z probe."
414
+      #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y
415
+        #error "The given BACK_PROBE_BED_POSITION can't be reached by the Z probe."
416
+      #endif
417
+    #endif
418
+  #else // !AUTO_BED_LEVELING_GRID
419
+
420
+    // Check the triangulation points
421
+    #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X
422
+      #error "The given ABL_PROBE_PT_1_X can't be reached by the Z probe."
423
+    #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X
424
+      #error "The given ABL_PROBE_PT_2_X can't be reached by the Z probe."
425
+    #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X
426
+      #error "The given ABL_PROBE_PT_3_X can't be reached by the Z probe."
427
+    #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y
428
+      #error "The given ABL_PROBE_PT_1_Y can't be reached by the Z probe."
429
+    #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y
430
+      #error "The given ABL_PROBE_PT_2_Y can't be reached by the Z probe."
431
+    #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y
432
+      #error "The given ABL_PROBE_PT_3_Y can't be reached by the Z probe."
433
+    #endif
434
+
435
+  #endif // !AUTO_BED_LEVELING_GRID
436
+
437
+#endif // AUTO_BED_LEVELING_FEATURE
438
+
439
+/**
440
+ * Advance Extrusion
441
+ */
442
+#if ENABLED(ADVANCE) && ENABLED(LIN_ADVANCE)
443
+  #error "You can enable ADVANCE or LIN_ADVANCE, but not both."
444
+#endif
445
+
446
+/**
447
+ * Filament Width Sensor
448
+ */
449
+#if ENABLED(FILAMENT_WIDTH_SENSOR) && !HAS_FILAMENT_WIDTH_SENSOR
450
+  #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
451
+#endif
452
+
453
+/**
454
+ * ULTIPANEL encoder
455
+ */
456
+#if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
457
+  #error "ULTIPANEL requires some kind of encoder."
458
+#endif
459
+
460
+#if ENCODER_PULSES_PER_STEP < 0
461
+  #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead."
462
+#endif
463
+
464
+/**
465
+ * SAV_3DGLCD display options
466
+ */
467
+#if ENABLED(U8GLIB_SSD1306) && ENABLED(U8GLIB_SH1106)
468
+  #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
469
+#endif
470
+
471
+/**
472
+ * Don't set more than one kinematic type
473
+ */
474
+#if (ENABLED(DELTA) && (ENABLED(SCARA) || ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ))) \
475
+ || (ENABLED(SCARA) && (ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ))) \
476
+ || (ENABLED(COREXY) && (ENABLED(COREXZ) || ENABLED(COREYZ))) \
477
+ || (ENABLED(COREXZ) && ENABLED(COREYZ))
478
+  #error "Please enable only one of DELTA, SCARA, COREXY, COREXZ, or COREYZ."
479
+#endif
480
+
481
+/**
482
+ * Allen Key
483
+ * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
484
+ */
485
+#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
486
+  #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY"
487
+#endif
488
+
489
+/**
490
+ * Dual X Carriage requirements
491
+ */
492
+#if ENABLED(DUAL_X_CARRIAGE)
493
+  #if EXTRUDERS == 1
494
+    #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
495
+  #elif ENABLED(COREXY) || ENABLED(COREXZ)
496
+    #error "DUAL_X_CARRIAGE cannot be used with COREXY or COREXZ."
497
+  #elif !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR
498
+    #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
499
+  #elif !HAS_X_MAX
500
+    #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop."
501
+  #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
502
+    #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
503
+  #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1
504
+    #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1."
505
+  #endif
506
+#endif // DUAL_X_CARRIAGE
507
+
508
+/**
509
+ * Make sure auto fan pins don't conflict with the fan pin
510
+ */
511
+#if HAS_AUTO_FAN
512
+  #if HAS_FAN0
513
+    #if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN
514
+      #error "You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN."
515
+    #elif EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN
516
+      #error "You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to FAN_PIN."
517
+    #elif EXTRUDER_2_AUTO_FAN_PIN == FAN_PIN
518
+      #error "You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to FAN_PIN."
519
+    #elif EXTRUDER_3_AUTO_FAN_PIN == FAN_PIN
520
+      #error "You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to FAN_PIN."
521
+    #endif
522
+  #endif
523
+#endif
524
+
525
+#if HAS_FAN0 && CONTROLLERFAN_PIN == FAN_PIN
526
+  #error "You cannot set CONTROLLERFAN_PIN equal to FAN_PIN."
527
+#endif
528
+
529
+#if HAS_CONTROLLERFAN
530
+  #if EXTRUDER_0_AUTO_FAN_PIN == CONTROLLERFAN_PIN
531
+    #error "You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN."
532
+  #elif EXTRUDER_1_AUTO_FAN_PIN == CONTROLLERFAN_PIN
533
+    #error "You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN."
534
+  #elif EXTRUDER_2_AUTO_FAN_PIN == CONTROLLERFAN_PIN
535
+    #error "You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN."
536
+  #elif EXTRUDER_3_AUTO_FAN_PIN == CONTROLLERFAN_PIN
537
+    #error "You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to CONTROLLERFAN_PIN."
538
+  #endif
539
+#endif
540
+
541
+/**
542
+ * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set.
543
+ */
544
+#if !HAS_HEATER_0
545
+  #error "HEATER_0_PIN not defined for this board."
546
+#elif !PIN_EXISTS(TEMP_0)
547
+  #error "TEMP_0_PIN not defined for this board."
548
+#elif !PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE)
549
+  #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
550
+#elif TEMP_SENSOR_0 == 0
551
+  #error "TEMP_SENSOR_0 is required."
552
+#endif
553
+
554
+#if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)
555
+  #if !HAS_HEATER_1
556
+    #error "HEATER_1_PIN not defined for this board."
557
+  #endif
558
+#endif
559
+
560
+#if HOTENDS > 1
561
+  #if TEMP_SENSOR_1 == 0
562
+    #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
563
+  #elif !PIN_EXISTS(TEMP_1)
564
+    #error "TEMP_1_PIN not defined for this board."
565
+  #endif
566
+  #if HOTENDS > 2
567
+    #if TEMP_SENSOR_2 == 0
568
+      #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
569
+    #elif !HAS_HEATER_2
570
+      #error "HEATER_2_PIN not defined for this board."
571
+    #elif !PIN_EXISTS(TEMP_2)
572
+      #error "TEMP_2_PIN not defined for this board."
573
+    #endif
574
+    #if HOTENDS > 3
575
+      #if TEMP_SENSOR_3 == 0
576
+        #error "TEMP_SENSOR_3 is required with 4 HOTENDS."
577
+      #elif !HAS_HEATER_3
578
+        #error "HEATER_3_PIN not defined for this board."
579
+      #elif !PIN_EXISTS(TEMP_3)
580
+        #error "TEMP_3_PIN not defined for this board."
581
+      #endif
582
+    #elif TEMP_SENSOR_3 != 0
583
+      #error "TEMP_SENSOR_3 shouldn't be set with only 3 extruders."
584
+    #endif
585
+  #elif TEMP_SENSOR_2 != 0
586
+    #error "TEMP_SENSOR_2 shouldn't be set with only 2 extruders."
587
+  #elif TEMP_SENSOR_3 != 0
588
+    #error "TEMP_SENSOR_3 shouldn't be set with only 2 extruders."
589
+  #endif
590
+#elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT)
591
+  #error "TEMP_SENSOR_1 shouldn't be set with only 1 extruder."
592
+#elif TEMP_SENSOR_2 != 0
593
+  #error "TEMP_SENSOR_2 shouldn't be set with only 1 extruder."
594
+#elif TEMP_SENSOR_3 != 0
595
+  #error "TEMP_SENSOR_3 shouldn't be set with only 1 extruder."
596
+#endif
597
+
598
+#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0
599
+  #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
600
+#endif
601
+
602
+/**
603
+ * Basic 2-nozzle duplication mode
604
+ */
605
+#if ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
606
+  #if HOTENDS != 2
607
+    #error "DUAL_NOZZLE_DUPLICATION_MODE requires exactly 2 hotends."
608
+  #elif ENABLED(DUAL_X_CARRIAGE)
609
+    #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with DUAL_X_CARRIAGE."
610
+  #elif ENABLED(SINGLENOZZLE)
611
+    #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SINGLENOZZLE."
612
+  #elif ENABLED(MIXING_EXTRUDER)
613
+    #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with MIXING_EXTRUDER."
614
+  #elif ENABLED(SWITCHING_EXTRUDER)
615
+    #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SWITCHING_EXTRUDER."
616
+  #endif
617
+#endif
618
+
619
+/**
620
+ * Test Extruder Pins
621
+ */
622
+#if EXTRUDERS > 3
623
+  #if !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE)
624
+    #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
625
+  #endif
626
+#elif EXTRUDERS > 2
627
+  #if !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE)
628
+    #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
629
+  #endif
630
+#elif EXTRUDERS > 1
631
+  #if !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE)
632
+    #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
633
+  #endif
634
+#endif
635
+
636
+/**
637
+ * Endstops
638
+ */
639
+#if DISABLED(USE_XMIN_PLUG) && DISABLED(USE_XMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _XMAX_ && Z2_USE_ENDSTOP <= _XMIN_)
640
+ #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG"
641
+#elif DISABLED(USE_YMIN_PLUG) && DISABLED(USE_YMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _YMAX_ && Z2_USE_ENDSTOP <= _YMIN_)
642
+ #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG"
643
+#elif DISABLED(USE_ZMIN_PLUG) && DISABLED(USE_ZMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _ZMAX_ && Z2_USE_ENDSTOP <= _ZMIN_)
644
+ #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG"
645
+#elif ENABLED(Z_DUAL_ENDSTOPS) && !Z2_USE_ENDSTOP
646
+ #error "You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS"
647
+#endif
648
+
649
+/**
650
+ * emergency-command parser
651
+ */
652
+#if ENABLED(EMERGENCY_PARSER) && ENABLED(USBCON)
653
+  #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
654
+#endif
655
+
656
+ /**
657
+ * Warnings for old configurations
26 658
  */
27
-#error "Please remove all #include lines from your Configuration.h and Configuration_adv.h files!"
659
+#if WATCH_TEMP_PERIOD > 500
660
+  #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds."
661
+#elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
662
+  #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS."
663
+#elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
664
+  #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED."
665
+#elif ENABLED(COREXZ) && ENABLED(Z_LATE_ENABLE)
666
+  #error "Z_LATE_ENABLE can't be used with COREXZ."
667
+#elif defined(X_HOME_RETRACT_MM)
668
+  #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM."
669
+#elif defined(BEEPER)
670
+  #error "BEEPER is now BEEPER_PIN. Please update your pins definitions."
671
+#elif defined(SDCARDDETECT)
672
+  #error "SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions."
673
+#elif defined(SDCARDDETECTINVERTED)
674
+  #error "SDCARDDETECTINVERTED is now SD_DETECT_INVERTED. Please update your configuration."
675
+#elif defined(BTENABLED)
676
+  #error "BTENABLED is now BLUETOOTH. Please update your configuration."
677
+#elif defined(CUSTOM_MENDEL_NAME)
678
+  #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration."
679
+#elif defined(HAS_AUTOMATIC_VERSIONING)
680
+  #error "HAS_AUTOMATIC_VERSIONING is now USE_AUTOMATIC_VERSIONING. Please update your configuration."
681
+#elif defined(ENABLE_AUTO_BED_LEVELING)
682
+  #error "ENABLE_AUTO_BED_LEVELING is now AUTO_BED_LEVELING_FEATURE. Please update your configuration."
683
+#elif defined(SDSLOW)
684
+  #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead."
685
+#elif defined(SDEXTRASLOW)
686
+  #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead."
687
+#elif defined(Z_RAISE_BEFORE_HOMING)
688
+  #error "Z_RAISE_BEFORE_HOMING is deprecated. Use MIN_Z_HEIGHT_FOR_HOMING instead."
689
+#elif defined(FILAMENT_SENSOR)
690
+  #error "FILAMENT_SENSOR is deprecated. Use FILAMENT_WIDTH_SENSOR instead."
691
+#elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
692
+  #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead."
693
+#elif ENABLED(Z_DUAL_ENDSTOPS) && !defined(Z2_USE_ENDSTOP)
694
+  #error "Z_DUAL_ENDSTOPS settings are simplified. Just set Z2_USE_ENDSTOP to the endstop you want to repurpose for Z2"
695
+#elif defined(LANGUAGE_INCLUDE)
696
+  #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration."
697
+#elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y)
698
+  #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead."
699
+#elif defined(PID_PARAMS_PER_EXTRUDER)
700
+  #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead."
701
+#elif defined(EXTRUDER_WATTS)
702
+  #error "EXTRUDER_WATTS is deprecated. Use HOTEND_WATTS instead."
703
+#elif defined(SERVO_ENDSTOP_ANGLES)
704
+  #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
705
+#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
706
+  #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
707
+#elif defined(XY_TRAVEL_SPEED)
708
+  #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead."
709
+#elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
710
+  #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead."
711
+#elif defined(SERVO_DEACTIVATION_DELAY)
712
+  #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead."
713
+#elif ENABLED(FILAMENTCHANGEENABLE)
714
+  #error "FILAMENTCHANGEENABLE is now FILAMENT_CHANGE_FEATURE. Please update your configuration."
715
+#elif defined(PLA_PREHEAT_HOTEND_TEMP)
716
+  #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration."
717
+#elif defined(PLA_PREHEAT_HPB_TEMP)
718
+  #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration."
719
+#elif defined(PLA_PREHEAT_FAN_SPEED)
720
+  #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration."
721
+#elif defined(ABS_PREHEAT_HOTEND_TEMP)
722
+  #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration."
723
+#elif defined(ABS_PREHEAT_HPB_TEMP)
724
+  #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration."
725
+#elif defined(ABS_PREHEAT_FAN_SPEED)
726
+  #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration."
727
+#elif defined(ENDSTOPS_ONLY_FOR_HOMING)
728
+  #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead."
729
+#elif defined(HOMING_FEEDRATE)
730
+  #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead."
731
+#endif

Loading…
Cancel
Save