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

SanityCheck.h 187KB

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