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.h 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. /**
  2. * Conditionals.h
  3. * Defines that depend on configuration but are not editable.
  4. */
  5. #ifndef CONDITIONALS_H
  6. #ifndef M_PI
  7. #define M_PI 3.1415926536
  8. #endif
  9. #ifndef CONFIGURATION_LCD // Get the LCD defines which are needed first
  10. #define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0)
  11. #define CONFIGURATION_LCD
  12. #if defined(MAKRPANEL)
  13. #define DOGLCD
  14. #define SDSUPPORT
  15. #define DEFAULT_LCD_CONTRAST 17
  16. #define ULTIPANEL
  17. #define NEWPANEL
  18. #endif
  19. #if defined(miniVIKI) || defined(VIKI2)
  20. #define ULTRA_LCD //general LCD support, also 16x2
  21. #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
  22. #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
  23. #ifdef miniVIKI
  24. #define DEFAULT_LCD_CONTRAST 95
  25. #else
  26. #define DEFAULT_LCD_CONTRAST 40
  27. #endif
  28. #define ENCODER_PULSES_PER_STEP 4
  29. #define ENCODER_STEPS_PER_MENU_ITEM 1
  30. #endif
  31. #ifdef PANEL_ONE
  32. #define SDSUPPORT
  33. #define ULTIMAKERCONTROLLER
  34. #endif
  35. #ifdef REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  36. #define DOGLCD
  37. #define U8GLIB_ST7920
  38. #define REPRAP_DISCOUNT_SMART_CONTROLLER
  39. #endif
  40. #if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
  41. #define ULTIPANEL
  42. #define NEWPANEL
  43. #endif
  44. #ifdef REPRAPWORLD_KEYPAD
  45. #define ULTIPANEL
  46. #define NEWPANEL
  47. #endif
  48. #ifdef RA_CONTROL_PANEL
  49. #define LCD_I2C_TYPE_PCA8574
  50. #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
  51. #define ULTIPANEL
  52. #define NEWPANEL
  53. #endif
  54. /**
  55. * I2C PANELS
  56. */
  57. #ifdef LCD_I2C_SAINSMART_YWROBOT
  58. // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
  59. // Make sure it is placed in the Arduino libraries directory.
  60. #define LCD_I2C_TYPE_PCF8575
  61. #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
  62. #define ULTIPANEL
  63. #define NEWPANEL
  64. #endif
  65. // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
  66. #ifdef LCD_I2C_PANELOLU2
  67. // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
  68. // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
  69. // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
  70. // Note: The PANELOLU2 encoder click input can either be directly connected to a pin
  71. // (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
  72. #define LCD_I2C_TYPE_MCP23017
  73. #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
  74. #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
  75. #ifndef ENCODER_PULSES_PER_STEP
  76. #define ENCODER_PULSES_PER_STEP 4
  77. #endif
  78. #ifndef ENCODER_STEPS_PER_MENU_ITEM
  79. #define ENCODER_STEPS_PER_MENU_ITEM 1
  80. #endif
  81. #ifdef LCD_USE_I2C_BUZZER
  82. #define LCD_FEEDBACK_FREQUENCY_HZ 1000
  83. #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
  84. #endif
  85. #define ULTIPANEL
  86. #define NEWPANEL
  87. #endif
  88. // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
  89. #ifdef LCD_I2C_VIKI
  90. // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
  91. // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
  92. // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
  93. // BTN_ENC pin (or set BTN_ENC to -1 if not used)
  94. #define LCD_I2C_TYPE_MCP23017
  95. #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
  96. #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
  97. #define ULTIPANEL
  98. #define NEWPANEL
  99. #endif
  100. // Shift register panels
  101. // ---------------------
  102. // 2 wire Non-latching LCD SR from:
  103. // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
  104. #ifdef SAV_3DLCD
  105. #define SR_LCD_2W_NL // Non latching 2 wire shiftregister
  106. #define ULTIPANEL
  107. #define NEWPANEL
  108. #endif
  109. #ifdef ULTIPANEL
  110. #define NEWPANEL //enable this if you have a click-encoder panel
  111. #define SDSUPPORT
  112. #define ULTRA_LCD
  113. #ifdef DOGLCD // Change number of lines to match the DOG graphic display
  114. #define LCD_WIDTH 22
  115. #define LCD_HEIGHT 5
  116. #else
  117. #define LCD_WIDTH 20
  118. #define LCD_HEIGHT 4
  119. #endif
  120. #else //no panel but just LCD
  121. #ifdef ULTRA_LCD
  122. #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display
  123. #define LCD_WIDTH 22
  124. #define LCD_HEIGHT 5
  125. #else
  126. #define LCD_WIDTH 16
  127. #define LCD_HEIGHT 2
  128. #endif
  129. #endif
  130. #endif
  131. #ifdef DOGLCD
  132. /* Custom characters defined in font font_6x10_marlin_symbols */
  133. // \x00 intentionally skipped to avoid problems in strings
  134. #define LCD_STR_REFRESH "\x01"
  135. #define LCD_STR_FOLDER "\x02"
  136. #define LCD_STR_ARROW_RIGHT "\x03"
  137. #define LCD_STR_UPLEVEL "\x04"
  138. #define LCD_STR_CLOCK "\x05"
  139. #define LCD_STR_FEEDRATE "\x06"
  140. #define LCD_STR_BEDTEMP "\x07"
  141. #define LCD_STR_THERMOMETER "\x08"
  142. #define LCD_STR_DEGREE "\x09"
  143. #define LCD_STR_SPECIAL_MAX '\x09'
  144. // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin.
  145. // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
  146. #else
  147. /* Custom characters defined in the first 8 characters of the LCD */
  148. #define LCD_STR_BEDTEMP "\x00" // this will have 'unexpected' results when used in a string!
  149. #define LCD_STR_DEGREE "\x01"
  150. #define LCD_STR_THERMOMETER "\x02"
  151. #define LCD_STR_UPLEVEL "\x03"
  152. #define LCD_STR_REFRESH "\x04"
  153. #define LCD_STR_FOLDER "\x05"
  154. #define LCD_STR_FEEDRATE "\x06"
  155. #define LCD_STR_CLOCK "\x07"
  156. #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */
  157. #endif
  158. /**
  159. * Default LCD contrast for dogm-like LCD displays
  160. */
  161. #if defined(DOGLCD) && !defined(DEFAULT_LCD_CONTRAST)
  162. #define DEFAULT_LCD_CONTRAST 32
  163. #endif
  164. #ifdef DOGLCD
  165. #define HAS_LCD_CONTRAST
  166. #ifdef U8GLIB_ST7920
  167. #undef HAS_LCD_CONTRAST
  168. #endif
  169. #endif
  170. #else // CONFIGURATION_LCD
  171. #define CONDITIONALS_H
  172. #ifndef AT90USB
  173. #define HardwareSerial_h // trick to disable the standard HWserial
  174. #endif
  175. #if (ARDUINO >= 100)
  176. #include "Arduino.h"
  177. #else
  178. #include "WProgram.h"
  179. #endif
  180. #include "pins.h"
  181. /**
  182. * ENDSTOPPULLUPS
  183. */
  184. #ifdef ENDSTOPPULLUPS
  185. #ifndef DISABLE_MAX_ENDSTOPS
  186. #define ENDSTOPPULLUP_XMAX
  187. #define ENDSTOPPULLUP_YMAX
  188. #define ENDSTOPPULLUP_ZMAX
  189. #endif
  190. #ifndef DISABLE_MIN_ENDSTOPS
  191. #define ENDSTOPPULLUP_XMIN
  192. #define ENDSTOPPULLUP_YMIN
  193. #define ENDSTOPPULLUP_ZMIN
  194. #endif
  195. #ifndef DISABLE_Z_PROBE_ENDSTOP
  196. #define ENDSTOPPULLUP_ZPROBE
  197. #endif
  198. #endif
  199. /**
  200. * Axis lengths
  201. */
  202. #define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
  203. #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
  204. #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
  205. /**
  206. * SCARA
  207. */
  208. #ifdef SCARA
  209. #undef SLOWDOWN
  210. #define QUICK_HOME //SCARA needs Quickhome
  211. #endif
  212. /**
  213. * AUTOSET LOCATIONS OF LIMIT SWITCHES
  214. * Added by ZetaPhoenix 09-15-2012
  215. */
  216. #ifdef MANUAL_HOME_POSITIONS // Use manual limit switch locations
  217. #define X_HOME_POS MANUAL_X_HOME_POS
  218. #define Y_HOME_POS MANUAL_Y_HOME_POS
  219. #define Z_HOME_POS MANUAL_Z_HOME_POS
  220. #else //!MANUAL_HOME_POSITIONS – Use home switch positions based on homing direction and travel limits
  221. #ifdef BED_CENTER_AT_0_0
  222. #define X_HOME_POS X_MAX_LENGTH * X_HOME_DIR * 0.5
  223. #define Y_HOME_POS Y_MAX_LENGTH * Y_HOME_DIR * 0.5
  224. #else
  225. #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
  226. #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
  227. #endif
  228. #define Z_HOME_POS (Z_HOME_DIR < 0 ? Z_MIN_POS : Z_MAX_POS)
  229. #endif //!MANUAL_HOME_POSITIONS
  230. /**
  231. * Auto Bed Leveling
  232. */
  233. #ifdef ENABLE_AUTO_BED_LEVELING
  234. // Boundaries for probing based on set limits
  235. #define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
  236. #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
  237. #define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
  238. #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
  239. #endif
  240. /**
  241. * MAX_STEP_FREQUENCY differs for TOSHIBA
  242. */
  243. #ifdef CONFIG_STEPPERS_TOSHIBA
  244. #define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
  245. #else
  246. #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
  247. #endif
  248. // MS1 MS2 Stepper Driver Microstepping mode table
  249. #define MICROSTEP1 LOW,LOW
  250. #define MICROSTEP2 HIGH,LOW
  251. #define MICROSTEP4 LOW,HIGH
  252. #define MICROSTEP8 HIGH,HIGH
  253. #define MICROSTEP16 HIGH,HIGH
  254. /**
  255. * Advance calculated values
  256. */
  257. #ifdef ADVANCE
  258. #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * M_PI)
  259. #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS] / EXTRUSION_AREA)
  260. #endif
  261. #ifdef ULTIPANEL
  262. #undef SDCARDDETECTINVERTED
  263. #endif
  264. // Power Signal Control Definitions
  265. // By default use ATX definition
  266. #ifndef POWER_SUPPLY
  267. #define POWER_SUPPLY 1
  268. #endif
  269. #if (POWER_SUPPLY == 1) // 1 = ATX
  270. #define PS_ON_AWAKE LOW
  271. #define PS_ON_ASLEEP HIGH
  272. #elif (POWER_SUPPLY == 2) // 2 = X-Box 360 203W
  273. #define PS_ON_AWAKE HIGH
  274. #define PS_ON_ASLEEP LOW
  275. #endif
  276. #define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && PIN_EXISTS(PS_ON))
  277. /**
  278. * Temp Sensor defines
  279. */
  280. #if TEMP_SENSOR_0 == -2
  281. #define HEATER_0_USES_MAX6675
  282. #elif TEMP_SENSOR_0 == -1
  283. #define HEATER_0_USES_AD595
  284. #elif TEMP_SENSOR_0 == 0
  285. #undef HEATER_0_MINTEMP
  286. #undef HEATER_0_MAXTEMP
  287. #elif TEMP_SENSOR_0 > 0
  288. #define THERMISTORHEATER_0 TEMP_SENSOR_0
  289. #define HEATER_0_USES_THERMISTOR
  290. #endif
  291. #if TEMP_SENSOR_1 == -1
  292. #define HEATER_1_USES_AD595
  293. #elif TEMP_SENSOR_1 == 0
  294. #undef HEATER_1_MINTEMP
  295. #undef HEATER_1_MAXTEMP
  296. #elif TEMP_SENSOR_1 > 0
  297. #define THERMISTORHEATER_1 TEMP_SENSOR_1
  298. #define HEATER_1_USES_THERMISTOR
  299. #endif
  300. #if TEMP_SENSOR_2 == -1
  301. #define HEATER_2_USES_AD595
  302. #elif TEMP_SENSOR_2 == 0
  303. #undef HEATER_2_MINTEMP
  304. #undef HEATER_2_MAXTEMP
  305. #elif TEMP_SENSOR_2 > 0
  306. #define THERMISTORHEATER_2 TEMP_SENSOR_2
  307. #define HEATER_2_USES_THERMISTOR
  308. #endif
  309. #if TEMP_SENSOR_3 == -1
  310. #define HEATER_3_USES_AD595
  311. #elif TEMP_SENSOR_3 == 0
  312. #undef HEATER_3_MINTEMP
  313. #undef HEATER_3_MAXTEMP
  314. #elif TEMP_SENSOR_3 > 0
  315. #define THERMISTORHEATER_3 TEMP_SENSOR_3
  316. #define HEATER_3_USES_THERMISTOR
  317. #endif
  318. #if TEMP_SENSOR_BED == -1
  319. #define BED_USES_AD595
  320. #elif TEMP_SENSOR_BED == 0
  321. #undef BED_MINTEMP
  322. #undef BED_MAXTEMP
  323. #elif TEMP_SENSOR_BED > 0
  324. #define THERMISTORBED TEMP_SENSOR_BED
  325. #define BED_USES_THERMISTOR
  326. #endif
  327. /**
  328. * ARRAY_BY_EXTRUDERS based on EXTRUDERS
  329. */
  330. #if EXTRUDERS > 3
  331. #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2, v3, v4 }
  332. #elif EXTRUDERS > 2
  333. #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2, v3 }
  334. #elif EXTRUDERS > 1
  335. #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1, v2 }
  336. #else
  337. #define ARRAY_BY_EXTRUDERS(v1, v2, v3, v4) { v1 }
  338. #endif
  339. /**
  340. * Shorthand for pin tests, used wherever needed
  341. */
  342. #define HAS_TEMP_0 (PIN_EXISTS(TEMP_0) && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 != -2)
  343. #define HAS_TEMP_1 (PIN_EXISTS(TEMP_1) && TEMP_SENSOR_1 != 0)
  344. #define HAS_TEMP_2 (PIN_EXISTS(TEMP_2) && TEMP_SENSOR_2 != 0)
  345. #define HAS_TEMP_3 (PIN_EXISTS(TEMP_3) && TEMP_SENSOR_3 != 0)
  346. #define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0)
  347. #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
  348. #define HAS_HEATER_1 (PIN_EXISTS(HEATER_1))
  349. #define HAS_HEATER_2 (PIN_EXISTS(HEATER_2))
  350. #define HAS_HEATER_3 (PIN_EXISTS(HEATER_3))
  351. #define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED))
  352. #define HAS_AUTO_FAN_0 (PIN_EXISTS(EXTRUDER_0_AUTO_FAN))
  353. #define HAS_AUTO_FAN_1 (PIN_EXISTS(EXTRUDER_1_AUTO_FAN))
  354. #define HAS_AUTO_FAN_2 (PIN_EXISTS(EXTRUDER_2_AUTO_FAN))
  355. #define HAS_AUTO_FAN_3 (PIN_EXISTS(EXTRUDER_3_AUTO_FAN))
  356. #define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3)
  357. #define HAS_FAN (PIN_EXISTS(FAN))
  358. #define HAS_CONTROLLERFAN (PIN_EXISTS(CONTROLLERFAN))
  359. #define HAS_SERVO_0 (PIN_EXISTS(SERVO0))
  360. #define HAS_SERVO_1 (PIN_EXISTS(SERVO1))
  361. #define HAS_SERVO_2 (PIN_EXISTS(SERVO2))
  362. #define HAS_SERVO_3 (PIN_EXISTS(SERVO3))
  363. #define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && PIN_EXISTS(FILWIDTH))
  364. #define HAS_FILRUNOUT (PIN_EXISTS(FILRUNOUT))
  365. #define HAS_HOME (PIN_EXISTS(HOME))
  366. #define HAS_KILL (PIN_EXISTS(KILL))
  367. #define HAS_SUICIDE (PIN_EXISTS(SUICIDE))
  368. #define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH))
  369. #define HAS_X_MIN (PIN_EXISTS(X_MIN))
  370. #define HAS_X_MAX (PIN_EXISTS(X_MAX))
  371. #define HAS_Y_MIN (PIN_EXISTS(Y_MIN))
  372. #define HAS_Y_MAX (PIN_EXISTS(Y_MAX))
  373. #define HAS_Z_MIN (PIN_EXISTS(Z_MIN))
  374. #define HAS_Z_MAX (PIN_EXISTS(Z_MAX))
  375. #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN))
  376. #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
  377. #define HAS_Z_PROBE (PIN_EXISTS(Z_PROBE))
  378. #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1))
  379. #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2))
  380. #define HAS_SOLENOID_3 (PIN_EXISTS(SOL3))
  381. #define HAS_MICROSTEPS (PIN_EXISTS(X_MS1))
  382. #define HAS_MICROSTEPS_E0 (PIN_EXISTS(E0_MS1))
  383. #define HAS_MICROSTEPS_E1 (PIN_EXISTS(E1_MS1))
  384. #define HAS_MICROSTEPS_E2 (PIN_EXISTS(E2_MS1))
  385. #define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE))
  386. #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE))
  387. #define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE))
  388. #define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE))
  389. #define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE))
  390. #define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE))
  391. #define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE))
  392. #define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE))
  393. #define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE))
  394. #define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE))
  395. #define HAS_X_DIR (PIN_EXISTS(X_DIR))
  396. #define HAS_X2_DIR (PIN_EXISTS(X2_DIR))
  397. #define HAS_Y_DIR (PIN_EXISTS(Y_DIR))
  398. #define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR))
  399. #define HAS_Z_DIR (PIN_EXISTS(Z_DIR))
  400. #define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR))
  401. #define HAS_E0_DIR (PIN_EXISTS(E0_DIR))
  402. #define HAS_E1_DIR (PIN_EXISTS(E1_DIR))
  403. #define HAS_E2_DIR (PIN_EXISTS(E2_DIR))
  404. #define HAS_E3_DIR (PIN_EXISTS(E3_DIR))
  405. #define HAS_X_STEP (PIN_EXISTS(X_STEP))
  406. #define HAS_X2_STEP (PIN_EXISTS(X2_STEP))
  407. #define HAS_Y_STEP (PIN_EXISTS(Y_STEP))
  408. #define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP))
  409. #define HAS_Z_STEP (PIN_EXISTS(Z_STEP))
  410. #define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP))
  411. #define HAS_E0_STEP (PIN_EXISTS(E0_STEP))
  412. #define HAS_E1_STEP (PIN_EXISTS(E1_STEP))
  413. #define HAS_E2_STEP (PIN_EXISTS(E2_STEP))
  414. #define HAS_E3_STEP (PIN_EXISTS(E3_STEP))
  415. /**
  416. * Helper Macros for heaters and extruder fan
  417. */
  418. #define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v)
  419. #if EXTRUDERS > 1 || defined(HEATERS_PARALLEL)
  420. #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, v)
  421. #if EXTRUDERS > 2
  422. #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v)
  423. #if EXTRUDERS > 3
  424. #define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, v)
  425. #endif
  426. #endif
  427. #endif
  428. #ifdef HEATERS_PARALLEL
  429. #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); }
  430. #else
  431. #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v)
  432. #endif
  433. #if HAS_HEATER_BED
  434. #define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, v)
  435. #endif
  436. #if HAS_FAN
  437. #define WRITE_FAN(v) WRITE(FAN_PIN, v)
  438. #endif
  439. #endif //CONFIGURATION_LCD
  440. #endif //CONDITIONALS_H