My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SanityCheck.h 100KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207
  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 USE_AUTOMATIC_VERSIONING. Please update your configuration."
  73. #elif defined(SDSLOW)
  74. #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead."
  75. #elif defined(SDEXTRASLOW)
  76. #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead."
  77. #elif defined(FILAMENT_SENSOR)
  78. #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration."
  79. #elif defined(ENDSTOPPULLUP_FIL_RUNOUT)
  80. #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP. Please update your configuration."
  81. #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
  82. #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead."
  83. #elif defined(LANGUAGE_INCLUDE)
  84. #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration."
  85. #elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y)
  86. #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead."
  87. #elif defined(PID_PARAMS_PER_EXTRUDER)
  88. #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead."
  89. #elif defined(EXTRUDER_WATTS) || defined(BED_WATTS)
  90. #error "EXTRUDER_WATTS and BED_WATTS are deprecated. Remove them from your configuration."
  91. #elif defined(SERVO_ENDSTOP_ANGLES)
  92. #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
  93. #elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
  94. #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
  95. #elif defined(Z_ENDSTOP_SERVO_NR)
  96. #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR. Please update your configuration."
  97. #elif defined(DEFAULT_XYJERK)
  98. #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead."
  99. #elif defined(XY_TRAVEL_SPEED)
  100. #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead."
  101. #elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
  102. #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead."
  103. #elif defined(SERVO_DEACTIVATION_DELAY)
  104. #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead."
  105. #elif ENABLED(FILAMENTCHANGEENABLE)
  106. #error "FILAMENTCHANGEENABLE is now ADVANCED_PAUSE_FEATURE. Please update your configuration."
  107. #elif ENABLED(FILAMENT_CHANGE_FEATURE)
  108. #error "FILAMENT_CHANGE_FEATURE is now ADVANCED_PAUSE_FEATURE. Please update your configuration."
  109. #elif defined(FILAMENT_CHANGE_X_POS) || defined(FILAMENT_CHANGE_Y_POS)
  110. #error "FILAMENT_CHANGE_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration."
  111. #elif defined(FILAMENT_CHANGE_Z_ADD)
  112. #error "FILAMENT_CHANGE_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration."
  113. #elif defined(FILAMENT_CHANGE_XY_FEEDRATE)
  114. #error "FILAMENT_CHANGE_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration."
  115. #elif defined(FILAMENT_CHANGE_Z_FEEDRATE)
  116. #error "FILAMENT_CHANGE_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration."
  117. #elif defined(PAUSE_PARK_X_POS) || defined(PAUSE_PARK_Y_POS)
  118. #error "PAUSE_PARK_[XY]_POS is now set with NOZZLE_PARK_POINT. Please update your configuration."
  119. #elif defined(PAUSE_PARK_Z_ADD)
  120. #error "PAUSE_PARK_Z_ADD is now set with NOZZLE_PARK_POINT. Please update your configuration."
  121. #elif defined(PAUSE_PARK_XY_FEEDRATE)
  122. #error "PAUSE_PARK_XY_FEEDRATE is now NOZZLE_PARK_XY_FEEDRATE. Please update your configuration."
  123. #elif defined(PAUSE_PARK_Z_FEEDRATE)
  124. #error "PAUSE_PARK_Z_FEEDRATE is now NOZZLE_PARK_Z_FEEDRATE. Please update your configuration."
  125. #elif defined(FILAMENT_CHANGE_RETRACT_FEEDRATE)
  126. #error "FILAMENT_CHANGE_RETRACT_FEEDRATE is now PAUSE_PARK_RETRACT_FEEDRATE. Please update your configuration."
  127. #elif defined(FILAMENT_CHANGE_RETRACT_LENGTH)
  128. #error "FILAMENT_CHANGE_RETRACT_LENGTH is now PAUSE_PARK_RETRACT_LENGTH. Please update your configuration."
  129. #elif defined(FILAMENT_CHANGE_EXTRUDE_FEEDRATE)
  130. #error "FILAMENT_CHANGE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration."
  131. #elif defined(ADVANCED_PAUSE_EXTRUDE_FEEDRATE)
  132. #error "ADVANCED_PAUSE_EXTRUDE_FEEDRATE is now ADVANCED_PAUSE_PURGE_FEEDRATE. Please update your configuration."
  133. #elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH)
  134. #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration."
  135. #elif defined(ADVANCED_PAUSE_EXTRUDE_LENGTH)
  136. #error "ADVANCED_PAUSE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_PURGE_LENGTH. Please update your configuration."
  137. #elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT)
  138. #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT. Please update your configuration."
  139. #elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS)
  140. #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS. Please update your configuration."
  141. #elif defined(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
  142. #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT. Please update your configuration."
  143. #elif defined(PLA_PREHEAT_HOTEND_TEMP)
  144. #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration."
  145. #elif defined(PLA_PREHEAT_HPB_TEMP)
  146. #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration."
  147. #elif defined(PLA_PREHEAT_FAN_SPEED)
  148. #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration."
  149. #elif defined(ABS_PREHEAT_HOTEND_TEMP)
  150. #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration."
  151. #elif defined(ABS_PREHEAT_HPB_TEMP)
  152. #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration."
  153. #elif defined(ABS_PREHEAT_FAN_SPEED)
  154. #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration."
  155. #elif defined(ENDSTOPS_ONLY_FOR_HOMING)
  156. #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead."
  157. #elif defined(HOMING_FEEDRATE)
  158. #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead."
  159. #elif defined(MANUAL_HOME_POSITIONS)
  160. #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead."
  161. #elif defined(PID_ADD_EXTRUSION_RATE)
  162. #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."
  163. #elif defined(Z_RAISE_BEFORE_HOMING)
  164. #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT. Please update your configuration."
  165. #elif defined(MIN_Z_HEIGHT_FOR_HOMING)
  166. #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT. Please update your configuration."
  167. #elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING)
  168. #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead."
  169. #elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS)
  170. #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."
  171. #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT)
  172. #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."
  173. #elif defined(MANUAL_BED_LEVELING)
  174. #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING. Please update your configuration."
  175. #elif defined(MESH_HOME_SEARCH_Z)
  176. #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE. Please update your configuration."
  177. #elif defined(MANUAL_PROBE_Z_RANGE)
  178. #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE. Please update your configuration."
  179. #elif !defined(MIN_STEPS_PER_SEGMENT)
  180. #error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h.
  181. #elif MIN_STEPS_PER_SEGMENT <= 0
  182. #error "MIN_STEPS_PER_SEGMENT must be at least 1. Please update your Configuration_adv.h."
  183. #elif defined(PREVENT_DANGEROUS_EXTRUDE)
  184. #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION. Please update your configuration."
  185. #elif defined(SCARA)
  186. #error "SCARA is now MORGAN_SCARA. Please update your configuration."
  187. #elif defined(ENABLE_AUTO_BED_LEVELING)
  188. #error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
  189. #elif defined(AUTO_BED_LEVELING_FEATURE)
  190. #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
  191. #elif defined(ABL_GRID_POINTS)
  192. #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y. Please update your configuration."
  193. #elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y)
  194. #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration."
  195. #elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y)
  196. #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration."
  197. #elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS)
  198. #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration."
  199. #elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS)
  200. #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration."
  201. #elif defined(UBL_G26_MESH_VALIDATION)
  202. #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION. Please update your configuration."
  203. #elif defined(UBL_MESH_EDIT_ENABLED)
  204. #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION. Please update your configuration."
  205. #elif defined(UBL_MESH_EDITING)
  206. #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION. Please update your configuration."
  207. #elif defined(BLTOUCH_HEATERS_OFF)
  208. #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF. Please update your configuration."
  209. #elif defined(BLTOUCH_V3)
  210. #error "BLTOUCH_V3 is obsolete. Please update your configuration."
  211. #elif defined(BLTOUCH_FORCE_OPEN_DRAIN_MODE)
  212. #error "BLTOUCH_FORCE_OPEN_DRAIN_MODE is obsolete. Please update your configuration."
  213. #elif defined(BEEPER)
  214. #error "BEEPER is now BEEPER_PIN. Please update your pins definitions."
  215. #elif defined(SDCARDDETECT)
  216. #error "SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions."
  217. #elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE)
  218. #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN. Please update your pins definitions."
  219. #elif defined(LCD_PIN_BL)
  220. #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN. Please update your pins definitions."
  221. #elif defined(LCD_PIN_RESET)
  222. #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions."
  223. #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)
  224. #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h."
  225. #elif defined(min_software_endstops) || defined(max_software_endstops)
  226. #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration."
  227. #elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN)
  228. #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)."
  229. #elif defined(CONTROLLERFAN_PIN)
  230. #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN. Please update your Configuration_adv.h."
  231. #elif defined(MIN_RETRACT)
  232. #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h."
  233. #elif defined(ADVANCE)
  234. #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE."
  235. #elif defined(LIN_ADVANCE_E_D_RATIO)
  236. #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO. Check your configuration."
  237. #elif defined(NEOPIXEL_RGBW_LED)
  238. #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration."
  239. #elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS)
  240. #error "Remove DELTA_PROBEABLE_RADIUS and use MIN_PROBE_EDGE to inset the probe area instead."
  241. #elif defined(UBL_MESH_INSET)
  242. #error "UBL_MESH_INSET is now just MESH_INSET. Please update your configuration."
  243. #elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y)
  244. #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]. Please update your configuration."
  245. #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)
  246. #error "ABL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration."
  247. #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)
  248. #error "UBL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration."
  249. #elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY)
  250. #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY. Please update your configuration."
  251. #elif defined(BABYSTEP_ZPROBE_GFX_REVERSE)
  252. #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE. Please update your configurations."
  253. #elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN)
  254. #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES. Please update your configuration."
  255. #elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1))
  256. #error "K1 is now PID_K1. Please update your configuration."
  257. #elif defined(PROBE_DOUBLE_TOUCH)
  258. #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING. Please update your configuration."
  259. #elif defined(ANET_KEYPAD_LCD)
  260. #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD. Please update your configuration."
  261. #elif defined(LCD_I2C_SAINSMART_YWROBOT)
  262. #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004). Please update your configuration."
  263. #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT)
  264. #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN. Please update your configuration."
  265. #elif defined(HAVE_TMCDRIVER)
  266. #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
  267. #elif defined(STEALTHCHOP)
  268. #error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E). Please update your Configuration_adv.h."
  269. #elif defined(HAVE_TMC26X)
  270. #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
  271. #elif defined(HAVE_TMC2130)
  272. #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h."
  273. #elif defined(HAVE_L6470DRIVER)
  274. #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h."
  275. #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) \
  276. || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) || defined(E5_IS_TMC)
  277. #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
  278. #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) \
  279. || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) || defined(E5_IS_TMC26X)
  280. #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
  281. #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) \
  282. || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) || defined(E5_IS_TMC2130)
  283. #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h."
  284. #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) \
  285. || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) || defined(E5_IS_TMC2208)
  286. #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h."
  287. #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) \
  288. || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) || defined(E5_IS_L6470)
  289. #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h."
  290. #elif defined(AUTOMATIC_CURRENT_CONTROL)
  291. #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration."
  292. #elif defined(FILAMENT_CHANGE_LOAD_LENGTH)
  293. #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH. Please update your configuration."
  294. #elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET)
  295. #error "LEVEL_BED_CORNERS requires a LEVEL_CORNERS_INSET value. Please update your Configuration.h."
  296. #elif defined(BEZIER_JERK_CONTROL)
  297. #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION. Please update your configuration."
  298. #elif defined(JUNCTION_DEVIATION_FACTOR)
  299. #error "JUNCTION_DEVIATION_FACTOR is now JUNCTION_DEVIATION_MM. Please update your configuration."
  300. #elif defined(JUNCTION_ACCELERATION_FACTOR)
  301. #error "JUNCTION_ACCELERATION_FACTOR is obsolete. Delete it from Configuration_adv.h."
  302. #elif defined(JUNCTION_ACCELERATION)
  303. #error "JUNCTION_ACCELERATION is obsolete. Delete it from Configuration_adv.h."
  304. #elif defined(MAX7219_DEBUG_STEPPER_HEAD)
  305. #error "MAX7219_DEBUG_STEPPER_HEAD is now MAX7219_DEBUG_PLANNER_HEAD. Please update your configuration."
  306. #elif defined(MAX7219_DEBUG_STEPPER_TAIL)
  307. #error "MAX7219_DEBUG_STEPPER_TAIL is now MAX7219_DEBUG_PLANNER_TAIL. Please update your configuration."
  308. #elif defined(MAX7219_DEBUG_STEPPER_QUEUE)
  309. #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE. Please update your configuration."
  310. #elif defined(ENDSTOP_NOISE_FILTER)
  311. #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]. Please update your configuration."
  312. #elif defined(RETRACT_ZLIFT)
  313. #error "RETRACT_ZLIFT is now RETRACT_ZRAISE. Please update your Configuration_adv.h."
  314. #elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT)
  315. #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE. Please update your configuration."
  316. #elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE)
  317. #error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE. Please update your configuration."
  318. #elif defined(SINGLENOZZLE_SWAP_LENGTH)
  319. #error "SINGLENOZZLE_SWAP_LENGTH is now TOOLCHANGE_FIL_SWAP_LENGTH. Please update your configuration."
  320. #elif defined(SINGLENOZZLE_SWAP_RETRACT_SPEED)
  321. #error "SINGLENOZZLE_SWAP_RETRACT_SPEED is now TOOLCHANGE_FIL_SWAP_RETRACT_SPEED. Please update your configuration."
  322. #elif defined(SINGLENOZZLE_SWAP_PRIME_SPEED)
  323. #error "SINGLENOZZLE_SWAP_PRIME_SPEED is now TOOLCHANGE_FIL_SWAP_PRIME_SPEED. Please update your configuration."
  324. #elif defined(SINGLENOZZLE_SWAP_PARK)
  325. #error "SINGLENOZZLE_SWAP_PARK is now TOOLCHANGE_PARK. Please update your configuration."
  326. #elif defined(SINGLENOZZLE_TOOLCHANGE_XY)
  327. #error "SINGLENOZZLE_TOOLCHANGE_XY is now TOOLCHANGE_PARK_XY. Please update your configuration."
  328. #elif defined(SINGLENOZZLE_PARK_XY_FEEDRATE)
  329. #error "SINGLENOZZLE_PARK_XY_FEEDRATE is now TOOLCHANGE_PARK_XY_FEEDRATE. Please update your configuration."
  330. #elif defined(PARKING_EXTRUDER_SECURITY_RAISE)
  331. #error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration."
  332. #elif defined(SWITCHING_TOOLHEAD_SECURITY_RAISE)
  333. #error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration."
  334. #elif defined(G0_FEEDRATE) && G0_FEEDRATE == 0
  335. #error "G0_FEEDRATE is now used to set the G0 feedrate. Please update your configuration."
  336. #elif defined(MBL_Z_STEP)
  337. #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP. Please update your configuration."
  338. #elif defined(CHDK)
  339. #error "CHDK is now CHDK_PIN. Please update your Configuration_adv.h."
  340. #elif defined(MAX6675_SS)
  341. #error "MAX6675_SS is now MAX6675_SS_PIN. Please update your configuration and/or pins."
  342. #elif defined(MAX6675_SS2)
  343. #error "MAX6675_SS2 is now MAX6675_SS2_PIN. Please update your configuration and/or pins."
  344. #elif defined(SPINDLE_LASER_ENABLE_PIN)
  345. #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN. Please update your configuration and/or pins."
  346. #elif defined(CHAMBER_HEATER_PIN)
  347. #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN. Please update your configuration and/or pins."
  348. #elif defined(TMC_Z_CALIBRATION)
  349. #error "TMC_Z_CALIBRATION has been deprecated in favor of Z_STEPPER_AUTO_ALIGN. Please update your configuration."
  350. #elif defined(Z_MIN_PROBE_ENDSTOP)
  351. #error "Z_MIN_PROBE_ENDSTOP is no longer required. Please remove it from Configuration.h."
  352. #elif defined(DUAL_NOZZLE_DUPLICATION_MODE)
  353. #error "DUAL_NOZZLE_DUPLICATION_MODE is now MULTI_NOZZLE_DUPLICATION. Please update your configuration."
  354. #elif defined(MENU_ITEM_CASE_LIGHT)
  355. #error "MENU_ITEM_CASE_LIGHT is now CASE_LIGHT_MENU. Please update your configuration."
  356. #elif defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
  357. #error "ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED is now SD_ABORT_ON_ENDSTOP_HIT. Please update your Configuration_adv.h."
  358. #endif
  359. #define BOARD_MKS_13 -47
  360. #define BOARD_TRIGORILLA -343
  361. #define BOARD_RURAMPS4D -1550
  362. #define BOARD_FORMBOT_TREX2 -81
  363. #if MB(MKS_13)
  364. #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration."
  365. #elif MB(TRIGORILLA)
  366. #error "BOARD_TRIGORILLA has been renamed BOARD_TRIGORILLA_13. Please update your configuration."
  367. #elif MB(RURAMPS4D)
  368. #error "BOARD_RURAMPS4D has been renamed BOARD_RURAMPS4D_11. Please update your configuration."
  369. #elif MB(FORMBOT_TREX2)
  370. #error "FORMBOT_TREX2 has been renamed BOARD_FORMBOT_TREX2PLUS. Please update your configuration."
  371. #endif
  372. #undef BOARD_MKS_13
  373. #undef BOARD_TRIGORILLA
  374. #undef BOARD_RURAMPS4D
  375. #undef BOARD_FORMBOT_TREX2
  376. /**
  377. * Marlin release, version and default string
  378. */
  379. #ifndef SHORT_BUILD_VERSION
  380. #error "SHORT_BUILD_VERSION must be specified."
  381. #elif !defined(DETAILED_BUILD_VERSION)
  382. #error "BUILD_VERSION must be specified."
  383. #elif !defined(STRING_DISTRIBUTION_DATE)
  384. #error "STRING_DISTRIBUTION_DATE must be specified."
  385. #elif !defined(PROTOCOL_VERSION)
  386. #error "PROTOCOL_VERSION must be specified."
  387. #elif !defined(MACHINE_NAME)
  388. #error "MACHINE_NAME must be specified."
  389. #elif !defined(SOURCE_CODE_URL)
  390. #error "SOURCE_CODE_URL must be specified."
  391. #elif !defined(DEFAULT_MACHINE_UUID)
  392. #error "DEFAULT_MACHINE_UUID must be specified."
  393. #elif !defined(WEBSITE_URL)
  394. #error "WEBSITE_URL must be specified."
  395. #endif
  396. /**
  397. * Serial
  398. */
  399. #if !(defined(__AVR__) && defined(USBCON))
  400. #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
  401. #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
  402. #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
  403. #error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
  404. #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
  405. #error "TX_BUFFER_SIZE must be 0 or a power of 2 between 1 and 256."
  406. #endif
  407. #elif ANY(SERIAL_XON_XOFF, SERIAL_STATS_MAX_RX_QUEUED, SERIAL_STATS_DROPPED_RX)
  408. #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
  409. #endif
  410. #if SERIAL_PORT > 7
  411. #error "Set SERIAL_PORT to the port on your board. Usually this is 0."
  412. #endif
  413. #if defined(SERIAL_PORT_2) && NUM_SERIAL < 2
  414. #error "SERIAL_PORT_2 is not supported for your MOTHERBOARD. Disable it to continue."
  415. #endif
  416. /**
  417. * Dual / Triple Stepper Drivers
  418. */
  419. #if BOTH(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE)
  420. #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS."
  421. #elif ENABLED(X_DUAL_STEPPER_DRIVERS) && !(HAS_X2_ENABLE && HAS_X2_STEP && HAS_X2_DIR)
  422. #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)."
  423. #elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && !(HAS_Y2_ENABLE && HAS_Y2_STEP && HAS_Y2_DIR)
  424. #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)."
  425. #elif ENABLED(Z_DUAL_STEPPER_DRIVERS)
  426. #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
  427. #error "Please select either Z_TRIPLE_STEPPER_DRIVERS or Z_DUAL_STEPPER_DRIVERS, not both."
  428. #elif !(HAS_Z2_ENABLE && HAS_Z2_STEP && HAS_Z2_DIR)
  429. #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)."
  430. #endif
  431. #elif ENABLED(Z_TRIPLE_STEPPER_DRIVERS) && !(HAS_Z2_ENABLE && HAS_Z2_STEP && HAS_Z2_DIR && HAS_Z3_ENABLE && HAS_Z3_STEP && HAS_Z3_DIR)
  432. #error "Z_TRIPLE_STEPPER_DRIVERS requires Z3 pins (and two extra E plugs)."
  433. #endif
  434. /**
  435. * Validate that the bed size fits
  436. */
  437. static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE.");
  438. static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE.");
  439. /**
  440. * Granular software endstops (Marlin >= 1.1.7)
  441. */
  442. #if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z)
  443. #if IS_KINEMATIC
  444. #error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z."
  445. #elif DISABLED(MIN_SOFTWARE_ENDSTOP_X, MIN_SOFTWARE_ENDSTOP_Y)
  446. #error "MIN_SOFTWARE_ENDSTOPS requires at least one of the MIN_SOFTWARE_ENDSTOP_[XYZ] options."
  447. #endif
  448. #endif
  449. #if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z)
  450. #if IS_KINEMATIC
  451. #error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z."
  452. #elif DISABLED(MAX_SOFTWARE_ENDSTOP_X, MAX_SOFTWARE_ENDSTOP_Y)
  453. #error "MAX_SOFTWARE_ENDSTOPS requires at least one of the MAX_SOFTWARE_ENDSTOP_[XYZ] options."
  454. #endif
  455. #endif
  456. #if !defined(TARGET_LPC1768) && ( \
  457. ENABLED(ENDSTOPPULLDOWNS) \
  458. || ENABLED(ENDSTOPPULLDOWN_XMAX) \
  459. || ENABLED(ENDSTOPPULLDOWN_YMAX) \
  460. || ENABLED(ENDSTOPPULLDOWN_ZMAX) \
  461. || ENABLED(ENDSTOPPULLDOWN_XMIN) \
  462. || ENABLED(ENDSTOPPULLDOWN_YMIN) \
  463. || ENABLED(ENDSTOPPULLDOWN_ZMIN) )
  464. #error "PULLDOWN pin mode is not available on the selected board."
  465. #endif
  466. #if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS)
  467. #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS."
  468. #elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN)
  469. #error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN."
  470. #elif BOTH(ENDSTOPPULLUP_XMAX, ENDSTOPPULLDOWN_XMAX)
  471. #error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX."
  472. #elif BOTH(ENDSTOPPULLUP_YMAX, ENDSTOPPULLDOWN_YMAX)
  473. #error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
  474. #elif BOTH(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX)
  475. #error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
  476. #elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN)
  477. #error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
  478. #elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN)
  479. #error "Enable only one of ENDSTOPPULLUP_Y_MIN or ENDSTOPPULLDOWN_Y_MIN."
  480. #elif BOTH(ENDSTOPPULLUP_ZMIN, ENDSTOPPULLDOWN_ZMIN)
  481. #error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN."
  482. #endif
  483. /**
  484. * LCD Info Screen Style
  485. */
  486. #if LCD_INFO_SCREEN_STYLE > 0
  487. #if HAS_GRAPHICAL_LCD || LCD_WIDTH < 20 || LCD_HEIGHT < 4
  488. #error "Alternative LCD_INFO_SCREEN_STYLE requires 20x4 Character LCD."
  489. #elif LCD_INFO_SCREEN_STYLE > 1
  490. #error "LCD_INFO_SCREEN_STYLE only has options 0 and 1 at this time."
  491. #endif
  492. #endif
  493. /**
  494. * Progress Bar
  495. */
  496. #if ENABLED(LCD_PROGRESS_BAR)
  497. #if DISABLED(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
  498. #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY."
  499. #elif !HAS_CHARACTER_LCD
  500. #error "LCD_PROGRESS_BAR requires a character LCD."
  501. #elif HAS_GRAPHICAL_LCD
  502. #error "LCD_PROGRESS_BAR does not apply to graphical displays."
  503. #elif ENABLED(FILAMENT_LCD_DISPLAY)
  504. #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both."
  505. #elif PROGRESS_MSG_EXPIRE < 0
  506. #error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
  507. #endif
  508. #elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && !HAS_GRAPHICAL_LCD && DISABLED(EXTENSIBLE_UI)
  509. #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Graphical LCD, or EXTENSIBLE_UI."
  510. #endif
  511. /**
  512. * Custom Boot and Status screens
  513. */
  514. #if DISABLED(DOGLCD) && EITHER(SHOW_CUSTOM_BOOTSCREEN, CUSTOM_STATUS_SCREEN_IMAGE)
  515. #error "Graphical LCD is required for SHOW_CUSTOM_BOOTSCREEN and CUSTOM_STATUS_SCREEN_IMAGE."
  516. #endif
  517. /**
  518. * LCD Lightweight Screen Style
  519. */
  520. #if ENABLED(LIGHTWEIGHT_UI) && DISABLED(U8GLIB_ST7920)
  521. #error "LIGHTWEIGHT_UI requires a U8GLIB_ST7920-based display."
  522. #endif
  523. /**
  524. * SD File Sorting
  525. */
  526. #if ENABLED(SDCARD_SORT_ALPHA)
  527. #if SDSORT_LIMIT > 256
  528. #error "SDSORT_LIMIT must be 256 or smaller."
  529. #elif SDSORT_LIMIT < 10
  530. #error "SDSORT_LIMIT should be greater than 9 to be useful."
  531. #elif DISABLED(SDSORT_USES_RAM)
  532. #if ENABLED(SDSORT_DYNAMIC_RAM)
  533. #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)."
  534. #elif ENABLED(SDSORT_CACHE_NAMES)
  535. #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)."
  536. #endif
  537. #endif
  538. #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
  539. #if SDSORT_CACHE_VFATS < 2
  540. #error "SDSORT_CACHE_VFATS must be 2 or greater!"
  541. #elif SDSORT_CACHE_VFATS > MAX_VFAT_ENTRIES
  542. #undef SDSORT_CACHE_VFATS
  543. #define SDSORT_CACHE_VFATS MAX_VFAT_ENTRIES
  544. #warning "SDSORT_CACHE_VFATS was reduced to MAX_VFAT_ENTRIES!"
  545. #endif
  546. #endif
  547. #endif
  548. #if defined(EVENT_GCODE_SD_STOP) && DISABLED(NOZZLE_PARK_FEATURE)
  549. static_assert(nullptr == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP.");
  550. #endif
  551. /**
  552. * I2C Position Encoders
  553. */
  554. #if ENABLED(I2C_POSITION_ENCODERS)
  555. #if DISABLED(BABYSTEPPING) || DISABLED(BABYSTEP_XY)
  556. #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY."
  557. #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5)
  558. #error "I2CPE_ENCODER_CNT must be between 1 and 5."
  559. #endif
  560. #endif
  561. /**
  562. * Babystepping
  563. */
  564. #if ENABLED(BABYSTEPPING)
  565. #if ENABLED(SCARA)
  566. #error "BABYSTEPPING is not implemented for SCARA yet."
  567. #elif BOTH(DELTA, BABYSTEP_XY)
  568. #error "BABYSTEPPING only implemented for Z axis on deltabots."
  569. #elif BOTH(BABYSTEP_ZPROBE_OFFSET, MESH_BED_LEVELING)
  570. #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
  571. #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
  572. #error "BABYSTEP_ZPROBE_OFFSET requires a probe."
  573. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(DOGLCD)
  574. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD."
  575. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
  576. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
  577. #elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET
  578. #error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS."
  579. #elif BOTH(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE)
  580. #error "BABYSTEP_ALWAYS_AVAILABLE and MOVE_Z_WHEN_IDLE are incompatible."
  581. #endif
  582. #endif
  583. /**
  584. * Filament Runout needs one or more pins and either SD Support or Auto print start detection
  585. */
  586. #if HAS_FILAMENT_SENSOR
  587. #if !PIN_EXISTS(FIL_RUNOUT)
  588. #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
  589. #elif NUM_RUNOUT_SENSORS > E_STEPPERS
  590. #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers."
  591. #elif NUM_RUNOUT_SENSORS > 1 && !PIN_EXISTS(FIL_RUNOUT2)
  592. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 1 requires FIL_RUNOUT2_PIN."
  593. #elif NUM_RUNOUT_SENSORS > 2 && !PIN_EXISTS(FIL_RUNOUT3)
  594. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 2 requires FIL_RUNOUT3_PIN."
  595. #elif NUM_RUNOUT_SENSORS > 3 && !PIN_EXISTS(FIL_RUNOUT4)
  596. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 3 requires FIL_RUNOUT4_PIN."
  597. #elif NUM_RUNOUT_SENSORS > 4 && !PIN_EXISTS(FIL_RUNOUT5)
  598. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 4 requires FIL_RUNOUT5_PIN."
  599. #elif NUM_RUNOUT_SENSORS > 5 && !PIN_EXISTS(FIL_RUNOUT6)
  600. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 5 requires FIL_RUNOUT6_PIN."
  601. #elif DISABLED(SDSUPPORT, PRINTJOB_TIMER_AUTOSTART)
  602. #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART."
  603. #elif FILAMENT_RUNOUT_DISTANCE_MM < 0
  604. #error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero."
  605. #elif DISABLED(ADVANCED_PAUSE_FEATURE)
  606. static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
  607. #endif
  608. #endif
  609. /**
  610. * Advanced Pause
  611. */
  612. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  613. #if !HAS_RESUME_CONTINUE
  614. #error "ADVANCED_PAUSE_FEATURE currently requires an LCD controller or EMERGENCY_PARSER."
  615. #elif ENABLED(EXTRUDER_RUNOUT_PREVENT)
  616. #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
  617. #elif ENABLED(PARK_HEAD_ON_PAUSE) && DISABLED(SDSUPPORT, NEWPANEL, EMERGENCY_PARSER)
  618. #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller."
  619. #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
  620. #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT."
  621. #elif DISABLED(NOZZLE_PARK_FEATURE)
  622. #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE."
  623. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH
  624. #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  625. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_SLOW_LOAD_LENGTH > EXTRUDE_MAXLENGTH
  626. #error "FILAMENT_CHANGE_SLOW_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  627. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_FAST_LOAD_LENGTH > EXTRUDE_MAXLENGTH
  628. #error "FILAMENT_CHANGE_FAST_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  629. #endif
  630. #endif
  631. #if ENABLED(NOZZLE_PARK_FEATURE)
  632. constexpr float npp[] = NOZZLE_PARK_POINT;
  633. static_assert(COUNT(npp) == XYZ, "NOZZLE_PARK_POINT requires X, Y, and Z values.");
  634. #endif
  635. /**
  636. * Individual axis homing is useless for DELTAS
  637. */
  638. #if BOTH(INDIVIDUAL_AXIS_HOMING_MENU, DELTA)
  639. #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
  640. #endif
  641. /**
  642. * Options only for EXTRUDERS > 1
  643. */
  644. #if EXTRUDERS > 1
  645. #if EXTRUDERS > 6
  646. #error "Marlin supports a maximum of 6 EXTRUDERS."
  647. #endif
  648. #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  649. #error "EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT."
  650. #endif
  651. #if ENABLED(HEATERS_PARALLEL)
  652. #error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
  653. #endif
  654. #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
  655. #ifndef TOOLCHANGE_FIL_SWAP_LENGTH
  656. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FIL_SWAP_LENGTH. Please update your Configuration."
  657. #elif !defined(TOOLCHANGE_FIL_SWAP_RETRACT_SPEED)
  658. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FIL_SWAP_RETRACT_SPEED. Please update your Configuration."
  659. #elif !defined(TOOLCHANGE_FIL_SWAP_PRIME_SPEED)
  660. #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FIL_SWAP_PRIME_SPEED. Please update your Configuration."
  661. #endif
  662. #endif
  663. #if ENABLED(TOOLCHANGE_PARK)
  664. #ifndef TOOLCHANGE_PARK_XY
  665. #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY. Please update your Configuration."
  666. #elif !defined(TOOLCHANGE_PARK_XY_FEEDRATE)
  667. #error "TOOLCHANGE_PARK requires TOOLCHANGE_PARK_XY_FEEDRATE. Please update your Configuration."
  668. #endif
  669. #endif
  670. #ifndef TOOLCHANGE_ZRAISE
  671. #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1. Please update your Configuration_adv.h."
  672. #endif
  673. #elif ENABLED(MK2_MULTIPLEXER)
  674. #error "MK2_MULTIPLEXER requires 2 or more EXTRUDERS."
  675. #elif ENABLED(SINGLENOZZLE)
  676. #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
  677. #endif
  678. /**
  679. * Sanity checking for the Průša MK2 Multiplexer
  680. */
  681. #ifdef SNMM
  682. #error "SNMM is now MK2_MULTIPLEXER. Please update your configuration."
  683. #endif
  684. /**
  685. * A Dual Nozzle carriage with switching servo
  686. */
  687. #if ENABLED(SWITCHING_NOZZLE)
  688. #if ENABLED(DUAL_X_CARRIAGE)
  689. #error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible."
  690. #elif ENABLED(SINGLENOZZLE)
  691. #error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible."
  692. #elif EXTRUDERS != 2
  693. #error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
  694. #elif NUM_SERVOS < 1
  695. #error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1."
  696. #endif
  697. #ifndef SWITCHING_NOZZLE_SERVO_NR
  698. #error "SWITCHING_NOZZLE requires SWITCHING_NOZZLE_SERVO_NR."
  699. #elif SWITCHING_NOZZLE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  700. #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
  701. #elif SWITCHING_NOZZLE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  702. #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
  703. #elif SWITCHING_NOZZLE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  704. #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
  705. #elif SWITCHING_NOZZLE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  706. #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
  707. #endif
  708. #ifdef SWITCHING_NOZZLE_E1_SERVO_NR
  709. #if SWITCHING_NOZZLE_E1_SERVO_NR == SWITCHING_NOZZLE_SERVO_NR
  710. #error "SWITCHING_NOZZLE_E1_SERVO_NR must be different from SWITCHING_NOZZLE_SERVO_NR."
  711. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  712. #error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
  713. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  714. #error "SERVO1_PIN must be defined for your SWITCHING_NOZZLE."
  715. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  716. #error "SERVO2_PIN must be defined for your SWITCHING_NOZZLE."
  717. #elif SWITCHING_NOZZLE_E1_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  718. #error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
  719. #endif
  720. #endif
  721. #endif
  722. /**
  723. * Single Stepper Dual Extruder with switching servo
  724. */
  725. #if ENABLED(SWITCHING_EXTRUDER)
  726. #if NUM_SERVOS < 1
  727. #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
  728. #elif SWITCHING_EXTRUDER_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  729. #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
  730. #elif SWITCHING_EXTRUDER_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  731. #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
  732. #elif SWITCHING_EXTRUDER_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  733. #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
  734. #elif SWITCHING_EXTRUDER_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  735. #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
  736. #endif
  737. #if EXTRUDERS > 3
  738. #if NUM_SERVOS < 2
  739. #error "SWITCHING_EXTRUDER with 4 extruders requires NUM_SERVOS >= 2."
  740. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  741. #error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
  742. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  743. #error "SERVO1_PIN must be defined for your SWITCHING_EXTRUDER."
  744. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  745. #error "SERVO2_PIN must be defined for your SWITCHING_EXTRUDER."
  746. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  747. #error "SERVO3_PIN must be defined for your SWITCHING_EXTRUDER."
  748. #elif SWITCHING_EXTRUDER_E23_SERVO_NR == SWITCHING_EXTRUDER_SERVO_NR
  749. #error "SWITCHING_EXTRUDER_E23_SERVO_NR should be a different extruder from SWITCHING_EXTRUDER_SERVO_NR."
  750. #endif
  751. #endif
  752. #endif
  753. /**
  754. * Mixing Extruder requirements
  755. */
  756. #if ENABLED(MIXING_EXTRUDER)
  757. #if EXTRUDERS > 1
  758. #error "MIXING_EXTRUDER currently only supports one extruder."
  759. #elif MIXING_STEPPERS < 2
  760. #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
  761. #elif ENABLED(FILAMENT_SENSOR)
  762. #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway."
  763. #elif ENABLED(SWITCHING_EXTRUDER)
  764. #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both."
  765. #elif ENABLED(SINGLENOZZLE)
  766. #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE."
  767. #endif
  768. #endif
  769. /**
  770. * Linear Advance 1.5 - Check K value range
  771. */
  772. #if ENABLED(LIN_ADVANCE)
  773. static_assert(
  774. WITHIN(LIN_ADVANCE_K, 0, 10),
  775. "LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)."
  776. );
  777. #endif
  778. /**
  779. * (Magnetic) Parking Extruder requirements
  780. */
  781. #if ENABLED(PARKING_EXTRUDER)
  782. #if ENABLED(DUAL_X_CARRIAGE)
  783. #error "PARKING_EXTRUDER and DUAL_X_CARRIAGE are incompatible."
  784. #elif ENABLED(SINGLENOZZLE)
  785. #error "PARKING_EXTRUDER and SINGLENOZZLE are incompatible."
  786. #elif ENABLED(EXT_SOLENOID)
  787. #error "PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)"
  788. #elif ENABLED(MAGNETIC_PARKING_EXTRUDER)
  789. #error "Enable only one of PARKING_EXTRUDER and MAGNETIC_PARKING_EXTRUDER."
  790. #elif EXTRUDERS != 2
  791. #error "PARKING_EXTRUDER requires exactly 2 EXTRUDERS."
  792. #elif !PIN_EXISTS(SOL0, SOL1)
  793. #error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN."
  794. #elif !defined(PARKING_EXTRUDER_PARKING_X)
  795. #error "PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X."
  796. #elif !defined(TOOLCHANGE_ZRAISE)
  797. #error "PARKING_EXTRUDER requires TOOLCHANGE_ZRAISE."
  798. #elif TOOLCHANGE_ZRAISE < 0
  799. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  800. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH)
  801. #error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW."
  802. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000)
  803. #error "PARKING_EXTRUDER_SOLENOIDS_DELAY must be between 0 and 2000 (ms)."
  804. #endif
  805. #elif ENABLED(MAGNETIC_PARKING_EXTRUDER)
  806. #if ENABLED(DUAL_X_CARRIAGE)
  807. #error "MAGNETIC_PARKING_EXTRUDER and DUAL_X_CARRIAGE are incompatible."
  808. #elif ENABLED(SINGLENOZZLE)
  809. #error "MAGNETIC_PARKING_EXTRUDER and SINGLENOZZLE are incompatible."
  810. #elif ENABLED(EXT_SOLENOID)
  811. #error "MAGNETIC_PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)"
  812. #elif EXTRUDERS != 2
  813. #error "MAGNETIC_PARKING_EXTRUDER requires exactly 2 EXTRUDERS."
  814. #elif !defined(PARKING_EXTRUDER_PARKING_X)
  815. #error "MAGNETIC_PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X."
  816. #elif !defined(TOOLCHANGE_ZRAISE)
  817. #error "MAGNETIC_PARKING_EXTRUDER requires TOOLCHANGE_ZRAISE."
  818. #elif TOOLCHANGE_ZRAISE < 0
  819. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  820. #endif
  821. #endif
  822. /**
  823. * Switching Toolhead requirements
  824. */
  825. #if ENABLED(SWITCHING_TOOLHEAD)
  826. #if ENABLED(DUAL_X_CARRIAGE)
  827. #error "SWITCHING_TOOLHEAD and DUAL_X_CARRIAGE are incompatible."
  828. #elif ENABLED(SINGLENOZZLE)
  829. #error "SWITCHING_TOOLHEAD and SINGLENOZZLE are incompatible."
  830. #elif ENABLED(PARKING_EXTRUDER)
  831. #error "SWITCHING_TOOLHEAD and PARKING_EXTRUDER are incompatible."
  832. #elif !defined(SWITCHING_TOOLHEAD_SERVO_NR)
  833. #error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SERVO_NR."
  834. #elif EXTRUDERS < 2
  835. #error "SWITCHING_TOOLHEAD requires at least 2 EXTRUDERS."
  836. #elif NUM_SERVOS < (SWITCHING_TOOLHEAD_SERVO_NR - 1)
  837. #if SWITCHING_TOOLHEAD_SERVO_NR == 0
  838. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 0 requires NUM_SERVOS >= 1."
  839. #elif SWITCHING_TOOLHEAD_SERVO_NR == 1
  840. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 1 requires NUM_SERVOS >= 2."
  841. #elif SWITCHING_TOOLHEAD_SERVO_NR == 2
  842. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 2 requires NUM_SERVOS >= 3."
  843. #elif SWITCHING_TOOLHEAD_SERVO_NR == 3
  844. #error "A SWITCHING_TOOLHEAD_SERVO_NR of 3 requires NUM_SERVOS >= 4."
  845. #endif
  846. #elif !defined(TOOLCHANGE_ZRAISE)
  847. #error "SWITCHING_TOOLHEAD requires TOOLCHANGE_ZRAISE."
  848. #elif TOOLCHANGE_ZRAISE < 0
  849. #error "TOOLCHANGE_ZRAISE must be 0 or higher."
  850. #endif
  851. #endif
  852. /**
  853. * Part-Cooling Fan Multiplexer requirements
  854. */
  855. #if PIN_EXISTS(FANMUX1)
  856. #if !HAS_FANMUX
  857. #error "FANMUX0_PIN must be set before FANMUX1_PIN can be set."
  858. #endif
  859. #elif PIN_EXISTS(FANMUX2)
  860. #error "FANMUX0_PIN and FANMUX1_PIN must be set before FANMUX2_PIN can be set."
  861. #endif
  862. /**
  863. * Limited number of servos
  864. */
  865. #if NUM_SERVOS > NUM_SERVO_PLUGS
  866. #error "The selected board doesn't support enough servos for your configuration. Reduce NUM_SERVOS."
  867. #endif
  868. /**
  869. * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder
  870. */
  871. #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)
  872. #error "Z_PROBE_SERVO_NR, switching nozzle, switching toolhead or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE."
  873. #endif
  874. /**
  875. * Required LCD language
  876. */
  877. #if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780)
  878. #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller."
  879. #endif
  880. /**
  881. * Bed Heating Options - PID vs Limit Switching
  882. */
  883. #if BOTH(PIDTEMPBED, BED_LIMIT_SWITCHING)
  884. #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED."
  885. #endif
  886. /**
  887. * Kinematics
  888. */
  889. /**
  890. * Allow only one kinematic type to be defined
  891. */
  892. #if 1 < 0 \
  893. + ENABLED(DELTA) \
  894. + ENABLED(MORGAN_SCARA) \
  895. + ENABLED(MAKERARM_SCARA) \
  896. + ENABLED(COREXY) \
  897. + ENABLED(COREXZ) \
  898. + ENABLED(COREYZ) \
  899. + ENABLED(COREYX) \
  900. + ENABLED(COREZX) \
  901. + ENABLED(COREZY)
  902. #error "Please enable only one of DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY."
  903. #endif
  904. /**
  905. * Delta requirements
  906. */
  907. #if ENABLED(DELTA)
  908. #if DISABLED(USE_XMAX_PLUG, USE_YMAX_PLUG, USE_ZMAX_PLUG)
  909. #error "You probably want to use Max Endstops for DELTA!"
  910. #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED
  911. #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
  912. #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_LCD_MENU)
  913. #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
  914. #elif ABL_GRID
  915. #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0
  916. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
  917. #elif GRID_MAX_POINTS_X < 3
  918. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher."
  919. #endif
  920. #endif
  921. #endif
  922. /**
  923. * Probes
  924. */
  925. /**
  926. * Allow only one probe option to be defined
  927. */
  928. #if 1 < 0 \
  929. + ENABLED(PROBE_MANUALLY) \
  930. + ENABLED(FIX_MOUNTED_PROBE) \
  931. + (HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH)) \
  932. + ENABLED(BLTOUCH) \
  933. + ENABLED(SOLENOID_PROBE) \
  934. + ENABLED(Z_PROBE_ALLEN_KEY) \
  935. + ENABLED(Z_PROBE_SLED) \
  936. + ENABLED(RACK_AND_PINION_PROBE)
  937. #error "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
  938. #endif
  939. #if HAS_BED_PROBE
  940. static_assert(FLOOR(float(X_PROBE_OFFSET_FROM_EXTRUDER)) == float(X_PROBE_OFFSET_FROM_EXTRUDER), "X_PROBE_OFFSET_FROM_EXTRUDER must be an integer!");
  941. static_assert(FLOOR(float(Y_PROBE_OFFSET_FROM_EXTRUDER)) == float(Y_PROBE_OFFSET_FROM_EXTRUDER), "Y_PROBE_OFFSET_FROM_EXTRUDER must be an integer!");
  942. /**
  943. * Z_PROBE_SLED is incompatible with DELTA
  944. */
  945. #if BOTH(Z_PROBE_SLED, DELTA)
  946. #error "You cannot use Z_PROBE_SLED with DELTA."
  947. #endif
  948. /**
  949. * SOLENOID_PROBE requirements
  950. */
  951. #if ENABLED(SOLENOID_PROBE)
  952. #if ENABLED(EXT_SOLENOID)
  953. #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID."
  954. #elif !HAS_SOLENOID_1
  955. #error "SOLENOID_PROBE requires SOL1_PIN. It can be added to your Configuration.h."
  956. #endif
  957. #endif
  958. /**
  959. * NUM_SERVOS is required for a Z servo probe
  960. */
  961. #if HAS_Z_SERVO_PROBE
  962. #ifndef NUM_SERVOS
  963. #error "You must set NUM_SERVOS for a Z servo probe (Z_PROBE_SERVO_NR)."
  964. #elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
  965. #error "SERVO0_PIN must be defined for your servo or BLTOUCH probe."
  966. #elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
  967. #error "SERVO1_PIN must be defined for your servo or BLTOUCH probe."
  968. #elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
  969. #error "SERVO2_PIN must be defined for your servo or BLTOUCH probe."
  970. #elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
  971. #error "SERVO3_PIN must be defined for your servo or BLTOUCH probe."
  972. #elif Z_PROBE_SERVO_NR >= NUM_SERVOS
  973. #error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS."
  974. #endif
  975. #endif
  976. #if ENABLED(BLTOUCH)
  977. #if BLTOUCH_DELAY < 200
  978. #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported."
  979. #elif DISABLED(BLTOUCH_SET_5V_MODE) && NONE(ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN, ENDSTOPPULLUP_ZMIN_PROBE)
  980. #error "BLTOUCH without BLTOUCH_SET_5V_MODE requires ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN or ENDSTOPPULLUP_ZMIN_PROBE."
  981. #endif
  982. #endif
  983. #if ENABLED(RACK_AND_PINION_PROBE) && !(defined(Z_PROBE_DEPLOY_X) && defined(Z_PROBE_RETRACT_X))
  984. #error "RACK_AND_PINION_PROBE requires Z_PROBE_DEPLOY_X and Z_PROBE_RETRACT_X."
  985. #endif
  986. /**
  987. * Require pin options and pins to be defined
  988. */
  989. #if ENABLED(SENSORLESS_PROBING)
  990. #if ENABLED(DELTA) && (!AXIS_DRIVER_TYPE_X(TMC2130) || !AXIS_DRIVER_TYPE_Y(TMC2130) || !AXIS_DRIVER_TYPE_Z(TMC2130))
  991. #error "SENSORLESS_PROBING requires TMC2130 drivers on X, Y, and Z."
  992. #elif !AXIS_DRIVER_TYPE_Z(TMC2130)
  993. #error "SENSORLESS_PROBING requires a TMC2130 driver on Z."
  994. #endif
  995. #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  996. #if DISABLED(USE_ZMIN_PLUG)
  997. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled."
  998. #elif !HAS_Z_MIN
  999. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined."
  1000. #elif Z_MIN_PROBE_ENDSTOP_INVERTING != Z_MIN_ENDSTOP_INVERTING
  1001. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING."
  1002. #endif
  1003. #elif !HAS_Z_MIN_PROBE_PIN
  1004. #error "Z_MIN_PROBE_PIN must be defined if Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN is not enabled."
  1005. #endif
  1006. /**
  1007. * Make sure Z raise values are set
  1008. */
  1009. #ifndef Z_CLEARANCE_DEPLOY_PROBE
  1010. #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration."
  1011. #elif !defined(Z_CLEARANCE_BETWEEN_PROBES)
  1012. #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration."
  1013. #elif Z_CLEARANCE_DEPLOY_PROBE < 0
  1014. #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0."
  1015. #elif Z_CLEARANCE_BETWEEN_PROBES < 0
  1016. #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
  1017. #elif Z_AFTER_PROBING < 0
  1018. #error "Probes need Z_AFTER_PROBING >= 0."
  1019. #endif
  1020. #if MULTIPLE_PROBING && MULTIPLE_PROBING < 2
  1021. #error "MULTIPLE_PROBING must be >= 2."
  1022. #endif
  1023. #if Z_PROBE_LOW_POINT > 0
  1024. #error "Z_PROBE_LOW_POINT must be less than or equal to 0."
  1025. #endif
  1026. #else
  1027. /**
  1028. * Require some kind of probe for bed leveling and probe testing
  1029. */
  1030. #if HAS_ABL_NOT_UBL && !PROBE_SELECTED
  1031. #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo."
  1032. #endif
  1033. #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
  1034. #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe: FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
  1035. #endif
  1036. #endif
  1037. /**
  1038. * Allow only one bed leveling option to be defined
  1039. */
  1040. #if 1 < 0 \
  1041. + ENABLED(AUTO_BED_LEVELING_LINEAR) \
  1042. + ENABLED(AUTO_BED_LEVELING_3POINT) \
  1043. + ENABLED(AUTO_BED_LEVELING_BILINEAR) \
  1044. + ENABLED(AUTO_BED_LEVELING_UBL) \
  1045. + ENABLED(MESH_BED_LEVELING)
  1046. #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."
  1047. #endif
  1048. /**
  1049. * Bed Leveling Requirements
  1050. */
  1051. #if EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT)
  1052. static_assert(WITHIN(PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_1_X is outside the probe region.");
  1053. static_assert(WITHIN(PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_2_X is outside the probe region.");
  1054. static_assert(WITHIN(PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_3_X is outside the probe region.");
  1055. static_assert(WITHIN(PROBE_PT_1_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_1_Y is outside the probe region.");
  1056. static_assert(WITHIN(PROBE_PT_2_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_2_Y is outside the probe region.");
  1057. static_assert(WITHIN(PROBE_PT_3_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_3_Y is outside the probe region.");
  1058. #endif
  1059. #if ENABLED(AUTO_BED_LEVELING_UBL)
  1060. /**
  1061. * Unified Bed Leveling
  1062. */
  1063. // Hide PROBE_MANUALLY from the rest of the code
  1064. #undef PROBE_MANUALLY
  1065. #if IS_SCARA
  1066. #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
  1067. #elif DISABLED(EEPROM_SETTINGS)
  1068. #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration."
  1069. #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
  1070. #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
  1071. #elif !defined(RESTORE_LEVELING_AFTER_G28)
  1072. #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'."
  1073. #endif
  1074. #elif HAS_ABL_NOT_UBL
  1075. /**
  1076. * Auto Bed Leveling
  1077. */
  1078. /**
  1079. * Delta and SCARA have limited bed leveling options
  1080. */
  1081. #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR)
  1082. #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option."
  1083. #endif
  1084. /**
  1085. * Check auto bed leveling probe points
  1086. */
  1087. #if ABL_GRID
  1088. static_assert(LEFT_PROBE_BED_POSITION < RIGHT_PROBE_BED_POSITION, "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION.");
  1089. static_assert(FRONT_PROBE_BED_POSITION < BACK_PROBE_BED_POSITION, "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION.");
  1090. static_assert(LEFT_PROBE_BED_POSITION >= MIN_PROBE_X, "LEFT_PROBE_BED_POSITION is outside the probe region.");
  1091. static_assert(RIGHT_PROBE_BED_POSITION <= MAX_PROBE_X, "RIGHT_PROBE_BED_POSITION is outside the probe region.");
  1092. static_assert(FRONT_PROBE_BED_POSITION >= MIN_PROBE_Y, "FRONT_PROBE_BED_POSITION is outside the probe region.");
  1093. static_assert(BACK_PROBE_BED_POSITION <= MAX_PROBE_Y, "BACK_PROBE_BED_POSITION is outside the probe region.");
  1094. #endif
  1095. #elif ENABLED(MESH_BED_LEVELING)
  1096. // Hide PROBE_MANUALLY from the rest of the code
  1097. #undef PROBE_MANUALLY
  1098. /**
  1099. * Mesh Bed Leveling
  1100. */
  1101. #if ENABLED(DELTA)
  1102. #error "MESH_BED_LEVELING is not compatible with DELTA printers."
  1103. #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9
  1104. #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
  1105. #endif
  1106. #endif
  1107. #if HAS_MESH
  1108. #if DISABLED(JUNCTION_DEVIATION)
  1109. static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
  1110. #endif
  1111. #elif ENABLED(G26_MESH_VALIDATION)
  1112. #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
  1113. #endif
  1114. #if ENABLED(MESH_EDIT_GFX_OVERLAY) && (DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(DOGLCD))
  1115. #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD."
  1116. #endif
  1117. #if ENABLED(G29_RETRY_AND_RECOVER)
  1118. #if ENABLED(AUTO_BED_LEVELING_UBL)
  1119. #error "G29_RETRY_AND_RECOVER is not compatible with UBL."
  1120. #elif ENABLED(MESH_BED_LEVELING)
  1121. #error "G29_RETRY_AND_RECOVER is not compatible with MESH_BED_LEVELING."
  1122. #endif
  1123. #endif
  1124. /**
  1125. * LCD_BED_LEVELING requirements
  1126. */
  1127. #if ENABLED(LCD_BED_LEVELING)
  1128. #if !HAS_LCD_MENU
  1129. #error "LCD_BED_LEVELING requires a programmable LCD controller."
  1130. #elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL)
  1131. #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
  1132. #endif
  1133. #endif
  1134. /**
  1135. * Homing
  1136. */
  1137. #if X_HOME_BUMP_MM < 0 || Y_HOME_BUMP_MM < 0 || Z_HOME_BUMP_MM < 0
  1138. #error "[XYZ]_HOME_BUMP_MM must be greater than or equal to 0."
  1139. #endif
  1140. #if ENABLED(CODEPENDENT_XY_HOMING)
  1141. #if ENABLED(QUICK_HOME)
  1142. #error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING."
  1143. #elif IS_KINEMATIC
  1144. #error "CODEPENDENT_XY_HOMING requires a Cartesian setup."
  1145. #endif
  1146. #endif
  1147. /**
  1148. * Make sure Z_SAFE_HOMING point is reachable
  1149. */
  1150. #if ENABLED(Z_SAFE_HOMING)
  1151. #if HAS_BED_PROBE
  1152. static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, MIN_PROBE_X, MAX_PROBE_X), "Z_SAFE_HOMING_X_POINT is outside the probe region.");
  1153. static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, MIN_PROBE_Y, MAX_PROBE_Y), "Z_SAFE_HOMING_Y_POINT is outside the probe region.");
  1154. #else
  1155. 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.");
  1156. 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.");
  1157. #endif
  1158. #endif // Z_SAFE_HOMING
  1159. /**
  1160. * Make sure DISABLE_[XYZ] compatible with selected homing options
  1161. */
  1162. #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z)
  1163. #if EITHER(HOME_AFTER_DEACTIVATE, Z_SAFE_HOMING)
  1164. #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
  1165. #endif
  1166. #endif
  1167. /**
  1168. * Filament Width Sensor
  1169. */
  1170. #if ENABLED(FILAMENT_WIDTH_SENSOR)
  1171. #if !HAS_FILAMENT_WIDTH_SENSOR
  1172. #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
  1173. #elif ENABLED(NO_VOLUMETRICS)
  1174. #error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled."
  1175. #endif
  1176. #endif
  1177. /**
  1178. * ULTIPANEL encoder
  1179. */
  1180. #if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL, SR_LCD_2W_NL) && !defined(SHIFT_CLK)
  1181. #error "ULTIPANEL requires some kind of encoder."
  1182. #endif
  1183. #if ENCODER_PULSES_PER_STEP < 0
  1184. #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead."
  1185. #endif
  1186. /**
  1187. * SAV_3DGLCD display options
  1188. */
  1189. #if ENABLED(SAV_3DGLCD)
  1190. #if DISABLED(U8GLIB_SSD1306, U8GLIB_SH1106)
  1191. #error "Enable a SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
  1192. #elif BOTH(U8GLIB_SSD1306, U8GLIB_SH1106)
  1193. #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
  1194. #endif
  1195. #endif
  1196. /**
  1197. * Allen Key
  1198. * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
  1199. */
  1200. #if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  1201. #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY"
  1202. #endif
  1203. /**
  1204. * Dual X Carriage requirements
  1205. */
  1206. #if ENABLED(DUAL_X_CARRIAGE)
  1207. #if EXTRUDERS == 1
  1208. #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
  1209. #elif CORE_IS_XY || CORE_IS_XZ
  1210. #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, or COREZX."
  1211. #elif !(HAS_X2_ENABLE && HAS_X2_STEP && HAS_X2_DIR)
  1212. #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
  1213. #elif !HAS_X_MAX
  1214. #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop."
  1215. #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
  1216. #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
  1217. #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1
  1218. #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1."
  1219. #endif
  1220. #endif // DUAL_X_CARRIAGE
  1221. /**
  1222. * Make sure auto fan pins don't conflict with the fan pin
  1223. */
  1224. #if HAS_AUTO_FAN
  1225. #if HAS_FAN0
  1226. #if E0_AUTO_FAN_PIN == FAN_PIN
  1227. #error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
  1228. #elif E1_AUTO_FAN_PIN == FAN_PIN
  1229. #error "You cannot set E1_AUTO_FAN_PIN equal to FAN_PIN."
  1230. #elif E2_AUTO_FAN_PIN == FAN_PIN
  1231. #error "You cannot set E2_AUTO_FAN_PIN equal to FAN_PIN."
  1232. #elif E3_AUTO_FAN_PIN == FAN_PIN
  1233. #error "You cannot set E3_AUTO_FAN_PIN equal to FAN_PIN."
  1234. #endif
  1235. #endif
  1236. #endif
  1237. #if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN
  1238. #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."
  1239. #endif
  1240. #if ENABLED(USE_CONTROLLER_FAN)
  1241. #if !HAS_CONTROLLER_FAN
  1242. #error "USE_CONTROLLER_FAN requires a CONTROLLER_FAN_PIN. Define in Configuration_adv.h."
  1243. #elif E0_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1244. #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1245. #elif E1_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1246. #error "You cannot set E1_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1247. #elif E2_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1248. #error "You cannot set E2_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1249. #elif E3_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  1250. #error "You cannot set E3_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  1251. #endif
  1252. #endif
  1253. /**
  1254. * Test case light not using the same pin as the fan
  1255. */
  1256. #if ENABLED(CASE_LIGHT_ENABLE) && CASE_LIGHT_PIN == FAN_PIN
  1257. #error "You cannot set CASE_LIGHT_PIN equal to FAN_PIN."
  1258. #endif
  1259. /**
  1260. * Required custom thermistor settings
  1261. */
  1262. #if ENABLED(HEATER_0_USER_THERMISTOR) && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA))
  1263. #error "TEMP_SENSOR_0 1000 requires HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS and HOTEND0_BETA in Configuration_adv.h."
  1264. #elif ENABLED(HEATER_1_USER_THERMISTOR) && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA))
  1265. #error "TEMP_SENSOR_1 1000 requires HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS and HOTEND1_BETA in Configuration_adv.h."
  1266. #elif ENABLED(HEATER_2_USER_THERMISTOR) && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA))
  1267. #error "TEMP_SENSOR_2 1000 requires HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS and HOTEND2_BETA in Configuration_adv.h."
  1268. #elif ENABLED(HEATER_3_USER_THERMISTOR) && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA))
  1269. #error "TEMP_SENSOR_3 1000 requires HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS and HOTEND3_BETA in Configuration_adv.h."
  1270. #elif ENABLED(HEATER_4_USER_THERMISTOR) && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA))
  1271. #error "TEMP_SENSOR_4 1000 requires HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS and HOTEND4_BETA in Configuration_adv.h."
  1272. #elif ENABLED(HEATER_5_USER_THERMISTOR) && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA))
  1273. #error "TEMP_SENSOR_5 1000 requires HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS and HOTEND5_BETA in Configuration_adv.h."
  1274. #elif ENABLED(HEATER_BED_USER_THERMISTOR) && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA))
  1275. #error "TEMP_SENSOR_BED 1000 requires BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS and BED_BETA in Configuration_adv.h."
  1276. #elif ENABLED(HEATER_CHAMBER_USER_THERMISTOR) && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA))
  1277. #error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h."
  1278. #endif
  1279. /**
  1280. * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set.
  1281. */
  1282. #if !HAS_HEATER_0
  1283. #error "HEATER_0_PIN not defined for this board."
  1284. #elif !ANY_PIN(TEMP_0, MAX6675_SS)
  1285. #error "TEMP_0_PIN not defined for this board."
  1286. #elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && !PIN_EXISTS(E0_STEP, E0_DIR))
  1287. #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
  1288. #elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP, E0_DIR) || !HAS_E0_ENABLE))
  1289. #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
  1290. #elif TEMP_SENSOR_0 == 0
  1291. #error "TEMP_SENSOR_0 is required."
  1292. #endif
  1293. // Pins are required for heaters
  1294. #if ENABLED(HEATER_0_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS)
  1295. #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board."
  1296. #elif (HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)) && !HAS_HEATER_1
  1297. #error "HEATER_1_PIN not defined for this board."
  1298. #endif
  1299. #if HOTENDS > 1
  1300. #if ENABLED(HEATER_1_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS2)
  1301. #error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board."
  1302. #elif TEMP_SENSOR_1 == 0
  1303. #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
  1304. #elif !ANY_PIN(TEMP_1, MAX6675_SS2)
  1305. #error "TEMP_1_PIN not defined for this board."
  1306. #endif
  1307. #if HOTENDS > 2
  1308. #if TEMP_SENSOR_2 == 0
  1309. #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
  1310. #elif !HAS_HEATER_2
  1311. #error "HEATER_2_PIN not defined for this board."
  1312. #elif !PIN_EXISTS(TEMP_2)
  1313. #error "TEMP_2_PIN not defined for this board."
  1314. #endif
  1315. #if HOTENDS > 3
  1316. #if TEMP_SENSOR_3 == 0
  1317. #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
  1318. #elif !HAS_HEATER_3
  1319. #error "HEATER_3_PIN not defined for this board."
  1320. #elif !PIN_EXISTS(TEMP_3)
  1321. #error "TEMP_3_PIN not defined for this board."
  1322. #endif
  1323. #if HOTENDS > 4
  1324. #if TEMP_SENSOR_4 == 0
  1325. #error "TEMP_SENSOR_4 is required with 5 or more HOTENDS."
  1326. #elif !HAS_HEATER_4
  1327. #error "HEATER_4_PIN not defined for this board."
  1328. #elif !PIN_EXISTS(TEMP_4)
  1329. #error "TEMP_4_PIN not defined for this board."
  1330. #endif
  1331. #if HOTENDS > 5
  1332. #if TEMP_SENSOR_5 == 0
  1333. #error "TEMP_SENSOR_5 is required with 6 HOTENDS."
  1334. #elif !HAS_HEATER_5
  1335. #error "HEATER_5_PIN not defined for this board."
  1336. #elif !PIN_EXISTS(TEMP_5)
  1337. #error "TEMP_5_PIN not defined for this board."
  1338. #endif
  1339. #elif TEMP_SENSOR_5 != 0
  1340. #error "TEMP_SENSOR_5 shouldn't be set with only 5 HOTENDS."
  1341. #endif
  1342. #elif TEMP_SENSOR_4 != 0
  1343. #error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS."
  1344. #elif TEMP_SENSOR_5 != 0
  1345. #error "TEMP_SENSOR_5 shouldn't be set with only 4 HOTENDS."
  1346. #endif
  1347. #elif TEMP_SENSOR_3 != 0
  1348. #error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS."
  1349. #elif TEMP_SENSOR_4 != 0
  1350. #error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS."
  1351. #elif TEMP_SENSOR_5 != 0
  1352. #error "TEMP_SENSOR_5 shouldn't be set with only 3 HOTENDS."
  1353. #endif
  1354. #elif TEMP_SENSOR_2 != 0
  1355. #error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS."
  1356. #elif TEMP_SENSOR_3 != 0
  1357. #error "TEMP_SENSOR_3 shouldn't be set with only 2 HOTENDS."
  1358. #elif TEMP_SENSOR_4 != 0
  1359. #error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS."
  1360. #elif TEMP_SENSOR_5 != 0
  1361. #error "TEMP_SENSOR_5 shouldn't be set with only 2 HOTENDS."
  1362. #endif
  1363. #elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  1364. #error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND."
  1365. #elif TEMP_SENSOR_2 != 0
  1366. #error "TEMP_SENSOR_2 shouldn't be set with only 1 HOTEND."
  1367. #elif TEMP_SENSOR_3 != 0
  1368. #error "TEMP_SENSOR_3 shouldn't be set with only 1 HOTEND."
  1369. #elif TEMP_SENSOR_4 != 0
  1370. #error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND."
  1371. #elif TEMP_SENSOR_5 != 0
  1372. #error "TEMP_SENSOR_5 shouldn't be set with only 1 HOTEND."
  1373. #endif
  1374. #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0
  1375. #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
  1376. #endif
  1377. /**
  1378. * Temperature status LEDs
  1379. */
  1380. #if ENABLED(TEMP_STAT_LEDS) && !ANY_PIN(STAT_LED_RED, STAT_LED_BLUE)
  1381. #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both."
  1382. #endif
  1383. /**
  1384. * LED Control Menu
  1385. */
  1386. #if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS
  1387. #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9533, PCA9632, or NEOPIXEL_LED."
  1388. #endif
  1389. /**
  1390. * LED Backlight Timeout
  1391. */
  1392. #if defined(LED_BACKLIGHT_TIMEOUT) && !(EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && POWER_SUPPLY > 0)
  1393. #error "LED_BACKLIGHT_TIMEOUT requires a Fysetc Mini Panel and a Power Switch."
  1394. #endif
  1395. /**
  1396. * Basic multi hotend duplication mode
  1397. */
  1398. #if ENABLED(MULTI_NOZZLE_DUPLICATION)
  1399. #if HOTENDS < 2
  1400. #error "MULTI_NOZZLE_DUPLICATION requires 2 or more hotends."
  1401. #elif ENABLED(DUAL_X_CARRIAGE)
  1402. #error "MULTI_NOZZLE_DUPLICATION is incompatible with DUAL_X_CARRIAGE."
  1403. #elif ENABLED(SINGLENOZZLE)
  1404. #error "MULTI_NOZZLE_DUPLICATION is incompatible with SINGLENOZZLE."
  1405. #elif ENABLED(MIXING_EXTRUDER)
  1406. #error "MULTI_NOZZLE_DUPLICATION is incompatible with MIXING_EXTRUDER."
  1407. #elif ENABLED(SWITCHING_EXTRUDER)
  1408. #error "MULTI_NOZZLE_DUPLICATION is incompatible with SWITCHING_EXTRUDER."
  1409. #endif
  1410. #endif
  1411. /**
  1412. * Test Extruder Stepper Pins
  1413. */
  1414. #if DISABLED(MK2_MULTIPLEXER) // MK2_MULTIPLEXER uses E0 stepper only
  1415. #if E_STEPPERS
  1416. #if !(PIN_EXISTS(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
  1417. #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
  1418. #endif
  1419. #if E_STEPPERS > 1
  1420. #if !(PIN_EXISTS(E1_STEP, E1_DIR) && HAS_E1_ENABLE)
  1421. #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
  1422. #endif
  1423. #if E_STEPPERS > 2
  1424. #if !(PIN_EXISTS(E2_STEP, E2_DIR) && HAS_E2_ENABLE)
  1425. #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
  1426. #endif
  1427. #if E_STEPPERS > 3
  1428. #if !(PIN_EXISTS(E3_STEP, E3_DIR) && HAS_E3_ENABLE)
  1429. #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
  1430. #endif
  1431. #if E_STEPPERS > 4
  1432. #if !(PIN_EXISTS(E4_STEP, E4_DIR) && HAS_E4_ENABLE)
  1433. #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
  1434. #endif
  1435. #if E_STEPPERS > 5
  1436. #if !(PIN_EXISTS(E5_STEP, E5_DIR) && HAS_E5_ENABLE)
  1437. #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
  1438. #endif
  1439. #endif // E_STEPPERS > 5
  1440. #endif // E_STEPPERS > 4
  1441. #endif // E_STEPPERS > 3
  1442. #endif // E_STEPPERS > 2
  1443. #endif // E_STEPPERS > 1
  1444. #endif // E_STEPPERS
  1445. #endif
  1446. /**
  1447. * Endstop Tests
  1448. */
  1449. #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_)))
  1450. #define _AXIS_PLUG_UNUSED_TEST(AXIS) (_PLUG_UNUSED_TEST(AXIS,X) && _PLUG_UNUSED_TEST(AXIS,Y) && _PLUG_UNUSED_TEST(AXIS,Z))
  1451. // At least 3 endstop plugs must be used
  1452. #if _AXIS_PLUG_UNUSED_TEST(X)
  1453. #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG."
  1454. #endif
  1455. #if _AXIS_PLUG_UNUSED_TEST(Y)
  1456. #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG."
  1457. #endif
  1458. #if _AXIS_PLUG_UNUSED_TEST(Z)
  1459. #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG."
  1460. #endif
  1461. // Delta and Cartesian use 3 homing endstops
  1462. #if !IS_SCARA
  1463. #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG)
  1464. #error "Enable USE_XMIN_PLUG when homing X to MIN."
  1465. #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG)
  1466. #error "Enable USE_XMAX_PLUG when homing X to MAX."
  1467. #elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG)
  1468. #error "Enable USE_YMIN_PLUG when homing Y to MIN."
  1469. #elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG)
  1470. #error "Enable USE_YMAX_PLUG when homing Y to MAX."
  1471. #endif
  1472. #endif
  1473. #if Z_HOME_DIR < 0 && DISABLED(USE_ZMIN_PLUG)
  1474. #error "Enable USE_ZMIN_PLUG when homing Z to MIN."
  1475. #elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG)
  1476. #error "Enable USE_ZMAX_PLUG when homing Z to MAX."
  1477. #endif
  1478. // Dual endstops requirements
  1479. #if ENABLED(X_DUAL_ENDSTOPS)
  1480. #if !X2_USE_ENDSTOP
  1481. #error "You must set X2_USE_ENDSTOP with X_DUAL_ENDSTOPS."
  1482. #elif X2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1483. #error "USE_XMIN_PLUG is required when X2_USE_ENDSTOP is _XMIN_."
  1484. #elif X2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1485. #error "USE_XMAX_PLUG is required when X2_USE_ENDSTOP is _XMAX_."
  1486. #elif X2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1487. #error "USE_YMIN_PLUG is required when X2_USE_ENDSTOP is _YMIN_."
  1488. #elif X2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1489. #error "USE_YMAX_PLUG is required when X2_USE_ENDSTOP is _YMAX_."
  1490. #elif X2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1491. #error "USE_ZMIN_PLUG is required when X2_USE_ENDSTOP is _ZMIN_."
  1492. #elif X2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1493. #error "USE_ZMAX_PLUG is required when X2_USE_ENDSTOP is _ZMAX_."
  1494. #elif !HAS_X2_MIN && !HAS_X2_MAX
  1495. #error "X2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1496. #elif ENABLED(DELTA)
  1497. #error "X_DUAL_ENDSTOPS is not compatible with DELTA."
  1498. #endif
  1499. #endif
  1500. #if ENABLED(Y_DUAL_ENDSTOPS)
  1501. #if !Y2_USE_ENDSTOP
  1502. #error "You must set Y2_USE_ENDSTOP with Y_DUAL_ENDSTOPS."
  1503. #elif Y2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1504. #error "USE_XMIN_PLUG is required when Y2_USE_ENDSTOP is _XMIN_."
  1505. #elif Y2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1506. #error "USE_XMAX_PLUG is required when Y2_USE_ENDSTOP is _XMAX_."
  1507. #elif Y2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1508. #error "USE_YMIN_PLUG is required when Y2_USE_ENDSTOP is _YMIN_."
  1509. #elif Y2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1510. #error "USE_YMAX_PLUG is required when Y2_USE_ENDSTOP is _YMAX_."
  1511. #elif Y2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1512. #error "USE_ZMIN_PLUG is required when Y2_USE_ENDSTOP is _ZMIN_."
  1513. #elif Y2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1514. #error "USE_ZMAX_PLUG is required when Y2_USE_ENDSTOP is _ZMAX_."
  1515. #elif !HAS_Y2_MIN && !HAS_Y2_MAX
  1516. #error "Y2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1517. #elif ENABLED(DELTA)
  1518. #error "Y_DUAL_ENDSTOPS is not compatible with DELTA."
  1519. #endif
  1520. #endif
  1521. #if ENABLED(Z_DUAL_ENDSTOPS)
  1522. #if !Z2_USE_ENDSTOP
  1523. #error "You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS."
  1524. #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1525. #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_."
  1526. #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1527. #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_."
  1528. #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1529. #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_."
  1530. #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1531. #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_."
  1532. #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1533. #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_."
  1534. #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1535. #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_."
  1536. #elif !HAS_Z2_MIN && !HAS_Z2_MAX
  1537. #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1538. #elif ENABLED(DELTA)
  1539. #error "Z_DUAL_ENDSTOPS is not compatible with DELTA."
  1540. #endif
  1541. #endif
  1542. #if ENABLED(Z_TRIPLE_ENDSTOPS)
  1543. #if !Z2_USE_ENDSTOP
  1544. #error "You must set Z2_USE_ENDSTOP with Z_TRIPLE_ENDSTOPS."
  1545. #elif Z2_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1546. #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _XMIN_."
  1547. #elif Z2_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1548. #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _XMAX_."
  1549. #elif Z2_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1550. #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _YMIN_."
  1551. #elif Z2_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1552. #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _YMAX_."
  1553. #elif Z2_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1554. #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _ZMIN_."
  1555. #elif Z2_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1556. #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _ZMAX_."
  1557. #elif !HAS_Z2_MIN && !HAS_Z2_MAX
  1558. #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1559. #elif ENABLED(DELTA)
  1560. #error "Z_TRIPLE_ENDSTOPS is not compatible with DELTA."
  1561. #endif
  1562. #if !Z3_USE_ENDSTOP
  1563. #error "You must set Z3_USE_ENDSTOP with Z_TRIPLE_ENDSTOPS."
  1564. #elif Z3_USE_ENDSTOP == _XMIN_ && DISABLED(USE_XMIN_PLUG)
  1565. #error "USE_XMIN_PLUG is required when Z3_USE_ENDSTOP is _XMIN_."
  1566. #elif Z3_USE_ENDSTOP == _XMAX_ && DISABLED(USE_XMAX_PLUG)
  1567. #error "USE_XMAX_PLUG is required when Z3_USE_ENDSTOP is _XMAX_."
  1568. #elif Z3_USE_ENDSTOP == _YMIN_ && DISABLED(USE_YMIN_PLUG)
  1569. #error "USE_YMIN_PLUG is required when Z3_USE_ENDSTOP is _YMIN_."
  1570. #elif Z3_USE_ENDSTOP == _YMAX_ && DISABLED(USE_YMAX_PLUG)
  1571. #error "USE_YMAX_PLUG is required when Z3_USE_ENDSTOP is _YMAX_."
  1572. #elif Z3_USE_ENDSTOP == _ZMIN_ && DISABLED(USE_ZMIN_PLUG)
  1573. #error "USE_ZMIN_PLUG is required when Z3_USE_ENDSTOP is _ZMIN_."
  1574. #elif Z3_USE_ENDSTOP == _ZMAX_ && DISABLED(USE_ZMAX_PLUG)
  1575. #error "USE_ZMAX_PLUG is required when Z3_USE_ENDSTOP is _ZMAX_."
  1576. #elif !HAS_Z3_MIN && !HAS_Z3_MAX
  1577. #error "Z3_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1578. #elif ENABLED(DELTA)
  1579. #error "Z_TRIPLE_ENDSTOPS is not compatible with DELTA."
  1580. #endif
  1581. #endif
  1582. #if defined(ENDSTOP_NOISE_THRESHOLD) && !WITHIN(ENDSTOP_NOISE_THRESHOLD, 2, 7)
  1583. #error "ENDSTOP_NOISE_THRESHOLD must be an integer from 2 to 7."
  1584. #endif
  1585. /**
  1586. * emergency-command parser
  1587. */
  1588. #if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON)
  1589. #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
  1590. #endif
  1591. /**
  1592. * I2C bus
  1593. */
  1594. #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0
  1595. #if I2C_SLAVE_ADDRESS < 8
  1596. #error "I2C_SLAVE_ADDRESS can't be less than 8. (Addresses 0 - 7 are reserved.)"
  1597. #elif I2C_SLAVE_ADDRESS > 127
  1598. #error "I2C_SLAVE_ADDRESS can't be over 127. (Only 7 bits allowed.)"
  1599. #endif
  1600. #endif
  1601. /**
  1602. * G38 Probe Target
  1603. */
  1604. #if ENABLED(G38_PROBE_TARGET)
  1605. #if !HAS_BED_PROBE
  1606. #error "G38_PROBE_TARGET requires a bed probe."
  1607. #elif !IS_CARTESIAN
  1608. #error "G38_PROBE_TARGET requires a Cartesian machine."
  1609. #endif
  1610. #endif
  1611. /**
  1612. * RGB_LED Requirements
  1613. */
  1614. #define _RGB_TEST (PIN_EXISTS(RGB_LED_R, RGB_LED_G, RGB_LED_B))
  1615. #if ENABLED(PRINTER_EVENT_LEDS) && !HAS_COLOR_LEDS
  1616. #error "PRINTER_EVENT_LEDS requires BLINKM, PCA9533, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED."
  1617. #elif ENABLED(RGB_LED)
  1618. #if !_RGB_TEST
  1619. #error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN."
  1620. #elif ENABLED(RGBW_LED)
  1621. #error "Please enable only one of RGB_LED and RGBW_LED."
  1622. #endif
  1623. #elif ENABLED(RGBW_LED)
  1624. #if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W))
  1625. #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN."
  1626. #endif
  1627. #elif ENABLED(NEOPIXEL_LED)
  1628. #if !(PIN_EXISTS(NEOPIXEL) && NEOPIXEL_PIXELS > 0)
  1629. #error "NEOPIXEL_LED requires NEOPIXEL_PIN and NEOPIXEL_PIXELS."
  1630. #endif
  1631. #endif
  1632. #undef _RGB_TEST
  1633. /**
  1634. * Auto Fan check for PWM pins
  1635. */
  1636. #if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255
  1637. #define AF_ERR_SUFF "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255."
  1638. #if HAS_AUTO_FAN_0
  1639. static_assert(PWM_PIN(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF);
  1640. #elif HAS_AUTO_FAN_1
  1641. static_assert(PWM_PIN(E1_AUTO_FAN_PIN), "E1" AF_ERR_SUFF);
  1642. #elif HAS_AUTO_FAN_2
  1643. static_assert(PWM_PIN(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF);
  1644. #elif HAS_AUTO_FAN_3
  1645. static_assert(PWM_PIN(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF);
  1646. #endif
  1647. #endif
  1648. /**
  1649. * Make sure only one display is enabled
  1650. *
  1651. * Note: BQ_LCD_SMART_CONTROLLER => REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  1652. * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER => REPRAP_DISCOUNT_SMART_CONTROLLER
  1653. * SAV_3DGLCD => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
  1654. * MKS_12864OLED => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
  1655. * MKS_12864OLED_SSD1306 => U8GLIB_SSD1306 => ULTIMAKERCONTROLLER
  1656. * MKS_MINI_12864 => MINIPANEL
  1657. * miniVIKI => ULTIMAKERCONTROLLER
  1658. * VIKI2 => ULTIMAKERCONTROLLER
  1659. * ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER
  1660. * AZSMZ_12864 => ULTIMAKERCONTROLLER
  1661. * PANEL_ONE => ULTIMAKERCONTROLLER
  1662. */
  1663. #if 1 < 0 \
  1664. + ( ENABLED(ULTIMAKERCONTROLLER) \
  1665. && DISABLED(SAV_3DGLCD) \
  1666. && DISABLED(miniVIKI) \
  1667. && DISABLED(VIKI2) \
  1668. && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  1669. && DISABLED(AZSMZ_12864) \
  1670. && DISABLED(PANEL_ONE) \
  1671. && DISABLED(MKS_12864OLED) \
  1672. && DISABLED(MKS_12864OLED_SSD1306) ) \
  1673. + ( ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
  1674. && DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
  1675. && DISABLED(LCD_FOR_MELZI) \
  1676. && DISABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
  1677. && DISABLED(MKS_12864OLED) \
  1678. && DISABLED(MKS_12864OLED_SSD1306) ) \
  1679. + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(BQ_LCD_SMART_CONTROLLER)) \
  1680. + ENABLED(LCD_FOR_MELZI) \
  1681. + ENABLED(MALYAN_LCD) \
  1682. + ENABLED(MKS_12864OLED) \
  1683. + ENABLED(MKS_12864OLED_SSD1306) \
  1684. + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
  1685. + ENABLED(CARTESIO_UI) \
  1686. + ENABLED(PANEL_ONE) \
  1687. + ENABLED(MAKRPANEL) \
  1688. + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \
  1689. + ENABLED(VIKI2) \
  1690. + ENABLED(miniVIKI) \
  1691. + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  1692. + ENABLED(AZSMZ_12864) \
  1693. + ENABLED(G3D_PANEL) \
  1694. + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \
  1695. + ENABLED(MKS_MINI_12864) \
  1696. + ENABLED(FYSETC_MINI_12864_1_2) \
  1697. + ENABLED(FYSETC_MINI_12864_2_0) \
  1698. + ENABLED(FYSETC_MINI_12864_2_1) \
  1699. + (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(CARTESIO_UI, ZONESTAR_LCD)) \
  1700. + ENABLED(RIGIDBOT_PANEL) \
  1701. + ENABLED(RA_CONTROL_PANEL) \
  1702. + ENABLED(LCD_SAINSMART_I2C_1602) \
  1703. + ENABLED(LCD_SAINSMART_I2C_2004) \
  1704. + ENABLED(LCM1602) \
  1705. + ENABLED(LCD_I2C_PANELOLU2) \
  1706. + ENABLED(LCD_I2C_VIKI) \
  1707. + (ENABLED(U8GLIB_SSD1306) && DISABLED(OLED_PANEL_TINYBOY2, MKS_12864OLED_SSD1306)) \
  1708. + ENABLED(SAV_3DLCD) \
  1709. + ENABLED(BQ_LCD_SMART_CONTROLLER) \
  1710. + ENABLED(SAV_3DGLCD) \
  1711. + ENABLED(OLED_PANEL_TINYBOY2) \
  1712. + ENABLED(ZONESTAR_LCD) \
  1713. + ENABLED(ULTI_CONTROLLER) \
  1714. + (ENABLED(EXTENSIBLE_UI) && DISABLED(MALYAN_LCD))
  1715. #error "Please select no more than one LCD controller option."
  1716. #endif
  1717. /**
  1718. * FYSETC Mini 12864 RGB backlighting required
  1719. */
  1720. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED)
  1721. #error "RGB_LED is required for FYSETC_MINI_12864 1.2 and 2.0."
  1722. #elif EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && DISABLED(LED_USER_PRESET_STARTUP)
  1723. #error "LED_USER_PRESET_STARTUP is required for FYSETC_MINI_12864 2.x displays."
  1724. #endif
  1725. /**
  1726. * Check existing CS pins against enabled TMC SPI drivers.
  1727. */
  1728. #define INVALID_TMC2130(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) && !PIN_EXISTS(ST##_CS))
  1729. #if INVALID_TMC2130(X)
  1730. #error "TMC2130 on X requires X_CS_PIN."
  1731. #elif INVALID_TMC2130(X2)
  1732. #error "TMC2130 on X2 requires X2_CS_PIN."
  1733. #elif INVALID_TMC2130(Y)
  1734. #error "TMC2130 on Y requires Y_CS_PIN."
  1735. #elif INVALID_TMC2130(Y2)
  1736. #error "TMC2130 on Y2 requires Y2_CS_PIN."
  1737. #elif INVALID_TMC2130(Z)
  1738. #error "TMC2130 on Z requires Z_CS_PIN."
  1739. #elif INVALID_TMC2130(Z2)
  1740. #error "TMC2130 on Z2 requires Z2_CS_PIN."
  1741. #elif INVALID_TMC2130(Z3)
  1742. #error "TMC2130 on Z3 requires Z3_CS_PIN."
  1743. #elif INVALID_TMC2130(E0)
  1744. #error "TMC2130 on E0 requires E0_CS_PIN."
  1745. #elif INVALID_TMC2130(E1)
  1746. #error "TMC2130 on E1 requires E1_CS_PIN."
  1747. #elif INVALID_TMC2130(E2)
  1748. #error "TMC2130 on E2 requires E2_CS_PIN."
  1749. #elif INVALID_TMC2130(E3)
  1750. #error "TMC2130 on E3 requires E3_CS_PIN."
  1751. #elif INVALID_TMC2130(E4)
  1752. #error "TMC2130 on E4 requires E4_CS_PIN."
  1753. #elif INVALID_TMC2130(E5)
  1754. #error "TMC2130 on E5 requires E5_CS_PIN."
  1755. #endif
  1756. #undef INVALID_TMC2130
  1757. /**
  1758. * Check existing RX/TX pins against enable TMC UART drivers.
  1759. */
  1760. #define INVALID_TMC2208(ST) (AXIS_DRIVER_TYPE(ST, TMC2208) && !(defined(ST##_HARDWARE_SERIAL) || (PIN_EXISTS(ST##_SERIAL_RX, ST##_SERIAL_TX))))
  1761. #if INVALID_TMC2208(X)
  1762. #error "TMC2208 on X requires X_HARDWARE_SERIAL or X_SERIAL_(RX|TX)_PIN."
  1763. #elif INVALID_TMC2208(X2)
  1764. #error "TMC2208 on X2 requires X2_HARDWARE_SERIAL or X2_SERIAL_(RX|TX)_PIN."
  1765. #elif INVALID_TMC2208(Y)
  1766. #error "TMC2208 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL_(RX|TX)_PIN."
  1767. #elif INVALID_TMC2208(Y2)
  1768. #error "TMC2208 on Y2 requires Y2_HARDWARE_SERIAL or Y2_SERIAL_(RX|TX)_PIN."
  1769. #elif INVALID_TMC2208(Z)
  1770. #error "TMC2208 on Z requires Z_HARDWARE_SERIAL or Z_SERIAL_(RX|TX)_PIN."
  1771. #elif INVALID_TMC2208(Z2)
  1772. #error "TMC2208 on Z2 requires Z2_HARDWARE_SERIAL or Z2_SERIAL_(RX|TX)_PIN."
  1773. #elif INVALID_TMC2208(Z3)
  1774. #error "TMC2208 on Z3 requires Z3_HARDWARE_SERIAL or Z3_SERIAL_(RX|TX)_PIN."
  1775. #elif INVALID_TMC2208(E0)
  1776. #error "TMC2208 on E0 requires E0_HARDWARE_SERIAL or E0_SERIAL_(RX|TX)_PIN."
  1777. #elif INVALID_TMC2208(E1)
  1778. #error "TMC2208 on E1 requires E1_HARDWARE_SERIAL or E1_SERIAL_(RX|TX)_PIN."
  1779. #elif INVALID_TMC2208(E2)
  1780. #error "TMC2208 on E2 requires E2_HARDWARE_SERIAL or E2_SERIAL_(RX|TX)_PIN."
  1781. #elif INVALID_TMC2208(E3)
  1782. #error "TMC2208 on E3 requires E3_HARDWARE_SERIAL or E3_SERIAL_(RX|TX)_PIN."
  1783. #elif INVALID_TMC2208(E4)
  1784. #error "TMC2208 on E4 requires E4_HARDWARE_SERIAL or E4_SERIAL_(RX|TX)_PIN."
  1785. #elif INVALID_TMC2208(E5)
  1786. #error "TMC2208 on E5 requires E5_HARDWARE_SERIAL or E5_SERIAL_(RX|TX)_PIN."
  1787. #endif
  1788. #undef INVALID_TMC2208
  1789. /**
  1790. * TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI)
  1791. */
  1792. #if HAS_DRIVER(TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \
  1793. defined(X_HARDWARE_SERIAL ) \
  1794. || defined(X2_HARDWARE_SERIAL) \
  1795. || defined(Y_HARDWARE_SERIAL ) \
  1796. || defined(Y2_HARDWARE_SERIAL) \
  1797. || defined(Z_HARDWARE_SERIAL ) \
  1798. || defined(Z2_HARDWARE_SERIAL) \
  1799. || defined(Z3_HARDWARE_SERIAL) \
  1800. || defined(E0_HARDWARE_SERIAL) \
  1801. || defined(E1_HARDWARE_SERIAL) \
  1802. || defined(E2_HARDWARE_SERIAL) \
  1803. || defined(E3_HARDWARE_SERIAL) \
  1804. || defined(E4_HARDWARE_SERIAL) \
  1805. || defined(E5_HARDWARE_SERIAL) )
  1806. #error "Select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE."
  1807. #endif
  1808. /**
  1809. * TMC2208 software UART is only supported on AVR
  1810. */
  1811. #if HAS_DRIVER(TMC2208) && !defined(__AVR__) && !defined(TARGET_LPC1768) && !( \
  1812. defined(X_HARDWARE_SERIAL ) \
  1813. || defined(X2_HARDWARE_SERIAL) \
  1814. || defined(Y_HARDWARE_SERIAL ) \
  1815. || defined(Y2_HARDWARE_SERIAL) \
  1816. || defined(Z_HARDWARE_SERIAL ) \
  1817. || defined(Z2_HARDWARE_SERIAL) \
  1818. || defined(E0_HARDWARE_SERIAL) \
  1819. || defined(E1_HARDWARE_SERIAL) \
  1820. || defined(E2_HARDWARE_SERIAL) \
  1821. || defined(E3_HARDWARE_SERIAL) \
  1822. || defined(E4_HARDWARE_SERIAL) \
  1823. || defined(E5_HARDWARE_SERIAL) )
  1824. #error "TMC2208 Software Serial is supported only on AVR and LPC1768 platforms."
  1825. #endif
  1826. #if ENABLED(SENSORLESS_HOMING)
  1827. // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop
  1828. // is necessary in order to reset the stallGuard indication between the initial movement of all three
  1829. // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of
  1830. // clearing the stallGuard activated status is found.
  1831. #if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z)
  1832. #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z."
  1833. #elif X_SENSORLESS && X_HOME_DIR == -1 && (!X_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMIN))
  1834. #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMIN when homing to X_MIN."
  1835. #elif X_SENSORLESS && X_HOME_DIR == 1 && (!X_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMAX))
  1836. #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMAX when homing to X_MAX."
  1837. #elif Y_SENSORLESS && Y_HOME_DIR == -1 && (!Y_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMIN))
  1838. #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMIN when homing to Y_MIN."
  1839. #elif Y_SENSORLESS && Y_HOME_DIR == 1 && (!Y_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMAX))
  1840. #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMAX when homing to Y_MAX."
  1841. #elif Z_SENSORLESS && Z_HOME_DIR == -1 && (!Z_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMIN))
  1842. #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMIN when homing to Z_MIN."
  1843. #elif Z_SENSORLESS && Z_HOME_DIR == 1 && (!Z_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMAX))
  1844. #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMAX when homing to Z_MAX."
  1845. #elif ENDSTOP_NOISE_THRESHOLD
  1846. #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD."
  1847. #elif !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS)
  1848. #error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, or Z axes."
  1849. #endif
  1850. #endif
  1851. // Sensorless probing requirements
  1852. #if ENABLED(SENSORLESS_PROBING)
  1853. #if ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS)
  1854. #error "SENSORLESS_PROBING for DELTA requires TMC stepper drivers with StallGuard on X, Y, and Z axes."
  1855. #elif !Z_SENSORLESS
  1856. #error "SENSORLESS_PROBING requires a TMC stepper driver with StallGuard on Z."
  1857. #endif
  1858. #endif
  1859. // Sensorless homing is required for both combined steppers in an H-bot
  1860. #if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS
  1861. #error "CoreXY requires both X and Y to use sensorless homing if either does."
  1862. #elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS
  1863. #error "CoreXZ requires both X and Z to use sensorless homing if either does."
  1864. #elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS
  1865. #error "CoreYZ requires both Y and Z to use sensorless homing if either does."
  1866. #endif
  1867. // Other TMC feature requirements
  1868. #if ENABLED(HYBRID_THRESHOLD) && !STEALTHCHOP_ENABLED
  1869. #error "Enable STEALTHCHOP_(XY|Z|E) to use HYBRID_THRESHOLD."
  1870. #elif ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD
  1871. #error "SENSORLESS_HOMING requires TMC2130 or TMC2160 or TMC5160 stepper drivers."
  1872. #elif ENABLED(SENSORLESS_PROBING) && !HAS_STALLGUARD
  1873. #error "SENSORLESS_PROBING requires TMC2130 stepper drivers."
  1874. #elif STEALTHCHOP_ENABLED && !HAS_STEALTHCHOP
  1875. #error "STEALTHCHOP requires TMC2130 or TMC2160 or TMC2208 or TMC5160 stepper drivers."
  1876. #endif
  1877. #if ENABLED(DELTA) && (ENABLED(STEALTHCHOP_XY) != ENABLED(STEALTHCHOP_Z))
  1878. #error "STEALTHCHOP_XY and STEALTHCHOP_Z must be the same on DELTA."
  1879. #endif
  1880. /**
  1881. * Digipot requirement
  1882. */
  1883. #if ENABLED(DIGIPOT_MCP4018)
  1884. #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
  1885. || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)
  1886. #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined."
  1887. #endif
  1888. #endif
  1889. /**
  1890. * Check per-axis initializers for errors
  1891. */
  1892. constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT,
  1893. sanity_arr_2[] = DEFAULT_MAX_FEEDRATE,
  1894. sanity_arr_3[] = DEFAULT_MAX_ACCELERATION;
  1895. #define _ARR_TEST(N,I) (sanity_arr_##N[MIN(I,int(COUNT(sanity_arr_##N))-1)] > 0)
  1896. static_assert(COUNT(sanity_arr_1) >= XYZE, "DEFAULT_AXIS_STEPS_PER_UNIT requires X, Y, Z and E elements.");
  1897. 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?)");
  1898. static_assert( _ARR_TEST(1,0) && _ARR_TEST(1,1) && _ARR_TEST(1,2)
  1899. && _ARR_TEST(1,3) && _ARR_TEST(1,4) && _ARR_TEST(1,5)
  1900. && _ARR_TEST(1,6) && _ARR_TEST(1,7) && _ARR_TEST(1,8),
  1901. "DEFAULT_AXIS_STEPS_PER_UNIT values must be positive.");
  1902. static_assert(COUNT(sanity_arr_2) >= XYZE, "DEFAULT_MAX_FEEDRATE requires X, Y, Z and E elements.");
  1903. static_assert(COUNT(sanity_arr_2) <= XYZE_N, "DEFAULT_MAX_FEEDRATE has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)");
  1904. static_assert( _ARR_TEST(2,0) && _ARR_TEST(2,1) && _ARR_TEST(2,2)
  1905. && _ARR_TEST(2,3) && _ARR_TEST(2,4) && _ARR_TEST(2,5)
  1906. && _ARR_TEST(2,6) && _ARR_TEST(2,7) && _ARR_TEST(2,8),
  1907. "DEFAULT_MAX_FEEDRATE values must be positive.");
  1908. static_assert(COUNT(sanity_arr_3) >= XYZE, "DEFAULT_MAX_ACCELERATION requires X, Y, Z and E elements.");
  1909. static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)");
  1910. static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
  1911. && _ARR_TEST(3,3) && _ARR_TEST(3,4) && _ARR_TEST(3,5)
  1912. && _ARR_TEST(3,6) && _ARR_TEST(3,7) && _ARR_TEST(3,8),
  1913. "DEFAULT_MAX_ACCELERATION values must be positive.");
  1914. #undef _ARR_TEST
  1915. #if BOTH(CNC_COORDINATE_SYSTEMS, NO_WORKSPACE_OFFSETS)
  1916. #error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS."
  1917. #endif
  1918. #if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE)
  1919. #error "BLOCK_BUFFER_SIZE must be a power of 2."
  1920. #endif
  1921. #if ENABLED(LED_CONTROL_MENU) && DISABLED(ULTIPANEL)
  1922. #error "LED_CONTROL_MENU requires an LCD controller."
  1923. #endif
  1924. #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED)
  1925. #error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED."
  1926. #endif
  1927. #if ENABLED(SKEW_CORRECTION)
  1928. #if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD))
  1929. #error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD."
  1930. #endif
  1931. #if ENABLED(SKEW_CORRECTION_FOR_Z)
  1932. #if !defined(XZ_SKEW_FACTOR) && !(defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD))
  1933. #error "SKEW_CORRECTION requires XZ_SKEW_FACTOR or XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD."
  1934. #endif
  1935. #if !defined(YZ_SKEW_FACTOR) && !(defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD))
  1936. #error "SKEW_CORRECTION requires YZ_SKEW_FACTOR or YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD."
  1937. #endif
  1938. #endif
  1939. #endif
  1940. #if ENABLED(POWER_LOSS_RECOVERY) && DISABLED(ULTIPANEL)
  1941. #error "POWER_LOSS_RECOVERY currently requires an LCD Controller."
  1942. #endif
  1943. #if ENABLED(Z_STEPPER_AUTO_ALIGN)
  1944. #if !Z_MULTI_STEPPER_DRIVERS
  1945. #error "Z_STEPPER_AUTO_ALIGN requires Z_DUAL_STEPPER_DRIVERS or Z_TRIPLE_STEPPER_DRIVERS."
  1946. #elif !HAS_BED_PROBE
  1947. #error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe."
  1948. #endif
  1949. constexpr float sanity_arr_z_align_x[] = Z_STEPPER_ALIGN_X, sanity_arr_z_align_y[] = Z_STEPPER_ALIGN_Y;
  1950. static_assert(
  1951. COUNT(sanity_arr_z_align_x) == Z_STEPPER_COUNT && COUNT(sanity_arr_z_align_y) == Z_STEPPER_COUNT,
  1952. "Z_STEPPER_ALIGN_[XY]POS settings require one element per Z stepper."
  1953. );
  1954. #endif
  1955. #if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS)
  1956. #error "PRINTCOUNTER requires EEPROM_SETTINGS. Please update your Configuration."
  1957. #endif
  1958. #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && !PIN_EXISTS(USB_CS, USB_INTR)
  1959. #error "USB_CS_PIN and USB_INTR_PIN are required for USB_FLASH_DRIVE_SUPPORT."
  1960. #endif
  1961. #if ENABLED(SD_FIRMWARE_UPDATE) && !defined(__AVR_ATmega2560__)
  1962. #error "SD_FIRMWARE_UPDATE requires an ATmega2560-based (Arduino Mega) board."
  1963. #endif
  1964. #if ENABLED(GCODE_MACROS) && !WITHIN(GCODE_MACROS_SLOTS, 1, 10)
  1965. #error "GCODE_MACROS_SLOTS must be a number from 1 to 10."
  1966. #endif
  1967. #if ENABLED(CUSTOM_USER_MENUS)
  1968. #ifdef USER_GCODE_1
  1969. constexpr char _chr1 = USER_GCODE_1[strlen(USER_GCODE_1) - 1];
  1970. static_assert(_chr1 != '\n' && _chr1 != '\r', "USER_GCODE_1 cannot have a newline at the end. Please remove it.");
  1971. #endif
  1972. #ifdef USER_GCODE_2
  1973. constexpr char _chr2 = USER_GCODE_2[strlen(USER_GCODE_2) - 1];
  1974. static_assert(_chr2 != '\n' && _chr2 != '\r', "USER_GCODE_2 cannot have a newline at the end. Please remove it.");
  1975. #endif
  1976. #ifdef USER_GCODE_3
  1977. constexpr char _chr3 = USER_GCODE_3[strlen(USER_GCODE_3) - 1];
  1978. static_assert(_chr3 != '\n' && _chr3 != '\r', "USER_GCODE_3 cannot have a newline at the end. Please remove it.");
  1979. #endif
  1980. #ifdef USER_GCODE_4
  1981. constexpr char _chr4 = USER_GCODE_4[strlen(USER_GCODE_4) - 1];
  1982. static_assert(_chr4 != '\n' && _chr4 != '\r', "USER_GCODE_4 cannot have a newline at the end. Please remove it.");
  1983. #endif
  1984. #ifdef USER_GCODE_5
  1985. constexpr char _chr5 = USER_GCODE_5[strlen(USER_GCODE_5) - 1];
  1986. static_assert(_chr5 != '\n' && _chr5 != '\r', "USER_GCODE_5 cannot have a newline at the end. Please remove it.");
  1987. #endif
  1988. #endif
  1989. #if ENABLED(BACKLASH_COMPENSATION) && IS_CORE
  1990. #error "BACKLASH_COMPENSATION is incompatible with CORE kinematics."
  1991. #endif
  1992. #if ENABLED(GRADIENT_MIX) && MIXING_VIRTUAL_TOOLS < 2
  1993. #error "GRADIENT_MIX requires 2 or more MIXING_VIRTUAL_TOOLS."
  1994. #endif
  1995. /**
  1996. * Photo G-code requirements
  1997. */
  1998. #if ENABLED(PHOTO_GCODE)
  1999. #if (PIN_EXISTS(CHDK) + PIN_EXISTS(PHOTOGRAPH_PIN) + defined(PHOTO_SWITCH_POSITION)) > 1
  2000. #error "Please define only one of CHDK_PIN, PHOTOGRAPH_PIN, or PHOTO_SWITCH_POSITION."
  2001. #elif defined(PHOTO_SWITCH_POSITION) && !defined(PHOTO_POSITION)
  2002. #error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION. Please update your Configuration_adv.h."
  2003. #elif PIN_EXISTS(CHDK) && defined(CHDK_DELAY)
  2004. #error "CHDK_DELAY has been replaced by PHOTO_SWITCH_MS. Please update your Configuration_adv.h."
  2005. #elif PIN_EXISTS(CHDK) && !defined(PHOTO_SWITCH_MS)
  2006. #error "PHOTO_SWITCH_MS is required with CHDK_PIN. Please update your Configuration_adv.h."
  2007. #elif defined(PHOTO_RETRACT_MM)
  2008. static_assert(PHOTO_RETRACT_MM + 0 >= 0, "PHOTO_RETRACT_MM must be >= 0.");
  2009. #endif
  2010. #endif
  2011. /**
  2012. * Prusa MMU2 requirements
  2013. */
  2014. #if ENABLED(PRUSA_MMU2)
  2015. #if DISABLED(NOZZLE_PARK_FEATURE)
  2016. #error "PRUSA_MMU2 requires NOZZLE_PARK_FEATURE."
  2017. #elif EXTRUDERS != 5
  2018. #error "PRUSA_MMU2 requires EXTRUDERS = 5."
  2019. #elif DISABLED(ADVANCED_PAUSE_FEATURE)
  2020. static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2.");
  2021. #endif
  2022. #endif
  2023. /**
  2024. * Advanced PRINTCOUNTER settings
  2025. */
  2026. #if ENABLED(PRINTCOUNTER)
  2027. #if defined(SERVICE_INTERVAL_1) != defined(SERVICE_NAME_1)
  2028. #error "Both SERVICE_NAME_1 and SERVICE_INTERVAL_1 are required."
  2029. #elif defined(SERVICE_INTERVAL_2) != defined(SERVICE_NAME_2)
  2030. #error "Both SERVICE_NAME_2 and SERVICE_INTERVAL_2 are required."
  2031. #elif defined(SERVICE_INTERVAL_3) != defined(SERVICE_NAME_3)
  2032. #error "Both SERVICE_NAME_3 and SERVICE_INTERVAL_3 are required."
  2033. #endif
  2034. #endif
  2035. /**
  2036. * Require soft endstops for certain setups
  2037. */
  2038. #if DISABLED(MIN_SOFTWARE_ENDSTOPS) || DISABLED(MAX_SOFTWARE_ENDSTOPS)
  2039. #if ENABLED(DUAL_X_CARRIAGE)
  2040. #error "DUAL_X_CARRIAGE requires both MIN_ and MAX_SOFTWARE_ENDSTOPS."
  2041. #elif HAS_HOTEND_OFFSET
  2042. #error "MIN_ and MAX_SOFTWARE_ENDSTOPS are both required with offset hotends."
  2043. #endif
  2044. #endif