My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

SanityCheck.h 143KB

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