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

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