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

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