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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158
  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. // Strings for sanity check messages
  35. #define _NUM_AXES_STR NUM_AXIS_GANG("X ", "Y ", "Z ", "I ", "J ", "K ", "U ", "V ", "W ")
  36. #define _LOGICAL_AXES_STR LOGICAL_AXIS_GANG("E ", "X ", "Y ", "Z ", "I ", "J ", "K ", "U ", "V ", "W ")
  37. // Make sure macros aren't borked
  38. #define TEST1
  39. #define TEST2 1
  40. #define TEST3 0
  41. #define TEST4 true
  42. #if ENABLED(TEST0) || !ENABLED(TEST2) || ENABLED(TEST3) || !ENABLED(TEST1, TEST2, TEST4)
  43. #error "ENABLED is borked!"
  44. #endif
  45. #if BOTH(TEST0, TEST1)
  46. #error "BOTH is borked!"
  47. #endif
  48. #if DISABLED(TEST1) || !DISABLED(TEST3) || DISABLED(TEST4) || DISABLED(TEST0, TEST1, TEST2, TEST4) || !DISABLED(TEST0, TEST3)
  49. #error "DISABLED is borked!"
  50. #endif
  51. #if !ANY(TEST1, TEST2, TEST3, TEST4) || ANY(TEST0, TEST3)
  52. #error "ANY is borked!"
  53. #endif
  54. #if NONE(TEST0, TEST1, TEST2, TEST4) || !NONE(TEST0, TEST3)
  55. #error "NONE is borked!"
  56. #endif
  57. #undef TEST1
  58. #undef TEST2
  59. #undef TEST3
  60. #undef TEST4
  61. /**
  62. * This is to alert you about non-matching versions of config files.
  63. *
  64. * You can edit the version tag in your old config files and try the build again.
  65. * The checks below will alert you about options that need to be changed, but they won't
  66. * tell you about new options that you might find useful. So it's recommended to transfer
  67. * your settings to new Configuration files matching your Marlin version as soon as possible.
  68. */
  69. #define HEXIFY(H) _CAT(0x,H)
  70. #if !defined(CONFIGURATION_H_VERSION) || HEXIFY(CONFIGURATION_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_H_VERSION)
  71. #error "Your Configuration.h file is for an old version of Marlin. Downgrade Marlin or upgrade your Configuration.h."
  72. #elif HEXIFY(CONFIGURATION_H_VERSION) > HEXIFY(REQUIRED_CONFIGURATION_H_VERSION)
  73. #error "Your Configuration.h file is for a newer version of Marlin. Upgrade Marlin or downgrade your Configuration.h."
  74. #endif
  75. #if !defined(CONFIGURATION_ADV_H_VERSION) || HEXIFY(CONFIGURATION_ADV_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION)
  76. #error "Your Configuration_adv.h file is for an old version of Marlin. Downgrade Marlin or upgrade your Configuration_adv.h."
  77. #elif HEXIFY(CONFIGURATION_ADV_H_VERSION) > HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION)
  78. #error "Your Configuration_adv.h file is for a newer version of Marlin. Upgrade Marlin or downgrade your Configuration_adv.h."
  79. #endif
  80. #undef HEXIFY
  81. /**
  82. * Warnings for old configurations
  83. */
  84. #ifndef MOTHERBOARD
  85. #error "MOTHERBOARD is required."
  86. #elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE)
  87. #error "X_BED_SIZE and Y_BED_SIZE are now required!"
  88. #elif WATCH_TEMP_PERIOD > 500
  89. #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds."
  90. #elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
  91. #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS."
  92. #elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
  93. #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED."
  94. #elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE)
  95. #error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY."
  96. #elif defined(X_HOME_RETRACT_MM)
  97. #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM."
  98. #elif defined(SDCARDDETECTINVERTED)
  99. #error "SDCARDDETECTINVERTED is now SD_DETECT_STATE (HIGH)."
  100. #elif defined(SD_DETECT_INVERTED)
  101. #error "SD_DETECT_INVERTED is now SD_DETECT_STATE (HIGH)."
  102. #elif defined(BTENABLED)
  103. #error "BTENABLED is now BLUETOOTH."
  104. #elif defined(CUSTOM_MENDEL_NAME)
  105. #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME."
  106. #elif defined(HAS_AUTOMATIC_VERSIONING)
  107. #error "HAS_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE."
  108. #elif defined(USE_AUTOMATIC_VERSIONING)
  109. #error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE."
  110. #elif defined(SDSLOW)
  111. #error "SDSLOW deprecated. Set SD_SPI_SPEED to SPI_HALF_SPEED instead."
  112. #elif defined(SDEXTRASLOW)
  113. #error "SDEXTRASLOW deprecated. Set SD_SPI_SPEED to SPI_QUARTER_SPEED instead."
  114. #elif defined(FILAMENT_SENSOR)
  115. #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR."
  116. #elif defined(ENDSTOPPULLUP_FIL_RUNOUT)
  117. #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP."
  118. #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
  119. #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead."
  120. #elif defined(LANGUAGE_INCLUDE)
  121. #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE."
  122. #elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y)
  123. #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead."
  124. #elif defined(PID_PARAMS_PER_EXTRUDER)
  125. #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead."
  126. #elif defined(EXTRUDER_WATTS) || defined(BED_WATTS)
  127. #error "EXTRUDER_WATTS and BED_WATTS are deprecated and should be removed."
  128. #elif defined(SERVO_ENDSTOP_ANGLES)
  129. #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
  130. #elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
  131. #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
  132. #elif defined(Z_ENDSTOP_SERVO_NR)
  133. #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR."
  134. #elif defined(DEFAULT_XYJERK)
  135. #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead."
  136. #elif defined(XY_TRAVEL_SPEED)
  137. #error "XY_TRAVEL_SPEED is now XY_PROBE_FEEDRATE."
  138. #elif defined(XY_PROBE_SPEED)
  139. #error "XY_PROBE_SPEED is now XY_PROBE_FEEDRATE."
  140. #elif defined(Z_PROBE_SPEED_FAST)
  141. #error "Z_PROBE_SPEED_FAST is now Z_PROBE_FEEDRATE_FAST."
  142. #elif defined(Z_PROBE_SPEED_SLOW)
  143. #error "Z_PROBE_SPEED_SLOW is now Z_PROBE_FEEDRATE_SLOW."
  144. #elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
  145. #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead."
  146. #elif defined(SERVO_DEACTIVATION_DELAY)
  147. #error "SERVO_DEACTIVATION_DELAY is now SERVO_DELAY."
  148. #elif ENABLED(FILAMENTCHANGEENABLE)
  149. #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE."
  150. #elif ENABLED(FILAMENT_CHANGE_FEATURE)
  151. #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE."
  152. #elif defined(FILAMENT_CHANGE_X_POS) || defined(FILAMENT_CHANGE_Y_POS)
  153. #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT."
  154. #elif defined(FILAMENT_CHANGE_Z_ADD)
  155. #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT."
  156. #elif defined(FILAMENT_CHANGE_XY_FEEDRATE)
  157. #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE."
  158. #elif defined(FILAMENT_CHANGE_Z_FEEDRATE)
  159. #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE."
  160. #elif defined(PAUSE_PARK_X_POS) || defined(PAUSE_PARK_Y_POS)
  161. #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT."
  162. #elif defined(PAUSE_PARK_Z_ADD)
  163. #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT."
  164. #elif defined(PAUSE_PARK_XY_FEEDRATE)
  165. #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE."
  166. #elif defined(PAUSE_PARK_Z_FEEDRATE)
  167. #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE."
  168. #elif defined(FILAMENT_CHANGE_RETRACT_FEEDRATE)
  169. #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE."
  170. #elif defined(FILAMENT_CHANGE_RETRACT_LENGTH)
  171. #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH."
  172. #elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE)
  173. #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE."
  174. #elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE)
  175. #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE."
  176. #elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH)
  177. #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH."
  178. #elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH)
  179. #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH."
  180. #elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT)
  181. #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT."
  182. #elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS)
  183. #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS."
  184. #elif defined(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
  185. #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT."
  186. #elif defined(PLA_PREHEAT_HOTEND_TEMP)
  187. #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND."
  188. #elif defined(PLA_PREHEAT_HPB_TEMP)
  189. #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED."
  190. #elif defined(PLA_PREHEAT_FAN_SPEED)
  191. #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED."
  192. #elif defined(ABS_PREHEAT_HOTEND_TEMP)
  193. #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND."
  194. #elif defined(ABS_PREHEAT_HPB_TEMP)
  195. #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED."
  196. #elif defined(ABS_PREHEAT_FAN_SPEED)
  197. #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED."
  198. #elif defined(ENDSTOPS_ONLY_FOR_HOMING)
  199. #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead."
  200. #elif defined(HOMING_FEEDRATE)
  201. #error "HOMING_FEEDRATE is now set using the HOMING_FEEDRATE_MM_M array instead."
  202. #elif (defined(HOMING_FEEDRATE_XY) || defined(HOMING_FEEDRATE_Z)) && !defined(HOMING_FEEDRATE_MM_M)
  203. #error "HOMING_FEEDRATE_XY and HOMING_FEEDRATE_Z are now set using the HOMING_FEEDRATE_MM_M array instead."
  204. #elif defined(MANUAL_HOME_POSITIONS)
  205. #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead."
  206. #elif defined(PID_ADD_EXTRUSION_RATE)
  207. #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default."
  208. #elif defined(Z_RAISE_BEFORE_HOMING)
  209. #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT."
  210. #elif defined(MIN_Z_HEIGHT_FOR_HOMING)
  211. #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT."
  212. #elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING)
  213. #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead."
  214. #elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS)
  215. #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES."
  216. #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT)
  217. #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES."
  218. #elif defined(MANUAL_BED_LEVELING)
  219. #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING."
  220. #elif defined(MESH_HOME_SEARCH_Z)
  221. #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE."
  222. #elif defined(MANUAL_PROBE_Z_RANGE)
  223. #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE."
  224. #elif !defined(MIN_STEPS_PER_SEGMENT)
  225. #error "Please replace 'const int dropsegments' with '#define MIN_STEPS_PER_SEGMENT' (and increase by 1)."
  226. #elif MIN_STEPS_PER_SEGMENT <= 0
  227. #error "MIN_STEPS_PER_SEGMENT must be at least 1."
  228. #elif defined(PREVENT_DANGEROUS_EXTRUDE)
  229. #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION."
  230. #elif defined(SCARA)
  231. #error "SCARA is now MORGAN_SCARA."
  232. #elif defined(ENABLE_AUTO_BED_LEVELING)
  233. #error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
  234. #elif defined(AUTO_BED_LEVELING_FEATURE)
  235. #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
  236. #elif defined(ABL_GRID_POINTS)
  237. #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y."
  238. #elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y)
  239. #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]."
  240. #elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y)
  241. #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]."
  242. #elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS)
  243. #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]."
  244. #elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS)
  245. #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]."
  246. #elif defined(UBL_G26_MESH_VALIDATION)
  247. #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION."
  248. #elif defined(UBL_MESH_EDIT_ENABLED)
  249. #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION."
  250. #elif defined(UBL_MESH_EDITING)
  251. #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION."
  252. #elif defined(BLTOUCH_HEATERS_OFF)
  253. #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF."
  254. #elif defined(BLTOUCH_V3)
  255. #error "BLTOUCH_V3 is obsolete."
  256. #elif defined(BLTOUCH_FORCE_OPEN_DRAIN_MODE)
  257. #error "BLTOUCH_FORCE_OPEN_DRAIN_MODE is obsolete."
  258. #elif defined(BEEPER)
  259. #error "BEEPER is now BEEPER_PIN."
  260. #elif defined(SDCARDDETECT)
  261. #error "SDCARDDETECT is now SD_DETECT_PIN."
  262. #elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE)
  263. #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN."
  264. #elif defined(LCD_PIN_BL)
  265. #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN."
  266. #elif defined(LCD_PIN_RESET)
  267. #error "LCD_PIN_RESET is now LCD_RESET_PIN."
  268. #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)
  269. #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN."
  270. #elif defined(PID_FAN_SCALING) && !HAS_FAN
  271. #error "PID_FAN_SCALING needs at least one fan enabled."
  272. #elif defined(min_software_endstops) || defined(max_software_endstops)
  273. #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS."
  274. #elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN)
  275. #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)."
  276. #elif defined(CONTROLLERFAN_PIN)
  277. #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN."
  278. #elif defined(CONTROLLERFAN_SPEED)
  279. #error "CONTROLLERFAN_SPEED is now CONTROLLERFAN_SPEED_ACTIVE."
  280. #elif defined(CONTROLLERFAN_SECS)
  281. #error "CONTROLLERFAN_SECS is now CONTROLLERFAN_IDLE_TIME."
  282. #elif defined(MIN_RETRACT)
  283. #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT."
  284. #elif defined(ADVANCE)
  285. #error "ADVANCE is now LIN_ADVANCE."
  286. #elif defined(LIN_ADVANCE_E_D_RATIO)
  287. #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO."
  288. #elif defined(NEOPIXEL_RGBW_LED)
  289. #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED."
  290. #elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS)
  291. #error "Remove DELTA_PROBEABLE_RADIUS and use PROBING_MARGIN to inset the probe area instead."
  292. #elif ENABLED(DELTA) && defined(DELTA_CALIBRATION_RADIUS)
  293. #error "Remove DELTA_CALIBRATION_RADIUS and use PROBING_MARGIN to inset the probe area instead."
  294. #elif defined(UBL_MESH_INSET)
  295. #error "UBL_MESH_INSET is now just MESH_INSET."
  296. #elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y)
  297. #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]."
  298. #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)
  299. #error "ABL_PROBE_PT_[123]_[XY] is no longer required. Please remove it."
  300. #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)
  301. #error "UBL_PROBE_PT_[123]_[XY] is no longer required. Please remove it."
  302. #elif defined(MIN_PROBE_EDGE)
  303. #error "MIN_PROBE_EDGE is now called PROBING_MARGIN."
  304. #elif defined(MIN_PROBE_EDGE_LEFT)
  305. #error "MIN_PROBE_EDGE_LEFT is now called PROBING_MARGIN_LEFT."
  306. #elif defined(MIN_PROBE_EDGE_RIGHT)
  307. #error "MIN_PROBE_EDGE_RIGHT is now called PROBING_MARGIN_RIGHT."
  308. #elif defined(MIN_PROBE_EDGE_FRONT)
  309. #error "MIN_PROBE_EDGE_FRONT is now called PROBING_MARGIN_FRONT."
  310. #elif defined(MIN_PROBE_EDGE_BACK)
  311. #error "MIN_PROBE_EDGE_BACK is now called PROBING_MARGIN_BACK."
  312. #elif defined(LEFT_PROBE_BED_POSITION)
  313. #error "LEFT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_LEFT instead."
  314. #elif defined(RIGHT_PROBE_BED_POSITION)
  315. #error "RIGHT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_RIGHT instead."
  316. #elif defined(FRONT_PROBE_BED_POSITION)
  317. #error "FRONT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_FRONT instead."
  318. #elif defined(BACK_PROBE_BED_POSITION)
  319. #error "BACK_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_BACK instead."
  320. #elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY)
  321. #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY."
  322. #elif defined(BABYSTEP_ZPROBE_GFX_REVERSE)
  323. #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE."
  324. #elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN)
  325. #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES."
  326. #elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1))
  327. #error "K1 is now PID_K1."
  328. #elif defined(PROBE_DOUBLE_TOUCH)
  329. #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING."
  330. #elif defined(ANET_KEYPAD_LCD)
  331. #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD."
  332. #elif defined(LCD_I2C_SAINSMART_YWROBOT)
  333. #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004)."
  334. #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT)
  335. #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN."
  336. #elif defined(HAVE_TMCDRIVER)
  337. #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X."
  338. #elif defined(STEALTHCHOP)
  339. #error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E)."
  340. #elif defined(HAVE_TMC26X)
  341. #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X."
  342. #elif defined(HAVE_TMC2130)
  343. #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130."
  344. #elif defined(HAVE_TMC2208)
  345. #error "HAVE_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208."
  346. #elif defined(HAVE_L6470DRIVER)
  347. #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470."
  348. #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) \
  349. || 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)
  350. #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X."
  351. #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) \
  352. || 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)
  353. #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X."
  354. #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) \
  355. || 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)
  356. #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130."
  357. #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) \
  358. || 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)
  359. #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208."
  360. #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) \
  361. || 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)
  362. #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470."
  363. #elif defined(AUTOMATIC_CURRENT_CONTROL)
  364. #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS."
  365. #elif defined(FILAMENT_CHANGE_LOAD_LENGTH)
  366. #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH."
  367. #elif defined(LEVEL_CORNERS_INSET)
  368. #error "LEVEL_CORNERS_INSET is now BED_TRAMMING_INSET_LFRB."
  369. #elif defined(BEZIER_JERK_CONTROL)
  370. #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION."
  371. #elif HAS_JUNCTION_DEVIATION && defined(JUNCTION_DEVIATION_FACTOR)
  372. #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM."
  373. #elif defined(JUNCTION_ACCELERATION_FACTOR)
  374. #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h."
  375. #elif defined(JUNCTION_ACCELERATION)
  376. #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h."
  377. #elif defined(MAX7219_DEBUG_STEPPER_HEAD)
  378. #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD."
  379. #elif defined(MAX7219_DEBUG_STEPPER_TAIL)
  380. #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL."
  381. #elif defined(MAX7219_DEBUG_STEPPER_QUEUE)
  382. #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE."
  383. #elif defined(ENDSTOP_NOISE_FILTER)
  384. #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]."
  385. #elif defined(RETRACT_ZLIFT)
  386. #error "RETRACT_ZLIFT is now RETRACT_ZRAISE."
  387. #elif defined(TOOLCHANGE_FS_INIT_BEFORE_SWAP)
  388. #error "TOOLCHANGE_FS_INIT_BEFORE_SWAP is now TOOLCHANGE_FS_SLOW_FIRST_PRIME."
  389. #elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT)
  390. #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE."
  391. #elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE)
  392. #error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE."
  393. #elif defined(SINGLENOZZLE_SWAP_LENGTH)
  394. #error "SINGLENOZZLE_SWAP_LENGTH is now TOOLCHANGE_FIL_SWAP_LENGTH."
  395. #elif defined(SINGLENOZZLE_SWAP_RETRACT_SPEED)
  396. #error "SINGLENOZZLE_SWAP_RETRACT_SPEED is now TOOLCHANGE_FIL_SWAP_RETRACT_SPEED."
  397. #elif defined(SINGLENOZZLE_SWAP_PRIME_SPEED)
  398. #error "SINGLENOZZLE_SWAP_PRIME_SPEED is now TOOLCHANGE_FIL_SWAP_PRIME_SPEED."
  399. #elif defined(SINGLENOZZLE_SWAP_PARK)
  400. #error "SINGLENOZZLE_SWAP_PARK is now TOOLCHANGE_PARK."
  401. #elif defined(SINGLENOZZLE_TOOLCHANGE_XY)
  402. #error "SINGLENOZZLE_TOOLCHANGE_XY is now TOOLCHANGE_PARK_XY."
  403. #elif defined(SINGLENOZZLE_PARK_XY_FEEDRATE)
  404. #error "SINGLENOZZLE_PARK_XY_FEEDRATE is now TOOLCHANGE_PARK_XY_FEEDRATE."
  405. #elif defined(PARKING_EXTRUDER_SECURITY_RAISE)
  406. #error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE."
  407. #elif defined(SWITCHING_TOOLHEAD_SECURITY_RAISE)
  408. #error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE."
  409. #elif defined(G0_FEEDRATE) && G0_FEEDRATE == 0
  410. #error "G0_FEEDRATE is now used to set the G0 feedrate."
  411. #elif defined(MBL_Z_STEP)
  412. #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP."
  413. #elif defined(CHDK)
  414. #error "CHDK is now CHDK_PIN."
  415. #elif ANY_PIN( \
  416. MAX6675_SS, MAX6675_SS2, MAX6675_CS, MAX6675_CS2, \
  417. MAX31855_SS, MAX31855_SS2, MAX31855_CS, MAX31855_CS2, \
  418. MAX31865_SS, MAX31865_SS2, MAX31865_CS, MAX31865_CS2)
  419. #warning "MAX*_SS_PIN, MAX*_SS2_PIN, MAX*_CS_PIN, and MAX*_CS2_PIN are deprecated and will be removed in a future version. Please use TEMP_0_CS_PIN/TEMP_1_CS_PIN instead."
  420. #elif ANY_PIN(MAX6675_SCK, MAX31855_SCK, MAX31865_SCK)
  421. #warning "MAX*_SCK_PIN is deprecated and will be removed in a future version. Please use TEMP_0_SCK_PIN/TEMP_1_SCK_PIN instead."
  422. #elif ANY_PIN(MAX6675_MISO, MAX6675_DO, MAX31855_MISO, MAX31855_DO, MAX31865_MISO, MAX31865_DO)
  423. #warning "MAX*_MISO_PIN and MAX*_DO_PIN are deprecated and will be removed in a future version. Please use TEMP_0_MISO_PIN/TEMP_1_MISO_PIN instead."
  424. #elif PIN_EXISTS(MAX31865_MOSI)
  425. #warning "MAX31865_MOSI_PIN is deprecated and will be removed in a future version. Please use TEMP_0_MOSI_PIN/TEMP_1_MOSI_PIN instead."
  426. #elif ANY_PIN(THERMO_CS1_PIN, THERMO_CS2_PIN, THERMO_DO_PIN, THERMO_SCK_PIN)
  427. #error "THERMO_*_PIN is now TEMP_n_CS_PIN, TEMP_n_SCK_PIN, TEMP_n_MOSI_PIN, TEMP_n_MISO_PIN."
  428. #elif defined(MAX31865_SENSOR_OHMS)
  429. #error "MAX31865_SENSOR_OHMS is now MAX31865_SENSOR_OHMS_0."
  430. #elif defined(MAX31865_CALIBRATION_OHMS)
  431. #error "MAX31865_CALIBRATION_OHMS is now MAX31865_CALIBRATION_OHMS_0."
  432. #elif defined(SPINDLE_LASER_ENABLE)
  433. #error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE."
  434. #elif defined(SPINDLE_LASER_ENABLE_PIN)
  435. #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN."
  436. #elif defined(SPINDLE_DIR_CHANGE)
  437. #error "SPINDLE_DIR_CHANGE is now SPINDLE_CHANGE_DIR."
  438. #elif defined(SPINDLE_STOP_ON_DIR_CHANGE)
  439. #error "SPINDLE_STOP_ON_DIR_CHANGE is now SPINDLE_CHANGE_DIR_STOP."
  440. #elif defined(SPINDLE_LASER_ACTIVE_HIGH)
  441. #error "SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE."
  442. #elif defined(SPINDLE_LASER_ENABLE_INVERT)
  443. #error "SPINDLE_LASER_ENABLE_INVERT is now SPINDLE_LASER_ACTIVE_STATE."
  444. #elif defined(LASER_POWER_INLINE)
  445. #error "LASER_POWER_INLINE is not required, inline mode is enabled with 'M3 I' and disabled with 'M5 I'."
  446. #elif defined(LASER_POWER_INLINE_TRAPEZOID)
  447. #error "LASER_POWER_INLINE_TRAPEZOID is now LASER_POWER_TRAP."
  448. #elif defined(LASER_POWER_INLINE_TRAPEZOID_CONT)
  449. #error "LASER_POWER_INLINE_TRAPEZOID_CONT is replaced with LASER_POWER_TRAP."
  450. #elif defined(LASER_POWER_INLINE_TRAPEZOID_PER)
  451. #error "LASER_POWER_INLINE_TRAPEZOID_CONT_PER replaced with LASER_POWER_TRAP."
  452. #elif defined(LASER_POWER_INLINE_CONTINUOUS)
  453. #error "LASER_POWER_INLINE_CONTINUOUS is not required, inline mode is enabled with 'M3 I' and disabled with 'M5 I'."
  454. #elif defined(CUTTER_POWER_DISPLAY)
  455. #error "CUTTER_POWER_DISPLAY is now CUTTER_POWER_UNIT."
  456. #elif defined(CHAMBER_HEATER_PIN)
  457. #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN."
  458. #elif defined(TMC_Z_CALIBRATION)
  459. #error "TMC_Z_CALIBRATION has been deprecated in favor of MECHANICAL_GANTRY_CALIBRATION."
  460. #elif defined(Z_MIN_PROBE_ENDSTOP)
  461. #error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it."
  462. #elif defined(DUAL_NOZZLE_DUPLICATION_MODE)
  463. #error "DUAL_NOZZLE_DUPLICATION_MODE is now MULTI_NOZZLE_DUPLICATION."
  464. #elif defined(MENU_ITEM_CASE_LIGHT)
  465. #error "MENU_ITEM_CASE_LIGHT is now CASE_LIGHT_MENU."
  466. #elif defined(CASE_LIGHT_NEOPIXEL_COLOR)
  467. #error "CASE_LIGHT_NEOPIXEL_COLOR is now CASE_LIGHT_DEFAULT_COLOR."
  468. #elif defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
  469. #error "ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED is now SD_ABORT_ON_ENDSTOP_HIT."
  470. #elif defined(LPC_SD_LCD) || defined(LPC_SD_ONBOARD) || defined(LPC_SD_CUSTOM_CABLE)
  471. #error "LPC_SD_(LCD|ONBOARD|CUSTOM_CABLE) are now SDCARD_CONNECTION."
  472. #elif defined(USB_SD_DISABLED)
  473. #error "USB_SD_DISABLED is now NO_SD_HOST_DRIVE."
  474. #elif defined(USB_SD_ONBOARD)
  475. #error "USB_SD_ONBOARD is obsolete. Disable NO_SD_HOST_DRIVE instead."
  476. #elif defined(PSU_ACTIVE_HIGH)
  477. #error "PSU_ACTIVE_HIGH is now PSU_ACTIVE_STATE."
  478. #elif POWER_SUPPLY == 1
  479. #error "Replace POWER_SUPPLY 1 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'LOW'."
  480. #elif POWER_SUPPLY == 2
  481. #error "Replace POWER_SUPPLY 2 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'HIGH'."
  482. #elif defined(POWER_SUPPLY)
  483. #error "POWER_SUPPLY is now obsolete. Please remove it."
  484. #elif defined(MKS_ROBIN_TFT)
  485. #error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT."
  486. #elif defined(SDPOWER)
  487. #error "SDPOWER is now SDPOWER_PIN."
  488. #elif defined(STRING_SPLASH_LINE1) || defined(STRING_SPLASH_LINE2)
  489. #error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them."
  490. #elif defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_X)
  491. #error "Z_PROBE_ALLEN_KEY_(DEPLOY|STOW) coordinates are now a single setting."
  492. #elif defined(X_PROBE_OFFSET_FROM_EXTRUDER) || defined(Y_PROBE_OFFSET_FROM_EXTRUDER) || defined(Z_PROBE_OFFSET_FROM_EXTRUDER)
  493. #error "[XYZ]_PROBE_OFFSET_FROM_EXTRUDER is now NOZZLE_TO_PROBE_OFFSET."
  494. #elif defined(MIN_PROBE_X) || defined(MIN_PROBE_Y) || defined(MAX_PROBE_X) || defined(MAX_PROBE_Y)
  495. #error "(MIN|MAX)_PROBE_[XY] are now calculated at runtime. Please remove them."
  496. #elif defined(Z_STEPPER_ALIGN_X) || defined(Z_STEPPER_ALIGN_X)
  497. #error "Z_STEPPER_ALIGN_X and Z_STEPPER_ALIGN_Y are now combined as Z_STEPPER_ALIGN_XY."
  498. #elif defined(JUNCTION_DEVIATION)
  499. #error "JUNCTION_DEVIATION is no longer required. (See CLASSIC_JERK). Please remove it."
  500. #elif defined(BABYSTEP_MULTIPLICATOR)
  501. #error "BABYSTEP_MULTIPLICATOR is now BABYSTEP_MULTIPLICATOR_[XY|Z]."
  502. #elif defined(LULZBOT_TOUCH_UI)
  503. #error "LULZBOT_TOUCH_UI is now TOUCH_UI_FTDI_EVE."
  504. #elif defined(PS_DEFAULT_OFF)
  505. #error "PS_DEFAULT_OFF is now PSU_DEFAULT_OFF."
  506. #elif defined(FILAMENT_UNLOAD_RETRACT_LENGTH)
  507. #error "FILAMENT_UNLOAD_RETRACT_LENGTH is now FILAMENT_UNLOAD_PURGE_RETRACT."
  508. #elif defined(FILAMENT_UNLOAD_DELAY)
  509. #error "FILAMENT_UNLOAD_DELAY is now FILAMENT_UNLOAD_PURGE_DELAY."
  510. #elif defined(HOME_USING_SPREADCYCLE)
  511. #error "HOME_USING_SPREADCYCLE is now obsolete. Please remove it."
  512. #elif defined(DGUS_LCD)
  513. #error "DGUS_LCD is now DGUS_LCD_UI_(ORIGIN|FYSETC|HIPRECY)."
  514. #elif defined(DGUS_SERIAL_PORT)
  515. #error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT."
  516. #elif defined(DGUS_BAUDRATE)
  517. #error "DGUS_BAUDRATE is now LCD_BAUDRATE."
  518. #elif defined(DGUS_STATS_RX_BUFFER_OVERRUNS)
  519. #error "DGUS_STATS_RX_BUFFER_OVERRUNS is now STATS_RX_BUFFER_OVERRUNS."
  520. #elif defined(ANYCUBIC_LCD_SERIAL_PORT)
  521. #error "ANYCUBIC_LCD_SERIAL_PORT is now LCD_SERIAL_PORT."
  522. #elif defined(INTERNAL_SERIAL_PORT)
  523. #error "INTERNAL_SERIAL_PORT is now MMU2_SERIAL_PORT."
  524. #elif defined(X_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Y_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Z_DUAL_ENDSTOPS_ADJUSTMENT)
  525. #error "[XYZ]_DUAL_ENDSTOPS_ADJUSTMENT is now [XYZ]2_ENDSTOP_ADJUSTMENT."
  526. #elif defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT2) || defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT3)
  527. #error "Z_TRIPLE_ENDSTOPS_ADJUSTMENT[23] is now Z[23]_ENDSTOP_ADJUSTMENT."
  528. #elif defined(Z_QUAD_ENDSTOPS_ADJUSTMENT2) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT3) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT4)
  529. #error "Z_QUAD_ENDSTOPS_ADJUSTMENT[234] is now Z[234]_ENDSTOP_ADJUSTMENT."
  530. #elif defined(Z_DUAL_STEPPER_DRIVERS)
  531. #error "Z_DUAL_STEPPER_DRIVERS is no longer needed and should be removed."
  532. #elif defined(Z_TRIPLE_STEPPER_DRIVERS)
  533. #error "Z_TRIPLE_STEPPER_DRIVERS is no longer needed and should be removed."
  534. #elif defined(Z_QUAD_STEPPER_DRIVERS)
  535. #error "Z_QUAD_STEPPER_DRIVERS is no longer needed and should be removed."
  536. #elif defined(Z_DUAL_ENDSTOPS) || defined(Z_TRIPLE_ENDSTOPS) || defined(Z_QUAD_ENDSTOPS)
  537. #error "Z_(DUAL|TRIPLE|QUAD)_ENDSTOPS is now Z_MULTI_ENDSTOPS."
  538. #elif defined(DUGS_UI_MOVE_DIS_OPTION)
  539. #error "DUGS_UI_MOVE_DIS_OPTION is spelled DGUS_UI_MOVE_DIS_OPTION."
  540. #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)
  541. #error "ORIG_Ex_AUTO_FAN_PIN is now just Ex_AUTO_FAN_PIN."
  542. #elif defined(ORIG_CHAMBER_AUTO_FAN_PIN)
  543. #error "ORIG_CHAMBER_AUTO_FAN_PIN is now just CHAMBER_AUTO_FAN_PIN."
  544. #elif defined(HOMING_BACKOFF_MM)
  545. #error "HOMING_BACKOFF_MM is now HOMING_BACKOFF_POST_MM."
  546. #elif defined(X_HOME_BUMP_MM) || defined(Y_HOME_BUMP_MM) || defined(Z_HOME_BUMP_MM)
  547. #error "[XYZ]_HOME_BUMP_MM is now HOMING_BUMP_MM."
  548. #elif defined(DIGIPOT_I2C)
  549. #error "DIGIPOT_I2C is now DIGIPOT_MCP4451 (or DIGIPOT_MCP4018)."
  550. #elif defined(TOUCH_BUTTONS)
  551. #error "TOUCH_BUTTONS is now TOUCH_SCREEN."
  552. #elif defined(LCD_FULL_PIXEL_HEIGHT) || defined(LCD_FULL_PIXEL_WIDTH)
  553. #error "LCD_FULL_PIXEL_(WIDTH|HEIGHT) is deprecated and should be removed."
  554. #elif defined(FSMC_UPSCALE)
  555. #error "FSMC_UPSCALE is now GRAPHICAL_TFT_UPSCALE."
  556. #elif defined(ANYCUBIC_TFT_MODEL)
  557. #error "ANYCUBIC_TFT_MODEL is now ANYCUBIC_LCD_I3MEGA."
  558. #elif defined(EVENT_GCODE_SD_STOP)
  559. #error "EVENT_GCODE_SD_STOP is now EVENT_GCODE_SD_ABORT."
  560. #elif defined(GRAPHICAL_TFT_ROTATE_180)
  561. #error "GRAPHICAL_TFT_ROTATE_180 is now TFT_ROTATION set to TFT_ROTATE_180."
  562. #elif defined(PROBE_OFFSET_START)
  563. #error "PROBE_OFFSET_START is now PROBE_OFFSET_WIZARD_START_Z."
  564. #elif defined(POWER_LOSS_PULL)
  565. #error "POWER_LOSS_PULL is now specifically POWER_LOSS_PULL(UP|DOWN)."
  566. #elif defined(SHORT_MANUAL_Z_MOVE)
  567. #error "SHORT_MANUAL_Z_MOVE is now FINE_MANUAL_MOVE, applying to Z on most printers."
  568. #elif defined(FIL_RUNOUT_INVERTING)
  569. #if FIL_RUNOUT_INVERTING
  570. #error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH."
  571. #else
  572. #error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_STATE LOW."
  573. #endif
  574. #elif defined(ASSISTED_TRAMMING_MENU_ITEM)
  575. #error "ASSISTED_TRAMMING_MENU_ITEM is deprecated and should be removed."
  576. #elif defined(UNKNOWN_Z_NO_RAISE)
  577. #error "UNKNOWN_Z_NO_RAISE is replaced by setting Z_IDLE_HEIGHT to Z_MAX_POS."
  578. #elif defined(Z_AFTER_DEACTIVATE)
  579. #error "Z_AFTER_DEACTIVATE is replaced by Z_IDLE_HEIGHT."
  580. #elif defined(MEATPACK)
  581. #error "MEATPACK is now enabled with MEATPACK_ON_SERIAL_PORT_1, MEATPACK_ON_SERIAL_PORT_2, etc."
  582. #elif defined(CUSTOM_USER_MENUS)
  583. #error "CUSTOM_USER_MENUS has been replaced by CUSTOM_MENU_MAIN and CUSTOM_MENU_CONFIG."
  584. #elif defined(MKS_LCD12864)
  585. #error "MKS_LCD12864 is now MKS_LCD12864A or MKS_LCD12864B."
  586. #elif defined(DOGM_SD_PERCENT)
  587. #error "DOGM_SD_PERCENT is now SHOW_SD_PERCENT."
  588. #elif defined(NEOPIXEL_BKGD_LED_INDEX)
  589. #error "NEOPIXEL_BKGD_LED_INDEX is now NEOPIXEL_BKGD_INDEX_FIRST."
  590. #elif defined(TEMP_SENSOR_1_AS_REDUNDANT)
  591. #error "TEMP_SENSOR_1_AS_REDUNDANT is now TEMP_SENSOR_REDUNDANT, with associated TEMP_SENSOR_REDUNDANT_* config."
  592. #elif defined(MAX_REDUNDANT_TEMP_SENSOR_DIFF)
  593. #error "MAX_REDUNDANT_TEMP_SENSOR_DIFF is now TEMP_SENSOR_REDUNDANT_MAX_DIFF"
  594. #elif defined(LCD_ALEPHOBJECTS_CLCD_UI)
  595. #error "LCD_ALEPHOBJECTS_CLCD_UI is now LCD_LULZBOT_CLCD_UI."
  596. #elif defined(MIN_ARC_SEGMENTS)
  597. #error "MIN_ARC_SEGMENTS is now MIN_CIRCLE_SEGMENTS."
  598. #elif defined(ARC_SEGMENTS_PER_R)
  599. #error "ARC_SUPPORT no longer uses ARC_SEGMENTS_PER_R."
  600. #elif ENABLED(ARC_SUPPORT) && (!defined(MIN_ARC_SEGMENT_MM) || !defined(MAX_ARC_SEGMENT_MM))
  601. #error "ARC_SUPPORT now requires MIN_ARC_SEGMENT_MM and MAX_ARC_SEGMENT_MM."
  602. #elif defined(LASER_POWER_INLINE)
  603. #error "LASER_POWER_INLINE is obsolete."
  604. #elif defined(SPINDLE_LASER_PWM)
  605. #error "SPINDLE_LASER_PWM (true) is now set with SPINDLE_LASER_USE_PWM (enabled)."
  606. #elif ANY(IS_RAMPS_EEB, IS_RAMPS_EEF, IS_RAMPS_EFB, IS_RAMPS_EFF, IS_RAMPS_SF)
  607. #error "The IS_RAMPS_* conditionals (for heater/fan/bed pins) are now called FET_ORDER_*."
  608. #elif defined(PROBE_TEMP_COMPENSATION)
  609. #error "PROBE_TEMP_COMPENSATION is now set using the PTC_PROBE, PTC_BED, PTC_HOTEND options."
  610. #elif defined(BTC_PROBE_TEMP)
  611. #error "BTC_PROBE_TEMP is now PTC_PROBE_TEMP."
  612. #elif defined(LCD_SCREEN_ROT_90)
  613. #error "LCD_SCREEN_ROT_90 is now LCD_SCREEN_ROTATE with a value of 90."
  614. #elif defined(LCD_SCREEN_ROT_180)
  615. #error "LCD_SCREEN_ROT_180 is now LCD_SCREEN_ROTATE with a value of 180."
  616. #elif defined(LCD_SCREEN_ROT_270)
  617. #error "LCD_SCREEN_ROT_270 is now LCD_SCREEN_ROTATE with a value of 270."
  618. #elif defined(DEFAULT_LCD_BRIGHTNESS)
  619. #error "DEFAULT_LCD_BRIGHTNESS is now LCD_BRIGHTNESS_DEFAULT."
  620. #elif defined(NOZZLE_PARK_X_ONLY)
  621. #error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 1."
  622. #elif defined(NOZZLE_PARK_Y_ONLY)
  623. #error "NOZZLE_PARK_Y_ONLY is now NOZZLE_PARK_MOVE 2."
  624. #elif defined(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
  625. #error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS is now just Z_STEPPER_ALIGN_STEPPER_XY."
  626. #elif defined(DWIN_CREALITY_LCD_ENHANCED)
  627. #error "DWIN_CREALITY_LCD_ENHANCED is now DWIN_LCD_PROUI."
  628. #elif defined(LINEAR_AXES)
  629. #error "LINEAR_AXES is now NUM_AXES (to account for rotational axes)."
  630. #elif defined(X_DUAL_STEPPER_DRIVERS)
  631. #error "X_DUAL_STEPPER_DRIVERS is no longer needed and should be removed."
  632. #elif defined(Y_DUAL_STEPPER_DRIVERS)
  633. #error "Y_DUAL_STEPPER_DRIVERS is no longer needed and should be removed."
  634. #elif defined(NUM_Z_STEPPER_DRIVERS)
  635. #error "NUM_Z_STEPPER_DRIVERS is no longer needed and should be removed."
  636. #elif defined(LEVEL_BED_CORNERS)
  637. #error "LEVEL_BED_CORNERS is now LCD_BED_TRAMMING."
  638. #elif defined(LEVEL_CORNERS_INSET_LFRB) || defined(LEVEL_CORNERS_HEIGHT) || defined(LEVEL_CORNERS_Z_HOP) || defined(LEVEL_CORNERS_USE_PROBE) || defined(LEVEL_CORNERS_PROBE_TOLERANCE) || defined(LEVEL_CORNERS_VERIFY_RAISED) || defined(LEVEL_CORNERS_AUDIO_FEEDBACK)
  639. #error "LEVEL_CORNERS_* settings have been renamed BED_TRAMMING_*."
  640. #elif defined(LEVEL_CENTER_TOO)
  641. #error "LEVEL_CENTER_TOO is now BED_TRAMMING_INCLUDE_CENTER."
  642. #endif
  643. constexpr float arm[] = AXIS_RELATIVE_MODES;
  644. static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements.");
  645. /**
  646. * Probe temp compensation requirements
  647. */
  648. #if HAS_PTC
  649. #if TEMP_SENSOR_PROBE && TEMP_SENSOR_BED
  650. #if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
  651. #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
  652. #elif !defined(PTC_PARK_POS)
  653. #error "PTC_PARK_POS is required for Probe Temperature Compensation."
  654. #elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y)
  655. #error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)."
  656. #elif !defined(PTC_PROBE_POS)
  657. #error "PTC_PROBE_POS is required for Probe Temperature Compensation."
  658. #endif
  659. #endif
  660. #ifdef PTC_PROBE_START
  661. constexpr auto _ptc_sample_start = PTC_PROBE_START;
  662. constexpr decltype(_ptc_sample_start) _test_ptc_sample_start = 12.3f;
  663. static_assert(_test_ptc_sample_start != 12.3f, "PTC_PROBE_START must be a whole number.");
  664. #endif
  665. #ifdef PTC_PROBE_RES
  666. constexpr auto _ptc_sample_res = PTC_PROBE_RES;
  667. constexpr decltype(_ptc_sample_res) _test_ptc_sample_res = 12.3f;
  668. static_assert(_test_ptc_sample_res != 12.3f, "PTC_PROBE_RES must be a whole number.");
  669. #endif
  670. #ifdef PTC_BED_START
  671. constexpr auto _btc_sample_start = PTC_BED_START;
  672. constexpr decltype(_btc_sample_start) _test_btc_sample_start = 12.3f;
  673. static_assert(_test_btc_sample_start != 12.3f, "PTC_BED_START must be a whole number.");
  674. #endif
  675. #ifdef PTC_BED_RES
  676. constexpr auto _btc_sample_res = PTC_BED_RES;
  677. constexpr decltype(_btc_sample_res) _test_btc_sample_res = 12.3f;
  678. static_assert(_test_btc_sample_res != 12.3f, "PTC_BED_RES must be a whole number.");
  679. #endif
  680. #ifdef PTC_PROBE_TEMP
  681. constexpr auto _btc_probe_temp = PTC_PROBE_TEMP;
  682. constexpr decltype(_btc_probe_temp) _test_btc_probe_temp = 12.3f;
  683. static_assert(_test_btc_probe_temp != 12.3f, "PTC_PROBE_TEMP must be a whole number.");
  684. #endif
  685. #if ENABLED(PTC_HOTEND)
  686. #if EXTRUDERS != 1
  687. #error "PTC_HOTEND only works with a single extruder."
  688. #endif
  689. #ifdef PTC_HOTEND_START
  690. constexpr auto _etc_sample_start = PTC_HOTEND_START;
  691. constexpr decltype(_etc_sample_start) _test_etc_sample_start = 12.3f;
  692. static_assert(_test_etc_sample_start != 12.3f, "PTC_HOTEND_START must be a whole number.");
  693. #endif
  694. #ifdef PTC_HOTEND_RES
  695. constexpr auto _etc_sample_res = PTC_HOTEND_RES;
  696. constexpr decltype(_etc_sample_res) _test_etc_sample_res = 12.3f;
  697. static_assert(_test_etc_sample_res != 12.3f, "PTC_HOTEND_RES must be a whole number.");
  698. #endif
  699. #endif
  700. #endif // HAS_PTC
  701. /**
  702. * Marlin release, version and default string
  703. */
  704. #ifndef SHORT_BUILD_VERSION
  705. #error "SHORT_BUILD_VERSION must be specified."
  706. #elif !defined(DETAILED_BUILD_VERSION)
  707. #error "BUILD_VERSION must be specified."
  708. #elif !defined(STRING_DISTRIBUTION_DATE)
  709. #error "STRING_DISTRIBUTION_DATE must be specified."
  710. #elif !defined(PROTOCOL_VERSION)
  711. #error "PROTOCOL_VERSION must be specified."
  712. #elif !defined(MACHINE_NAME)
  713. #error "MACHINE_NAME must be specified."
  714. #elif !defined(SOURCE_CODE_URL)
  715. #error "SOURCE_CODE_URL must be specified."
  716. #elif !defined(DEFAULT_MACHINE_UUID)
  717. #error "DEFAULT_MACHINE_UUID must be specified."
  718. #elif !defined(WEBSITE_URL)
  719. #error "WEBSITE_URL must be specified."
  720. #endif
  721. /**
  722. * Serial
  723. */
  724. #ifndef SERIAL_PORT
  725. #error "SERIAL_PORT must be defined."
  726. #elif defined(SERIAL_PORT_2) && SERIAL_PORT_2 == SERIAL_PORT
  727. #error "SERIAL_PORT_2 cannot be the same as SERIAL_PORT."
  728. #elif defined(SERIAL_PORT_3)
  729. #ifndef SERIAL_PORT_2
  730. #error "Use SERIAL_PORT_2 before using SERIAL_PORT_3"
  731. #elif SERIAL_PORT_3 == SERIAL_PORT
  732. #error "SERIAL_PORT_3 cannot be the same as SERIAL_PORT."
  733. #elif SERIAL_PORT_3 == SERIAL_PORT_2
  734. #error "SERIAL_PORT_3 cannot be the same as SERIAL_PORT_2."
  735. #endif
  736. #endif
  737. #if !(defined(__AVR__) && defined(USBCON))
  738. #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
  739. #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
  740. #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
  741. #error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
  742. #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
  743. #error "TX_BUFFER_SIZE must be 0 or a power of 2 between 1 and 256."
  744. #endif
  745. #elif ANY(SERIAL_XON_XOFF, SERIAL_STATS_MAX_RX_QUEUED, SERIAL_STATS_DROPPED_RX)
  746. #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
  747. #endif
  748. /**
  749. * Multiple Stepper Drivers Per Axis
  750. */
  751. #define GOOD_AXIS_PINS(A) (HAS_##A##_ENABLE && HAS_##A##_STEP && HAS_##A##_DIR)
  752. #if HAS_X2_STEPPER && !GOOD_AXIS_PINS(X)
  753. #error "If X2_DRIVER_TYPE is defined, then X2 ENABLE/STEP/DIR pins are also needed."
  754. #endif
  755. #if HAS_DUAL_Y_STEPPERS && !GOOD_AXIS_PINS(Y)
  756. #error "If Y2_DRIVER_TYPE is defined, then Y2 ENABLE/STEP/DIR pins are also needed."
  757. #endif
  758. #if HAS_Z_AXIS
  759. #if NUM_Z_STEPPERS >= 2 && !GOOD_AXIS_PINS(Z2)
  760. #error "If Z2_DRIVER_TYPE is defined, then Z2 ENABLE/STEP/DIR pins are also needed."
  761. #elif NUM_Z_STEPPERS >= 3 && !GOOD_AXIS_PINS(Z3)
  762. #error "If Z3_DRIVER_TYPE is defined, then Z3 ENABLE/STEP/DIR pins are also needed."
  763. #elif NUM_Z_STEPPERS >= 4 && !GOOD_AXIS_PINS(Z4)
  764. #error "If Z4_DRIVER_TYPE is defined, then Z4 ENABLE/STEP/DIR pins are also needed."
  765. #endif
  766. #endif
  767. /**
  768. * Validate that the bed size fits
  769. */
  770. static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE.");
  771. static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE.");
  772. /**
  773. * Granular software endstops (Marlin >= 1.1.7)
  774. */
  775. #if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z)
  776. #if IS_KINEMATIC
  777. #error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z."
  778. #elif NONE(MIN_SOFTWARE_ENDSTOP_X, MIN_SOFTWARE_ENDSTOP_Y)
  779. #error "MIN_SOFTWARE_ENDSTOPS requires at least one of the MIN_SOFTWARE_ENDSTOP_[XYZ] options."
  780. #endif
  781. #endif
  782. #if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z)
  783. #if IS_KINEMATIC
  784. #error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z."
  785. #elif NONE(MAX_SOFTWARE_ENDSTOP_X, MAX_SOFTWARE_ENDSTOP_Y)
  786. #error "MAX_SOFTWARE_ENDSTOPS requires at least one of the MAX_SOFTWARE_ENDSTOP_[XYZ] options."
  787. #endif
  788. #endif
  789. #if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS)
  790. #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS."
  791. #elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN)
  792. #error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN."
  793. #elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX)
  794. #error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX."
  795. #elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX)
  796. #error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
  797. #elif BOTH(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX)
  798. #error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
  799. #elif BOTH(ENDSTOPPULLUP_IMAX, ENDSTOPPULLDOWN_IMAX)
  800. #error "Enable only one of ENDSTOPPULLUP_I_MAX or ENDSTOPPULLDOWN_I_MAX."
  801. #elif BOTH(ENDSTOPPULLUP_JMAX, ENDSTOPPULLDOWN_JMAX)
  802. #error "Enable only one of ENDSTOPPULLUP_J_MAX or ENDSTOPPULLDOWN_J_MAX."
  803. #elif BOTH(ENDSTOPPULLUP_KMAX, ENDSTOPPULLDOWN_KMAX)
  804. #error "Enable only one of ENDSTOPPULLUP_K_MAX or ENDSTOPPULLDOWN_K_MAX."
  805. #elif BOTH(ENDSTOPPULLUP_UMAX, ENDSTOPPULLDOWN_UMAX)
  806. #error "Enable only one of ENDSTOPPULLUP_U_MAX or ENDSTOPPULLDOWN_U_MAX."
  807. #elif BOTH(ENDSTOPPULLUP_VMAX, ENDSTOPPULLDOWN_VMAX)
  808. #error "Enable only one of ENDSTOPPULLUP_V_MAX or ENDSTOPPULLDOWN_V_MAX."
  809. #elif BOTH(ENDSTOPPULLUP_WMAX, ENDSTOPPULLDOWN_WMAX)
  810. #error "Enable only one of ENDSTOPPULLUP_W_MAX or ENDSTOPPULLDOWN_W_MAX."
  811. #elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN)
  812. #error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
  813. #elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN)
  814. #error "Enable only one of ENDSTOPPULLUP_Y_MIN or ENDSTOPPULLDOWN_Y_MIN."
  815. #elif BOTH(ENDSTOPPULLUP_ZMIN, ENDSTOPPULLDOWN_ZMIN)
  816. #error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN."
  817. #elif BOTH(ENDSTOPPULLUP_IMIN, ENDSTOPPULLDOWN_IMIN)
  818. #error "Enable only one of ENDSTOPPULLUP_I_MIN or ENDSTOPPULLDOWN_I_MIN."
  819. #elif BOTH(ENDSTOPPULLUP_JMIN, ENDSTOPPULLDOWN_JMIN)
  820. #error "Enable only one of ENDSTOPPULLUP_J_MIN or ENDSTOPPULLDOWN_J_MIN."
  821. #elif BOTH(ENDSTOPPULLUP_KMIN, ENDSTOPPULLDOWN_KMIN)
  822. #error "Enable only one of ENDSTOPPULLUP_K_MIN or ENDSTOPPULLDOWN_K_MIN."
  823. #elif BOTH(ENDSTOPPULLUP_UMIN, ENDSTOPPULLDOWN_UMIN)
  824. #error "Enable only one of ENDSTOPPULLUP_U_MIN or ENDSTOPPULLDOWN_U_MIN."
  825. #elif BOTH(ENDSTOPPULLUP_VMIN, ENDSTOPPULLDOWN_VMIN)
  826. #error "Enable only one of ENDSTOPPULLUP_V_MIN or ENDSTOPPULLDOWN_V_MIN."
  827. #elif BOTH(ENDSTOPPULLUP_WMIN, ENDSTOPPULLDOWN_WMIN)
  828. #error "Enable only one of ENDSTOPPULLUP_W_MIN or ENDSTOPPULLDOWN_W_MIN."
  829. #endif
  830. /**
  831. * LCD Info Screen Style
  832. */
  833. #if LCD_INFO_SCREEN_STYLE > 0
  834. #if HAS_MARLINUI_U8GLIB || LCD_WIDTH < 20 || LCD_HEIGHT < 4
  835. #error "Alternative LCD_INFO_SCREEN_STYLE requires 20x4 Character LCD."
  836. #elif LCD_INFO_SCREEN_STYLE > 1
  837. #error "LCD_INFO_SCREEN_STYLE only has options 0 and 1 at this time."
  838. #endif
  839. #endif
  840. /**
  841. * Progress Bar
  842. */
  843. #if ENABLED(LCD_PROGRESS_BAR)
  844. #if NONE(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
  845. #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY."
  846. #elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
  847. #error "LCD_PROGRESS_BAR only applies to HD44780 character LCD and TFTGLCD_PANEL_(SPI|I2C)."
  848. #elif HAS_MARLINUI_U8GLIB || IS_DWIN_MARLINUI
  849. #error "LCD_PROGRESS_BAR does not apply to graphical displays."
  850. #elif ENABLED(FILAMENT_LCD_DISPLAY)
  851. #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both."
  852. #elif PROGRESS_MSG_EXPIRE < 0
  853. #error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
  854. #endif
  855. #elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && NONE(HAS_MARLINUI_U8GLIB, HAS_GRAPHICAL_TFT, HAS_MARLINUI_HD44780, EXTENSIBLE_UI, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
  856. #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Character LCD, Graphical LCD, TFT, DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_*, OR EXTENSIBLE_UI."
  857. #endif
  858. #if ENABLED(USE_M73_REMAINING_TIME) && DISABLED(LCD_SET_PROGRESS_MANUALLY)
  859. #error "USE_M73_REMAINING_TIME requires LCD_SET_PROGRESS_MANUALLY"
  860. #endif
  861. #if !HAS_MARLINUI_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
  862. #error "SD_REPRINT_LAST_SELECTED_FILE currently requires a Marlin-native LCD menu."
  863. #endif
  864. /**
  865. * Custom Boot and Status screens
  866. */
  867. #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE, IS_DWIN_MARLINUI)
  868. #error "SHOW_CUSTOM_BOOTSCREEN requires Graphical LCD or TOUCH_UI_FTDI_EVE."
  869. #elif ENABLED(SHOW_CUSTOM_BOOTSCREEN) && DISABLED(SHOW_BOOTSCREEN)
  870. #error "SHOW_CUSTOM_BOOTSCREEN requires SHOW_BOOTSCREEN."
  871. #elif ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && !HAS_MARLINUI_U8GLIB
  872. #error "CUSTOM_STATUS_SCREEN_IMAGE requires a 128x64 DOGM B/W Graphical LCD."
  873. #endif
  874. /**
  875. * LCD Lightweight Screen Style
  876. */
  877. #if ENABLED(LIGHTWEIGHT_UI) && !IS_U8GLIB_ST7920
  878. #error "LIGHTWEIGHT_UI requires a U8GLIB_ST7920-based display."
  879. #endif
  880. /**
  881. * SD Card Settings
  882. */
  883. #if ALL(SDSUPPORT, HAS_SD_DETECT, SD_CONNECTION_TYPICAL, ELB_FULL_GRAPHIC_CONTROLLER, HAS_MARLINUI_MENU) && SD_DETECT_STATE == LOW
  884. #error "SD_DETECT_STATE must be set HIGH for SD on the ELB_FULL_GRAPHIC_CONTROLLER."
  885. #endif
  886. #undef SD_CONNECTION_TYPICAL
  887. /**
  888. * SD File Sorting
  889. */
  890. #if ENABLED(SDCARD_SORT_ALPHA)
  891. #if SDSORT_LIMIT > 256
  892. #error "SDSORT_LIMIT must be 256 or smaller."
  893. #elif SDSORT_LIMIT < 10
  894. #error "SDSORT_LIMIT should be greater than 9 to be useful."
  895. #elif DISABLED(SDSORT_USES_RAM)
  896. #if ENABLED(SDSORT_DYNAMIC_RAM)
  897. #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)."
  898. #elif ENABLED(SDSORT_CACHE_NAMES)
  899. #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)."
  900. #endif
  901. #endif
  902. #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
  903. #if SDSORT_CACHE_VFATS < 2
  904. #error "SDSORT_CACHE_VFATS must be 2 or greater!"
  905. #elif SDSORT_CACHE_VFATS > MAX_VFAT_ENTRIES
  906. #undef SDSORT_CACHE_VFATS
  907. #define SDSORT_CACHE_VFATS MAX_VFAT_ENTRIES
  908. #warning "SDSORT_CACHE_VFATS was reduced to MAX_VFAT_ENTRIES!"
  909. #endif
  910. #endif
  911. #endif
  912. #if defined(EVENT_GCODE_SD_ABORT) && DISABLED(NOZZLE_PARK_FEATURE)
  913. static_assert(nullptr == strstr(EVENT_GCODE_SD_ABORT, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_ABORT.");
  914. #endif
  915. /**
  916. * I2C Position Encoders
  917. */
  918. #if ENABLED(I2C_POSITION_ENCODERS)
  919. #if !BOTH(BABYSTEPPING, BABYSTEP_XY)
  920. #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY."
  921. #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5)
  922. #error "I2CPE_ENCODER_CNT must be between 1 and 5."
  923. #endif
  924. #endif
  925. /**
  926. * Babystepping
  927. */
  928. #if ENABLED(BABYSTEPPING)
  929. #if ENABLED(SCARA)
  930. #error "BABYSTEPPING is not implemented for SCARA yet."
  931. #elif ENABLED(BABYSTEP_XY) && EITHER(MARKFORGED_XY, MARKFORGED_YX)
  932. #error "BABYSTEPPING only implemented for Z axis on MarkForged."
  933. #elif BOTH(DELTA, BABYSTEP_XY)
  934. #error "BABYSTEPPING only implemented for Z axis on deltabots."
  935. #elif BOTH(BABYSTEP_ZPROBE_OFFSET, MESH_BED_LEVELING)
  936. #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
  937. #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
  938. #error "BABYSTEP_ZPROBE_OFFSET requires a probe."
  939. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI)
  940. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD."
  941. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
  942. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
  943. #elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET
  944. #error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS."
  945. #elif BOTH(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE)
  946. #error "BABYSTEP_ALWAYS_AVAILABLE and MOVE_Z_WHEN_IDLE are incompatible."
  947. #elif !defined(BABYSTEP_MULTIPLICATOR_Z)
  948. #error "BABYSTEPPING requires BABYSTEP_MULTIPLICATOR_Z."
  949. #elif ENABLED(BABYSTEP_XY) && !defined(BABYSTEP_MULTIPLICATOR_XY)
  950. #error "BABYSTEP_XY requires BABYSTEP_MULTIPLICATOR_XY."
  951. #elif ENABLED(BABYSTEP_MILLIMETER_UNITS)
  952. static_assert(BABYSTEP_MULTIPLICATOR_Z <= 0.1f, "BABYSTEP_MULTIPLICATOR_Z must be less or equal to 0.1mm.");
  953. #if ENABLED(BABYSTEP_XY)
  954. static_assert(BABYSTEP_MULTIPLICATOR_XY <= 0.25f, "BABYSTEP_MULTIPLICATOR_XY must be less than or equal to 0.25mm.");
  955. #endif
  956. #endif
  957. #endif
  958. /**
  959. * Filament Runout needs one or more pins and either SD Support or Auto print start detection
  960. */
  961. #if HAS_FILAMENT_SENSOR
  962. #if !PIN_EXISTS(FIL_RUNOUT)
  963. #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
  964. #elif HAS_PRUSA_MMU2 && NUM_RUNOUT_SENSORS != 1
  965. #error "NUM_RUNOUT_SENSORS must be 1 with MMU2 / MMU2S."
  966. #elif NUM_RUNOUT_SENSORS != 1 && NUM_RUNOUT_SENSORS != E_STEPPERS
  967. #error "NUM_RUNOUT_SENSORS must be either 1 or number of E steppers."
  968. #elif NUM_RUNOUT_SENSORS >= 8 && !PIN_EXISTS(FIL_RUNOUT8)
  969. #error "FIL_RUNOUT8_PIN is required with NUM_RUNOUT_SENSORS >= 8."
  970. #elif NUM_RUNOUT_SENSORS >= 7 && !PIN_EXISTS(FIL_RUNOUT7)
  971. #error "FIL_RUNOUT7_PIN is required with NUM_RUNOUT_SENSORS >= 7."
  972. #elif NUM_RUNOUT_SENSORS >= 6 && !PIN_EXISTS(FIL_RUNOUT6)
  973. #error "FIL_RUNOUT6_PIN is required with NUM_RUNOUT_SENSORS >= 6."
  974. #elif NUM_RUNOUT_SENSORS >= 5 && !PIN_EXISTS(FIL_RUNOUT5)
  975. #error "FIL_RUNOUT5_PIN is required with NUM_RUNOUT_SENSORS >= 5."
  976. #elif NUM_RUNOUT_SENSORS >= 4 && !PIN_EXISTS(FIL_RUNOUT4)
  977. #error "FIL_RUNOUT4_PIN is required with NUM_RUNOUT_SENSORS >= 4."
  978. #elif NUM_RUNOUT_SENSORS >= 3 && !PIN_EXISTS(FIL_RUNOUT3)
  979. #error "FIL_RUNOUT3_PIN is required with NUM_RUNOUT_SENSORS >= 3."
  980. #elif NUM_RUNOUT_SENSORS >= 2 && !PIN_EXISTS(FIL_RUNOUT2)
  981. #error "FIL_RUNOUT2_PIN is required with NUM_RUNOUT_SENSORS >= 2."
  982. #elif BOTH(FIL_RUNOUT1_PULLUP, FIL_RUNOUT1_PULLDOWN)
  983. #error "You can't enable FIL_RUNOUT1_PULLUP and FIL_RUNOUT1_PULLDOWN at the same time."
  984. #elif BOTH(FIL_RUNOUT2_PULLUP, FIL_RUNOUT2_PULLDOWN)
  985. #error "You can't enable FIL_RUNOUT2_PULLUP and FIL_RUNOUT2_PULLDOWN at the same time."
  986. #elif BOTH(FIL_RUNOUT3_PULLUP, FIL_RUNOUT3_PULLDOWN)
  987. #error "You can't enable FIL_RUNOUT3_PULLUP and FIL_RUNOUT3_PULLDOWN at the same time."
  988. #elif BOTH(FIL_RUNOUT4_PULLUP, FIL_RUNOUT4_PULLDOWN)
  989. #error "You can't enable FIL_RUNOUT4_PULLUP and FIL_RUNOUT4_PULLDOWN at the same time."
  990. #elif BOTH(FIL_RUNOUT5_PULLUP, FIL_RUNOUT5_PULLDOWN)
  991. #error "You can't enable FIL_RUNOUT5_PULLUP and FIL_RUNOUT5_PULLDOWN at the same time."
  992. #elif BOTH(FIL_RUNOUT6_PULLUP, FIL_RUNOUT6_PULLDOWN)
  993. #error "You can't enable FIL_RUNOUT6_PULLUP and FIL_RUNOUT6_PULLDOWN at the same time."
  994. #elif BOTH(FIL_RUNOUT7_PULLUP, FIL_RUNOUT7_PULLDOWN)
  995. #error "You can't enable FIL_RUNOUT7_PULLUP and FIL_RUNOUT7_PULLDOWN at the same time."
  996. #elif BOTH(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN)
  997. #error "You can't enable FIL_RUNOUT8_PULLUP and FIL_RUNOUT8_PULLDOWN at the same time."
  998. #elif FILAMENT_RUNOUT_DISTANCE_MM < 0
  999. #error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero."
  1000. #elif DISABLED(ADVANCED_PAUSE_FEATURE)
  1001. static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
  1002. #endif
  1003. #endif
  1004. /**
  1005. * Advanced Pause
  1006. */
  1007. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  1008. #if !HAS_RESUME_CONTINUE
  1009. #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
  1010. #elif DISABLED(NOZZLE_PARK_FEATURE)
  1011. #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE."
  1012. #elif !defined(FILAMENT_UNLOAD_PURGE_FEEDRATE)
  1013. #error "ADVANCED_PAUSE_FEATURE requires FILAMENT_UNLOAD_PURGE_FEEDRATE."
  1014. #elif ENABLED(EXTRUDER_RUNOUT_PREVENT)
  1015. #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
  1016. #elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(SDSUPPORT, IS_NEWPANEL, EMERGENCY_PARSER)
  1017. #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller."
  1018. #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
  1019. #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT."
  1020. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH
  1021. #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  1022. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH
  1023. #error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  1024. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH
  1025. #error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  1026. #endif
  1027. #endif
  1028. #if ENABLED(NOZZLE_PARK_FEATURE)
  1029. constexpr float npp[] = NOZZLE_PARK_POINT;
  1030. static_assert(COUNT(npp) == XYZ, "NOZZLE_PARK_POINT requires X, Y, and Z values.");
  1031. constexpr xyz_pos_t npp_xyz = NOZZLE_PARK_POINT;
  1032. 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).");
  1033. 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).");
  1034. 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).");
  1035. #endif
  1036. /**
  1037. * Instant Freeze
  1038. */
  1039. #if ENABLED(FREEZE_FEATURE) && !(PIN_EXISTS(FREEZE) && defined(FREEZE_STATE))
  1040. #error "FREEZE_FEATURE requires both FREEZE_PIN and FREEZE_STATE."
  1041. #endif
  1042. /**
  1043. * Individual axis homing is useless for DELTAS
  1044. */
  1045. #if BOTH(INDIVIDUAL_AXIS_HOMING_MENU, DELTA)
  1046. #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
  1047. #endif
  1048. /**
  1049. * Sanity checking for all Průša MMU
  1050. */
  1051. #ifdef SNMM
  1052. #error "SNMM is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
  1053. #elif ENABLED(MK2_MULTIPLEXER)
  1054. #error "MK2_MULTIPLEXER is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
  1055. #elif ENABLED(PRUSA_MMU2)
  1056. #error "PRUSA_MMU2 is obsolete. Define MMU_MODEL as PRUSA_MMU2 instead."
  1057. #elif ENABLED(PRUSA_MMU2_S_MODE)
  1058. #error "PRUSA_MMU2_S_MODE is obsolete. Define MMU_MODEL as PRUSA_MMU2S instead."
  1059. #elif ENABLED(SMUFF_EMU_MMU2)
  1060. #error "SMUFF_EMU_MMU2 is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2 instead."
  1061. #elif ENABLED(SMUFF_EMU_MMU2S)
  1062. #error "SMUFF_EMU_MMU2S is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2S instead."
  1063. #endif
  1064. /**
  1065. * Multi-Material-Unit 2 / EXTENDABLE_EMU_MMU2 requirements
  1066. */
  1067. #if HAS_PRUSA_MMU2
  1068. #if !HAS_EXTENDABLE_MMU && EXTRUDERS != 5
  1069. #undef SINGLENOZZLE
  1070. #error "PRUSA_MMU2(S) requires exactly 5 EXTRUDERS. Please update your Configuration."
  1071. #elif HAS_EXTENDABLE_MMU && EXTRUDERS > 15
  1072. #error "EXTRUDERS is too large for MMU(S) emulation mode. The maximum value is 15."
  1073. #elif DISABLED(NOZZLE_PARK_FEATURE)
  1074. #error "PRUSA_MMU2(S) requires NOZZLE_PARK_FEATURE. Enable it to continue."
  1075. #elif HAS_PRUSA_MMU2S && DISABLED(FILAMENT_RUNOUT_SENSOR)
  1076. #error "PRUSA_MMU2S requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
  1077. #elif ENABLED(MMU_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR)
  1078. #error "MMU_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
  1079. #elif ENABLED(MMU_EXTRUDER_SENSOR) && !HAS_MARLINUI_MENU
  1080. #error "MMU_EXTRUDER_SENSOR requires an LCD supporting MarlinUI."
  1081. #elif ENABLED(MMU2_MENUS) && !HAS_MARLINUI_MENU
  1082. #error "MMU2_MENUS requires an LCD supporting MarlinUI."
  1083. #elif DISABLED(ADVANCED_PAUSE_FEATURE)
  1084. static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2(S) / HAS_EXTENDABLE_MMU(S).");
  1085. #endif
  1086. #endif
  1087. /**
  1088. * Options only for EXTRUDERS > 1
  1089. */
  1090. #if HAS_MULTI_EXTRUDER
  1091. #if HAS_EXTENDABLE_MMU
  1092. #define MAX_EXTRUDERS 15
  1093. #else
  1094. #define MAX_EXTRUDERS 8
  1095. #endif
  1096. static_assert(EXTRUDERS <= MAX_EXTRUDERS, "Marlin supports a maximum of " STRINGIFY(MAX_EXTRUDERS) " EXTRUDERS.");
  1097. #undef MAX_EXTRUDERS
  1098. #if ENABLED(HEATERS_PARALLEL)
  1099. #error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
  1100. #endif
  1101. #if ENABLED(STATUS_HOTEND_INVERTED) && NONE(STATUS_HOTEND_NUMBERLESS, STATUS_HOTEND_ANIM)
  1102. #error "With multiple hotends STATUS_HOTEND_INVERTED requires STATUS_HOTEND_ANIM or STATUS_HOTEND_NUMBERLESS."
  1103. #endif
  1104. #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
  1105. #ifndef TOOLCHANGE_FS_LENGTH
  1106. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH."
  1107. #elif !defined(TOOLCHANGE_FS_RETRACT_SPEED)
  1108. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_RETRACT_SPEED."
  1109. #elif !defined(TOOLCHANGE_FS_PRIME_SPEED)
  1110. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_PRIME_SPEED."
  1111. #endif
  1112. #endif
  1113. #if ENABLED(TOOLCHANGE_PARK)
  1114. #ifndef TOOLCHANGE_PARK_XY
  1115. #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY."
  1116. #elif !defined(TOOLCHANGE_PARK_XY_FEEDRATE)
  1117. #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY_FEEDRATE."
  1118. #endif
  1119. #endif
  1120. #ifndef TOOLCHANGE_ZRAISE
  1121. #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1."
  1122. #endif
  1123. #elif HAS_PRUSA_MMU1 || HAS_EXTENDABLE_MMU
  1124. #error "Multi-Material-Unit requires 2 or more EXTRUDERS."
  1125. #elif ENABLED(SINGLENOZZLE)
  1126. #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
  1127. #if ENABLED(PID_PARAMS_PER_HOTEND)
  1128. #error "PID_PARAMS_PER_HOTEND must be disabled when using any SINGLENOZZLE extruder."
  1129. #endif
  1130. #endif
  1131. /**
  1132. * A Dual Nozzle carriage with switching servo
  1133. */
  1134. #if ENABLED(SWITCHING_NOZZLE)
  1135. #if ENABLED(DUAL_X_CARRIAGE)
  1136. #error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible."
  1137. #elif ENABLED(SINGLENOZZLE)
  1138. #error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible."
  1139. #elif HAS_PRUSA_MMU2
  1140. #error "SWITCHING_NOZZLE and PRUSA_MMU2(S) are incompatible."
  1141. #elif EXTRUDERS != 2
  1142. #error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
  1143. #elif NUM_SERVOS < 1
  1144. #error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1."
  1145. #endif
  1146. #ifndef SWITCHING_NOZZLE_SERVO_NR
  1147. #error "SWITCHING_NOZZLE requires SWITCHING_NOZZLE_SERVO_NR."
  1148. #elif SWITCHING_NOZZLE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  1149. #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
  1150. #elif SWITCHING_NOZZLE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  1151. #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
  1152. #elif SWITCHING_NOZZLE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  1153. #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
  1154. #elif SWITCHING_NOZZLE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  1155. #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
  1156. #endif
  1157. #ifdef SWITCHING_NOZZLE_E1_SERVO_NR
  1158. #if SWITCHING_NOZZLE_E1_SERVO_NR == SWITCHING_NOZZLE_SERVO_NR
  1159. #error "SWITCHING_NOZZLE_E1_SERVO_NR must be different from SWITCHING_NOZZLE_SERVO_NR."
  1160. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  1161. #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
  1162. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  1163. #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
  1164. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  1165. #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
  1166. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  1167. #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
  1168. #endif
  1169. #endif
  1170. #endif
  1171. /**
  1172. * Single Stepper Dual Extruder with switching servo
  1173. */
  1174. #if ENABLED(SWITCHING_EXTRUDER)
  1175. #if NUM_SERVOS < 1
  1176. #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
  1177. #elif SWITCHING_EXTRUDER_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  1178. #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
  1179. #elif SWITCHING_EXTRUDER_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  1180. #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
  1181. #elif SWITCHING_EXTRUDER_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  1182. #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
  1183. #elif SWITCHING_EXTRUDER_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  1184. #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
  1185. #endif
  1186. #if EXTRUDERS > 3
  1187. #if NUM_SERVOS < 2
  1188. #error "SWITCHING_EXTRUDER with 4 extruders requires NUM_SERVOS >= 2."
  1189. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  1190. #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
  1191. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  1192. #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
  1193. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  1194. #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
  1195. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  1196. #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
  1197. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == SWITCHING_EXTRUDER_SERVO_NR
  1198. #error "SWITCHING_EXTRUDER_E23_SERVO_NR should be a different extruder from SWITCHING_EXTRUDER_SERVO_NR."
  1199. #endif
  1200. #endif
  1201. #endif
  1202. /**
  1203. * Mixing Extruder requirements
  1204. */
  1205. #if ENABLED(MIXING_EXTRUDER)
  1206. #if HAS_MULTI_EXTRUDER
  1207. #error "For MIXING_EXTRUDER set MIXING_STEPPERS > 1 instead of EXTRUDERS > 1."
  1208. #elif MIXING_STEPPERS < 2
  1209. #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
  1210. #elif ENABLED(FILAMENT_WIDTH_SENSOR)
  1211. #error "MIXING_EXTRUDER is incompatible with FILAMENT_WIDTH_SENSOR. Comment out this line to use it anyway."
  1212. #elif ENABLED(SWITCHING_EXTRUDER)
  1213. #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both."
  1214. #elif ENABLED(SINGLENOZZLE)
  1215. #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE."
  1216. #elif ENABLED(DISABLE_INACTIVE_EXTRUDER)
  1217. #error "MIXING_EXTRUDER is incompatible with DISABLE_INACTIVE_EXTRUDER."
  1218. #elif HAS_FILAMENT_RUNOUT_DISTANCE
  1219. #error "MIXING_EXTRUDER is incompatible with FILAMENT_RUNOUT_DISTANCE_MM."
  1220. #endif
  1221. #endif
  1222. /**
  1223. * Dual E Steppers requirements
  1224. */
  1225. #if ENABLED(E_DUAL_STEPPER_DRIVERS)
  1226. #if EXTRUDERS > 1
  1227. #error "E_DUAL_STEPPER_DRIVERS can only be used with EXTRUDERS set to 1."
  1228. #elif ENABLED(MIXING_EXTRUDER)
  1229. #error "E_DUAL_STEPPER_DRIVERS is incompatible with MIXING_EXTRUDER."
  1230. #elif ENABLED(SWITCHING_EXTRUDER)
  1231. #error "E_DUAL_STEPPER_DRIVERS is incompatible with SWITCHING_EXTRUDER."
  1232. #endif
  1233. #endif
  1234. /**
  1235. * Linear Advance 1.5 - Check K value range
  1236. */
  1237. #if ENABLED(LIN_ADVANCE)
  1238. static_assert(
  1239. WITHIN(LIN_ADVANCE_K, 0, 10),
  1240. "LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)."
  1241. );
  1242. #if ENABLED(S_CURVE_ACCELERATION) && DISABLED(EXPERIMENTAL_SCURVE)
  1243. #error "LIN_ADVANCE and S_CURVE_ACCELERATION may not play well together! Enable EXPERIMENTAL_SCURVE to continue."
  1244. #elif ENABLED(DIRECT_STEPPING)
  1245. #error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. Enable in external planner if possible."
  1246. #elif NONE(HAS_JUNCTION_DEVIATION, ALLOW_LOW_EJERK) && defined(DEFAULT_EJERK)
  1247. static_assert(DEFAULT_EJERK >= 10, "It is strongly recommended to set DEFAULT_EJERK >= 10 when using LIN_ADVANCE. Enable ALLOW_LOW_EJERK to bypass this alert (e.g., for direct drive).");
  1248. #endif
  1249. #endif
  1250. /**
  1251. * Special tool-changing options
  1252. */
  1253. #if MANY(SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  1254. #error "Please select only one of SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, or ELECTROMAGNETIC_SWITCHING_TOOLHEAD."
  1255. #endif
  1256. /**
  1257. * (Magnetic) Parking Extruder requirements
  1258. */
  1259. #if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER)
  1260. #if ENABLED(EXT_SOLENOID)
  1261. #error "(MAGNETIC_)PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)"
  1262. #elif EXTRUDERS != 2
  1263. #error "(MAGNETIC_)PARKING_EXTRUDER requires exactly 2 EXTRUDERS."
  1264. #elif !defined(PARKING_EXTRUDER_PARKING_X)
  1265. #error "(MAGNETIC_)PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X."
  1266. #elif !defined(TOOLCHANGE_ZRAISE)
  1267. #error "(MAGNETIC_)PARKING_EXTRUDER requires TOOLCHANGE_ZRAISE."
  1268. #elif TOOLCHANGE_ZRAISE < 0
  1269. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  1270. #elif ENABLED(PARKING_EXTRUDER)
  1271. #if !PINS_EXIST(SOL0, SOL1)
  1272. #error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN."
  1273. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH)
  1274. #error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW."
  1275. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000)
  1276. #error "PARKING_EXTRUDER_SOLENOIDS_DELAY must be between 0 and 2000 (ms)."
  1277. #endif
  1278. #endif
  1279. #endif
  1280. /**
  1281. * Generic Switching Toolhead requirements
  1282. */
  1283. #if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  1284. constexpr float thpx[] = SWITCHING_TOOLHEAD_X_POS;
  1285. static_assert(COUNT(thpx) == EXTRUDERS, "SWITCHING_TOOLHEAD_X_POS must be an array EXTRUDERS long.");
  1286. #endif
  1287. /**
  1288. * Switching Toolhead requirements
  1289. */
  1290. #if ENABLED(SWITCHING_TOOLHEAD)
  1291. #ifndef SWITCHING_TOOLHEAD_SERVO_NR
  1292. #error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SERVO_NR."
  1293. #elif EXTRUDERS < 2
  1294. #error "SWITCHING_TOOLHEAD requires at least 2 EXTRUDERS."
  1295. #elif NUM_SERVOS < (SWITCHING_TOOLHEAD_SERVO_NR - 1)
  1296. #if SWITCHING_TOOLHEAD_SERVO_NR == 0
  1297. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 0 requires NUM_SERVOS >= 1."
  1298. #elif SWITCHING_TOOLHEAD_SERVO_NR == 1
  1299. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 1 requires NUM_SERVOS >= 2."
  1300. #elif SWITCHING_TOOLHEAD_SERVO_NR == 2
  1301. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 2 requires NUM_SERVOS >= 3."
  1302. #elif SWITCHING_TOOLHEAD_SERVO_NR == 3
  1303. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 3 requires NUM_SERVOS >= 4."
  1304. #endif
  1305. #elif !defined(TOOLCHANGE_ZRAISE)
  1306. #error "SWITCHING_TOOLHEAD requires TOOLCHANGE_ZRAISE."
  1307. #elif TOOLCHANGE_ZRAISE < 0
  1308. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  1309. #endif
  1310. #endif
  1311. /**
  1312. * Magnetic / Electromagnetic Switching Toolhead requirements
  1313. */
  1314. #if EITHER(MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  1315. #ifndef SWITCHING_TOOLHEAD_Y_POS
  1316. #error "(ELECTRO)?MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_POS"
  1317. #elif !defined(SWITCHING_TOOLHEAD_X_POS)
  1318. #error "(ELECTRO)?MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_X_POS"
  1319. #elif !defined(SWITCHING_TOOLHEAD_Y_CLEAR)
  1320. #error "(ELECTRO)?MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_CLEAR."
  1321. #endif
  1322. #endif
  1323. /**
  1324. * Electromagnetic Switching Toolhead requirements
  1325. */
  1326. #if ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  1327. #if ENABLED(EXT_SOLENOID)
  1328. #error "ELECTROMAGNETIC_SWITCHING_TOOLHEAD and EXT_SOLENOID are incompatible. (Pins are used twice.)"
  1329. #elif !PIN_EXISTS(SOL0)
  1330. #error "ELECTROMAGNETIC_SWITCHING_TOOLHEAD requires SOL0_PIN."
  1331. #elif !defined(SWITCHING_TOOLHEAD_Z_HOP)
  1332. #error "ELECTROMAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
  1333. #endif
  1334. #endif
  1335. /**
  1336. * Part-Cooling Fan Multiplexer requirements
  1337. */
  1338. #if PIN_EXISTS(FANMUX1)
  1339. #if !HAS_FANMUX
  1340. #error "FANMUX0_PIN must be set before FANMUX1_PIN can be set."
  1341. #endif
  1342. #elif PIN_EXISTS(FANMUX2)
  1343. #error "FANMUX0_PIN and FANMUX1_PIN must be set before FANMUX2_PIN can be set."
  1344. #endif
  1345. /**
  1346. * Limited user-controlled fans
  1347. */
  1348. #if NUM_M106_FANS > FAN_COUNT
  1349. #error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS."
  1350. #endif
  1351. /**
  1352. * Limited number of servos
  1353. */
  1354. #if NUM_SERVOS > NUM_SERVO_PLUGS
  1355. #error "The selected board doesn't support enough servos for your configuration. Reduce NUM_SERVOS."
  1356. #endif
  1357. /**
  1358. * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder
  1359. */
  1360. #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && NONE(HAS_Z_SERVO_PROBE, POLARGRAPH) && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR) && !defined(SWITCHING_TOOLHEAD_SERVO_NR)
  1361. #error "Z_PROBE_SERVO_NR, switching nozzle, switching toolhead, switching extruder, or POLARGRAPH is required for DEACTIVATE_SERVOS_AFTER_MOVE."
  1362. #endif
  1363. /**
  1364. * Required LCD language
  1365. */
  1366. #if HAS_MARLINUI_HD44780 && !defined(DISPLAY_CHARSET_HD44780)
  1367. #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller."
  1368. #endif
  1369. /**
  1370. * Extruder temperature control algorithm - There can be only one!
  1371. */
  1372. #if BOTH(PIDTEMP, MPCTEMP)
  1373. #error "Only enable PIDTEMP or MPCTEMP, but not both."
  1374. #endif
  1375. #if ENABLED(MPC_INCLUDE_FAN)
  1376. #if FAN_COUNT < 1
  1377. #error "MPC_INCLUDE_FAN requires at least one fan."
  1378. #endif
  1379. #if FAN_COUNT < HOTENDS
  1380. #if COUNT_ENABLED(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) > 1
  1381. #error "Enable either MPC_FAN_0_ALL_HOTENDS or MPC_FAN_0_ACTIVE_HOTEND, not both."
  1382. #elif NONE(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND)
  1383. #error "MPC_INCLUDE_FAN requires MPC_FAN_0_ALL_HOTENDS or MPC_FAN_0_ACTIVE_HOTEND for one fan with multiple hotends."
  1384. #endif
  1385. #endif
  1386. #endif
  1387. /**
  1388. * Bed Heating Options - PID vs Limit Switching
  1389. */
  1390. #if BOTH(PIDTEMPBED, BED_LIMIT_SWITCHING)
  1391. #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED."
  1392. #endif
  1393. /**
  1394. * Synchronous M106/M107 checks
  1395. */
  1396. #if ENABLED(LASER_SYNCHRONOUS_M106_M107)
  1397. #if FAN_KICKSTART_TIME
  1398. #error "FAN_KICKSTART_TIME must be 0 with LASER_SYNCHRONOUS_M106_M107 (because the laser will always come on at FULL power)."
  1399. #elif FAN_MIN_PWM
  1400. #error "FAN_MIN_PWM must be 0 with LASER_SYNCHRONOUS_M106_M107 (otherwise the laser will never turn OFF)."
  1401. #endif
  1402. #endif
  1403. /**
  1404. * Chamber Heating Options - PID vs Limit Switching
  1405. */
  1406. #if BOTH(PIDTEMPCHAMBER, CHAMBER_LIMIT_SWITCHING)
  1407. #error "To use CHAMBER_LIMIT_SWITCHING you must disable PIDTEMPCHAMBER."
  1408. #endif
  1409. /**
  1410. * Features that require a min/max/specific NUM_AXES
  1411. */
  1412. #if HAS_LEVELING && !HAS_Z_AXIS
  1413. #error "Leveling in Marlin requires three or more axes, with Z as the vertical axis."
  1414. #elif ENABLED(CNC_WORKSPACE_PLANES) && !HAS_Z_AXIS
  1415. #error "CNC_WORKSPACE_PLANES currently requires NUM_AXES >= 3"
  1416. #elif ENABLED(DIRECT_STEPPING) && NUM_AXES > XYZ
  1417. #error "DIRECT_STEPPING currently requires NUM_AXES 3"
  1418. #elif ENABLED(FOAMCUTTER_XYUV) && NUM_AXES < 5
  1419. #error "FOAMCUTTER_XYUV requires NUM_AXES >= 5."
  1420. #elif ENABLED(LINEAR_ADVANCE) && HAS_I_AXIS
  1421. #error "LINEAR_ADVANCE currently requires NUM_AXES <= 3."
  1422. #endif
  1423. /**
  1424. * Allow only extra axis codes that do not conflict with G-code parameter names
  1425. */
  1426. #if HAS_I_AXIS
  1427. #if !defined(I_MIN_POS) || !defined(I_MAX_POS)
  1428. #error "I_MIN_POS and I_MAX_POS are required with NUM_AXES >= 4."
  1429. #elif !defined(I_HOME_DIR)
  1430. #error "I_HOME_DIR is required with NUM_AXES >= 4."
  1431. #elif HAS_I_ENABLE && !defined(I_ENABLE_ON)
  1432. #error "I_ENABLE_ON is required for your I driver with NUM_AXES >= 4."
  1433. #endif
  1434. #endif
  1435. #if HAS_J_AXIS
  1436. #if AXIS5_NAME == AXIS4_NAME
  1437. #error "AXIS5_NAME must be unique."
  1438. #elif ENABLED(AXIS5_ROTATES) && DISABLED(AXIS4_ROTATES)
  1439. #error "AXIS5_ROTATES requires AXIS4_ROTATES."
  1440. #elif !defined(J_MIN_POS) || !defined(J_MAX_POS)
  1441. #error "J_MIN_POS and J_MAX_POS are required with NUM_AXES >= 5."
  1442. #elif !defined(J_HOME_DIR)
  1443. #error "J_HOME_DIR is required with NUM_AXES >= 5."
  1444. #elif HAS_J_ENABLE && !defined(J_ENABLE_ON)
  1445. #error "J_ENABLE_ON is required for your J driver with NUM_AXES >= 5."
  1446. #endif
  1447. #endif
  1448. #if HAS_K_AXIS
  1449. #if AXIS6_NAME == AXIS5_NAME || AXIS6_NAME == AXIS4_NAME
  1450. #error "AXIS6_NAME must be unique."
  1451. #elif ENABLED(AXIS6_ROTATES) && DISABLED(AXIS5_ROTATES)
  1452. #error "AXIS6_ROTATES requires AXIS5_ROTATES."
  1453. #elif !defined(K_MIN_POS) || !defined(K_MAX_POS)
  1454. #error "K_MIN_POS and K_MAX_POS are required with NUM_AXES >= 6."
  1455. #elif !defined(K_HOME_DIR)
  1456. #error "K_HOME_DIR is required with NUM_AXES >= 6."
  1457. #elif HAS_K_ENABLE && !defined(K_ENABLE_ON)
  1458. #error "K_ENABLE_ON is required for your K driver with NUM_AXES >= 6."
  1459. #endif
  1460. #endif
  1461. #if HAS_U_AXIS
  1462. #if AXIS7_NAME == AXIS6_NAME || AXIS7_NAME == AXIS5_NAME || AXIS7_NAME == AXIS4_NAME
  1463. #error "AXIS7_NAME must be unique."
  1464. #elif ENABLED(AXIS7_ROTATES) && DISABLED(AXIS6_ROTATES)
  1465. #error "AXIS7_ROTATES requires AXIS6_ROTATES."
  1466. #elif !defined(U_MIN_POS) || !defined(U_MAX_POS)
  1467. #error "U_MIN_POS and U_MAX_POS are required with NUM_AXES >= 7."
  1468. #elif !defined(U_HOME_DIR)
  1469. #error "U_HOME_DIR is required with NUM_AXES >= 7."
  1470. #elif HAS_U_ENABLE && !defined(U_ENABLE_ON)
  1471. #error "U_ENABLE_ON is required for your U driver with NUM_AXES >= 7."
  1472. #endif
  1473. #endif
  1474. #if HAS_V_AXIS
  1475. #if AXIS8_NAME == AXIS7_NAME || AXIS8_NAME == AXIS6_NAME || AXIS8_NAME == AXIS5_NAME || AXIS8_NAME == AXIS4_NAME
  1476. #error "AXIS8_NAME must be unique."
  1477. #elif ENABLED(AXIS8_ROTATES) && DISABLED(AXIS7_ROTATES)
  1478. #error "AXIS8_ROTATES requires AXIS7_ROTATES."
  1479. #elif !defined(V_MIN_POS) || !defined(V_MAX_POS)
  1480. #error "V_MIN_POS and V_MAX_POS are required with NUM_AXES >= 8."
  1481. #elif !defined(V_HOME_DIR)
  1482. #error "V_HOME_DIR is required with NUM_AXES >= 8."
  1483. #elif HAS_V_ENABLE && !defined(V_ENABLE_ON)
  1484. #error "V_ENABLE_ON is required for your V driver with NUM_AXES >= 8."
  1485. #endif
  1486. #endif
  1487. #if HAS_W_AXIS
  1488. #if AXIS9_NAME == AXIS8_NAME || AXIS9_NAME == AXIS7_NAME || AXIS9_NAME == AXIS6_NAME || AXIS9_NAME == AXIS5_NAME || AXIS9_NAME == AXIS4_NAME
  1489. #error "AXIS9_NAME must be unique."
  1490. #elif ENABLED(AXIS9_ROTATES) && DISABLED(AXIS8_ROTATES)
  1491. #error "AXIS9_ROTATES requires AXIS8_ROTATES."
  1492. #elif !defined(W_MIN_POS) || !defined(W_MAX_POS)
  1493. #error "W_MIN_POS and W_MAX_POS are required with NUM_AXES >= 9."
  1494. #elif !defined(W_HOME_DIR)
  1495. #error "W_HOME_DIR is required with NUM_AXES >= 9."
  1496. #elif HAS_W_ENABLE && !defined(W_ENABLE_ON)
  1497. #error "W_ENABLE_ON is required for your W driver with NUM_AXES >= 9."
  1498. #endif
  1499. #endif
  1500. /**
  1501. * Kinematics
  1502. */
  1503. /**
  1504. * Allow only one kinematic type to be defined
  1505. */
  1506. #if MANY(DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, ARTICULATED_ROBOT_ARM, FOAMCUTTER_XYUV)
  1507. #error "Please enable only one of DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, ARTICULATED_ROBOT_ARM, or FOAMCUTTER_XYUV."
  1508. #endif
  1509. /**
  1510. * Delta requirements
  1511. */
  1512. #if ENABLED(DELTA)
  1513. #if NONE(USE_XMAX_PLUG, USE_YMAX_PLUG, USE_ZMAX_PLUG)
  1514. #error "You probably want to use Max Endstops for DELTA!"
  1515. #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED
  1516. #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
  1517. #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_MARLINUI_MENU)
  1518. #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
  1519. #elif ENABLED(DELTA_CALIBRATION_MENU) && !HAS_MARLINUI_MENU
  1520. #error "DELTA_CALIBRATION_MENU requires an LCD Controller."
  1521. #elif ABL_USES_GRID
  1522. #if ((GRID_MAX_POINTS_X) & 1) == 0 || ((GRID_MAX_POINTS_Y) & 1) == 0
  1523. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
  1524. #elif (GRID_MAX_POINTS_X) < 3
  1525. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher."
  1526. #endif
  1527. #endif
  1528. #endif
  1529. /**
  1530. * Junction deviation is incompatible with kinematic systems.
  1531. */
  1532. #if HAS_JUNCTION_DEVIATION && IS_KINEMATIC
  1533. #error "CLASSIC_JERK is required for DELTA and SCARA."
  1534. #endif
  1535. /**
  1536. * Some things should not be used on Belt Printers
  1537. */
  1538. #if BOTH(BELTPRINTER, HAS_LEVELING)
  1539. #error "Bed Leveling is not compatible with BELTPRINTER."
  1540. #endif
  1541. /**
  1542. * Probes
  1543. */
  1544. /**
  1545. * Allow only one probe option to be defined
  1546. */
  1547. #if 1 < 0 \
  1548. + (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \
  1549. + 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, MAGLEV4)
  1550. #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, MAGLEV4, or Z Servo."
  1551. #endif
  1552. #if HAS_BED_PROBE
  1553. /**
  1554. * Z_PROBE_SLED is incompatible with DELTA
  1555. */
  1556. #if BOTH(Z_PROBE_SLED, DELTA)
  1557. #error "You cannot use Z_PROBE_SLED with DELTA."
  1558. #endif
  1559. /**
  1560. * SOLENOID_PROBE requirements
  1561. */
  1562. #if ENABLED(SOLENOID_PROBE)
  1563. #if ENABLED(EXT_SOLENOID)
  1564. #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID."
  1565. #elif !HAS_SOLENOID_1
  1566. #error "SOLENOID_PROBE requires SOL1_PIN."
  1567. #endif
  1568. #endif
  1569. /**
  1570. * NUM_SERVOS is required for a Z servo probe
  1571. */
  1572. #if HAS_Z_SERVO_PROBE
  1573. #if !NUM_SERVOS
  1574. #error "NUM_SERVOS is required for a Z servo probe (Z_PROBE_SERVO_NR)."
  1575. #elif Z_PROBE_SERVO_NR >= NUM_SERVOS
  1576. #error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS."
  1577. #elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  1578. #error "SERVO0_PIN must be defined for your servo or BLTOUCH probe."
  1579. #elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  1580. #error "SERVO1_PIN must be defined for your servo or BLTOUCH probe."
  1581. #elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  1582. #error "SERVO2_PIN must be defined for your servo or BLTOUCH probe."
  1583. #elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  1584. #error "SERVO3_PIN must be defined for your servo or BLTOUCH probe."
  1585. #endif
  1586. #endif
  1587. #if ENABLED(BLTOUCH)
  1588. // BLTouch can't run in 5V mode with a 3.3V probe pin
  1589. #if ENABLED(BLTOUCH_SET_5V_MODE)
  1590. #define _5V(P,A,B) WITHIN(P,A,B)
  1591. #ifdef STM32F1 // STM32F103 5V-tolerant pins
  1592. #define _IS_5V_TOLERANT(P) (_5V(P,PA8,PA15) || _5V(P,PB2,PB15) || _5V(P,PC6,PC12) || _5V(P,PD0,PD15) || _5V(P,PE0,PE15) || _5V(P,PF0,PF5) || _5V(P,PF11,PF15))
  1593. #elif defined(ARDUINO_ARCH_SAM)
  1594. #define _IS_5V_TOLERANT(P) 0 // Assume no 5V tolerance
  1595. #else
  1596. #define _IS_5V_TOLERANT(P) 1 // Assume 5V tolerance
  1597. #endif
  1598. #if USES_Z_MIN_PROBE_PIN
  1599. #if !_IS_5V_TOLERANT(Z_MIN_PROBE_PIN)
  1600. #error "BLTOUCH_SET_5V_MODE is not compatible with the Z_MIN_PROBE_PIN."
  1601. #endif
  1602. #elif !_IS_5V_TOLERANT(Z_MIN_PIN)
  1603. #if !MB(CHITU3D_V6)
  1604. #error "BLTOUCH_SET_5V_MODE is not compatible with the Z_MIN_PIN."
  1605. #endif
  1606. #endif
  1607. #undef _IS_5V_TOLERANT
  1608. #undef _5V
  1609. #elif NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN, ENDSTOPPULLUP_ZMIN_PROBE)
  1610. #if USES_Z_MIN_PROBE_PIN
  1611. #error "BLTOUCH on Z_MIN_PROBE_PIN requires ENDSTOPPULLUP_ZMIN_PROBE, ENDSTOPPULLUPS, or BLTOUCH_SET_5V_MODE."
  1612. #else
  1613. #error "BLTOUCH on Z_MIN_PIN requires ENDSTOPPULLUP_ZMIN, ENDSTOPPULLUPS, or BLTOUCH_SET_5V_MODE."
  1614. #endif
  1615. #endif
  1616. #if ENABLED(BLTOUCH_HS_MODE) && BLTOUCH_HS_MODE == 0
  1617. #error "BLTOUCH_HS_MODE must now be defined as true or false, indicating the default state."
  1618. #endif
  1619. #if BLTOUCH_DELAY < 200
  1620. #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported."
  1621. #endif
  1622. #endif
  1623. #if ENABLED(RACK_AND_PINION_PROBE) && !(defined(Z_PROBE_DEPLOY_X) && defined(Z_PROBE_RETRACT_X))
  1624. #error "RACK_AND_PINION_PROBE requires Z_PROBE_DEPLOY_X and Z_PROBE_RETRACT_X."
  1625. #endif
  1626. /**
  1627. * Touch-MI probe requirements
  1628. */
  1629. #if ENABLED(TOUCH_MI_PROBE)
  1630. #if DISABLED(Z_SAFE_HOMING)
  1631. #error "TOUCH_MI_PROBE requires Z_SAFE_HOMING."
  1632. #elif !defined(TOUCH_MI_RETRACT_Z)
  1633. #error "TOUCH_MI_PROBE requires TOUCH_MI_RETRACT_Z."
  1634. #elif defined(Z_AFTER_PROBING)
  1635. #error "TOUCH_MI_PROBE requires Z_AFTER_PROBING to be disabled."
  1636. #elif Z_HOMING_HEIGHT < 10
  1637. #error "TOUCH_MI_PROBE requires Z_HOMING_HEIGHT >= 10."
  1638. #elif Z_MIN_PROBE_ENDSTOP_INVERTING
  1639. #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING to be set to false."
  1640. #elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
  1641. #error "TOUCH_MI_PROBE requires BABYSTEPPING with BABYSTEP_ZPROBE_OFFSET."
  1642. #elif !HAS_RESUME_CONTINUE
  1643. #error "TOUCH_MI_PROBE currently requires an LCD controller or EMERGENCY_PARSER."
  1644. #endif
  1645. #endif
  1646. /**
  1647. * MagLev V4 probe requirements
  1648. */
  1649. #if ENABLED(MAGLEV4)
  1650. #if !PIN_EXISTS(MAGLEV_TRIGGER)
  1651. #error "MAGLEV4 requires MAGLEV_TRIGGER_PIN to be defined."
  1652. #elif DISABLED(Z_SAFE_HOMING)
  1653. #error "MAGLEV4 requires Z_SAFE_HOMING."
  1654. #elif MAGLEV_TRIGGER_DELAY != 15
  1655. #error "MAGLEV_TRIGGER_DELAY should not be changed. Comment out this line to continue."
  1656. #endif
  1657. #endif
  1658. /**
  1659. * Require pin options and pins to be defined
  1660. */
  1661. #if ENABLED(SENSORLESS_PROBING)
  1662. #if ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS)
  1663. #error "SENSORLESS_PROBING requires TMC2130/2160/2209/5130/5160 drivers on X, Y, and Z."
  1664. #elif !Z_SENSORLESS
  1665. #error "SENSORLESS_PROBING requires a TMC2130/2160/2209/5130/5160 driver on Z."
  1666. #endif
  1667. #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  1668. #if DISABLED(USE_ZMIN_PLUG)
  1669. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled."
  1670. #elif !HAS_Z_MIN
  1671. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined."
  1672. #elif Z_MIN_PROBE_ENDSTOP_INVERTING != Z_MIN_ENDSTOP_INVERTING
  1673. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING."
  1674. #endif
  1675. #elif !HAS_Z_MIN_PROBE_PIN
  1676. #error "Z_MIN_PROBE_PIN must be defined if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN is not enabled."
  1677. #endif
  1678. /**
  1679. * Check for improper NOZZLE_TO_PROBE_OFFSET
  1680. */
  1681. constexpr xyz_pos_t sanity_nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET;
  1682. #if ENABLED(NOZZLE_AS_PROBE)
  1683. static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0,
  1684. "NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0.");
  1685. #elif !IS_KINEMATIC
  1686. static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0.");
  1687. static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0.");
  1688. static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0.");
  1689. static_assert(PROBING_MARGIN_LEFT >= 0, "PROBING_MARGIN_LEFT must be >= 0.");
  1690. static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0.");
  1691. #endif
  1692. #define _MARGIN(A) TERN(IS_SCARA, SCARA_PRINTABLE_RADIUS, TERN(DELTA, DELTA_PRINTABLE_RADIUS, ((A##_BED_SIZE) / 2)))
  1693. static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large.");
  1694. static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large.");
  1695. static_assert(PROBING_MARGIN_FRONT < _MARGIN(Y), "PROBING_MARGIN_FRONT is too large.");
  1696. static_assert(PROBING_MARGIN_LEFT < _MARGIN(X), "PROBING_MARGIN_LEFT is too large.");
  1697. static_assert(PROBING_MARGIN_RIGHT < _MARGIN(X), "PROBING_MARGIN_RIGHT is too large.");
  1698. #undef _MARGIN
  1699. /**
  1700. * Make sure Z raise values are set
  1701. */
  1702. #ifndef Z_CLEARANCE_DEPLOY_PROBE
  1703. #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration."
  1704. #elif !defined(Z_CLEARANCE_BETWEEN_PROBES)
  1705. #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration."
  1706. #elif Z_CLEARANCE_DEPLOY_PROBE < 0
  1707. #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0."
  1708. #elif Z_CLEARANCE_BETWEEN_PROBES < 0
  1709. #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
  1710. #elif Z_AFTER_PROBING < 0
  1711. #error "Probes need Z_AFTER_PROBING >= 0."
  1712. #endif
  1713. #if MULTIPLE_PROBING > 0 || EXTRA_PROBING > 0
  1714. #if MULTIPLE_PROBING == 0
  1715. #error "EXTRA_PROBING requires MULTIPLE_PROBING."
  1716. #elif MULTIPLE_PROBING < 2
  1717. #error "MULTIPLE_PROBING must be 2 or more."
  1718. #elif MULTIPLE_PROBING <= EXTRA_PROBING
  1719. #error "EXTRA_PROBING must be less than MULTIPLE_PROBING."
  1720. #endif
  1721. #endif
  1722. #if Z_PROBE_LOW_POINT > 0
  1723. #error "Z_PROBE_LOW_POINT must be less than or equal to 0."
  1724. #endif
  1725. #if ENABLED(PROBE_ACTIVATION_SWITCH)
  1726. #ifndef PROBE_ACTIVATION_SWITCH_STATE
  1727. #error "PROBE_ACTIVATION_SWITCH_STATE is required for PROBE_ACTIVATION_SWITCH."
  1728. #elif !PIN_EXISTS(PROBE_ACTIVATION_SWITCH)
  1729. #error "A PROBE_ACTIVATION_SWITCH_PIN is required for PROBE_ACTIVATION_SWITCH."
  1730. #endif
  1731. #endif
  1732. #else
  1733. /**
  1734. * Require some kind of probe for bed leveling and probe testing
  1735. */
  1736. #if HAS_ABL_NOT_UBL && !PROBE_SELECTED
  1737. #error "Auto Bed Leveling requires either PROBE_MANUALLY, SENSORLESS_PROBING, or a real probe."
  1738. #endif
  1739. #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
  1740. #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a real probe."
  1741. #endif
  1742. #endif
  1743. #if ENABLED(LCD_BED_TRAMMING)
  1744. #ifndef BED_TRAMMING_INSET_LFRB
  1745. #error "LCD_BED_TRAMMING requires BED_TRAMMING_INSET_LFRB values."
  1746. #elif ENABLED(BED_TRAMMING_USE_PROBE)
  1747. #if !HAS_BED_PROBE
  1748. #error "BED_TRAMMING_USE_PROBE requires a real probe."
  1749. #elif ENABLED(SENSORLESS_PROBING)
  1750. #error "BED_TRAMMING_USE_PROBE is incompatible with SENSORLESS_PROBING."
  1751. #endif
  1752. #endif
  1753. #endif
  1754. /**
  1755. * Allow only one bed leveling option to be defined
  1756. */
  1757. #if MANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
  1758. #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."
  1759. #endif
  1760. /**
  1761. * Bed Leveling Requirements
  1762. */
  1763. #if ENABLED(AUTO_BED_LEVELING_UBL)
  1764. /**
  1765. * Unified Bed Leveling
  1766. */
  1767. #if IS_SCARA
  1768. #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
  1769. #elif DISABLED(EEPROM_SETTINGS)
  1770. #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS."
  1771. #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
  1772. #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
  1773. #endif
  1774. #elif HAS_ABL_NOT_UBL
  1775. /**
  1776. * Auto Bed Leveling
  1777. */
  1778. /**
  1779. * Delta and SCARA have limited bed leveling options
  1780. */
  1781. #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR)
  1782. #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option."
  1783. #endif
  1784. #elif ENABLED(MESH_BED_LEVELING)
  1785. // Mesh Bed Leveling
  1786. #if ENABLED(DELTA)
  1787. #error "MESH_BED_LEVELING is not compatible with DELTA printers."
  1788. #elif (GRID_MAX_POINTS_X) > 9 || (GRID_MAX_POINTS_Y) > 9
  1789. #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
  1790. #endif
  1791. #endif
  1792. #if ALL(HAS_LEVELING, RESTORE_LEVELING_AFTER_G28, ENABLE_LEVELING_AFTER_G28)
  1793. #error "Only enable RESTORE_LEVELING_AFTER_G28 or ENABLE_LEVELING_AFTER_G28, but not both."
  1794. #endif
  1795. #if HAS_MESH && HAS_CLASSIC_JERK
  1796. static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
  1797. #endif
  1798. #if ENABLED(G26_MESH_VALIDATION)
  1799. #if !HAS_EXTRUDERS
  1800. #error "G26_MESH_VALIDATION requires at least one extruder."
  1801. #elif !HAS_MESH
  1802. #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
  1803. #endif
  1804. #endif
  1805. #if ENABLED(MESH_EDIT_GFX_OVERLAY)
  1806. #if DISABLED(AUTO_BED_LEVELING_UBL)
  1807. #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL."
  1808. #elif NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI)
  1809. #error "MESH_EDIT_GFX_OVERLAY requires a Graphical LCD."
  1810. #endif
  1811. #endif
  1812. #if ENABLED(G29_RETRY_AND_RECOVER) && NONE(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
  1813. #error "G29_RETRY_AND_RECOVER requires AUTO_BED_LEVELING_3POINT, LINEAR, or BILINEAR."
  1814. #endif
  1815. /**
  1816. * LCD_BED_LEVELING requirements
  1817. */
  1818. #if ENABLED(LCD_BED_LEVELING)
  1819. #if !HAS_MARLINUI_MENU
  1820. #error "LCD_BED_LEVELING is not supported by the selected LCD controller."
  1821. #elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL)
  1822. #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
  1823. #elif ENABLED(MESH_EDIT_MENU) && !HAS_MESH
  1824. #error "MESH_EDIT_MENU requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
  1825. #endif
  1826. #endif
  1827. #if BOTH(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
  1828. #error "Disable PREHEAT_BEFORE_LEVELING when using PREHEAT_BEFORE_PROBING."
  1829. #endif
  1830. /**
  1831. * Homing checks
  1832. */
  1833. #ifndef HOMING_BUMP_MM
  1834. #error "Required setting HOMING_BUMP_MM is missing!"
  1835. #elif !defined(HOMING_BUMP_DIVISOR)
  1836. #error "Required setting HOMING_BUMP_DIVISOR is missing!"
  1837. #else
  1838. constexpr float hbm[] = HOMING_BUMP_MM, hbd[] = HOMING_BUMP_DIVISOR;
  1839. static_assert(COUNT(hbm) == NUM_AXES, "HOMING_BUMP_MM must have " _NUM_AXES_STR "elements (and no others).");
  1840. NUM_AXIS_CODE(
  1841. static_assert(hbm[X_AXIS] >= 0, "HOMING_BUMP_MM.X must be greater than or equal to 0."),
  1842. static_assert(hbm[Y_AXIS] >= 0, "HOMING_BUMP_MM.Y must be greater than or equal to 0."),
  1843. static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal to 0."),
  1844. static_assert(hbm[I_AXIS] >= 0, "HOMING_BUMP_MM.I must be greater than or equal to 0."),
  1845. static_assert(hbm[J_AXIS] >= 0, "HOMING_BUMP_MM.J must be greater than or equal to 0."),
  1846. static_assert(hbm[K_AXIS] >= 0, "HOMING_BUMP_MM.K must be greater than or equal to 0."),
  1847. static_assert(hbm[U_AXIS] >= 0, "HOMING_BUMP_MM.U must be greater than or equal to 0."),
  1848. static_assert(hbm[V_AXIS] >= 0, "HOMING_BUMP_MM.V must be greater than or equal to 0."),
  1849. static_assert(hbm[W_AXIS] >= 0, "HOMING_BUMP_MM.W must be greater than or equal to 0.")
  1850. );
  1851. static_assert(COUNT(hbd) == NUM_AXES, "HOMING_BUMP_DIVISOR must have " _NUM_AXES_STR "elements (and no others).");
  1852. NUM_AXIS_CODE(
  1853. static_assert(hbd[X_AXIS] >= 1, "HOMING_BUMP_DIVISOR.X must be greater than or equal to 1."),
  1854. static_assert(hbd[Y_AXIS] >= 1, "HOMING_BUMP_DIVISOR.Y must be greater than or equal to 1."),
  1855. static_assert(hbd[Z_AXIS] >= 1, "HOMING_BUMP_DIVISOR.Z must be greater than or equal to 1."),
  1856. static_assert(hbd[I_AXIS] >= 1, "HOMING_BUMP_DIVISOR.I must be greater than or equal to 1."),
  1857. static_assert(hbd[J_AXIS] >= 1, "HOMING_BUMP_DIVISOR.J must be greater than or equal to 1."),
  1858. static_assert(hbd[K_AXIS] >= 1, "HOMING_BUMP_DIVISOR.K must be greater than or equal to 1."),
  1859. static_assert(hbd[U_AXIS] >= 1, "HOMING_BUMP_DIVISOR.U must be greater than or equal to 1."),
  1860. static_assert(hbd[V_AXIS] >= 1, "HOMING_BUMP_DIVISOR.V must be greater than or equal to 1."),
  1861. static_assert(hbd[W_AXIS] >= 1, "HOMING_BUMP_DIVISOR.W must be greater than or equal to 1.")
  1862. );
  1863. #endif
  1864. #ifdef HOMING_BACKOFF_POST_MM
  1865. constexpr float hbp[] = HOMING_BACKOFF_POST_MM;
  1866. static_assert(COUNT(hbp) == NUM_AXES, "HOMING_BACKOFF_POST_MM must have " _NUM_AXES_STR "elements (and no others).");
  1867. NUM_AXIS_CODE(
  1868. static_assert(hbp[X_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.X must be greater than or equal to 0."),
  1869. static_assert(hbp[Y_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.Y must be greater than or equal to 0."),
  1870. static_assert(hbp[Z_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.Z must be greater than or equal to 0."),
  1871. static_assert(hbp[I_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.I must be greater than or equal to 0."),
  1872. static_assert(hbp[J_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.J must be greater than or equal to 0."),
  1873. static_assert(hbp[K_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.K must be greater than or equal to 0."),
  1874. static_assert(hbp[U_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.U must be greater than or equal to 0."),
  1875. static_assert(hbp[V_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.V must be greater than or equal to 0."),
  1876. static_assert(hbp[W_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.W must be greater than or equal to 0.")
  1877. );
  1878. #endif
  1879. #ifdef SENSORLESS_BACKOFF_MM
  1880. constexpr float sbm[] = SENSORLESS_BACKOFF_MM;
  1881. static_assert(COUNT(sbm) == NUM_AXES, "SENSORLESS_BACKOFF_MM must have " _NUM_AXES_STR "elements (and no others).");
  1882. NUM_AXIS_CODE(
  1883. static_assert(sbm[X_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.X must be greater than or equal to 0."),
  1884. static_assert(sbm[Y_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.Y must be greater than or equal to 0."),
  1885. static_assert(sbm[Z_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.Z must be greater than or equal to 0."),
  1886. static_assert(sbm[I_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.I must be greater than or equal to 0."),
  1887. static_assert(sbm[J_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.J must be greater than or equal to 0."),
  1888. static_assert(sbm[K_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.K must be greater than or equal to 0."),
  1889. static_assert(sbm[U_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.U must be greater than or equal to 0."),
  1890. static_assert(sbm[V_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.V must be greater than or equal to 0."),
  1891. static_assert(sbm[W_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.W must be greater than or equal to 0.")
  1892. );
  1893. #endif
  1894. #if ENABLED(CODEPENDENT_XY_HOMING)
  1895. #if ENABLED(QUICK_HOME)
  1896. #error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING."
  1897. #elif IS_KINEMATIC
  1898. #error "CODEPENDENT_XY_HOMING requires a Cartesian setup."
  1899. #endif
  1900. #endif
  1901. /**
  1902. * Make sure Z_SAFE_HOMING point is reachable
  1903. */
  1904. #if ENABLED(Z_SAFE_HOMING)
  1905. 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.");
  1906. 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.");
  1907. #endif
  1908. /**
  1909. * Make sure DISABLE_[XYZ] compatible with selected homing options
  1910. */
  1911. #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_I, DISABLE_J, DISABLE_K, DISABLE_U, DISABLE_V, DISABLE_W)
  1912. #if EITHER(HOME_AFTER_DEACTIVATE, Z_SAFE_HOMING)
  1913. #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
  1914. #endif
  1915. #endif
  1916. /**
  1917. * Filament Width Sensor
  1918. */
  1919. #if ENABLED(FILAMENT_WIDTH_SENSOR)
  1920. #if !HAS_FILAMENT_WIDTH_SENSOR
  1921. #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
  1922. #elif ENABLED(NO_VOLUMETRICS)
  1923. #error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled."
  1924. #endif
  1925. #endif
  1926. /**
  1927. * System Power Sensor
  1928. */
  1929. #if ENABLED(POWER_MONITOR_CURRENT) && !PIN_EXISTS(POWER_MONITOR_CURRENT)
  1930. #error "POWER_MONITOR_CURRENT requires a valid POWER_MONITOR_CURRENT_PIN."
  1931. #elif ENABLED(POWER_MONITOR_VOLTAGE) && !PIN_EXISTS(POWER_MONITOR_VOLTAGE)
  1932. #error "POWER_MONITOR_VOLTAGE requires POWER_MONITOR_VOLTAGE_PIN to be defined."
  1933. #elif BOTH(POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE) && POWER_MONITOR_CURRENT_PIN == POWER_MONITOR_VOLTAGE_PIN
  1934. #error "POWER_MONITOR_CURRENT_PIN and POWER_MONITOR_VOLTAGE_PIN must be different."
  1935. #endif
  1936. /**
  1937. * Volumetric Extruder Limit
  1938. */
  1939. #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT)
  1940. #if ENABLED(NO_VOLUMETRICS)
  1941. #error "VOLUMETRIC_EXTRUDER_LIMIT requires NO_VOLUMETRICS to be disabled."
  1942. #elif MIN_STEPS_PER_SEGMENT > 1
  1943. #error "VOLUMETRIC_EXTRUDER_LIMIT is not compatible with MIN_STEPS_PER_SEGMENT greater than 1."
  1944. #endif
  1945. #endif
  1946. /**
  1947. * ULTIPANEL encoder
  1948. */
  1949. #if IS_ULTIPANEL && NONE(IS_NEWPANEL, SR_LCD_2W_NL) && !PIN_EXISTS(SHIFT_CLK)
  1950. #error "ULTIPANEL controllers require some kind of encoder."
  1951. #endif
  1952. #if ENCODER_PULSES_PER_STEP < 0
  1953. #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead."
  1954. #endif
  1955. /**
  1956. * SAV_3DGLCD display options
  1957. */
  1958. #if ENABLED(SAV_3DGLCD)
  1959. #if NONE(U8GLIB_SSD1306, U8GLIB_SH1106)
  1960. #error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
  1961. #elif BOTH(U8GLIB_SSD1306, U8GLIB_SH1106)
  1962. #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
  1963. #endif
  1964. #endif
  1965. /**
  1966. * Allen Key
  1967. * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
  1968. */
  1969. #if ALL(Z_HOME_TO_MIN, Z_PROBE_ALLEN_KEY, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  1970. #error "You can't home to a Z min endstop with a Z_PROBE_ALLEN_KEY."
  1971. #endif
  1972. /**
  1973. * Dual X Carriage requirements
  1974. */
  1975. #if ENABLED(DUAL_X_CARRIAGE)
  1976. #if EXTRUDERS < 2
  1977. #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
  1978. #elif ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_YX)
  1979. #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, COREZX, MARKFORGED_YX, or MARKFORGED_XY."
  1980. #elif !GOOD_AXIS_PINS(X2)
  1981. #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
  1982. #elif !HAS_X_MAX
  1983. #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop."
  1984. #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
  1985. #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
  1986. #elif X_HOME_TO_MAX || X2_HOME_TO_MIN
  1987. #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1."
  1988. #endif
  1989. #endif
  1990. #undef GOOD_AXIS_PINS
  1991. /**
  1992. * Make sure auto fan pins don't conflict with the fan pin
  1993. */
  1994. #if HAS_AUTO_FAN
  1995. #if HAS_FAN0
  1996. #if E0_AUTO_FAN_PIN == FAN_PIN
  1997. #error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
  1998. #elif E1_AUTO_FAN_PIN == FAN_PIN
  1999. #error "You cannot set E1_AUTO_FAN_PIN equal to FAN_PIN."
  2000. #elif E2_AUTO_FAN_PIN == FAN_PIN
  2001. #error "You cannot set E2_AUTO_FAN_PIN equal to FAN_PIN."
  2002. #elif E3_AUTO_FAN_PIN == FAN_PIN
  2003. #error "You cannot set E3_AUTO_FAN_PIN equal to FAN_PIN."
  2004. #endif
  2005. #endif
  2006. #endif
  2007. #if HAS_FAN0
  2008. #if CONTROLLER_FAN_PIN == FAN_PIN
  2009. #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."
  2010. #elif ENABLED(FAN_SOFT_PWM_REQUIRED) && DISABLED(FAN_SOFT_PWM)
  2011. #error "FAN_SOFT_PWM is required for your board. Enable it to continue."
  2012. #endif
  2013. #endif
  2014. #if ENABLED(USE_CONTROLLER_FAN)
  2015. #if !HAS_CONTROLLER_FAN
  2016. #error "USE_CONTROLLER_FAN requires a CONTROLLER_FAN_PIN. Define in Configuration_adv.h."
  2017. #elif E0_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  2018. #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  2019. #elif E1_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  2020. #error "You cannot set E1_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  2021. #elif E2_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  2022. #error "You cannot set E2_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  2023. #elif E3_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  2024. #error "You cannot set E3_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  2025. #endif
  2026. #endif
  2027. #ifdef REDUNDANT_PART_COOLING_FAN
  2028. #if FAN_COUNT < 2
  2029. #error "REDUNDANT_PART_COOLING_FAN requires a board with at least two PWM fans."
  2030. #else
  2031. static_assert(WITHIN(REDUNDANT_PART_COOLING_FAN, 1, FAN_COUNT - 1), "REDUNDANT_PART_COOLING_FAN must be between 1 and " STRINGIFY(DECREMENT(FAN_COUNT)) ".");
  2032. #endif
  2033. #endif
  2034. /**
  2035. * Case Light requirements
  2036. */
  2037. #if NEED_CASE_LIGHT_PIN
  2038. #if !PIN_EXISTS(CASE_LIGHT)
  2039. #error "CASE_LIGHT_ENABLE requires CASE_LIGHT_PIN, CASE_LIGHT_USE_NEOPIXEL, or CASE_LIGHT_USE_RGB_LED."
  2040. #elif CASE_LIGHT_PIN == FAN_PIN
  2041. #error "CASE_LIGHT_PIN conflicts with FAN_PIN. Resolve before continuing."
  2042. #endif
  2043. #endif
  2044. /**
  2045. * Required custom thermistor settings
  2046. */
  2047. #if TEMP_SENSOR_0_IS_CUSTOM && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA))
  2048. #error "TEMP_SENSOR_0 1000 requires HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS and HOTEND0_BETA in Configuration_adv.h."
  2049. #elif TEMP_SENSOR_1_IS_CUSTOM && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA))
  2050. #error "TEMP_SENSOR_1 1000 requires HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS and HOTEND1_BETA in Configuration_adv.h."
  2051. #elif TEMP_SENSOR_2_IS_CUSTOM && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA))
  2052. #error "TEMP_SENSOR_2 1000 requires HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS and HOTEND2_BETA in Configuration_adv.h."
  2053. #elif TEMP_SENSOR_3_IS_CUSTOM && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA))
  2054. #error "TEMP_SENSOR_3 1000 requires HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS and HOTEND3_BETA in Configuration_adv.h."
  2055. #elif TEMP_SENSOR_4_IS_CUSTOM && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA))
  2056. #error "TEMP_SENSOR_4 1000 requires HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS and HOTEND4_BETA in Configuration_adv.h."
  2057. #elif TEMP_SENSOR_5_IS_CUSTOM && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA))
  2058. #error "TEMP_SENSOR_5 1000 requires HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS and HOTEND5_BETA in Configuration_adv.h."
  2059. #elif TEMP_SENSOR_6_IS_CUSTOM && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA))
  2060. #error "TEMP_SENSOR_6 1000 requires HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS and HOTEND6_BETA in Configuration_adv.h."
  2061. #elif TEMP_SENSOR_7_IS_CUSTOM && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA))
  2062. #error "TEMP_SENSOR_7 1000 requires HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS and HOTEND7_BETA in Configuration_adv.h."
  2063. #elif TEMP_SENSOR_BED_IS_CUSTOM && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA))
  2064. #error "TEMP_SENSOR_BED 1000 requires BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS and BED_BETA in Configuration_adv.h."
  2065. #elif TEMP_SENSOR_CHAMBER_IS_CUSTOM && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA))
  2066. #error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h."
  2067. #elif TEMP_SENSOR_PROBE_IS_CUSTOM && !(defined(PROBE_PULLUP_RESISTOR_OHMS) && defined(PROBE_RESISTANCE_25C_OHMS) && defined(PROBE_BETA))
  2068. #error "TEMP_SENSOR_PROBE 1000 requires PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS and PROBE_BETA in Configuration_adv.h."
  2069. #elif TEMP_SENSOR_BOARD_IS_CUSTOM && !(defined(BOARD_PULLUP_RESISTOR_OHMS) && defined(BOARD_RESISTANCE_25C_OHMS) && defined(BOARD_BETA))
  2070. #error "TEMP_SENSOR_BOARD 1000 requires BOARD_PULLUP_RESISTOR_OHMS, BOARD_RESISTANCE_25C_OHMS and BOARD_BETA in Configuration_adv.h."
  2071. #elif TEMP_SENSOR_REDUNDANT_IS_CUSTOM && !(defined(REDUNDANT_PULLUP_RESISTOR_OHMS) && defined(REDUNDANT_RESISTANCE_25C_OHMS) && defined(REDUNDANT_BETA))
  2072. #error "TEMP_SENSOR_REDUNDANT 1000 requires REDUNDANT_PULLUP_RESISTOR_OHMS, REDUNDANT_RESISTANCE_25C_OHMS and REDUNDANT_BETA in Configuration_adv.h."
  2073. #endif
  2074. /**
  2075. * Required MAX31865 settings
  2076. */
  2077. #if TEMP_SENSOR_0_IS_MAX31865 || (TEMP_SENSOR_REDUNDANT_IS_MAX31865 && REDUNDANT_TEMP_MATCH(SOURCE, E0))
  2078. #if !defined(MAX31865_SENSOR_WIRES_0) || !WITHIN(MAX31865_SENSOR_WIRES_0, 2, 4)
  2079. #error "MAX31865_SENSOR_WIRES_0 must be defined as an integer between 2 and 4."
  2080. #elif !defined(MAX31865_SENSOR_OHMS_0) || !defined(MAX31865_CALIBRATION_OHMS_0)
  2081. #error "MAX31865_SENSOR_OHMS_0 and MAX31865_CALIBRATION_OHMS_0 must be set if TEMP_SENSOR_0/TEMP_SENSOR_REDUNDANT is MAX31865."
  2082. #endif
  2083. #endif
  2084. #if TEMP_SENSOR_1_IS_MAX31865 || (TEMP_SENSOR_REDUNDANT_IS_MAX31865 && REDUNDANT_TEMP_MATCH(SOURCE, E1))
  2085. #if !defined(MAX31865_SENSOR_WIRES_1) || !WITHIN(MAX31865_SENSOR_WIRES_1, 2, 4)
  2086. #error "MAX31865_SENSOR_WIRES_1 must be defined as an integer between 2 and 4."
  2087. #elif !defined(MAX31865_SENSOR_OHMS_1) || !defined(MAX31865_CALIBRATION_OHMS_1)
  2088. #error "MAX31865_SENSOR_OHMS_1 and MAX31865_CALIBRATION_OHMS_1 must be set if TEMP_SENSOR_1/TEMP_SENSOR_REDUNDANT is MAX31865."
  2089. #endif
  2090. #endif
  2091. /**
  2092. * Redundant temperature sensor config
  2093. */
  2094. #if HAS_TEMP_REDUNDANT
  2095. #if !defined(TEMP_SENSOR_REDUNDANT_SOURCE)
  2096. #error "TEMP_SENSOR_REDUNDANT requires TEMP_SENSOR_REDUNDANT_SOURCE."
  2097. #elif !defined(TEMP_SENSOR_REDUNDANT_TARGET)
  2098. #error "TEMP_SENSOR_REDUNDANT requires TEMP_SENSOR_REDUNDANT_TARGET."
  2099. #elif REDUNDANT_TEMP_MATCH(SOURCE, TEMP_SENSOR_REDUNDANT_TARGET)
  2100. #error "TEMP_SENSOR_REDUNDANT_SOURCE can't be the same as TEMP_SENSOR_REDUNDANT_TARGET."
  2101. #elif HAS_MULTI_HOTEND && TEMP_SENSOR_REDUNDANT_SOURCE < HOTENDS
  2102. #error "TEMP_SENSOR_REDUNDANT_SOURCE must be after the last used hotend TEMP_SENSOR."
  2103. #endif
  2104. #if REDUNDANT_TEMP_MATCH(SOURCE, E0) && HAS_HOTEND
  2105. #error "TEMP_SENSOR_REDUNDANT_SOURCE can't be E0 if a hotend is used. E0 always uses TEMP_SENSOR_0."
  2106. #elif REDUNDANT_TEMP_MATCH(SOURCE, COOLER) && HAS_TEMP_COOLER
  2107. #error "TEMP_SENSOR_REDUNDANT_SOURCE can't be COOLER. TEMP_SENSOR_COOLER is in use."
  2108. #elif REDUNDANT_TEMP_MATCH(SOURCE, PROBE) && HAS_TEMP_PROBE
  2109. #error "TEMP_SENSOR_REDUNDANT_SOURCE can't be PROBE. TEMP_SENSOR_PROBE is in use."
  2110. #elif REDUNDANT_TEMP_MATCH(SOURCE, BOARD) && HAS_TEMP_BOARD
  2111. #error "TEMP_SENSOR_REDUNDANT_SOURCE can't be BOARD. TEMP_SENSOR_BOARD is in use."
  2112. #elif REDUNDANT_TEMP_MATCH(SOURCE, CHAMBER) && HAS_TEMP_CHAMBER
  2113. #error "TEMP_SENSOR_REDUNDANT_SOURCE can't be CHAMBER. TEMP_SENSOR_CHAMBER is in use."
  2114. #elif REDUNDANT_TEMP_MATCH(SOURCE, BED) && HAS_TEMP_BED
  2115. #error "TEMP_SENSOR_REDUNDANT_SOURCE can't be BED. TEMP_SENSOR_BED is in use."
  2116. #endif
  2117. #if REDUNDANT_TEMP_MATCH(TARGET, E0) && !PIN_EXISTS(TEMP_0)
  2118. #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E0 without TEMP_0_PIN defined."
  2119. #elif REDUNDANT_TEMP_MATCH(TARGET, E1) && !PIN_EXISTS(TEMP_1)
  2120. #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E1 without TEMP_1_PIN defined."
  2121. #elif REDUNDANT_TEMP_MATCH(TARGET, E2) && !PIN_EXISTS(TEMP_2)
  2122. #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E2 without TEMP_2_PIN defined."
  2123. #elif REDUNDANT_TEMP_MATCH(TARGET, E3) && !PIN_EXISTS(TEMP_3)
  2124. #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E3 without TEMP_3_PIN defined."
  2125. #elif REDUNDANT_TEMP_MATCH(TARGET, E4) && !PIN_EXISTS(TEMP_4)
  2126. #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E4 without TEMP_4_PIN defined."
  2127. #elif REDUNDANT_TEMP_MATCH(TARGET, E5) && !PIN_EXISTS(TEMP_5)
  2128. #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E5 without TEMP_5_PIN defined."
  2129. #elif REDUNDANT_TEMP_MATCH(TARGET, E6) && !PIN_EXISTS(TEMP_6)
  2130. #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E6 without TEMP_6_PIN defined."
  2131. #elif REDUNDANT_TEMP_MATCH(TARGET, E7) && !PIN_EXISTS(TEMP_7)
  2132. #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E7 without TEMP_7_PIN defined."
  2133. #elif REDUNDANT_TEMP_MATCH(TARGET, BED) && !PIN_EXISTS(TEMP_BED)
  2134. #error "TEMP_SENSOR_REDUNDANT_TARGET can't be BED without TEMP_BED_PIN defined."
  2135. #elif REDUNDANT_TEMP_MATCH(TARGET, CHAMBER) && !PIN_EXISTS(TEMP_CHAMBER)
  2136. #error "TEMP_SENSOR_REDUNDANT_TARGET can't be CHAMBER without TEMP_CHAMBER_PIN defined."
  2137. #elif REDUNDANT_TEMP_MATCH(TARGET, BOARD) && !PIN_EXISTS(TEMP_BOARD)
  2138. #error "TEMP_SENSOR_REDUNDANT_TARGET can't be BOARD without TEMP_BOARD_PIN defined."
  2139. #elif REDUNDANT_TEMP_MATCH(TARGET, PROBE) && !PIN_EXISTS(TEMP_PROBE)
  2140. #error "TEMP_SENSOR_REDUNDANT_TARGET can't be PROBE without TEMP_PROBE_PIN defined."
  2141. #elif REDUNDANT_TEMP_MATCH(TARGET, COOLER) && !PIN_EXISTS(TEMP_COOLER)
  2142. #error "TEMP_SENSOR_REDUNDANT_TARGET can't be COOLER without TEMP_COOLER_PIN defined."
  2143. #endif
  2144. #if TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E0) && !PIN_EXISTS(TEMP_0_CS)
  2145. #error "TEMP_SENSOR_REDUNDANT MAX Thermocouple with TEMP_SENSOR_REDUNDANT_SOURCE E0 requires TEMP_0_CS_PIN."
  2146. #elif TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E1) && !PIN_EXISTS(TEMP_1_CS)
  2147. #error "TEMP_SENSOR_REDUNDANT MAX Thermocouple with TEMP_SENSOR_REDUNDANT_SOURCE E1 requires TEMP_1_CS_PIN."
  2148. #endif
  2149. #endif
  2150. /**
  2151. * Test Sensor & Heater pin combos.
  2152. * Pins and Sensor IDs must be set for each heater
  2153. */
  2154. #if HAS_EXTRUDERS && !ANY_PIN(TEMP_0, TEMP_0_CS)
  2155. #error "TEMP_0_PIN or TEMP_0_CS_PIN not defined for this board."
  2156. #elif HAS_EXTRUDERS && !HAS_HEATER_0
  2157. #error "HEATER_0_PIN not defined for this board."
  2158. #elif TEMP_SENSOR_0_IS_MAX_TC && !PIN_EXISTS(TEMP_0_CS)
  2159. #error "TEMP_SENSOR_0 MAX thermocouple requires TEMP_0_CS_PIN."
  2160. #elif HAS_HOTEND && !HAS_TEMP_HOTEND && !TEMP_SENSOR_0_IS_DUMMY
  2161. #error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board."
  2162. #elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1
  2163. #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."
  2164. #endif
  2165. #if HAS_MULTI_HOTEND
  2166. #if TEMP_SENSOR_1_IS_MAX_TC && !PIN_EXISTS(TEMP_1_CS)
  2167. #error "TEMP_SENSOR_1 MAX thermocouple requires TEMP_1_CS_PIN."
  2168. #elif TEMP_SENSOR_1 == 0
  2169. #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
  2170. #elif !ANY_PIN(TEMP_1, TEMP_1_CS) && !TEMP_SENSOR_1_IS_DUMMY
  2171. #error "TEMP_1_PIN or TEMP_1_CS_PIN not defined for this board."
  2172. #endif
  2173. #if HOTENDS > 2
  2174. #if TEMP_SENSOR_2 == 0
  2175. #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
  2176. #elif !HAS_HEATER_2
  2177. #error "HEATER_2_PIN not defined for this board."
  2178. #elif !PIN_EXISTS(TEMP_2) && !TEMP_SENSOR_2_IS_DUMMY
  2179. #error "TEMP_2_PIN not defined for this board."
  2180. #endif
  2181. #if HOTENDS > 3
  2182. #if TEMP_SENSOR_3 == 0
  2183. #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
  2184. #elif !HAS_HEATER_3
  2185. #error "HEATER_3_PIN not defined for this board."
  2186. #elif !PIN_EXISTS(TEMP_3) && !TEMP_SENSOR_3_IS_DUMMY
  2187. #error "TEMP_3_PIN not defined for this board."
  2188. #endif
  2189. #if HOTENDS > 4
  2190. #if TEMP_SENSOR_4 == 0
  2191. #error "TEMP_SENSOR_4 is required with 5 or more HOTENDS."
  2192. #elif !HAS_HEATER_4
  2193. #error "HEATER_4_PIN not defined for this board."
  2194. #elif !PIN_EXISTS(TEMP_4) && !TEMP_SENSOR_4_IS_DUMMY
  2195. #error "TEMP_4_PIN not defined for this board."
  2196. #endif
  2197. #if HOTENDS > 5
  2198. #if TEMP_SENSOR_5 == 0
  2199. #error "TEMP_SENSOR_5 is required with 6 HOTENDS."
  2200. #elif !HAS_HEATER_5
  2201. #error "HEATER_5_PIN not defined for this board."
  2202. #elif !PIN_EXISTS(TEMP_5) && !TEMP_SENSOR_5_IS_DUMMY
  2203. #error "TEMP_5_PIN not defined for this board."
  2204. #endif
  2205. #if HOTENDS > 6
  2206. #if TEMP_SENSOR_6 == 0
  2207. #error "TEMP_SENSOR_6 is required with 6 HOTENDS."
  2208. #elif !HAS_HEATER_6
  2209. #error "HEATER_6_PIN not defined for this board."
  2210. #elif !PIN_EXISTS(TEMP_6) && !TEMP_SENSOR_6_IS_DUMMY
  2211. #error "TEMP_6_PIN not defined for this board."
  2212. #endif
  2213. #if HOTENDS > 7
  2214. #if TEMP_SENSOR_7 == 0
  2215. #error "TEMP_SENSOR_7 is required with 7 HOTENDS."
  2216. #elif !HAS_HEATER_7
  2217. #error "HEATER_7_PIN not defined for this board."
  2218. #elif !PIN_EXISTS(TEMP_7) && !TEMP_SENSOR_7_IS_DUMMY
  2219. #error "TEMP_7_PIN not defined for this board."
  2220. #endif
  2221. #endif // HOTENDS > 7
  2222. #endif // HOTENDS > 6
  2223. #endif // HOTENDS > 5
  2224. #endif // HOTENDS > 4
  2225. #endif // HOTENDS > 3
  2226. #endif // HOTENDS > 2
  2227. #endif // HAS_MULTI_HOTEND
  2228. /**
  2229. * Pins must be set for temp sensors, with some other feature requirements.
  2230. */
  2231. #if TEMP_SENSOR_CHAMBER && !PIN_EXISTS(TEMP_CHAMBER)
  2232. #error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN."
  2233. #endif
  2234. #if TEMP_SENSOR_COOLER
  2235. #if !PIN_EXISTS(TEMP_COOLER)
  2236. #error "TEMP_SENSOR_COOLER requires TEMP_COOLER_PIN."
  2237. #elif DISABLED(LASER_FEATURE)
  2238. #error "TEMP_SENSOR_COOLER requires LASER_FEATURE."
  2239. #endif
  2240. #endif
  2241. #if TEMP_SENSOR_PROBE
  2242. #if !PIN_EXISTS(TEMP_PROBE)
  2243. #error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN."
  2244. #elif DISABLED(FIX_MOUNTED_PROBE)
  2245. #error "TEMP_SENSOR_PROBE shouldn't be set without FIX_MOUNTED_PROBE."
  2246. #endif
  2247. #endif
  2248. #if TEMP_SENSOR_BOARD
  2249. #if !PIN_EXISTS(TEMP_BOARD)
  2250. #error "TEMP_SENSOR_BOARD requires TEMP_BOARD_PIN."
  2251. #elif ENABLED(THERMAL_PROTECTION_BOARD) && (!defined(BOARD_MINTEMP) || !defined(BOARD_MAXTEMP))
  2252. #error "THERMAL_PROTECTION_BOARD requires BOARD_MINTEMP and BOARD_MAXTEMP."
  2253. #endif
  2254. #elif CONTROLLER_FAN_MIN_BOARD_TEMP
  2255. #error "CONTROLLER_FAN_MIN_BOARD_TEMP requires TEMP_SENSOR_BOARD."
  2256. #endif
  2257. #if TEMP_SENSOR_BOARD && !PIN_EXISTS(TEMP_BOARD)
  2258. #error "TEMP_SENSOR_BOARD requires TEMP_BOARD_PIN."
  2259. #endif
  2260. #if ENABLED(LASER_COOLANT_FLOW_METER) && !(PIN_EXISTS(FLOWMETER) && ENABLED(LASER_FEATURE))
  2261. #error "LASER_COOLANT_FLOW_METER requires FLOWMETER_PIN and LASER_FEATURE."
  2262. #endif
  2263. #if ENABLED(CHAMBER_FAN) && !(defined(CHAMBER_FAN_MODE) && WITHIN(CHAMBER_FAN_MODE, 0, 3))
  2264. #error "CHAMBER_FAN_MODE must be between 0 and 3."
  2265. #endif
  2266. #if ENABLED(CHAMBER_VENT)
  2267. #ifndef CHAMBER_VENT_SERVO_NR
  2268. #error "CHAMBER_VENT_SERVO_NR is required for CHAMBER SERVO."
  2269. #elif !NUM_SERVOS
  2270. #error "NUM_SERVOS is required for a Heated Chamber vent servo (CHAMBER_VENT_SERVO_NR)."
  2271. #elif CHAMBER_VENT_SERVO_NR >= NUM_SERVOS
  2272. #error "CHAMBER_VENT_SERVO_NR must be smaller than NUM_SERVOS."
  2273. #elif HAS_Z_SERVO_PROBE && CHAMBER_VENT_SERVO_NR == Z_PROBE_SERVO_NR
  2274. #error "CHAMBER SERVO is already used by BLTOUCH."
  2275. #elif CHAMBER_VENT_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  2276. #error "SERVO0_PIN must be defined for your Heated Chamber vent servo."
  2277. #elif CHAMBER_VENT_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  2278. #error "SERVO1_PIN must be defined for your Heated Chamber vent servo."
  2279. #elif CHAMBER_VENT_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  2280. #error "SERVO2_PIN must be defined for your Heated Chamber vent servo."
  2281. #elif CHAMBER_VENT_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  2282. #error "SERVO3_PIN must be defined for your Heated Chamber vent servo."
  2283. #endif
  2284. #endif
  2285. /**
  2286. * Temperature status LEDs
  2287. */
  2288. #if ENABLED(TEMP_STAT_LEDS) && !ANY_PIN(STAT_LED_RED, STAT_LED_BLUE)
  2289. #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both."
  2290. #endif
  2291. /**
  2292. * FYSETC/MKS/BTT Mini Panel Requirements
  2293. */
  2294. #if EITHER(FYSETC_242_OLED_12864, FYSETC_MINI_12864_2_1)
  2295. #ifndef NEO_RGB
  2296. #define NEO_RGB 123
  2297. #define FAUX_RGB 1
  2298. #endif
  2299. #if defined(NEOPIXEL_TYPE) && NEOPIXEL_TYPE != NEO_RGB
  2300. #error "Your FYSETC/MKS/BTT Mini Panel requires NEOPIXEL_TYPE to be NEO_RGB."
  2301. #elif defined(NEOPIXEL_PIXELS) && NEOPIXEL_PIXELS < 3
  2302. #error "Your FYSETC/MKS/BTT Mini Panel requires NEOPIXEL_PIXELS >= 3."
  2303. #endif
  2304. #if FAUX_RGB
  2305. #undef NEO_RGB
  2306. #undef FAUX_RGB
  2307. #endif
  2308. #elif EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED)
  2309. #error "Your FYSETC Mini Panel requires RGB_LED."
  2310. #endif
  2311. /**
  2312. * LED Control Menu requirements
  2313. */
  2314. #if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS
  2315. #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9533, PCA9632, or NEOPIXEL_LED."
  2316. #endif
  2317. /**
  2318. * Basic multi hotend duplication mode
  2319. */
  2320. #if ENABLED(MULTI_NOZZLE_DUPLICATION)
  2321. #if ENABLED(SINGLENOZZLE)
  2322. #error "MULTI_NOZZLE_DUPLICATION is incompatible with SINGLENOZZLE."
  2323. #elif ENABLED(DUAL_X_CARRIAGE)
  2324. #error "MULTI_NOZZLE_DUPLICATION is incompatible with DUAL_X_CARRIAGE."
  2325. #elif ENABLED(MIXING_EXTRUDER)
  2326. #error "MULTI_NOZZLE_DUPLICATION is incompatible with MIXING_EXTRUDER."
  2327. #elif ENABLED(SWITCHING_EXTRUDER)
  2328. #error "MULTI_NOZZLE_DUPLICATION is incompatible with SWITCHING_EXTRUDER."
  2329. #elif HOTENDS < 2
  2330. #error "MULTI_NOZZLE_DUPLICATION requires 2 or more hotends."
  2331. #endif
  2332. #endif
  2333. /**
  2334. * Test Extruder Stepper Pins
  2335. */
  2336. #if HAS_EXTRUDERS
  2337. #if ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && !PINS_EXIST(E0_STEP, E0_DIR))
  2338. #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
  2339. #elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PINS_EXIST(E0_STEP, E0_DIR) || !HAS_E0_ENABLE))
  2340. #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
  2341. #elif EXTRUDERS && TEMP_SENSOR_0 == 0
  2342. #error "TEMP_SENSOR_0 is required if there are any extruders."
  2343. #endif
  2344. #endif
  2345. #if E_STEPPERS > 0 && !(PINS_EXIST(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
  2346. #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
  2347. #endif
  2348. #if E_STEPPERS > 1 && !(PINS_EXIST(E1_STEP, E1_DIR) && HAS_E1_ENABLE)
  2349. #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
  2350. #endif
  2351. #if E_STEPPERS > 2 && !(PINS_EXIST(E2_STEP, E2_DIR) && HAS_E2_ENABLE)
  2352. #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
  2353. #endif
  2354. #if E_STEPPERS > 3 && !(PINS_EXIST(E3_STEP, E3_DIR) && HAS_E3_ENABLE)
  2355. #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
  2356. #endif
  2357. #if E_STEPPERS > 4 && !(PINS_EXIST(E4_STEP, E4_DIR) && HAS_E4_ENABLE)
  2358. #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
  2359. #endif
  2360. #if E_STEPPERS > 5 && !(PINS_EXIST(E5_STEP, E5_DIR) && HAS_E5_ENABLE)
  2361. #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
  2362. #endif
  2363. #if E_STEPPERS > 6 && !(PINS_EXIST(E6_STEP, E6_DIR) && HAS_E6_ENABLE)
  2364. #error "E6_STEP_PIN, E6_DIR_PIN, or E6_ENABLE_PIN not defined for this board."
  2365. #endif
  2366. #if E_STEPPERS > 7 && !(PINS_EXIST(E7_STEP, E7_DIR) && HAS_E7_ENABLE)
  2367. #error "E7_STEP_PIN, E7_DIR_PIN, or E7_ENABLE_PIN not defined for this board."
  2368. #endif
  2369. /**
  2370. * Endstop Tests
  2371. */
  2372. #define _PLUG_UNUSED_TEST(A,P) (DISABLED(USE_##P##MIN_PLUG, USE_##P##MAX_PLUG) \
  2373. && !(ENABLED(A##_DUAL_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) \
  2374. && !(ENABLED(A##_MULTI_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) )
  2375. #define _AXIS_PLUG_UNUSED_TEST(A) (1 NUM_AXIS_GANG(&& _PLUG_UNUSED_TEST(A,X), && _PLUG_UNUSED_TEST(A,Y), && _PLUG_UNUSED_TEST(A,Z), \
  2376. && _PLUG_UNUSED_TEST(A,I), && _PLUG_UNUSED_TEST(A,J), && _PLUG_UNUSED_TEST(A,K), \
  2377. && _PLUG_UNUSED_TEST(A,U), && _PLUG_UNUSED_TEST(A,V), && _PLUG_UNUSED_TEST(A,W) ) )
  2378. // A machine with endstops must have a minimum of 3
  2379. #if HAS_ENDSTOPS
  2380. #if _AXIS_PLUG_UNUSED_TEST(X)
  2381. #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG."
  2382. #endif
  2383. #if _AXIS_PLUG_UNUSED_TEST(Y)
  2384. #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG."
  2385. #endif
  2386. #if _AXIS_PLUG_UNUSED_TEST(Z)
  2387. #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG."
  2388. #endif
  2389. #if HAS_I_AXIS && _AXIS_PLUG_UNUSED_TEST(I)
  2390. #error "You must enable USE_IMIN_PLUG or USE_IMAX_PLUG."
  2391. #endif
  2392. #if HAS_J_AXIS && _AXIS_PLUG_UNUSED_TEST(J)
  2393. #error "You must enable USE_JMIN_PLUG or USE_JMAX_PLUG."
  2394. #endif
  2395. #if HAS_K_AXIS && _AXIS_PLUG_UNUSED_TEST(K)
  2396. #error "You must enable USE_KMIN_PLUG or USE_KMAX_PLUG."
  2397. #endif
  2398. #if HAS_U_AXIS && _AXIS_PLUG_UNUSED_TEST(U)
  2399. #error "You must enable USE_UMIN_PLUG or USE_UMAX_PLUG."
  2400. #endif
  2401. #if HAS_V_AXIS && _AXIS_PLUG_UNUSED_TEST(V)
  2402. #error "You must enable USE_VMIN_PLUG or USE_VMAX_PLUG."
  2403. #endif
  2404. #if HAS_W_AXIS && _AXIS_PLUG_UNUSED_TEST(W)
  2405. #error "You must enable USE_WMIN_PLUG or USE_WMAX_PLUG."
  2406. #endif
  2407. // Delta and Cartesian use 3 homing endstops
  2408. #if NONE(IS_SCARA, SPI_ENDSTOPS)
  2409. #if X_HOME_TO_MIN && DISABLED(USE_XMIN_PLUG)
  2410. #error "Enable USE_XMIN_PLUG when homing X to MIN."
  2411. #elif X_HOME_TO_MAX && DISABLED(USE_XMAX_PLUG)
  2412. #error "Enable USE_XMAX_PLUG when homing X to MAX."
  2413. #elif Y_HOME_TO_MIN && DISABLED(USE_YMIN_PLUG)
  2414. #error "Enable USE_YMIN_PLUG when homing Y to MIN."
  2415. #elif Y_HOME_TO_MAX && DISABLED(USE_YMAX_PLUG)
  2416. #error "Enable USE_YMAX_PLUG when homing Y to MAX."
  2417. #elif HAS_I_AXIS && I_HOME_TO_MIN && DISABLED(USE_IMIN_PLUG)
  2418. #error "Enable USE_IMIN_PLUG when homing I to MIN."
  2419. #elif HAS_I_AXIS && I_HOME_TO_MAX && DISABLED(USE_IMAX_PLUG)
  2420. #error "Enable USE_IMAX_PLUG when homing I to MAX."
  2421. #elif HAS_J_AXIS && J_HOME_TO_MIN && DISABLED(USE_JMIN_PLUG)
  2422. #error "Enable USE_JMIN_PLUG when homing J to MIN."
  2423. #elif HAS_J_AXIS && J_HOME_TO_MAX && DISABLED(USE_JMAX_PLUG)
  2424. #error "Enable USE_JMAX_PLUG when homing J to MAX."
  2425. #elif HAS_K_AXIS && K_HOME_TO_MIN && DISABLED(USE_KMIN_PLUG)
  2426. #error "Enable USE_KMIN_PLUG when homing K to MIN."
  2427. #elif HAS_K_AXIS && K_HOME_TO_MAX && DISABLED(USE_KMAX_PLUG)
  2428. #error "Enable USE_KMAX_PLUG when homing K to MAX."
  2429. #elif HAS_U_AXIS && U_HOME_TO_MIN && DISABLED(USE_UMIN_PLUG)
  2430. #error "Enable USE_UMIN_PLUG when homing U to MIN."
  2431. #elif HAS_U_AXIS && U_HOME_TO_MAX && DISABLED(USE_UMAX_PLUG)
  2432. #error "Enable USE_UMAX_PLUG when homing U to MAX."
  2433. #elif HAS_V_AXIS && V_HOME_TO_MIN && DISABLED(USE_VMIN_PLUG)
  2434. #error "Enable USE_VMIN_PLUG when homing V to MIN."
  2435. #elif HAS_V_AXIS && V_HOME_TO_MAX && DISABLED(USE_VMAX_PLUG)
  2436. #error "Enable USE_VMAX_PLUG when homing V to MAX."
  2437. #elif HAS_W_AXIS && W_HOME_TO_MIN && DISABLED(USE_WMIN_PLUG)
  2438. #error "Enable USE_WMIN_PLUG when homing W to MIN."
  2439. #elif HAS_W_AXIS && W_HOME_TO_MAX && DISABLED(USE_WMAX_PLUG)
  2440. #error "Enable USE_WMAX_PLUG when homing W to MAX."
  2441. #endif
  2442. #endif
  2443. // Z homing direction and plug usage flags
  2444. #if Z_HOME_TO_MIN && NONE(USE_ZMIN_PLUG, HOMING_Z_WITH_PROBE)
  2445. #error "Enable USE_ZMIN_PLUG when homing Z to MIN."
  2446. #elif Z_HOME_TO_MAX && ENABLED(USE_PROBE_FOR_Z_HOMING)
  2447. #error "Z_HOME_DIR must be -1 when homing Z with the probe."
  2448. #elif BOTH(HOMING_Z_WITH_PROBE, Z_MULTI_ENDSTOPS)
  2449. #error "Z_MULTI_ENDSTOPS is incompatible with USE_PROBE_FOR_Z_HOMING."
  2450. #elif Z_HOME_TO_MAX && DISABLED(USE_ZMAX_PLUG)
  2451. #error "Enable USE_ZMAX_PLUG when homing Z to MAX."
  2452. #endif
  2453. #endif
  2454. #if BOTH(HOME_Z_FIRST, USE_PROBE_FOR_Z_HOMING)
  2455. #error "HOME_Z_FIRST can't be used when homing Z with a probe."
  2456. #endif
  2457. // Dual/multiple endstops requirements
  2458. #if ENABLED(X_DUAL_ENDSTOPS)
  2459. #if ENABLED(DELTA)
  2460. #error "X_DUAL_ENDSTOPS is not compatible with DELTA."
  2461. #elif !X2_USE_ENDSTOP
  2462. #error "X2_USE_ENDSTOP must be set with X_DUAL_ENDSTOPS."
  2463. #endif
  2464. #endif
  2465. #if ENABLED(Y_DUAL_ENDSTOPS)
  2466. #if ENABLED(DELTA)
  2467. #error "Y_DUAL_ENDSTOPS is not compatible with DELTA."
  2468. #elif !Y2_USE_ENDSTOP
  2469. #error "Y2_USE_ENDSTOP must be set with Y_DUAL_ENDSTOPS."
  2470. #endif
  2471. #endif
  2472. #if ENABLED(Z_MULTI_ENDSTOPS)
  2473. #if ENABLED(DELTA)
  2474. #error "Z_MULTI_ENDSTOPS is not compatible with DELTA."
  2475. #elif !Z2_USE_ENDSTOP
  2476. #error "Z2_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS."
  2477. #elif !Z3_USE_ENDSTOP && NUM_Z_STEPPERS >= 3
  2478. #error "Z3_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS and Z3_DRIVER_TYPE."
  2479. #elif !Z4_USE_ENDSTOP && NUM_Z_STEPPERS >= 4
  2480. #error "Z4_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS and Z4_DRIVER_TYPE."
  2481. #endif
  2482. #endif
  2483. #if defined(ENDSTOP_NOISE_THRESHOLD) && !WITHIN(ENDSTOP_NOISE_THRESHOLD, 2, 7)
  2484. #error "ENDSTOP_NOISE_THRESHOLD must be an integer from 2 to 7."
  2485. #endif
  2486. /**
  2487. * Emergency Command Parser
  2488. */
  2489. #if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON)
  2490. #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
  2491. #endif
  2492. /**
  2493. * Software Reset options
  2494. */
  2495. #if ENABLED(SOFT_RESET_VIA_SERIAL) && DISABLED(EMERGENCY_PARSER)
  2496. #error "EMERGENCY_PARSER is required to activate SOFT_RESET_VIA_SERIAL."
  2497. #endif
  2498. #if ENABLED(SOFT_RESET_ON_KILL) && !BUTTON_EXISTS(ENC)
  2499. #error "An encoder button is required or SOFT_RESET_ON_KILL will reset the printer without notice!"
  2500. #endif
  2501. // Reset reason for AVR
  2502. #if ENABLED(OPTIBOOT_RESET_REASON) && !defined(__AVR__)
  2503. #error "OPTIBOOT_RESET_REASON only applies to AVR."
  2504. #endif
  2505. /**
  2506. * I2C bus
  2507. */
  2508. #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0
  2509. #if I2C_SLAVE_ADDRESS < 8
  2510. #error "I2C_SLAVE_ADDRESS can't be less than 8. (Addresses 0 - 7 are reserved.)"
  2511. #elif I2C_SLAVE_ADDRESS > 127
  2512. #error "I2C_SLAVE_ADDRESS can't be over 127. (Only 7 bits allowed.)"
  2513. #endif
  2514. #endif
  2515. /**
  2516. * G35 Assisted Tramming
  2517. */
  2518. #if ENABLED(ASSISTED_TRAMMING) && !HAS_BED_PROBE
  2519. #error "ASSISTED_TRAMMING requires a bed probe."
  2520. #endif
  2521. /**
  2522. * G38 Probe Target
  2523. */
  2524. #if ENABLED(G38_PROBE_TARGET)
  2525. #if !HAS_BED_PROBE
  2526. #error "G38_PROBE_TARGET requires a bed probe."
  2527. #elif !IS_CARTESIAN
  2528. #error "G38_PROBE_TARGET requires a Cartesian machine."
  2529. #endif
  2530. #endif
  2531. /**
  2532. * RGB_LED Requirements
  2533. */
  2534. #define _RGB_TEST (PINS_EXIST(RGB_LED_R, RGB_LED_G, RGB_LED_B))
  2535. #if ENABLED(PRINTER_EVENT_LEDS) && !HAS_COLOR_LEDS
  2536. #error "PRINTER_EVENT_LEDS requires BLINKM, PCA9533, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED."
  2537. #elif ENABLED(RGB_LED)
  2538. #if !_RGB_TEST
  2539. #error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN."
  2540. #elif ENABLED(RGBW_LED)
  2541. #error "Please enable only one of RGB_LED and RGBW_LED."
  2542. #endif
  2543. #elif ENABLED(RGBW_LED)
  2544. #if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W))
  2545. #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN."
  2546. #endif
  2547. #endif
  2548. #undef _RGB_TEST
  2549. // NeoPixel requirements
  2550. #if ENABLED(NEOPIXEL_LED)
  2551. #if !PIN_EXISTS(NEOPIXEL) || NEOPIXEL_PIXELS == 0
  2552. #error "NEOPIXEL_LED requires NEOPIXEL_PIN and NEOPIXEL_PIXELS."
  2553. #elif ENABLED(NEOPIXEL2_SEPARATE) && !(defined(NEOPIXEL2_TYPE) && PIN_EXISTS(NEOPIXEL2) && NEOPIXEL2_PIXELS > 0)
  2554. #error "NEOPIXEL2_SEPARATE requires NEOPIXEL2_TYPE, NEOPIXEL2_PIN and NEOPIXEL2_PIXELS."
  2555. #elif ENABLED(NEO2_COLOR_PRESETS) && DISABLED(NEOPIXEL2_SEPARATE)
  2556. #error "NEO2_COLOR_PRESETS requires NEOPIXEL2_SEPARATE to be enabled."
  2557. #endif
  2558. #endif
  2559. #if DISABLED(NO_COMPILE_TIME_PWM)
  2560. #define _TEST_PWM(P) PWM_PIN(P)
  2561. #else
  2562. #define _TEST_PWM(P) 1 // pass
  2563. #endif
  2564. /**
  2565. * Auto Fan check for PWM pins
  2566. */
  2567. #if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255
  2568. #define AF_ERR_SUFF "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255."
  2569. #if HAS_AUTO_FAN_0
  2570. static_assert(_TEST_PWM(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF);
  2571. #elif HAS_AUTO_FAN_1
  2572. static_assert(_TEST_PWM(E1_AUTO_FAN_PIN), "E1" AF_ERR_SUFF);
  2573. #elif HAS_AUTO_FAN_2
  2574. static_assert(_TEST_PWM(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF);
  2575. #elif HAS_AUTO_FAN_3
  2576. static_assert(_TEST_PWM(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF);
  2577. #elif HAS_AUTO_FAN_4
  2578. static_assert(_TEST_PWM(E4_AUTO_FAN_PIN), "E4" AF_ERR_SUFF);
  2579. #elif HAS_AUTO_FAN_5
  2580. static_assert(_TEST_PWM(E5_AUTO_FAN_PIN), "E5" AF_ERR_SUFF);
  2581. #elif HAS_AUTO_FAN_6
  2582. static_assert(_TEST_PWM(E6_AUTO_FAN_PIN), "E6" AF_ERR_SUFF);
  2583. #elif HAS_AUTO_FAN_7
  2584. static_assert(_TEST_PWM(E7_AUTO_FAN_PIN), "E7" AF_ERR_SUFF);
  2585. #endif
  2586. #endif
  2587. /**
  2588. * Fan check
  2589. */
  2590. #if HAS_FANCHECK
  2591. #if BOTH(E0_FAN_TACHO_PULLUP, E0_FAN_TACHO_PULLDOWN)
  2592. #error "Enable only one of E0_FAN_TACHO_PULLUP or E0_FAN_TACHO_PULLDOWN."
  2593. #elif BOTH(E1_FAN_TACHO_PULLUP, E1_FAN_TACHO_PULLDOWN)
  2594. #error "Enable only one of E1_FAN_TACHO_PULLUP or E1_FAN_TACHO_PULLDOWN."
  2595. #elif BOTH(E2_FAN_TACHO_PULLUP, E2_FAN_TACHO_PULLDOWN)
  2596. #error "Enable only one of E2_FAN_TACHO_PULLUP or E2_FAN_TACHO_PULLDOWN."
  2597. #elif BOTH(E3_FAN_TACHO_PULLUP, E3_FAN_TACHO_PULLDOWN)
  2598. #error "Enable only one of E3_FAN_TACHO_PULLUP or E3_FAN_TACHO_PULLDOWN."
  2599. #elif BOTH(E4_FAN_TACHO_PULLUP, E4_FAN_TACHO_PULLDOWN)
  2600. #error "Enable only one of E4_FAN_TACHO_PULLUP or E4_FAN_TACHO_PULLDOWN."
  2601. #elif BOTH(E5_FAN_TACHO_PULLUP, E5_FAN_TACHO_PULLDOWN)
  2602. #error "Enable only one of E5_FAN_TACHO_PULLUP or E5_FAN_TACHO_PULLDOWN."
  2603. #elif BOTH(E6_FAN_TACHO_PULLUP, E6_FAN_TACHO_PULLDOWN)
  2604. #error "Enable only one of E6_FAN_TACHO_PULLUP or E6_FAN_TACHO_PULLDOWN."
  2605. #elif BOTH(E7_FAN_TACHO_PULLUP, E7_FAN_TACHO_PULLDOWN)
  2606. #error "Enable only one of E7_FAN_TACHO_PULLUP or E7_FAN_TACHO_PULLDOWN."
  2607. #endif
  2608. #elif ENABLED(AUTO_REPORT_FANS)
  2609. #error "AUTO_REPORT_FANS requires one or more fans with a tachometer pin."
  2610. #endif
  2611. /**
  2612. * Make sure only one EEPROM type is enabled
  2613. */
  2614. #if ENABLED(EEPROM_SETTINGS)
  2615. #if 1 < 0 \
  2616. + ENABLED(I2C_EEPROM) \
  2617. + ENABLED(SPI_EEPROM) \
  2618. + ENABLED(QSPI_EEPROM) \
  2619. + ENABLED(SDCARD_EEPROM_EMULATION) \
  2620. + ENABLED(FLASH_EEPROM_EMULATION) \
  2621. + ENABLED(SRAM_EEPROM_EMULATION) \
  2622. + ENABLED(IIC_BL24CXX_EEPROM)
  2623. #error "Please select only one method of EEPROM Persistent Storage."
  2624. #endif
  2625. #endif
  2626. /**
  2627. * Make sure features that need to write to the SD card can
  2628. */
  2629. #if ENABLED(SDCARD_READONLY) && ANY(POWER_LOSS_RECOVERY, BINARY_FILE_TRANSFER, SDCARD_EEPROM_EMULATION)
  2630. #undef SDCARD_READONLY
  2631. #if ENABLED(POWER_LOSS_RECOVERY)
  2632. #warning "Either disable SDCARD_READONLY or disable POWER_LOSS_RECOVERY."
  2633. #elif ENABLED(BINARY_FILE_TRANSFER)
  2634. #warning "Either disable SDCARD_READONLY or disable BINARY_FILE_TRANSFER."
  2635. #elif ENABLED(SDCARD_EEPROM_EMULATION)
  2636. #warning "Either disable SDCARD_READONLY or disable SDCARD_EEPROM_EMULATION."
  2637. #endif
  2638. #endif
  2639. #if ENABLED(SD_IGNORE_AT_STARTUP)
  2640. #if ENABLED(POWER_LOSS_RECOVERY)
  2641. #error "SD_IGNORE_AT_STARTUP is incompatible with POWER_LOSS_RECOVERY."
  2642. #elif ENABLED(SDCARD_EEPROM_EMULATION)
  2643. #error "SD_IGNORE_AT_STARTUP is incompatible with SDCARD_EEPROM_EMULATION."
  2644. #endif
  2645. #endif
  2646. /**
  2647. * Make sure only one display is enabled
  2648. */
  2649. #if 1 < 0 \
  2650. + ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
  2651. + ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
  2652. + (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \
  2653. + (ENABLED(MINIPANEL) && NONE(MKS_MINI_12864, ENDER2_STOCKDISPLAY)) \
  2654. + (ENABLED(MKS_MINI_12864) && NONE(MKS_LCD12864A, MKS_LCD12864B)) \
  2655. + (ENABLED(FYSETC_MINI_12864_2_1) && NONE(MKS_MINI_12864_V3, BTT_MINI_12864_V1)) \
  2656. + COUNT_ENABLED(MKS_MINI_12864_V3, BTT_MINI_12864_V1) \
  2657. + (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \
  2658. + (DISABLED(IS_LEGACY_TFT) && ENABLED(TFT_GENERIC)) \
  2659. + (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)) \
  2660. + COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35) \
  2661. + COUNT_ENABLED(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS, DGUS_LCD_UI_RELOADED) \
  2662. + COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY) \
  2663. + COUNT_ENABLED(DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE) \
  2664. + COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_GENERIC_12864_1_1) \
  2665. + COUNT_ENABLED(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) \
  2666. + COUNT_ENABLED(MKS_12864OLED, MKS_12864OLED_SSD1306) \
  2667. + 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, BIQU_BX_TFT70, BTT_TFT35_SPI_V1_0) \
  2668. + COUNT_ENABLED(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) \
  2669. + COUNT_ENABLED(VIKI2, miniVIKI) \
  2670. + ENABLED(WYH_L12864) \
  2671. + COUNT_ENABLED(ZONESTAR_12864LCD, ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306) \
  2672. + COUNT_ENABLED(ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING) \
  2673. + ENABLED(AZSMZ_12864) \
  2674. + ENABLED(BQ_LCD_SMART_CONTROLLER) \
  2675. + ENABLED(CARTESIO_UI) \
  2676. + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  2677. + ENABLED(FF_INTERFACEBOARD) \
  2678. + ENABLED(FYSETC_242_OLED_12864) \
  2679. + ENABLED(G3D_PANEL) \
  2680. + ENABLED(LCD_FOR_MELZI) \
  2681. + ENABLED(LCD_I2C_PANELOLU2) \
  2682. + ENABLED(LCD_I2C_VIKI) \
  2683. + ENABLED(LCM1602) \
  2684. + ENABLED(LONGER_LK_TFT28) \
  2685. + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
  2686. + ENABLED(MAKRPANEL) \
  2687. + ENABLED(MALYAN_LCD) \
  2688. + ENABLED(NEXTION_TFT) \
  2689. + ENABLED(MKS_LCD12864A) \
  2690. + ENABLED(MKS_LCD12864B) \
  2691. + ENABLED(OLED_PANEL_TINYBOY2) \
  2692. + ENABLED(OVERLORD_OLED) \
  2693. + ENABLED(PANEL_ONE) \
  2694. + ENABLED(RA_CONTROL_PANEL) \
  2695. + ENABLED(RADDS_DISPLAY) \
  2696. + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \
  2697. + ENABLED(RIGIDBOT_PANEL) \
  2698. + ENABLED(SAV_3DGLCD) \
  2699. + ENABLED(SAV_3DLCD) \
  2700. + ENABLED(SILVER_GATE_GLCD_CONTROLLER) \
  2701. + ENABLED(TFT_TRONXY_X5SA) \
  2702. + ENABLED(TOUCH_UI_FTDI_EVE) \
  2703. + ENABLED(U8GLIB_SH1106_EINSTART) \
  2704. + ENABLED(ULTI_CONTROLLER) \
  2705. + ENABLED(ULTIMAKERCONTROLLER) \
  2706. + ENABLED(ULTIPANEL) \
  2707. + ENABLED(ULTRA_LCD) \
  2708. + ENABLED(YHCB2004) \
  2709. + ENABLED(ZONESTAR_LCD) \
  2710. + ENABLED(K3D_FULL_GRAPHIC_SMART_CONTROLLER) \
  2711. + ENABLED(K3D_242_OLED_CONTROLLER)
  2712. #error "Please select only one LCD controller option."
  2713. #endif
  2714. #undef IS_U8GLIB_SSD1306
  2715. #undef IS_EXTUI
  2716. #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, BIQU_BX_TFT70, BTT_TFT35_SPI_V1_0)
  2717. #if NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
  2718. #error "TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI is required for your TFT. Please enable one."
  2719. #elif MANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
  2720. #error "Please select only one of TFT_COLOR_UI, TFT_CLASSIC_UI, or TFT_LVGL_UI."
  2721. #endif
  2722. #elif ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
  2723. #error "TFT_(COLOR|CLASSIC|LVGL)_UI requires a TFT display to be enabled."
  2724. #endif
  2725. #if ENABLED(TFT_GENERIC) && NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
  2726. #error "TFT_GENERIC requires either TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI interface."
  2727. #endif
  2728. #if BOTH(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
  2729. #error "Please enable only one of TFT_INTERFACE_SPI or TFT_INTERFACE_SPI."
  2730. #endif
  2731. #if defined(LCD_SCREEN_ROTATE) && LCD_SCREEN_ROTATE != 0 && LCD_SCREEN_ROTATE != 90 && LCD_SCREEN_ROTATE != 180 && LCD_SCREEN_ROTATE != 270
  2732. #error "LCD_SCREEN_ROTATE must be 0, 90, 180, or 270."
  2733. #endif
  2734. #if MANY(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320, TFT_RES_1024x600)
  2735. #error "Please select only one of TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320, or TFT_RES_1024x600."
  2736. #endif
  2737. #if ENABLED(TFT_LVGL_UI)
  2738. #if DISABLED(TFT_RES_480x320)
  2739. #error "TFT_LVGL_UI requires TFT_RES_480x320."
  2740. #elif DISABLED(SDSUPPORT)
  2741. #error "TFT_LVGL_UI requires SDSUPPORT."
  2742. #endif
  2743. #endif
  2744. #if defined(GRAPHICAL_TFT_UPSCALE) && !WITHIN(GRAPHICAL_TFT_UPSCALE, 2, 6)
  2745. #error "GRAPHICAL_TFT_UPSCALE must be between 2 and 6."
  2746. #endif
  2747. #if BOTH(CHIRON_TFT_STANDARD, CHIRON_TFT_NEW)
  2748. #error "Please select only one of CHIRON_TFT_STANDARD or CHIRON_TFT_NEW."
  2749. #endif
  2750. #if ENABLED(ANYCUBIC_LCD_CHIRON)
  2751. #if !defined(BEEPER_PIN)
  2752. #error "ANYCUBIC_LCD_CHIRON requires BEEPER_PIN"
  2753. #elif DISABLED(SDSUPPORT)
  2754. #error "ANYCUBIC_LCD_CHIRON requires SDSUPPORT"
  2755. #elif TEMP_SENSOR_BED == 0
  2756. #error "ANYCUBIC_LCD_CHIRON requires heatbed (TEMP_SENSOR_BED)"
  2757. #elif NONE(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
  2758. #error "ANYCUBIC_LCD_CHIRON requires one of: AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL or MESH_BED_LEVELING"
  2759. #elif DISABLED(BABYSTEPPING)
  2760. #error "ANYCUBIC_LCD_CHIRON requires BABYSTEPPING"
  2761. #endif
  2762. #endif
  2763. #if EITHER(MKS_TS35_V2_0, BTT_TFT35_SPI_V1_0) && SD_CONNECTION_IS(LCD)
  2764. #error "SDCARD_CONNECTION cannot be set to LCD for the enabled TFT. No available SD card reader."
  2765. #endif
  2766. /**
  2767. * Ender 3 V2 controller has some limitations
  2768. */
  2769. #if ENABLED(DWIN_CREALITY_LCD)
  2770. #if DISABLED(SDSUPPORT)
  2771. #error "DWIN_CREALITY_LCD requires SDSUPPORT to be enabled."
  2772. #elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU)
  2773. #error "DWIN_CREALITY_LCD does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU."
  2774. #elif EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU)
  2775. #error "DWIN_CREALITY_LCD does not support MPC_EDIT_MENU or MPC_AUTOTUNE_MENU."
  2776. #elif ENABLED(LCD_BED_TRAMMING)
  2777. #error "DWIN_CREALITY_LCD does not support LCD_BED_TRAMMING."
  2778. #elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY)
  2779. #error "DWIN_CREALITY_LCD does not support LCD_BED_LEVELING with PROBE_MANUALLY."
  2780. #endif
  2781. #elif ENABLED(DWIN_LCD_PROUI)
  2782. #if DISABLED(SDSUPPORT)
  2783. #error "DWIN_LCD_PROUI requires SDSUPPORT to be enabled."
  2784. #elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU)
  2785. #error "DWIN_LCD_PROUI does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU."
  2786. #elif EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU)
  2787. #error "DWIN_LCD_PROUI does not support MPC_EDIT_MENU or MPC_AUTOTUNE_MENU."
  2788. #elif ENABLED(LCD_BED_TRAMMING)
  2789. #error "DWIN_LCD_PROUI does not support LCD_BED_TRAMMING."
  2790. #elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY)
  2791. #error "DWIN_LCD_PROUI does not support LCD_BED_LEVELING with PROBE_MANUALLY."
  2792. #endif
  2793. #endif
  2794. #if LCD_BACKLIGHT_TIMEOUT
  2795. #if !HAS_ENCODER_ACTION
  2796. #error "LCD_BACKLIGHT_TIMEOUT requires an LCD with encoder or keypad."
  2797. #elif !PIN_EXISTS(LCD_BACKLIGHT)
  2798. #error "LCD_BACKLIGHT_TIMEOUT requires LCD_BACKLIGHT_PIN."
  2799. #endif
  2800. #endif
  2801. /**
  2802. * Display Sleep is not supported by these common displays
  2803. */
  2804. #if HAS_DISPLAY_SLEEP
  2805. #if ANY(IS_U8GLIB_LM6059_AF, IS_U8GLIB_ST7565_64128, REPRAPWORLD_GRAPHICAL_LCD, FYSETC_MINI, ENDER2_STOCKDISPLAY, MINIPANEL)
  2806. #error "DISPLAY_SLEEP_MINUTES is not supported by your display."
  2807. #elif !WITHIN(DISPLAY_SLEEP_MINUTES, 0, 255)
  2808. #error "DISPLAY_SLEEP_MINUTES must be between 0 and 255."
  2809. #endif
  2810. #endif
  2811. /**
  2812. * Some boards forbid the use of -1 Native USB
  2813. */
  2814. #if ENABLED(BOARD_NO_NATIVE_USB)
  2815. #undef BOARD_NO_NATIVE_USB
  2816. #if SERIAL_PORT == -1
  2817. #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."
  2818. #elif SERIAL_PORT_2 == -1
  2819. #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."
  2820. #elif MMU2_SERIAL_PORT == -1
  2821. #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."
  2822. #elif LCD_SERIAL_PORT == -1
  2823. #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."
  2824. #endif
  2825. #endif
  2826. /**
  2827. * MMU2 require a dedicated serial port
  2828. */
  2829. #ifdef MMU2_SERIAL_PORT
  2830. #if MMU2_SERIAL_PORT == SERIAL_PORT
  2831. #error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT."
  2832. #elif defined(SERIAL_PORT_2) && MMU2_SERIAL_PORT == SERIAL_PORT_2
  2833. #error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT_2."
  2834. #elif defined(LCD_SERIAL_PORT) && MMU2_SERIAL_PORT == LCD_SERIAL_PORT
  2835. #error "MMU2_SERIAL_PORT cannot be the same as LCD_SERIAL_PORT."
  2836. #endif
  2837. #endif
  2838. /**
  2839. * Serial displays require a dedicated serial port
  2840. */
  2841. #ifdef LCD_SERIAL_PORT
  2842. #if LCD_SERIAL_PORT == SERIAL_PORT
  2843. #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT."
  2844. #elif defined(SERIAL_PORT_2) && LCD_SERIAL_PORT == SERIAL_PORT_2
  2845. #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT_2."
  2846. #endif
  2847. #else
  2848. #if HAS_DGUS_LCD
  2849. #error "The DGUS LCD requires LCD_SERIAL_PORT to be defined."
  2850. #elif EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
  2851. #error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined."
  2852. #elif ENABLED(MALYAN_LCD)
  2853. #error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined."
  2854. #elif ENABLED(NEXTION_LCD)
  2855. #error "NEXTION_LCD requires LCD_SERIAL_PORT to be defined."
  2856. #endif
  2857. #endif
  2858. /**
  2859. * Check existing CS pins against enabled TMC SPI drivers.
  2860. */
  2861. #define INVALID_TMC_SPI(ST) (AXIS_HAS_SPI(ST) && !PIN_EXISTS(ST##_CS))
  2862. #if INVALID_TMC_SPI(X)
  2863. #error "An SPI driven TMC driver on X requires X_CS_PIN."
  2864. #elif INVALID_TMC_SPI(X2)
  2865. #error "An SPI driven TMC driver on X2 requires X2_CS_PIN."
  2866. #elif INVALID_TMC_SPI(Y)
  2867. #error "An SPI driven TMC driver on Y requires Y_CS_PIN."
  2868. #elif INVALID_TMC_SPI(Y2)
  2869. #error "An SPI driven TMC driver on Y2 requires Y2_CS_PIN."
  2870. #elif INVALID_TMC_SPI(Z)
  2871. #error "An SPI driven TMC driver on Z requires Z_CS_PIN."
  2872. #elif INVALID_TMC_SPI(Z2)
  2873. #error "An SPI driven TMC driver on Z2 requires Z2_CS_PIN."
  2874. #elif INVALID_TMC_SPI(Z3)
  2875. #error "An SPI driven TMC driver on Z3 requires Z3_CS_PIN."
  2876. #elif INVALID_TMC_SPI(Z4)
  2877. #error "An SPI driven TMC driver on Z4 requires Z4_CS_PIN."
  2878. #elif INVALID_TMC_SPI(E0)
  2879. #error "An SPI driven TMC driver on E0 requires E0_CS_PIN."
  2880. #elif INVALID_TMC_SPI(E1)
  2881. #error "An SPI driven TMC driver on E1 requires E1_CS_PIN."
  2882. #elif INVALID_TMC_SPI(E2)
  2883. #error "An SPI driven TMC driver on E2 requires E2_CS_PIN."
  2884. #elif INVALID_TMC_SPI(E3)
  2885. #error "An SPI driven TMC driver on E3 requires E3_CS_PIN."
  2886. #elif INVALID_TMC_SPI(E4)
  2887. #error "An SPI driven TMC driver on E4 requires E4_CS_PIN."
  2888. #elif INVALID_TMC_SPI(E5)
  2889. #error "An SPI driven TMC driver on E5 requires E5_CS_PIN."
  2890. #elif INVALID_TMC_SPI(E6)
  2891. #error "An SPI driven TMC driver on E6 requires E6_CS_PIN."
  2892. #elif INVALID_TMC_SPI(E7)
  2893. #error "An SPI driven TMC driver on E7 requires E7_CS_PIN."
  2894. #elif INVALID_TMC_SPI(I)
  2895. #error "An SPI driven TMC on I requires I_CS_PIN."
  2896. #elif INVALID_TMC_SPI(J)
  2897. #error "An SPI driven TMC on J requires J_CS_PIN."
  2898. #elif INVALID_TMC_SPI(K)
  2899. #error "An SPI driven TMC on K requires K_CS_PIN."
  2900. #elif INVALID_TMC_SPI(U)
  2901. #error "An SPI driven TMC on U requires U_CS_PIN."
  2902. #elif INVALID_TMC_SPI(V)
  2903. #error "An SPI driven TMC on V requires V_CS_PIN."
  2904. #elif INVALID_TMC_SPI(W)
  2905. #error "An SPI driven TMC on W requires W_CS_PIN."
  2906. #endif
  2907. #undef INVALID_TMC_SPI
  2908. /**
  2909. * Check existing RX/TX pins against enable TMC UART drivers.
  2910. */
  2911. #define INVALID_TMC_UART(ST) (AXIS_HAS_UART(ST) && !(defined(ST##_HARDWARE_SERIAL) || (PINS_EXIST(ST##_SERIAL_RX, ST##_SERIAL_TX))))
  2912. #if INVALID_TMC_UART(X)
  2913. #error "TMC2208 or TMC2209 on X requires X_HARDWARE_SERIAL or X_SERIAL_(RX|TX)_PIN."
  2914. #elif INVALID_TMC_UART(X2)
  2915. #error "TMC2208 or TMC2209 on X2 requires X2_HARDWARE_SERIAL or X2_SERIAL_(RX|TX)_PIN."
  2916. #elif INVALID_TMC_UART(Y)
  2917. #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL_(RX|TX)_PIN."
  2918. #elif INVALID_TMC_UART(Y2)
  2919. #error "TMC2208 or TMC2209 on Y2 requires Y2_HARDWARE_SERIAL or Y2_SERIAL_(RX|TX)_PIN."
  2920. #elif INVALID_TMC_UART(Z)
  2921. #error "TMC2208 or TMC2209 on Z requires Z_HARDWARE_SERIAL or Z_SERIAL_(RX|TX)_PIN."
  2922. #elif INVALID_TMC_UART(Z2)
  2923. #error "TMC2208 or TMC2209 on Z2 requires Z2_HARDWARE_SERIAL or Z2_SERIAL_(RX|TX)_PIN."
  2924. #elif INVALID_TMC_UART(Z3)
  2925. #error "TMC2208 or TMC2209 on Z3 requires Z3_HARDWARE_SERIAL or Z3_SERIAL_(RX|TX)_PIN."
  2926. #elif INVALID_TMC_UART(Z4)
  2927. #error "TMC2208 or TMC2209 on Z4 requires Z4_HARDWARE_SERIAL or Z4_SERIAL_(RX|TX)_PIN."
  2928. #elif INVALID_TMC_UART(E0)
  2929. #error "TMC2208 or TMC2209 on E0 requires E0_HARDWARE_SERIAL or E0_SERIAL_(RX|TX)_PIN."
  2930. #elif INVALID_TMC_UART(E1)
  2931. #error "TMC2208 or TMC2209 on E1 requires E1_HARDWARE_SERIAL or E1_SERIAL_(RX|TX)_PIN."
  2932. #elif INVALID_TMC_UART(E2)
  2933. #error "TMC2208 or TMC2209 on E2 requires E2_HARDWARE_SERIAL or E2_SERIAL_(RX|TX)_PIN."
  2934. #elif INVALID_TMC_UART(E3)
  2935. #error "TMC2208 or TMC2209 on E3 requires E3_HARDWARE_SERIAL or E3_SERIAL_(RX|TX)_PIN."
  2936. #elif INVALID_TMC_UART(E4)
  2937. #error "TMC2208 or TMC2209 on E4 requires E4_HARDWARE_SERIAL or E4_SERIAL_(RX|TX)_PIN."
  2938. #elif INVALID_TMC_UART(E5)
  2939. #error "TMC2208 or TMC2209 on E5 requires E5_HARDWARE_SERIAL or E5_SERIAL_(RX|TX)_PIN."
  2940. #elif INVALID_TMC_UART(E6)
  2941. #error "TMC2208 or TMC2209 on E6 requires E6_HARDWARE_SERIAL or E6_SERIAL_(RX|TX)_PIN."
  2942. #elif INVALID_TMC_UART(E7)
  2943. #error "TMC2208 or TMC2209 on E7 requires E7_HARDWARE_SERIAL or E7_SERIAL_(RX|TX)_PIN."
  2944. #elif HAS_I_AXIS && INVALID_TMC_UART(I)
  2945. #error "TMC2208 or TMC2209 on I requires I_HARDWARE_SERIAL or I_SERIAL_(RX|TX)_PIN."
  2946. #elif HAS_J_AXIS && INVALID_TMC_UART(J)
  2947. #error "TMC2208 or TMC2209 on J requires J_HARDWARE_SERIAL or J_SERIAL_(RX|TX)_PIN."
  2948. #elif HAS_K_AXIS && INVALID_TMC_UART(K)
  2949. #error "TMC2208 or TMC2209 on K requires K_HARDWARE_SERIAL or K_SERIAL_(RX|TX)_PIN."
  2950. #elif HAS_U_AXIS && INVALID_TMC_UART(U)
  2951. #error "TMC2208 or TMC2209 on U requires U_HARDWARE_SERIAL or U_SERIAL_(RX|TX)_PIN."
  2952. #elif HAS_V_AXIS && INVALID_TMC_UART(V)
  2953. #error "TMC2208 or TMC2209 on V requires V_HARDWARE_SERIAL or V_SERIAL_(RX|TX)_PIN."
  2954. #elif HAS_W_AXIS && INVALID_TMC_UART(W)
  2955. #error "TMC2208 or TMC2209 on W requires W_HARDWARE_SERIAL or W_SERIAL_(RX|TX)_PIN."
  2956. #endif
  2957. #undef INVALID_TMC_UART
  2958. /**
  2959. * TMC2209 slave address values
  2960. */
  2961. #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")
  2962. #if AXIS_DRIVER_TYPE_X(TMC2209)
  2963. INVALID_TMC_ADDRESS(X);
  2964. #elif AXIS_DRIVER_TYPE_X2(TMC2209)
  2965. INVALID_TMC_ADDRESS(X2);
  2966. #elif AXIS_DRIVER_TYPE_Y(TMC2209)
  2967. INVALID_TMC_ADDRESS(Y);
  2968. #elif AXIS_DRIVER_TYPE_Y2(TMC2209)
  2969. INVALID_TMC_ADDRESS(Y2);
  2970. #elif AXIS_DRIVER_TYPE_Z(TMC2209)
  2971. INVALID_TMC_ADDRESS(Z);
  2972. #elif AXIS_DRIVER_TYPE_Z2(TMC2209)
  2973. INVALID_TMC_ADDRESS(Z2);
  2974. #elif AXIS_DRIVER_TYPE_Z3(TMC2209)
  2975. INVALID_TMC_ADDRESS(Z3);
  2976. #elif AXIS_DRIVER_TYPE_Z4(TMC2209)
  2977. INVALID_TMC_ADDRESS(Z4);
  2978. #elif AXIS_DRIVER_TYPE_I(TMC2209)
  2979. INVALID_TMC_ADDRESS(I);
  2980. #elif AXIS_DRIVER_TYPE_J(TMC2209)
  2981. INVALID_TMC_ADDRESS(J);
  2982. #elif AXIS_DRIVER_TYPE_K(TMC2209)
  2983. INVALID_TMC_ADDRESS(K);
  2984. #elif AXIS_DRIVER_TYPE_U(TMC2209)
  2985. INVALID_TMC_ADDRESS(U);
  2986. #elif AXIS_DRIVER_TYPE_V(TMC2209)
  2987. INVALID_TMC_ADDRESS(V);
  2988. #elif AXIS_DRIVER_TYPE_W(TMC2209)
  2989. INVALID_TMC_ADDRESS(W);
  2990. #elif AXIS_DRIVER_TYPE_E0(TMC2209)
  2991. INVALID_TMC_ADDRESS(E0);
  2992. #elif AXIS_DRIVER_TYPE_E1(TMC2209)
  2993. INVALID_TMC_ADDRESS(E1);
  2994. #elif AXIS_DRIVER_TYPE_E2(TMC2209)
  2995. INVALID_TMC_ADDRESS(E2);
  2996. #elif AXIS_DRIVER_TYPE_E3(TMC2209)
  2997. INVALID_TMC_ADDRESS(E3);
  2998. #elif AXIS_DRIVER_TYPE_E4(TMC2209)
  2999. INVALID_TMC_ADDRESS(E4);
  3000. #elif AXIS_DRIVER_TYPE_E5(TMC2209)
  3001. INVALID_TMC_ADDRESS(E5);
  3002. #elif AXIS_DRIVER_TYPE_E6(TMC2209)
  3003. INVALID_TMC_ADDRESS(E6);
  3004. #elif AXIS_DRIVER_TYPE_E7(TMC2209)
  3005. INVALID_TMC_ADDRESS(E7);
  3006. #endif
  3007. #undef INVALID_TMC_ADDRESS
  3008. #define _TMC_MICROSTEP_IS_VALID(MS) (MS == 0 || MS == 2 || MS == 4 || MS == 8 || MS == 16 || MS == 32 || MS == 64 || MS == 128 || MS == 256)
  3009. #define TMC_MICROSTEP_IS_VALID(M) (!AXIS_IS_TMC(M) || _TMC_MICROSTEP_IS_VALID(M##_MICROSTEPS))
  3010. #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.")
  3011. #if !TMC_MICROSTEP_IS_VALID(X)
  3012. INVALID_TMC_MS(X);
  3013. #elif !TMC_MICROSTEP_IS_VALID(Y)
  3014. INVALID_TMC_MS(Y)
  3015. #elif !TMC_MICROSTEP_IS_VALID(Z)
  3016. INVALID_TMC_MS(Z)
  3017. #elif !TMC_MICROSTEP_IS_VALID(X2)
  3018. INVALID_TMC_MS(X2);
  3019. #elif !TMC_MICROSTEP_IS_VALID(Y2)
  3020. INVALID_TMC_MS(Y2)
  3021. #elif !TMC_MICROSTEP_IS_VALID(Z2)
  3022. INVALID_TMC_MS(Z2)
  3023. #elif !TMC_MICROSTEP_IS_VALID(Z3)
  3024. INVALID_TMC_MS(Z3)
  3025. #elif !TMC_MICROSTEP_IS_VALID(Z4)
  3026. INVALID_TMC_MS(Z4)
  3027. #elif !TMC_MICROSTEP_IS_VALID(E0)
  3028. INVALID_TMC_MS(E0)
  3029. #elif !TMC_MICROSTEP_IS_VALID(E1)
  3030. INVALID_TMC_MS(E1)
  3031. #elif !TMC_MICROSTEP_IS_VALID(E2)
  3032. INVALID_TMC_MS(E2)
  3033. #elif !TMC_MICROSTEP_IS_VALID(E3)
  3034. INVALID_TMC_MS(E3)
  3035. #elif !TMC_MICROSTEP_IS_VALID(E4)
  3036. INVALID_TMC_MS(E4)
  3037. #elif !TMC_MICROSTEP_IS_VALID(E5)
  3038. INVALID_TMC_MS(E5)
  3039. #elif !TMC_MICROSTEP_IS_VALID(E6)
  3040. INVALID_TMC_MS(E6)
  3041. #elif !TMC_MICROSTEP_IS_VALID(E7)
  3042. INVALID_TMC_MS(E7)
  3043. #elif HAS_I_AXIS && !TMC_MICROSTEP_IS_VALID(I)
  3044. INVALID_TMC_MS(I)
  3045. #elif HAS_J_AXIS && !TMC_MICROSTEP_IS_VALID(J)
  3046. INVALID_TMC_MS(J)
  3047. #elif HAS_K_AXIS && !TMC_MICROSTEP_IS_VALID(K)
  3048. INVALID_TMC_MS(K)
  3049. #elif HAS_U_AXIS && !TMC_MICROSTEP_IS_VALID(U)
  3050. INVALID_TMC_MS(U)
  3051. #elif HAS_V_AXIS && !TMC_MICROSTEP_IS_VALID(V)
  3052. INVALID_TMC_MS(V)
  3053. #elif HAS_W_AXIS && !TMC_MICROSTEP_IS_VALID(W)
  3054. INVALID_TMC_MS(W)
  3055. #endif
  3056. #undef INVALID_TMC_MS
  3057. #undef TMC_MICROSTEP_IS_VALID
  3058. #undef _TMC_MICROSTEP_IS_VALID
  3059. #if ENABLED(DELTA) && (ENABLED(STEALTHCHOP_XY) != ENABLED(STEALTHCHOP_Z))
  3060. #error "STEALTHCHOP_XY and STEALTHCHOP_Z must be the same on DELTA."
  3061. #endif
  3062. #if ENABLED(SENSORLESS_HOMING)
  3063. // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop
  3064. // is necessary in order to reset the stallGuard indication between the initial movement of all three
  3065. // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of
  3066. // clearing the stallGuard activated status is found.
  3067. // Stall detection DIAG = HIGH : TMC2209
  3068. // Stall detection DIAG = LOW : TMC2130/TMC2160/TMC2660/TMC5130/TMC5160
  3069. #define X_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(X,TMC2209)
  3070. #define Y_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Y,TMC2209)
  3071. #define Z_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Z,TMC2209)
  3072. #if HAS_I_AXIS
  3073. #define I_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(I,TMC2209)
  3074. #endif
  3075. #if HAS_J_AXIS
  3076. #define J_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(J,TMC2209)
  3077. #endif
  3078. #if HAS_K_AXIS
  3079. #define K_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(K,TMC2209)
  3080. #endif
  3081. #if HAS_U_AXIS
  3082. #define U_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(U,TMC2209)
  3083. #endif
  3084. #if HAS_V_AXIS
  3085. #define V_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(V,TMC2209)
  3086. #endif
  3087. #if HAS_W_AXIS
  3088. #define W_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(W,TMC2209)
  3089. #endif
  3090. #if NONE(SPI_ENDSTOPS, ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS)
  3091. #if X_SENSORLESS && X_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_XMIN)
  3092. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMIN (or ENDSTOPPULLUPS) when homing to X_MIN."
  3093. #elif X_SENSORLESS && X_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_XMAX)
  3094. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMAX (or ENDSTOPPULLUPS) when homing to X_MAX."
  3095. #elif Y_SENSORLESS && Y_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_YMIN)
  3096. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMIN (or ENDSTOPPULLUPS) when homing to Y_MIN."
  3097. #elif Y_SENSORLESS && Y_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_YMAX)
  3098. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMAX (or ENDSTOPPULLUPS) when homing to Y_MAX."
  3099. #elif Z_SENSORLESS && Z_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_ZMIN)
  3100. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN."
  3101. #elif Z_SENSORLESS && Z_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_ZMAX)
  3102. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX."
  3103. #elif ALL(HAS_I_AXIS, I_SENSORLESS, I_HOME_TO_MIN) && DISABLED(ENDSTOPPULLUP_IMIN)
  3104. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMIN (or ENDSTOPPULLUPS) when homing to I_MIN."
  3105. #elif ALL(HAS_I_AXIS, I_SENSORLESS, I_HOME_TO_MAX) && DISABLED(ENDSTOPPULLUP_IMAX)
  3106. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMAX (or ENDSTOPPULLUPS) when homing to I_MAX."
  3107. #elif ALL(HAS_J_AXIS, J_SENSORLESS, J_HOME_TO_MIN) && DISABLED(ENDSTOPPULLUP_JMIN)
  3108. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMIN (or ENDSTOPPULLUPS) when homing to J_MIN."
  3109. #elif ALL(HAS_J_AXIS, J_SENSORLESS, J_HOME_TO_MAX) && DISABLED(ENDSTOPPULLUP_JMAX)
  3110. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMAX (or ENDSTOPPULLUPS) when homing to J_MAX."
  3111. #elif ALL(HAS_K_AXIS, K_SENSORLESS, K_HOME_TO_MIN) && DISABLED(ENDSTOPPULLUP_KMIN)
  3112. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMIN (or ENDSTOPPULLUPS) when homing to K_MIN."
  3113. #elif ALL(HAS_K_AXIS, K_SENSORLESS, K_HOME_TO_MAX) && DISABLED(ENDSTOPPULLUP_KMAX)
  3114. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMAX (or ENDSTOPPULLUPS) when homing to K_MAX."
  3115. #elif HAS_U_AXIS && U_SENSORLESS && U_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_UMIN)
  3116. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_UMIN (or ENDSTOPPULLUPS) when homing to U_MIN."
  3117. #elif HAS_U_AXIS && U_SENSORLESS && U_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_UMAX)
  3118. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_UMAX (or ENDSTOPPULLUPS) when homing to U_MAX."
  3119. #elif HAS_V_AXIS && V_SENSORLESS && V_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_VMIN)
  3120. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_VMIN (or ENDSTOPPULLUPS) when homing to V_MIN."
  3121. #elif HAS_V_AXIS && V_SENSORLESS && V_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_VMAX)
  3122. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_VMAX (or ENDSTOPPULLUPS) when homing to V_MAX."
  3123. #elif HAS_W_AXIS && W_SENSORLESS && W_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_WMIN)
  3124. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_WMIN (or ENDSTOPPULLUPS) when homing to W_MIN."
  3125. #elif HAS_W_AXIS && W_SENSORLESS && W_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_WMAX)
  3126. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_WMAX (or ENDSTOPPULLUPS) when homing to W_MAX."
  3127. #endif
  3128. #endif
  3129. #if ENABLED(SPI_ENDSTOPS)
  3130. #if ENABLED(QUICK_HOME)
  3131. #warning "SPI_ENDSTOPS may be unreliable with QUICK_HOME. Adjust back-offs for better results."
  3132. #endif
  3133. #else
  3134. #if X_SENSORLESS && X_HOME_TO_MIN && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
  3135. #if X_ENDSTOP_INVERTING
  3136. #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = true when homing to X_MIN."
  3137. #else
  3138. #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to X_MIN."
  3139. #endif
  3140. #elif X_SENSORLESS && X_HOME_TO_MAX && X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
  3141. #if X_ENDSTOP_INVERTING
  3142. #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = true when homing to X_MAX."
  3143. #else
  3144. #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to X_MAX."
  3145. #endif
  3146. #elif Y_SENSORLESS && Y_HOME_TO_MIN && Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
  3147. #if Y_ENDSTOP_INVERTING
  3148. #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = true when homing to Y_MIN."
  3149. #else
  3150. #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MIN."
  3151. #endif
  3152. #elif Y_SENSORLESS && Y_HOME_TO_MAX && Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
  3153. #if Y_ENDSTOP_INVERTING
  3154. #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = true when homing to Y_MAX."
  3155. #else
  3156. #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MAX."
  3157. #endif
  3158. #elif Z_SENSORLESS && Z_HOME_TO_MIN && Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
  3159. #if Z_ENDSTOP_INVERTING
  3160. #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = true when homing to Z_MIN."
  3161. #else
  3162. #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MIN."
  3163. #endif
  3164. #elif Z_SENSORLESS && Z_HOME_TO_MAX && Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
  3165. #if Z_ENDSTOP_INVERTING
  3166. #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = true when homing to Z_MAX."
  3167. #else
  3168. #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MAX."
  3169. #endif
  3170. #elif ALL(HAS_I_AXIS, I_SENSORLESS, I_HOME_TO_MIN) && I_MIN_ENDSTOP_INVERTING != I_ENDSTOP_INVERTING
  3171. #if I_ENDSTOP_INVERTING
  3172. #error "SENSORLESS_HOMING requires I_MIN_ENDSTOP_INVERTING = true when homing to I_MIN."
  3173. #else
  3174. #error "SENSORLESS_HOMING requires I_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to I_MIN."
  3175. #endif
  3176. #elif ALL(HAS_I_AXIS, I_SENSORLESS, I_HOME_TO_MAX) && I_MAX_ENDSTOP_INVERTING != I_ENDSTOP_INVERTING
  3177. #if I_ENDSTOP_INVERTING
  3178. #error "SENSORLESS_HOMING requires I_MAX_ENDSTOP_INVERTING = true when homing to I_MAX."
  3179. #else
  3180. #error "SENSORLESS_HOMING requires I_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to I_MAX."
  3181. #endif
  3182. #elif ALL(HAS_J_AXIS, J_SENSORLESS, J_HOME_TO_MIN) && J_MIN_ENDSTOP_INVERTING != J_ENDSTOP_INVERTING
  3183. #if J_ENDSTOP_INVERTING
  3184. #error "SENSORLESS_HOMING requires J_MIN_ENDSTOP_INVERTING = true when homing to J_MIN."
  3185. #else
  3186. #error "SENSORLESS_HOMING requires J_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to J_MIN."
  3187. #endif
  3188. #elif ALL(HAS_J_AXIS, J_SENSORLESS, J_HOME_TO_MAX) && J_MAX_ENDSTOP_INVERTING != J_ENDSTOP_INVERTING
  3189. #if J_ENDSTOP_INVERTING
  3190. #error "SENSORLESS_HOMING requires J_MAX_ENDSTOP_INVERTING = true when homing to J_MAX."
  3191. #else
  3192. #error "SENSORLESS_HOMING requires J_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to J_MAX."
  3193. #endif
  3194. #elif ALL(HAS_K_AXIS, K_SENSORLESS, K_HOME_TO_MIN) && K_MIN_ENDSTOP_INVERTING != K_ENDSTOP_INVERTING
  3195. #if K_ENDSTOP_INVERTING
  3196. #error "SENSORLESS_HOMING requires K_MIN_ENDSTOP_INVERTING = true when homing to K_MIN."
  3197. #else
  3198. #error "SENSORLESS_HOMING requires K_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to K_MIN."
  3199. #endif
  3200. #elif ALL(HAS_K_AXIS, K_SENSORLESS, K_HOME_TO_MAX) && K_MAX_ENDSTOP_INVERTING != K_ENDSTOP_INVERTING
  3201. #if K_ENDSTOP_INVERTING
  3202. #error "SENSORLESS_HOMING requires K_MAX_ENDSTOP_INVERTING = true when homing to K_MAX."
  3203. #else
  3204. #error "SENSORLESS_HOMING requires K_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to K_MAX."
  3205. #endif
  3206. #elif ALL(HAS_U_AXIS, U_SENSORLESS, U_HOME_TO_MIN) && U_MIN_ENDSTOP_INVERTING != U_ENDSTOP_INVERTING
  3207. #if U_ENDSTOP_INVERTING
  3208. #error "SENSORLESS_HOMING requires U_MIN_ENDSTOP_INVERTING = true when homing to U_MIN."
  3209. #else
  3210. #error "SENSORLESS_HOMING requires U_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to U_MIN."
  3211. #endif
  3212. #elif ALL(HAS_U_AXIS, U_SENSORLESS, U_HOME_TO_MAX) && U_MAX_ENDSTOP_INVERTING != U_ENDSTOP_INVERTING
  3213. #if U_ENDSTOP_INVERTING
  3214. #error "SENSORLESS_HOMING requires U_MAX_ENDSTOP_INVERTING = true when homing to U_MAX."
  3215. #else
  3216. #error "SENSORLESS_HOMING requires U_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to U_MAX."
  3217. #endif
  3218. #elif ALL(HAS_V_AXIS, V_SENSORLESS, V_HOME_TO_MIN) && V_MIN_ENDSTOP_INVERTING != V_ENDSTOP_INVERTING
  3219. #if V_ENDSTOP_INVERTING
  3220. #error "SENSORLESS_HOMING requires V_MIN_ENDSTOP_INVERTING = true when homing to V_MIN."
  3221. #else
  3222. #error "SENSORLESS_HOMING requires V_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to V_MIN."
  3223. #endif
  3224. #elif ALL(HAS_V_AXIS, V_SENSORLESS, V_HOME_TO_MAX) && V_MAX_ENDSTOP_INVERTING != V_ENDSTOP_INVERTING
  3225. #if V_ENDSTOP_INVERTING
  3226. #error "SENSORLESS_HOMING requires V_MAX_ENDSTOP_INVERTING = true when homing to V_MAX."
  3227. #else
  3228. #error "SENSORLESS_HOMING requires V_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to V_MAX."
  3229. #endif
  3230. #elif ALL(HAS_W_AXIS, W_SENSORLESS, W_HOME_TO_MIN) && W_MIN_ENDSTOP_INVERTING != W_ENDSTOP_INVERTING
  3231. #if W_ENDSTOP_INVERTING
  3232. #error "SENSORLESS_HOMING requires W_MIN_ENDSTOP_INVERTING = true when homing to W_MIN."
  3233. #else
  3234. #error "SENSORLESS_HOMING requires W_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to W_MIN."
  3235. #endif
  3236. #elif ALL(HAS_W_AXIS, W_SENSORLESS, W_HOME_TO_MAX0) && W_MAX_ENDSTOP_INVERTING != W_ENDSTOP_INVERTING
  3237. #if W_ENDSTOP_INVERTING
  3238. #error "SENSORLESS_HOMING requires W_MAX_ENDSTOP_INVERTING = true when homing to W_MAX."
  3239. #else
  3240. #error "SENSORLESS_HOMING requires W_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to W_MAX."
  3241. #endif
  3242. #endif
  3243. #endif
  3244. #if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z)
  3245. #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z."
  3246. #elif ENDSTOP_NOISE_THRESHOLD
  3247. #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD."
  3248. #elif !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS)
  3249. #error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, or Z axes."
  3250. #endif
  3251. #undef X_ENDSTOP_INVERTING
  3252. #undef Y_ENDSTOP_INVERTING
  3253. #undef Z_ENDSTOP_INVERTING
  3254. #undef I_ENDSTOP_INVERTING
  3255. #undef J_ENDSTOP_INVERTING
  3256. #undef K_ENDSTOP_INVERTING
  3257. #undef U_ENDSTOP_INVERTING
  3258. #undef V_ENDSTOP_INVERTING
  3259. #undef W_ENDSTOP_INVERTING
  3260. #endif
  3261. // Sensorless probing requirements
  3262. #if ENABLED(SENSORLESS_PROBING)
  3263. #if ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS)
  3264. #error "SENSORLESS_PROBING for DELTA requires TMC stepper drivers with StallGuard on X, Y, and Z axes."
  3265. #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  3266. #error "SENSORLESS_PROBING cannot be used with Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN."
  3267. #elif ENABLED(USE_PROBE_FOR_Z_HOMING)
  3268. #error "SENSORLESS_PROBING cannot be used with USE_PROBE_FOR_Z_HOMING."
  3269. #elif !Z_SENSORLESS
  3270. #error "SENSORLESS_PROBING requires a TMC stepper driver with StallGuard on Z."
  3271. #endif
  3272. #endif
  3273. // Sensorless homing is required for both combined steppers in an H-bot
  3274. #if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS
  3275. #error "CoreXY requires both X and Y to use sensorless homing if either one does."
  3276. #elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS && !HOMING_Z_WITH_PROBE
  3277. #error "CoreXZ requires both X and Z to use sensorless homing if either one does."
  3278. #elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS && !HOMING_Z_WITH_PROBE
  3279. #error "CoreYZ requires both Y and Z to use sensorless homing if either one does."
  3280. #elif EITHER(MARKFORGED_XY, MARKFORGED_YX) && X_SENSORLESS != Y_SENSORLESS
  3281. #error "MARKFORGED requires both X and Y to use sensorless homing if either one does."
  3282. #endif
  3283. // Other TMC feature requirements
  3284. #if ENABLED(HYBRID_THRESHOLD) && !STEALTHCHOP_ENABLED
  3285. #error "Enable STEALTHCHOP_(XY|Z|E) to use HYBRID_THRESHOLD."
  3286. #elif ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD
  3287. #error "SENSORLESS_HOMING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
  3288. #elif ENABLED(SENSORLESS_PROBING) && !HAS_STALLGUARD
  3289. #error "SENSORLESS_PROBING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
  3290. #elif STEALTHCHOP_ENABLED && !HAS_STEALTHCHOP
  3291. #error "STEALTHCHOP requires TMC2130, TMC2160, TMC2208, TMC2209, or TMC5160 stepper drivers."
  3292. #endif
  3293. /**
  3294. * TMC SPI Chaining
  3295. */
  3296. #define IN_CHAIN(A) ((A##_CHAIN_POS > 0) && !HAS_L64XX)
  3297. #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) \
  3298. || IN_CHAIN(E0) || IN_CHAIN(E1) || IN_CHAIN(E2) || IN_CHAIN(E3) || IN_CHAIN(E4) || IN_CHAIN(E5) || IN_CHAIN(E6) || IN_CHAIN(E7)
  3299. #define BAD_CHAIN(A) (IN_CHAIN(A) && !PIN_EXISTS(A##_CS))
  3300. #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) \
  3301. || BAD_CHAIN(E0) || BAD_CHAIN(E1) || BAD_CHAIN(E2) || BAD_CHAIN(E3) || BAD_CHAIN(E4) || BAD_CHAIN(E5) || BAD_CHAIN(E6) || BAD_CHAIN(E7)
  3302. #error "All chained TMC drivers need a CS pin."
  3303. #else
  3304. #if IN_CHAIN(X)
  3305. #define CS_COMPARE X_CS_PIN
  3306. #elif IN_CHAIN(Y)
  3307. #define CS_COMPARE Y_CS_PIN
  3308. #elif IN_CHAIN(Z)
  3309. #define CS_COMPARE Z_CS_PIN
  3310. #elif IN_CHAIN(X2)
  3311. #define CS_COMPARE X2_CS_PIN
  3312. #elif IN_CHAIN(Y2)
  3313. #define CS_COMPARE Y2_CS_PIN
  3314. #elif IN_CHAIN(Z2)
  3315. #define CS_COMPARE Z2_CS_PIN
  3316. #elif IN_CHAIN(Z3)
  3317. #define CS_COMPARE Z3_CS_PIN
  3318. #elif IN_CHAIN(I)
  3319. #define CS_COMPARE I_CS_PIN
  3320. #elif IN_CHAIN(J)
  3321. #define CS_COMPARE J_CS_PIN
  3322. #elif IN_CHAIN(K)
  3323. #define CS_COMPARE K_CS_PIN
  3324. #elif IN_CHAIN(U)
  3325. #define CS_COMPARE U_CS_PIN
  3326. #elif IN_CHAIN(V)
  3327. #define CS_COMPARE V_CS_PIN
  3328. #elif IN_CHAIN(W)
  3329. #define CS_COMPARE W_CS_PIN
  3330. #elif IN_CHAIN(E0)
  3331. #define CS_COMPARE E0_CS_PIN
  3332. #elif IN_CHAIN(E1)
  3333. #define CS_COMPARE E1_CS_PIN
  3334. #elif IN_CHAIN(E2)
  3335. #define CS_COMPARE E2_CS_PIN
  3336. #elif IN_CHAIN(E3)
  3337. #define CS_COMPARE E3_CS_PIN
  3338. #elif IN_CHAIN(E4)
  3339. #define CS_COMPARE E4_CS_PIN
  3340. #elif IN_CHAIN(E5)
  3341. #define CS_COMPARE E5_CS_PIN
  3342. #elif IN_CHAIN(E6)
  3343. #define CS_COMPARE E6_CS_PIN
  3344. #elif IN_CHAIN(E7)
  3345. #define CS_COMPARE E7_CS_PIN
  3346. #endif
  3347. #define BAD_CS_PIN(A) (IN_CHAIN(A) && A##_CS_PIN != CS_COMPARE)
  3348. #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) \
  3349. || BAD_CS_PIN(I) || BAD_CS_PIN(J) || BAD_CS_PIN(K) \
  3350. || BAD_CS_PIN(U) || BAD_CS_PIN(V) || BAD_CS_PIN(W) \
  3351. || 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)
  3352. #error "All chained TMC drivers must use the same CS pin."
  3353. #endif
  3354. #undef BAD_CS_PIN
  3355. #undef CS_COMPARE
  3356. #endif
  3357. #undef BAD_CHAIN
  3358. #endif
  3359. #undef IN_CHAIN
  3360. /**
  3361. * L64XX requirement
  3362. */
  3363. #if HAS_L64XX && NUM_AXES > 3
  3364. #error "L64XX requires NUM_AXES <= 3. Homing with L64XX is not yet implemented for NUM_AXES > 3."
  3365. #endif
  3366. /**
  3367. * Digipot requirement
  3368. */
  3369. #if HAS_MOTOR_CURRENT_I2C
  3370. #if BOTH(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
  3371. #error "Enable only one of DIGIPOT_MCP4018 or DIGIPOT_MCP4451."
  3372. #elif !MB(MKS_SBASE, AZTEEG_X5_GT, AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI) \
  3373. && (!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))
  3374. #error "DIGIPOT_MCP4018/4451 requires DIGIPOTS_I2C_SDA_* pins to be defined."
  3375. #endif
  3376. #endif
  3377. /**
  3378. * Check per-axis initializers for errors
  3379. */
  3380. #define __PLUS_TEST(I,A) && (sanity_arr_##A[_MIN(I,signed(COUNT(sanity_arr_##A)-1))] > 0)
  3381. #define _PLUS_TEST(A) (1 REPEAT2(14,__PLUS_TEST,A))
  3382. #if HAS_MULTI_EXTRUDER
  3383. #define _EXTRA_NOTE " (Did you forget to enable DISTINCT_E_FACTORS?)"
  3384. #else
  3385. #define _EXTRA_NOTE " (Should be " STRINGIFY(NUM_AXES) "+" STRINGIFY(E_STEPPERS) ")"
  3386. #endif
  3387. constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT;
  3388. static_assert(COUNT(sanity_arr_1) >= LOGICAL_AXES, "DEFAULT_AXIS_STEPS_PER_UNIT requires " _LOGICAL_AXES_STR "elements.");
  3389. static_assert(COUNT(sanity_arr_1) <= DISTINCT_AXES, "DEFAULT_AXIS_STEPS_PER_UNIT has too many elements." _EXTRA_NOTE);
  3390. static_assert(_PLUS_TEST(1), "DEFAULT_AXIS_STEPS_PER_UNIT values must be positive.");
  3391. constexpr float sanity_arr_2[] = DEFAULT_MAX_FEEDRATE;
  3392. static_assert(COUNT(sanity_arr_2) >= LOGICAL_AXES, "DEFAULT_MAX_FEEDRATE requires " _LOGICAL_AXES_STR "elements.");
  3393. static_assert(COUNT(sanity_arr_2) <= DISTINCT_AXES, "DEFAULT_MAX_FEEDRATE has too many elements." _EXTRA_NOTE);
  3394. static_assert(_PLUS_TEST(2), "DEFAULT_MAX_FEEDRATE values must be positive.");
  3395. constexpr float sanity_arr_3[] = DEFAULT_MAX_ACCELERATION;
  3396. static_assert(COUNT(sanity_arr_3) >= LOGICAL_AXES, "DEFAULT_MAX_ACCELERATION requires " _LOGICAL_AXES_STR "elements.");
  3397. static_assert(COUNT(sanity_arr_3) <= DISTINCT_AXES, "DEFAULT_MAX_ACCELERATION has too many elements." _EXTRA_NOTE);
  3398. static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive.");
  3399. constexpr float sanity_arr_4[] = HOMING_FEEDRATE_MM_M;
  3400. static_assert(COUNT(sanity_arr_4) == NUM_AXES, "HOMING_FEEDRATE_MM_M requires " _NUM_AXES_STR "elements (and no others).");
  3401. static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
  3402. #ifdef MAX_ACCEL_EDIT_VALUES
  3403. constexpr float sanity_arr_5[] = MAX_ACCEL_EDIT_VALUES;
  3404. static_assert(COUNT(sanity_arr_5) >= LOGICAL_AXES, "MAX_ACCEL_EDIT_VALUES requires " _LOGICAL_AXES_STR "elements.");
  3405. static_assert(COUNT(sanity_arr_5) <= LOGICAL_AXES, "MAX_ACCEL_EDIT_VALUES has too many elements. " _LOGICAL_AXES_STR "elements only.");
  3406. static_assert(_PLUS_TEST(5), "MAX_ACCEL_EDIT_VALUES values must be positive.");
  3407. #endif
  3408. #ifdef MAX_FEEDRATE_EDIT_VALUES
  3409. constexpr float sanity_arr_6[] = MAX_FEEDRATE_EDIT_VALUES;
  3410. static_assert(COUNT(sanity_arr_6) >= LOGICAL_AXES, "MAX_FEEDRATE_EDIT_VALUES requires " _LOGICAL_AXES_STR "elements.");
  3411. static_assert(COUNT(sanity_arr_6) <= LOGICAL_AXES, "MAX_FEEDRATE_EDIT_VALUES has too many elements. " _LOGICAL_AXES_STR "elements only.");
  3412. static_assert(_PLUS_TEST(6), "MAX_FEEDRATE_EDIT_VALUES values must be positive.");
  3413. #endif
  3414. #ifdef MAX_JERK_EDIT_VALUES
  3415. constexpr float sanity_arr_7[] = MAX_JERK_EDIT_VALUES;
  3416. static_assert(COUNT(sanity_arr_7) >= LOGICAL_AXES, "MAX_JERK_EDIT_VALUES requires " _LOGICAL_AXES_STR "elements.");
  3417. static_assert(COUNT(sanity_arr_7) <= LOGICAL_AXES, "MAX_JERK_EDIT_VALUES has too many elements. " _LOGICAL_AXES_STR "elements only.");
  3418. static_assert(_PLUS_TEST(7), "MAX_JERK_EDIT_VALUES values must be positive.");
  3419. #endif
  3420. #ifdef MANUAL_FEEDRATE
  3421. constexpr float sanity_arr_8[] = MANUAL_FEEDRATE;
  3422. static_assert(COUNT(sanity_arr_8) >= LOGICAL_AXES, "MANUAL_FEEDRATE requires " _LOGICAL_AXES_STR "elements.");
  3423. static_assert(COUNT(sanity_arr_8) <= LOGICAL_AXES, "MANUAL_FEEDRATE has too many elements. " _LOGICAL_AXES_STR "elements only.");
  3424. static_assert(_PLUS_TEST(8), "MANUAL_FEEDRATE values must be positive.");
  3425. #endif
  3426. #undef __PLUS_TEST
  3427. #undef _PLUS_TEST
  3428. #undef _EXTRA_NOTE
  3429. #if BOTH(CNC_COORDINATE_SYSTEMS, NO_WORKSPACE_OFFSETS)
  3430. #error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS."
  3431. #endif
  3432. #if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE)
  3433. #error "BLOCK_BUFFER_SIZE must be a power of 2."
  3434. #elif BLOCK_BUFFER_SIZE > 64
  3435. #error "A very large BLOCK_BUFFER_SIZE is not needed and takes longer to drain the buffer on pause / cancel."
  3436. #endif
  3437. #if ENABLED(LED_CONTROL_MENU) && NONE(HAS_MARLINUI_MENU, DWIN_LCD_PROUI)
  3438. #error "LED_CONTROL_MENU requires an LCD controller that implements the menu."
  3439. #endif
  3440. #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED)
  3441. #error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED."
  3442. #endif
  3443. #if ENABLED(SKEW_CORRECTION)
  3444. #if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD))
  3445. #error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD."
  3446. #endif
  3447. #if ENABLED(SKEW_CORRECTION_FOR_Z)
  3448. #if !defined(XZ_SKEW_FACTOR) && !(defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD))
  3449. #error "SKEW_CORRECTION requires XZ_SKEW_FACTOR or XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD."
  3450. #endif
  3451. #if !defined(YZ_SKEW_FACTOR) && !(defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD))
  3452. #error "SKEW_CORRECTION requires YZ_SKEW_FACTOR or YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD."
  3453. #endif
  3454. #endif
  3455. #endif
  3456. #if BOTH(X_AXIS_TWIST_COMPENSATION, NOZZLE_AS_PROBE)
  3457. #error "X_AXIS_TWIST_COMPENSATION is incompatible with NOZZLE_AS_PROBE."
  3458. #endif
  3459. #if ENABLED(POWER_LOSS_RECOVERY)
  3460. #if ENABLED(BACKUP_POWER_SUPPLY) && !PIN_EXISTS(POWER_LOSS)
  3461. #error "BACKUP_POWER_SUPPLY requires a POWER_LOSS_PIN."
  3462. #elif BOTH(POWER_LOSS_PULLUP, POWER_LOSS_PULLDOWN)
  3463. #error "You can't enable POWER_LOSS_PULLUP and POWER_LOSS_PULLDOWN at the same time."
  3464. #elif ENABLED(POWER_LOSS_RECOVER_ZHOME) && Z_HOME_TO_MAX
  3465. #error "POWER_LOSS_RECOVER_ZHOME is not needed on a machine that homes to ZMAX."
  3466. #elif BOTH(IS_CARTESIAN, POWER_LOSS_RECOVER_ZHOME) && Z_HOME_TO_MIN && !defined(POWER_LOSS_ZHOME_POS)
  3467. #error "POWER_LOSS_RECOVER_ZHOME requires POWER_LOSS_ZHOME_POS for a Cartesian that homes to ZMIN."
  3468. #endif
  3469. #endif
  3470. #if ENABLED(Z_STEPPER_AUTO_ALIGN)
  3471. #if NUM_Z_STEPPERS <= 1
  3472. #error "Z_STEPPER_AUTO_ALIGN requires more than one Z stepper."
  3473. #elif !HAS_BED_PROBE
  3474. #error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe."
  3475. #elif HAS_Z_STEPPER_ALIGN_STEPPER_XY
  3476. static_assert(WITHIN(Z_STEPPER_ALIGN_AMP, 0.5, 2.0), "Z_STEPPER_ALIGN_AMP must be between 0.5 and 2.0.");
  3477. #if NUM_Z_STEPPERS < 3
  3478. #error "Z_STEPPER_ALIGN_STEPPER_XY requires 3 or 4 Z steppers."
  3479. #endif
  3480. #endif
  3481. #endif
  3482. #if ENABLED(MECHANICAL_GANTRY_CALIBRATION)
  3483. #if NONE(HAS_MOTOR_CURRENT_DAC, HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC, HAS_TRINAMIC_CONFIG, HAS_MOTOR_CURRENT_PWM)
  3484. #error "Adjustable current drivers are highly recommended to prevent damage. Comment out this line to continue anyway."
  3485. #elif !defined(GANTRY_CALIBRATION_CURRENT)
  3486. #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_CURRENT to be set."
  3487. #elif !defined(GANTRY_CALIBRATION_EXTRA_HEIGHT)
  3488. #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_EXTRA_HEIGHT to be set."
  3489. #elif !defined(GANTRY_CALIBRATION_FEEDRATE)
  3490. #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_FEEDRATE to be set."
  3491. #elif ENABLED(Z_MULTI_ENDSTOPS)
  3492. #error "Sorry! MECHANICAL_GANTRY_CALIBRATION cannot be used with Z_MULTI_ENDSTOPS."
  3493. #elif ENABLED(Z_STEPPER_AUTO_ALIGN)
  3494. #error "Sorry! MECHANICAL_GANTRY_CALIBRATION cannot be used with Z_STEPPER_AUTO_ALIGN."
  3495. #endif
  3496. #if defined(GANTRY_CALIBRATION_SAFE_POSITION) && !defined(GANTRY_CALIBRATION_XY_PARK_FEEDRATE)
  3497. #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
  3498. #endif
  3499. #endif
  3500. #if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS)
  3501. #error "PRINTCOUNTER requires EEPROM_SETTINGS."
  3502. #endif
  3503. #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PINS_EXIST(USB_CS, USB_INTR) && DISABLED(USE_OTG_USB_HOST)
  3504. #error "USB_CS_PIN and USB_INTR_PIN are required for USB_FLASH_DRIVE_SUPPORT."
  3505. #endif
  3506. #if ENABLED(USE_OTG_USB_HOST) && !defined(HAS_OTG_USB_HOST_SUPPORT)
  3507. #error "The current board does not support USE_OTG_USB_HOST."
  3508. #endif
  3509. #if ENABLED(SD_FIRMWARE_UPDATE) && !defined(__AVR_ATmega2560__)
  3510. #error "SD_FIRMWARE_UPDATE requires an ATmega2560-based (Arduino Mega) board."
  3511. #endif
  3512. #if ENABLED(GCODE_MACROS) && !WITHIN(GCODE_MACROS_SLOTS, 1, 10)
  3513. #error "GCODE_MACROS_SLOTS must be a number from 1 to 10."
  3514. #endif
  3515. #if ENABLED(BACKLASH_COMPENSATION)
  3516. #ifndef BACKLASH_DISTANCE_MM
  3517. #error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM."
  3518. #elif !defined(BACKLASH_CORRECTION)
  3519. #error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION."
  3520. #elif EITHER(MARKFORGED_XY, MARKFORGED_YX)
  3521. constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
  3522. static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
  3523. "BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " on a MarkForged system.");
  3524. #elif IS_CORE
  3525. constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
  3526. #ifndef CORE_BACKLASH
  3527. static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
  3528. "BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " with your CORE system.");
  3529. #endif
  3530. #endif
  3531. #endif
  3532. #if ENABLED(GRADIENT_MIX) && MIXING_VIRTUAL_TOOLS < 2
  3533. #error "GRADIENT_MIX requires 2 or more MIXING_VIRTUAL_TOOLS."
  3534. #endif
  3535. /**
  3536. * Photo G-code requirements
  3537. */
  3538. #if ENABLED(PHOTO_GCODE)
  3539. #if (PIN_EXISTS(CHDK) + PIN_EXISTS(PHOTOGRAPH) + defined(PHOTO_SWITCH_POSITION)) > 1
  3540. #error "Please define only one of CHDK_PIN, PHOTOGRAPH_PIN, or PHOTO_SWITCH_POSITION."
  3541. #elif defined(PHOTO_SWITCH_POSITION) && !defined(PHOTO_POSITION)
  3542. #error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION."
  3543. #elif PIN_EXISTS(CHDK) && defined(CHDK_DELAY)
  3544. #error "CHDK_DELAY has been replaced by PHOTO_SWITCH_MS."
  3545. #elif PIN_EXISTS(CHDK) && !defined(PHOTO_SWITCH_MS)
  3546. #error "PHOTO_SWITCH_MS is required with CHDK_PIN."
  3547. #elif defined(PHOTO_RETRACT_MM)
  3548. static_assert(PHOTO_RETRACT_MM + 0 >= 0, "PHOTO_RETRACT_MM must be >= 0.");
  3549. #endif
  3550. #endif
  3551. /**
  3552. * Advanced PRINTCOUNTER settings
  3553. */
  3554. #if ENABLED(PRINTCOUNTER)
  3555. #if defined(SERVICE_INTERVAL_1) != defined(SERVICE_NAME_1)
  3556. #error "Both SERVICE_NAME_1 and SERVICE_INTERVAL_1 are required."
  3557. #elif defined(SERVICE_INTERVAL_2) != defined(SERVICE_NAME_2)
  3558. #error "Both SERVICE_NAME_2 and SERVICE_INTERVAL_2 are required."
  3559. #elif defined(SERVICE_INTERVAL_3) != defined(SERVICE_NAME_3)
  3560. #error "Both SERVICE_NAME_3 and SERVICE_INTERVAL_3 are required."
  3561. #endif
  3562. #endif
  3563. /**
  3564. * Require soft endstops for certain setups
  3565. */
  3566. #if !BOTH(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
  3567. #if ENABLED(DUAL_X_CARRIAGE)
  3568. #error "DUAL_X_CARRIAGE requires both MIN_ and MAX_SOFTWARE_ENDSTOPS."
  3569. #elif HAS_HOTEND_OFFSET
  3570. #error "MIN_ and MAX_SOFTWARE_ENDSTOPS are both required with offset hotends."
  3571. #endif
  3572. #endif
  3573. /**
  3574. * Validate MKS_PWC
  3575. */
  3576. #if ENABLED(MKS_PWC) && PSU_ACTIVE_STATE != HIGH
  3577. #error "MKS_PWC requires PSU_ACTIVE_STATE to be set HIGH."
  3578. #endif
  3579. /**
  3580. * Ensure this option is set intentionally
  3581. */
  3582. #if ENABLED(PSU_CONTROL)
  3583. #ifndef PSU_ACTIVE_STATE
  3584. #error "PSU_CONTROL requires PSU_ACTIVE_STATE to be defined as 'HIGH' or 'LOW'."
  3585. #elif !PIN_EXISTS(PS_ON)
  3586. #error "PSU_CONTROL requires PS_ON_PIN."
  3587. #elif POWER_OFF_DELAY < 0
  3588. #error "POWER_OFF_DELAY must be a positive value."
  3589. #elif ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN) && !(defined(AUTO_POWER_E_TEMP) || defined(AUTO_POWER_CHAMBER_TEMP) || defined(AUTO_POWER_COOLER_TEMP))
  3590. #error "POWER_OFF_WAIT_FOR_COOLDOWN requires AUTO_POWER_E_TEMP, AUTO_POWER_CHAMBER_TEMP, and/or AUTO_POWER_COOLER_TEMP."
  3591. #endif
  3592. #endif
  3593. #if HAS_CUTTER
  3594. #ifndef CUTTER_POWER_UNIT
  3595. #error "CUTTER_POWER_UNIT is required with a spindle or laser."
  3596. #elif !CUTTER_UNIT_IS(PWM255) && !CUTTER_UNIT_IS(PERCENT) && !CUTTER_UNIT_IS(RPM) && !CUTTER_UNIT_IS(SERVO)
  3597. #error "CUTTER_POWER_UNIT must be PWM255, PERCENT, RPM, or SERVO."
  3598. #endif
  3599. #if ENABLED(LASER_FEATURE)
  3600. #if ENABLED(SPINDLE_CHANGE_DIR)
  3601. #error "SPINDLE_CHANGE_DIR and LASER_FEATURE are incompatible."
  3602. #elif ENABLED(LASER_MOVE_G0_OFF)
  3603. #error "LASER_MOVE_G0_OFF is no longer required, G0 and G28 cannot apply power."
  3604. #elif ENABLED(LASER_MOVE_G28_OFF)
  3605. #error "LASER_MOVE_G0_OFF is no longer required, G0 and G28 cannot apply power."
  3606. #elif ENABLED(LASER_MOVE_POWER)
  3607. #error "LASER_MOVE_POWER is no longer applicable."
  3608. #endif
  3609. #if ENABLED(LASER_POWER_TRAP)
  3610. #if DISABLED(SPINDLE_LASER_USE_PWM)
  3611. #error "LASER_POWER_TRAP requires SPINDLE_LASER_USE_PWM to function."
  3612. #endif
  3613. #endif
  3614. #else
  3615. #if SPINDLE_LASER_POWERUP_DELAY < 1
  3616. #error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0."
  3617. #elif SPINDLE_LASER_POWERDOWN_DELAY < 1
  3618. #error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0."
  3619. #endif
  3620. #endif
  3621. #define _PIN_CONFLICT(P) (PIN_EXISTS(P) && P##_PIN == SPINDLE_LASER_PWM_PIN)
  3622. #if BOTH(SPINDLE_FEATURE, LASER_FEATURE)
  3623. #error "Enable only one of SPINDLE_FEATURE or LASER_FEATURE."
  3624. #elif !PIN_EXISTS(SPINDLE_LASER_ENA) && DISABLED(SPINDLE_SERVO)
  3625. #error "(SPINDLE|LASER)_FEATURE requires SPINDLE_LASER_ENA_PIN or SPINDLE_SERVO to control the power."
  3626. #elif ENABLED(SPINDLE_CHANGE_DIR) && !PIN_EXISTS(SPINDLE_DIR)
  3627. #error "SPINDLE_DIR_PIN is required for SPINDLE_CHANGE_DIR."
  3628. #elif ENABLED(SPINDLE_LASER_USE_PWM)
  3629. #if !defined(SPINDLE_LASER_PWM_PIN) || SPINDLE_LASER_PWM_PIN < 0
  3630. #error "SPINDLE_LASER_PWM_PIN is required for SPINDLE_LASER_USE_PWM."
  3631. #elif !_TEST_PWM(SPINDLE_LASER_PWM_PIN)
  3632. #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."
  3633. #elif !defined(SPINDLE_LASER_PWM_INVERT)
  3634. #error "SPINDLE_LASER_PWM_INVERT is required for (SPINDLE|LASER)_FEATURE."
  3635. #elif !(defined(SPEED_POWER_MIN) && defined(SPEED_POWER_MAX) && defined(SPEED_POWER_STARTUP))
  3636. #error "SPINDLE_LASER_USE_PWM equation constant(s) missing."
  3637. #elif _PIN_CONFLICT(X_MIN)
  3638. #error "SPINDLE_LASER_USE_PWM pin conflicts with X_MIN_PIN."
  3639. #elif _PIN_CONFLICT(X_MAX)
  3640. #error "SPINDLE_LASER_USE_PWM pin conflicts with X_MAX_PIN."
  3641. #elif _PIN_CONFLICT(Z_STEP)
  3642. #error "SPINDLE_LASER_USE_PWM pin conflicts with Z_STEP_PIN."
  3643. #elif _PIN_CONFLICT(CASE_LIGHT)
  3644. #error "SPINDLE_LASER_PWM_PIN conflicts with CASE_LIGHT_PIN."
  3645. #elif _PIN_CONFLICT(E0_AUTO_FAN)
  3646. #error "SPINDLE_LASER_PWM_PIN conflicts with E0_AUTO_FAN_PIN."
  3647. #elif _PIN_CONFLICT(E1_AUTO_FAN)
  3648. #error "SPINDLE_LASER_PWM_PIN conflicts with E1_AUTO_FAN_PIN."
  3649. #elif _PIN_CONFLICT(E2_AUTO_FAN)
  3650. #error "SPINDLE_LASER_PWM_PIN conflicts with E2_AUTO_FAN_PIN."
  3651. #elif _PIN_CONFLICT(E3_AUTO_FAN)
  3652. #error "SPINDLE_LASER_PWM_PIN conflicts with E3_AUTO_FAN_PIN."
  3653. #elif _PIN_CONFLICT(E4_AUTO_FAN)
  3654. #error "SPINDLE_LASER_PWM_PIN conflicts with E4_AUTO_FAN_PIN."
  3655. #elif _PIN_CONFLICT(E5_AUTO_FAN)
  3656. #error "SPINDLE_LASER_PWM_PIN conflicts with E5_AUTO_FAN_PIN."
  3657. #elif _PIN_CONFLICT(E6_AUTO_FAN)
  3658. #error "SPINDLE_LASER_PWM_PIN conflicts with E6_AUTO_FAN_PIN."
  3659. #elif _PIN_CONFLICT(E7_AUTO_FAN)
  3660. #error "SPINDLE_LASER_PWM_PIN conflicts with E7_AUTO_FAN_PIN."
  3661. #elif _PIN_CONFLICT(FAN)
  3662. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN_PIN."
  3663. #elif _PIN_CONFLICT(FAN1)
  3664. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN1_PIN."
  3665. #elif _PIN_CONFLICT(FAN2)
  3666. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN2_PIN."
  3667. #elif _PIN_CONFLICT(FAN3)
  3668. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN3_PIN."
  3669. #elif _PIN_CONFLICT(FAN4)
  3670. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN4_PIN."
  3671. #elif _PIN_CONFLICT(FAN5)
  3672. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN5_PIN."
  3673. #elif _PIN_CONFLICT(FAN6)
  3674. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN6_PIN."
  3675. #elif _PIN_CONFLICT(FAN7)
  3676. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN7_PIN."
  3677. #elif _PIN_CONFLICT(CONTROLLERFAN)
  3678. #error "SPINDLE_LASER_PWM_PIN conflicts with CONTROLLERFAN_PIN."
  3679. #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_XY)
  3680. #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_XY."
  3681. #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_Z)
  3682. #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_Z."
  3683. #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_E)
  3684. #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_E."
  3685. #endif
  3686. #endif
  3687. #undef _PIN_CONFLICT
  3688. #ifdef LASER_SAFETY_TIMEOUT_MS
  3689. static_assert(LASER_SAFETY_TIMEOUT_MS < (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL, "LASER_SAFETY_TIMEOUT_MS must be less than DEFAULT_STEPPER_DEACTIVE_TIME (" STRINGIFY(DEFAULT_STEPPER_DEACTIVE_TIME) " seconds)");
  3690. #endif
  3691. #endif
  3692. #if ENABLED(COOLANT_MIST) && !PIN_EXISTS(COOLANT_MIST)
  3693. #error "COOLANT_MIST requires COOLANT_MIST_PIN to be defined."
  3694. #elif ENABLED(COOLANT_FLOOD) && !PIN_EXISTS(COOLANT_FLOOD)
  3695. #error "COOLANT_FLOOD requires COOLANT_FLOOD_PIN to be defined."
  3696. #endif
  3697. #if NONE(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI, IS_DWIN_MARLINUI) && ENABLED(PRINT_PROGRESS_SHOW_DECIMALS)
  3698. #error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD."
  3699. #endif
  3700. #if HAS_ADC_BUTTONS && defined(ADC_BUTTON_DEBOUNCE_DELAY) && ADC_BUTTON_DEBOUNCE_DELAY < 16
  3701. #error "ADC_BUTTON_DEBOUNCE_DELAY must be greater than 16."
  3702. #endif
  3703. /**
  3704. * Check to make sure MONITOR_DRIVER_STATUS isn't enabled
  3705. * on boards where TMC drivers share the SPI bus with SD.
  3706. */
  3707. #if HAS_TMC_SPI && ALL(MONITOR_DRIVER_STATUS, SDSUPPORT, USES_SHARED_SPI)
  3708. #error "MONITOR_DRIVER_STATUS and SDSUPPORT cannot be used together on boards with shared SPI."
  3709. #endif
  3710. // G60/G61 Position Save
  3711. #if SAVED_POSITIONS > 256
  3712. #error "SAVED_POSITIONS must be an integer from 0 to 256."
  3713. #endif
  3714. /**
  3715. * Touch Screen Calibration
  3716. */
  3717. #if !MB(LINUX_RAMPS) && ENABLED(TFT_TOUCH_DEVICE_XPT2046) && DISABLED(TOUCH_SCREEN_CALIBRATION) \
  3718. && !(defined(TOUCH_CALIBRATION_X) && defined(TOUCH_CALIBRATION_Y) && defined(TOUCH_OFFSET_X) && defined(TOUCH_OFFSET_Y))
  3719. #error "TOUCH_CALIBRATION_[XY] and TOUCH_OFFSET_[XY] are required for resistive touch screens with TOUCH_SCREEN_CALIBRATION disabled."
  3720. #endif
  3721. /**
  3722. * Sanity check for WIFI
  3723. */
  3724. #if EITHER(ESP3D_WIFISUPPORT, WIFISUPPORT) && DISABLED(ARDUINO_ARCH_ESP32)
  3725. #error "ESP3D_WIFISUPPORT or WIFISUPPORT requires an ESP32 MOTHERBOARD."
  3726. #endif
  3727. /**
  3728. * Sanity Check for Password Feature
  3729. */
  3730. #if ENABLED(PASSWORD_FEATURE)
  3731. #if NONE(HAS_MARLINUI_MENU, PASSWORD_UNLOCK_GCODE, PASSWORD_CHANGE_GCODE)
  3732. #error "Without PASSWORD_UNLOCK_GCODE, PASSWORD_CHANGE_GCODE, or a supported LCD there's no way to unlock the printer or set a password."
  3733. #elif DISABLED(EEPROM_SETTINGS)
  3734. #warning "PASSWORD_FEATURE settings will be lost on power-off without EEPROM_SETTINGS."
  3735. #endif
  3736. #endif
  3737. /**
  3738. * Sanity Check for MEATPACK and BINARY_FILE_TRANSFER Features
  3739. */
  3740. #if BOTH(HAS_MEATPACK, BINARY_FILE_TRANSFER)
  3741. #error "Either enable MEATPACK_ON_SERIAL_PORT_* or BINARY_FILE_TRANSFER, not both."
  3742. #endif
  3743. /**
  3744. * Sanity Check for Slim LCD Menus and Probe Offset Wizard
  3745. */
  3746. #if BOTH(SLIM_LCD_MENUS, PROBE_OFFSET_WIZARD)
  3747. #error "SLIM_LCD_MENUS disables \"Advanced Settings > Probe Offsets > PROBE_OFFSET_WIZARD.\""
  3748. #endif
  3749. /**
  3750. * Sanity check for unique start and stop values in NOZZLE_CLEAN_FEATURE
  3751. */
  3752. #if ENABLED(NOZZLE_CLEAN_FEATURE)
  3753. constexpr xyz_pos_t start_xyz[8] = NOZZLE_CLEAN_START_POINT,
  3754. end_xyz[8] = NOZZLE_CLEAN_END_POINT;
  3755. #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), \
  3756. "NOZZLE_CLEAN Start and End must be made different on HOTEND " STRINGIFY(N))
  3757. _CLEAN_ASSERT(0); _CLEAN_ASSERT(1);
  3758. _CLEAN_ASSERT(2); _CLEAN_ASSERT(3);
  3759. _CLEAN_ASSERT(4); _CLEAN_ASSERT(5);
  3760. _CLEAN_ASSERT(6); _CLEAN_ASSERT(7);
  3761. #undef _CLEAN_ASSERT
  3762. #endif
  3763. /**
  3764. * Sanity check for MIXING_EXTRUDER & DISTINCT_E_FACTORS these are not compatible
  3765. */
  3766. #if BOTH(MIXING_EXTRUDER, DISTINCT_E_FACTORS)
  3767. #error "MIXING_EXTRUDER can't be used with DISTINCT_E_FACTORS. But you may use SINGLENOZZLE with DISTINCT_E_FACTORS."
  3768. #endif
  3769. /**
  3770. * Sanity check for valid stepper driver types
  3771. */
  3772. #define _BAD_DRIVER(A) (defined(A##_DRIVER_TYPE) && !_DRIVER_ID(A##_DRIVER_TYPE))
  3773. #if _BAD_DRIVER(X)
  3774. #error "X_DRIVER_TYPE is not recognized."
  3775. #endif
  3776. #if _BAD_DRIVER(Y)
  3777. #error "Y_DRIVER_TYPE is not recognized."
  3778. #endif
  3779. #if _BAD_DRIVER(Z)
  3780. #error "Z_DRIVER_TYPE is not recognized."
  3781. #endif
  3782. #if _BAD_DRIVER(I)
  3783. #error "I_DRIVER_TYPE is not recognized."
  3784. #endif
  3785. #if _BAD_DRIVER(J)
  3786. #error "J_DRIVER_TYPE is not recognized."
  3787. #endif
  3788. #if _BAD_DRIVER(K)
  3789. #error "K_DRIVER_TYPE is not recognized."
  3790. #endif
  3791. #if _BAD_DRIVER(U)
  3792. #error "U_DRIVER_TYPE is not recognized."
  3793. #endif
  3794. #if _BAD_DRIVER(V)
  3795. #error "V_DRIVER_TYPE is not recognized."
  3796. #endif
  3797. #if _BAD_DRIVER(W)
  3798. #error "W_DRIVER_TYPE is not recognized."
  3799. #endif
  3800. #if _BAD_DRIVER(X2)
  3801. #error "X2_DRIVER_TYPE is not recognized."
  3802. #endif
  3803. #if _BAD_DRIVER(Y2)
  3804. #error "Y2_DRIVER_TYPE is not recognized."
  3805. #endif
  3806. #if _BAD_DRIVER(Z2)
  3807. #error "Z2_DRIVER_TYPE is not recognized."
  3808. #endif
  3809. #if _BAD_DRIVER(Z3)
  3810. #error "Z3_DRIVER_TYPE is not recognized."
  3811. #endif
  3812. #if _BAD_DRIVER(Z4)
  3813. #error "Z4_DRIVER_TYPE is not recognized."
  3814. #endif
  3815. #if _BAD_DRIVER(E0)
  3816. #error "E0_DRIVER_TYPE is not recognized."
  3817. #endif
  3818. #if _BAD_DRIVER(E1)
  3819. #error "E1_DRIVER_TYPE is not recognized."
  3820. #endif
  3821. #if _BAD_DRIVER(E2)
  3822. #error "E2_DRIVER_TYPE is not recognized."
  3823. #endif
  3824. #if _BAD_DRIVER(E3)
  3825. #error "E3_DRIVER_TYPE is not recognized."
  3826. #endif
  3827. #if _BAD_DRIVER(E4)
  3828. #error "E4_DRIVER_TYPE is not recognized."
  3829. #endif
  3830. #if _BAD_DRIVER(E5)
  3831. #error "E5_DRIVER_TYPE is not recognized."
  3832. #endif
  3833. #if _BAD_DRIVER(E6)
  3834. #error "E6_DRIVER_TYPE is not recognized."
  3835. #endif
  3836. #if _BAD_DRIVER(E7)
  3837. #error "E7_DRIVER_TYPE is not recognized."
  3838. #endif
  3839. #undef _BAD_DRIVER
  3840. /**
  3841. * Require certain features for DGUS_LCD_UI_RELOADED.
  3842. */
  3843. #if ENABLED(DGUS_LCD_UI_RELOADED)
  3844. #if BUFSIZE < 4
  3845. #error "DGUS_LCD_UI_RELOADED requires a BUFSIZE of at least 4."
  3846. #elif HOTENDS < 1
  3847. #error "DGUS_LCD_UI_RELOADED requires at least 1 hotend."
  3848. #elif EXTRUDERS < 1
  3849. #error "DGUS_LCD_UI_RELOADED requires at least 1 extruder."
  3850. #elif !HAS_HEATED_BED
  3851. #error "DGUS_LCD_UI_RELOADED requires a heated bed."
  3852. #elif FAN_COUNT < 1
  3853. #error "DGUS_LCD_UI_RELOADED requires a fan."
  3854. #elif !HAS_BED_PROBE
  3855. #error "DGUS_LCD_UI_RELOADED requires a bed probe."
  3856. #elif !HAS_MESH
  3857. #error "DGUS_LCD_UI_RELOADED requires mesh leveling."
  3858. #elif DISABLED(LCD_BED_TRAMMING)
  3859. #error "DGUS_LCD_UI_RELOADED requires LCD_BED_TRAMMING."
  3860. #elif DISABLED(BABYSTEP_ALWAYS_AVAILABLE)
  3861. #error "DGUS_LCD_UI_RELOADED requires BABYSTEP_ALWAYS_AVAILABLE."
  3862. #elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
  3863. #error "DGUS_LCD_UI_RELOADED requires BABYSTEP_ZPROBE_OFFSET."
  3864. #elif ENABLED(AUTO_BED_LEVELING_UBL) && DISABLED(UBL_SAVE_ACTIVE_ON_M500)
  3865. #warning "Without UBL_SAVE_ACTIVE_ON_M500, your mesh will not be saved when using the touchscreen."
  3866. #endif
  3867. #endif
  3868. // Misc. Cleanup
  3869. #undef _TEST_PWM
  3870. #undef _NUM_AXES_STR
  3871. #undef _LOGICAL_AXES_STR
  3872. // JTAG support in the HAL
  3873. #if ENABLED(DISABLE_DEBUG) && !defined(JTAGSWD_DISABLE)
  3874. #error "DISABLE_DEBUG is not supported for the selected MCU/Board."
  3875. #elif ENABLED(DISABLE_JTAG) && !defined(JTAG_DISABLE)
  3876. #error "DISABLE_JTAG is not supported for the selected MCU/Board."
  3877. #endif
  3878. // Check requirements for upload.py
  3879. #if ENABLED(XFER_BUILD) && !BOTH(BINARY_FILE_TRANSFER, CUSTOM_FIRMWARE_UPLOAD)
  3880. #error "BINARY_FILE_TRANSFER and CUSTOM_FIRMWARE_UPLOAD are required for custom upload."
  3881. #endif