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

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