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

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