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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313
  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. // Make sure macros aren't borked
  35. #define TEST1
  36. #define TEST2 1
  37. #define TEST3 0
  38. #define TEST4 true
  39. #if ENABLED(TEST0) || !ENABLED(TEST2) || ENABLED(TEST3)
  40. #error "ENABLED is borked!"
  41. #endif
  42. #if BOTH(TEST0, TEST1)
  43. #error "BOTH is borked!"
  44. #endif
  45. #if DISABLED(TEST1) || !DISABLED(TEST3) || DISABLED(TEST4) || DISABLED(TEST0, TEST1, TEST2, TEST4) || !DISABLED(TEST0, TEST3)
  46. #error "DISABLED is borked!"
  47. #endif
  48. #if !ANY(TEST1, TEST2, TEST3, TEST4) || ANY(TEST0, TEST3)
  49. #error "ANY is borked!"
  50. #endif
  51. #if NONE(TEST0, TEST1, TEST2, TEST4) || !NONE(TEST0, TEST3)
  52. #error "NONE is borked!"
  53. #endif
  54. #undef TEST1
  55. #undef TEST2
  56. #undef TEST3
  57. #undef TEST4
  58. /**
  59. * This is to alert you about non-matching versions of config files.
  60. *
  61. * You can edit the version tag in your old config files and try the build again.
  62. * The checks below will alert you about options that need to be changed, but they won't
  63. * tell you about new options that you might find useful. So it's recommended to transfer
  64. * your settings to new Configuration files matching your Marlin version as soon as possible.
  65. */
  66. #define HEXIFY(H) _CAT(0x,H)
  67. #if !defined(CONFIGURATION_H_VERSION) || HEXIFY(CONFIGURATION_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_H_VERSION)
  68. #error "Your Configuration.h file is for an old version of Marlin. Downgrade Marlin or upgrade your Configuration.h."
  69. #elif HEXIFY(CONFIGURATION_H_VERSION) > HEXIFY(REQUIRED_CONFIGURATION_H_VERSION)
  70. #error "Your Configuration.h file is for a newer version of Marlin. Upgrade Marlin or downgrade your Configuration.h."
  71. #endif
  72. #if !defined(CONFIGURATION_ADV_H_VERSION) || HEXIFY(CONFIGURATION_ADV_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION)
  73. #error "Your Configuration_adv.h file is for an old version of Marlin. Downgrade Marlin or upgrade your Configuration_adv.h."
  74. #elif HEXIFY(CONFIGURATION_ADV_H_VERSION) > HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION)
  75. #error "Your Configuration_adv.h file is for a newer version of Marlin. Upgrade Marlin or downgrade your Configuration_adv.h."
  76. #endif
  77. #undef HEXIFY
  78. /**
  79. * Warnings for old configurations
  80. */
  81. #ifndef MOTHERBOARD
  82. #error "MOTHERBOARD is required."
  83. #elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE)
  84. #error "X_BED_SIZE and Y_BED_SIZE are now required!"
  85. #elif WATCH_TEMP_PERIOD > 500
  86. #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds."
  87. #elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
  88. #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS."
  89. #elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
  90. #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED."
  91. #elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE)
  92. #error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY."
  93. #elif defined(X_HOME_RETRACT_MM)
  94. #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM."
  95. #elif defined(SDCARDDETECTINVERTED)
  96. #error "SDCARDDETECTINVERTED is now SD_DETECT_STATE (HIGH)."
  97. #elif defined(SD_DETECT_INVERTED)
  98. #error "SD_DETECT_INVERTED is now SD_DETECT_STATE (HIGH)."
  99. #elif defined(BTENABLED)
  100. #error "BTENABLED is now BLUETOOTH."
  101. #elif defined(CUSTOM_MENDEL_NAME)
  102. #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME."
  103. #elif defined(HAS_AUTOMATIC_VERSIONING)
  104. #error "HAS_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE."
  105. #elif defined(USE_AUTOMATIC_VERSIONING)
  106. #error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE."
  107. #elif defined(SDSLOW)
  108. #error "SDSLOW deprecated. Set SD_SPI_SPEED to SPI_HALF_SPEED instead."
  109. #elif defined(SDEXTRASLOW)
  110. #error "SDEXTRASLOW deprecated. Set SD_SPI_SPEED to SPI_QUARTER_SPEED instead."
  111. #elif defined(FILAMENT_SENSOR)
  112. #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR."
  113. #elif defined(ENDSTOPPULLUP_FIL_RUNOUT)
  114. #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP."
  115. #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
  116. #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead."
  117. #elif defined(LANGUAGE_INCLUDE)
  118. #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE."
  119. #elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y)
  120. #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead."
  121. #elif defined(PID_PARAMS_PER_EXTRUDER)
  122. #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead."
  123. #elif defined(EXTRUDER_WATTS) || defined(BED_WATTS)
  124. #error "EXTRUDER_WATTS and BED_WATTS are deprecated and should be removed."
  125. #elif defined(SERVO_ENDSTOP_ANGLES)
  126. #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
  127. #elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
  128. #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
  129. #elif defined(Z_ENDSTOP_SERVO_NR)
  130. #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR."
  131. #elif defined(DEFAULT_XYJERK)
  132. #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead."
  133. #elif defined(XY_TRAVEL_SPEED)
  134. #error "XY_TRAVEL_SPEED is now XY_PROBE_FEEDRATE."
  135. #elif defined(XY_PROBE_SPEED)
  136. #error "XY_PROBE_SPEED is now XY_PROBE_FEEDRATE."
  137. #elif defined(Z_PROBE_SPEED_FAST)
  138. #error "Z_PROBE_SPEED_FAST is now Z_PROBE_FEEDRATE_FAST."
  139. #elif defined(Z_PROBE_SPEED_SLOW)
  140. #error "Z_PROBE_SPEED_SLOW is now Z_PROBE_FEEDRATE_SLOW."
  141. #elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
  142. #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead."
  143. #elif defined(SERVO_DEACTIVATION_DELAY)
  144. #error "SERVO_DEACTIVATION_DELAY is now SERVO_DELAY."
  145. #elif ENABLED(FILAMENTCHANGEENABLE)
  146. #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE."
  147. #elif ENABLED(FILAMENT_CHANGE_FEATURE)
  148. #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE."
  149. #elif defined(FILAMENT_CHANGE_X_POS) || defined(FILAMENT_CHANGE_Y_POS)
  150. #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT."
  151. #elif defined(FILAMENT_CHANGE_Z_ADD)
  152. #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT."
  153. #elif defined(FILAMENT_CHANGE_XY_FEEDRATE)
  154. #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE."
  155. #elif defined(FILAMENT_CHANGE_Z_FEEDRATE)
  156. #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE."
  157. #elif defined(PAUSE_PARK_X_POS) || defined(PAUSE_PARK_Y_POS)
  158. #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT."
  159. #elif defined(PAUSE_PARK_Z_ADD)
  160. #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT."
  161. #elif defined(PAUSE_PARK_XY_FEEDRATE)
  162. #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE."
  163. #elif defined(PAUSE_PARK_Z_FEEDRATE)
  164. #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE."
  165. #elif defined(FILAMENT_CHANGE_RETRACT_FEEDRATE)
  166. #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE."
  167. #elif defined(FILAMENT_CHANGE_RETRACT_LENGTH)
  168. #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH."
  169. #elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE)
  170. #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE."
  171. #elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE)
  172. #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE."
  173. #elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH)
  174. #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH."
  175. #elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH)
  176. #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH."
  177. #elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT)
  178. #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT."
  179. #elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS)
  180. #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS."
  181. #elif defined(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
  182. #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT."
  183. #elif defined(PLA_PREHEAT_HOTEND_TEMP)
  184. #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND."
  185. #elif defined(PLA_PREHEAT_HPB_TEMP)
  186. #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED."
  187. #elif defined(PLA_PREHEAT_FAN_SPEED)
  188. #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED."
  189. #elif defined(ABS_PREHEAT_HOTEND_TEMP)
  190. #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND."
  191. #elif defined(ABS_PREHEAT_HPB_TEMP)
  192. #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED."
  193. #elif defined(ABS_PREHEAT_FAN_SPEED)
  194. #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED."
  195. #elif defined(ENDSTOPS_ONLY_FOR_HOMING)
  196. #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead."
  197. #elif defined(HOMING_FEEDRATE)
  198. #error "HOMING_FEEDRATE is now set using the HOMING_FEEDRATE_MM_M array instead."
  199. #elif (defined(HOMING_FEEDRATE_XY) || defined(HOMING_FEEDRATE_Z)) && !defined(HOMING_FEEDRATE_MM_M)
  200. #error "HOMING_FEEDRATE_XY and HOMING_FEEDRATE_Z are now set using the HOMING_FEEDRATE_MM_M array instead."
  201. #elif defined(MANUAL_HOME_POSITIONS)
  202. #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead."
  203. #elif defined(PID_ADD_EXTRUSION_RATE)
  204. #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default."
  205. #elif defined(Z_RAISE_BEFORE_HOMING)
  206. #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT."
  207. #elif defined(MIN_Z_HEIGHT_FOR_HOMING)
  208. #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT."
  209. #elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING)
  210. #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead."
  211. #elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS)
  212. #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES."
  213. #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT)
  214. #error "Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES."
  215. #elif defined(MANUAL_BED_LEVELING)
  216. #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING."
  217. #elif defined(MESH_HOME_SEARCH_Z)
  218. #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE."
  219. #elif defined(MANUAL_PROBE_Z_RANGE)
  220. #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE."
  221. #elif !defined(MIN_STEPS_PER_SEGMENT)
  222. #error "Please replace 'const int dropsegments' with '#define MIN_STEPS_PER_SEGMENT' (and increase by 1)."
  223. #elif MIN_STEPS_PER_SEGMENT <= 0
  224. #error "MIN_STEPS_PER_SEGMENT must be at least 1."
  225. #elif defined(PREVENT_DANGEROUS_EXTRUDE)
  226. #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION."
  227. #elif defined(SCARA)
  228. #error "SCARA is now MORGAN_SCARA."
  229. #elif defined(ENABLE_AUTO_BED_LEVELING)
  230. #error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
  231. #elif defined(AUTO_BED_LEVELING_FEATURE)
  232. #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
  233. #elif defined(ABL_GRID_POINTS)
  234. #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y."
  235. #elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y)
  236. #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]."
  237. #elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y)
  238. #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]."
  239. #elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS)
  240. #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]."
  241. #elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS)
  242. #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]."
  243. #elif defined(UBL_G26_MESH_VALIDATION)
  244. #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION."
  245. #elif defined(UBL_MESH_EDIT_ENABLED)
  246. #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION."
  247. #elif defined(UBL_MESH_EDITING)
  248. #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION."
  249. #elif defined(BLTOUCH_HEATERS_OFF)
  250. #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF."
  251. #elif defined(BLTOUCH_V3)
  252. #error "BLTOUCH_V3 is obsolete."
  253. #elif defined(BLTOUCH_FORCE_OPEN_DRAIN_MODE)
  254. #error "BLTOUCH_FORCE_OPEN_DRAIN_MODE is obsolete."
  255. #elif defined(BEEPER)
  256. #error "BEEPER is now BEEPER_PIN."
  257. #elif defined(SDCARDDETECT)
  258. #error "SDCARDDETECT is now SD_DETECT_PIN."
  259. #elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE)
  260. #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN."
  261. #elif defined(LCD_PIN_BL)
  262. #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN."
  263. #elif defined(LCD_PIN_RESET)
  264. #error "LCD_PIN_RESET is now LCD_RESET_PIN."
  265. #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)
  266. #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN."
  267. #elif defined(PID_FAN_SCALING) && !HAS_FAN
  268. #error "PID_FAN_SCALING needs at least one fan enabled."
  269. #elif defined(min_software_endstops) || defined(max_software_endstops)
  270. #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS."
  271. #elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN)
  272. #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)."
  273. #elif defined(CONTROLLERFAN_PIN)
  274. #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN."
  275. #elif defined(CONTROLLERFAN_SPEED)
  276. #error "CONTROLLERFAN_SPEED is now CONTROLLERFAN_SPEED_ACTIVE."
  277. #elif defined(CONTROLLERFAN_SECS)
  278. #error "CONTROLLERFAN_SECS is now CONTROLLERFAN_IDLE_TIME."
  279. #elif defined(MIN_RETRACT)
  280. #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT."
  281. #elif defined(ADVANCE)
  282. #error "ADVANCE is now LIN_ADVANCE."
  283. #elif defined(LIN_ADVANCE_E_D_RATIO)
  284. #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO."
  285. #elif defined(NEOPIXEL_RGBW_LED)
  286. #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED."
  287. #elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS)
  288. #error "Remove DELTA_PROBEABLE_RADIUS and use PROBING_MARGIN to inset the probe area instead."
  289. #elif ENABLED(DELTA) && defined(DELTA_CALIBRATION_RADIUS)
  290. #error "Remove DELTA_CALIBRATION_RADIUS and use PROBING_MARGIN to inset the probe area instead."
  291. #elif defined(UBL_MESH_INSET)
  292. #error "UBL_MESH_INSET is now just MESH_INSET."
  293. #elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y)
  294. #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]."
  295. #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)
  296. #error "ABL_PROBE_PT_[123]_[XY] is no longer required. Please remove it."
  297. #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)
  298. #error "UBL_PROBE_PT_[123]_[XY] is no longer required. Please remove it."
  299. #elif defined(MIN_PROBE_EDGE)
  300. #error "MIN_PROBE_EDGE is now called PROBING_MARGIN."
  301. #elif defined(MIN_PROBE_EDGE_LEFT)
  302. #error "MIN_PROBE_EDGE_LEFT is now called PROBING_MARGIN_LEFT."
  303. #elif defined(MIN_PROBE_EDGE_RIGHT)
  304. #error "MIN_PROBE_EDGE_RIGHT is now called PROBING_MARGIN_RIGHT."
  305. #elif defined(MIN_PROBE_EDGE_FRONT)
  306. #error "MIN_PROBE_EDGE_FRONT is now called PROBING_MARGIN_FRONT."
  307. #elif defined(MIN_PROBE_EDGE_BACK)
  308. #error "MIN_PROBE_EDGE_BACK is now called PROBING_MARGIN_BACK."
  309. #elif defined(LEFT_PROBE_BED_POSITION)
  310. #error "LEFT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_LEFT instead."
  311. #elif defined(RIGHT_PROBE_BED_POSITION)
  312. #error "RIGHT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_RIGHT instead."
  313. #elif defined(FRONT_PROBE_BED_POSITION)
  314. #error "FRONT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_FRONT instead."
  315. #elif defined(BACK_PROBE_BED_POSITION)
  316. #error "BACK_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_BACK instead."
  317. #elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY)
  318. #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY."
  319. #elif defined(BABYSTEP_ZPROBE_GFX_REVERSE)
  320. #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE."
  321. #elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN)
  322. #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES."
  323. #elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1))
  324. #error "K1 is now PID_K1."
  325. #elif defined(PROBE_DOUBLE_TOUCH)
  326. #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING."
  327. #elif defined(ANET_KEYPAD_LCD)
  328. #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD."
  329. #elif defined(LCD_I2C_SAINSMART_YWROBOT)
  330. #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004)."
  331. #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT)
  332. #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN."
  333. #elif defined(HAVE_TMCDRIVER)
  334. #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X."
  335. #elif defined(STEALTHCHOP)
  336. #error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E)."
  337. #elif defined(HAVE_TMC26X)
  338. #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X."
  339. #elif defined(HAVE_TMC2130)
  340. #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130."
  341. #elif defined(HAVE_TMC2208)
  342. #error "HAVE_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208."
  343. #elif defined(HAVE_L6470DRIVER)
  344. #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470."
  345. #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) \
  346. || 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)
  347. #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X."
  348. #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) \
  349. || 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)
  350. #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X."
  351. #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) \
  352. || 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)
  353. #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130."
  354. #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) \
  355. || 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)
  356. #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208."
  357. #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) \
  358. || 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)
  359. #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470."
  360. #elif defined(AUTOMATIC_CURRENT_CONTROL)
  361. #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS."
  362. #elif defined(FILAMENT_CHANGE_LOAD_LENGTH)
  363. #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH."
  364. #elif defined(LEVEL_CORNERS_INSET)
  365. #error "LEVEL_CORNERS_INSET is now LEVEL_CORNERS_INSET_LFRB."
  366. #elif defined(BEZIER_JERK_CONTROL)
  367. #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION."
  368. #elif HAS_JUNCTION_DEVIATION && defined(JUNCTION_DEVIATION_FACTOR)
  369. #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM."
  370. #elif defined(JUNCTION_ACCELERATION_FACTOR)
  371. #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h."
  372. #elif defined(JUNCTION_ACCELERATION)
  373. #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h."
  374. #elif defined(MAX7219_DEBUG_STEPPER_HEAD)
  375. #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD."
  376. #elif defined(MAX7219_DEBUG_STEPPER_TAIL)
  377. #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL."
  378. #elif defined(MAX7219_DEBUG_STEPPER_QUEUE)
  379. #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE."
  380. #elif defined(ENDSTOP_NOISE_FILTER)
  381. #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]."
  382. #elif defined(RETRACT_ZLIFT)
  383. #error "RETRACT_ZLIFT is now RETRACT_ZRAISE."
  384. #elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT)
  385. #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE."
  386. #elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE)
  387. #error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE."
  388. #elif defined(SINGLENOZZLE_SWAP_LENGTH)
  389. #error "SINGLENOZZLE_SWAP_LENGTH is now TOOLCHANGE_FIL_SWAP_LENGTH."
  390. #elif defined(SINGLENOZZLE_SWAP_RETRACT_SPEED)
  391. #error "SINGLENOZZLE_SWAP_RETRACT_SPEED is now TOOLCHANGE_FIL_SWAP_RETRACT_SPEED."
  392. #elif defined(SINGLENOZZLE_SWAP_PRIME_SPEED)
  393. #error "SINGLENOZZLE_SWAP_PRIME_SPEED is now TOOLCHANGE_FIL_SWAP_PRIME_SPEED."
  394. #elif defined(SINGLENOZZLE_SWAP_PARK)
  395. #error "SINGLENOZZLE_SWAP_PARK is now TOOLCHANGE_PARK."
  396. #elif defined(SINGLENOZZLE_TOOLCHANGE_XY)
  397. #error "SINGLENOZZLE_TOOLCHANGE_XY is now TOOLCHANGE_PARK_XY."
  398. #elif defined(SINGLENOZZLE_PARK_XY_FEEDRATE)
  399. #error "SINGLENOZZLE_PARK_XY_FEEDRATE is now TOOLCHANGE_PARK_XY_FEEDRATE."
  400. #elif defined(PARKING_EXTRUDER_SECURITY_RAISE)
  401. #error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE."
  402. #elif defined(SWITCHING_TOOLHEAD_SECURITY_RAISE)
  403. #error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE."
  404. #elif defined(G0_FEEDRATE) && G0_FEEDRATE == 0
  405. #error "G0_FEEDRATE is now used to set the G0 feedrate."
  406. #elif defined(MBL_Z_STEP)
  407. #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP."
  408. #elif defined(CHDK)
  409. #error "CHDK is now CHDK_PIN."
  410. #elif defined(MAX6675_SS) || defined(MAX6675_SS2)
  411. #error "MAX6675_SS / MAX6675_SS2 is now MAX6675_SS_PIN / MAX6675_SS2_PIN."
  412. #elif defined(MAX31865_SENSOR_OHMS)
  413. #error "MAX31865_SENSOR_OHMS is now MAX31865_SENSOR_OHMS_0."
  414. #elif defined(MAX31865_CALIBRATION_OHMS)
  415. #error "MAX31865_CALIBRATION_OHMS is now MAX31865_CALIBRATION_OHMS_0."
  416. #elif defined(SPINDLE_LASER_ENABLE)
  417. #error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE."
  418. #elif defined(SPINDLE_LASER_ENABLE_PIN)
  419. #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN."
  420. #elif defined(SPINDLE_DIR_CHANGE)
  421. #error "SPINDLE_DIR_CHANGE is now SPINDLE_CHANGE_DIR."
  422. #elif defined(SPINDLE_STOP_ON_DIR_CHANGE)
  423. #error "SPINDLE_STOP_ON_DIR_CHANGE is now SPINDLE_CHANGE_DIR_STOP."
  424. #elif defined(SPINDLE_LASER_ACTIVE_HIGH)
  425. #error "SPINDLE_LASER_ACTIVE_HIGH is now SPINDLE_LASER_ACTIVE_STATE."
  426. #elif defined(SPINDLE_LASER_ENABLE_INVERT)
  427. #error "SPINDLE_LASER_ENABLE_INVERT is now SPINDLE_LASER_ACTIVE_STATE."
  428. #elif defined(CUTTER_POWER_DISPLAY)
  429. #error "CUTTER_POWER_DISPLAY is now CUTTER_POWER_UNIT."
  430. #elif defined(CHAMBER_HEATER_PIN)
  431. #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN."
  432. #elif defined(TMC_Z_CALIBRATION)
  433. #error "TMC_Z_CALIBRATION has been deprecated in favor of MECHANICAL_GANTRY_CALIBRATION."
  434. #elif defined(Z_MIN_PROBE_ENDSTOP)
  435. #error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it."
  436. #elif defined(DUAL_NOZZLE_DUPLICATION_MODE)
  437. #error "DUAL_NOZZLE_DUPLICATION_MODE is now MULTI_NOZZLE_DUPLICATION."
  438. #elif defined(MENU_ITEM_CASE_LIGHT)
  439. #error "MENU_ITEM_CASE_LIGHT is now CASE_LIGHT_MENU."
  440. #elif defined(CASE_LIGHT_NEOPIXEL_COLOR)
  441. #error "CASE_LIGHT_NEOPIXEL_COLOR is now CASE_LIGHT_DEFAULT_COLOR."
  442. #elif defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
  443. #error "ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED is now SD_ABORT_ON_ENDSTOP_HIT."
  444. #elif defined(LPC_SD_LCD) || defined(LPC_SD_ONBOARD) || defined(LPC_SD_CUSTOM_CABLE)
  445. #error "LPC_SD_(LCD|ONBOARD|CUSTOM_CABLE) are now SDCARD_CONNECTION."
  446. #elif defined(USB_SD_DISABLED)
  447. #error "USB_SD_DISABLED is now NO_SD_HOST_DRIVE."
  448. #elif defined(USB_SD_ONBOARD)
  449. #error "USB_SD_ONBOARD is obsolete. Disable NO_SD_HOST_DRIVE instead."
  450. #elif defined(PSU_ACTIVE_HIGH)
  451. #error "PSU_ACTIVE_HIGH is now PSU_ACTIVE_STATE."
  452. #elif POWER_SUPPLY == 1
  453. #error "Replace POWER_SUPPLY 1 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'LOW'."
  454. #elif POWER_SUPPLY == 2
  455. #error "Replace POWER_SUPPLY 2 by enabling PSU_CONTROL and setting PSU_ACTIVE_STATE to 'HIGH'."
  456. #elif defined(POWER_SUPPLY)
  457. #error "POWER_SUPPLY is now obsolete. Please remove it."
  458. #elif defined(MKS_ROBIN_TFT)
  459. #error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT."
  460. #elif defined(SDPOWER)
  461. #error "SDPOWER is now SDPOWER_PIN."
  462. #elif defined(STRING_SPLASH_LINE1) || defined(STRING_SPLASH_LINE2)
  463. #error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them."
  464. #elif defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_X)
  465. #error "Z_PROBE_ALLEN_KEY_(DEPLOY|STOW) coordinates are now a single setting."
  466. #elif defined(X_PROBE_OFFSET_FROM_EXTRUDER) || defined(Y_PROBE_OFFSET_FROM_EXTRUDER) || defined(Z_PROBE_OFFSET_FROM_EXTRUDER)
  467. #error "[XYZ]_PROBE_OFFSET_FROM_EXTRUDER is now NOZZLE_TO_PROBE_OFFSET."
  468. #elif defined(MIN_PROBE_X) || defined(MIN_PROBE_Y) || defined(MAX_PROBE_X) || defined(MAX_PROBE_Y)
  469. #error "(MIN|MAX)_PROBE_[XY] are now calculated at runtime. Please remove them."
  470. #elif defined(Z_STEPPER_ALIGN_X) || defined(Z_STEPPER_ALIGN_X)
  471. #error "Z_STEPPER_ALIGN_X and Z_STEPPER_ALIGN_Y are now combined as Z_STEPPER_ALIGN_XY."
  472. #elif defined(JUNCTION_DEVIATION)
  473. #error "JUNCTION_DEVIATION is no longer required. (See CLASSIC_JERK). Please remove it."
  474. #elif defined(BABYSTEP_MULTIPLICATOR)
  475. #error "BABYSTEP_MULTIPLICATOR is now BABYSTEP_MULTIPLICATOR_[XY|Z]."
  476. #elif defined(LULZBOT_TOUCH_UI)
  477. #error "LULZBOT_TOUCH_UI is now TOUCH_UI_FTDI_EVE."
  478. #elif defined(PS_DEFAULT_OFF)
  479. #error "PS_DEFAULT_OFF is now PSU_DEFAULT_OFF."
  480. #elif defined(FILAMENT_UNLOAD_RETRACT_LENGTH)
  481. #error "FILAMENT_UNLOAD_RETRACT_LENGTH is now FILAMENT_UNLOAD_PURGE_RETRACT."
  482. #elif defined(FILAMENT_UNLOAD_DELAY)
  483. #error "FILAMENT_UNLOAD_DELAY is now FILAMENT_UNLOAD_PURGE_DELAY."
  484. #elif defined(HOME_USING_SPREADCYCLE)
  485. #error "HOME_USING_SPREADCYCLE is now obsolete. Please remove it."
  486. #elif defined(DGUS_LCD)
  487. #error "DGUS_LCD is now DGUS_LCD_UI_(ORIGIN|FYSETC|HIPRECY)."
  488. #elif defined(DGUS_SERIAL_PORT)
  489. #error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT."
  490. #elif defined(DGUS_BAUDRATE)
  491. #error "DGUS_BAUDRATE is now LCD_BAUDRATE."
  492. #elif defined(DGUS_STATS_RX_BUFFER_OVERRUNS)
  493. #error "DGUS_STATS_RX_BUFFER_OVERRUNS is now STATS_RX_BUFFER_OVERRUNS."
  494. #elif defined(ANYCUBIC_LCD_SERIAL_PORT)
  495. #error "ANYCUBIC_LCD_SERIAL_PORT is now LCD_SERIAL_PORT."
  496. #elif defined(INTERNAL_SERIAL_PORT)
  497. #error "INTERNAL_SERIAL_PORT is now MMU2_SERIAL_PORT."
  498. #elif defined(X_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Y_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Z_DUAL_ENDSTOPS_ADJUSTMENT)
  499. #error "[XYZ]_DUAL_ENDSTOPS_ADJUSTMENT is now [XYZ]2_ENDSTOP_ADJUSTMENT."
  500. #elif defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT2) || defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT3)
  501. #error "Z_TRIPLE_ENDSTOPS_ADJUSTMENT[23] is now Z[23]_ENDSTOP_ADJUSTMENT."
  502. #elif defined(Z_QUAD_ENDSTOPS_ADJUSTMENT2) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT3) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT4)
  503. #error "Z_QUAD_ENDSTOPS_ADJUSTMENT[234] is now Z[234]_ENDSTOP_ADJUSTMENT."
  504. #elif defined(Z_DUAL_STEPPER_DRIVERS)
  505. #error "Z_DUAL_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 2."
  506. #elif defined(Z_TRIPLE_STEPPER_DRIVERS)
  507. #error "Z_TRIPLE_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 3."
  508. #elif defined(Z_QUAD_STEPPER_DRIVERS)
  509. #error "Z_QUAD_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 4."
  510. #elif defined(Z_DUAL_ENDSTOPS) || defined(Z_TRIPLE_ENDSTOPS) || defined(Z_QUAD_ENDSTOPS)
  511. #error "Z_(DUAL|TRIPLE|QUAD)_ENDSTOPS is now Z_MULTI_ENDSTOPS."
  512. #elif defined(DUGS_UI_MOVE_DIS_OPTION)
  513. #error "DUGS_UI_MOVE_DIS_OPTION is spelled DGUS_UI_MOVE_DIS_OPTION."
  514. #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)
  515. #error "ORIG_Ex_AUTO_FAN_PIN is now just Ex_AUTO_FAN_PIN."
  516. #elif defined(ORIG_CHAMBER_AUTO_FAN_PIN)
  517. #error "ORIG_CHAMBER_AUTO_FAN_PIN is now just CHAMBER_AUTO_FAN_PIN."
  518. #elif defined(HOMING_BACKOFF_MM)
  519. #error "HOMING_BACKOFF_MM is now HOMING_BACKOFF_POST_MM."
  520. #elif defined(X_HOME_BUMP_MM) || defined(Y_HOME_BUMP_MM) || defined(Z_HOME_BUMP_MM)
  521. #error "[XYZ]_HOME_BUMP_MM is now HOMING_BUMP_MM."
  522. #elif defined(DIGIPOT_I2C)
  523. #error "DIGIPOT_I2C is now DIGIPOT_MCP4451 (or DIGIPOT_MCP4018)."
  524. #elif defined(TOUCH_BUTTONS)
  525. #error "TOUCH_BUTTONS is now TOUCH_SCREEN."
  526. #elif defined(LCD_FULL_PIXEL_HEIGHT) || defined(LCD_FULL_PIXEL_WIDTH)
  527. #error "LCD_FULL_PIXEL_(WIDTH|HEIGHT) is deprecated and should be removed."
  528. #elif defined(FSMC_UPSCALE)
  529. #error "FSMC_UPSCALE is now GRAPHICAL_TFT_UPSCALE."
  530. #elif defined(ANYCUBIC_TFT_MODEL)
  531. #error "ANYCUBIC_TFT_MODEL is now ANYCUBIC_LCD_I3MEGA."
  532. #elif defined(EVENT_GCODE_SD_STOP)
  533. #error "EVENT_GCODE_SD_STOP is now EVENT_GCODE_SD_ABORT."
  534. #elif defined(GRAPHICAL_TFT_ROTATE_180)
  535. #error "GRAPHICAL_TFT_ROTATE_180 is now TFT_ROTATION set to TFT_ROTATE_180."
  536. #elif defined(PROBE_OFFSET_START)
  537. #error "PROBE_OFFSET_START is now PROBE_OFFSET_WIZARD_START_Z."
  538. #elif defined(POWER_LOSS_PULL)
  539. #error "POWER_LOSS_PULL is now specifically POWER_LOSS_PULL(UP|DOWN)."
  540. #elif defined(SHORT_MANUAL_Z_MOVE)
  541. #error "SHORT_MANUAL_Z_MOVE is now FINE_MANUAL_MOVE, applying to Z on most printers."
  542. #elif defined(FIL_RUNOUT_INVERTING)
  543. #if FIL_RUNOUT_INVERTING
  544. #error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH."
  545. #else
  546. #error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_STATE LOW."
  547. #endif
  548. #elif defined(ASSISTED_TRAMMING_MENU_ITEM)
  549. #error "ASSISTED_TRAMMING_MENU_ITEM is deprecated and should be removed."
  550. #elif defined(UNKNOWN_Z_NO_RAISE)
  551. #error "UNKNOWN_Z_NO_RAISE is replaced by setting Z_IDLE_HEIGHT to Z_MAX_POS."
  552. #elif defined(Z_AFTER_DEACTIVATE)
  553. #error "Z_AFTER_DEACTIVATE is replaced by Z_IDLE_HEIGHT."
  554. #elif defined(MEATPACK)
  555. #error "MEATPACK is now enabled with MEATPACK_ON_SERIAL_PORT_1, MEATPACK_ON_SERIAL_PORT_2, etc."
  556. #elif defined(CUSTOM_USER_MENUS)
  557. #error "CUSTOM_USER_MENUS has been replaced by CUSTOM_MENU_MAIN and CUSTOM_MENU_CONFIG."
  558. #elif defined(MKS_LCD12864)
  559. #error "MKS_LCD12864 is now MKS_LCD12864A or MKS_LCD12864B."
  560. #endif
  561. /**
  562. * Probe temp compensation requirements
  563. */
  564. #if ENABLED(PROBE_TEMP_COMPENSATION)
  565. #if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
  566. #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
  567. #elif !defined(PTC_PARK_POS)
  568. #error "PROBE_TEMP_COMPENSATION requires PTC_PARK_POS."
  569. #elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y)
  570. #error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)."
  571. #elif !defined(PTC_PROBE_POS)
  572. #error "PROBE_TEMP_COMPENSATION requires PTC_PROBE_POS."
  573. #endif
  574. #endif
  575. /**
  576. * Marlin release, version and default string
  577. */
  578. #ifndef SHORT_BUILD_VERSION
  579. #error "SHORT_BUILD_VERSION must be specified."
  580. #elif !defined(DETAILED_BUILD_VERSION)
  581. #error "BUILD_VERSION must be specified."
  582. #elif !defined(STRING_DISTRIBUTION_DATE)
  583. #error "STRING_DISTRIBUTION_DATE must be specified."
  584. #elif !defined(PROTOCOL_VERSION)
  585. #error "PROTOCOL_VERSION must be specified."
  586. #elif !defined(MACHINE_NAME)
  587. #error "MACHINE_NAME must be specified."
  588. #elif !defined(SOURCE_CODE_URL)
  589. #error "SOURCE_CODE_URL must be specified."
  590. #elif !defined(DEFAULT_MACHINE_UUID)
  591. #error "DEFAULT_MACHINE_UUID must be specified."
  592. #elif !defined(WEBSITE_URL)
  593. #error "WEBSITE_URL must be specified."
  594. #endif
  595. /**
  596. * Serial
  597. */
  598. #ifndef SERIAL_PORT
  599. #error "SERIAL_PORT must be defined."
  600. #elif defined(SERIAL_PORT_2) && SERIAL_PORT_2 == SERIAL_PORT
  601. #error "SERIAL_PORT_2 cannot be the same as SERIAL_PORT."
  602. #elif defined(SERIAL_PORT_3)
  603. #ifndef SERIAL_PORT_2
  604. #error "Use SERIAL_PORT_2 before using SERIAL_PORT_3"
  605. #elif SERIAL_PORT_3 == SERIAL_PORT
  606. #error "SERIAL_PORT_3 cannot be the same as SERIAL_PORT."
  607. #elif SERIAL_PORT_3 == SERIAL_PORT_2
  608. #error "SERIAL_PORT_3 cannot be the same as SERIAL_PORT_2."
  609. #endif
  610. #endif
  611. #if !(defined(__AVR__) && defined(USBCON))
  612. #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
  613. #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
  614. #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
  615. #error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
  616. #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
  617. #error "TX_BUFFER_SIZE must be 0 or a power of 2 between 1 and 256."
  618. #endif
  619. #elif ANY(SERIAL_XON_XOFF, SERIAL_STATS_MAX_RX_QUEUED, SERIAL_STATS_DROPPED_RX)
  620. #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
  621. #endif
  622. /**
  623. * Multiple Stepper Drivers Per Axis
  624. */
  625. #define GOOD_AXIS_PINS(A) (HAS_##A##_ENABLE && HAS_##A##_STEP && HAS_##A##_DIR)
  626. #if ENABLED(X_DUAL_STEPPER_DRIVERS)
  627. #if ENABLED(DUAL_X_CARRIAGE)
  628. #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS."
  629. #elif !GOOD_AXIS_PINS(X)
  630. #error "X_DUAL_STEPPER_DRIVERS requires X2 pins to be defined."
  631. #endif
  632. #endif
  633. #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !GOOD_AXIS_PINS(Y)
  634. #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins to be defined."
  635. #elif !WITHIN(NUM_Z_STEPPER_DRIVERS, 1, 4)
  636. #error "NUM_Z_STEPPER_DRIVERS must be an integer from 1 to 4."
  637. #elif NUM_Z_STEPPER_DRIVERS == 2 && !GOOD_AXIS_PINS(Z2)
  638. #error "If NUM_Z_STEPPER_DRIVERS is 2, you must define stepper pins for Z2."
  639. #elif NUM_Z_STEPPER_DRIVERS == 3 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3))
  640. #error "If NUM_Z_STEPPER_DRIVERS is 3, you must define stepper pins for Z2 and Z3."
  641. #elif NUM_Z_STEPPER_DRIVERS == 4 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3) && GOOD_AXIS_PINS(Z4))
  642. #error "If NUM_Z_STEPPER_DRIVERS is 4, you must define stepper pins for Z2, Z3, and Z4."
  643. #endif
  644. /**
  645. * Validate that the bed size fits
  646. */
  647. static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE.");
  648. static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE.");
  649. /**
  650. * Granular software endstops (Marlin >= 1.1.7)
  651. */
  652. #if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z)
  653. #if IS_KINEMATIC
  654. #error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z."
  655. #elif NONE(MIN_SOFTWARE_ENDSTOP_X, MIN_SOFTWARE_ENDSTOP_Y)
  656. #error "MIN_SOFTWARE_ENDSTOPS requires at least one of the MIN_SOFTWARE_ENDSTOP_[XYZ] options."
  657. #endif
  658. #endif
  659. #if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z)
  660. #if IS_KINEMATIC
  661. #error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z."
  662. #elif NONE(MAX_SOFTWARE_ENDSTOP_X, MAX_SOFTWARE_ENDSTOP_Y)
  663. #error "MAX_SOFTWARE_ENDSTOPS requires at least one of the MAX_SOFTWARE_ENDSTOP_[XYZ] options."
  664. #endif
  665. #endif
  666. #if !defined(TARGET_LPC1768) && ANY( \
  667. ENDSTOPPULLDOWNS, \
  668. ENDSTOPPULLDOWN_XMAX, ENDSTOPPULLDOWN_YMAX, \
  669. ENDSTOPPULLDOWN_ZMAX, ENDSTOPPULLDOWN_XMIN, \
  670. ENDSTOPPULLDOWN_YMIN, ENDSTOPPULLDOWN_ZMIN \
  671. )
  672. #error "PULLDOWN pin mode is not available on the selected board."
  673. #endif
  674. #if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS)
  675. #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS."
  676. #elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN)
  677. #error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN."
  678. #elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX)
  679. #error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX."
  680. #elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX)
  681. #error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
  682. #elif BOTH(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX)
  683. #error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
  684. #elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN)
  685. #error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
  686. #elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN)
  687. #error "Enable only one of ENDSTOPPULLUP_Y_MIN or ENDSTOPPULLDOWN_Y_MIN."
  688. #elif BOTH(ENDSTOPPULLUP_ZMIN, ENDSTOPPULLDOWN_ZMIN)
  689. #error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN."
  690. #endif
  691. /**
  692. * LCD Info Screen Style
  693. */
  694. #if LCD_INFO_SCREEN_STYLE > 0
  695. #if HAS_MARLINUI_U8GLIB || LCD_WIDTH < 20 || LCD_HEIGHT < 4
  696. #error "Alternative LCD_INFO_SCREEN_STYLE requires 20x4 Character LCD."
  697. #elif LCD_INFO_SCREEN_STYLE > 1
  698. #error "LCD_INFO_SCREEN_STYLE only has options 0 and 1 at this time."
  699. #endif
  700. #endif
  701. /**
  702. * Progress Bar
  703. */
  704. #if ENABLED(LCD_PROGRESS_BAR)
  705. #if NONE(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
  706. #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY."
  707. #elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
  708. #error "LCD_PROGRESS_BAR only applies to HD44780 character LCD and TFTGLCD_PANEL_(SPI|I2C)."
  709. #elif HAS_MARLINUI_U8GLIB
  710. #error "LCD_PROGRESS_BAR does not apply to graphical displays."
  711. #elif ENABLED(FILAMENT_LCD_DISPLAY)
  712. #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both."
  713. #elif PROGRESS_MSG_EXPIRE < 0
  714. #error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
  715. #endif
  716. #elif ENABLED(LCD_SET_PROGRESS_MANUALLY)
  717. #if NONE(HAS_MARLINUI_U8GLIB, HAS_GRAPHICAL_TFT, HAS_MARLINUI_HD44780, EXTENSIBLE_UI)
  718. #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Character LCD, Graphical LCD, TFT, or EXTENSIBLE_UI."
  719. #endif
  720. #endif
  721. #if ENABLED(USE_M73_REMAINING_TIME) && DISABLED(LCD_SET_PROGRESS_MANUALLY)
  722. #error "USE_M73_REMAINING_TIME requires LCD_SET_PROGRESS_MANUALLY"
  723. #endif
  724. #if !HAS_LCD_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
  725. #error "SD_REPRINT_LAST_SELECTED_FILE currently requires a Marlin-native LCD menu."
  726. #endif
  727. /**
  728. * Custom Boot and Status screens
  729. */
  730. #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE)
  731. #error "SHOW_CUSTOM_BOOTSCREEN requires Graphical LCD or TOUCH_UI_FTDI_EVE."
  732. #elif ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && !HAS_MARLINUI_U8GLIB
  733. #error "CUSTOM_STATUS_SCREEN_IMAGE requires a 128x64 DOGM B/W Graphical LCD."
  734. #endif
  735. /**
  736. * LCD Lightweight Screen Style
  737. */
  738. #if ENABLED(LIGHTWEIGHT_UI) && DISABLED(U8GLIB_ST7920)
  739. #error "LIGHTWEIGHT_UI requires a U8GLIB_ST7920-based display."
  740. #endif
  741. /**
  742. * SD Card Settings
  743. */
  744. #if ALL(SDSUPPORT, ELB_FULL_GRAPHIC_CONTROLLER, HAS_LCD_MENU) && PIN_EXISTS(SD_DETECT) && SD_DETECT_STATE != HIGH && (SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION))
  745. #error "SD_DETECT_STATE must be set HIGH for SD on the ELB_FULL_GRAPHIC_CONTROLLER."
  746. #endif
  747. /**
  748. * SD File Sorting
  749. */
  750. #if ENABLED(SDCARD_SORT_ALPHA)
  751. #if SDSORT_LIMIT > 256
  752. #error "SDSORT_LIMIT must be 256 or smaller."
  753. #elif SDSORT_LIMIT < 10
  754. #error "SDSORT_LIMIT should be greater than 9 to be useful."
  755. #elif DISABLED(SDSORT_USES_RAM)
  756. #if ENABLED(SDSORT_DYNAMIC_RAM)
  757. #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)."
  758. #elif ENABLED(SDSORT_CACHE_NAMES)
  759. #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)."
  760. #endif
  761. #endif
  762. #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
  763. #if SDSORT_CACHE_VFATS < 2
  764. #error "SDSORT_CACHE_VFATS must be 2 or greater!"
  765. #elif SDSORT_CACHE_VFATS > MAX_VFAT_ENTRIES
  766. #undef SDSORT_CACHE_VFATS
  767. #define SDSORT_CACHE_VFATS MAX_VFAT_ENTRIES
  768. #warning "SDSORT_CACHE_VFATS was reduced to MAX_VFAT_ENTRIES!"
  769. #endif
  770. #endif
  771. #endif
  772. #if defined(EVENT_GCODE_SD_ABORT) && DISABLED(NOZZLE_PARK_FEATURE)
  773. static_assert(nullptr == strstr(EVENT_GCODE_SD_ABORT, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_ABORT.");
  774. #endif
  775. /**
  776. * I2C Position Encoders
  777. */
  778. #if ENABLED(I2C_POSITION_ENCODERS)
  779. #if !BOTH(BABYSTEPPING, BABYSTEP_XY)
  780. #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY."
  781. #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5)
  782. #error "I2CPE_ENCODER_CNT must be between 1 and 5."
  783. #endif
  784. #endif
  785. /**
  786. * Babystepping
  787. */
  788. #if ENABLED(BABYSTEPPING)
  789. #if ENABLED(SCARA)
  790. #error "BABYSTEPPING is not implemented for SCARA yet."
  791. #elif BOTH(MARKFORGED_XY, BABYSTEP_XY)
  792. #error "BABYSTEPPING only implemented for Z axis on MarkForged."
  793. #elif BOTH(DELTA, BABYSTEP_XY)
  794. #error "BABYSTEPPING only implemented for Z axis on deltabots."
  795. #elif BOTH(BABYSTEP_ZPROBE_OFFSET, MESH_BED_LEVELING)
  796. #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
  797. #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
  798. #error "BABYSTEP_ZPROBE_OFFSET requires a probe."
  799. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !HAS_MARLINUI_U8GLIB
  800. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD."
  801. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
  802. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
  803. #elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET
  804. #error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS."
  805. #elif BOTH(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE)
  806. #error "BABYSTEP_ALWAYS_AVAILABLE and MOVE_Z_WHEN_IDLE are incompatible."
  807. #elif !defined(BABYSTEP_MULTIPLICATOR_Z)
  808. #error "BABYSTEPPING requires BABYSTEP_MULTIPLICATOR_Z."
  809. #elif ENABLED(BABYSTEP_XY) && !defined(BABYSTEP_MULTIPLICATOR_XY)
  810. #error "BABYSTEP_XY requires BABYSTEP_MULTIPLICATOR_XY."
  811. #elif ENABLED(BABYSTEP_MILLIMETER_UNITS)
  812. static_assert(BABYSTEP_MULTIPLICATOR_Z <= 0.1f, "BABYSTEP_MULTIPLICATOR_Z must be less or equal to 0.1mm.");
  813. #if ENABLED(BABYSTEP_XY)
  814. static_assert(BABYSTEP_MULTIPLICATOR_XY <= 0.25f, "BABYSTEP_MULTIPLICATOR_XY must be less than or equal to 0.25mm.");
  815. #endif
  816. #endif
  817. #endif
  818. /**
  819. * Filament Runout needs one or more pins and either SD Support or Auto print start detection
  820. */
  821. #if HAS_FILAMENT_SENSOR
  822. #if !PIN_EXISTS(FIL_RUNOUT)
  823. #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
  824. #elif HAS_PRUSA_MMU2 && NUM_RUNOUT_SENSORS != 1
  825. #error "NUM_RUNOUT_SENSORS must be 1 with MMU2 / MMU2S."
  826. #elif NUM_RUNOUT_SENSORS != 1 && NUM_RUNOUT_SENSORS != E_STEPPERS
  827. #error "NUM_RUNOUT_SENSORS must be either 1 or number of E steppers."
  828. #elif NUM_RUNOUT_SENSORS >= 8 && !PIN_EXISTS(FIL_RUNOUT8)
  829. #error "FIL_RUNOUT8_PIN is required with NUM_RUNOUT_SENSORS >= 8."
  830. #elif NUM_RUNOUT_SENSORS >= 7 && !PIN_EXISTS(FIL_RUNOUT7)
  831. #error "FIL_RUNOUT7_PIN is required with NUM_RUNOUT_SENSORS >= 7."
  832. #elif NUM_RUNOUT_SENSORS >= 6 && !PIN_EXISTS(FIL_RUNOUT6)
  833. #error "FIL_RUNOUT6_PIN is required with NUM_RUNOUT_SENSORS >= 6."
  834. #elif NUM_RUNOUT_SENSORS >= 5 && !PIN_EXISTS(FIL_RUNOUT5)
  835. #error "FIL_RUNOUT5_PIN is required with NUM_RUNOUT_SENSORS >= 5."
  836. #elif NUM_RUNOUT_SENSORS >= 4 && !PIN_EXISTS(FIL_RUNOUT4)
  837. #error "FIL_RUNOUT4_PIN is required with NUM_RUNOUT_SENSORS >= 4."
  838. #elif NUM_RUNOUT_SENSORS >= 3 && !PIN_EXISTS(FIL_RUNOUT3)
  839. #error "FIL_RUNOUT3_PIN is required with NUM_RUNOUT_SENSORS >= 3."
  840. #elif NUM_RUNOUT_SENSORS >= 2 && !PIN_EXISTS(FIL_RUNOUT2)
  841. #error "FIL_RUNOUT2_PIN is required with NUM_RUNOUT_SENSORS >= 2."
  842. #elif BOTH(FIL_RUNOUT1_PULLUP, FIL_RUNOUT1_PULLDOWN)
  843. #error "You can't enable FIL_RUNOUT1_PULLUP and FIL_RUNOUT1_PULLDOWN at the same time."
  844. #elif BOTH(FIL_RUNOUT2_PULLUP, FIL_RUNOUT2_PULLDOWN)
  845. #error "You can't enable FIL_RUNOUT2_PULLUP and FIL_RUNOUT2_PULLDOWN at the same time."
  846. #elif BOTH(FIL_RUNOUT3_PULLUP, FIL_RUNOUT3_PULLDOWN)
  847. #error "You can't enable FIL_RUNOUT3_PULLUP and FIL_RUNOUT3_PULLDOWN at the same time."
  848. #elif BOTH(FIL_RUNOUT4_PULLUP, FIL_RUNOUT4_PULLDOWN)
  849. #error "You can't enable FIL_RUNOUT4_PULLUP and FIL_RUNOUT4_PULLDOWN at the same time."
  850. #elif BOTH(FIL_RUNOUT5_PULLUP, FIL_RUNOUT5_PULLDOWN)
  851. #error "You can't enable FIL_RUNOUT5_PULLUP and FIL_RUNOUT5_PULLDOWN at the same time."
  852. #elif BOTH(FIL_RUNOUT6_PULLUP, FIL_RUNOUT6_PULLDOWN)
  853. #error "You can't enable FIL_RUNOUT6_PULLUP and FIL_RUNOUT6_PULLDOWN at the same time."
  854. #elif BOTH(FIL_RUNOUT7_PULLUP, FIL_RUNOUT7_PULLDOWN)
  855. #error "You can't enable FIL_RUNOUT7_PULLUP and FIL_RUNOUT7_PULLDOWN at the same time."
  856. #elif BOTH(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN)
  857. #error "You can't enable FIL_RUNOUT8_PULLUP and FIL_RUNOUT8_PULLDOWN at the same time."
  858. #elif FILAMENT_RUNOUT_DISTANCE_MM < 0
  859. #error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero."
  860. #elif DISABLED(ADVANCED_PAUSE_FEATURE)
  861. static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
  862. #endif
  863. #endif
  864. /**
  865. * Advanced Pause
  866. */
  867. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  868. #if !HAS_RESUME_CONTINUE
  869. #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
  870. #elif DISABLED(NOZZLE_PARK_FEATURE)
  871. #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE."
  872. #elif !defined(FILAMENT_UNLOAD_PURGE_FEEDRATE)
  873. #error "ADVANCED_PAUSE_FEATURE requires FILAMENT_UNLOAD_PURGE_FEEDRATE."
  874. #elif ENABLED(EXTRUDER_RUNOUT_PREVENT)
  875. #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
  876. #elif ENABLED(PARK_HEAD_ON_PAUSE) && NONE(SDSUPPORT, IS_NEWPANEL, EMERGENCY_PARSER)
  877. #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller."
  878. #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
  879. #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT."
  880. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH
  881. #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  882. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH
  883. #error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  884. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH
  885. #error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  886. #endif
  887. #endif
  888. #if ENABLED(NOZZLE_PARK_FEATURE)
  889. constexpr float npp[] = NOZZLE_PARK_POINT;
  890. static_assert(COUNT(npp) == XYZ, "NOZZLE_PARK_POINT requires X, Y, and Z values.");
  891. constexpr xyz_pos_t npp_xyz = NOZZLE_PARK_POINT;
  892. 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).");
  893. 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).");
  894. 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).");
  895. #endif
  896. /**
  897. * Individual axis homing is useless for DELTAS
  898. */
  899. #if BOTH(INDIVIDUAL_AXIS_HOMING_MENU, DELTA)
  900. #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
  901. #endif
  902. /**
  903. * Sanity checking for all Průša MMU
  904. */
  905. #ifdef SNMM
  906. #error "SNMM is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
  907. #elif ENABLED(MK2_MULTIPLEXER)
  908. #error "MK2_MULTIPLEXER is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
  909. #elif ENABLED(PRUSA_MMU2)
  910. #error "PRUSA_MMU2 is obsolete. Define MMU_MODEL as PRUSA_MMU2 instead."
  911. #elif ENABLED(PRUSA_MMU2_S_MODE)
  912. #error "PRUSA_MMU2_S_MODE is obsolete. Define MMU_MODEL as PRUSA_MMU2S instead."
  913. #elif ENABLED(SMUFF_EMU_MMU2)
  914. #error "SMUFF_EMU_MMU2 is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2 instead."
  915. #elif ENABLED(SMUFF_EMU_MMU2S)
  916. #error "SMUFF_EMU_MMU2S is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2S instead."
  917. #endif
  918. /**
  919. * Multi-Material-Unit 2 / EXTENDABLE_EMU_MMU2 requirements
  920. */
  921. #if HAS_PRUSA_MMU2
  922. #if EXTRUDERS != 5
  923. #undef SINGLENOZZLE
  924. #error "PRUSA_MMU2(S) requires exactly 5 EXTRUDERS. Please update your Configuration."
  925. #elif DISABLED(NOZZLE_PARK_FEATURE)
  926. #error "PRUSA_MMU2(S) requires NOZZLE_PARK_FEATURE. Enable it to continue."
  927. #elif HAS_PRUSA_MMU2S && DISABLED(FILAMENT_RUNOUT_SENSOR)
  928. #error "PRUSA_MMU2S requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
  929. #elif ENABLED(MMU_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR)
  930. #error "MMU_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
  931. #elif ENABLED(MMU_EXTRUDER_SENSOR) && !HAS_LCD_MENU
  932. #error "MMU_EXTRUDER_SENSOR requires an LCD supporting MarlinUI to be enabled."
  933. #elif DISABLED(ADVANCED_PAUSE_FEATURE)
  934. 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).");
  935. #endif
  936. #endif
  937. #if HAS_EXTENDABLE_MMU && EXTRUDERS > 15
  938. #error "Too many extruders for MMU(S) emulation mode. (15 maximum)."
  939. #endif
  940. /**
  941. * Options only for EXTRUDERS > 1
  942. */
  943. #if HAS_MULTI_EXTRUDER
  944. #if EXTRUDERS > 8
  945. #error "Marlin supports a maximum of 8 EXTRUDERS."
  946. #endif
  947. #if ENABLED(HEATERS_PARALLEL)
  948. #error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
  949. #endif
  950. #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
  951. #ifndef TOOLCHANGE_FS_LENGTH
  952. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH."
  953. #elif !defined(TOOLCHANGE_FS_RETRACT_SPEED)
  954. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_RETRACT_SPEED."
  955. #elif !defined(TOOLCHANGE_FS_PRIME_SPEED)
  956. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_PRIME_SPEED."
  957. #endif
  958. #endif
  959. #if ENABLED(TOOLCHANGE_PARK)
  960. #ifndef TOOLCHANGE_PARK_XY
  961. #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY."
  962. #elif !defined(TOOLCHANGE_PARK_XY_FEEDRATE)
  963. #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY_FEEDRATE."
  964. #endif
  965. #endif
  966. #ifndef TOOLCHANGE_ZRAISE
  967. #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1."
  968. #endif
  969. #elif HAS_PRUSA_MMU1 || HAS_EXTENDABLE_MMU
  970. #error "Multi-Material-Unit requires 2 or more EXTRUDERS."
  971. #elif ENABLED(SINGLENOZZLE)
  972. #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
  973. #endif
  974. /**
  975. * A Dual Nozzle carriage with switching servo
  976. */
  977. #if ENABLED(SWITCHING_NOZZLE)
  978. #if ENABLED(DUAL_X_CARRIAGE)
  979. #error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible."
  980. #elif ENABLED(SINGLENOZZLE)
  981. #error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible."
  982. #elif EXTRUDERS != 2
  983. #error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
  984. #elif NUM_SERVOS < 1
  985. #error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1."
  986. #endif
  987. #ifndef SWITCHING_NOZZLE_SERVO_NR
  988. #error "SWITCHING_NOZZLE requires SWITCHING_NOZZLE_SERVO_NR."
  989. #elif SWITCHING_NOZZLE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  990. #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
  991. #elif SWITCHING_NOZZLE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  992. #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
  993. #elif SWITCHING_NOZZLE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  994. #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
  995. #elif SWITCHING_NOZZLE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  996. #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
  997. #endif
  998. #ifdef SWITCHING_NOZZLE_E1_SERVO_NR
  999. #if SWITCHING_NOZZLE_E1_SERVO_NR == SWITCHING_NOZZLE_SERVO_NR
  1000. #error "SWITCHING_NOZZLE_E1_SERVO_NR must be different from SWITCHING_NOZZLE_SERVO_NR."
  1001. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  1002. #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
  1003. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  1004. #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
  1005. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  1006. #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
  1007. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  1008. #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
  1009. #endif
  1010. #endif
  1011. #endif
  1012. /**
  1013. * Single Stepper Dual Extruder with switching servo
  1014. */
  1015. #if ENABLED(SWITCHING_EXTRUDER)
  1016. #if NUM_SERVOS < 1
  1017. #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
  1018. #elif SWITCHING_EXTRUDER_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  1019. #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
  1020. #elif SWITCHING_EXTRUDER_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  1021. #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
  1022. #elif SWITCHING_EXTRUDER_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  1023. #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
  1024. #elif SWITCHING_EXTRUDER_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  1025. #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
  1026. #endif
  1027. #if EXTRUDERS > 3
  1028. #if NUM_SERVOS < 2
  1029. #error "SWITCHING_EXTRUDER with 4 extruders requires NUM_SERVOS >= 2."
  1030. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  1031. #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
  1032. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  1033. #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
  1034. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  1035. #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
  1036. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  1037. #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
  1038. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == SWITCHING_EXTRUDER_SERVO_NR
  1039. #error "SWITCHING_EXTRUDER_E23_SERVO_NR should be a different extruder from SWITCHING_EXTRUDER_SERVO_NR."
  1040. #endif
  1041. #endif
  1042. #endif
  1043. /**
  1044. * Mixing Extruder requirements
  1045. */
  1046. #if ENABLED(MIXING_EXTRUDER)
  1047. #if HAS_MULTI_EXTRUDER
  1048. #error "For MIXING_EXTRUDER set MIXING_STEPPERS > 1 instead of EXTRUDERS > 1."
  1049. #elif MIXING_STEPPERS < 2
  1050. #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
  1051. #elif ENABLED(FILAMENT_SENSOR)
  1052. #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway."
  1053. #elif ENABLED(SWITCHING_EXTRUDER)
  1054. #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both."
  1055. #elif ENABLED(SINGLENOZZLE)
  1056. #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE."
  1057. #endif
  1058. #endif
  1059. /**
  1060. * Linear Advance 1.5 - Check K value range
  1061. */
  1062. #if ENABLED(LIN_ADVANCE)
  1063. static_assert(
  1064. WITHIN(LIN_ADVANCE_K, 0, 10),
  1065. "LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)."
  1066. );
  1067. #if ENABLED(S_CURVE_ACCELERATION) && DISABLED(EXPERIMENTAL_SCURVE)
  1068. #error "LIN_ADVANCE and S_CURVE_ACCELERATION may not play well together! Enable EXPERIMENTAL_SCURVE to continue."
  1069. #endif
  1070. #endif
  1071. /**
  1072. * Special tool-changing options
  1073. */
  1074. #if MANY(SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  1075. #error "Please select only one of SINGLENOZZLE, DUAL_X_CARRIAGE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, or ELECTROMAGNETIC_SWITCHING_TOOLHEAD."
  1076. #endif
  1077. /**
  1078. * (Magnetic) Parking Extruder requirements
  1079. */
  1080. #if ANY(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER)
  1081. #if ENABLED(EXT_SOLENOID)
  1082. #error "(MAGNETIC_)PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)"
  1083. #elif EXTRUDERS != 2
  1084. #error "(MAGNETIC_)PARKING_EXTRUDER requires exactly 2 EXTRUDERS."
  1085. #elif !defined(PARKING_EXTRUDER_PARKING_X)
  1086. #error "(MAGNETIC_)PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X."
  1087. #elif !defined(TOOLCHANGE_ZRAISE)
  1088. #error "(MAGNETIC_)PARKING_EXTRUDER requires TOOLCHANGE_ZRAISE."
  1089. #elif TOOLCHANGE_ZRAISE < 0
  1090. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  1091. #elif ENABLED(PARKING_EXTRUDER)
  1092. #if !PINS_EXIST(SOL0, SOL1)
  1093. #error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN."
  1094. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH)
  1095. #error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW."
  1096. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000)
  1097. #error "PARKING_EXTRUDER_SOLENOIDS_DELAY must be between 0 and 2000 (ms)."
  1098. #endif
  1099. #endif
  1100. #endif
  1101. /**
  1102. * Switching Toolhead requirements
  1103. */
  1104. #if ENABLED(SWITCHING_TOOLHEAD)
  1105. #ifndef SWITCHING_TOOLHEAD_SERVO_NR
  1106. #error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SERVO_NR."
  1107. #elif EXTRUDERS < 2
  1108. #error "SWITCHING_TOOLHEAD requires at least 2 EXTRUDERS."
  1109. #elif NUM_SERVOS < (SWITCHING_TOOLHEAD_SERVO_NR - 1)
  1110. #if SWITCHING_TOOLHEAD_SERVO_NR == 0
  1111. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 0 requires NUM_SERVOS >= 1."
  1112. #elif SWITCHING_TOOLHEAD_SERVO_NR == 1
  1113. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 1 requires NUM_SERVOS >= 2."
  1114. #elif SWITCHING_TOOLHEAD_SERVO_NR == 2
  1115. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 2 requires NUM_SERVOS >= 3."
  1116. #elif SWITCHING_TOOLHEAD_SERVO_NR == 3
  1117. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 3 requires NUM_SERVOS >= 4."
  1118. #endif
  1119. #elif !defined(TOOLCHANGE_ZRAISE)
  1120. #error "SWITCHING_TOOLHEAD requires TOOLCHANGE_ZRAISE."
  1121. #elif TOOLCHANGE_ZRAISE < 0
  1122. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  1123. #endif
  1124. #endif
  1125. /**
  1126. * (Electro)magnetic Switching Toolhead requirements
  1127. */
  1128. #if EITHER(MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  1129. #ifndef SWITCHING_TOOLHEAD_Y_POS
  1130. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_POS"
  1131. #elif !defined(SWITCHING_TOOLHEAD_X_POS)
  1132. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_X_POS"
  1133. #elif !defined(SWITCHING_TOOLHEAD_Z_HOP)
  1134. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
  1135. #elif !defined(SWITCHING_TOOLHEAD_Y_CLEAR)
  1136. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_CLEAR."
  1137. #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
  1138. #if ENABLED(EXT_SOLENOID)
  1139. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD and EXT_SOLENOID are incompatible. (Pins are used twice.)"
  1140. #elif !PIN_EXISTS(SOL0)
  1141. #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SOL0_PIN."
  1142. #endif
  1143. #endif
  1144. #endif
  1145. /**
  1146. * Part-Cooling Fan Multiplexer requirements
  1147. */
  1148. #if PIN_EXISTS(FANMUX1)
  1149. #if !HAS_FANMUX
  1150. #error "FANMUX0_PIN must be set before FANMUX1_PIN can be set."
  1151. #endif
  1152. #elif PIN_EXISTS(FANMUX2)
  1153. #error "FANMUX0_PIN and FANMUX1_PIN must be set before FANMUX2_PIN can be set."
  1154. #endif
  1155. /**
  1156. * Limited user-controlled fans
  1157. */
  1158. #if NUM_M106_FANS > FAN_COUNT
  1159. #error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS."
  1160. #endif
  1161. /**
  1162. * Limited number of servos
  1163. */
  1164. #if NUM_SERVOS > NUM_SERVO_PLUGS
  1165. #error "The selected board doesn't support enough servos for your configuration. Reduce NUM_SERVOS."
  1166. #endif
  1167. /**
  1168. * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder
  1169. */
  1170. #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_PROBE && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR) && !defined(SWITCHING_TOOLHEAD_SERVO_NR)
  1171. #error "Z_PROBE_SERVO_NR, switching nozzle, switching toolhead or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE."
  1172. #endif
  1173. /**
  1174. * Required LCD language
  1175. */
  1176. #if HAS_MARLINUI_HD44780 && !defined(DISPLAY_CHARSET_HD44780)
  1177. #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller."
  1178. #endif
  1179. /**
  1180. * Bed Heating Options - PID vs Limit Switching
  1181. */
  1182. #if BOTH(PIDTEMPBED, BED_LIMIT_SWITCHING)
  1183. #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED."
  1184. #endif
  1185. /**
  1186. * Synchronous M106/M107 checks
  1187. */
  1188. #if ENABLED(LASER_SYNCHRONOUS_M106_M107)
  1189. #if FAN_KICKSTART_TIME
  1190. #error "FAN_KICKSTART_TIME must be 0 with LASER_SYNCHRONOUS_M106_M107 (because the laser will always come on at FULL power)."
  1191. #elif FAN_MIN_PWM
  1192. #error "FAN_MIN_PWM must be 0 with LASER_SYNCHRONOUS_M106_M107 (otherwise the laser will never turn OFF)."
  1193. #endif
  1194. #endif
  1195. /**
  1196. * Chamber Heating Options - PID vs Limit Switching
  1197. */
  1198. #if BOTH(PIDTEMPCHAMBER, CHAMBER_LIMIT_SWITCHING)
  1199. #error "To use CHAMBER_LIMIT_SWITCHING you must disable PIDTEMPCHAMBER."
  1200. #endif
  1201. /**
  1202. * Kinematics
  1203. */
  1204. /**
  1205. * Allow only one kinematic type to be defined
  1206. */
  1207. #if MANY(DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY)
  1208. #error "Please enable only one of DELTA, MORGAN_SCARA, AXEL_TPARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, COREZY, or MARKFORGED_XY."
  1209. #endif
  1210. /**
  1211. * Delta requirements
  1212. */
  1213. #if ENABLED(DELTA)
  1214. #if NONE(USE_XMAX_PLUG, USE_YMAX_PLUG, USE_ZMAX_PLUG)
  1215. #error "You probably want to use Max Endstops for DELTA!"
  1216. #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED
  1217. #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
  1218. #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_LCD_MENU)
  1219. #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
  1220. #elif ENABLED(DELTA_CALIBRATION_MENU) && !HAS_LCD_MENU
  1221. #error "DELTA_CALIBRATION_MENU requires an LCD Controller."
  1222. #elif ABL_USES_GRID
  1223. #if ((GRID_MAX_POINTS_X) & 1) == 0 || ((GRID_MAX_POINTS_Y) & 1) == 0
  1224. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
  1225. #elif (GRID_MAX_POINTS_X) < 3
  1226. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher."
  1227. #endif
  1228. #endif
  1229. #endif
  1230. /**
  1231. * Junction deviation is incompatible with kinematic systems.
  1232. */
  1233. #if HAS_JUNCTION_DEVIATION && IS_KINEMATIC
  1234. #error "CLASSIC_JERK is required for DELTA and SCARA."
  1235. #endif
  1236. /**
  1237. * Probes
  1238. */
  1239. /**
  1240. * Allow only one probe option to be defined
  1241. */
  1242. #if 1 < 0 \
  1243. + (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \
  1244. + 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)
  1245. #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, or Z Servo."
  1246. #endif
  1247. #if HAS_BED_PROBE
  1248. /**
  1249. * Z_PROBE_SLED is incompatible with DELTA
  1250. */
  1251. #if BOTH(Z_PROBE_SLED, DELTA)
  1252. #error "You cannot use Z_PROBE_SLED with DELTA."
  1253. #endif
  1254. /**
  1255. * SOLENOID_PROBE requirements
  1256. */
  1257. #if ENABLED(SOLENOID_PROBE)
  1258. #if ENABLED(EXT_SOLENOID)
  1259. #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID."
  1260. #elif !HAS_SOLENOID_1
  1261. #error "SOLENOID_PROBE requires SOL1_PIN."
  1262. #endif
  1263. #endif
  1264. /**
  1265. * NUM_SERVOS is required for a Z servo probe
  1266. */
  1267. #if HAS_Z_SERVO_PROBE
  1268. #if !NUM_SERVOS
  1269. #error "NUM_SERVOS is required for a Z servo probe (Z_PROBE_SERVO_NR)."
  1270. #elif Z_PROBE_SERVO_NR >= NUM_SERVOS
  1271. #error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS."
  1272. #elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  1273. #error "SERVO0_PIN must be defined for your servo or BLTOUCH probe."
  1274. #elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  1275. #error "SERVO1_PIN must be defined for your servo or BLTOUCH probe."
  1276. #elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  1277. #error "SERVO2_PIN must be defined for your servo or BLTOUCH probe."
  1278. #elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  1279. #error "SERVO3_PIN must be defined for your servo or BLTOUCH probe."
  1280. #endif
  1281. #endif
  1282. #if ENABLED(BLTOUCH)
  1283. #if BLTOUCH_DELAY < 200
  1284. #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported."
  1285. #elif DISABLED(BLTOUCH_SET_5V_MODE) && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN, ENDSTOPPULLUP_ZMIN_PROBE)
  1286. #error "BLTOUCH without BLTOUCH_SET_5V_MODE requires ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN or ENDSTOPPULLUP_ZMIN_PROBE."
  1287. #endif
  1288. #endif
  1289. #if ENABLED(RACK_AND_PINION_PROBE) && !(defined(Z_PROBE_DEPLOY_X) && defined(Z_PROBE_RETRACT_X))
  1290. #error "RACK_AND_PINION_PROBE requires Z_PROBE_DEPLOY_X and Z_PROBE_RETRACT_X."
  1291. #endif
  1292. /**
  1293. * Touch-MI probe requirements
  1294. */
  1295. #if ENABLED(TOUCH_MI_PROBE)
  1296. #if DISABLED(Z_SAFE_HOMING)
  1297. #error "TOUCH_MI_PROBE requires Z_SAFE_HOMING."
  1298. #elif !defined(TOUCH_MI_RETRACT_Z)
  1299. #error "TOUCH_MI_PROBE requires TOUCH_MI_RETRACT_Z."
  1300. #elif defined(Z_AFTER_PROBING)
  1301. #error "TOUCH_MI_PROBE requires Z_AFTER_PROBING to be disabled."
  1302. #elif Z_HOMING_HEIGHT < 10
  1303. #error "TOUCH_MI_PROBE requires Z_HOMING_HEIGHT >= 10."
  1304. #elif Z_MIN_PROBE_ENDSTOP_INVERTING
  1305. #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING to be set to false."
  1306. #elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
  1307. #error "TOUCH_MI_PROBE requires BABYSTEPPING with BABYSTEP_ZPROBE_OFFSET."
  1308. #elif !HAS_RESUME_CONTINUE
  1309. #error "TOUCH_MI_PROBE currently requires an LCD controller or EMERGENCY_PARSER."
  1310. #endif
  1311. #endif
  1312. /**
  1313. * Require pin options and pins to be defined
  1314. */
  1315. #if ENABLED(SENSORLESS_PROBING)
  1316. #if ENABLED(DELTA) && !(AXIS_HAS_STALLGUARD(X) && AXIS_HAS_STALLGUARD(Y) && AXIS_HAS_STALLGUARD(Z))
  1317. #error "SENSORLESS_PROBING requires TMC2130/2160/2209/5130/5160 drivers on X, Y, and Z."
  1318. #elif !AXIS_HAS_STALLGUARD(Z)
  1319. #error "SENSORLESS_PROBING requires a TMC2130/2160/2209/5130/5160 driver on Z."
  1320. #endif
  1321. #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  1322. #if DISABLED(USE_ZMIN_PLUG)
  1323. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled."
  1324. #elif !HAS_Z_MIN
  1325. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined."
  1326. #elif Z_MIN_PROBE_ENDSTOP_INVERTING != Z_MIN_ENDSTOP_INVERTING
  1327. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING."
  1328. #endif
  1329. #elif !HAS_Z_MIN_PROBE_PIN
  1330. #error "Z_MIN_PROBE_PIN must be defined if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN is not enabled."
  1331. #endif
  1332. /**
  1333. * Check for improper NOZZLE_TO_PROBE_OFFSET
  1334. */
  1335. constexpr xyz_pos_t sanity_nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET;
  1336. #if ENABLED(NOZZLE_AS_PROBE)
  1337. static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0,
  1338. "NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0.");
  1339. #else
  1340. static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0.");
  1341. static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0.");
  1342. static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0.");
  1343. static_assert(PROBING_MARGIN_LEFT >= 0, "PROBING_MARGIN_LEFT must be >= 0.");
  1344. static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0.");
  1345. #endif
  1346. #define _MARGIN(A) TERN(IS_SCARA, SCARA_PRINTABLE_RADIUS, TERN(DELTA, DELTA_PRINTABLE_RADIUS, ((A##_BED_SIZE) / 2)))
  1347. static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large.");
  1348. static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large.");
  1349. static_assert(PROBING_MARGIN_FRONT < _MARGIN(Y), "PROBING_MARGIN_FRONT is too large.");
  1350. static_assert(PROBING_MARGIN_LEFT < _MARGIN(X), "PROBING_MARGIN_LEFT is too large.");
  1351. static_assert(PROBING_MARGIN_RIGHT < _MARGIN(X), "PROBING_MARGIN_RIGHT is too large.");
  1352. #undef _MARGIN
  1353. /**
  1354. * Make sure Z raise values are set
  1355. */
  1356. #ifndef Z_CLEARANCE_DEPLOY_PROBE
  1357. #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration."
  1358. #elif !defined(Z_CLEARANCE_BETWEEN_PROBES)
  1359. #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration."
  1360. #elif Z_CLEARANCE_DEPLOY_PROBE < 0
  1361. #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0."
  1362. #elif Z_CLEARANCE_BETWEEN_PROBES < 0
  1363. #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
  1364. #elif Z_AFTER_PROBING < 0
  1365. #error "Probes need Z_AFTER_PROBING >= 0."
  1366. #endif
  1367. #if MULTIPLE_PROBING > 0 || EXTRA_PROBING > 0
  1368. #if MULTIPLE_PROBING == 0
  1369. #error "EXTRA_PROBING requires MULTIPLE_PROBING."
  1370. #elif MULTIPLE_PROBING < 2
  1371. #error "MULTIPLE_PROBING must be 2 or more."
  1372. #elif MULTIPLE_PROBING <= EXTRA_PROBING
  1373. #error "EXTRA_PROBING must be less than MULTIPLE_PROBING."
  1374. #endif
  1375. #endif
  1376. #if Z_PROBE_LOW_POINT > 0
  1377. #error "Z_PROBE_LOW_POINT must be less than or equal to 0."
  1378. #endif
  1379. #if HOMING_Z_WITH_PROBE && IS_CARTESIAN && DISABLED(Z_SAFE_HOMING)
  1380. #error "Z_SAFE_HOMING is recommended when homing with a probe. Enable it or comment out this line to continue."
  1381. #endif
  1382. #if ENABLED(PROBE_ACTIVATION_SWITCH)
  1383. #ifndef PROBE_ACTIVATION_SWITCH_STATE
  1384. #error "PROBE_ACTIVATION_SWITCH_STATE is required for PROBE_ACTIVATION_SWITCH."
  1385. #elif !PIN_EXISTS(PROBE_ACTIVATION_SWITCH)
  1386. #error "A PROBE_ACTIVATION_SWITCH_PIN is required for PROBE_ACTIVATION_SWITCH."
  1387. #endif
  1388. #endif
  1389. #else
  1390. /**
  1391. * Require some kind of probe for bed leveling and probe testing
  1392. */
  1393. #if HAS_ABL_NOT_UBL && !PROBE_SELECTED
  1394. #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo."
  1395. #endif
  1396. #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
  1397. #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe: FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
  1398. #endif
  1399. #endif
  1400. #if ENABLED(LEVEL_BED_CORNERS)
  1401. #ifndef LEVEL_CORNERS_INSET_LFRB
  1402. #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values."
  1403. #elif ENABLED(LEVEL_CORNERS_USE_PROBE)
  1404. #if !HAS_BED_PROBE
  1405. #error "LEVEL_CORNERS_USE_PROBE requires a real probe."
  1406. #elif ENABLED(SENSORLESS_PROBING)
  1407. #error "LEVEL_CORNERS_USE_PROBE is incompatible with SENSORLESS_PROBING."
  1408. #endif
  1409. #endif
  1410. #endif
  1411. /**
  1412. * Allow only one bed leveling option to be defined
  1413. */
  1414. #if MANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
  1415. #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."
  1416. #endif
  1417. /**
  1418. * Bed Leveling Requirements
  1419. */
  1420. #if ENABLED(AUTO_BED_LEVELING_UBL)
  1421. /**
  1422. * Unified Bed Leveling
  1423. */
  1424. #if IS_SCARA
  1425. #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
  1426. #elif DISABLED(EEPROM_SETTINGS)
  1427. #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS."
  1428. #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
  1429. #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
  1430. #endif
  1431. #elif HAS_ABL_NOT_UBL
  1432. /**
  1433. * Auto Bed Leveling
  1434. */
  1435. /**
  1436. * Delta and SCARA have limited bed leveling options
  1437. */
  1438. #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR)
  1439. #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option."
  1440. #endif
  1441. #elif ENABLED(MESH_BED_LEVELING)
  1442. // Mesh Bed Leveling
  1443. #if ENABLED(DELTA)
  1444. #error "MESH_BED_LEVELING is not compatible with DELTA printers."
  1445. #elif (GRID_MAX_POINTS_X) > 9 || (GRID_MAX_POINTS_Y) > 9
  1446. #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
  1447. #endif
  1448. #endif
  1449. #if ALL(HAS_LEVELING, RESTORE_LEVELING_AFTER_G28, ENABLE_LEVELING_AFTER_G28)
  1450. #error "Only enable RESTORE_LEVELING_AFTER_G28 or ENABLE_LEVELING_AFTER_G28, but not both."
  1451. #endif
  1452. #if HAS_MESH && HAS_CLASSIC_JERK
  1453. static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
  1454. #endif
  1455. #if ENABLED(G26_MESH_VALIDATION)
  1456. #if !HAS_EXTRUDERS
  1457. #error "G26_MESH_VALIDATION requires at least one extruder."
  1458. #elif !HAS_MESH
  1459. #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
  1460. #endif
  1461. #endif
  1462. #if ENABLED(MESH_EDIT_GFX_OVERLAY) && !BOTH(AUTO_BED_LEVELING_UBL, HAS_MARLINUI_U8GLIB)
  1463. #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD."
  1464. #endif
  1465. #if ENABLED(G29_RETRY_AND_RECOVER)
  1466. #if ENABLED(AUTO_BED_LEVELING_UBL)
  1467. #error "G29_RETRY_AND_RECOVER is not compatible with UBL."
  1468. #elif ENABLED(MESH_BED_LEVELING)
  1469. #error "G29_RETRY_AND_RECOVER is not compatible with MESH_BED_LEVELING."
  1470. #endif
  1471. #endif
  1472. /**
  1473. * LCD_BED_LEVELING requirements
  1474. */
  1475. #if ENABLED(LCD_BED_LEVELING)
  1476. #if !HAS_LCD_MENU
  1477. #error "LCD_BED_LEVELING requires a programmable LCD controller."
  1478. #elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL)
  1479. #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
  1480. #endif
  1481. #endif
  1482. #if BOTH(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
  1483. #error "Disable PREHEAT_BEFORE_LEVELING when using PREHEAT_BEFORE_PROBING."
  1484. #endif
  1485. /**
  1486. * Homing
  1487. */
  1488. constexpr float hbm[] = HOMING_BUMP_MM;
  1489. static_assert(COUNT(hbm) == XYZ, "HOMING_BUMP_MM requires X, Y, and Z elements.");
  1490. static_assert(hbm[X_AXIS] >= 0, "HOMING_BUMP_MM.X must be greater than or equal to 0.");
  1491. static_assert(hbm[Y_AXIS] >= 0, "HOMING_BUMP_MM.Y must be greater than or equal to 0.");
  1492. static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal to 0.");
  1493. #if ENABLED(CODEPENDENT_XY_HOMING)
  1494. #if ENABLED(QUICK_HOME)
  1495. #error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING."
  1496. #elif IS_KINEMATIC
  1497. #error "CODEPENDENT_XY_HOMING requires a Cartesian setup."
  1498. #endif
  1499. #endif
  1500. /**
  1501. * Make sure Z_SAFE_HOMING point is reachable
  1502. */
  1503. #if ENABLED(Z_SAFE_HOMING)
  1504. 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.");
  1505. 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.");
  1506. #endif
  1507. /**
  1508. * Make sure DISABLE_[XYZ] compatible with selected homing options
  1509. */
  1510. #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z)
  1511. #if EITHER(HOME_AFTER_DEACTIVATE, Z_SAFE_HOMING)
  1512. #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
  1513. #endif
  1514. #endif
  1515. /**
  1516. * Filament Width Sensor
  1517. */
  1518. #if ENABLED(FILAMENT_WIDTH_SENSOR)
  1519. #if !HAS_FILAMENT_WIDTH_SENSOR
  1520. #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
  1521. #elif ENABLED(NO_VOLUMETRICS)
  1522. #error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled."
  1523. #endif
  1524. #endif
  1525. /**
  1526. * System Power Sensor
  1527. */
  1528. #if ENABLED(POWER_MONITOR_CURRENT) && !PIN_EXISTS(POWER_MONITOR_CURRENT)
  1529. #error "POWER_MONITOR_CURRENT requires a valid POWER_MONITOR_CURRENT_PIN."
  1530. #elif ENABLED(POWER_MONITOR_VOLTAGE) && !PIN_EXISTS(POWER_MONITOR_VOLTAGE)
  1531. #error "POWER_MONITOR_VOLTAGE requires POWER_MONITOR_VOLTAGE_PIN to be defined."
  1532. #elif BOTH(POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE) && POWER_MONITOR_CURRENT_PIN == POWER_MONITOR_VOLTAGE_PIN
  1533. #error "POWER_MONITOR_CURRENT_PIN and POWER_MONITOR_VOLTAGE_PIN must be different."
  1534. #endif
  1535. /**
  1536. * Volumetric Extruder Limit
  1537. */
  1538. #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT)
  1539. #if ENABLED(NO_VOLUMETRICS)
  1540. #error "VOLUMETRIC_EXTRUDER_LIMIT requires NO_VOLUMETRICS to be disabled."
  1541. #elif MIN_STEPS_PER_SEGMENT > 1
  1542. #error "VOLUMETRIC_EXTRUDER_LIMIT is not compatible with MIN_STEPS_PER_SEGMENT greater than 1."
  1543. #endif
  1544. #endif
  1545. /**
  1546. * ULTIPANEL encoder
  1547. */
  1548. #if IS_ULTIPANEL && NONE(IS_NEWPANEL, SR_LCD_2W_NL) && !PIN_EXISTS(SHIFT_CLK)
  1549. #error "ULTIPANEL controllers require some kind of encoder."
  1550. #endif
  1551. #if ENCODER_PULSES_PER_STEP < 0
  1552. #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead."
  1553. #endif
  1554. /**
  1555. * SAV_3DGLCD display options
  1556. */
  1557. #if ENABLED(SAV_3DGLCD)
  1558. #if NONE(U8GLIB_SSD1306, U8GLIB_SH1106)
  1559. #error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
  1560. #elif BOTH(U8GLIB_SSD1306, U8GLIB_SH1106)
  1561. #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
  1562. #endif
  1563. #endif
  1564. /**
  1565. * Allen Key
  1566. * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
  1567. */
  1568. #if ALL(Z_HOME_TO_MIN, Z_PROBE_ALLEN_KEY, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  1569. #error "You can't home to a Z min endstop with a Z_PROBE_ALLEN_KEY."
  1570. #endif
  1571. /**
  1572. * Dual X Carriage requirements
  1573. */
  1574. #if ENABLED(DUAL_X_CARRIAGE)
  1575. #if EXTRUDERS < 2
  1576. #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
  1577. #elif ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY)
  1578. #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, COREZX, or MARKFORGED_XY."
  1579. #elif !GOOD_AXIS_PINS(X2)
  1580. #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
  1581. #elif !HAS_X_MAX
  1582. #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop."
  1583. #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
  1584. #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
  1585. #elif X_HOME_TO_MAX || X2_HOME_TO_MIN
  1586. #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1."
  1587. #endif
  1588. #endif
  1589. #undef GOOD_AXIS_PINS
  1590. /**
  1591. * Make sure auto fan pins don't conflict with the fan pin
  1592. */
  1593. #if HAS_AUTO_FAN
  1594. #if HAS_FAN0
  1595. #if E0_AUTO_FAN_PIN == FAN_PIN
  1596. #error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
  1597. #elif E1_AUTO_FAN_PIN == FAN_PIN
  1598. #error "You cannot set E1_AUTO_FAN_PIN equal to FAN_PIN."
  1599. #elif E2_AUTO_FAN_PIN == FAN_PIN
  1600. #error "You cannot set E2_AUTO_FAN_PIN equal to FAN_PIN."
  1601. #elif E3_AUTO_FAN_PIN == FAN_PIN
  1602. #error "You cannot set E3_AUTO_FAN_PIN equal to FAN_PIN."
  1603. #endif
  1604. #endif
  1605. #endif
  1606. #if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN
  1607. #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."
  1608. #endif
  1609. #if ENABLED(USE_CONTROLLER_FAN)
  1610. #if !HAS_CONTROLLER_FAN
  1611. #error "USE_CONTROLLER_FAN requires a CONTROLLER_FAN_PIN. Define in Configuration_adv.h."
  1612. #elif E0_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1613. #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1614. #elif E1_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1615. #error "You cannot set E1_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1616. #elif E2_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1617. #error "You cannot set E2_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1618. #elif E3_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1619. #error "You cannot set E3_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1620. #endif
  1621. #endif
  1622. /**
  1623. * Case Light requirements
  1624. */
  1625. #if NEED_CASE_LIGHT_PIN
  1626. #if !PIN_EXISTS(CASE_LIGHT)
  1627. #error "CASE_LIGHT_ENABLE requires CASE_LIGHT_PIN, CASE_LIGHT_USE_NEOPIXEL, or CASE_LIGHT_USE_RGB_LED."
  1628. #elif CASE_LIGHT_PIN == FAN_PIN
  1629. #error "CASE_LIGHT_PIN conflicts with FAN_PIN. Resolve before continuing."
  1630. #endif
  1631. #endif
  1632. /**
  1633. * Required custom thermistor settings
  1634. */
  1635. #if TEMP_SENSOR_0_IS_CUSTOM && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA))
  1636. #error "TEMP_SENSOR_0 1000 requires HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS and HOTEND0_BETA in Configuration_adv.h."
  1637. #elif TEMP_SENSOR_1_IS_CUSTOM && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA))
  1638. #error "TEMP_SENSOR_1 1000 requires HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS and HOTEND1_BETA in Configuration_adv.h."
  1639. #elif TEMP_SENSOR_2_IS_CUSTOM && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA))
  1640. #error "TEMP_SENSOR_2 1000 requires HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS and HOTEND2_BETA in Configuration_adv.h."
  1641. #elif TEMP_SENSOR_3_IS_CUSTOM && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA))
  1642. #error "TEMP_SENSOR_3 1000 requires HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS and HOTEND3_BETA in Configuration_adv.h."
  1643. #elif TEMP_SENSOR_4_IS_CUSTOM && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA))
  1644. #error "TEMP_SENSOR_4 1000 requires HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS and HOTEND4_BETA in Configuration_adv.h."
  1645. #elif TEMP_SENSOR_5_IS_CUSTOM && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA))
  1646. #error "TEMP_SENSOR_5 1000 requires HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS and HOTEND5_BETA in Configuration_adv.h."
  1647. #elif TEMP_SENSOR_6_IS_CUSTOM && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA))
  1648. #error "TEMP_SENSOR_6 1000 requires HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS and HOTEND6_BETA in Configuration_adv.h."
  1649. #elif TEMP_SENSOR_7_IS_CUSTOM && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA))
  1650. #error "TEMP_SENSOR_7 1000 requires HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS and HOTEND7_BETA in Configuration_adv.h."
  1651. #elif TEMP_SENSOR_BED_IS_CUSTOM && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA))
  1652. #error "TEMP_SENSOR_BED 1000 requires BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS and BED_BETA in Configuration_adv.h."
  1653. #elif TEMP_SENSOR_CHAMBER_IS_CUSTOM && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA))
  1654. #error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h."
  1655. #elif TEMP_SENSOR_PROBE_IS_CUSTOM && !(defined(PROBE_PULLUP_RESISTOR_OHMS) && defined(PROBE_RESISTANCE_25C_OHMS) && defined(PROBE_BETA))
  1656. #error "TEMP_SENSOR_PROBE 1000 requires PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS and PROBE_BETA in Configuration_adv.h."
  1657. #endif
  1658. /**
  1659. * Pins and Sensor IDs must be set for each heater
  1660. */
  1661. #if TEMP_SENSOR_0_IS_MAX6675 && !ANY_PIN(MAX6675_SS, MAX31855_CS, MAX31865_CS, MAX6675_CS)
  1662. #error "TEMP_SENSOR_0 requires a MAX6675_SS_PIN, MAX6675_CS_PIN, MAX31855_CS_PIN, or MAX31865_CS_PIN."
  1663. #elif HAS_HOTEND && !HAS_TEMP_HOTEND && !TEMP_SENSOR_0_IS_DUMMY
  1664. #error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board."
  1665. #elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1
  1666. #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."
  1667. #endif
  1668. #if HAS_MULTI_HOTEND
  1669. #if TEMP_SENSOR_1_IS_MAX6675 && !ANY_PIN(MAX6675_SS2, MAX31855_CS2, MAX31865_CS2, MAX6675_CS2)
  1670. #error "TEMP_SENSOR_1 requires a MAX6675_SS2_PIN, MAX6675_CS2_PIN, MAX31855_CS2_PIN, or MAX31865_CS2_PIN."
  1671. #elif TEMP_SENSOR_1 == 0
  1672. #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
  1673. #elif !ANY_PIN(TEMP_1, MAX6675_SS2) && !TEMP_SENSOR_1_IS_DUMMY
  1674. #error "TEMP_1_PIN or MAX6675_SS2_PIN not defined for this board."
  1675. #elif ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  1676. #error "HOTENDS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT."
  1677. #endif
  1678. #if HOTENDS > 2
  1679. #if TEMP_SENSOR_2 == 0
  1680. #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
  1681. #elif !HAS_HEATER_2
  1682. #error "HEATER_2_PIN not defined for this board."
  1683. #elif !PIN_EXISTS(TEMP_2) && !TEMP_SENSOR_2_IS_DUMMY
  1684. #error "TEMP_2_PIN not defined for this board."
  1685. #endif
  1686. #if HOTENDS > 3
  1687. #if TEMP_SENSOR_3 == 0
  1688. #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
  1689. #elif !HAS_HEATER_3
  1690. #error "HEATER_3_PIN not defined for this board."
  1691. #elif !PIN_EXISTS(TEMP_3) && !TEMP_SENSOR_3_IS_DUMMY
  1692. #error "TEMP_3_PIN not defined for this board."
  1693. #endif
  1694. #if HOTENDS > 4
  1695. #if TEMP_SENSOR_4 == 0
  1696. #error "TEMP_SENSOR_4 is required with 5 or more HOTENDS."
  1697. #elif !HAS_HEATER_4
  1698. #error "HEATER_4_PIN not defined for this board."
  1699. #elif !PIN_EXISTS(TEMP_4) && !TEMP_SENSOR_4_IS_DUMMY
  1700. #error "TEMP_4_PIN not defined for this board."
  1701. #endif
  1702. #if HOTENDS > 5
  1703. #if TEMP_SENSOR_5 == 0
  1704. #error "TEMP_SENSOR_5 is required with 6 HOTENDS."
  1705. #elif !HAS_HEATER_5
  1706. #error "HEATER_5_PIN not defined for this board."
  1707. #elif !PIN_EXISTS(TEMP_5) && !TEMP_SENSOR_5_IS_DUMMY
  1708. #error "TEMP_5_PIN not defined for this board."
  1709. #endif
  1710. #if HOTENDS > 6
  1711. #if TEMP_SENSOR_6 == 0
  1712. #error "TEMP_SENSOR_6 is required with 6 HOTENDS."
  1713. #elif !HAS_HEATER_6
  1714. #error "HEATER_6_PIN not defined for this board."
  1715. #elif !PIN_EXISTS(TEMP_6) && !TEMP_SENSOR_6_IS_DUMMY
  1716. #error "TEMP_6_PIN not defined for this board."
  1717. #endif
  1718. #if HOTENDS > 7
  1719. #if TEMP_SENSOR_7 == 0
  1720. #error "TEMP_SENSOR_7 is required with 7 HOTENDS."
  1721. #elif !HAS_HEATER_7
  1722. #error "HEATER_7_PIN not defined for this board."
  1723. #elif !PIN_EXISTS(TEMP_7) && !TEMP_SENSOR_7_IS_DUMMY
  1724. #error "TEMP_7_PIN not defined for this board."
  1725. #endif
  1726. #elif TEMP_SENSOR_7 != 0
  1727. #error "TEMP_SENSOR_7 shouldn't be set with only 7 HOTENDS."
  1728. #endif
  1729. #elif TEMP_SENSOR_6 != 0
  1730. #error "TEMP_SENSOR_6 shouldn't be set with only 6 HOTENDS."
  1731. #elif TEMP_SENSOR_7 != 0
  1732. #error "TEMP_SENSOR_7 shouldn't be set with only 6 HOTENDS."
  1733. #endif
  1734. #elif TEMP_SENSOR_5 != 0
  1735. #error "TEMP_SENSOR_5 shouldn't be set with only 5 HOTENDS."
  1736. #elif TEMP_SENSOR_6 != 0
  1737. #error "TEMP_SENSOR_6 shouldn't be set with only 5 HOTENDS."
  1738. #elif TEMP_SENSOR_7 != 0
  1739. #error "TEMP_SENSOR_7 shouldn't be set with only 5 HOTENDS."
  1740. #endif
  1741. #elif TEMP_SENSOR_4 != 0
  1742. #error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS."
  1743. #elif TEMP_SENSOR_5 != 0
  1744. #error "TEMP_SENSOR_5 shouldn't be set with only 4 HOTENDS."
  1745. #elif TEMP_SENSOR_6 != 0
  1746. #error "TEMP_SENSOR_6 shouldn't be set with only 4 HOTENDS."
  1747. #elif TEMP_SENSOR_7 != 0
  1748. #error "TEMP_SENSOR_7 shouldn't be set with only 4 HOTENDS."
  1749. #endif
  1750. #elif TEMP_SENSOR_3 != 0
  1751. #error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS."
  1752. #elif TEMP_SENSOR_4 != 0
  1753. #error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS."
  1754. #elif TEMP_SENSOR_5 != 0
  1755. #error "TEMP_SENSOR_5 shouldn't be set with only 3 HOTENDS."
  1756. #elif TEMP_SENSOR_6 != 0
  1757. #error "TEMP_SENSOR_6 shouldn't be set with only 3 HOTENDS."
  1758. #elif TEMP_SENSOR_7 != 0
  1759. #error "TEMP_SENSOR_7 shouldn't be set with only 3 HOTENDS."
  1760. #endif
  1761. #elif TEMP_SENSOR_2 != 0
  1762. #error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS."
  1763. #elif TEMP_SENSOR_3 != 0
  1764. #error "TEMP_SENSOR_3 shouldn't be set with only 2 HOTENDS."
  1765. #elif TEMP_SENSOR_4 != 0
  1766. #error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS."
  1767. #elif TEMP_SENSOR_5 != 0
  1768. #error "TEMP_SENSOR_5 shouldn't be set with only 2 HOTENDS."
  1769. #elif TEMP_SENSOR_6 != 0
  1770. #error "TEMP_SENSOR_6 shouldn't be set with only 2 HOTENDS."
  1771. #elif TEMP_SENSOR_7 != 0
  1772. #error "TEMP_SENSOR_7 shouldn't be set with only 2 HOTENDS."
  1773. #endif
  1774. #elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  1775. #error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND."
  1776. #elif TEMP_SENSOR_2 != 0
  1777. #error "TEMP_SENSOR_2 shouldn't be set with only 1 HOTEND."
  1778. #elif TEMP_SENSOR_3 != 0
  1779. #error "TEMP_SENSOR_3 shouldn't be set with only 1 HOTEND."
  1780. #elif TEMP_SENSOR_4 != 0
  1781. #error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND."
  1782. #elif TEMP_SENSOR_5 != 0
  1783. #error "TEMP_SENSOR_5 shouldn't be set with only 1 HOTEND."
  1784. #elif TEMP_SENSOR_6 != 0
  1785. #error "TEMP_SENSOR_6 shouldn't be set with only 1 HOTEND."
  1786. #elif TEMP_SENSOR_7 != 0
  1787. #error "TEMP_SENSOR_7 shouldn't be set with only 1 HOTEND."
  1788. #endif
  1789. #if TEMP_SENSOR_CHAMBER && !PIN_EXISTS(TEMP_CHAMBER)
  1790. #error "TEMP_SENSOR_CHAMBER requires TEMP_CHAMBER_PIN."
  1791. #endif
  1792. #if TEMP_SENSOR_COOLER && !(PIN_EXISTS(TEMP_COOLER) && ENABLED(LASER_FEATURE))
  1793. #error "TEMP_SENSOR_COOLER requires LASER_FEATURE and TEMP_COOLER_PIN."
  1794. #endif
  1795. #if ENABLED(LASER_COOLANT_FLOW_METER) && !(PIN_EXISTS(FLOWMETER) && ENABLED(LASER_FEATURE))
  1796. #error "LASER_COOLANT_FLOW_METER requires FLOWMETER_PIN and LASER_FEATURE."
  1797. #endif
  1798. #if ENABLED(CHAMBER_FAN) && !(defined(CHAMBER_FAN_MODE) && WITHIN(CHAMBER_FAN_MODE, 0, 2))
  1799. #error "CHAMBER_FAN_MODE must be between 0 and 2."
  1800. #endif
  1801. #if ENABLED(CHAMBER_VENT)
  1802. #ifndef CHAMBER_VENT_SERVO_NR
  1803. #error "CHAMBER_VENT_SERVO_NR is required for CHAMBER SERVO."
  1804. #elif !NUM_SERVOS
  1805. #error "NUM_SERVOS is required for a Heated Chamber vent servo (CHAMBER_VENT_SERVO_NR)."
  1806. #elif CHAMBER_VENT_SERVO_NR >= NUM_SERVOS
  1807. #error "CHAMBER_VENT_SERVO_NR must be smaller than NUM_SERVOS."
  1808. #elif HAS_Z_SERVO_PROBE && CHAMBER_VENT_SERVO_NR == Z_PROBE_SERVO_NR
  1809. #error "CHAMBER SERVO is already used by BLTOUCH."
  1810. #elif CHAMBER_VENT_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  1811. #error "SERVO0_PIN must be defined for your Heated Chamber vent servo."
  1812. #elif CHAMBER_VENT_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  1813. #error "SERVO1_PIN must be defined for your Heated Chamber vent servo."
  1814. #elif CHAMBER_VENT_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  1815. #error "SERVO2_PIN must be defined for your Heated Chamber vent servo."
  1816. #elif CHAMBER_VENT_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  1817. #error "SERVO3_PIN must be defined for your Heated Chamber vent servo."
  1818. #endif
  1819. #endif
  1820. #if TEMP_SENSOR_PROBE
  1821. #if !PIN_EXISTS(TEMP_PROBE)
  1822. #error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN."
  1823. #elif !HAS_TEMP_ADC_PROBE
  1824. #error "TEMP_PROBE_PIN must be an ADC pin."
  1825. #elif DISABLED(FIX_MOUNTED_PROBE)
  1826. #error "TEMP_SENSOR_PROBE shouldn't be set without FIX_MOUNTED_PROBE."
  1827. #endif
  1828. #endif
  1829. #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0
  1830. #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
  1831. #endif
  1832. #if TEMP_SENSOR_0_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_0) && defined(MAX31865_CALIBRATION_OHMS_0))
  1833. #error "MAX31865_SENSOR_OHMS_0 and MAX31865_CALIBRATION_OHMS_0 must be set if TEMP_SENSOR_0 is MAX31865."
  1834. #elif TEMP_SENSOR_1_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_1) && defined(MAX31865_CALIBRATION_OHMS_1))
  1835. #error "MAX31865_SENSOR_OHMS_1 and MAX31865_CALIBRATION_OHMS_1 must be set if TEMP_SENSOR_1 is MAX31865."
  1836. #endif
  1837. /**
  1838. * Test Heater, Temp Sensor, and Extruder Pins
  1839. */
  1840. #if !HAS_HEATER_0 && EXTRUDERS
  1841. #error "HEATER_0_PIN not defined for this board."
  1842. #elif !ANY_PIN(TEMP_0, MAX6675_SS)
  1843. #error "TEMP_0_PIN or MAX6675_SS not defined for this board."
  1844. #elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && !PINS_EXIST(E0_STEP, E0_DIR))
  1845. #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
  1846. #elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PINS_EXIST(E0_STEP, E0_DIR) || !HAS_E0_ENABLE))
  1847. #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
  1848. #elif EXTRUDERS && TEMP_SENSOR_0 == 0
  1849. #error "TEMP_SENSOR_0 is required if there are any extruders."
  1850. #endif
  1851. /**
  1852. * Temperature status LEDs
  1853. */
  1854. #if ENABLED(TEMP_STAT_LEDS) && !ANY_PIN(STAT_LED_RED, STAT_LED_BLUE)
  1855. #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both."
  1856. #endif
  1857. /**
  1858. * LED Control Menu
  1859. */
  1860. #if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS
  1861. #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9533, PCA9632, or NEOPIXEL_LED."
  1862. #endif
  1863. /**
  1864. * LED Backlight Timeout
  1865. */
  1866. #if defined(LED_BACKLIGHT_TIMEOUT) && !(ENABLED(PSU_CONTROL) && ANY(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_242_OLED_12864))
  1867. #error "LED_BACKLIGHT_TIMEOUT requires a FYSETC Mini Panel and a Power Switch."
  1868. #endif
  1869. /**
  1870. * Basic multi hotend duplication mode
  1871. */
  1872. #if ENABLED(MULTI_NOZZLE_DUPLICATION)
  1873. #if ENABLED(SINGLENOZZLE)
  1874. #error "MULTI_NOZZLE_DUPLICATION is incompatible with SINGLENOZZLE."
  1875. #elif ENABLED(DUAL_X_CARRIAGE)
  1876. #error "MULTI_NOZZLE_DUPLICATION is incompatible with DUAL_X_CARRIAGE."
  1877. #elif ENABLED(MIXING_EXTRUDER)
  1878. #error "MULTI_NOZZLE_DUPLICATION is incompatible with MIXING_EXTRUDER."
  1879. #elif ENABLED(SWITCHING_EXTRUDER)
  1880. #error "MULTI_NOZZLE_DUPLICATION is incompatible with SWITCHING_EXTRUDER."
  1881. #elif HOTENDS < 2
  1882. #error "MULTI_NOZZLE_DUPLICATION requires 2 or more hotends."
  1883. #endif
  1884. #endif
  1885. /**
  1886. * Test Extruder Stepper Pins
  1887. */
  1888. #if E_STEPPERS
  1889. #if !(PINS_EXIST(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
  1890. #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
  1891. #endif
  1892. #if E_STEPPERS > 1
  1893. #if !(PINS_EXIST(E1_STEP, E1_DIR) && HAS_E1_ENABLE)
  1894. #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
  1895. #endif
  1896. #if E_STEPPERS > 2
  1897. #if !(PINS_EXIST(E2_STEP, E2_DIR) && HAS_E2_ENABLE)
  1898. #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
  1899. #endif
  1900. #if E_STEPPERS > 3
  1901. #if !(PINS_EXIST(E3_STEP, E3_DIR) && HAS_E3_ENABLE)
  1902. #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
  1903. #endif
  1904. #if E_STEPPERS > 4
  1905. #if !(PINS_EXIST(E4_STEP, E4_DIR) && HAS_E4_ENABLE)
  1906. #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
  1907. #endif
  1908. #if E_STEPPERS > 5
  1909. #if !(PINS_EXIST(E5_STEP, E5_DIR) && HAS_E5_ENABLE)
  1910. #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
  1911. #endif
  1912. #if E_STEPPERS > 6
  1913. #if !(PINS_EXIST(E6_STEP, E6_DIR) && HAS_E6_ENABLE)
  1914. #error "E6_STEP_PIN, E6_DIR_PIN, or E6_ENABLE_PIN not defined for this board."
  1915. #endif
  1916. #if E_STEPPERS > 7
  1917. #if !(PINS_EXIST(E7_STEP, E7_DIR) && HAS_E7_ENABLE)
  1918. #error "E7_STEP_PIN, E7_DIR_PIN, or E7_ENABLE_PIN not defined for this board."
  1919. #endif
  1920. #endif // E_STEPPERS > 7
  1921. #endif // E_STEPPERS > 6
  1922. #endif // E_STEPPERS > 5
  1923. #endif // E_STEPPERS > 4
  1924. #endif // E_STEPPERS > 3
  1925. #endif // E_STEPPERS > 2
  1926. #endif // E_STEPPERS > 1
  1927. #endif // E_STEPPERS
  1928. /**
  1929. * Endstop Tests
  1930. */
  1931. #define _PLUG_UNUSED_TEST(A,P) (DISABLED(USE_##P##MIN_PLUG, USE_##P##MAX_PLUG) \
  1932. && !(ENABLED(A##_DUAL_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) \
  1933. && !(ENABLED(A##_MULTI_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) )
  1934. #define _AXIS_PLUG_UNUSED_TEST(A) (_PLUG_UNUSED_TEST(A,X) && _PLUG_UNUSED_TEST(A,Y) && _PLUG_UNUSED_TEST(A,Z))
  1935. // A machine with endstops must have a minimum of 3
  1936. #if HAS_ENDSTOPS
  1937. #if _AXIS_PLUG_UNUSED_TEST(X)
  1938. #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG."
  1939. #endif
  1940. #if _AXIS_PLUG_UNUSED_TEST(Y)
  1941. #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG."
  1942. #endif
  1943. #if _AXIS_PLUG_UNUSED_TEST(Z)
  1944. #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG."
  1945. #endif
  1946. // Delta and Cartesian use 3 homing endstops
  1947. #if NONE(IS_SCARA, SPI_ENDSTOPS)
  1948. #if X_HOME_TO_MIN && DISABLED(USE_XMIN_PLUG)
  1949. #error "Enable USE_XMIN_PLUG when homing X to MIN."
  1950. #elif X_HOME_TO_MAX && DISABLED(USE_XMAX_PLUG)
  1951. #error "Enable USE_XMAX_PLUG when homing X to MAX."
  1952. #elif Y_HOME_TO_MIN && DISABLED(USE_YMIN_PLUG)
  1953. #error "Enable USE_YMIN_PLUG when homing Y to MIN."
  1954. #elif Y_HOME_TO_MAX && DISABLED(USE_YMAX_PLUG)
  1955. #error "Enable USE_YMAX_PLUG when homing Y to MAX."
  1956. #endif
  1957. #endif
  1958. // Z homing direction and plug usage flags
  1959. #if Z_HOME_TO_MIN && NONE(USE_ZMIN_PLUG, HOMING_Z_WITH_PROBE)
  1960. #error "Enable USE_ZMIN_PLUG when homing Z to MIN."
  1961. #elif Z_HOME_TO_MAX && ENABLED(USE_PROBE_FOR_Z_HOMING)
  1962. #error "Z_HOME_DIR must be -1 when homing Z with the probe."
  1963. #elif BOTH(HOMING_Z_WITH_PROBE, Z_MULTI_ENDSTOPS)
  1964. #error "Z_MULTI_ENDSTOPS is incompatible with USE_PROBE_FOR_Z_HOMING."
  1965. #elif Z_HOME_TO_MAX && DISABLED(USE_ZMAX_PLUG)
  1966. #error "Enable USE_ZMAX_PLUG when homing Z to MAX."
  1967. #endif
  1968. #endif
  1969. #if BOTH(HOME_Z_FIRST, USE_PROBE_FOR_Z_HOMING)
  1970. #error "HOME_Z_FIRST can't be used when homing Z with a probe."
  1971. #endif
  1972. // Dual/multiple endstops requirements
  1973. #if ENABLED(X_DUAL_ENDSTOPS)
  1974. #if ENABLED(DELTA)
  1975. #error "X_DUAL_ENDSTOPS is not compatible with DELTA."
  1976. #elif !X2_USE_ENDSTOP
  1977. #error "X2_USE_ENDSTOP must be set with X_DUAL_ENDSTOPS."
  1978. #endif
  1979. #endif
  1980. #if ENABLED(Y_DUAL_ENDSTOPS)
  1981. #if ENABLED(DELTA)
  1982. #error "Y_DUAL_ENDSTOPS is not compatible with DELTA."
  1983. #elif !Y2_USE_ENDSTOP
  1984. #error "Y2_USE_ENDSTOP must be set with Y_DUAL_ENDSTOPS."
  1985. #endif
  1986. #endif
  1987. #if ENABLED(Z_MULTI_ENDSTOPS)
  1988. #if ENABLED(DELTA)
  1989. #error "Z_MULTI_ENDSTOPS is not compatible with DELTA."
  1990. #elif !Z2_USE_ENDSTOP
  1991. #error "Z2_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS."
  1992. #elif !Z3_USE_ENDSTOP && NUM_Z_STEPPER_DRIVERS >= 3
  1993. #error "Z3_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS and NUM_Z_STEPPER_DRIVERS >= 3."
  1994. #elif !Z4_USE_ENDSTOP && NUM_Z_STEPPER_DRIVERS >= 4
  1995. #error "Z4_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS and NUM_Z_STEPPER_DRIVERS >= 4."
  1996. #endif
  1997. #endif
  1998. #if defined(ENDSTOP_NOISE_THRESHOLD) && !WITHIN(ENDSTOP_NOISE_THRESHOLD, 2, 7)
  1999. #error "ENDSTOP_NOISE_THRESHOLD must be an integer from 2 to 7."
  2000. #endif
  2001. /**
  2002. * Emergency Command Parser
  2003. */
  2004. #if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON)
  2005. #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
  2006. #endif
  2007. /**
  2008. * Software Reset options
  2009. */
  2010. #if ENABLED(SOFT_RESET_VIA_SERIAL) && DISABLED(EMERGENCY_PARSER)
  2011. #error "EMERGENCY_PARSER is required to activate SOFT_RESET_VIA_SERIAL."
  2012. #endif
  2013. #if ENABLED(SOFT_RESET_ON_KILL) && !BUTTON_EXISTS(ENC)
  2014. #error "An encoder button is required or SOFT_RESET_ON_KILL will reset the printer without notice!"
  2015. #endif
  2016. /**
  2017. * I2C bus
  2018. */
  2019. #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0
  2020. #if I2C_SLAVE_ADDRESS < 8
  2021. #error "I2C_SLAVE_ADDRESS can't be less than 8. (Addresses 0 - 7 are reserved.)"
  2022. #elif I2C_SLAVE_ADDRESS > 127
  2023. #error "I2C_SLAVE_ADDRESS can't be over 127. (Only 7 bits allowed.)"
  2024. #endif
  2025. #endif
  2026. /**
  2027. * G35 Assisted Tramming
  2028. */
  2029. #if ENABLED(ASSISTED_TRAMMING) && !HAS_BED_PROBE
  2030. #error "ASSISTED_TRAMMING requires a bed probe."
  2031. #endif
  2032. /**
  2033. * G38 Probe Target
  2034. */
  2035. #if ENABLED(G38_PROBE_TARGET)
  2036. #if !HAS_BED_PROBE
  2037. #error "G38_PROBE_TARGET requires a bed probe."
  2038. #elif !IS_CARTESIAN
  2039. #error "G38_PROBE_TARGET requires a Cartesian machine."
  2040. #endif
  2041. #endif
  2042. /**
  2043. * RGB_LED Requirements
  2044. */
  2045. #define _RGB_TEST (PINS_EXIST(RGB_LED_R, RGB_LED_G, RGB_LED_B))
  2046. #if ENABLED(PRINTER_EVENT_LEDS) && !HAS_COLOR_LEDS
  2047. #error "PRINTER_EVENT_LEDS requires BLINKM, PCA9533, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED."
  2048. #elif ENABLED(RGB_LED)
  2049. #if !_RGB_TEST
  2050. #error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN."
  2051. #elif ENABLED(RGBW_LED)
  2052. #error "Please enable only one of RGB_LED and RGBW_LED."
  2053. #endif
  2054. #elif ENABLED(RGBW_LED)
  2055. #if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W))
  2056. #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN."
  2057. #endif
  2058. #endif
  2059. #undef _RGB_TEST
  2060. // NeoPixel requirements
  2061. #if ENABLED(NEOPIXEL_LED)
  2062. #if !PIN_EXISTS(NEOPIXEL) || NEOPIXEL_PIXELS == 0
  2063. #error "NEOPIXEL_LED requires NEOPIXEL_PIN and NEOPIXEL_PIXELS."
  2064. #elif ENABLED(NEOPIXEL2_SEPARATE) && !(defined(NEOPIXEL2_TYPE) && PIN_EXISTS(NEOPIXEL2) && NEOPIXEL2_PIXELS > 0)
  2065. #error "NEOPIXEL2_SEPARATE requires NEOPIXEL2_TYPE, NEOPIXEL2_PIN and NEOPIXEL2_PIXELS."
  2066. #elif ENABLED(NEO2_COLOR_PRESETS) && DISABLED(NEOPIXEL2_SEPARATE)
  2067. #error "NEO2_COLOR_PRESETS requires NEOPIXEL2_SEPARATE to be enabled."
  2068. #endif
  2069. #endif
  2070. #if DISABLED(NO_COMPILE_TIME_PWM)
  2071. #define _TEST_PWM(P) PWM_PIN(P)
  2072. #else
  2073. #define _TEST_PWM(P) 1 // pass
  2074. #endif
  2075. /**
  2076. * Auto Fan check for PWM pins
  2077. */
  2078. #if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255
  2079. #define AF_ERR_SUFF "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255."
  2080. #if HAS_AUTO_FAN_0
  2081. static_assert(_TEST_PWM(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF);
  2082. #elif HAS_AUTO_FAN_1
  2083. static_assert(_TEST_PWM(E1_AUTO_FAN_PIN), "E1" AF_ERR_SUFF);
  2084. #elif HAS_AUTO_FAN_2
  2085. static_assert(_TEST_PWM(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF);
  2086. #elif HAS_AUTO_FAN_3
  2087. static_assert(_TEST_PWM(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF);
  2088. #elif HAS_AUTO_FAN_4
  2089. static_assert(_TEST_PWM(E4_AUTO_FAN_PIN), "E4" AF_ERR_SUFF);
  2090. #elif HAS_AUTO_FAN_5
  2091. static_assert(_TEST_PWM(E5_AUTO_FAN_PIN), "E5" AF_ERR_SUFF);
  2092. #elif HAS_AUTO_FAN_6
  2093. static_assert(_TEST_PWM(E6_AUTO_FAN_PIN), "E6" AF_ERR_SUFF);
  2094. #elif HAS_AUTO_FAN_7
  2095. static_assert(_TEST_PWM(E7_AUTO_FAN_PIN), "E7" AF_ERR_SUFF);
  2096. #endif
  2097. #endif
  2098. /**
  2099. * Make sure only one EEPROM type is enabled
  2100. */
  2101. #if ENABLED(EEPROM_SETTINGS)
  2102. #if 1 < 0 \
  2103. + ENABLED(I2C_EEPROM) \
  2104. + ENABLED(SPI_EEPROM) \
  2105. + ENABLED(QSPI_EEPROM) \
  2106. + ENABLED(SDCARD_EEPROM_EMULATION) \
  2107. + ENABLED(FLASH_EEPROM_EMULATION) \
  2108. + ENABLED(SRAM_EEPROM_EMULATION) \
  2109. + ENABLED(IIC_BL24CXX_EEPROM)
  2110. #error "Please select only one method of EEPROM Persistent Storage."
  2111. #endif
  2112. #endif
  2113. /**
  2114. * Make sure features that need to write to the SD card can
  2115. */
  2116. #if ENABLED(SDCARD_READONLY) && ANY(POWER_LOSS_RECOVERY, BINARY_FILE_TRANSFER, SDCARD_EEPROM_EMULATION)
  2117. #undef SDCARD_READONLY
  2118. #if ENABLED(POWER_LOSS_RECOVERY)
  2119. #warning "Either disable SDCARD_READONLY or disable POWER_LOSS_RECOVERY."
  2120. #elif ENABLED(BINARY_FILE_TRANSFER)
  2121. #warning "Either disable SDCARD_READONLY or disable BINARY_FILE_TRANSFER."
  2122. #elif ENABLED(SDCARD_EEPROM_EMULATION)
  2123. #warning "Either disable SDCARD_READONLY or disable SDCARD_EEPROM_EMULATION."
  2124. #endif
  2125. #endif
  2126. #if ENABLED(SD_IGNORE_AT_STARTUP)
  2127. #if ENABLED(POWER_LOSS_RECOVERY)
  2128. #error "SD_IGNORE_AT_STARTUP is incompatible with POWER_LOSS_RECOVERY."
  2129. #elif ENABLED(SDCARD_EEPROM_EMULATION)
  2130. #error "SD_IGNORE_AT_STARTUP is incompatible with SDCARD_EEPROM_EMULATION."
  2131. #endif
  2132. #endif
  2133. /**
  2134. * Make sure only one display is enabled
  2135. */
  2136. #if 1 < 0 \
  2137. + ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
  2138. + ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
  2139. + (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \
  2140. + (ENABLED(MINIPANEL) && NONE(MKS_MINI_12864, ENDER2_STOCKDISPLAY)) \
  2141. + (ENABLED(MKS_MINI_12864) && NONE(MKS_LCD12864A, MKS_LCD12864B)) \
  2142. + (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \
  2143. + (DISABLED(IS_LEGACY_TFT) && ENABLED(TFT_GENERIC)) \
  2144. + (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)) \
  2145. + COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35) \
  2146. + COUNT_ENABLED(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY,DGUS_LCD_UI_MKS) \
  2147. + COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY, DWIN_CREALITY_LCD) \
  2148. + COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) \
  2149. + COUNT_ENABLED(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) \
  2150. + COUNT_ENABLED(MKS_12864OLED, MKS_12864OLED_SSD1306) \
  2151. + 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) \
  2152. + COUNT_ENABLED(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) \
  2153. + COUNT_ENABLED(VIKI2, miniVIKI) \
  2154. + COUNT_ENABLED(ZONESTAR_12864LCD, ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306) \
  2155. + COUNT_ENABLED(ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING) \
  2156. + ENABLED(AZSMZ_12864) \
  2157. + ENABLED(BQ_LCD_SMART_CONTROLLER) \
  2158. + ENABLED(CARTESIO_UI) \
  2159. + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  2160. + ENABLED(FF_INTERFACEBOARD) \
  2161. + ENABLED(FYSETC_242_OLED_12864) \
  2162. + ENABLED(G3D_PANEL) \
  2163. + ENABLED(LCD_FOR_MELZI) \
  2164. + ENABLED(LCD_I2C_PANELOLU2) \
  2165. + ENABLED(LCD_I2C_VIKI) \
  2166. + ENABLED(LCM1602) \
  2167. + ENABLED(LONGER_LK_TFT28) \
  2168. + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
  2169. + ENABLED(MAKRPANEL) \
  2170. + ENABLED(MALYAN_LCD) \
  2171. + ENABLED(NEXTION_TFT) \
  2172. + ENABLED(MKS_LCD12864A) \
  2173. + ENABLED(MKS_LCD12864B) \
  2174. + ENABLED(OLED_PANEL_TINYBOY2) \
  2175. + ENABLED(OVERLORD_OLED) \
  2176. + ENABLED(PANEL_ONE) \
  2177. + ENABLED(RA_CONTROL_PANEL) \
  2178. + ENABLED(RADDS_DISPLAY) \
  2179. + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \
  2180. + ENABLED(RIGIDBOT_PANEL) \
  2181. + ENABLED(SAV_3DGLCD) \
  2182. + ENABLED(SAV_3DLCD) \
  2183. + ENABLED(SILVER_GATE_GLCD_CONTROLLER) \
  2184. + ENABLED(TFT_TRONXY_X5SA) \
  2185. + ENABLED(TOUCH_UI_FTDI_EVE) \
  2186. + ENABLED(U8GLIB_SH1106_EINSTART) \
  2187. + ENABLED(ULTI_CONTROLLER) \
  2188. + ENABLED(ULTIMAKERCONTROLLER) \
  2189. + ENABLED(ULTIPANEL) \
  2190. + ENABLED(ULTRA_LCD) \
  2191. + ENABLED(YHCB2004) \
  2192. + ENABLED(ZONESTAR_LCD) \
  2193. + ENABLED(K3D_FULL_GRAPHIC_SMART_CONTROLLER) \
  2194. + ENABLED(K3D_242_OLED_CONTROLLER)
  2195. #error "Please select only one LCD controller option."
  2196. #endif
  2197. #undef IS_U8GLIB_SSD1306
  2198. #undef IS_EXTUI
  2199. #undef IS_LEGACY_TFT
  2200. #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)
  2201. #if NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
  2202. #error "TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI is required for your TFT. Please enable one."
  2203. #elif 1 < ENABLED(TFT_COLOR_UI) + ENABLED(TFT_CLASSIC_UI) + ENABLED(TFT_LVGL_UI)
  2204. #error "Please select only one of TFT_COLOR_UI, TFT_CLASSIC_UI, or TFT_LVGL_UI."
  2205. #endif
  2206. #elif ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
  2207. #error "TFT_(COLOR|CLASSIC|LVGL)_UI requires a TFT display to be enabled."
  2208. #endif
  2209. #if ENABLED(TFT_GENERIC) && NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
  2210. #error "TFT_GENERIC requires either TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI interface."
  2211. #endif
  2212. #if BOTH(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
  2213. #error "Please enable only one of TFT_INTERFACE_SPI or TFT_INTERFACE_SPI."
  2214. #endif
  2215. #if MANY(LCD_SCREEN_ROT_0, LCD_SCREEN_ROT_90, LCD_SCREEN_ROT_180, LCD_SCREEN_ROT_270)
  2216. #error "Please enable only one LCD_SCREEN_ROT_* option: 0, 90, 180, or 270."
  2217. #endif
  2218. #if MANY(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320, TFT_RES_1024x600)
  2219. #error "Please select only one of TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320, or TFT_RES_1024x600."
  2220. #endif
  2221. #if HAS_TFT_LVGL_UI && DISABLED(TFT_RES_480x320)
  2222. #error "(FMSC|SPI)TFT_LVGL_UI requires TFT_RES_480x320."
  2223. #endif
  2224. #if defined(GRAPHICAL_TFT_UPSCALE) && !WITHIN(GRAPHICAL_TFT_UPSCALE, 2, 4)
  2225. #error "GRAPHICAL_TFT_UPSCALE must be 2, 3, or 4."
  2226. #endif
  2227. #if BOTH(CHIRON_TFT_STANDARD, CHIRON_TFT_NEW)
  2228. #error "Please select only one of CHIRON_TFT_STANDARD or CHIRON_TFT_NEW."
  2229. #endif
  2230. /**
  2231. * Some boards forbid the use of -1 Native USB
  2232. */
  2233. #if ENABLED(BOARD_NO_NATIVE_USB)
  2234. #undef BOARD_NO_NATIVE_USB
  2235. #if SERIAL_PORT == -1
  2236. #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."
  2237. #elif SERIAL_PORT_2 == -1
  2238. #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."
  2239. #elif MMU2_SERIAL_PORT == -1
  2240. #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."
  2241. #elif LCD_SERIAL_PORT == -1
  2242. #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."
  2243. #endif
  2244. #endif
  2245. /**
  2246. * MMU2 require a dedicated serial port
  2247. */
  2248. #ifdef MMU2_SERIAL_PORT
  2249. #if MMU2_SERIAL_PORT == SERIAL_PORT
  2250. #error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT."
  2251. #elif defined(SERIAL_PORT_2) && MMU2_SERIAL_PORT == SERIAL_PORT_2
  2252. #error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT_2."
  2253. #elif defined(LCD_SERIAL_PORT) && MMU2_SERIAL_PORT == LCD_SERIAL_PORT
  2254. #error "MMU2_SERIAL_PORT cannot be the same as LCD_SERIAL_PORT."
  2255. #endif
  2256. #endif
  2257. /**
  2258. * Serial displays require a dedicated serial port
  2259. */
  2260. #ifdef LCD_SERIAL_PORT
  2261. #if LCD_SERIAL_PORT == SERIAL_PORT
  2262. #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT."
  2263. #elif defined(SERIAL_PORT_2) && LCD_SERIAL_PORT == SERIAL_PORT_2
  2264. #error "LCD_SERIAL_PORT cannot be the same as SERIAL_PORT_2."
  2265. #endif
  2266. #else
  2267. #if HAS_DGUS_LCD
  2268. #error "The DGUS LCD requires LCD_SERIAL_PORT to be defined."
  2269. #elif EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
  2270. #error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined."
  2271. #elif ENABLED(MALYAN_LCD)
  2272. #error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined."
  2273. #endif
  2274. #endif
  2275. /**
  2276. * FYSETC Mini 12864 RGB backlighting required
  2277. */
  2278. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED)
  2279. #error "RGB_LED is required for FYSETC_MINI_12864 1.2 and 2.0."
  2280. #elif EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && DISABLED(LED_USER_PRESET_STARTUP)
  2281. #error "LED_USER_PRESET_STARTUP is required for FYSETC_MINI_12864 2.x displays."
  2282. #endif
  2283. /**
  2284. * Check existing CS pins against enabled TMC SPI drivers.
  2285. */
  2286. #define INVALID_TMC_SPI(ST) (AXIS_HAS_SPI(ST) && !PIN_EXISTS(ST##_CS))
  2287. #if INVALID_TMC_SPI(X)
  2288. #error "An SPI driven TMC driver on X requires X_CS_PIN."
  2289. #elif INVALID_TMC_SPI(X2)
  2290. #error "An SPI driven TMC driver on X2 requires X2_CS_PIN."
  2291. #elif INVALID_TMC_SPI(Y)
  2292. #error "An SPI driven TMC driver on Y requires Y_CS_PIN."
  2293. #elif INVALID_TMC_SPI(Y2)
  2294. #error "An SPI driven TMC driver on Y2 requires Y2_CS_PIN."
  2295. #elif INVALID_TMC_SPI(Z)
  2296. #error "An SPI driven TMC driver on Z requires Z_CS_PIN."
  2297. #elif INVALID_TMC_SPI(Z2)
  2298. #error "An SPI driven TMC driver on Z2 requires Z2_CS_PIN."
  2299. #elif INVALID_TMC_SPI(Z3)
  2300. #error "An SPI driven TMC driver on Z3 requires Z3_CS_PIN."
  2301. #elif INVALID_TMC_SPI(Z4)
  2302. #error "An SPI driven TMC driver on Z4 requires Z4_CS_PIN."
  2303. #elif INVALID_TMC_SPI(E0)
  2304. #error "An SPI driven TMC driver on E0 requires E0_CS_PIN."
  2305. #elif INVALID_TMC_SPI(E1)
  2306. #error "An SPI driven TMC driver on E1 requires E1_CS_PIN."
  2307. #elif INVALID_TMC_SPI(E2)
  2308. #error "An SPI driven TMC driver on E2 requires E2_CS_PIN."
  2309. #elif INVALID_TMC_SPI(E3)
  2310. #error "An SPI driven TMC driver on E3 requires E3_CS_PIN."
  2311. #elif INVALID_TMC_SPI(E4)
  2312. #error "An SPI driven TMC driver on E4 requires E4_CS_PIN."
  2313. #elif INVALID_TMC_SPI(E5)
  2314. #error "An SPI driven TMC driver on E5 requires E5_CS_PIN."
  2315. #elif INVALID_TMC_SPI(E6)
  2316. #error "An SPI driven TMC driver on E6 requires E6_CS_PIN."
  2317. #elif INVALID_TMC_SPI(E7)
  2318. #error "An SPI driven TMC driver on E7 requires E7_CS_PIN."
  2319. #endif
  2320. #undef INVALID_TMC_SPI
  2321. /**
  2322. * Check existing RX/TX pins against enable TMC UART drivers.
  2323. */
  2324. #define INVALID_TMC_UART(ST) (AXIS_HAS_UART(ST) && !(defined(ST##_HARDWARE_SERIAL) || (PINS_EXIST(ST##_SERIAL_RX, ST##_SERIAL_TX))))
  2325. #if INVALID_TMC_UART(X)
  2326. #error "TMC2208 or TMC2209 on X requires X_HARDWARE_SERIAL or X_SERIAL_(RX|TX)_PIN."
  2327. #elif INVALID_TMC_UART(X2)
  2328. #error "TMC2208 or TMC2209 on X2 requires X2_HARDWARE_SERIAL or X2_SERIAL_(RX|TX)_PIN."
  2329. #elif INVALID_TMC_UART(Y)
  2330. #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL_(RX|TX)_PIN."
  2331. #elif INVALID_TMC_UART(Y2)
  2332. #error "TMC2208 or TMC2209 on Y2 requires Y2_HARDWARE_SERIAL or Y2_SERIAL_(RX|TX)_PIN."
  2333. #elif INVALID_TMC_UART(Z)
  2334. #error "TMC2208 or TMC2209 on Z requires Z_HARDWARE_SERIAL or Z_SERIAL_(RX|TX)_PIN."
  2335. #elif INVALID_TMC_UART(Z2)
  2336. #error "TMC2208 or TMC2209 on Z2 requires Z2_HARDWARE_SERIAL or Z2_SERIAL_(RX|TX)_PIN."
  2337. #elif INVALID_TMC_UART(Z3)
  2338. #error "TMC2208 or TMC2209 on Z3 requires Z3_HARDWARE_SERIAL or Z3_SERIAL_(RX|TX)_PIN."
  2339. #elif INVALID_TMC_UART(Z4)
  2340. #error "TMC2208 or TMC2209 on Z4 requires Z4_HARDWARE_SERIAL or Z4_SERIAL_(RX|TX)_PIN."
  2341. #elif INVALID_TMC_UART(E0)
  2342. #error "TMC2208 or TMC2209 on E0 requires E0_HARDWARE_SERIAL or E0_SERIAL_(RX|TX)_PIN."
  2343. #elif INVALID_TMC_UART(E1)
  2344. #error "TMC2208 or TMC2209 on E1 requires E1_HARDWARE_SERIAL or E1_SERIAL_(RX|TX)_PIN."
  2345. #elif INVALID_TMC_UART(E2)
  2346. #error "TMC2208 or TMC2209 on E2 requires E2_HARDWARE_SERIAL or E2_SERIAL_(RX|TX)_PIN."
  2347. #elif INVALID_TMC_UART(E3)
  2348. #error "TMC2208 or TMC2209 on E3 requires E3_HARDWARE_SERIAL or E3_SERIAL_(RX|TX)_PIN."
  2349. #elif INVALID_TMC_UART(E4)
  2350. #error "TMC2208 or TMC2209 on E4 requires E4_HARDWARE_SERIAL or E4_SERIAL_(RX|TX)_PIN."
  2351. #elif INVALID_TMC_UART(E5)
  2352. #error "TMC2208 or TMC2209 on E5 requires E5_HARDWARE_SERIAL or E5_SERIAL_(RX|TX)_PIN."
  2353. #elif INVALID_TMC_UART(E6)
  2354. #error "TMC2208 or TMC2209 on E6 requires E6_HARDWARE_SERIAL or E6_SERIAL_(RX|TX)_PIN."
  2355. #elif INVALID_TMC_UART(E7)
  2356. #error "TMC2208 or TMC2209 on E7 requires E7_HARDWARE_SERIAL or E7_SERIAL_(RX|TX)_PIN."
  2357. #endif
  2358. #undef INVALID_TMC_UART
  2359. /**
  2360. * TMC2209 slave address values
  2361. */
  2362. #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")
  2363. #if AXIS_DRIVER_TYPE_X(TMC2209)
  2364. INVALID_TMC_ADDRESS(X);
  2365. #elif AXIS_DRIVER_TYPE_X2(TMC2209)
  2366. INVALID_TMC_ADDRESS(X2);
  2367. #elif AXIS_DRIVER_TYPE_Y(TMC2209)
  2368. INVALID_TMC_ADDRESS(Y);
  2369. #elif AXIS_DRIVER_TYPE_Y2(TMC2209)
  2370. INVALID_TMC_ADDRESS(Y2);
  2371. #elif AXIS_DRIVER_TYPE_Z(TMC2209)
  2372. INVALID_TMC_ADDRESS(Z);
  2373. #elif AXIS_DRIVER_TYPE_Z2(TMC2209)
  2374. INVALID_TMC_ADDRESS(Z2);
  2375. #elif AXIS_DRIVER_TYPE_Z3(TMC2209)
  2376. INVALID_TMC_ADDRESS(Z3);
  2377. #elif AXIS_DRIVER_TYPE_Z4(TMC2209)
  2378. INVALID_TMC_ADDRESS(Z4);
  2379. #elif AXIS_DRIVER_TYPE_E0(TMC2209)
  2380. INVALID_TMC_ADDRESS(E0);
  2381. #elif AXIS_DRIVER_TYPE_E1(TMC2209)
  2382. INVALID_TMC_ADDRESS(E1);
  2383. #elif AXIS_DRIVER_TYPE_E2(TMC2209)
  2384. INVALID_TMC_ADDRESS(E2);
  2385. #elif AXIS_DRIVER_TYPE_E3(TMC2209)
  2386. INVALID_TMC_ADDRESS(E3);
  2387. #elif AXIS_DRIVER_TYPE_E4(TMC2209)
  2388. INVALID_TMC_ADDRESS(E4);
  2389. #elif AXIS_DRIVER_TYPE_E5(TMC2209)
  2390. INVALID_TMC_ADDRESS(E5);
  2391. #elif AXIS_DRIVER_TYPE_E6(TMC2209)
  2392. INVALID_TMC_ADDRESS(E6);
  2393. #elif AXIS_DRIVER_TYPE_E7(TMC2209)
  2394. INVALID_TMC_ADDRESS(E7);
  2395. #endif
  2396. #undef INVALID_TMC_ADDRESS
  2397. #define _TMC_MICROSTEP_IS_VALID(MS) (MS == 0 || MS == 2 || MS == 4 || MS == 8 || MS == 16 || MS == 32 || MS == 64 || MS == 128 || MS == 256)
  2398. #define TMC_MICROSTEP_IS_VALID(M) (!AXIS_IS_TMC(M) || _TMC_MICROSTEP_IS_VALID(M##_MICROSTEPS))
  2399. #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.")
  2400. #if !TMC_MICROSTEP_IS_VALID(X)
  2401. INVALID_TMC_MS(X);
  2402. #elif !TMC_MICROSTEP_IS_VALID(Y)
  2403. INVALID_TMC_MS(Y)
  2404. #elif !TMC_MICROSTEP_IS_VALID(Z)
  2405. INVALID_TMC_MS(Z)
  2406. #elif !TMC_MICROSTEP_IS_VALID(X2)
  2407. INVALID_TMC_MS(X2);
  2408. #elif !TMC_MICROSTEP_IS_VALID(Y2)
  2409. INVALID_TMC_MS(Y2)
  2410. #elif !TMC_MICROSTEP_IS_VALID(Z2)
  2411. INVALID_TMC_MS(Z2)
  2412. #elif !TMC_MICROSTEP_IS_VALID(Z3)
  2413. INVALID_TMC_MS(Z3)
  2414. #elif !TMC_MICROSTEP_IS_VALID(Z4)
  2415. INVALID_TMC_MS(Z4)
  2416. #elif !TMC_MICROSTEP_IS_VALID(E0)
  2417. INVALID_TMC_MS(E0)
  2418. #elif !TMC_MICROSTEP_IS_VALID(E1)
  2419. INVALID_TMC_MS(E1)
  2420. #elif !TMC_MICROSTEP_IS_VALID(E2)
  2421. INVALID_TMC_MS(E2)
  2422. #elif !TMC_MICROSTEP_IS_VALID(E3)
  2423. INVALID_TMC_MS(E3)
  2424. #elif !TMC_MICROSTEP_IS_VALID(E4)
  2425. INVALID_TMC_MS(E4)
  2426. #elif !TMC_MICROSTEP_IS_VALID(E5)
  2427. INVALID_TMC_MS(E5)
  2428. #elif !TMC_MICROSTEP_IS_VALID(E6)
  2429. INVALID_TMC_MS(E6)
  2430. #elif !TMC_MICROSTEP_IS_VALID(E7)
  2431. INVALID_TMC_MS(E7)
  2432. #endif
  2433. #undef INVALID_TMC_MS
  2434. #undef TMC_MICROSTEP_IS_VALID
  2435. #undef _TMC_MICROSTEP_IS_VALID
  2436. #if ENABLED(DELTA) && (ENABLED(STEALTHCHOP_XY) != ENABLED(STEALTHCHOP_Z))
  2437. #error "STEALTHCHOP_XY and STEALTHCHOP_Z must be the same on DELTA."
  2438. #endif
  2439. #if ENABLED(SENSORLESS_HOMING)
  2440. // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop
  2441. // is necessary in order to reset the stallGuard indication between the initial movement of all three
  2442. // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of
  2443. // clearing the stallGuard activated status is found.
  2444. // Stall detection DIAG = HIGH : TMC2209
  2445. // Stall detection DIAG = LOW : TMC2130/TMC2160/TMC2660/TMC5130/TMC5160
  2446. #define X_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(X,TMC2209)
  2447. #define Y_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Y,TMC2209)
  2448. #define Z_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Z,TMC2209)
  2449. #if NONE(SPI_ENDSTOPS, ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS)
  2450. #if X_SENSORLESS && X_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_XMIN)
  2451. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMIN (or ENDSTOPPULLUPS) when homing to X_MIN."
  2452. #elif X_SENSORLESS && X_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_XMAX)
  2453. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMAX (or ENDSTOPPULLUPS) when homing to X_MAX."
  2454. #elif Y_SENSORLESS && Y_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_YMIN)
  2455. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMIN (or ENDSTOPPULLUPS) when homing to Y_MIN."
  2456. #elif Y_SENSORLESS && Y_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_YMAX)
  2457. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMAX (or ENDSTOPPULLUPS) when homing to Y_MAX."
  2458. #elif Z_SENSORLESS && Z_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_ZMIN)
  2459. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN."
  2460. #elif Z_SENSORLESS && Z_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_ZMAX)
  2461. #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX."
  2462. #endif
  2463. #endif
  2464. #if ENABLED(SPI_ENDSTOPS)
  2465. #if ENABLED(QUICK_HOME)
  2466. #warning "SPI_ENDSTOPS may be unreliable with QUICK_HOME. Adjust back-offs for better results."
  2467. #endif
  2468. #else
  2469. #if X_SENSORLESS && X_HOME_TO_MIN && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
  2470. #if X_ENDSTOP_INVERTING
  2471. #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = true when homing to X_MIN."
  2472. #else
  2473. #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to X_MIN."
  2474. #endif
  2475. #elif X_SENSORLESS && X_HOME_TO_MAX && X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
  2476. #if X_ENDSTOP_INVERTING
  2477. #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = true when homing to X_MAX."
  2478. #else
  2479. #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to X_MAX."
  2480. #endif
  2481. #elif Y_SENSORLESS && Y_HOME_TO_MIN && Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
  2482. #if Y_ENDSTOP_INVERTING
  2483. #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = true when homing to Y_MIN."
  2484. #else
  2485. #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MIN."
  2486. #endif
  2487. #elif Y_SENSORLESS && Y_HOME_TO_MAX && Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING
  2488. #if Y_ENDSTOP_INVERTING
  2489. #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = true when homing to Y_MAX."
  2490. #else
  2491. #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MAX."
  2492. #endif
  2493. #elif Z_SENSORLESS && Z_HOME_TO_MIN && Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
  2494. #if Z_ENDSTOP_INVERTING
  2495. #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = true when homing to Z_MIN."
  2496. #else
  2497. #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MIN."
  2498. #endif
  2499. #elif Z_SENSORLESS && Z_HOME_TO_MAX && Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING
  2500. #if Z_ENDSTOP_INVERTING
  2501. #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = true when homing to Z_MAX."
  2502. #else
  2503. #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MAX."
  2504. #endif
  2505. #endif
  2506. #endif
  2507. #if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z)
  2508. #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z."
  2509. #elif ENDSTOP_NOISE_THRESHOLD
  2510. #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD."
  2511. #elif !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS)
  2512. #error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, or Z axes."
  2513. #endif
  2514. #undef X_ENDSTOP_INVERTING
  2515. #undef Y_ENDSTOP_INVERTING
  2516. #undef Z_ENDSTOP_INVERTING
  2517. #endif
  2518. // Sensorless probing requirements
  2519. #if ENABLED(SENSORLESS_PROBING)
  2520. #if ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS)
  2521. #error "SENSORLESS_PROBING for DELTA requires TMC stepper drivers with StallGuard on X, Y, and Z axes."
  2522. #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  2523. #error "SENSORLESS_PROBING cannot be used with Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN."
  2524. #elif ENABLED(USE_PROBE_FOR_Z_HOMING)
  2525. #error "SENSORLESS_PROBING cannot be used with USE_PROBE_FOR_Z_HOMING."
  2526. #elif !Z_SENSORLESS
  2527. #error "SENSORLESS_PROBING requires a TMC stepper driver with StallGuard on Z."
  2528. #endif
  2529. #endif
  2530. // Sensorless homing is required for both combined steppers in an H-bot
  2531. #if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS
  2532. #error "CoreXY requires both X and Y to use sensorless homing if either one does."
  2533. #elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS && !HOMING_Z_WITH_PROBE
  2534. #error "CoreXZ requires both X and Z to use sensorless homing if either one does."
  2535. #elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS && !HOMING_Z_WITH_PROBE
  2536. #error "CoreYZ requires both Y and Z to use sensorless homing if either one does."
  2537. #elif ENABLED(MARKFORGED_XY) && X_SENSORLESS != Y_SENSORLESS
  2538. #error "MARKFORGED_XY requires both X and Y to use sensorless homing if either one does."
  2539. #endif
  2540. // Other TMC feature requirements
  2541. #if ENABLED(HYBRID_THRESHOLD) && !STEALTHCHOP_ENABLED
  2542. #error "Enable STEALTHCHOP_(XY|Z|E) to use HYBRID_THRESHOLD."
  2543. #elif ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD
  2544. #error "SENSORLESS_HOMING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
  2545. #elif ENABLED(SENSORLESS_PROBING) && !HAS_STALLGUARD
  2546. #error "SENSORLESS_PROBING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
  2547. #elif STEALTHCHOP_ENABLED && !HAS_STEALTHCHOP
  2548. #error "STEALTHCHOP requires TMC2130, TMC2160, TMC2208, TMC2209, or TMC5160 stepper drivers."
  2549. #endif
  2550. /**
  2551. * TMC SPI Chaining
  2552. */
  2553. #define IN_CHAIN(A) ((A##_CHAIN_POS > 0) && !HAS_L64XX)
  2554. #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) \
  2555. || IN_CHAIN(E0) || IN_CHAIN(E1) || IN_CHAIN(E2) || IN_CHAIN(E3) || IN_CHAIN(E4) || IN_CHAIN(E5) || IN_CHAIN(E6) || IN_CHAIN(E7)
  2556. #define BAD_CHAIN(A) (IN_CHAIN(A) && !PIN_EXISTS(A##_CS))
  2557. #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) \
  2558. || BAD_CHAIN(E0) || BAD_CHAIN(E1) || BAD_CHAIN(E2) || BAD_CHAIN(E3) || BAD_CHAIN(E4) || BAD_CHAIN(E5) || BAD_CHAIN(E6) || BAD_CHAIN(E7)
  2559. #error "All chained TMC drivers need a CS pin."
  2560. #else
  2561. #if IN_CHAIN(X)
  2562. #define CS_COMPARE X_CS_PIN
  2563. #elif IN_CHAIN(Y)
  2564. #define CS_COMPARE Y_CS_PIN
  2565. #elif IN_CHAIN(Z)
  2566. #define CS_COMPARE Z_CS_PIN
  2567. #elif IN_CHAIN(X2)
  2568. #define CS_COMPARE X2_CS_PIN
  2569. #elif IN_CHAIN(Y2)
  2570. #define CS_COMPARE Y2_CS_PIN
  2571. #elif IN_CHAIN(Z2)
  2572. #define CS_COMPARE Z2_CS_PIN
  2573. #elif IN_CHAIN(Z3)
  2574. #define CS_COMPARE Z3_CS_PIN
  2575. #elif IN_CHAIN(E0)
  2576. #define CS_COMPARE E0_CS_PIN
  2577. #elif IN_CHAIN(E1)
  2578. #define CS_COMPARE E1_CS_PIN
  2579. #elif IN_CHAIN(E2)
  2580. #define CS_COMPARE E2_CS_PIN
  2581. #elif IN_CHAIN(E3)
  2582. #define CS_COMPARE E3_CS_PIN
  2583. #elif IN_CHAIN(E4)
  2584. #define CS_COMPARE E4_CS_PIN
  2585. #elif IN_CHAIN(E5)
  2586. #define CS_COMPARE E5_CS_PIN
  2587. #elif IN_CHAIN(E6)
  2588. #define CS_COMPARE E6_CS_PIN
  2589. #elif IN_CHAIN(E7)
  2590. #define CS_COMPARE E7_CS_PIN
  2591. #endif
  2592. #define BAD_CS_PIN(A) (IN_CHAIN(A) && A##_CS_PIN != CS_COMPARE)
  2593. #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) \
  2594. || 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)
  2595. #error "All chained TMC drivers must use the same CS pin."
  2596. #endif
  2597. #undef BAD_CS_PIN
  2598. #undef CS_COMPARE
  2599. #endif
  2600. #undef BAD_CHAIN
  2601. #endif
  2602. #undef IN_CHAIN
  2603. /**
  2604. * Digipot requirement
  2605. */
  2606. #if HAS_MOTOR_CURRENT_I2C
  2607. #if BOTH(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
  2608. #error "Enable only one of DIGIPOT_MCP4018 or DIGIPOT_MCP4451."
  2609. #elif !MB(MKS_SBASE, AZTEEG_X5_GT, AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI) \
  2610. && (!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))
  2611. #error "DIGIPOT_MCP4018/4451 requires DIGIPOTS_I2C_SDA_* pins to be defined."
  2612. #endif
  2613. #endif
  2614. /**
  2615. * Check per-axis initializers for errors
  2616. */
  2617. constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT,
  2618. sanity_arr_2[] = DEFAULT_MAX_FEEDRATE,
  2619. sanity_arr_3[] = DEFAULT_MAX_ACCELERATION;
  2620. #define _ARR_TEST(N,I) (sanity_arr_##N[_MIN(I,int(COUNT(sanity_arr_##N))-1)] > 0)
  2621. #if HAS_MULTI_EXTRUDER
  2622. #define _EXTRA_NOTE " (Did you forget to enable DISTINCT_E_FACTORS?)"
  2623. #elif EXTRUDERS == 0
  2624. #define _EXTRA_NOTE " (Note: EXTRUDERS is set to 0.)"
  2625. #else
  2626. #define _EXTRA_NOTE ""
  2627. #endif
  2628. static_assert(COUNT(sanity_arr_1) >= LOGICAL_AXES, "DEFAULT_AXIS_STEPS_PER_UNIT requires X, Y, Z and E elements.");
  2629. static_assert(COUNT(sanity_arr_1) <= DISTINCT_AXES, "DEFAULT_AXIS_STEPS_PER_UNIT has too many elements." _EXTRA_NOTE);
  2630. static_assert( _ARR_TEST(1,0) && _ARR_TEST(1,1) && _ARR_TEST(1,2)
  2631. && _ARR_TEST(1,3) && _ARR_TEST(1,4) && _ARR_TEST(1,5)
  2632. && _ARR_TEST(1,6) && _ARR_TEST(1,7) && _ARR_TEST(1,8),
  2633. "DEFAULT_AXIS_STEPS_PER_UNIT values must be positive.");
  2634. static_assert(COUNT(sanity_arr_2) >= LOGICAL_AXES, "DEFAULT_MAX_FEEDRATE requires X, Y, Z and E elements.");
  2635. static_assert(COUNT(sanity_arr_2) <= DISTINCT_AXES, "DEFAULT_MAX_FEEDRATE has too many elements." _EXTRA_NOTE);
  2636. static_assert( _ARR_TEST(2,0) && _ARR_TEST(2,1) && _ARR_TEST(2,2)
  2637. && _ARR_TEST(2,3) && _ARR_TEST(2,4) && _ARR_TEST(2,5)
  2638. && _ARR_TEST(2,6) && _ARR_TEST(2,7) && _ARR_TEST(2,8),
  2639. "DEFAULT_MAX_FEEDRATE values must be positive.");
  2640. static_assert(COUNT(sanity_arr_3) >= LOGICAL_AXES, "DEFAULT_MAX_ACCELERATION requires X, Y, Z and E elements.");
  2641. static_assert(COUNT(sanity_arr_3) <= DISTINCT_AXES, "DEFAULT_MAX_ACCELERATION has too many elements." _EXTRA_NOTE);
  2642. static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
  2643. && _ARR_TEST(3,3) && _ARR_TEST(3,4) && _ARR_TEST(3,5)
  2644. && _ARR_TEST(3,6) && _ARR_TEST(3,7) && _ARR_TEST(3,8),
  2645. "DEFAULT_MAX_ACCELERATION values must be positive.");
  2646. #if ENABLED(LIMITED_MAX_ACCEL_EDITING)
  2647. #ifdef MAX_ACCEL_EDIT_VALUES
  2648. constexpr float sanity_arr_4[] = MAX_ACCEL_EDIT_VALUES;
  2649. static_assert(COUNT(sanity_arr_4) >= LOGICAL_AXES, "MAX_ACCEL_EDIT_VALUES requires X, Y, Z and E elements.");
  2650. static_assert(COUNT(sanity_arr_4) <= LOGICAL_AXES, "MAX_ACCEL_EDIT_VALUES has too many elements. X, Y, Z and E elements only.");
  2651. static_assert( _ARR_TEST(4,0) && _ARR_TEST(4,1) && _ARR_TEST(4,2)
  2652. && _ARR_TEST(4,3) && _ARR_TEST(4,4) && _ARR_TEST(4,5)
  2653. && _ARR_TEST(4,6) && _ARR_TEST(4,7) && _ARR_TEST(4,8),
  2654. "MAX_ACCEL_EDIT_VALUES values must be positive.");
  2655. #endif
  2656. #endif
  2657. #if ENABLED(LIMITED_MAX_FR_EDITING)
  2658. #ifdef MAX_FEEDRATE_EDIT_VALUES
  2659. constexpr float sanity_arr_5[] = MAX_FEEDRATE_EDIT_VALUES;
  2660. static_assert(COUNT(sanity_arr_5) >= LOGICAL_AXES, "MAX_FEEDRATE_EDIT_VALUES requires X, Y, Z and E elements.");
  2661. static_assert(COUNT(sanity_arr_5) <= LOGICAL_AXES, "MAX_FEEDRATE_EDIT_VALUES has too many elements. X, Y, Z and E elements only.");
  2662. static_assert( _ARR_TEST(5,0) && _ARR_TEST(5,1) && _ARR_TEST(5,2)
  2663. && _ARR_TEST(5,3) && _ARR_TEST(5,4) && _ARR_TEST(5,5)
  2664. && _ARR_TEST(5,6) && _ARR_TEST(5,7) && _ARR_TEST(5,8),
  2665. "MAX_FEEDRATE_EDIT_VALUES values must be positive.");
  2666. #endif
  2667. #endif
  2668. #if ENABLED(LIMITED_JERK_EDITING)
  2669. #ifdef MAX_JERK_EDIT_VALUES
  2670. constexpr float sanity_arr_6[] = MAX_JERK_EDIT_VALUES;
  2671. static_assert(COUNT(sanity_arr_6) >= LOGICAL_AXES, "MAX_JERK_EDIT_VALUES requires X, Y, Z and E elements.");
  2672. static_assert(COUNT(sanity_arr_6) <= LOGICAL_AXES, "MAX_JERK_EDIT_VALUES has too many elements. X, Y, Z and E elements only.");
  2673. static_assert( _ARR_TEST(6,0) && _ARR_TEST(6,1) && _ARR_TEST(6,2)
  2674. && _ARR_TEST(6,3) && _ARR_TEST(6,4) && _ARR_TEST(6,5)
  2675. && _ARR_TEST(6,6) && _ARR_TEST(6,7) && _ARR_TEST(6,8),
  2676. "MAX_JERK_EDIT_VALUES values must be positive.");
  2677. #endif
  2678. #endif
  2679. #undef _ARR_TEST
  2680. #undef _EXTRA_NOTE
  2681. #if BOTH(CNC_COORDINATE_SYSTEMS, NO_WORKSPACE_OFFSETS)
  2682. #error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS."
  2683. #endif
  2684. #if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE)
  2685. #error "BLOCK_BUFFER_SIZE must be a power of 2."
  2686. #elif BLOCK_BUFFER_SIZE > 64
  2687. #error "A very large BLOCK_BUFFER_SIZE is not needed and takes longer to drain the buffer on pause / cancel."
  2688. #endif
  2689. #if ENABLED(LED_CONTROL_MENU) && !IS_ULTIPANEL
  2690. #error "LED_CONTROL_MENU requires an LCD controller."
  2691. #endif
  2692. #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED)
  2693. #error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED."
  2694. #endif
  2695. #if ENABLED(SKEW_CORRECTION)
  2696. #if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD))
  2697. #error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD."
  2698. #endif
  2699. #if ENABLED(SKEW_CORRECTION_FOR_Z)
  2700. #if !defined(XZ_SKEW_FACTOR) && !(defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD))
  2701. #error "SKEW_CORRECTION requires XZ_SKEW_FACTOR or XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD."
  2702. #endif
  2703. #if !defined(YZ_SKEW_FACTOR) && !(defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD))
  2704. #error "SKEW_CORRECTION requires YZ_SKEW_FACTOR or YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD."
  2705. #endif
  2706. #endif
  2707. #endif
  2708. #if ENABLED(POWER_LOSS_RECOVERY)
  2709. #if ENABLED(BACKUP_POWER_SUPPLY) && !PIN_EXISTS(POWER_LOSS)
  2710. #error "BACKUP_POWER_SUPPLY requires a POWER_LOSS_PIN."
  2711. #elif BOTH(POWER_LOSS_RECOVER_ZHOME, Z_SAFE_HOMING)
  2712. #error "POWER_LOSS_RECOVER_ZHOME cannot be used with Z_SAFE_HOMING."
  2713. #elif BOTH(POWER_LOSS_PULLUP, POWER_LOSS_PULLDOWN)
  2714. #error "You can't enable POWER_LOSS_PULLUP and POWER_LOSS_PULLDOWN at the same time."
  2715. #elif ENABLED(POWER_LOSS_RECOVER_ZHOME) && Z_HOME_TO_MAX
  2716. #error "POWER_LOSS_RECOVER_ZHOME is not needed on a machine that homes to ZMAX."
  2717. #elif BOTH(IS_CARTESIAN, POWER_LOSS_RECOVER_ZHOME) && Z_HOME_TO_MIN && !defined(POWER_LOSS_ZHOME_POS)
  2718. #error "POWER_LOSS_RECOVER_ZHOME requires POWER_LOSS_ZHOME_POS for a Cartesian that homes to ZMIN."
  2719. #endif
  2720. #endif
  2721. #if ENABLED(Z_STEPPER_AUTO_ALIGN)
  2722. #if NUM_Z_STEPPER_DRIVERS <= 1
  2723. #error "Z_STEPPER_AUTO_ALIGN requires NUM_Z_STEPPER_DRIVERS greater than 1."
  2724. #elif !HAS_BED_PROBE
  2725. #error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe."
  2726. #elif ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
  2727. static_assert(WITHIN(Z_STEPPER_ALIGN_AMP, 0.5, 2.0), "Z_STEPPER_ALIGN_AMP must be between 0.5 and 2.0.");
  2728. #if NUM_Z_STEPPER_DRIVERS < 3
  2729. #error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS requires NUM_Z_STEPPER_DRIVERS to be 3 or 4."
  2730. #endif
  2731. #endif
  2732. #endif
  2733. #if ENABLED(MECHANICAL_GANTRY_CALIBRATION)
  2734. #if NONE(HAS_MOTOR_CURRENT_DAC, HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC, HAS_TRINAMIC_CONFIG, HAS_MOTOR_CURRENT_PWM)
  2735. #error "It is highly recommended to have adjustable current drivers to prevent damage. Disable this line to continue anyway."
  2736. #elif !defined(GANTRY_CALIBRATION_CURRENT)
  2737. #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_CURRENT to be set."
  2738. #elif !defined(GANTRY_CALIBRATION_EXTRA_HEIGHT)
  2739. #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_EXTRA_HEIGHT to be set."
  2740. #elif !defined(GANTRY_CALIBRATION_FEEDRATE)
  2741. #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_FEEDRATE to be set."
  2742. #endif
  2743. #if defined(GANTRY_CALIBRATION_SAFE_POSITION) && !defined(GANTRY_CALIBRATION_XY_PARK_FEEDRATE)
  2744. #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
  2745. #endif
  2746. #endif
  2747. #if BOTH(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION)
  2748. #error "You cannot use Z_STEPPER_AUTO_ALIGN and MECHANICAL_GANTRY_CALIBRATION at the same time."
  2749. #endif
  2750. #if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS)
  2751. #error "PRINTCOUNTER requires EEPROM_SETTINGS."
  2752. #endif
  2753. #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PINS_EXIST(USB_CS, USB_INTR) && DISABLED(USE_OTG_USB_HOST)
  2754. #error "USB_CS_PIN and USB_INTR_PIN are required for USB_FLASH_DRIVE_SUPPORT."
  2755. #endif
  2756. #if ENABLED(USE_OTG_USB_HOST) && !defined(HAS_OTG_USB_HOST_SUPPORT)
  2757. #error "The current board does not support USE_OTG_USB_HOST."
  2758. #endif
  2759. #if ENABLED(SD_FIRMWARE_UPDATE) && !defined(__AVR_ATmega2560__)
  2760. #error "SD_FIRMWARE_UPDATE requires an ATmega2560-based (Arduino Mega) board."
  2761. #endif
  2762. #if ENABLED(GCODE_MACROS) && !WITHIN(GCODE_MACROS_SLOTS, 1, 10)
  2763. #error "GCODE_MACROS_SLOTS must be a number from 1 to 10."
  2764. #endif
  2765. #if ENABLED(BACKLASH_COMPENSATION)
  2766. #ifndef BACKLASH_DISTANCE_MM
  2767. #error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM."
  2768. #elif !defined(BACKLASH_CORRECTION)
  2769. #error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION."
  2770. #elif ENABLED(MARKFORGED_XY)
  2771. constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
  2772. static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
  2773. "BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " on a MarkForged system.");
  2774. #elif IS_CORE
  2775. constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
  2776. #ifndef CORE_BACKLASH
  2777. static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
  2778. "BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " with your CORE system.");
  2779. #endif
  2780. #endif
  2781. #endif
  2782. #if ENABLED(GRADIENT_MIX) && MIXING_VIRTUAL_TOOLS < 2
  2783. #error "GRADIENT_MIX requires 2 or more MIXING_VIRTUAL_TOOLS."
  2784. #endif
  2785. /**
  2786. * Photo G-code requirements
  2787. */
  2788. #if ENABLED(PHOTO_GCODE)
  2789. #if (PIN_EXISTS(CHDK) + PIN_EXISTS(PHOTOGRAPH) + defined(PHOTO_SWITCH_POSITION)) > 1
  2790. #error "Please define only one of CHDK_PIN, PHOTOGRAPH_PIN, or PHOTO_SWITCH_POSITION."
  2791. #elif defined(PHOTO_SWITCH_POSITION) && !defined(PHOTO_POSITION)
  2792. #error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION."
  2793. #elif PIN_EXISTS(CHDK) && defined(CHDK_DELAY)
  2794. #error "CHDK_DELAY has been replaced by PHOTO_SWITCH_MS."
  2795. #elif PIN_EXISTS(CHDK) && !defined(PHOTO_SWITCH_MS)
  2796. #error "PHOTO_SWITCH_MS is required with CHDK_PIN."
  2797. #elif defined(PHOTO_RETRACT_MM)
  2798. static_assert(PHOTO_RETRACT_MM + 0 >= 0, "PHOTO_RETRACT_MM must be >= 0.");
  2799. #endif
  2800. #endif
  2801. /**
  2802. * Advanced PRINTCOUNTER settings
  2803. */
  2804. #if ENABLED(PRINTCOUNTER)
  2805. #if defined(SERVICE_INTERVAL_1) != defined(SERVICE_NAME_1)
  2806. #error "Both SERVICE_NAME_1 and SERVICE_INTERVAL_1 are required."
  2807. #elif defined(SERVICE_INTERVAL_2) != defined(SERVICE_NAME_2)
  2808. #error "Both SERVICE_NAME_2 and SERVICE_INTERVAL_2 are required."
  2809. #elif defined(SERVICE_INTERVAL_3) != defined(SERVICE_NAME_3)
  2810. #error "Both SERVICE_NAME_3 and SERVICE_INTERVAL_3 are required."
  2811. #endif
  2812. #endif
  2813. /**
  2814. * Require soft endstops for certain setups
  2815. */
  2816. #if !BOTH(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
  2817. #if ENABLED(DUAL_X_CARRIAGE)
  2818. #error "DUAL_X_CARRIAGE requires both MIN_ and MAX_SOFTWARE_ENDSTOPS."
  2819. #elif HAS_HOTEND_OFFSET
  2820. #error "MIN_ and MAX_SOFTWARE_ENDSTOPS are both required with offset hotends."
  2821. #endif
  2822. #endif
  2823. /**
  2824. * Ensure this option is set intentionally
  2825. */
  2826. #if ENABLED(PSU_CONTROL)
  2827. #ifndef PSU_ACTIVE_STATE
  2828. #error "PSU_CONTROL requires PSU_ACTIVE_STATE to be defined as 'HIGH' or 'LOW'."
  2829. #elif !PIN_EXISTS(PS_ON)
  2830. #error "PSU_CONTROL requires PS_ON_PIN."
  2831. #elif POWER_OFF_DELAY < 0
  2832. #error "POWER_OFF_DELAY must be a positive value."
  2833. #endif
  2834. #endif
  2835. #if HAS_CUTTER
  2836. #ifndef CUTTER_POWER_UNIT
  2837. #error "CUTTER_POWER_UNIT is required with a spindle or laser."
  2838. #elif !CUTTER_UNIT_IS(PWM255) && !CUTTER_UNIT_IS(PERCENT) && !CUTTER_UNIT_IS(RPM) && !CUTTER_UNIT_IS(SERVO)
  2839. #error "CUTTER_POWER_UNIT must be PWM255, PERCENT, RPM, or SERVO."
  2840. #endif
  2841. #if ENABLED(LASER_POWER_INLINE)
  2842. #if ENABLED(SPINDLE_CHANGE_DIR)
  2843. #error "SPINDLE_CHANGE_DIR and LASER_POWER_INLINE are incompatible."
  2844. #elif ENABLED(LASER_MOVE_G0_OFF) && DISABLED(LASER_MOVE_POWER)
  2845. #error "LASER_MOVE_G0_OFF requires LASER_MOVE_POWER."
  2846. #endif
  2847. #if ENABLED(LASER_POWER_INLINE_TRAPEZOID)
  2848. #if DISABLED(SPINDLE_LASER_PWM)
  2849. #error "LASER_POWER_INLINE_TRAPEZOID requires SPINDLE_LASER_PWM to function."
  2850. #elif ENABLED(S_CURVE_ACCELERATION)
  2851. //#ifndef LASER_POWER_INLINE_S_CURVE_ACCELERATION_WARN
  2852. // #define LASER_POWER_INLINE_S_CURVE_ACCELERATION_WARN
  2853. // #warning "Combining LASER_POWER_INLINE_TRAPEZOID with S_CURVE_ACCELERATION may result in unintended behavior."
  2854. //#endif
  2855. #endif
  2856. #endif
  2857. #if ENABLED(LASER_POWER_INLINE_INVERT)
  2858. //#ifndef LASER_POWER_INLINE_INVERT_WARN
  2859. // #define LASER_POWER_INLINE_INVERT_WARN
  2860. // #warning "Enabling LASER_POWER_INLINE_INVERT means that `M5` won't kill the laser immediately; use `M5 I` instead."
  2861. //#endif
  2862. #endif
  2863. #else
  2864. #if SPINDLE_LASER_POWERUP_DELAY < 1
  2865. #error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0."
  2866. #elif SPINDLE_LASER_POWERDOWN_DELAY < 1
  2867. #error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0."
  2868. #elif ENABLED(LASER_MOVE_POWER)
  2869. #error "LASER_MOVE_POWER requires LASER_POWER_INLINE."
  2870. #elif ANY(LASER_POWER_INLINE_TRAPEZOID, LASER_POWER_INLINE_INVERT, LASER_MOVE_G0_OFF, LASER_MOVE_POWER)
  2871. #error "Enabled an inline laser feature without inline laser power being enabled."
  2872. #endif
  2873. #endif
  2874. #define _PIN_CONFLICT(P) (PIN_EXISTS(P) && P##_PIN == SPINDLE_LASER_PWM_PIN)
  2875. #if BOTH(SPINDLE_FEATURE, LASER_FEATURE)
  2876. #error "Enable only one of SPINDLE_FEATURE or LASER_FEATURE."
  2877. #elif !PIN_EXISTS(SPINDLE_LASER_ENA) && DISABLED(SPINDLE_SERVO)
  2878. #error "(SPINDLE|LASER)_FEATURE requires SPINDLE_LASER_ENA_PIN or SPINDLE_SERVO to control the power."
  2879. #elif ENABLED(SPINDLE_CHANGE_DIR) && !PIN_EXISTS(SPINDLE_DIR)
  2880. #error "SPINDLE_DIR_PIN is required for SPINDLE_CHANGE_DIR."
  2881. #elif ENABLED(SPINDLE_LASER_PWM)
  2882. #if !defined(SPINDLE_LASER_PWM_PIN) || SPINDLE_LASER_PWM_PIN < 0
  2883. #error "SPINDLE_LASER_PWM_PIN is required for SPINDLE_LASER_PWM."
  2884. #elif !_TEST_PWM(SPINDLE_LASER_PWM_PIN)
  2885. #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."
  2886. #elif !defined(SPINDLE_LASER_PWM_INVERT)
  2887. #error "SPINDLE_LASER_PWM_INVERT is required for (SPINDLE|LASER)_FEATURE."
  2888. #elif !(defined(SPEED_POWER_INTERCEPT) && defined(SPEED_POWER_MIN) && defined(SPEED_POWER_MAX) && defined(SPEED_POWER_STARTUP))
  2889. #error "SPINDLE_LASER_PWM equation constant(s) missing."
  2890. #elif _PIN_CONFLICT(X_MIN)
  2891. #error "SPINDLE_LASER_PWM pin conflicts with X_MIN_PIN."
  2892. #elif _PIN_CONFLICT(X_MAX)
  2893. #error "SPINDLE_LASER_PWM pin conflicts with X_MAX_PIN."
  2894. #elif _PIN_CONFLICT(Z_STEP)
  2895. #error "SPINDLE_LASER_PWM pin conflicts with Z_STEP_PIN."
  2896. #elif _PIN_CONFLICT(CASE_LIGHT)
  2897. #error "SPINDLE_LASER_PWM_PIN conflicts with CASE_LIGHT_PIN."
  2898. #elif _PIN_CONFLICT(E0_AUTO_FAN)
  2899. #error "SPINDLE_LASER_PWM_PIN conflicts with E0_AUTO_FAN_PIN."
  2900. #elif _PIN_CONFLICT(E1_AUTO_FAN)
  2901. #error "SPINDLE_LASER_PWM_PIN conflicts with E1_AUTO_FAN_PIN."
  2902. #elif _PIN_CONFLICT(E2_AUTO_FAN)
  2903. #error "SPINDLE_LASER_PWM_PIN conflicts with E2_AUTO_FAN_PIN."
  2904. #elif _PIN_CONFLICT(E3_AUTO_FAN)
  2905. #error "SPINDLE_LASER_PWM_PIN conflicts with E3_AUTO_FAN_PIN."
  2906. #elif _PIN_CONFLICT(E4_AUTO_FAN)
  2907. #error "SPINDLE_LASER_PWM_PIN conflicts with E4_AUTO_FAN_PIN."
  2908. #elif _PIN_CONFLICT(E5_AUTO_FAN)
  2909. #error "SPINDLE_LASER_PWM_PIN conflicts with E5_AUTO_FAN_PIN."
  2910. #elif _PIN_CONFLICT(E6_AUTO_FAN)
  2911. #error "SPINDLE_LASER_PWM_PIN conflicts with E6_AUTO_FAN_PIN."
  2912. #elif _PIN_CONFLICT(E7_AUTO_FAN)
  2913. #error "SPINDLE_LASER_PWM_PIN conflicts with E7_AUTO_FAN_PIN."
  2914. #elif _PIN_CONFLICT(FAN)
  2915. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN_PIN."
  2916. #elif _PIN_CONFLICT(FAN1)
  2917. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN1_PIN."
  2918. #elif _PIN_CONFLICT(FAN2)
  2919. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN2_PIN."
  2920. #elif _PIN_CONFLICT(FAN3)
  2921. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN3_PIN."
  2922. #elif _PIN_CONFLICT(FAN4)
  2923. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN4_PIN."
  2924. #elif _PIN_CONFLICT(FAN5)
  2925. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN5_PIN."
  2926. #elif _PIN_CONFLICT(FAN6)
  2927. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN6_PIN."
  2928. #elif _PIN_CONFLICT(FAN7)
  2929. #error "SPINDLE_LASER_PWM_PIN conflicts with FAN7_PIN."
  2930. #elif _PIN_CONFLICT(CONTROLLERFAN)
  2931. #error "SPINDLE_LASER_PWM_PIN conflicts with CONTROLLERFAN_PIN."
  2932. #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_XY)
  2933. #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_XY."
  2934. #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_Z)
  2935. #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_Z."
  2936. #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_E)
  2937. #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_E."
  2938. #endif
  2939. #endif
  2940. #undef _PIN_CONFLICT
  2941. #endif
  2942. #if ENABLED(COOLANT_MIST) && !PIN_EXISTS(COOLANT_MIST)
  2943. #error "COOLANT_MIST requires COOLANT_MIST_PIN to be defined."
  2944. #elif ENABLED(COOLANT_FLOOD) && !PIN_EXISTS(COOLANT_FLOOD)
  2945. #error "COOLANT_FLOOD requires COOLANT_FLOOD_PIN to be defined."
  2946. #endif
  2947. #if NONE(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI) && ENABLED(PRINT_PROGRESS_SHOW_DECIMALS)
  2948. #error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD."
  2949. #endif
  2950. #if HAS_ADC_BUTTONS && defined(ADC_BUTTON_DEBOUNCE_DELAY) && ADC_BUTTON_DEBOUNCE_DELAY < 16
  2951. #error "ADC_BUTTON_DEBOUNCE_DELAY must be greater than 16."
  2952. #endif
  2953. /**
  2954. * Check to make sure MONITOR_DRIVER_STATUS isn't enabled
  2955. * on boards where TMC drivers share the SPI bus with SD.
  2956. */
  2957. #if HAS_TMC_SPI && ALL(MONITOR_DRIVER_STATUS, SDSUPPORT, USES_SHARED_SPI)
  2958. #error "MONITOR_DRIVER_STATUS and SDSUPPORT cannot be used together on boards with shared SPI."
  2959. #endif
  2960. // G60/G61 Position Save
  2961. #if SAVED_POSITIONS > 256
  2962. #error "SAVED_POSITIONS must be an integer from 0 to 256."
  2963. #endif
  2964. /**
  2965. * Stepper Chunk support
  2966. */
  2967. #if BOTH(DIRECT_STEPPING, LIN_ADVANCE)
  2968. #error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. Enable in external planner if possible."
  2969. #endif
  2970. /**
  2971. * Touch Screen Calibration
  2972. */
  2973. #if ENABLED(TFT_TOUCH_DEVICE_XPT2046) && DISABLED(TOUCH_SCREEN_CALIBRATION) \
  2974. && (!defined(TOUCH_CALIBRATION_X) || !defined(TOUCH_CALIBRATION_Y) || !defined(TOUCH_OFFSET_X) || !defined(TOUCH_OFFSET_Y))
  2975. #error "TOUCH_CALIBRATION_[XY] and TOUCH_OFFSET_[XY] are required for resistive touch screens with TOUCH_SCREEN_CALIBRATION disabled."
  2976. #endif
  2977. /**
  2978. * Sanity check for WIFI
  2979. */
  2980. #if EITHER(ESP3D_WIFISUPPORT, WIFISUPPORT) && DISABLED(ARDUINO_ARCH_ESP32)
  2981. #error "ESP3D_WIFISUPPORT or WIFISUPPORT requires an ESP32 MOTHERBOARD."
  2982. #endif
  2983. /**
  2984. * Sanity Check for Password Feature
  2985. */
  2986. #if ENABLED(PASSWORD_FEATURE)
  2987. #if NONE(HAS_LCD_MENU, PASSWORD_UNLOCK_GCODE, PASSWORD_CHANGE_GCODE)
  2988. #error "Without PASSWORD_UNLOCK_GCODE, PASSWORD_CHANGE_GCODE, or a supported LCD there's no way to unlock the printer or set a password."
  2989. #elif DISABLED(EEPROM_SETTINGS)
  2990. #warning "PASSWORD_FEATURE settings will be lost on power-off without EEPROM_SETTINGS."
  2991. #endif
  2992. #endif
  2993. /**
  2994. * Sanity Check for MEATPACK and BINARY_FILE_TRANSFER Features
  2995. */
  2996. #if BOTH(HAS_MEATPACK, BINARY_FILE_TRANSFER)
  2997. #error "Either enable MEATPACK_ON_SERIAL_PORT_* or BINARY_FILE_TRANSFER, not both."
  2998. #endif
  2999. /**
  3000. * Sanity check for unique start and stop values in NOZZLE_CLEAN_FEATURE
  3001. */
  3002. #if ENABLED(NOZZLE_CLEAN_FEATURE)
  3003. constexpr xyz_pos_t start_xyz[8] = NOZZLE_CLEAN_START_POINT,
  3004. end_xyz[8] = NOZZLE_CLEAN_END_POINT;
  3005. #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), \
  3006. "NOZZLE_CLEAN Start and End must be made different on HOTEND " STRINGIFY(N))
  3007. _CLEAN_ASSERT(0); _CLEAN_ASSERT(1);
  3008. _CLEAN_ASSERT(2); _CLEAN_ASSERT(3);
  3009. _CLEAN_ASSERT(4); _CLEAN_ASSERT(5);
  3010. _CLEAN_ASSERT(6); _CLEAN_ASSERT(7);
  3011. #undef _CLEAN_ASSERT
  3012. #endif
  3013. /**
  3014. * Sanity check for MIXING_EXTRUDER & DISTINCT_E_FACTORS these are not compatible
  3015. */
  3016. #if BOTH(MIXING_EXTRUDER, DISTINCT_E_FACTORS)
  3017. #error "MIXING_EXTRUDER can't be used with DISTINCT_E_FACTORS. But you may use SINGLENOZZLE with DISTINCT_E_FACTORS."
  3018. #endif
  3019. /**
  3020. * Sanity check for valid stepper driver types
  3021. */
  3022. #define _BAD_DRIVER(A) (defined(A##_DRIVER_TYPE) && !_DRIVER_ID(A##_DRIVER_TYPE))
  3023. #if _BAD_DRIVER(X)
  3024. #error "X_DRIVER_TYPE is not recognized."
  3025. #endif
  3026. #if _BAD_DRIVER(Y)
  3027. #error "Y_DRIVER_TYPE is not recognized."
  3028. #endif
  3029. #if _BAD_DRIVER(Z)
  3030. #error "Z_DRIVER_TYPE is not recognized."
  3031. #endif
  3032. #if _BAD_DRIVER(X2)
  3033. #error "X2_DRIVER_TYPE is not recognized."
  3034. #endif
  3035. #if _BAD_DRIVER(Y2)
  3036. #error "Y2_DRIVER_TYPE is not recognized."
  3037. #endif
  3038. #if _BAD_DRIVER(Z2)
  3039. #error "Z2_DRIVER_TYPE is not recognized."
  3040. #endif
  3041. #if _BAD_DRIVER(Z3)
  3042. #error "Z3_DRIVER_TYPE is not recognized."
  3043. #endif
  3044. #if _BAD_DRIVER(Z4)
  3045. #error "Z4_DRIVER_TYPE is not recognized."
  3046. #endif
  3047. #if _BAD_DRIVER(E0)
  3048. #error "E0_DRIVER_TYPE is not recognized."
  3049. #endif
  3050. #if _BAD_DRIVER(E1)
  3051. #error "E1_DRIVER_TYPE is not recognized."
  3052. #endif
  3053. #if _BAD_DRIVER(E2)
  3054. #error "E2_DRIVER_TYPE is not recognized."
  3055. #endif
  3056. #if _BAD_DRIVER(E3)
  3057. #error "E3_DRIVER_TYPE is not recognized."
  3058. #endif
  3059. #if _BAD_DRIVER(E4)
  3060. #error "E4_DRIVER_TYPE is not recognized."
  3061. #endif
  3062. #if _BAD_DRIVER(E5)
  3063. #error "E5_DRIVER_TYPE is not recognized."
  3064. #endif
  3065. #if _BAD_DRIVER(E6)
  3066. #error "E6_DRIVER_TYPE is not recognized."
  3067. #endif
  3068. #if _BAD_DRIVER(E7)
  3069. #error "E7_DRIVER_TYPE is not recognized."
  3070. #endif
  3071. #undef _BAD_DRIVER
  3072. // Misc. Cleanup
  3073. #undef _TEST_PWM
  3074. #if ENABLED(FREEZE_FEATURE) && !PIN_EXISTS(FREEZE)
  3075. #error "FREEZE_FEATURE requires a FREEZE_PIN to be defined."
  3076. #endif