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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379
  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. #undef HEXIFY
  48. /**
  49. * Warnings for old configurations
  50. */
  51. #ifndef MOTHERBOARD
  52. #error "MOTHERBOARD is required. Please update your configuration."
  53. #elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE)
  54. #error "X_BED_SIZE and Y_BED_SIZE are now required! Please update your configuration."
  55. #elif WATCH_TEMP_PERIOD > 500
  56. #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds."
  57. #elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
  58. #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS."
  59. #elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
  60. #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED."
  61. #elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE)
  62. #error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY."
  63. #elif defined(X_HOME_RETRACT_MM)
  64. #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM."
  65. #elif defined(SDCARDDETECTINVERTED)
  66. #error "SDCARDDETECTINVERTED is now SD_DETECT_INVERTED. Please update your configuration."
  67. #elif defined(BTENABLED)
  68. #error "BTENABLED is now BLUETOOTH. Please update your configuration."
  69. #elif defined(CUSTOM_MENDEL_NAME)
  70. #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration."
  71. #elif defined(HAS_AUTOMATIC_VERSIONING)
  72. #error "HAS_AUTOMATIC_VERSIONING is now USE_AUTOMATIC_VERSIONING. Please update your configuration."
  73. #elif defined(SDSLOW)
  74. #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead."
  75. #elif defined(SDEXTRASLOW)
  76. #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead."
  77. #elif defined(FILAMENT_SENSOR)
  78. #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration."
  79. #elif defined(ENDSTOPPULLUP_FIL_RUNOUT)
  80. #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP. Please update your configuration."
  81. #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
  82. #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead."
  83. #elif defined(LANGUAGE_INCLUDE)
  84. #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration."
  85. #elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y)
  86. #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead."
  87. #elif defined(PID_PARAMS_PER_EXTRUDER)
  88. #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead."
  89. #elif defined(EXTRUDER_WATTS) || defined(BED_WATTS)
  90. #error "EXTRUDER_WATTS and BED_WATTS are deprecated. Remove them from your configuration."
  91. #elif defined(SERVO_ENDSTOP_ANGLES)
  92. #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
  93. #elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
  94. #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
  95. #elif defined(Z_ENDSTOP_SERVO_NR)
  96. #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR. Please update your configuration."
  97. #elif defined(DEFAULT_XYJERK)
  98. #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead."
  99. #elif defined(XY_TRAVEL_SPEED)
  100. #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead."
  101. #elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
  102. #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead."
  103. #elif defined(SERVO_DEACTIVATION_DELAY)
  104. #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead."
  105. #elif ENABLED(FILAMENTCHANGEENABLE)
  106. #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE. Please update your configuration."
  107. #elif ENABLED(FILAMENT_CHANGE_FEATURE)
  108. #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE. Please update your configuration."
  109. #elif defined(FILAMENT_CHANGE_X_POS) || defined(FILAMENT_CHANGE_Y_POS)
  110. #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration."
  111. #elif defined(FILAMENT_CHANGE_Z_ADD)
  112. #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration."
  113. #elif defined(FILAMENT_CHANGE_XY_FEEDRATE)
  114. #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration."
  115. #elif defined(FILAMENT_CHANGE_Z_FEEDRATE)
  116. #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration."
  117. #elif defined(PAUSE_PARK_X_POS) || defined(PAUSE_PARK_Y_POS)
  118. #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration."
  119. #elif defined(PAUSE_PARK_Z_ADD)
  120. #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration."
  121. #elif defined(PAUSE_PARK_XY_FEEDRATE)
  122. #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration."
  123. #elif defined(PAUSE_PARK_Z_FEEDRATE)
  124. #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration."
  125. #elif defined(FILAMENT_CHANGE_RETRACT_FEEDRATE)
  126. #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE. Please update your configuration."
  127. #elif defined(FILAMENT_CHANGE_RETRACT_LENGTH)
  128. #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH. Please update your configuration."
  129. #elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE)
  130. #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration."
  131. #elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE)
  132. #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration."
  133. #elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH)
  134. #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration."
  135. #elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH)
  136. #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration."
  137. #elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT)
  138. #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT. Please update your configuration."
  139. #elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS)
  140. #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS. Please update your configuration."
  141. #elif defined(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
  142. #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT. Please update your configuration."
  143. #elif defined(PLA_PREHEAT_HOTEND_TEMP)
  144. #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration."
  145. #elif defined(PLA_PREHEAT_HPB_TEMP)
  146. #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration."
  147. #elif defined(PLA_PREHEAT_FAN_SPEED)
  148. #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration."
  149. #elif defined(ABS_PREHEAT_HOTEND_TEMP)
  150. #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration."
  151. #elif defined(ABS_PREHEAT_HPB_TEMP)
  152. #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration."
  153. #elif defined(ABS_PREHEAT_FAN_SPEED)
  154. #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration."
  155. #elif defined(ENDSTOPS_ONLY_FOR_HOMING)
  156. #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead."
  157. #elif defined(HOMING_FEEDRATE)
  158. #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead."
  159. #elif defined(MANUAL_HOME_POSITIONS)
  160. #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead."
  161. #elif defined(PID_ADD_EXTRUSION_RATE)
  162. #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."
  163. #elif defined(Z_RAISE_BEFORE_HOMING)
  164. #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT. Please update your configuration."
  165. #elif defined(MIN_Z_HEIGHT_FOR_HOMING)
  166. #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT. Please update your configuration."
  167. #elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING)
  168. #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead."
  169. #elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS)
  170. #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."
  171. #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT)
  172. #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."
  173. #elif defined(MANUAL_BED_LEVELING)
  174. #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING. Please update your configuration."
  175. #elif defined(MESH_HOME_SEARCH_Z)
  176. #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE. Please update your configuration."
  177. #elif defined(MANUAL_PROBE_Z_RANGE)
  178. #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE. Please update your configuration."
  179. #elif !defined(MIN_STEPS_PER_SEGMENT)
  180. #error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h.
  181. #elif MIN_STEPS_PER_SEGMENT <= 0
  182. #error "MIN_STEPS_PER_SEGMENT must be at least 1. Please update your Configuration_adv.h."
  183. #elif defined(PREVENT_DANGEROUS_EXTRUDE)
  184. #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION. Please update your configuration."
  185. #elif defined(SCARA)
  186. #error "SCARA is now MORGAN_SCARA. Please update your configuration."
  187. #elif defined(ENABLE_AUTO_BED_LEVELING)
  188. #error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
  189. #elif defined(AUTO_BED_LEVELING_FEATURE)
  190. #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
  191. #elif defined(ABL_GRID_POINTS)
  192. #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y. Please update your configuration."
  193. #elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y)
  194. #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration."
  195. #elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y)
  196. #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration."
  197. #elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS)
  198. #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration."
  199. #elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS)
  200. #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration."
  201. #elif defined(UBL_G26_MESH_VALIDATION)
  202. #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION. Please update your configuration."
  203. #elif defined(UBL_MESH_EDIT_ENABLED)
  204. #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION. Please update your configuration."
  205. #elif defined(UBL_MESH_EDITING)
  206. #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION. Please update your configuration."
  207. #elif defined(BLTOUCH_HEATERS_OFF)
  208. #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF. Please update your configuration."
  209. #elif defined(BLTOUCH_V3)
  210. #error "BLTOUCH_V3 is obsolete. Please update your configuration."
  211. #elif defined(BLTOUCH_FORCE_OPEN_DRAIN_MODE)
  212. #error "BLTOUCH_FORCE_OPEN_DRAIN_MODE is obsolete. Please update your configuration."
  213. #elif defined(BEEPER)
  214. #error "BEEPER is now BEEPER_PIN. Please update your pins definitions."
  215. #elif defined(SDCARDDETECT)
  216. #error "SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions."
  217. #elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE)
  218. #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN. Please update your pins definitions."
  219. #elif defined(LCD_PIN_BL)
  220. #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN. Please update your pins definitions."
  221. #elif defined(LCD_PIN_RESET)
  222. #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions."
  223. #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)
  224. #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h."
  225. #elif defined(min_software_endstops) || defined(max_software_endstops)
  226. #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration."
  227. #elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN)
  228. #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)."
  229. #elif defined(CONTROLLERFAN_PIN)
  230. #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN. Please update your Configuration_adv.h."
  231. #elif defined(MIN_RETRACT)
  232. #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h."
  233. #elif defined(ADVANCE)
  234. #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE."
  235. #elif defined(LIN_ADVANCE_E_D_RATIO)
  236. #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO. Check your configuration."
  237. #elif defined(NEOPIXEL_RGBW_LED)
  238. #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration."
  239. #elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS)
  240. #error "Remove DELTA_PROBEABLE_RADIUS and use MIN_PROBE_EDGE to inset the probe area instead."
  241. #elif defined(UBL_MESH_INSET)
  242. #error "UBL_MESH_INSET is now just MESH_INSET. Please update your configuration."
  243. #elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y)
  244. #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]. Please update your configuration."
  245. #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)
  246. #error "ABL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration."
  247. #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)
  248. #error "UBL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration."
  249. #elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY)
  250. #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY. Please update your configuration."
  251. #elif defined(BABYSTEP_ZPROBE_GFX_REVERSE)
  252. #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE. Please update your configurations."
  253. #elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN)
  254. #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES. Please update your configuration."
  255. #elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1))
  256. #error "K1 is now PID_K1. Please update your configuration."
  257. #elif defined(PROBE_DOUBLE_TOUCH)
  258. #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING. Please update your configuration."
  259. #elif defined(ANET_KEYPAD_LCD)
  260. #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD. Please update your configuration."
  261. #elif defined(LCD_I2C_SAINSMART_YWROBOT)
  262. #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004). Please update your configuration."
  263. #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT)
  264. #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN. Please update your configuration."
  265. #elif defined(HAVE_TMCDRIVER)
  266. #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
  267. #elif defined(STEALTHCHOP)
  268. #error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E). Please update your Configuration_adv.h."
  269. #elif defined(HAVE_TMC26X)
  270. #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
  271. #elif defined(HAVE_TMC2130)
  272. #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h."
  273. #elif defined(HAVE_TMC2208)
  274. #error "HAVE_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h."
  275. #elif defined(HAVE_L6470DRIVER)
  276. #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h."
  277. #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) \
  278. || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) || defined(E5_IS_TMC)
  279. #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
  280. #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) \
  281. || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) || defined(E5_IS_TMC26X)
  282. #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
  283. #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) \
  284. || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) || defined(E5_IS_TMC2130)
  285. #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h."
  286. #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) \
  287. || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) || defined(E5_IS_TMC2208)
  288. #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h."
  289. #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) \
  290. || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) || defined(E5_IS_L6470)
  291. #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h."
  292. #elif defined(AUTOMATIC_CURRENT_CONTROL)
  293. #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration."
  294. #elif defined(FILAMENT_CHANGE_LOAD_LENGTH)
  295. #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH. Please update your configuration."
  296. #elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET)
  297. #error "LEVEL_BED_CORNERS requires a LEVEL_CORNERS_INSET value. Please update your Configuration.h."
  298. #elif defined(BEZIER_JERK_CONTROL)
  299. #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration."
  300. #elif defined(JUNCTION_DEVIATION_FACTOR)
  301. #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM. Please update your configuration."
  302. #elif defined(JUNCTION_ACCELERATION_FACTOR)
  303. #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h."
  304. #elif defined(JUNCTION_ACCELERATION)
  305. #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h."
  306. #elif defined(MAX7219_DEBUG_STEPPER_HEAD)
  307. #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD. Please update your configuration."
  308. #elif defined(MAX7219_DEBUG_STEPPER_TAIL)
  309. #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL. Please update your configuration."
  310. #elif defined(MAX7219_DEBUG_STEPPER_QUEUE)
  311. #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE. Please update your configuration."
  312. #elif defined(ENDSTOP_NOISE_FILTER)
  313. #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]. Please update your configuration."
  314. #elif defined(RETRACT_ZLIFT)
  315. #error "RETRACT_ZLIFT is now RETRACT_ZRAISE. Please update your Configuration_adv.h."
  316. #elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT)
  317. #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE. Please update your configuration."
  318. #elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE)
  319. #error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE. Please update your configuration."
  320. #elif defined(SINGLENOZZLE_SWAP_LENGTH)
  321. #error "SINGLENOZZLE_SWAP_LENGTH is now TOOLCHANGE_FIL_SWAP_LENGTH. Please update your configuration."
  322. #elif defined(SINGLENOZZLE_SWAP_RETRACT_SPEED)
  323. #error "SINGLENOZZLE_SWAP_RETRACT_SPEED is now TOOLCHANGE_FIL_SWAP_RETRACT_SPEED. Please update your configuration."
  324. #elif defined(SINGLENOZZLE_SWAP_PRIME_SPEED)
  325. #error "SINGLENOZZLE_SWAP_PRIME_SPEED is now TOOLCHANGE_FIL_SWAP_PRIME_SPEED. Please update your configuration."
  326. #elif defined(SINGLENOZZLE_SWAP_PARK)
  327. #error "SINGLENOZZLE_SWAP_PARK is now TOOLCHANGE_PARK. Please update your configuration."
  328. #elif defined(SINGLENOZZLE_TOOLCHANGE_XY)
  329. #error "SINGLENOZZLE_TOOLCHANGE_XY is now TOOLCHANGE_PARK_XY. Please update your configuration."
  330. #elif defined(SINGLENOZZLE_PARK_XY_FEEDRATE)
  331. #error "SINGLENOZZLE_PARK_XY_FEEDRATE is now TOOLCHANGE_PARK_XY_FEEDRATE. Please update your configuration."
  332. #elif defined(PARKING_EXTRUDER_SECURITY_RAISE)
  333. #error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration."
  334. #elif defined(SWITCHING_TOOLHEAD_SECURITY_RAISE)
  335. #error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration."
  336. #elif defined(G0_FEEDRATE) && G0_FEEDRATE == 0
  337. #error "G0_FEEDRATE is now used to set the G0 feedrate. Please update your configuration."
  338. #elif defined(MBL_Z_STEP)
  339. #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP. Please update your configuration."
  340. #elif defined(CHDK)
  341. #error "CHDK is now CHDK_PIN. Please update your Configuration_adv.h."
  342. #elif defined(MAX6675_SS)
  343. #error "MAX6675_SS is now MAX6675_SS_PIN. Please update your configuration and/or pins."
  344. #elif defined(MAX6675_SS2)
  345. #error "MAX6675_SS2 is now MAX6675_SS2_PIN. Please update your configuration and/or pins."
  346. #elif defined(SPINDLE_LASER_ENABLE)
  347. #error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE. Please update your Configuration_adv.h."
  348. #elif defined(SPINDLE_LASER_ENABLE_PIN)
  349. #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN. Please update your Configuration_adv.h and/or pins."
  350. #elif defined(SPINDLE_DIR_CHANGE)
  351. #error "SPINDLE_DIR_CHANGE is now SPINDLE_CHANGE_DIR. Please update your Configuration_adv.h."
  352. #elif defined(SPINDLE_STOP_ON_DIR_CHANGE)
  353. #error "SPINDLE_STOP_ON_DIR_CHANGE is now SPINDLE_CHANGE_DIR_STOP. Please update your Configuration_adv.h."
  354. #elif defined(SPINDLE_LASER_ENABLE_INVERT)
  355. #error "SPINDLE_LASER_ENABLE_INVERT is now SPINDLE_LASER_ACTIVE_HIGH. Please update your Configuration_adv.h."
  356. #elif defined(CHAMBER_HEATER_PIN)
  357. #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN. Please update your configuration and/or pins."
  358. #elif defined(TMC_Z_CALIBRATION)
  359. #error "TMC_Z_CALIBRATION has been deprecated in favor of Z_STEPPER_AUTO_ALIGN. Please update your configuration."
  360. #elif defined(Z_MIN_PROBE_ENDSTOP)
  361. #error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it from Configuration.h."
  362. #elif defined(DUAL_NOZZLE_DUPLICATION_MODE)
  363. #error "DUAL_NOZZLE_DUPLICATION_MODE is now MULTI_NOZZLE_DUPLICATION. Please update your configuration."
  364. #elif defined(MENU_ITEM_CASE_LIGHT)
  365. #error "MENU_ITEM_CASE_LIGHT is now CASE_LIGHT_MENU. Please update your configuration."
  366. #elif defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
  367. #error "ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED is now SD_ABORT_ON_ENDSTOP_HIT. Please update your Configuration_adv.h."
  368. #elif defined(LPC_SD_LCD) || defined(LPC_SD_ONBOARD) || defined(LPC_SD_CUSTOM_CABLE)
  369. #error "LPC_SD_(LCD|ONBOARD|CUSTOM_CABLE) are now SDCARD_CONNECTION. Please update your Configuration_adv.h."
  370. #elif defined(USB_SD_DISABLED)
  371. #error "USB_SD_DISABLED is now NO_SD_HOST_DRIVE. Please update your Configuration_adv.h."
  372. #elif defined(USB_SD_ONBOARD)
  373. #error "USB_SD_ONBOARD is obsolete. Disable NO_SD_HOST_DRIVE instead."
  374. #elif POWER_SUPPLY == 1
  375. #error "Replace POWER_SUPPLY 1 by enabling PSU_CONTROL and setting PSU_ACTIVE_HIGH to 'false'."
  376. #elif POWER_SUPPLY == 2
  377. #error "Replace POWER_SUPPLY 2 by enabling PSU_CONTROL and setting PSU_ACTIVE_HIGH to 'true'."
  378. #elif defined(POWER_SUPPLY)
  379. #error "POWER_SUPPLY is now obsolete. Please remove it from Configuration.h."
  380. #endif
  381. #define BOARD_MKS_13 -1109
  382. #define BOARD_TRIGORILLA -1131
  383. #define BOARD_RURAMPS4D -3020
  384. #define BOARD_FORMBOT_TREX2 -1125
  385. #define BOARD_BIQU_SKR_V1_1 -2014
  386. #if MB(MKS_13)
  387. #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration."
  388. #elif MB(TRIGORILLA)
  389. #error "BOARD_TRIGORILLA has been renamed BOARD_TRIGORILLA_13. Please update your configuration."
  390. #elif MB(RURAMPS4D)
  391. #error "BOARD_RURAMPS4D has been renamed BOARD_RURAMPS4D_11. Please update your configuration."
  392. #elif MB(FORMBOT_TREX2)
  393. #error "FORMBOT_TREX2 has been renamed BOARD_FORMBOT_TREX2PLUS. Please update your configuration."
  394. #elif MB(BOARD_BIQU_SKR_V1_1)
  395. #error "BIQU_SKR_V1_1 has been renamed BOARD_BIGTREE_SKR_V1_1. Please update your configuration."
  396. #endif
  397. #undef BOARD_MKS_13
  398. #undef BOARD_TRIGORILLA
  399. #undef BOARD_RURAMPS4D
  400. #undef BOARD_FORMBOT_TREX2
  401. #undef BOARD_BIQU_SKR_V1_1
  402. /**
  403. * Marlin release, version and default string
  404. */
  405. #ifndef SHORT_BUILD_VERSION
  406. #error "SHORT_BUILD_VERSION must be specified."
  407. #elif !defined(DETAILED_BUILD_VERSION)
  408. #error "BUILD_VERSION must be specified."
  409. #elif !defined(STRING_DISTRIBUTION_DATE)
  410. #error "STRING_DISTRIBUTION_DATE must be specified."
  411. #elif !defined(PROTOCOL_VERSION)
  412. #error "PROTOCOL_VERSION must be specified."
  413. #elif !defined(MACHINE_NAME)
  414. #error "MACHINE_NAME must be specified."
  415. #elif !defined(SOURCE_CODE_URL)
  416. #error "SOURCE_CODE_URL must be specified."
  417. #elif !defined(DEFAULT_MACHINE_UUID)
  418. #error "DEFAULT_MACHINE_UUID must be specified."
  419. #elif !defined(WEBSITE_URL)
  420. #error "WEBSITE_URL must be specified."
  421. #endif
  422. /**
  423. * Serial
  424. */
  425. #if !(defined(__AVR__) && defined(USBCON))
  426. #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
  427. #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
  428. #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
  429. #error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
  430. #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
  431. #error "TX_BUFFER_SIZE must be 0 or a power of 2 between 1 and 256."
  432. #endif
  433. #elif ANY(SERIAL_XON_XOFF, SERIAL_STATS_MAX_RX_QUEUED, SERIAL_STATS_DROPPED_RX)
  434. #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
  435. #endif
  436. #if SERIAL_PORT > 7
  437. #error "Set SERIAL_PORT to the port on your board. Usually this is 0."
  438. #endif
  439. #if defined(SERIAL_PORT_2) && NUM_SERIAL < 2
  440. #error "SERIAL_PORT_2 is not supported for your MOTHERBOARD. Disable it to continue."
  441. #endif
  442. /**
  443. * Dual / Triple Stepper Drivers
  444. */
  445. #if BOTH(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE)
  446. #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS."
  447. #elif ENABLED(X_DUAL_STEPPER_DRIVERS) && !(HAS_X2_ENABLE && HAS_X2_STEP && HAS_X2_DIR)
  448. #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)."
  449. #elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && !(HAS_Y2_ENABLE && HAS_Y2_STEP && HAS_Y2_DIR)
  450. #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)."
  451. #elif ENABLED(Z_DUAL_STEPPER_DRIVERS)
  452. #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
  453. #error "Please select either Z_TRIPLE_STEPPER_DRIVERS or Z_DUAL_STEPPER_DRIVERS, not both."
  454. #elif !(HAS_Z2_ENABLE && HAS_Z2_STEP && HAS_Z2_DIR)
  455. #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)."
  456. #endif
  457. #elif ENABLED(Z_TRIPLE_STEPPER_DRIVERS) && !(HAS_Z2_ENABLE && HAS_Z2_STEP && HAS_Z2_DIR && HAS_Z3_ENABLE && HAS_Z3_STEP && HAS_Z3_DIR)
  458. #error "Z_TRIPLE_STEPPER_DRIVERS requires Z3 pins (and two extra E plugs)."
  459. #endif
  460. /**
  461. * Validate that the bed size fits
  462. */
  463. static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE.");
  464. static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE.");
  465. /**
  466. * Granular software endstops (Marlin >= 1.1.7)
  467. */
  468. #if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z)
  469. #if IS_KINEMATIC
  470. #error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z."
  471. #elif NONE(MIN_SOFTWARE_ENDSTOP_X, MIN_SOFTWARE_ENDSTOP_Y)
  472. #error "MIN_SOFTWARE_ENDSTOPS requires at least one of the MIN_SOFTWARE_ENDSTOP_[XYZ] options."
  473. #endif
  474. #endif
  475. #if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z)
  476. #if IS_KINEMATIC
  477. #error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z."
  478. #elif NONE(MAX_SOFTWARE_ENDSTOP_X, MAX_SOFTWARE_ENDSTOP_Y)
  479. #error "MAX_SOFTWARE_ENDSTOPS requires at least one of the MAX_SOFTWARE_ENDSTOP_[XYZ] options."
  480. #endif
  481. #endif
  482. #if !defined(TARGET_LPC1768) && ( \
  483. ENABLED(ENDSTOPPULLDOWNS) \
  484. || ENABLED(ENDSTOPPULLDOWN_XMAX) \
  485. || ENABLED(ENDSTOPPULLDOWN_YMAX) \
  486. || ENABLED(ENDSTOPPULLDOWN_ZMAX) \
  487. || ENABLED(ENDSTOPPULLDOWN_XMIN) \
  488. || ENABLED(ENDSTOPPULLDOWN_YMIN) \
  489. || ENABLED(ENDSTOPPULLDOWN_ZMIN) )
  490. #error "PULLDOWN pin mode is not available on the selected board."
  491. #endif
  492. #if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS)
  493. #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS."
  494. #elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN)
  495. #error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN."
  496. #elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX)
  497. #error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX."
  498. #elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX)
  499. #error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
  500. #elif BOTH(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX)
  501. #error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
  502. #elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN)
  503. #error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
  504. #elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN)
  505. #error "Enable only one of ENDSTOPPULLUP_Y_MIN or ENDSTOPPULLDOWN_Y_MIN."
  506. #elif BOTH(ENDSTOPPULLUP_ZMIN, ENDSTOPPULLDOWN_ZMIN)
  507. #error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN."
  508. #endif
  509. /**
  510. * LCD Info Screen Style
  511. */
  512. #if LCD_INFO_SCREEN_STYLE > 0
  513. #if HAS_GRAPHICAL_LCD || LCD_WIDTH < 20 || LCD_HEIGHT < 4
  514. #error "Alternative LCD_INFO_SCREEN_STYLE requires 20x4 Character LCD."
  515. #elif LCD_INFO_SCREEN_STYLE > 1
  516. #error "LCD_INFO_SCREEN_STYLE only has options 0 and 1 at this time."
  517. #endif
  518. #endif
  519. /**
  520. * Progress Bar
  521. */
  522. #if ENABLED(LCD_PROGRESS_BAR)
  523. #if NONE(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
  524. #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY."
  525. #elif !HAS_CHARACTER_LCD
  526. #error "LCD_PROGRESS_BAR requires a character LCD."
  527. #elif HAS_GRAPHICAL_LCD
  528. #error "LCD_PROGRESS_BAR does not apply to graphical displays."
  529. #elif ENABLED(FILAMENT_LCD_DISPLAY)
  530. #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both."
  531. #elif PROGRESS_MSG_EXPIRE < 0
  532. #error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
  533. #endif
  534. #elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && !HAS_GRAPHICAL_LCD && DISABLED(EXTENSIBLE_UI)
  535. #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Graphical LCD, or EXTENSIBLE_UI."
  536. #endif
  537. /**
  538. * Custom Boot and Status screens
  539. */
  540. #if DISABLED(DOGLCD) && EITHER(SHOW_CUSTOM_BOOTSCREEN, CUSTOM_STATUS_SCREEN_IMAGE)
  541. #error "Graphical LCD is required for SHOW_CUSTOM_BOOTSCREEN and CUSTOM_STATUS_SCREEN_IMAGE."
  542. #endif
  543. /**
  544. * LCD Lightweight Screen Style
  545. */
  546. #if ENABLED(LIGHTWEIGHT_UI) && DISABLED(U8GLIB_ST7920)
  547. #error "LIGHTWEIGHT_UI requires a U8GLIB_ST7920-based display."
  548. #endif
  549. /**
  550. * SD File Sorting
  551. */
  552. #if ENABLED(SDCARD_SORT_ALPHA)
  553. #if SDSORT_LIMIT > 256
  554. #error "SDSORT_LIMIT must be 256 or smaller."
  555. #elif SDSORT_LIMIT < 10
  556. #error "SDSORT_LIMIT should be greater than 9 to be useful."
  557. #elif DISABLED(SDSORT_USES_RAM)
  558. #if ENABLED(SDSORT_DYNAMIC_RAM)
  559. #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)."
  560. #elif ENABLED(SDSORT_CACHE_NAMES)
  561. #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)."
  562. #endif
  563. #endif
  564. #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
  565. #if SDSORT_CACHE_VFATS < 2
  566. #error "SDSORT_CACHE_VFATS must be 2 or greater!"
  567. #elif SDSORT_CACHE_VFATS > MAX_VFAT_ENTRIES
  568. #undef SDSORT_CACHE_VFATS
  569. #define SDSORT_CACHE_VFATS MAX_VFAT_ENTRIES
  570. #warning "SDSORT_CACHE_VFATS was reduced to MAX_VFAT_ENTRIES!"
  571. #endif
  572. #endif
  573. #endif
  574. #if defined(EVENT_GCODE_SD_STOP) && DISABLED(NOZZLE_PARK_FEATURE)
  575. static_assert(nullptr == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP.");
  576. #endif
  577. /**
  578. * I2C Position Encoders
  579. */
  580. #if ENABLED(I2C_POSITION_ENCODERS)
  581. #if DISABLED(BABYSTEPPING) || DISABLED(BABYSTEP_XY)
  582. #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY."
  583. #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5)
  584. #error "I2CPE_ENCODER_CNT must be between 1 and 5."
  585. #endif
  586. #endif
  587. /**
  588. * Babystepping
  589. */
  590. #if ENABLED(BABYSTEPPING)
  591. #if ENABLED(SCARA)
  592. #error "BABYSTEPPING is not implemented for SCARA yet."
  593. #elif BOTH(DELTA, BABYSTEP_XY)
  594. #error "BABYSTEPPING only implemented for Z axis on deltabots."
  595. #elif BOTH(BABYSTEP_ZPROBE_OFFSET, MESH_BED_LEVELING)
  596. #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
  597. #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
  598. #error "BABYSTEP_ZPROBE_OFFSET requires a probe."
  599. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(DOGLCD)
  600. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD."
  601. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
  602. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
  603. #elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET
  604. #error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS."
  605. #elif BOTH(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE)
  606. #error "BABYSTEP_ALWAYS_AVAILABLE and MOVE_Z_WHEN_IDLE are incompatible."
  607. #endif
  608. #endif
  609. /**
  610. * Filament Runout needs one or more pins and either SD Support or Auto print start detection
  611. */
  612. #if HAS_FILAMENT_SENSOR
  613. #if !PIN_EXISTS(FIL_RUNOUT)
  614. #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
  615. #elif NUM_RUNOUT_SENSORS > E_STEPPERS
  616. #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers."
  617. #elif NUM_RUNOUT_SENSORS > 1 && !PIN_EXISTS(FIL_RUNOUT2)
  618. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 1 requires FIL_RUNOUT2_PIN."
  619. #elif NUM_RUNOUT_SENSORS > 2 && !PIN_EXISTS(FIL_RUNOUT3)
  620. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 2 requires FIL_RUNOUT3_PIN."
  621. #elif NUM_RUNOUT_SENSORS > 3 && !PIN_EXISTS(FIL_RUNOUT4)
  622. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 3 requires FIL_RUNOUT4_PIN."
  623. #elif NUM_RUNOUT_SENSORS > 4 && !PIN_EXISTS(FIL_RUNOUT5)
  624. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 4 requires FIL_RUNOUT5_PIN."
  625. #elif NUM_RUNOUT_SENSORS > 5 && !PIN_EXISTS(FIL_RUNOUT6)
  626. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 5 requires FIL_RUNOUT6_PIN."
  627. #elif NONE(SDSUPPORT, PRINTJOB_TIMER_AUTOSTART)
  628. #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART."
  629. #elif FILAMENT_RUNOUT_DISTANCE_MM < 0
  630. #error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero."
  631. #elif DISABLED(ADVANCED_PAUSE_FEATURE)
  632. static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
  633. #endif
  634. #endif
  635. /**
  636. * Advanced Pause
  637. */
  638. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  639. #if !HAS_RESUME_CONTINUE
  640. #error "ADVANCED_PAUSE_FEATURE currently requires an LCD controller or EMERGENCY_PARSER."
  641. #elif ENABLED(EXTRUDER_RUNOUT_PREVENT)
  642. #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
  643. #elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(SDSUPPORT, NEWPANEL, EMERGENCY_PARSER)
  644. #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller."
  645. #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
  646. #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT."
  647. #elif DISABLED(NOZZLE_PARK_FEATURE)
  648. #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE."
  649. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH
  650. #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  651. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH
  652. #error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  653. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH
  654. #error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  655. #endif
  656. #endif
  657. #if ENABLED(NOZZLE_PARK_FEATURE)
  658. constexpr float npp[] = NOZZLE_PARK_POINT;
  659. static_assert(COUNT(npp) == XYZ, "NOZZLE_PARK_POINT requires X, Y, and Z values.");
  660. #endif
  661. /**
  662. * Individual axis homing is useless for DELTAS
  663. */
  664. #if BOTH(INDIVIDUAL_AXIS_HOMING_MENU, DELTA)
  665. #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
  666. #endif
  667. /**
  668. * Options only for EXTRUDERS > 1
  669. */
  670. #if EXTRUDERS > 1
  671. #if EXTRUDERS > 6
  672. #error "Marlin supports a maximum of 6 EXTRUDERS."
  673. #endif
  674. #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  675. #error "EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT."
  676. #endif
  677. #if ENABLED(HEATERS_PARALLEL)
  678. #error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
  679. #endif
  680. #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
  681. #ifndef TOOLCHANGE_FIL_SWAP_LENGTH
  682. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FIL_SWAP_LENGTH. Please update your Configuration."
  683. #elif !defined(TOOLCHANGE_FIL_SWAP_RETRACT_SPEED)
  684. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FIL_SWAP_RETRACT_SPEED. Please update your Configuration."
  685. #elif !defined(TOOLCHANGE_FIL_SWAP_PRIME_SPEED)
  686. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FIL_SWAP_PRIME_SPEED. Please update your Configuration."
  687. #endif
  688. #endif
  689. #if ENABLED(TOOLCHANGE_PARK)
  690. #ifndef TOOLCHANGE_PARK_XY
  691. #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY. Please update your Configuration."
  692. #elif !defined(TOOLCHANGE_PARK_XY_FEEDRATE)
  693. #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY_FEEDRATE. Please update your Configuration."
  694. #endif
  695. #endif
  696. #ifndef TOOLCHANGE_ZRAISE
  697. #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1. Please update your Configuration_adv.h."
  698. #endif
  699. #elif ENABLED(MK2_MULTIPLEXER)
  700. #error "MK2_MULTIPLEXER requires 2 or more EXTRUDERS."
  701. #elif ENABLED(SINGLENOZZLE)
  702. #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
  703. #endif
  704. /**
  705. * Sanity checking for the Průša MK2 Multiplexer
  706. */
  707. #ifdef SNMM
  708. #error "SNMM is now MK2_MULTIPLEXER. Please update your configuration."
  709. #endif
  710. /**
  711. * A Dual Nozzle carriage with switching servo
  712. */
  713. #if ENABLED(SWITCHING_NOZZLE)
  714. #if ENABLED(DUAL_X_CARRIAGE)
  715. #error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible."
  716. #elif ENABLED(SINGLENOZZLE)
  717. #error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible."
  718. #elif EXTRUDERS != 2
  719. #error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
  720. #elif NUM_SERVOS < 1
  721. #error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1."
  722. #endif
  723. #ifndef SWITCHING_NOZZLE_SERVO_NR
  724. #error "SWITCHING_NOZZLE requires SWITCHING_NOZZLE_SERVO_NR."
  725. #elif SWITCHING_NOZZLE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  726. #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
  727. #elif SWITCHING_NOZZLE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  728. #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
  729. #elif SWITCHING_NOZZLE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  730. #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
  731. #elif SWITCHING_NOZZLE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  732. #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
  733. #endif
  734. #ifdef SWITCHING_NOZZLE_E1_SERVO_NR
  735. #if SWITCHING_NOZZLE_E1_SERVO_NR == SWITCHING_NOZZLE_SERVO_NR
  736. #error "SWITCHING_NOZZLE_E1_SERVO_NR must be different from SWITCHING_NOZZLE_SERVO_NR."
  737. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  738. #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
  739. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  740. #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
  741. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  742. #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
  743. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  744. #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
  745. #endif
  746. #endif
  747. #endif
  748. /**
  749. * Single Stepper Dual Extruder with switching servo
  750. */
  751. #if ENABLED(SWITCHING_EXTRUDER)
  752. #if NUM_SERVOS < 1
  753. #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
  754. #elif SWITCHING_EXTRUDER_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  755. #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
  756. #elif SWITCHING_EXTRUDER_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  757. #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
  758. #elif SWITCHING_EXTRUDER_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  759. #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
  760. #elif SWITCHING_EXTRUDER_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  761. #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
  762. #endif
  763. #if EXTRUDERS > 3
  764. #if NUM_SERVOS < 2
  765. #error "SWITCHING_EXTRUDER with 4 extruders requires NUM_SERVOS >= 2."
  766. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  767. #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
  768. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  769. #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
  770. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  771. #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
  772. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  773. #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
  774. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == SWITCHING_EXTRUDER_SERVO_NR
  775. #error "SWITCHING_EXTRUDER_E23_SERVO_NR should be a different extruder from SWITCHING_EXTRUDER_SERVO_NR."
  776. #endif
  777. #endif
  778. #endif
  779. /**
  780. * Mixing Extruder requirements
  781. */
  782. #if ENABLED(MIXING_EXTRUDER)
  783. #if EXTRUDERS > 1
  784. #error "MIXING_EXTRUDER currently only supports one extruder."
  785. #elif MIXING_STEPPERS < 2
  786. #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
  787. #elif ENABLED(FILAMENT_SENSOR)
  788. #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway."
  789. #elif ENABLED(SWITCHING_EXTRUDER)
  790. #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both."
  791. #elif ENABLED(SINGLENOZZLE)
  792. #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE."
  793. #endif
  794. #endif
  795. /**
  796. * Linear Advance 1.5 - Check K value range
  797. */
  798. #if ENABLED(LIN_ADVANCE)
  799. static_assert(
  800. WITHIN(LIN_ADVANCE_K, 0, 10),
  801. "LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)."
  802. );
  803. #endif
  804. /**
  805. * Special tool-changing options
  806. */
  807. #if 1 < 0 \
  808. + ENABLED(SINGLENOZZLE) \
  809. + ENABLED(DUAL_X_CARRIAGE) \
  810. + ENABLED(PARKING_EXTRUDER) \
  811. + ENABLED(MAGNETIC_PARKING_EXTRUDER) \
  812. + ENABLED(SWITCHING_TOOLHEAD) \
  813. + ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) \
  814. + ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  815. #error "Please select only one of SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, or ELECTROMAGNETIC_SWITCHING_TOOLHEAD."
  816. #endif
  817. /**
  818. * (Magnetic) Parking Extruder requirements
  819. */
  820. #if ANY(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER)
  821. #if ENABLED(EXT_SOLENOID)
  822. #error "(MAGNETIC_)PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)"
  823. #elif EXTRUDERS != 2
  824. #error "(MAGNETIC_)PARKING_EXTRUDER requires exactly 2 EXTRUDERS."
  825. #elif !defined(PARKING_EXTRUDER_PARKING_X)
  826. #error "(MAGNETIC_)PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X."
  827. #elif !defined(TOOLCHANGE_ZRAISE)
  828. #error "(MAGNETIC_)PARKING_EXTRUDER requires TOOLCHANGE_ZRAISE."
  829. #elif TOOLCHANGE_ZRAISE < 0
  830. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  831. #elif ENABLED(PARKING_EXTRUDER)
  832. #if !PIN_EXISTS(SOL0, SOL1)
  833. #error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN."
  834. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH)
  835. #error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW."
  836. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000)
  837. #error "PARKING_EXTRUDER_SOLENOIDS_DELAY must be between 0 and 2000 (ms)."
  838. #endif
  839. #endif
  840. #endif
  841. /**
  842. * Switching Toolhead requirements
  843. */
  844. #if ENABLED(SWITCHING_TOOLHEAD)
  845. #if !defined(SWITCHING_TOOLHEAD_SERVO_NR)
  846. #error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SERVO_NR."
  847. #elif EXTRUDERS < 2
  848. #error "SWITCHING_TOOLHEAD requires at least 2 EXTRUDERS."
  849. #elif NUM_SERVOS < (SWITCHING_TOOLHEAD_SERVO_NR - 1)
  850. #if SWITCHING_TOOLHEAD_SERVO_NR == 0
  851. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 0 requires NUM_SERVOS >= 1."
  852. #elif SWITCHING_TOOLHEAD_SERVO_NR == 1
  853. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 1 requires NUM_SERVOS >= 2."
  854. #elif SWITCHING_TOOLHEAD_SERVO_NR == 2
  855. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 2 requires NUM_SERVOS >= 3."
  856. #elif SWITCHING_TOOLHEAD_SERVO_NR == 3
  857. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 3 requires NUM_SERVOS >= 4."
  858. #endif
  859. #elif !defined(TOOLCHANGE_ZRAISE)
  860. #error "SWITCHING_TOOLHEAD requires TOOLCHANGE_ZRAISE."
  861. #elif TOOLCHANGE_ZRAISE < 0
  862. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  863. #endif
  864. #endif
  865. #if ANY(MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  866. #if ENABLED(EXT_SOLENOID)
  867. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD and EXT_SOLENOID are incompatible. (Pins are used twice.)"
  868. #elif !PIN_EXISTS(SOL0)
  869. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SOL0_PIN."
  870. #elif !defined(SWITCHING_TOOLHEAD_Y_POS)
  871. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_POS"
  872. #elif !defined(SWITCHING_TOOLHEAD_X_POS)
  873. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_X_POS"
  874. #elif !defined(SWITCHING_TOOLHEAD_Z_HOP)
  875. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
  876. #elif !defined(SWITCHING_TOOLHEAD_Y_CLEAR)
  877. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_CLEAR."
  878. #endif
  879. #endif
  880. /**
  881. * Part-Cooling Fan Multiplexer requirements
  882. */
  883. #if PIN_EXISTS(FANMUX1)
  884. #if !HAS_FANMUX
  885. #error "FANMUX0_PIN must be set before FANMUX1_PIN can be set."
  886. #endif
  887. #elif PIN_EXISTS(FANMUX2)
  888. #error "FANMUX0_PIN and FANMUX1_PIN must be set before FANMUX2_PIN can be set."
  889. #endif
  890. /**
  891. * Limited number of servos
  892. */
  893. #if NUM_SERVOS > NUM_SERVO_PLUGS
  894. #error "The selected board doesn't support enough servos for your configuration. Reduce NUM_SERVOS."
  895. #endif
  896. /**
  897. * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder
  898. */
  899. #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)
  900. #error "Z_PROBE_SERVO_NR, switching nozzle, switching toolhead or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE."
  901. #endif
  902. /**
  903. * Required LCD language
  904. */
  905. #if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780)
  906. #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller."
  907. #endif
  908. /**
  909. * Bed Heating Options - PID vs Limit Switching
  910. */
  911. #if BOTH(PIDTEMPBED, BED_LIMIT_SWITCHING)
  912. #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED."
  913. #endif
  914. /**
  915. * Kinematics
  916. */
  917. /**
  918. * Allow only one kinematic type to be defined
  919. */
  920. #if 1 < 0 \
  921. + ENABLED(DELTA) \
  922. + ENABLED(MORGAN_SCARA) \
  923. + ENABLED(COREXY) \
  924. + ENABLED(COREXZ) \
  925. + ENABLED(COREYZ) \
  926. + ENABLED(COREYX) \
  927. + ENABLED(COREZX) \
  928. + ENABLED(COREZY)
  929. #error "Please enable only one of DELTA, MORGAN_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY."
  930. #endif
  931. /**
  932. * Delta requirements
  933. */
  934. #if ENABLED(DELTA)
  935. #if NONE(USE_XMAX_PLUG, USE_YMAX_PLUG, USE_ZMAX_PLUG)
  936. #error "You probably want to use Max Endstops for DELTA!"
  937. #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED
  938. #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
  939. #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_LCD_MENU)
  940. #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
  941. #elif ABL_GRID
  942. #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0
  943. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
  944. #elif GRID_MAX_POINTS_X < 3
  945. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher."
  946. #endif
  947. #endif
  948. #endif
  949. /**
  950. * Probes
  951. */
  952. /**
  953. * Allow only one probe option to be defined
  954. */
  955. #if 1 < 0 \
  956. + ENABLED(PROBE_MANUALLY) \
  957. + ENABLED(FIX_MOUNTED_PROBE) \
  958. + (HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH)) \
  959. + ENABLED(BLTOUCH) \
  960. + ENABLED(TOUCH_MI_PROBE) \
  961. + ENABLED(SOLENOID_PROBE) \
  962. + ENABLED(Z_PROBE_ALLEN_KEY) \
  963. + ENABLED(Z_PROBE_SLED) \
  964. + ENABLED(RACK_AND_PINION_PROBE)
  965. #error "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
  966. #endif
  967. #if HAS_BED_PROBE
  968. static_assert(FLOOR(float(X_PROBE_OFFSET_FROM_EXTRUDER)) == float(X_PROBE_OFFSET_FROM_EXTRUDER), "X_PROBE_OFFSET_FROM_EXTRUDER must be an integer!");
  969. static_assert(FLOOR(float(Y_PROBE_OFFSET_FROM_EXTRUDER)) == float(Y_PROBE_OFFSET_FROM_EXTRUDER), "Y_PROBE_OFFSET_FROM_EXTRUDER must be an integer!");
  970. /**
  971. * Z_PROBE_SLED is incompatible with DELTA
  972. */
  973. #if BOTH(Z_PROBE_SLED, DELTA)
  974. #error "You cannot use Z_PROBE_SLED with DELTA."
  975. #endif
  976. /**
  977. * SOLENOID_PROBE requirements
  978. */
  979. #if ENABLED(SOLENOID_PROBE)
  980. #if ENABLED(EXT_SOLENOID)
  981. #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID."
  982. #elif !HAS_SOLENOID_1
  983. #error "SOLENOID_PROBE requires SOL1_PIN. It can be added to your Configuration.h."
  984. #endif
  985. #endif
  986. /**
  987. * NUM_SERVOS is required for a Z servo probe
  988. */
  989. #if HAS_Z_SERVO_PROBE
  990. #ifndef NUM_SERVOS
  991. #error "You must set NUM_SERVOS for a Z servo probe (Z_PROBE_SERVO_NR)."
  992. #elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  993. #error "SERVO0_PIN must be defined for your servo or BLTOUCH probe."
  994. #elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  995. #error "SERVO1_PIN must be defined for your servo or BLTOUCH probe."
  996. #elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  997. #error "SERVO2_PIN must be defined for your servo or BLTOUCH probe."
  998. #elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  999. #error "SERVO3_PIN must be defined for your servo or BLTOUCH probe."
  1000. #elif Z_PROBE_SERVO_NR >= NUM_SERVOS
  1001. #error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS."
  1002. #endif
  1003. #endif
  1004. #if ENABLED(BLTOUCH)
  1005. #if BLTOUCH_DELAY < 200
  1006. #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported."
  1007. #elif DISABLED(BLTOUCH_SET_5V_MODE) && NONE(ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN, ENDSTOPPULLUP_ZMIN_PROBE)
  1008. #error "BLTOUCH without BLTOUCH_SET_5V_MODE requires ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN or ENDSTOPPULLUP_ZMIN_PROBE."
  1009. #endif
  1010. #endif
  1011. #if ENABLED(RACK_AND_PINION_PROBE) && !(defined(Z_PROBE_DEPLOY_X) && defined(Z_PROBE_RETRACT_X))
  1012. #error "RACK_AND_PINION_PROBE requires Z_PROBE_DEPLOY_X and Z_PROBE_RETRACT_X."
  1013. #endif
  1014. /**
  1015. * Touch-MI probe requirements
  1016. */
  1017. #if ENABLED(TOUCH_MI_PROBE)
  1018. #if DISABLED(Z_SAFE_HOMING)
  1019. #error "TOUCH_MI_PROBE requires Z_SAFE_HOMING."
  1020. #elif !defined(TOUCH_MI_RETRACT_Z)
  1021. #error "TOUCH_MI_PROBE requires TOUCH_MI_RETRACT_Z."
  1022. #elif defined(Z_AFTER_PROBING)
  1023. #error "TOUCH_MI_PROBE requires Z_AFTER_PROBING to be disabled."
  1024. #elif Z_HOMING_HEIGHT < 10
  1025. #error "TOUCH_MI_PROBE requires Z_HOMING_HEIGHT >= 10."
  1026. #elif Z_MIN_PROBE_ENDSTOP_INVERTING
  1027. #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING to be set to false."
  1028. #elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
  1029. #error "TOUCH_MI_PROBE requires BABYSTEPPING with BABYSTEP_ZPROBE_OFFSET."
  1030. #endif
  1031. #endif
  1032. /**
  1033. * Require pin options and pins to be defined
  1034. */
  1035. #if ENABLED(SENSORLESS_PROBING)
  1036. #if ENABLED(DELTA) && !(AXIS_HAS_STALLGUARD(X) && AXIS_HAS_STALLGUARD(Y) && AXIS_HAS_STALLGUARD(Z))
  1037. #error "SENSORLESS_PROBING requires TMC2130/2160/2209/5130/5160 drivers on X, Y, and Z."
  1038. #elif !AXIS_HAS_STALLGUARD(Z)
  1039. #error "SENSORLESS_PROBING requires a TMC2130/2160/2209/5130/5160 driver on Z."
  1040. #endif
  1041. #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  1042. #if DISABLED(USE_ZMIN_PLUG)
  1043. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled."
  1044. #elif !HAS_Z_MIN
  1045. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined."
  1046. #elif Z_MIN_PROBE_ENDSTOP_INVERTING != Z_MIN_ENDSTOP_INVERTING
  1047. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING."
  1048. #endif
  1049. #elif !HAS_Z_MIN_PROBE_PIN
  1050. #error "Z_MIN_PROBE_PIN must be defined if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN is not enabled."
  1051. #endif
  1052. /**
  1053. * Make sure Z raise values are set
  1054. */
  1055. #ifndef Z_CLEARANCE_DEPLOY_PROBE
  1056. #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration."
  1057. #elif !defined(Z_CLEARANCE_BETWEEN_PROBES)
  1058. #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration."
  1059. #elif Z_CLEARANCE_DEPLOY_PROBE < 0
  1060. #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0."
  1061. #elif Z_CLEARANCE_BETWEEN_PROBES < 0
  1062. #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
  1063. #elif Z_AFTER_PROBING < 0
  1064. #error "Probes need Z_AFTER_PROBING >= 0."
  1065. #endif
  1066. #if MULTIPLE_PROBING || EXTRA_PROBING
  1067. #if !MULTIPLE_PROBING
  1068. #error "EXTRA_PROBING requires MULTIPLE_PROBING."
  1069. #elif MULTIPLE_PROBING < 2
  1070. #error "MULTIPLE_PROBING must be 2 or more."
  1071. #elif MULTIPLE_PROBING <= EXTRA_PROBING
  1072. #error "EXTRA_PROBING must be less than MULTIPLE_PROBING."
  1073. #endif
  1074. #endif
  1075. #if Z_PROBE_LOW_POINT > 0
  1076. #error "Z_PROBE_LOW_POINT must be less than or equal to 0."
  1077. #endif
  1078. #else
  1079. /**
  1080. * Require some kind of probe for bed leveling and probe testing
  1081. */
  1082. #if HAS_ABL_NOT_UBL && !PROBE_SELECTED
  1083. #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."
  1084. #endif
  1085. #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
  1086. #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."
  1087. #endif
  1088. #endif
  1089. /**
  1090. * Allow only one bed leveling option to be defined
  1091. */
  1092. #if 1 < 0 \
  1093. + ENABLED(AUTO_BED_LEVELING_LINEAR) \
  1094. + ENABLED(AUTO_BED_LEVELING_3POINT) \
  1095. + ENABLED(AUTO_BED_LEVELING_BILINEAR) \
  1096. + ENABLED(AUTO_BED_LEVELING_UBL) \
  1097. + ENABLED(MESH_BED_LEVELING)
  1098. #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."
  1099. #endif
  1100. /**
  1101. * Bed Leveling Requirements
  1102. */
  1103. #if EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT)
  1104. static_assert(WITHIN(PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_1_X is outside the probe region.");
  1105. static_assert(WITHIN(PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_2_X is outside the probe region.");
  1106. static_assert(WITHIN(PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_3_X is outside the probe region.");
  1107. static_assert(WITHIN(PROBE_PT_1_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_1_Y is outside the probe region.");
  1108. static_assert(WITHIN(PROBE_PT_2_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_2_Y is outside the probe region.");
  1109. static_assert(WITHIN(PROBE_PT_3_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_3_Y is outside the probe region.");
  1110. #endif
  1111. #if ENABLED(AUTO_BED_LEVELING_UBL)
  1112. /**
  1113. * Unified Bed Leveling
  1114. */
  1115. // Hide PROBE_MANUALLY from the rest of the code
  1116. #undef PROBE_MANUALLY
  1117. #if IS_SCARA
  1118. #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
  1119. #elif DISABLED(EEPROM_SETTINGS)
  1120. #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration."
  1121. #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
  1122. #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
  1123. #elif !defined(RESTORE_LEVELING_AFTER_G28)
  1124. #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'."
  1125. #endif
  1126. #elif HAS_ABL_NOT_UBL
  1127. /**
  1128. * Auto Bed Leveling
  1129. */
  1130. /**
  1131. * Delta and SCARA have limited bed leveling options
  1132. */
  1133. #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR)
  1134. #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option."
  1135. #endif
  1136. /**
  1137. * Check auto bed leveling probe points
  1138. */
  1139. #if ABL_GRID
  1140. static_assert(LEFT_PROBE_BED_POSITION < RIGHT_PROBE_BED_POSITION, "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION.");
  1141. static_assert(FRONT_PROBE_BED_POSITION < BACK_PROBE_BED_POSITION, "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION.");
  1142. static_assert(LEFT_PROBE_BED_POSITION >= MIN_PROBE_X, "LEFT_PROBE_BED_POSITION is outside the probe region.");
  1143. static_assert(RIGHT_PROBE_BED_POSITION <= MAX_PROBE_X, "RIGHT_PROBE_BED_POSITION is outside the probe region.");
  1144. static_assert(FRONT_PROBE_BED_POSITION >= MIN_PROBE_Y, "FRONT_PROBE_BED_POSITION is outside the probe region.");
  1145. static_assert(BACK_PROBE_BED_POSITION <= MAX_PROBE_Y, "BACK_PROBE_BED_POSITION is outside the probe region.");
  1146. #endif
  1147. #elif ENABLED(MESH_BED_LEVELING)
  1148. // Hide PROBE_MANUALLY from the rest of the code
  1149. #undef PROBE_MANUALLY
  1150. /**
  1151. * Mesh Bed Leveling
  1152. */
  1153. #if ENABLED(DELTA)
  1154. #error "MESH_BED_LEVELING is not compatible with DELTA printers."
  1155. #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9
  1156. #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
  1157. #endif
  1158. #endif
  1159. #if HAS_MESH
  1160. #if DISABLED(JUNCTION_DEVIATION)
  1161. static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
  1162. #endif
  1163. #elif ENABLED(G26_MESH_VALIDATION)
  1164. #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
  1165. #endif
  1166. #if ENABLED(MESH_EDIT_GFX_OVERLAY) && (DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(DOGLCD))
  1167. #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD."
  1168. #endif
  1169. #if ENABLED(G29_RETRY_AND_RECOVER)
  1170. #if ENABLED(AUTO_BED_LEVELING_UBL)
  1171. #error "G29_RETRY_AND_RECOVER is not compatible with UBL."
  1172. #elif ENABLED(MESH_BED_LEVELING)
  1173. #error "G29_RETRY_AND_RECOVER is not compatible with MESH_BED_LEVELING."
  1174. #endif
  1175. #endif
  1176. /**
  1177. * LCD_BED_LEVELING requirements
  1178. */
  1179. #if ENABLED(LCD_BED_LEVELING)
  1180. #if !HAS_LCD_MENU
  1181. #error "LCD_BED_LEVELING requires a programmable LCD controller."
  1182. #elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL)
  1183. #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
  1184. #endif
  1185. #endif
  1186. /**
  1187. * Homing
  1188. */
  1189. #if X_HOME_BUMP_MM < 0 || Y_HOME_BUMP_MM < 0 || Z_HOME_BUMP_MM < 0
  1190. #error "[XYZ]_HOME_BUMP_MM must be greater than or equal to 0."
  1191. #endif
  1192. #if ENABLED(CODEPENDENT_XY_HOMING)
  1193. #if ENABLED(QUICK_HOME)
  1194. #error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING."
  1195. #elif IS_KINEMATIC
  1196. #error "CODEPENDENT_XY_HOMING requires a Cartesian setup."
  1197. #endif
  1198. #endif
  1199. /**
  1200. * Make sure Z_SAFE_HOMING point is reachable
  1201. */
  1202. #if ENABLED(Z_SAFE_HOMING)
  1203. #if HAS_BED_PROBE
  1204. static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, MIN_PROBE_X, MAX_PROBE_X), "Z_SAFE_HOMING_X_POINT is outside the probe region.");
  1205. static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, MIN_PROBE_Y, MAX_PROBE_Y), "Z_SAFE_HOMING_Y_POINT is outside the probe region.");
  1206. #else
  1207. 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.");
  1208. 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.");
  1209. #endif
  1210. #endif // Z_SAFE_HOMING
  1211. /**
  1212. * Make sure DISABLE_[XYZ] compatible with selected homing options
  1213. */
  1214. #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z)
  1215. #if EITHER(HOME_AFTER_DEACTIVATE, Z_SAFE_HOMING)
  1216. #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
  1217. #endif
  1218. #endif
  1219. /**
  1220. * Filament Width Sensor
  1221. */
  1222. #if ENABLED(FILAMENT_WIDTH_SENSOR)
  1223. #if !HAS_FILAMENT_WIDTH_SENSOR
  1224. #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
  1225. #elif ENABLED(NO_VOLUMETRICS)
  1226. #error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled."
  1227. #endif
  1228. #endif
  1229. /**
  1230. * ULTIPANEL encoder
  1231. */
  1232. #if ENABLED(ULTIPANEL) && NONE(NEWPANEL, SR_LCD_2W_NL) && !defined(SHIFT_CLK)
  1233. #error "ULTIPANEL requires some kind of encoder."
  1234. #endif
  1235. #if ENCODER_PULSES_PER_STEP < 0
  1236. #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead."
  1237. #endif
  1238. /**
  1239. * SAV_3DGLCD display options
  1240. */
  1241. #if ENABLED(SAV_3DGLCD)
  1242. #if NONE(U8GLIB_SSD1306, U8GLIB_SH1106)
  1243. #error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
  1244. #elif BOTH(U8GLIB_SSD1306, U8GLIB_SH1106)
  1245. #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
  1246. #endif
  1247. #endif
  1248. /**
  1249. * Allen Key
  1250. * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
  1251. */
  1252. #if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  1253. #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY"
  1254. #endif
  1255. /**
  1256. * Dual X Carriage requirements
  1257. */
  1258. #if ENABLED(DUAL_X_CARRIAGE)
  1259. #if EXTRUDERS < 2
  1260. #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
  1261. #elif CORE_IS_XY || CORE_IS_XZ
  1262. #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, or COREZX."
  1263. #elif !(HAS_X2_ENABLE && HAS_X2_STEP && HAS_X2_DIR)
  1264. #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
  1265. #elif !HAS_X_MAX
  1266. #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop."
  1267. #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
  1268. #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
  1269. #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1
  1270. #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1."
  1271. #endif
  1272. #endif
  1273. /**
  1274. * Make sure auto fan pins don't conflict with the fan pin
  1275. */
  1276. #if HAS_AUTO_FAN
  1277. #if HAS_FAN0
  1278. #if E0_AUTO_FAN_PIN == FAN_PIN
  1279. #error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
  1280. #elif E1_AUTO_FAN_PIN == FAN_PIN
  1281. #error "You cannot set E1_AUTO_FAN_PIN equal to FAN_PIN."
  1282. #elif E2_AUTO_FAN_PIN == FAN_PIN
  1283. #error "You cannot set E2_AUTO_FAN_PIN equal to FAN_PIN."
  1284. #elif E3_AUTO_FAN_PIN == FAN_PIN
  1285. #error "You cannot set E3_AUTO_FAN_PIN equal to FAN_PIN."
  1286. #endif
  1287. #endif
  1288. #endif
  1289. #if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN
  1290. #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."
  1291. #endif
  1292. #if ENABLED(USE_CONTROLLER_FAN)
  1293. #if !HAS_CONTROLLER_FAN
  1294. #error "USE_CONTROLLER_FAN requires a CONTROLLER_FAN_PIN. Define in Configuration_adv.h."
  1295. #elif E0_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1296. #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1297. #elif E1_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1298. #error "You cannot set E1_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1299. #elif E2_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1300. #error "You cannot set E2_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1301. #elif E3_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1302. #error "You cannot set E3_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1303. #endif
  1304. #endif
  1305. /**
  1306. * Case Light requirements
  1307. */
  1308. #if ENABLED(CASE_LIGHT_ENABLE)
  1309. #if !PIN_EXISTS(CASE_LIGHT)
  1310. #error "CASE_LIGHT_ENABLE requires CASE_LIGHT_PIN to be defined."
  1311. #elif CASE_LIGHT_PIN == FAN_PIN
  1312. #error "CASE_LIGHT_PIN conflicts with FAN_PIN. Resolve before continuing."
  1313. #endif
  1314. #endif
  1315. /**
  1316. * Required custom thermistor settings
  1317. */
  1318. #if ENABLED(HEATER_0_USER_THERMISTOR) && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA))
  1319. #error "TEMP_SENSOR_0 1000 requires HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS and HOTEND0_BETA in Configuration_adv.h."
  1320. #elif ENABLED(HEATER_1_USER_THERMISTOR) && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA))
  1321. #error "TEMP_SENSOR_1 1000 requires HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS and HOTEND1_BETA in Configuration_adv.h."
  1322. #elif ENABLED(HEATER_2_USER_THERMISTOR) && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA))
  1323. #error "TEMP_SENSOR_2 1000 requires HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS and HOTEND2_BETA in Configuration_adv.h."
  1324. #elif ENABLED(HEATER_3_USER_THERMISTOR) && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA))
  1325. #error "TEMP_SENSOR_3 1000 requires HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS and HOTEND3_BETA in Configuration_adv.h."
  1326. #elif ENABLED(HEATER_4_USER_THERMISTOR) && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA))
  1327. #error "TEMP_SENSOR_4 1000 requires HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS and HOTEND4_BETA in Configuration_adv.h."
  1328. #elif ENABLED(HEATER_5_USER_THERMISTOR) && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA))
  1329. #error "TEMP_SENSOR_5 1000 requires HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS and HOTEND5_BETA in Configuration_adv.h."
  1330. #elif ENABLED(HEATER_BED_USER_THERMISTOR) && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA))
  1331. #error "TEMP_SENSOR_BED 1000 requires BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS and BED_BETA in Configuration_adv.h."
  1332. #elif ENABLED(HEATER_CHAMBER_USER_THERMISTOR) && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA))
  1333. #error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h."
  1334. #endif
  1335. /**
  1336. * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set.
  1337. */
  1338. #if !HAS_HEATER_0
  1339. #error "HEATER_0_PIN not defined for this board."
  1340. #elif !ANY_PIN(TEMP_0, MAX6675_SS)
  1341. #error "TEMP_0_PIN not defined for this board."
  1342. #elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && !PIN_EXISTS(E0_STEP, E0_DIR))
  1343. #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
  1344. #elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP, E0_DIR) || !HAS_E0_ENABLE))
  1345. #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
  1346. #elif TEMP_SENSOR_0 == 0
  1347. #error "TEMP_SENSOR_0 is required."
  1348. #endif
  1349. // Pins are required for heaters
  1350. #if ENABLED(HEATER_0_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS)
  1351. #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board."
  1352. #elif (HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)) && !HAS_HEATER_1
  1353. #error "HEATER_1_PIN not defined for this board."
  1354. #endif
  1355. #if HOTENDS > 1
  1356. #if ENABLED(HEATER_1_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS2)
  1357. #error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board."
  1358. #elif TEMP_SENSOR_1 == 0
  1359. #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
  1360. #elif !ANY_PIN(TEMP_1, MAX6675_SS2)
  1361. #error "TEMP_1_PIN not defined for this board."
  1362. #endif
  1363. #if HOTENDS > 2
  1364. #if TEMP_SENSOR_2 == 0
  1365. #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
  1366. #elif !HAS_HEATER_2
  1367. #error "HEATER_2_PIN not defined for this board."
  1368. #elif !PIN_EXISTS(TEMP_2)
  1369. #error "TEMP_2_PIN not defined for this board."
  1370. #endif
  1371. #if HOTENDS > 3
  1372. #if TEMP_SENSOR_3 == 0
  1373. #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
  1374. #elif !HAS_HEATER_3
  1375. #error "HEATER_3_PIN not defined for this board."
  1376. #elif !PIN_EXISTS(TEMP_3)
  1377. #error "TEMP_3_PIN not defined for this board."
  1378. #endif
  1379. #if HOTENDS > 4
  1380. #if TEMP_SENSOR_4 == 0
  1381. #error "TEMP_SENSOR_4 is required with 5 or more HOTENDS."
  1382. #elif !HAS_HEATER_4
  1383. #error "HEATER_4_PIN not defined for this board."
  1384. #elif !PIN_EXISTS(TEMP_4)
  1385. #error "TEMP_4_PIN not defined for this board."
  1386. #endif
  1387. #if HOTENDS > 5
  1388. #if TEMP_SENSOR_5 == 0
  1389. #error "TEMP_SENSOR_5 is required with 6 HOTENDS."
  1390. #elif !HAS_HEATER_5
  1391. #error "HEATER_5_PIN not defined for this board."
  1392. #elif !PIN_EXISTS(TEMP_5)
  1393. #error "TEMP_5_PIN not defined for this board."
  1394. #endif
  1395. #elif TEMP_SENSOR_5 != 0
  1396. #error "TEMP_SENSOR_5 shouldn't be set with only 5 HOTENDS."
  1397. #endif
  1398. #elif TEMP_SENSOR_4 != 0
  1399. #error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS."
  1400. #elif TEMP_SENSOR_5 != 0
  1401. #error "TEMP_SENSOR_5 shouldn't be set with only 4 HOTENDS."
  1402. #endif
  1403. #elif TEMP_SENSOR_3 != 0
  1404. #error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS."
  1405. #elif TEMP_SENSOR_4 != 0
  1406. #error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS."
  1407. #elif TEMP_SENSOR_5 != 0
  1408. #error "TEMP_SENSOR_5 shouldn't be set with only 3 HOTENDS."
  1409. #endif
  1410. #elif TEMP_SENSOR_2 != 0
  1411. #error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS."
  1412. #elif TEMP_SENSOR_3 != 0
  1413. #error "TEMP_SENSOR_3 shouldn't be set with only 2 HOTENDS."
  1414. #elif TEMP_SENSOR_4 != 0
  1415. #error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS."
  1416. #elif TEMP_SENSOR_5 != 0
  1417. #error "TEMP_SENSOR_5 shouldn't be set with only 2 HOTENDS."
  1418. #endif
  1419. #elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  1420. #error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND."
  1421. #elif TEMP_SENSOR_2 != 0
  1422. #error "TEMP_SENSOR_2 shouldn't be set with only 1 HOTEND."
  1423. #elif TEMP_SENSOR_3 != 0
  1424. #error "TEMP_SENSOR_3 shouldn't be set with only 1 HOTEND."
  1425. #elif TEMP_SENSOR_4 != 0
  1426. #error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND."
  1427. #elif TEMP_SENSOR_5 != 0
  1428. #error "TEMP_SENSOR_5 shouldn't be set with only 1 HOTEND."
  1429. #endif
  1430. #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0
  1431. #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
  1432. #endif
  1433. /**
  1434. * Temperature status LEDs
  1435. */
  1436. #if ENABLED(TEMP_STAT_LEDS) && !ANY_PIN(STAT_LED_RED, STAT_LED_BLUE)
  1437. #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both."
  1438. #endif
  1439. /**
  1440. * LED Control Menu
  1441. */
  1442. #if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS
  1443. #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9533, PCA9632, or NEOPIXEL_LED."
  1444. #endif
  1445. /**
  1446. * LED Backlight Timeout
  1447. */
  1448. #if defined(LED_BACKLIGHT_TIMEOUT) && !(EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && HAS_POWER_SWITCH)
  1449. #error "LED_BACKLIGHT_TIMEOUT requires a Fysetc Mini Panel and a Power Switch."
  1450. #endif
  1451. /**
  1452. * Basic multi hotend duplication mode
  1453. */
  1454. #if ENABLED(MULTI_NOZZLE_DUPLICATION)
  1455. #if HOTENDS < 2
  1456. #error "MULTI_NOZZLE_DUPLICATION requires 2 or more hotends."
  1457. #elif ENABLED(DUAL_X_CARRIAGE)
  1458. #error "MULTI_NOZZLE_DUPLICATION is incompatible with DUAL_X_CARRIAGE."
  1459. #elif ENABLED(SINGLENOZZLE)
  1460. #error "MULTI_NOZZLE_DUPLICATION is incompatible with SINGLENOZZLE."
  1461. #elif ENABLED(MIXING_EXTRUDER)
  1462. #error "MULTI_NOZZLE_DUPLICATION is incompatible with MIXING_EXTRUDER."
  1463. #elif ENABLED(SWITCHING_EXTRUDER)
  1464. #error "MULTI_NOZZLE_DUPLICATION is incompatible with SWITCHING_EXTRUDER."
  1465. #endif
  1466. #endif
  1467. /**
  1468. * Test Extruder Stepper Pins
  1469. */
  1470. #if DISABLED(MK2_MULTIPLEXER) // MK2_MULTIPLEXER uses E0 stepper only
  1471. #if E_STEPPERS
  1472. #if !(PIN_EXISTS(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
  1473. #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
  1474. #endif
  1475. #if E_STEPPERS > 1
  1476. #if !(PIN_EXISTS(E1_STEP, E1_DIR) && HAS_E1_ENABLE)
  1477. #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
  1478. #endif
  1479. #if E_STEPPERS > 2
  1480. #if !(PIN_EXISTS(E2_STEP, E2_DIR) && HAS_E2_ENABLE)
  1481. #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
  1482. #endif
  1483. #if E_STEPPERS > 3
  1484. #if !(PIN_EXISTS(E3_STEP, E3_DIR) && HAS_E3_ENABLE)
  1485. #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
  1486. #endif
  1487. #if E_STEPPERS > 4
  1488. #if !(PIN_EXISTS(E4_STEP, E4_DIR) && HAS_E4_ENABLE)
  1489. #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
  1490. #endif
  1491. #if E_STEPPERS > 5
  1492. #if !(PIN_EXISTS(E5_STEP, E5_DIR) && HAS_E5_ENABLE)
  1493. #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
  1494. #endif
  1495. #endif // E_STEPPERS > 5
  1496. #endif // E_STEPPERS > 4
  1497. #endif // E_STEPPERS > 3
  1498. #endif // E_STEPPERS > 2
  1499. #endif // E_STEPPERS > 1
  1500. #endif // E_STEPPERS
  1501. #endif
  1502. /**
  1503. * Endstop Tests
  1504. */
  1505. #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_)))
  1506. #define _AXIS_PLUG_UNUSED_TEST(AXIS) (_PLUG_UNUSED_TEST(AXIS,X) && _PLUG_UNUSED_TEST(AXIS,Y) && _PLUG_UNUSED_TEST(AXIS,Z))
  1507. // At least 3 endstop plugs must be used
  1508. #if _AXIS_PLUG_UNUSED_TEST(X)
  1509. #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG."
  1510. #endif
  1511. #if _AXIS_PLUG_UNUSED_TEST(Y)
  1512. #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG."
  1513. #endif
  1514. #if _AXIS_PLUG_UNUSED_TEST(Z)
  1515. #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG."
  1516. #endif
  1517. // Delta and Cartesian use 3 homing endstops
  1518. #if !IS_SCARA
  1519. #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG)
  1520. #error "Enable USE_XMIN_PLUG when homing X to MIN."
  1521. #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG)
  1522. #error "Enable USE_XMAX_PLUG when homing X to MAX."
  1523. #elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG)
  1524. #error "Enable USE_YMIN_PLUG when homing Y to MIN."
  1525. #elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG)
  1526. #error "Enable USE_YMAX_PLUG when homing Y to MAX."
  1527. #endif
  1528. #endif
  1529. #if Z_HOME_DIR < 0 && DISABLED(USE_ZMIN_PLUG)
  1530. #error "Enable USE_ZMIN_PLUG when homing Z to MIN."
  1531. #elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG)
  1532. #error "Enable USE_ZMAX_PLUG when homing Z to MAX."
  1533. #endif
  1534. // Dual endstops requirements
  1535. #if ENABLED(X_DUAL_ENDSTOPS)
  1536. #if !X2_USE_ENDSTOP
  1537. #error "You must set X2_USE_ENDSTOP with X_DUAL_ENDSTOPS."
  1538. #elif X2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1539. #error "USE_XMIN_PLUG is required when X2_USE_ENDSTOP is _XMIN_."
  1540. #elif X2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1541. #error "USE_XMAX_PLUG is required when X2_USE_ENDSTOP is _XMAX_."
  1542. #elif X2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1543. #error "USE_YMIN_PLUG is required when X2_USE_ENDSTOP is _YMIN_."
  1544. #elif X2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1545. #error "USE_YMAX_PLUG is required when X2_USE_ENDSTOP is _YMAX_."
  1546. #elif X2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1547. #error "USE_ZMIN_PLUG is required when X2_USE_ENDSTOP is _ZMIN_."
  1548. #elif X2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1549. #error "USE_ZMAX_PLUG is required when X2_USE_ENDSTOP is _ZMAX_."
  1550. #elif !HAS_X2_MIN && !HAS_X2_MAX
  1551. #error "X2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1552. #elif ENABLED(DELTA)
  1553. #error "X_DUAL_ENDSTOPS is not compatible with DELTA."
  1554. #endif
  1555. #endif
  1556. #if ENABLED(Y_DUAL_ENDSTOPS)
  1557. #if !Y2_USE_ENDSTOP
  1558. #error "You must set Y2_USE_ENDSTOP with Y_DUAL_ENDSTOPS."
  1559. #elif Y2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1560. #error "USE_XMIN_PLUG is required when Y2_USE_ENDSTOP is _XMIN_."
  1561. #elif Y2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1562. #error "USE_XMAX_PLUG is required when Y2_USE_ENDSTOP is _XMAX_."
  1563. #elif Y2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1564. #error "USE_YMIN_PLUG is required when Y2_USE_ENDSTOP is _YMIN_."
  1565. #elif Y2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1566. #error "USE_YMAX_PLUG is required when Y2_USE_ENDSTOP is _YMAX_."
  1567. #elif Y2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1568. #error "USE_ZMIN_PLUG is required when Y2_USE_ENDSTOP is _ZMIN_."
  1569. #elif Y2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1570. #error "USE_ZMAX_PLUG is required when Y2_USE_ENDSTOP is _ZMAX_."
  1571. #elif !HAS_Y2_MIN && !HAS_Y2_MAX
  1572. #error "Y2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1573. #elif ENABLED(DELTA)
  1574. #error "Y_DUAL_ENDSTOPS is not compatible with DELTA."
  1575. #endif
  1576. #endif
  1577. #if ENABLED(Z_DUAL_ENDSTOPS)
  1578. #if !Z2_USE_ENDSTOP
  1579. #error "You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS."
  1580. #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1581. #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_."
  1582. #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1583. #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_."
  1584. #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1585. #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_."
  1586. #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1587. #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_."
  1588. #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1589. #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_."
  1590. #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1591. #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_."
  1592. #elif !HAS_Z2_MIN && !HAS_Z2_MAX
  1593. #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1594. #elif ENABLED(DELTA)
  1595. #error "Z_DUAL_ENDSTOPS is not compatible with DELTA."
  1596. #endif
  1597. #endif
  1598. #if ENABLED(Z_TRIPLE_ENDSTOPS)
  1599. #if !Z2_USE_ENDSTOP
  1600. #error "You must set Z2_USE_ENDSTOP with Z_TRIPLE_ENDSTOPS."
  1601. #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1602. #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_."
  1603. #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1604. #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_."
  1605. #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1606. #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_."
  1607. #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1608. #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_."
  1609. #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1610. #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_."
  1611. #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1612. #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_."
  1613. #elif !HAS_Z2_MIN && !HAS_Z2_MAX
  1614. #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1615. #elif ENABLED(DELTA)
  1616. #error "Z_TRIPLE_ENDSTOPS is not compatible with DELTA."
  1617. #endif
  1618. #if !Z3_USE_ENDSTOP
  1619. #error "You must set Z3_USE_ENDSTOP with Z_TRIPLE_ENDSTOPS."
  1620. #elif Z3_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1621. #error "USE_XMIN_PLUG is required when Z3_USE_ENDSTOP is _XMIN_."
  1622. #elif Z3_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1623. #error "USE_XMAX_PLUG is required when Z3_USE_ENDSTOP is _XMAX_."
  1624. #elif Z3_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1625. #error "USE_YMIN_PLUG is required when Z3_USE_ENDSTOP is _YMIN_."
  1626. #elif Z3_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1627. #error "USE_YMAX_PLUG is required when Z3_USE_ENDSTOP is _YMAX_."
  1628. #elif Z3_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1629. #error "USE_ZMIN_PLUG is required when Z3_USE_ENDSTOP is _ZMIN_."
  1630. #elif Z3_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1631. #error "USE_ZMAX_PLUG is required when Z3_USE_ENDSTOP is _ZMAX_."
  1632. #elif !HAS_Z3_MIN && !HAS_Z3_MAX
  1633. #error "Z3_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1634. #elif ENABLED(DELTA)
  1635. #error "Z_TRIPLE_ENDSTOPS is not compatible with DELTA."
  1636. #endif
  1637. #endif
  1638. #if defined(ENDSTOP_NOISE_THRESHOLD) && !WITHIN(ENDSTOP_NOISE_THRESHOLD, 2, 7)
  1639. #error "ENDSTOP_NOISE_THRESHOLD must be an integer from 2 to 7."
  1640. #endif
  1641. /**
  1642. * emergency-command parser
  1643. */
  1644. #if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON)
  1645. #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
  1646. #endif
  1647. /**
  1648. * I2C bus
  1649. */
  1650. #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0
  1651. #if I2C_SLAVE_ADDRESS < 8
  1652. #error "I2C_SLAVE_ADDRESS can't be less than 8. (Addresses 0 - 7 are reserved.)"
  1653. #elif I2C_SLAVE_ADDRESS > 127
  1654. #error "I2C_SLAVE_ADDRESS can't be over 127. (Only 7 bits allowed.)"
  1655. #endif
  1656. #endif
  1657. /**
  1658. * G38 Probe Target
  1659. */
  1660. #if ENABLED(G38_PROBE_TARGET)
  1661. #if !HAS_BED_PROBE
  1662. #error "G38_PROBE_TARGET requires a bed probe."
  1663. #elif !IS_CARTESIAN
  1664. #error "G38_PROBE_TARGET requires a Cartesian machine."
  1665. #endif
  1666. #endif
  1667. /**
  1668. * RGB_LED Requirements
  1669. */
  1670. #define _RGB_TEST (PIN_EXISTS(RGB_LED_R, RGB_LED_G, RGB_LED_B))
  1671. #if ENABLED(PRINTER_EVENT_LEDS) && !HAS_COLOR_LEDS
  1672. #error "PRINTER_EVENT_LEDS requires BLINKM, PCA9533, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED."
  1673. #elif ENABLED(RGB_LED)
  1674. #if !_RGB_TEST
  1675. #error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN."
  1676. #elif ENABLED(RGBW_LED)
  1677. #error "Please enable only one of RGB_LED and RGBW_LED."
  1678. #endif
  1679. #elif ENABLED(RGBW_LED)
  1680. #if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W))
  1681. #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN."
  1682. #endif
  1683. #elif ENABLED(NEOPIXEL_LED)
  1684. #if !(PIN_EXISTS(NEOPIXEL) && NEOPIXEL_PIXELS > 0)
  1685. #error "NEOPIXEL_LED requires NEOPIXEL_PIN and NEOPIXEL_PIXELS."
  1686. #endif
  1687. #endif
  1688. #undef _RGB_TEST
  1689. /**
  1690. * Auto Fan check for PWM pins
  1691. */
  1692. #if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255
  1693. #define AF_ERR_SUFF "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255."
  1694. #if HAS_AUTO_FAN_0
  1695. static_assert(PWM_PIN(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF);
  1696. #elif HAS_AUTO_FAN_1
  1697. static_assert(PWM_PIN(E1_AUTO_FAN_PIN), "E1" AF_ERR_SUFF);
  1698. #elif HAS_AUTO_FAN_2
  1699. static_assert(PWM_PIN(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF);
  1700. #elif HAS_AUTO_FAN_3
  1701. static_assert(PWM_PIN(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF);
  1702. #endif
  1703. #endif
  1704. /**
  1705. * Make sure only one display is enabled
  1706. *
  1707. * Note: BQ_LCD_SMART_CONTROLLER => REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  1708. * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER => REPRAP_DISCOUNT_SMART_CONTROLLER
  1709. * SAV_3DGLCD => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
  1710. * MKS_12864OLED => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
  1711. * MKS_12864OLED_SSD1306 => U8GLIB_SSD1306 => ULTIMAKERCONTROLLER
  1712. * MKS_MINI_12864 => MINIPANEL
  1713. * miniVIKI => ULTIMAKERCONTROLLER
  1714. * VIKI2 => ULTIMAKERCONTROLLER
  1715. * ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER
  1716. * AZSMZ_12864 => ULTIMAKERCONTROLLER
  1717. * PANEL_ONE => ULTIMAKERCONTROLLER
  1718. */
  1719. #if 1 < 0 \
  1720. + ( ENABLED(ULTIMAKERCONTROLLER) \
  1721. && DISABLED(SAV_3DGLCD) \
  1722. && DISABLED(miniVIKI) \
  1723. && DISABLED(VIKI2) \
  1724. && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  1725. && DISABLED(AZSMZ_12864) \
  1726. && DISABLED(PANEL_ONE) \
  1727. && DISABLED(MKS_12864OLED) \
  1728. && DISABLED(MKS_12864OLED_SSD1306) ) \
  1729. + ( ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
  1730. && DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
  1731. && DISABLED(LCD_FOR_MELZI) \
  1732. && DISABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
  1733. && DISABLED(MKS_12864OLED) \
  1734. && DISABLED(MKS_12864OLED_SSD1306) ) \
  1735. + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(BQ_LCD_SMART_CONTROLLER)) \
  1736. + ENABLED(LCD_FOR_MELZI) \
  1737. + ENABLED(MKS_12864OLED) \
  1738. + ENABLED(MKS_12864OLED_SSD1306) \
  1739. + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
  1740. + ENABLED(CARTESIO_UI) \
  1741. + ENABLED(PANEL_ONE) \
  1742. + ENABLED(MAKRPANEL) \
  1743. + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \
  1744. + ENABLED(VIKI2) \
  1745. + ENABLED(miniVIKI) \
  1746. + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  1747. + ENABLED(AZSMZ_12864) \
  1748. + ENABLED(G3D_PANEL) \
  1749. + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \
  1750. + ENABLED(MKS_MINI_12864) \
  1751. + ENABLED(FYSETC_MINI_12864_X_X) \
  1752. + ENABLED(FYSETC_MINI_12864_1_2) \
  1753. + ENABLED(FYSETC_MINI_12864_2_0) \
  1754. + ENABLED(FYSETC_MINI_12864_2_1) \
  1755. + (ENABLED(REPRAPWORLD_KEYPAD) && NONE(CARTESIO_UI, ZONESTAR_LCD)) \
  1756. + ENABLED(RIGIDBOT_PANEL) \
  1757. + ENABLED(RA_CONTROL_PANEL) \
  1758. + ENABLED(LCD_SAINSMART_I2C_1602) \
  1759. + ENABLED(LCD_SAINSMART_I2C_2004) \
  1760. + ENABLED(LCM1602) \
  1761. + ENABLED(LCD_I2C_PANELOLU2) \
  1762. + ENABLED(LCD_I2C_VIKI) \
  1763. + (ENABLED(U8GLIB_SSD1306) && NONE(OLED_PANEL_TINYBOY2, MKS_12864OLED_SSD1306)) \
  1764. + ENABLED(SAV_3DLCD) \
  1765. + ENABLED(BQ_LCD_SMART_CONTROLLER) \
  1766. + ENABLED(SAV_3DGLCD) \
  1767. + ENABLED(OLED_PANEL_TINYBOY2) \
  1768. + ENABLED(ZONESTAR_LCD) \
  1769. + ENABLED(ULTI_CONTROLLER) \
  1770. + ENABLED(MALYAN_LCD) \
  1771. + ENABLED(DGUS_LCD) \
  1772. + (ENABLED(EXTENSIBLE_UI) && NONE(MALYAN_LCD, DGUS_LCD))
  1773. #error "Please select no more than one LCD controller option."
  1774. #endif
  1775. /**
  1776. * FYSETC Mini 12864 RGB backlighting required
  1777. */
  1778. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED)
  1779. #error "RGB_LED is required for FYSETC_MINI_12864 1.2 and 2.0."
  1780. #elif EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && DISABLED(LED_USER_PRESET_STARTUP)
  1781. #error "LED_USER_PRESET_STARTUP is required for FYSETC_MINI_12864 2.x displays."
  1782. #endif
  1783. /**
  1784. * Check existing CS pins against enabled TMC SPI drivers.
  1785. */
  1786. #define INVALID_TMC_SPI(ST) (AXIS_HAS_SPI && !PIN_EXISTS(ST##_CS))
  1787. #if INVALID_TMC_SPI(X)
  1788. #error "An SPI driven TMC driver on X requires X_CS_PIN."
  1789. #elif INVALID_TMC_SPI(X2)
  1790. #error "An SPI driven TMC driver on X2 requires X2_CS_PIN."
  1791. #elif INVALID_TMC_SPI(Y)
  1792. #error "An SPI driven TMC driver on Y requires Y_CS_PIN."
  1793. #elif INVALID_TMC_SPI(Y2)
  1794. #error "An SPI driven TMC driver on Y2 requires Y2_CS_PIN."
  1795. #elif INVALID_TMC_SPI(Z)
  1796. #error "An SPI driven TMC driver on Z requires Z_CS_PIN."
  1797. #elif INVALID_TMC_SPI(Z2)
  1798. #error "An SPI driven TMC driver on Z2 requires Z2_CS_PIN."
  1799. #elif INVALID_TMC_SPI(Z3)
  1800. #error "An SPI driven TMC driver on Z3 requires Z3_CS_PIN."
  1801. #elif INVALID_TMC_SPI(E0)
  1802. #error "An SPI driven TMC driver on E0 requires E0_CS_PIN."
  1803. #elif INVALID_TMC_SPI(E1)
  1804. #error "An SPI driven TMC driver on E1 requires E1_CS_PIN."
  1805. #elif INVALID_TMC_SPI(E2)
  1806. #error "An SPI driven TMC driver on E2 requires E2_CS_PIN."
  1807. #elif INVALID_TMC_SPI(E3)
  1808. #error "An SPI driven TMC driver on E3 requires E3_CS_PIN."
  1809. #elif INVALID_TMC_SPI(E4)
  1810. #error "An SPI driven TMC driver on E4 requires E4_CS_PIN."
  1811. #elif INVALID_TMC_SPI(E5)
  1812. #error "An SPI driven TMC driver on E5 requires E5_CS_PIN."
  1813. #endif
  1814. #undef INVALID_TMC_SPI
  1815. /**
  1816. * Check existing RX/TX pins against enable TMC UART drivers.
  1817. */
  1818. #define INVALID_TMC_UART(ST) (AXIS_HAS_UART(ST) && !(defined(ST##_HARDWARE_SERIAL) || (PIN_EXISTS(ST##_SERIAL_RX, ST##_SERIAL_TX))))
  1819. #if INVALID_TMC_UART(X)
  1820. #error "TMC2208 or TMC2209 on X requires X_HARDWARE_SERIAL or X_SERIAL_(RX|TX)_PIN."
  1821. #elif INVALID_TMC_UART(X2)
  1822. #error "TMC2208 or TMC2209 on X2 requires X2_HARDWARE_SERIAL or X2_SERIAL_(RX|TX)_PIN."
  1823. #elif INVALID_TMC_UART(Y)
  1824. #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL_(RX|TX)_PIN."
  1825. #elif INVALID_TMC_UART(Y2)
  1826. #error "TMC2208 or TMC2209 on Y2 requires Y2_HARDWARE_SERIAL or Y2_SERIAL_(RX|TX)_PIN."
  1827. #elif INVALID_TMC_UART(Z)
  1828. #error "TMC2208 or TMC2209 on Z requires Z_HARDWARE_SERIAL or Z_SERIAL_(RX|TX)_PIN."
  1829. #elif INVALID_TMC_UART(Z2)
  1830. #error "TMC2208 or TMC2209 on Z2 requires Z2_HARDWARE_SERIAL or Z2_SERIAL_(RX|TX)_PIN."
  1831. #elif INVALID_TMC_UART(Z3)
  1832. #error "TMC2208 or TMC2209 on Z3 requires Z3_HARDWARE_SERIAL or Z3_SERIAL_(RX|TX)_PIN."
  1833. #elif INVALID_TMC_UART(E0)
  1834. #error "TMC2208 or TMC2209 on E0 requires E0_HARDWARE_SERIAL or E0_SERIAL_(RX|TX)_PIN."
  1835. #elif INVALID_TMC_UART(E1)
  1836. #error "TMC2208 or TMC2209 on E1 requires E1_HARDWARE_SERIAL or E1_SERIAL_(RX|TX)_PIN."
  1837. #elif INVALID_TMC_UART(E2)
  1838. #error "TMC2208 or TMC2209 on E2 requires E2_HARDWARE_SERIAL or E2_SERIAL_(RX|TX)_PIN."
  1839. #elif INVALID_TMC_UART(E3)
  1840. #error "TMC2208 or TMC2209 on E3 requires E3_HARDWARE_SERIAL or E3_SERIAL_(RX|TX)_PIN."
  1841. #elif INVALID_TMC_UART(E4)
  1842. #error "TMC2208 or TMC2209 on E4 requires E4_HARDWARE_SERIAL or E4_SERIAL_(RX|TX)_PIN."
  1843. #elif INVALID_TMC_UART(E5)
  1844. #error "TMC2208 or TMC2209 on E5 requires E5_HARDWARE_SERIAL or E5_SERIAL_(RX|TX)_PIN."
  1845. #endif
  1846. #undef INVALID_TMC_UART
  1847. /**
  1848. * TMC2209 slave address values
  1849. */
  1850. #define INVALID_TMC_ADDRESS(ST) static_assert(0 <= ST##_SLAVE_ADDRESS && ST##_SLAVE_ADDRESS <= 3, "TMC2209 slave address must be 0, 1, 2 or 3")
  1851. #if AXIS_DRIVER_TYPE_X(TMC2209)
  1852. INVALID_TMC_ADDRESS(X);
  1853. #elif AXIS_DRIVER_TYPE_X2(TMC2209)
  1854. INVALID_TMC_ADDRESS(X2);
  1855. #elif AXIS_DRIVER_TYPE_Y(TMC2209)
  1856. INVALID_TMC_ADDRESS(Y);
  1857. #elif AXIS_DRIVER_TYPE_Y2(TMC2209)
  1858. INVALID_TMC_ADDRESS(Y2);
  1859. #elif AXIS_DRIVER_TYPE_Z(TMC2209)
  1860. INVALID_TMC_ADDRESS(Z);
  1861. #elif AXIS_DRIVER_TYPE_Z2(TMC2209)
  1862. INVALID_TMC_ADDRESS(Z2);
  1863. #elif AXIS_DRIVER_TYPE_Z3(TMC2209)
  1864. INVALID_TMC_ADDRESS(Z3);
  1865. #elif AXIS_DRIVER_TYPE_E0(TMC2209)
  1866. INVALID_TMC_ADDRESS(E0);
  1867. #elif AXIS_DRIVER_TYPE_E1(TMC2209)
  1868. INVALID_TMC_ADDRESS(E1);
  1869. #elif AXIS_DRIVER_TYPE_E2(TMC2209)
  1870. INVALID_TMC_ADDRESS(E2);
  1871. #elif AXIS_DRIVER_TYPE_E3(TMC2209)
  1872. INVALID_TMC_ADDRESS(E3);
  1873. #elif AXIS_DRIVER_TYPE_E4(TMC2209)
  1874. INVALID_TMC_ADDRESS(E4);
  1875. #elif AXIS_DRIVER_TYPE_E5(TMC2209)
  1876. INVALID_TMC_ADDRESS(E5);
  1877. #endif
  1878. #undef INVALID_TMC_ADDRESS
  1879. /**
  1880. * TMC2208/2209 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI)
  1881. */
  1882. #if (HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209)) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \
  1883. defined(X_HARDWARE_SERIAL ) \
  1884. || defined(X2_HARDWARE_SERIAL) \
  1885. || defined(Y_HARDWARE_SERIAL ) \
  1886. || defined(Y2_HARDWARE_SERIAL) \
  1887. || defined(Z_HARDWARE_SERIAL ) \
  1888. || defined(Z2_HARDWARE_SERIAL) \
  1889. || defined(Z3_HARDWARE_SERIAL) \
  1890. || defined(E0_HARDWARE_SERIAL) \
  1891. || defined(E1_HARDWARE_SERIAL) \
  1892. || defined(E2_HARDWARE_SERIAL) \
  1893. || defined(E3_HARDWARE_SERIAL) \
  1894. || defined(E4_HARDWARE_SERIAL) \
  1895. || defined(E5_HARDWARE_SERIAL) )
  1896. #error "Select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE."
  1897. #endif
  1898. /**
  1899. * TMC2208/2209 software UART is only supported on AVR and LPC
  1900. */
  1901. #if (HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209)) && !defined(__AVR__) && !defined(TARGET_LPC1768) && !( \
  1902. defined(X_HARDWARE_SERIAL ) \
  1903. || defined(X2_HARDWARE_SERIAL) \
  1904. || defined(Y_HARDWARE_SERIAL ) \
  1905. || defined(Y2_HARDWARE_SERIAL) \
  1906. || defined(Z_HARDWARE_SERIAL ) \
  1907. || defined(Z2_HARDWARE_SERIAL) \
  1908. || defined(E0_HARDWARE_SERIAL) \
  1909. || defined(E1_HARDWARE_SERIAL) \
  1910. || defined(E2_HARDWARE_SERIAL) \
  1911. || defined(E3_HARDWARE_SERIAL) \
  1912. || defined(E4_HARDWARE_SERIAL) \
  1913. || defined(E5_HARDWARE_SERIAL) )
  1914. #error "TMC2208 Software Serial is supported only on AVR and LPC1768 platforms."
  1915. #endif
  1916. #if ENABLED(SENSORLESS_HOMING)
  1917. // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop
  1918. // is necessary in order to reset the stallGuard indication between the initial movement of all three
  1919. // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of
  1920. // clearing the stallGuard activated status is found.
  1921. // Stall detection DIAG = HIGH : TMC2209
  1922. // Stall detection DIAG = LOW : TMC2130/TMC2160/TMC2660/TMC5130/TMC5160
  1923. #define X_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(X,TMC2209)
  1924. #define Y_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Y,TMC2209)
  1925. #define Z_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Z,TMC2209)
  1926. #if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z)
  1927. #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z."
  1928. #elif X_SENSORLESS && X_HOME_DIR == -1 && (X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMIN))
  1929. #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMIN when homing to X_MIN."
  1930. #elif X_SENSORLESS && X_HOME_DIR == 1 && (X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMAX))
  1931. #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMAX when homing to X_MAX."
  1932. #elif Y_SENSORLESS && Y_HOME_DIR == -1 && (Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMIN))
  1933. #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMIN when homing to Y_MIN."
  1934. #elif Y_SENSORLESS && Y_HOME_DIR == 1 && (Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMAX))
  1935. #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMAX when homing to Y_MAX."
  1936. #elif Z_SENSORLESS && Z_HOME_DIR == -1 && (Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMIN))
  1937. #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMIN when homing to Z_MIN."
  1938. #elif Z_SENSORLESS && Z_HOME_DIR == 1 && (Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMAX))
  1939. #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMAX when homing to Z_MAX."
  1940. #elif ENDSTOP_NOISE_THRESHOLD
  1941. #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD."
  1942. #elif !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS)
  1943. #error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, or Z axes."
  1944. #endif
  1945. #undef X_ENDSTOP_INVERTING
  1946. #undef Y_ENDSTOP_INVERTING
  1947. #undef Z_ENDSTOP_INVERTING
  1948. #endif
  1949. // Sensorless probing requirements
  1950. #if ENABLED(SENSORLESS_PROBING)
  1951. #if ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS)
  1952. #error "SENSORLESS_PROBING for DELTA requires TMC stepper drivers with StallGuard on X, Y, and Z axes."
  1953. #elif !Z_SENSORLESS
  1954. #error "SENSORLESS_PROBING requires a TMC stepper driver with StallGuard on Z."
  1955. #endif
  1956. #endif
  1957. // Sensorless homing is required for both combined steppers in an H-bot
  1958. #if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS
  1959. #error "CoreXY requires both X and Y to use sensorless homing if either does."
  1960. #elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS
  1961. #error "CoreXZ requires both X and Z to use sensorless homing if either does."
  1962. #elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS
  1963. #error "CoreYZ requires both Y and Z to use sensorless homing if either does."
  1964. #endif
  1965. // Other TMC feature requirements
  1966. #if ENABLED(HYBRID_THRESHOLD) && !STEALTHCHOP_ENABLED
  1967. #error "Enable STEALTHCHOP_(XY|Z|E) to use HYBRID_THRESHOLD."
  1968. #elif ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD
  1969. #error "SENSORLESS_HOMING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
  1970. #elif ENABLED(SENSORLESS_PROBING) && !HAS_STALLGUARD
  1971. #error "SENSORLESS_PROBING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
  1972. #elif STEALTHCHOP_ENABLED && !HAS_STEALTHCHOP
  1973. #error "STEALTHCHOP requires TMC2130, TMC2160, TMC2208, TMC2209, or TMC5160 stepper drivers."
  1974. #endif
  1975. #if ENABLED(DELTA) && (ENABLED(STEALTHCHOP_XY) != ENABLED(STEALTHCHOP_Z))
  1976. #error "STEALTHCHOP_XY and STEALTHCHOP_Z must be the same on DELTA."
  1977. #endif
  1978. /**
  1979. * Digipot requirement
  1980. */
  1981. #if ENABLED(DIGIPOT_MCP4018)
  1982. #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
  1983. || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)
  1984. #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined."
  1985. #endif
  1986. #endif
  1987. /**
  1988. * Check per-axis initializers for errors
  1989. */
  1990. constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT,
  1991. sanity_arr_2[] = DEFAULT_MAX_FEEDRATE,
  1992. sanity_arr_3[] = DEFAULT_MAX_ACCELERATION;
  1993. #define _ARR_TEST(N,I) (sanity_arr_##N[_MIN(I,int(COUNT(sanity_arr_##N))-1)] > 0)
  1994. static_assert(COUNT(sanity_arr_1) >= XYZE, "DEFAULT_AXIS_STEPS_PER_UNIT requires X, Y, Z and E elements.");
  1995. 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?)");
  1996. static_assert( _ARR_TEST(1,0) && _ARR_TEST(1,1) && _ARR_TEST(1,2)
  1997. && _ARR_TEST(1,3) && _ARR_TEST(1,4) && _ARR_TEST(1,5)
  1998. && _ARR_TEST(1,6) && _ARR_TEST(1,7) && _ARR_TEST(1,8),
  1999. "DEFAULT_AXIS_STEPS_PER_UNIT values must be positive.");
  2000. static_assert(COUNT(sanity_arr_2) >= XYZE, "DEFAULT_MAX_FEEDRATE requires X, Y, Z and E elements.");
  2001. static_assert(COUNT(sanity_arr_2) <= XYZE_N, "DEFAULT_MAX_FEEDRATE has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)");
  2002. static_assert( _ARR_TEST(2,0) && _ARR_TEST(2,1) && _ARR_TEST(2,2)
  2003. && _ARR_TEST(2,3) && _ARR_TEST(2,4) && _ARR_TEST(2,5)
  2004. && _ARR_TEST(2,6) && _ARR_TEST(2,7) && _ARR_TEST(2,8),
  2005. "DEFAULT_MAX_FEEDRATE values must be positive.");
  2006. static_assert(COUNT(sanity_arr_3) >= XYZE, "DEFAULT_MAX_ACCELERATION requires X, Y, Z and E elements.");
  2007. static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)");
  2008. static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
  2009. && _ARR_TEST(3,3) && _ARR_TEST(3,4) && _ARR_TEST(3,5)
  2010. && _ARR_TEST(3,6) && _ARR_TEST(3,7) && _ARR_TEST(3,8),
  2011. "DEFAULT_MAX_ACCELERATION values must be positive.");
  2012. #undef _ARR_TEST
  2013. #if BOTH(CNC_COORDINATE_SYSTEMS, NO_WORKSPACE_OFFSETS)
  2014. #error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS."
  2015. #endif
  2016. #if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE)
  2017. #error "BLOCK_BUFFER_SIZE must be a power of 2."
  2018. #endif
  2019. #if ENABLED(LED_CONTROL_MENU) && DISABLED(ULTIPANEL)
  2020. #error "LED_CONTROL_MENU requires an LCD controller."
  2021. #endif
  2022. #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED)
  2023. #error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED."
  2024. #endif
  2025. #if ENABLED(SKEW_CORRECTION)
  2026. #if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD))
  2027. #error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD."
  2028. #endif
  2029. #if ENABLED(SKEW_CORRECTION_FOR_Z)
  2030. #if !defined(XZ_SKEW_FACTOR) && !(defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD))
  2031. #error "SKEW_CORRECTION requires XZ_SKEW_FACTOR or XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD."
  2032. #endif
  2033. #if !defined(YZ_SKEW_FACTOR) && !(defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD))
  2034. #error "SKEW_CORRECTION requires YZ_SKEW_FACTOR or YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD."
  2035. #endif
  2036. #endif
  2037. #endif
  2038. #if ENABLED(POWER_LOSS_RECOVERY) && DISABLED(ULTIPANEL)
  2039. #error "POWER_LOSS_RECOVERY currently requires an LCD Controller."
  2040. #endif
  2041. #if ENABLED(Z_STEPPER_AUTO_ALIGN)
  2042. #if !Z_MULTI_STEPPER_DRIVERS
  2043. #error "Z_STEPPER_AUTO_ALIGN requires Z_DUAL_STEPPER_DRIVERS or Z_TRIPLE_STEPPER_DRIVERS."
  2044. #elif !HAS_BED_PROBE
  2045. #error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe."
  2046. #endif
  2047. constexpr float sanity_arr_z_align_x[] = Z_STEPPER_ALIGN_X, sanity_arr_z_align_y[] = Z_STEPPER_ALIGN_Y;
  2048. static_assert(
  2049. COUNT(sanity_arr_z_align_x) == Z_STEPPER_COUNT && COUNT(sanity_arr_z_align_y) == Z_STEPPER_COUNT,
  2050. "Z_STEPPER_ALIGN_[XY]POS settings require one element per Z stepper."
  2051. );
  2052. #endif
  2053. #if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS)
  2054. #error "PRINTCOUNTER requires EEPROM_SETTINGS. Please update your Configuration."
  2055. #endif
  2056. #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PIN_EXISTS(USB_CS, USB_INTR)
  2057. #error "USB_CS_PIN and USB_INTR_PIN are required for USB_FLASH_DRIVE_SUPPORT."
  2058. #endif
  2059. #if ENABLED(SD_FIRMWARE_UPDATE) && !defined(__AVR_ATmega2560__)
  2060. #error "SD_FIRMWARE_UPDATE requires an ATmega2560-based (Arduino Mega) board."
  2061. #endif
  2062. #if ENABLED(GCODE_MACROS) && !WITHIN(GCODE_MACROS_SLOTS, 1, 10)
  2063. #error "GCODE_MACROS_SLOTS must be a number from 1 to 10."
  2064. #endif
  2065. #if ENABLED(CUSTOM_USER_MENUS)
  2066. #ifdef USER_GCODE_1
  2067. constexpr char _chr1 = USER_GCODE_1[strlen(USER_GCODE_1) - 1];
  2068. static_assert(_chr1 != '\n' && _chr1 != '\r', "USER_GCODE_1 cannot have a newline at the end. Please remove it.");
  2069. #endif
  2070. #ifdef USER_GCODE_2
  2071. constexpr char _chr2 = USER_GCODE_2[strlen(USER_GCODE_2) - 1];
  2072. static_assert(_chr2 != '\n' && _chr2 != '\r', "USER_GCODE_2 cannot have a newline at the end. Please remove it.");
  2073. #endif
  2074. #ifdef USER_GCODE_3
  2075. constexpr char _chr3 = USER_GCODE_3[strlen(USER_GCODE_3) - 1];
  2076. static_assert(_chr3 != '\n' && _chr3 != '\r', "USER_GCODE_3 cannot have a newline at the end. Please remove it.");
  2077. #endif
  2078. #ifdef USER_GCODE_4
  2079. constexpr char _chr4 = USER_GCODE_4[strlen(USER_GCODE_4) - 1];
  2080. static_assert(_chr4 != '\n' && _chr4 != '\r', "USER_GCODE_4 cannot have a newline at the end. Please remove it.");
  2081. #endif
  2082. #ifdef USER_GCODE_5
  2083. constexpr char _chr5 = USER_GCODE_5[strlen(USER_GCODE_5) - 1];
  2084. static_assert(_chr5 != '\n' && _chr5 != '\r', "USER_GCODE_5 cannot have a newline at the end. Please remove it.");
  2085. #endif
  2086. #endif
  2087. #if ENABLED(BACKLASH_COMPENSATION) && IS_CORE
  2088. #error "BACKLASH_COMPENSATION is incompatible with CORE kinematics."
  2089. #endif
  2090. #if ENABLED(GRADIENT_MIX) && MIXING_VIRTUAL_TOOLS < 2
  2091. #error "GRADIENT_MIX requires 2 or more MIXING_VIRTUAL_TOOLS."
  2092. #endif
  2093. /**
  2094. * Photo G-code requirements
  2095. */
  2096. #if ENABLED(PHOTO_GCODE)
  2097. #if (PIN_EXISTS(CHDK) + PIN_EXISTS(PHOTOGRAPH_PIN) + defined(PHOTO_SWITCH_POSITION)) > 1
  2098. #error "Please define only one of CHDK_PIN, PHOTOGRAPH_PIN, or PHOTO_SWITCH_POSITION."
  2099. #elif defined(PHOTO_SWITCH_POSITION) && !defined(PHOTO_POSITION)
  2100. #error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION. Please update your Configuration_adv.h."
  2101. #elif PIN_EXISTS(CHDK) && defined(CHDK_DELAY)
  2102. #error "CHDK_DELAY has been replaced by PHOTO_SWITCH_MS. Please update your Configuration_adv.h."
  2103. #elif PIN_EXISTS(CHDK) && !defined(PHOTO_SWITCH_MS)
  2104. #error "PHOTO_SWITCH_MS is required with CHDK_PIN. Please update your Configuration_adv.h."
  2105. #elif defined(PHOTO_RETRACT_MM)
  2106. static_assert(PHOTO_RETRACT_MM + 0 >= 0, "PHOTO_RETRACT_MM must be >= 0.");
  2107. #endif
  2108. #endif
  2109. /**
  2110. * Prusa MMU2 requirements
  2111. */
  2112. #if ENABLED(PRUSA_MMU2)
  2113. #if DISABLED(NOZZLE_PARK_FEATURE)
  2114. #error "PRUSA_MMU2 requires NOZZLE_PARK_FEATURE."
  2115. #elif EXTRUDERS != 5
  2116. #error "PRUSA_MMU2 requires EXTRUDERS = 5."
  2117. #elif DISABLED(ADVANCED_PAUSE_FEATURE)
  2118. static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2.");
  2119. #endif
  2120. #endif
  2121. /**
  2122. * Advanced PRINTCOUNTER settings
  2123. */
  2124. #if ENABLED(PRINTCOUNTER)
  2125. #if defined(SERVICE_INTERVAL_1) != defined(SERVICE_NAME_1)
  2126. #error "Both SERVICE_NAME_1 and SERVICE_INTERVAL_1 are required."
  2127. #elif defined(SERVICE_INTERVAL_2) != defined(SERVICE_NAME_2)
  2128. #error "Both SERVICE_NAME_2 and SERVICE_INTERVAL_2 are required."
  2129. #elif defined(SERVICE_INTERVAL_3) != defined(SERVICE_NAME_3)
  2130. #error "Both SERVICE_NAME_3 and SERVICE_INTERVAL_3 are required."
  2131. #endif
  2132. #endif
  2133. /**
  2134. * Require soft endstops for certain setups
  2135. */
  2136. #if !BOTH(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
  2137. #if ENABLED(DUAL_X_CARRIAGE)
  2138. #error "DUAL_X_CARRIAGE requires both MIN_ and MAX_SOFTWARE_ENDSTOPS."
  2139. #elif HAS_HOTEND_OFFSET
  2140. #error "MIN_ and MAX_SOFTWARE_ENDSTOPS are both required with offset hotends."
  2141. #endif
  2142. #endif
  2143. /**
  2144. * Ensure this option is set intentionally
  2145. */
  2146. #if ENABLED(PSU_CONTROL) && !defined(PSU_ACTIVE_HIGH)
  2147. #error "PSU_CONTROL requires PSU_ACTIVE_HIGH to be defined as 'true' or 'false'."
  2148. #endif
  2149. #if HAS_CUTTER
  2150. #define _PIN_CONFLICT(P) (PIN_EXISTS(P) && P##_PIN == SPINDLE_LASER_PWM_PIN)
  2151. #if BOTH(SPINDLE_FEATURE, LASER_FEATURE)
  2152. #error "Enable only one of SPINDLE_FEATURE or LASER_FEATURE."
  2153. #elif !PIN_EXISTS(SPINDLE_LASER_ENA)
  2154. #error "(SPINDLE|LASER)_FEATURE requires SPINDLE_LASER_ENA_PIN."
  2155. #elif ENABLED(SPINDLE_CHANGE_DIR) && !PIN_EXISTS(SPINDLE_DIR)
  2156. #error "SPINDLE_DIR_PIN is required for SPINDLE_CHANGE_DIR."
  2157. #elif ENABLED(SPINDLE_LASER_PWM)
  2158. #if !defined(SPINDLE_LASER_PWM_PIN) || SPINDLE_LASER_PWM_PIN < 0
  2159. #error "SPINDLE_LASER_PWM_PIN is required for SPINDLE_LASER_PWM."
  2160. #elif !PWM_PIN(SPINDLE_LASER_PWM_PIN)
  2161. #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."
  2162. #elif SPINDLE_LASER_POWERUP_DELAY < 1
  2163. #error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0."
  2164. #elif SPINDLE_LASER_POWERDOWN_DELAY < 1
  2165. #error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0."
  2166. #elif !defined(SPINDLE_LASER_PWM_INVERT)
  2167. #error "SPINDLE_LASER_PWM_INVERT is required for (SPINDLE|LASER)_FEATURE."
  2168. #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX)
  2169. #error "SPINDLE_LASER_PWM equation constant(s) missing."
  2170. #elif _PIN_CONFLICT(X_MIN)
  2171. #error "SPINDLE_LASER_PWM pin conflicts with X_MIN_PIN."
  2172. #elif _PIN_CONFLICT(X_MAX)
  2173. #error "SPINDLE_LASER_PWM pin conflicts with X_MAX_PIN."
  2174. #elif _PIN_CONFLICT(Z_STEP)
  2175. #error "SPINDLE_LASER_PWM pin conflicts with Z_STEP_PIN."
  2176. #elif _PIN_CONFLICT(CASE_LIGHT)
  2177. #error "SPINDLE_LASER_PWM_PIN conflicts with CASE_LIGHT_PIN."
  2178. #elif _PIN_CONFLICT(E0_AUTO_FAN)
  2179. #error "SPINDLE_LASER_PWM_PIN conflicts with E0_AUTO_FAN_PIN."
  2180. #elif _PIN_CONFLICT(E1_AUTO_FAN)
  2181. #error "SPINDLE_LASER_PWM_PIN conflicts with E1_AUTO_FAN_PIN."
  2182. #elif _PIN_CONFLICT(E2_AUTO_FAN)
  2183. #error "SPINDLE_LASER_PWM_PIN conflicts with E2_AUTO_FAN_PIN."
  2184. #elif _PIN_CONFLICT(E3_AUTO_FAN)
  2185. #error "SPINDLE_LASER_PWM_PIN conflicts with E3_AUTO_FAN_PIN."
  2186. #elif _PIN_CONFLICT(E4_AUTO_FAN)
  2187. #error "SPINDLE_LASER_PWM_PIN conflicts with E4_AUTO_FAN_PIN."
  2188. #elif _PIN_CONFLICT(E5_AUTO_FAN)
  2189. #error "SPINDLE_LASER_PWM_PIN conflicts with E5_AUTO_FAN_PIN."
  2190. #elif _PIN_CONFLICT(FAN)
  2191. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN_PIN."
  2192. #elif _PIN_CONFLICT(FAN1)
  2193. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN1_PIN."
  2194. #elif _PIN_CONFLICT(FAN2)
  2195. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN2_PIN."
  2196. #elif _PIN_CONFLICT(CONTROLLERFAN)
  2197. #error "SPINDLE_LASER_PWM_PIN conflicts with CONTROLLERFAN_PIN."
  2198. #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_XY)
  2199. #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_XY."
  2200. #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_Z)
  2201. #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_Z."
  2202. #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_E)
  2203. #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_E."
  2204. #endif
  2205. #endif
  2206. #undef _PIN_CONFLICT
  2207. #endif