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

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