My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

Conditionals_adv.h 31KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035
  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. * Conditionals_adv.h
  25. * Conditionals set before pins.h and which depend on Configuration_adv.h.
  26. */
  27. #ifndef AXIS_RELATIVE_MODES
  28. #define AXIS_RELATIVE_MODES {}
  29. #endif
  30. #ifdef SWITCHING_NOZZLE_E1_SERVO_NR
  31. #define SWITCHING_NOZZLE_TWO_SERVOS 1
  32. #endif
  33. // Determine NUM_SERVOS if none was supplied
  34. #ifndef NUM_SERVOS
  35. #define NUM_SERVOS 0
  36. #if ANY(HAS_Z_SERVO_PROBE, CHAMBER_VENT, SWITCHING_TOOLHEAD, SWITCHING_EXTRUDER, SWITCHING_NOZZLE, SPINDLE_SERVO)
  37. #if NUM_SERVOS <= Z_PROBE_SERVO_NR
  38. #undef NUM_SERVOS
  39. #define NUM_SERVOS (Z_PROBE_SERVO_NR + 1)
  40. #endif
  41. #if NUM_SERVOS <= CHAMBER_VENT_SERVO_NR
  42. #undef NUM_SERVOS
  43. #define NUM_SERVOS (CHAMBER_VENT_SERVO_NR + 1)
  44. #endif
  45. #if NUM_SERVOS <= SWITCHING_TOOLHEAD_SERVO_NR
  46. #undef NUM_SERVOS
  47. #define NUM_SERVOS (SWITCHING_TOOLHEAD_SERVO_NR + 1)
  48. #endif
  49. #if NUM_SERVOS <= SWITCHING_NOZZLE_SERVO_NR
  50. #undef NUM_SERVOS
  51. #define NUM_SERVOS (SWITCHING_NOZZLE_SERVO_NR + 1)
  52. #endif
  53. #if NUM_SERVOS <= SWITCHING_NOZZLE_E1_SERVO_NR
  54. #undef NUM_SERVOS
  55. #define NUM_SERVOS (SWITCHING_NOZZLE_E1_SERVO_NR + 1)
  56. #endif
  57. #if NUM_SERVOS <= SWITCHING_EXTRUDER_SERVO_NR
  58. #undef NUM_SERVOS
  59. #define NUM_SERVOS (SWITCHING_EXTRUDER_SERVO_NR + 1)
  60. #endif
  61. #if NUM_SERVOS <= SWITCHING_EXTRUDER_E23_SERVO_NR
  62. #undef NUM_SERVOS
  63. #define NUM_SERVOS (SWITCHING_EXTRUDER_E23_SERVO_NR + 1)
  64. #endif
  65. #if NUM_SERVOS <= SPINDLE_SERVO_NR
  66. #undef NUM_SERVOS
  67. #define NUM_SERVOS (SPINDLE_SERVO_NR + 1)
  68. #endif
  69. #endif
  70. #endif
  71. // Convenience override for a BLTouch alone
  72. #if ENABLED(BLTOUCH) && NUM_SERVOS == 1
  73. #undef SERVO_DELAY
  74. #define SERVO_DELAY { 50 }
  75. #endif
  76. #if !HAS_EXTRUDERS
  77. #define NO_VOLUMETRICS
  78. #undef TEMP_SENSOR_0
  79. #undef TEMP_SENSOR_1
  80. #undef TEMP_SENSOR_2
  81. #undef TEMP_SENSOR_3
  82. #undef TEMP_SENSOR_4
  83. #undef TEMP_SENSOR_5
  84. #undef TEMP_SENSOR_6
  85. #undef TEMP_SENSOR_7
  86. #undef FWRETRACT
  87. #undef PIDTEMP
  88. #undef AUTOTEMP
  89. #undef PID_EXTRUSION_SCALING
  90. #undef LIN_ADVANCE
  91. #undef FILAMENT_RUNOUT_SENSOR
  92. #undef ADVANCED_PAUSE_FEATURE
  93. #undef FILAMENT_RUNOUT_DISTANCE_MM
  94. #undef FILAMENT_LOAD_UNLOAD_GCODES
  95. #undef DISABLE_INACTIVE_EXTRUDER
  96. #undef FILAMENT_LOAD_UNLOAD_GCODES
  97. #undef EXTRUDER_RUNOUT_PREVENT
  98. #undef PREVENT_COLD_EXTRUSION
  99. #undef PREVENT_LENGTHY_EXTRUDE
  100. #undef THERMAL_PROTECTION_HOTENDS
  101. #undef THERMAL_PROTECTION_PERIOD
  102. #undef WATCH_TEMP_PERIOD
  103. #undef SHOW_TEMP_ADC_VALUES
  104. #undef LCD_SHOW_E_TOTAL
  105. #undef MANUAL_E_MOVES_RELATIVE
  106. #undef STEALTHCHOP_E
  107. #endif
  108. /**
  109. * Temperature Sensors; define what sensor(s) we have.
  110. */
  111. // Temperature sensor IDs
  112. #define HID_REDUNDANT -6
  113. #define HID_BOARD -5
  114. #define HID_COOLER -4
  115. #define HID_PROBE -3
  116. #define HID_CHAMBER -2
  117. #define HID_BED -1
  118. #define HID_E0 0
  119. #define HID_E1 1
  120. #define HID_E2 2
  121. #define HID_E3 3
  122. #define HID_E4 4
  123. #define HID_E5 5
  124. #define HID_E6 6
  125. #define HID_E7 7
  126. #define _SENSOR_IS(I,N) || (TEMP_SENSOR_##N == I)
  127. #define _E_SENSOR_IS(I,N) _SENSOR_IS(N,I)
  128. #define ANY_THERMISTOR_IS(N) (0 REPEAT2(HOTENDS, _E_SENSOR_IS, N) \
  129. _SENSOR_IS(N,BED) _SENSOR_IS(N,PROBE) _SENSOR_IS(N,CHAMBER) \
  130. _SENSOR_IS(N,COOLER) _SENSOR_IS(N,BOARD) _SENSOR_IS(N,REDUNDANT) )
  131. #if ANY_THERMISTOR_IS(1000)
  132. #define HAS_USER_THERMISTORS 1
  133. #endif
  134. #if TEMP_SENSOR_REDUNDANT
  135. #define _HEATER_ID(M) HID_##M
  136. #define HEATER_ID(M) _HEATER_ID(M)
  137. #define REDUNDANT_TEMP_MATCH(M,N) (HEATER_ID(TEMP_SENSOR_REDUNDANT_##M) == _HEATER_ID(N))
  138. #else
  139. #define REDUNDANT_TEMP_MATCH(...) 0
  140. #endif
  141. #if TEMP_SENSOR_0 == -5 || TEMP_SENSOR_0 == -3 || TEMP_SENSOR_0 == -2
  142. #define TEMP_SENSOR_0_IS_MAX_TC 1
  143. #if TEMP_SENSOR_0 == -5
  144. #define TEMP_SENSOR_0_IS_MAX31865 1
  145. #define TEMP_SENSOR_0_MAX_TC_TMIN 0
  146. #define TEMP_SENSOR_0_MAX_TC_TMAX 1024
  147. #ifndef MAX31865_SENSOR_WIRES_0
  148. #define MAX31865_SENSOR_WIRES_0 2
  149. #endif
  150. #ifndef MAX31865_WIRE_OHMS_0
  151. #define MAX31865_WIRE_OHMS_0 0.0f
  152. #endif
  153. #elif TEMP_SENSOR_0 == -3
  154. #define TEMP_SENSOR_0_IS_MAX31855 1
  155. #define TEMP_SENSOR_0_MAX_TC_TMIN -270
  156. #define TEMP_SENSOR_0_MAX_TC_TMAX 1800
  157. #elif TEMP_SENSOR_0 == -2
  158. #define TEMP_SENSOR_0_IS_MAX6675 1
  159. #define TEMP_SENSOR_0_MAX_TC_TMIN 0
  160. #define TEMP_SENSOR_0_MAX_TC_TMAX 1024
  161. #endif
  162. #elif TEMP_SENSOR_0 == -4
  163. #define TEMP_SENSOR_0_IS_AD8495 1
  164. #elif TEMP_SENSOR_0 == -1
  165. #define TEMP_SENSOR_0_IS_AD595 1
  166. #elif TEMP_SENSOR_0 > 0
  167. #define TEMP_SENSOR_0_IS_THERMISTOR 1
  168. #if TEMP_SENSOR_0 == 1000
  169. #define TEMP_SENSOR_0_IS_CUSTOM 1
  170. #elif TEMP_SENSOR_0 == 998 || TEMP_SENSOR_0 == 999
  171. #define TEMP_SENSOR_0_IS_DUMMY 1
  172. #endif
  173. #else
  174. #undef HEATER_0_MINTEMP
  175. #undef HEATER_0_MAXTEMP
  176. #endif
  177. #if TEMP_SENSOR_1 == -5 || TEMP_SENSOR_1 == -3 || TEMP_SENSOR_1 == -2
  178. #define TEMP_SENSOR_1_IS_MAX_TC 1
  179. #if TEMP_SENSOR_1 == -5
  180. #define TEMP_SENSOR_1_IS_MAX31865 1
  181. #define TEMP_SENSOR_1_MAX_TC_TMIN 0
  182. #define TEMP_SENSOR_1_MAX_TC_TMAX 1024
  183. #ifndef MAX31865_SENSOR_WIRES_1
  184. #define MAX31865_SENSOR_WIRES_1 2
  185. #endif
  186. #ifndef MAX31865_WIRE_OHMS_1
  187. #define MAX31865_WIRE_OHMS_1 0.0f
  188. #endif
  189. #elif TEMP_SENSOR_1 == -3
  190. #define TEMP_SENSOR_1_IS_MAX31855 1
  191. #define TEMP_SENSOR_1_MAX_TC_TMIN -270
  192. #define TEMP_SENSOR_1_MAX_TC_TMAX 1800
  193. #elif TEMP_SENSOR_1 == -2
  194. #define TEMP_SENSOR_1_IS_MAX6675 1
  195. #define TEMP_SENSOR_1_MAX_TC_TMIN 0
  196. #define TEMP_SENSOR_1_MAX_TC_TMAX 1024
  197. #endif
  198. #if TEMP_SENSOR_1 != TEMP_SENSOR_0
  199. #if TEMP_SENSOR_1 == -5
  200. #error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match."
  201. #elif TEMP_SENSOR_1 == -3
  202. #error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match."
  203. #elif TEMP_SENSOR_1 == -2
  204. #error "If MAX6675 Thermocouple (-2) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match."
  205. #endif
  206. #endif
  207. #elif TEMP_SENSOR_1 == -4
  208. #define TEMP_SENSOR_1_IS_AD8495 1
  209. #elif TEMP_SENSOR_1 == -1
  210. #define TEMP_SENSOR_1_IS_AD595 1
  211. #elif TEMP_SENSOR_1 > 0
  212. #define TEMP_SENSOR_1_IS_THERMISTOR 1
  213. #if TEMP_SENSOR_1 == 1000
  214. #define TEMP_SENSOR_1_IS_CUSTOM 1
  215. #elif TEMP_SENSOR_1 == 998 || TEMP_SENSOR_1 == 999
  216. #define TEMP_SENSOR_1_IS_DUMMY 1
  217. #endif
  218. #else
  219. #undef HEATER_1_MINTEMP
  220. #undef HEATER_1_MAXTEMP
  221. #endif
  222. #if TEMP_SENSOR_REDUNDANT == -5 || TEMP_SENSOR_REDUNDANT == -3 || TEMP_SENSOR_REDUNDANT == -2
  223. #define TEMP_SENSOR_REDUNDANT_IS_MAX_TC 1
  224. #if TEMP_SENSOR_REDUNDANT == -5
  225. #if !REDUNDANT_TEMP_MATCH(SOURCE, E0) && !REDUNDANT_TEMP_MATCH(SOURCE, E1)
  226. #error "MAX31865 Thermocouples (-5) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1 (0/1)."
  227. #endif
  228. #define TEMP_SENSOR_REDUNDANT_IS_MAX31865 1
  229. #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN 0
  230. #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1024
  231. #elif TEMP_SENSOR_REDUNDANT == -3
  232. #if !REDUNDANT_TEMP_MATCH(SOURCE, E0) && !REDUNDANT_TEMP_MATCH(SOURCE, E1)
  233. #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1 (0/1)."
  234. #endif
  235. #define TEMP_SENSOR_REDUNDANT_IS_MAX31855 1
  236. #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN -270
  237. #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1800
  238. #elif TEMP_SENSOR_REDUNDANT == -2
  239. #if !REDUNDANT_TEMP_MATCH(SOURCE, E0) && !REDUNDANT_TEMP_MATCH(SOURCE, E1)
  240. #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1 (0/1)."
  241. #endif
  242. #define TEMP_SENSOR_REDUNDANT_IS_MAX6675 1
  243. #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN 0
  244. #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1024
  245. #endif
  246. // mimic setting up the source TEMP_SENSOR
  247. #if REDUNDANT_TEMP_MATCH(SOURCE, E0)
  248. #define TEMP_SENSOR_0_MAX_TC_TMIN TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN
  249. #define TEMP_SENSOR_0_MAX_TC_TMAX TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX
  250. #ifndef MAX31865_SENSOR_WIRES_0
  251. #define MAX31865_SENSOR_WIRES_0 2
  252. #endif
  253. #elif REDUNDANT_TEMP_MATCH(SOURCE, E1)
  254. #define TEMP_SENSOR_1_MAX_TC_TMIN TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN
  255. #define TEMP_SENSOR_1_MAX_TC_TMAX TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX
  256. #ifndef MAX31865_SENSOR_WIRES_1
  257. #define MAX31865_SENSOR_WIRES_1 2
  258. #endif
  259. #endif
  260. #if (TEMP_SENSOR_0_IS_MAX_TC && TEMP_SENSOR_REDUNDANT != TEMP_SENSOR_0) || (TEMP_SENSOR_1_IS_MAX_TC && TEMP_SENSOR_REDUNDANT != TEMP_SENSOR_1)
  261. #if TEMP_SENSOR_REDUNDANT == -5
  262. #error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_0/TEMP_SENSOR_1 then TEMP_SENSOR_REDUNDANT must match."
  263. #elif TEMP_SENSOR_REDUNDANT == -3
  264. #error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_0/TEMP_SENSOR_1 then TEMP_SENSOR_REDUNDANT must match."
  265. #elif TEMP_SENSOR_REDUNDANT == -2
  266. #error "If MAX6675 Thermocouple (-2) is used for TEMP_SENSOR_0/TEMP_SENSOR_1 then TEMP_SENSOR_REDUNDANT must match."
  267. #endif
  268. #endif
  269. #elif TEMP_SENSOR_REDUNDANT == -4
  270. #define TEMP_SENSOR_REDUNDANT_IS_AD8495 1
  271. #elif TEMP_SENSOR_REDUNDANT == -1
  272. #define TEMP_SENSOR_REDUNDANT_IS_AD595 1
  273. #elif TEMP_SENSOR_REDUNDANT > 0
  274. #define TEMP_SENSOR_REDUNDANT_IS_THERMISTOR 1
  275. #if TEMP_SENSOR_REDUNDANT == 1000
  276. #define TEMP_SENSOR_REDUNDANT_IS_CUSTOM 1
  277. #elif TEMP_SENSOR_REDUNDANT == 998 || TEMP_SENSOR_REDUNDANT == 999
  278. #error "Dummy sensors are not supported for TEMP_SENSOR_REDUNDANT."
  279. #endif
  280. #endif
  281. #if TEMP_SENSOR_0_IS_MAX_TC || TEMP_SENSOR_1_IS_MAX_TC || TEMP_SENSOR_REDUNDANT_IS_MAX_TC
  282. #define HAS_MAX_TC 1
  283. #endif
  284. #if TEMP_SENSOR_0_IS_MAX6675 || TEMP_SENSOR_1_IS_MAX6675 || TEMP_SENSOR_REDUNDANT_IS_MAX6675
  285. #define HAS_MAX6675 1
  286. #endif
  287. #if TEMP_SENSOR_0_IS_MAX31855 || TEMP_SENSOR_1_IS_MAX31855 || TEMP_SENSOR_REDUNDANT_IS_MAX31855
  288. #define HAS_MAX31855 1
  289. #endif
  290. #if TEMP_SENSOR_0_IS_MAX31865 || TEMP_SENSOR_1_IS_MAX31865 || TEMP_SENSOR_REDUNDANT_IS_MAX31865
  291. #define HAS_MAX31865 1
  292. #endif
  293. #if TEMP_SENSOR_2 == -4
  294. #define TEMP_SENSOR_2_IS_AD8495 1
  295. #elif TEMP_SENSOR_2 == -3
  296. #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_2."
  297. #elif TEMP_SENSOR_2 == -2
  298. #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_2."
  299. #elif TEMP_SENSOR_2 == -1
  300. #define TEMP_SENSOR_2_IS_AD595 1
  301. #elif TEMP_SENSOR_2 > 0
  302. #define TEMP_SENSOR_2_IS_THERMISTOR 1
  303. #if TEMP_SENSOR_2 == 1000
  304. #define TEMP_SENSOR_2_IS_CUSTOM 1
  305. #elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999
  306. #define TEMP_SENSOR_2_IS_DUMMY 1
  307. #endif
  308. #else
  309. #undef HEATER_2_MINTEMP
  310. #undef HEATER_2_MAXTEMP
  311. #endif
  312. #if TEMP_SENSOR_3 == -4
  313. #define TEMP_SENSOR_3_IS_AD8495 1
  314. #elif TEMP_SENSOR_3 == -3
  315. #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3."
  316. #elif TEMP_SENSOR_3 == -2
  317. #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3."
  318. #elif TEMP_SENSOR_3 == -1
  319. #define TEMP_SENSOR_3_IS_AD595 1
  320. #elif TEMP_SENSOR_3 > 0
  321. #define TEMP_SENSOR_3_IS_THERMISTOR 1
  322. #if TEMP_SENSOR_3 == 1000
  323. #define TEMP_SENSOR_3_IS_CUSTOM 1
  324. #elif TEMP_SENSOR_3 == 998 || TEMP_SENSOR_3 == 999
  325. #define TEMP_SENSOR_3_IS_DUMMY 1
  326. #endif
  327. #else
  328. #undef HEATER_3_MINTEMP
  329. #undef HEATER_3_MAXTEMP
  330. #endif
  331. #if TEMP_SENSOR_4 == -4
  332. #define TEMP_SENSOR_4_IS_AD8495 1
  333. #elif TEMP_SENSOR_4 == -3
  334. #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4."
  335. #elif TEMP_SENSOR_4 == -2
  336. #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4."
  337. #elif TEMP_SENSOR_4 == -1
  338. #define TEMP_SENSOR_4_IS_AD595 1
  339. #elif TEMP_SENSOR_4 > 0
  340. #define TEMP_SENSOR_4_IS_THERMISTOR 1
  341. #if TEMP_SENSOR_4 == 1000
  342. #define TEMP_SENSOR_4_IS_CUSTOM 1
  343. #elif TEMP_SENSOR_4 == 998 || TEMP_SENSOR_4 == 999
  344. #define TEMP_SENSOR_4_IS_DUMMY 1
  345. #endif
  346. #else
  347. #undef HEATER_4_MINTEMP
  348. #undef HEATER_4_MAXTEMP
  349. #endif
  350. #if TEMP_SENSOR_5 == -4
  351. #define TEMP_SENSOR_5_IS_AD8495 1
  352. #elif TEMP_SENSOR_5 == -3
  353. #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_5."
  354. #elif TEMP_SENSOR_5 == -2
  355. #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_5."
  356. #elif TEMP_SENSOR_5 == -1
  357. #define TEMP_SENSOR_5_IS_AD595 1
  358. #elif TEMP_SENSOR_5 > 0
  359. #define TEMP_SENSOR_5_IS_THERMISTOR 1
  360. #if TEMP_SENSOR_5 == 1000
  361. #define TEMP_SENSOR_5_IS_CUSTOM 1
  362. #elif TEMP_SENSOR_5 == 998 || TEMP_SENSOR_5 == 999
  363. #define TEMP_SENSOR_5_IS_DUMMY 1
  364. #endif
  365. #else
  366. #undef HEATER_5_MINTEMP
  367. #undef HEATER_5_MAXTEMP
  368. #endif
  369. #if TEMP_SENSOR_6 == -4
  370. #define TEMP_SENSOR_6_IS_AD8495 1
  371. #elif TEMP_SENSOR_6 == -3
  372. #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_6."
  373. #elif TEMP_SENSOR_6 == -2
  374. #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_6."
  375. #elif TEMP_SENSOR_6 == -1
  376. #define TEMP_SENSOR_6_IS_AD595 1
  377. #elif TEMP_SENSOR_6 > 0
  378. #define TEMP_SENSOR_6_IS_THERMISTOR 1
  379. #if TEMP_SENSOR_6 == 1000
  380. #define TEMP_SENSOR_6_IS_CUSTOM 1
  381. #elif TEMP_SENSOR_6 == 998 || TEMP_SENSOR_6 == 999
  382. #define TEMP_SENSOR_6_IS_DUMMY 1
  383. #endif
  384. #else
  385. #undef HEATER_6_MINTEMP
  386. #undef HEATER_6_MAXTEMP
  387. #endif
  388. #if TEMP_SENSOR_7 == -4
  389. #define TEMP_SENSOR_7_IS_AD8495 1
  390. #elif TEMP_SENSOR_7 == -3
  391. #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_7."
  392. #elif TEMP_SENSOR_7 == -2
  393. #error "MAX7775 Thermocouples (-2) not supported for TEMP_SENSOR_7."
  394. #elif TEMP_SENSOR_7 == -1
  395. #define TEMP_SENSOR_7_IS_AD595 1
  396. #elif TEMP_SENSOR_7 > 0
  397. #define TEMP_SENSOR_7_IS_THERMISTOR 1
  398. #if TEMP_SENSOR_7 == 1000
  399. #define TEMP_SENSOR_7_IS_CUSTOM 1
  400. #elif TEMP_SENSOR_7 == 998 || TEMP_SENSOR_7 == 999
  401. #define TEMP_SENSOR_7_IS_DUMMY 1
  402. #endif
  403. #else
  404. #undef HEATER_7_MINTEMP
  405. #undef HEATER_7_MAXTEMP
  406. #endif
  407. #if TEMP_SENSOR_BED == -4
  408. #define TEMP_SENSOR_BED_IS_AD8495 1
  409. #elif TEMP_SENSOR_BED == -3
  410. #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BED."
  411. #elif TEMP_SENSOR_BED == -2
  412. #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED."
  413. #elif TEMP_SENSOR_BED == -1
  414. #define TEMP_SENSOR_BED_IS_AD595 1
  415. #elif TEMP_SENSOR_BED > 0
  416. #define TEMP_SENSOR_BED_IS_THERMISTOR 1
  417. #if TEMP_SENSOR_BED == 1000
  418. #define TEMP_SENSOR_BED_IS_CUSTOM 1
  419. #elif TEMP_SENSOR_BED == 998 || TEMP_SENSOR_BED == 999
  420. #define TEMP_SENSOR_BED_IS_DUMMY 1
  421. #endif
  422. #else
  423. #undef THERMAL_PROTECTION_BED
  424. #undef THERMAL_PROTECTION_BED_PERIOD
  425. #undef BED_MINTEMP
  426. #undef BED_MAXTEMP
  427. #endif
  428. #if TEMP_SENSOR_CHAMBER == -4
  429. #define TEMP_SENSOR_CHAMBER_IS_AD8495 1
  430. #elif TEMP_SENSOR_CHAMBER == -3
  431. #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER."
  432. #elif TEMP_SENSOR_CHAMBER == -2
  433. #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER."
  434. #elif TEMP_SENSOR_CHAMBER == -1
  435. #define TEMP_SENSOR_CHAMBER_IS_AD595 1
  436. #elif TEMP_SENSOR_CHAMBER > 0
  437. #define TEMP_SENSOR_CHAMBER_IS_THERMISTOR 1
  438. #if TEMP_SENSOR_CHAMBER == 1000
  439. #define TEMP_SENSOR_CHAMBER_IS_CUSTOM 1
  440. #elif TEMP_SENSOR_CHAMBER == 998 || TEMP_SENSOR_CHAMBER == 999
  441. #define TEMP_SENSOR_CHAMBER_IS_DUMMY 1
  442. #endif
  443. #else
  444. #undef THERMAL_PROTECTION_CHAMBER
  445. #undef CHAMBER_MINTEMP
  446. #undef CHAMBER_MAXTEMP
  447. #endif
  448. #if TEMP_SENSOR_COOLER == -4
  449. #define TEMP_SENSOR_COOLER_IS_AD8495 1
  450. #elif TEMP_SENSOR_COOLER == -3
  451. #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_COOLER."
  452. #elif TEMP_SENSOR_COOLER == -2
  453. #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_COOLER."
  454. #elif TEMP_SENSOR_COOLER == -1
  455. #define TEMP_SENSOR_COOLER_IS_AD595 1
  456. #elif TEMP_SENSOR_COOLER > 0
  457. #define TEMP_SENSOR_COOLER_IS_THERMISTOR 1
  458. #if TEMP_SENSOR_COOLER == 1000
  459. #define TEMP_SENSOR_COOLER_IS_CUSTOM 1
  460. #elif TEMP_SENSOR_COOLER == 998 || TEMP_SENSOR_COOLER == 999
  461. #define TEMP_SENSOR_COOLER_IS_DUMMY 1
  462. #endif
  463. #else
  464. #undef THERMAL_PROTECTION_COOLER
  465. #undef COOLER_MINTEMP
  466. #undef COOLER_MAXTEMP
  467. #endif
  468. #if TEMP_SENSOR_PROBE == -4
  469. #define TEMP_SENSOR_PROBE_IS_AD8495 1
  470. #elif TEMP_SENSOR_PROBE == -3
  471. #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_PROBE."
  472. #elif TEMP_SENSOR_PROBE == -2
  473. #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_PROBE."
  474. #elif TEMP_SENSOR_PROBE == -1
  475. #define TEMP_SENSOR_PROBE_IS_AD595 1
  476. #elif TEMP_SENSOR_PROBE > 0
  477. #define TEMP_SENSOR_PROBE_IS_THERMISTOR 1
  478. #if TEMP_SENSOR_PROBE == 1000
  479. #define TEMP_SENSOR_PROBE_IS_CUSTOM 1
  480. #elif TEMP_SENSOR_PROBE == 998 || TEMP_SENSOR_PROBE == 999
  481. #define TEMP_SENSOR_PROBE_IS_DUMMY 1
  482. #endif
  483. #endif
  484. #if TEMP_SENSOR_BOARD == -4
  485. #define TEMP_SENSOR_BOARD_IS_AD8495 1
  486. #elif TEMP_SENSOR_BOARD == -3
  487. #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BOARD."
  488. #elif TEMP_SENSOR_BOARD == -2
  489. #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BOARD."
  490. #elif TEMP_SENSOR_BOARD == -1
  491. #define TEMP_SENSOR_BOARD_IS_AD595 1
  492. #elif TEMP_SENSOR_BOARD > 0
  493. #define TEMP_SENSOR_BOARD_IS_THERMISTOR 1
  494. #if TEMP_SENSOR_BOARD == 1000
  495. #define TEMP_SENSOR_BOARD_IS_CUSTOM 1
  496. #elif TEMP_SENSOR_BOARD == 998 || TEMP_SENSOR_BOARD == 999
  497. #define TEMP_SENSOR_BOARD_IS_DUMMY 1
  498. #endif
  499. #endif
  500. #if ENABLED(MIXING_EXTRUDER) && (ENABLED(RETRACT_SYNC_MIXING) || BOTH(FILAMENT_LOAD_UNLOAD_GCODES, FILAMENT_UNLOAD_ALL_EXTRUDERS))
  501. #define HAS_MIXER_SYNC_CHANNEL 1
  502. #endif
  503. #if EITHER(DUAL_X_CARRIAGE, MULTI_NOZZLE_DUPLICATION)
  504. #define HAS_DUPLICATION_MODE 1
  505. #endif
  506. #if ENABLED(PRINTCOUNTER) && (SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0)
  507. #define HAS_SERVICE_INTERVALS 1
  508. #endif
  509. #if ENABLED(FILAMENT_RUNOUT_SENSOR)
  510. #define HAS_FILAMENT_SENSOR 1
  511. #if NUM_RUNOUT_SENSORS > 1
  512. #define MULTI_FILAMENT_SENSOR 1
  513. #endif
  514. #ifdef FILAMENT_RUNOUT_DISTANCE_MM
  515. #define HAS_FILAMENT_RUNOUT_DISTANCE 1
  516. #endif
  517. #if ENABLED(MIXING_EXTRUDER)
  518. #define WATCH_ALL_RUNOUT_SENSORS
  519. #endif
  520. #endif
  521. // Probe Temperature Compensation
  522. #if !TEMP_SENSOR_PROBE
  523. #undef PTC_PROBE
  524. #endif
  525. #if !TEMP_SENSOR_BED
  526. #undef PTC_BED
  527. #endif
  528. #if !HAS_EXTRUDERS
  529. #undef PTC_HOTEND
  530. #endif
  531. #if ANY(PTC_PROBE, PTC_BED, PTC_HOTEND)
  532. #define HAS_PTC 1
  533. #endif
  534. // Let SD_FINISHED_RELEASECOMMAND stand in for SD_FINISHED_STEPPERRELEASE
  535. #if ENABLED(SD_FINISHED_STEPPERRELEASE)
  536. #ifndef SD_FINISHED_RELEASECOMMAND
  537. #define SD_FINISHED_RELEASECOMMAND "M84" // planner.finish_and_disable()
  538. #endif
  539. #else
  540. #undef SD_FINISHED_RELEASECOMMAND
  541. #endif
  542. #if ENABLED(NO_SD_AUTOSTART)
  543. #undef MENU_ADDAUTOSTART
  544. #endif
  545. #if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
  546. #define HAS_PRINT_PROGRESS 1
  547. #endif
  548. #if STATUS_MESSAGE_TIMEOUT_SEC > 0
  549. #define HAS_STATUS_MESSAGE_TIMEOUT 1
  550. #endif
  551. #if ENABLED(SDSUPPORT) && SD_PROCEDURE_DEPTH
  552. #define HAS_MEDIA_SUBCALLS 1
  553. #endif
  554. #if HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME)
  555. #define HAS_PRINT_PROGRESS_PERMYRIAD 1
  556. #endif
  557. #if ANY(MARLIN_BRICKOUT, MARLIN_INVADERS, MARLIN_SNAKE, MARLIN_MAZE)
  558. #define HAS_GAMES 1
  559. #if MANY(MARLIN_BRICKOUT, MARLIN_INVADERS, MARLIN_SNAKE, MARLIN_MAZE)
  560. #define HAS_GAME_MENU 1
  561. #endif
  562. #endif
  563. #if ANY(FWRETRACT, HAS_LEVELING, SKEW_CORRECTION)
  564. #define HAS_POSITION_MODIFIERS 1
  565. #endif
  566. #if ANY(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS, Z_MULTI_ENDSTOPS)
  567. #define HAS_EXTRA_ENDSTOPS 1
  568. #endif
  569. #if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
  570. #define HAS_SOFTWARE_ENDSTOPS 1
  571. #endif
  572. #if ANY(EXTENSIBLE_UI, IS_NEWPANEL, EMERGENCY_PARSER, HAS_ADC_BUTTONS, HAS_DWIN_E3V2)
  573. #define HAS_RESUME_CONTINUE 1
  574. #endif
  575. #if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED)
  576. #define HAS_COLOR_LEDS 1
  577. #else
  578. #undef LED_POWEROFF_TIMEOUT
  579. #endif
  580. #if ALL(HAS_RESUME_CONTINUE, PRINTER_EVENT_LEDS, SDSUPPORT)
  581. #define HAS_LEDS_OFF_FLAG 1
  582. #endif
  583. #if EITHER(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
  584. #define HAS_MOTOR_CURRENT_I2C 1
  585. #endif
  586. #if ENABLED(Z_STEPPER_AUTO_ALIGN)
  587. #ifdef Z_STEPPER_ALIGN_STEPPER_XY
  588. #define HAS_Z_STEPPER_ALIGN_STEPPER_XY 1
  589. #undef Z_STEPPER_ALIGN_AMP
  590. #endif
  591. #ifndef Z_STEPPER_ALIGN_AMP
  592. #define Z_STEPPER_ALIGN_AMP 1.0
  593. #endif
  594. #endif
  595. // Multiple Z steppers
  596. #ifndef NUM_Z_STEPPER_DRIVERS
  597. #define NUM_Z_STEPPER_DRIVERS 1
  598. #endif
  599. // Fallback Stepper Driver types that depend on Configuration_adv.h
  600. #if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
  601. #define HAS_X2_STEPPER 1
  602. #else
  603. #undef X2_DRIVER_TYPE
  604. #endif
  605. #if DISABLED(Y_DUAL_STEPPER_DRIVERS)
  606. #undef Y2_DRIVER_TYPE
  607. #endif
  608. #if NUM_Z_STEPPER_DRIVERS < 4
  609. #undef Z4_DRIVER_TYPE
  610. #undef INVERT_Z4_VS_Z_DIR
  611. #if NUM_Z_STEPPER_DRIVERS < 3
  612. #undef Z3_DRIVER_TYPE
  613. #undef INVERT_Z3_VS_Z_DIR
  614. #if NUM_Z_STEPPER_DRIVERS < 2
  615. #undef Z2_DRIVER_TYPE
  616. #undef INVERT_Z2_VS_Z_DIR
  617. #endif
  618. #endif
  619. #endif
  620. //
  621. // Spindle/Laser power display types
  622. // Defined here so sanity checks can use them
  623. //
  624. #if EITHER(SPINDLE_FEATURE, LASER_FEATURE)
  625. #define HAS_CUTTER 1
  626. #define _CUTTER_POWER_PWM255 1
  627. #define _CUTTER_POWER_PERCENT 2
  628. #define _CUTTER_POWER_RPM 3
  629. #define _CUTTER_POWER(V) _CAT(_CUTTER_POWER_, V)
  630. #define CUTTER_UNIT_IS(V) (_CUTTER_POWER(CUTTER_POWER_UNIT) == _CUTTER_POWER(V))
  631. #endif
  632. #if !defined(__AVR__) || !defined(USBCON)
  633. // Define constants and variables for buffering serial data.
  634. // Use only 0 or powers of 2 greater than 1
  635. // : [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...]
  636. #ifndef RX_BUFFER_SIZE
  637. #define RX_BUFFER_SIZE 128
  638. #endif
  639. // 256 is the max TX buffer limit due to uint8_t head and tail
  640. // : [0, 4, 8, 16, 32, 64, 128, 256]
  641. #ifndef TX_BUFFER_SIZE
  642. #define TX_BUFFER_SIZE 32
  643. #endif
  644. #else
  645. // SERIAL_XON_XOFF not supported on USB-native devices
  646. #undef SERIAL_XON_XOFF
  647. #endif
  648. #if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER)
  649. #define HAS_GCODE_M876
  650. #endif
  651. #if ENABLED(HOST_ACTION_COMMANDS)
  652. #ifndef ACTION_ON_PAUSE
  653. #define ACTION_ON_PAUSE "pause"
  654. #endif
  655. #ifndef ACTION_ON_PAUSED
  656. #define ACTION_ON_PAUSED "paused"
  657. #endif
  658. #ifndef ACTION_ON_RESUME
  659. #define ACTION_ON_RESUME "resume"
  660. #endif
  661. #ifndef ACTION_ON_RESUMED
  662. #define ACTION_ON_RESUMED "resumed"
  663. #endif
  664. #ifndef ACTION_ON_CANCEL
  665. #define ACTION_ON_CANCEL "cancel"
  666. #endif
  667. #ifndef ACTION_ON_START
  668. #define ACTION_ON_START "start"
  669. #endif
  670. #ifndef ACTION_ON_KILL
  671. #define ACTION_ON_KILL "poweroff"
  672. #endif
  673. #ifndef SHUTDOWN_ACTION
  674. #define SHUTDOWN_ACTION "shutdown"
  675. #endif
  676. #if HAS_FILAMENT_SENSOR
  677. #ifndef ACTION_ON_FILAMENT_RUNOUT
  678. #define ACTION_ON_FILAMENT_RUNOUT "filament_runout"
  679. #endif
  680. #ifndef ACTION_REASON_ON_FILAMENT_RUNOUT
  681. #define ACTION_REASON_ON_FILAMENT_RUNOUT "filament_runout"
  682. #endif
  683. #endif
  684. #if ENABLED(G29_RETRY_AND_RECOVER)
  685. #ifndef ACTION_ON_G29_RECOVER
  686. #define ACTION_ON_G29_RECOVER "probe_rewipe"
  687. #endif
  688. #ifndef ACTION_ON_G29_FAILURE
  689. #define ACTION_ON_G29_FAILURE "probe_failed"
  690. #endif
  691. #endif
  692. #endif
  693. #if EITHER(FYSETC_MINI_12864_2_1, FYSETC_242_OLED_12864)
  694. #ifndef LED_USER_PRESET_GREEN
  695. #define LED_USER_PRESET_GREEN 128
  696. #endif
  697. #ifndef LED_USER_PRESET_BLUE
  698. #define LED_USER_PRESET_BLUE 0
  699. #endif
  700. #ifndef LED_USER_PRESET_BRIGHTNESS
  701. #define LED_USER_PRESET_BRIGHTNESS 255
  702. #endif
  703. #endif
  704. // Set defaults for unspecified LED user colors
  705. #if ENABLED(LED_CONTROL_MENU)
  706. #ifndef LED_USER_PRESET_RED
  707. #define LED_USER_PRESET_RED 255
  708. #endif
  709. #ifndef LED_USER_PRESET_GREEN
  710. #define LED_USER_PRESET_GREEN 255
  711. #endif
  712. #ifndef LED_USER_PRESET_BLUE
  713. #define LED_USER_PRESET_BLUE 255
  714. #endif
  715. #ifndef LED_USER_PRESET_WHITE
  716. #define LED_USER_PRESET_WHITE 0
  717. #endif
  718. #ifndef LED_USER_PRESET_BRIGHTNESS
  719. #ifdef NEOPIXEL_BRIGHTNESS
  720. #define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS
  721. #else
  722. #define LED_USER_PRESET_BRIGHTNESS 255
  723. #endif
  724. #endif
  725. #endif
  726. #if BOTH(LED_CONTROL_MENU, NEOPIXEL2_SEPARATE)
  727. #ifndef LED2_USER_PRESET_RED
  728. #define LED2_USER_PRESET_RED 255
  729. #endif
  730. #ifndef LED2_USER_PRESET_GREEN
  731. #define LED2_USER_PRESET_GREEN 255
  732. #endif
  733. #ifndef LED2_USER_PRESET_BLUE
  734. #define LED2_USER_PRESET_BLUE 255
  735. #endif
  736. #ifndef LED2_USER_PRESET_WHITE
  737. #define LED2_USER_PRESET_WHITE 0
  738. #endif
  739. #ifndef LED2_USER_PRESET_BRIGHTNESS
  740. #ifdef NEOPIXEL2_BRIGHTNESS
  741. #define LED2_USER_PRESET_BRIGHTNESS NEOPIXEL2_BRIGHTNESS
  742. #else
  743. #define LED2_USER_PRESET_BRIGHTNESS 255
  744. #endif
  745. #endif
  746. #endif
  747. // Full Touch Screen needs 'tft/xpt2046'
  748. #if EITHER(TFT_TOUCH_DEVICE_XPT2046, HAS_TFT_LVGL_UI)
  749. #define HAS_TFT_XPT2046 1
  750. #endif
  751. // Touch Screen or "Touch Buttons" need XPT2046 pins
  752. // but they use different components
  753. #if HAS_TFT_XPT2046 || HAS_RES_TOUCH_BUTTONS
  754. #define NEED_TOUCH_PINS 1
  755. #endif
  756. // Extensible UI pin mapping for RepRapDiscount
  757. #if ENABLED(TOUCH_UI_FTDI_EVE) && ANY(AO_EXP1_PINMAP, AO_EXP2_PINMAP, CR10_TFT_PINMAP)
  758. #define TOUCH_UI_ULTIPANEL 1
  759. #endif
  760. // Poll-based jogging for joystick and other devices
  761. #if ENABLED(JOYSTICK)
  762. #define POLL_JOG
  763. #endif
  764. #if X2_HOME_DIR > 0
  765. #define X2_HOME_TO_MAX 1
  766. #elif X2_HOME_DIR < 0
  767. #define X2_HOME_TO_MIN 1
  768. #endif
  769. #ifndef HOMING_BUMP_MM
  770. #define HOMING_BUMP_MM { 0, 0, 0 }
  771. #endif
  772. #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && NONE(USE_OTG_USB_HOST, USE_UHS3_USB)
  773. #define USE_UHS2_USB
  774. #endif
  775. /**
  776. * Driver Timings (in nanoseconds)
  777. * NOTE: Driver timing order is longest-to-shortest duration.
  778. * Preserve this ordering when adding new drivers.
  779. */
  780. #ifndef MINIMUM_STEPPER_POST_DIR_DELAY
  781. #if HAS_DRIVER(TB6560)
  782. #define MINIMUM_STEPPER_POST_DIR_DELAY 15000
  783. #elif HAS_DRIVER(TB6600)
  784. #define MINIMUM_STEPPER_POST_DIR_DELAY 1500
  785. #elif HAS_DRIVER(DRV8825)
  786. #define MINIMUM_STEPPER_POST_DIR_DELAY 650
  787. #elif HAS_DRIVER(LV8729)
  788. #define MINIMUM_STEPPER_POST_DIR_DELAY 500
  789. #elif HAS_DRIVER(A5984)
  790. #define MINIMUM_STEPPER_POST_DIR_DELAY 400
  791. #elif HAS_DRIVER(A4988)
  792. #define MINIMUM_STEPPER_POST_DIR_DELAY 200
  793. #elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE
  794. #define MINIMUM_STEPPER_POST_DIR_DELAY 60
  795. #else
  796. #define MINIMUM_STEPPER_POST_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire
  797. #endif
  798. #endif
  799. #ifndef MINIMUM_STEPPER_PRE_DIR_DELAY
  800. #define MINIMUM_STEPPER_PRE_DIR_DELAY MINIMUM_STEPPER_POST_DIR_DELAY
  801. #endif
  802. #ifndef MINIMUM_STEPPER_PULSE
  803. #if HAS_DRIVER(TB6560)
  804. #define MINIMUM_STEPPER_PULSE 30
  805. #elif HAS_DRIVER(TB6600)
  806. #define MINIMUM_STEPPER_PULSE 3
  807. #elif HAS_DRIVER(DRV8825)
  808. #define MINIMUM_STEPPER_PULSE 2
  809. #elif HAS_DRIVER(A4988) || HAS_DRIVER(A5984)
  810. #define MINIMUM_STEPPER_PULSE 1
  811. #elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE
  812. #define MINIMUM_STEPPER_PULSE 0
  813. #elif HAS_DRIVER(LV8729)
  814. #define MINIMUM_STEPPER_PULSE 0
  815. #else
  816. #define MINIMUM_STEPPER_PULSE 2
  817. #endif
  818. #endif
  819. #ifndef MAXIMUM_STEPPER_RATE
  820. #if HAS_DRIVER(TB6560)
  821. #define MAXIMUM_STEPPER_RATE 15000
  822. #elif HAS_DRIVER(TB6600)
  823. #define MAXIMUM_STEPPER_RATE 150000
  824. #elif HAS_DRIVER(DRV8825)
  825. #define MAXIMUM_STEPPER_RATE 250000
  826. #elif HAS_DRIVER(A4988)
  827. #define MAXIMUM_STEPPER_RATE 500000
  828. #elif HAS_DRIVER(LV8729)
  829. #define MAXIMUM_STEPPER_RATE 1000000
  830. #elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE
  831. #define MAXIMUM_STEPPER_RATE 5000000
  832. #else
  833. #define MAXIMUM_STEPPER_RATE 250000
  834. #endif
  835. #endif
  836. #if ENABLED(DIRECT_STEPPING)
  837. #ifndef STEPPER_PAGES
  838. #define STEPPER_PAGES 16
  839. #endif
  840. #ifndef STEPPER_PAGE_FORMAT
  841. #define STEPPER_PAGE_FORMAT SP_4x2_256
  842. #endif
  843. #ifndef PAGE_MANAGER
  844. #define PAGE_MANAGER SerialPageManager
  845. #endif
  846. #endif
  847. // Remove unused STEALTHCHOP flags
  848. #if NUM_AXES < 9
  849. #undef STEALTHCHOP_W
  850. #undef CALIBRATION_MEASURE_WMIN
  851. #undef CALIBRATION_MEASURE_WMAX
  852. #if NUM_AXES < 8
  853. #undef STEALTHCHOP_V
  854. #undef CALIBRATION_MEASURE_VMIN
  855. #undef CALIBRATION_MEASURE_VMAX
  856. #if NUM_AXES < 7
  857. #undef STEALTHCHOP_U
  858. #undef CALIBRATION_MEASURE_UMIN
  859. #undef CALIBRATION_MEASURE_UMAX
  860. #if NUM_AXES < 6
  861. #undef STEALTHCHOP_K
  862. #undef CALIBRATION_MEASURE_KMIN
  863. #undef CALIBRATION_MEASURE_KMAX
  864. #if NUM_AXES < 5
  865. #undef STEALTHCHOP_J
  866. #undef CALIBRATION_MEASURE_JMIN
  867. #undef CALIBRATION_MEASURE_JMAX
  868. #if NUM_AXES < 4
  869. #undef STEALTHCHOP_I
  870. #undef CALIBRATION_MEASURE_IMIN
  871. #undef CALIBRATION_MEASURE_IMAX
  872. #if NUM_AXES < 3
  873. #undef Z_IDLE_HEIGHT
  874. #undef STEALTHCHOP_Z
  875. #undef Z_PROBE_SLED
  876. #undef Z_SAFE_HOMING
  877. #undef HOME_Z_FIRST
  878. #undef HOMING_Z_WITH_PROBE
  879. #undef ENABLE_LEVELING_FADE_HEIGHT
  880. #undef NUM_Z_STEPPER_DRIVERS
  881. #undef CNC_WORKSPACE_PLANES
  882. #if NUM_AXES < 2
  883. #undef STEALTHCHOP_Y
  884. #endif
  885. #endif
  886. #endif
  887. #endif
  888. #endif
  889. #endif
  890. #endif
  891. #endif
  892. //
  893. // SD Card connection methods
  894. // Defined here so pins and sanity checks can use them
  895. //
  896. #if ENABLED(SDSUPPORT)
  897. #define _SDCARD_LCD 1
  898. #define _SDCARD_ONBOARD 2
  899. #define _SDCARD_CUSTOM_CABLE 3
  900. #define _SDCARD_ID(V) _CAT(_SDCARD_, V)
  901. #define SD_CONNECTION_IS(V) (_SDCARD_ID(SDCARD_CONNECTION) == _SDCARD_ID(V))
  902. #else
  903. #define SD_CONNECTION_IS(...) 0
  904. #endif
  905. // Power Monitor sensors
  906. #if EITHER(POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE)
  907. #define HAS_POWER_MONITOR 1
  908. #if ENABLED(POWER_MONITOR_CURRENT) && (ENABLED(POWER_MONITOR_VOLTAGE) || defined(POWER_MONITOR_FIXED_VOLTAGE))
  909. #define HAS_POWER_MONITOR_WATTS 1
  910. #endif
  911. #endif
  912. // Flag if an EEPROM type is pre-selected
  913. #if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM, QSPI_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION)
  914. #define NO_EEPROM_SELECTED 1
  915. #endif
  916. // Flag whether hex_print.cpp is used
  917. #if ANY(AUTO_BED_LEVELING_UBL, M100_FREE_MEMORY_WATCHER, DEBUG_GCODE_PARSER, TMC_DEBUG, MARLIN_DEV_MODE)
  918. #define NEED_HEX_PRINT 1
  919. #endif
  920. // Flags for Case Light having a color property or a single pin
  921. #if ENABLED(CASE_LIGHT_ENABLE)
  922. #if EITHER(CASE_LIGHT_USE_NEOPIXEL, CASE_LIGHT_USE_RGB_LED)
  923. #define CASE_LIGHT_IS_COLOR_LED 1
  924. #else
  925. #define NEED_CASE_LIGHT_PIN 1
  926. #endif
  927. #endif
  928. // Flags for Case Light having a brightness property
  929. #if ENABLED(CASE_LIGHT_ENABLE) && (NONE(CASE_LIGHT_NO_BRIGHTNESS, CASE_LIGHT_IS_COLOR_LED) || ENABLED(CASE_LIGHT_USE_NEOPIXEL))
  930. #define CASELIGHT_USES_BRIGHTNESS 1
  931. #endif
  932. // Flag whether least_squares_fit.cpp is used
  933. #if ANY(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_LINEAR, HAS_Z_STEPPER_ALIGN_STEPPER_XY)
  934. #define NEED_LSF 1
  935. #endif
  936. #if BOTH(HAS_TFT_LVGL_UI, CUSTOM_MENU_MAIN)
  937. #define _HAS_1(N) (defined(MAIN_MENU_ITEM_##N##_DESC) && defined(MAIN_MENU_ITEM_##N##_GCODE))
  938. #define HAS_USER_ITEM(V...) DO(HAS,||,V)
  939. #else
  940. #define HAS_USER_ITEM(N) 0
  941. #endif
  942. #if !HAS_MULTI_SERIAL
  943. #undef MEATPACK_ON_SERIAL_PORT_2
  944. #endif
  945. #if EITHER(MEATPACK_ON_SERIAL_PORT_1, MEATPACK_ON_SERIAL_PORT_2)
  946. #define HAS_MEATPACK 1
  947. #endif
  948. // AVR are (usually) too limited in resources to store the configuration into the binary
  949. #if ENABLED(CONFIGURATION_EMBEDDING) && !defined(FORCE_CONFIG_EMBED) && (defined(__AVR__) || DISABLED(SDSUPPORT) || EITHER(SDCARD_READONLY, DISABLE_M503))
  950. #undef CONFIGURATION_EMBEDDING
  951. #define CANNOT_EMBED_CONFIGURATION defined(__AVR__)
  952. #endif