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

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