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 97KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2019 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(STEALTHCHOP)
  263. #error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E). Please update your Configuration_adv.h."
  264. #elif defined(HAVE_TMC26X)
  265. #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
  266. #elif defined(HAVE_TMC2130)
  267. #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h."
  268. #elif defined(HAVE_L6470DRIVER)
  269. #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h."
  270. #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) \
  271. || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) || defined(E5_IS_TMC)
  272. #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
  273. #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) \
  274. || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) || defined(E5_IS_TMC26X)
  275. #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
  276. #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) \
  277. || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) || defined(E5_IS_TMC2130)
  278. #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h."
  279. #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) \
  280. || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) || defined(E5_IS_TMC2208)
  281. #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h."
  282. #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) \
  283. || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) || defined(E5_IS_L6470)
  284. #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h."
  285. #elif defined(AUTOMATIC_CURRENT_CONTROL)
  286. #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration."
  287. #elif defined(FILAMENT_CHANGE_LOAD_LENGTH)
  288. #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH. Please update your configuration."
  289. #elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET)
  290. #error "LEVEL_BED_CORNERS requires a LEVEL_CORNERS_INSET value. Please update your Configuration.h."
  291. #elif defined(BEZIER_JERK_CONTROL)
  292. #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration."
  293. #elif defined(JUNCTION_DEVIATION_FACTOR)
  294. #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM. Please update your configuration."
  295. #elif defined(JUNCTION_ACCELERATION_FACTOR)
  296. #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h."
  297. #elif defined(JUNCTION_ACCELERATION)
  298. #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h."
  299. #elif defined(MAX7219_DEBUG_STEPPER_HEAD)
  300. #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD. Please update your configuration."
  301. #elif defined(MAX7219_DEBUG_STEPPER_TAIL)
  302. #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL. Please update your configuration."
  303. #elif defined(MAX7219_DEBUG_STEPPER_QUEUE)
  304. #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE. Please update your configuration."
  305. #elif defined(ENDSTOP_NOISE_FILTER)
  306. #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]. Please update your configuration."
  307. #elif defined(RETRACT_ZLIFT)
  308. #error "RETRACT_ZLIFT is now RETRACT_ZRAISE. Please update your Configuration_adv.h."
  309. #elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT)
  310. #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE. Please update your configuration."
  311. #elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE)
  312. #error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE. Please update your configuration."
  313. #elif defined(SINGLENOZZLE_SWAP_LENGTH)
  314. #error "SINGLENOZZLE_SWAP_LENGTH is now TOOLCHANGE_FIL_SWAP_LENGTH. Please update your configuration."
  315. #elif defined(SINGLENOZZLE_SWAP_RETRACT_SPEED)
  316. #error "SINGLENOZZLE_SWAP_RETRACT_SPEED is now TOOLCHANGE_FIL_SWAP_RETRACT_SPEED. Please update your configuration."
  317. #elif defined(SINGLENOZZLE_SWAP_PRIME_SPEED)
  318. #error "SINGLENOZZLE_SWAP_PRIME_SPEED is now TOOLCHANGE_FIL_SWAP_PRIME_SPEED. Please update your configuration."
  319. #elif defined(SINGLENOZZLE_SWAP_PARK)
  320. #error "SINGLENOZZLE_SWAP_PARK is now TOOLCHANGE_PARK. Please update your configuration."
  321. #elif defined(SINGLENOZZLE_TOOLCHANGE_XY)
  322. #error "SINGLENOZZLE_TOOLCHANGE_XY is now TOOLCHANGE_PARK_XY. Please update your configuration."
  323. #elif defined(SINGLENOZZLE_PARK_XY_FEEDRATE)
  324. #error "SINGLENOZZLE_PARK_XY_FEEDRATE is now TOOLCHANGE_PARK_XY_FEEDRATE. Please update your configuration."
  325. #elif defined(PARKING_EXTRUDER_SECURITY_RAISE)
  326. #error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration."
  327. #elif defined(SWITCHING_TOOLHEAD_SECURITY_RAISE)
  328. #error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration."
  329. #elif defined(G0_FEEDRATE) && G0_FEEDRATE == 0
  330. #error "G0_FEEDRATE is now used to set the G0 feedrate. Please update your configuration."
  331. #elif defined(MBL_Z_STEP)
  332. #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP. Please update your configuration."
  333. #elif defined(CHDK)
  334. #error "CHDK is now CHDK_PIN. Please update your Configuration_adv.h."
  335. #elif defined(MAX6675_SS)
  336. #error "MAX6675_SS is now MAX6675_SS_PIN. Please update your configuration and/or pins."
  337. #elif defined(MAX6675_SS2)
  338. #error "MAX6675_SS2 is now MAX6675_SS2_PIN. Please update your configuration and/or pins."
  339. #elif defined(SPINDLE_LASER_ENABLE_PIN)
  340. #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN. Please update your configuration and/or pins."
  341. #elif defined(CHAMBER_HEATER_PIN)
  342. #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN. Please update your configuration and/or pins."
  343. #elif defined(TMC_Z_CALIBRATION)
  344. #error "TMC_Z_CALIBRATION has been deprecated in favor of Z_STEPPER_AUTO_ALIGN. Please update your configuration."
  345. #elif defined(Z_MIN_PROBE_ENDSTOP)
  346. #error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it from Configuration.h."
  347. #elif defined(DUAL_NOZZLE_DUPLICATION_MODE)
  348. #error "DUAL_NOZZLE_DUPLICATION_MODE is now MULTI_NOZZLE_DUPLICATION. Please update your configuration."
  349. #endif
  350. #define BOARD_MKS_13 -47
  351. #define BOARD_TRIGORILLA -343
  352. #define BOARD_RURAMPS4D -1550
  353. #define BOARD_FORMBOT_TREX2 -81
  354. #if MB(MKS_13)
  355. #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration."
  356. #elif MB(TRIGORILLA)
  357. #error "BOARD_TRIGORILLA has been renamed BOARD_TRIGORILLA_13. Please update your configuration."
  358. #elif MB(RURAMPS4D)
  359. #error "BOARD_RURAMPS4D has been renamed BOARD_RURAMPS4D_11. Please update your configuration."
  360. #elif MB(FORMBOT_TREX2)
  361. #error "FORMBOT_TREX2 has been renamed BOARD_FORMBOT_TREX2PLUS. Please update your configuration."
  362. #endif
  363. /**
  364. * Marlin release, version and default string
  365. */
  366. #ifndef SHORT_BUILD_VERSION
  367. #error "SHORT_BUILD_VERSION must be specified."
  368. #elif !defined(DETAILED_BUILD_VERSION)
  369. #error "BUILD_VERSION must be specified."
  370. #elif !defined(STRING_DISTRIBUTION_DATE)
  371. #error "STRING_DISTRIBUTION_DATE must be specified."
  372. #elif !defined(PROTOCOL_VERSION)
  373. #error "PROTOCOL_VERSION must be specified."
  374. #elif !defined(MACHINE_NAME)
  375. #error "MACHINE_NAME must be specified."
  376. #elif !defined(SOURCE_CODE_URL)
  377. #error "SOURCE_CODE_URL must be specified."
  378. #elif !defined(DEFAULT_MACHINE_UUID)
  379. #error "DEFAULT_MACHINE_UUID must be specified."
  380. #elif !defined(WEBSITE_URL)
  381. #error "WEBSITE_URL must be specified."
  382. #endif
  383. /**
  384. * Serial
  385. */
  386. #if !(defined(__AVR__) && defined(USBCON))
  387. #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
  388. #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
  389. #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
  390. #error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
  391. #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
  392. #error "TX_BUFFER_SIZE must be 0 or a power of 2 between 1 and 256."
  393. #endif
  394. #elif ANY(SERIAL_XON_XOFF, SERIAL_STATS_MAX_RX_QUEUED, SERIAL_STATS_DROPPED_RX)
  395. #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
  396. #endif
  397. #if SERIAL_PORT > 7
  398. #error "Set SERIAL_PORT to the port on your board. Usually this is 0."
  399. #endif
  400. #if defined(SERIAL_PORT_2) && NUM_SERIAL < 2
  401. #error "SERIAL_PORT_2 is not supported for your MOTHERBOARD. Disable it to continue."
  402. #endif
  403. /**
  404. * Dual / Triple Stepper Drivers
  405. */
  406. #if BOTH(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE)
  407. #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS."
  408. #elif ENABLED(X_DUAL_STEPPER_DRIVERS) && !(HAS_X2_ENABLE && HAS_X2_STEP && HAS_X2_DIR)
  409. #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)."
  410. #elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && !(HAS_Y2_ENABLE && HAS_Y2_STEP && HAS_Y2_DIR)
  411. #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)."
  412. #elif ENABLED(Z_DUAL_STEPPER_DRIVERS)
  413. #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
  414. #error "Please select either Z_TRIPLE_STEPPER_DRIVERS or Z_DUAL_STEPPER_DRIVERS, not both."
  415. #elif !(HAS_Z2_ENABLE && HAS_Z2_STEP && HAS_Z2_DIR)
  416. #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)."
  417. #endif
  418. #elif ENABLED(Z_TRIPLE_STEPPER_DRIVERS) && !(HAS_Z2_ENABLE && HAS_Z2_STEP && HAS_Z2_DIR && HAS_Z3_ENABLE && HAS_Z3_STEP && HAS_Z3_DIR)
  419. #error "Z_TRIPLE_STEPPER_DRIVERS requires Z3 pins (and two extra E plugs)."
  420. #endif
  421. /**
  422. * Validate that the bed size fits
  423. */
  424. static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE.");
  425. static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE.");
  426. /**
  427. * Granular software endstops (Marlin >= 1.1.7)
  428. */
  429. #if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z)
  430. #if IS_KINEMATIC
  431. #error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z."
  432. #elif DISABLED(MIN_SOFTWARE_ENDSTOP_X, MIN_SOFTWARE_ENDSTOP_Y)
  433. #error "MIN_SOFTWARE_ENDSTOPS requires at least one of the MIN_SOFTWARE_ENDSTOP_[XYZ] options."
  434. #endif
  435. #endif
  436. #if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z)
  437. #if IS_KINEMATIC
  438. #error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z."
  439. #elif DISABLED(MAX_SOFTWARE_ENDSTOP_X, MAX_SOFTWARE_ENDSTOP_Y)
  440. #error "MAX_SOFTWARE_ENDSTOPS requires at least one of the MAX_SOFTWARE_ENDSTOP_[XYZ] options."
  441. #endif
  442. #endif
  443. #if !defined(TARGET_LPC1768) && ( \
  444. ENABLED(ENDSTOPPULLDOWNS) \
  445. || ENABLED(ENDSTOPPULLDOWN_XMAX) \
  446. || ENABLED(ENDSTOPPULLDOWN_YMAX) \
  447. || ENABLED(ENDSTOPPULLDOWN_ZMAX) \
  448. || ENABLED(ENDSTOPPULLDOWN_XMIN) \
  449. || ENABLED(ENDSTOPPULLDOWN_YMIN) \
  450. || ENABLED(ENDSTOPPULLDOWN_ZMIN) )
  451. #error "PULLDOWN pin mode is not available on the selected board."
  452. #endif
  453. #if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS)
  454. #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS."
  455. #elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN)
  456. #error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN."
  457. #elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX)
  458. #error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX."
  459. #elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX)
  460. #error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
  461. #elif BOTH(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX)
  462. #error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
  463. #elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN)
  464. #error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
  465. #elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN)
  466. #error "Enable only one of ENDSTOPPULLUP_Y_MIN or ENDSTOPPULLDOWN_Y_MIN."
  467. #elif BOTH(ENDSTOPPULLUP_ZMIN, ENDSTOPPULLDOWN_ZMIN)
  468. #error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN."
  469. #endif
  470. /**
  471. * LCD Info Screen Style
  472. */
  473. #if LCD_INFO_SCREEN_STYLE > 0
  474. #if HAS_GRAPHICAL_LCD || LCD_WIDTH < 20 || LCD_HEIGHT < 4
  475. #error "Alternative LCD_INFO_SCREEN_STYLE requires 20x4 Character LCD."
  476. #elif LCD_INFO_SCREEN_STYLE > 1
  477. #error "LCD_INFO_SCREEN_STYLE only has options 0 and 1 at this time."
  478. #endif
  479. #endif
  480. /**
  481. * Progress Bar
  482. */
  483. #if ENABLED(LCD_PROGRESS_BAR)
  484. #if DISABLED(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
  485. #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY."
  486. #elif !HAS_CHARACTER_LCD
  487. #error "LCD_PROGRESS_BAR requires a character LCD."
  488. #elif HAS_GRAPHICAL_LCD
  489. #error "LCD_PROGRESS_BAR does not apply to graphical displays."
  490. #elif ENABLED(FILAMENT_LCD_DISPLAY)
  491. #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both."
  492. #elif PROGRESS_MSG_EXPIRE < 0
  493. #error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
  494. #endif
  495. #elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && !HAS_GRAPHICAL_LCD && DISABLED(EXTENSIBLE_UI)
  496. #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Graphical LCD, or EXTENSIBLE_UI."
  497. #endif
  498. /**
  499. * Custom Boot and Status screens
  500. */
  501. #if DISABLED(DOGLCD) && EITHER(SHOW_CUSTOM_BOOTSCREEN, CUSTOM_STATUS_SCREEN_IMAGE)
  502. #error "Graphical LCD is required for SHOW_CUSTOM_BOOTSCREEN and CUSTOM_STATUS_SCREEN_IMAGE."
  503. #endif
  504. /**
  505. * LCD Lightweight Screen Style
  506. */
  507. #if ENABLED(LIGHTWEIGHT_UI) && DISABLED(U8GLIB_ST7920)
  508. #error "LIGHTWEIGHT_UI requires a U8GLIB_ST7920-based display."
  509. #endif
  510. /**
  511. * SD File Sorting
  512. */
  513. #if ENABLED(SDCARD_SORT_ALPHA)
  514. #if SDSORT_LIMIT > 256
  515. #error "SDSORT_LIMIT must be 256 or smaller."
  516. #elif SDSORT_LIMIT < 10
  517. #error "SDSORT_LIMIT should be greater than 9 to be useful."
  518. #elif DISABLED(SDSORT_USES_RAM)
  519. #if ENABLED(SDSORT_DYNAMIC_RAM)
  520. #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)."
  521. #elif ENABLED(SDSORT_CACHE_NAMES)
  522. #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)."
  523. #endif
  524. #endif
  525. #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
  526. #if SDSORT_CACHE_VFATS < 2
  527. #error "SDSORT_CACHE_VFATS must be 2 or greater!"
  528. #elif SDSORT_CACHE_VFATS > MAX_VFAT_ENTRIES
  529. #undef SDSORT_CACHE_VFATS
  530. #define SDSORT_CACHE_VFATS MAX_VFAT_ENTRIES
  531. #warning "SDSORT_CACHE_VFATS was reduced to MAX_VFAT_ENTRIES!"
  532. #endif
  533. #endif
  534. #endif
  535. #if defined(EVENT_GCODE_SD_STOP) && DISABLED(NOZZLE_PARK_FEATURE)
  536. static_assert(NULL == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP.");
  537. #endif
  538. /**
  539. * I2C Position Encoders
  540. */
  541. #if ENABLED(I2C_POSITION_ENCODERS)
  542. #if DISABLED(BABYSTEPPING) || DISABLED(BABYSTEP_XY)
  543. #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY."
  544. #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5)
  545. #error "I2CPE_ENCODER_CNT must be between 1 and 5."
  546. #endif
  547. #endif
  548. /**
  549. * Babystepping
  550. */
  551. #if ENABLED(BABYSTEPPING)
  552. #if ENABLED(SCARA)
  553. #error "BABYSTEPPING is not implemented for SCARA yet."
  554. #elif BOTH(DELTA, BABYSTEP_XY)
  555. #error "BABYSTEPPING only implemented for Z axis on deltabots."
  556. #elif BOTH(BABYSTEP_ZPROBE_OFFSET, MESH_BED_LEVELING)
  557. #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
  558. #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
  559. #error "BABYSTEP_ZPROBE_OFFSET requires a probe."
  560. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(DOGLCD)
  561. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD."
  562. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
  563. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
  564. #elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET
  565. #error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS."
  566. #elif BOTH(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE)
  567. #error "BABYSTEP_ALWAYS_AVAILABLE and MOVE_Z_WHEN_IDLE are incompatible."
  568. #endif
  569. #endif
  570. /**
  571. * Filament Runout needs one or more pins and either SD Support or Auto print start detection
  572. */
  573. #if HAS_FILAMENT_SENSOR
  574. #if !PIN_EXISTS(FIL_RUNOUT)
  575. #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
  576. #elif NUM_RUNOUT_SENSORS > E_STEPPERS
  577. #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers."
  578. #elif NUM_RUNOUT_SENSORS > 1 && !PIN_EXISTS(FIL_RUNOUT2)
  579. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 1 requires FIL_RUNOUT2_PIN."
  580. #elif NUM_RUNOUT_SENSORS > 2 && !PIN_EXISTS(FIL_RUNOUT3)
  581. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 2 requires FIL_RUNOUT3_PIN."
  582. #elif NUM_RUNOUT_SENSORS > 3 && !PIN_EXISTS(FIL_RUNOUT4)
  583. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 3 requires FIL_RUNOUT4_PIN."
  584. #elif NUM_RUNOUT_SENSORS > 4 && !PIN_EXISTS(FIL_RUNOUT5)
  585. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 4 requires FIL_RUNOUT5_PIN."
  586. #elif NUM_RUNOUT_SENSORS > 5 && !PIN_EXISTS(FIL_RUNOUT6)
  587. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 5 requires FIL_RUNOUT6_PIN."
  588. #elif DISABLED(SDSUPPORT, PRINTJOB_TIMER_AUTOSTART)
  589. #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART."
  590. #elif FILAMENT_RUNOUT_DISTANCE_MM < 0
  591. #error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero."
  592. #elif DISABLED(ADVANCED_PAUSE_FEATURE)
  593. static_assert(NULL == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
  594. #endif
  595. #endif
  596. /**
  597. * Advanced Pause
  598. */
  599. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  600. #if !HAS_RESUME_CONTINUE
  601. #error "ADVANCED_PAUSE_FEATURE currently requires an LCD controller or EMERGENCY_PARSER."
  602. #elif ENABLED(EXTRUDER_RUNOUT_PREVENT)
  603. #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
  604. #elif ENABLED(PARK_HEAD_ON_PAUSE) && DISABLED(SDSUPPORT, NEWPANEL, EMERGENCY_PARSER)
  605. #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller."
  606. #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
  607. #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT."
  608. #elif DISABLED(NOZZLE_PARK_FEATURE)
  609. #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE."
  610. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH
  611. #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  612. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH
  613. #error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  614. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH
  615. #error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  616. #endif
  617. #endif
  618. #if ENABLED(NOZZLE_PARK_FEATURE)
  619. constexpr float npp[] = NOZZLE_PARK_POINT;
  620. static_assert(COUNT(npp) == XYZ, "NOZZLE_PARK_POINT requires X, Y, and Z values.");
  621. #endif
  622. /**
  623. * Individual axis homing is useless for DELTAS
  624. */
  625. #if BOTH(INDIVIDUAL_AXIS_HOMING_MENU, DELTA)
  626. #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
  627. #endif
  628. /**
  629. * Options only for EXTRUDERS > 1
  630. */
  631. #if EXTRUDERS > 1
  632. #if EXTRUDERS > 6
  633. #error "Marlin supports a maximum of 6 EXTRUDERS."
  634. #endif
  635. #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  636. #error "EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT."
  637. #endif
  638. #if ENABLED(HEATERS_PARALLEL)
  639. #error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
  640. #endif
  641. #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
  642. #ifndef TOOLCHANGE_FIL_SWAP_LENGTH
  643. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FIL_SWAP_LENGTH. Please update your Configuration."
  644. #elif !defined(TOOLCHANGE_FIL_SWAP_RETRACT_SPEED)
  645. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FIL_SWAP_RETRACT_SPEED. Please update your Configuration."
  646. #elif !defined(TOOLCHANGE_FIL_SWAP_PRIME_SPEED)
  647. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FIL_SWAP_PRIME_SPEED. Please update your Configuration."
  648. #endif
  649. #endif
  650. #if ENABLED(TOOLCHANGE_PARK)
  651. #ifndef TOOLCHANGE_PARK_XY
  652. #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY. Please update your Configuration."
  653. #elif !defined(TOOLCHANGE_PARK_XY_FEEDRATE)
  654. #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY_FEEDRATE. Please update your Configuration."
  655. #endif
  656. #endif
  657. #ifndef TOOLCHANGE_ZRAISE
  658. #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1. Please update your Configuration."
  659. #endif
  660. #elif ENABLED(MK2_MULTIPLEXER)
  661. #error "MK2_MULTIPLEXER requires 2 or more EXTRUDERS."
  662. #elif ENABLED(SINGLENOZZLE)
  663. #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
  664. #endif
  665. /**
  666. * Sanity checking for the Průša MK2 Multiplexer
  667. */
  668. #ifdef SNMM
  669. #error "SNMM is now MK2_MULTIPLEXER. Please update your configuration."
  670. #endif
  671. /**
  672. * A Dual Nozzle carriage with switching servo
  673. */
  674. #if ENABLED(SWITCHING_NOZZLE)
  675. #if ENABLED(DUAL_X_CARRIAGE)
  676. #error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible."
  677. #elif ENABLED(SINGLENOZZLE)
  678. #error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible."
  679. #elif EXTRUDERS != 2
  680. #error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
  681. #elif NUM_SERVOS < 1
  682. #error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1."
  683. #endif
  684. #ifndef SWITCHING_NOZZLE_SERVO_NR
  685. #error "SWITCHING_NOZZLE requires SWITCHING_NOZZLE_SERVO_NR."
  686. #elif SWITCHING_NOZZLE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  687. #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
  688. #elif SWITCHING_NOZZLE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  689. #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
  690. #elif SWITCHING_NOZZLE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  691. #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
  692. #elif SWITCHING_NOZZLE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  693. #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
  694. #endif
  695. #ifdef SWITCHING_NOZZLE_E1_SERVO_NR
  696. #if SWITCHING_NOZZLE_E1_SERVO_NR == SWITCHING_NOZZLE_SERVO_NR
  697. #error "SWITCHING_NOZZLE_E1_SERVO_NR must be different from SWITCHING_NOZZLE_SERVO_NR."
  698. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  699. #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
  700. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  701. #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
  702. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  703. #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
  704. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  705. #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
  706. #endif
  707. #endif
  708. #endif
  709. /**
  710. * Single Stepper Dual Extruder with switching servo
  711. */
  712. #if ENABLED(SWITCHING_EXTRUDER)
  713. #if NUM_SERVOS < 1
  714. #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
  715. #elif SWITCHING_EXTRUDER_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  716. #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
  717. #elif SWITCHING_EXTRUDER_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  718. #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
  719. #elif SWITCHING_EXTRUDER_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  720. #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
  721. #elif SWITCHING_EXTRUDER_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  722. #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
  723. #endif
  724. #if EXTRUDERS > 3
  725. #if NUM_SERVOS < 2
  726. #error "SWITCHING_EXTRUDER with 4 extruders requires NUM_SERVOS >= 2."
  727. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  728. #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
  729. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  730. #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
  731. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  732. #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
  733. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  734. #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
  735. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == SWITCHING_EXTRUDER_SERVO_NR
  736. #error "SWITCHING_EXTRUDER_E23_SERVO_NR should be a different extruder from SWITCHING_EXTRUDER_SERVO_NR."
  737. #endif
  738. #endif
  739. #endif
  740. /**
  741. * Mixing Extruder requirements
  742. */
  743. #if ENABLED(MIXING_EXTRUDER)
  744. #if EXTRUDERS > 1
  745. #error "MIXING_EXTRUDER currently only supports one extruder."
  746. #elif MIXING_STEPPERS < 2
  747. #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
  748. #elif ENABLED(FILAMENT_SENSOR)
  749. #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway."
  750. #elif ENABLED(SWITCHING_EXTRUDER)
  751. #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both."
  752. #elif ENABLED(SINGLENOZZLE)
  753. #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE."
  754. #endif
  755. #endif
  756. /**
  757. * Linear Advance 1.5 - Check K value range
  758. */
  759. #if ENABLED(LIN_ADVANCE)
  760. static_assert(
  761. WITHIN(LIN_ADVANCE_K, 0, 10),
  762. "LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)."
  763. );
  764. #endif
  765. /**
  766. * (Magnetic) Parking Extruder requirements
  767. */
  768. #if ENABLED(PARKING_EXTRUDER)
  769. #if ENABLED(DUAL_X_CARRIAGE)
  770. #error "PARKING_EXTRUDER and DUAL_X_CARRIAGE are incompatible."
  771. #elif ENABLED(SINGLENOZZLE)
  772. #error "PARKING_EXTRUDER and SINGLENOZZLE are incompatible."
  773. #elif ENABLED(EXT_SOLENOID)
  774. #error "PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)"
  775. #elif ENABLED(MAGNETIC_PARKING_EXTRUDER)
  776. #error "Enable only one of PARKING_EXTRUDER and MAGNETIC_PARKING_EXTRUDER."
  777. #elif EXTRUDERS != 2
  778. #error "PARKING_EXTRUDER requires exactly 2 EXTRUDERS."
  779. #elif !PIN_EXISTS(SOL0, SOL1)
  780. #error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN."
  781. #elif !defined(PARKING_EXTRUDER_PARKING_X)
  782. #error "PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X."
  783. #elif !defined(TOOLCHANGE_ZRAISE)
  784. #error "PARKING_EXTRUDER requires TOOLCHANGE_ZRAISE."
  785. #elif TOOLCHANGE_ZRAISE < 0
  786. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  787. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH)
  788. #error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW."
  789. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000)
  790. #error "PARKING_EXTRUDER_SOLENOIDS_DELAY must be between 0 and 2000 (ms)."
  791. #endif
  792. #elif ENABLED(MAGNETIC_PARKING_EXTRUDER)
  793. #if ENABLED(DUAL_X_CARRIAGE)
  794. #error "MAGNETIC_PARKING_EXTRUDER and DUAL_X_CARRIAGE are incompatible."
  795. #elif ENABLED(SINGLENOZZLE)
  796. #error "MAGNETIC_PARKING_EXTRUDER and SINGLENOZZLE are incompatible."
  797. #elif ENABLED(EXT_SOLENOID)
  798. #error "MAGNETIC_PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)"
  799. #elif EXTRUDERS != 2
  800. #error "MAGNETIC_PARKING_EXTRUDER requires exactly 2 EXTRUDERS."
  801. #elif !defined(PARKING_EXTRUDER_PARKING_X)
  802. #error "MAGNETIC_PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X."
  803. #elif !defined(TOOLCHANGE_ZRAISE)
  804. #error "MAGNETIC_PARKING_EXTRUDER requires TOOLCHANGE_ZRAISE."
  805. #elif TOOLCHANGE_ZRAISE < 0
  806. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  807. #endif
  808. #endif
  809. /**
  810. * Switching Toolhead requirements
  811. */
  812. #if ENABLED(SWITCHING_TOOLHEAD)
  813. #if ENABLED(DUAL_X_CARRIAGE)
  814. #error "SWITCHING_TOOLHEAD and DUAL_X_CARRIAGE are incompatible."
  815. #elif ENABLED(SINGLENOZZLE)
  816. #error "SWITCHING_TOOLHEAD and SINGLENOZZLE are incompatible."
  817. #elif ENABLED(PARKING_EXTRUDER)
  818. #error "SWITCHING_TOOLHEAD and PARKING_EXTRUDER are incompatible."
  819. #elif !defined(SWITCHING_TOOLHEAD_SERVO_NR)
  820. #error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SERVO_NR."
  821. #elif EXTRUDERS < 2
  822. #error "SWITCHING_TOOLHEAD requires at least 2 EXTRUDERS."
  823. #elif NUM_SERVOS < (SWITCHING_TOOLHEAD_SERVO_NR - 1)
  824. #if SWITCHING_TOOLHEAD_SERVO_NR == 0
  825. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 0 requires NUM_SERVOS >= 1."
  826. #elif SWITCHING_TOOLHEAD_SERVO_NR == 1
  827. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 1 requires NUM_SERVOS >= 2."
  828. #elif SWITCHING_TOOLHEAD_SERVO_NR == 2
  829. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 2 requires NUM_SERVOS >= 3."
  830. #elif SWITCHING_TOOLHEAD_SERVO_NR == 3
  831. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 3 requires NUM_SERVOS >= 4."
  832. #endif
  833. #elif !defined(TOOLCHANGE_ZRAISE)
  834. #error "SWITCHING_TOOLHEAD requires TOOLCHANGE_ZRAISE."
  835. #elif TOOLCHANGE_ZRAISE < 0
  836. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  837. #endif
  838. #endif
  839. /**
  840. * Part-Cooling Fan Multiplexer requirements
  841. */
  842. #if PIN_EXISTS(FANMUX1)
  843. #if !HAS_FANMUX
  844. #error "FANMUX0_PIN must be set before FANMUX1_PIN can be set."
  845. #endif
  846. #elif PIN_EXISTS(FANMUX2)
  847. #error "FANMUX0_PIN and FANMUX1_PIN must be set before FANMUX2_PIN can be set."
  848. #endif
  849. /**
  850. * Limited number of servos
  851. */
  852. #if NUM_SERVOS > NUM_SERVO_PLUGS
  853. #error "The selected board doesn't support enough servos for your configuration. Reduce NUM_SERVOS."
  854. #endif
  855. /**
  856. * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder
  857. */
  858. #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)
  859. #error "Z_PROBE_SERVO_NR, switching nozzle, switching toolhead or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE."
  860. #endif
  861. /**
  862. * Required LCD language
  863. */
  864. #if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780)
  865. #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller."
  866. #endif
  867. /**
  868. * Bed Heating Options - PID vs Limit Switching
  869. */
  870. #if BOTH(PIDTEMPBED, BED_LIMIT_SWITCHING)
  871. #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED."
  872. #endif
  873. /**
  874. * Kinematics
  875. */
  876. /**
  877. * Allow only one kinematic type to be defined
  878. */
  879. #if 1 < 0 \
  880. + ENABLED(DELTA) \
  881. + ENABLED(MORGAN_SCARA) \
  882. + ENABLED(MAKERARM_SCARA) \
  883. + ENABLED(COREXY) \
  884. + ENABLED(COREXZ) \
  885. + ENABLED(COREYZ) \
  886. + ENABLED(COREYX) \
  887. + ENABLED(COREZX) \
  888. + ENABLED(COREZY)
  889. #error "Please enable only one of DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY."
  890. #endif
  891. /**
  892. * Delta requirements
  893. */
  894. #if ENABLED(DELTA)
  895. #if DISABLED(USE_XMAX_PLUG, USE_YMAX_PLUG, USE_ZMAX_PLUG)
  896. #error "You probably want to use Max Endstops for DELTA!"
  897. #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED
  898. #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
  899. #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_LCD_MENU)
  900. #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
  901. #elif ABL_GRID
  902. #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0
  903. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
  904. #elif GRID_MAX_POINTS_X < 3
  905. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher."
  906. #endif
  907. #endif
  908. #endif
  909. /**
  910. * Probes
  911. */
  912. /**
  913. * Allow only one probe option to be defined
  914. */
  915. #if 1 < 0 \
  916. + ENABLED(PROBE_MANUALLY) \
  917. + ENABLED(FIX_MOUNTED_PROBE) \
  918. + (HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH)) \
  919. + ENABLED(BLTOUCH) \
  920. + ENABLED(SOLENOID_PROBE) \
  921. + ENABLED(Z_PROBE_ALLEN_KEY) \
  922. + ENABLED(Z_PROBE_SLED) \
  923. + ENABLED(RACK_AND_PINION_PROBE)
  924. #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."
  925. #endif
  926. #if HAS_BED_PROBE
  927. /**
  928. * Z_PROBE_SLED is incompatible with DELTA
  929. */
  930. #if BOTH(Z_PROBE_SLED, DELTA)
  931. #error "You cannot use Z_PROBE_SLED with DELTA."
  932. #endif
  933. /**
  934. * SOLENOID_PROBE requirements
  935. */
  936. #if ENABLED(SOLENOID_PROBE)
  937. #if ENABLED(EXT_SOLENOID)
  938. #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID."
  939. #elif !HAS_SOLENOID_1
  940. #error "SOLENOID_PROBE requires SOL1_PIN. It can be added to your Configuration.h."
  941. #endif
  942. #endif
  943. /**
  944. * NUM_SERVOS is required for a Z servo probe
  945. */
  946. #if HAS_Z_SERVO_PROBE
  947. #ifndef NUM_SERVOS
  948. #error "You must set NUM_SERVOS for a Z servo probe (Z_PROBE_SERVO_NR)."
  949. #elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  950. #error "SERVO0_PIN must be defined for your servo or BLTOUCH probe."
  951. #elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  952. #error "SERVO1_PIN must be defined for your servo or BLTOUCH probe."
  953. #elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  954. #error "SERVO2_PIN must be defined for your servo or BLTOUCH probe."
  955. #elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  956. #error "SERVO3_PIN must be defined for your servo or BLTOUCH probe."
  957. #elif Z_PROBE_SERVO_NR >= NUM_SERVOS
  958. #error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS."
  959. #endif
  960. #endif
  961. #if ENABLED(RACK_AND_PINION_PROBE) && !(defined(Z_PROBE_DEPLOY_X) && defined(Z_PROBE_RETRACT_X))
  962. #error "RACK_AND_PINION_PROBE requires Z_PROBE_DEPLOY_X and Z_PROBE_RETRACT_X."
  963. #endif
  964. /**
  965. * Require pin options and pins to be defined
  966. */
  967. #if ENABLED(SENSORLESS_PROBING)
  968. #if ENABLED(DELTA) && (!AXIS_DRIVER_TYPE_X(TMC2130) || !AXIS_DRIVER_TYPE_Y(TMC2130) || !AXIS_DRIVER_TYPE_Z(TMC2130))
  969. #error "SENSORLESS_PROBING requires TMC2130 drivers on X, Y, and Z."
  970. #elif !AXIS_DRIVER_TYPE_Z(TMC2130)
  971. #error "SENSORLESS_PROBING requires a TMC2130 driver on Z."
  972. #endif
  973. #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  974. #if DISABLED(USE_ZMIN_PLUG)
  975. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled."
  976. #elif !HAS_Z_MIN
  977. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined."
  978. #elif Z_MIN_PROBE_ENDSTOP_INVERTING != Z_MIN_ENDSTOP_INVERTING
  979. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING."
  980. #endif
  981. #elif !HAS_Z_MIN_PROBE_PIN
  982. #error "Z_MIN_PROBE_PIN must be defined if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN is not enabled."
  983. #endif
  984. /**
  985. * Make sure Z raise values are set
  986. */
  987. #ifndef Z_CLEARANCE_DEPLOY_PROBE
  988. #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration."
  989. #elif !defined(Z_CLEARANCE_BETWEEN_PROBES)
  990. #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration."
  991. #elif Z_CLEARANCE_DEPLOY_PROBE < 0
  992. #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0."
  993. #elif Z_CLEARANCE_BETWEEN_PROBES < 0
  994. #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
  995. #elif Z_AFTER_PROBING < 0
  996. #error "Probes need Z_AFTER_PROBING >= 0."
  997. #endif
  998. #if MULTIPLE_PROBING && MULTIPLE_PROBING < 2
  999. #error "MULTIPLE_PROBING must be >= 2."
  1000. #endif
  1001. #if Z_PROBE_LOW_POINT > 0
  1002. #error "Z_PROBE_LOW_POINT must be less than or equal to 0."
  1003. #endif
  1004. #else
  1005. /**
  1006. * Require some kind of probe for bed leveling and probe testing
  1007. */
  1008. #if HAS_ABL_NOT_UBL && !PROBE_SELECTED
  1009. #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."
  1010. #endif
  1011. #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
  1012. #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."
  1013. #endif
  1014. #endif
  1015. /**
  1016. * Allow only one bed leveling option to be defined
  1017. */
  1018. #if 1 < 0 \
  1019. + ENABLED(AUTO_BED_LEVELING_LINEAR) \
  1020. + ENABLED(AUTO_BED_LEVELING_3POINT) \
  1021. + ENABLED(AUTO_BED_LEVELING_BILINEAR) \
  1022. + ENABLED(AUTO_BED_LEVELING_UBL) \
  1023. + ENABLED(MESH_BED_LEVELING)
  1024. #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."
  1025. #endif
  1026. /**
  1027. * Bed Leveling Requirements
  1028. */
  1029. #if EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT)
  1030. static_assert(WITHIN(PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_1_X is outside the probe region.");
  1031. static_assert(WITHIN(PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_2_X is outside the probe region.");
  1032. static_assert(WITHIN(PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_3_X is outside the probe region.");
  1033. static_assert(WITHIN(PROBE_PT_1_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_1_Y is outside the probe region.");
  1034. static_assert(WITHIN(PROBE_PT_2_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_2_Y is outside the probe region.");
  1035. static_assert(WITHIN(PROBE_PT_3_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_3_Y is outside the probe region.");
  1036. #endif
  1037. #if ENABLED(AUTO_BED_LEVELING_UBL)
  1038. /**
  1039. * Unified Bed Leveling
  1040. */
  1041. // Hide PROBE_MANUALLY from the rest of the code
  1042. #undef PROBE_MANUALLY
  1043. #if IS_SCARA
  1044. #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
  1045. #elif DISABLED(EEPROM_SETTINGS)
  1046. #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration."
  1047. #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
  1048. #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
  1049. #elif !defined(RESTORE_LEVELING_AFTER_G28)
  1050. #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'."
  1051. #endif
  1052. #elif HAS_ABL_NOT_UBL
  1053. /**
  1054. * Auto Bed Leveling
  1055. */
  1056. /**
  1057. * Delta and SCARA have limited bed leveling options
  1058. */
  1059. #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR)
  1060. #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option."
  1061. #endif
  1062. /**
  1063. * Check auto bed leveling probe points
  1064. */
  1065. #if ABL_GRID
  1066. static_assert(LEFT_PROBE_BED_POSITION < RIGHT_PROBE_BED_POSITION, "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION.");
  1067. static_assert(FRONT_PROBE_BED_POSITION < BACK_PROBE_BED_POSITION, "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION.");
  1068. static_assert(LEFT_PROBE_BED_POSITION >= MIN_PROBE_X, "LEFT_PROBE_BED_POSITION is outside the probe region.");
  1069. static_assert(RIGHT_PROBE_BED_POSITION <= MAX_PROBE_X, "RIGHT_PROBE_BED_POSITION is outside the probe region.");
  1070. static_assert(FRONT_PROBE_BED_POSITION >= MIN_PROBE_Y, "FRONT_PROBE_BED_POSITION is outside the probe region.");
  1071. static_assert(BACK_PROBE_BED_POSITION <= MAX_PROBE_Y, "BACK_PROBE_BED_POSITION is outside the probe region.");
  1072. #endif
  1073. #elif ENABLED(MESH_BED_LEVELING)
  1074. // Hide PROBE_MANUALLY from the rest of the code
  1075. #undef PROBE_MANUALLY
  1076. /**
  1077. * Mesh Bed Leveling
  1078. */
  1079. #if ENABLED(DELTA)
  1080. #error "MESH_BED_LEVELING is not compatible with DELTA printers."
  1081. #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9
  1082. #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
  1083. #endif
  1084. #endif
  1085. #if HAS_MESH
  1086. #if DISABLED(JUNCTION_DEVIATION)
  1087. static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
  1088. #endif
  1089. #elif ENABLED(G26_MESH_VALIDATION)
  1090. #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
  1091. #endif
  1092. #if ENABLED(MESH_EDIT_GFX_OVERLAY) && (DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(DOGLCD))
  1093. #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD."
  1094. #endif
  1095. #if ENABLED(G29_RETRY_AND_RECOVER)
  1096. #if ENABLED(AUTO_BED_LEVELING_UBL)
  1097. #error "G29_RETRY_AND_RECOVER is not compatible with UBL."
  1098. #elif ENABLED(MESH_BED_LEVELING)
  1099. #error "G29_RETRY_AND_RECOVER is not compatible with MESH_BED_LEVELING."
  1100. #endif
  1101. #endif
  1102. /**
  1103. * LCD_BED_LEVELING requirements
  1104. */
  1105. #if ENABLED(LCD_BED_LEVELING)
  1106. #if !HAS_LCD_MENU
  1107. #error "LCD_BED_LEVELING requires a programmable LCD controller."
  1108. #elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL)
  1109. #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
  1110. #endif
  1111. #endif
  1112. /**
  1113. * Homing
  1114. */
  1115. #if X_HOME_BUMP_MM < 0 || Y_HOME_BUMP_MM < 0 || Z_HOME_BUMP_MM < 0
  1116. #error "[XYZ]_HOME_BUMP_MM must be greater than or equal to 0."
  1117. #endif
  1118. #if ENABLED(CODEPENDENT_XY_HOMING)
  1119. #if ENABLED(QUICK_HOME)
  1120. #error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING."
  1121. #elif IS_KINEMATIC
  1122. #error "CODEPENDENT_XY_HOMING requires a Cartesian setup."
  1123. #endif
  1124. #endif
  1125. /**
  1126. * Make sure Z_SAFE_HOMING point is reachable
  1127. */
  1128. #if ENABLED(Z_SAFE_HOMING)
  1129. #if HAS_BED_PROBE
  1130. static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, MIN_PROBE_X, MAX_PROBE_X), "Z_SAFE_HOMING_X_POINT is outside the probe region.");
  1131. static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, MIN_PROBE_Y, MAX_PROBE_Y), "Z_SAFE_HOMING_Y_POINT is outside the probe region.");
  1132. #else
  1133. 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.");
  1134. 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.");
  1135. #endif
  1136. #endif // Z_SAFE_HOMING
  1137. /**
  1138. * Make sure DISABLE_[XYZ] compatible with selected homing options
  1139. */
  1140. #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z)
  1141. #if EITHER(HOME_AFTER_DEACTIVATE, Z_SAFE_HOMING)
  1142. #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
  1143. #endif
  1144. #endif
  1145. /**
  1146. * Filament Width Sensor
  1147. */
  1148. #if ENABLED(FILAMENT_WIDTH_SENSOR)
  1149. #if !HAS_FILAMENT_WIDTH_SENSOR
  1150. #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
  1151. #elif ENABLED(NO_VOLUMETRICS)
  1152. #error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled."
  1153. #endif
  1154. #endif
  1155. /**
  1156. * ULTIPANEL encoder
  1157. */
  1158. #if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL, SR_LCD_2W_NL) && !defined(SHIFT_CLK)
  1159. #error "ULTIPANEL requires some kind of encoder."
  1160. #endif
  1161. #if ENCODER_PULSES_PER_STEP < 0
  1162. #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead."
  1163. #endif
  1164. /**
  1165. * SAV_3DGLCD display options
  1166. */
  1167. #if ENABLED(SAV_3DGLCD)
  1168. #if DISABLED(U8GLIB_SSD1306, U8GLIB_SH1106)
  1169. #error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
  1170. #elif BOTH(U8GLIB_SSD1306, U8GLIB_SH1106)
  1171. #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
  1172. #endif
  1173. #endif
  1174. /**
  1175. * Allen Key
  1176. * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
  1177. */
  1178. #if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  1179. #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY"
  1180. #endif
  1181. /**
  1182. * Dual X Carriage requirements
  1183. */
  1184. #if ENABLED(DUAL_X_CARRIAGE)
  1185. #if EXTRUDERS == 1
  1186. #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
  1187. #elif CORE_IS_XY || CORE_IS_XZ
  1188. #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, or COREZX."
  1189. #elif !(HAS_X2_ENABLE && HAS_X2_STEP && HAS_X2_DIR)
  1190. #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
  1191. #elif !HAS_X_MAX
  1192. #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop."
  1193. #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
  1194. #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
  1195. #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1
  1196. #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1."
  1197. #endif
  1198. #endif // DUAL_X_CARRIAGE
  1199. /**
  1200. * Make sure auto fan pins don't conflict with the fan pin
  1201. */
  1202. #if HAS_AUTO_FAN
  1203. #if HAS_FAN0
  1204. #if E0_AUTO_FAN_PIN == FAN_PIN
  1205. #error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
  1206. #elif E1_AUTO_FAN_PIN == FAN_PIN
  1207. #error "You cannot set E1_AUTO_FAN_PIN equal to FAN_PIN."
  1208. #elif E2_AUTO_FAN_PIN == FAN_PIN
  1209. #error "You cannot set E2_AUTO_FAN_PIN equal to FAN_PIN."
  1210. #elif E3_AUTO_FAN_PIN == FAN_PIN
  1211. #error "You cannot set E3_AUTO_FAN_PIN equal to FAN_PIN."
  1212. #endif
  1213. #endif
  1214. #endif
  1215. #if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN
  1216. #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."
  1217. #endif
  1218. #if ENABLED(USE_CONTROLLER_FAN)
  1219. #if !HAS_CONTROLLER_FAN
  1220. #error "USE_CONTROLLER_FAN requires a CONTROLLER_FAN_PIN. Define in Configuration_adv.h."
  1221. #elif E0_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1222. #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1223. #elif E1_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1224. #error "You cannot set E1_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1225. #elif E2_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1226. #error "You cannot set E2_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1227. #elif E3_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1228. #error "You cannot set E3_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1229. #endif
  1230. #endif
  1231. /**
  1232. * Test case light not using the same pin as the fan
  1233. */
  1234. #if ENABLED(CASE_LIGHT_ENABLE) && CASE_LIGHT_PIN == FAN_PIN
  1235. #error "You cannot set CASE_LIGHT_PIN equal to FAN_PIN."
  1236. #endif
  1237. /**
  1238. * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set.
  1239. */
  1240. #if !HAS_HEATER_0
  1241. #error "HEATER_0_PIN not defined for this board."
  1242. #elif !ANY_PIN(TEMP_0, MAX6675_SS)
  1243. #error "TEMP_0_PIN not defined for this board."
  1244. #elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && !PIN_EXISTS(E0_STEP, E0_DIR))
  1245. #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
  1246. #elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP, E0_DIR) || !HAS_E0_ENABLE))
  1247. #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
  1248. #elif TEMP_SENSOR_0 == 0
  1249. #error "TEMP_SENSOR_0 is required."
  1250. #endif
  1251. // Pins are required for heaters
  1252. #if ENABLED(HEATER_0_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS)
  1253. #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board."
  1254. #elif (HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)) && !HAS_HEATER_1
  1255. #error "HEATER_1_PIN not defined for this board."
  1256. #endif
  1257. #if HOTENDS > 1
  1258. #if ENABLED(HEATER_1_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS2)
  1259. #error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board."
  1260. #elif TEMP_SENSOR_1 == 0
  1261. #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
  1262. #elif !ANY_PIN(TEMP_1, MAX6675_SS2)
  1263. #error "TEMP_1_PIN not defined for this board."
  1264. #endif
  1265. #if HOTENDS > 2
  1266. #if TEMP_SENSOR_2 == 0
  1267. #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
  1268. #elif !HAS_HEATER_2
  1269. #error "HEATER_2_PIN not defined for this board."
  1270. #elif !PIN_EXISTS(TEMP_2)
  1271. #error "TEMP_2_PIN not defined for this board."
  1272. #endif
  1273. #if HOTENDS > 3
  1274. #if TEMP_SENSOR_3 == 0
  1275. #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
  1276. #elif !HAS_HEATER_3
  1277. #error "HEATER_3_PIN not defined for this board."
  1278. #elif !PIN_EXISTS(TEMP_3)
  1279. #error "TEMP_3_PIN not defined for this board."
  1280. #endif
  1281. #if HOTENDS > 4
  1282. #if TEMP_SENSOR_4 == 0
  1283. #error "TEMP_SENSOR_4 is required with 5 or more HOTENDS."
  1284. #elif !HAS_HEATER_4
  1285. #error "HEATER_4_PIN not defined for this board."
  1286. #elif !PIN_EXISTS(TEMP_4)
  1287. #error "TEMP_4_PIN not defined for this board."
  1288. #endif
  1289. #if HOTENDS > 5
  1290. #if TEMP_SENSOR_5 == 0
  1291. #error "TEMP_SENSOR_5 is required with 6 HOTENDS."
  1292. #elif !HAS_HEATER_5
  1293. #error "HEATER_5_PIN not defined for this board."
  1294. #elif !PIN_EXISTS(TEMP_5)
  1295. #error "TEMP_5_PIN not defined for this board."
  1296. #endif
  1297. #elif TEMP_SENSOR_5 != 0
  1298. #error "TEMP_SENSOR_5 shouldn't be set with only 5 HOTENDS."
  1299. #endif
  1300. #elif TEMP_SENSOR_4 != 0
  1301. #error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS."
  1302. #elif TEMP_SENSOR_5 != 0
  1303. #error "TEMP_SENSOR_5 shouldn't be set with only 4 HOTENDS."
  1304. #endif
  1305. #elif TEMP_SENSOR_3 != 0
  1306. #error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS."
  1307. #elif TEMP_SENSOR_4 != 0
  1308. #error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS."
  1309. #elif TEMP_SENSOR_5 != 0
  1310. #error "TEMP_SENSOR_5 shouldn't be set with only 3 HOTENDS."
  1311. #endif
  1312. #elif TEMP_SENSOR_2 != 0
  1313. #error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS."
  1314. #elif TEMP_SENSOR_3 != 0
  1315. #error "TEMP_SENSOR_3 shouldn't be set with only 2 HOTENDS."
  1316. #elif TEMP_SENSOR_4 != 0
  1317. #error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS."
  1318. #elif TEMP_SENSOR_5 != 0
  1319. #error "TEMP_SENSOR_5 shouldn't be set with only 2 HOTENDS."
  1320. #endif
  1321. #elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  1322. #error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND."
  1323. #elif TEMP_SENSOR_2 != 0
  1324. #error "TEMP_SENSOR_2 shouldn't be set with only 1 HOTEND."
  1325. #elif TEMP_SENSOR_3 != 0
  1326. #error "TEMP_SENSOR_3 shouldn't be set with only 1 HOTEND."
  1327. #elif TEMP_SENSOR_4 != 0
  1328. #error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND."
  1329. #elif TEMP_SENSOR_5 != 0
  1330. #error "TEMP_SENSOR_5 shouldn't be set with only 1 HOTEND."
  1331. #endif
  1332. #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0
  1333. #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
  1334. #endif
  1335. /**
  1336. * Temperature status LEDs
  1337. */
  1338. #if ENABLED(TEMP_STAT_LEDS) && !ANY_PIN(STAT_LED_RED, STAT_LED_BLUE)
  1339. #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both."
  1340. #endif
  1341. /**
  1342. * LED Control Menu
  1343. */
  1344. #if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS
  1345. #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9533, PCA9632, or NEOPIXEL_LED."
  1346. #endif
  1347. /**
  1348. * Basic multi hotend duplication mode
  1349. */
  1350. #if ENABLED(MULTI_NOZZLE_DUPLICATION)
  1351. #if HOTENDS < 2
  1352. #error "MULTI_NOZZLE_DUPLICATION requires 2 or more hotends."
  1353. #elif ENABLED(DUAL_X_CARRIAGE)
  1354. #error "MULTI_NOZZLE_DUPLICATION is incompatible with DUAL_X_CARRIAGE."
  1355. #elif ENABLED(SINGLENOZZLE)
  1356. #error "MULTI_NOZZLE_DUPLICATION is incompatible with SINGLENOZZLE."
  1357. #elif ENABLED(MIXING_EXTRUDER)
  1358. #error "MULTI_NOZZLE_DUPLICATION is incompatible with MIXING_EXTRUDER."
  1359. #elif ENABLED(SWITCHING_EXTRUDER)
  1360. #error "MULTI_NOZZLE_DUPLICATION is incompatible with SWITCHING_EXTRUDER."
  1361. #endif
  1362. #endif
  1363. /**
  1364. * Test Extruder Stepper Pins
  1365. */
  1366. #if DISABLED(MK2_MULTIPLEXER) // MK2_MULTIPLEXER uses E0 stepper only
  1367. #if E_STEPPERS
  1368. #if !(PIN_EXISTS(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
  1369. #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
  1370. #endif
  1371. #if E_STEPPERS > 1
  1372. #if !(PIN_EXISTS(E1_STEP, E1_DIR) && HAS_E1_ENABLE)
  1373. #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
  1374. #endif
  1375. #if E_STEPPERS > 2
  1376. #if !(PIN_EXISTS(E2_STEP, E2_DIR) && HAS_E2_ENABLE)
  1377. #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
  1378. #endif
  1379. #if E_STEPPERS > 3
  1380. #if !(PIN_EXISTS(E3_STEP, E3_DIR) && HAS_E3_ENABLE)
  1381. #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
  1382. #endif
  1383. #if E_STEPPERS > 4
  1384. #if !(PIN_EXISTS(E4_STEP, E4_DIR) && HAS_E4_ENABLE)
  1385. #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
  1386. #endif
  1387. #if E_STEPPERS > 5
  1388. #if !(PIN_EXISTS(E5_STEP, E5_DIR) && HAS_E5_ENABLE)
  1389. #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
  1390. #endif
  1391. #endif // E_STEPPERS > 5
  1392. #endif // E_STEPPERS > 4
  1393. #endif // E_STEPPERS > 3
  1394. #endif // E_STEPPERS > 2
  1395. #endif // E_STEPPERS > 1
  1396. #endif // E_STEPPERS
  1397. #endif
  1398. /**
  1399. * Endstop Tests
  1400. */
  1401. #define _PLUG_UNUSED_TEST(AXIS,PLUG) (DISABLED(USE_##PLUG##MIN_PLUG, USE_##PLUG##MAX_PLUG) && !(ENABLED(AXIS##_DUAL_ENDSTOPS) && WITHIN(AXIS##2_USE_ENDSTOP, _##PLUG##MAX_, _##PLUG##MIN_)))
  1402. #define _AXIS_PLUG_UNUSED_TEST(AXIS) (_PLUG_UNUSED_TEST(AXIS,X) && _PLUG_UNUSED_TEST(AXIS,Y) && _PLUG_UNUSED_TEST(AXIS,Z))
  1403. // At least 3 endstop plugs must be used
  1404. #if _AXIS_PLUG_UNUSED_TEST(X)
  1405. #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG."
  1406. #endif
  1407. #if _AXIS_PLUG_UNUSED_TEST(Y)
  1408. #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG."
  1409. #endif
  1410. #if _AXIS_PLUG_UNUSED_TEST(Z)
  1411. #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG."
  1412. #endif
  1413. // Delta and Cartesian use 3 homing endstops
  1414. #if !IS_SCARA
  1415. #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG)
  1416. #error "Enable USE_XMIN_PLUG when homing X to MIN."
  1417. #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG)
  1418. #error "Enable USE_XMAX_PLUG when homing X to MAX."
  1419. #elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG)
  1420. #error "Enable USE_YMIN_PLUG when homing Y to MIN."
  1421. #elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG)
  1422. #error "Enable USE_YMAX_PLUG when homing Y to MAX."
  1423. #endif
  1424. #endif
  1425. #if Z_HOME_DIR < 0 && DISABLED(USE_ZMIN_PLUG)
  1426. #error "Enable USE_ZMIN_PLUG when homing Z to MIN."
  1427. #elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG)
  1428. #error "Enable USE_ZMAX_PLUG when homing Z to MAX."
  1429. #endif
  1430. // Dual endstops requirements
  1431. #if ENABLED(X_DUAL_ENDSTOPS)
  1432. #if !X2_USE_ENDSTOP
  1433. #error "You must set X2_USE_ENDSTOP with X_DUAL_ENDSTOPS."
  1434. #elif X2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1435. #error "USE_XMIN_PLUG is required when X2_USE_ENDSTOP is _XMIN_."
  1436. #elif X2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1437. #error "USE_XMAX_PLUG is required when X2_USE_ENDSTOP is _XMAX_."
  1438. #elif X2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1439. #error "USE_YMIN_PLUG is required when X2_USE_ENDSTOP is _YMIN_."
  1440. #elif X2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1441. #error "USE_YMAX_PLUG is required when X2_USE_ENDSTOP is _YMAX_."
  1442. #elif X2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1443. #error "USE_ZMIN_PLUG is required when X2_USE_ENDSTOP is _ZMIN_."
  1444. #elif X2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1445. #error "USE_ZMAX_PLUG is required when X2_USE_ENDSTOP is _ZMAX_."
  1446. #elif !HAS_X2_MIN && !HAS_X2_MAX
  1447. #error "X2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1448. #elif ENABLED(DELTA)
  1449. #error "X_DUAL_ENDSTOPS is not compatible with DELTA."
  1450. #endif
  1451. #endif
  1452. #if ENABLED(Y_DUAL_ENDSTOPS)
  1453. #if !Y2_USE_ENDSTOP
  1454. #error "You must set Y2_USE_ENDSTOP with Y_DUAL_ENDSTOPS."
  1455. #elif Y2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1456. #error "USE_XMIN_PLUG is required when Y2_USE_ENDSTOP is _XMIN_."
  1457. #elif Y2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1458. #error "USE_XMAX_PLUG is required when Y2_USE_ENDSTOP is _XMAX_."
  1459. #elif Y2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1460. #error "USE_YMIN_PLUG is required when Y2_USE_ENDSTOP is _YMIN_."
  1461. #elif Y2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1462. #error "USE_YMAX_PLUG is required when Y2_USE_ENDSTOP is _YMAX_."
  1463. #elif Y2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1464. #error "USE_ZMIN_PLUG is required when Y2_USE_ENDSTOP is _ZMIN_."
  1465. #elif Y2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1466. #error "USE_ZMAX_PLUG is required when Y2_USE_ENDSTOP is _ZMAX_."
  1467. #elif !HAS_Y2_MIN && !HAS_Y2_MAX
  1468. #error "Y2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1469. #elif ENABLED(DELTA)
  1470. #error "Y_DUAL_ENDSTOPS is not compatible with DELTA."
  1471. #endif
  1472. #endif
  1473. #if ENABLED(Z_DUAL_ENDSTOPS)
  1474. #if !Z2_USE_ENDSTOP
  1475. #error "You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS."
  1476. #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1477. #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_."
  1478. #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1479. #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_."
  1480. #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1481. #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_."
  1482. #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1483. #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_."
  1484. #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1485. #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_."
  1486. #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1487. #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_."
  1488. #elif !HAS_Z2_MIN && !HAS_Z2_MAX
  1489. #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1490. #elif ENABLED(DELTA)
  1491. #error "Z_DUAL_ENDSTOPS is not compatible with DELTA."
  1492. #endif
  1493. #endif
  1494. #if ENABLED(Z_TRIPLE_ENDSTOPS)
  1495. #if !Z2_USE_ENDSTOP
  1496. #error "You must set Z2_USE_ENDSTOP with Z_TRIPLE_ENDSTOPS."
  1497. #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1498. #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_."
  1499. #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1500. #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_."
  1501. #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1502. #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_."
  1503. #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1504. #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_."
  1505. #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1506. #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_."
  1507. #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1508. #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_."
  1509. #elif !HAS_Z2_MIN && !HAS_Z2_MAX
  1510. #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1511. #elif ENABLED(DELTA)
  1512. #error "Z_TRIPLE_ENDSTOPS is not compatible with DELTA."
  1513. #endif
  1514. #if !Z3_USE_ENDSTOP
  1515. #error "You must set Z3_USE_ENDSTOP with Z_TRIPLE_ENDSTOPS."
  1516. #elif Z3_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1517. #error "USE_XMIN_PLUG is required when Z3_USE_ENDSTOP is _XMIN_."
  1518. #elif Z3_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1519. #error "USE_XMAX_PLUG is required when Z3_USE_ENDSTOP is _XMAX_."
  1520. #elif Z3_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1521. #error "USE_YMIN_PLUG is required when Z3_USE_ENDSTOP is _YMIN_."
  1522. #elif Z3_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1523. #error "USE_YMAX_PLUG is required when Z3_USE_ENDSTOP is _YMAX_."
  1524. #elif Z3_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1525. #error "USE_ZMIN_PLUG is required when Z3_USE_ENDSTOP is _ZMIN_."
  1526. #elif Z3_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1527. #error "USE_ZMAX_PLUG is required when Z3_USE_ENDSTOP is _ZMAX_."
  1528. #elif !HAS_Z3_MIN && !HAS_Z3_MAX
  1529. #error "Z3_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1530. #elif ENABLED(DELTA)
  1531. #error "Z_TRIPLE_ENDSTOPS is not compatible with DELTA."
  1532. #endif
  1533. #endif
  1534. #if defined(ENDSTOP_NOISE_THRESHOLD) && !WITHIN(ENDSTOP_NOISE_THRESHOLD, 2, 7)
  1535. #error "ENDSTOP_NOISE_THRESHOLD must be an integer from 2 to 7."
  1536. #endif
  1537. /**
  1538. * emergency-command parser
  1539. */
  1540. #if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON)
  1541. #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
  1542. #endif
  1543. /**
  1544. * I2C bus
  1545. */
  1546. #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0
  1547. #if I2C_SLAVE_ADDRESS < 8
  1548. #error "I2C_SLAVE_ADDRESS can't be less than 8. (Addresses 0 - 7 are reserved.)"
  1549. #elif I2C_SLAVE_ADDRESS > 127
  1550. #error "I2C_SLAVE_ADDRESS can't be over 127. (Only 7 bits allowed.)"
  1551. #endif
  1552. #endif
  1553. /**
  1554. * G38 Probe Target
  1555. */
  1556. #if ENABLED(G38_PROBE_TARGET)
  1557. #if !HAS_BED_PROBE
  1558. #error "G38_PROBE_TARGET requires a bed probe."
  1559. #elif !IS_CARTESIAN
  1560. #error "G38_PROBE_TARGET requires a Cartesian machine."
  1561. #endif
  1562. #endif
  1563. /**
  1564. * RGB_LED Requirements
  1565. */
  1566. #define _RGB_TEST (PIN_EXISTS(RGB_LED_R, RGB_LED_G, RGB_LED_B))
  1567. #if ENABLED(PRINTER_EVENT_LEDS) && !HAS_COLOR_LEDS
  1568. #error "PRINTER_EVENT_LEDS requires BLINKM, PCA9533, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED."
  1569. #elif ENABLED(RGB_LED)
  1570. #if !_RGB_TEST
  1571. #error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN."
  1572. #elif ENABLED(RGBW_LED)
  1573. #error "Please enable only one of RGB_LED and RGBW_LED."
  1574. #endif
  1575. #elif ENABLED(RGBW_LED)
  1576. #if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W))
  1577. #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN."
  1578. #endif
  1579. #elif ENABLED(NEOPIXEL_LED)
  1580. #if !(PIN_EXISTS(NEOPIXEL) && NEOPIXEL_PIXELS > 0)
  1581. #error "NEOPIXEL_LED requires NEOPIXEL_PIN and NEOPIXEL_PIXELS."
  1582. #endif
  1583. #endif
  1584. /**
  1585. * Auto Fan check for PWM pins
  1586. */
  1587. #if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255
  1588. #define AF_ERR_SUFF "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255."
  1589. #if HAS_AUTO_FAN_0
  1590. static_assert(PWM_PIN(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF);
  1591. #elif HAS_AUTO_FAN_1
  1592. static_assert(PWM_PIN(E1_AUTO_FAN_PIN), "E1" AF_ERR_SUFF);
  1593. #elif HAS_AUTO_FAN_2
  1594. static_assert(PWM_PIN(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF);
  1595. #elif HAS_AUTO_FAN_3
  1596. static_assert(PWM_PIN(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF);
  1597. #endif
  1598. #endif
  1599. /**
  1600. * Make sure only one display is enabled
  1601. *
  1602. * Note: BQ_LCD_SMART_CONTROLLER => REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  1603. * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER => REPRAP_DISCOUNT_SMART_CONTROLLER
  1604. * SAV_3DGLCD => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
  1605. * MKS_12864OLED => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
  1606. * MKS_12864OLED_SSD1306 => U8GLIB_SSD1306 => ULTIMAKERCONTROLLER
  1607. * MKS_MINI_12864 => MINIPANEL
  1608. * miniVIKI => ULTIMAKERCONTROLLER
  1609. * VIKI2 => ULTIMAKERCONTROLLER
  1610. * ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER
  1611. * AZSMZ_12864 => ULTIMAKERCONTROLLER
  1612. * PANEL_ONE => ULTIMAKERCONTROLLER
  1613. */
  1614. #if 1 < 0 \
  1615. + ( ENABLED(ULTIMAKERCONTROLLER) \
  1616. && DISABLED(SAV_3DGLCD) \
  1617. && DISABLED(miniVIKI) \
  1618. && DISABLED(VIKI2) \
  1619. && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  1620. && DISABLED(AZSMZ_12864) \
  1621. && DISABLED(PANEL_ONE) \
  1622. && DISABLED(MKS_12864OLED) \
  1623. && DISABLED(MKS_12864OLED_SSD1306) ) \
  1624. + ( ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
  1625. && DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
  1626. && DISABLED(LCD_FOR_MELZI) \
  1627. && DISABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
  1628. && DISABLED(MKS_12864OLED) \
  1629. && DISABLED(MKS_12864OLED_SSD1306) ) \
  1630. + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(BQ_LCD_SMART_CONTROLLER)) \
  1631. + ENABLED(LCD_FOR_MELZI) \
  1632. + ENABLED(MALYAN_LCD) \
  1633. + ENABLED(MKS_12864OLED) \
  1634. + ENABLED(MKS_12864OLED_SSD1306) \
  1635. + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
  1636. + ENABLED(CARTESIO_UI) \
  1637. + ENABLED(PANEL_ONE) \
  1638. + ENABLED(MAKRPANEL) \
  1639. + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \
  1640. + ENABLED(VIKI2) \
  1641. + ENABLED(miniVIKI) \
  1642. + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  1643. + ENABLED(AZSMZ_12864) \
  1644. + ENABLED(G3D_PANEL) \
  1645. + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \
  1646. + ENABLED(MKS_MINI_12864) \
  1647. + ENABLED(FYSETC_MINI_12864_1_2) \
  1648. + ENABLED(FYSETC_MINI_12864_2_0) \
  1649. + ENABLED(FYSETC_MINI_12864_2_1) \
  1650. + (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(CARTESIO_UI, ZONESTAR_LCD)) \
  1651. + ENABLED(RIGIDBOT_PANEL) \
  1652. + ENABLED(RA_CONTROL_PANEL) \
  1653. + ENABLED(LCD_SAINSMART_I2C_1602) \
  1654. + ENABLED(LCD_SAINSMART_I2C_2004) \
  1655. + ENABLED(LCM1602) \
  1656. + ENABLED(LCD_I2C_PANELOLU2) \
  1657. + ENABLED(LCD_I2C_VIKI) \
  1658. + (ENABLED(U8GLIB_SSD1306) && DISABLED(OLED_PANEL_TINYBOY2, MKS_12864OLED_SSD1306)) \
  1659. + ENABLED(SAV_3DLCD) \
  1660. + ENABLED(BQ_LCD_SMART_CONTROLLER) \
  1661. + ENABLED(SAV_3DGLCD) \
  1662. + ENABLED(OLED_PANEL_TINYBOY2) \
  1663. + ENABLED(ZONESTAR_LCD) \
  1664. + ENABLED(ULTI_CONTROLLER) \
  1665. + (ENABLED(EXTENSIBLE_UI) && DISABLED(MALYAN_LCD))
  1666. #error "Please select no more than one LCD controller option."
  1667. #endif
  1668. /**
  1669. * FYSETC Mini 12864 RGB backlighting required
  1670. */
  1671. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED)
  1672. #error "RGB_LED is required for FYSETC_MINI_12864 1.2 and 2.0."
  1673. #elif EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && DISABLED(LED_USER_PRESET_STARTUP)
  1674. #error "LED_USER_PRESET_STARTUP is required for FYSETC_MINI_12864 2.x displays."
  1675. #elif ENABLED(FYSETC_MINI_12864_2_1)
  1676. #if DISABLED(NEOPIXEL_LED)
  1677. #error "NEOPIXEL_LED is required for FYSETC_MINI_12864 Rev. 2.1."
  1678. #elif NEOPIXEL_PIXELS != 3
  1679. #error "NEOPIXEL_PIXELS should be 3 for FYSETC_MINI_12864 Rev. 2.1."
  1680. #elif NEOPIXEL_BRIGHTNESS != 127
  1681. #error "NEOPIXEL_BRIGHTNESS should be 127 for FYSETC_MINI_12864 Rev. 2.1."
  1682. #else
  1683. #ifndef NEO_GRB
  1684. #define NEO_GRB 0xFAD
  1685. #define _UNDO_NEO_GRB
  1686. #endif
  1687. #if NEOPIXEL_TYPE != NEO_GRB
  1688. #error "NEOPIXEL_TYPE should be NEO_GRB for FYSETC_MINI_12864 Rev. 2.1."
  1689. #endif
  1690. #ifdef _UNDO_NEO_GRB
  1691. #undef NEO_GRB
  1692. #undef _UNDO_NEO_GRB
  1693. #endif
  1694. #endif
  1695. #endif
  1696. /**
  1697. * Check existing CS pins against enabled TMC SPI drivers.
  1698. */
  1699. #define INVALID_TMC2130(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) && !PIN_EXISTS(ST##_CS))
  1700. #if INVALID_TMC2130(X)
  1701. #error "TMC2130 on X requires X_CS_PIN."
  1702. #elif INVALID_TMC2130(X2)
  1703. #error "TMC2130 on X2 requires X2_CS_PIN."
  1704. #elif INVALID_TMC2130(Y)
  1705. #error "TMC2130 on Y requires Y_CS_PIN."
  1706. #elif INVALID_TMC2130(Y2)
  1707. #error "TMC2130 on Y2 requires Y2_CS_PIN."
  1708. #elif INVALID_TMC2130(Z)
  1709. #error "TMC2130 on Z requires Z_CS_PIN."
  1710. #elif INVALID_TMC2130(Z2)
  1711. #error "TMC2130 on Z2 requires Z2_CS_PIN."
  1712. #elif INVALID_TMC2130(Z3)
  1713. #error "TMC2130 on Z3 requires Z3_CS_PIN."
  1714. #elif INVALID_TMC2130(E0)
  1715. #error "TMC2130 on E0 requires E0_CS_PIN."
  1716. #elif INVALID_TMC2130(E1)
  1717. #error "TMC2130 on E1 requires E1_CS_PIN."
  1718. #elif INVALID_TMC2130(E2)
  1719. #error "TMC2130 on E2 requires E2_CS_PIN."
  1720. #elif INVALID_TMC2130(E3)
  1721. #error "TMC2130 on E3 requires E3_CS_PIN."
  1722. #elif INVALID_TMC2130(E4)
  1723. #error "TMC2130 on E4 requires E4_CS_PIN."
  1724. #elif INVALID_TMC2130(E5)
  1725. #error "TMC2130 on E5 requires E5_CS_PIN."
  1726. #endif
  1727. #undef INVALID_TMC2130
  1728. /**
  1729. * Check existing RX/TX pins against enable TMC UART drivers.
  1730. */
  1731. #define INVALID_TMC2208(ST) (AXIS_DRIVER_TYPE(ST, TMC2208) && !(defined(ST##_HARDWARE_SERIAL) || (PIN_EXISTS(ST##_SERIAL_RX, ST##_SERIAL_TX))))
  1732. #if INVALID_TMC2208(X)
  1733. #error "TMC2208 on X requires X_HARDWARE_SERIAL or X_SERIAL_(RX|TX)_PIN."
  1734. #elif INVALID_TMC2208(X2)
  1735. #error "TMC2208 on X2 requires X2_HARDWARE_SERIAL or X2_SERIAL_(RX|TX)_PIN."
  1736. #elif INVALID_TMC2208(Y)
  1737. #error "TMC2208 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL_(RX|TX)_PIN."
  1738. #elif INVALID_TMC2208(Y2)
  1739. #error "TMC2208 on Y2 requires Y2_HARDWARE_SERIAL or Y2_SERIAL_(RX|TX)_PIN."
  1740. #elif INVALID_TMC2208(Z)
  1741. #error "TMC2208 on Z requires Z_HARDWARE_SERIAL or Z_SERIAL_(RX|TX)_PIN."
  1742. #elif INVALID_TMC2208(Z2)
  1743. #error "TMC2208 on Z2 requires Z2_HARDWARE_SERIAL or Z2_SERIAL_(RX|TX)_PIN."
  1744. #elif INVALID_TMC2208(Z3)
  1745. #error "TMC2208 on Z3 requires Z3_HARDWARE_SERIAL or Z3_SERIAL_(RX|TX)_PIN."
  1746. #elif INVALID_TMC2208(E0)
  1747. #error "TMC2208 on E0 requires E0_HARDWARE_SERIAL or E0_SERIAL_(RX|TX)_PIN."
  1748. #elif INVALID_TMC2208(E1)
  1749. #error "TMC2208 on E1 requires E1_HARDWARE_SERIAL or E1_SERIAL_(RX|TX)_PIN."
  1750. #elif INVALID_TMC2208(E2)
  1751. #error "TMC2208 on E2 requires E2_HARDWARE_SERIAL or E2_SERIAL_(RX|TX)_PIN."
  1752. #elif INVALID_TMC2208(E3)
  1753. #error "TMC2208 on E3 requires E3_HARDWARE_SERIAL or E3_SERIAL_(RX|TX)_PIN."
  1754. #elif INVALID_TMC2208(E4)
  1755. #error "TMC2208 on E4 requires E4_HARDWARE_SERIAL or E4_SERIAL_(RX|TX)_PIN."
  1756. #elif INVALID_TMC2208(E5)
  1757. #error "TMC2208 on E5 requires E5_HARDWARE_SERIAL or E5_SERIAL_(RX|TX)_PIN."
  1758. #endif
  1759. #undef INVALID_TMC2208
  1760. /**
  1761. * TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI)
  1762. */
  1763. #if HAS_DRIVER(TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \
  1764. defined(X_HARDWARE_SERIAL ) \
  1765. || defined(X2_HARDWARE_SERIAL) \
  1766. || defined(Y_HARDWARE_SERIAL ) \
  1767. || defined(Y2_HARDWARE_SERIAL) \
  1768. || defined(Z_HARDWARE_SERIAL ) \
  1769. || defined(Z2_HARDWARE_SERIAL) \
  1770. || defined(Z3_HARDWARE_SERIAL) \
  1771. || defined(E0_HARDWARE_SERIAL) \
  1772. || defined(E1_HARDWARE_SERIAL) \
  1773. || defined(E2_HARDWARE_SERIAL) \
  1774. || defined(E3_HARDWARE_SERIAL) \
  1775. || defined(E4_HARDWARE_SERIAL) \
  1776. || defined(E5_HARDWARE_SERIAL) )
  1777. #error "Select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE."
  1778. #endif
  1779. /**
  1780. * TMC2208 software UART is only supported on AVR
  1781. */
  1782. #if HAS_DRIVER(TMC2208) && !defined(__AVR__) && !defined(TARGET_LPC1768) && !( \
  1783. defined(X_HARDWARE_SERIAL ) \
  1784. || defined(X2_HARDWARE_SERIAL) \
  1785. || defined(Y_HARDWARE_SERIAL ) \
  1786. || defined(Y2_HARDWARE_SERIAL) \
  1787. || defined(Z_HARDWARE_SERIAL ) \
  1788. || defined(Z2_HARDWARE_SERIAL) \
  1789. || defined(E0_HARDWARE_SERIAL) \
  1790. || defined(E1_HARDWARE_SERIAL) \
  1791. || defined(E2_HARDWARE_SERIAL) \
  1792. || defined(E3_HARDWARE_SERIAL) \
  1793. || defined(E4_HARDWARE_SERIAL) \
  1794. || defined(E5_HARDWARE_SERIAL) )
  1795. #error "TMC2208 Software Serial is supported only on AVR and LPC1768 platforms."
  1796. #endif
  1797. #if ENABLED(SENSORLESS_HOMING)
  1798. // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop
  1799. // is necessary in order to reset the stallGuard indication between the initial movement of all three
  1800. // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of
  1801. // clearing the stallGuard activated status is found.
  1802. #if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z)
  1803. #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z."
  1804. #elif X_SENSORLESS && X_HOME_DIR == -1 && (!X_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMIN))
  1805. #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMIN when homing to X_MIN."
  1806. #elif X_SENSORLESS && X_HOME_DIR == 1 && (!X_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMAX))
  1807. #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMAX when homing to X_MAX."
  1808. #elif Y_SENSORLESS && Y_HOME_DIR == -1 && (!Y_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMIN))
  1809. #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMIN when homing to Y_MIN."
  1810. #elif Y_SENSORLESS && Y_HOME_DIR == 1 && (!Y_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMAX))
  1811. #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMAX when homing to Y_MAX."
  1812. #elif Z_SENSORLESS && Z_HOME_DIR == -1 && (!Z_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMIN))
  1813. #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMIN when homing to Z_MIN."
  1814. #elif Z_SENSORLESS && Z_HOME_DIR == 1 && (!Z_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMAX))
  1815. #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMAX when homing to Z_MAX."
  1816. #elif ENDSTOP_NOISE_THRESHOLD
  1817. #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD."
  1818. #endif
  1819. #endif
  1820. // Sensorless homing/probing requirements
  1821. #if ENABLED(SENSORLESS_HOMING) && !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS)
  1822. #error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, or Z axes."
  1823. #elif BOTH(SENSORLESS_PROBING, DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS)
  1824. #error "SENSORLESS_PROBING for DELTA requires TMC stepper drivers with StallGuard on X, Y, and Z axes."
  1825. #elif ENABLED(SENSORLESS_PROBING) && !Z_SENSORLESS
  1826. #error "SENSORLESS_PROBING requires a TMC stepper driver with StallGuard on Z."
  1827. #endif
  1828. // Sensorless homing is required for both combined steppers in an H-bot
  1829. #if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS
  1830. #error "CoreXY requires both X and Y to use sensorless homing if either does."
  1831. #elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS
  1832. #error "CoreXZ requires both X and Z to use sensorless homing if either does."
  1833. #elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS
  1834. #error "CoreYZ requires both Y and Z to use sensorless homing if either does."
  1835. #endif
  1836. // Other TMC feature requirements
  1837. #if ENABLED(HYBRID_THRESHOLD) && !STEALTHCHOP_ENABLED
  1838. #error "Enable STEALTHCHOP_(XY|Z|E) to use HYBRID_THRESHOLD."
  1839. #elif ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD
  1840. #error "SENSORLESS_HOMING requires TMC2130 or TMC2160 or TMC5160 stepper drivers."
  1841. #elif ENABLED(SENSORLESS_PROBING) && !HAS_STALLGUARD
  1842. #error "SENSORLESS_PROBING requires TMC2130 stepper drivers."
  1843. #elif STEALTHCHOP_ENABLED && !HAS_STEALTHCHOP
  1844. #error "STEALTHCHOP requires TMC2130 or TMC2160 or TMC2208 or TMC5160 stepper drivers."
  1845. #endif
  1846. #if ENABLED(DELTA) && (ENABLED(STEALTHCHOP_XY) != ENABLED(STEALTHCHOP_Z))
  1847. #error "STEALTHCHOP_XY and STEALTHCHOP_Z must be the same on DELTA."
  1848. #endif
  1849. /**
  1850. * Digipot requirement
  1851. */
  1852. #if ENABLED(DIGIPOT_MCP4018)
  1853. #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
  1854. || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)
  1855. #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined."
  1856. #endif
  1857. #endif
  1858. /**
  1859. * Check per-axis initializers for errors
  1860. */
  1861. constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT,
  1862. sanity_arr_2[] = DEFAULT_MAX_FEEDRATE,
  1863. sanity_arr_3[] = DEFAULT_MAX_ACCELERATION;
  1864. #define _ARR_TEST(N,I) (sanity_arr_##N[MIN(I,int(COUNT(sanity_arr_##N))-1)] > 0)
  1865. static_assert(COUNT(sanity_arr_1) >= XYZE, "DEFAULT_AXIS_STEPS_PER_UNIT requires X, Y, Z and E elements.");
  1866. 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?)");
  1867. static_assert( _ARR_TEST(1,0) && _ARR_TEST(1,1) && _ARR_TEST(1,2)
  1868. && _ARR_TEST(1,3) && _ARR_TEST(1,4) && _ARR_TEST(1,5)
  1869. && _ARR_TEST(1,6) && _ARR_TEST(1,7) && _ARR_TEST(1,8),
  1870. "DEFAULT_AXIS_STEPS_PER_UNIT values must be positive.");
  1871. static_assert(COUNT(sanity_arr_2) >= XYZE, "DEFAULT_MAX_FEEDRATE requires X, Y, Z and E elements.");
  1872. static_assert(COUNT(sanity_arr_2) <= XYZE_N, "DEFAULT_MAX_FEEDRATE has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)");
  1873. static_assert( _ARR_TEST(2,0) && _ARR_TEST(2,1) && _ARR_TEST(2,2)
  1874. && _ARR_TEST(2,3) && _ARR_TEST(2,4) && _ARR_TEST(2,5)
  1875. && _ARR_TEST(2,6) && _ARR_TEST(2,7) && _ARR_TEST(2,8),
  1876. "DEFAULT_MAX_FEEDRATE values must be positive.");
  1877. static_assert(COUNT(sanity_arr_3) >= XYZE, "DEFAULT_MAX_ACCELERATION requires X, Y, Z and E elements.");
  1878. static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)");
  1879. static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
  1880. && _ARR_TEST(3,3) && _ARR_TEST(3,4) && _ARR_TEST(3,5)
  1881. && _ARR_TEST(3,6) && _ARR_TEST(3,7) && _ARR_TEST(3,8),
  1882. "DEFAULT_MAX_ACCELERATION values must be positive.");
  1883. #undef _ARR_TEST
  1884. #if BOTH(CNC_COORDINATE_SYSTEMS, NO_WORKSPACE_OFFSETS)
  1885. #error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS."
  1886. #endif
  1887. #if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE)
  1888. #error "BLOCK_BUFFER_SIZE must be a power of 2."
  1889. #endif
  1890. #if ENABLED(LED_CONTROL_MENU) && DISABLED(ULTIPANEL)
  1891. #error "LED_CONTROL_MENU requires an LCD controller."
  1892. #endif
  1893. #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED)
  1894. #error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED."
  1895. #endif
  1896. #if ENABLED(SKEW_CORRECTION)
  1897. #if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD))
  1898. #error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD."
  1899. #endif
  1900. #if ENABLED(SKEW_CORRECTION_FOR_Z)
  1901. #if !defined(XZ_SKEW_FACTOR) && !(defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD))
  1902. #error "SKEW_CORRECTION requires XZ_SKEW_FACTOR or XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD."
  1903. #endif
  1904. #if !defined(YZ_SKEW_FACTOR) && !(defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD))
  1905. #error "SKEW_CORRECTION requires YZ_SKEW_FACTOR or YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD."
  1906. #endif
  1907. #endif
  1908. #endif
  1909. #if ENABLED(POWER_LOSS_RECOVERY) && DISABLED(ULTIPANEL)
  1910. #error "POWER_LOSS_RECOVERY currently requires an LCD Controller."
  1911. #endif
  1912. #if ENABLED(Z_STEPPER_AUTO_ALIGN)
  1913. #if !Z_MULTI_STEPPER_DRIVERS
  1914. #error "Z_STEPPER_AUTO_ALIGN requires Z_DUAL_STEPPER_DRIVERS or Z_TRIPLE_STEPPER_DRIVERS."
  1915. #elif !HAS_BED_PROBE
  1916. #error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe."
  1917. #endif
  1918. constexpr float sanity_arr_z_align_x[] = Z_STEPPER_ALIGN_X, sanity_arr_z_align_y[] = Z_STEPPER_ALIGN_Y;
  1919. static_assert(
  1920. COUNT(sanity_arr_z_align_x) == Z_STEPPER_COUNT && COUNT(sanity_arr_z_align_y) == Z_STEPPER_COUNT,
  1921. "Z_STEPPER_ALIGN_[XY]POS settings require one element per Z stepper."
  1922. );
  1923. #endif
  1924. #if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS)
  1925. #error "PRINTCOUNTER requires EEPROM_SETTINGS. Please update your Configuration."
  1926. #endif
  1927. #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PIN_EXISTS(USB_CS, USB_INTR)
  1928. #error "USB_CS_PIN and USB_INTR_PIN are required for USB_FLASH_DRIVE_SUPPORT."
  1929. #endif
  1930. #if ENABLED(SD_FIRMWARE_UPDATE) && !defined(__AVR_ATmega2560__)
  1931. #error "SD_FIRMWARE_UPDATE requires an ATmega2560-based (Arduino Mega) board."
  1932. #endif
  1933. #if ENABLED(GCODE_MACROS) && !WITHIN(GCODE_MACROS_SLOTS, 1, 10)
  1934. #error "GCODE_MACROS_SLOTS must be a number from 1 to 10."
  1935. #endif
  1936. #if ENABLED(CUSTOM_USER_MENUS)
  1937. #ifdef USER_GCODE_1
  1938. constexpr char _chr1 = USER_GCODE_1[strlen(USER_GCODE_1) - 1];
  1939. static_assert(_chr1 != '\n' && _chr1 != '\r', "USER_GCODE_1 cannot have a newline at the end. Please remove it.");
  1940. #endif
  1941. #ifdef USER_GCODE_2
  1942. constexpr char _chr2 = USER_GCODE_2[strlen(USER_GCODE_2) - 1];
  1943. static_assert(_chr2 != '\n' && _chr2 != '\r', "USER_GCODE_2 cannot have a newline at the end. Please remove it.");
  1944. #endif
  1945. #ifdef USER_GCODE_3
  1946. constexpr char _chr3 = USER_GCODE_3[strlen(USER_GCODE_3) - 1];
  1947. static_assert(_chr3 != '\n' && _chr3 != '\r', "USER_GCODE_3 cannot have a newline at the end. Please remove it.");
  1948. #endif
  1949. #ifdef USER_GCODE_4
  1950. constexpr char _chr4 = USER_GCODE_4[strlen(USER_GCODE_4) - 1];
  1951. static_assert(_chr4 != '\n' && _chr4 != '\r', "USER_GCODE_4 cannot have a newline at the end. Please remove it.");
  1952. #endif
  1953. #ifdef USER_GCODE_5
  1954. constexpr char _chr5 = USER_GCODE_5[strlen(USER_GCODE_5) - 1];
  1955. static_assert(_chr5 != '\n' && _chr5 != '\r', "USER_GCODE_5 cannot have a newline at the end. Please remove it.");
  1956. #endif
  1957. #endif
  1958. #if ENABLED(BACKLASH_COMPENSATION) && IS_CORE
  1959. #error "BACKLASH_COMPENSATION is incompatible with CORE kinematics."
  1960. #endif
  1961. #if ENABLED(GRADIENT_MIX) && MIXING_VIRTUAL_TOOLS < 2
  1962. #error "GRADIENT_MIX requires 2 or more MIXING_VIRTUAL_TOOLS."
  1963. #endif
  1964. /**
  1965. * Photo G-code requirements
  1966. */
  1967. #if ENABLED(PHOTO_GCODE)
  1968. #if (PIN_EXISTS(CHDK) + PIN_EXISTS(PHOTOGRAPH_PIN) + defined(PHOTO_SWITCH_POSITION)) > 1
  1969. #error "Please define only one of CHDK_PIN, PHOTOGRAPH_PIN, or PHOTO_SWITCH_POSITION."
  1970. #elif defined(PHOTO_SWITCH_POSITION) && !defined(PHOTO_POSITION)
  1971. #error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION. Please update your Configuration_adv.h."
  1972. #elif PIN_EXISTS(CHDK) && defined(CHDK_DELAY)
  1973. #error "CHDK_DELAY has been replaced by PHOTO_SWITCH_MS. Please update your Configuration_adv.h."
  1974. #elif PIN_EXISTS(CHDK) && !defined(PHOTO_SWITCH_MS)
  1975. #error "PHOTO_SWITCH_MS is required with CHDK_PIN. Please update your Configuration_adv.h."
  1976. #elif defined(PHOTO_RETRACT_MM)
  1977. static_assert(PHOTO_RETRACT_MM + 0 >= 0, "PHOTO_RETRACT_MM must be >= 0.");
  1978. #endif
  1979. #endif
  1980. /**
  1981. * Prusa MMU2 requirements
  1982. */
  1983. #if ENABLED(PRUSA_MMU2)
  1984. #if DISABLED(NOZZLE_PARK_FEATURE)
  1985. #error "PRUSA_MMU2 requires NOZZLE_PARK_FEATURE."
  1986. #elif EXTRUDERS != 5
  1987. #error "PRUSA_MMU2 requires EXTRUDERS = 5."
  1988. #elif DISABLED(ADVANCED_PAUSE_FEATURE)
  1989. static_assert(NULL == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2.");
  1990. #endif
  1991. #endif
  1992. /**
  1993. * Advanced PRINTCOUNTER settings
  1994. */
  1995. #if ENABLED(PRINTCOUNTER)
  1996. #if defined(SERVICE_INTERVAL_1) != defined(SERVICE_NAME_1)
  1997. #error "Both SERVICE_NAME_1 and SERVICE_INTERVAL_1 are required."
  1998. #elif defined(SERVICE_INTERVAL_2) != defined(SERVICE_NAME_2)
  1999. #error "Both SERVICE_NAME_2 and SERVICE_INTERVAL_2 are required."
  2000. #elif defined(SERVICE_INTERVAL_3) != defined(SERVICE_NAME_3)
  2001. #error "Both SERVICE_NAME_3 and SERVICE_INTERVAL_3 are required."
  2002. #endif
  2003. #endif
  2004. /**
  2005. * Require soft endstops for certain setups
  2006. */
  2007. #if DISABLED(MIN_SOFTWARE_ENDSTOPS) || DISABLED(MAX_SOFTWARE_ENDSTOPS)
  2008. #if ENABLED(DUAL_X_CARRIAGE)
  2009. #error "DUAL_X_CARRIAGE requires both MIN_ and MAX_SOFTWARE_ENDSTOPS."
  2010. #elif HAS_HOTEND_OFFSET
  2011. #error "MIN_ and MAX_SOFTWARE_ENDSTOPS are both required with offset hotends."
  2012. #endif
  2013. #endif