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

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