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

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