My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

SanityCheck.h 122KB

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