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

SanityCheck.h 147KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 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 <https://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. // Make sure macros aren't borked
  35. #define TEST1
  36. #define TEST2 1
  37. #define TEST3 0
  38. #define TEST4 true
  39. #if ENABLED(TEST0) || !ENABLED(TEST2) || ENABLED(TEST3)
  40. #error "ENABLED is borked!"
  41. #endif
  42. #if BOTH(TEST0, TEST1)
  43. #error "BOTH is borked!"
  44. #endif
  45. #if DISABLED(TEST1) || !DISABLED(TEST3) || DISABLED(TEST4) || DISABLED(TEST0, TEST1, TEST2, TEST4) || !DISABLED(TEST0, TEST3)
  46. #error "DISABLED is borked!"
  47. #endif
  48. #if !ANY(TEST1, TEST2, TEST3, TEST4) || ANY(TEST0, TEST3)
  49. #error "ANY is borked!"
  50. #endif
  51. #if NONE(TEST0, TEST1, TEST2, TEST4) || !NONE(TEST0, TEST3)
  52. #error "NONE is borked!"
  53. #endif
  54. #undef TEST1
  55. #undef TEST2
  56. #undef TEST3
  57. #undef TEST4
  58. /**
  59. * We try our best to include sanity checks for all changed configuration
  60. * directives because users have a tendency to use outdated config files with
  61. * the bleeding-edge source code, but sometimes this is not enough. This check
  62. * forces a minimum config file revision. Otherwise Marlin will not build.
  63. */
  64. #define HEXIFY(H) _CAT(0x,H)
  65. #if !defined(CONFIGURATION_H_VERSION) || HEXIFY(CONFIGURATION_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_H_VERSION)
  66. #error "You are using an old Configuration.h file, update it before building Marlin."
  67. #endif
  68. #if !defined(CONFIGURATION_ADV_H_VERSION) || HEXIFY(CONFIGURATION_ADV_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION)
  69. #error "You are using an old Configuration_adv.h file, update it before building Marlin."
  70. #endif
  71. #undef HEXIFY
  72. /**
  73. * Warnings for old configurations
  74. */
  75. #ifndef MOTHERBOARD
  76. #error "MOTHERBOARD is required."
  77. #elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE)
  78. #error "X_BED_SIZE and Y_BED_SIZE are now required!"
  79. #elif WATCH_TEMP_PERIOD > 500
  80. #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds."
  81. #elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
  82. #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS."
  83. #elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
  84. #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED."
  85. #elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE)
  86. #error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY."
  87. #elif defined(X_HOME_RETRACT_MM)
  88. #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM."
  89. #elif defined(SDCARDDETECTINVERTED)
  90. #error "SDCARDDETECTINVERTED is now SD_DETECT_STATE (HIGH)."
  91. #elif defined(SD_DETECT_INVERTED)
  92. #error "SD_DETECT_INVERTED is now SD_DETECT_STATE (HIGH)."
  93. #elif defined(BTENABLED)
  94. #error "BTENABLED is now BLUETOOTH."
  95. #elif defined(CUSTOM_MENDEL_NAME)
  96. #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME."
  97. #elif defined(HAS_AUTOMATIC_VERSIONING)
  98. #error "HAS_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE."
  99. #elif defined(USE_AUTOMATIC_VERSIONING)
  100. #error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE."
  101. #elif defined(SDSLOW)
  102. #error "SDSLOW deprecated. Set SD_SPI_SPEED to SPI_HALF_SPEED instead."
  103. #elif defined(SDEXTRASLOW)
  104. #error "SDEXTRASLOW deprecated. Set SD_SPI_SPEED to SPI_QUARTER_SPEED instead."
  105. #elif defined(FILAMENT_SENSOR)
  106. #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR."
  107. #elif defined(ENDSTOPPULLUP_FIL_RUNOUT)
  108. #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP."
  109. #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
  110. #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead."
  111. #elif defined(LANGUAGE_INCLUDE)
  112. #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE."
  113. #elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y)
  114. #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead."
  115. #elif defined(PID_PARAMS_PER_EXTRUDER)
  116. #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead."
  117. #elif defined(EXTRUDER_WATTS) || defined(BED_WATTS)
  118. #error "EXTRUDER_WATTS and BED_WATTS are deprecated and should be removed."
  119. #elif defined(SERVO_ENDSTOP_ANGLES)
  120. #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
  121. #elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
  122. #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
  123. #elif defined(Z_ENDSTOP_SERVO_NR)
  124. #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR."
  125. #elif defined(DEFAULT_XYJERK)
  126. #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead."
  127. #elif defined(XY_TRAVEL_SPEED)
  128. #error "XY_TRAVEL_SPEED is now XY_PROBE_FEEDRATE."
  129. #elif defined(XY_PROBE_SPEED)
  130. #error "XY_PROBE_SPEED is now XY_PROBE_FEEDRATE."
  131. #elif defined(Z_PROBE_SPEED_FAST)
  132. #error "Z_PROBE_SPEED_FAST is now Z_PROBE_FEEDRATE_FAST."
  133. #elif defined(Z_PROBE_SPEED_SLOW)
  134. #error "Z_PROBE_SPEED_SLOW is now Z_PROBE_FEEDRATE_SLOW."
  135. #elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
  136. #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead."
  137. #elif defined(SERVO_DEACTIVATION_DELAY)
  138. #error "SERVO_DEACTIVATION_DELAY is now SERVO_DELAY."
  139. #elif ENABLED(FILAMENTCHANGEENABLE)
  140. #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE."
  141. #elif ENABLED(FILAMENT_CHANGE_FEATURE)
  142. #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE."
  143. #elif defined(FILAMENT_CHANGE_X_POS) || defined(FILAMENT_CHANGE_Y_POS)
  144. #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT."
  145. #elif defined(FILAMENT_CHANGE_Z_ADD)
  146. #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT."
  147. #elif defined(FILAMENT_CHANGE_XY_FEEDRATE)
  148. #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE."
  149. #elif defined(FILAMENT_CHANGE_Z_FEEDRATE)
  150. #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE."
  151. #elif defined(PAUSE_PARK_X_POS) || defined(PAUSE_PARK_Y_POS)
  152. #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT."
  153. #elif defined(PAUSE_PARK_Z_ADD)
  154. #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT."
  155. #elif defined(PAUSE_PARK_XY_FEEDRATE)
  156. #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE."
  157. #elif defined(PAUSE_PARK_Z_FEEDRATE)
  158. #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE."
  159. #elif defined(FILAMENT_CHANGE_RETRACT_FEEDRATE)
  160. #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE."
  161. #elif defined(FILAMENT_CHANGE_RETRACT_LENGTH)
  162. #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH."
  163. #elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE)
  164. #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE."
  165. #elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE)
  166. #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE."
  167. #elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH)
  168. #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH."
  169. #elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH)
  170. #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH."
  171. #elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT)
  172. #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT."
  173. #elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS)
  174. #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS."
  175. #elif defined(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
  176. #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT."
  177. #elif defined(PLA_PREHEAT_HOTEND_TEMP)
  178. #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND."
  179. #elif defined(PLA_PREHEAT_HPB_TEMP)
  180. #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED."
  181. #elif defined(PLA_PREHEAT_FAN_SPEED)
  182. #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED."
  183. #elif defined(ABS_PREHEAT_HOTEND_TEMP)
  184. #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND."
  185. #elif defined(ABS_PREHEAT_HPB_TEMP)
  186. #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED."
  187. #elif defined(ABS_PREHEAT_FAN_SPEED)
  188. #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED."
  189. #elif defined(ENDSTOPS_ONLY_FOR_HOMING)
  190. #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead."
  191. #elif defined(HOMING_FEEDRATE)
  192. #error "HOMING_FEEDRATE is now set using the HOMING_FEEDRATE_MM_M array instead."
  193. #elif (defined(HOMING_FEEDRATE_XY) || defined(HOMING_FEEDRATE_Z)) && !defined(HOMING_FEEDRATE_MM_M)
  194. #error "HOMING_FEEDRATE_XY and HOMING_FEEDRATE_Z are now set using the HOMING_FEEDRATE_MM_M array instead."
  195. #elif defined(MANUAL_HOME_POSITIONS)
  196. #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead."
  197. #elif defined(PID_ADD_EXTRUSION_RATE)
  198. #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default."
  199. #elif defined(Z_RAISE_BEFORE_HOMING)
  200. #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT."
  201. #elif defined(MIN_Z_HEIGHT_FOR_HOMING)
  202. #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT."
  203. #elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING)
  204. #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead."
  205. #elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS)
  206. #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES."
  207. #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT)
  208. #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES."
  209. #elif defined(MANUAL_BED_LEVELING)
  210. #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING."
  211. #elif defined(MESH_HOME_SEARCH_Z)
  212. #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE."
  213. #elif defined(MANUAL_PROBE_Z_RANGE)
  214. #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE."
  215. #elif !defined(MIN_STEPS_PER_SEGMENT)
  216. #error "Please replace 'const int dropsegments' with '#define MIN_STEPS_PER_SEGMENT' (and increase by 1)."
  217. #elif MIN_STEPS_PER_SEGMENT <= 0
  218. #error "MIN_STEPS_PER_SEGMENT must be at least 1."
  219. #elif defined(PREVENT_DANGEROUS_EXTRUDE)
  220. #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION."
  221. #elif defined(SCARA)
  222. #error "SCARA is now MORGAN_SCARA."
  223. #elif defined(ENABLE_AUTO_BED_LEVELING)
  224. #error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
  225. #elif defined(AUTO_BED_LEVELING_FEATURE)
  226. #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
  227. #elif defined(ABL_GRID_POINTS)
  228. #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y."
  229. #elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y)
  230. #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]."
  231. #elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y)
  232. #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]."
  233. #elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS)
  234. #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]."
  235. #elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS)
  236. #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]."
  237. #elif defined(UBL_G26_MESH_VALIDATION)
  238. #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION."
  239. #elif defined(UBL_MESH_EDIT_ENABLED)
  240. #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION."
  241. #elif defined(UBL_MESH_EDITING)
  242. #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION."
  243. #elif defined(BLTOUCH_HEATERS_OFF)
  244. #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF."
  245. #elif defined(BLTOUCH_V3)
  246. #error "BLTOUCH_V3 is obsolete."
  247. #elif defined(BLTOUCH_FORCE_OPEN_DRAIN_MODE)
  248. #error "BLTOUCH_FORCE_OPEN_DRAIN_MODE is obsolete."
  249. #elif defined(BEEPER)
  250. #error "BEEPER is now BEEPER_PIN."
  251. #elif defined(SDCARDDETECT)
  252. #error "SDCARDDETECT is now SD_DETECT_PIN."
  253. #elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE)
  254. #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN."
  255. #elif defined(LCD_PIN_BL)
  256. #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN."
  257. #elif defined(LCD_PIN_RESET)
  258. #error "LCD_PIN_RESET is now LCD_RESET_PIN."
  259. #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)
  260. #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN."
  261. #elif defined(PID_FAN_SCALING) && !HAS_FAN
  262. #error "PID_FAN_SCALING needs at least one fan enabled."
  263. #elif defined(min_software_endstops) || defined(max_software_endstops)
  264. #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS."
  265. #elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN)
  266. #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)."
  267. #elif defined(CONTROLLERFAN_PIN)
  268. #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN."
  269. #elif defined(CONTROLLERFAN_SPEED)
  270. #error "CONTROLLERFAN_SPEED is now CONTROLLERFAN_SPEED_ACTIVE."
  271. #elif defined(CONTROLLERFAN_SECS)
  272. #error "CONTROLLERFAN_SECS is now CONTROLLERFAN_IDLE_TIME."
  273. #elif defined(MIN_RETRACT)
  274. #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT."
  275. #elif defined(ADVANCE)
  276. #error "ADVANCE is now LIN_ADVANCE."
  277. #elif defined(LIN_ADVANCE_E_D_RATIO)
  278. #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO."
  279. #elif defined(NEOPIXEL_RGBW_LED)
  280. #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED."
  281. #elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS)
  282. #error "Remove DELTA_PROBEABLE_RADIUS and use PROBING_MARGIN to inset the probe area instead."
  283. #elif ENABLED(DELTA) && defined(DELTA_CALIBRATION_RADIUS)
  284. #error "Remove DELTA_CALIBRATION_RADIUS and use PROBING_MARGIN to inset the probe area instead."
  285. #elif defined(UBL_MESH_INSET)
  286. #error "UBL_MESH_INSET is now just MESH_INSET."
  287. #elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y)
  288. #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]."
  289. #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)
  290. #error "ABL_PROBE_PT_[123]_[XY] is no longer required. Please remove it."
  291. #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)
  292. #error "UBL_PROBE_PT_[123]_[XY] is no longer required. Please remove it."
  293. #elif defined(MIN_PROBE_EDGE)
  294. #error "MIN_PROBE_EDGE is now called PROBING_MARGIN."
  295. #elif defined(MIN_PROBE_EDGE_LEFT)
  296. #error "MIN_PROBE_EDGE_LEFT is now called PROBING_MARGIN_LEFT."
  297. #elif defined(MIN_PROBE_EDGE_RIGHT)
  298. #error "MIN_PROBE_EDGE_RIGHT is now called PROBING_MARGIN_RIGHT."
  299. #elif defined(MIN_PROBE_EDGE_FRONT)
  300. #error "MIN_PROBE_EDGE_FRONT is now called PROBING_MARGIN_FRONT."
  301. #elif defined(MIN_PROBE_EDGE_BACK)
  302. #error "MIN_PROBE_EDGE_BACK is now called PROBING_MARGIN_BACK."
  303. #elif defined(LEFT_PROBE_BED_POSITION)
  304. #error "LEFT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_LEFT instead."
  305. #elif defined(RIGHT_PROBE_BED_POSITION)
  306. #error "RIGHT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_RIGHT instead."
  307. #elif defined(FRONT_PROBE_BED_POSITION)
  308. #error "FRONT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_FRONT instead."
  309. #elif defined(BACK_PROBE_BED_POSITION)
  310. #error "BACK_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_BACK instead."
  311. #elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY)
  312. #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY."
  313. #elif defined(BABYSTEP_ZPROBE_GFX_REVERSE)
  314. #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE."
  315. #elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN)
  316. #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES."
  317. #elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1))
  318. #error "K1 is now PID_K1."
  319. #elif defined(PROBE_DOUBLE_TOUCH)
  320. #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING."
  321. #elif defined(ANET_KEYPAD_LCD)
  322. #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD."
  323. #elif defined(LCD_I2C_SAINSMART_YWROBOT)
  324. #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004)."
  325. #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT)
  326. #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN."
  327. #elif defined(HAVE_TMCDRIVER)
  328. #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X."
  329. #elif defined(STEALTHCHOP)
  330. #error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E)."
  331. #elif defined(HAVE_TMC26X)
  332. #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X."
  333. #elif defined(HAVE_TMC2130)
  334. #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130."
  335. #elif defined(HAVE_TMC2208)
  336. #error "HAVE_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208."
  337. #elif defined(HAVE_L6470DRIVER)
  338. #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470."
  339. #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) \
  340. || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) || defined(E5_IS_TMC) || defined(E6_IS_TMC) || defined(E7_IS_TMC)
  341. #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X."
  342. #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) \
  343. || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) || defined(E5_IS_TMC26X) || defined(E6_IS_TMC26X) || defined(E7_IS_TMC26X)
  344. #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X."
  345. #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) \
  346. || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) || defined(E5_IS_TMC2130) || defined(E6_IS_TMC2130) || defined(E7_IS_TMC2130)
  347. #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130."
  348. #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) \
  349. || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) || defined(E5_IS_TMC2208) || defined(E6_IS_TMC2208) || defined(E7_IS_TMC2208)
  350. #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208."
  351. #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) \
  352. || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) || defined(E5_IS_L6470) || defined(E6_IS_L6470) || defined(E7_IS_L6470)
  353. #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470."
  354. #elif defined(AUTOMATIC_CURRENT_CONTROL)
  355. #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS."
  356. #elif defined(FILAMENT_CHANGE_LOAD_LENGTH)
  357. #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH."
  358. #elif defined(LEVEL_CORNERS_INSET)
  359. #error "LEVEL_CORNERS_INSET is now LEVEL_CORNERS_INSET_LFRB."
  360. #elif defined(BEZIER_JERK_CONTROL)
  361. #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION."
  362. #elif HAS_JUNCTION_DEVIATION && defined(JUNCTION_DEVIATION_FACTOR)
  363. #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM."
  364. #elif defined(JUNCTION_ACCELERATION_FACTOR)
  365. #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h."
  366. #elif defined(JUNCTION_ACCELERATION)
  367. #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h."
  368. #elif defined(MAX7219_DEBUG_STEPPER_HEAD)
  369. #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD."
  370. #elif defined(MAX7219_DEBUG_STEPPER_TAIL)
  371. #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL."
  372. #elif defined(MAX7219_DEBUG_STEPPER_QUEUE)
  373. #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE."
  374. #elif defined(ENDSTOP_NOISE_FILTER)
  375. #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]."
  376. #elif defined(RETRACT_ZLIFT)
  377. #error "RETRACT_ZLIFT is now RETRACT_ZRAISE."
  378. #elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT)
  379. #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE."
  380. #elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE)
  381. #error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE."
  382. #elif defined(SINGLENOZZLE_SWAP_LENGTH)
  383. #error "SINGLENOZZLE_SWAP_LENGTH is now TOOLCHANGE_FIL_SWAP_LENGTH."
  384. #elif defined(SINGLENOZZLE_SWAP_RETRACT_SPEED)
  385. #error "SINGLENOZZLE_SWAP_RETRACT_SPEED is now TOOLCHANGE_FIL_SWAP_RETRACT_SPEED."
  386. #elif defined(SINGLENOZZLE_SWAP_PRIME_SPEED)
  387. #error "SINGLENOZZLE_SWAP_PRIME_SPEED is now TOOLCHANGE_FIL_SWAP_PRIME_SPEED."
  388. #elif defined(SINGLENOZZLE_SWAP_PARK)
  389. #error "SINGLENOZZLE_SWAP_PARK is now TOOLCHANGE_PARK."
  390. #elif defined(SINGLENOZZLE_TOOLCHANGE_XY)
  391. #error "SINGLENOZZLE_TOOLCHANGE_XY is now TOOLCHANGE_PARK_XY."
  392. #elif defined(SINGLENOZZLE_PARK_XY_FEEDRATE)
  393. #error "SINGLENOZZLE_PARK_XY_FEEDRATE is now TOOLCHANGE_PARK_XY_FEEDRATE."
  394. #elif defined(PARKING_EXTRUDER_SECURITY_RAISE)
  395. #error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE."
  396. #elif defined(SWITCHING_TOOLHEAD_SECURITY_RAISE)
  397. #error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE."
  398. #elif defined(G0_FEEDRATE) && G0_FEEDRATE == 0
  399. #error "G0_FEEDRATE is now used to set the G0 feedrate."
  400. #elif defined(MBL_Z_STEP)
  401. #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP."
  402. #elif defined(CHDK)
  403. #error "CHDK is now CHDK_PIN."
  404. #elif defined(MAX6675_SS) || defined(MAX6675_SS2)
  405. #error "MAX6675_SS / MAX6675_SS2 is now MAX6675_SS_PIN / MAX6675_SS2_PIN."
  406. #elif defined(MAX31865_SENSOR_OHMS)
  407. #error "MAX31865_SENSOR_OHMS is now MAX31865_SENSOR_OHMS_0."
  408. #elif defined(MAX31865_CALIBRATION_OHMS)
  409. #error "MAX31865_CALIBRATION_OHMS is now MAX31865_CALIBRATION_OHMS_0."
  410. #elif defined(SPINDLE_LASER_ENABLE)
  411. #error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE."
  412. #elif defined(SPINDLE_LASER_ENABLE_PIN)
  413. #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN."
  414. #elif defined(SPINDLE_DIR_CHANGE)
  415. #error "SPINDLE_DIR_CHANGE is now SPINDLE_CHANGE_DIR."
  416. #elif defined(SPINDLE_STOP_ON_DIR_CHANGE)
  417. #error "SPINDLE_STOP_ON_DIR_CHANGE is now SPINDLE_CHANGE_DIR_STOP."
  418. #elif defined(SPINDLE_LASER_ACTIVE_HIGH)
  419. #error "SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE."
  420. #elif defined(SPINDLE_LASER_ENABLE_INVERT)
  421. #error "SPINDLE_LASER_ENABLE_INVERT is now SPINDLE_LASER_ACTIVE_STATE."
  422. #elif defined(CUTTER_POWER_DISPLAY)
  423. #error "CUTTER_POWER_DISPLAY is now CUTTER_POWER_UNIT."
  424. #elif defined(CHAMBER_HEATER_PIN)
  425. #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN."
  426. #elif defined(TMC_Z_CALIBRATION)
  427. #error "TMC_Z_CALIBRATION has been deprecated in favor of MECHANICAL_GANTRY_CALIBRATION."
  428. #elif defined(Z_MIN_PROBE_ENDSTOP)
  429. #error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it."
  430. #elif defined(DUAL_NOZZLE_DUPLICATION_MODE)
  431. #error "DUAL_NOZZLE_DUPLICATION_MODE is now MULTI_NOZZLE_DUPLICATION."
  432. #elif defined(MENU_ITEM_CASE_LIGHT)
  433. #error "MENU_ITEM_CASE_LIGHT is now CASE_LIGHT_MENU."
  434. #elif defined(CASE_LIGHT_NEOPIXEL_COLOR)
  435. #error "CASE_LIGHT_NEOPIXEL_COLOR is now CASE_LIGHT_DEFAULT_COLOR."
  436. #elif defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
  437. #error "ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED is now SD_ABORT_ON_ENDSTOP_HIT."
  438. #elif defined(LPC_SD_LCD) || defined(LPC_SD_ONBOARD) || defined(LPC_SD_CUSTOM_CABLE)
  439. #error "LPC_SD_(LCD|ONBOARD|CUSTOM_CABLE) are now SDCARD_CONNECTION."
  440. #elif defined(USB_SD_DISABLED)
  441. #error "USB_SD_DISABLED is now NO_SD_HOST_DRIVE."
  442. #elif defined(USB_SD_ONBOARD)
  443. #error "USB_SD_ONBOARD is obsolete. Disable NO_SD_HOST_DRIVE instead."
  444. #elif defined(PSU_ACTIVE_HIGH)
  445. #error "PSU_ACTIVE_HIGH is now PSU_ACTIVE_STATE."
  446. #elif POWER_SUPPLY == 1
  447. #error "Replace POWER_SUPPLY 1 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'LOW'."
  448. #elif POWER_SUPPLY == 2
  449. #error "Replace POWER_SUPPLY 2 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'HIGH'."
  450. #elif defined(POWER_SUPPLY)
  451. #error "POWER_SUPPLY is now obsolete. Please remove it."
  452. #elif defined(MKS_ROBIN_TFT)
  453. #error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT."
  454. #elif defined(SDPOWER)
  455. #error "SDPOWER is now SDPOWER_PIN."
  456. #elif defined(STRING_SPLASH_LINE1) || defined(STRING_SPLASH_LINE2)
  457. #error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them."
  458. #elif defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_X)
  459. #error "Z_PROBE_ALLEN_KEY_(DEPLOY|STOW) coordinates are now a single setting."
  460. #elif defined(X_PROBE_OFFSET_FROM_EXTRUDER) || defined(Y_PROBE_OFFSET_FROM_EXTRUDER) || defined(Z_PROBE_OFFSET_FROM_EXTRUDER)
  461. #error "[XYZ]_PROBE_OFFSET_FROM_EXTRUDER is now NOZZLE_TO_PROBE_OFFSET."
  462. #elif defined(MIN_PROBE_X) || defined(MIN_PROBE_Y) || defined(MAX_PROBE_X) || defined(MAX_PROBE_Y)
  463. #error "(MIN|MAX)_PROBE_[XY] are now calculated at runtime. Please remove them."
  464. #elif defined(Z_STEPPER_ALIGN_X) || defined(Z_STEPPER_ALIGN_X)
  465. #error "Z_STEPPER_ALIGN_X and Z_STEPPER_ALIGN_Y are now combined as Z_STEPPER_ALIGN_XY."
  466. #elif defined(JUNCTION_DEVIATION)
  467. #error "JUNCTION_DEVIATION is no longer required. (See CLASSIC_JERK). Please remove it."
  468. #elif defined(BABYSTEP_MULTIPLICATOR)
  469. #error "BABYSTEP_MULTIPLICATOR is now BABYSTEP_MULTIPLICATOR_[XY|Z]."
  470. #elif defined(LULZBOT_TOUCH_UI)
  471. #error "LULZBOT_TOUCH_UI is now TOUCH_UI_FTDI_EVE."
  472. #elif defined(PS_DEFAULT_OFF)
  473. #error "PS_DEFAULT_OFF is now PSU_DEFAULT_OFF."
  474. #elif defined(FILAMENT_UNLOAD_RETRACT_LENGTH)
  475. #error "FILAMENT_UNLOAD_RETRACT_LENGTH is now FILAMENT_UNLOAD_PURGE_RETRACT."
  476. #elif defined(FILAMENT_UNLOAD_DELAY)
  477. #error "FILAMENT_UNLOAD_DELAY is now FILAMENT_UNLOAD_PURGE_DELAY."
  478. #elif defined(HOME_USING_SPREADCYCLE)
  479. #error "HOME_USING_SPREADCYCLE is now obsolete. Please remove it."
  480. #elif defined(DGUS_LCD)
  481. #error "DGUS_LCD is now DGUS_LCD_UI_(ORIGIN|FYSETC|HIPRECY)."
  482. #elif defined(DGUS_SERIAL_PORT)
  483. #error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT."
  484. #elif defined(DGUS_BAUDRATE)
  485. #error "DGUS_BAUDRATE is now LCD_BAUDRATE."
  486. #elif defined(DGUS_STATS_RX_BUFFER_OVERRUNS)
  487. #error "DGUS_STATS_RX_BUFFER_OVERRUNS is now STATS_RX_BUFFER_OVERRUNS."
  488. #elif defined(ANYCUBIC_LCD_SERIAL_PORT)
  489. #error "ANYCUBIC_LCD_SERIAL_PORT is now LCD_SERIAL_PORT."
  490. #elif defined(INTERNAL_SERIAL_PORT)
  491. #error "INTERNAL_SERIAL_PORT is now MMU2_SERIAL_PORT."
  492. #elif defined(X_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Y_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Z_DUAL_ENDSTOPS_ADJUSTMENT)
  493. #error "[XYZ]_DUAL_ENDSTOPS_ADJUSTMENT is now [XYZ]2_ENDSTOP_ADJUSTMENT."
  494. #elif defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT2) || defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT3)
  495. #error "Z_TRIPLE_ENDSTOPS_ADJUSTMENT[23] is now Z[23]_ENDSTOP_ADJUSTMENT."
  496. #elif defined(Z_QUAD_ENDSTOPS_ADJUSTMENT2) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT3) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT4)
  497. #error "Z_QUAD_ENDSTOPS_ADJUSTMENT[234] is now Z[234]_ENDSTOP_ADJUSTMENT."
  498. #elif defined(Z_DUAL_STEPPER_DRIVERS)
  499. #error "Z_DUAL_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 2."
  500. #elif defined(Z_TRIPLE_STEPPER_DRIVERS)
  501. #error "Z_TRIPLE_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 3."
  502. #elif defined(Z_QUAD_STEPPER_DRIVERS)
  503. #error "Z_QUAD_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 4."
  504. #elif defined(Z_DUAL_ENDSTOPS) || defined(Z_TRIPLE_ENDSTOPS) || defined(Z_QUAD_ENDSTOPS)
  505. #error "Z_(DUAL|TRIPLE|QUAD)_ENDSTOPS is now Z_MULTI_ENDSTOPS."
  506. #elif defined(DUGS_UI_MOVE_DIS_OPTION)
  507. #error "DUGS_UI_MOVE_DIS_OPTION is spelled DGUS_UI_MOVE_DIS_OPTION."
  508. #elif defined(ORIG_E0_AUTO_FAN_PIN) || defined(ORIG_E1_AUTO_FAN_PIN) || defined(ORIG_E2_AUTO_FAN_PIN) || defined(ORIG_E3_AUTO_FAN_PIN) || defined(ORIG_E4_AUTO_FAN_PIN) || defined(ORIG_E5_AUTO_FAN_PIN) || defined(ORIG_E6_AUTO_FAN_PIN) || defined(ORIG_E7_AUTO_FAN_PIN)
  509. #error "ORIG_Ex_AUTO_FAN_PIN is now just Ex_AUTO_FAN_PIN."
  510. #elif defined(ORIG_CHAMBER_AUTO_FAN_PIN)
  511. #error "ORIG_CHAMBER_AUTO_FAN_PIN is now just CHAMBER_AUTO_FAN_PIN."
  512. #elif defined(HOMING_BACKOFF_MM)
  513. #error "HOMING_BACKOFF_MM is now HOMING_BACKOFF_POST_MM."
  514. #elif defined(X_HOME_BUMP_MM) || defined(Y_HOME_BUMP_MM) || defined(Z_HOME_BUMP_MM)
  515. #error "[XYZ]_HOME_BUMP_MM is now HOMING_BUMP_MM."
  516. #elif defined(DIGIPOT_I2C)
  517. #error "DIGIPOT_I2C is now DIGIPOT_MCP4451 (or DIGIPOT_MCP4018)."
  518. #elif defined(TOUCH_BUTTONS)
  519. #error "TOUCH_BUTTONS is now TOUCH_SCREEN."
  520. #elif defined(LCD_FULL_PIXEL_HEIGHT) || defined(LCD_FULL_PIXEL_WIDTH)
  521. #error "LCD_FULL_PIXEL_(WIDTH|HEIGHT) is deprecated and should be removed."
  522. #elif defined(FSMC_UPSCALE)
  523. #error "FSMC_UPSCALE is now GRAPHICAL_TFT_UPSCALE."
  524. #elif defined(ANYCUBIC_TFT_MODEL)
  525. #error "ANYCUBIC_TFT_MODEL is now ANYCUBIC_LCD_I3MEGA."
  526. #elif defined(EVENT_GCODE_SD_STOP)
  527. #error "EVENT_GCODE_SD_STOP is now EVENT_GCODE_SD_ABORT."
  528. #elif defined(GRAPHICAL_TFT_ROTATE_180)
  529. #error "GRAPHICAL_TFT_ROTATE_180 is now TFT_ROTATION set to TFT_ROTATE_180."
  530. #elif defined(PROBE_OFFSET_START)
  531. #error "PROBE_OFFSET_START is now PROBE_OFFSET_WIZARD_START_Z."
  532. #elif defined(POWER_LOSS_PULL)
  533. #error "POWER_LOSS_PULL is now specifically POWER_LOSS_PULL(UP|DOWN)."
  534. #elif defined(SHORT_MANUAL_Z_MOVE)
  535. #error "SHORT_MANUAL_Z_MOVE is now FINE_MANUAL_MOVE, applying to Z on most printers."
  536. #elif defined(FIL_RUNOUT_INVERTING)
  537. #if FIL_RUNOUT_INVERTING
  538. #error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH."
  539. #else
  540. #error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_STATE LOW."
  541. #endif
  542. #elif defined(ASSISTED_TRAMMING_MENU_ITEM)
  543. #error "ASSISTED_TRAMMING_MENU_ITEM is deprecated and should be removed."
  544. #elif defined(UNKNOWN_Z_NO_RAISE)
  545. #error "UNKNOWN_Z_NO_RAISE is replaced by setting Z_IDLE_HEIGHT to Z_MAX_POS."
  546. #elif defined(Z_AFTER_DEACTIVATE)
  547. #error "Z_AFTER_DEACTIVATE is replaced by Z_IDLE_HEIGHT."
  548. #elif defined(MEATPACK)
  549. #error "MEATPACK is now enabled with MEATPACK_ON_SERIAL_PORT_1, MEATPACK_ON_SERIAL_PORT_2, etc."
  550. #elif defined(CUSTOM_USER_MENUS)
  551. #error "CUSTOM_USER_MENUS has been replaced by CUSTOM_MENU_MAIN and CUSTOM_MENU_CONFIG."
  552. #endif
  553. /**
  554. * Probe temp compensation requirements
  555. */
  556. #if ENABLED(PROBE_TEMP_COMPENSATION)
  557. #if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
  558. #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
  559. #elif !defined(PTC_PARK_POS)
  560. #error "PROBE_TEMP_COMPENSATION requires PTC_PARK_POS."
  561. #elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y)
  562. #error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)."
  563. #elif !defined(PTC_PROBE_POS)
  564. #error "PROBE_TEMP_COMPENSATION requires PTC_PROBE_POS."
  565. #endif
  566. #endif
  567. /**
  568. * Marlin release, version and default string
  569. */
  570. #ifndef SHORT_BUILD_VERSION
  571. #error "SHORT_BUILD_VERSION must be specified."
  572. #elif !defined(DETAILED_BUILD_VERSION)
  573. #error "BUILD_VERSION must be specified."
  574. #elif !defined(STRING_DISTRIBUTION_DATE)
  575. #error "STRING_DISTRIBUTION_DATE must be specified."
  576. #elif !defined(PROTOCOL_VERSION)
  577. #error "PROTOCOL_VERSION must be specified."
  578. #elif !defined(MACHINE_NAME)
  579. #error "MACHINE_NAME must be specified."
  580. #elif !defined(SOURCE_CODE_URL)
  581. #error "SOURCE_CODE_URL must be specified."
  582. #elif !defined(DEFAULT_MACHINE_UUID)
  583. #error "DEFAULT_MACHINE_UUID must be specified."
  584. #elif !defined(WEBSITE_URL)
  585. #error "WEBSITE_URL must be specified."
  586. #endif
  587. /**
  588. * Serial
  589. */
  590. #ifndef SERIAL_PORT
  591. #error "SERIAL_PORT must be defined."
  592. #elif defined(SERIAL_PORT_2) && SERIAL_PORT_2 == SERIAL_PORT
  593. #error "SERIAL_PORT_2 cannot be the same as SERIAL_PORT."
  594. #endif
  595. #if !(defined(__AVR__) && defined(USBCON))
  596. #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
  597. #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
  598. #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
  599. #error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
  600. #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
  601. #error "TX_BUFFER_SIZE must be 0 or a power of 2 between 1 and 256."
  602. #endif
  603. #elif ANY(SERIAL_XON_XOFF, SERIAL_STATS_MAX_RX_QUEUED, SERIAL_STATS_DROPPED_RX)
  604. #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
  605. #endif
  606. /**
  607. * Multiple Stepper Drivers Per Axis
  608. */
  609. #define GOOD_AXIS_PINS(A) (HAS_##A##_ENABLE && HAS_##A##_STEP && HAS_##A##_DIR)
  610. #if ENABLED(X_DUAL_STEPPER_DRIVERS)
  611. #if ENABLED(DUAL_X_CARRIAGE)
  612. #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS."
  613. #elif !GOOD_AXIS_PINS(X)
  614. #error "X_DUAL_STEPPER_DRIVERS requires X2 pins to be defined."
  615. #endif
  616. #endif
  617. #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !GOOD_AXIS_PINS(Y)
  618. #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins to be defined."
  619. #elif !WITHIN(NUM_Z_STEPPER_DRIVERS, 1, 4)
  620. #error "NUM_Z_STEPPER_DRIVERS must be an integer from 1 to 4."
  621. #elif NUM_Z_STEPPER_DRIVERS == 2 && !GOOD_AXIS_PINS(Z2)
  622. #error "If NUM_Z_STEPPER_DRIVERS is 2, you must define stepper pins for Z2."
  623. #elif NUM_Z_STEPPER_DRIVERS == 3 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3))
  624. #error "If NUM_Z_STEPPER_DRIVERS is 3, you must define stepper pins for Z2 and Z3."
  625. #elif NUM_Z_STEPPER_DRIVERS == 4 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3) && GOOD_AXIS_PINS(Z4))
  626. #error "If NUM_Z_STEPPER_DRIVERS is 4, you must define stepper pins for Z2, Z3, and Z4."
  627. #endif
  628. /**
  629. * Validate that the bed size fits
  630. */
  631. static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE.");
  632. static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE.");
  633. /**
  634. * Granular software endstops (Marlin >= 1.1.7)
  635. */
  636. #if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z)
  637. #if IS_KINEMATIC
  638. #error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z."
  639. #elif NONE(MIN_SOFTWARE_ENDSTOP_X, MIN_SOFTWARE_ENDSTOP_Y)
  640. #error "MIN_SOFTWARE_ENDSTOPS requires at least one of the MIN_SOFTWARE_ENDSTOP_[XYZ] options."
  641. #endif
  642. #endif
  643. #if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z)
  644. #if IS_KINEMATIC
  645. #error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z."
  646. #elif NONE(MAX_SOFTWARE_ENDSTOP_X, MAX_SOFTWARE_ENDSTOP_Y)
  647. #error "MAX_SOFTWARE_ENDSTOPS requires at least one of the MAX_SOFTWARE_ENDSTOP_[XYZ] options."
  648. #endif
  649. #endif
  650. #if !defined(TARGET_LPC1768) && ANY( \
  651. ENDSTOPPULLDOWNS, \
  652. ENDSTOPPULLDOWN_XMAX, ENDSTOPPULLDOWN_YMAX, \
  653. ENDSTOPPULLDOWN_ZMAX, ENDSTOPPULLDOWN_XMIN, \
  654. ENDSTOPPULLDOWN_YMIN, ENDSTOPPULLDOWN_ZMIN \
  655. )
  656. #error "PULLDOWN pin mode is not available on the selected board."
  657. #endif
  658. #if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS)
  659. #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS."
  660. #elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN)
  661. #error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN."
  662. #elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX)
  663. #error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX."
  664. #elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX)
  665. #error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
  666. #elif BOTH(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX)
  667. #error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
  668. #elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN)
  669. #error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
  670. #elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN)
  671. #error "Enable only one of ENDSTOPPULLUP_Y_MIN or ENDSTOPPULLDOWN_Y_MIN."
  672. #elif BOTH(ENDSTOPPULLUP_ZMIN, ENDSTOPPULLDOWN_ZMIN)
  673. #error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN."
  674. #endif
  675. /**
  676. * LCD Info Screen Style
  677. */
  678. #if LCD_INFO_SCREEN_STYLE > 0
  679. #if HAS_MARLINUI_U8GLIB || LCD_WIDTH < 20 || LCD_HEIGHT < 4
  680. #error "Alternative LCD_INFO_SCREEN_STYLE requires 20x4 Character LCD."
  681. #elif LCD_INFO_SCREEN_STYLE > 1
  682. #error "LCD_INFO_SCREEN_STYLE only has options 0 and 1 at this time."
  683. #endif
  684. #endif
  685. /**
  686. * Progress Bar
  687. */
  688. #if ENABLED(LCD_PROGRESS_BAR)
  689. #if NONE(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
  690. #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY."
  691. #elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
  692. #error "LCD_PROGRESS_BAR only applies to HD44780 character LCD and TFTGLCD_PANEL_(SPI|I2C)."
  693. #elif HAS_MARLINUI_U8GLIB
  694. #error "LCD_PROGRESS_BAR does not apply to graphical displays."
  695. #elif ENABLED(FILAMENT_LCD_DISPLAY)
  696. #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both."
  697. #elif PROGRESS_MSG_EXPIRE < 0
  698. #error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
  699. #endif
  700. #elif ENABLED(LCD_SET_PROGRESS_MANUALLY)
  701. #if NONE(HAS_MARLINUI_U8GLIB, HAS_GRAPHICAL_TFT, HAS_MARLINUI_HD44780, EXTENSIBLE_UI)
  702. #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Character LCD, Graphical LCD, TFT, or EXTENSIBLE_UI."
  703. #endif
  704. #endif
  705. #if ENABLED(USE_M73_REMAINING_TIME) && DISABLED(LCD_SET_PROGRESS_MANUALLY)
  706. #error "USE_M73_REMAINING_TIME requires LCD_SET_PROGRESS_MANUALLY"
  707. #endif
  708. #if !HAS_LCD_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
  709. #error "SD_REPRINT_LAST_SELECTED_FILE currently requires a Marlin-native LCD menu."
  710. #endif
  711. /**
  712. * Custom Boot and Status screens
  713. */
  714. #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE)
  715. #error "SHOW_CUSTOM_BOOTSCREEN requires Graphical LCD or TOUCH_UI_FTDI_EVE."
  716. #elif ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && !HAS_MARLINUI_U8GLIB
  717. #error "CUSTOM_STATUS_SCREEN_IMAGE requires a 128x64 DOGM B/W Graphical LCD."
  718. #endif
  719. /**
  720. * LCD Lightweight Screen Style
  721. */
  722. #if ENABLED(LIGHTWEIGHT_UI) && DISABLED(U8GLIB_ST7920)
  723. #error "LIGHTWEIGHT_UI requires a U8GLIB_ST7920-based display."
  724. #endif
  725. /**
  726. * SD File Sorting
  727. */
  728. #if ENABLED(SDCARD_SORT_ALPHA)
  729. #if SDSORT_LIMIT > 256
  730. #error "SDSORT_LIMIT must be 256 or smaller."
  731. #elif SDSORT_LIMIT < 10
  732. #error "SDSORT_LIMIT should be greater than 9 to be useful."
  733. #elif DISABLED(SDSORT_USES_RAM)
  734. #if ENABLED(SDSORT_DYNAMIC_RAM)
  735. #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)."
  736. #elif ENABLED(SDSORT_CACHE_NAMES)
  737. #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)."
  738. #endif
  739. #endif
  740. #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
  741. #if SDSORT_CACHE_VFATS < 2
  742. #error "SDSORT_CACHE_VFATS must be 2 or greater!"
  743. #elif SDSORT_CACHE_VFATS > MAX_VFAT_ENTRIES
  744. #undef SDSORT_CACHE_VFATS
  745. #define SDSORT_CACHE_VFATS MAX_VFAT_ENTRIES
  746. #warning "SDSORT_CACHE_VFATS was reduced to MAX_VFAT_ENTRIES!"
  747. #endif
  748. #endif
  749. #endif
  750. #if defined(EVENT_GCODE_SD_ABORT) && DISABLED(NOZZLE_PARK_FEATURE)
  751. static_assert(nullptr == strstr(EVENT_GCODE_SD_ABORT, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_ABORT.");
  752. #endif
  753. /**
  754. * I2C Position Encoders
  755. */
  756. #if ENABLED(I2C_POSITION_ENCODERS)
  757. #if !BOTH(BABYSTEPPING, BABYSTEP_XY)
  758. #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY."
  759. #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5)
  760. #error "I2CPE_ENCODER_CNT must be between 1 and 5."
  761. #endif
  762. #endif
  763. /**
  764. * Babystepping
  765. */
  766. #if ENABLED(BABYSTEPPING)
  767. #if ENABLED(SCARA)
  768. #error "BABYSTEPPING is not implemented for SCARA yet."
  769. #elif BOTH(MARKFORGED_XY, BABYSTEP_XY)
  770. #error "BABYSTEPPING only implemented for Z axis on MarkForged."
  771. #elif BOTH(DELTA, BABYSTEP_XY)
  772. #error "BABYSTEPPING only implemented for Z axis on deltabots."
  773. #elif BOTH(BABYSTEP_ZPROBE_OFFSET, MESH_BED_LEVELING)
  774. #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
  775. #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
  776. #error "BABYSTEP_ZPROBE_OFFSET requires a probe."
  777. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !HAS_MARLINUI_U8GLIB
  778. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD."
  779. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
  780. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
  781. #elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET
  782. #error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS."
  783. #elif BOTH(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE)
  784. #error "BABYSTEP_ALWAYS_AVAILABLE and MOVE_Z_WHEN_IDLE are incompatible."
  785. #elif !defined(BABYSTEP_MULTIPLICATOR_Z)
  786. #error "BABYSTEPPING requires BABYSTEP_MULTIPLICATOR_Z."
  787. #elif ENABLED(BABYSTEP_XY) && !defined(BABYSTEP_MULTIPLICATOR_XY)
  788. #error "BABYSTEP_XY requires BABYSTEP_MULTIPLICATOR_XY."
  789. #elif ENABLED(BABYSTEP_MILLIMETER_UNITS)
  790. static_assert(BABYSTEP_MULTIPLICATOR_Z <= 0.1f, "BABYSTEP_MULTIPLICATOR_Z must be less or equal to 0.1mm.");
  791. #if ENABLED(BABYSTEP_XY)
  792. static_assert(BABYSTEP_MULTIPLICATOR_XY <= 0.25f, "BABYSTEP_MULTIPLICATOR_XY must be less than or equal to 0.25mm.");
  793. #endif
  794. #endif
  795. #endif
  796. /**
  797. * Filament Runout needs one or more pins and either SD Support or Auto print start detection
  798. */
  799. #if HAS_FILAMENT_SENSOR
  800. #if !PIN_EXISTS(FIL_RUNOUT)
  801. #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
  802. #elif HAS_PRUSA_MMU2 && NUM_RUNOUT_SENSORS != 1
  803. #error "NUM_RUNOUT_SENSORS must be 1 with MMU2 / MMU2S."
  804. #elif NUM_RUNOUT_SENSORS != 1 && NUM_RUNOUT_SENSORS != E_STEPPERS
  805. #error "NUM_RUNOUT_SENSORS must be either 1 or number of E steppers."
  806. #elif NUM_RUNOUT_SENSORS >= 8 && !PIN_EXISTS(FIL_RUNOUT8)
  807. #error "FIL_RUNOUT8_PIN is required with NUM_RUNOUT_SENSORS >= 8."
  808. #elif NUM_RUNOUT_SENSORS >= 7 && !PIN_EXISTS(FIL_RUNOUT7)
  809. #error "FIL_RUNOUT7_PIN is required with NUM_RUNOUT_SENSORS >= 7."
  810. #elif NUM_RUNOUT_SENSORS >= 6 && !PIN_EXISTS(FIL_RUNOUT6)
  811. #error "FIL_RUNOUT6_PIN is required with NUM_RUNOUT_SENSORS >= 6."
  812. #elif NUM_RUNOUT_SENSORS >= 5 && !PIN_EXISTS(FIL_RUNOUT5)
  813. #error "FIL_RUNOUT5_PIN is required with NUM_RUNOUT_SENSORS >= 5."
  814. #elif NUM_RUNOUT_SENSORS >= 4 && !PIN_EXISTS(FIL_RUNOUT4)
  815. #error "FIL_RUNOUT4_PIN is required with NUM_RUNOUT_SENSORS >= 4."
  816. #elif NUM_RUNOUT_SENSORS >= 3 && !PIN_EXISTS(FIL_RUNOUT3)
  817. #error "FIL_RUNOUT3_PIN is required with NUM_RUNOUT_SENSORS >= 3."
  818. #elif NUM_RUNOUT_SENSORS >= 2 && !PIN_EXISTS(FIL_RUNOUT2)
  819. #error "FIL_RUNOUT2_PIN is required with NUM_RUNOUT_SENSORS >= 2."
  820. #elif BOTH(FIL_RUNOUT1_PULLUP, FIL_RUNOUT1_PULLDOWN)
  821. #error "You can't enable FIL_RUNOUT1_PULLUP and FIL_RUNOUT1_PULLDOWN at the same time."
  822. #elif BOTH(FIL_RUNOUT2_PULLUP, FIL_RUNOUT2_PULLDOWN)
  823. #error "You can't enable FIL_RUNOUT2_PULLUP and FIL_RUNOUT2_PULLDOWN at the same time."
  824. #elif BOTH(FIL_RUNOUT3_PULLUP, FIL_RUNOUT3_PULLDOWN)
  825. #error "You can't enable FIL_RUNOUT3_PULLUP and FIL_RUNOUT3_PULLDOWN at the same time."
  826. #elif BOTH(FIL_RUNOUT4_PULLUP, FIL_RUNOUT4_PULLDOWN)
  827. #error "You can't enable FIL_RUNOUT4_PULLUP and FIL_RUNOUT4_PULLDOWN at the same time."
  828. #elif BOTH(FIL_RUNOUT5_PULLUP, FIL_RUNOUT5_PULLDOWN)
  829. #error "You can't enable FIL_RUNOUT5_PULLUP and FIL_RUNOUT5_PULLDOWN at the same time."
  830. #elif BOTH(FIL_RUNOUT6_PULLUP, FIL_RUNOUT6_PULLDOWN)
  831. #error "You can't enable FIL_RUNOUT6_PULLUP and FIL_RUNOUT6_PULLDOWN at the same time."
  832. #elif BOTH(FIL_RUNOUT7_PULLUP, FIL_RUNOUT7_PULLDOWN)
  833. #error "You can't enable FIL_RUNOUT7_PULLUP and FIL_RUNOUT7_PULLDOWN at the same time."
  834. #elif BOTH(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN)
  835. #error "You can't enable FIL_RUNOUT8_PULLUP and FIL_RUNOUT8_PULLDOWN at the same time."
  836. #elif FILAMENT_RUNOUT_DISTANCE_MM < 0
  837. #error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero."
  838. #elif DISABLED(ADVANCED_PAUSE_FEATURE)
  839. static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
  840. #endif
  841. #endif
  842. /**
  843. * Advanced Pause
  844. */
  845. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  846. #if !HAS_RESUME_CONTINUE
  847. #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
  848. #elif DISABLED(NOZZLE_PARK_FEATURE)
  849. #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE."
  850. #elif !defined(FILAMENT_UNLOAD_PURGE_FEEDRATE)
  851. #error "ADVANCED_PAUSE_FEATURE requires FILAMENT_UNLOAD_PURGE_FEEDRATE."
  852. #elif ENABLED(EXTRUDER_RUNOUT_PREVENT)
  853. #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
  854. #elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(SDSUPPORT, IS_NEWPANEL, EMERGENCY_PARSER)
  855. #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller."
  856. #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
  857. #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT."
  858. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH
  859. #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  860. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH
  861. #error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  862. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH
  863. #error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  864. #endif
  865. #endif
  866. #if ENABLED(NOZZLE_PARK_FEATURE)
  867. constexpr float npp[] = NOZZLE_PARK_POINT;
  868. static_assert(COUNT(npp) == XYZ, "NOZZLE_PARK_POINT requires X, Y, and Z values.");
  869. constexpr xyz_pos_t npp_xyz = NOZZLE_PARK_POINT;
  870. static_assert(WITHIN(npp_xyz.x, X_MIN_POS, X_MAX_POS), "NOZZLE_PARK_POINT.X is out of bounds (X_MIN_POS, X_MAX_POS).");
  871. static_assert(WITHIN(npp_xyz.y, Y_MIN_POS, Y_MAX_POS), "NOZZLE_PARK_POINT.Y is out of bounds (Y_MIN_POS, Y_MAX_POS).");
  872. static_assert(WITHIN(npp_xyz.z, Z_MIN_POS, Z_MAX_POS), "NOZZLE_PARK_POINT.Z is out of bounds (Z_MIN_POS, Z_MAX_POS).");
  873. #endif
  874. /**
  875. * Individual axis homing is useless for DELTAS
  876. */
  877. #if BOTH(INDIVIDUAL_AXIS_HOMING_MENU, DELTA)
  878. #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
  879. #endif
  880. /**
  881. * Sanity checking for all Průša MMU
  882. */
  883. #ifdef SNMM
  884. #error "SNMM is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
  885. #elif ENABLED(MK2_MULTIPLEXER)
  886. #error "MK2_MULTIPLEXER is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
  887. #elif ENABLED(PRUSA_MMU2)
  888. #error "PRUSA_MMU2 is obsolete. Define MMU_MODEL as PRUSA_MMU2 instead."
  889. #elif ENABLED(PRUSA_MMU2_S_MODE)
  890. #error "PRUSA_MMU2_S_MODE is obsolete. Define MMU_MODEL as PRUSA_MMU2S instead."
  891. #endif
  892. /**
  893. * Multi-Material-Unit 2 / SMuFF requirements
  894. */
  895. #if HAS_PRUSA_MMU2
  896. #if EXTRUDERS != 5
  897. #undef SINGLENOZZLE
  898. #error "PRUSA_MMU2(S) requires exactly 5 EXTRUDERS. Please update your Configuration."
  899. #elif DISABLED(NOZZLE_PARK_FEATURE)
  900. #error "PRUSA_MMU2(S) requires NOZZLE_PARK_FEATURE. Enable it to continue."
  901. #elif HAS_PRUSA_MMU2S && DISABLED(FILAMENT_RUNOUT_SENSOR)
  902. #error "PRUSA_MMU2S requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
  903. #elif ENABLED(MMU_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR)
  904. #error "MMU_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
  905. #elif ENABLED(MMU_EXTRUDER_SENSOR) && !HAS_LCD_MENU
  906. #error "MMU_EXTRUDER_SENSOR requires an LCD supporting MarlinUI to be enabled."
  907. #elif DISABLED(ADVANCED_PAUSE_FEATURE)
  908. static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2(S) / SMUFF_EMU_MMU2(S).");
  909. #endif
  910. #endif
  911. #if HAS_SMUFF && EXTRUDERS > 12
  912. #error "Too many extruders for SMUFF_EMU_MMU2(S). (12 maximum)."
  913. #endif
  914. /**
  915. * Options only for EXTRUDERS > 1
  916. */
  917. #if HAS_MULTI_EXTRUDER
  918. #if EXTRUDERS > 8
  919. #error "Marlin supports a maximum of 8 EXTRUDERS."
  920. #endif
  921. #if ENABLED(HEATERS_PARALLEL)
  922. #error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
  923. #endif
  924. #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
  925. #ifndef TOOLCHANGE_FS_LENGTH
  926. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH."
  927. #elif !defined(TOOLCHANGE_FS_RETRACT_SPEED)
  928. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_RETRACT_SPEED."
  929. #elif !defined(TOOLCHANGE_FS_PRIME_SPEED)
  930. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_PRIME_SPEED."
  931. #endif
  932. #endif
  933. #if ENABLED(TOOLCHANGE_PARK)
  934. #ifndef TOOLCHANGE_PARK_XY
  935. #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY."
  936. #elif !defined(TOOLCHANGE_PARK_XY_FEEDRATE)
  937. #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY_FEEDRATE."
  938. #endif
  939. #endif
  940. #ifndef TOOLCHANGE_ZRAISE
  941. #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1."
  942. #endif
  943. #elif HAS_PRUSA_MMU1 || HAS_SMUFF
  944. #error "Multi-Material-Unit requires 2 or more EXTRUDERS."
  945. #elif ENABLED(SINGLENOZZLE)
  946. #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
  947. #endif
  948. /**
  949. * A Dual Nozzle carriage with switching servo
  950. */
  951. #if ENABLED(SWITCHING_NOZZLE)
  952. #if ENABLED(DUAL_X_CARRIAGE)
  953. #error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible."
  954. #elif ENABLED(SINGLENOZZLE)
  955. #error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible."
  956. #elif EXTRUDERS != 2
  957. #error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
  958. #elif NUM_SERVOS < 1
  959. #error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1."
  960. #endif
  961. #ifndef SWITCHING_NOZZLE_SERVO_NR
  962. #error "SWITCHING_NOZZLE requires SWITCHING_NOZZLE_SERVO_NR."
  963. #elif SWITCHING_NOZZLE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  964. #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
  965. #elif SWITCHING_NOZZLE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  966. #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
  967. #elif SWITCHING_NOZZLE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  968. #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
  969. #elif SWITCHING_NOZZLE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  970. #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
  971. #endif
  972. #ifdef SWITCHING_NOZZLE_E1_SERVO_NR
  973. #if SWITCHING_NOZZLE_E1_SERVO_NR == SWITCHING_NOZZLE_SERVO_NR
  974. #error "SWITCHING_NOZZLE_E1_SERVO_NR must be different from SWITCHING_NOZZLE_SERVO_NR."
  975. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  976. #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
  977. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  978. #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
  979. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  980. #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
  981. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  982. #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
  983. #endif
  984. #endif
  985. #endif
  986. /**
  987. * Single Stepper Dual Extruder with switching servo
  988. */
  989. #if ENABLED(SWITCHING_EXTRUDER)
  990. #if NUM_SERVOS < 1
  991. #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
  992. #elif SWITCHING_EXTRUDER_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  993. #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
  994. #elif SWITCHING_EXTRUDER_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  995. #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
  996. #elif SWITCHING_EXTRUDER_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  997. #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
  998. #elif SWITCHING_EXTRUDER_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  999. #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
  1000. #endif
  1001. #if EXTRUDERS > 3
  1002. #if NUM_SERVOS < 2
  1003. #error "SWITCHING_EXTRUDER with 4 extruders requires NUM_SERVOS >= 2."
  1004. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  1005. #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
  1006. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  1007. #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
  1008. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  1009. #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
  1010. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  1011. #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
  1012. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == SWITCHING_EXTRUDER_SERVO_NR
  1013. #error "SWITCHING_EXTRUDER_E23_SERVO_NR should be a different extruder from SWITCHING_EXTRUDER_SERVO_NR."
  1014. #endif
  1015. #endif
  1016. #endif
  1017. /**
  1018. * Mixing Extruder requirements
  1019. */
  1020. #if ENABLED(MIXING_EXTRUDER)
  1021. #if HAS_MULTI_EXTRUDER
  1022. #error "For MIXING_EXTRUDER set MIXING_STEPPERS > 1 instead of EXTRUDERS > 1."
  1023. #elif MIXING_STEPPERS < 2
  1024. #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
  1025. #elif ENABLED(FILAMENT_SENSOR)
  1026. #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway."
  1027. #elif ENABLED(SWITCHING_EXTRUDER)
  1028. #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both."
  1029. #elif ENABLED(SINGLENOZZLE)
  1030. #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE."
  1031. #endif
  1032. #endif
  1033. /**
  1034. * Linear Advance 1.5 - Check K value range
  1035. */
  1036. #if ENABLED(LIN_ADVANCE)
  1037. static_assert(
  1038. WITHIN(LIN_ADVANCE_K, 0, 10),
  1039. "LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)."
  1040. );
  1041. #if ENABLED(S_CURVE_ACCELERATION) && DISABLED(EXPERIMENTAL_SCURVE)
  1042. #error "LIN_ADVANCE and S_CURVE_ACCELERATION may not play well together! Enable EXPERIMENTAL_SCURVE to continue."
  1043. #endif
  1044. #endif
  1045. /**
  1046. * Special tool-changing options
  1047. */
  1048. #if MANY(SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  1049. #error "Please select only one of SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, or ELECTROMAGNETIC_SWITCHING_TOOLHEAD."
  1050. #endif
  1051. /**
  1052. * (Magnetic) Parking Extruder requirements
  1053. */
  1054. #if ANY(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER)
  1055. #if ENABLED(EXT_SOLENOID)
  1056. #error "(MAGNETIC_)PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)"
  1057. #elif EXTRUDERS != 2
  1058. #error "(MAGNETIC_)PARKING_EXTRUDER requires exactly 2 EXTRUDERS."
  1059. #elif !defined(PARKING_EXTRUDER_PARKING_X)
  1060. #error "(MAGNETIC_)PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X."
  1061. #elif !defined(TOOLCHANGE_ZRAISE)
  1062. #error "(MAGNETIC_)PARKING_EXTRUDER requires TOOLCHANGE_ZRAISE."
  1063. #elif TOOLCHANGE_ZRAISE < 0
  1064. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  1065. #elif ENABLED(PARKING_EXTRUDER)
  1066. #if !PINS_EXIST(SOL0, SOL1)
  1067. #error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN."
  1068. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH)
  1069. #error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW."
  1070. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000)
  1071. #error "PARKING_EXTRUDER_SOLENOIDS_DELAY must be between 0 and 2000 (ms)."
  1072. #endif
  1073. #endif
  1074. #endif
  1075. /**
  1076. * Switching Toolhead requirements
  1077. */
  1078. #if ENABLED(SWITCHING_TOOLHEAD)
  1079. #ifndef SWITCHING_TOOLHEAD_SERVO_NR
  1080. #error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SERVO_NR."
  1081. #elif EXTRUDERS < 2
  1082. #error "SWITCHING_TOOLHEAD requires at least 2 EXTRUDERS."
  1083. #elif NUM_SERVOS < (SWITCHING_TOOLHEAD_SERVO_NR - 1)
  1084. #if SWITCHING_TOOLHEAD_SERVO_NR == 0
  1085. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 0 requires NUM_SERVOS >= 1."
  1086. #elif SWITCHING_TOOLHEAD_SERVO_NR == 1
  1087. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 1 requires NUM_SERVOS >= 2."
  1088. #elif SWITCHING_TOOLHEAD_SERVO_NR == 2
  1089. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 2 requires NUM_SERVOS >= 3."
  1090. #elif SWITCHING_TOOLHEAD_SERVO_NR == 3
  1091. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 3 requires NUM_SERVOS >= 4."
  1092. #endif
  1093. #elif !defined(TOOLCHANGE_ZRAISE)
  1094. #error "SWITCHING_TOOLHEAD requires TOOLCHANGE_ZRAISE."
  1095. #elif TOOLCHANGE_ZRAISE < 0
  1096. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  1097. #endif
  1098. #endif
  1099. /**
  1100. * (Electro)magnetic Switching Toolhead requirements
  1101. */
  1102. #if EITHER(MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  1103. #ifndef SWITCHING_TOOLHEAD_Y_POS
  1104. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_POS"
  1105. #elif !defined(SWITCHING_TOOLHEAD_X_POS)
  1106. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_X_POS"
  1107. #elif !defined(SWITCHING_TOOLHEAD_Z_HOP)
  1108. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
  1109. #elif !defined(SWITCHING_TOOLHEAD_Y_CLEAR)
  1110. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_CLEAR."
  1111. #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  1112. #if ENABLED(EXT_SOLENOID)
  1113. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD and EXT_SOLENOID are incompatible. (Pins are used twice.)"
  1114. #elif !PIN_EXISTS(SOL0)
  1115. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SOL0_PIN."
  1116. #endif
  1117. #endif
  1118. #endif
  1119. /**
  1120. * Part-Cooling Fan Multiplexer requirements
  1121. */
  1122. #if PIN_EXISTS(FANMUX1)
  1123. #if !HAS_FANMUX
  1124. #error "FANMUX0_PIN must be set before FANMUX1_PIN can be set."
  1125. #endif
  1126. #elif PIN_EXISTS(FANMUX2)
  1127. #error "FANMUX0_PIN and FANMUX1_PIN must be set before FANMUX2_PIN can be set."
  1128. #endif
  1129. /**
  1130. * Limited user-controlled fans
  1131. */
  1132. #if NUM_M106_FANS > FAN_COUNT
  1133. #error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS."
  1134. #endif
  1135. /**
  1136. * Limited number of servos
  1137. */
  1138. #if NUM_SERVOS > NUM_SERVO_PLUGS
  1139. #error "The selected board doesn't support enough servos for your configuration. Reduce NUM_SERVOS."
  1140. #endif
  1141. /**
  1142. * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder
  1143. */
  1144. #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)
  1145. #error "Z_PROBE_SERVO_NR, switching nozzle, switching toolhead or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE."
  1146. #endif
  1147. /**
  1148. * Required LCD language
  1149. */
  1150. #if HAS_MARLINUI_HD44780 && !defined(DISPLAY_CHARSET_HD44780)
  1151. #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller."
  1152. #endif
  1153. /**
  1154. * Bed Heating Options - PID vs Limit Switching
  1155. */
  1156. #if BOTH(PIDTEMPBED, BED_LIMIT_SWITCHING)
  1157. #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED."
  1158. #endif
  1159. /**
  1160. * Synchronous M106/M107 checks
  1161. */
  1162. #if ENABLED(LASER_SYNCHRONOUS_M106_M107)
  1163. #if FAN_KICKSTART_TIME
  1164. #error "FAN_KICKSTART_TIME must be 0 with LASER_SYNCHRONOUS_M106_M107 (because the laser will always come on at FULL power)."
  1165. #elif FAN_MIN_PWM
  1166. #error "FAN_MIN_PWM must be 0 with LASER_SYNCHRONOUS_M106_M107 (otherwise the laser will never turn OFF)."
  1167. #endif
  1168. #endif
  1169. /**
  1170. * Chamber Heating Options - PID vs Limit Switching
  1171. */
  1172. #if BOTH(PIDTEMPCHAMBER, CHAMBER_LIMIT_SWITCHING)
  1173. #error "To use CHAMBER_LIMIT_SWITCHING you must disable PIDTEMPCHAMBER."
  1174. #endif
  1175. /**
  1176. * Kinematics
  1177. */
  1178. /**
  1179. * Allow only one kinematic type to be defined
  1180. */
  1181. #if MANY(DELTA, MORGAN_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY)
  1182. #error "Please enable only one of DELTA, MORGAN_SCARA, AXEL_TPARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, COREZY, or MARKFORGED_XY."
  1183. #endif
  1184. /**
  1185. * Delta requirements
  1186. */
  1187. #if ENABLED(DELTA)
  1188. #if NONE(USE_XMAX_PLUG, USE_YMAX_PLUG, USE_ZMAX_PLUG)
  1189. #error "You probably want to use Max Endstops for DELTA!"
  1190. #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED
  1191. #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
  1192. #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_LCD_MENU)
  1193. #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
  1194. #elif ENABLED(DELTA_CALIBRATION_MENU) && !HAS_LCD_MENU
  1195. #error "DELTA_CALIBRATION_MENU requires an LCD Controller."
  1196. #elif ABL_GRID
  1197. #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0
  1198. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
  1199. #elif GRID_MAX_POINTS_X < 3
  1200. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher."
  1201. #endif
  1202. #endif
  1203. #endif
  1204. /**
  1205. * Junction deviation is incompatible with kinematic systems.
  1206. */
  1207. #if HAS_JUNCTION_DEVIATION && IS_KINEMATIC
  1208. #error "CLASSIC_JERK is required for DELTA and SCARA."
  1209. #endif
  1210. /**
  1211. * Probes
  1212. */
  1213. /**
  1214. * Allow only one probe option to be defined
  1215. */
  1216. #if 1 < 0 \
  1217. + (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \
  1218. + COUNT_ENABLED(PROBE_MANUALLY, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING)
  1219. #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."
  1220. #endif
  1221. #if HAS_BED_PROBE
  1222. /**
  1223. * Z_PROBE_SLED is incompatible with DELTA
  1224. */
  1225. #if BOTH(Z_PROBE_SLED, DELTA)
  1226. #error "You cannot use Z_PROBE_SLED with DELTA."
  1227. #endif
  1228. /**
  1229. * SOLENOID_PROBE requirements
  1230. */
  1231. #if ENABLED(SOLENOID_PROBE)
  1232. #if ENABLED(EXT_SOLENOID)
  1233. #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID."
  1234. #elif !HAS_SOLENOID_1
  1235. #error "SOLENOID_PROBE requires SOL1_PIN."
  1236. #endif
  1237. #endif
  1238. /**
  1239. * NUM_SERVOS is required for a Z servo probe
  1240. */
  1241. #if HAS_Z_SERVO_PROBE
  1242. #if !NUM_SERVOS
  1243. #error "NUM_SERVOS is required for a Z servo probe (Z_PROBE_SERVO_NR)."
  1244. #elif Z_PROBE_SERVO_NR >= NUM_SERVOS
  1245. #error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS."
  1246. #elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  1247. #error "SERVO0_PIN must be defined for your servo or BLTOUCH probe."
  1248. #elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  1249. #error "SERVO1_PIN must be defined for your servo or BLTOUCH probe."
  1250. #elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  1251. #error "SERVO2_PIN must be defined for your servo or BLTOUCH probe."
  1252. #elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  1253. #error "SERVO3_PIN must be defined for your servo or BLTOUCH probe."
  1254. #endif
  1255. #endif
  1256. #if ENABLED(BLTOUCH)
  1257. #if BLTOUCH_DELAY < 200
  1258. #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported."
  1259. #elif DISABLED(BLTOUCH_SET_5V_MODE) && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN, ENDSTOPPULLUP_ZMIN_PROBE)
  1260. #error "BLTOUCH without BLTOUCH_SET_5V_MODE requires ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN or ENDSTOPPULLUP_ZMIN_PROBE."
  1261. #endif
  1262. #endif
  1263. #if ENABLED(RACK_AND_PINION_PROBE) && !(defined(Z_PROBE_DEPLOY_X) && defined(Z_PROBE_RETRACT_X))
  1264. #error "RACK_AND_PINION_PROBE requires Z_PROBE_DEPLOY_X and Z_PROBE_RETRACT_X."
  1265. #endif
  1266. /**
  1267. * Touch-MI probe requirements
  1268. */
  1269. #if ENABLED(TOUCH_MI_PROBE)
  1270. #if DISABLED(Z_SAFE_HOMING)
  1271. #error "TOUCH_MI_PROBE requires Z_SAFE_HOMING."
  1272. #elif !defined(TOUCH_MI_RETRACT_Z)
  1273. #error "TOUCH_MI_PROBE requires TOUCH_MI_RETRACT_Z."
  1274. #elif defined(Z_AFTER_PROBING)
  1275. #error "TOUCH_MI_PROBE requires Z_AFTER_PROBING to be disabled."
  1276. #elif Z_HOMING_HEIGHT < 10
  1277. #error "TOUCH_MI_PROBE requires Z_HOMING_HEIGHT >= 10."
  1278. #elif Z_MIN_PROBE_ENDSTOP_INVERTING
  1279. #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING to be set to false."
  1280. #elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
  1281. #error "TOUCH_MI_PROBE requires BABYSTEPPING with BABYSTEP_ZPROBE_OFFSET."
  1282. #elif !HAS_RESUME_CONTINUE
  1283. #error "TOUCH_MI_PROBE currently requires an LCD controller or EMERGENCY_PARSER."
  1284. #endif
  1285. #endif
  1286. /**
  1287. * Require pin options and pins to be defined
  1288. */
  1289. #if ENABLED(SENSORLESS_PROBING)
  1290. #if ENABLED(DELTA) && !(AXIS_HAS_STALLGUARD(X) && AXIS_HAS_STALLGUARD(Y) && AXIS_HAS_STALLGUARD(Z))
  1291. #error "SENSORLESS_PROBING requires TMC2130/2160/2209/5130/5160 drivers on X, Y, and Z."
  1292. #elif !AXIS_HAS_STALLGUARD(Z)
  1293. #error "SENSORLESS_PROBING requires a TMC2130/2160/2209/5130/5160 driver on Z."
  1294. #endif
  1295. #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  1296. #if DISABLED(USE_ZMIN_PLUG)
  1297. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled."
  1298. #elif !HAS_Z_MIN
  1299. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined."
  1300. #elif Z_MIN_PROBE_ENDSTOP_INVERTING != Z_MIN_ENDSTOP_INVERTING
  1301. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING."
  1302. #endif
  1303. #elif !HAS_Z_MIN_PROBE_PIN
  1304. #error "Z_MIN_PROBE_PIN must be defined if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN is not enabled."
  1305. #endif
  1306. /**
  1307. * Check for improper NOZZLE_TO_PROBE_OFFSET
  1308. */
  1309. constexpr xyz_pos_t sanity_nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET;
  1310. #if ENABLED(NOZZLE_AS_PROBE)
  1311. static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0,
  1312. "NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0.");
  1313. #else
  1314. static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0.");
  1315. static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0.");
  1316. static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0.");
  1317. static_assert(PROBING_MARGIN_LEFT >= 0, "PROBING_MARGIN_LEFT must be >= 0.");
  1318. static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0.");
  1319. #endif
  1320. #define _MARGIN(A) TERN(IS_SCARA, SCARA_PRINTABLE_RADIUS, TERN(DELTA, DELTA_PRINTABLE_RADIUS, ((A##_BED_SIZE) / 2)))
  1321. static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large.");
  1322. static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large.");
  1323. static_assert(PROBING_MARGIN_FRONT < _MARGIN(Y), "PROBING_MARGIN_FRONT is too large.");
  1324. static_assert(PROBING_MARGIN_LEFT < _MARGIN(X), "PROBING_MARGIN_LEFT is too large.");
  1325. static_assert(PROBING_MARGIN_RIGHT < _MARGIN(X), "PROBING_MARGIN_RIGHT is too large.");
  1326. #undef _MARGIN
  1327. /**
  1328. * Make sure Z raise values are set
  1329. */
  1330. #ifndef Z_CLEARANCE_DEPLOY_PROBE
  1331. #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration."
  1332. #elif !defined(Z_CLEARANCE_BETWEEN_PROBES)
  1333. #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration."
  1334. #elif Z_CLEARANCE_DEPLOY_PROBE < 0
  1335. #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0."
  1336. #elif Z_CLEARANCE_BETWEEN_PROBES < 0
  1337. #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
  1338. #elif Z_AFTER_PROBING < 0
  1339. #error "Probes need Z_AFTER_PROBING >= 0."
  1340. #endif
  1341. #if MULTIPLE_PROBING > 0 || EXTRA_PROBING > 0
  1342. #if MULTIPLE_PROBING == 0
  1343. #error "EXTRA_PROBING requires MULTIPLE_PROBING."
  1344. #elif MULTIPLE_PROBING < 2
  1345. #error "MULTIPLE_PROBING must be 2 or more."
  1346. #elif MULTIPLE_PROBING <= EXTRA_PROBING
  1347. #error "EXTRA_PROBING must be less than MULTIPLE_PROBING."
  1348. #endif
  1349. #endif
  1350. #if Z_PROBE_LOW_POINT > 0
  1351. #error "Z_PROBE_LOW_POINT must be less than or equal to 0."
  1352. #endif
  1353. #if HOMING_Z_WITH_PROBE && IS_CARTESIAN && DISABLED(Z_SAFE_HOMING)
  1354. #error "Z_SAFE_HOMING is recommended when homing with a probe. Enable it or comment out this line to continue."
  1355. #endif
  1356. #if ENABLED(PROBE_ACTIVATION_SWITCH)
  1357. #ifndef PROBE_ACTIVATION_SWITCH_STATE
  1358. #error "PROBE_ACTIVATION_SWITCH_STATE is required for PROBE_ACTIVATION_SWITCH."
  1359. #elif !PIN_EXISTS(PROBE_ACTIVATION_SWITCH)
  1360. #error "A PROBE_ACTIVATION_SWITCH_PIN is required for PROBE_ACTIVATION_SWITCH."
  1361. #endif
  1362. #endif
  1363. #else
  1364. /**
  1365. * Require some kind of probe for bed leveling and probe testing
  1366. */
  1367. #if HAS_ABL_NOT_UBL && !PROBE_SELECTED
  1368. #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo."
  1369. #endif
  1370. #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
  1371. #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."
  1372. #endif
  1373. #endif
  1374. #if ENABLED(LEVEL_BED_CORNERS)
  1375. #ifndef LEVEL_CORNERS_INSET_LFRB
  1376. #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values."
  1377. #elif ENABLED(LEVEL_CORNERS_USE_PROBE)
  1378. #if !HAS_BED_PROBE
  1379. #error "LEVEL_CORNERS_USE_PROBE requires a real probe."
  1380. #elif ENABLED(SENSORLESS_PROBING)
  1381. #error "LEVEL_CORNERS_USE_PROBE is incompatible with SENSORLESS_PROBING."
  1382. #endif
  1383. #endif
  1384. #endif
  1385. /**
  1386. * Allow only one bed leveling option to be defined
  1387. */
  1388. #if MANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
  1389. #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."
  1390. #endif
  1391. /**
  1392. * Bed Leveling Requirements
  1393. */
  1394. #if ENABLED(AUTO_BED_LEVELING_UBL)
  1395. /**
  1396. * Unified Bed Leveling
  1397. */
  1398. #if IS_SCARA
  1399. #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
  1400. #elif DISABLED(EEPROM_SETTINGS)
  1401. #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS."
  1402. #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
  1403. #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
  1404. #endif
  1405. #elif HAS_ABL_NOT_UBL
  1406. /**
  1407. * Auto Bed Leveling
  1408. */
  1409. /**
  1410. * Delta and SCARA have limited bed leveling options
  1411. */
  1412. #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR)
  1413. #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option."
  1414. #endif
  1415. #elif ENABLED(MESH_BED_LEVELING)
  1416. // Mesh Bed Leveling
  1417. #if ENABLED(DELTA)
  1418. #error "MESH_BED_LEVELING is not compatible with DELTA printers."
  1419. #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9
  1420. #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
  1421. #endif
  1422. #endif
  1423. #if ALL(HAS_LEVELING, RESTORE_LEVELING_AFTER_G28, ENABLE_LEVELING_AFTER_G28)
  1424. #error "Only enable RESTORE_LEVELING_AFTER_G28 or ENABLE_LEVELING_AFTER_G28, but not both."
  1425. #endif
  1426. #if HAS_MESH && HAS_CLASSIC_JERK
  1427. static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
  1428. #endif
  1429. #if ENABLED(G26_MESH_VALIDATION)
  1430. #if !EXTRUDERS
  1431. #error "G26_MESH_VALIDATION requires at least one extruder."
  1432. #elif !HAS_MESH
  1433. #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
  1434. #endif
  1435. #endif
  1436. #if ENABLED(MESH_EDIT_GFX_OVERLAY) && !BOTH(AUTO_BED_LEVELING_UBL, HAS_MARLINUI_U8GLIB)
  1437. #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD."
  1438. #endif
  1439. #if ENABLED(G29_RETRY_AND_RECOVER)
  1440. #if ENABLED(AUTO_BED_LEVELING_UBL)
  1441. #error "G29_RETRY_AND_RECOVER is not compatible with UBL."
  1442. #elif ENABLED(MESH_BED_LEVELING)
  1443. #error "G29_RETRY_AND_RECOVER is not compatible with MESH_BED_LEVELING."
  1444. #endif
  1445. #endif
  1446. /**
  1447. * LCD_BED_LEVELING requirements
  1448. */
  1449. #if ENABLED(LCD_BED_LEVELING)
  1450. #if !HAS_LCD_MENU
  1451. #error "LCD_BED_LEVELING requires a programmable LCD controller."
  1452. #elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL)
  1453. #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
  1454. #endif
  1455. #endif
  1456. #if BOTH(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
  1457. #error "Disable PREHEAT_BEFORE_LEVELING when using PREHEAT_BEFORE_PROBING."
  1458. #endif
  1459. /**
  1460. * Homing
  1461. */
  1462. constexpr float hbm[] = HOMING_BUMP_MM;
  1463. static_assert(COUNT(hbm) == XYZ, "HOMING_BUMP_MM requires X, Y, and Z elements.");
  1464. static_assert(hbm[X_AXIS] >= 0, "HOMING_BUMP_MM.X must be greater than or equal to 0.");
  1465. static_assert(hbm[Y_AXIS] >= 0, "HOMING_BUMP_MM.Y must be greater than or equal to 0.");
  1466. static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal to 0.");
  1467. #if ENABLED(CODEPENDENT_XY_HOMING)
  1468. #if ENABLED(QUICK_HOME)
  1469. #error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING."
  1470. #elif IS_KINEMATIC
  1471. #error "CODEPENDENT_XY_HOMING requires a Cartesian setup."
  1472. #endif
  1473. #endif
  1474. /**
  1475. * Make sure Z_SAFE_HOMING point is reachable
  1476. */
  1477. #if ENABLED(Z_SAFE_HOMING)
  1478. 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.");
  1479. 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.");
  1480. #endif
  1481. /**
  1482. * Make sure DISABLE_[XYZ] compatible with selected homing options
  1483. */
  1484. #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z)
  1485. #if EITHER(HOME_AFTER_DEACTIVATE, Z_SAFE_HOMING)
  1486. #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
  1487. #endif
  1488. #endif
  1489. /**
  1490. * Filament Width Sensor
  1491. */
  1492. #if ENABLED(FILAMENT_WIDTH_SENSOR)
  1493. #if !HAS_FILAMENT_WIDTH_SENSOR
  1494. #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
  1495. #elif ENABLED(NO_VOLUMETRICS)
  1496. #error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled."
  1497. #endif
  1498. #endif
  1499. /**
  1500. * System Power Sensor
  1501. */
  1502. #if ENABLED(POWER_MONITOR_CURRENT) && !PIN_EXISTS(POWER_MONITOR_CURRENT)
  1503. #error "POWER_MONITOR_CURRENT requires a valid POWER_MONITOR_CURRENT_PIN."
  1504. #elif ENABLED(POWER_MONITOR_VOLTAGE) && !PIN_EXISTS(POWER_MONITOR_VOLTAGE)
  1505. #error "POWER_MONITOR_VOLTAGE requires POWER_MONITOR_VOLTAGE_PIN to be defined."
  1506. #elif BOTH(POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE) && POWER_MONITOR_CURRENT_PIN == POWER_MONITOR_VOLTAGE_PIN
  1507. #error "POWER_MONITOR_CURRENT_PIN and POWER_MONITOR_VOLTAGE_PIN must be different."
  1508. #endif
  1509. /**
  1510. * Volumetric Extruder Limit
  1511. */
  1512. #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT)
  1513. #if ENABLED(NO_VOLUMETRICS)
  1514. #error "VOLUMETRIC_EXTRUDER_LIMIT requires NO_VOLUMETRICS to be disabled."
  1515. #elif MIN_STEPS_PER_SEGMENT > 1
  1516. #error "VOLUMETRIC_EXTRUDER_LIMIT is not compatible with MIN_STEPS_PER_SEGMENT greater than 1."
  1517. #endif
  1518. #endif
  1519. /**
  1520. * ULTIPANEL encoder
  1521. */
  1522. #if IS_ULTIPANEL && NONE(IS_NEWPANEL, SR_LCD_2W_NL) && !PIN_EXISTS(SHIFT_CLK)
  1523. #error "ULTIPANEL controllers require some kind of encoder."
  1524. #endif
  1525. #if ENCODER_PULSES_PER_STEP < 0
  1526. #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead."
  1527. #endif
  1528. /**
  1529. * SAV_3DGLCD display options
  1530. */
  1531. #if ENABLED(SAV_3DGLCD)
  1532. #if NONE(U8GLIB_SSD1306, U8GLIB_SH1106)
  1533. #error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
  1534. #elif BOTH(U8GLIB_SSD1306, U8GLIB_SH1106)
  1535. #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
  1536. #endif
  1537. #endif
  1538. /**
  1539. * Allen Key
  1540. * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
  1541. */
  1542. #if BOTH(Z_PROBE_ALLEN_KEY, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && Z_HOME_DIR < 0
  1543. #error "You can't home to a Z min endstop with a Z_PROBE_ALLEN_KEY."
  1544. #endif
  1545. /**
  1546. * Dual X Carriage requirements
  1547. */
  1548. #if ENABLED(DUAL_X_CARRIAGE)
  1549. #if EXTRUDERS < 2
  1550. #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
  1551. #elif ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY)
  1552. #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, COREZX, or MARKFORGED_XY."
  1553. #elif !GOOD_AXIS_PINS(X2)
  1554. #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
  1555. #elif !HAS_X_MAX
  1556. #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop."
  1557. #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
  1558. #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
  1559. #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1
  1560. #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1."
  1561. #endif
  1562. #endif
  1563. #undef GOOD_AXIS_PINS
  1564. /**
  1565. * Make sure auto fan pins don't conflict with the fan pin
  1566. */
  1567. #if HAS_AUTO_FAN
  1568. #if HAS_FAN0
  1569. #if E0_AUTO_FAN_PIN == FAN_PIN
  1570. #error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
  1571. #elif E1_AUTO_FAN_PIN == FAN_PIN
  1572. #error "You cannot set E1_AUTO_FAN_PIN equal to FAN_PIN."
  1573. #elif E2_AUTO_FAN_PIN == FAN_PIN
  1574. #error "You cannot set E2_AUTO_FAN_PIN equal to FAN_PIN."
  1575. #elif E3_AUTO_FAN_PIN == FAN_PIN
  1576. #error "You cannot set E3_AUTO_FAN_PIN equal to FAN_PIN."
  1577. #endif
  1578. #endif
  1579. #endif
  1580. #if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN
  1581. #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."
  1582. #endif
  1583. #if ENABLED(USE_CONTROLLER_FAN)
  1584. #if !HAS_CONTROLLER_FAN
  1585. #error "USE_CONTROLLER_FAN requires a CONTROLLER_FAN_PIN. Define in Configuration_adv.h."
  1586. #elif E0_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1587. #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1588. #elif E1_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1589. #error "You cannot set E1_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1590. #elif E2_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1591. #error "You cannot set E2_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1592. #elif E3_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1593. #error "You cannot set E3_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1594. #endif
  1595. #endif
  1596. /**
  1597. * Case Light requirements
  1598. */
  1599. #if NEED_CASE_LIGHT_PIN
  1600. #if !PIN_EXISTS(CASE_LIGHT)
  1601. #error "CASE_LIGHT_ENABLE requires CASE_LIGHT_PIN, CASE_LIGHT_USE_NEOPIXEL, or CASE_LIGHT_USE_RGB_LED."
  1602. #elif CASE_LIGHT_PIN == FAN_PIN
  1603. #error "CASE_LIGHT_PIN conflicts with FAN_PIN. Resolve before continuing."
  1604. #endif
  1605. #endif
  1606. /**
  1607. * Required custom thermistor settings
  1608. */
  1609. #if TEMP_SENSOR_0_IS_CUSTOM && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA))
  1610. #error "TEMP_SENSOR_0 1000 requires HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS and HOTEND0_BETA in Configuration_adv.h."
  1611. #elif TEMP_SENSOR_1_IS_CUSTOM && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA))
  1612. #error "TEMP_SENSOR_1 1000 requires HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS and HOTEND1_BETA in Configuration_adv.h."
  1613. #elif TEMP_SENSOR_2_IS_CUSTOM && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA))
  1614. #error "TEMP_SENSOR_2 1000 requires HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS and HOTEND2_BETA in Configuration_adv.h."
  1615. #elif TEMP_SENSOR_3_IS_CUSTOM && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA))
  1616. #error "TEMP_SENSOR_3 1000 requires HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS and HOTEND3_BETA in Configuration_adv.h."
  1617. #elif TEMP_SENSOR_4_IS_CUSTOM && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA))
  1618. #error "TEMP_SENSOR_4 1000 requires HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS and HOTEND4_BETA in Configuration_adv.h."
  1619. #elif TEMP_SENSOR_5_IS_CUSTOM && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA))
  1620. #error "TEMP_SENSOR_5 1000 requires HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS and HOTEND5_BETA in Configuration_adv.h."
  1621. #elif TEMP_SENSOR_6_IS_CUSTOM && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA))
  1622. #error "TEMP_SENSOR_6 1000 requires HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS and HOTEND6_BETA in Configuration_adv.h."
  1623. #elif TEMP_SENSOR_7_IS_CUSTOM && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA))
  1624. #error "TEMP_SENSOR_7 1000 requires HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS and HOTEND7_BETA in Configuration_adv.h."
  1625. #elif TEMP_SENSOR_BED_IS_CUSTOM && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA))
  1626. #error "TEMP_SENSOR_BED 1000 requires BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS and BED_BETA in Configuration_adv.h."
  1627. #elif TEMP_SENSOR_CHAMBER_IS_CUSTOM && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA))
  1628. #error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h."
  1629. #elif TEMP_SENSOR_PROBE_IS_CUSTOM && !(defined(PROBE_PULLUP_RESISTOR_OHMS) && defined(PROBE_RESISTANCE_25C_OHMS) && defined(PROBE_BETA))
  1630. #error "TEMP_SENSOR_PROBE 1000 requires PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS and PROBE_BETA in Configuration_adv.h."
  1631. #endif
  1632. /**
  1633. * Pins and Sensor IDs must be set for each heater
  1634. */
  1635. #if TEMP_SENSOR_0_IS_MAX6675 && !ANY_PIN(MAX6675_SS, MAX31855_CS, MAX31865_CS, MAX6675_CS)
  1636. #error "TEMP_SENSOR_0 requires a MAX6675_SS_PIN, MAX6675_CS_PIN, MAX31855_CS_PIN, or MAX31865_CS_PIN."
  1637. #elif HAS_HOTEND && !HAS_TEMP_HOTEND && !TEMP_SENSOR_0_IS_DUMMY
  1638. #error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board."
  1639. #elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1
  1640. #error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin."
  1641. #endif
  1642. #if HAS_MULTI_HOTEND
  1643. #if TEMP_SENSOR_1_IS_MAX6675 && !ANY_PIN(MAX6675_SS2, MAX31855_CS2, MAX31865_CS2, MAX6675_CS2)
  1644. #error "TEMP_SENSOR_1 requires a MAX6675_SS2_PIN, MAX6675_CS2_PIN, MAX31855_CS2_PIN, or MAX31865_CS2_PIN."
  1645. #elif TEMP_SENSOR_1 == 0
  1646. #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
  1647. #elif !ANY_PIN(TEMP_1, MAX6675_SS2) && !TEMP_SENSOR_1_IS_DUMMY
  1648. #error "TEMP_1_PIN or MAX6675_SS2_PIN not defined for this board."
  1649. #elif ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  1650. #error "HOTENDS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT."
  1651. #endif
  1652. #if HOTENDS > 2
  1653. #if TEMP_SENSOR_2 == 0
  1654. #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
  1655. #elif !HAS_HEATER_2
  1656. #error "HEATER_2_PIN not defined for this board."
  1657. #elif !PIN_EXISTS(TEMP_2) && !TEMP_SENSOR_2_IS_DUMMY
  1658. #error "TEMP_2_PIN not defined for this board."
  1659. #endif
  1660. #if HOTENDS > 3
  1661. #if TEMP_SENSOR_3 == 0
  1662. #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
  1663. #elif !HAS_HEATER_3
  1664. #error "HEATER_3_PIN not defined for this board."
  1665. #elif !PIN_EXISTS(TEMP_3) && !TEMP_SENSOR_3_IS_DUMMY
  1666. #error "TEMP_3_PIN not defined for this board."
  1667. #endif
  1668. #if HOTENDS > 4
  1669. #if TEMP_SENSOR_4 == 0
  1670. #error "TEMP_SENSOR_4 is required with 5 or more HOTENDS."
  1671. #elif !HAS_HEATER_4
  1672. #error "HEATER_4_PIN not defined for this board."
  1673. #elif !PIN_EXISTS(TEMP_4) && !TEMP_SENSOR_4_IS_DUMMY
  1674. #error "TEMP_4_PIN not defined for this board."
  1675. #endif
  1676. #if HOTENDS > 5
  1677. #if TEMP_SENSOR_5 == 0
  1678. #error "TEMP_SENSOR_5 is required with 6 HOTENDS."
  1679. #elif !HAS_HEATER_5
  1680. #error "HEATER_5_PIN not defined for this board."
  1681. #elif !PIN_EXISTS(TEMP_5) && !TEMP_SENSOR_5_IS_DUMMY
  1682. #error "TEMP_5_PIN not defined for this board."
  1683. #endif
  1684. #if HOTENDS > 6
  1685. #if TEMP_SENSOR_6 == 0
  1686. #error "TEMP_SENSOR_6 is required with 6 HOTENDS."
  1687. #elif !HAS_HEATER_6
  1688. #error "HEATER_6_PIN not defined for this board."
  1689. #elif !PIN_EXISTS(TEMP_6) && !TEMP_SENSOR_6_IS_DUMMY
  1690. #error "TEMP_6_PIN not defined for this board."
  1691. #endif
  1692. #if HOTENDS > 7
  1693. #if TEMP_SENSOR_7 == 0
  1694. #error "TEMP_SENSOR_7 is required with 7 HOTENDS."
  1695. #elif !HAS_HEATER_7
  1696. #error "HEATER_7_PIN not defined for this board."
  1697. #elif !PIN_EXISTS(TEMP_7) && !TEMP_SENSOR_7_IS_DUMMY
  1698. #error "TEMP_7_PIN not defined for this board."
  1699. #endif
  1700. #elif TEMP_SENSOR_7 != 0
  1701. #error "TEMP_SENSOR_7 shouldn't be set with only 7 HOTENDS."
  1702. #endif
  1703. #elif TEMP_SENSOR_6 != 0
  1704. #error "TEMP_SENSOR_6 shouldn't be set with only 6 HOTENDS."
  1705. #elif TEMP_SENSOR_7 != 0
  1706. #error "TEMP_SENSOR_7 shouldn't be set with only 6 HOTENDS."
  1707. #endif
  1708. #elif TEMP_SENSOR_5 != 0
  1709. #error "TEMP_SENSOR_5 shouldn't be set with only 5 HOTENDS."
  1710. #elif TEMP_SENSOR_6 != 0
  1711. #error "TEMP_SENSOR_6 shouldn't be set with only 5 HOTENDS."
  1712. #elif TEMP_SENSOR_7 != 0
  1713. #error "TEMP_SENSOR_7 shouldn't be set with only 5 HOTENDS."
  1714. #endif
  1715. #elif TEMP_SENSOR_4 != 0
  1716. #error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS."
  1717. #elif TEMP_SENSOR_5 != 0
  1718. #error "TEMP_SENSOR_5 shouldn't be set with only 4 HOTENDS."
  1719. #elif TEMP_SENSOR_6 != 0
  1720. #error "TEMP_SENSOR_6 shouldn't be set with only 4 HOTENDS."
  1721. #elif TEMP_SENSOR_7 != 0
  1722. #error "TEMP_SENSOR_7 shouldn't be set with only 4 HOTENDS."
  1723. #endif
  1724. #elif TEMP_SENSOR_3 != 0
  1725. #error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS."
  1726. #elif TEMP_SENSOR_4 != 0
  1727. #error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS."
  1728. #elif TEMP_SENSOR_5 != 0
  1729. #error "TEMP_SENSOR_5 shouldn't be set with only 3 HOTENDS."
  1730. #elif TEMP_SENSOR_6 != 0
  1731. #error "TEMP_SENSOR_6 shouldn't be set with only 3 HOTENDS."
  1732. #elif TEMP_SENSOR_7 != 0
  1733. #error "TEMP_SENSOR_7 shouldn't be set with only 3 HOTENDS."
  1734. #endif
  1735. #elif TEMP_SENSOR_2 != 0
  1736. #error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS."
  1737. #elif TEMP_SENSOR_3 != 0
  1738. #error "TEMP_SENSOR_3 shouldn't be set with only 2 HOTENDS."
  1739. #elif TEMP_SENSOR_4 != 0
  1740. #error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS."
  1741. #elif TEMP_SENSOR_5 != 0
  1742. #error "TEMP_SENSOR_5 shouldn't be set with only 2 HOTENDS."
  1743. #elif TEMP_SENSOR_6 != 0
  1744. #error "TEMP_SENSOR_6 shouldn't be set with only 2 HOTENDS."
  1745. #elif TEMP_SENSOR_7 != 0
  1746. #error "TEMP_SENSOR_7 shouldn't be set with only 2 HOTENDS."
  1747. #endif
  1748. #elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  1749. #error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND."
  1750. #elif TEMP_SENSOR_2 != 0
  1751. #error "TEMP_SENSOR_2 shouldn't be set with only 1 HOTEND."
  1752. #elif TEMP_SENSOR_3 != 0
  1753. #error "TEMP_SENSOR_3 shouldn't be set with only 1 HOTEND."
  1754. #elif TEMP_SENSOR_4 != 0
  1755. #error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND."
  1756. #elif TEMP_SENSOR_5 != 0
  1757. #error "TEMP_SENSOR_5 shouldn't be set with only 1 HOTEND."
  1758. #elif TEMP_SENSOR_6 != 0
  1759. #error "TEMP_SENSOR_6 shouldn't be set with only 1 HOTEND."
  1760. #elif TEMP_SENSOR_7 != 0
  1761. #error "TEMP_SENSOR_7 shouldn't be set with only 1 HOTEND."
  1762. #endif
  1763. #if TEMP_SENSOR_CHAMBER && !PIN_EXISTS(TEMP_CHAMBER)
  1764. #error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN."
  1765. #endif
  1766. #if TEMP_SENSOR_COOLER && !(PIN_EXISTS(TEMP_COOLER) && ENABLED(LASER_FEATURE))
  1767. #error "TEMP_SENSOR_COOLER requires LASER_FEATURE and TEMP_COOLER_PIN."
  1768. #endif
  1769. #if ENABLED(LASER_COOLANT_FLOW_METER) && !(PIN_EXISTS(FLOWMETER) && ENABLED(LASER_FEATURE))
  1770. #error "LASER_COOLANT_FLOW_METER requires FLOWMETER_PIN and LASER_FEATURE."
  1771. #endif
  1772. #if ENABLED(CHAMBER_FAN) && !(defined(CHAMBER_FAN_MODE) && WITHIN(CHAMBER_FAN_MODE, 0, 2))
  1773. #error "CHAMBER_FAN_MODE must be between 0 and 2."
  1774. #endif
  1775. #if ENABLED(CHAMBER_VENT)
  1776. #ifndef CHAMBER_VENT_SERVO_NR
  1777. #error "CHAMBER_VENT_SERVO_NR is required for CHAMBER SERVO."
  1778. #elif !NUM_SERVOS
  1779. #error "NUM_SERVOS is required for a Heated Chamber vent servo (CHAMBER_VENT_SERVO_NR)."
  1780. #elif CHAMBER_VENT_SERVO_NR >= NUM_SERVOS
  1781. #error "CHAMBER_VENT_SERVO_NR must be smaller than NUM_SERVOS."
  1782. #elif HAS_Z_SERVO_PROBE && CHAMBER_VENT_SERVO_NR == Z_PROBE_SERVO_NR
  1783. #error "CHAMBER SERVO is already used by BLTOUCH."
  1784. #elif CHAMBER_VENT_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  1785. #error "SERVO0_PIN must be defined for your Heated Chamber vent servo."
  1786. #elif CHAMBER_VENT_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  1787. #error "SERVO1_PIN must be defined for your Heated Chamber vent servo."
  1788. #elif CHAMBER_VENT_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  1789. #error "SERVO2_PIN must be defined for your Heated Chamber vent servo."
  1790. #elif CHAMBER_VENT_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  1791. #error "SERVO3_PIN must be defined for your Heated Chamber vent servo."
  1792. #endif
  1793. #endif
  1794. #if TEMP_SENSOR_PROBE
  1795. #if !PIN_EXISTS(TEMP_PROBE)
  1796. #error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN."
  1797. #elif !HAS_TEMP_ADC_PROBE
  1798. #error "TEMP_PROBE_PIN must be an ADC pin."
  1799. #elif DISABLED(FIX_MOUNTED_PROBE)
  1800. #error "TEMP_SENSOR_PROBE shouldn't be set without FIX_MOUNTED_PROBE."
  1801. #endif
  1802. #endif
  1803. #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0
  1804. #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
  1805. #endif
  1806. #if TEMP_SENSOR_0_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_0) && defined(MAX31865_CALIBRATION_OHMS_0))
  1807. #error "MAX31865_SENSOR_OHMS_0 and MAX31865_CALIBRATION_OHMS_0 must be set if TEMP_SENSOR_0 is MAX31865."
  1808. #elif TEMP_SENSOR_1_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_1) && defined(MAX31865_CALIBRATION_OHMS_1))
  1809. #error "MAX31865_SENSOR_OHMS_1 and MAX31865_CALIBRATION_OHMS_1 must be set if TEMP_SENSOR_1 is MAX31865."
  1810. #endif
  1811. /**
  1812. * Test Heater, Temp Sensor, and Extruder Pins
  1813. */
  1814. #if !HAS_HEATER_0 && EXTRUDERS
  1815. #error "HEATER_0_PIN not defined for this board."
  1816. #elif !ANY_PIN(TEMP_0, MAX6675_SS)
  1817. #error "TEMP_0_PIN or MAX6675_SS not defined for this board."
  1818. #elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && !PINS_EXIST(E0_STEP, E0_DIR))
  1819. #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
  1820. #elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PINS_EXIST(E0_STEP, E0_DIR) || !HAS_E0_ENABLE))
  1821. #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
  1822. #elif EXTRUDERS && TEMP_SENSOR_0 == 0
  1823. #error "TEMP_SENSOR_0 is required if there are any extruders."
  1824. #endif
  1825. /**
  1826. * Temperature status LEDs
  1827. */
  1828. #if ENABLED(TEMP_STAT_LEDS) && !ANY_PIN(STAT_LED_RED, STAT_LED_BLUE)
  1829. #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both."
  1830. #endif
  1831. /**
  1832. * LED Control Menu
  1833. */
  1834. #if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS
  1835. #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9533, PCA9632, or NEOPIXEL_LED."
  1836. #endif
  1837. /**
  1838. * LED Backlight Timeout
  1839. */
  1840. #if defined(LED_BACKLIGHT_TIMEOUT) && !(ENABLED(PSU_CONTROL) && ANY(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_242_OLED_12864))
  1841. #error "LED_BACKLIGHT_TIMEOUT requires a FYSETC Mini Panel and a Power Switch."
  1842. #endif
  1843. /**
  1844. * Basic multi hotend duplication mode
  1845. */
  1846. #if ENABLED(MULTI_NOZZLE_DUPLICATION)
  1847. #if ENABLED(SINGLENOZZLE)
  1848. #error "MULTI_NOZZLE_DUPLICATION is incompatible with SINGLENOZZLE."
  1849. #elif ENABLED(DUAL_X_CARRIAGE)
  1850. #error "MULTI_NOZZLE_DUPLICATION is incompatible with DUAL_X_CARRIAGE."
  1851. #elif ENABLED(MIXING_EXTRUDER)
  1852. #error "MULTI_NOZZLE_DUPLICATION is incompatible with MIXING_EXTRUDER."
  1853. #elif ENABLED(SWITCHING_EXTRUDER)
  1854. #error "MULTI_NOZZLE_DUPLICATION is incompatible with SWITCHING_EXTRUDER."
  1855. #elif HOTENDS < 2
  1856. #error "MULTI_NOZZLE_DUPLICATION requires 2 or more hotends."
  1857. #endif
  1858. #endif
  1859. /**
  1860. * Test Extruder Stepper Pins
  1861. */
  1862. #if E_STEPPERS
  1863. #if !(PINS_EXIST(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
  1864. #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
  1865. #endif
  1866. #if E_STEPPERS > 1
  1867. #if !(PINS_EXIST(E1_STEP, E1_DIR) && HAS_E1_ENABLE)
  1868. #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
  1869. #endif
  1870. #if E_STEPPERS > 2
  1871. #if !(PINS_EXIST(E2_STEP, E2_DIR) && HAS_E2_ENABLE)
  1872. #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
  1873. #endif
  1874. #if E_STEPPERS > 3
  1875. #if !(PINS_EXIST(E3_STEP, E3_DIR) && HAS_E3_ENABLE)
  1876. #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
  1877. #endif
  1878. #if E_STEPPERS > 4
  1879. #if !(PINS_EXIST(E4_STEP, E4_DIR) && HAS_E4_ENABLE)
  1880. #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
  1881. #endif
  1882. #if E_STEPPERS > 5
  1883. #if !(PINS_EXIST(E5_STEP, E5_DIR) && HAS_E5_ENABLE)
  1884. #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
  1885. #endif
  1886. #if E_STEPPERS > 6
  1887. #if !(PINS_EXIST(E6_STEP, E6_DIR) && HAS_E6_ENABLE)
  1888. #error "E6_STEP_PIN, E6_DIR_PIN, or E6_ENABLE_PIN not defined for this board."
  1889. #endif
  1890. #if E_STEPPERS > 7
  1891. #if !(PINS_EXIST(E7_STEP, E7_DIR) && HAS_E7_ENABLE)
  1892. #error "E7_STEP_PIN, E7_DIR_PIN, or E7_ENABLE_PIN not defined for this board."
  1893. #endif
  1894. #endif // E_STEPPERS > 7
  1895. #endif // E_STEPPERS > 6
  1896. #endif // E_STEPPERS > 5
  1897. #endif // E_STEPPERS > 4
  1898. #endif // E_STEPPERS > 3
  1899. #endif // E_STEPPERS > 2
  1900. #endif // E_STEPPERS > 1
  1901. #endif // E_STEPPERS
  1902. /**
  1903. * Endstop Tests
  1904. */
  1905. #define _PLUG_UNUSED_TEST(A,P) (DISABLED(USE_##P##MIN_PLUG, USE_##P##MAX_PLUG) \
  1906. && !(ENABLED(A##_DUAL_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) \
  1907. && !(ENABLED(A##_MULTI_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) )
  1908. #define _AXIS_PLUG_UNUSED_TEST(A) (_PLUG_UNUSED_TEST(A,X) && _PLUG_UNUSED_TEST(A,Y) && _PLUG_UNUSED_TEST(A,Z))
  1909. // A machine with endstops must have a minimum of 3
  1910. #if HAS_ENDSTOPS
  1911. #if _AXIS_PLUG_UNUSED_TEST(X)
  1912. #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG."
  1913. #endif
  1914. #if _AXIS_PLUG_UNUSED_TEST(Y)
  1915. #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG."
  1916. #endif
  1917. #if _AXIS_PLUG_UNUSED_TEST(Z)
  1918. #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG."
  1919. #endif
  1920. // Delta and Cartesian use 3 homing endstops
  1921. #if NONE(IS_SCARA, SPI_ENDSTOPS)
  1922. #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG)
  1923. #error "Enable USE_XMIN_PLUG when homing X to MIN."
  1924. #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG)
  1925. #error "Enable USE_XMAX_PLUG when homing X to MAX."
  1926. #elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG)
  1927. #error "Enable USE_YMIN_PLUG when homing Y to MIN."
  1928. #elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG)
  1929. #error "Enable USE_YMAX_PLUG when homing Y to MAX."
  1930. #endif
  1931. #endif
  1932. // Z homing direction and plug usage flags
  1933. #if Z_HOME_DIR < 0 && NONE(USE_ZMIN_PLUG, HOMING_Z_WITH_PROBE)
  1934. #error "Enable USE_ZMIN_PLUG when homing Z to MIN."
  1935. #elif Z_HOME_DIR > 0 && ENABLED(USE_PROBE_FOR_Z_HOMING)
  1936. #error "Z_HOME_DIR must be -1 when homing Z with the probe."
  1937. #elif BOTH(HOMING_Z_WITH_PROBE, Z_MULTI_ENDSTOPS)
  1938. #error "Z_MULTI_ENDSTOPS is incompatible with USE_PROBE_FOR_Z_HOMING."
  1939. #elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG)
  1940. #error "Enable USE_ZMAX_PLUG when homing Z to MAX."
  1941. #endif
  1942. #endif
  1943. #if BOTH(HOME_Z_FIRST, USE_PROBE_FOR_Z_HOMING)
  1944. #error "HOME_Z_FIRST can't be used when homing Z with a probe."
  1945. #endif
  1946. // Dual/multiple endstops requirements
  1947. #if ENABLED(X_DUAL_ENDSTOPS)
  1948. #if !X2_USE_ENDSTOP
  1949. #error "You must set X2_USE_ENDSTOP with X_DUAL_ENDSTOPS."
  1950. #elif X2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1951. #error "USE_XMIN_PLUG is required when X2_USE_ENDSTOP is _XMIN_."
  1952. #elif X2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1953. #error "USE_XMAX_PLUG is required when X2_USE_ENDSTOP is _XMAX_."
  1954. #elif X2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1955. #error "USE_YMIN_PLUG is required when X2_USE_ENDSTOP is _YMIN_."
  1956. #elif X2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1957. #error "USE_YMAX_PLUG is required when X2_USE_ENDSTOP is _YMAX_."
  1958. #elif X2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1959. #error "USE_ZMIN_PLUG is required when X2_USE_ENDSTOP is _ZMIN_."
  1960. #elif X2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1961. #error "USE_ZMAX_PLUG is required when X2_USE_ENDSTOP is _ZMAX_."
  1962. #elif !HAS_X2_MIN && !HAS_X2_MAX
  1963. #error "X2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1964. #elif ENABLED(DELTA)
  1965. #error "X_DUAL_ENDSTOPS is not compatible with DELTA."
  1966. #endif
  1967. #endif
  1968. #if ENABLED(Y_DUAL_ENDSTOPS)
  1969. #if !Y2_USE_ENDSTOP
  1970. #error "You must set Y2_USE_ENDSTOP with Y_DUAL_ENDSTOPS."
  1971. #elif Y2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1972. #error "USE_XMIN_PLUG is required when Y2_USE_ENDSTOP is _XMIN_."
  1973. #elif Y2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1974. #error "USE_XMAX_PLUG is required when Y2_USE_ENDSTOP is _XMAX_."
  1975. #elif Y2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1976. #error "USE_YMIN_PLUG is required when Y2_USE_ENDSTOP is _YMIN_."
  1977. #elif Y2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1978. #error "USE_YMAX_PLUG is required when Y2_USE_ENDSTOP is _YMAX_."
  1979. #elif Y2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1980. #error "USE_ZMIN_PLUG is required when Y2_USE_ENDSTOP is _ZMIN_."
  1981. #elif Y2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1982. #error "USE_ZMAX_PLUG is required when Y2_USE_ENDSTOP is _ZMAX_."
  1983. #elif !HAS_Y2_MIN && !HAS_Y2_MAX
  1984. #error "Y2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1985. #elif ENABLED(DELTA)
  1986. #error "Y_DUAL_ENDSTOPS is not compatible with DELTA."
  1987. #endif
  1988. #endif
  1989. #if ENABLED(Z_MULTI_ENDSTOPS)
  1990. #if !Z2_USE_ENDSTOP
  1991. #error "You must set Z2_USE_ENDSTOP with Z_MULTI_ENDSTOPS when NUM_Z_STEPPER_DRIVERS >= 2."
  1992. #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1993. #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_."
  1994. #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1995. #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_."
  1996. #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1997. #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_."
  1998. #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1999. #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_."
  2000. #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  2001. #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_."
  2002. #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  2003. #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_."
  2004. #elif !HAS_Z2_MIN && !HAS_Z2_MAX
  2005. #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  2006. #elif ENABLED(DELTA)
  2007. #error "Z_MULTI_ENDSTOPS is not compatible with DELTA."
  2008. #endif
  2009. #if NUM_Z_STEPPER_DRIVERS >= 3
  2010. #if !Z3_USE_ENDSTOP
  2011. #error "You must set Z3_USE_ENDSTOP with Z_MULTI_ENDSTOPS when NUM_Z_STEPPER_DRIVERS >= 3."
  2012. #elif Z3_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  2013. #error "USE_XMIN_PLUG is required when Z3_USE_ENDSTOP is _XMIN_."
  2014. #elif Z3_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  2015. #error "USE_XMAX_PLUG is required when Z3_USE_ENDSTOP is _XMAX_."
  2016. #elif Z3_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  2017. #error "USE_YMIN_PLUG is required when Z3_USE_ENDSTOP is _YMIN_."
  2018. #elif Z3_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  2019. #error "USE_YMAX_PLUG is required when Z3_USE_ENDSTOP is _YMAX_."
  2020. #elif Z3_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  2021. #error "USE_ZMIN_PLUG is required when Z3_USE_ENDSTOP is _ZMIN_."
  2022. #elif Z3_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  2023. #error "USE_ZMAX_PLUG is required when Z3_USE_ENDSTOP is _ZMAX_."
  2024. #elif !HAS_Z3_MIN && !HAS_Z3_MAX
  2025. #error "Z3_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  2026. #endif
  2027. #endif
  2028. #if NUM_Z_STEPPER_DRIVERS >= 4
  2029. #if !Z4_USE_ENDSTOP
  2030. #error "You must set Z4_USE_ENDSTOP with Z_MULTI_ENDSTOPS when NUM_Z_STEPPER_DRIVERS >= 4."
  2031. #elif Z4_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  2032. #error "USE_XMIN_PLUG is required when Z4_USE_ENDSTOP is _XMIN_."
  2033. #elif Z4_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  2034. #error "USE_XMAX_PLUG is required when Z4_USE_ENDSTOP is _XMAX_."
  2035. #elif Z4_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  2036. #error "USE_YMIN_PLUG is required when Z4_USE_ENDSTOP is _YMIN_."
  2037. #elif Z4_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  2038. #error "USE_YMAX_PLUG is required when Z4_USE_ENDSTOP is _YMAX_."
  2039. #elif Z4_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  2040. #error "USE_ZMIN_PLUG is required when Z4_USE_ENDSTOP is _ZMIN_."
  2041. #elif Z4_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  2042. #error "USE_ZMAX_PLUG is required when Z4_USE_ENDSTOP is _ZMAX_."
  2043. #elif !HAS_Z4_MIN && !HAS_Z4_MAX
  2044. #error "Z4_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  2045. #endif
  2046. #endif
  2047. #endif
  2048. #if defined(ENDSTOP_NOISE_THRESHOLD) && !WITHIN(ENDSTOP_NOISE_THRESHOLD, 2, 7)
  2049. #error "ENDSTOP_NOISE_THRESHOLD must be an integer from 2 to 7."
  2050. #endif
  2051. /**
  2052. * emergency-command parser
  2053. */
  2054. #if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON)
  2055. #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
  2056. #endif
  2057. /**
  2058. * I2C bus
  2059. */
  2060. #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0
  2061. #if I2C_SLAVE_ADDRESS < 8
  2062. #error "I2C_SLAVE_ADDRESS can't be less than 8. (Addresses 0 - 7 are reserved.)"
  2063. #elif I2C_SLAVE_ADDRESS > 127
  2064. #error "I2C_SLAVE_ADDRESS can't be over 127. (Only 7 bits allowed.)"
  2065. #endif
  2066. #endif
  2067. /**
  2068. * G35 Assisted Tramming
  2069. */
  2070. #if ENABLED(ASSISTED_TRAMMING) && !HAS_BED_PROBE
  2071. #error "ASSISTED_TRAMMING requires a bed probe."
  2072. #endif
  2073. /**
  2074. * G38 Probe Target
  2075. */
  2076. #if ENABLED(G38_PROBE_TARGET)
  2077. #if !HAS_BED_PROBE
  2078. #error "G38_PROBE_TARGET requires a bed probe."
  2079. #elif !IS_CARTESIAN
  2080. #error "G38_PROBE_TARGET requires a Cartesian machine."
  2081. #endif
  2082. #endif
  2083. /**
  2084. * RGB_LED Requirements
  2085. */
  2086. #define _RGB_TEST (PINS_EXIST(RGB_LED_R, RGB_LED_G, RGB_LED_B))
  2087. #if ENABLED(PRINTER_EVENT_LEDS) && !HAS_COLOR_LEDS
  2088. #error "PRINTER_EVENT_LEDS requires BLINKM, PCA9533, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED."
  2089. #elif ENABLED(RGB_LED)
  2090. #if !_RGB_TEST
  2091. #error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN."
  2092. #elif ENABLED(RGBW_LED)
  2093. #error "Please enable only one of RGB_LED and RGBW_LED."
  2094. #endif
  2095. #elif ENABLED(RGBW_LED)
  2096. #if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W))
  2097. #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN."
  2098. #endif
  2099. #endif
  2100. #undef _RGB_TEST
  2101. // NeoPixel requirements
  2102. #if ENABLED(NEOPIXEL_LED)
  2103. #if !PIN_EXISTS(NEOPIXEL) || NEOPIXEL_PIXELS == 0
  2104. #error "NEOPIXEL_LED requires NEOPIXEL_PIN and NEOPIXEL_PIXELS."
  2105. #elif ENABLED(NEOPIXEL2_SEPARATE) && !(defined(NEOPIXEL2_TYPE) && PIN_EXISTS(NEOPIXEL2) && NEOPIXEL2_PIXELS > 0)
  2106. #error "NEOPIXEL2_SEPARATE requires NEOPIXEL2_TYPE, NEOPIXEL2_PIN and NEOPIXEL2_PIXELS."
  2107. #elif ENABLED(NEO2_COLOR_PRESETS) && DISABLED(NEOPIXEL2_SEPARATE)
  2108. #error "NEO2_COLOR_PRESETS requires NEOPIXEL2_SEPARATE to be enabled."
  2109. #endif
  2110. #endif
  2111. #if DISABLED(NO_COMPILE_TIME_PWM)
  2112. #define _TEST_PWM(P) PWM_PIN(P)
  2113. #else
  2114. #define _TEST_PWM(P) 1 // pass
  2115. #endif
  2116. /**
  2117. * Auto Fan check for PWM pins
  2118. */
  2119. #if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255
  2120. #define AF_ERR_SUFF "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255."
  2121. #if HAS_AUTO_FAN_0
  2122. static_assert(_TEST_PWM(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF);
  2123. #elif HAS_AUTO_FAN_1
  2124. static_assert(_TEST_PWM(E1_AUTO_FAN_PIN), "E1" AF_ERR_SUFF);
  2125. #elif HAS_AUTO_FAN_2
  2126. static_assert(_TEST_PWM(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF);
  2127. #elif HAS_AUTO_FAN_3
  2128. static_assert(_TEST_PWM(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF);
  2129. #elif HAS_AUTO_FAN_4
  2130. static_assert(_TEST_PWM(E4_AUTO_FAN_PIN), "E4" AF_ERR_SUFF);
  2131. #elif HAS_AUTO_FAN_5
  2132. static_assert(_TEST_PWM(E5_AUTO_FAN_PIN), "E5" AF_ERR_SUFF);
  2133. #elif HAS_AUTO_FAN_6
  2134. static_assert(_TEST_PWM(E6_AUTO_FAN_PIN), "E6" AF_ERR_SUFF);
  2135. #elif HAS_AUTO_FAN_7
  2136. static_assert(_TEST_PWM(E7_AUTO_FAN_PIN), "E7" AF_ERR_SUFF);
  2137. #endif
  2138. #endif
  2139. /**
  2140. * Make sure only one EEPROM type is enabled
  2141. */
  2142. #if ENABLED(EEPROM_SETTINGS)
  2143. #if 1 < 0 \
  2144. + ENABLED(I2C_EEPROM) \
  2145. + ENABLED(SPI_EEPROM) \
  2146. + ENABLED(QSPI_EEPROM) \
  2147. + ENABLED(SDCARD_EEPROM_EMULATION) \
  2148. + ENABLED(FLASH_EEPROM_EMULATION) \
  2149. + ENABLED(SRAM_EEPROM_EMULATION) \
  2150. + ENABLED(IIC_BL24CXX_EEPROM)
  2151. #error "Please select only one method of EEPROM Persistent Storage."
  2152. #endif
  2153. #endif
  2154. /**
  2155. * Make sure features that need to write to the SD card can
  2156. */
  2157. #if ENABLED(SDCARD_READONLY) && ANY(POWER_LOSS_RECOVERY, BINARY_FILE_TRANSFER, SDCARD_EEPROM_EMULATION)
  2158. #undef SDCARD_READONLY
  2159. #if ENABLED(POWER_LOSS_RECOVERY)
  2160. #warning "Either disable SDCARD_READONLY or disable POWER_LOSS_RECOVERY."
  2161. #elif ENABLED(BINARY_FILE_TRANSFER)
  2162. #warning "Either disable SDCARD_READONLY or disable BINARY_FILE_TRANSFER."
  2163. #elif ENABLED(SDCARD_EEPROM_EMULATION)
  2164. #warning "Either disable SDCARD_READONLY or disable SDCARD_EEPROM_EMULATION."
  2165. #endif
  2166. #endif
  2167. #if ENABLED(SD_IGNORE_AT_STARTUP)
  2168. #if ENABLED(POWER_LOSS_RECOVERY)
  2169. #error "SD_IGNORE_AT_STARTUP is incompatible with POWER_LOSS_RECOVERY."
  2170. #elif ENABLED(SDCARD_EEPROM_EMULATION)
  2171. #error "SD_IGNORE_AT_STARTUP is incompatible with SDCARD_EEPROM_EMULATION."
  2172. #endif
  2173. #endif
  2174. /**
  2175. * Make sure only one display is enabled
  2176. */
  2177. #if 1 < 0 \
  2178. + ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
  2179. + ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
  2180. + (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \
  2181. + (ENABLED(MINIPANEL) && NONE(MKS_MINI_12864, ENDER2_STOCKDISPLAY)) \
  2182. + (ENABLED(MKS_MINI_12864) && DISABLED(MKS_LCD12864)) \
  2183. + (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \
  2184. + (DISABLED(IS_LEGACY_TFT) && ENABLED(TFT_GENERIC)) \
  2185. + (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)) \
  2186. + COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35) \
  2187. + COUNT_ENABLED(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY,DGUS_LCD_UI_MKS) \
  2188. + COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY, DWIN_CREALITY_LCD) \
  2189. + COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) \
  2190. + COUNT_ENABLED(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) \
  2191. + COUNT_ENABLED(MKS_12864OLED, MKS_12864OLED_SSD1306) \
  2192. + COUNT_ENABLED(MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, ANET_ET4_TFT28, ANET_ET5_TFT35) \
  2193. + COUNT_ENABLED(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) \
  2194. + COUNT_ENABLED(VIKI2, miniVIKI) \
  2195. + COUNT_ENABLED(ZONESTAR_12864LCD, ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306) \
  2196. + COUNT_ENABLED(ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING) \
  2197. + ENABLED(AZSMZ_12864) \
  2198. + ENABLED(BQ_LCD_SMART_CONTROLLER) \
  2199. + ENABLED(CARTESIO_UI) \
  2200. + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  2201. + ENABLED(FF_INTERFACEBOARD) \
  2202. + ENABLED(FYSETC_242_OLED_12864) \
  2203. + ENABLED(G3D_PANEL) \
  2204. + ENABLED(LCD_FOR_MELZI) \
  2205. + ENABLED(LCD_I2C_PANELOLU2) \
  2206. + ENABLED(LCD_I2C_VIKI) \
  2207. + ENABLED(LCM1602) \
  2208. + ENABLED(LONGER_LK_TFT28) \
  2209. + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
  2210. + ENABLED(MAKRPANEL) \
  2211. + ENABLED(MALYAN_LCD) \
  2212. + ENABLED(NEXTION_TFT) \
  2213. + ENABLED(MKS_LCD12864) \
  2214. + ENABLED(OLED_PANEL_TINYBOY2) \
  2215. + ENABLED(OVERLORD_OLED) \
  2216. + ENABLED(PANEL_ONE) \
  2217. + ENABLED(RA_CONTROL_PANEL) \
  2218. + ENABLED(RADDS_DISPLAY) \
  2219. + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \
  2220. + ENABLED(RIGIDBOT_PANEL) \
  2221. + ENABLED(SAV_3DGLCD) \
  2222. + ENABLED(SAV_3DLCD) \
  2223. + ENABLED(SILVER_GATE_GLCD_CONTROLLER) \
  2224. + ENABLED(TFT_TRONXY_X5SA) \
  2225. + ENABLED(TOUCH_UI_FTDI_EVE) \
  2226. + ENABLED(U8GLIB_SH1106_EINSTART) \
  2227. + ENABLED(ULTI_CONTROLLER) \
  2228. + ENABLED(ULTIMAKERCONTROLLER) \
  2229. + ENABLED(ULTIPANEL) \
  2230. + ENABLED(ULTRA_LCD) \
  2231. + ENABLED(YHCB2004) \
  2232. + ENABLED(ZONESTAR_LCD) \
  2233. + ENABLED(K3D_FULL_GRAPHIC_SMART_CONTROLLER) \
  2234. + ENABLED(K3D_242_OLED_CONTROLLER)
  2235. #error "Please select only one LCD controller option."
  2236. #endif
  2237. #undef IS_U8GLIB_SSD1306
  2238. #undef IS_EXTUI
  2239. #undef IS_LEGACY_TFT
  2240. #if ANY(TFT_GENERIC, MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, TFT_TRONXY_X5SA, ANYCUBIC_TFT35, ANYCUBIC_TFT35, LONGER_LK_TFT28, ANET_ET4_TFT28, ANET_ET5_TFT35)
  2241. #if NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
  2242. #error "TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI is required for your TFT. Please enable one."
  2243. #elif 1 < ENABLED(TFT_COLOR_UI) + ENABLED(TFT_CLASSIC_UI) + ENABLED(TFT_LVGL_UI)
  2244. #error "Please select only one of TFT_COLOR_UI, TFT_CLASSIC_UI, or TFT_LVGL_UI."
  2245. #endif
  2246. #elif ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
  2247. #error "TFT_(COLOR|CLASSIC|LVGL)_UI requires a TFT display to be enabled."
  2248. #endif
  2249. #if ENABLED(TFT_GENERIC) && NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
  2250. #error "TFT_GENERIC requires either TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI interface."
  2251. #endif
  2252. #if BOTH(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
  2253. #error "Please enable only one of TFT_INTERFACE_SPI or TFT_INTERFACE_SPI."
  2254. #endif
  2255. #if MANY(LCD_SCREEN_ROT_0, LCD_SCREEN_ROT_90, LCD_SCREEN_ROT_180, LCD_SCREEN_ROT_270)
  2256. #error "Please enable only one LCD_SCREEN_ROT_* option: 0, 90, 180, or 270."
  2257. #endif
  2258. #if MANY(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320)
  2259. #error "Please select only one of TFT_RES_480x320, TFT_RES_480x320, or TFT_RES_480x272."
  2260. #endif
  2261. #if HAS_TFT_LVGL_UI && DISABLED(TFT_RES_480x320)
  2262. #error "(FMSC|SPI)TFT_LVGL_UI requires TFT_RES_480x320."
  2263. #endif
  2264. #if defined(GRAPHICAL_TFT_UPSCALE) && !WITHIN(GRAPHICAL_TFT_UPSCALE, 2, 3)
  2265. #error "GRAPHICAL_TFT_UPSCALE must be set to 2 or 3."
  2266. #endif
  2267. /**
  2268. * Some boards forbid the use of -1 Native USB
  2269. */
  2270. #if ENABLED(BOARD_NO_NATIVE_USB)
  2271. #undef BOARD_NO_NATIVE_USB
  2272. #if SERIAL_PORT == -1
  2273. #error "SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT to a valid value for your board."
  2274. #elif SERIAL_PORT_2 == -1
  2275. #error "SERIAL_PORT_2 is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT_2 to a valid value for your board."
  2276. #elif MMU2_SERIAL_PORT == -1
  2277. #error "MMU2_SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set MMU2_SERIAL_PORT to a valid value for your board."
  2278. #elif LCD_SERIAL_PORT == -1
  2279. #error "LCD_SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set LCD_SERIAL_PORT to a valid value for your board."
  2280. #endif
  2281. #endif
  2282. /**
  2283. * MMU2 require a dedicated serial port
  2284. */
  2285. #ifdef MMU2_SERIAL_PORT
  2286. #if MMU2_SERIAL_PORT == SERIAL_PORT
  2287. #error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT."
  2288. #elif defined(SERIAL_PORT_2) && MMU2_SERIAL_PORT == SERIAL_PORT_2
  2289. #error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT_2."
  2290. #elif defined(LCD_SERIAL_PORT) && MMU2_SERIAL_PORT == LCD_SERIAL_PORT
  2291. #error "MMU2_SERIAL_PORT cannot be the same as LCD_SERIAL_PORT."
  2292. #endif
  2293. #endif
  2294. /**
  2295. * Serial displays require a dedicated serial port
  2296. */
  2297. #ifdef LCD_SERIAL_PORT
  2298. #if LCD_SERIAL_PORT == SERIAL_PORT
  2299. #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT."
  2300. #elif defined(SERIAL_PORT_2) && LCD_SERIAL_PORT == SERIAL_PORT_2
  2301. #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT_2."
  2302. #endif
  2303. #else
  2304. #if HAS_DGUS_LCD
  2305. #error "The DGUS LCD requires LCD_SERIAL_PORT to be defined."
  2306. #elif EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
  2307. #error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined."
  2308. #elif ENABLED(MALYAN_LCD)
  2309. #error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined."
  2310. #endif
  2311. #endif
  2312. /**
  2313. * FYSETC Mini 12864 RGB backlighting required
  2314. */
  2315. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED)
  2316. #error "RGB_LED is required for FYSETC_MINI_12864 1.2 and 2.0."
  2317. #elif EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && DISABLED(LED_USER_PRESET_STARTUP)
  2318. #error "LED_USER_PRESET_STARTUP is required for FYSETC_MINI_12864 2.x displays."
  2319. #endif
  2320. /**
  2321. * Check existing CS pins against enabled TMC SPI drivers.
  2322. */
  2323. #define INVALID_TMC_SPI(ST) (AXIS_HAS_SPI(ST) && !PIN_EXISTS(ST##_CS))
  2324. #if INVALID_TMC_SPI(X)
  2325. #error "An SPI driven TMC driver on X requires X_CS_PIN."
  2326. #elif INVALID_TMC_SPI(X2)
  2327. #error "An SPI driven TMC driver on X2 requires X2_CS_PIN."
  2328. #elif INVALID_TMC_SPI(Y)
  2329. #error "An SPI driven TMC driver on Y requires Y_CS_PIN."
  2330. #elif INVALID_TMC_SPI(Y2)
  2331. #error "An SPI driven TMC driver on Y2 requires Y2_CS_PIN."
  2332. #elif INVALID_TMC_SPI(Z)
  2333. #error "An SPI driven TMC driver on Z requires Z_CS_PIN."
  2334. #elif INVALID_TMC_SPI(Z2)
  2335. #error "An SPI driven TMC driver on Z2 requires Z2_CS_PIN."
  2336. #elif INVALID_TMC_SPI(Z3)
  2337. #error "An SPI driven TMC driver on Z3 requires Z3_CS_PIN."
  2338. #elif INVALID_TMC_SPI(Z4)
  2339. #error "An SPI driven TMC driver on Z4 requires Z4_CS_PIN."
  2340. #elif INVALID_TMC_SPI(E0)
  2341. #error "An SPI driven TMC driver on E0 requires E0_CS_PIN."
  2342. #elif INVALID_TMC_SPI(E1)
  2343. #error "An SPI driven TMC driver on E1 requires E1_CS_PIN."
  2344. #elif INVALID_TMC_SPI(E2)
  2345. #error "An SPI driven TMC driver on E2 requires E2_CS_PIN."
  2346. #elif INVALID_TMC_SPI(E3)
  2347. #error "An SPI driven TMC driver on E3 requires E3_CS_PIN."
  2348. #elif INVALID_TMC_SPI(E4)
  2349. #error "An SPI driven TMC driver on E4 requires E4_CS_PIN."
  2350. #elif INVALID_TMC_SPI(E5)
  2351. #error "An SPI driven TMC driver on E5 requires E5_CS_PIN."
  2352. #elif INVALID_TMC_SPI(E6)
  2353. #error "An SPI driven TMC driver on E6 requires E6_CS_PIN."
  2354. #elif INVALID_TMC_SPI(E7)
  2355. #error "An SPI driven TMC driver on E7 requires E7_CS_PIN."
  2356. #endif
  2357. #undef INVALID_TMC_SPI
  2358. /**
  2359. * Check existing RX/TX pins against enable TMC UART drivers.
  2360. */
  2361. #define INVALID_TMC_UART(ST) (AXIS_HAS_UART(ST) && !(defined(ST##_HARDWARE_SERIAL) || (PINS_EXIST(ST##_SERIAL_RX, ST##_SERIAL_TX))))
  2362. #if INVALID_TMC_UART(X)
  2363. #error "TMC2208 or TMC2209 on X requires X_HARDWARE_SERIAL or X_SERIAL_(RX|TX)_PIN."
  2364. #elif INVALID_TMC_UART(X2)
  2365. #error "TMC2208 or TMC2209 on X2 requires X2_HARDWARE_SERIAL or X2_SERIAL_(RX|TX)_PIN."
  2366. #elif INVALID_TMC_UART(Y)
  2367. #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL_(RX|TX)_PIN."
  2368. #elif INVALID_TMC_UART(Y2)
  2369. #error "TMC2208 or TMC2209 on Y2 requires Y2_HARDWARE_SERIAL or Y2_SERIAL_(RX|TX)_PIN."
  2370. #elif INVALID_TMC_UART(Z)
  2371. #error "TMC2208 or TMC2209 on Z requires Z_HARDWARE_SERIAL or Z_SERIAL_(RX|TX)_PIN."
  2372. #elif INVALID_TMC_UART(Z2)
  2373. #error "TMC2208 or TMC2209 on Z2 requires Z2_HARDWARE_SERIAL or Z2_SERIAL_(RX|TX)_PIN."
  2374. #elif INVALID_TMC_UART(Z3)
  2375. #error "TMC2208 or TMC2209 on Z3 requires Z3_HARDWARE_SERIAL or Z3_SERIAL_(RX|TX)_PIN."
  2376. #elif INVALID_TMC_UART(Z4)
  2377. #error "TMC2208 or TMC2209 on Z4 requires Z4_HARDWARE_SERIAL or Z4_SERIAL_(RX|TX)_PIN."
  2378. #elif INVALID_TMC_UART(E0)
  2379. #error "TMC2208 or TMC2209 on E0 requires E0_HARDWARE_SERIAL or E0_SERIAL_(RX|TX)_PIN."
  2380. #elif INVALID_TMC_UART(E1)
  2381. #error "TMC2208 or TMC2209 on E1 requires E1_HARDWARE_SERIAL or E1_SERIAL_(RX|TX)_PIN."
  2382. #elif INVALID_TMC_UART(E2)
  2383. #error "TMC2208 or TMC2209 on E2 requires E2_HARDWARE_SERIAL or E2_SERIAL_(RX|TX)_PIN."
  2384. #elif INVALID_TMC_UART(E3)
  2385. #error "TMC2208 or TMC2209 on E3 requires E3_HARDWARE_SERIAL or E3_SERIAL_(RX|TX)_PIN."
  2386. #elif INVALID_TMC_UART(E4)
  2387. #error "TMC2208 or TMC2209 on E4 requires E4_HARDWARE_SERIAL or E4_SERIAL_(RX|TX)_PIN."
  2388. #elif INVALID_TMC_UART(E5)
  2389. #error "TMC2208 or TMC2209 on E5 requires E5_HARDWARE_SERIAL or E5_SERIAL_(RX|TX)_PIN."
  2390. #elif INVALID_TMC_UART(E6)
  2391. #error "TMC2208 or TMC2209 on E6 requires E6_HARDWARE_SERIAL or E6_SERIAL_(RX|TX)_PIN."
  2392. #elif INVALID_TMC_UART(E7)
  2393. #error "TMC2208 or TMC2209 on E7 requires E7_HARDWARE_SERIAL or E7_SERIAL_(RX|TX)_PIN."
  2394. #endif
  2395. #undef INVALID_TMC_UART
  2396. /**
  2397. * TMC2209 slave address values
  2398. */
  2399. #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")
  2400. #if AXIS_DRIVER_TYPE_X(TMC2209)
  2401. INVALID_TMC_ADDRESS(X);
  2402. #elif AXIS_DRIVER_TYPE_X2(TMC2209)
  2403. INVALID_TMC_ADDRESS(X2);
  2404. #elif AXIS_DRIVER_TYPE_Y(TMC2209)
  2405. INVALID_TMC_ADDRESS(Y);
  2406. #elif AXIS_DRIVER_TYPE_Y2(TMC2209)
  2407. INVALID_TMC_ADDRESS(Y2);
  2408. #elif AXIS_DRIVER_TYPE_Z(TMC2209)
  2409. INVALID_TMC_ADDRESS(Z);
  2410. #elif AXIS_DRIVER_TYPE_Z2(TMC2209)
  2411. INVALID_TMC_ADDRESS(Z2);
  2412. #elif AXIS_DRIVER_TYPE_Z3(TMC2209)
  2413. INVALID_TMC_ADDRESS(Z3);
  2414. #elif AXIS_DRIVER_TYPE_Z4(TMC2209)
  2415. INVALID_TMC_ADDRESS(Z4);
  2416. #elif AXIS_DRIVER_TYPE_E0(TMC2209)
  2417. INVALID_TMC_ADDRESS(E0);
  2418. #elif AXIS_DRIVER_TYPE_E1(TMC2209)
  2419. INVALID_TMC_ADDRESS(E1);
  2420. #elif AXIS_DRIVER_TYPE_E2(TMC2209)
  2421. INVALID_TMC_ADDRESS(E2);
  2422. #elif AXIS_DRIVER_TYPE_E3(TMC2209)
  2423. INVALID_TMC_ADDRESS(E3);
  2424. #elif AXIS_DRIVER_TYPE_E4(TMC2209)
  2425. INVALID_TMC_ADDRESS(E4);
  2426. #elif AXIS_DRIVER_TYPE_E5(TMC2209)
  2427. INVALID_TMC_ADDRESS(E5);
  2428. #elif AXIS_DRIVER_TYPE_E6(TMC2209)
  2429. INVALID_TMC_ADDRESS(E6);
  2430. #elif AXIS_DRIVER_TYPE_E7(TMC2209)
  2431. INVALID_TMC_ADDRESS(E7);
  2432. #endif
  2433. #undef INVALID_TMC_ADDRESS
  2434. #define _TMC_MICROSTEP_IS_VALID(MS) (MS == 0 || MS == 2 || MS == 4 || MS == 8 || MS == 16 || MS == 32 || MS == 64 || MS == 128 || MS == 256)
  2435. #define TMC_MICROSTEP_IS_VALID(M) (!AXIS_IS_TMC(M) || _TMC_MICROSTEP_IS_VALID(M##_MICROSTEPS))
  2436. #define INVALID_TMC_MS(ST) static_assert(0, "Invalid " STRINGIFY(ST) "_MICROSTEPS. Valid values are 0, 2, 4, 8, 16, 32, 64, 128, and 256.")
  2437. #if !TMC_MICROSTEP_IS_VALID(X)
  2438. INVALID_TMC_MS(X);
  2439. #elif !TMC_MICROSTEP_IS_VALID(Y)
  2440. INVALID_TMC_MS(Y)
  2441. #elif !TMC_MICROSTEP_IS_VALID(Z)
  2442. INVALID_TMC_MS(Z)
  2443. #elif !TMC_MICROSTEP_IS_VALID(X2)
  2444. INVALID_TMC_MS(X2);
  2445. #elif !TMC_MICROSTEP_IS_VALID(Y2)
  2446. INVALID_TMC_MS(Y2)
  2447. #elif !TMC_MICROSTEP_IS_VALID(Z2)
  2448. INVALID_TMC_MS(Z2)
  2449. #elif !TMC_MICROSTEP_IS_VALID(Z3)
  2450. INVALID_TMC_MS(Z3)
  2451. #elif !TMC_MICROSTEP_IS_VALID(Z4)
  2452. INVALID_TMC_MS(Z4)
  2453. #elif !TMC_MICROSTEP_IS_VALID(E0)
  2454. INVALID_TMC_MS(E0)
  2455. #elif !TMC_MICROSTEP_IS_VALID(E1)
  2456. INVALID_TMC_MS(E1)
  2457. #elif !TMC_MICROSTEP_IS_VALID(E2)
  2458. INVALID_TMC_MS(E2)
  2459. #elif !TMC_MICROSTEP_IS_VALID(E3)
  2460. INVALID_TMC_MS(E3)
  2461. #elif !TMC_MICROSTEP_IS_VALID(E4)
  2462. INVALID_TMC_MS(E4)
  2463. #elif !TMC_MICROSTEP_IS_VALID(E5)
  2464. INVALID_TMC_MS(E5)
  2465. #elif !TMC_MICROSTEP_IS_VALID(E6)
  2466. INVALID_TMC_MS(E6)
  2467. #elif !TMC_MICROSTEP_IS_VALID(E7)
  2468. INVALID_TMC_MS(E7)
  2469. #endif
  2470. #undef INVALID_TMC_MS
  2471. #undef TMC_MICROSTEP_IS_VALID
  2472. #undef _TMC_MICROSTEP_IS_VALID
  2473. #if ENABLED(DELTA) && (ENABLED(STEALTHCHOP_XY) != ENABLED(STEALTHCHOP_Z))
  2474. #error "STEALTHCHOP_XY and STEALTHCHOP_Z must be the same on DELTA."
  2475. #endif
  2476. #if ENABLED(SENSORLESS_HOMING)
  2477. // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop
  2478. // is necessary in order to reset the stallGuard indication between the initial movement of all three
  2479. // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of
  2480. // clearing the stallGuard activated status is found.
  2481. // Stall detection DIAG = HIGH : TMC2209
  2482. // Stall detection DIAG = LOW : TMC2130/TMC2160/TMC2660/TMC5130/TMC5160
  2483. #define X_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(X,TMC2209)
  2484. #define Y_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Y,TMC2209)
  2485. #define Z_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Z,TMC2209)
  2486. #if NONE(SPI_ENDSTOPS, ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS)
  2487. #if X_SENSORLESS && X_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_XMIN)
  2488. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMIN (or ENDSTOPPULLUPS) when homing to X_MIN."
  2489. #elif X_SENSORLESS && X_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_XMAX)
  2490. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMAX (or ENDSTOPPULLUPS) when homing to X_MAX."
  2491. #elif Y_SENSORLESS && Y_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_YMIN)
  2492. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMIN (or ENDSTOPPULLUPS) when homing to Y_MIN."
  2493. #elif Y_SENSORLESS && Y_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_YMAX)
  2494. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMAX (or ENDSTOPPULLUPS) when homing to Y_MAX."
  2495. #elif Z_SENSORLESS && Z_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_ZMIN)
  2496. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN."
  2497. #elif Z_SENSORLESS && Z_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_ZMAX)
  2498. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX."
  2499. #endif
  2500. #endif
  2501. #if ENABLED(SPI_ENDSTOPS)
  2502. #if ENABLED(QUICK_HOME)
  2503. #warning "SPI_ENDSTOPS may be unreliable with QUICK_HOME. Adjust back-offs for better results."
  2504. #endif
  2505. #else
  2506. #if X_SENSORLESS && X_HOME_DIR < 0 && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
  2507. #if X_ENDSTOP_INVERTING
  2508. #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = true when homing to X_MIN."
  2509. #else
  2510. #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to X_MIN."
  2511. #endif
  2512. #elif X_SENSORLESS && X_HOME_DIR > 0 && X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
  2513. #if X_ENDSTOP_INVERTING
  2514. #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = true when homing to X_MAX."
  2515. #else
  2516. #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to X_MAX."
  2517. #endif
  2518. #elif Y_SENSORLESS && Y_HOME_DIR < 0 && Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
  2519. #if Y_ENDSTOP_INVERTING
  2520. #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = true when homing to Y_MIN."
  2521. #else
  2522. #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MIN."
  2523. #endif
  2524. #elif Y_SENSORLESS && Y_HOME_DIR > 0 && Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
  2525. #if Y_ENDSTOP_INVERTING
  2526. #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = true when homing to Y_MAX."
  2527. #else
  2528. #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MAX."
  2529. #endif
  2530. #elif Z_SENSORLESS && Z_HOME_DIR < 0 && Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
  2531. #if Z_ENDSTOP_INVERTING
  2532. #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = true when homing to Z_MIN."
  2533. #else
  2534. #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MIN."
  2535. #endif
  2536. #elif Z_SENSORLESS && Z_HOME_DIR > 0 && Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
  2537. #if Z_ENDSTOP_INVERTING
  2538. #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = true when homing to Z_MAX."
  2539. #else
  2540. #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MAX."
  2541. #endif
  2542. #endif
  2543. #endif
  2544. #if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z)
  2545. #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z."
  2546. #elif ENDSTOP_NOISE_THRESHOLD
  2547. #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD."
  2548. #elif !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS)
  2549. #error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, or Z axes."
  2550. #endif
  2551. #undef X_ENDSTOP_INVERTING
  2552. #undef Y_ENDSTOP_INVERTING
  2553. #undef Z_ENDSTOP_INVERTING
  2554. #endif
  2555. // Sensorless probing requirements
  2556. #if ENABLED(SENSORLESS_PROBING)
  2557. #if ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS)
  2558. #error "SENSORLESS_PROBING for DELTA requires TMC stepper drivers with StallGuard on X, Y, and Z axes."
  2559. #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  2560. #error "SENSORLESS_PROBING cannot be used with Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN."
  2561. #elif ENABLED(USE_PROBE_FOR_Z_HOMING)
  2562. #error "SENSORLESS_PROBING cannot be used with USE_PROBE_FOR_Z_HOMING."
  2563. #elif !Z_SENSORLESS
  2564. #error "SENSORLESS_PROBING requires a TMC stepper driver with StallGuard on Z."
  2565. #endif
  2566. #endif
  2567. // Sensorless homing is required for both combined steppers in an H-bot
  2568. #if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS
  2569. #error "CoreXY requires both X and Y to use sensorless homing if either one does."
  2570. #elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS && !HOMING_Z_WITH_PROBE
  2571. #error "CoreXZ requires both X and Z to use sensorless homing if either one does."
  2572. #elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS && !HOMING_Z_WITH_PROBE
  2573. #error "CoreYZ requires both Y and Z to use sensorless homing if either one does."
  2574. #elif ENABLED(MARKFORGED_XY) && X_SENSORLESS != Y_SENSORLESS
  2575. #error "MARKFORGED_XY requires both X and Y to use sensorless homing if either one does."
  2576. #endif
  2577. // Other TMC feature requirements
  2578. #if ENABLED(HYBRID_THRESHOLD) && !STEALTHCHOP_ENABLED
  2579. #error "Enable STEALTHCHOP_(XY|Z|E) to use HYBRID_THRESHOLD."
  2580. #elif ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD
  2581. #error "SENSORLESS_HOMING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
  2582. #elif ENABLED(SENSORLESS_PROBING) && !HAS_STALLGUARD
  2583. #error "SENSORLESS_PROBING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
  2584. #elif STEALTHCHOP_ENABLED && !HAS_STEALTHCHOP
  2585. #error "STEALTHCHOP requires TMC2130, TMC2160, TMC2208, TMC2209, or TMC5160 stepper drivers."
  2586. #endif
  2587. /**
  2588. * TMC SPI Chaining
  2589. */
  2590. #define IN_CHAIN(A) ((A##_CHAIN_POS > 0) && !HAS_L64XX)
  2591. #if IN_CHAIN(X ) || IN_CHAIN(Y ) || IN_CHAIN(Z ) || IN_CHAIN(X2) || IN_CHAIN(Y2) || IN_CHAIN(Z2) || IN_CHAIN(Z3) || IN_CHAIN(Z4) \
  2592. || IN_CHAIN(E0) || IN_CHAIN(E1) || IN_CHAIN(E2) || IN_CHAIN(E3) || IN_CHAIN(E4) || IN_CHAIN(E5) || IN_CHAIN(E6) || IN_CHAIN(E7)
  2593. #define BAD_CHAIN(A) (IN_CHAIN(A) && !PIN_EXISTS(A##_CS))
  2594. #if BAD_CHAIN(X ) || BAD_CHAIN(Y ) || BAD_CHAIN(Z ) || BAD_CHAIN(X2) || BAD_CHAIN(Y2) || BAD_CHAIN(Z2) || BAD_CHAIN(Z3) || BAD_CHAIN(Z4) \
  2595. || BAD_CHAIN(E0) || BAD_CHAIN(E1) || BAD_CHAIN(E2) || BAD_CHAIN(E3) || BAD_CHAIN(E4) || BAD_CHAIN(E5) || BAD_CHAIN(E6) || BAD_CHAIN(E7)
  2596. #error "All chained TMC drivers need a CS pin."
  2597. #else
  2598. #if IN_CHAIN(X)
  2599. #define CS_COMPARE X_CS_PIN
  2600. #elif IN_CHAIN(Y)
  2601. #define CS_COMPARE Y_CS_PIN
  2602. #elif IN_CHAIN(Z)
  2603. #define CS_COMPARE Z_CS_PIN
  2604. #elif IN_CHAIN(X2)
  2605. #define CS_COMPARE X2_CS_PIN
  2606. #elif IN_CHAIN(Y2)
  2607. #define CS_COMPARE Y2_CS_PIN
  2608. #elif IN_CHAIN(Z2)
  2609. #define CS_COMPARE Z2_CS_PIN
  2610. #elif IN_CHAIN(Z3)
  2611. #define CS_COMPARE Z3_CS_PIN
  2612. #elif IN_CHAIN(E0)
  2613. #define CS_COMPARE E0_CS_PIN
  2614. #elif IN_CHAIN(E1)
  2615. #define CS_COMPARE E1_CS_PIN
  2616. #elif IN_CHAIN(E2)
  2617. #define CS_COMPARE E2_CS_PIN
  2618. #elif IN_CHAIN(E3)
  2619. #define CS_COMPARE E3_CS_PIN
  2620. #elif IN_CHAIN(E4)
  2621. #define CS_COMPARE E4_CS_PIN
  2622. #elif IN_CHAIN(E5)
  2623. #define CS_COMPARE E5_CS_PIN
  2624. #elif IN_CHAIN(E6)
  2625. #define CS_COMPARE E6_CS_PIN
  2626. #elif IN_CHAIN(E7)
  2627. #define CS_COMPARE E7_CS_PIN
  2628. #endif
  2629. #define BAD_CS_PIN(A) (IN_CHAIN(A) && A##_CS_PIN != CS_COMPARE)
  2630. #if BAD_CS_PIN(X ) || BAD_CS_PIN(Y ) || BAD_CS_PIN(Z ) || BAD_CS_PIN(X2) || BAD_CS_PIN(Y2) || BAD_CS_PIN(Z2) || BAD_CS_PIN(Z3) || BAD_CS_PIN(Z4) \
  2631. || BAD_CS_PIN(E0) || BAD_CS_PIN(E1) || BAD_CS_PIN(E2) || BAD_CS_PIN(E3) || BAD_CS_PIN(E4) || BAD_CS_PIN(E5) || BAD_CS_PIN(E6) || BAD_CS_PIN(E7)
  2632. #error "All chained TMC drivers must use the same CS pin."
  2633. #endif
  2634. #undef BAD_CS_PIN
  2635. #undef CS_COMPARE
  2636. #endif
  2637. #undef BAD_CHAIN
  2638. #endif
  2639. #undef IN_CHAIN
  2640. /**
  2641. * Digipot requirement
  2642. */
  2643. #if HAS_MOTOR_CURRENT_I2C
  2644. #if BOTH(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
  2645. #error "Enable only one of DIGIPOT_MCP4018 or DIGIPOT_MCP4451."
  2646. #elif !MB(MKS_SBASE) \
  2647. && (!defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1))
  2648. #error "DIGIPOT_MCP4018/4451 requires DIGIPOTS_I2C_SDA_* pins to be defined."
  2649. #endif
  2650. #endif
  2651. /**
  2652. * Check per-axis initializers for errors
  2653. */
  2654. constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT,
  2655. sanity_arr_2[] = DEFAULT_MAX_FEEDRATE,
  2656. sanity_arr_3[] = DEFAULT_MAX_ACCELERATION;
  2657. #define _ARR_TEST(N,I) (sanity_arr_##N[_MIN(I,int(COUNT(sanity_arr_##N))-1)] > 0)
  2658. static_assert(COUNT(sanity_arr_1) >= XYZE, "DEFAULT_AXIS_STEPS_PER_UNIT requires X, Y, Z and E elements.");
  2659. 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?)");
  2660. static_assert( _ARR_TEST(1,0) && _ARR_TEST(1,1) && _ARR_TEST(1,2)
  2661. && _ARR_TEST(1,3) && _ARR_TEST(1,4) && _ARR_TEST(1,5)
  2662. && _ARR_TEST(1,6) && _ARR_TEST(1,7) && _ARR_TEST(1,8),
  2663. "DEFAULT_AXIS_STEPS_PER_UNIT values must be positive.");
  2664. static_assert(COUNT(sanity_arr_2) >= XYZE, "DEFAULT_MAX_FEEDRATE requires X, Y, Z and E elements.");
  2665. static_assert(COUNT(sanity_arr_2) <= XYZE_N, "DEFAULT_MAX_FEEDRATE has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)");
  2666. static_assert( _ARR_TEST(2,0) && _ARR_TEST(2,1) && _ARR_TEST(2,2)
  2667. && _ARR_TEST(2,3) && _ARR_TEST(2,4) && _ARR_TEST(2,5)
  2668. && _ARR_TEST(2,6) && _ARR_TEST(2,7) && _ARR_TEST(2,8),
  2669. "DEFAULT_MAX_FEEDRATE values must be positive.");
  2670. static_assert(COUNT(sanity_arr_3) >= XYZE, "DEFAULT_MAX_ACCELERATION requires X, Y, Z and E elements.");
  2671. static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)");
  2672. static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
  2673. && _ARR_TEST(3,3) && _ARR_TEST(3,4) && _ARR_TEST(3,5)
  2674. && _ARR_TEST(3,6) && _ARR_TEST(3,7) && _ARR_TEST(3,8),
  2675. "DEFAULT_MAX_ACCELERATION values must be positive.");
  2676. #if ENABLED(LIMITED_MAX_ACCEL_EDITING)
  2677. #ifdef MAX_ACCEL_EDIT_VALUES
  2678. constexpr float sanity_arr_4[] = MAX_ACCEL_EDIT_VALUES;
  2679. static_assert(COUNT(sanity_arr_4) >= XYZE, "MAX_ACCEL_EDIT_VALUES requires X, Y, Z and E elements.");
  2680. static_assert(COUNT(sanity_arr_4) <= XYZE, "MAX_ACCEL_EDIT_VALUES has too many elements. X, Y, Z and E elements only.");
  2681. static_assert( _ARR_TEST(4,0) && _ARR_TEST(4,1) && _ARR_TEST(4,2)
  2682. && _ARR_TEST(4,3) && _ARR_TEST(4,4) && _ARR_TEST(4,5)
  2683. && _ARR_TEST(4,6) && _ARR_TEST(4,7) && _ARR_TEST(4,8),
  2684. "MAX_ACCEL_EDIT_VALUES values must be positive.");
  2685. #endif
  2686. #endif
  2687. #if ENABLED(LIMITED_MAX_FR_EDITING)
  2688. #ifdef MAX_FEEDRATE_EDIT_VALUES
  2689. constexpr float sanity_arr_5[] = MAX_FEEDRATE_EDIT_VALUES;
  2690. static_assert(COUNT(sanity_arr_5) >= XYZE, "MAX_FEEDRATE_EDIT_VALUES requires X, Y, Z and E elements.");
  2691. static_assert(COUNT(sanity_arr_5) <= XYZE, "MAX_FEEDRATE_EDIT_VALUES has too many elements. X, Y, Z and E elements only.");
  2692. static_assert( _ARR_TEST(5,0) && _ARR_TEST(5,1) && _ARR_TEST(5,2)
  2693. && _ARR_TEST(5,3) && _ARR_TEST(5,4) && _ARR_TEST(5,5)
  2694. && _ARR_TEST(5,6) && _ARR_TEST(5,7) && _ARR_TEST(5,8),
  2695. "MAX_FEEDRATE_EDIT_VALUES values must be positive.");
  2696. #endif
  2697. #endif
  2698. #if ENABLED(LIMITED_JERK_EDITING)
  2699. #ifdef MAX_JERK_EDIT_VALUES
  2700. constexpr float sanity_arr_6[] = MAX_JERK_EDIT_VALUES;
  2701. static_assert(COUNT(sanity_arr_6) >= XYZE, "MAX_JERK_EDIT_VALUES requires X, Y, Z and E elements.");
  2702. static_assert(COUNT(sanity_arr_6) <= XYZE, "MAX_JERK_EDIT_VALUES has too many elements. X, Y, Z and E elements only.");
  2703. static_assert( _ARR_TEST(6,0) && _ARR_TEST(6,1) && _ARR_TEST(6,2)
  2704. && _ARR_TEST(6,3) && _ARR_TEST(6,4) && _ARR_TEST(6,5)
  2705. && _ARR_TEST(6,6) && _ARR_TEST(6,7) && _ARR_TEST(6,8),
  2706. "MAX_JERK_EDIT_VALUES values must be positive.");
  2707. #endif
  2708. #endif
  2709. #undef _ARR_TEST
  2710. #if BOTH(CNC_COORDINATE_SYSTEMS, NO_WORKSPACE_OFFSETS)
  2711. #error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS."
  2712. #endif
  2713. #if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE)
  2714. #error "BLOCK_BUFFER_SIZE must be a power of 2."
  2715. #elif BLOCK_BUFFER_SIZE > 64
  2716. #error "A very large BLOCK_BUFFER_SIZE is not needed and takes longer to drain the buffer on pause / cancel."
  2717. #endif
  2718. #if ENABLED(LED_CONTROL_MENU) && !IS_ULTIPANEL
  2719. #error "LED_CONTROL_MENU requires an LCD controller."
  2720. #endif
  2721. #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED)
  2722. #error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED."
  2723. #endif
  2724. #if ENABLED(SKEW_CORRECTION)
  2725. #if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD))
  2726. #error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD."
  2727. #endif
  2728. #if ENABLED(SKEW_CORRECTION_FOR_Z)
  2729. #if !defined(XZ_SKEW_FACTOR) && !(defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD))
  2730. #error "SKEW_CORRECTION requires XZ_SKEW_FACTOR or XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD."
  2731. #endif
  2732. #if !defined(YZ_SKEW_FACTOR) && !(defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD))
  2733. #error "SKEW_CORRECTION requires YZ_SKEW_FACTOR or YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD."
  2734. #endif
  2735. #endif
  2736. #endif
  2737. #if ENABLED(POWER_LOSS_RECOVERY)
  2738. #if ENABLED(BACKUP_POWER_SUPPLY) && !PIN_EXISTS(POWER_LOSS)
  2739. #error "BACKUP_POWER_SUPPLY requires a POWER_LOSS_PIN."
  2740. #elif BOTH(POWER_LOSS_RECOVER_ZHOME, Z_SAFE_HOMING)
  2741. #error "POWER_LOSS_RECOVER_ZHOME cannot be used with Z_SAFE_HOMING."
  2742. #elif BOTH(POWER_LOSS_PULLUP, POWER_LOSS_PULLDOWN)
  2743. #error "You can't enable POWER_LOSS_PULLUP and POWER_LOSS_PULLDOWN at the same time."
  2744. #elif BOTH(IS_CARTESIAN, POWER_LOSS_RECOVER_ZHOME) && Z_HOME_DIR < 0 && !defined(POWER_LOSS_ZHOME_POS)
  2745. #error "POWER_LOSS_RECOVER_ZHOME requires POWER_LOSS_ZHOME_POS for a Cartesian that homes to ZMIN."
  2746. #endif
  2747. #endif
  2748. #if ENABLED(Z_STEPPER_AUTO_ALIGN)
  2749. #if NUM_Z_STEPPER_DRIVERS <= 1
  2750. #error "Z_STEPPER_AUTO_ALIGN requires NUM_Z_STEPPER_DRIVERS greater than 1."
  2751. #elif !HAS_BED_PROBE
  2752. #error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe."
  2753. #elif ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
  2754. static_assert(WITHIN(Z_STEPPER_ALIGN_AMP, 0.5, 2.0), "Z_STEPPER_ALIGN_AMP must be between 0.5 and 2.0.");
  2755. #if NUM_Z_STEPPER_DRIVERS < 3
  2756. #error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS requires NUM_Z_STEPPER_DRIVERS to be 3 or 4."
  2757. #endif
  2758. #endif
  2759. #endif
  2760. #if ENABLED(MECHANICAL_GANTRY_CALIBRATION)
  2761. #if NONE(HAS_MOTOR_CURRENT_DAC, HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC, HAS_TRINAMIC_CONFIG, HAS_MOTOR_CURRENT_PWM)
  2762. #error "It is highly recommended to have adjustable current drivers to prevent damage. Disable this line to continue anyway."
  2763. #elif !defined(GANTRY_CALIBRATION_CURRENT)
  2764. #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_CURRENT to be set."
  2765. #elif !defined(GANTRY_CALIBRATION_EXTRA_HEIGHT)
  2766. #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_EXTRA_HEIGHT to be set."
  2767. #elif !defined(GANTRY_CALIBRATION_FEEDRATE)
  2768. #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_FEEDRATE to be set."
  2769. #endif
  2770. #if defined(GANTRY_CALIBRATION_SAFE_POSITION) && !defined(GANTRY_CALIBRATION_XY_PARK_FEEDRATE)
  2771. #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
  2772. #endif
  2773. #endif
  2774. #if BOTH(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION)
  2775. #error "You cannot use Z_STEPPER_AUTO_ALIGN and MECHANICAL_GANTRY_CALIBRATION at the same time."
  2776. #endif
  2777. #if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS)
  2778. #error "PRINTCOUNTER requires EEPROM_SETTINGS."
  2779. #endif
  2780. #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PINS_EXIST(USB_CS, USB_INTR) && DISABLED(USE_OTG_USB_HOST)
  2781. #error "USB_CS_PIN and USB_INTR_PIN are required for USB_FLASH_DRIVE_SUPPORT."
  2782. #endif
  2783. #if ENABLED(USE_OTG_USB_HOST) && !defined(HAS_OTG_USB_HOST_SUPPORT)
  2784. #error "The current board does not support USE_OTG_USB_HOST."
  2785. #endif
  2786. #if ENABLED(SD_FIRMWARE_UPDATE) && !defined(__AVR_ATmega2560__)
  2787. #error "SD_FIRMWARE_UPDATE requires an ATmega2560-based (Arduino Mega) board."
  2788. #endif
  2789. #if ENABLED(GCODE_MACROS) && !WITHIN(GCODE_MACROS_SLOTS, 1, 10)
  2790. #error "GCODE_MACROS_SLOTS must be a number from 1 to 10."
  2791. #endif
  2792. #if ENABLED(BACKLASH_COMPENSATION)
  2793. #ifndef BACKLASH_DISTANCE_MM
  2794. #error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM."
  2795. #elif !defined(BACKLASH_CORRECTION)
  2796. #error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION."
  2797. #elif ENABLED(MARKFORGED_XY)
  2798. constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
  2799. static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
  2800. "BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " on a MarkForged system.");
  2801. #elif IS_CORE
  2802. constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
  2803. static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
  2804. "BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " with your CORE system.");
  2805. #endif
  2806. #endif
  2807. #if ENABLED(GRADIENT_MIX) && MIXING_VIRTUAL_TOOLS < 2
  2808. #error "GRADIENT_MIX requires 2 or more MIXING_VIRTUAL_TOOLS."
  2809. #endif
  2810. /**
  2811. * Photo G-code requirements
  2812. */
  2813. #if ENABLED(PHOTO_GCODE)
  2814. #if (PIN_EXISTS(CHDK) + PIN_EXISTS(PHOTOGRAPH) + defined(PHOTO_SWITCH_POSITION)) > 1
  2815. #error "Please define only one of CHDK_PIN, PHOTOGRAPH_PIN, or PHOTO_SWITCH_POSITION."
  2816. #elif defined(PHOTO_SWITCH_POSITION) && !defined(PHOTO_POSITION)
  2817. #error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION."
  2818. #elif PIN_EXISTS(CHDK) && defined(CHDK_DELAY)
  2819. #error "CHDK_DELAY has been replaced by PHOTO_SWITCH_MS."
  2820. #elif PIN_EXISTS(CHDK) && !defined(PHOTO_SWITCH_MS)
  2821. #error "PHOTO_SWITCH_MS is required with CHDK_PIN."
  2822. #elif defined(PHOTO_RETRACT_MM)
  2823. static_assert(PHOTO_RETRACT_MM + 0 >= 0, "PHOTO_RETRACT_MM must be >= 0.");
  2824. #endif
  2825. #endif
  2826. /**
  2827. * Advanced PRINTCOUNTER settings
  2828. */
  2829. #if ENABLED(PRINTCOUNTER)
  2830. #if defined(SERVICE_INTERVAL_1) != defined(SERVICE_NAME_1)
  2831. #error "Both SERVICE_NAME_1 and SERVICE_INTERVAL_1 are required."
  2832. #elif defined(SERVICE_INTERVAL_2) != defined(SERVICE_NAME_2)
  2833. #error "Both SERVICE_NAME_2 and SERVICE_INTERVAL_2 are required."
  2834. #elif defined(SERVICE_INTERVAL_3) != defined(SERVICE_NAME_3)
  2835. #error "Both SERVICE_NAME_3 and SERVICE_INTERVAL_3 are required."
  2836. #endif
  2837. #endif
  2838. /**
  2839. * Require soft endstops for certain setups
  2840. */
  2841. #if !BOTH(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
  2842. #if ENABLED(DUAL_X_CARRIAGE)
  2843. #error "DUAL_X_CARRIAGE requires both MIN_ and MAX_SOFTWARE_ENDSTOPS."
  2844. #elif HAS_HOTEND_OFFSET
  2845. #error "MIN_ and MAX_SOFTWARE_ENDSTOPS are both required with offset hotends."
  2846. #endif
  2847. #endif
  2848. /**
  2849. * Ensure this option is set intentionally
  2850. */
  2851. #if ENABLED(PSU_CONTROL)
  2852. #ifndef PSU_ACTIVE_STATE
  2853. #error "PSU_CONTROL requires PSU_ACTIVE_STATE to be defined as 'HIGH' or 'LOW'."
  2854. #elif !PIN_EXISTS(PS_ON)
  2855. #error "PSU_CONTROL requires PS_ON_PIN."
  2856. #elif POWER_OFF_DELAY < 0
  2857. #error "POWER_OFF_DELAY must be a positive value."
  2858. #endif
  2859. #endif
  2860. #if HAS_CUTTER
  2861. #ifndef CUTTER_POWER_UNIT
  2862. #error "CUTTER_POWER_UNIT is required with a spindle or laser."
  2863. #elif !CUTTER_UNIT_IS(PWM255) && !CUTTER_UNIT_IS(PERCENT) && !CUTTER_UNIT_IS(RPM) && !CUTTER_UNIT_IS(SERVO)
  2864. #error "CUTTER_POWER_UNIT must be PWM255, PERCENT, RPM, or SERVO."
  2865. #endif
  2866. #if ENABLED(LASER_POWER_INLINE)
  2867. #if ENABLED(SPINDLE_CHANGE_DIR)
  2868. #error "SPINDLE_CHANGE_DIR and LASER_POWER_INLINE are incompatible."
  2869. #elif ENABLED(LASER_MOVE_G0_OFF) && DISABLED(LASER_MOVE_POWER)
  2870. #error "LASER_MOVE_G0_OFF requires LASER_MOVE_POWER."
  2871. #endif
  2872. #if ENABLED(LASER_POWER_INLINE_TRAPEZOID)
  2873. #if DISABLED(SPINDLE_LASER_PWM)
  2874. #error "LASER_POWER_INLINE_TRAPEZOID requires SPINDLE_LASER_PWM to function."
  2875. #elif ENABLED(S_CURVE_ACCELERATION)
  2876. //#ifndef LASER_POWER_INLINE_S_CURVE_ACCELERATION_WARN
  2877. // #define LASER_POWER_INLINE_S_CURVE_ACCELERATION_WARN
  2878. // #warning "Combining LASER_POWER_INLINE_TRAPEZOID with S_CURVE_ACCELERATION may result in unintended behavior."
  2879. //#endif
  2880. #endif
  2881. #endif
  2882. #if ENABLED(LASER_POWER_INLINE_INVERT)
  2883. //#ifndef LASER_POWER_INLINE_INVERT_WARN
  2884. // #define LASER_POWER_INLINE_INVERT_WARN
  2885. // #warning "Enabling LASER_POWER_INLINE_INVERT means that `M5` won't kill the laser immediately; use `M5 I` instead."
  2886. //#endif
  2887. #endif
  2888. #else
  2889. #if SPINDLE_LASER_POWERUP_DELAY < 1
  2890. #error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0."
  2891. #elif SPINDLE_LASER_POWERDOWN_DELAY < 1
  2892. #error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0."
  2893. #elif ENABLED(LASER_MOVE_POWER)
  2894. #error "LASER_MOVE_POWER requires LASER_POWER_INLINE."
  2895. #elif ANY(LASER_POWER_INLINE_TRAPEZOID, LASER_POWER_INLINE_INVERT, LASER_MOVE_G0_OFF, LASER_MOVE_POWER)
  2896. #error "Enabled an inline laser feature without inline laser power being enabled."
  2897. #endif
  2898. #endif
  2899. #define _PIN_CONFLICT(P) (PIN_EXISTS(P) && P##_PIN == SPINDLE_LASER_PWM_PIN)
  2900. #if BOTH(SPINDLE_FEATURE, LASER_FEATURE)
  2901. #error "Enable only one of SPINDLE_FEATURE or LASER_FEATURE."
  2902. #elif !PIN_EXISTS(SPINDLE_LASER_ENA) && DISABLED(SPINDLE_SERVO)
  2903. #error "(SPINDLE|LASER)_FEATURE requires SPINDLE_LASER_ENA_PIN or SPINDLE_SERVO to control the power."
  2904. #elif ENABLED(SPINDLE_CHANGE_DIR) && !PIN_EXISTS(SPINDLE_DIR)
  2905. #error "SPINDLE_DIR_PIN is required for SPINDLE_CHANGE_DIR."
  2906. #elif ENABLED(SPINDLE_LASER_PWM)
  2907. #if !defined(SPINDLE_LASER_PWM_PIN) || SPINDLE_LASER_PWM_PIN < 0
  2908. #error "SPINDLE_LASER_PWM_PIN is required for SPINDLE_LASER_PWM."
  2909. #elif !_TEST_PWM(SPINDLE_LASER_PWM_PIN)
  2910. #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."
  2911. #elif !defined(SPINDLE_LASER_PWM_INVERT)
  2912. #error "SPINDLE_LASER_PWM_INVERT is required for (SPINDLE|LASER)_FEATURE."
  2913. #elif !(defined(SPEED_POWER_INTERCEPT) && defined(SPEED_POWER_MIN) && defined(SPEED_POWER_MAX) && defined(SPEED_POWER_STARTUP))
  2914. #error "SPINDLE_LASER_PWM equation constant(s) missing."
  2915. #elif _PIN_CONFLICT(X_MIN)
  2916. #error "SPINDLE_LASER_PWM pin conflicts with X_MIN_PIN."
  2917. #elif _PIN_CONFLICT(X_MAX)
  2918. #error "SPINDLE_LASER_PWM pin conflicts with X_MAX_PIN."
  2919. #elif _PIN_CONFLICT(Z_STEP)
  2920. #error "SPINDLE_LASER_PWM pin conflicts with Z_STEP_PIN."
  2921. #elif _PIN_CONFLICT(CASE_LIGHT)
  2922. #error "SPINDLE_LASER_PWM_PIN conflicts with CASE_LIGHT_PIN."
  2923. #elif _PIN_CONFLICT(E0_AUTO_FAN)
  2924. #error "SPINDLE_LASER_PWM_PIN conflicts with E0_AUTO_FAN_PIN."
  2925. #elif _PIN_CONFLICT(E1_AUTO_FAN)
  2926. #error "SPINDLE_LASER_PWM_PIN conflicts with E1_AUTO_FAN_PIN."
  2927. #elif _PIN_CONFLICT(E2_AUTO_FAN)
  2928. #error "SPINDLE_LASER_PWM_PIN conflicts with E2_AUTO_FAN_PIN."
  2929. #elif _PIN_CONFLICT(E3_AUTO_FAN)
  2930. #error "SPINDLE_LASER_PWM_PIN conflicts with E3_AUTO_FAN_PIN."
  2931. #elif _PIN_CONFLICT(E4_AUTO_FAN)
  2932. #error "SPINDLE_LASER_PWM_PIN conflicts with E4_AUTO_FAN_PIN."
  2933. #elif _PIN_CONFLICT(E5_AUTO_FAN)
  2934. #error "SPINDLE_LASER_PWM_PIN conflicts with E5_AUTO_FAN_PIN."
  2935. #elif _PIN_CONFLICT(E6_AUTO_FAN)
  2936. #error "SPINDLE_LASER_PWM_PIN conflicts with E6_AUTO_FAN_PIN."
  2937. #elif _PIN_CONFLICT(E7_AUTO_FAN)
  2938. #error "SPINDLE_LASER_PWM_PIN conflicts with E7_AUTO_FAN_PIN."
  2939. #elif _PIN_CONFLICT(FAN)
  2940. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN_PIN."
  2941. #elif _PIN_CONFLICT(FAN1)
  2942. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN1_PIN."
  2943. #elif _PIN_CONFLICT(FAN2)
  2944. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN2_PIN."
  2945. #elif _PIN_CONFLICT(FAN3)
  2946. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN3_PIN."
  2947. #elif _PIN_CONFLICT(FAN4)
  2948. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN4_PIN."
  2949. #elif _PIN_CONFLICT(FAN5)
  2950. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN5_PIN."
  2951. #elif _PIN_CONFLICT(FAN6)
  2952. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN6_PIN."
  2953. #elif _PIN_CONFLICT(FAN7)
  2954. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN7_PIN."
  2955. #elif _PIN_CONFLICT(CONTROLLERFAN)
  2956. #error "SPINDLE_LASER_PWM_PIN conflicts with CONTROLLERFAN_PIN."
  2957. #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_XY)
  2958. #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_XY."
  2959. #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_Z)
  2960. #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_Z."
  2961. #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_E)
  2962. #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_E."
  2963. #endif
  2964. #endif
  2965. #undef _PIN_CONFLICT
  2966. #endif
  2967. #if ENABLED(COOLANT_MIST) && !PIN_EXISTS(COOLANT_MIST)
  2968. #error "COOLANT_MIST requires COOLANT_MIST_PIN to be defined."
  2969. #elif ENABLED(COOLANT_FLOOD) && !PIN_EXISTS(COOLANT_FLOOD)
  2970. #error "COOLANT_FLOOD requires COOLANT_FLOOD_PIN to be defined."
  2971. #endif
  2972. #if NONE(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI) && ENABLED(PRINT_PROGRESS_SHOW_DECIMALS)
  2973. #error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD."
  2974. #endif
  2975. #if HAS_ADC_BUTTONS && defined(ADC_BUTTON_DEBOUNCE_DELAY) && ADC_BUTTON_DEBOUNCE_DELAY < 16
  2976. #error "ADC_BUTTON_DEBOUNCE_DELAY must be greater than 16."
  2977. #endif
  2978. /**
  2979. * Check to make sure MONITOR_DRIVER_STATUS isn't enabled
  2980. * on boards where TMC drivers share the SPI bus with SD.
  2981. */
  2982. #if HAS_TMC_SPI && ALL(MONITOR_DRIVER_STATUS, SDSUPPORT, USES_SHARED_SPI)
  2983. #error "MONITOR_DRIVER_STATUS and SDSUPPORT cannot be used together on boards with shared SPI."
  2984. #endif
  2985. // G60/G61 Position Save
  2986. #if SAVED_POSITIONS > 256
  2987. #error "SAVED_POSITIONS must be an integer from 0 to 256."
  2988. #endif
  2989. /**
  2990. * Stepper Chunk support
  2991. */
  2992. #if BOTH(DIRECT_STEPPING, LIN_ADVANCE)
  2993. #error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. Enable in external planner if possible."
  2994. #endif
  2995. /**
  2996. * Touch Buttons
  2997. */
  2998. #if ENABLED(TOUCH_SCREEN) && DISABLED(TOUCH_SCREEN_CALIBRATION)
  2999. #ifndef TOUCH_CALIBRATION_X
  3000. #error "TOUCH_CALIBRATION_X must be defined with TOUCH_SCREEN."
  3001. #endif
  3002. #ifndef TOUCH_CALIBRATION_Y
  3003. #error "TOUCH_CALIBRATION_Y must be defined with TOUCH_SCREEN."
  3004. #endif
  3005. #ifndef TOUCH_OFFSET_X
  3006. #error "TOUCH_OFFSET_X must be defined with TOUCH_SCREEN."
  3007. #endif
  3008. #ifndef TOUCH_OFFSET_Y
  3009. #error "TOUCH_OFFSET_Y must be defined with TOUCH_SCREEN."
  3010. #endif
  3011. #endif
  3012. /**
  3013. * Sanity check for WIFI
  3014. */
  3015. #if EITHER(ESP3D_WIFISUPPORT, WIFISUPPORT) && DISABLED(ARDUINO_ARCH_ESP32)
  3016. #error "ESP3D_WIFISUPPORT or WIFISUPPORT requires an ESP32 MOTHERBOARD."
  3017. #endif
  3018. /**
  3019. * Sanity Check for Password Feature
  3020. */
  3021. #if ENABLED(PASSWORD_FEATURE)
  3022. #if NONE(HAS_LCD_MENU, PASSWORD_UNLOCK_GCODE, PASSWORD_CHANGE_GCODE)
  3023. #error "Without PASSWORD_UNLOCK_GCODE, PASSWORD_CHANGE_GCODE, or a supported LCD there's no way to unlock the printer or set a password."
  3024. #elif DISABLED(EEPROM_SETTINGS)
  3025. #warning "PASSWORD_FEATURE settings will be lost on power-off without EEPROM_SETTINGS."
  3026. #endif
  3027. #endif
  3028. /**
  3029. * Sanity Check for MEATPACK and BINARY_FILE_TRANSFER Features
  3030. */
  3031. #if BOTH(HAS_MEATPACK, BINARY_FILE_TRANSFER)
  3032. #error "Either enable MEATPACK_ON_SERIAL_PORT_* or BINARY_FILE_TRANSFER, not both."
  3033. #endif
  3034. /**
  3035. * Sanity check for unique start and stop values in NOZZLE_CLEAN_FEATURE
  3036. */
  3037. #if ENABLED(NOZZLE_CLEAN_FEATURE)
  3038. constexpr xyz_pos_t start_xyz[8] = NOZZLE_CLEAN_START_POINT,
  3039. end_xyz[8] = NOZZLE_CLEAN_END_POINT;
  3040. #define _CLEAN_ASSERT(N) static_assert(N >= HOTENDS || end_xyz[N].x != start_xyz[N].x || TERN(NOZZLE_CLEAN_NO_Y, false, end_xyz[N].y != start_xyz[N].y), \
  3041. "NOZZLE_CLEAN Start and End must be made different on HOTEND " STRINGIFY(N))
  3042. _CLEAN_ASSERT(0); _CLEAN_ASSERT(1);
  3043. _CLEAN_ASSERT(2); _CLEAN_ASSERT(3);
  3044. _CLEAN_ASSERT(4); _CLEAN_ASSERT(5);
  3045. _CLEAN_ASSERT(6); _CLEAN_ASSERT(7);
  3046. #undef _CLEAN_ASSERT
  3047. #endif
  3048. /**
  3049. * Sanity check for valid stepper driver types
  3050. */
  3051. #define _BAD_DRIVER(A) (defined(A##_DRIVER_TYPE) && !_DRIVER_ID(A##_DRIVER_TYPE))
  3052. #if _BAD_DRIVER(X)
  3053. #error "X_DRIVER_TYPE is not recognized."
  3054. #endif
  3055. #if _BAD_DRIVER(Y)
  3056. #error "Y_DRIVER_TYPE is not recognized."
  3057. #endif
  3058. #if _BAD_DRIVER(Z)
  3059. #error "Z_DRIVER_TYPE is not recognized."
  3060. #endif
  3061. #if _BAD_DRIVER(X2)
  3062. #error "X2_DRIVER_TYPE is not recognized."
  3063. #endif
  3064. #if _BAD_DRIVER(Y2)
  3065. #error "Y2_DRIVER_TYPE is not recognized."
  3066. #endif
  3067. #if _BAD_DRIVER(Z2)
  3068. #error "Z2_DRIVER_TYPE is not recognized."
  3069. #endif
  3070. #if _BAD_DRIVER(Z3)
  3071. #error "Z3_DRIVER_TYPE is not recognized."
  3072. #endif
  3073. #if _BAD_DRIVER(Z4)
  3074. #error "Z4_DRIVER_TYPE is not recognized."
  3075. #endif
  3076. #if _BAD_DRIVER(E0)
  3077. #error "E0_DRIVER_TYPE is not recognized."
  3078. #endif
  3079. #if _BAD_DRIVER(E1)
  3080. #error "E1_DRIVER_TYPE is not recognized."
  3081. #endif
  3082. #if _BAD_DRIVER(E2)
  3083. #error "E2_DRIVER_TYPE is not recognized."
  3084. #endif
  3085. #if _BAD_DRIVER(E3)
  3086. #error "E3_DRIVER_TYPE is not recognized."
  3087. #endif
  3088. #if _BAD_DRIVER(E4)
  3089. #error "E4_DRIVER_TYPE is not recognized."
  3090. #endif
  3091. #if _BAD_DRIVER(E5)
  3092. #error "E5_DRIVER_TYPE is not recognized."
  3093. #endif
  3094. #if _BAD_DRIVER(E6)
  3095. #error "E6_DRIVER_TYPE is not recognized."
  3096. #endif
  3097. #if _BAD_DRIVER(E7)
  3098. #error "E7_DRIVER_TYPE is not recognized."
  3099. #endif
  3100. #undef _BAD_DRIVER
  3101. // Misc. Cleanup
  3102. #undef _TEST_PWM