My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

SanityCheck.h 117KB

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