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

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