My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sensitive_pins.h 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  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. // Prepare a list of protected pins for M42/M43
  25. //
  26. #if PIN_EXISTS(X_MIN)
  27. #define _X_MIN X_MIN_PIN,
  28. #else
  29. #define _X_MIN
  30. #endif
  31. #if PIN_EXISTS(X_MAX)
  32. #define _X_MAX X_MAX_PIN,
  33. #else
  34. #define _X_MAX
  35. #endif
  36. #if PIN_EXISTS(X_CS) && AXIS_HAS_SPI(X)
  37. #define _X_CS X_CS_PIN,
  38. #else
  39. #define _X_CS
  40. #endif
  41. #if PIN_EXISTS(X_MS1)
  42. #define _X_MS1 X_MS1_PIN,
  43. #else
  44. #define _X_MS1
  45. #endif
  46. #if PIN_EXISTS(X_MS2)
  47. #define _X_MS2 X_MS2_PIN,
  48. #else
  49. #define _X_MS2
  50. #endif
  51. #if PIN_EXISTS(X_MS3)
  52. #define _X_MS3 X_MS3_PIN,
  53. #else
  54. #define _X_MS3
  55. #endif
  56. #define _X_PINS X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, _X_MIN _X_MAX _X_MS1 _X_MS2 _X_MS3 _X_CS
  57. #if PIN_EXISTS(Y_MIN)
  58. #define _Y_MIN Y_MIN_PIN,
  59. #else
  60. #define _Y_MIN
  61. #endif
  62. #if PIN_EXISTS(Y_MAX)
  63. #define _Y_MAX Y_MAX_PIN,
  64. #else
  65. #define _Y_MAX
  66. #endif
  67. #if PIN_EXISTS(Y_CS) && AXIS_HAS_SPI(Y)
  68. #define _Y_CS Y_CS_PIN,
  69. #else
  70. #define _Y_CS
  71. #endif
  72. #if PIN_EXISTS(Y_MS1)
  73. #define _Y_MS1 Y_MS1_PIN,
  74. #else
  75. #define _Y_MS1
  76. #endif
  77. #if PIN_EXISTS(Y_MS2)
  78. #define _Y_MS2 Y_MS2_PIN,
  79. #else
  80. #define _Y_MS2
  81. #endif
  82. #if PIN_EXISTS(Y_MS3)
  83. #define _Y_MS3 Y_MS3_PIN,
  84. #else
  85. #define _Y_MS3
  86. #endif
  87. #define _Y_PINS Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, _Y_MIN _Y_MAX _Y_MS1 _Y_MS2 _Y_MS3 _Y_CS
  88. #if PIN_EXISTS(Z_MIN)
  89. #define _Z_MIN Z_MIN_PIN,
  90. #else
  91. #define _Z_MIN
  92. #endif
  93. #if PIN_EXISTS(Z_MAX)
  94. #define _Z_MAX Z_MAX_PIN,
  95. #else
  96. #define _Z_MAX
  97. #endif
  98. #if PIN_EXISTS(Z_CS) && AXIS_HAS_SPI(Z)
  99. #define _Z_CS Z_CS_PIN,
  100. #else
  101. #define _Z_CS
  102. #endif
  103. #if PIN_EXISTS(Z_MS1)
  104. #define _Z_MS1 Z_MS1_PIN,
  105. #else
  106. #define _Z_MS1
  107. #endif
  108. #if PIN_EXISTS(Z_MS2)
  109. #define _Z_MS2 Z_MS2_PIN,
  110. #else
  111. #define _Z_MS2
  112. #endif
  113. #if PIN_EXISTS(Z_MS3)
  114. #define _Z_MS3 Z_MS3_PIN,
  115. #else
  116. #define _Z_MS3
  117. #endif
  118. #define _Z_PINS Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, _Z_MIN _Z_MAX _Z_MS1 _Z_MS2 _Z_MS3 _Z_CS
  119. //
  120. // Extruder Chip Select, Digital Micro-steps
  121. //
  122. // Mixing stepper, Switching stepper, or regular stepper
  123. #define E_NEEDED(N) (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > N) \
  124. || (ENABLED(SWITCHING_EXTRUDER) && E_STEPPERS > N) \
  125. || (NONE(SWITCHING_EXTRUDER, MIXING_EXTRUDER) && EXTRUDERS > N)
  126. #define _E0_CS
  127. #define _E0_MS1
  128. #define _E0_MS2
  129. #define _E0_MS3
  130. #if E_NEEDED(0)
  131. #if PIN_EXISTS(E0_CS) && AXIS_HAS_SPI(E0)
  132. #undef _E0_CS
  133. #define _E0_CS E0_CS_PIN,
  134. #endif
  135. #if PIN_EXISTS(E0_MS1)
  136. #undef _E0_MS1
  137. #define _E0_MS1 E0_MS1_PIN,
  138. #endif
  139. #if PIN_EXISTS(E0_MS2)
  140. #undef _E0_MS2
  141. #define _E0_MS2 E0_MS2_PIN,
  142. #endif
  143. #if PIN_EXISTS(E0_MS3)
  144. #undef _E0_MS3
  145. #define _E0_MS3 E0_MS3_PIN,
  146. #endif
  147. #endif
  148. #define _E1_CS
  149. #define _E1_MS1
  150. #define _E1_MS2
  151. #define _E1_MS3
  152. #if E_NEEDED(1)
  153. #if PIN_EXISTS(E1_CS) && AXIS_HAS_SPI(E1)
  154. #undef _E1_CS
  155. #define _E1_CS E1_CS_PIN,
  156. #endif
  157. #if PIN_EXISTS(E1_MS1)
  158. #undef _E1_MS1
  159. #define _E1_MS1 E1_MS1_PIN,
  160. #endif
  161. #if PIN_EXISTS(E1_MS2)
  162. #undef _E1_MS2
  163. #define _E1_MS2 E1_MS2_PIN,
  164. #endif
  165. #if PIN_EXISTS(E1_MS3)
  166. #undef _E1_MS3
  167. #define _E1_MS3 E1_MS3_PIN,
  168. #endif
  169. #endif
  170. #define _E2_CS
  171. #define _E2_MS1
  172. #define _E2_MS2
  173. #define _E2_MS3
  174. #if E_NEEDED(2)
  175. #if PIN_EXISTS(E2_CS) && AXIS_HAS_SPI(E2)
  176. #undef _E2_CS
  177. #define _E2_CS E2_CS_PIN,
  178. #endif
  179. #if PIN_EXISTS(E2_MS1)
  180. #undef _E2_MS1
  181. #define _E2_MS1 E2_MS1_PIN,
  182. #endif
  183. #if PIN_EXISTS(E2_MS2)
  184. #undef _E2_MS2
  185. #define _E2_MS2 E2_MS2_PIN,
  186. #endif
  187. #if PIN_EXISTS(E2_MS3)
  188. #undef _E2_MS3
  189. #define _E2_MS3 E2_MS3_PIN,
  190. #endif
  191. #endif
  192. #define _E3_CS
  193. #define _E3_MS1
  194. #define _E3_MS2
  195. #define _E3_MS3
  196. #if E_NEEDED(3)
  197. #if PIN_EXISTS(E3_CS) && AXIS_HAS_SPI(E3)
  198. #undef _E3_CS
  199. #define _E3_CS E3_CS_PIN,
  200. #endif
  201. #if PIN_EXISTS(E3_MS1)
  202. #undef _E3_MS1
  203. #define _E3_MS1 E3_MS1_PIN,
  204. #endif
  205. #if PIN_EXISTS(E3_MS2)
  206. #undef _E3_MS2
  207. #define _E3_MS2 E3_MS2_PIN,
  208. #endif
  209. #if PIN_EXISTS(E3_MS3)
  210. #undef _E3_MS3
  211. #define _E3_MS3 E3_MS3_PIN,
  212. #endif
  213. #endif
  214. #define _E4_CS
  215. #define _E4_MS1
  216. #define _E4_MS2
  217. #define _E4_MS3
  218. #if E_NEEDED(4)
  219. #if PIN_EXISTS(E4_CS) && AXIS_HAS_SPI(E4)
  220. #undef _E4_CS
  221. #define _E4_CS E4_CS_PIN,
  222. #endif
  223. #if PIN_EXISTS(E4_MS1)
  224. #undef _E4_MS1
  225. #define _E4_MS1 E4_MS1_PIN,
  226. #endif
  227. #if PIN_EXISTS(E4_MS2)
  228. #undef _E4_MS2
  229. #define _E4_MS2 E4_MS2_PIN,
  230. #endif
  231. #if PIN_EXISTS(E4_MS3)
  232. #undef _E4_MS3
  233. #define _E4_MS3 E4_MS3_PIN,
  234. #endif
  235. #endif
  236. #define _E5_CS
  237. #define _E5_MS1
  238. #define _E5_MS2
  239. #define _E5_MS3
  240. #if E_NEEDED(5)
  241. #if PIN_EXISTS(E5_CS) && AXIS_HAS_SPI(E5)
  242. #undef _E5_CS
  243. #define _E5_CS E5_CS_PIN,
  244. #endif
  245. #if PIN_EXISTS(E5_MS1)
  246. #undef _E5_MS1
  247. #define _E5_MS1 E5_MS1_PIN,
  248. #endif
  249. #if PIN_EXISTS(E5_MS2)
  250. #undef _E5_MS2
  251. #define _E5_MS2 E5_MS2_PIN,
  252. #endif
  253. #if PIN_EXISTS(E5_MS3)
  254. #undef _E5_MS3
  255. #define _E5_MS3 E5_MS3_PIN,
  256. #endif
  257. #endif
  258. #define _E6_CS
  259. #define _E6_MS1
  260. #define _E6_MS2
  261. #define _E6_MS3
  262. #if E_NEEDED(6)
  263. #if PIN_EXISTS(E6_CS) && AXIS_HAS_SPI(E6)
  264. #undef _E6_CS
  265. #define _E6_CS E6_CS_PIN,
  266. #endif
  267. #if PIN_EXISTS(E6_MS2)
  268. #undef _E6_MS2
  269. #define _E6_MS2 E6_MS2_PIN,
  270. #endif
  271. #if PIN_EXISTS(E6_MS3)
  272. #undef _E6_MS3
  273. #define _E6_MS3 E6_MS3_PIN,
  274. #endif
  275. #if PIN_EXISTS(E6_MS4)
  276. #undef _E6_MS4
  277. #define _E6_MS4 E6_MS4_PIN,
  278. #endif
  279. #endif
  280. #define _E7_CS
  281. #define _E7_MS1
  282. #define _E7_MS2
  283. #define _E7_MS3
  284. #if E_NEEDED(7)
  285. #if PIN_EXISTS(E7_CS) && AXIS_HAS_SPI(E7)
  286. #undef _E7_CS
  287. #define _E7_CS E7_CS_PIN,
  288. #endif
  289. #if PIN_EXISTS(E7_MS3)
  290. #undef _E7_MS3
  291. #define _E7_MS3 E7_MS3_PIN,
  292. #endif
  293. #if PIN_EXISTS(E7_MS4)
  294. #undef _E7_MS4
  295. #define _E7_MS4 E7_MS4_PIN,
  296. #endif
  297. #if PIN_EXISTS(E7_MS5)
  298. #undef _E7_MS5
  299. #define _E7_MS5 E7_MS5_PIN,
  300. #endif
  301. #endif
  302. //
  303. // E Steppers
  304. //
  305. #define _E0_PINS
  306. #define _E1_PINS
  307. #define _E2_PINS
  308. #define _E3_PINS
  309. #define _E4_PINS
  310. #define _E5_PINS
  311. #define _E6_PINS
  312. #define _E7_PINS
  313. #if EXTRUDERS
  314. #undef _E0_PINS
  315. #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, _E0_CS _E0_MS1 _E0_MS2 _E0_MS3
  316. #endif
  317. #if ENABLED(SWITCHING_EXTRUDER)
  318. // Tools 0 and 1 use E0
  319. #if EXTRUDERS > 2 // Tools 2 and 3 use E1
  320. #undef _E1_PINS
  321. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, _E1_CS _E1_MS1 _E1_MS2 _E1_MS3
  322. #if EXTRUDERS > 4 // Tools 4 and 5 use E2
  323. #undef _E2_PINS
  324. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, _E2_CS _E2_MS1 _E2_MS2 _E2_MS3
  325. #endif
  326. #endif
  327. #elif EITHER(HAS_MULTI_EXTRUDER, MIXING_EXTRUDER)
  328. #undef _E1_PINS
  329. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, _E1_CS _E1_MS1 _E1_MS2 _E1_MS3
  330. #if EXTRUDERS > 2 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 2)
  331. #undef _E2_PINS
  332. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, _E2_CS _E2_MS1 _E2_MS2 _E2_MS3
  333. #if EXTRUDERS > 3 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 3)
  334. #undef _E3_PINS
  335. #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, _E3_CS _E3_MS1 _E3_MS2 _E3_MS3
  336. #if EXTRUDERS > 4 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 4)
  337. #undef _E4_PINS
  338. #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, _E4_CS _E4_MS1 _E4_MS2 _E4_MS3
  339. #if EXTRUDERS > 5 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 5)
  340. #undef _E5_PINS
  341. #define _E5_PINS E5_STEP_PIN, E5_DIR_PIN, E5_ENABLE_PIN, _E5_CS _E5_MS1 _E5_MS2 _E5_MS3
  342. #if EXTRUDERS > 6 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 6)
  343. #undef _E6_PINS
  344. #define _E6_PINS E6_STEP_PIN, E6_DIR_PIN, E6_ENABLE_PIN, _E6_CS _E6_MS1 _E6_MS2 _E6_MS3
  345. #if EXTRUDERS > 7 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 7)
  346. #undef _E7_PINS
  347. #define _E7_PINS E7_STEP_PIN, E7_DIR_PIN, E7_ENABLE_PIN, _E7_CS _E7_MS1 _E7_MS2 _E7_MS3
  348. #endif // EXTRUDERS > 7 || MIXING_EXTRUDER > 7
  349. #endif // EXTRUDERS > 6 || MIXING_EXTRUDER > 6
  350. #endif // EXTRUDERS > 5 || MIXING_EXTRUDER > 5
  351. #endif // EXTRUDERS > 4 || MIXING_EXTRUDER > 4
  352. #endif // EXTRUDERS > 3 || MIXING_EXTRUDER > 3
  353. #endif // EXTRUDERS > 2 || MIXING_EXTRUDER > 2
  354. #endif // HAS_MULTI_EXTRUDER || MIXING_EXTRUDER
  355. //
  356. // Heaters, Fans, Temp Sensors
  357. //
  358. #ifndef E0_AUTO_FAN_PIN
  359. #define E0_AUTO_FAN_PIN -1
  360. #endif
  361. #ifndef E1_AUTO_FAN_PIN
  362. #define E1_AUTO_FAN_PIN -1
  363. #endif
  364. #ifndef E2_AUTO_FAN_PIN
  365. #define E2_AUTO_FAN_PIN -1
  366. #endif
  367. #ifndef E3_AUTO_FAN_PIN
  368. #define E3_AUTO_FAN_PIN -1
  369. #endif
  370. #ifndef E4_AUTO_FAN_PIN
  371. #define E4_AUTO_FAN_PIN -1
  372. #endif
  373. #ifndef E5_AUTO_FAN_PIN
  374. #define E5_AUTO_FAN_PIN -1
  375. #endif
  376. #ifndef E6_AUTO_FAN_PIN
  377. #define E6_AUTO_FAN_PIN -1
  378. #endif
  379. #ifndef E7_AUTO_FAN_PIN
  380. #define E7_AUTO_FAN_PIN -1
  381. #endif
  382. #define _H0_PINS
  383. #define _H1_PINS
  384. #define _H2_PINS
  385. #define _H3_PINS
  386. #define _H4_PINS
  387. #define _H5_PINS
  388. #define _H6_PINS
  389. #define _H7_PINS
  390. #if HAS_HOTEND
  391. #undef _H0_PINS
  392. #define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_0_PIN),
  393. #if HAS_MULTI_HOTEND
  394. #undef _H1_PINS
  395. #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_1_PIN),
  396. #if HOTENDS > 2
  397. #undef _H2_PINS
  398. #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_2_PIN),
  399. #if HOTENDS > 3
  400. #undef _H3_PINS
  401. #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_3_PIN),
  402. #if HOTENDS > 4
  403. #undef _H4_PINS
  404. #define _H4_PINS HEATER_4_PIN, E4_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_4_PIN),
  405. #if HOTENDS > 5
  406. #undef _H5_PINS
  407. #define _H5_PINS HEATER_5_PIN, E5_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_5_PIN),
  408. #if HOTENDS > 6
  409. #undef _H6_PINS
  410. #define _H6_PINS HEATER_6_PIN, E6_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_6_PIN),
  411. #if HOTENDS > 7
  412. #undef _H7_PINS
  413. #define _H7_PINS HEATER_7_PIN, E7_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_7_PIN),
  414. #endif // HOTENDS > 7
  415. #endif // HOTENDS > 6
  416. #endif // HOTENDS > 5
  417. #endif // HOTENDS > 4
  418. #endif // HOTENDS > 3
  419. #endif // HOTENDS > 2
  420. #endif // HAS_MULTI_HOTEND
  421. #endif // HOTENDS
  422. //
  423. // Dual X, Dual Y, Multi-Z
  424. // Chip Select and Digital Micro-stepping
  425. //
  426. #if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
  427. #if PIN_EXISTS(X2_CS) && AXIS_HAS_SPI(X2)
  428. #define _X2_CS X2_CS_PIN,
  429. #else
  430. #define _X2_CS
  431. #endif
  432. #if PIN_EXISTS(X2_MS1)
  433. #define _X2_MS1 X2_MS1_PIN,
  434. #else
  435. #define _X2_MS1
  436. #endif
  437. #if PIN_EXISTS(X2_MS2)
  438. #define _X2_MS2 X2_MS2_PIN,
  439. #else
  440. #define _X2_MS2
  441. #endif
  442. #if PIN_EXISTS(X2_MS3)
  443. #define _X2_MS3 X2_MS3_PIN,
  444. #else
  445. #define _X2_MS3
  446. #endif
  447. #define _X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN, _X2_CS _X2_MS1 _X2_MS2 _X2_MS3
  448. #else
  449. #define _X2_PINS
  450. #endif
  451. #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
  452. #if PIN_EXISTS(Y2_CS) && AXIS_HAS_SPI(Y2)
  453. #define _Y2_CS Y2_CS_PIN,
  454. #else
  455. #define _Y2_CS
  456. #endif
  457. #if PIN_EXISTS(Y2_MS1)
  458. #define _Y2_MS1 Y2_MS1_PIN,
  459. #else
  460. #define _Y2_MS1
  461. #endif
  462. #if PIN_EXISTS(Y2_MS2)
  463. #define _Y2_MS2 Y2_MS2_PIN,
  464. #else
  465. #define _Y2_MS2
  466. #endif
  467. #if PIN_EXISTS(Y2_MS3)
  468. #define _Y2_MS3 Y2_MS3_PIN,
  469. #else
  470. #define _Y2_MS3
  471. #endif
  472. #define _Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN, _Y2_CS _Y2_MS1 _Y2_MS2 _Y2_MS3
  473. #else
  474. #define _Y2_PINS
  475. #endif
  476. #if NUM_Z_STEPPER_DRIVERS >= 2
  477. #if PIN_EXISTS(Z2_CS) && AXIS_HAS_SPI(Z2)
  478. #define _Z2_CS Z2_CS_PIN,
  479. #else
  480. #define _Z2_CS
  481. #endif
  482. #if PIN_EXISTS(Z2_MS1)
  483. #define _Z2_MS1 Z2_MS1_PIN,
  484. #else
  485. #define _Z2_MS1
  486. #endif
  487. #if PIN_EXISTS(Z2_MS2)
  488. #define _Z2_MS2 Z2_MS2_PIN,
  489. #else
  490. #define _Z2_MS2
  491. #endif
  492. #if PIN_EXISTS(Z2_MS3)
  493. #define _Z2_MS3 Z2_MS3_PIN,
  494. #else
  495. #define _Z2_MS3
  496. #endif
  497. #define _Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN, _Z2_CS _Z2_MS1 _Z2_MS2 _Z2_MS3
  498. #else
  499. #define _Z2_PINS
  500. #endif
  501. #if NUM_Z_STEPPER_DRIVERS >= 3
  502. #if PIN_EXISTS(Z3_CS) && AXIS_HAS_SPI(Z3)
  503. #define _Z3_CS Z3_CS_PIN,
  504. #else
  505. #define _Z3_CS
  506. #endif
  507. #if PIN_EXISTS(Z3_MS1)
  508. #define _Z3_MS1 Z3_MS1_PIN,
  509. #else
  510. #define _Z3_MS1
  511. #endif
  512. #if PIN_EXISTS(Z3_MS2)
  513. #define _Z3_MS2 Z3_MS2_PIN,
  514. #else
  515. #define _Z3_MS2
  516. #endif
  517. #if PIN_EXISTS(Z3_MS3)
  518. #define _Z3_MS3 Z3_MS3_PIN,
  519. #else
  520. #define _Z3_MS3
  521. #endif
  522. #define _Z3_PINS Z3_STEP_PIN, Z3_DIR_PIN, Z3_ENABLE_PIN, _Z3_CS _Z3_MS1 _Z3_MS2 _Z3_MS3
  523. #else
  524. #define _Z3_PINS
  525. #endif
  526. #if NUM_Z_STEPPER_DRIVERS >= 4
  527. #if PIN_EXISTS(Z4_CS) && AXIS_HAS_SPI(Z4)
  528. #define _Z4_CS Z4_CS_PIN,
  529. #else
  530. #define _Z4_CS
  531. #endif
  532. #if PIN_EXISTS(Z4_MS1)
  533. #define _Z4_MS1 Z4_MS1_PIN,
  534. #else
  535. #define _Z4_MS1
  536. #endif
  537. #if PIN_EXISTS(Z4_MS2)
  538. #define _Z4_MS2 Z4_MS2_PIN,
  539. #else
  540. #define _Z4_MS2
  541. #endif
  542. #if PIN_EXISTS(Z4_MS3)
  543. #define _Z4_MS3 Z4_MS3_PIN,
  544. #else
  545. #define _Z4_MS3
  546. #endif
  547. #define _Z4_PINS Z4_STEP_PIN, Z4_DIR_PIN, Z4_ENABLE_PIN, _Z4_CS _Z4_MS1 _Z4_MS2 _Z4_MS3
  548. #else
  549. #define _Z4_PINS
  550. #endif
  551. //
  552. // Generate the final Sensitive Pins array,
  553. // keeping the array as small as possible.
  554. //
  555. #if PIN_EXISTS(PS_ON)
  556. #define _PS_ON PS_ON_PIN,
  557. #else
  558. #define _PS_ON
  559. #endif
  560. #if HAS_BED_PROBE && PIN_EXISTS(Z_MIN_PROBE)
  561. #define _Z_PROBE Z_MIN_PROBE_PIN,
  562. #else
  563. #define _Z_PROBE
  564. #endif
  565. #if PIN_EXISTS(FAN)
  566. #define _FAN0 FAN_PIN,
  567. #else
  568. #define _FAN0
  569. #endif
  570. #if PIN_EXISTS(FAN1)
  571. #define _FAN1 FAN1_PIN,
  572. #else
  573. #define _FAN1
  574. #endif
  575. #if PIN_EXISTS(FAN2)
  576. #define _FAN2 FAN2_PIN,
  577. #else
  578. #define _FAN2
  579. #endif
  580. #if PIN_EXISTS(FAN3)
  581. #define _FAN3 FAN3_PIN,
  582. #else
  583. #define _FAN3
  584. #endif
  585. #if PIN_EXISTS(FAN4)
  586. #define _FAN4 FAN4_PIN,
  587. #else
  588. #define _FAN4
  589. #endif
  590. #if PIN_EXISTS(FAN5)
  591. #define _FAN5 FAN5_PIN,
  592. #else
  593. #define _FAN5
  594. #endif
  595. #if PIN_EXISTS(FAN6)
  596. #define _FAN6 FAN6_PIN,
  597. #else
  598. #define _FAN6
  599. #endif
  600. #if PIN_EXISTS(FAN7)
  601. #define _FAN7 FAN7_PIN,
  602. #else
  603. #define _FAN7
  604. #endif
  605. #if PIN_EXISTS(CONTROLLER_FAN)
  606. #define _FANC CONTROLLER_FAN_PIN,
  607. #else
  608. #define _FANC
  609. #endif
  610. #if TEMP_SENSOR_BED && PINS_EXIST(TEMP_BED, HEATER_BED)
  611. #define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN),
  612. #else
  613. #define _BED_PINS
  614. #endif
  615. #if TEMP_SENSOR_CHAMBER && PIN_EXISTS(TEMP_CHAMBER)
  616. #define _CHAMBER_TEMP analogInputToDigitalPin(TEMP_CHAMBER_PIN),
  617. #else
  618. #define _CHAMBER_TEMP
  619. #endif
  620. #if TEMP_SENSOR_CHAMBER && PINS_EXIST(TEMP_CHAMBER, HEATER_CHAMBER)
  621. #define _CHAMBER_HEATER HEATER_CHAMBER_PIN,
  622. #else
  623. #define _CHAMBER_HEATER
  624. #endif
  625. #if TEMP_SENSOR_CHAMBER && PINS_EXIST(TEMP_CHAMBER, CHAMBER_AUTO_FAN)
  626. #define _CHAMBER_FAN CHAMBER_AUTO_FAN_PIN,
  627. #else
  628. #define _CHAMBER_FAN
  629. #endif
  630. #ifndef HAL_SENSITIVE_PINS
  631. #define HAL_SENSITIVE_PINS
  632. #endif
  633. #define SENSITIVE_PINS { \
  634. _X_PINS _Y_PINS _Z_PINS _X2_PINS _Y2_PINS _Z2_PINS _Z3_PINS _Z4_PINS _Z_PROBE \
  635. _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS _E6_PINS _E7_PINS \
  636. _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS _H5_PINS _H6_PINS _H7_PINS \
  637. _PS_ON _FAN0 _FAN1 _FAN2 _FAN3 _FAN4 _FAN5 _FAN6 _FAN7 _FANC \
  638. _BED_PINS _CHAMBER_TEMP _CHAMBER_HEATER _CHAMBER_FAN HAL_SENSITIVE_PINS \
  639. }