My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

SanityCheck.h 70KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 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. /**
  23. * SanityCheck.h
  24. *
  25. * Test configuration values for errors at compile-time.
  26. */
  27. #ifndef _SANITYCHECK_H_
  28. #define _SANITYCHECK_H_
  29. /**
  30. * Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features.
  31. */
  32. #if __cplusplus < 201103L
  33. #error "Marlin requires C++11 support (gcc >= 4.7, Arduino IDE >= 1.6.8). Please upgrade your toolchain."
  34. #endif
  35. /**
  36. * We try our best to include sanity checks for all changed configuration
  37. * directives because users have a tendency to use outdated config files with
  38. * the bleeding-edge source code, but sometimes this is not enough. This check
  39. * forces a minimum config file revision. Otherwise Marlin will not build.
  40. */
  41. #if !defined(CONFIGURATION_H_VERSION) || CONFIGURATION_H_VERSION < 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) || CONFIGURATION_ADV_H_VERSION < 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. #if !defined(X_BED_SIZE) || !defined(Y_BED_SIZE)
  51. #error "X_BED_SIZE and Y_BED_SIZE are now required! Please update your configuration."
  52. #elif WATCH_TEMP_PERIOD > 500
  53. #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds."
  54. #elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
  55. #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS."
  56. #elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
  57. #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED."
  58. #elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE)
  59. #error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY."
  60. #elif defined(X_HOME_RETRACT_MM)
  61. #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM."
  62. #elif defined(SDCARDDETECTINVERTED)
  63. #error "SDCARDDETECTINVERTED is now SD_DETECT_INVERTED. Please update your configuration."
  64. #elif defined(BTENABLED)
  65. #error "BTENABLED is now BLUETOOTH. Please update your configuration."
  66. #elif defined(CUSTOM_MENDEL_NAME)
  67. #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration."
  68. #elif defined(HAS_AUTOMATIC_VERSIONING)
  69. #error "HAS_AUTOMATIC_VERSIONING is now USE_AUTOMATIC_VERSIONING. Please update your configuration."
  70. #elif defined(SDSLOW)
  71. #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead."
  72. #elif defined(SDEXTRASLOW)
  73. #error "SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead."
  74. #elif defined(FILAMENT_SENSOR)
  75. #error "FILAMENT_SENSOR is now FILAMENT_WIDTH_SENSOR. Please update your configuration."
  76. #elif defined(ENDSTOPPULLUP_FIL_RUNOUT)
  77. #error "ENDSTOPPULLUP_FIL_RUNOUT is now FIL_RUNOUT_PULLUP. Please update your configuration."
  78. #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
  79. #error "DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead."
  80. #elif defined(LANGUAGE_INCLUDE)
  81. #error "LANGUAGE_INCLUDE has been replaced by LCD_LANGUAGE. Please update your configuration."
  82. #elif defined(EXTRUDER_OFFSET_X) || defined(EXTRUDER_OFFSET_Y)
  83. #error "EXTRUDER_OFFSET_[XY] is deprecated. Use HOTEND_OFFSET_[XY] instead."
  84. #elif defined(PID_PARAMS_PER_EXTRUDER)
  85. #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead."
  86. #elif defined(EXTRUDER_WATTS) || defined(BED_WATTS)
  87. #error "EXTRUDER_WATTS and BED_WATTS are deprecated. Remove them from your configuration."
  88. #elif defined(SERVO_ENDSTOP_ANGLES)
  89. #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
  90. #elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
  91. #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
  92. #elif defined(Z_ENDSTOP_SERVO_NR)
  93. #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR. Please update your configuration."
  94. #elif defined(DEFAULT_XYJERK)
  95. #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead."
  96. #elif ENABLED(BEZIER_JERK_CONTROL) && !defined(CPU_32_BIT)
  97. #error "BEZIER_JERK_CONTROL is computationally intensive and requires a 32-bit board."
  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_EXTRUDE_FEEDRATE. Please update your configuration."
  130. #elif defined(FILAMENT_CHANGE_EXTRUDE_LENGTH)
  131. #error "FILAMENT_CHANGE_EXTRUDE_LENGTH is now ADVANCED_PAUSE_EXTRUDE_LENGTH. Please update your configuration."
  132. #elif defined(FILAMENT_CHANGE_NOZZLE_TIMEOUT)
  133. #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT. Please update your configuration."
  134. #elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS)
  135. #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS. Please update your configuration."
  136. #elif ENABLED(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
  137. #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT. Please update your configuration."
  138. #elif defined(PLA_PREHEAT_HOTEND_TEMP)
  139. #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration."
  140. #elif defined(PLA_PREHEAT_HPB_TEMP)
  141. #error "PLA_PREHEAT_HPB_TEMP is now PREHEAT_1_TEMP_BED. Please update your configuration."
  142. #elif defined(PLA_PREHEAT_FAN_SPEED)
  143. #error "PLA_PREHEAT_FAN_SPEED is now PREHEAT_1_FAN_SPEED. Please update your configuration."
  144. #elif defined(ABS_PREHEAT_HOTEND_TEMP)
  145. #error "ABS_PREHEAT_HOTEND_TEMP is now PREHEAT_2_TEMP_HOTEND. Please update your configuration."
  146. #elif defined(ABS_PREHEAT_HPB_TEMP)
  147. #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration."
  148. #elif defined(ABS_PREHEAT_FAN_SPEED)
  149. #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration."
  150. #elif defined(ENDSTOPS_ONLY_FOR_HOMING)
  151. #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead."
  152. #elif defined(HOMING_FEEDRATE)
  153. #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead."
  154. #elif defined(MANUAL_HOME_POSITIONS)
  155. #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead."
  156. #elif defined(PID_ADD_EXTRUSION_RATE)
  157. #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."
  158. #elif defined(Z_RAISE_BEFORE_HOMING)
  159. #error "Z_RAISE_BEFORE_HOMING is now Z_HOMING_HEIGHT. Please update your configuration."
  160. #elif defined(MIN_Z_HEIGHT_FOR_HOMING)
  161. #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT. Please update your configuration."
  162. #elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING)
  163. #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead."
  164. #elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS)
  165. #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."
  166. #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT)
  167. #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."
  168. #elif defined(MANUAL_BED_LEVELING)
  169. #error "MANUAL_BED_LEVELING is now LCD_BED_LEVELING. Please update your configuration."
  170. #elif defined(MESH_HOME_SEARCH_Z)
  171. #error "MESH_HOME_SEARCH_Z is now LCD_PROBE_Z_RANGE. Please update your configuration."
  172. #elif defined(MANUAL_PROBE_Z_RANGE)
  173. #error "MANUAL_PROBE_Z_RANGE is now LCD_PROBE_Z_RANGE. Please update your configuration."
  174. #elif !defined(MIN_STEPS_PER_SEGMENT)
  175. #error Please replace "const int dropsegments" with "#define MIN_STEPS_PER_SEGMENT" (and increase by 1) in Configuration_adv.h.
  176. #elif defined(PREVENT_DANGEROUS_EXTRUDE)
  177. #error "PREVENT_DANGEROUS_EXTRUDE is now PREVENT_COLD_EXTRUSION. Please update your configuration."
  178. #elif defined(SCARA)
  179. #error "SCARA is now MORGAN_SCARA. Please update your configuration."
  180. #elif defined(ENABLE_AUTO_BED_LEVELING)
  181. #error "ENABLE_AUTO_BED_LEVELING is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
  182. #elif defined(AUTO_BED_LEVELING_FEATURE)
  183. #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
  184. #elif defined(ABL_GRID_POINTS)
  185. #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y. Please update your configuration."
  186. #elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y)
  187. #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration."
  188. #elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y)
  189. #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration."
  190. #elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS)
  191. #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration."
  192. #elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS)
  193. #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration."
  194. #elif defined(UBL_G26_MESH_VALIDATION)
  195. #error "UBL_G26_MESH_VALIDATION is now G26_MESH_VALIDATION. Please update your configuration."
  196. #elif defined(UBL_MESH_EDIT_ENABLED)
  197. #error "UBL_MESH_EDIT_ENABLED is now G26_MESH_VALIDATION. Please update your configuration."
  198. #elif defined(UBL_MESH_EDITING)
  199. #error "UBL_MESH_EDITING is now G26_MESH_VALIDATION. Please update your configuration."
  200. #elif defined(BLTOUCH_HEATERS_OFF)
  201. #error "BLTOUCH_HEATERS_OFF is now PROBING_HEATERS_OFF. Please update your configuration."
  202. #elif defined(BEEPER)
  203. #error "BEEPER is now BEEPER_PIN. Please update your pins definitions."
  204. #elif defined(SDCARDDETECT)
  205. #error "SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions."
  206. #elif defined(STAT_LED_RED) || defined(STAT_LED_BLUE)
  207. #error "STAT_LED_RED/STAT_LED_BLUE are now STAT_LED_RED_PIN/STAT_LED_BLUE_PIN. Please update your pins definitions."
  208. #elif defined(LCD_PIN_BL)
  209. #error "LCD_PIN_BL is now LCD_BACKLIGHT_PIN. Please update your pins definitions."
  210. #elif defined(LCD_PIN_RESET)
  211. #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions."
  212. #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)
  213. #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h."
  214. #elif defined(min_software_endstops) || defined(max_software_endstops)
  215. #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration."
  216. #elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN)
  217. #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)."
  218. #elif defined(CONTROLLERFAN_PIN)
  219. #error "CONTROLLERFAN_PIN is now CONTROLLER_FAN_PIN, enabled with USE_CONTROLLER_FAN. Please update your Configuration_adv.h."
  220. #elif defined(MIN_RETRACT)
  221. #error "MIN_RETRACT is now MIN_AUTORETRACT and MAX_AUTORETRACT. Please update your Configuration_adv.h."
  222. #elif defined(ADVANCE)
  223. #error "ADVANCE was removed in Marlin 1.1.6. Please use LIN_ADVANCE."
  224. #elif defined(LIN_ADVANCE_E_D_RATIO)
  225. #error "LIN_ADVANCE (1.5) no longer uses LIN_ADVANCE_E_D_RATIO. Check your configuration."
  226. #elif defined(NEOPIXEL_RGBW_LED)
  227. #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration."
  228. #elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS)
  229. #error "Remove DELTA_PROBEABLE_RADIUS and use MIN_PROBE_EDGE to inset the probe area instead."
  230. #elif defined(UBL_MESH_INSET)
  231. #error "UBL_MESH_INSET is now just MESH_INSET. Please update your configuration."
  232. #elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y)
  233. #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]. Please update your configuration."
  234. #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)
  235. #error "ABL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration."
  236. #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)
  237. #error "UBL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration."
  238. #elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY)
  239. #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY. Please update your configuration."
  240. #elif defined(BABYSTEP_ZPROBE_GFX_REVERSE)
  241. #error "BABYSTEP_ZPROBE_GFX_REVERSE is now set by OVERLAY_GFX_REVERSE. Please update your configurations."
  242. #elif defined(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN)
  243. #error "UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN is now SEGMENT_LEVELED_MOVES. Please update your configuration."
  244. #elif HAS_PID_HEATING && (defined(K1) || !defined(PID_K1))
  245. #error "K1 is now PID_K1. Please update your configuration."
  246. #elif defined(PROBE_DOUBLE_TOUCH)
  247. #error "PROBE_DOUBLE_TOUCH is now MULTIPLE_PROBING. Please update your configuration."
  248. #elif defined(ANET_KEYPAD_LCD)
  249. #error "ANET_KEYPAD_LCD is now ZONESTAR_LCD. Please update your configuration."
  250. #elif defined(LCD_I2C_SAINSMART_YWROBOT)
  251. #error "LCD_I2C_SAINSMART_YWROBOT is now LCD_SAINSMART_I2C_(1602|2004). Please update your configuration."
  252. #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT)
  253. #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN. Please update your configuration."
  254. #elif defined(HAVE_TMCDRIVER)
  255. #error "HAVE_TMCDRIVER is now HAVE_TMC26X. Please update your Configuration_adv.h."
  256. #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) \
  257. || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC)
  258. #error "[AXIS]_IS_TMC is now [AXIS]_IS_TMC26X. Please update your Configuration_adv.h."
  259. #elif defined(AUTOMATIC_CURRENT_CONTROL)
  260. #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration."
  261. #endif
  262. /**
  263. * Marlin release, version and default string
  264. */
  265. #ifndef SHORT_BUILD_VERSION
  266. #error "SHORT_BUILD_VERSION must be specified."
  267. #elif !defined(DETAILED_BUILD_VERSION)
  268. #error "BUILD_VERSION must be specified."
  269. #elif !defined(STRING_DISTRIBUTION_DATE)
  270. #error "STRING_DISTRIBUTION_DATE must be specified."
  271. #elif !defined(PROTOCOL_VERSION)
  272. #error "PROTOCOL_VERSION must be specified."
  273. #elif !defined(MACHINE_NAME)
  274. #error "MACHINE_NAME must be specified."
  275. #elif !defined(SOURCE_CODE_URL)
  276. #error "SOURCE_CODE_URL must be specified."
  277. #elif !defined(DEFAULT_MACHINE_UUID)
  278. #error "DEFAULT_MACHINE_UUID must be specified."
  279. #elif !defined(WEBSITE_URL)
  280. #error "WEBSITE_URL must be specified."
  281. #endif
  282. /**
  283. * Serial
  284. */
  285. #if !(defined(__AVR__) && defined(USBCON))
  286. #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
  287. #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
  288. #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
  289. #error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
  290. #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
  291. #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256."
  292. #endif
  293. #elif ENABLED(SERIAL_XON_XOFF) || ENABLED(SERIAL_STATS_MAX_RX_QUEUED) || ENABLED(SERIAL_STATS_DROPPED_RX)
  294. #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
  295. #endif
  296. #if SERIAL_PORT > 7
  297. #error "Set SERIAL_PORT to the port on your board. Usually this is 0."
  298. #endif
  299. /**
  300. * Dual Stepper Drivers
  301. */
  302. #if ENABLED(X_DUAL_STEPPER_DRIVERS) && ENABLED(DUAL_X_CARRIAGE)
  303. #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS."
  304. #elif ENABLED(X_DUAL_STEPPER_DRIVERS) && (!HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR)
  305. #error "X_DUAL_STEPPER_DRIVERS requires X2 pins (and an extra E plug)."
  306. #elif ENABLED(Y_DUAL_STEPPER_DRIVERS) && (!HAS_Y2_ENABLE || !HAS_Y2_STEP || !HAS_Y2_DIR)
  307. #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins (and an extra E plug)."
  308. #elif ENABLED(Z_DUAL_STEPPER_DRIVERS) && (!HAS_Z2_ENABLE || !HAS_Z2_STEP || !HAS_Z2_DIR)
  309. #error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)."
  310. #endif
  311. /**
  312. * Validate that the bed size fits
  313. */
  314. static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
  315. "Movement bounds ([XY]_MIN_POS, [XY]_MAX_POS) are too narrow to contain [XY]_BED_SIZE.");
  316. /**
  317. * Granular software endstops (Marlin >= 1.1.7)
  318. */
  319. #if ENABLED(MIN_SOFTWARE_ENDSTOPS) && DISABLED(MIN_SOFTWARE_ENDSTOP_Z)
  320. #if IS_KINEMATIC
  321. #error "MIN_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MIN_SOFTWARE_ENDSTOP_Z."
  322. #elif DISABLED(MIN_SOFTWARE_ENDSTOP_X) && DISABLED(MIN_SOFTWARE_ENDSTOP_Y)
  323. #error "MIN_SOFTWARE_ENDSTOPS requires at least one of the MIN_SOFTWARE_ENDSTOP_[XYZ] options."
  324. #endif
  325. #endif
  326. #if ENABLED(MAX_SOFTWARE_ENDSTOPS) && DISABLED(MAX_SOFTWARE_ENDSTOP_Z)
  327. #if IS_KINEMATIC
  328. #error "MAX_SOFTWARE_ENDSTOPS on DELTA/SCARA also requires MAX_SOFTWARE_ENDSTOP_Z."
  329. #elif DISABLED(MAX_SOFTWARE_ENDSTOP_X) && DISABLED(MAX_SOFTWARE_ENDSTOP_Y)
  330. #error "MAX_SOFTWARE_ENDSTOPS requires at least one of the MAX_SOFTWARE_ENDSTOP_[XYZ] options."
  331. #endif
  332. #endif
  333. #if !defined(TARGET_LPC1768) && ( \
  334. ENABLED(ENDSTOPPULLDOWNS) \
  335. || ENABLED(ENDSTOPPULLDOWN_XMAX) \
  336. || ENABLED(ENDSTOPPULLDOWN_YMAX) \
  337. || ENABLED(ENDSTOPPULLDOWN_ZMAX) \
  338. || ENABLED(ENDSTOPPULLDOWN_XMIN) \
  339. || ENABLED(ENDSTOPPULLDOWN_YMIN) \
  340. || ENABLED(ENDSTOPPULLDOWN_ZMIN) )
  341. #error "PULLDOWN pin mode is not available on the selected board."
  342. #endif
  343. #if ENABLED(ENDSTOPPULLUPS) && ENABLED(ENDSTOPPULLDOWNS)
  344. #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS."
  345. #elif ENABLED(FIL_RUNOUT_PULLUP) && ENABLED(FIL_RUNOUT_PULLDOWN)
  346. #error "Enable only one of FIL_RUNOUT_PULLUP or FIL_RUNOUT_PULLDOWN."
  347. #elif ENABLED(ENDSTOPPULLUP_XMAX) && ENABLED(ENDSTOPPULLDOWN_XMAX)
  348. #error "Enable only one of ENDSTOPPULLUP_X_MAX or ENDSTOPPULLDOWN_X_MAX."
  349. #elif ENABLED(ENDSTOPPULLUP_YMAX) && ENABLED(ENDSTOPPULLDOWN_YMAX)
  350. #error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX."
  351. #elif ENABLED(ENDSTOPPULLUP_ZMAX) && ENABLED(ENDSTOPPULLDOWN_ZMAX)
  352. #error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX."
  353. #elif ENABLED(ENDSTOPPULLUP_XMIN) && ENABLED(ENDSTOPPULLDOWN_XMIN)
  354. #error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
  355. #elif ENABLED(ENDSTOPPULLUP_YMIN) && ENABLED(ENDSTOPPULLDOWN_YMIN)
  356. #error "Enable only one of ENDSTOPPULLUP_Y_MIN or ENDSTOPPULLDOWN_Y_MIN."
  357. #elif ENABLED(ENDSTOPPULLUP_ZMIN) && ENABLED(ENDSTOPPULLDOWN_ZMIN)
  358. #error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN."
  359. #endif
  360. /**
  361. * Progress Bar
  362. */
  363. #if ENABLED(LCD_PROGRESS_BAR)
  364. #if DISABLED(SDSUPPORT) && DISABLED(LCD_SET_PROGRESS_MANUALLY)
  365. #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY."
  366. #elif DISABLED(ULTRA_LCD)
  367. #error "LCD_PROGRESS_BAR requires a character LCD."
  368. #elif ENABLED(DOGLCD)
  369. #error "LCD_PROGRESS_BAR does not apply to graphical displays."
  370. #elif ENABLED(FILAMENT_LCD_DISPLAY)
  371. #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both."
  372. #endif
  373. #elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && DISABLED(DOGLCD)
  374. #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR or Graphical LCD."
  375. #endif
  376. /**
  377. * Custom Boot and Status screens
  378. */
  379. #if DISABLED(DOGLCD) && (ENABLED(SHOW_CUSTOM_BOOTSCREEN) || ENABLED(CUSTOM_STATUS_SCREEN_IMAGE))
  380. #error "Graphical LCD is required for SHOW_CUSTOM_BOOTSCREEN and CUSTOM_STATUS_SCREEN_IMAGE."
  381. #endif
  382. /**
  383. * SD File Sorting
  384. */
  385. #if ENABLED(SDCARD_SORT_ALPHA)
  386. #if SDSORT_LIMIT > 256
  387. #error "SDSORT_LIMIT must be 256 or smaller."
  388. #elif SDSORT_LIMIT < 10
  389. #error "SDSORT_LIMIT should be greater than 9 to be useful."
  390. #elif DISABLED(SDSORT_USES_RAM)
  391. #if ENABLED(SDSORT_DYNAMIC_RAM)
  392. #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)."
  393. #elif ENABLED(SDSORT_CACHE_NAMES)
  394. #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)."
  395. #endif
  396. #endif
  397. #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
  398. #if SDSORT_CACHE_VFATS < 2
  399. #error "SDSORT_CACHE_VFATS must be 2 or greater!"
  400. #elif SDSORT_CACHE_VFATS > MAX_VFAT_ENTRIES
  401. #undef SDSORT_CACHE_VFATS
  402. #define SDSORT_CACHE_VFATS MAX_VFAT_ENTRIES
  403. #warning "SDSORT_CACHE_VFATS was reduced to MAX_VFAT_ENTRIES!"
  404. #endif
  405. #endif
  406. #endif
  407. /**
  408. * I2C Position Encoders
  409. */
  410. #if ENABLED(I2C_POSITION_ENCODERS)
  411. #if DISABLED(BABYSTEPPING) || DISABLED(BABYSTEP_XY)
  412. #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY."
  413. #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5)
  414. #error "I2CPE_ENCODER_CNT must be between 1 and 5."
  415. #endif
  416. #endif
  417. /**
  418. * Babystepping
  419. */
  420. #if ENABLED(BABYSTEPPING)
  421. #if ENABLED(SCARA)
  422. #error "BABYSTEPPING is not implemented for SCARA yet."
  423. #elif ENABLED(DELTA) && ENABLED(BABYSTEP_XY)
  424. #error "BABYSTEPPING only implemented for Z axis on deltabots."
  425. #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && ENABLED(MESH_BED_LEVELING)
  426. #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
  427. #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
  428. #error "BABYSTEP_ZPROBE_OFFSET requires a probe."
  429. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !ENABLED(DOGLCD)
  430. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a DOGLCD."
  431. #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !ENABLED(BABYSTEP_ZPROBE_OFFSET)
  432. #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
  433. #endif
  434. #endif
  435. /**
  436. * Filament Runout needs one or more pins and either SD Support or Auto print start detection
  437. */
  438. #if ENABLED(FILAMENT_RUNOUT_SENSOR)
  439. #if !PIN_EXISTS(FIL_RUNOUT)
  440. #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
  441. #elif NUM_RUNOUT_SENSORS > E_STEPPERS
  442. #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers."
  443. #elif NUM_RUNOUT_SENSORS > 1 && !PIN_EXISTS(FIL_RUNOUT2)
  444. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 1 requires FIL_RUNOUT2_PIN."
  445. #elif NUM_RUNOUT_SENSORS > 2 && !PIN_EXISTS(FIL_RUNOUT3)
  446. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 2 requires FIL_RUNOUT3_PIN."
  447. #elif NUM_RUNOUT_SENSORS > 3 && !PIN_EXISTS(FIL_RUNOUT4)
  448. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 3 requires FIL_RUNOUT4_PIN."
  449. #elif NUM_RUNOUT_SENSORS > 4 && !PIN_EXISTS(FIL_RUNOUT5)
  450. #error "FILAMENT_RUNOUT_SENSOR with NUM_RUNOUT_SENSORS > 4 requires FIL_RUNOUT5_PIN."
  451. #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART)
  452. #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART."
  453. #elif DISABLED(ADVANCED_PAUSE_FEATURE)
  454. static_assert(NULL == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
  455. #endif
  456. #endif
  457. /**
  458. * Advanced Pause
  459. */
  460. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  461. #if !HAS_RESUME_CONTINUE
  462. #error "ADVANCED_PAUSE_FEATURE currently requires an LCD controller or EMERGENCY_PARSER."
  463. #elif ENABLED(EXTRUDER_RUNOUT_PREVENT)
  464. #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
  465. #elif ENABLED(PARK_HEAD_ON_PAUSE) && DISABLED(SDSUPPORT) && DISABLED(NEWPANEL) && DISABLED(EMERGENCY_PARSER)
  466. #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller."
  467. #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
  468. #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT."
  469. #elif DISABLED(NOZZLE_PARK_FEATURE)
  470. #error "ADVANCED_PAUSE_FEATURE requires NOZZLE_PARK_FEATURE."
  471. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_UNLOAD_LENGTH > EXTRUDE_MAXLENGTH
  472. #error "FILAMENT_CHANGE_UNLOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  473. #elif ENABLED(PREVENT_LENGTHY_EXTRUDE) && FILAMENT_CHANGE_LOAD_LENGTH > EXTRUDE_MAXLENGTH
  474. #error "FILAMENT_CHANGE_LOAD_LENGTH must be less than or equal to EXTRUDE_MAXLENGTH."
  475. #endif
  476. #endif
  477. /**
  478. * Individual axis homing is useless for DELTAS
  479. */
  480. #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) && ENABLED(DELTA)
  481. #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
  482. #endif
  483. /**
  484. * Options only for EXTRUDERS > 1
  485. */
  486. #if EXTRUDERS > 1
  487. #if EXTRUDERS > 5
  488. #error "Marlin supports a maximum of 5 EXTRUDERS."
  489. #endif
  490. #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  491. #error "EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT."
  492. #endif
  493. #if ENABLED(HEATERS_PARALLEL)
  494. #error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
  495. #endif
  496. #elif ENABLED(MK2_MULTIPLEXER)
  497. #error "MK2_MULTIPLEXER requires 2 or more EXTRUDERS."
  498. #elif ENABLED(SINGLENOZZLE)
  499. #error "SINGLENOZZLE requires 2 or more EXTRUDERS."
  500. #endif
  501. /**
  502. * Sanity checking for the Průša MK2 Multiplexer
  503. */
  504. #ifdef SNMM
  505. #error "SNMM is now MK2_MULTIPLEXER. Please update your configuration."
  506. #endif
  507. /**
  508. * A Dual Nozzle carriage with switching servo
  509. */
  510. #if ENABLED(SWITCHING_NOZZLE)
  511. #if ENABLED(DUAL_X_CARRIAGE)
  512. #error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible."
  513. #elif ENABLED(SINGLENOZZLE)
  514. #error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible."
  515. #elif EXTRUDERS != 2
  516. #error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
  517. #elif NUM_SERVOS < 1
  518. #error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1."
  519. #endif
  520. #endif
  521. /**
  522. * Single Stepper Dual Extruder with switching servo
  523. */
  524. #if ENABLED(SWITCHING_EXTRUDER) && NUM_SERVOS < 1
  525. #error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
  526. #endif
  527. /**
  528. * Mixing Extruder requirements
  529. */
  530. #if ENABLED(MIXING_EXTRUDER)
  531. #if EXTRUDERS > 1
  532. #error "MIXING_EXTRUDER currently only supports one extruder."
  533. #elif MIXING_STEPPERS < 2
  534. #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
  535. #elif ENABLED(FILAMENT_SENSOR)
  536. #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway."
  537. #elif ENABLED(SWITCHING_EXTRUDER)
  538. #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both."
  539. #elif ENABLED(SINGLENOZZLE)
  540. #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE."
  541. #elif ENABLED(LIN_ADVANCE)
  542. #error "MIXING_EXTRUDER is incompatible with LIN_ADVANCE."
  543. #endif
  544. #endif
  545. /**
  546. * Linear Advance 1.5 - Check K value range
  547. */
  548. #if ENABLED(LIN_ADVANCE)
  549. static_assert(
  550. WITHIN(LIN_ADVANCE_K, 0, 10),
  551. "LIN_ADVANCE_K must be a value from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)."
  552. );
  553. #endif
  554. /**
  555. * Parking Extruder requirements
  556. */
  557. #if ENABLED(PARKING_EXTRUDER)
  558. #if ENABLED(DUAL_X_CARRIAGE)
  559. #error "PARKING_EXTRUDER and DUAL_X_CARRIAGE are incompatible."
  560. #elif ENABLED(SINGLENOZZLE)
  561. #error "PARKING_EXTRUDER and SINGLENOZZLE are incompatible."
  562. #elif ENABLED(EXT_SOLENOID)
  563. #error "PARKING_EXTRUDER and EXT_SOLENOID are incompatible. (Pins are used twice.)"
  564. #elif EXTRUDERS != 2
  565. #error "PARKING_EXTRUDER requires exactly 2 EXTRUDERS."
  566. #elif !PIN_EXISTS(SOL0) || !PIN_EXISTS(SOL1)
  567. #error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN."
  568. #elif !defined(PARKING_EXTRUDER_PARKING_X)
  569. #error "PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X."
  570. #elif !defined(PARKING_EXTRUDER_SECURITY_RAISE)
  571. #error "PARKING_EXTRUDER requires PARKING_EXTRUDER_SECURITY_RAISE."
  572. #elif PARKING_EXTRUDER_SECURITY_RAISE < 0
  573. #error "PARKING_EXTRUDER_SECURITY_RAISE must be 0 or higher."
  574. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH)
  575. #error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW."
  576. #elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000)
  577. #error "PARKING_EXTRUDER_SOLENOIDS_DELAY must be between 0 and 2000 (ms)."
  578. #endif
  579. #endif
  580. /**
  581. * Part-Cooling Fan Multiplexer requirements
  582. */
  583. #if PIN_EXISTS(FANMUX1)
  584. #if !HAS_FANMUX
  585. #error "FANMUX0_PIN must be set before FANMUX1_PIN can be set."
  586. #endif
  587. #elif PIN_EXISTS(FANMUX2)
  588. #error "FANMUX0_PIN and FANMUX1_PIN must be set before FANMUX2_PIN can be set."
  589. #endif
  590. /**
  591. * Limited number of servos
  592. */
  593. #if NUM_SERVOS > 4
  594. #error "The maximum number of SERVOS in Marlin is 4."
  595. #endif
  596. /**
  597. * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder
  598. */
  599. #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_PROBE && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR)
  600. #error "Z_PROBE_SERVO_NR, switching nozzle, or switching extruder is required for DEACTIVATE_SERVOS_AFTER_MOVE."
  601. #endif
  602. /**
  603. * Required LCD language
  604. */
  605. #if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780)
  606. #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller."
  607. #endif
  608. /**
  609. * Bed Heating Options - PID vs Limit Switching
  610. */
  611. #if ENABLED(PIDTEMPBED) && ENABLED(BED_LIMIT_SWITCHING)
  612. #error "To use BED_LIMIT_SWITCHING you must disable PIDTEMPBED."
  613. #endif
  614. /**
  615. * Kinematics
  616. */
  617. /**
  618. * Allow only one kinematic type to be defined
  619. */
  620. #if 1 < 0 \
  621. + ENABLED(DELTA) \
  622. + ENABLED(MORGAN_SCARA) \
  623. + ENABLED(MAKERARM_SCARA) \
  624. + ENABLED(COREXY) \
  625. + ENABLED(COREXZ) \
  626. + ENABLED(COREYZ) \
  627. + ENABLED(COREYX) \
  628. + ENABLED(COREZX) \
  629. + ENABLED(COREZY)
  630. #error "Please enable only one of DELTA, MORGAN_SCARA, MAKERARM_SCARA, COREXY, COREYX, COREXZ, COREZX, COREYZ, or COREZY."
  631. #endif
  632. /**
  633. * Delta requirements
  634. */
  635. #if ENABLED(DELTA)
  636. #if DISABLED(USE_XMAX_PLUG) && DISABLED(USE_YMAX_PLUG) && DISABLED(USE_ZMAX_PLUG)
  637. #error "You probably want to use Max Endstops for DELTA!"
  638. #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED
  639. #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
  640. #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || ENABLED(ULTIPANEL))
  641. #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
  642. #elif ABL_GRID
  643. #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0
  644. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
  645. #elif GRID_MAX_POINTS_X < 3
  646. #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher."
  647. #endif
  648. #endif
  649. #endif
  650. /**
  651. * Probes
  652. */
  653. /**
  654. * Allow only one probe option to be defined
  655. */
  656. #if 1 < 0 \
  657. + ENABLED(PROBE_MANUALLY) \
  658. + ENABLED(FIX_MOUNTED_PROBE) \
  659. + (HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH)) \
  660. + ENABLED(BLTOUCH) \
  661. + ENABLED(SOLENOID_PROBE) \
  662. + ENABLED(Z_PROBE_ALLEN_KEY) \
  663. + ENABLED(Z_PROBE_SLED)
  664. #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."
  665. #endif
  666. #if HAS_BED_PROBE
  667. /**
  668. * Z_PROBE_SLED is incompatible with DELTA
  669. */
  670. #if ENABLED(Z_PROBE_SLED) && ENABLED(DELTA)
  671. #error "You cannot use Z_PROBE_SLED with DELTA."
  672. #endif
  673. /**
  674. * SOLENOID_PROBE requirements
  675. */
  676. #if ENABLED(SOLENOID_PROBE)
  677. #if ENABLED(EXT_SOLENOID)
  678. #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID."
  679. #elif !HAS_SOLENOID_1
  680. #error "SOLENOID_PROBE requires SOL1_PIN. It can be added to your Configuration.h."
  681. #endif
  682. #endif
  683. /**
  684. * NUM_SERVOS is required for a Z servo probe
  685. */
  686. #if HAS_Z_SERVO_PROBE
  687. #ifndef NUM_SERVOS
  688. #error "You must set NUM_SERVOS for a Z servo probe (Z_PROBE_SERVO_NR)."
  689. #elif Z_PROBE_SERVO_NR >= NUM_SERVOS
  690. #error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS."
  691. #endif
  692. #endif
  693. /**
  694. * Require pin options and pins to be defined
  695. */
  696. #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  697. #if ENABLED(Z_MIN_PROBE_ENDSTOP)
  698. #error "Enable only one option: Z_MIN_PROBE_ENDSTOP or Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN."
  699. #elif DISABLED(USE_ZMIN_PLUG)
  700. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires USE_ZMIN_PLUG to be enabled."
  701. #elif !HAS_Z_MIN
  702. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires the Z_MIN_PIN to be defined."
  703. #elif ENABLED(Z_MIN_PROBE_ENDSTOP_INVERTING) != ENABLED(Z_MIN_ENDSTOP_INVERTING)
  704. #error "Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN requires Z_MIN_ENDSTOP_INVERTING to match Z_MIN_PROBE_ENDSTOP_INVERTING."
  705. #endif
  706. #elif ENABLED(Z_MIN_PROBE_ENDSTOP)
  707. #if !HAS_Z_MIN_PROBE_PIN
  708. #error "Z_MIN_PROBE_ENDSTOP requires the Z_MIN_PROBE_PIN to be defined."
  709. #endif
  710. #else
  711. #error "You must enable either Z_MIN_PROBE_ENDSTOP or Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use a probe."
  712. #endif
  713. /**
  714. * Make sure Z raise values are set
  715. */
  716. #ifndef Z_CLEARANCE_DEPLOY_PROBE
  717. #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration."
  718. #elif !defined(Z_CLEARANCE_BETWEEN_PROBES)
  719. #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration."
  720. #elif Z_CLEARANCE_DEPLOY_PROBE < 0
  721. #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0."
  722. #elif Z_CLEARANCE_BETWEEN_PROBES < 0
  723. #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
  724. #elif Z_AFTER_PROBING < 0
  725. #error "Probes need Z_AFTER_PROBING >= 0."
  726. #endif
  727. #if MULTIPLE_PROBING && MULTIPLE_PROBING < 2
  728. #error "MULTIPLE_PROBING must be >= 2."
  729. #endif
  730. #else
  731. /**
  732. * Require some kind of probe for bed leveling and probe testing
  733. */
  734. #if OLDSCHOOL_ABL && !PROBE_SELECTED
  735. #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."
  736. #endif
  737. #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
  738. #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."
  739. #endif
  740. #endif
  741. /**
  742. * Allow only one bed leveling option to be defined
  743. */
  744. #if 1 < 0 \
  745. + ENABLED(AUTO_BED_LEVELING_LINEAR) \
  746. + ENABLED(AUTO_BED_LEVELING_3POINT) \
  747. + ENABLED(AUTO_BED_LEVELING_BILINEAR) \
  748. + ENABLED(AUTO_BED_LEVELING_UBL) \
  749. + ENABLED(MESH_BED_LEVELING)
  750. #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."
  751. #endif
  752. /**
  753. * Bed Leveling Requirements
  754. */
  755. #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_3POINT)
  756. static_assert(WITHIN(PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_1_X is outside the probe region.");
  757. static_assert(WITHIN(PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_2_X is outside the probe region.");
  758. static_assert(WITHIN(PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_3_X is outside the probe region.");
  759. static_assert(WITHIN(PROBE_PT_1_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_1_Y is outside the probe region.");
  760. static_assert(WITHIN(PROBE_PT_2_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_2_Y is outside the probe region.");
  761. static_assert(WITHIN(PROBE_PT_3_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_3_Y is outside the probe region.");
  762. #endif
  763. #if ENABLED(AUTO_BED_LEVELING_UBL)
  764. /**
  765. * Unified Bed Leveling
  766. */
  767. // Hide PROBE_MANUALLY from the rest of the code
  768. #undef PROBE_MANUALLY
  769. #if IS_SCARA
  770. #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
  771. #elif DISABLED(EEPROM_SETTINGS)
  772. #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration."
  773. #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
  774. #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
  775. #elif DISABLED(RESTORE_LEVELING_AFTER_G28)
  776. #error "AUTO_BED_LEVELING_UBL (<=1.1.8) always has RESTORE_LEVELING_AFTER_G28 enabled. To keep this behavior, #define RESTORE_LEVELING_AFTER_G28. To keep it disabled comment out this line in SanityCheck.h."
  777. #endif
  778. #elif OLDSCHOOL_ABL
  779. /**
  780. * Auto Bed Leveling
  781. */
  782. /**
  783. * Delta and SCARA have limited bed leveling options
  784. */
  785. #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR)
  786. #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option."
  787. #endif
  788. /**
  789. * Check auto bed leveling probe points
  790. */
  791. #if ABL_GRID
  792. static_assert(LEFT_PROBE_BED_POSITION < RIGHT_PROBE_BED_POSITION, "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION.");
  793. static_assert(FRONT_PROBE_BED_POSITION < BACK_PROBE_BED_POSITION, "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION.");
  794. static_assert(LEFT_PROBE_BED_POSITION >= MIN_PROBE_X, "LEFT_PROBE_BED_POSITION is outside the probe region.");
  795. static_assert(RIGHT_PROBE_BED_POSITION <= MAX_PROBE_X, "RIGHT_PROBE_BED_POSITION is outside the probe region.");
  796. static_assert(FRONT_PROBE_BED_POSITION >= MIN_PROBE_Y, "FRONT_PROBE_BED_POSITION is outside the probe region.");
  797. static_assert(BACK_PROBE_BED_POSITION <= MAX_PROBE_Y, "BACK_PROBE_BED_POSITION is outside the probe region.");
  798. #endif // AUTO_BED_LEVELING_3POINT
  799. #elif ENABLED(MESH_BED_LEVELING)
  800. // Hide PROBE_MANUALLY from the rest of the code
  801. #undef PROBE_MANUALLY
  802. /**
  803. * Mesh Bed Leveling
  804. */
  805. #if ENABLED(DELTA)
  806. #error "MESH_BED_LEVELING is not compatible with DELTA printers."
  807. #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9
  808. #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
  809. #endif
  810. #endif
  811. #if HAS_MESH
  812. static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
  813. #elif ENABLED(G26_MESH_VALIDATION)
  814. #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL."
  815. #endif
  816. #if ENABLED(MESH_EDIT_GFX_OVERLAY) && (DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(DOGLCD))
  817. #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD."
  818. #endif
  819. /**
  820. * LCD_BED_LEVELING requirements
  821. */
  822. #if ENABLED(LCD_BED_LEVELING)
  823. #if DISABLED(ULTIPANEL)
  824. #error "LCD_BED_LEVELING requires an LCD controller."
  825. #elif !(ENABLED(MESH_BED_LEVELING) || (OLDSCHOOL_ABL && ENABLED(PROBE_MANUALLY)))
  826. #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or ABL with PROBE_MANUALLY."
  827. #endif
  828. #endif
  829. /**
  830. * Homing
  831. */
  832. #if X_HOME_BUMP_MM < 0 || Y_HOME_BUMP_MM < 0 || Z_HOME_BUMP_MM < 0
  833. #error "[XYZ]_HOME_BUMP_MM must be greater than or equal to 0."
  834. #endif
  835. #if ENABLED(CODEPENDENT_XY_HOMING)
  836. #if ENABLED(QUICK_HOME)
  837. #error "QUICK_HOME is incompatible with CODEPENDENT_XY_HOMING."
  838. #elif IS_KINEMATIC
  839. #error "CODEPENDENT_XY_HOMING requires a Cartesian setup."
  840. #endif
  841. #endif
  842. /**
  843. * Make sure Z_SAFE_HOMING point is reachable
  844. */
  845. #if ENABLED(Z_SAFE_HOMING)
  846. #if HAS_BED_PROBE
  847. static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, MIN_PROBE_X, MAX_PROBE_X),
  848. "Z_SAFE_HOMING_X_POINT is outside the probe region.");
  849. static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, MIN_PROBE_Y, MAX_PROBE_Y),
  850. "Z_SAFE_HOMING_Y_POINT is outside the probe region.");
  851. #else
  852. static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, X_MIN_POS, X_MAX_POS),
  853. "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle.");
  854. static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS),
  855. "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
  856. #endif
  857. #endif // Z_SAFE_HOMING
  858. /**
  859. * Make sure DISABLE_[XYZ] compatible with selected homing options
  860. */
  861. #if ENABLED(DISABLE_X) || ENABLED(DISABLE_Y) || ENABLED(DISABLE_Z)
  862. #if ENABLED(HOME_AFTER_DEACTIVATE) || ENABLED(Z_SAFE_HOMING)
  863. #error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
  864. #endif
  865. #endif // DISABLE_[XYZ]
  866. /**
  867. * Filament Width Sensor
  868. */
  869. #if ENABLED(FILAMENT_WIDTH_SENSOR)
  870. #if !HAS_FILAMENT_WIDTH_SENSOR
  871. #error "FILAMENT_WIDTH_SENSOR requires a FILWIDTH_PIN to be defined."
  872. #elif ENABLED(NO_VOLUMETRICS)
  873. #error "FILAMENT_WIDTH_SENSOR requires NO_VOLUMETRICS to be disabled."
  874. #endif
  875. #endif
  876. /**
  877. * ULTIPANEL encoder
  878. */
  879. #if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
  880. #error "ULTIPANEL requires some kind of encoder."
  881. #endif
  882. #if ENCODER_PULSES_PER_STEP < 0
  883. #error "ENCODER_PULSES_PER_STEP should not be negative, use REVERSE_MENU_DIRECTION instead."
  884. #endif
  885. /**
  886. * SAV_3DGLCD display options
  887. */
  888. #if ENABLED(U8GLIB_SSD1306) && ENABLED(U8GLIB_SH1106)
  889. #error "Only enable one SAV_3DGLCD display type: U8GLIB_SSD1306 or U8GLIB_SH1106."
  890. #endif
  891. /**
  892. * Allen Key
  893. * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
  894. */
  895. #if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  896. #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY"
  897. #endif
  898. /**
  899. * Dual X Carriage requirements
  900. */
  901. #if ENABLED(DUAL_X_CARRIAGE)
  902. #if EXTRUDERS == 1
  903. #error "DUAL_X_CARRIAGE requires 2 (or more) extruders."
  904. #elif CORE_IS_XY || CORE_IS_XZ
  905. #error "DUAL_X_CARRIAGE cannot be used with COREXY, COREYX, COREXZ, or COREZX."
  906. #elif !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR
  907. #error "DUAL_X_CARRIAGE requires X2 stepper pins to be defined."
  908. #elif !HAS_X_MAX
  909. #error "DUAL_X_CARRIAGE requires USE_XMAX_PLUG and an X Max Endstop."
  910. #elif !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS)
  911. #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
  912. #elif X_HOME_DIR != -1 || X2_HOME_DIR != 1
  913. #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1 and X2_HOME_DIR 1."
  914. #endif
  915. #endif // DUAL_X_CARRIAGE
  916. /**
  917. * Make sure auto fan pins don't conflict with the fan pin
  918. */
  919. #if HAS_AUTO_FAN
  920. #if HAS_FAN0
  921. #if E0_AUTO_FAN_PIN == FAN_PIN
  922. #error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
  923. #elif E1_AUTO_FAN_PIN == FAN_PIN
  924. #error "You cannot set E1_AUTO_FAN_PIN equal to FAN_PIN."
  925. #elif E2_AUTO_FAN_PIN == FAN_PIN
  926. #error "You cannot set E2_AUTO_FAN_PIN equal to FAN_PIN."
  927. #elif E3_AUTO_FAN_PIN == FAN_PIN
  928. #error "You cannot set E3_AUTO_FAN_PIN equal to FAN_PIN."
  929. #endif
  930. #endif
  931. #endif
  932. #if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN
  933. #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."
  934. #endif
  935. #if ENABLED(USE_CONTROLLER_FAN)
  936. #if !HAS_CONTROLLER_FAN
  937. #error "USE_CONTROLLER_FAN requires a CONTROLLER_FAN_PIN. Define in Configuration_adv.h."
  938. #elif E0_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  939. #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  940. #elif E1_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  941. #error "You cannot set E1_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  942. #elif E2_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  943. #error "You cannot set E2_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  944. #elif E3_AUTO_FAN_PIN == CONTROLLER_FAN_PIN
  945. #error "You cannot set E3_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
  946. #endif
  947. #endif
  948. /**
  949. * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set.
  950. */
  951. #if !HAS_HEATER_0
  952. #error "HEATER_0_PIN not defined for this board."
  953. #elif !PIN_EXISTS(TEMP_0) && !(defined(MAX6675_SS) && MAX6675_SS >= 0)
  954. #error "TEMP_0_PIN not defined for this board."
  955. #elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR)))
  956. #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
  957. #elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE)))
  958. #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
  959. #elif TEMP_SENSOR_0 == 0
  960. #error "TEMP_SENSOR_0 is required."
  961. #endif
  962. // Pins are required for heaters
  963. #if ENABLED(HEATER_0_USES_MAX6675) && !(defined(MAX6675_SS) && MAX6675_SS >= 0)
  964. #error "MAX6675_SS (required for TEMP_SENSOR_0) not defined for this board."
  965. #elif (HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)) && !HAS_HEATER_1
  966. #error "HEATER_1_PIN not defined for this board."
  967. #endif
  968. #if HOTENDS > 1
  969. #if TEMP_SENSOR_1 == 0
  970. #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
  971. #elif !PIN_EXISTS(TEMP_1)
  972. #error "TEMP_1_PIN not defined for this board."
  973. #endif
  974. #if HOTENDS > 2
  975. #if TEMP_SENSOR_2 == 0
  976. #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
  977. #elif !HAS_HEATER_2
  978. #error "HEATER_2_PIN not defined for this board."
  979. #elif !PIN_EXISTS(TEMP_2)
  980. #error "TEMP_2_PIN not defined for this board."
  981. #endif
  982. #if HOTENDS > 3
  983. #if TEMP_SENSOR_3 == 0
  984. #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
  985. #elif !HAS_HEATER_3
  986. #error "HEATER_3_PIN not defined for this board."
  987. #elif !PIN_EXISTS(TEMP_3)
  988. #error "TEMP_3_PIN not defined for this board."
  989. #endif
  990. #if HOTENDS > 4
  991. #if TEMP_SENSOR_4 == 0
  992. #error "TEMP_SENSOR_4 is required with 5 HOTENDS."
  993. #elif !HAS_HEATER_4
  994. #error "HEATER_4_PIN not defined for this board."
  995. #elif !PIN_EXISTS(TEMP_4)
  996. #error "TEMP_4_PIN not defined for this board."
  997. #endif
  998. #elif TEMP_SENSOR_4 != 0
  999. #error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS."
  1000. #endif
  1001. #elif TEMP_SENSOR_3 != 0
  1002. #error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS."
  1003. #elif TEMP_SENSOR_4 != 0
  1004. #error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS."
  1005. #endif
  1006. #elif TEMP_SENSOR_2 != 0
  1007. #error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS."
  1008. #elif TEMP_SENSOR_3 != 0
  1009. #error "TEMP_SENSOR_3 shouldn't be set with only 2 HOTENDS."
  1010. #elif TEMP_SENSOR_4 != 0
  1011. #error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS."
  1012. #endif
  1013. #elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  1014. #error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND."
  1015. #elif TEMP_SENSOR_2 != 0
  1016. #error "TEMP_SENSOR_2 shouldn't be set with only 1 HOTEND."
  1017. #elif TEMP_SENSOR_3 != 0
  1018. #error "TEMP_SENSOR_3 shouldn't be set with only 1 HOTEND."
  1019. #elif TEMP_SENSOR_4 != 0
  1020. #error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND."
  1021. #endif
  1022. #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0
  1023. #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
  1024. #endif
  1025. /**
  1026. * Temperature status LEDs
  1027. */
  1028. #if ENABLED(TEMP_STAT_LEDS) && !PIN_EXISTS(STAT_LED_RED) && !PIN_EXISTS(STAT_LED_BLUE)
  1029. #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both."
  1030. #endif
  1031. /**
  1032. * Basic 2-nozzle duplication mode
  1033. */
  1034. #if ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
  1035. #if HOTENDS != 2
  1036. #error "DUAL_NOZZLE_DUPLICATION_MODE requires exactly 2 hotends."
  1037. #elif ENABLED(DUAL_X_CARRIAGE)
  1038. #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with DUAL_X_CARRIAGE."
  1039. #elif ENABLED(SINGLENOZZLE)
  1040. #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SINGLENOZZLE."
  1041. #elif ENABLED(MIXING_EXTRUDER)
  1042. #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with MIXING_EXTRUDER."
  1043. #elif ENABLED(SWITCHING_EXTRUDER)
  1044. #error "DUAL_NOZZLE_DUPLICATION_MODE is incompatible with SWITCHING_EXTRUDER."
  1045. #endif
  1046. #endif
  1047. /**
  1048. * Test Extruder Stepper Pins
  1049. */
  1050. #if DISABLED(MK2_MULTIPLEXER) // MK2_MULTIPLEXER uses E0 stepper only
  1051. #if E_STEPPERS > 4
  1052. #if !PIN_EXISTS(E4_STEP) || !PIN_EXISTS(E4_DIR) || !PIN_EXISTS(E4_ENABLE)
  1053. #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
  1054. #endif
  1055. #elif E_STEPPERS > 3
  1056. #if !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE)
  1057. #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
  1058. #endif
  1059. #elif E_STEPPERS > 2
  1060. #if !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE)
  1061. #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
  1062. #endif
  1063. #elif E_STEPPERS > 1
  1064. #if !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE)
  1065. #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
  1066. #endif
  1067. #endif
  1068. #endif
  1069. /**
  1070. * Endstop Tests
  1071. */
  1072. #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_)))
  1073. #define _AXIS_PLUG_UNUSED_TEST(AXIS) (_PLUG_UNUSED_TEST(AXIS,X) && _PLUG_UNUSED_TEST(AXIS,Y) && _PLUG_UNUSED_TEST(AXIS,Z))
  1074. // At least 3 endstop plugs must be used
  1075. #if _AXIS_PLUG_UNUSED_TEST(X)
  1076. #error "You must enable USE_XMIN_PLUG or USE_XMAX_PLUG."
  1077. #endif
  1078. #if _AXIS_PLUG_UNUSED_TEST(Y)
  1079. #error "You must enable USE_YMIN_PLUG or USE_YMAX_PLUG."
  1080. #endif
  1081. #if _AXIS_PLUG_UNUSED_TEST(Z)
  1082. #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG."
  1083. #endif
  1084. // Delta and Cartesian use 3 homing endstops
  1085. #if !IS_SCARA
  1086. #if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG)
  1087. #error "Enable USE_XMIN_PLUG when homing X to MIN."
  1088. #elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG)
  1089. #error "Enable USE_XMAX_PLUG when homing X to MAX."
  1090. #elif Y_HOME_DIR < 0 && DISABLED(USE_YMIN_PLUG)
  1091. #error "Enable USE_YMIN_PLUG when homing Y to MIN."
  1092. #elif Y_HOME_DIR > 0 && DISABLED(USE_YMAX_PLUG)
  1093. #error "Enable USE_YMAX_PLUG when homing Y to MAX."
  1094. #endif
  1095. #endif
  1096. #if Z_HOME_DIR < 0 && DISABLED(USE_ZMIN_PLUG)
  1097. #error "Enable USE_ZMIN_PLUG when homing Z to MIN."
  1098. #elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG)
  1099. #error "Enable USE_ZMAX_PLUG when homing Z to MAX."
  1100. #endif
  1101. // Dual endstops requirements
  1102. #if ENABLED(X_DUAL_ENDSTOPS)
  1103. #if !X2_USE_ENDSTOP
  1104. #error "You must set X2_USE_ENDSTOP with X_DUAL_ENDSTOPS."
  1105. #elif X2_USE_ENDSTOP == _X_MIN_ && DISABLED(USE_XMIN_PLUG)
  1106. #error "USE_XMIN_PLUG is required when X2_USE_ENDSTOP is _X_MIN_."
  1107. #elif X2_USE_ENDSTOP == _X_MAX_ && DISABLED(USE_XMAX_PLUG)
  1108. #error "USE_XMAX_PLUG is required when X2_USE_ENDSTOP is _X_MAX_."
  1109. #elif X2_USE_ENDSTOP == _Y_MIN_ && DISABLED(USE_YMIN_PLUG)
  1110. #error "USE_YMIN_PLUG is required when X2_USE_ENDSTOP is _Y_MIN_."
  1111. #elif X2_USE_ENDSTOP == _Y_MAX_ && DISABLED(USE_YMAX_PLUG)
  1112. #error "USE_YMAX_PLUG is required when X2_USE_ENDSTOP is _Y_MAX_."
  1113. #elif X2_USE_ENDSTOP == _Z_MIN_ && DISABLED(USE_ZMIN_PLUG)
  1114. #error "USE_ZMIN_PLUG is required when X2_USE_ENDSTOP is _Z_MIN_."
  1115. #elif X2_USE_ENDSTOP == _Z_MAX_ && DISABLED(USE_ZMAX_PLUG)
  1116. #error "USE_ZMAX_PLUG is required when X2_USE_ENDSTOP is _Z_MAX_."
  1117. #elif !HAS_X2_MIN && !HAS_X2_MAX
  1118. #error "X2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1119. #elif ENABLED(DELTA)
  1120. #error "X_DUAL_ENDSTOPS is not compatible with DELTA."
  1121. #endif
  1122. #endif
  1123. #if ENABLED(Y_DUAL_ENDSTOPS)
  1124. #if !Y2_USE_ENDSTOP
  1125. #error "You must set Y2_USE_ENDSTOP with Y_DUAL_ENDSTOPS."
  1126. #elif Y2_USE_ENDSTOP == _X_MIN_ && DISABLED(USE_XMIN_PLUG)
  1127. #error "USE_XMIN_PLUG is required when Y2_USE_ENDSTOP is _X_MIN_."
  1128. #elif Y2_USE_ENDSTOP == _X_MAX_ && DISABLED(USE_XMAX_PLUG)
  1129. #error "USE_XMAX_PLUG is required when Y2_USE_ENDSTOP is _X_MAX_."
  1130. #elif Y2_USE_ENDSTOP == _Y_MIN_ && DISABLED(USE_YMIN_PLUG)
  1131. #error "USE_YMIN_PLUG is required when Y2_USE_ENDSTOP is _Y_MIN_."
  1132. #elif Y2_USE_ENDSTOP == _Y_MAX_ && DISABLED(USE_YMAX_PLUG)
  1133. #error "USE_YMAX_PLUG is required when Y2_USE_ENDSTOP is _Y_MAX_."
  1134. #elif Y2_USE_ENDSTOP == _Z_MIN_ && DISABLED(USE_ZMIN_PLUG)
  1135. #error "USE_ZMIN_PLUG is required when Y2_USE_ENDSTOP is _Z_MIN_."
  1136. #elif Y2_USE_ENDSTOP == _Z_MAX_ && DISABLED(USE_ZMAX_PLUG)
  1137. #error "USE_ZMAX_PLUG is required when Y2_USE_ENDSTOP is _Z_MAX_."
  1138. #elif !HAS_Y2_MIN && !HAS_Y2_MAX
  1139. #error "Y2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1140. #elif ENABLED(DELTA)
  1141. #error "Y_DUAL_ENDSTOPS is not compatible with DELTA."
  1142. #endif
  1143. #endif
  1144. #if ENABLED(Z_DUAL_ENDSTOPS)
  1145. #if !Z2_USE_ENDSTOP
  1146. #error "You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS."
  1147. #elif Z2_USE_ENDSTOP == _X_MIN_ && DISABLED(USE_XMIN_PLUG)
  1148. #error "USE_XMIN_PLUG is required when Z2_USE_ENDSTOP is _X_MIN_."
  1149. #elif Z2_USE_ENDSTOP == _X_MAX_ && DISABLED(USE_XMAX_PLUG)
  1150. #error "USE_XMAX_PLUG is required when Z2_USE_ENDSTOP is _X_MAX_."
  1151. #elif Z2_USE_ENDSTOP == _Y_MIN_ && DISABLED(USE_YMIN_PLUG)
  1152. #error "USE_YMIN_PLUG is required when Z2_USE_ENDSTOP is _Y_MIN_."
  1153. #elif Z2_USE_ENDSTOP == _Y_MAX_ && DISABLED(USE_YMAX_PLUG)
  1154. #error "USE_YMAX_PLUG is required when Z2_USE_ENDSTOP is _Y_MAX_."
  1155. #elif Z2_USE_ENDSTOP == _Z_MIN_ && DISABLED(USE_ZMIN_PLUG)
  1156. #error "USE_ZMIN_PLUG is required when Z2_USE_ENDSTOP is _Z_MIN_."
  1157. #elif Z2_USE_ENDSTOP == _Z_MAX_ && DISABLED(USE_ZMAX_PLUG)
  1158. #error "USE_ZMAX_PLUG is required when Z2_USE_ENDSTOP is _Z_MAX_."
  1159. #elif !HAS_Z2_MIN && !HAS_Z2_MAX
  1160. #error "Z2_USE_ENDSTOP has been assigned to a nonexistent endstop!"
  1161. #elif ENABLED(DELTA)
  1162. #error "Z_DUAL_ENDSTOPS is not compatible with DELTA."
  1163. #endif
  1164. #endif
  1165. /**
  1166. * emergency-command parser
  1167. */
  1168. #if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON)
  1169. #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
  1170. #endif
  1171. /**
  1172. * I2C bus
  1173. */
  1174. #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0
  1175. #if I2C_SLAVE_ADDRESS < 8
  1176. #error "I2C_SLAVE_ADDRESS can't be less than 8. (Addresses 0 - 7 are reserved.)"
  1177. #elif I2C_SLAVE_ADDRESS > 127
  1178. #error "I2C_SLAVE_ADDRESS can't be over 127. (Only 7 bits allowed.)"
  1179. #endif
  1180. #endif
  1181. /**
  1182. * G38 Probe Target
  1183. */
  1184. #if ENABLED(G38_PROBE_TARGET)
  1185. #if !HAS_BED_PROBE
  1186. #error "G38_PROBE_TARGET requires a bed probe."
  1187. #elif !IS_CARTESIAN
  1188. #error "G38_PROBE_TARGET requires a Cartesian machine."
  1189. #endif
  1190. #endif
  1191. /**
  1192. * RGB_LED Requirements
  1193. */
  1194. #define _RGB_TEST (PIN_EXISTS(RGB_LED_R) && PIN_EXISTS(RGB_LED_G) && PIN_EXISTS(RGB_LED_B))
  1195. #if ENABLED(RGB_LED)
  1196. #if !_RGB_TEST
  1197. #error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN."
  1198. #elif ENABLED(RGBW_LED)
  1199. #error "Please enable only one of RGB_LED and RGBW_LED."
  1200. #endif
  1201. #elif ENABLED(RGBW_LED)
  1202. #if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W))
  1203. #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN."
  1204. #endif
  1205. #elif ENABLED(NEOPIXEL_LED)
  1206. #if !(PIN_EXISTS(NEOPIXEL) && NEOPIXEL_PIXELS > 0)
  1207. #error "NEOPIXEL_LED requires NEOPIXEL_PIN and NEOPIXEL_PIXELS."
  1208. #endif
  1209. #elif ENABLED(PRINTER_EVENT_LEDS) && DISABLED(BLINKM) && DISABLED(PCA9632) && DISABLED(NEOPIXEL_LED)
  1210. #error "PRINTER_EVENT_LEDS requires BLINKM, PCA9632, RGB_LED, RGBW_LED or NEOPIXEL_LED."
  1211. #endif
  1212. /**
  1213. * Auto Fan check for PWM pins
  1214. */
  1215. #if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255
  1216. #define AF_ERR_SUFF "_AUTO_FAN_PIN is not a PWM pin. Set EXTRUDER_AUTO_FAN_SPEED to 255."
  1217. #if HAS_AUTO_FAN_0
  1218. static_assert(GET_TIMER(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF);
  1219. #elif HAS_AUTO_FAN_1
  1220. static_assert(GET_TIMER(E1_AUTO_FAN_PIN), "E1" AF_ERR_SUFF);
  1221. #elif HAS_AUTO_FAN_2
  1222. static_assert(GET_TIMER(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF);
  1223. #elif HAS_AUTO_FAN_3
  1224. static_assert(GET_TIMER(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF);
  1225. #endif
  1226. #endif
  1227. /**
  1228. * Make sure only one display is enabled
  1229. *
  1230. * Note: BQ_LCD_SMART_CONTROLLER => REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  1231. * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER => REPRAP_DISCOUNT_SMART_CONTROLLER
  1232. * SAV_3DGLCD => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
  1233. * MKS_12864OLED => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
  1234. * MKS_12864OLED_SSD1306 => U8GLIB_SSD1306 => ULTIMAKERCONTROLLER
  1235. * MKS_MINI_12864 => MINIPANEL
  1236. * miniVIKI => ULTIMAKERCONTROLLER
  1237. * VIKI2 => ULTIMAKERCONTROLLER
  1238. * ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER
  1239. * AZSMZ_12864 => ULTIMAKERCONTROLLER
  1240. * PANEL_ONE => ULTIMAKERCONTROLLER
  1241. */
  1242. #if 1 < 0 \
  1243. + ( ENABLED(ULTIMAKERCONTROLLER) \
  1244. && DISABLED(SAV_3DGLCD) \
  1245. && DISABLED(miniVIKI) \
  1246. && DISABLED(VIKI2) \
  1247. && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  1248. && DISABLED(AZSMZ_12864) \
  1249. && DISABLED(PANEL_ONE) \
  1250. && DISABLED(MKS_12864OLED) \
  1251. && DISABLED(MKS_12864OLED_SSD1306) ) \
  1252. + ( ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
  1253. && DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
  1254. && DISABLED(LCD_FOR_MELZI) \
  1255. && DISABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
  1256. && DISABLED(MKS_12864OLED) \
  1257. && DISABLED(MKS_12864OLED_SSD1306) ) \
  1258. + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(BQ_LCD_SMART_CONTROLLER)) \
  1259. + ENABLED(LCD_FOR_MELZI) \
  1260. + ENABLED(MKS_12864OLED) \
  1261. + ENABLED(MKS_12864OLED_SSD1306) \
  1262. + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
  1263. + ENABLED(CARTESIO_UI) \
  1264. + ENABLED(PANEL_ONE) \
  1265. + ENABLED(MAKRPANEL) \
  1266. + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \
  1267. + ENABLED(VIKI2) \
  1268. + ENABLED(miniVIKI) \
  1269. + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  1270. + ENABLED(AZSMZ_12864) \
  1271. + ENABLED(G3D_PANEL) \
  1272. + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \
  1273. + ENABLED(MKS_MINI_12864) \
  1274. + (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(CARTESIO_UI) && DISABLED(ZONESTAR_LCD)) \
  1275. + ENABLED(RIGIDBOT_PANEL) \
  1276. + ENABLED(RA_CONTROL_PANEL) \
  1277. + ENABLED(LCD_SAINSMART_I2C_1602) \
  1278. + ENABLED(LCD_SAINSMART_I2C_2004) \
  1279. + ENABLED(LCM1602) \
  1280. + ENABLED(LCD_I2C_PANELOLU2) \
  1281. + ENABLED(LCD_I2C_VIKI) \
  1282. + (ENABLED(U8GLIB_SSD1306) && DISABLED(OLED_PANEL_TINYBOY2) && DISABLED(MKS_12864OLED_SSD1306)) \
  1283. + ENABLED(SAV_3DLCD) \
  1284. + ENABLED(BQ_LCD_SMART_CONTROLLER) \
  1285. + ENABLED(SAV_3DGLCD) \
  1286. + ENABLED(OLED_PANEL_TINYBOY2) \
  1287. + ENABLED(ZONESTAR_LCD) \
  1288. + ENABLED(ULTI_CONTROLLER)
  1289. #error "Please select no more than one LCD controller option."
  1290. #endif
  1291. /**
  1292. * Make sure HAVE_TMC26X is warranted
  1293. */
  1294. #if ENABLED(HAVE_TMC26X) && !( \
  1295. ENABLED( X_IS_TMC26X ) \
  1296. || ENABLED( X2_IS_TMC26X ) \
  1297. || ENABLED( Y_IS_TMC26X ) \
  1298. || ENABLED( Y2_IS_TMC26X ) \
  1299. || ENABLED( Z_IS_TMC26X ) \
  1300. || ENABLED( Z2_IS_TMC26X ) \
  1301. || ENABLED( E0_IS_TMC26X ) \
  1302. || ENABLED( E1_IS_TMC26X ) \
  1303. || ENABLED( E2_IS_TMC26X ) \
  1304. || ENABLED( E3_IS_TMC26X ) \
  1305. || ENABLED( E4_IS_TMC26X ) \
  1306. )
  1307. #error "HAVE_TMC26X requires at least one TMC26X stepper to be set."
  1308. #endif
  1309. /**
  1310. * Make sure HAVE_TMC2130 is warranted
  1311. */
  1312. #if ENABLED(HAVE_TMC2130)
  1313. #if !( ENABLED( X_IS_TMC2130 ) \
  1314. || ENABLED( X2_IS_TMC2130 ) \
  1315. || ENABLED( Y_IS_TMC2130 ) \
  1316. || ENABLED( Y2_IS_TMC2130 ) \
  1317. || ENABLED( Z_IS_TMC2130 ) \
  1318. || ENABLED( Z2_IS_TMC2130 ) \
  1319. || ENABLED( E0_IS_TMC2130 ) \
  1320. || ENABLED( E1_IS_TMC2130 ) \
  1321. || ENABLED( E2_IS_TMC2130 ) \
  1322. || ENABLED( E3_IS_TMC2130 ) \
  1323. || ENABLED( E4_IS_TMC2130 ) )
  1324. #error "HAVE_TMC2130 requires at least one TMC2130 stepper to be set."
  1325. #elif ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP)
  1326. #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD."
  1327. #endif
  1328. #if ENABLED(X_IS_TMC2130) && !PIN_EXISTS(X_CS)
  1329. #error "X_CS_PIN is required for X_IS_TMC2130. Define X_CS_PIN in Configuration_adv.h."
  1330. #elif ENABLED(X2_IS_TMC2130) && !PIN_EXISTS(X2_CS)
  1331. #error "X2_CS_PIN is required for X2_IS_TMC2130. Define X2_CS_PIN in Configuration_adv.h."
  1332. #elif ENABLED(Y_IS_TMC2130) && !PIN_EXISTS(Y_CS)
  1333. #error "Y_CS_PIN is required for Y_IS_TMC2130. Define Y_CS_PIN in Configuration_adv.h."
  1334. #elif ENABLED(Y2_IS_TMC2130) && !PIN_EXISTS(Y2_CS)
  1335. #error "Y2_CS_PIN is required for Y2_IS_TMC2130. Define Y2_CS_PIN in Configuration_adv.h."
  1336. #elif ENABLED(Z_IS_TMC2130) && !PIN_EXISTS(Z_CS)
  1337. #error "Z_CS_PIN is required for Z_IS_TMC2130. Define Z_CS_PIN in Configuration_adv.h."
  1338. #elif ENABLED(Z2_IS_TMC2130) && !PIN_EXISTS(Z2_CS)
  1339. #error "Z2_CS_PIN is required for Z2_IS_TMC2130. Define Z2_CS_PIN in Configuration_adv.h."
  1340. #elif ENABLED(E0_IS_TMC2130) && !PIN_EXISTS(E0_CS)
  1341. #error "E0_CS_PIN is required for E0_IS_TMC2130. Define E0_CS_PIN in Configuration_adv.h."
  1342. #elif ENABLED(E1_IS_TMC2130) && !PIN_EXISTS(E1_CS)
  1343. #error "E1_CS_PIN is required for E1_IS_TMC2130. Define E1_CS_PIN in Configuration_adv.h."
  1344. #elif ENABLED(E2_IS_TMC2130) && !PIN_EXISTS(E2_CS)
  1345. #error "E2_CS_PIN is required for E2_IS_TMC2130. Define E2_CS_PIN in Configuration_adv.h."
  1346. #elif ENABLED(E3_IS_TMC2130) && !PIN_EXISTS(E3_CS)
  1347. #error "E3_CS_PIN is required for E3_IS_TMC2130. Define E3_CS_PIN in Configuration_adv.h."
  1348. #elif ENABLED(E4_IS_TMC2130) && !PIN_EXISTS(E4_CS)
  1349. #error "E4_CS_PIN is required for E4_IS_TMC2130. Define E4_CS_PIN in Configuration_adv.h."
  1350. #endif
  1351. #if ENABLED(SENSORLESS_HOMING)
  1352. // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop
  1353. // is necessary in order to reset the stallGuard indication between the initial movement of all three
  1354. // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of
  1355. // clearing the stallGuard activated status is found.
  1356. #if ENABLED(DELTA) && !ENABLED(STEALTHCHOP)
  1357. #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP."
  1358. #elif X_HOME_DIR == -1 && DISABLED(X_MIN_ENDSTOP_INVERTING)
  1359. #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING when homing to X_MIN."
  1360. #elif X_HOME_DIR == 1 && DISABLED(X_MAX_ENDSTOP_INVERTING)
  1361. #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING when homing to X_MAX."
  1362. #elif Y_HOME_DIR == -1 && DISABLED(Y_MIN_ENDSTOP_INVERTING)
  1363. #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING when homing to Y_MIN."
  1364. #elif Y_HOME_DIR == 1 && DISABLED(Y_MAX_ENDSTOP_INVERTING)
  1365. #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING when homing to Y_MAX."
  1366. #endif
  1367. #endif
  1368. // Sensorless homing is required for both combined steppers in an H-bot
  1369. #if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS
  1370. #error "CoreXY requires both X and Y to use sensorless homing if either does."
  1371. #elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS
  1372. #error "CoreXZ requires both X and Z to use sensorless homing if either does."
  1373. #elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS
  1374. #error "CoreYZ requires both Y and Z to use sensorless homing if either does."
  1375. #endif
  1376. #elif ENABLED(SENSORLESS_HOMING)
  1377. #error "SENSORLESS_HOMING requires TMC2130 stepper drivers."
  1378. #endif
  1379. /**
  1380. * Make sure HAVE_TMC2208 is warranted
  1381. */
  1382. #if ENABLED(HAVE_TMC2208) && !( \
  1383. ENABLED( X_IS_TMC2208 ) \
  1384. || ENABLED( X2_IS_TMC2208 ) \
  1385. || ENABLED( Y_IS_TMC2208 ) \
  1386. || ENABLED( Y2_IS_TMC2208 ) \
  1387. || ENABLED( Z_IS_TMC2208 ) \
  1388. || ENABLED( Z2_IS_TMC2208 ) \
  1389. || ENABLED( E0_IS_TMC2208 ) \
  1390. || ENABLED( E1_IS_TMC2208 ) \
  1391. || ENABLED( E2_IS_TMC2208 ) \
  1392. || ENABLED( E3_IS_TMC2208 ) )
  1393. #error "HAVE_TMC2208 requires at least one TMC2208 stepper to be set."
  1394. #endif
  1395. /**
  1396. * TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI)
  1397. */
  1398. #if ENABLED(HAVE_TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \
  1399. defined(X_HARDWARE_SERIAL ) \
  1400. || defined(X2_HARDWARE_SERIAL) \
  1401. || defined(Y_HARDWARE_SERIAL ) \
  1402. || defined(Y2_HARDWARE_SERIAL) \
  1403. || defined(Z_HARDWARE_SERIAL ) \
  1404. || defined(Z2_HARDWARE_SERIAL) \
  1405. || defined(E0_HARDWARE_SERIAL) \
  1406. || defined(E1_HARDWARE_SERIAL) \
  1407. || defined(E2_HARDWARE_SERIAL) \
  1408. || defined(E3_HARDWARE_SERIAL) \
  1409. || defined(E4_HARDWARE_SERIAL) )
  1410. #error "select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE."
  1411. #endif
  1412. #if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP)
  1413. #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD."
  1414. #endif
  1415. #if ENABLED(TMC_Z_CALIBRATION) && !Z_IS_TRINAMIC && !Z2_IS_TRINAMIC
  1416. #error "TMC_Z_CALIBRATION requires at least one TMC driver on Z axis"
  1417. #endif
  1418. /**
  1419. * Make sure HAVE_L6470DRIVER is warranted
  1420. */
  1421. #if ENABLED(HAVE_L6470DRIVER) && !( \
  1422. ENABLED( X_IS_L6470 ) \
  1423. || ENABLED( X2_IS_L6470 ) \
  1424. || ENABLED( Y_IS_L6470 ) \
  1425. || ENABLED( Y2_IS_L6470 ) \
  1426. || ENABLED( Z_IS_L6470 ) \
  1427. || ENABLED( Z2_IS_L6470 ) \
  1428. || ENABLED( E0_IS_L6470 ) \
  1429. || ENABLED( E1_IS_L6470 ) \
  1430. || ENABLED( E2_IS_L6470 ) \
  1431. || ENABLED( E3_IS_L6470 ) \
  1432. || ENABLED( E4_IS_L6470 ) \
  1433. )
  1434. #error "HAVE_L6470DRIVER requires at least one L6470 stepper to be set."
  1435. #endif
  1436. /**
  1437. * Check that each axis has only one driver selected
  1438. */
  1439. #if 1 < 0 \
  1440. + ENABLED(X_IS_TMC26X) \
  1441. + ENABLED(X_IS_TMC2130) \
  1442. + ENABLED(X_IS_TMC2208) \
  1443. + ENABLED(X_IS_L6470)
  1444. #error "Please enable only one stepper driver for the X axis."
  1445. #endif
  1446. #if 1 < 0 \
  1447. + ENABLED(X2_IS_TMC26X) \
  1448. + ENABLED(X2_IS_TMC2130) \
  1449. + ENABLED(X2_IS_TMC2208) \
  1450. + ENABLED(X2_IS_L6470)
  1451. #error "Please enable only one stepper driver for the X2 axis."
  1452. #endif
  1453. #if 1 < 0 \
  1454. + ENABLED(Y_IS_TMC26X) \
  1455. + ENABLED(Y_IS_TMC2130) \
  1456. + ENABLED(Y_IS_TMC2208) \
  1457. + ENABLED(Y_IS_L6470)
  1458. #error "Please enable only one stepper driver for the Y axis."
  1459. #endif
  1460. #if 1 < 0 \
  1461. + ENABLED(Y2_IS_TMC26X) \
  1462. + ENABLED(Y2_IS_TMC2130) \
  1463. + ENABLED(Y2_IS_TMC2208) \
  1464. + ENABLED(Y2_IS_L6470)
  1465. #error "Please enable only one stepper driver for the Y2 axis."
  1466. #endif
  1467. #if 1 < 0 \
  1468. + ENABLED(Z_IS_TMC26X) \
  1469. + ENABLED(Z_IS_TMC2130) \
  1470. + ENABLED(Z_IS_TMC2208) \
  1471. + ENABLED(Z_IS_L6470)
  1472. #error "Please enable only one stepper driver for the Z axis."
  1473. #endif
  1474. #if 1 < 0 \
  1475. + ENABLED(Z2_IS_TMC26X) \
  1476. + ENABLED(Z2_IS_TMC2130) \
  1477. + ENABLED(Z2_IS_TMC2208) \
  1478. + ENABLED(Z2_IS_L6470)
  1479. #error "Please enable only one stepper driver for the Z2 axis."
  1480. #endif
  1481. #if 1 < 0 \
  1482. + ENABLED(E0_IS_TMC26X) \
  1483. + ENABLED(E0_IS_TMC2130) \
  1484. + ENABLED(E0_IS_TMC2208) \
  1485. + ENABLED(E0_IS_L6470)
  1486. #error "Please enable only one stepper driver for the E0 axis."
  1487. #endif
  1488. #if 1 < 0 \
  1489. + ENABLED(E1_IS_TMC26X) \
  1490. + ENABLED(E1_IS_TMC2130) \
  1491. + ENABLED(E1_IS_TMC2208) \
  1492. + ENABLED(E1_IS_L6470)
  1493. #error "Please enable only one stepper driver for the E1 axis."
  1494. #endif
  1495. #if 1 < 0 \
  1496. + ENABLED(E2_IS_TMC26X) \
  1497. + ENABLED(E2_IS_TMC2130) \
  1498. + ENABLED(E2_IS_TMC2208) \
  1499. + ENABLED(E2_IS_L6470)
  1500. #error "Please enable only one stepper driver for the E2 axis."
  1501. #endif
  1502. #if 1 < 0 \
  1503. + ENABLED(E3_IS_TMC26X) \
  1504. + ENABLED(E3_IS_TMC2130) \
  1505. + ENABLED(E3_IS_TMC2208) \
  1506. + ENABLED(E3_IS_L6470)
  1507. #error "Please enable only one stepper driver for the E3 axis."
  1508. #endif
  1509. #if 1 < 0 \
  1510. + ENABLED(E4_IS_TMC26X) \
  1511. + ENABLED(E4_IS_TMC2130) \
  1512. + ENABLED(E4_IS_TMC2208) \
  1513. + ENABLED(E4_IS_L6470)
  1514. #error "Please enable only one stepper driver for the E4 axis."
  1515. #endif
  1516. /**
  1517. * Digipot requirement
  1518. */
  1519. #if ENABLED(DIGIPOT_MCP4018)
  1520. #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
  1521. || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)
  1522. #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined."
  1523. #endif
  1524. #endif
  1525. /**
  1526. * Require 4 or more elements in per-axis initializers
  1527. */
  1528. constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT,
  1529. sanity_arr_2[] = DEFAULT_MAX_FEEDRATE,
  1530. sanity_arr_3[] = DEFAULT_MAX_ACCELERATION;
  1531. static_assert(COUNT(sanity_arr_1) >= XYZE, "DEFAULT_AXIS_STEPS_PER_UNIT requires 4 (or more) elements.");
  1532. static_assert(COUNT(sanity_arr_2) >= XYZE, "DEFAULT_MAX_FEEDRATE requires 4 (or more) elements.");
  1533. static_assert(COUNT(sanity_arr_3) >= XYZE, "DEFAULT_MAX_ACCELERATION requires 4 (or more) elements.");
  1534. static_assert(COUNT(sanity_arr_1) <= XYZE_N, "DEFAULT_AXIS_STEPS_PER_UNIT has too many elements.");
  1535. static_assert(COUNT(sanity_arr_2) <= XYZE_N, "DEFAULT_MAX_FEEDRATE has too many elements.");
  1536. static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too many elements.");
  1537. #if ENABLED(CNC_COORDINATE_SYSTEMS) && ENABLED(NO_WORKSPACE_OFFSETS)
  1538. #error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS."
  1539. #endif
  1540. #if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE)
  1541. #error "BLOCK_BUFFER_SIZE must be a power of 2."
  1542. #endif
  1543. #if ENABLED(LED_CONTROL_MENU) && DISABLED(ULTIPANEL)
  1544. #error "LED_CONTROL_MENU requires an LCD controller."
  1545. #endif
  1546. #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED)
  1547. #error "CASE_LIGHT_USE_NEOPIXEL requires NEOPIXEL_LED."
  1548. #endif
  1549. #if ENABLED(SKEW_CORRECTION)
  1550. #if !defined(XY_SKEW_FACTOR) && !(defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD))
  1551. #error "SKEW_CORRECTION requires XY_SKEW_FACTOR or XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD."
  1552. #endif
  1553. #if ENABLED(SKEW_CORRECTION_FOR_Z)
  1554. #if !defined(XZ_SKEW_FACTOR) && !(defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD))
  1555. #error "SKEW_CORRECTION requires XZ_SKEW_FACTOR or XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD."
  1556. #endif
  1557. #if !defined(YZ_SKEW_FACTOR) && !(defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD))
  1558. #error "SKEW_CORRECTION requires YZ_SKEW_FACTOR or YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD."
  1559. #endif
  1560. #endif
  1561. #endif
  1562. #endif // _SANITYCHECK_H_