My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SanityCheck.h 89KB

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