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

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