MMU2 as standard serial device (#20771)
[Marlin.git] / Marlin / src / inc / SanityCheck.h
blob8da31336e83f40ac5f90834182d022d124641c5e
1 /**
2 * Marlin 3D Printer Firmware
3 * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
5 * Based on Sprinter and grbl.
6 * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
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.
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.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 #pragma once
24 /**
25 * SanityCheck.h
27 * Test configuration values for errors at compile-time.
30 /**
31 * Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features.
33 #if __cplusplus < 201103L
34 #error "Marlin requires C++11 support (gcc >= 4.7, Arduino IDE >= 1.6.8). Please upgrade your toolchain."
35 #endif
37 // Make sure macros aren't borked
38 #define TEST1
39 #define TEST2 1
40 #define TEST3 0
41 #define TEST4 true
42 #if ENABLED(TEST0) || !ENABLED(TEST2) || ENABLED(TEST3)
43 #error "ENABLED is borked!"
44 #endif
45 #if BOTH(TEST0, TEST1)
46 #error "BOTH is borked!"
47 #endif
48 #if DISABLED(TEST1) || !DISABLED(TEST3) || DISABLED(TEST4) || DISABLED(TEST0, TEST1, TEST2, TEST4) || !DISABLED(TEST0, TEST3)
49 #error "DISABLED is borked!"
50 #endif
51 #if !ANY(TEST1, TEST2, TEST3, TEST4) || ANY(TEST0, TEST3)
52 #error "ANY is borked!"
53 #endif
54 #if NONE(TEST0, TEST1, TEST2, TEST4) || !NONE(TEST0, TEST3)
55 #error "NONE is borked!"
56 #endif
57 #undef TEST1
58 #undef TEST2
59 #undef TEST3
60 #undef TEST4
62 /**
63 * We try our best to include sanity checks for all changed configuration
64 * directives because users have a tendency to use outdated config files with
65 * the bleeding-edge source code, but sometimes this is not enough. This check
66 * forces a minimum config file revision. Otherwise Marlin will not build.
68 #define HEXIFY(H) _CAT(0x,H)
69 #if !defined(CONFIGURATION_H_VERSION) || HEXIFY(CONFIGURATION_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_H_VERSION)
70 #error "You are using an old Configuration.h file, update it before building Marlin."
71 #endif
73 #if !defined(CONFIGURATION_ADV_H_VERSION) || HEXIFY(CONFIGURATION_ADV_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION)
74 #error "You are using an old Configuration_adv.h file, update it before building Marlin."
75 #endif
76 #undef HEXIFY
78 /**
79 * Warnings for old configurations
81 #ifndef MOTHERBOARD
82 #error "MOTHERBOARD is required."
83 #elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE)
84 #error "X_BED_SIZE and Y_BED_SIZE are now required!"
85 #elif WATCH_TEMP_PERIOD > 500
86 #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds."
87 #elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
88 #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS."
89 #elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
90 #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED."
91 #elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE)
92 #error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY."
93 #elif defined(X_HOME_RETRACT_MM)
94 #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM."
95 #elif defined(SDCARDDETECTINVERTED)
96 #error "SDCARDDETECTINVERTED is now SD_DETECT_STATE (HIGH)."
97 #elif defined(SD_DETECT_INVERTED)
98 #error "SD_DETECT_INVERTED is now SD_DETECT_STATE (HIGH)."
99 #elif defined(BTENABLED)
100 #error "BTENABLED is now BLUETOOTH."
101 #elif defined(CUSTOM_MENDEL_NAME)
102 #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME."
103 #elif defined(HAS_AUTOMATIC_VERSIONING)
104 #error "HAS_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE."
105 #elif defined(USE_AUTOMATIC_VERSIONING)
106 #error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE."
107 #elif defined(SDSLOW)
108 #error "SDSLOW deprecated. Set SD_SPI_SPEED to SPI_HALF_SPEED instead."
109 #elif defined(SDEXTRASLOW)
110 #error "SDEXTRASLOW deprecated. Set SD_SPI_SPEED to SPI_QUARTER_SPEED instead."
111 #elif defined(FILAMENT_SENSOR)
112 #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR."
113 #elif defined(ENDSTOPPULLUP_FIL_RUNOUT)
114 #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP."
115 #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
116 #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead."
117 #elif defined(LANGUAGE_INCLUDE)
118 #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE."
119 #elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y)
120 #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead."
121 #elif defined(PID_PARAMS_PER_EXTRUDER)
122 #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead."
123 #elif defined(EXTRUDER_WATTS) || defined(BED_WATTS)
124 #error "EXTRUDER_WATTS and BED_WATTS are deprecated and should be removed."
125 #elif defined(SERVO_ENDSTOP_ANGLES)
126 #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
127 #elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
128 #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
129 #elif defined(Z_ENDSTOP_SERVO_NR)
130 #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR."
131 #elif defined(DEFAULT_XYJERK)
132 #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead."
133 #elif defined(XY_TRAVEL_SPEED)
134 #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead."
135 #elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
136 #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead."
137 #elif defined(SERVO_DEACTIVATION_DELAY)
138 #error "SERVO_DEACTIVATION_DELAY is now SERVO_DELAY."
139 #elif ENABLED(FILAMENTCHANGEENABLE)
140 #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE."
141 #elif ENABLED(FILAMENT_CHANGE_FEATURE)
142 #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE."
143 #elif defined(FILAMENT_CHANGE_X_POS) || defined(FILAMENT_CHANGE_Y_POS)
144 #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT."
145 #elif defined(FILAMENT_CHANGE_Z_ADD)
146 #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT."
147 #elif defined(FILAMENT_CHANGE_XY_FEEDRATE)
148 #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE."
149 #elif defined(FILAMENT_CHANGE_Z_FEEDRATE)
150 #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE."
151 #elif defined(PAUSE_PARK_X_POS) || defined(PAUSE_PARK_Y_POS)
152 #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT."
153 #elif defined(PAUSE_PARK_Z_ADD)
154 #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT."
155 #elif defined(PAUSE_PARK_XY_FEEDRATE)
156 #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE."
157 #elif defined(PAUSE_PARK_Z_FEEDRATE)
158 #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE."
159 #elif defined(FILAMENT_CHANGE_RETRACT_FEEDRATE)
160 #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE."
161 #elif defined(FILAMENT_CHANGE_RETRACT_LENGTH)
162 #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH."
163 #elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE)
164 #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE."
165 #elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE)
166 #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE."
167 #elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH)
168 #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH."
169 #elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH)
170 #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH."
171 #elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT)
172 #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT."
173 #elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS)
174 #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS."
175 #elif defined(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
176 #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT."
177 #elif defined(PLA_PREHEAT_HOTEND_TEMP)
178 #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND."
179 #elif defined(PLA_PREHEAT_HPB_TEMP)
180 #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED."
181 #elif defined(PLA_PREHEAT_FAN_SPEED)
182 #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED."
183 #elif defined(ABS_PREHEAT_HOTEND_TEMP)
184 #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND."
185 #elif defined(ABS_PREHEAT_HPB_TEMP)
186 #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED."
187 #elif defined(ABS_PREHEAT_FAN_SPEED)
188 #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED."
189 #elif defined(ENDSTOPS_ONLY_FOR_HOMING)
190 #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead."
191 #elif defined(HOMING_FEEDRATE)
192 #error "HOMING_FEEDRATE is now set using the HOMING_FEEDRATE_MM_M array instead."
193 #elif (defined(HOMING_FEEDRATE_XY) || defined(HOMING_FEEDRATE_Z)) && !defined(HOMING_FEEDRATE_MM_M)
194 #error "HOMING_FEEDRATE_XY and HOMING_FEEDRATE_Z are now set using the HOMING_FEEDRATE_MM_M array instead."
195 #elif defined(MANUAL_HOME_POSITIONS)
196 #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead."
197 #elif defined(PID_ADD_EXTRUSION_RATE)
198 #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default."
199 #elif defined(Z_RAISE_BEFORE_HOMING)
200 #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT."
201 #elif defined(MIN_Z_HEIGHT_FOR_HOMING)
202 #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT."
203 #elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING)
204 #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead."
205 #elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS)
206 #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES."
207 #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT)
208 #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES."
209 #elif defined(MANUAL_BED_LEVELING)
210 #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING."
211 #elif defined(MESH_HOME_SEARCH_Z)
212 #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE."
213 #elif defined(MANUAL_PROBE_Z_RANGE)
214 #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE."
215 #elif !defined(MIN_STEPS_PER_SEGMENT)
216 #error "Please replace 'const int dropsegments' with '#define MIN_STEPS_PER_SEGMENT' (and increase by 1)."
217 #elif MIN_STEPS_PER_SEGMENT <= 0
218 #error "MIN_STEPS_PER_SEGMENT must be at least 1."
219 #elif defined(PREVENT_DANGEROUS_EXTRUDE)
220 #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION."
221 #elif defined(SCARA)
222 #error "SCARA is now MORGAN_SCARA."
223 #elif defined(ENABLE_AUTO_BED_LEVELING)
224 #error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
225 #elif defined(AUTO_BED_LEVELING_FEATURE)
226 #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
227 #elif defined(ABL_GRID_POINTS)
228 #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y."
229 #elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y)
230 #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]."
231 #elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y)
232 #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]."
233 #elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS)
234 #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]."
235 #elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS)
236 #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]."
237 #elif defined(UBL_G26_MESH_VALIDATION)
238 #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION."
239 #elif defined(UBL_MESH_EDIT_ENABLED)
240 #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION."
241 #elif defined(UBL_MESH_EDITING)
242 #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION."
243 #elif defined(BLTOUCH_HEATERS_OFF)
244 #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF."
245 #elif defined(BLTOUCH_V3)
246 #error "BLTOUCH_V3 is obsolete."
247 #elif defined(BLTOUCH_FORCE_OPEN_DRAIN_MODE)
248 #error "BLTOUCH_FORCE_OPEN_DRAIN_MODE is obsolete."
249 #elif defined(BEEPER)
250 #error "BEEPER is now BEEPER_PIN."
251 #elif defined(SDCARDDETECT)
252 #error "SDCARDDETECT is now SD_DETECT_PIN."
253 #elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE)
254 #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN."
255 #elif defined(LCD_PIN_BL)
256 #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN."
257 #elif defined(LCD_PIN_RESET)
258 #error "LCD_PIN_RESET is now LCD_RESET_PIN."
259 #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)
260 #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN."
261 #elif defined(PID_FAN_SCALING) && !HAS_FAN
262 #error "PID_FAN_SCALING needs at least one fan enabled."
263 #elif defined(min_software_endstops) || defined(max_software_endstops)
264 #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS."
265 #elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN)
266 #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)."
267 #elif defined(CONTROLLERFAN_PIN)
268 #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN."
269 #elif defined(CONTROLLERFAN_SPEED)
270 #error "CONTROLLERFAN_SPEED is now CONTROLLERFAN_SPEED_ACTIVE."
271 #elif defined(CONTROLLERFAN_SECS)
272 #error "CONTROLLERFAN_SECS is now CONTROLLERFAN_IDLE_TIME."
273 #elif defined(MIN_RETRACT)
274 #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT."
275 #elif defined(ADVANCE)
276 #error "ADVANCE is now LIN_ADVANCE."
277 #elif defined(LIN_ADVANCE_E_D_RATIO)
278 #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO."
279 #elif defined(NEOPIXEL_RGBW_LED)
280 #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED."
281 #elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS)
282 #error "Remove DELTA_PROBEABLE_RADIUS and use PROBING_MARGIN to inset the probe area instead."
283 #elif ENABLED(DELTA) && defined(DELTA_CALIBRATION_RADIUS)
284 #error "Remove DELTA_CALIBRATION_RADIUS and use PROBING_MARGIN to inset the probe area instead."
285 #elif defined(UBL_MESH_INSET)
286 #error "UBL_MESH_INSET is now just MESH_INSET."
287 #elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y)
288 #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]."
289 #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)
290 #error "ABL_PROBE_PT_[123]_[XY] is no longer required. Please remove it."
291 #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)
292 #error "UBL_PROBE_PT_[123]_[XY] is no longer required. Please remove it."
293 #elif defined(MIN_PROBE_EDGE)
294 #error "MIN_PROBE_EDGE is now called PROBING_MARGIN."
295 #elif defined(MIN_PROBE_EDGE_LEFT)
296 #error "MIN_PROBE_EDGE_LEFT is now called PROBING_MARGIN_LEFT."
297 #elif defined(MIN_PROBE_EDGE_RIGHT)
298 #error "MIN_PROBE_EDGE_RIGHT is now called PROBING_MARGIN_RIGHT."
299 #elif defined(MIN_PROBE_EDGE_FRONT)
300 #error "MIN_PROBE_EDGE_FRONT is now called PROBING_MARGIN_FRONT."
301 #elif defined(MIN_PROBE_EDGE_BACK)
302 #error "MIN_PROBE_EDGE_BACK is now called PROBING_MARGIN_BACK."
303 #elif defined(LEFT_PROBE_BED_POSITION)
304 #error "LEFT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_LEFT instead."
305 #elif defined(RIGHT_PROBE_BED_POSITION)
306 #error "RIGHT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_RIGHT instead."
307 #elif defined(FRONT_PROBE_BED_POSITION)
308 #error "FRONT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_FRONT instead."
309 #elif defined(BACK_PROBE_BED_POSITION)
310 #error "BACK_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_BACK instead."
311 #elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY)
312 #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY."
313 #elif defined(BABYSTEP_ZPROBE_GFX_REVERSE)
314 #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE."
315 #elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN)
316 #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES."
317 #elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1))
318 #error "K1 is now PID_K1."
319 #elif defined(PROBE_DOUBLE_TOUCH)
320 #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING."
321 #elif defined(ANET_KEYPAD_LCD)
322 #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD."
323 #elif defined(LCD_I2C_SAINSMART_YWROBOT)
324 #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004)."
325 #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT)
326 #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN."
327 #elif defined(HAVE_TMCDRIVER)
328 #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X."
329 #elif defined(STEALTHCHOP)
330 #error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E)."
331 #elif defined(HAVE_TMC26X)
332 #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X."
333 #elif defined(HAVE_TMC2130)
334 #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130."
335 #elif defined(HAVE_TMC2208)
336 #error "HAVE_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208."
337 #elif defined(HAVE_L6470DRIVER)
338 #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470."
339 #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) || defined(Z3_IS_TMC) \
340 || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) || defined(E5_IS_TMC) || defined(E6_IS_TMC) || defined(E7_IS_TMC)
341 #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X."
342 #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) || defined(Z3_IS_TMC26X) \
343 || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) || defined(E5_IS_TMC26X) || defined(E6_IS_TMC26X) || defined(E7_IS_TMC26X)
344 #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X."
345 #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) || defined(Z3_IS_TMC2130) \
346 || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) || defined(E5_IS_TMC2130) || defined(E6_IS_TMC2130) || defined(E7_IS_TMC2130)
347 #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130."
348 #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) || defined(Z3_IS_TMC2208) \
349 || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) || defined(E5_IS_TMC2208) || defined(E6_IS_TMC2208) || defined(E7_IS_TMC2208)
350 #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208."
351 #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) || defined(Z3_IS_L6470) \
352 || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) || defined(E5_IS_L6470) || defined(E6_IS_L6470) || defined(E7_IS_L6470)
353 #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470."
354 #elif defined(AUTOMATIC_CURRENT_CONTROL)
355 #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS."
356 #elif defined(FILAMENT_CHANGE_LOAD_LENGTH)
357 #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH."
358 #elif defined(LEVEL_CORNERS_INSET)
359 #error "LEVEL_CORNERS_INSET is now LEVEL_CORNERS_INSET_LFRB."
360 #elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET_LFRB)
361 #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values."
362 #elif BOTH(LEVEL_CORNERS_USE_PROBE, SENSORLESS_PROBING)
363 #error "LEVEL_CORNERS_USE_PROBE is incompatible with SENSORLESS_PROBING."
364 #elif defined(BEZIER_JERK_CONTROL)
365 #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION."
366 #elif HAS_JUNCTION_DEVIATION && defined(JUNCTION_DEVIATION_FACTOR)
367 #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM."
368 #elif defined(JUNCTION_ACCELERATION_FACTOR)
369 #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h."
370 #elif defined(JUNCTION_ACCELERATION)
371 #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h."
372 #elif defined(MAX7219_DEBUG_STEPPER_HEAD)
373 #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD."
374 #elif defined(MAX7219_DEBUG_STEPPER_TAIL)
375 #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL."
376 #elif defined(MAX7219_DEBUG_STEPPER_QUEUE)
377 #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE."
378 #elif defined(ENDSTOP_NOISE_FILTER)
379 #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]."
380 #elif defined(RETRACT_ZLIFT)
381 #error "RETRACT_ZLIFT is now RETRACT_ZRAISE."
382 #elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT)
383 #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE."
384 #elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE)
385 #error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE."
386 #elif defined(SINGLENOZZLE_SWAP_LENGTH)
387 #error "SINGLENOZZLE_SWAP_LENGTH is now TOOLCHANGE_FIL_SWAP_LENGTH."
388 #elif defined(SINGLENOZZLE_SWAP_RETRACT_SPEED)
389 #error "SINGLENOZZLE_SWAP_RETRACT_SPEED is now TOOLCHANGE_FIL_SWAP_RETRACT_SPEED."
390 #elif defined(SINGLENOZZLE_SWAP_PRIME_SPEED)
391 #error "SINGLENOZZLE_SWAP_PRIME_SPEED is now TOOLCHANGE_FIL_SWAP_PRIME_SPEED."
392 #elif defined(SINGLENOZZLE_SWAP_PARK)
393 #error "SINGLENOZZLE_SWAP_PARK is now TOOLCHANGE_PARK."
394 #elif defined(SINGLENOZZLE_TOOLCHANGE_XY)
395 #error "SINGLENOZZLE_TOOLCHANGE_XY is now TOOLCHANGE_PARK_XY."
396 #elif defined(SINGLENOZZLE_PARK_XY_FEEDRATE)
397 #error "SINGLENOZZLE_PARK_XY_FEEDRATE is now TOOLCHANGE_PARK_XY_FEEDRATE."
398 #elif defined(PARKING_EXTRUDER_SECURITY_RAISE)
399 #error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE."
400 #elif defined(SWITCHING_TOOLHEAD_SECURITY_RAISE)
401 #error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE."
402 #elif defined(G0_FEEDRATE) && G0_FEEDRATE == 0
403 #error "G0_FEEDRATE is now used to set the G0 feedrate."
404 #elif defined(MBL_Z_STEP)
405 #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP."
406 #elif defined(CHDK)
407 #error "CHDK is now CHDK_PIN."
408 #elif defined(MAX6675_SS) || defined(MAX6675_SS2)
409 #error "MAX6675_SS / MAX6675_SS2 is now MAX6675_SS_PIN / MAX6675_SS2_PIN."
410 #elif defined(MAX31865_SENSOR_OHMS)
411 #error "MAX31865_SENSOR_OHMS is now MAX31865_SENSOR_OHMS_0."
412 #elif defined(MAX31865_CALIBRATION_OHMS)
413 #error "MAX31865_CALIBRATION_OHMS is now MAX31865_CALIBRATION_OHMS_0."
414 #elif defined(SPINDLE_LASER_ENABLE)
415 #error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE."
416 #elif defined(SPINDLE_LASER_ENABLE_PIN)
417 #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN."
418 #elif defined(SPINDLE_DIR_CHANGE)
419 #error "SPINDLE_DIR_CHANGE is now SPINDLE_CHANGE_DIR."
420 #elif defined(SPINDLE_STOP_ON_DIR_CHANGE)
421 #error "SPINDLE_STOP_ON_DIR_CHANGE is now SPINDLE_CHANGE_DIR_STOP."
422 #elif defined(SPINDLE_LASER_ACTIVE_HIGH)
423 #error "SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE."
424 #elif defined(SPINDLE_LASER_ENABLE_INVERT)
425 #error "SPINDLE_LASER_ENABLE_INVERT is now SPINDLE_LASER_ACTIVE_STATE."
426 #elif defined(CUTTER_POWER_DISPLAY)
427 #error "CUTTER_POWER_DISPLAY is now CUTTER_POWER_UNIT."
428 #elif defined(CHAMBER_HEATER_PIN)
429 #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN."
430 #elif defined(TMC_Z_CALIBRATION)
431 #error "TMC_Z_CALIBRATION has been deprecated in favor of MECHANICAL_GANTRY_CALIBRATION."
432 #elif defined(Z_MIN_PROBE_ENDSTOP)
433 #error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it."
434 #elif defined(DUAL_NOZZLE_DUPLICATION_MODE)
435 #error "DUAL_NOZZLE_DUPLICATION_MODE is now MULTI_NOZZLE_DUPLICATION."
436 #elif defined(MENU_ITEM_CASE_LIGHT)
437 #error "MENU_ITEM_CASE_LIGHT is now CASE_LIGHT_MENU."
438 #elif defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
439 #error "ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED is now SD_ABORT_ON_ENDSTOP_HIT."
440 #elif defined(LPC_SD_LCD) || defined(LPC_SD_ONBOARD) || defined(LPC_SD_CUSTOM_CABLE)
441 #error "LPC_SD_(LCD|ONBOARD|CUSTOM_CABLE) are now SDCARD_CONNECTION."
442 #elif defined(USB_SD_DISABLED)
443 #error "USB_SD_DISABLED is now NO_SD_HOST_DRIVE."
444 #elif defined(USB_SD_ONBOARD)
445 #error "USB_SD_ONBOARD is obsolete. Disable NO_SD_HOST_DRIVE instead."
446 #elif defined(PSU_ACTIVE_HIGH)
447 #error "PSU_ACTIVE_HIGH is now PSU_ACTIVE_STATE."
448 #elif POWER_SUPPLY == 1
449 #error "Replace POWER_SUPPLY 1 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'LOW'."
450 #elif POWER_SUPPLY == 2
451 #error "Replace POWER_SUPPLY 2 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'HIGH'."
452 #elif defined(POWER_SUPPLY)
453 #error "POWER_SUPPLY is now obsolete. Please remove it."
454 #elif defined(MKS_ROBIN_TFT)
455 #error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT."
456 #elif defined(SDPOWER)
457 #error "SDPOWER is now SDPOWER_PIN."
458 #elif defined(STRING_SPLASH_LINE1) || defined(STRING_SPLASH_LINE2)
459 #error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them."
460 #elif defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_X)
461 #error "Z_PROBE_ALLEN_KEY_(DEPLOY|STOW) coordinates are now a single setting."
462 #elif defined(X_PROBE_OFFSET_FROM_EXTRUDER) || defined(Y_PROBE_OFFSET_FROM_EXTRUDER) || defined(Z_PROBE_OFFSET_FROM_EXTRUDER)
463 #error "[XYZ]_PROBE_OFFSET_FROM_EXTRUDER is now NOZZLE_TO_PROBE_OFFSET."
464 #elif defined(MIN_PROBE_X) || defined(MIN_PROBE_Y) || defined(MAX_PROBE_X) || defined(MAX_PROBE_Y)
465 #error "(MIN|MAX)_PROBE_[XY] are now calculated at runtime. Please remove them."
466 #elif defined(Z_STEPPER_ALIGN_X) || defined(Z_STEPPER_ALIGN_X)
467 #error "Z_STEPPER_ALIGN_X and Z_STEPPER_ALIGN_Y are now combined as Z_STEPPER_ALIGN_XY."
468 #elif defined(JUNCTION_DEVIATION)
469 #error "JUNCTION_DEVIATION is no longer required. (See CLASSIC_JERK). Please remove it."
470 #elif defined(BABYSTEP_MULTIPLICATOR)
471 #error "BABYSTEP_MULTIPLICATOR is now BABYSTEP_MULTIPLICATOR_[XY|Z]."
472 #elif defined(LULZBOT_TOUCH_UI)
473 #error "LULZBOT_TOUCH_UI is now TOUCH_UI_FTDI_EVE."
474 #elif defined(PS_DEFAULT_OFF)
475 #error "PS_DEFAULT_OFF is now PSU_DEFAULT_OFF."
476 #elif defined(FILAMENT_UNLOAD_RETRACT_LENGTH)
477 #error "FILAMENT_UNLOAD_RETRACT_LENGTH is now FILAMENT_UNLOAD_PURGE_RETRACT."
478 #elif defined(FILAMENT_UNLOAD_DELAY)
479 #error "FILAMENT_UNLOAD_DELAY is now FILAMENT_UNLOAD_PURGE_DELAY."
480 #elif defined(HOME_USING_SPREADCYCLE)
481 #error "HOME_USING_SPREADCYCLE is now obsolete. Please remove it."
482 #elif defined(DGUS_LCD)
483 #error "DGUS_LCD is now DGUS_LCD_UI_(ORIGIN|FYSETC|HIPRECY)."
484 #elif defined(DGUS_SERIAL_PORT)
485 #error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT."
486 #elif defined(DGUS_BAUDRATE)
487 #error "DGUS_BAUDRATE is now LCD_BAUDRATE."
488 #elif defined(DGUS_STATS_RX_BUFFER_OVERRUNS)
489 #error "DGUS_STATS_RX_BUFFER_OVERRUNS is now STATS_RX_BUFFER_OVERRUNS."
490 #elif defined(ANYCUBIC_LCD_SERIAL_PORT)
491 #error "ANYCUBIC_LCD_SERIAL_PORT is now LCD_SERIAL_PORT."
492 #elif defined(INTERNAL_SERIAL_PORT)
493 #error "INTERNAL_SERIAL_PORT is now MMU2_SERIAL_PORT."
494 #elif defined(X_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Y_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Z_DUAL_ENDSTOPS_ADJUSTMENT)
495 #error "[XYZ]_DUAL_ENDSTOPS_ADJUSTMENT is now [XYZ]2_ENDSTOP_ADJUSTMENT."
496 #elif defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT2) || defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT3)
497 #error "Z_TRIPLE_ENDSTOPS_ADJUSTMENT[23] is now Z[23]_ENDSTOP_ADJUSTMENT."
498 #elif defined(Z_QUAD_ENDSTOPS_ADJUSTMENT2) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT3) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT4)
499 #error "Z_QUAD_ENDSTOPS_ADJUSTMENT[234] is now Z[234]_ENDSTOP_ADJUSTMENT."
500 #elif defined(Z_DUAL_STEPPER_DRIVERS)
501 #error "Z_DUAL_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 2."
502 #elif defined(Z_TRIPLE_STEPPER_DRIVERS)
503 #error "Z_TRIPLE_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 3."
504 #elif defined(Z_QUAD_STEPPER_DRIVERS)
505 #error "Z_QUAD_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 4."
506 #elif defined(Z_DUAL_ENDSTOPS) || defined(Z_TRIPLE_ENDSTOPS) || defined(Z_QUAD_ENDSTOPS)
507 #error "Z_(DUAL|TRIPLE|QUAD)_ENDSTOPS is now Z_MULTI_ENDSTOPS."
508 #elif defined(DUGS_UI_MOVE_DIS_OPTION)
509 #error "DUGS_UI_MOVE_DIS_OPTION is spelled DGUS_UI_MOVE_DIS_OPTION."
510 #elif defined(ORIG_E0_AUTO_FAN_PIN) || defined(ORIG_E1_AUTO_FAN_PIN) || defined(ORIG_E2_AUTO_FAN_PIN) || defined(ORIG_E3_AUTO_FAN_PIN) || defined(ORIG_E4_AUTO_FAN_PIN) || defined(ORIG_E5_AUTO_FAN_PIN) || defined(ORIG_E6_AUTO_FAN_PIN) || defined(ORIG_E7_AUTO_FAN_PIN)
511 #error "ORIG_Ex_AUTO_FAN_PIN is now just Ex_AUTO_FAN_PIN."
512 #elif defined(ORIG_CHAMBER_AUTO_FAN_PIN)
513 #error "ORIG_CHAMBER_AUTO_FAN_PIN is now just CHAMBER_AUTO_FAN_PIN."
514 #elif defined(HOMING_BACKOFF_MM)
515 #error "HOMING_BACKOFF_MM is now HOMING_BACKOFF_POST_MM."
516 #elif defined(X_HOME_BUMP_MM) || defined(Y_HOME_BUMP_MM) || defined(Z_HOME_BUMP_MM)
517 #error "[XYZ]_HOME_BUMP_MM is now HOMING_BUMP_MM."
518 #elif defined(DIGIPOT_I2C)
519 #error "DIGIPOT_I2C is now DIGIPOT_MCP4451 (or DIGIPOT_MCP4018)."
520 #elif defined(TOUCH_BUTTONS)
521 #error "TOUCH_BUTTONS is now TOUCH_SCREEN."
522 #elif defined(LCD_FULL_PIXEL_HEIGHT) || defined(LCD_FULL_PIXEL_WIDTH)
523 #error "LCD_FULL_PIXEL_(WIDTH|HEIGHT) is deprecated and should be removed."
524 #elif defined(FSMC_UPSCALE)
525 #error "FSMC_UPSCALE is now GRAPHICAL_TFT_UPSCALE."
526 #elif defined(ANYCUBIC_TFT_MODEL)
527 #error "ANYCUBIC_TFT_MODEL is now ANYCUBIC_LCD_I3MEGA."
528 #elif defined(EVENT_GCODE_SD_STOP)
529 #error "EVENT_GCODE_SD_STOP is now EVENT_GCODE_SD_ABORT."
530 #elif defined(GRAPHICAL_TFT_ROTATE_180)
531 #error "GRAPHICAL_TFT_ROTATE_180 is now TFT_ROTATION set to TFT_ROTATE_180."
532 #elif defined(PROBE_OFFSET_START)
533 #error "PROBE_OFFSET_START is now PROBE_OFFSET_WIZARD_START_Z."
534 #elif defined(POWER_LOSS_PULL)
535 #error "POWER_LOSS_PULL is now specifically POWER_LOSS_PULL(UP|DOWN)."
536 #elif defined(SHORT_MANUAL_Z_MOVE)
537 #error "SHORT_MANUAL_Z_MOVE is now FINE_MANUAL_MOVE, applying to Z on most printers."
538 #elif defined(FIL_RUNOUT_INVERTING)
539 #if FIL_RUNOUT_INVERTING
540 #error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH."
541 #else
542 #error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_STATE LOW."
543 #endif
544 #elif defined(ASSISTED_TRAMMING_MENU_ITEM)
545 #error "ASSISTED_TRAMMING_MENU_ITEM is deprecated and should be removed."
546 #endif
549 * Probe temp compensation requirements
551 #if ENABLED(PROBE_TEMP_COMPENSATION)
552 #if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
553 #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
554 #elif !defined(PTC_PARK_POS)
555 #error "PROBE_TEMP_COMPENSATION requires PTC_PARK_POS."
556 #elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y)
557 #error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)."
558 #elif !defined(PTC_PROBE_POS)
559 #error "PROBE_TEMP_COMPENSATION requires PTC_PROBE_POS."
560 #endif
561 #endif
564 * Marlin release, version and default string
566 #ifndef SHORT_BUILD_VERSION
567 #error "SHORT_BUILD_VERSION must be specified."
568 #elif !defined(DETAILED_BUILD_VERSION)
569 #error "BUILD_VERSION must be specified."
570 #elif !defined(STRING_DISTRIBUTION_DATE)
571 #error "STRING_DISTRIBUTION_DATE must be specified."
572 #elif !defined(PROTOCOL_VERSION)
573 #error "PROTOCOL_VERSION must be specified."
574 #elif !defined(MACHINE_NAME)
575 #error "MACHINE_NAME must be specified."
576 #elif !defined(SOURCE_CODE_URL)
577 #error "SOURCE_CODE_URL must be specified."
578 #elif !defined(DEFAULT_MACHINE_UUID)
579 #error "DEFAULT_MACHINE_UUID must be specified."
580 #elif !defined(WEBSITE_URL)
581 #error "WEBSITE_URL must be specified."
582 #endif
585 * Serial
587 #ifndef SERIAL_PORT
588 #error "SERIAL_PORT must be defined."
589 #elif defined(SERIAL_PORT_2) && SERIAL_PORT_2 == SERIAL_PORT
590 #error "SERIAL_PORT_2 cannot be the same as SERIAL_PORT."
591 #endif
592 #if !(defined(__AVR__) && defined(USBCON))
593 #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
594 #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
595 #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
596 #error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
597 #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
598 #error "TX_BUFFER_SIZE must be 0 or a power of 2 between 1 and 256."
599 #endif
600 #elif ANY(SERIAL_XON_XOFF, SERIAL_STATS_MAX_RX_QUEUED, SERIAL_STATS_DROPPED_RX)
601 #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
602 #endif
605 * Multiple Stepper Drivers Per Axis
607 #define GOOD_AXIS_PINS(A) (HAS_##A##_ENABLE && HAS_##A##_STEP && HAS_##A##_DIR)
608 #if ENABLED(X_DUAL_STEPPER_DRIVERS)
609 #if ENABLED(DUAL_X_CARRIAGE)
610 #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS."
611 #elif !GOOD_AXIS_PINS(X)
612 #error "X_DUAL_STEPPER_DRIVERS requires X2 pins to be defined."
613 #endif
614 #endif
616 #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !GOOD_AXIS_PINS(Y)
617 #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins to be defined."
618 #elif !WITHIN(NUM_Z_STEPPER_DRIVERS, 1, 4)
619 #error "NUM_Z_STEPPER_DRIVERS must be an integer from 1 to 4."
620 #elif NUM_Z_STEPPER_DRIVERS == 2 && !GOOD_AXIS_PINS(Z2)
621 #error "If NUM_Z_STEPPER_DRIVERS is 2, you must define stepper pins for Z2."
622 #elif NUM_Z_STEPPER_DRIVERS == 3 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3))
623 #error "If NUM_Z_STEPPER_DRIVERS is 3, you must define stepper pins for Z2 and Z3."
624 #elif NUM_Z_STEPPER_DRIVERS == 4 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3) && GOOD_AXIS_PINS(Z4))
625 #error "If NUM_Z_STEPPER_DRIVERS is 4, you must define stepper pins for Z2, Z3, and Z4."
626 #endif
629 * Validate that the bed size fits
631 static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE.");
632 static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE.");
635 * Granular software endstops (Marlin >= 1.1.7)
637 #if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z)
638 #if IS_KINEMATIC
639 #error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z."
640 #elif NONE(MIN_SOFTWARE_ENDSTOP_X, MIN_SOFTWARE_ENDSTOP_Y)
641 #error "MIN_SOFTWARE_ENDSTOPS requires at least one of the MIN_SOFTWARE_ENDSTOP_[XYZ] options."
642 #endif
643 #endif
645 #if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z)
646 #if IS_KINEMATIC
647 #error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z."
648 #elif NONE(MAX_SOFTWARE_ENDSTOP_X, MAX_SOFTWARE_ENDSTOP_Y)
649 #error "MAX_SOFTWARE_ENDSTOPS requires at least one of the MAX_SOFTWARE_ENDSTOP_[XYZ] options."
650 #endif
651 #endif
653 #if !defined(TARGET_LPC1768) && ANY( \
654 ENDSTOPPULLDOWNS, \
655 ENDSTOPPULLDOWN_XMAX, ENDSTOPPULLDOWN_YMAX, \
656 ENDSTOPPULLDOWN_ZMAX, ENDSTOPPULLDOWN_XMIN, \
657 ENDSTOPPULLDOWN_YMIN, ENDSTOPPULLDOWN_ZMIN \
659 #error "PULLDOWN pin mode is not available on the selected board."
660 #endif
662 #if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS)
663 #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS."
664 #elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN)
665 #error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN."
666 #elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX)
667 #error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX."
668 #elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX)
669 #error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
670 #elif BOTH(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX)
671 #error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
672 #elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN)
673 #error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
674 #elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN)
675 #error "Enable only one of ENDSTOPPULLUP_Y_MIN or ENDSTOPPULLDOWN_Y_MIN."
676 #elif BOTH(ENDSTOPPULLUP_ZMIN, ENDSTOPPULLDOWN_ZMIN)
677 #error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN."
678 #endif
681 * LCD Info Screen Style
683 #if LCD_INFO_SCREEN_STYLE > 0
684 #if HAS_MARLINUI_U8GLIB || LCD_WIDTH < 20 || LCD_HEIGHT < 4
685 #error "Alternative LCD_INFO_SCREEN_STYLE requires 20x4 Character LCD."
686 #elif LCD_INFO_SCREEN_STYLE > 1
687 #error "LCD_INFO_SCREEN_STYLE only has options 0 and 1 at this time."
688 #endif
689 #endif
692 * Progress Bar
694 #if ENABLED(LCD_PROGRESS_BAR)
695 #if NONE(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
696 #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY."
697 #elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
698 #error "LCD_PROGRESS_BAR only applies to HD44780 character LCD and TFTGLCD_PANEL_(SPI|I2C)."
699 #elif HAS_MARLINUI_U8GLIB
700 #error "LCD_PROGRESS_BAR does not apply to graphical displays."
701 #elif ENABLED(FILAMENT_LCD_DISPLAY)
702 #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both."
703 #elif PROGRESS_MSG_EXPIRE < 0
704 #error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
705 #endif
706 #elif ENABLED(LCD_SET_PROGRESS_MANUALLY)
707 #if NONE(HAS_MARLINUI_U8GLIB, HAS_GRAPHICAL_TFT, HAS_MARLINUI_HD44780, EXTENSIBLE_UI)
708 #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Character LCD, Graphical LCD, TFT, or EXTENSIBLE_UI."
709 #endif
710 #endif
712 #if !HAS_LCD_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
713 #error "SD_REPRINT_LAST_SELECTED_FILE currently requires a Marlin-native LCD menu."
714 #endif
717 * Custom Boot and Status screens
719 #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE)
720 #error "SHOW_CUSTOM_BOOTSCREEN requires Graphical LCD or TOUCH_UI_FTDI_EVE."
721 #elif ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && !HAS_MARLINUI_U8GLIB
722 #error "CUSTOM_STATUS_SCREEN_IMAGE requires a 128x64 DOGM B/W Graphical LCD."
723 #endif
726 * LCD Lightweight Screen Style
728 #if ENABLED(LIGHTWEIGHT_UI) && DISABLED(U8GLIB_ST7920)
729 #error "LIGHTWEIGHT_UI requires a U8GLIB_ST7920-based display."
730 #endif
733 * SD File Sorting
735 #if ENABLED(SDCARD_SORT_ALPHA)
736 #if SDSORT_LIMIT > 256
737 #error "SDSORT_LIMIT must be 256 or smaller."
738 #elif SDSORT_LIMIT < 10
739 #error "SDSORT_LIMIT should be greater than 9 to be useful."
740 #elif DISABLED(SDSORT_USES_RAM)
741 #if ENABLED(SDSORT_DYNAMIC_RAM)
742 #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)."
743 #elif ENABLED(SDSORT_CACHE_NAMES)
744 #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)."
745 #endif
746 #endif
748 #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
749 #if SDSORT_CACHE_VFATS < 2
750 #error "SDSORT_CACHE_VFATS must be 2 or greater!"
751 #elif SDSORT_CACHE_VFATS > MAX_VFAT_ENTRIES
752 #undef SDSORT_CACHE_VFATS
753 #define SDSORT_CACHE_VFATS MAX_VFAT_ENTRIES
754 #warning "SDSORT_CACHE_VFATS was reduced to MAX_VFAT_ENTRIES!"
755 #endif
756 #endif
757 #endif
759 #if defined(EVENT_GCODE_SD_ABORT) && DISABLED(NOZZLE_PARK_FEATURE)
760 static_assert(nullptr == strstr(EVENT_GCODE_SD_ABORT, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_ABORT.");
761 #endif
764 * I2C Position Encoders
766 #if ENABLED(I2C_POSITION_ENCODERS)
767 #if !BOTH(BABYSTEPPING, BABYSTEP_XY)
768 #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY."
769 #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5)
770 #error "I2CPE_ENCODER_CNT must be between 1 and 5."
771 #endif
772 #endif
775 * Babystepping
777 #if ENABLED(BABYSTEPPING)
778 #if ENABLED(SCARA)
779 #error "BABYSTEPPING is not implemented for SCARA yet."
780 #elif BOTH(MARKFORGED_XY, BABYSTEP_XY)
781 #error "BABYSTEPPING only implemented for Z axis on MarkForged."
782 #elif BOTH(DELTA, BABYSTEP_XY)
783 #error "BABYSTEPPING only implemented for Z axis on deltabots."
784 #elif BOTH(BABYSTEP_ZPROBE_OFFSET, MESH_BED_LEVELING)
785 #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
786 #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
787 #error "BABYSTEP_ZPROBE_OFFSET requires a probe."
788 #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !HAS_MARLINUI_U8GLIB
789 #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD."
790 #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
791 #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
792 #elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET
793 #error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS."
794 #elif BOTH(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE)
795 #error "BABYSTEP_ALWAYS_AVAILABLE and MOVE_Z_WHEN_IDLE are incompatible."
796 #elif !defined(BABYSTEP_MULTIPLICATOR_Z)
797 #error "BABYSTEPPING requires BABYSTEP_MULTIPLICATOR_Z."
798 #elif ENABLED(BABYSTEP_XY) && !defined(BABYSTEP_MULTIPLICATOR_XY)
799 #error "BABYSTEP_XY requires BABYSTEP_MULTIPLICATOR_XY."
800 #elif ENABLED(BABYSTEP_MILLIMETER_UNITS)
801 static_assert(BABYSTEP_MULTIPLICATOR_Z <= 0.1f, "BABYSTEP_MULTIPLICATOR_Z must be less or equal to 0.1mm.");
802 #if ENABLED(BABYSTEP_XY)
803 static_assert(BABYSTEP_MULTIPLICATOR_XY <= 0.25f, "BABYSTEP_MULTIPLICATOR_XY must be less than or equal to 0.25mm.");
804 #endif
805 #elif ENABLED(BABYSTEP_DISPLAY_TOTAL) && ANY(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)
806 #error "New Color UI (TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI) does not support BABYSTEP_DISPLAY_TOTAL yet."
807 #endif
808 #endif
811 * Filament Runout needs one or more pins and either SD Support or Auto print start detection
813 #if HAS_FILAMENT_SENSOR
814 #if !PIN_EXISTS(FIL_RUNOUT)
815 #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
816 #elif NUM_RUNOUT_SENSORS > E_STEPPERS
817 #if HAS_PRUSA_MMU2
818 #error "NUM_RUNOUT_SENSORS must be 1 with MMU2 / MMU2S."
819 #else
820 #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers."
821 #endif
822 #elif NUM_RUNOUT_SENSORS >= 2 && !PIN_EXISTS(FIL_RUNOUT2)
823 #error "FIL_RUNOUT2_PIN is required with NUM_RUNOUT_SENSORS >= 2."
824 #elif NUM_RUNOUT_SENSORS >= 3 && !PIN_EXISTS(FIL_RUNOUT3)
825 #error "FIL_RUNOUT3_PIN is required with NUM_RUNOUT_SENSORS >= 3."
826 #elif NUM_RUNOUT_SENSORS >= 4 && !PIN_EXISTS(FIL_RUNOUT4)
827 #error "FIL_RUNOUT4_PIN is required with NUM_RUNOUT_SENSORS >= 4."
828 #elif NUM_RUNOUT_SENSORS >= 5 && !PIN_EXISTS(FIL_RUNOUT5)
829 #error "FIL_RUNOUT5_PIN is required with NUM_RUNOUT_SENSORS >= 5."
830 #elif NUM_RUNOUT_SENSORS >= 6 && !PIN_EXISTS(FIL_RUNOUT6)
831 #error "FIL_RUNOUT6_PIN is required with NUM_RUNOUT_SENSORS >= 6."
832 #elif NUM_RUNOUT_SENSORS >= 7 && !PIN_EXISTS(FIL_RUNOUT7)
833 #error "FIL_RUNOUT7_PIN is required with NUM_RUNOUT_SENSORS >= 7."
834 #elif NUM_RUNOUT_SENSORS >= 8 && !PIN_EXISTS(FIL_RUNOUT8)
835 #error "FIL_RUNOUT8_PIN is required with NUM_RUNOUT_SENSORS >= 8."
836 #elif BOTH(FIL_RUNOUT1_PULLUP, FIL_RUNOUT1_PULLDOWN)
837 #error "You can't enable FIL_RUNOUT1_PULLUP and FIL_RUNOUT1_PULLDOWN at the same time."
838 #elif BOTH(FIL_RUNOUT2_PULLUP, FIL_RUNOUT2_PULLDOWN)
839 #error "You can't enable FIL_RUNOUT2_PULLUP and FIL_RUNOUT2_PULLDOWN at the same time."
840 #elif BOTH(FIL_RUNOUT3_PULLUP, FIL_RUNOUT3_PULLDOWN)
841 #error "You can't enable FIL_RUNOUT3_PULLUP and FIL_RUNOUT3_PULLDOWN at the same time."
842 #elif BOTH(FIL_RUNOUT4_PULLUP, FIL_RUNOUT4_PULLDOWN)
843 #error "You can't enable FIL_RUNOUT4_PULLUP and FIL_RUNOUT4_PULLDOWN at the same time."
844 #elif BOTH(FIL_RUNOUT5_PULLUP, FIL_RUNOUT5_PULLDOWN)
845 #error "You can't enable FIL_RUNOUT5_PULLUP and FIL_RUNOUT5_PULLDOWN at the same time."
846 #elif BOTH(FIL_RUNOUT6_PULLUP, FIL_RUNOUT6_PULLDOWN)
847 #error "You can't enable FIL_RUNOUT6_PULLUP and FIL_RUNOUT6_PULLDOWN at the same time."
848 #elif BOTH(FIL_RUNOUT7_PULLUP, FIL_RUNOUT7_PULLDOWN)
849 #error "You can't enable FIL_RUNOUT7_PULLUP and FIL_RUNOUT7_PULLDOWN at the same time."
850 #elif BOTH(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN)
851 #error "You can't enable FIL_RUNOUT8_PULLUP and FIL_RUNOUT8_PULLDOWN at the same time."
852 #elif FILAMENT_RUNOUT_DISTANCE_MM < 0
853 #error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero."
854 #elif DISABLED(ADVANCED_PAUSE_FEATURE)
855 static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
856 #endif
857 #endif
860 * Advanced Pause
862 #if ENABLED(ADVANCED_PAUSE_FEATURE)
863 #if !HAS_RESUME_CONTINUE
864 #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
865 #elif DISABLED(NOZZLE_PARK_FEATURE)
866 #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE."
867 #elif !defined(FILAMENT_UNLOAD_PURGE_FEEDRATE)
868 #error "ADVANCED_PAUSE_FEATURE requires FILAMENT_UNLOAD_PURGE_FEEDRATE."
869 #elif ENABLED(EXTRUDER_RUNOUT_PREVENT)
870 #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
871 #elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(SDSUPPORT, IS_NEWPANEL, EMERGENCY_PARSER)
872 #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller."
873 #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
874 #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT."
875 #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH
876 #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
877 #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH
878 #error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
879 #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH
880 #error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
881 #endif
882 #endif
884 #if ENABLED(NOZZLE_PARK_FEATURE)
885 constexpr float npp[] = NOZZLE_PARK_POINT;
886 static_assert(COUNT(npp) == XYZ, "NOZZLE_PARK_POINT requires X, Y, and Z values.");
887 constexpr xyz_pos_t npp_xyz = NOZZLE_PARK_POINT;
888 static_assert(WITHIN(npp_xyz.x, X_MIN_POS, X_MAX_POS), "NOZZLE_PARK_POINT.X is out of bounds (X_MIN_POS, X_MAX_POS).");
889 static_assert(WITHIN(npp_xyz.y, Y_MIN_POS, Y_MAX_POS), "NOZZLE_PARK_POINT.Y is out of bounds (Y_MIN_POS, Y_MAX_POS).");
890 static_assert(WITHIN(npp_xyz.z, Z_MIN_POS, Z_MAX_POS), "NOZZLE_PARK_POINT.Z is out of bounds (Z_MIN_POS, Z_MAX_POS).");
891 #endif
894 * Individual axis homing is useless for DELTAS
896 #if BOTH(INDIVIDUAL_AXIS_HOMING_MENU, DELTA)
897 #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
898 #endif
901 * Sanity checking for all Průša MMU
903 #ifdef SNMM
904 #error "SNMM is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
905 #elif ENABLED(MK2_MULTIPLEXER)
906 #error "MK2_MULTIPLEXER is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
907 #elif ENABLED(PRUSA_MMU2)
908 #error "PRUSA_MMU2 is obsolete. Define MMU_MODEL as PRUSA_MMU2 instead."
909 #elif ENABLED(PRUSA_MMU2_S_MODE)
910 #error "PRUSA_MMU2_S_MODE is obsolete. Define MMU_MODEL as PRUSA_MMU2S instead."
911 #endif
914 * Multi-Material-Unit 2 / SMUFF requirements
916 #if HAS_PRUSA_MMU2
917 #if EXTRUDERS != 5
918 #undef SINGLENOZZLE
919 #error "PRUSA_MMU2(S) requires exactly 5 EXTRUDERS. Please update your Configuration."
920 #elif DISABLED(NOZZLE_PARK_FEATURE)
921 #error "PRUSA_MMU2(S) requires NOZZLE_PARK_FEATURE. Enable it to continue."
922 #elif HAS_PRUSA_MMU2S && DISABLED(FILAMENT_RUNOUT_SENSOR)
923 #error "PRUSA_MMU2S requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
924 #elif ENABLED(MMU_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR)
925 #error "MMU_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
926 #elif ENABLED(MMU_EXTRUDER_SENSOR) && !HAS_LCD_MENU
927 #error "MMU_EXTRUDER_SENSOR requires an LCD supporting MarlinUI to be enabled."
928 #elif DISABLED(ADVANCED_PAUSE_FEATURE)
929 static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2(S) / SMUFF_EMU_MMU2(S).");
930 #endif
931 #endif
932 #if HAS_SMUFF && EXTRUDERS > 12
933 #error "Too many extruders for SMUFF_EMU_MMU2(S). (12 maximum)."
934 #endif
937 * Options only for EXTRUDERS > 1
939 #if HAS_MULTI_EXTRUDER
941 #if EXTRUDERS > 8
942 #error "Marlin supports a maximum of 8 EXTRUDERS."
943 #endif
945 #if ENABLED(HEATERS_PARALLEL)
946 #error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
947 #endif
949 #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
950 #ifndef TOOLCHANGE_FS_LENGTH
951 #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH."
952 #elif !defined(TOOLCHANGE_FS_RETRACT_SPEED)
953 #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_RETRACT_SPEED."
954 #elif !defined(TOOLCHANGE_FS_PRIME_SPEED)
955 #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_PRIME_SPEED."
956 #endif
957 #endif
959 #if ENABLED(TOOLCHANGE_PARK)
960 #ifndef TOOLCHANGE_PARK_XY
961 #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY."
962 #elif !defined(TOOLCHANGE_PARK_XY_FEEDRATE)
963 #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY_FEEDRATE."
964 #endif
965 #endif
967 #ifndef TOOLCHANGE_ZRAISE
968 #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1."
969 #endif
971 #elif HAS_PRUSA_MMU1 || HAS_SMUFF
973 #error "Multi-Material-Unit requires 2 or more EXTRUDERS."
975 #elif ENABLED(SINGLENOZZLE)
977 #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
979 #endif
982 * A Dual Nozzle carriage with switching servo
984 #if ENABLED(SWITCHING_NOZZLE)
985 #if ENABLED(DUAL_X_CARRIAGE)
986 #error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible."
987 #elif ENABLED(SINGLENOZZLE)
988 #error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible."
989 #elif EXTRUDERS != 2
990 #error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
991 #elif NUM_SERVOS < 1
992 #error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1."
993 #endif
995 #ifndef SWITCHING_NOZZLE_SERVO_NR
996 #error "SWITCHING_NOZZLE requires SWITCHING_NOZZLE_SERVO_NR."
997 #elif SWITCHING_NOZZLE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
998 #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
999 #elif SWITCHING_NOZZLE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
1000 #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
1001 #elif SWITCHING_NOZZLE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
1002 #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
1003 #elif SWITCHING_NOZZLE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
1004 #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
1005 #endif
1007 #ifdef SWITCHING_NOZZLE_E1_SERVO_NR
1008 #if SWITCHING_NOZZLE_E1_SERVO_NR == SWITCHING_NOZZLE_SERVO_NR
1009 #error "SWITCHING_NOZZLE_E1_SERVO_NR must be different from SWITCHING_NOZZLE_SERVO_NR."
1010 #elif SWITCHING_NOZZLE_E1_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
1011 #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
1012 #elif SWITCHING_NOZZLE_E1_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
1013 #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
1014 #elif SWITCHING_NOZZLE_E1_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
1015 #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
1016 #elif SWITCHING_NOZZLE_E1_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
1017 #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
1018 #endif
1019 #endif
1020 #endif
1023 * Single Stepper Dual Extruder with switching servo
1025 #if ENABLED(SWITCHING_EXTRUDER)
1026 #if NUM_SERVOS < 1
1027 #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
1028 #elif SWITCHING_EXTRUDER_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
1029 #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
1030 #elif SWITCHING_EXTRUDER_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
1031 #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
1032 #elif SWITCHING_EXTRUDER_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
1033 #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
1034 #elif SWITCHING_EXTRUDER_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
1035 #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
1036 #endif
1037 #if EXTRUDERS > 3
1038 #if NUM_SERVOS < 2
1039 #error "SWITCHING_EXTRUDER with 4 extruders requires NUM_SERVOS >= 2."
1040 #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
1041 #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
1042 #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
1043 #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
1044 #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
1045 #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
1046 #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
1047 #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
1048 #elif SWITCHING_EXTRUDER_E23_SERVO_NR == SWITCHING_EXTRUDER_SERVO_NR
1049 #error "SWITCHING_EXTRUDER_E23_SERVO_NR should be a different extruder from SWITCHING_EXTRUDER_SERVO_NR."
1050 #endif
1051 #endif
1052 #endif
1055 * Mixing Extruder requirements
1057 #if ENABLED(MIXING_EXTRUDER)
1058 #if HAS_MULTI_EXTRUDER
1059 #error "For MIXING_EXTRUDER set MIXING_STEPPERS > 1 instead of EXTRUDERS > 1."
1060 #elif MIXING_STEPPERS < 2
1061 #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
1062 #elif ENABLED(FILAMENT_SENSOR)
1063 #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway."
1064 #elif ENABLED(SWITCHING_EXTRUDER)
1065 #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both."
1066 #elif ENABLED(SINGLENOZZLE)
1067 #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE."
1068 #endif
1069 #endif
1072 * Linear Advance 1.5 - Check K value range
1074 #if ENABLED(LIN_ADVANCE)
1075 static_assert(
1076 WITHIN(LIN_ADVANCE_K, 0, 10),
1077 "LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)."
1079 #if ENABLED(S_CURVE_ACCELERATION) && DISABLED(EXPERIMENTAL_SCURVE)
1080 #error "LIN_ADVANCE and S_CURVE_ACCELERATION may not play well together! Enable EXPERIMENTAL_SCURVE to continue."
1081 #endif
1082 #endif
1085 * Special tool-changing options
1087 #if MANY(SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
1088 #error "Please select only one of SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, or ELECTROMAGNETIC_SWITCHING_TOOLHEAD."
1089 #endif
1092 * (Magnetic) Parking Extruder requirements
1094 #if ANY(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER)
1095 #if ENABLED(EXT_SOLENOID)
1096 #error "(MAGNETIC_)PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)"
1097 #elif EXTRUDERS != 2
1098 #error "(MAGNETIC_)PARKING_EXTRUDER requires exactly 2 EXTRUDERS."
1099 #elif !defined(PARKING_EXTRUDER_PARKING_X)
1100 #error "(MAGNETIC_)PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X."
1101 #elif !defined(TOOLCHANGE_ZRAISE)
1102 #error "(MAGNETIC_)PARKING_EXTRUDER requires TOOLCHANGE_ZRAISE."
1103 #elif TOOLCHANGE_ZRAISE < 0
1104 #error "TOOLCHANGE_ZRAISE must be 0 or higher."
1105 #elif ENABLED(PARKING_EXTRUDER)
1106 #if !PINS_EXIST(SOL0, SOL1)
1107 #error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN."
1108 #elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH)
1109 #error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW."
1110 #elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000)
1111 #error "PARKING_EXTRUDER_SOLENOIDS_DELAY must be between 0 and 2000 (ms)."
1112 #endif
1113 #endif
1114 #endif
1117 * Switching Toolhead requirements
1119 #if ENABLED(SWITCHING_TOOLHEAD)
1120 #ifndef SWITCHING_TOOLHEAD_SERVO_NR
1121 #error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SERVO_NR."
1122 #elif EXTRUDERS < 2
1123 #error "SWITCHING_TOOLHEAD requires at least 2 EXTRUDERS."
1124 #elif NUM_SERVOS < (SWITCHING_TOOLHEAD_SERVO_NR - 1)
1125 #if SWITCHING_TOOLHEAD_SERVO_NR == 0
1126 #error "A SWITCHING_TOOLHEAD_SERVO_NR of 0 requires NUM_SERVOS >= 1."
1127 #elif SWITCHING_TOOLHEAD_SERVO_NR == 1
1128 #error "A SWITCHING_TOOLHEAD_SERVO_NR of 1 requires NUM_SERVOS >= 2."
1129 #elif SWITCHING_TOOLHEAD_SERVO_NR == 2
1130 #error "A SWITCHING_TOOLHEAD_SERVO_NR of 2 requires NUM_SERVOS >= 3."
1131 #elif SWITCHING_TOOLHEAD_SERVO_NR == 3
1132 #error "A SWITCHING_TOOLHEAD_SERVO_NR of 3 requires NUM_SERVOS >= 4."
1133 #endif
1134 #elif !defined(TOOLCHANGE_ZRAISE)
1135 #error "SWITCHING_TOOLHEAD requires TOOLCHANGE_ZRAISE."
1136 #elif TOOLCHANGE_ZRAISE < 0
1137 #error "TOOLCHANGE_ZRAISE must be 0 or higher."
1138 #endif
1139 #endif
1142 * (Electro)magnetic Switching Toolhead requirements
1144 #if EITHER(MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
1145 #ifndef SWITCHING_TOOLHEAD_Y_POS
1146 #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_POS"
1147 #elif !defined(SWITCHING_TOOLHEAD_X_POS)
1148 #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_X_POS"
1149 #elif !defined(SWITCHING_TOOLHEAD_Z_HOP)
1150 #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
1151 #elif !defined(SWITCHING_TOOLHEAD_Y_CLEAR)
1152 #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_CLEAR."
1153 #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
1154 #if ENABLED(EXT_SOLENOID)
1155 #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD and EXT_SOLENOID are incompatible. (Pins are used twice.)"
1156 #elif !PIN_EXISTS(SOL0)
1157 #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SOL0_PIN."
1158 #endif
1159 #endif
1160 #endif
1163 * Part-Cooling Fan Multiplexer requirements
1165 #if PIN_EXISTS(FANMUX1)
1166 #if !HAS_FANMUX
1167 #error "FANMUX0_PIN must be set before FANMUX1_PIN can be set."
1168 #endif
1169 #elif PIN_EXISTS(FANMUX2)
1170 #error "FANMUX0_PIN and FANMUX1_PIN must be set before FANMUX2_PIN can be set."
1171 #endif
1174 * Limited user-controlled fans
1176 #if NUM_M106_FANS > FAN_COUNT
1177 #error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS."
1178 #endif
1181 * Limited number of servos
1183 #if NUM_SERVOS > NUM_SERVO_PLUGS
1184 #error "The selected board doesn't support enough servos for your configuration. Reduce NUM_SERVOS."
1185 #endif
1188 * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder
1190 #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_PROBE && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR) && !defined(SWITCHING_TOOLHEAD_SERVO_NR)
1191 #error "Z_PROBE_SERVO_NR, switching nozzle, switching toolhead or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE."
1192 #endif
1195 * Required LCD language
1197 #if HAS_MARLINUI_HD44780 && !defined(DISPLAY_CHARSET_HD44780)
1198 #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller."
1199 #endif
1202 * Bed Heating Options - PID vs Limit Switching
1204 #if BOTH(PIDTEMPBED, BED_LIMIT_SWITCHING)
1205 #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED."
1206 #endif
1209 * Kinematics
1213 * Allow only one kinematic type to be defined
1215 #if MANY(DELTA, MORGAN_SCARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY)
1216 #error "Please enable only one of DELTA, MORGAN_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, COREZY, or MARKFORGED_XY."
1217 #endif
1220 * Delta requirements
1222 #if ENABLED(DELTA)
1223 #if NONE(USE_XMAX_PLUG, USE_YMAX_PLUG, USE_ZMAX_PLUG)
1224 #error "You probably want to use Max Endstops for DELTA!"
1225 #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED
1226 #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
1227 #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_LCD_MENU)
1228 #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
1229 #elif ENABLED(DELTA_CALIBRATION_MENU) && !HAS_LCD_MENU
1230 #error "DELTA_CALIBRATION_MENU requires an LCD Controller."
1231 #elif ABL_GRID
1232 #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0
1233 #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
1234 #elif GRID_MAX_POINTS_X < 3
1235 #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher."
1236 #endif
1237 #endif
1238 #endif
1241 * Junction deviation is incompatible with kinematic systems.
1243 #if HAS_JUNCTION_DEVIATION && IS_KINEMATIC
1244 #error "CLASSIC_JERK is required for DELTA and SCARA."
1245 #endif
1248 * Probes
1252 * Allow only one probe option to be defined
1254 #if 1 < 0 \
1255 + (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \
1256 + COUNT_ENABLED(PROBE_MANUALLY, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING)
1257 #error "Please enable only one probe option: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
1258 #endif
1260 #if HAS_BED_PROBE
1263 * Z_PROBE_SLED is incompatible with DELTA
1265 #if BOTH(Z_PROBE_SLED, DELTA)
1266 #error "You cannot use Z_PROBE_SLED with DELTA."
1267 #endif
1270 * SOLENOID_PROBE requirements
1272 #if ENABLED(SOLENOID_PROBE)
1273 #if ENABLED(EXT_SOLENOID)
1274 #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID."
1275 #elif !HAS_SOLENOID_1
1276 #error "SOLENOID_PROBE requires SOL1_PIN."
1277 #endif
1278 #endif
1281 * NUM_SERVOS is required for a Z servo probe
1283 #if HAS_Z_SERVO_PROBE
1284 #if !NUM_SERVOS
1285 #error "NUM_SERVOS is required for a Z servo probe (Z_PROBE_SERVO_NR)."
1286 #elif Z_PROBE_SERVO_NR >= NUM_SERVOS
1287 #error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS."
1288 #elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
1289 #error "SERVO0_PIN must be defined for your servo or BLTOUCH probe."
1290 #elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
1291 #error "SERVO1_PIN must be defined for your servo or BLTOUCH probe."
1292 #elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
1293 #error "SERVO2_PIN must be defined for your servo or BLTOUCH probe."
1294 #elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
1295 #error "SERVO3_PIN must be defined for your servo or BLTOUCH probe."
1296 #endif
1297 #endif
1299 #if ENABLED(BLTOUCH)
1300 #if BLTOUCH_DELAY < 200
1301 #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported."
1302 #elif DISABLED(BLTOUCH_SET_5V_MODE) && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN, ENDSTOPPULLUP_ZMIN_PROBE)
1303 #error "BLTOUCH without BLTOUCH_SET_5V_MODE requires ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN or ENDSTOPPULLUP_ZMIN_PROBE."
1304 #endif
1305 #endif
1307 #if ENABLED(RACK_AND_PINION_PROBE) && !(defined(Z_PROBE_DEPLOY_X) && defined(Z_PROBE_RETRACT_X))
1308 #error "RACK_AND_PINION_PROBE requires Z_PROBE_DEPLOY_X and Z_PROBE_RETRACT_X."
1309 #endif
1312 * Touch-MI probe requirements
1314 #if ENABLED(TOUCH_MI_PROBE)
1315 #if DISABLED(Z_SAFE_HOMING)
1316 #error "TOUCH_MI_PROBE requires Z_SAFE_HOMING."
1317 #elif !defined(TOUCH_MI_RETRACT_Z)
1318 #error "TOUCH_MI_PROBE requires TOUCH_MI_RETRACT_Z."
1319 #elif defined(Z_AFTER_PROBING)
1320 #error "TOUCH_MI_PROBE requires Z_AFTER_PROBING to be disabled."
1321 #elif Z_HOMING_HEIGHT < 10
1322 #error "TOUCH_MI_PROBE requires Z_HOMING_HEIGHT >= 10."
1323 #elif Z_MIN_PROBE_ENDSTOP_INVERTING
1324 #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING to be set to false."
1325 #elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
1326 #error "TOUCH_MI_PROBE requires BABYSTEPPING with BABYSTEP_ZPROBE_OFFSET."
1327 #elif !HAS_RESUME_CONTINUE
1328 #error "TOUCH_MI_PROBE currently requires an LCD controller or EMERGENCY_PARSER."
1329 #endif
1330 #endif
1333 * Require pin options and pins to be defined
1335 #if ENABLED(SENSORLESS_PROBING)
1336 #if ENABLED(DELTA) && !(AXIS_HAS_STALLGUARD(X) && AXIS_HAS_STALLGUARD(Y) && AXIS_HAS_STALLGUARD(Z))
1337 #error "SENSORLESS_PROBING requires TMC2130/2160/2209/5130/5160 drivers on X, Y, and Z."
1338 #elif !AXIS_HAS_STALLGUARD(Z)
1339 #error "SENSORLESS_PROBING requires a TMC2130/2160/2209/5130/5160 driver on Z."
1340 #endif
1341 #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
1342 #if DISABLED(USE_ZMIN_PLUG)
1343 #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled."
1344 #elif !HAS_Z_MIN
1345 #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined."
1346 #elif Z_MIN_PROBE_ENDSTOP_INVERTING != Z_MIN_ENDSTOP_INVERTING
1347 #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING."
1348 #endif
1349 #elif !HAS_Z_MIN_PROBE_PIN
1350 #error "Z_MIN_PROBE_PIN must be defined if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN is not enabled."
1351 #endif
1354 * Check for improper NOZZLE_TO_PROBE_OFFSET
1356 constexpr xyz_pos_t sanity_nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET;
1357 #if ENABLED(NOZZLE_AS_PROBE)
1358 static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0,
1359 "NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0.");
1360 #else
1361 static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0.");
1362 static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0.");
1363 static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0.");
1364 static_assert(PROBING_MARGIN_LEFT >= 0, "PROBING_MARGIN_LEFT must be >= 0.");
1365 static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0.");
1366 #endif
1368 #define _MARGIN(A) TERN(IS_SCARA, SCARA_PRINTABLE_RADIUS, TERN(DELTA, DELTA_PRINTABLE_RADIUS, ((A##_BED_SIZE) / 2)))
1369 static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large.");
1370 static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large.");
1371 static_assert(PROBING_MARGIN_FRONT < _MARGIN(Y), "PROBING_MARGIN_FRONT is too large.");
1372 static_assert(PROBING_MARGIN_LEFT < _MARGIN(X), "PROBING_MARGIN_LEFT is too large.");
1373 static_assert(PROBING_MARGIN_RIGHT < _MARGIN(X), "PROBING_MARGIN_RIGHT is too large.");
1374 #undef _MARGIN
1377 * Make sure Z raise values are set
1379 #ifndef Z_CLEARANCE_DEPLOY_PROBE
1380 #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration."
1381 #elif !defined(Z_CLEARANCE_BETWEEN_PROBES)
1382 #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration."
1383 #elif Z_CLEARANCE_DEPLOY_PROBE < 0
1384 #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0."
1385 #elif Z_CLEARANCE_BETWEEN_PROBES < 0
1386 #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
1387 #elif Z_AFTER_PROBING < 0
1388 #error "Probes need Z_AFTER_PROBING >= 0."
1389 #endif
1391 #if MULTIPLE_PROBING > 0 || EXTRA_PROBING > 0
1392 #if MULTIPLE_PROBING == 0
1393 #error "EXTRA_PROBING requires MULTIPLE_PROBING."
1394 #elif MULTIPLE_PROBING < 2
1395 #error "MULTIPLE_PROBING must be 2 or more."
1396 #elif MULTIPLE_PROBING <= EXTRA_PROBING
1397 #error "EXTRA_PROBING must be less than MULTIPLE_PROBING."
1398 #endif
1399 #endif
1401 #if Z_PROBE_LOW_POINT > 0
1402 #error "Z_PROBE_LOW_POINT must be less than or equal to 0."
1403 #endif
1405 #if HOMING_Z_WITH_PROBE && IS_CARTESIAN && DISABLED(Z_SAFE_HOMING)
1406 #error "Z_SAFE_HOMING is recommended when homing with a probe. Enable it or comment out this line to continue."
1407 #endif
1409 #if ENABLED(PROBE_ACTIVATION_SWITCH)
1410 #ifndef PROBE_ACTIVATION_SWITCH_STATE
1411 #error "PROBE_ACTIVATION_SWITCH_STATE is required for PROBE_ACTIVATION_SWITCH."
1412 #elif !PIN_EXISTS(PROBE_ACTIVATION_SWITCH)
1413 #error "A PROBE_ACTIVATION_SWITCH_PIN is required for PROBE_ACTIVATION_SWITCH."
1414 #endif
1415 #endif
1417 #else
1420 * Require some kind of probe for bed leveling and probe testing
1422 #if HAS_ABL_NOT_UBL && !PROBE_SELECTED
1423 #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo."
1424 #endif
1426 #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
1427 #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe: FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
1428 #endif
1430 #endif
1433 * Allow only one bed leveling option to be defined
1435 #if MANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
1436 #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."
1437 #endif
1440 * Bed Leveling Requirements
1443 #if ENABLED(AUTO_BED_LEVELING_UBL)
1446 * Unified Bed Leveling
1449 #if IS_SCARA
1450 #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
1451 #elif DISABLED(EEPROM_SETTINGS)
1452 #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS."
1453 #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
1454 #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
1455 #endif
1457 #elif HAS_ABL_NOT_UBL
1460 * Auto Bed Leveling
1464 * Delta and SCARA have limited bed leveling options
1466 #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR)
1467 #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option."
1468 #endif
1470 #elif ENABLED(MESH_BED_LEVELING)
1472 // Mesh Bed Leveling
1473 #if ENABLED(DELTA)
1474 #error "MESH_BED_LEVELING is not compatible with DELTA printers."
1475 #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9
1476 #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
1477 #endif
1479 #endif
1481 #if ALL(HAS_LEVELING, RESTORE_LEVELING_AFTER_G28, ENABLE_LEVELING_AFTER_G28)
1482 #error "Only enable RESTORE_LEVELING_AFTER_G28 or ENABLE_LEVELING_AFTER_G28, but not both."
1483 #endif
1485 #if HAS_MESH && HAS_CLASSIC_JERK
1486 static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
1487 #endif
1489 #if ENABLED(G26_MESH_VALIDATION)
1490 #if !EXTRUDERS
1491 #error "G26_MESH_VALIDATION requires at least one extruder."
1492 #elif !HAS_MESH
1493 #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
1494 #endif
1495 #endif
1497 #if ENABLED(MESH_EDIT_GFX_OVERLAY) && !BOTH(AUTO_BED_LEVELING_UBL, HAS_MARLINUI_U8GLIB)
1498 #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD."
1499 #endif
1501 #if ENABLED(G29_RETRY_AND_RECOVER)
1502 #if ENABLED(AUTO_BED_LEVELING_UBL)
1503 #error "G29_RETRY_AND_RECOVER is not compatible with UBL."
1504 #elif ENABLED(MESH_BED_LEVELING)
1505 #error "G29_RETRY_AND_RECOVER is not compatible with MESH_BED_LEVELING."
1506 #endif
1507 #endif
1510 * LCD_BED_LEVELING requirements
1512 #if ENABLED(LCD_BED_LEVELING)
1513 #if !HAS_LCD_MENU
1514 #error "LCD_BED_LEVELING requires a programmable LCD controller."
1515 #elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL)
1516 #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
1517 #endif
1518 #endif
1520 #if BOTH(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
1521 #error "Disable PREHEAT_BEFORE_LEVELING when using PREHEAT_BEFORE_PROBING."
1522 #endif
1525 * Homing
1527 constexpr float hbm[] = HOMING_BUMP_MM;
1528 static_assert(COUNT(hbm) == XYZ, "HOMING_BUMP_MM requires X, Y, and Z elements.");
1529 static_assert(hbm[X_AXIS] >= 0, "HOMING_BUMP_MM.X must be greater than or equal to 0.");
1530 static_assert(hbm[Y_AXIS] >= 0, "HOMING_BUMP_MM.Y must be greater than or equal to 0.");
1531 static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal to 0.");
1533 #if ENABLED(CODEPENDENT_XY_HOMING)
1534 #if ENABLED(QUICK_HOME)
1535 #error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING."
1536 #elif IS_KINEMATIC
1537 #error "CODEPENDENT_XY_HOMING requires a Cartesian setup."
1538 #endif
1539 #endif
1542 * Make sure Z_SAFE_HOMING point is reachable
1544 #if ENABLED(Z_SAFE_HOMING)
1545 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.");
1546 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.");
1547 #endif
1550 * Make sure DISABLE_[XYZ] compatible with selected homing options
1552 #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z)
1553 #if EITHER(HOME_AFTER_DEACTIVATE, Z_SAFE_HOMING)
1554 #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
1555 #endif
1556 #endif
1559 * Filament Width Sensor
1561 #if ENABLED(FILAMENT_WIDTH_SENSOR)
1562 #if !HAS_FILAMENT_WIDTH_SENSOR
1563 #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
1564 #elif ENABLED(NO_VOLUMETRICS)
1565 #error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled."
1566 #endif
1567 #endif
1570 * System Power Sensor
1572 #if ENABLED(POWER_MONITOR_CURRENT) && !PIN_EXISTS(POWER_MONITOR_CURRENT)
1573 #error "POWER_MONITOR_CURRENT requires a valid POWER_MONITOR_CURRENT_PIN."
1574 #elif ENABLED(POWER_MONITOR_VOLTAGE) && !PIN_EXISTS(POWER_MONITOR_VOLTAGE)
1575 #error "POWER_MONITOR_VOLTAGE requires POWER_MONITOR_VOLTAGE_PIN to be defined."
1576 #elif BOTH(POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE) && POWER_MONITOR_CURRENT_PIN == POWER_MONITOR_VOLTAGE_PIN
1577 #error "POWER_MONITOR_CURRENT_PIN and POWER_MONITOR_VOLTAGE_PIN must be different."
1578 #endif
1581 * Volumetric Extruder Limit
1583 #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT)
1584 #if ENABLED(NO_VOLUMETRICS)
1585 #error "VOLUMETRIC_EXTRUDER_LIMIT requires NO_VOLUMETRICS to be disabled."
1586 #elif MIN_STEPS_PER_SEGMENT > 1
1587 #error "VOLUMETRIC_EXTRUDER_LIMIT is not compatible with MIN_STEPS_PER_SEGMENT greater than 1."
1588 #endif
1589 #endif
1592 * ULTIPANEL encoder
1594 #if IS_ULTIPANEL && NONE(IS_NEWPANEL, SR_LCD_2W_NL) && !PIN_EXISTS(SHIFT_CLK)
1595 #error "ULTIPANEL controllers require some kind of encoder."
1596 #endif
1598 #if ENCODER_PULSES_PER_STEP < 0
1599 #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead."
1600 #endif
1603 * SAV_3DGLCD display options
1605 #if ENABLED(SAV_3DGLCD)
1606 #if NONE(U8GLIB_SSD1306, U8GLIB_SH1106)
1607 #error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
1608 #elif BOTH(U8GLIB_SSD1306, U8GLIB_SH1106)
1609 #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
1610 #endif
1611 #endif
1614 * Allen Key
1615 * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
1617 #if BOTH(Z_PROBE_ALLEN_KEY, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && (Z_HOME_DIR < 0)
1618 #error "You can't home to a Z min endstop with a Z_PROBE_ALLEN_KEY."
1619 #endif
1622 * Dual X Carriage requirements
1624 #if ENABLED(DUAL_X_CARRIAGE)
1625 #if EXTRUDERS < 2
1626 #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
1627 #elif ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY)
1628 #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, COREZX, or MARKFORGED_XY."
1629 #elif !GOOD_AXIS_PINS(X2)
1630 #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
1631 #elif !HAS_X_MAX
1632 #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop."
1633 #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
1634 #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
1635 #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1
1636 #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1."
1637 #endif
1638 #endif
1640 #undef GOOD_AXIS_PINS
1643 * Make sure auto fan pins don't conflict with the fan pin
1645 #if HAS_AUTO_FAN
1646 #if HAS_FAN0
1647 #if E0_AUTO_FAN_PIN == FAN_PIN
1648 #error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
1649 #elif E1_AUTO_FAN_PIN == FAN_PIN
1650 #error "You cannot set E1_AUTO_FAN_PIN equal to FAN_PIN."
1651 #elif E2_AUTO_FAN_PIN == FAN_PIN
1652 #error "You cannot set E2_AUTO_FAN_PIN equal to FAN_PIN."
1653 #elif E3_AUTO_FAN_PIN == FAN_PIN
1654 #error "You cannot set E3_AUTO_FAN_PIN equal to FAN_PIN."
1655 #endif
1656 #endif
1657 #endif
1659 #if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN
1660 #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."
1661 #endif
1663 #if ENABLED(USE_CONTROLLER_FAN)
1664 #if !HAS_CONTROLLER_FAN
1665 #error "USE_CONTROLLER_FAN requires a CONTROLLER_FAN_PIN. Define in Configuration_adv.h."
1666 #elif E0_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
1667 #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
1668 #elif E1_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
1669 #error "You cannot set E1_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
1670 #elif E2_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
1671 #error "You cannot set E2_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
1672 #elif E3_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
1673 #error "You cannot set E3_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
1674 #endif
1675 #endif
1678 * Case Light requirements
1680 #if ENABLED(CASE_LIGHT_ENABLE)
1681 #if !PIN_EXISTS(CASE_LIGHT)
1682 #error "CASE_LIGHT_ENABLE requires CASE_LIGHT_PIN to be defined."
1683 #elif CASE_LIGHT_PIN == FAN_PIN
1684 #error "CASE_LIGHT_PIN conflicts with FAN_PIN. Resolve before continuing."
1685 #endif
1686 #endif
1689 * Required custom thermistor settings
1691 #if HEATER_0_USER_THERMISTOR && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA))
1692 #error "TEMP_SENSOR_0 1000 requires HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS and HOTEND0_BETA in Configuration_adv.h."
1693 #elif HEATER_1_USER_THERMISTOR && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA))
1694 #error "TEMP_SENSOR_1 1000 requires HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS and HOTEND1_BETA in Configuration_adv.h."
1695 #elif HEATER_2_USER_THERMISTOR && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA))
1696 #error "TEMP_SENSOR_2 1000 requires HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS and HOTEND2_BETA in Configuration_adv.h."
1697 #elif HEATER_3_USER_THERMISTOR && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA))
1698 #error "TEMP_SENSOR_3 1000 requires HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS and HOTEND3_BETA in Configuration_adv.h."
1699 #elif HEATER_4_USER_THERMISTOR && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA))
1700 #error "TEMP_SENSOR_4 1000 requires HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS and HOTEND4_BETA in Configuration_adv.h."
1701 #elif HEATER_5_USER_THERMISTOR && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA))
1702 #error "TEMP_SENSOR_5 1000 requires HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS and HOTEND5_BETA in Configuration_adv.h."
1703 #elif HEATER_6_USER_THERMISTOR && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA))
1704 #error "TEMP_SENSOR_6 1000 requires HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS and HOTEND6_BETA in Configuration_adv.h."
1705 #elif HEATER_7_USER_THERMISTOR && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA))
1706 #error "TEMP_SENSOR_7 1000 requires HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS and HOTEND7_BETA in Configuration_adv.h."
1707 #elif HEATER_BED_USER_THERMISTOR && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA))
1708 #error "TEMP_SENSOR_BED 1000 requires BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS and BED_BETA in Configuration_adv.h."
1709 #elif HEATER_CHAMBER_USER_THERMISTOR && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA))
1710 #error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h."
1711 #endif
1714 * Pins and Sensor IDs must be set for each heater
1716 #if HEATER_0_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS)
1717 #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board."
1718 #elif HAS_HOTEND && !HAS_TEMP_HOTEND && !HEATER_0_DUMMY_THERMISTOR
1719 #error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board."
1720 #elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1
1721 #error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin."
1722 #endif
1724 #if HAS_MULTI_HOTEND
1725 #if HEATER_1_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS2)
1726 #error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board."
1727 #elif TEMP_SENSOR_1 == 0
1728 #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
1729 #elif !ANY_PIN(TEMP_1, MAX6675_SS2) && !HEATER_1_DUMMY_THERMISTOR
1730 #error "TEMP_1_PIN not defined for this board."
1731 #elif ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
1732 #error "HOTENDS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT."
1733 #endif
1734 #if HOTENDS > 2
1735 #if TEMP_SENSOR_2 == 0
1736 #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
1737 #elif !HAS_HEATER_2
1738 #error "HEATER_2_PIN not defined for this board."
1739 #elif !PIN_EXISTS(TEMP_2) && !HEATER_2_DUMMY_THERMISTOR
1740 #error "TEMP_2_PIN not defined for this board."
1741 #endif
1742 #if HOTENDS > 3
1743 #if TEMP_SENSOR_3 == 0
1744 #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
1745 #elif !HAS_HEATER_3
1746 #error "HEATER_3_PIN not defined for this board."
1747 #elif !PIN_EXISTS(TEMP_3) && !HEATER_3_DUMMY_THERMISTOR
1748 #error "TEMP_3_PIN not defined for this board."
1749 #endif
1750 #if HOTENDS > 4
1751 #if TEMP_SENSOR_4 == 0
1752 #error "TEMP_SENSOR_4 is required with 5 or more HOTENDS."
1753 #elif !HAS_HEATER_4
1754 #error "HEATER_4_PIN not defined for this board."
1755 #elif !PIN_EXISTS(TEMP_4) && !HEATER_4_DUMMY_THERMISTOR
1756 #error "TEMP_4_PIN not defined for this board."
1757 #endif
1758 #if HOTENDS > 5
1759 #if TEMP_SENSOR_5 == 0
1760 #error "TEMP_SENSOR_5 is required with 6 HOTENDS."
1761 #elif !HAS_HEATER_5
1762 #error "HEATER_5_PIN not defined for this board."
1763 #elif !PIN_EXISTS(TEMP_5) && !HEATER_5_DUMMY_THERMISTOR
1764 #error "TEMP_5_PIN not defined for this board."
1765 #endif
1766 #if HOTENDS > 6
1767 #if TEMP_SENSOR_6 == 0
1768 #error "TEMP_SENSOR_6 is required with 6 HOTENDS."
1769 #elif !HAS_HEATER_6
1770 #error "HEATER_6_PIN not defined for this board."
1771 #elif !PIN_EXISTS(TEMP_6) && !HEATER_6_DUMMY_THERMISTOR
1772 #error "TEMP_6_PIN not defined for this board."
1773 #endif
1774 #if HOTENDS > 7
1775 #if TEMP_SENSOR_7 == 0
1776 #error "TEMP_SENSOR_7 is required with 7 HOTENDS."
1777 #elif !HAS_HEATER_7
1778 #error "HEATER_7_PIN not defined for this board."
1779 #elif !PIN_EXISTS(TEMP_7) && !HEATER_7_DUMMY_THERMISTOR
1780 #error "TEMP_7_PIN not defined for this board."
1781 #endif
1782 #elif TEMP_SENSOR_7 != 0
1783 #error "TEMP_SENSOR_7 shouldn't be set with only 7 HOTENDS."
1784 #endif
1785 #elif TEMP_SENSOR_6 != 0
1786 #error "TEMP_SENSOR_6 shouldn't be set with only 6 HOTENDS."
1787 #elif TEMP_SENSOR_7 != 0
1788 #error "TEMP_SENSOR_7 shouldn't be set with only 6 HOTENDS."
1789 #endif
1790 #elif TEMP_SENSOR_5 != 0
1791 #error "TEMP_SENSOR_5 shouldn't be set with only 5 HOTENDS."
1792 #elif TEMP_SENSOR_6 != 0
1793 #error "TEMP_SENSOR_6 shouldn't be set with only 5 HOTENDS."
1794 #elif TEMP_SENSOR_7 != 0
1795 #error "TEMP_SENSOR_7 shouldn't be set with only 5 HOTENDS."
1796 #endif
1797 #elif TEMP_SENSOR_4 != 0
1798 #error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS."
1799 #elif TEMP_SENSOR_5 != 0
1800 #error "TEMP_SENSOR_5 shouldn't be set with only 4 HOTENDS."
1801 #elif TEMP_SENSOR_6 != 0
1802 #error "TEMP_SENSOR_6 shouldn't be set with only 4 HOTENDS."
1803 #elif TEMP_SENSOR_7 != 0
1804 #error "TEMP_SENSOR_7 shouldn't be set with only 4 HOTENDS."
1805 #endif
1806 #elif TEMP_SENSOR_3 != 0
1807 #error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS."
1808 #elif TEMP_SENSOR_4 != 0
1809 #error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS."
1810 #elif TEMP_SENSOR_5 != 0
1811 #error "TEMP_SENSOR_5 shouldn't be set with only 3 HOTENDS."
1812 #elif TEMP_SENSOR_6 != 0
1813 #error "TEMP_SENSOR_6 shouldn't be set with only 3 HOTENDS."
1814 #elif TEMP_SENSOR_7 != 0
1815 #error "TEMP_SENSOR_7 shouldn't be set with only 3 HOTENDS."
1816 #endif
1817 #elif TEMP_SENSOR_2 != 0
1818 #error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS."
1819 #elif TEMP_SENSOR_3 != 0
1820 #error "TEMP_SENSOR_3 shouldn't be set with only 2 HOTENDS."
1821 #elif TEMP_SENSOR_4 != 0
1822 #error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS."
1823 #elif TEMP_SENSOR_5 != 0
1824 #error "TEMP_SENSOR_5 shouldn't be set with only 2 HOTENDS."
1825 #elif TEMP_SENSOR_6 != 0
1826 #error "TEMP_SENSOR_6 shouldn't be set with only 2 HOTENDS."
1827 #elif TEMP_SENSOR_7 != 0
1828 #error "TEMP_SENSOR_7 shouldn't be set with only 2 HOTENDS."
1829 #endif
1830 #elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT)
1831 #error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND."
1832 #elif TEMP_SENSOR_2 != 0
1833 #error "TEMP_SENSOR_2 shouldn't be set with only 1 HOTEND."
1834 #elif TEMP_SENSOR_3 != 0
1835 #error "TEMP_SENSOR_3 shouldn't be set with only 1 HOTEND."
1836 #elif TEMP_SENSOR_4 != 0
1837 #error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND."
1838 #elif TEMP_SENSOR_5 != 0
1839 #error "TEMP_SENSOR_5 shouldn't be set with only 1 HOTEND."
1840 #elif TEMP_SENSOR_6 != 0
1841 #error "TEMP_SENSOR_6 shouldn't be set with only 1 HOTEND."
1842 #elif TEMP_SENSOR_7 != 0
1843 #error "TEMP_SENSOR_7 shouldn't be set with only 1 HOTEND."
1844 #endif
1846 #if TEMP_SENSOR_CHAMBER && !PIN_EXISTS(TEMP_CHAMBER)
1847 #error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN."
1848 #endif
1850 #if ENABLED(CHAMBER_FAN) && !(defined(CHAMBER_FAN_MODE) && WITHIN(CHAMBER_FAN_MODE, 0, 2))
1851 #error "CHAMBER_FAN_MODE must be between 0 and 2."
1852 #endif
1854 #if ENABLED(CHAMBER_VENT)
1855 #ifndef CHAMBER_VENT_SERVO_NR
1856 #error "CHAMBER_VENT_SERVO_NR is required for CHAMBER SERVO."
1857 #elif !NUM_SERVOS
1858 #error "NUM_SERVOS is required for a Heated Chamber vent servo (CHAMBER_VENT_SERVO_NR)."
1859 #elif CHAMBER_VENT_SERVO_NR >= NUM_SERVOS
1860 #error "CHAMBER_VENT_SERVO_NR must be smaller than NUM_SERVOS."
1861 #elif HAS_Z_SERVO_PROBE && CHAMBER_VENT_SERVO_NR == Z_PROBE_SERVO_NR
1862 #error "CHAMBER SERVO is already used by BLTOUCH."
1863 #elif CHAMBER_VENT_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
1864 #error "SERVO0_PIN must be defined for your Heated Chamber vent servo."
1865 #elif CHAMBER_VENT_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
1866 #error "SERVO1_PIN must be defined for your Heated Chamber vent servo."
1867 #elif CHAMBER_VENT_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
1868 #error "SERVO2_PIN must be defined for your Heated Chamber vent servo."
1869 #elif CHAMBER_VENT_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
1870 #error "SERVO3_PIN must be defined for your Heated Chamber vent servo."
1871 #endif
1872 #endif
1874 #if TEMP_SENSOR_PROBE
1875 #if !PIN_EXISTS(TEMP_PROBE)
1876 #error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN."
1877 #elif !HAS_TEMP_ADC_PROBE
1878 #error "TEMP_PROBE_PIN must be an ADC pin."
1879 #elif DISABLED(FIX_MOUNTED_PROBE)
1880 #error "TEMP_SENSOR_PROBE shouldn't be set without FIX_MOUNTED_PROBE."
1881 #endif
1882 #endif
1884 #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0
1885 #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
1886 #endif
1888 #if MAX6675_0_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_0) && defined(MAX31865_CALIBRATION_OHMS_0))
1889 #error "MAX31865_SENSOR_OHMS_0 and MAX31865_CALIBRATION_OHMS_0 must be set if TEMP_SENSOR_0 is MAX31865."
1890 #elif MAX6675_1_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_1) && defined(MAX31865_CALIBRATION_OHMS_1))
1891 #error "MAX31865_SENSOR_OHMS_1 and MAX31865_CALIBRATION_OHMS_1 must be set if TEMP_SENSOR_1 is MAX31865."
1892 #endif
1895 * Test Heater, Temp Sensor, and Extruder Pins
1897 #if !HAS_HEATER_0 && EXTRUDERS
1898 #error "HEATER_0_PIN not defined for this board."
1899 #elif !ANY_PIN(TEMP_0, MAX6675_SS)
1900 #error "TEMP_0_PIN not defined for this board."
1901 #elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && !PINS_EXIST(E0_STEP, E0_DIR))
1902 #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
1903 #elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PINS_EXIST(E0_STEP, E0_DIR) || !HAS_E0_ENABLE))
1904 #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
1905 #elif EXTRUDERS && TEMP_SENSOR_0 == 0
1906 #error "TEMP_SENSOR_0 is required if there are any extruders."
1907 #endif
1910 * Temperature status LEDs
1912 #if ENABLED(TEMP_STAT_LEDS) && !ANY_PIN(STAT_LED_RED, STAT_LED_BLUE)
1913 #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both."
1914 #endif
1917 * LED Control Menu
1919 #if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS
1920 #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9533, PCA9632, or NEOPIXEL_LED."
1921 #endif
1924 * LED Backlight Timeout
1926 #if defined(LED_BACKLIGHT_TIMEOUT) && !(ENABLED(PSU_CONTROL) && ANY(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_242_OLED_12864))
1927 #error "LED_BACKLIGHT_TIMEOUT requires a FYSETC Mini Panel and a Power Switch."
1928 #endif
1931 * Basic multi hotend duplication mode
1933 #if ENABLED(MULTI_NOZZLE_DUPLICATION)
1934 #if HOTENDS < 2
1935 #error "MULTI_NOZZLE_DUPLICATION requires 2 or more hotends."
1936 #elif ENABLED(DUAL_X_CARRIAGE)
1937 #error "MULTI_NOZZLE_DUPLICATION is incompatible with DUAL_X_CARRIAGE."
1938 #elif ENABLED(SINGLENOZZLE)
1939 #error "MULTI_NOZZLE_DUPLICATION is incompatible with SINGLENOZZLE."
1940 #elif ENABLED(MIXING_EXTRUDER)
1941 #error "MULTI_NOZZLE_DUPLICATION is incompatible with MIXING_EXTRUDER."
1942 #elif ENABLED(SWITCHING_EXTRUDER)
1943 #error "MULTI_NOZZLE_DUPLICATION is incompatible with SWITCHING_EXTRUDER."
1944 #endif
1945 #endif
1948 * Test Extruder Stepper Pins
1950 #if E_STEPPERS
1951 #if !(PINS_EXIST(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
1952 #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
1953 #endif
1954 #if E_STEPPERS > 1
1955 #if !(PINS_EXIST(E1_STEP, E1_DIR) && HAS_E1_ENABLE)
1956 #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
1957 #endif
1958 #if E_STEPPERS > 2
1959 #if !(PINS_EXIST(E2_STEP, E2_DIR) && HAS_E2_ENABLE)
1960 #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
1961 #endif
1962 #if E_STEPPERS > 3
1963 #if !(PINS_EXIST(E3_STEP, E3_DIR) && HAS_E3_ENABLE)
1964 #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
1965 #endif
1966 #if E_STEPPERS > 4
1967 #if !(PINS_EXIST(E4_STEP, E4_DIR) && HAS_E4_ENABLE)
1968 #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
1969 #endif
1970 #if E_STEPPERS > 5
1971 #if !(PINS_EXIST(E5_STEP, E5_DIR) && HAS_E5_ENABLE)
1972 #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
1973 #endif
1974 #if E_STEPPERS > 6
1975 #if !(PINS_EXIST(E6_STEP, E6_DIR) && HAS_E6_ENABLE)
1976 #error "E6_STEP_PIN, E6_DIR_PIN, or E6_ENABLE_PIN not defined for this board."
1977 #endif
1978 #if E_STEPPERS > 7
1979 #if !(PINS_EXIST(E7_STEP, E7_DIR) && HAS_E7_ENABLE)
1980 #error "E7_STEP_PIN, E7_DIR_PIN, or E7_ENABLE_PIN not defined for this board."
1981 #endif
1982 #endif // E_STEPPERS > 7
1983 #endif // E_STEPPERS > 6
1984 #endif // E_STEPPERS > 5
1985 #endif // E_STEPPERS > 4
1986 #endif // E_STEPPERS > 3
1987 #endif // E_STEPPERS > 2
1988 #endif // E_STEPPERS > 1
1989 #endif // E_STEPPERS
1992 * Endstop Tests
1995 #define _PLUG_UNUSED_TEST(A,P) (DISABLED(USE_##P##MIN_PLUG, USE_##P##MAX_PLUG) \
1996 && !(ENABLED(A##_DUAL_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) \
1997 && !(ENABLED(A##_MULTI_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) )
1998 #define _AXIS_PLUG_UNUSED_TEST(A) (_PLUG_UNUSED_TEST(A,X) && _PLUG_UNUSED_TEST(A,Y) && _PLUG_UNUSED_TEST(A,Z))
2000 // At least 3 endstop plugs must be used
2001 #if _AXIS_PLUG_UNUSED_TEST(X)
2002 #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG."
2003 #endif
2004 #if _AXIS_PLUG_UNUSED_TEST(Y)
2005 #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG."
2006 #endif
2007 #if _AXIS_PLUG_UNUSED_TEST(Z)
2008 #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG."
2009 #endif
2011 // Delta and Cartesian use 3 homing endstops
2012 #if NONE(IS_SCARA, SPI_ENDSTOPS)
2013 #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG)
2014 #error "Enable USE_XMIN_PLUG when homing X to MIN."
2015 #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG)
2016 #error "Enable USE_XMAX_PLUG when homing X to MAX."
2017 #elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG)
2018 #error "Enable USE_YMIN_PLUG when homing Y to MIN."
2019 #elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG)
2020 #error "Enable USE_YMAX_PLUG when homing Y to MAX."
2021 #endif
2022 #endif
2024 // Z homing direction and plug usage flags
2025 #if Z_HOME_DIR < 0 && NONE(USE_ZMIN_PLUG, HOMING_Z_WITH_PROBE)
2026 #error "Enable USE_ZMIN_PLUG when homing Z to MIN."
2027 #elif Z_HOME_DIR > 0 && ENABLED(USE_PROBE_FOR_Z_HOMING)
2028 #error "Z_HOME_DIR must be -1 when homing Z with the probe."
2029 #elif BOTH(HOMING_Z_WITH_PROBE, Z_MULTI_ENDSTOPS)
2030 #error "Z_MULTI_ENDSTOPS is incompatible with USE_PROBE_FOR_Z_HOMING."
2031 #elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG)
2032 #error "Enable USE_ZMAX_PLUG when homing Z to MAX."
2033 #endif
2035 #if BOTH(HOME_Z_FIRST, USE_PROBE_FOR_Z_HOMING)
2036 #error "HOME_Z_FIRST can't be used when homing Z with a probe."
2037 #endif
2039 // Dual/multiple endstops requirements
2040 #if ENABLED(X_DUAL_ENDSTOPS)
2041 #if !X2_USE_ENDSTOP
2042 #error "You must set X2_USE_ENDSTOP with X_DUAL_ENDSTOPS."
2043 #elif X2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
2044 #error "USE_XMIN_PLUG is required when X2_USE_ENDSTOP is _XMIN_."
2045 #elif X2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
2046 #error "USE_XMAX_PLUG is required when X2_USE_ENDSTOP is _XMAX_."
2047 #elif X2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
2048 #error "USE_YMIN_PLUG is required when X2_USE_ENDSTOP is _YMIN_."
2049 #elif X2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
2050 #error "USE_YMAX_PLUG is required when X2_USE_ENDSTOP is _YMAX_."
2051 #elif X2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
2052 #error "USE_ZMIN_PLUG is required when X2_USE_ENDSTOP is _ZMIN_."
2053 #elif X2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
2054 #error "USE_ZMAX_PLUG is required when X2_USE_ENDSTOP is _ZMAX_."
2055 #elif !HAS_X2_MIN && !HAS_X2_MAX
2056 #error "X2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
2057 #elif ENABLED(DELTA)
2058 #error "X_DUAL_ENDSTOPS is not compatible with DELTA."
2059 #endif
2060 #endif
2061 #if ENABLED(Y_DUAL_ENDSTOPS)
2062 #if !Y2_USE_ENDSTOP
2063 #error "You must set Y2_USE_ENDSTOP with Y_DUAL_ENDSTOPS."
2064 #elif Y2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
2065 #error "USE_XMIN_PLUG is required when Y2_USE_ENDSTOP is _XMIN_."
2066 #elif Y2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
2067 #error "USE_XMAX_PLUG is required when Y2_USE_ENDSTOP is _XMAX_."
2068 #elif Y2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
2069 #error "USE_YMIN_PLUG is required when Y2_USE_ENDSTOP is _YMIN_."
2070 #elif Y2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
2071 #error "USE_YMAX_PLUG is required when Y2_USE_ENDSTOP is _YMAX_."
2072 #elif Y2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
2073 #error "USE_ZMIN_PLUG is required when Y2_USE_ENDSTOP is _ZMIN_."
2074 #elif Y2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
2075 #error "USE_ZMAX_PLUG is required when Y2_USE_ENDSTOP is _ZMAX_."
2076 #elif !HAS_Y2_MIN && !HAS_Y2_MAX
2077 #error "Y2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
2078 #elif ENABLED(DELTA)
2079 #error "Y_DUAL_ENDSTOPS is not compatible with DELTA."
2080 #endif
2081 #endif
2083 #if ENABLED(Z_MULTI_ENDSTOPS)
2084 #if !Z2_USE_ENDSTOP
2085 #error "You must set Z2_USE_ENDSTOP with Z_MULTI_ENDSTOPS when NUM_Z_STEPPER_DRIVERS >= 2."
2086 #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
2087 #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_."
2088 #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
2089 #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_."
2090 #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
2091 #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_."
2092 #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
2093 #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_."
2094 #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
2095 #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_."
2096 #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
2097 #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_."
2098 #elif !HAS_Z2_MIN && !HAS_Z2_MAX
2099 #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
2100 #elif ENABLED(DELTA)
2101 #error "Z_MULTI_ENDSTOPS is not compatible with DELTA."
2102 #endif
2103 #if NUM_Z_STEPPER_DRIVERS >= 3
2104 #if !Z3_USE_ENDSTOP
2105 #error "You must set Z3_USE_ENDSTOP with Z_MULTI_ENDSTOPS when NUM_Z_STEPPER_DRIVERS >= 3."
2106 #elif Z3_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
2107 #error "USE_XMIN_PLUG is required when Z3_USE_ENDSTOP is _XMIN_."
2108 #elif Z3_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
2109 #error "USE_XMAX_PLUG is required when Z3_USE_ENDSTOP is _XMAX_."
2110 #elif Z3_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
2111 #error "USE_YMIN_PLUG is required when Z3_USE_ENDSTOP is _YMIN_."
2112 #elif Z3_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
2113 #error "USE_YMAX_PLUG is required when Z3_USE_ENDSTOP is _YMAX_."
2114 #elif Z3_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
2115 #error "USE_ZMIN_PLUG is required when Z3_USE_ENDSTOP is _ZMIN_."
2116 #elif Z3_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
2117 #error "USE_ZMAX_PLUG is required when Z3_USE_ENDSTOP is _ZMAX_."
2118 #elif !HAS_Z3_MIN && !HAS_Z3_MAX
2119 #error "Z3_USE_ENDSTOP has been assigned to a nonexistent endstop!"
2120 #endif
2121 #endif
2122 #if NUM_Z_STEPPER_DRIVERS >= 4
2123 #if !Z4_USE_ENDSTOP
2124 #error "You must set Z4_USE_ENDSTOP with Z_MULTI_ENDSTOPS when NUM_Z_STEPPER_DRIVERS >= 4."
2125 #elif Z4_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
2126 #error "USE_XMIN_PLUG is required when Z4_USE_ENDSTOP is _XMIN_."
2127 #elif Z4_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
2128 #error "USE_XMAX_PLUG is required when Z4_USE_ENDSTOP is _XMAX_."
2129 #elif Z4_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
2130 #error "USE_YMIN_PLUG is required when Z4_USE_ENDSTOP is _YMIN_."
2131 #elif Z4_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
2132 #error "USE_YMAX_PLUG is required when Z4_USE_ENDSTOP is _YMAX_."
2133 #elif Z4_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
2134 #error "USE_ZMIN_PLUG is required when Z4_USE_ENDSTOP is _ZMIN_."
2135 #elif Z4_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
2136 #error "USE_ZMAX_PLUG is required when Z4_USE_ENDSTOP is _ZMAX_."
2137 #elif !HAS_Z4_MIN && !HAS_Z4_MAX
2138 #error "Z4_USE_ENDSTOP has been assigned to a nonexistent endstop!"
2139 #endif
2140 #endif
2141 #endif
2143 #if defined(ENDSTOP_NOISE_THRESHOLD) && !WITHIN(ENDSTOP_NOISE_THRESHOLD, 2, 7)
2144 #error "ENDSTOP_NOISE_THRESHOLD must be an integer from 2 to 7."
2145 #endif
2148 * emergency-command parser
2150 #if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON)
2151 #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
2152 #endif
2155 * I2C bus
2157 #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0
2158 #if I2C_SLAVE_ADDRESS < 8
2159 #error "I2C_SLAVE_ADDRESS can't be less than 8. (Addresses 0 - 7 are reserved.)"
2160 #elif I2C_SLAVE_ADDRESS > 127
2161 #error "I2C_SLAVE_ADDRESS can't be over 127. (Only 7 bits allowed.)"
2162 #endif
2163 #endif
2166 * G35 Assisted Tramming
2168 #if ENABLED(ASSISTED_TRAMMING) && !HAS_BED_PROBE
2169 #error "ASSISTED_TRAMMING requires a bed probe."
2170 #endif
2173 * G38 Probe Target
2175 #if ENABLED(G38_PROBE_TARGET)
2176 #if !HAS_BED_PROBE
2177 #error "G38_PROBE_TARGET requires a bed probe."
2178 #elif !IS_CARTESIAN
2179 #error "G38_PROBE_TARGET requires a Cartesian machine."
2180 #endif
2181 #endif
2184 * RGB_LED Requirements
2186 #define _RGB_TEST (PINS_EXIST(RGB_LED_R, RGB_LED_G, RGB_LED_B))
2187 #if ENABLED(PRINTER_EVENT_LEDS) && !HAS_COLOR_LEDS
2188 #error "PRINTER_EVENT_LEDS requires BLINKM, PCA9533, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED."
2189 #elif ENABLED(RGB_LED)
2190 #if !_RGB_TEST
2191 #error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN."
2192 #elif ENABLED(RGBW_LED)
2193 #error "Please enable only one of RGB_LED and RGBW_LED."
2194 #endif
2195 #elif ENABLED(RGBW_LED)
2196 #if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W))
2197 #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN."
2198 #endif
2199 #endif
2200 #undef _RGB_TEST
2202 // NeoPixel requirements
2203 #if ENABLED(NEOPIXEL_LED)
2204 #if !PIN_EXISTS(NEOPIXEL) || NEOPIXEL_PIXELS == 0
2205 #error "NEOPIXEL_LED requires NEOPIXEL_PIN and NEOPIXEL_PIXELS."
2206 #elif ENABLED(NEOPIXEL2_SEPARATE) && !(defined(NEOPIXEL2_TYPE) && PIN_EXISTS(NEOPIXEL2) && NEOPIXEL2_PIXELS > 0)
2207 #error "NEOPIXEL2_SEPARATE requires NEOPIXEL2_TYPE, NEOPIXEL2_PIN and NEOPIXEL2_PIXELS."
2208 #elif ENABLED(NEO2_COLOR_PRESETS) && DISABLED(NEOPIXEL2_SEPARATE)
2209 #error "NEO2_COLOR_PRESETS requires NEOPIXEL2_SEPARATE to be enabled."
2210 #endif
2211 #endif
2213 #if DISABLED(NO_COMPILE_TIME_PWM)
2214 #define _TEST_PWM(P) PWM_PIN(P)
2215 #else
2216 #define _TEST_PWM(P) 1 // pass
2217 #endif
2220 * Auto Fan check for PWM pins
2222 #if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255
2223 #define AF_ERR_SUFF "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255."
2224 #if HAS_AUTO_FAN_0
2225 static_assert(_TEST_PWM(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF);
2226 #elif HAS_AUTO_FAN_1
2227 static_assert(_TEST_PWM(E1_AUTO_FAN_PIN), "E1" AF_ERR_SUFF);
2228 #elif HAS_AUTO_FAN_2
2229 static_assert(_TEST_PWM(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF);
2230 #elif HAS_AUTO_FAN_3
2231 static_assert(_TEST_PWM(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF);
2232 #elif HAS_AUTO_FAN_4
2233 static_assert(_TEST_PWM(E4_AUTO_FAN_PIN), "E4" AF_ERR_SUFF);
2234 #elif HAS_AUTO_FAN_5
2235 static_assert(_TEST_PWM(E5_AUTO_FAN_PIN), "E5" AF_ERR_SUFF);
2236 #elif HAS_AUTO_FAN_6
2237 static_assert(_TEST_PWM(E6_AUTO_FAN_PIN), "E6" AF_ERR_SUFF);
2238 #elif HAS_AUTO_FAN_7
2239 static_assert(_TEST_PWM(E7_AUTO_FAN_PIN), "E7" AF_ERR_SUFF);
2240 #endif
2241 #endif
2244 * Make sure only one EEPROM type is enabled
2246 #if ENABLED(EEPROM_SETTINGS)
2247 #if 1 < 0 \
2248 + ENABLED(I2C_EEPROM) \
2249 + ENABLED(SPI_EEPROM) \
2250 + ENABLED(QSPI_EEPROM) \
2251 + ENABLED(SDCARD_EEPROM_EMULATION) \
2252 + ENABLED(FLASH_EEPROM_EMULATION) \
2253 + ENABLED(SRAM_EEPROM_EMULATION) \
2254 + ENABLED(IIC_BL24CXX_EEPROM)
2255 #error "Please select only one method of EEPROM Persistent Storage."
2256 #endif
2257 #endif
2260 * Make sure features that need to write to the SD card can
2262 #if ENABLED(SDCARD_READONLY) && ANY(POWER_LOSS_RECOVERY, BINARY_FILE_TRANSFER, SDCARD_EEPROM_EMULATION)
2263 #undef SDCARD_READONLY
2264 #if ENABLED(POWER_LOSS_RECOVERY)
2265 #warning "Either disable SDCARD_READONLY or disable POWER_LOSS_RECOVERY."
2266 #elif ENABLED(BINARY_FILE_TRANSFER)
2267 #warning "Either disable SDCARD_READONLY or disable BINARY_FILE_TRANSFER."
2268 #elif ENABLED(SDCARD_EEPROM_EMULATION)
2269 #warning "Either disable SDCARD_READONLY or disable SDCARD_EEPROM_EMULATION."
2270 #endif
2271 #endif
2273 #if ENABLED(SD_IGNORE_AT_STARTUP)
2274 #if ENABLED(POWER_LOSS_RECOVERY)
2275 #error "SD_IGNORE_AT_STARTUP is incompatible with POWER_LOSS_RECOVERY."
2276 #elif ENABLED(SDCARD_EEPROM_EMULATION)
2277 #error "SD_IGNORE_AT_STARTUP is incompatible with SDCARD_EEPROM_EMULATION."
2278 #endif
2279 #endif
2282 * Make sure only one display is enabled
2284 #if 1 < 0 \
2285 + ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
2286 + ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
2287 + ENABLED(ULTIPANEL) \
2288 + ENABLED(ULTRA_LCD) \
2289 + (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \
2290 + (ENABLED(MINIPANEL) && NONE(MKS_MINI_12864, ENDER2_STOCKDISPLAY)) \
2291 + (ENABLED(MKS_MINI_12864) && DISABLED(MKS_LCD12864)) \
2292 + (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \
2293 + (DISABLED(IS_LEGACY_TFT) && ENABLED(TFT_GENERIC)) \
2294 + (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)) \
2295 + COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35) \
2296 + COUNT_ENABLED(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY) \
2297 + COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY, DWIN_CREALITY_LCD) \
2298 + COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) \
2299 + COUNT_ENABLED(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) \
2300 + COUNT_ENABLED(MKS_12864OLED, MKS_12864OLED_SSD1306) \
2301 + COUNT_ENABLED(MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, ANET_ET4_TFT28, ANET_ET5_TFT35) \
2302 + COUNT_ENABLED(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) \
2303 + COUNT_ENABLED(VIKI2, miniVIKI) \
2304 + COUNT_ENABLED(ZONESTAR_12864LCD, ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306) \
2305 + COUNT_ENABLED(ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING) \
2306 + ENABLED(AZSMZ_12864) \
2307 + ENABLED(BQ_LCD_SMART_CONTROLLER) \
2308 + ENABLED(CARTESIO_UI) \
2309 + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
2310 + ENABLED(FF_INTERFACEBOARD) \
2311 + ENABLED(FYSETC_242_OLED_12864) \
2312 + ENABLED(G3D_PANEL) \
2313 + ENABLED(LCD_FOR_MELZI) \
2314 + ENABLED(LCD_I2C_PANELOLU2) \
2315 + ENABLED(LCD_I2C_VIKI) \
2316 + ENABLED(LCM1602) \
2317 + ENABLED(LONGER_LK_TFT28) \
2318 + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
2319 + ENABLED(MAKRPANEL) \
2320 + ENABLED(MALYAN_LCD) \
2321 + ENABLED(MKS_LCD12864) \
2322 + ENABLED(OLED_PANEL_TINYBOY2) \
2323 + ENABLED(OVERLORD_OLED) \
2324 + ENABLED(PANEL_ONE) \
2325 + ENABLED(RA_CONTROL_PANEL) \
2326 + ENABLED(RADDS_DISPLAY) \
2327 + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \
2328 + ENABLED(RIGIDBOT_PANEL) \
2329 + ENABLED(SAV_3DGLCD) \
2330 + ENABLED(SAV_3DLCD) \
2331 + ENABLED(SILVER_GATE_GLCD_CONTROLLER) \
2332 + ENABLED(TFT_TRONXY_X5SA) \
2333 + ENABLED(TOUCH_UI_FTDI_EVE) \
2334 + ENABLED(U8GLIB_SH1106_EINSTART) \
2335 + ENABLED(ULTI_CONTROLLER) \
2336 + ENABLED(ULTIMAKERCONTROLLER) \
2337 + ENABLED(ZONESTAR_LCD)
2338 #error "Please select only one LCD controller option."
2339 #endif
2341 #undef IS_U8GLIB_SSD1306
2342 #undef IS_EXTUI
2343 #undef IS_LEGACY_TFT
2345 #if ANY(TFT_GENERIC, MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, TFT_TRONXY_X5SA, ANYCUBIC_TFT35, ANYCUBIC_TFT35, LONGER_LK_TFT28, ANET_ET4_TFT28, ANET_ET5_TFT35)
2346 #if NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
2347 #error "TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI is required for your TFT. Please enable one."
2348 #elif 1 < ENABLED(TFT_COLOR_UI) + ENABLED(TFT_CLASSIC_UI) + ENABLED(TFT_LVGL_UI)
2349 #error "Please select only one of TFT_COLOR_UI, TFT_CLASSIC_UI, or TFT_LVGL_UI."
2350 #endif
2351 #elif ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
2352 #error "TFT_(COLOR|CLASSIC|LVGL)_UI requires a TFT display to be enabled."
2353 #endif
2355 #if ENABLED(TFT_GENERIC) && NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
2356 #error "TFT_GENERIC requires either TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI interface."
2357 #endif
2359 #if BOTH(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
2360 #error "Please enable only one of TFT_INTERFACE_SPI or TFT_INTERFACE_SPI."
2361 #endif
2363 #if MANY(LCD_SCREEN_ROT_0, LCD_SCREEN_ROT_90, LCD_SCREEN_ROT_180, LCD_SCREEN_ROT_270)
2364 #error "Please enable only one LCD_SCREEN_ROT_* option: 0, 90, 180, or 270."
2365 #endif
2367 #if MANY(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320)
2368 #error "Please select only one of TFT_RES_480x320, TFT_RES_480x320, or TFT_RES_480x272."
2369 #endif
2371 #if HAS_TFT_LVGL_UI && DISABLED(TFT_RES_480x320)
2372 #error "(FMSC|SPI)TFT_LVGL_UI requires TFT_RES_480x320."
2373 #endif
2375 #if defined(GRAPHICAL_TFT_UPSCALE) && !WITHIN(GRAPHICAL_TFT_UPSCALE, 2, 3)
2376 #error "GRAPHICAL_TFT_UPSCALE must be set to 2 or 3."
2377 #endif
2380 * Some boards forbid the use of -1 Native USB
2382 #if ENABLED(BOARD_NO_NATIVE_USB)
2383 #undef BOARD_NO_NATIVE_USB
2384 #if SERIAL_PORT == -1
2385 #error "SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT to a valid value for your board."
2386 #elif SERIAL_PORT_2 == -1
2387 #error "SERIAL_PORT_2 is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT_2 to a valid value for your board."
2388 #elif MMU2_SERIAL_PORT == -1
2389 #error "MMU2_SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set MMU2_SERIAL_PORT to a valid value for your board."
2390 #elif LCD_SERIAL_PORT == -1
2391 #error "LCD_SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set LCD_SERIAL_PORT to a valid value for your board."
2392 #endif
2393 #endif
2396 * MMU2 require a dedicated serial port
2398 #ifdef MMU2_SERIAL_PORT
2399 #if MMU2_SERIAL_PORT == SERIAL_PORT
2400 #error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT."
2401 #elif defined(SERIAL_PORT_2) && MMU2_SERIAL_PORT == SERIAL_PORT_2
2402 #error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT_2."
2403 #elif defined(LCD_SERIAL_PORT) && MMU2_SERIAL_PORT == LCD_SERIAL_PORT
2404 #error "MMU2_SERIAL_PORT cannot be the same as LCD_SERIAL_PORT."
2405 #endif
2406 #endif
2409 * Serial displays require a dedicated serial port
2411 #ifdef LCD_SERIAL_PORT
2412 #if LCD_SERIAL_PORT == SERIAL_PORT
2413 #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT."
2414 #elif defined(SERIAL_PORT_2) && LCD_SERIAL_PORT == SERIAL_PORT_2
2415 #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT_2."
2416 #endif
2417 #else
2418 #if HAS_DGUS_LCD
2419 #error "The DGUS LCD requires LCD_SERIAL_PORT to be defined."
2420 #elif EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
2421 #error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined."
2422 #elif ENABLED(MALYAN_LCD)
2423 #error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined."
2424 #endif
2425 #endif
2428 * FYSETC Mini 12864 RGB backlighting required
2430 #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED)
2431 #error "RGB_LED is required for FYSETC_MINI_12864 1.2 and 2.0."
2432 #elif EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && DISABLED(LED_USER_PRESET_STARTUP)
2433 #error "LED_USER_PRESET_STARTUP is required for FYSETC_MINI_12864 2.x displays."
2434 #endif
2437 * Check existing CS pins against enabled TMC SPI drivers.
2439 #define INVALID_TMC_SPI(ST) (AXIS_HAS_SPI(ST) && !PIN_EXISTS(ST##_CS))
2440 #if INVALID_TMC_SPI(X)
2441 #error "An SPI driven TMC driver on X requires X_CS_PIN."
2442 #elif INVALID_TMC_SPI(X2)
2443 #error "An SPI driven TMC driver on X2 requires X2_CS_PIN."
2444 #elif INVALID_TMC_SPI(Y)
2445 #error "An SPI driven TMC driver on Y requires Y_CS_PIN."
2446 #elif INVALID_TMC_SPI(Y2)
2447 #error "An SPI driven TMC driver on Y2 requires Y2_CS_PIN."
2448 #elif INVALID_TMC_SPI(Z)
2449 #error "An SPI driven TMC driver on Z requires Z_CS_PIN."
2450 #elif INVALID_TMC_SPI(Z2)
2451 #error "An SPI driven TMC driver on Z2 requires Z2_CS_PIN."
2452 #elif INVALID_TMC_SPI(Z3)
2453 #error "An SPI driven TMC driver on Z3 requires Z3_CS_PIN."
2454 #elif INVALID_TMC_SPI(Z4)
2455 #error "An SPI driven TMC driver on Z4 requires Z4_CS_PIN."
2456 #elif INVALID_TMC_SPI(E0)
2457 #error "An SPI driven TMC driver on E0 requires E0_CS_PIN."
2458 #elif INVALID_TMC_SPI(E1)
2459 #error "An SPI driven TMC driver on E1 requires E1_CS_PIN."
2460 #elif INVALID_TMC_SPI(E2)
2461 #error "An SPI driven TMC driver on E2 requires E2_CS_PIN."
2462 #elif INVALID_TMC_SPI(E3)
2463 #error "An SPI driven TMC driver on E3 requires E3_CS_PIN."
2464 #elif INVALID_TMC_SPI(E4)
2465 #error "An SPI driven TMC driver on E4 requires E4_CS_PIN."
2466 #elif INVALID_TMC_SPI(E5)
2467 #error "An SPI driven TMC driver on E5 requires E5_CS_PIN."
2468 #elif INVALID_TMC_SPI(E6)
2469 #error "An SPI driven TMC driver on E6 requires E6_CS_PIN."
2470 #elif INVALID_TMC_SPI(E7)
2471 #error "An SPI driven TMC driver on E7 requires E7_CS_PIN."
2472 #endif
2473 #undef INVALID_TMC_SPI
2476 * Check existing RX/TX pins against enable TMC UART drivers.
2478 #define INVALID_TMC_UART(ST) (AXIS_HAS_UART(ST) && !(defined(ST##_HARDWARE_SERIAL) || (PINS_EXIST(ST##_SERIAL_RX, ST##_SERIAL_TX))))
2479 #if INVALID_TMC_UART(X)
2480 #error "TMC2208 or TMC2209 on X requires X_HARDWARE_SERIAL or X_SERIAL_(RX|TX)_PIN."
2481 #elif INVALID_TMC_UART(X2)
2482 #error "TMC2208 or TMC2209 on X2 requires X2_HARDWARE_SERIAL or X2_SERIAL_(RX|TX)_PIN."
2483 #elif INVALID_TMC_UART(Y)
2484 #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL_(RX|TX)_PIN."
2485 #elif INVALID_TMC_UART(Y2)
2486 #error "TMC2208 or TMC2209 on Y2 requires Y2_HARDWARE_SERIAL or Y2_SERIAL_(RX|TX)_PIN."
2487 #elif INVALID_TMC_UART(Z)
2488 #error "TMC2208 or TMC2209 on Z requires Z_HARDWARE_SERIAL or Z_SERIAL_(RX|TX)_PIN."
2489 #elif INVALID_TMC_UART(Z2)
2490 #error "TMC2208 or TMC2209 on Z2 requires Z2_HARDWARE_SERIAL or Z2_SERIAL_(RX|TX)_PIN."
2491 #elif INVALID_TMC_UART(Z3)
2492 #error "TMC2208 or TMC2209 on Z3 requires Z3_HARDWARE_SERIAL or Z3_SERIAL_(RX|TX)_PIN."
2493 #elif INVALID_TMC_UART(Z4)
2494 #error "TMC2208 or TMC2209 on Z4 requires Z4_HARDWARE_SERIAL or Z4_SERIAL_(RX|TX)_PIN."
2495 #elif INVALID_TMC_UART(E0)
2496 #error "TMC2208 or TMC2209 on E0 requires E0_HARDWARE_SERIAL or E0_SERIAL_(RX|TX)_PIN."
2497 #elif INVALID_TMC_UART(E1)
2498 #error "TMC2208 or TMC2209 on E1 requires E1_HARDWARE_SERIAL or E1_SERIAL_(RX|TX)_PIN."
2499 #elif INVALID_TMC_UART(E2)
2500 #error "TMC2208 or TMC2209 on E2 requires E2_HARDWARE_SERIAL or E2_SERIAL_(RX|TX)_PIN."
2501 #elif INVALID_TMC_UART(E3)
2502 #error "TMC2208 or TMC2209 on E3 requires E3_HARDWARE_SERIAL or E3_SERIAL_(RX|TX)_PIN."
2503 #elif INVALID_TMC_UART(E4)
2504 #error "TMC2208 or TMC2209 on E4 requires E4_HARDWARE_SERIAL or E4_SERIAL_(RX|TX)_PIN."
2505 #elif INVALID_TMC_UART(E5)
2506 #error "TMC2208 or TMC2209 on E5 requires E5_HARDWARE_SERIAL or E5_SERIAL_(RX|TX)_PIN."
2507 #elif INVALID_TMC_UART(E6)
2508 #error "TMC2208 or TMC2209 on E6 requires E6_HARDWARE_SERIAL or E6_SERIAL_(RX|TX)_PIN."
2509 #elif INVALID_TMC_UART(E7)
2510 #error "TMC2208 or TMC2209 on E7 requires E7_HARDWARE_SERIAL or E7_SERIAL_(RX|TX)_PIN."
2511 #endif
2512 #undef INVALID_TMC_UART
2515 * TMC2209 slave address values
2517 #define INVALID_TMC_ADDRESS(ST) static_assert(0 <= ST##_SLAVE_ADDRESS && ST##_SLAVE_ADDRESS <= 3, "TMC2209 slave address must be 0, 1, 2 or 3")
2518 #if AXIS_DRIVER_TYPE_X(TMC2209)
2519 INVALID_TMC_ADDRESS(X);
2520 #elif AXIS_DRIVER_TYPE_X2(TMC2209)
2521 INVALID_TMC_ADDRESS(X2);
2522 #elif AXIS_DRIVER_TYPE_Y(TMC2209)
2523 INVALID_TMC_ADDRESS(Y);
2524 #elif AXIS_DRIVER_TYPE_Y2(TMC2209)
2525 INVALID_TMC_ADDRESS(Y2);
2526 #elif AXIS_DRIVER_TYPE_Z(TMC2209)
2527 INVALID_TMC_ADDRESS(Z);
2528 #elif AXIS_DRIVER_TYPE_Z2(TMC2209)
2529 INVALID_TMC_ADDRESS(Z2);
2530 #elif AXIS_DRIVER_TYPE_Z3(TMC2209)
2531 INVALID_TMC_ADDRESS(Z3);
2532 #elif AXIS_DRIVER_TYPE_Z4(TMC2209)
2533 INVALID_TMC_ADDRESS(Z4);
2534 #elif AXIS_DRIVER_TYPE_E0(TMC2209)
2535 INVALID_TMC_ADDRESS(E0);
2536 #elif AXIS_DRIVER_TYPE_E1(TMC2209)
2537 INVALID_TMC_ADDRESS(E1);
2538 #elif AXIS_DRIVER_TYPE_E2(TMC2209)
2539 INVALID_TMC_ADDRESS(E2);
2540 #elif AXIS_DRIVER_TYPE_E3(TMC2209)
2541 INVALID_TMC_ADDRESS(E3);
2542 #elif AXIS_DRIVER_TYPE_E4(TMC2209)
2543 INVALID_TMC_ADDRESS(E4);
2544 #elif AXIS_DRIVER_TYPE_E5(TMC2209)
2545 INVALID_TMC_ADDRESS(E5);
2546 #elif AXIS_DRIVER_TYPE_E6(TMC2209)
2547 INVALID_TMC_ADDRESS(E6);
2548 #elif AXIS_DRIVER_TYPE_E7(TMC2209)
2549 INVALID_TMC_ADDRESS(E7);
2550 #endif
2551 #undef INVALID_TMC_ADDRESS
2553 #define _TMC_MICROSTEP_IS_VALID(MS) (MS == 0 || MS == 2 || MS == 4 || MS == 8 || MS == 16 || MS == 32 || MS == 64 || MS == 128 || MS == 256)
2554 #define TMC_MICROSTEP_IS_VALID(M) (!AXIS_IS_TMC(M) || _TMC_MICROSTEP_IS_VALID(M##_MICROSTEPS))
2555 #define INVALID_TMC_MS(ST) static_assert(0, "Invalid " STRINGIFY(ST) "_MICROSTEPS. Valid values are 0, 2, 4, 8, 16, 32, 64, 128, and 256.")
2557 #if !TMC_MICROSTEP_IS_VALID(X)
2558 INVALID_TMC_MS(X);
2559 #elif !TMC_MICROSTEP_IS_VALID(Y)
2560 INVALID_TMC_MS(Y)
2561 #elif !TMC_MICROSTEP_IS_VALID(Z)
2562 INVALID_TMC_MS(Z)
2563 #elif !TMC_MICROSTEP_IS_VALID(X2)
2564 INVALID_TMC_MS(X2);
2565 #elif !TMC_MICROSTEP_IS_VALID(Y2)
2566 INVALID_TMC_MS(Y2)
2567 #elif !TMC_MICROSTEP_IS_VALID(Z2)
2568 INVALID_TMC_MS(Z2)
2569 #elif !TMC_MICROSTEP_IS_VALID(Z3)
2570 INVALID_TMC_MS(Z3)
2571 #elif !TMC_MICROSTEP_IS_VALID(Z4)
2572 INVALID_TMC_MS(Z4)
2573 #elif !TMC_MICROSTEP_IS_VALID(E0)
2574 INVALID_TMC_MS(E0)
2575 #elif !TMC_MICROSTEP_IS_VALID(E1)
2576 INVALID_TMC_MS(E1)
2577 #elif !TMC_MICROSTEP_IS_VALID(E2)
2578 INVALID_TMC_MS(E2)
2579 #elif !TMC_MICROSTEP_IS_VALID(E3)
2580 INVALID_TMC_MS(E3)
2581 #elif !TMC_MICROSTEP_IS_VALID(E4)
2582 INVALID_TMC_MS(E4)
2583 #elif !TMC_MICROSTEP_IS_VALID(E5)
2584 INVALID_TMC_MS(E5)
2585 #elif !TMC_MICROSTEP_IS_VALID(E6)
2586 INVALID_TMC_MS(E6)
2587 #elif !TMC_MICROSTEP_IS_VALID(E7)
2588 INVALID_TMC_MS(E7)
2589 #endif
2590 #undef INVALID_TMC_MS
2591 #undef TMC_MICROSTEP_IS_VALID
2592 #undef _TMC_MICROSTEP_IS_VALID
2594 #if ENABLED(DELTA) && (ENABLED(STEALTHCHOP_XY) != ENABLED(STEALTHCHOP_Z))
2595 #error "STEALTHCHOP_XY and STEALTHCHOP_Z must be the same on DELTA."
2596 #endif
2598 #if ENABLED(SENSORLESS_HOMING)
2599 // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop
2600 // is necessary in order to reset the stallGuard indication between the initial movement of all three
2601 // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of
2602 // clearing the stallGuard activated status is found.
2604 // Stall detection DIAG = HIGH : TMC2209
2605 // Stall detection DIAG = LOW : TMC2130/TMC2160/TMC2660/TMC5130/TMC5160
2606 #define X_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(X,TMC2209)
2607 #define Y_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Y,TMC2209)
2608 #define Z_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Z,TMC2209)
2610 #if NONE(SPI_ENDSTOPS, ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS)
2611 #if X_SENSORLESS && X_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_XMIN)
2612 #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMIN (or ENDSTOPPULLUPS) when homing to X_MIN."
2613 #elif X_SENSORLESS && X_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_XMAX)
2614 #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMAX (or ENDSTOPPULLUPS) when homing to X_MAX."
2615 #elif Y_SENSORLESS && Y_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_YMIN)
2616 #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMIN (or ENDSTOPPULLUPS) when homing to Y_MIN."
2617 #elif Y_SENSORLESS && Y_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_YMAX)
2618 #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMAX (or ENDSTOPPULLUPS) when homing to Y_MAX."
2619 #elif Z_SENSORLESS && Z_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_ZMIN)
2620 #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN."
2621 #elif Z_SENSORLESS && Z_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_ZMAX)
2622 #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX."
2623 #endif
2624 #endif
2626 #if ENABLED(SPI_ENDSTOPS)
2627 #if ENABLED(QUICK_HOME)
2628 #warning "SPI_ENDSTOPS may be unreliable with QUICK_HOME. Adjust back-offs for better results."
2629 #endif
2630 #else
2631 #if X_SENSORLESS && X_HOME_DIR < 0 && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
2632 #if X_ENDSTOP_INVERTING
2633 #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = true when homing to X_MIN."
2634 #else
2635 #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to X_MIN."
2636 #endif
2637 #elif X_SENSORLESS && X_HOME_DIR > 0 && X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
2638 #if X_ENDSTOP_INVERTING
2639 #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = true when homing to X_MAX."
2640 #else
2641 #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to X_MAX."
2642 #endif
2643 #elif Y_SENSORLESS && Y_HOME_DIR < 0 && Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
2644 #if Y_ENDSTOP_INVERTING
2645 #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = true when homing to Y_MIN."
2646 #else
2647 #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MIN."
2648 #endif
2649 #elif Y_SENSORLESS && Y_HOME_DIR > 0 && Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
2650 #if Y_ENDSTOP_INVERTING
2651 #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = true when homing to Y_MAX."
2652 #else
2653 #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MAX."
2654 #endif
2655 #elif Z_SENSORLESS && Z_HOME_DIR < 0 && Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
2656 #if Z_ENDSTOP_INVERTING
2657 #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = true when homing to Z_MIN."
2658 #else
2659 #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MIN."
2660 #endif
2661 #elif Z_SENSORLESS && Z_HOME_DIR > 0 && Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
2662 #if Z_ENDSTOP_INVERTING
2663 #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = true when homing to Z_MAX."
2664 #else
2665 #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MAX."
2666 #endif
2667 #endif
2668 #endif
2670 #if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z)
2671 #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z."
2672 #elif ENDSTOP_NOISE_THRESHOLD
2673 #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD."
2674 #elif !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS)
2675 #error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, or Z axes."
2676 #endif
2678 #undef X_ENDSTOP_INVERTING
2679 #undef Y_ENDSTOP_INVERTING
2680 #undef Z_ENDSTOP_INVERTING
2681 #endif
2683 // Sensorless probing requirements
2684 #if ENABLED(SENSORLESS_PROBING)
2685 #if ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS)
2686 #error "SENSORLESS_PROBING for DELTA requires TMC stepper drivers with StallGuard on X, Y, and Z axes."
2687 #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
2688 #error "SENSORLESS_PROBING cannot be used with Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN."
2689 #elif ENABLED(USE_PROBE_FOR_Z_HOMING)
2690 #error "SENSORLESS_PROBING cannot be used with USE_PROBE_FOR_Z_HOMING."
2691 #elif !Z_SENSORLESS
2692 #error "SENSORLESS_PROBING requires a TMC stepper driver with StallGuard on Z."
2693 #endif
2694 #endif
2696 // Sensorless homing is required for both combined steppers in an H-bot
2697 #if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS
2698 #error "CoreXY requires both X and Y to use sensorless homing if either one does."
2699 #elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS && !HOMING_Z_WITH_PROBE
2700 #error "CoreXZ requires both X and Z to use sensorless homing if either one does."
2701 #elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS && !HOMING_Z_WITH_PROBE
2702 #error "CoreYZ requires both Y and Z to use sensorless homing if either one does."
2703 #elif ENABLED(MARKFORGED_XY) && X_SENSORLESS != Y_SENSORLESS
2704 #error "MARKFORGED_XY requires both X and Y to use sensorless homing if either one does."
2705 #endif
2707 // Other TMC feature requirements
2708 #if ENABLED(HYBRID_THRESHOLD) && !STEALTHCHOP_ENABLED
2709 #error "Enable STEALTHCHOP_(XY|Z|E) to use HYBRID_THRESHOLD."
2710 #elif ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD
2711 #error "SENSORLESS_HOMING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
2712 #elif ENABLED(SENSORLESS_PROBING) && !HAS_STALLGUARD
2713 #error "SENSORLESS_PROBING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
2714 #elif STEALTHCHOP_ENABLED && !HAS_STEALTHCHOP
2715 #error "STEALTHCHOP requires TMC2130, TMC2160, TMC2208, TMC2209, or TMC5160 stepper drivers."
2716 #endif
2719 * TMC SPI Chaining
2721 #define IN_CHAIN(A) ((A##_CHAIN_POS > 0) && !HAS_L64XX)
2722 #if IN_CHAIN(X ) || IN_CHAIN(Y ) || IN_CHAIN(Z ) || IN_CHAIN(X2) || IN_CHAIN(Y2) || IN_CHAIN(Z2) || IN_CHAIN(Z3) || IN_CHAIN(Z4) \
2723 || IN_CHAIN(E0) || IN_CHAIN(E1) || IN_CHAIN(E2) || IN_CHAIN(E3) || IN_CHAIN(E4) || IN_CHAIN(E5) || IN_CHAIN(E6) || IN_CHAIN(E7)
2724 #define BAD_CHAIN(A) (IN_CHAIN(A) && !PIN_EXISTS(A##_CS))
2725 #if BAD_CHAIN(X ) || BAD_CHAIN(Y ) || BAD_CHAIN(Z ) || BAD_CHAIN(X2) || BAD_CHAIN(Y2) || BAD_CHAIN(Z2) || BAD_CHAIN(Z3) || BAD_CHAIN(Z4) \
2726 || BAD_CHAIN(E0) || BAD_CHAIN(E1) || BAD_CHAIN(E2) || BAD_CHAIN(E3) || BAD_CHAIN(E4) || BAD_CHAIN(E5) || BAD_CHAIN(E6) || BAD_CHAIN(E7)
2727 #error "All chained TMC drivers need a CS pin."
2728 #else
2729 #if IN_CHAIN(X)
2730 #define CS_COMPARE X_CS_PIN
2731 #elif IN_CHAIN(Y)
2732 #define CS_COMPARE Y_CS_PIN
2733 #elif IN_CHAIN(Z)
2734 #define CS_COMPARE Z_CS_PIN
2735 #elif IN_CHAIN(X2)
2736 #define CS_COMPARE X2_CS_PIN
2737 #elif IN_CHAIN(Y2)
2738 #define CS_COMPARE Y2_CS_PIN
2739 #elif IN_CHAIN(Z2)
2740 #define CS_COMPARE Z2_CS_PIN
2741 #elif IN_CHAIN(Z3)
2742 #define CS_COMPARE Z3_CS_PIN
2743 #elif IN_CHAIN(E0)
2744 #define CS_COMPARE E0_CS_PIN
2745 #elif IN_CHAIN(E1)
2746 #define CS_COMPARE E1_CS_PIN
2747 #elif IN_CHAIN(E2)
2748 #define CS_COMPARE E2_CS_PIN
2749 #elif IN_CHAIN(E3)
2750 #define CS_COMPARE E3_CS_PIN
2751 #elif IN_CHAIN(E4)
2752 #define CS_COMPARE E4_CS_PIN
2753 #elif IN_CHAIN(E5)
2754 #define CS_COMPARE E5_CS_PIN
2755 #elif IN_CHAIN(E6)
2756 #define CS_COMPARE E6_CS_PIN
2757 #elif IN_CHAIN(E7)
2758 #define CS_COMPARE E7_CS_PIN
2759 #endif
2760 #define BAD_CS_PIN(A) (IN_CHAIN(A) && A##_CS_PIN != CS_COMPARE)
2761 #if BAD_CS_PIN(X ) || BAD_CS_PIN(Y ) || BAD_CS_PIN(Z ) || BAD_CS_PIN(X2) || BAD_CS_PIN(Y2) || BAD_CS_PIN(Z2) || BAD_CS_PIN(Z3) || BAD_CS_PIN(Z4) \
2762 || BAD_CS_PIN(E0) || BAD_CS_PIN(E1) || BAD_CS_PIN(E2) || BAD_CS_PIN(E3) || BAD_CS_PIN(E4) || BAD_CS_PIN(E5) || BAD_CS_PIN(E6) || BAD_CS_PIN(E7)
2763 #error "All chained TMC drivers must use the same CS pin."
2764 #endif
2765 #undef BAD_CS_PIN
2766 #undef CS_COMPARE
2767 #endif
2768 #undef BAD_CHAIN
2769 #endif
2770 #undef IN_CHAIN
2773 * Digipot requirement
2775 #if HAS_MOTOR_CURRENT_I2C
2776 #if BOTH(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
2777 #error "Enable only one of DIGIPOT_MCP4018 or DIGIPOT_MCP4451."
2778 #elif !MB(MKS_SBASE) \
2779 && (!defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1))
2780 #error "DIGIPOT_MCP4018/4451 requires DIGIPOTS_I2C_SDA_* pins to be defined."
2781 #endif
2782 #endif
2785 * Check per-axis initializers for errors
2787 constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT,
2788 sanity_arr_2[] = DEFAULT_MAX_FEEDRATE,
2789 sanity_arr_3[] = DEFAULT_MAX_ACCELERATION;
2791 #define _ARR_TEST(N,I) (sanity_arr_##N[_MIN(I,int(COUNT(sanity_arr_##N))-1)] > 0)
2793 static_assert(COUNT(sanity_arr_1) >= XYZE, "DEFAULT_AXIS_STEPS_PER_UNIT requires X, Y, Z and E elements.");
2794 static_assert(COUNT(sanity_arr_1) <= XYZE_N, "DEFAULT_AXIS_STEPS_PER_UNIT has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)");
2795 static_assert( _ARR_TEST(1,0) && _ARR_TEST(1,1) && _ARR_TEST(1,2)
2796 && _ARR_TEST(1,3) && _ARR_TEST(1,4) && _ARR_TEST(1,5)
2797 && _ARR_TEST(1,6) && _ARR_TEST(1,7) && _ARR_TEST(1,8),
2798 "DEFAULT_AXIS_STEPS_PER_UNIT values must be positive.");
2800 static_assert(COUNT(sanity_arr_2) >= XYZE, "DEFAULT_MAX_FEEDRATE requires X, Y, Z and E elements.");
2801 static_assert(COUNT(sanity_arr_2) <= XYZE_N, "DEFAULT_MAX_FEEDRATE has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)");
2802 static_assert( _ARR_TEST(2,0) && _ARR_TEST(2,1) && _ARR_TEST(2,2)
2803 && _ARR_TEST(2,3) && _ARR_TEST(2,4) && _ARR_TEST(2,5)
2804 && _ARR_TEST(2,6) && _ARR_TEST(2,7) && _ARR_TEST(2,8),
2805 "DEFAULT_MAX_FEEDRATE values must be positive.");
2807 static_assert(COUNT(sanity_arr_3) >= XYZE, "DEFAULT_MAX_ACCELERATION requires X, Y, Z and E elements.");
2808 static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)");
2809 static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
2810 && _ARR_TEST(3,3) && _ARR_TEST(3,4) && _ARR_TEST(3,5)
2811 && _ARR_TEST(3,6) && _ARR_TEST(3,7) && _ARR_TEST(3,8),
2812 "DEFAULT_MAX_ACCELERATION values must be positive.");
2814 #if ENABLED(LIMITED_MAX_ACCEL_EDITING)
2815 #ifdef MAX_ACCEL_EDIT_VALUES
2816 constexpr float sanity_arr_4[] = MAX_ACCEL_EDIT_VALUES;
2817 static_assert(COUNT(sanity_arr_4) >= XYZE, "MAX_ACCEL_EDIT_VALUES requires X, Y, Z and E elements.");
2818 static_assert(COUNT(sanity_arr_4) <= XYZE, "MAX_ACCEL_EDIT_VALUES has too many elements. X, Y, Z and E elements only.");
2819 static_assert( _ARR_TEST(4,0) && _ARR_TEST(4,1) && _ARR_TEST(4,2)
2820 && _ARR_TEST(4,3) && _ARR_TEST(4,4) && _ARR_TEST(4,5)
2821 && _ARR_TEST(4,6) && _ARR_TEST(4,7) && _ARR_TEST(4,8),
2822 "MAX_ACCEL_EDIT_VALUES values must be positive.");
2823 #endif
2824 #endif
2826 #if ENABLED(LIMITED_MAX_FR_EDITING)
2827 #ifdef MAX_FEEDRATE_EDIT_VALUES
2828 constexpr float sanity_arr_5[] = MAX_FEEDRATE_EDIT_VALUES;
2829 static_assert(COUNT(sanity_arr_5) >= XYZE, "MAX_FEEDRATE_EDIT_VALUES requires X, Y, Z and E elements.");
2830 static_assert(COUNT(sanity_arr_5) <= XYZE, "MAX_FEEDRATE_EDIT_VALUES has too many elements. X, Y, Z and E elements only.");
2831 static_assert( _ARR_TEST(5,0) && _ARR_TEST(5,1) && _ARR_TEST(5,2)
2832 && _ARR_TEST(5,3) && _ARR_TEST(5,4) && _ARR_TEST(5,5)
2833 && _ARR_TEST(5,6) && _ARR_TEST(5,7) && _ARR_TEST(5,8),
2834 "MAX_FEEDRATE_EDIT_VALUES values must be positive.");
2835 #endif
2836 #endif
2838 #if ENABLED(LIMITED_JERK_EDITING)
2839 #ifdef MAX_JERK_EDIT_VALUES
2840 constexpr float sanity_arr_6[] = MAX_JERK_EDIT_VALUES;
2841 static_assert(COUNT(sanity_arr_6) >= XYZE, "MAX_JERK_EDIT_VALUES requires X, Y, Z and E elements.");
2842 static_assert(COUNT(sanity_arr_6) <= XYZE, "MAX_JERK_EDIT_VALUES has too many elements. X, Y, Z and E elements only.");
2843 static_assert( _ARR_TEST(6,0) && _ARR_TEST(6,1) && _ARR_TEST(6,2)
2844 && _ARR_TEST(6,3) && _ARR_TEST(6,4) && _ARR_TEST(6,5)
2845 && _ARR_TEST(6,6) && _ARR_TEST(6,7) && _ARR_TEST(6,8),
2846 "MAX_JERK_EDIT_VALUES values must be positive.");
2847 #endif
2848 #endif
2850 #undef _ARR_TEST
2852 #if BOTH(CNC_COORDINATE_SYSTEMS, NO_WORKSPACE_OFFSETS)
2853 #error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS."
2854 #endif
2856 #if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE)
2857 #error "BLOCK_BUFFER_SIZE must be a power of 2."
2858 #elif BLOCK_BUFFER_SIZE > 64
2859 #error "A very large BLOCK_BUFFER_SIZE is not needed and takes longer to drain the buffer on pause / cancel."
2860 #endif
2862 #if ENABLED(LED_CONTROL_MENU) && !IS_ULTIPANEL
2863 #error "LED_CONTROL_MENU requires an LCD controller."
2864 #endif
2866 #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED)
2867 #error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED."
2868 #endif
2870 #if ENABLED(SKEW_CORRECTION)
2871 #if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD))
2872 #error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD."
2873 #endif
2874 #if ENABLED(SKEW_CORRECTION_FOR_Z)
2875 #if !defined(XZ_SKEW_FACTOR) && !(defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD))
2876 #error "SKEW_CORRECTION requires XZ_SKEW_FACTOR or XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD."
2877 #endif
2878 #if !defined(YZ_SKEW_FACTOR) && !(defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD))
2879 #error "SKEW_CORRECTION requires YZ_SKEW_FACTOR or YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD."
2880 #endif
2881 #endif
2882 #endif
2884 #if ENABLED(BACKUP_POWER_SUPPLY) && !PIN_EXISTS(POWER_LOSS)
2885 #error "BACKUP_POWER_SUPPLY requires a POWER_LOSS_PIN."
2886 #endif
2888 #if BOTH(POWER_LOSS_PULLUP, POWER_LOSS_PULLDOWN)
2889 #error "You can't enable POWER_LOSS_PULLUP and POWER_LOSS_PULLDOWN at the same time."
2890 #endif
2892 #if ENABLED(Z_STEPPER_AUTO_ALIGN)
2893 #if NUM_Z_STEPPER_DRIVERS <= 1
2894 #error "Z_STEPPER_AUTO_ALIGN requires NUM_Z_STEPPER_DRIVERS greater than 1."
2895 #elif !HAS_BED_PROBE
2896 #error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe."
2897 #elif ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
2898 static_assert(WITHIN(Z_STEPPER_ALIGN_AMP, 0.5, 2.0), "Z_STEPPER_ALIGN_AMP must be between 0.5 and 2.0.");
2899 #if NUM_Z_STEPPER_DRIVERS < 3
2900 #error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS requires NUM_Z_STEPPER_DRIVERS to be 3 or 4."
2901 #endif
2902 #endif
2903 #endif
2905 #if ENABLED(MECHANICAL_GANTRY_CALIBRATION)
2906 #if NONE(HAS_MOTOR_CURRENT_DAC, HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC, HAS_TRINAMIC_CONFIG, HAS_MOTOR_CURRENT_PWM)
2907 #error "It is highly recommended to have adjustable current drivers to prevent damage. Disable this line to continue anyway."
2908 #elif !defined(GANTRY_CALIBRATION_CURRENT)
2909 #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_CURRENT to be set."
2910 #elif !defined(GANTRY_CALIBRATION_EXTRA_HEIGHT)
2911 #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_EXTRA_HEIGHT to be set."
2912 #elif !defined(GANTRY_CALIBRATION_FEEDRATE)
2913 #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_FEEDRATE to be set."
2914 #endif
2915 #if defined(GANTRY_CALIBRATION_SAFE_POSITION) && !defined(GANTRY_CALIBRATION_XY_PARK_FEEDRATE)
2916 #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
2917 #endif
2918 #endif
2920 #if BOTH(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION)
2921 #error "You cannot use Z_STEPPER_AUTO_ALIGN and MECHANICAL_GANTRY_CALIBRATION at the same time."
2922 #endif
2924 #if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS)
2925 #error "PRINTCOUNTER requires EEPROM_SETTINGS."
2926 #endif
2928 #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PINS_EXIST(USB_CS, USB_INTR) && DISABLED(USE_OTG_USB_HOST)
2929 #error "USB_CS_PIN and USB_INTR_PIN are required for USB_FLASH_DRIVE_SUPPORT."
2930 #endif
2932 #if ENABLED(USE_OTG_USB_HOST) && !defined(HAS_OTG_USB_HOST_SUPPORT)
2933 #error "The current board does not support USE_OTG_USB_HOST."
2934 #endif
2936 #if ENABLED(SD_FIRMWARE_UPDATE) && !defined(__AVR_ATmega2560__)
2937 #error "SD_FIRMWARE_UPDATE requires an ATmega2560-based (Arduino Mega) board."
2938 #endif
2940 #if ENABLED(GCODE_MACROS) && !WITHIN(GCODE_MACROS_SLOTS, 1, 10)
2941 #error "GCODE_MACROS_SLOTS must be a number from 1 to 10."
2942 #endif
2944 #if ENABLED(CUSTOM_USER_MENUS)
2945 #ifdef USER_GCODE_1
2946 constexpr char _chr1 = USER_GCODE_1[strlen(USER_GCODE_1) - 1];
2947 static_assert(_chr1 != '\n' && _chr1 != '\r', "USER_GCODE_1 cannot have a newline at the end. Please remove it.");
2948 #endif
2949 #ifdef USER_GCODE_2
2950 constexpr char _chr2 = USER_GCODE_2[strlen(USER_GCODE_2) - 1];
2951 static_assert(_chr2 != '\n' && _chr2 != '\r', "USER_GCODE_2 cannot have a newline at the end. Please remove it.");
2952 #endif
2953 #ifdef USER_GCODE_3
2954 constexpr char _chr3 = USER_GCODE_3[strlen(USER_GCODE_3) - 1];
2955 static_assert(_chr3 != '\n' && _chr3 != '\r', "USER_GCODE_3 cannot have a newline at the end. Please remove it.");
2956 #endif
2957 #ifdef USER_GCODE_4
2958 constexpr char _chr4 = USER_GCODE_4[strlen(USER_GCODE_4) - 1];
2959 static_assert(_chr4 != '\n' && _chr4 != '\r', "USER_GCODE_4 cannot have a newline at the end. Please remove it.");
2960 #endif
2961 #ifdef USER_GCODE_5
2962 constexpr char _chr5 = USER_GCODE_5[strlen(USER_GCODE_5) - 1];
2963 static_assert(_chr5 != '\n' && _chr5 != '\r', "USER_GCODE_5 cannot have a newline at the end. Please remove it.");
2964 #endif
2965 #ifdef USER_GCODE_6
2966 constexpr char _chr6 = USER_GCODE_6[strlen(USER_GCODE_6) - 1];
2967 static_assert(_chr6 != '\n' && _chr6 != '\r', "USER_GCODE_6 cannot have a newline at the end. Please remove it.");
2968 #endif
2969 #ifdef USER_GCODE_7
2970 constexpr char _chr7 = USER_GCODE_7[strlen(USER_GCODE_7) - 1];
2971 static_assert(_chr7 != '\n' && _chr7 != '\r', "USER_GCODE_7 cannot have a newline at the end. Please remove it.");
2972 #endif
2973 #ifdef USER_GCODE_8
2974 constexpr char _chr8 = USER_GCODE_8[strlen(USER_GCODE_8) - 1];
2975 static_assert(_chr8 != '\n' && _chr8 != '\r', "USER_GCODE_8 cannot have a newline at the end. Please remove it.");
2976 #endif
2977 #ifdef USER_GCODE_9
2978 constexpr char _chr9 = USER_GCODE_9[strlen(USER_GCODE_9) - 1];
2979 static_assert(_chr9 != '\n' && _chr9 != '\r', "USER_GCODE_9 cannot have a newline at the end. Please remove it.");
2980 #endif
2981 #ifdef USER_GCODE_10
2982 constexpr char _chr10 = USER_GCODE_10[strlen(USER_GCODE_10) - 1];
2983 static_assert(_chr10 != '\n' && _chr10 != '\r', "USER_GCODE_10 cannot have a newline at the end. Please remove it.");
2984 #endif
2985 #ifdef USER_GCODE_11
2986 constexpr char _chr11 = USER_GCODE_11[strlen(USER_GCODE_11) - 1];
2987 static_assert(_chr11 != '\n' && _chr11 != '\r', "USER_GCODE_11 cannot have a newline at the end. Please remove it.");
2988 #endif
2989 #ifdef USER_GCODE_12
2990 constexpr char _chr12 = USER_GCODE_12[strlen(USER_GCODE_12) - 1];
2991 static_assert(_chr12 != '\n' && _chr12 != '\r', "USER_GCODE_12 cannot have a newline at the end. Please remove it.");
2992 #endif
2993 #ifdef USER_GCODE_13
2994 constexpr char _chr13 = USER_GCODE_13[strlen(USER_GCODE_13) - 1];
2995 static_assert(_chr13 != '\n' && _chr13 != '\r', "USER_GCODE_13 cannot have a newline at the end. Please remove it.");
2996 #endif
2997 #ifdef USER_GCODE_14
2998 constexpr char _chr14 = USER_GCODE_14[strlen(USER_GCODE_14) - 1];
2999 static_assert(_chr14 != '\n' && _chr14 != '\r', "USER_GCODE_14 cannot have a newline at the end. Please remove it.");
3000 #endif
3001 #ifdef USER_GCODE_15
3002 constexpr char _chr15 = USER_GCODE_15[strlen(USER_GCODE_15) - 1];
3003 static_assert(_chr15 != '\n' && _chr15 != '\r', "USER_GCODE_15 cannot have a newline at the end. Please remove it.");
3004 #endif
3005 #ifdef USER_GCODE_16
3006 constexpr char _chr16 = USER_GCODE_16[strlen(USER_GCODE_16) - 1];
3007 static_assert(_chr16 != '\n' && _chr16 != '\r', "USER_GCODE_16 cannot have a newline at the end. Please remove it.");
3008 #endif
3009 #ifdef USER_GCODE_17
3010 constexpr char _chr17 = USER_GCODE_17[strlen(USER_GCODE_17) - 1];
3011 static_assert(_chr17 != '\n' && _chr17 != '\r', "USER_GCODE_17 cannot have a newline at the end. Please remove it.");
3012 #endif
3013 #ifdef USER_GCODE_18
3014 constexpr char _chr18 = USER_GCODE_18[strlen(USER_GCODE_18) - 1];
3015 static_assert(_chr18 != '\n' && _chr18 != '\r', "USER_GCODE_18 cannot have a newline at the end. Please remove it.");
3016 #endif
3017 #ifdef USER_GCODE_19
3018 constexpr char _chr19 = USER_GCODE_19[strlen(USER_GCODE_19) - 1];
3019 static_assert(_chr19 != '\n' && _chr19 != '\r', "USER_GCODE_19 cannot have a newline at the end. Please remove it.");
3020 #endif
3021 #ifdef USER_GCODE_20
3022 constexpr char _chr20 = USER_GCODE_20[strlen(USER_GCODE_20) - 1];
3023 static_assert(_chr20 != '\n' && _chr20 != '\r', "USER_GCODE_20 cannot have a newline at the end. Please remove it.");
3024 #endif
3025 #ifdef USER_GCODE_21
3026 constexpr char _chr21 = USER_GCODE_21[strlen(USER_GCODE_21) - 1];
3027 static_assert(_chr21 != '\n' && _chr21 != '\r', "USER_GCODE_21 cannot have a newline at the end. Please remove it.");
3028 #endif
3029 #ifdef USER_GCODE_22
3030 constexpr char _chr22 = USER_GCODE_22[strlen(USER_GCODE_22) - 1];
3031 static_assert(_chr22 != '\n' && _chr22 != '\r', "USER_GCODE_22 cannot have a newline at the end. Please remove it.");
3032 #endif
3033 #ifdef USER_GCODE_23
3034 constexpr char _chr23 = USER_GCODE_23[strlen(USER_GCODE_23) - 1];
3035 static_assert(_chr23 != '\n' && _chr23 != '\r', "USER_GCODE_23 cannot have a newline at the end. Please remove it.");
3036 #endif
3037 #ifdef USER_GCODE_24
3038 constexpr char _chr24 = USER_GCODE_24[strlen(USER_GCODE_24) - 1];
3039 static_assert(_chr24 != '\n' && _chr24 != '\r', "USER_GCODE_24 cannot have a newline at the end. Please remove it.");
3040 #endif
3041 #ifdef USER_GCODE_25
3042 constexpr char _chr25 = USER_GCODE_25[strlen(USER_GCODE_25) - 1];
3043 static_assert(_chr25 != '\n' && _chr25 != '\r', "USER_GCODE_25 cannot have a newline at the end. Please remove it.");
3044 #endif
3045 #endif
3047 #if ENABLED(BACKLASH_COMPENSATION)
3048 #ifndef BACKLASH_DISTANCE_MM
3049 #error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM."
3050 #elif !defined(BACKLASH_CORRECTION)
3051 #error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION."
3052 #elif ENABLED(MARKFORGED_XY)
3053 constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
3054 static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
3055 "BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " on a MarkForged system.");
3056 #elif IS_CORE
3057 constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
3058 static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
3059 "BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " with your CORE system.");
3060 #endif
3061 #endif
3063 #if ENABLED(GRADIENT_MIX) && MIXING_VIRTUAL_TOOLS < 2
3064 #error "GRADIENT_MIX requires 2 or more MIXING_VIRTUAL_TOOLS."
3065 #endif
3068 * Photo G-code requirements
3070 #if ENABLED(PHOTO_GCODE)
3071 #if (PIN_EXISTS(CHDK) + PIN_EXISTS(PHOTOGRAPH) + defined(PHOTO_SWITCH_POSITION)) > 1
3072 #error "Please define only one of CHDK_PIN, PHOTOGRAPH_PIN, or PHOTO_SWITCH_POSITION."
3073 #elif defined(PHOTO_SWITCH_POSITION) && !defined(PHOTO_POSITION)
3074 #error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION."
3075 #elif PIN_EXISTS(CHDK) && defined(CHDK_DELAY)
3076 #error "CHDK_DELAY has been replaced by PHOTO_SWITCH_MS."
3077 #elif PIN_EXISTS(CHDK) && !defined(PHOTO_SWITCH_MS)
3078 #error "PHOTO_SWITCH_MS is required with CHDK_PIN."
3079 #elif defined(PHOTO_RETRACT_MM)
3080 static_assert(PHOTO_RETRACT_MM + 0 >= 0, "PHOTO_RETRACT_MM must be >= 0.");
3081 #endif
3082 #endif
3085 * Advanced PRINTCOUNTER settings
3087 #if ENABLED(PRINTCOUNTER)
3088 #if defined(SERVICE_INTERVAL_1) != defined(SERVICE_NAME_1)
3089 #error "Both SERVICE_NAME_1 and SERVICE_INTERVAL_1 are required."
3090 #elif defined(SERVICE_INTERVAL_2) != defined(SERVICE_NAME_2)
3091 #error "Both SERVICE_NAME_2 and SERVICE_INTERVAL_2 are required."
3092 #elif defined(SERVICE_INTERVAL_3) != defined(SERVICE_NAME_3)
3093 #error "Both SERVICE_NAME_3 and SERVICE_INTERVAL_3 are required."
3094 #endif
3095 #endif
3098 * Require soft endstops for certain setups
3100 #if !BOTH(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
3101 #if ENABLED(DUAL_X_CARRIAGE)
3102 #error "DUAL_X_CARRIAGE requires both MIN_ and MAX_SOFTWARE_ENDSTOPS."
3103 #elif HAS_HOTEND_OFFSET
3104 #error "MIN_ and MAX_SOFTWARE_ENDSTOPS are both required with offset hotends."
3105 #endif
3106 #endif
3109 * Ensure this option is set intentionally
3111 #if ENABLED(PSU_CONTROL)
3112 #ifndef PSU_ACTIVE_STATE
3113 #error "PSU_CONTROL requires PSU_ACTIVE_STATE to be defined as 'HIGH' or 'LOW'."
3114 #elif !PIN_EXISTS(PS_ON)
3115 #error "PSU_CONTROL requires PS_ON_PIN."
3116 #elif POWER_OFF_DELAY < 0
3117 #error "POWER_OFF_DELAY must be a positive value."
3118 #endif
3119 #endif
3121 #if HAS_CUTTER
3122 #ifndef CUTTER_POWER_UNIT
3123 #error "CUTTER_POWER_UNIT is required with a spindle or laser."
3124 #elif !CUTTER_UNIT_IS(PWM255) && !CUTTER_UNIT_IS(PERCENT) && !CUTTER_UNIT_IS(RPM) && !CUTTER_UNIT_IS(SERVO)
3125 #error "CUTTER_POWER_UNIT must be PWM255, PERCENT, RPM, or SERVO."
3126 #endif
3128 #if ENABLED(LASER_POWER_INLINE)
3129 #if ENABLED(SPINDLE_CHANGE_DIR)
3130 #error "SPINDLE_CHANGE_DIR and LASER_POWER_INLINE are incompatible."
3131 #elif ENABLED(LASER_MOVE_G0_OFF) && DISABLED(LASER_MOVE_POWER)
3132 #error "LASER_MOVE_G0_OFF requires LASER_MOVE_POWER."
3133 #endif
3134 #if ENABLED(LASER_POWER_INLINE_TRAPEZOID)
3135 #if DISABLED(SPINDLE_LASER_PWM)
3136 #error "LASER_POWER_INLINE_TRAPEZOID requires SPINDLE_LASER_PWM to function."
3137 #elif ENABLED(S_CURVE_ACCELERATION)
3138 //#ifndef LASER_POWER_INLINE_S_CURVE_ACCELERATION_WARN
3139 // #define LASER_POWER_INLINE_S_CURVE_ACCELERATION_WARN
3140 // #warning "Combining LASER_POWER_INLINE_TRAPEZOID with S_CURVE_ACCELERATION may result in unintended behavior."
3141 //#endif
3142 #endif
3143 #endif
3144 #if ENABLED(LASER_POWER_INLINE_INVERT)
3145 //#ifndef LASER_POWER_INLINE_INVERT_WARN
3146 // #define LASER_POWER_INLINE_INVERT_WARN
3147 // #warning "Enabling LASER_POWER_INLINE_INVERT means that `M5` won't kill the laser immediately; use `M5 I` instead."
3148 //#endif
3149 #endif
3150 #else
3151 #if SPINDLE_LASER_POWERUP_DELAY < 1
3152 #error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0."
3153 #elif SPINDLE_LASER_POWERDOWN_DELAY < 1
3154 #error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0."
3155 #elif ENABLED(LASER_MOVE_POWER)
3156 #error "LASER_MOVE_POWER requires LASER_POWER_INLINE."
3157 #elif ANY(LASER_POWER_INLINE_TRAPEZOID, LASER_POWER_INLINE_INVERT, LASER_MOVE_G0_OFF, LASER_MOVE_POWER)
3158 #error "Enabled an inline laser feature without inline laser power being enabled."
3159 #endif
3160 #endif
3161 #define _PIN_CONFLICT(P) (PIN_EXISTS(P) && P##_PIN == SPINDLE_LASER_PWM_PIN)
3162 #if BOTH(SPINDLE_FEATURE, LASER_FEATURE)
3163 #error "Enable only one of SPINDLE_FEATURE or LASER_FEATURE."
3164 #elif !PIN_EXISTS(SPINDLE_LASER_ENA) && DISABLED(SPINDLE_SERVO)
3165 #error "(SPINDLE|LASER)_FEATURE requires SPINDLE_LASER_ENA_PIN or SPINDLE_SERVO to control the power."
3166 #elif ENABLED(SPINDLE_CHANGE_DIR) && !PIN_EXISTS(SPINDLE_DIR)
3167 #error "SPINDLE_DIR_PIN is required for SPINDLE_CHANGE_DIR."
3168 #elif ENABLED(SPINDLE_LASER_PWM)
3169 #if !defined(SPINDLE_LASER_PWM_PIN) || SPINDLE_LASER_PWM_PIN < 0
3170 #error "SPINDLE_LASER_PWM_PIN is required for SPINDLE_LASER_PWM."
3171 #elif !_TEST_PWM(SPINDLE_LASER_PWM_PIN)
3172 #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."
3173 #elif !defined(SPINDLE_LASER_PWM_INVERT)
3174 #error "SPINDLE_LASER_PWM_INVERT is required for (SPINDLE|LASER)_FEATURE."
3175 #elif !(defined(SPEED_POWER_INTERCEPT) && defined(SPEED_POWER_MIN) && defined(SPEED_POWER_MAX) && defined(SPEED_POWER_STARTUP))
3176 #error "SPINDLE_LASER_PWM equation constant(s) missing."
3177 #elif _PIN_CONFLICT(X_MIN)
3178 #error "SPINDLE_LASER_PWM pin conflicts with X_MIN_PIN."
3179 #elif _PIN_CONFLICT(X_MAX)
3180 #error "SPINDLE_LASER_PWM pin conflicts with X_MAX_PIN."
3181 #elif _PIN_CONFLICT(Z_STEP)
3182 #error "SPINDLE_LASER_PWM pin conflicts with Z_STEP_PIN."
3183 #elif _PIN_CONFLICT(CASE_LIGHT)
3184 #error "SPINDLE_LASER_PWM_PIN conflicts with CASE_LIGHT_PIN."
3185 #elif _PIN_CONFLICT(E0_AUTO_FAN)
3186 #error "SPINDLE_LASER_PWM_PIN conflicts with E0_AUTO_FAN_PIN."
3187 #elif _PIN_CONFLICT(E1_AUTO_FAN)
3188 #error "SPINDLE_LASER_PWM_PIN conflicts with E1_AUTO_FAN_PIN."
3189 #elif _PIN_CONFLICT(E2_AUTO_FAN)
3190 #error "SPINDLE_LASER_PWM_PIN conflicts with E2_AUTO_FAN_PIN."
3191 #elif _PIN_CONFLICT(E3_AUTO_FAN)
3192 #error "SPINDLE_LASER_PWM_PIN conflicts with E3_AUTO_FAN_PIN."
3193 #elif _PIN_CONFLICT(E4_AUTO_FAN)
3194 #error "SPINDLE_LASER_PWM_PIN conflicts with E4_AUTO_FAN_PIN."
3195 #elif _PIN_CONFLICT(E5_AUTO_FAN)
3196 #error "SPINDLE_LASER_PWM_PIN conflicts with E5_AUTO_FAN_PIN."
3197 #elif _PIN_CONFLICT(E6_AUTO_FAN)
3198 #error "SPINDLE_LASER_PWM_PIN conflicts with E6_AUTO_FAN_PIN."
3199 #elif _PIN_CONFLICT(E7_AUTO_FAN)
3200 #error "SPINDLE_LASER_PWM_PIN conflicts with E7_AUTO_FAN_PIN."
3201 #elif _PIN_CONFLICT(FAN)
3202 #error "SPINDLE_LASER_PWM_PIN conflicts with FAN_PIN."
3203 #elif _PIN_CONFLICT(FAN1)
3204 #error "SPINDLE_LASER_PWM_PIN conflicts with FAN1_PIN."
3205 #elif _PIN_CONFLICT(FAN2)
3206 #error "SPINDLE_LASER_PWM_PIN conflicts with FAN2_PIN."
3207 #elif _PIN_CONFLICT(FAN3)
3208 #error "SPINDLE_LASER_PWM_PIN conflicts with FAN3_PIN."
3209 #elif _PIN_CONFLICT(FAN4)
3210 #error "SPINDLE_LASER_PWM_PIN conflicts with FAN4_PIN."
3211 #elif _PIN_CONFLICT(FAN5)
3212 #error "SPINDLE_LASER_PWM_PIN conflicts with FAN5_PIN."
3213 #elif _PIN_CONFLICT(FAN6)
3214 #error "SPINDLE_LASER_PWM_PIN conflicts with FAN6_PIN."
3215 #elif _PIN_CONFLICT(FAN7)
3216 #error "SPINDLE_LASER_PWM_PIN conflicts with FAN7_PIN."
3217 #elif _PIN_CONFLICT(CONTROLLERFAN)
3218 #error "SPINDLE_LASER_PWM_PIN conflicts with CONTROLLERFAN_PIN."
3219 #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_XY)
3220 #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_XY."
3221 #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_Z)
3222 #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_Z."
3223 #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_E)
3224 #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_E."
3225 #endif
3226 #endif
3227 #undef _PIN_CONFLICT
3228 #endif
3230 #if NONE(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI) && ENABLED(PRINT_PROGRESS_SHOW_DECIMALS)
3231 #error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD."
3232 #endif
3234 #if HAS_ADC_BUTTONS && defined(ADC_BUTTON_DEBOUNCE_DELAY) && ADC_BUTTON_DEBOUNCE_DELAY < 16
3235 #error "ADC_BUTTON_DEBOUNCE_DELAY must be greater than 16."
3236 #endif
3239 * Check to make sure MONITOR_DRIVER_STATUS isn't enabled
3240 * on boards where TMC drivers share the SPI bus with SD.
3242 #if HAS_TMC_SPI && ALL(MONITOR_DRIVER_STATUS, SDSUPPORT, USES_SHARED_SPI)
3243 #error "MONITOR_DRIVER_STATUS and SDSUPPORT cannot be used together on boards with shared SPI."
3244 #endif
3246 // G60/G61 Position Save
3247 #if SAVED_POSITIONS > 256
3248 #error "SAVED_POSITIONS must be an integer from 0 to 256."
3249 #endif
3252 * Stepper Chunk support
3254 #if BOTH(DIRECT_STEPPING, LIN_ADVANCE)
3255 #error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. Enable in external planner if possible."
3256 #endif
3259 * Touch Buttons
3261 #if ENABLED(TOUCH_SCREEN) && DISABLED(TOUCH_SCREEN_CALIBRATION)
3262 #ifndef TOUCH_CALIBRATION_X
3263 #error "TOUCH_CALIBRATION_X must be defined with TOUCH_SCREEN."
3264 #endif
3265 #ifndef TOUCH_CALIBRATION_Y
3266 #error "TOUCH_CALIBRATION_Y must be defined with TOUCH_SCREEN."
3267 #endif
3268 #ifndef TOUCH_OFFSET_X
3269 #error "TOUCH_OFFSET_X must be defined with TOUCH_SCREEN."
3270 #endif
3271 #ifndef TOUCH_OFFSET_Y
3272 #error "TOUCH_OFFSET_Y must be defined with TOUCH_SCREEN."
3273 #endif
3274 #endif
3277 * Sanity check for WIFI
3279 #if EITHER(ESP3D_WIFISUPPORT, WIFISUPPORT) && DISABLED(ARDUINO_ARCH_ESP32)
3280 #error "ESP3D_WIFISUPPORT or WIFISUPPORT requires an ESP32 MOTHERBOARD."
3281 #endif
3284 * Sanity Check for Password Feature
3286 #if ENABLED(PASSWORD_FEATURE)
3287 #if NONE(HAS_LCD_MENU, PASSWORD_UNLOCK_GCODE, PASSWORD_CHANGE_GCODE)
3288 #error "Without PASSWORD_UNLOCK_GCODE, PASSWORD_CHANGE_GCODE, or a supported LCD there's no way to unlock the printer or set a password."
3289 #elif DISABLED(EEPROM_SETTINGS)
3290 #warning "PASSWORD_FEATURE settings will be lost on power-off without EEPROM_SETTINGS."
3291 #endif
3292 #endif
3295 * Sanity check for valid stepper driver types
3297 #define _BAD_DRIVER(A) (defined(A##_DRIVER_TYPE) && !_DRIVER_ID(A##_DRIVER_TYPE))
3298 #if _BAD_DRIVER(X)
3299 #error "X_DRIVER_TYPE is not recognized."
3300 #endif
3301 #if _BAD_DRIVER(Y)
3302 #error "Y_DRIVER_TYPE is not recognized."
3303 #endif
3304 #if _BAD_DRIVER(Z)
3305 #error "Z_DRIVER_TYPE is not recognized."
3306 #endif
3307 #if _BAD_DRIVER(X2)
3308 #error "X2_DRIVER_TYPE is not recognized."
3309 #endif
3310 #if _BAD_DRIVER(Y2)
3311 #error "Y2_DRIVER_TYPE is not recognized."
3312 #endif
3313 #if _BAD_DRIVER(Z2)
3314 #error "Z2_DRIVER_TYPE is not recognized."
3315 #endif
3316 #if _BAD_DRIVER(Z3)
3317 #error "Z3_DRIVER_TYPE is not recognized."
3318 #endif
3319 #if _BAD_DRIVER(Z4)
3320 #error "Z4_DRIVER_TYPE is not recognized."
3321 #endif
3322 #if _BAD_DRIVER(E0)
3323 #error "E0_DRIVER_TYPE is not recognized."
3324 #endif
3325 #if _BAD_DRIVER(E1)
3326 #error "E1_DRIVER_TYPE is not recognized."
3327 #endif
3328 #if _BAD_DRIVER(E2)
3329 #error "E2_DRIVER_TYPE is not recognized."
3330 #endif
3331 #if _BAD_DRIVER(E3)
3332 #error "E3_DRIVER_TYPE is not recognized."
3333 #endif
3334 #if _BAD_DRIVER(E4)
3335 #error "E4_DRIVER_TYPE is not recognized."
3336 #endif
3337 #if _BAD_DRIVER(E5)
3338 #error "E5_DRIVER_TYPE is not recognized."
3339 #endif
3340 #if _BAD_DRIVER(E6)
3341 #error "E6_DRIVER_TYPE is not recognized."
3342 #endif
3343 #if _BAD_DRIVER(E7)
3344 #error "E7_DRIVER_TYPE is not recognized."
3345 #endif
3346 #undef _BAD_DRIVER
3348 // Misc. Cleanup
3349 #undef _TEST_PWM