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

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