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

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