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

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