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

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