Subversion Repositories Tronxy-X3A-Marlin

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 ron 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.h
25
 *
26
 * Test configuration values for errors at compile-time.
27
 */
28
 
29
#ifndef _SANITYCHECK_H_
30
#define _SANITYCHECK_H_
31
 
32
/**
33
 * Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features.
34
 */
35
#if __cplusplus < 201103L
36
  #error "Marlin requires C++11 support (gcc >= 4.7, Arduino IDE >= 1.6.8). Please upgrade your toolchain."
37
#endif
38
 
39
/**
40
 * We try our best to include sanity checks for all changed configuration
41
 * directives because users have a tendency to use outdated config files with
42
 * the bleeding-edge source code, but sometimes this is not enough. This check
43
 * forces a minimum config file revision. Otherwise Marlin will not build.
44
 */
45
#define HEXIFY(H) _CAT(0x,H)
46
#if !defined(CONFIGURATION_H_VERSION) || HEXIFY(CONFIGURATION_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_H_VERSION)
47
  #error "You are using an old Configuration.h file, update it before building Marlin."
48
#endif
49
 
50
#if !defined(CONFIGURATION_ADV_H_VERSION) || HEXIFY(CONFIGURATION_ADV_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION)
51
  #error "You are using an old Configuration_adv.h file, update it before building Marlin."
52
#endif
53
 
54
/**
55
 * Warnings for old configurations
56
 */
57
#ifndef MOTHERBOARD
58
  #error "MOTHERBOARD is required. Please update your configuration."
59
#elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE)
60
  #error "X_BED_SIZE and Y_BED_SIZE are now required! Please update your configuration."
61
#elif WATCH_TEMP_PERIOD > 500
62
  #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds."
63
#elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
64
  #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS."
65
#elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
66
  #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED."
67
#elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE)
68
  #error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY."
69
#elif defined(X_HOME_RETRACT_MM)
70
  #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM."
71
#elif defined(SDCARDDETECTINVERTED)
72
  #error "SDCARDDETECTINVERTED is now SD_DETECT_INVERTED. Please update your configuration."
73
#elif defined(BTENABLED)
74
  #error "BTENABLED is now BLUETOOTH. Please update your configuration."
75
#elif defined(CUSTOM_MENDEL_NAME)
76
  #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration."
77
#elif defined(HAS_AUTOMATIC_VERSIONING)
78
  #error "HAS_AUTOMATIC_VERSIONING is now USE_AUTOMATIC_VERSIONING. Please update your configuration."
79
#elif defined(SDSLOW)
80
  #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead."
81
#elif defined(SDEXTRASLOW)
82
  #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead."
83
#elif defined(FILAMENT_SENSOR)
84
  #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration."
85
#elif defined(ENDSTOPPULLUP_FIL_RUNOUT)
86
  #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP. Please update your configuration."
87
#elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
88
  #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead."
89
#elif defined(LANGUAGE_INCLUDE)
90
  #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration."
91
#elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y)
92
  #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead."
93
#elif defined(PID_PARAMS_PER_EXTRUDER)
94
  #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead."
95
#elif defined(EXTRUDER_WATTS) || defined(BED_WATTS)
96
  #error "EXTRUDER_WATTS and BED_WATTS are deprecated. Remove them from your configuration."
97
#elif defined(SERVO_ENDSTOP_ANGLES)
98
  #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
99
#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
100
  #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
101
#elif defined(Z_ENDSTOP_SERVO_NR)
102
  #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR. Please update your configuration."
103
#elif defined(DEFAULT_XYJERK)
104
  #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead."
105
#elif defined(XY_TRAVEL_SPEED)
106
  #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead."
107
#elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
108
  #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead."
109
#elif defined(SERVO_DEACTIVATION_DELAY)
110
  #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead."
111
#elif ENABLED(FILAMENTCHANGEENABLE)
112
  #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE. Please update your configuration."
113
#elif ENABLED(FILAMENT_CHANGE_FEATURE)
114
  #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE. Please update your configuration."
115
#elif defined(FILAMENT_CHANGE_X_POS) || defined(FILAMENT_CHANGE_Y_POS)
116
  #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration."
117
#elif defined(FILAMENT_CHANGE_Z_ADD)
118
  #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration."
119
#elif defined(FILAMENT_CHANGE_XY_FEEDRATE)
120
  #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration."
121
#elif defined(FILAMENT_CHANGE_Z_FEEDRATE)
122
  #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration."
123
#elif defined(PAUSE_PARK_X_POS) || defined(PAUSE_PARK_Y_POS)
124
  #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration."
125
#elif defined(PAUSE_PARK_Z_ADD)
126
  #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration."
127
#elif defined(PAUSE_PARK_XY_FEEDRATE)
128
  #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration."
129
#elif defined(PAUSE_PARK_Z_FEEDRATE)
130
  #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration."
131
#elif defined(FILAMENT_CHANGE_RETRACT_FEEDRATE)
132
  #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE. Please update your configuration."
133
#elif defined(FILAMENT_CHANGE_RETRACT_LENGTH)
134
  #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH. Please update your configuration."
135
#elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE)
136
  #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration."
137
#elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE)
138
  #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration."
139
#elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH)
140
  #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration."
141
#elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH)
142
  #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration."
143
#elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT)
144
  #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT. Please update your configuration."
145
#elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS)
146
  #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS. Please update your configuration."
147
#elif ENABLED(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
148
  #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT. Please update your configuration."
149
#elif defined(PLA_PREHEAT_HOTEND_TEMP)
150
  #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration."
151
#elif defined(PLA_PREHEAT_HPB_TEMP)
152
  #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration."
153
#elif defined(PLA_PREHEAT_FAN_SPEED)
154
  #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration."
155
#elif defined(ABS_PREHEAT_HOTEND_TEMP)
156
  #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration."
157
#elif defined(ABS_PREHEAT_HPB_TEMP)
158
  #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration."
159
#elif defined(ABS_PREHEAT_FAN_SPEED)
160
  #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration."
161
#elif defined(ENDSTOPS_ONLY_FOR_HOMING)
162
  #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead."
163
#elif defined(HOMING_FEEDRATE)
164
  #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead."
165
#elif defined(MANUAL_HOME_POSITIONS)
166
  #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead."
167
#elif defined(PID_ADD_EXTRUSION_RATE)
168
  #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default. Are you sure you want to use this option? Please update your configuration."
169
#elif defined(Z_RAISE_BEFORE_HOMING)
170
  #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT. Please update your configuration."
171
#elif defined(MIN_Z_HEIGHT_FOR_HOMING)
172
  #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT. Please update your configuration."
173
#elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING)
174
  #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead."
175
#elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS)
176
  #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration."
177
#elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT)
178
  #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration."
179
#elif defined(MANUAL_BED_LEVELING)
180
  #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING. Please update your configuration."
181
#elif defined(MESH_HOME_SEARCH_Z)
182
  #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE. Please update your configuration."
183
#elif defined(MANUAL_PROBE_Z_RANGE)
184
  #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE. Please update your configuration."
185
#elif !defined(MIN_STEPS_PER_SEGMENT)
186
  #error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h.
187
#elif MIN_STEPS_PER_SEGMENT <= 0
188
  #error "MIN_STEPS_PER_SEGMENT must be at least 1. Please update your Configuration_adv.h."
189
#elif defined(PREVENT_DANGEROUS_EXTRUDE)
190
  #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION. Please update your configuration."
191
#elif defined(SCARA)
192
  #error "SCARA is now MORGAN_SCARA. Please update your configuration."
193
#elif defined(ENABLE_AUTO_BED_LEVELING)
194
  #error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
195
#elif defined(AUTO_BED_LEVELING_FEATURE)
196
  #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
197
#elif defined(ABL_GRID_POINTS)
198
  #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y. Please update your configuration."
199
#elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y)
200
  #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration."
201
#elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y)
202
  #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration."
203
#elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS)
204
  #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration."
205
#elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS)
206
  #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration."
207
#elif defined(UBL_G26_MESH_VALIDATION)
208
  #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION. Please update your configuration."
209
#elif defined(UBL_MESH_EDIT_ENABLED)
210
  #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION. Please update your configuration."
211
#elif defined(UBL_MESH_EDITING)
212
  #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION. Please update your configuration."
213
#elif defined(BLTOUCH_HEATERS_OFF)
214
  #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF. Please update your configuration."
215
#elif defined(BEEPER)
216
  #error "BEEPER is now BEEPER_PIN. Please update your pins definitions."
217
#elif defined(SDCARDDETECT)
218
  #error "SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions."
219
#elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE)
220
  #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN. Please update your pins definitions."
221
#elif defined(LCD_PIN_BL)
222
  #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN. Please update your pins definitions."
223
#elif defined(LCD_PIN_RESET)
224
  #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions."
225
#elif defined(EXTRUDER_0_AUTO_FAN_PIN) || defined(EXTRUDER_1_AUTO_FAN_PIN) || defined(EXTRUDER_2_AUTO_FAN_PIN) || defined(EXTRUDER_3_AUTO_FAN_PIN)
226
  #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h."
227
#elif defined(min_software_endstops) || defined(max_software_endstops)
228
  #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration."
229
#elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN)
230
  #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)."
231
#elif defined(CONTROLLERFAN_PIN)
232
  #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN. Please update your Configuration_adv.h."
233
#elif defined(MIN_RETRACT)
234
  #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h."
235
#elif defined(ADVANCE)
236
  #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE."
237
#elif defined(LIN_ADVANCE_E_D_RATIO)
238
  #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO. Check your configuration."
239
#elif defined(NEOPIXEL_RGBW_LED)
240
  #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration."
241
#elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS)
242
  #error "Remove DELTA_PROBEABLE_RADIUS and use MIN_PROBE_EDGE to inset the probe area instead."
243
#elif defined(UBL_MESH_INSET)
244
  #error "UBL_MESH_INSET is now just MESH_INSET. Please update your configuration."
245
#elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X)  || defined(UBL_MESH_MAX_Y)
246
  #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]. Please update your configuration."
247
#elif defined(ABL_PROBE_PT_1_X) || defined(ABL_PROBE_PT_1_Y) || defined(ABL_PROBE_PT_2_X) || defined(ABL_PROBE_PT_2_Y) || defined(ABL_PROBE_PT_3_X) || defined(ABL_PROBE_PT_3_Y)
248
  #error "ABL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration."
249
#elif defined(UBL_PROBE_PT_1_X) || defined(UBL_PROBE_PT_1_Y) || defined(UBL_PROBE_PT_2_X) || defined(UBL_PROBE_PT_2_Y) || defined(UBL_PROBE_PT_3_X) || defined(UBL_PROBE_PT_3_Y)
250
  #error "UBL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration."
251
#elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY)
252
  #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY. Please update your configuration."
253
#elif defined(BABYSTEP_ZPROBE_GFX_REVERSE)
254
  #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE. Please update your configurations."
255
#elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN)
256
  #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES. Please update your configuration."
257
#elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1))
258
  #error "K1 is now PID_K1. Please update your configuration."
259
#elif defined(PROBE_DOUBLE_TOUCH)
260
  #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING. Please update your configuration."
261
#elif defined(ANET_KEYPAD_LCD)
262
  #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD. Please update your configuration."
263
#elif defined(LCD_I2C_SAINSMART_YWROBOT)
264
  #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004). Please update your configuration."
265
#elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT)
266
  #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN. Please update your configuration."
267
#elif defined(HAVE_TMCDRIVER)
268
  #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
269
#elif defined(HAVE_TMC26X)
270
  #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
271
#elif defined(HAVE_TMC2130)
272
  #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h."
273
#elif defined(HAVE_L6470DRIVER)
274
  #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h."
275
#elif defined(X_IS_TMC) || defined(X2_IS_TMC) || defined(Y_IS_TMC) || defined(Y2_IS_TMC) || defined(Z_IS_TMC) || defined(Z2_IS_TMC) \
276
   || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC)
277
  #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
278
#elif defined(X_IS_TMC26X) || defined(X2_IS_TMC26X) || defined(Y_IS_TMC26X) || defined(Y2_IS_TMC26X) || defined(Z_IS_TMC26X) || defined(Z2_IS_TMC26X) \
279
   || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X)
280
  #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
281
#elif defined(X_IS_TMC2130) || defined(X2_IS_TMC2130) || defined(Y_IS_TMC2130) || defined(Y2_IS_TMC2130) || defined(Z_IS_TMC2130) || defined(Z2_IS_TMC2130) \
282
   || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130)
283
  #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h."
284
#elif defined(X_IS_TMC2208) || defined(X2_IS_TMC2208) || defined(Y_IS_TMC2208) || defined(Y2_IS_TMC2208) || defined(Z_IS_TMC2208) || defined(Z2_IS_TMC2208) \
285
   || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208)
286
  #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h."
287
#elif defined(X_IS_L6470) || defined(X2_IS_L6470) || defined(Y_IS_L6470) || defined(Y2_IS_L6470) || defined(Z_IS_L6470) || defined(Z2_IS_L6470) \
288
   || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470)
289
  #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h."
290
#elif defined(AUTOMATIC_CURRENT_CONTROL)
291
  #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration."
292
#elif defined(FILAMENT_CHANGE_LOAD_LENGTH)
293
  #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH. Please update your configuration."
294
#elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET)
295
  #error "LEVEL_BED_CORNERS requires a LEVEL_CORNERS_INSET value. Please update your Configuration.h."
296
#elif defined(BEZIER_JERK_CONTROL)
297
  #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration."
298
#elif defined(JUNCTION_DEVIATION_FACTOR)
299
  #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM. Please update your configuration."
300
#elif defined(JUNCTION_ACCELERATION_FACTOR)
301
  #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h."
302
#elif defined(JUNCTION_ACCELERATION)
303
  #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h."
304
#elif defined(MAX7219_DEBUG_STEPPER_HEAD)
305
  #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD. Please update your configuration."
306
#elif defined(MAX7219_DEBUG_STEPPER_TAIL)
307
  #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL. Please update your configuration."
308
#elif defined(MAX7219_DEBUG_STEPPER_QUEUE)
309
  #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE. Please update your configuration."
310
#endif
311
 
312
#define BOARD_MKS_13     -47
313
#define BOARD_TRIGORILLA -343
314
#if MB(MKS_13)
315
  #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration."
316
#elif MB(BOARD_TRIGORILLA)
317
  #error "BOARD_TRIGORILLA has been renamed BOARD_TRIGORILLA_13. Please update your configuration."
318
#endif
319
 
320
/**
321
 * Marlin release, version and default string
322
 */
323
#ifndef SHORT_BUILD_VERSION
324
  #error "SHORT_BUILD_VERSION must be specified."
325
#elif !defined(DETAILED_BUILD_VERSION)
326
  #error "BUILD_VERSION must be specified."
327
#elif !defined(STRING_DISTRIBUTION_DATE)
328
  #error "STRING_DISTRIBUTION_DATE must be specified."
329
#elif !defined(PROTOCOL_VERSION)
330
  #error "PROTOCOL_VERSION must be specified."
331
#elif !defined(MACHINE_NAME)
332
  #error "MACHINE_NAME must be specified."
333
#elif !defined(SOURCE_CODE_URL)
334
  #error "SOURCE_CODE_URL must be specified."
335
#elif !defined(DEFAULT_MACHINE_UUID)
336
  #error "DEFAULT_MACHINE_UUID must be specified."
337
#elif !defined(WEBSITE_URL)
338
  #error "WEBSITE_URL must be specified."
339
#endif
340
 
341
/**
342
 * Serial
343
 */
344
#if USE_MARLINSERIAL
345
  #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
346
    #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
347
  #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
348
    #error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
349
  #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
350
    #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256."
351
  #elif ENABLED(BLUETOOTH)
352
    #error "BLUETOOTH is only supported with AT90USB."
353
  #endif
354
#elif ENABLED(SERIAL_XON_XOFF) || ENABLED(SERIAL_STATS_MAX_RX_QUEUED) || ENABLED(SERIAL_STATS_DROPPED_RX)
355
  #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
356
#endif
357
 
358
#if SERIAL_PORT > 7
359
  #error "Set SERIAL_PORT to the port on your board. Usually this is 0."
360
#endif
361
 
362
/**
363
 * Dual Stepper Drivers
364
 */
365
#if ENABLED(X_DUAL_STEPPER_DRIVERS) && ENABLED(DUAL_X_CARRIAGE)
366
  #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS."
367
#elif ENABLED(X_DUAL_STEPPER_DRIVERS) && (!HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR)
368
  #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)."
369
#elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && (!HAS_Y2_ENABLE || !HAS_Y2_STEP || !HAS_Y2_DIR)
370
  #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)."
371
#elif ENABLED(Z_DUAL_STEPPER_DRIVERS) && (!HAS_Z2_ENABLE || !HAS_Z2_STEP || !HAS_Z2_DIR)
372
  #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)."
373
#endif
374
 
375
/**
376
 * Validate that the bed size fits
377
 */
378
static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
379
  "Movement bounds ([XY]_MIN_POS, [XY]_MAX_POS) are too narrow to contain [XY]_BED_SIZE.");
380
 
381
/**
382
 * Granular software endstops (Marlin >= 1.1.7)
383
 */
384
#if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z)
385
  #if IS_KINEMATIC
386
    #error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z."
387
  #elif DISABLED(MIN_SOFTWARE_ENDSTOP_X) && DISABLED(MIN_SOFTWARE_ENDSTOP_Y)
388
    #error "MIN_SOFTWARE_ENDSTOPS requires at least one of the MIN_SOFTWARE_ENDSTOP_[XYZ] options."
389
  #endif
390
#endif
391
 
392
#if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z)
393
  #if IS_KINEMATIC
394
    #error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z."
395
  #elif DISABLED(MAX_SOFTWARE_ENDSTOP_X) && DISABLED(MAX_SOFTWARE_ENDSTOP_Y)
396
    #error "MAX_SOFTWARE_ENDSTOPS requires at least one of the MAX_SOFTWARE_ENDSTOP_[XYZ] options."
397
  #endif
398
#endif
399
 
400
/**
401
 * Progress Bar
402
 */
403
#if ENABLED(LCD_PROGRESS_BAR)
404
  #if DISABLED(SDSUPPORT) && DISABLED(LCD_SET_PROGRESS_MANUALLY)
405
    #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY."
406
  #elif ENABLED(DOGLCD)
407
    #error "LCD_PROGRESS_BAR does not apply to graphical displays."
408
  #elif DISABLED(ULTIPANEL)
409
    #error "LCD_PROGRESS_BAR requires a character LCD."
410
  #elif ENABLED(FILAMENT_LCD_DISPLAY)
411
    #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both."
412
  #endif
413
#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && DISABLED(DOGLCD)
414
  #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR or Graphical LCD."
415
#endif
416
 
417
/**
418
 * Custom Boot and Status screens
419
 */
420
#if DISABLED(DOGLCD) && (ENABLED(SHOW_CUSTOM_BOOTSCREEN) || ENABLED(CUSTOM_STATUS_SCREEN_IMAGE))
421
  #error "Graphical LCD is required for SHOW_CUSTOM_BOOTSCREEN and CUSTOM_STATUS_SCREEN_IMAGE."
422
#endif
423
 
424
/**
425
 * SD File Sorting
426
 */
427
#if ENABLED(SDCARD_SORT_ALPHA)
428
  #if SDSORT_LIMIT > 256
429
    #error "SDSORT_LIMIT must be 256 or smaller."
430
  #elif SDSORT_LIMIT < 10
431
    #error "SDSORT_LIMIT should be greater than 9 to be useful."
432
  #elif DISABLED(SDSORT_USES_RAM)
433
    #if ENABLED(SDSORT_DYNAMIC_RAM)
434
      #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)."
435
    #elif ENABLED(SDSORT_CACHE_NAMES)
436
      #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)."
437
    #endif
438
  #endif
439
 
440
  #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
441
    #if SDSORT_CACHE_VFATS < 2
442
      #error "SDSORT_CACHE_VFATS must be 2 or greater!"
443
    #elif SDSORT_CACHE_VFATS > MAX_VFAT_ENTRIES
444
      #undef SDSORT_CACHE_VFATS
445
      #define SDSORT_CACHE_VFATS MAX_VFAT_ENTRIES
446
      #warning "SDSORT_CACHE_VFATS was reduced to MAX_VFAT_ENTRIES!"
447
    #endif
448
  #endif
449
#endif
450
 
451
/**
452
 * I2C Position Encoders
453
 */
454
#if ENABLED(I2C_POSITION_ENCODERS)
455
  #if DISABLED(BABYSTEPPING) || DISABLED(BABYSTEP_XY)
456
    #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY."
457
  #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5)
458
    #error "I2CPE_ENCODER_CNT must be between 1 and 5."
459
  #endif
460
#endif
461
 
462
/**
463
 * Babystepping
464
 */
465
#if ENABLED(BABYSTEPPING)
466
  #if ENABLED(SCARA)
467
    #error "BABYSTEPPING is not implemented for SCARA yet."
468
  #elif ENABLED(HANGPRINTER)
469
    #error "BABYSTEPPING is not implemented for HANGPRINTER."
470
  #elif ENABLED(DELTA) && ENABLED(BABYSTEP_XY)
471
    #error "BABYSTEPPING only implemented for Z axis on deltabots."
472
  #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && ENABLED(MESH_BED_LEVELING)
473
    #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
474
  #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
475
    #error "BABYSTEP_ZPROBE_OFFSET requires a probe."
476
  #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !ENABLED(DOGLCD)
477
    #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD."
478
  #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !ENABLED(BABYSTEP_ZPROBE_OFFSET)
479
    #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
480
  #endif
481
#endif
482
 
483
/**
484
 * Filament Runout needs one or more pins and either SD Support or Auto print start detection
485
 */
486
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
487
  #if !PIN_EXISTS(FIL_RUNOUT)
488
    #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
489
  #elif NUM_RUNOUT_SENSORS > E_STEPPERS
490
    #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers."
491
  #elif NUM_RUNOUT_SENSORS > 1 && !PIN_EXISTS(FIL_RUNOUT2)
492
    #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 1 requires FIL_RUNOUT2_PIN."
493
  #elif NUM_RUNOUT_SENSORS > 2 && !PIN_EXISTS(FIL_RUNOUT3)
494
    #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 2 requires FIL_RUNOUT3_PIN."
495
  #elif NUM_RUNOUT_SENSORS > 3 && !PIN_EXISTS(FIL_RUNOUT4)
496
    #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 3 requires FIL_RUNOUT4_PIN."
497
  #elif NUM_RUNOUT_SENSORS > 4 && !PIN_EXISTS(FIL_RUNOUT5)
498
    #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 4 requires FIL_RUNOUT5_PIN."
499
  #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART)
500
    #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART."
501
  #elif DISABLED(ADVANCED_PAUSE_FEATURE)
502
    static_assert(NULL == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
503
  #endif
504
#endif
505
 
506
/**
507
 * Advanced Pause
508
 */
509
#if ENABLED(ADVANCED_PAUSE_FEATURE)
510
  #if !HAS_RESUME_CONTINUE
511
    #error "ADVANCED_PAUSE_FEATURE currently requires an LCD controller or EMERGENCY_PARSER."
512
  #elif ENABLED(EXTRUDER_RUNOUT_PREVENT)
513
    #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
514
  #elif ENABLED(PARK_HEAD_ON_PAUSE) && DISABLED(SDSUPPORT) && DISABLED(NEWPANEL) && DISABLED(EMERGENCY_PARSER)
515
    #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller."
516
  #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
517
    #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT."
518
  #elif DISABLED(NOZZLE_PARK_FEATURE)
519
    #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE."
520
  #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH
521
    #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
522
  #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH
523
    #error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
524
  #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH
525
    #error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
526
  #endif
527
#endif
528
 
529
/**
530
 * Individual axis homing is useless for DELTAS
531
 */
532
#if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU)
533
  #if ENABLED(DELTA)
534
    #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
535
  #elif ENABLED(HANGPRINTER)
536
    #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with HANGPRINTER kinematics."
537
  #endif
538
#endif
539
 
540
/**
541
 * Options only for EXTRUDERS > 1
542
 */
543
#if EXTRUDERS > 1
544
 
545
  #if EXTRUDERS > 5
546
    #error "Marlin supports a maximum of 5 EXTRUDERS."
547
  #endif
548
 
549
  #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
550
    #error "EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT."
551
  #endif
552
 
553
  #if ENABLED(HEATERS_PARALLEL)
554
    #error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
555
  #endif
556
 
557
#elif ENABLED(MK2_MULTIPLEXER)
558
  #error "MK2_MULTIPLEXER requires 2 or more EXTRUDERS."
559
#elif ENABLED(SINGLENOZZLE)
560
  #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
561
#endif
562
 
563
/**
564
 * Sanity checking for the Průša MK2 Multiplexer
565
 */
566
#ifdef SNMM
567
  #error "SNMM is now MK2_MULTIPLEXER. Please update your configuration."
568
#endif
569
 
570
/**
571
 * A Dual Nozzle carriage with switching servo
572
 */
573
#if ENABLED(SWITCHING_NOZZLE)
574
  #if ENABLED(DUAL_X_CARRIAGE)
575
    #error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible."
576
  #elif ENABLED(SINGLENOZZLE)
577
    #error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible."
578
  #elif EXTRUDERS != 2
579
    #error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
580
  #elif NUM_SERVOS < 1
581
    #error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1."
582
  #endif
583
#endif
584
 
585
/**
586
 * Single Stepper Dual Extruder with switching servo
587
 */
588
#if ENABLED(SWITCHING_EXTRUDER) && NUM_SERVOS < 1
589
  #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
590
#endif
591
 
592
/**
593
 * Mixing Extruder requirements
594
 */
595
#if ENABLED(MIXING_EXTRUDER)
596
  #if EXTRUDERS > 1
597
    #error "MIXING_EXTRUDER currently only supports one extruder."
598
  #elif MIXING_STEPPERS < 2
599
    #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
600
  #elif ENABLED(FILAMENT_SENSOR)
601
    #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway."
602
  #elif ENABLED(SWITCHING_EXTRUDER)
603
    #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both."
604
  #elif ENABLED(SINGLENOZZLE)
605
    #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE."
606
  #elif ENABLED(LIN_ADVANCE)
607
    #error "MIXING_EXTRUDER is incompatible with LIN_ADVANCE."
608
  #endif
609
#endif
610
 
611
/**
612
 * Linear Advance 1.5 - Check K value range
613
 */
614
#if ENABLED(LIN_ADVANCE)
615
  static_assert(
616
    WITHIN(LIN_ADVANCE_K, 0, 10),
617
    "LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)."
618
  );
619
#endif
620
 
621
/**
622
 * Parking Extruder requirements
623
 */
624
#if ENABLED(PARKING_EXTRUDER)
625
  #if ENABLED(DUAL_X_CARRIAGE)
626
    #error "PARKING_EXTRUDER and DUAL_X_CARRIAGE are incompatible."
627
  #elif ENABLED(SINGLENOZZLE)
628
    #error "PARKING_EXTRUDER and SINGLENOZZLE are incompatible."
629
  #elif ENABLED(EXT_SOLENOID)
630
    #error "PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)"
631
  #elif EXTRUDERS != 2
632
    #error "PARKING_EXTRUDER requires exactly 2 EXTRUDERS."
633
  #elif !PIN_EXISTS(SOL0) || !PIN_EXISTS(SOL1)
634
    #error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN."
635
  #elif !defined(PARKING_EXTRUDER_PARKING_X)
636
    #error "PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X."
637
  #elif !defined(PARKING_EXTRUDER_SECURITY_RAISE)
638
    #error "PARKING_EXTRUDER requires PARKING_EXTRUDER_SECURITY_RAISE."
639
  #elif PARKING_EXTRUDER_SECURITY_RAISE < 0
640
    #error "PARKING_EXTRUDER_SECURITY_RAISE must be 0 or higher."
641
  #elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH)
642
    #error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW."
643
  #elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000)
644
    #error "PARKING_EXTRUDER_SOLENOIDS_DELAY must be between 0 and 2000 (ms)."
645
  #endif
646
#endif
647
 
648
/**
649
 * Part-Cooling Fan Multiplexer requirements
650
 */
651
#if PIN_EXISTS(FANMUX1)
652
  #if !HAS_FANMUX
653
    #error "FANMUX0_PIN must be set before FANMUX1_PIN can be set."
654
  #endif
655
#elif PIN_EXISTS(FANMUX2)
656
  #error "FANMUX0_PIN and FANMUX1_PIN must be set before FANMUX2_PIN can be set."
657
#endif
658
 
659
/**
660
 * Limited number of servos
661
 */
662
#if NUM_SERVOS > 4
663
  #error "The maximum number of SERVOS in Marlin is 4."
664
#endif
665
 
666
/**
667
 * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder
668
 */
669
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_PROBE && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR)
670
  #error "Z_PROBE_SERVO_NR, switching nozzle, or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE."
671
#endif
672
 
673
/**
674
 * Required LCD language
675
 */
676
#if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780)
677
  #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller."
678
#endif
679
 
680
/**
681
 * Bed Heating Options - PID vs Limit Switching
682
 */
683
#if ENABLED(PIDTEMPBED) && ENABLED(BED_LIMIT_SWITCHING)
684
  #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED."
685
#endif
686
 
687
/**
688
 * Kinematics
689
 */
690
 
691
/**
692
 * Allow only one kinematic type to be defined
693
 */
694
#if 1 < 0 \
695
  + ENABLED(HANGPRINTER) \
696
  + ENABLED(DELTA) \
697
  + ENABLED(MORGAN_SCARA) \
698
  + ENABLED(MAKERARM_SCARA) \
699
  + ENABLED(COREXY) \
700
  + ENABLED(COREXZ) \
701
  + ENABLED(COREYZ) \
702
  + ENABLED(COREYX) \
703
  + ENABLED(COREZX) \
704
  + ENABLED(COREZY)
705
  #error "Please enable only one of HANGPRINTER, DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY."
706
#endif
707
 
708
/**
709
 * Delta requirements
710
 */
711
#if ENABLED(DELTA)
712
  #if DISABLED(USE_XMAX_PLUG) && DISABLED(USE_YMAX_PLUG) && DISABLED(USE_ZMAX_PLUG)
713
    #error "You probably want to use Max Endstops for DELTA!"
714
  #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED
715
    #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
716
  #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || ENABLED(ULTIPANEL))
717
    #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
718
  #elif ABL_GRID
719
    #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0
720
      #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
721
    #elif GRID_MAX_POINTS_X < 3
722
      #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher."
723
    #endif
724
  #endif
725
#endif
726
 
727
/**
728
 * Hangprinter requirements
729
 */
730
#if ENABLED(HANGPRINTER)
731
  #if EXTRUDERS > 4
732
    #error "Marlin supports a maximum of 4 EXTRUDERS when driving a Hangprinter."
733
  #elif ENABLED(CONVENTIONAL_GEOMETRY)
734
    #if ANCHOR_A_Y > 0
735
      #error "ANCHOR_A_Y should be negative by convention."
736
    #elif (ANCHOR_B_X) * (ANCHOR_C_X) > 0
737
      #error "ANCHOR_B_X and ANCHOR_C_X should have opposite signs by convention."
738
    #elif ANCHOR_B_Y < 0
739
      #error "ANCHOR_B_Y should be positive by convention."
740
    #elif ANCHOR_C_Y < 0
741
      #error "ANCHOR_C_Y should be positive by convention."
742
    #elif ANCHOR_A_Z > 0
743
      #error "ANCHOR_A_Z should be negative by convention."
744
    #elif ANCHOR_B_Z > 0
745
      #error "ANCHOR_B_Z should be negative by convention."
746
    #elif ANCHOR_C_Z > 0
747
      #error "ANCHOR_C_Z should be negative by convention."
748
    #elif ANCHOR_D_Z < 0
749
      #error "ANCHOR_D_Z should be positive by convention."
750
    #endif
751
  #endif
752
#elif ENABLED(LINE_BUILDUP_COMPENSATION_FEATURE)
753
  #error "LINE_BUILDUP_COMPENSATION_FEATURE is only compatible with HANGPRINTER."
754
#endif
755
 
756
/**
757
 * Mechaduino requirements
758
 */
759
#if ENABLED(MECHADUINO_I2C_COMMANDS) && DISABLED(EXPERIMENTAL_I2CBUS)
760
  #error "MECHADUINO_I2C_COMMANDS requires EXPERIMENTAL_I2CBUS to be enabled."
761
#endif
762
 
763
/**
764
 * Probes
765
 */
766
 
767
/**
768
 * Allow only one probe option to be defined
769
 */
770
#if 1 < 0 \
771
  + ENABLED(PROBE_MANUALLY) \
772
  + ENABLED(FIX_MOUNTED_PROBE) \
773
  + (HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH)) \
774
  + ENABLED(BLTOUCH) \
775
  + ENABLED(SOLENOID_PROBE) \
776
  + ENABLED(Z_PROBE_ALLEN_KEY) \
777
  + ENABLED(Z_PROBE_SLED)
778
  #error "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
779
#endif
780
 
781
#if HAS_BED_PROBE
782
 
783
  /**
784
   * Z_PROBE_SLED is incompatible with DELTA
785
   */
786
  #if ENABLED(Z_PROBE_SLED) && ENABLED(DELTA)
787
    #error "You cannot use Z_PROBE_SLED with DELTA."
788
  #endif
789
 
790
  /**
791
   * SOLENOID_PROBE requirements
792
   */
793
  #if ENABLED(SOLENOID_PROBE)
794
    #if ENABLED(EXT_SOLENOID)
795
      #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID."
796
    #elif !HAS_SOLENOID_1
797
      #error "SOLENOID_PROBE requires SOL1_PIN. It can be added to your Configuration.h."
798
    #endif
799
  #endif
800
 
801
  /**
802
   * NUM_SERVOS is required for a Z servo probe
803
   */
804
  #if HAS_Z_SERVO_PROBE
805
    #ifndef NUM_SERVOS
806
      #error "You must set NUM_SERVOS for a Z servo probe (Z_PROBE_SERVO_NR)."
807
    #elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
808
      #error "SERVO0_PIN must be defined for your servo or BLTOUCH probe."
809
    #elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
810
      #error "SERVO1_PIN must be defined for your servo or BLTOUCH probe."
811
    #elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
812
      #error "SERVO2_PIN must be defined for your servo or BLTOUCH probe."
813
    #elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
814
      #error "SERVO3_PIN must be defined for your servo or BLTOUCH probe."
815
    #elif Z_PROBE_SERVO_NR >= NUM_SERVOS
816
      #error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS."
817
    #endif
818
  #endif
819
 
820
  /**
821
   * Require pin options and pins to be defined
822
   */
823
  #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
824
    #if ENABLED(Z_MIN_PROBE_ENDSTOP)
825
      #error "Enable only one option: Z_MIN_PROBE_ENDSTOP or Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN."
826
    #elif DISABLED(USE_ZMIN_PLUG)
827
      #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled."
828
    #elif !HAS_Z_MIN
829
      #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined."
830
    #elif Z_MIN_PROBE_ENDSTOP_INVERTING != Z_MIN_ENDSTOP_INVERTING
831
      #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING."
832
    #endif
833
  #elif ENABLED(Z_MIN_PROBE_ENDSTOP)
834
    #if !HAS_Z_MIN_PROBE_PIN
835
      #error "Z_MIN_PROBE_ENDSTOP requires the Z_MIN_PROBE_PIN to be defined."
836
    #endif
837
  #else
838
    #error "You must enable either Z_MIN_PROBE_ENDSTOP or Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use a probe."
839
  #endif
840
 
841
  /**
842
   * Make sure Z raise values are set
843
   */
844
  #ifndef Z_CLEARANCE_DEPLOY_PROBE
845
    #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration."
846
  #elif !defined(Z_CLEARANCE_BETWEEN_PROBES)
847
    #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration."
848
  #elif Z_CLEARANCE_DEPLOY_PROBE < 0
849
    #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0."
850
  #elif Z_CLEARANCE_BETWEEN_PROBES < 0
851
    #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
852
  #elif Z_AFTER_PROBING < 0
853
    #error "Probes need Z_AFTER_PROBING >= 0."
854
  #endif
855
 
856
  #if MULTIPLE_PROBING && MULTIPLE_PROBING < 2
857
    #error "MULTIPLE_PROBING must be >= 2."
858
  #endif
859
 
860
  #if Z_PROBE_LOW_POINT > 0
861
    #error "Z_PROBE_LOW_POINT must be less than or equal to 0."
862
  #endif
863
 
864
  static_assert(int(X_PROBE_OFFSET_FROM_EXTRUDER) == (X_PROBE_OFFSET_FROM_EXTRUDER), "X_PROBE_OFFSET_FROM_EXTRUDER must be an integer value.");
865
  static_assert(int(Y_PROBE_OFFSET_FROM_EXTRUDER) == (Y_PROBE_OFFSET_FROM_EXTRUDER), "Y_PROBE_OFFSET_FROM_EXTRUDER must be an integer value.");
866
 
867
#else
868
 
869
  /**
870
   * Require some kind of probe for bed leveling and probe testing
871
   */
872
  #if OLDSCHOOL_ABL && !PROBE_SELECTED
873
    #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo."
874
  #endif
875
 
876
  #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
877
    #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe: FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
878
  #endif
879
 
880
#endif
881
 
882
/**
883
 * Allow only one bed leveling option to be defined
884
 */
885
#if 1 < 0 \
886
  + ENABLED(AUTO_BED_LEVELING_LINEAR) \
887
  + ENABLED(AUTO_BED_LEVELING_3POINT) \
888
  + ENABLED(AUTO_BED_LEVELING_BILINEAR) \
889
  + ENABLED(AUTO_BED_LEVELING_UBL) \
890
  + ENABLED(MESH_BED_LEVELING)
891
  #error "Select only one of: MESH_BED_LEVELING, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
892
#endif
893
 
894
/**
895
 * Bed Leveling Requirements
896
 */
897
 
898
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_3POINT)
899
  static_assert(WITHIN(PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_1_X is outside the probe region.");
900
  static_assert(WITHIN(PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_2_X is outside the probe region.");
901
  static_assert(WITHIN(PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_3_X is outside the probe region.");
902
  static_assert(WITHIN(PROBE_PT_1_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_1_Y is outside the probe region.");
903
  static_assert(WITHIN(PROBE_PT_2_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_2_Y is outside the probe region.");
904
  static_assert(WITHIN(PROBE_PT_3_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_3_Y is outside the probe region.");
905
#endif
906
 
907
#if ENABLED(AUTO_BED_LEVELING_UBL)
908
 
909
  /**
910
   * Unified Bed Leveling
911
   */
912
 
913
  // Hide PROBE_MANUALLY from the rest of the code
914
  #undef PROBE_MANUALLY
915
 
916
  #if IS_SCARA
917
    #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
918
  #elif DISABLED(EEPROM_SETTINGS)
919
    #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration."
920
  #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
921
    #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
922
  #elif !defined(RESTORE_LEVELING_AFTER_G28)
923
    #error "AUTO_BED_LEVELING_UBL used to enable RESTORE_LEVELING_AFTER_G28. To keep this behavior enable RESTORE_LEVELING_AFTER_G28. Otherwise define it as 'false'."
924
  #endif
925
 
926
#elif OLDSCHOOL_ABL
927
 
928
  /**
929
   * Auto Bed Leveling
930
   */
931
 
932
  /**
933
   * Delta and SCARA have limited bed leveling options
934
   */
935
  #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR)
936
    #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option."
937
  #endif
938
 
939
  /**
940
   * Check auto bed leveling probe points
941
   */
942
  #if ABL_GRID
943
 
944
    static_assert(LEFT_PROBE_BED_POSITION < RIGHT_PROBE_BED_POSITION, "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION.");
945
    static_assert(FRONT_PROBE_BED_POSITION < BACK_PROBE_BED_POSITION, "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION.");
946
    static_assert(LEFT_PROBE_BED_POSITION >= MIN_PROBE_X, "LEFT_PROBE_BED_POSITION is outside the probe region.");
947
    static_assert(RIGHT_PROBE_BED_POSITION <= MAX_PROBE_X, "RIGHT_PROBE_BED_POSITION is outside the probe region.");
948
    static_assert(FRONT_PROBE_BED_POSITION >= MIN_PROBE_Y, "FRONT_PROBE_BED_POSITION is outside the probe region.");
949
    static_assert(BACK_PROBE_BED_POSITION <= MAX_PROBE_Y, "BACK_PROBE_BED_POSITION is outside the probe region.");
950
 
951
  #endif // AUTO_BED_LEVELING_3POINT
952
 
953
#elif ENABLED(MESH_BED_LEVELING)
954
 
955
  // Hide PROBE_MANUALLY from the rest of the code
956
  #undef PROBE_MANUALLY
957
 
958
  /**
959
   * Mesh Bed Leveling
960
   */
961
 
962
  #if ENABLED(DELTA)
963
    #error "MESH_BED_LEVELING is not compatible with DELTA printers."
964
  #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9
965
    #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
966
  #endif
967
 
968
#endif
969
 
970
#if HAS_MESH
971
  static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
972
#elif ENABLED(G26_MESH_VALIDATION)
973
  #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
974
#endif
975
 
976
#if ENABLED(MESH_EDIT_GFX_OVERLAY) && (DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(DOGLCD))
977
  #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD."
978
#endif
979
 
980
/**
981
 * LCD_BED_LEVELING requirements
982
 */
983
#if ENABLED(LCD_BED_LEVELING)
984
  #if DISABLED(ULTIPANEL)
985
    #error "LCD_BED_LEVELING requires an LCD controller."
986
  #elif !(ENABLED(MESH_BED_LEVELING) || OLDSCHOOL_ABL)
987
    #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
988
  #endif
989
#endif
990
 
991
/**
992
 * Homing
993
 */
994
#if X_HOME_BUMP_MM < 0 || Y_HOME_BUMP_MM < 0 || Z_HOME_BUMP_MM < 0
995
  #error "[XYZ]_HOME_BUMP_MM must be greater than or equal to 0."
996
#endif
997
 
998
#if ENABLED(CODEPENDENT_XY_HOMING)
999
  #if ENABLED(QUICK_HOME)
1000
    #error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING."
1001
  #elif IS_KINEMATIC
1002
    #error "CODEPENDENT_XY_HOMING requires a Cartesian setup."
1003
  #endif
1004
#endif
1005
 
1006
/**
1007
 * Make sure Z_SAFE_HOMING point is reachable
1008
 */
1009
#if ENABLED(Z_SAFE_HOMING)
1010
  #if HAS_BED_PROBE
1011
    static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, MIN_PROBE_X, MAX_PROBE_X), "Z_SAFE_HOMING_X_POINT is outside the probe region.");
1012
    static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, MIN_PROBE_Y, MAX_PROBE_Y), "Z_SAFE_HOMING_Y_POINT is outside the probe region.");
1013
  #else
1014
    static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, X_MIN_POS, X_MAX_POS), "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle.");
1015
    static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
1016
  #endif
1017
#endif // Z_SAFE_HOMING
1018
 
1019
/**
1020
 * Make sure DISABLE_[XYZ] compatible with selected homing options
1021
 */
1022
#if ENABLED(DISABLE_X) || ENABLED(DISABLE_Y) || ENABLED(DISABLE_Z)
1023
  #if ENABLED(HOME_AFTER_DEACTIVATE) || ENABLED(Z_SAFE_HOMING)
1024
    #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
1025
  #endif
1026
#endif // DISABLE_[XYZ]
1027
 
1028
/**
1029
 * Filament Width Sensor
1030
 */
1031
#if ENABLED(FILAMENT_WIDTH_SENSOR)
1032
  #if !HAS_FILAMENT_WIDTH_SENSOR
1033
    #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
1034
  #elif ENABLED(NO_VOLUMETRICS)
1035
    #error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled."
1036
  #endif
1037
#endif
1038
 
1039
/**
1040
 * ULTIPANEL encoder
1041
 */
1042
#if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
1043
  #error "ULTIPANEL requires some kind of encoder."
1044
#endif
1045
 
1046
#if ENCODER_PULSES_PER_STEP < 0
1047
  #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead."
1048
#endif
1049
 
1050
/**
1051
 * SAV_3DGLCD display options
1052
 */
1053
#if ENABLED(SAV_3DGLCD)
1054
  #if DISABLED(U8GLIB_SSD1306) && DISABLED(U8GLIB_SH1106)
1055
    #error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
1056
  #elif ENABLED(U8GLIB_SSD1306) && ENABLED(U8GLIB_SH1106)
1057
    #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
1058
  #endif
1059
#endif
1060
 
1061
/**
1062
 * Allen Key
1063
 * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
1064
 */
1065
#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
1066
  #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY"
1067
#endif
1068
 
1069
/**
1070
 * Dual X Carriage requirements
1071
 */
1072
#if ENABLED(DUAL_X_CARRIAGE)
1073
  #if EXTRUDERS == 1
1074
    #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
1075
  #elif CORE_IS_XY || CORE_IS_XZ
1076
    #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, or COREZX."
1077
  #elif !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR
1078
    #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
1079
  #elif !HAS_X_MAX
1080
    #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop."
1081
  #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
1082
    #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
1083
  #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1
1084
    #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1."
1085
  #endif
1086
#endif // DUAL_X_CARRIAGE
1087
 
1088
/**
1089
 * Make sure auto fan pins don't conflict with the fan pin
1090
 */
1091
#if HAS_AUTO_FAN
1092
  #if HAS_FAN0
1093
    #if E0_AUTO_FAN_PIN == FAN_PIN
1094
      #error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
1095
    #elif E1_AUTO_FAN_PIN == FAN_PIN
1096
      #error "You cannot set E1_AUTO_FAN_PIN equal to FAN_PIN."
1097
    #elif E2_AUTO_FAN_PIN == FAN_PIN
1098
      #error "You cannot set E2_AUTO_FAN_PIN equal to FAN_PIN."
1099
    #elif E3_AUTO_FAN_PIN == FAN_PIN
1100
      #error "You cannot set E3_AUTO_FAN_PIN equal to FAN_PIN."
1101
    #endif
1102
  #endif
1103
#endif
1104
 
1105
#if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN
1106
  #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."
1107
#endif
1108
 
1109
#if ENABLED(USE_CONTROLLER_FAN)
1110
  #if !HAS_CONTROLLER_FAN
1111
    #error "USE_CONTROLLER_FAN requires a CONTROLLER_FAN_PIN. Define in Configuration_adv.h."
1112
  #elif E0_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
1113
    #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
1114
  #elif E1_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
1115
    #error "You cannot set E1_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
1116
  #elif E2_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
1117
    #error "You cannot set E2_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
1118
  #elif E3_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
1119
    #error "You cannot set E3_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
1120
  #endif
1121
#endif
1122
 
1123
/**
1124
 * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set.
1125
 */
1126
#if !HAS_HEATER_0
1127
  #error "HEATER_0_PIN not defined for this board."
1128
#elif !PIN_EXISTS(TEMP_0) && !(defined(MAX6675_SS) && MAX6675_SS >= 0)
1129
  #error "TEMP_0_PIN not defined for this board."
1130
#elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR)))
1131
  #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
1132
#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE)))
1133
  #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
1134
#elif TEMP_SENSOR_0 == 0
1135
  #error "TEMP_SENSOR_0 is required."
1136
#endif
1137
 
1138
// Pins are required for heaters
1139
#if ENABLED(HEATER_0_USES_MAX6675) && !(defined(MAX6675_SS) && MAX6675_SS >= 0)
1140
  #error "MAX6675_SS (required for TEMP_SENSOR_0) not defined for this board."
1141
#elif (HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)) && !HAS_HEATER_1
1142
  #error "HEATER_1_PIN not defined for this board."
1143
#endif
1144
 
1145
#if HOTENDS > 1
1146
  #if TEMP_SENSOR_1 == 0
1147
    #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
1148
  #elif !PIN_EXISTS(TEMP_1)
1149
    #error "TEMP_1_PIN not defined for this board."
1150
  #endif
1151
  #if HOTENDS > 2
1152
    #if TEMP_SENSOR_2 == 0
1153
      #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
1154
    #elif !HAS_HEATER_2
1155
      #error "HEATER_2_PIN not defined for this board."
1156
    #elif !PIN_EXISTS(TEMP_2)
1157
      #error "TEMP_2_PIN not defined for this board."
1158
    #endif
1159
    #if HOTENDS > 3
1160
      #if TEMP_SENSOR_3 == 0
1161
        #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
1162
      #elif !HAS_HEATER_3
1163
        #error "HEATER_3_PIN not defined for this board."
1164
      #elif !PIN_EXISTS(TEMP_3)
1165
        #error "TEMP_3_PIN not defined for this board."
1166
      #endif
1167
      #if HOTENDS > 4
1168
        #if TEMP_SENSOR_4 == 0
1169
          #error "TEMP_SENSOR_4 is required with 5 HOTENDS."
1170
        #elif !HAS_HEATER_4
1171
          #error "HEATER_4_PIN not defined for this board."
1172
        #elif !PIN_EXISTS(TEMP_4)
1173
          #error "TEMP_4_PIN not defined for this board."
1174
        #endif
1175
      #elif TEMP_SENSOR_4 != 0
1176
        #error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS."
1177
      #endif
1178
    #elif TEMP_SENSOR_3 != 0
1179
      #error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS."
1180
    #elif TEMP_SENSOR_4 != 0
1181
      #error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS."
1182
    #endif
1183
  #elif TEMP_SENSOR_2 != 0
1184
    #error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS."
1185
  #elif TEMP_SENSOR_3 != 0
1186
    #error "TEMP_SENSOR_3 shouldn't be set with only 2 HOTENDS."
1187
  #elif TEMP_SENSOR_4 != 0
1188
    #error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS."
1189
  #endif
1190
#elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT)
1191
  #error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND."
1192
#elif TEMP_SENSOR_2 != 0
1193
  #error "TEMP_SENSOR_2 shouldn't be set with only 1 HOTEND."
1194
#elif TEMP_SENSOR_3 != 0
1195
  #error "TEMP_SENSOR_3 shouldn't be set with only 1 HOTEND."
1196
#elif TEMP_SENSOR_4 != 0
1197
  #error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND."
1198
#endif
1199
 
1200
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0
1201
  #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
1202
#endif
1203
 
1204
/**
1205
 * Temperature status LEDs
1206
 */
1207
#if ENABLED(TEMP_STAT_LEDS) && !PIN_EXISTS(STAT_LED_RED) && !PIN_EXISTS(STAT_LED_BLUE)
1208
  #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both."
1209
#endif
1210
 
1211
/**
1212
 * LED Control Menu
1213
 */
1214
#if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS
1215
  #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9632, or NEOPIXEL_LED."
1216
#endif
1217
 
1218
/**
1219
 * Basic 2-nozzle duplication mode
1220
 */
1221
#if ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
1222
  #if HOTENDS != 2
1223
    #error "DUAL_NOZZLE_DUPLICATION_MODE requires exactly 2 hotends."
1224
  #elif ENABLED(DUAL_X_CARRIAGE)
1225
    #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with DUAL_X_CARRIAGE."
1226
  #elif ENABLED(SINGLENOZZLE)
1227
    #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SINGLENOZZLE."
1228
  #elif ENABLED(MIXING_EXTRUDER)
1229
    #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with MIXING_EXTRUDER."
1230
  #elif ENABLED(SWITCHING_EXTRUDER)
1231
    #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SWITCHING_EXTRUDER."
1232
  #endif
1233
#endif
1234
 
1235
/**
1236
 * Test Extruder Stepper Pins
1237
 */
1238
#if DISABLED(MK2_MULTIPLEXER) // MK2_MULTIPLEXER uses E0 stepper only
1239
  #if E_STEPPERS > 4
1240
    #if !PIN_EXISTS(E4_STEP) || !PIN_EXISTS(E4_DIR) || !PIN_EXISTS(E4_ENABLE)
1241
      #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
1242
    #endif
1243
  #elif E_STEPPERS > 3
1244
    #if !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE)
1245
      #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
1246
    #endif
1247
  #elif E_STEPPERS > 2
1248
    #if !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE)
1249
      #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
1250
    #endif
1251
  #elif E_STEPPERS > 1
1252
    #if !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE)
1253
      #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
1254
    #endif
1255
  #endif
1256
#endif
1257
 
1258
/**
1259
 * Endstop Tests
1260
 */
1261
 
1262
#define _PLUG_UNUSED_TEST(AXIS,PLUG) (DISABLED(USE_##PLUG##MIN_PLUG) && DISABLED(USE_##PLUG##MAX_PLUG) && !(ENABLED(AXIS##_DUAL_ENDSTOPS) && WITHIN(AXIS##2_USE_ENDSTOP, _##PLUG##MAX_, _##PLUG##MIN_)))
1263
#define _AXIS_PLUG_UNUSED_TEST(AXIS) (_PLUG_UNUSED_TEST(AXIS,X) && _PLUG_UNUSED_TEST(AXIS,Y) && _PLUG_UNUSED_TEST(AXIS,Z))
1264
 
1265
#if DISABLED(HANGPRINTER)
1266
  // At least 3 endstop plugs must be used
1267
  #if _AXIS_PLUG_UNUSED_TEST(X)
1268
    #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG."
1269
  #elif _AXIS_PLUG_UNUSED_TEST(Y)
1270
    #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG."
1271
  #elif _AXIS_PLUG_UNUSED_TEST(Z)
1272
    #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG."
1273
  #endif
1274
 
1275
  // Delta and Cartesian use 3 homing endstops
1276
  #if !IS_SCARA
1277
    #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG)
1278
      #error "Enable USE_XMIN_PLUG when homing X to MIN."
1279
    #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG)
1280
      #error "Enable USE_XMAX_PLUG when homing X to MAX."
1281
    #elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG)
1282
      #error "Enable USE_YMIN_PLUG when homing Y to MIN."
1283
    #elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG)
1284
      #error "Enable USE_YMAX_PLUG when homing Y to MAX."
1285
    #endif
1286
  #endif
1287
  #if Z_HOME_DIR < 0 && DISABLED(USE_ZMIN_PLUG)
1288
    #error "Enable USE_ZMIN_PLUG when homing Z to MIN."
1289
  #elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG)
1290
    #error "Enable USE_ZMAX_PLUG when homing Z to MAX."
1291
  #endif
1292
#endif
1293
 
1294
// Dual endstops requirements
1295
#if ENABLED(X_DUAL_ENDSTOPS)
1296
  #if !X2_USE_ENDSTOP
1297
    #error "You must set X2_USE_ENDSTOP with X_DUAL_ENDSTOPS."
1298
  #elif X2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
1299
    #error "USE_XMIN_PLUG is required when X2_USE_ENDSTOP is _XMIN_."
1300
  #elif X2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
1301
    #error "USE_XMAX_PLUG is required when X2_USE_ENDSTOP is _XMAX_."
1302
  #elif X2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
1303
    #error "USE_YMIN_PLUG is required when X2_USE_ENDSTOP is _YMIN_."
1304
  #elif X2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
1305
    #error "USE_YMAX_PLUG is required when X2_USE_ENDSTOP is _YMAX_."
1306
  #elif X2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
1307
    #error "USE_ZMIN_PLUG is required when X2_USE_ENDSTOP is _ZMIN_."
1308
  #elif X2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
1309
    #error "USE_ZMAX_PLUG is required when X2_USE_ENDSTOP is _ZMAX_."
1310
  #elif !HAS_X2_MIN && !HAS_X2_MAX
1311
    #error "X2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
1312
  #elif ENABLED(DELTA)
1313
    #error "X_DUAL_ENDSTOPS is not compatible with DELTA."
1314
  #endif
1315
#endif
1316
#if ENABLED(Y_DUAL_ENDSTOPS)
1317
  #if !Y2_USE_ENDSTOP
1318
    #error "You must set Y2_USE_ENDSTOP with Y_DUAL_ENDSTOPS."
1319
  #elif Y2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
1320
    #error "USE_XMIN_PLUG is required when Y2_USE_ENDSTOP is _XMIN_."
1321
  #elif Y2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
1322
    #error "USE_XMAX_PLUG is required when Y2_USE_ENDSTOP is _XMAX_."
1323
  #elif Y2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
1324
    #error "USE_YMIN_PLUG is required when Y2_USE_ENDSTOP is _YMIN_."
1325
  #elif Y2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
1326
    #error "USE_YMAX_PLUG is required when Y2_USE_ENDSTOP is _YMAX_."
1327
  #elif Y2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
1328
    #error "USE_ZMIN_PLUG is required when Y2_USE_ENDSTOP is _ZMIN_."
1329
  #elif Y2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
1330
    #error "USE_ZMAX_PLUG is required when Y2_USE_ENDSTOP is _ZMAX_."
1331
  #elif !HAS_Y2_MIN && !HAS_Y2_MAX
1332
    #error "Y2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
1333
  #elif ENABLED(DELTA)
1334
    #error "Y_DUAL_ENDSTOPS is not compatible with DELTA."
1335
  #endif
1336
#endif
1337
#if ENABLED(Z_DUAL_ENDSTOPS)
1338
  #if !Z2_USE_ENDSTOP
1339
    #error "You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS."
1340
  #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
1341
    #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_."
1342
  #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
1343
    #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_."
1344
  #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
1345
    #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_."
1346
  #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
1347
    #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_."
1348
  #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
1349
    #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_."
1350
  #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
1351
    #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_."
1352
  #elif !HAS_Z2_MIN && !HAS_Z2_MAX
1353
    #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
1354
  #elif ENABLED(DELTA)
1355
    #error "Z_DUAL_ENDSTOPS is not compatible with DELTA."
1356
  #endif
1357
#endif
1358
 
1359
/**
1360
 * emergency-command parser
1361
 */
1362
#if ENABLED(EMERGENCY_PARSER) && !USE_MARLINSERIAL
1363
  #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
1364
#endif
1365
 
1366
/**
1367
 * I2C bus
1368
 */
1369
#if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0
1370
  #if I2C_SLAVE_ADDRESS < 8
1371
    #error "I2C_SLAVE_ADDRESS can't be less than 8. (Addresses 0 - 7 are reserved.)"
1372
  #elif I2C_SLAVE_ADDRESS > 127
1373
    #error "I2C_SLAVE_ADDRESS can't be over 127. (Only 7 bits allowed.)"
1374
  #endif
1375
#endif
1376
 
1377
/**
1378
 * G38 Probe Target
1379
 */
1380
#if ENABLED(G38_PROBE_TARGET)
1381
  #if !HAS_BED_PROBE
1382
    #error "G38_PROBE_TARGET requires a bed probe."
1383
  #elif !IS_CARTESIAN
1384
    #error "G38_PROBE_TARGET requires a Cartesian machine."
1385
  #endif
1386
#endif
1387
 
1388
/**
1389
 * RGB_LED Requirements
1390
 */
1391
#define _RGB_TEST (PIN_EXISTS(RGB_LED_R) && PIN_EXISTS(RGB_LED_G) && PIN_EXISTS(RGB_LED_B))
1392
#if ENABLED(RGB_LED)
1393
  #if !_RGB_TEST
1394
    #error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN."
1395
  #elif ENABLED(RGBW_LED)
1396
    #error "Please enable only one of RGB_LED and RGBW_LED."
1397
  #endif
1398
#elif ENABLED(RGBW_LED)
1399
  #if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W))
1400
    #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN."
1401
  #endif
1402
#elif ENABLED(NEOPIXEL_LED)
1403
  #if !(PIN_EXISTS(NEOPIXEL) && NEOPIXEL_PIXELS > 0)
1404
    #error "NEOPIXEL_LED requires NEOPIXEL_PIN and NEOPIXEL_PIXELS."
1405
  #endif
1406
#elif ENABLED(PRINTER_EVENT_LEDS) && DISABLED(BLINKM) && DISABLED(PCA9632) && DISABLED(NEOPIXEL_LED)
1407
  #error "PRINTER_EVENT_LEDS requires BLINKM, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED."
1408
#endif
1409
 
1410
/**
1411
 * Auto Fan check for PWM pins
1412
 */
1413
#if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255
1414
  #define AF_ERR_SUFF "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255."
1415
  #if HAS_AUTO_FAN_0
1416
    static_assert(GET_TIMER(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF);
1417
  #elif HAS_AUTO_FAN_1
1418
    static_assert(GET_TIMER(E1_AUTO_FAN_PIN), "E1" AF_ERR_SUFF);
1419
  #elif HAS_AUTO_FAN_2
1420
    static_assert(GET_TIMER(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF);
1421
  #elif HAS_AUTO_FAN_3
1422
    static_assert(GET_TIMER(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF);
1423
  #endif
1424
#endif
1425
 
1426
/**
1427
 * Make sure only one display is enabled
1428
 *
1429
 * Note: BQ_LCD_SMART_CONTROLLER => REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1430
 *       REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER => REPRAP_DISCOUNT_SMART_CONTROLLER
1431
 *       SAV_3DGLCD => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
1432
 *       MKS_12864OLED => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
1433
 *       MKS_12864OLED_SSD1306 => U8GLIB_SSD1306 => ULTIMAKERCONTROLLER
1434
 *       MKS_MINI_12864 => MINIPANEL
1435
 *       miniVIKI => ULTIMAKERCONTROLLER
1436
 *       VIKI2 => ULTIMAKERCONTROLLER
1437
 *       ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER
1438
 *       PANEL_ONE => ULTIMAKERCONTROLLER
1439
 */
1440
#if 1 < 0 \
1441
  + (     ENABLED(ULTIMAKERCONTROLLER) \
1442
      && DISABLED(SAV_3DGLCD) \
1443
      && DISABLED(miniVIKI) \
1444
      && DISABLED(VIKI2) \
1445
      && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
1446
      && DISABLED(PANEL_ONE) \
1447
      && DISABLED(MKS_12864OLED) \
1448
      && DISABLED(MKS_12864OLED_SSD1306) ) \
1449
  + (     ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
1450
      && DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
1451
      && DISABLED(LCD_FOR_MELZI) \
1452
      && DISABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
1453
      && DISABLED(MKS_12864OLED) \
1454
      && DISABLED(MKS_12864OLED_SSD1306) ) \
1455
  + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(BQ_LCD_SMART_CONTROLLER)) \
1456
  + ENABLED(LCD_FOR_MELZI) \
1457
  + ENABLED(MKS_12864OLED) \
1458
  + ENABLED(MKS_12864OLED_SSD1306) \
1459
  + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
1460
  + ENABLED(CARTESIO_UI) \
1461
  + ENABLED(PANEL_ONE) \
1462
  + ENABLED(MAKRPANEL) \
1463
  + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \
1464
  + ENABLED(VIKI2) \
1465
  + ENABLED(miniVIKI) \
1466
  + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
1467
  + ENABLED(G3D_PANEL) \
1468
  + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \
1469
  + ENABLED(MKS_MINI_12864) \
1470
  + (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(CARTESIO_UI) && DISABLED(ZONESTAR_LCD)) \
1471
  + ENABLED(RIGIDBOT_PANEL) \
1472
  + ENABLED(RA_CONTROL_PANEL) \
1473
  + ENABLED(LCD_SAINSMART_I2C_1602) \
1474
  + ENABLED(LCD_SAINSMART_I2C_2004) \
1475
  + ENABLED(LCM1602) \
1476
  + ENABLED(LCD_I2C_PANELOLU2) \
1477
  + ENABLED(LCD_I2C_VIKI) \
1478
  + (ENABLED(U8GLIB_SSD1306) && DISABLED(OLED_PANEL_TINYBOY2) && DISABLED(MKS_12864OLED_SSD1306)) \
1479
  + ENABLED(SAV_3DLCD) \
1480
  + ENABLED(BQ_LCD_SMART_CONTROLLER) \
1481
  + ENABLED(SAV_3DGLCD) \
1482
  + ENABLED(OLED_PANEL_TINYBOY2) \
1483
  + ENABLED(ZONESTAR_LCD) \
1484
  + ENABLED(ULTI_CONTROLLER)
1485
  #error "Please select no more than one LCD controller option."
1486
#endif
1487
 
1488
/**
1489
 * Check existing CS pins against enabled TMC SPI drivers.
1490
 */
1491
#if AXIS_DRIVER_TYPE(X, TMC2130) && !PIN_EXISTS(X_CS)
1492
  #error "X_CS_PIN is required for TMC2130. Define X_CS_PIN in Configuration_adv.h."
1493
#elif AXIS_DRIVER_TYPE(X2, TMC2130) && !PIN_EXISTS(X2_CS)
1494
  #error "X2_CS_PIN is required for X2. Define X2_CS_PIN in Configuration_adv.h."
1495
#elif AXIS_DRIVER_TYPE(Y, TMC2130) && !PIN_EXISTS(Y_CS)
1496
  #error "Y_CS_PIN is required for TMC2130. Define Y_CS_PIN in Configuration_adv.h."
1497
#elif AXIS_DRIVER_TYPE(Y2, TMC2130) && !PIN_EXISTS(Y2_CS)
1498
  #error "Y2_CS_PIN is required for TMC2130. Define Y2_CS_PIN in Configuration_adv.h."
1499
#elif AXIS_DRIVER_TYPE(Z, TMC2130) && !PIN_EXISTS(Z_CS)
1500
  #error "Z_CS_PIN is required for TMC2130. Define Z_CS_PIN in Configuration_adv.h."
1501
#elif AXIS_DRIVER_TYPE(Z2, TMC2130) && !PIN_EXISTS(Z2_CS)
1502
  #error "Z2_CS_PIN is required for TMC2130. Define Z2_CS_PIN in Configuration_adv.h."
1503
#elif AXIS_DRIVER_TYPE(E0, TMC2130) && !PIN_EXISTS(E0_CS)
1504
  #error "E0_CS_PIN is required for TMC2130. Define E0_CS_PIN in Configuration_adv.h."
1505
#elif AXIS_DRIVER_TYPE(E1, TMC2130) && !PIN_EXISTS(E1_CS)
1506
  #error "E1_CS_PIN is required for TMC2130. Define E1_CS_PIN in Configuration_adv.h."
1507
#elif AXIS_DRIVER_TYPE(E2, TMC2130) && !PIN_EXISTS(E2_CS)
1508
  #error "E2_CS_PIN is required for TMC2130. Define E2_CS_PIN in Configuration_adv.h."
1509
#elif AXIS_DRIVER_TYPE(E3, TMC2130) && !PIN_EXISTS(E3_CS)
1510
  #error "E3_CS_PIN is required for TMC2130. Define E3_CS_PIN in Configuration_adv.h."
1511
#elif AXIS_DRIVER_TYPE(E4, TMC2130) && !PIN_EXISTS(E4_CS)
1512
  #error "E4_CS_PIN is required for TMC2130. Define E4_CS_PIN in Configuration_adv.h."
1513
#endif
1514
 
1515
/**
1516
 * TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI)
1517
 */
1518
#if HAS_DRIVER(TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \
1519
       defined(X_HARDWARE_SERIAL ) \
1520
    || defined(X2_HARDWARE_SERIAL) \
1521
    || defined(Y_HARDWARE_SERIAL ) \
1522
    || defined(Y2_HARDWARE_SERIAL) \
1523
    || defined(Z_HARDWARE_SERIAL ) \
1524
    || defined(Z2_HARDWARE_SERIAL) \
1525
    || defined(E0_HARDWARE_SERIAL) \
1526
    || defined(E1_HARDWARE_SERIAL) \
1527
    || defined(E2_HARDWARE_SERIAL) \
1528
    || defined(E3_HARDWARE_SERIAL) \
1529
    || defined(E4_HARDWARE_SERIAL) )
1530
  #error "select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE."
1531
#endif
1532
 
1533
#if ENABLED(SENSORLESS_HOMING)
1534
  // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop
1535
  // is necessary in order to reset the stallGuard indication between the initial movement of all three
1536
  // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of
1537
  // clearing the stallGuard activated status is found.
1538
  #if ENABLED(DELTA) && !ENABLED(STEALTHCHOP)
1539
    #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP."
1540
  #elif X_SENSORLESS && X_HOME_DIR == -1 && (!X_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMIN))
1541
    #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMIN when homing to X_MIN."
1542
  #elif X_SENSORLESS && X_HOME_DIR ==  1 && (!X_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMAX))
1543
    #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMAX when homing to X_MAX."
1544
  #elif Y_SENSORLESS && Y_HOME_DIR == -1 && (!Y_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMIN))
1545
    #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMIN when homing to Y_MIN."
1546
  #elif Y_SENSORLESS && Y_HOME_DIR ==  1 && (!Y_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMAX))
1547
    #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMAX when homing to Y_MAX."
1548
  #elif Z_SENSORLESS && Z_HOME_DIR == -1 && (!Z_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMIN))
1549
    #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMIN when homing to Z_MIN."
1550
  #elif Z_SENSORLESS && Z_HOME_DIR ==  1 && (!Z_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMAX))
1551
    #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMAX when homing to Z_MAX."
1552
  #elif ENABLED(ENDSTOP_NOISE_FILTER)
1553
    #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_FILTER."
1554
  #endif
1555
#endif
1556
 
1557
// Sensorless homing is required for both combined steppers in an H-bot
1558
#if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS
1559
  #error "CoreXY requires both X and Y to use sensorless homing if either does."
1560
#elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS
1561
  #error "CoreXZ requires both X and Z to use sensorless homing if either does."
1562
#elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS
1563
  #error "CoreYZ requires both Y and Z to use sensorless homing if either does."
1564
#endif
1565
 
1566
#if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP)
1567
  #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD."
1568
#endif
1569
#if ENABLED(TMC_Z_CALIBRATION) && !AXIS_IS_TMC(Z) && !AXIS_IS_TMC(Z2)
1570
  #error "TMC_Z_CALIBRATION requires at least one TMC driver on Z axis"
1571
#endif
1572
 
1573
#if ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD
1574
  #error "SENSORLESS_HOMING requires TMC2130 or TMC2660 stepper drivers."
1575
#endif
1576
#if ENABLED(STEALTHCHOP) && !HAS_STEALTHCHOP
1577
  #error "STEALTHCHOP requires TMC2130 or TMC2208 stepper drivers."
1578
#endif
1579
 
1580
/**
1581
 * Digipot requirement
1582
 */
1583
#if ENABLED(DIGIPOT_MCP4018)
1584
  #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
1585
    || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)
1586
      #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined."
1587
  #endif
1588
#endif
1589
 
1590
/**
1591
 * Require 5/4 or more elements in per-axis initializers
1592
 */
1593
#if ENABLED(HANGPRINTER)
1594
  #define MIN_ELEMENTS "5"
1595
#else
1596
  #define MIN_ELEMENTS "4"
1597
#endif
1598
 
1599
constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT,
1600
                sanity_arr_2[] = DEFAULT_MAX_FEEDRATE,
1601
                sanity_arr_3[] = DEFAULT_MAX_ACCELERATION;
1602
 
1603
static_assert(COUNT(sanity_arr_1) >= NUM_AXIS, "DEFAULT_AXIS_STEPS_PER_UNIT requires " MIN_ELEMENTS " (or more) elements for HANGPRINTER.");
1604
static_assert(COUNT(sanity_arr_2) >= NUM_AXIS, "DEFAULT_MAX_FEEDRATE requires " MIN_ELEMENTS " (or more) elements for HANGPRINTER.");
1605
static_assert(COUNT(sanity_arr_3) >= NUM_AXIS, "DEFAULT_MAX_ACCELERATION requires " MIN_ELEMENTS " (or more) elements for HANGPRINTER.");
1606
static_assert(COUNT(sanity_arr_1) <= NUM_AXIS_N, "DEFAULT_AXIS_STEPS_PER_UNIT has too many elements.");
1607
static_assert(COUNT(sanity_arr_2) <= NUM_AXIS_N, "DEFAULT_MAX_FEEDRATE has too many elements.");
1608
static_assert(COUNT(sanity_arr_3) <= NUM_AXIS_N, "DEFAULT_MAX_ACCELERATION has too many elements.");
1609
 
1610
/**
1611
 * Sanity checks for Spindle / Laser
1612
 */
1613
#if ENABLED(SPINDLE_LASER_ENABLE)
1614
  #if !PIN_EXISTS(SPINDLE_LASER_ENABLE)
1615
    #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENABLE_PIN."
1616
  #elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR)
1617
    #error "SPINDLE_DIR_PIN not defined."
1618
  #elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM)
1619
    #if !(WITHIN(SPINDLE_LASER_PWM_PIN, 2, 13) || WITHIN(SPINDLE_LASER_PWM_PIN, 44, 46))
1620
      #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."
1621
    #elif SPINDLE_LASER_POWERUP_DELAY < 1
1622
      #error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0."
1623
    #elif SPINDLE_LASER_POWERDOWN_DELAY < 1
1624
      #error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0."
1625
    #elif !defined(SPINDLE_LASER_PWM_INVERT)
1626
      #error "SPINDLE_LASER_PWM_INVERT missing."
1627
    #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX)
1628
      #error "SPINDLE_LASER_PWM equation constant(s) missing."
1629
    #elif SPINDLE_LASER_PWM_PIN == 4 || WITHIN(SPINDLE_LASER_PWM_PIN, 11, 13)
1630
      #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by a system interrupt."
1631
    #elif PIN_EXISTS(X_MAX) && X_MAX_PIN == SPINDLE_LASER_PWM_PIN
1632
      #error "SPINDLE_LASER_PWM pin is in use by X_MAX endstop."
1633
    #elif PIN_EXISTS(X_MIN) && X_MIN_PIN == SPINDLE_LASER_PWM_PIN
1634
      #error "SPINDLE_LASER_PWM pin is in use by X_MIN endstop."
1635
    #elif PIN_EXISTS(Z_STEP) && Z_STEP_PIN == SPINDLE_LASER_PWM_PIN
1636
      #error "SPINDLE_LASER_PWM pin in use by Z_STEP."
1637
    #elif NUM_SERVOS > 0 && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5)
1638
      #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system."
1639
    #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN
1640
      #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT_PIN."
1641
    #elif PIN_EXISTS(E0_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E0_AUTO_FAN_PIN
1642
      #error "SPINDLE_LASER_PWM_PIN is used by E0_AUTO_FAN_PIN."
1643
    #elif PIN_EXISTS(E1_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E1_AUTO_FAN_PIN
1644
      #error "SPINDLE_LASER_PWM_PIN is used by E1_AUTO_FAN_PIN."
1645
    #elif PIN_EXISTS(E2_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E2_AUTO_FAN_PIN
1646
      #error "SPINDLE_LASER_PWM_PIN is used by E2_AUTO_FAN_PIN."
1647
    #elif PIN_EXISTS(E3_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E3_AUTO_FAN_PIN
1648
      #error "SPINDLE_LASER_PWM_PIN is used by E3_AUTO_FAN_PIN."
1649
    #elif PIN_EXISTS(E4_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E4_AUTO_FAN_PIN
1650
      #error "SPINDLE_LASER_PWM_PIN is used by E4_AUTO_FAN_PIN."
1651
    #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN
1652
      #error "SPINDLE_LASER_PWM_PIN is used FAN_PIN."
1653
    #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN
1654
      #error "SPINDLE_LASER_PWM_PIN is used FAN1_PIN."
1655
    #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN
1656
      #error "SPINDLE_LASER_PWM_PIN is used FAN2_PIN."
1657
    #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN
1658
      #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN."
1659
    #elif PIN_EXISTS(MOTOR_CURRENT_PWM_XY) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_XY_PIN
1660
      #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_XY."
1661
    #elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_Z_PIN
1662
      #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_Z."
1663
    #elif PIN_EXISTS(MOTOR_CURRENT_PWM_E) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_E_PIN
1664
      #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_E."
1665
    #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN
1666
      #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT."
1667
    #endif
1668
  #endif
1669
#endif // SPINDLE_LASER_ENABLE
1670
 
1671
#if ENABLED(CNC_COORDINATE_SYSTEMS) && ENABLED(NO_WORKSPACE_OFFSETS)
1672
  #error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS."
1673
#endif
1674
 
1675
#if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE)
1676
  #error "BLOCK_BUFFER_SIZE must be a power of 2."
1677
#endif
1678
 
1679
#if ENABLED(LED_CONTROL_MENU) && DISABLED(ULTIPANEL)
1680
  #error "LED_CONTROL_MENU requires an LCD controller."
1681
#endif
1682
 
1683
#if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED)
1684
  #error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED."
1685
#endif
1686
 
1687
#if ENABLED(SKEW_CORRECTION)
1688
  #if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD))
1689
    #error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD."
1690
  #endif
1691
  #if ENABLED(SKEW_CORRECTION_FOR_Z)
1692
    #if !defined(XZ_SKEW_FACTOR) && !(defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD))
1693
      #error "SKEW_CORRECTION requires XZ_SKEW_FACTOR or XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD."
1694
    #endif
1695
    #if !defined(YZ_SKEW_FACTOR) && !(defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD))
1696
      #error "SKEW_CORRECTION requires YZ_SKEW_FACTOR or YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD."
1697
    #endif
1698
  #endif
1699
#endif
1700
 
1701
#if ENABLED(POWER_LOSS_RECOVERY) && !ENABLED(ULTIPANEL)
1702
  #error "POWER_LOSS_RECOVERY currently requires an LCD Controller."
1703
#endif
1704
 
1705
#endif // _SANITYCHECK_H_