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

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