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_LCD.h 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  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 <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /**
  24. * Conditionals_LCD.h
  25. * Conditionals that need to be set before Configuration_adv.h or pins.h
  26. */
  27. #if ENABLED(CARTESIO_UI)
  28. #define DOGLCD
  29. #define IS_ULTIPANEL
  30. #elif ENABLED(ZONESTAR_LCD)
  31. #define ADC_KEYPAD
  32. #define IS_RRW_KEYPAD
  33. #define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
  34. #define ADC_KEY_NUM 8
  35. #define IS_ULTIPANEL
  36. // This helps to implement ADC_KEYPAD menus
  37. #define REVERSE_MENU_DIRECTION
  38. #define ENCODER_PULSES_PER_STEP 1
  39. #define ENCODER_STEPS_PER_MENU_ITEM 1
  40. #define ENCODER_FEEDRATE_DEADZONE 2
  41. #elif ENABLED(RADDS_DISPLAY)
  42. #define IS_ULTIPANEL
  43. #define ENCODER_PULSES_PER_STEP 2
  44. #elif EITHER(ANET_FULL_GRAPHICS_LCD, BQ_LCD_SMART_CONTROLLER)
  45. #define IS_RRD_FG_SC
  46. #elif ANY(miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864)
  47. #define IS_ULTRA_LCD
  48. #define DOGLCD
  49. #define IS_ULTIPANEL
  50. #if ENABLED(miniVIKI)
  51. #define U8GLIB_ST7565_64128N
  52. #elif ENABLED(VIKI2)
  53. #define U8GLIB_ST7565_64128N
  54. #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
  55. #define U8GLIB_LM6059_AF
  56. #define SD_DETECT_INVERTED
  57. #elif ENABLED(AZSMZ_12864)
  58. #define U8GLIB_ST7565_64128N
  59. #endif
  60. #elif ENABLED(OLED_PANEL_TINYBOY2)
  61. #define IS_U8GLIB_SSD1306
  62. #define IS_ULTIPANEL
  63. #elif ENABLED(RA_CONTROL_PANEL)
  64. #define LCD_I2C_TYPE_PCA8574
  65. #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
  66. #define IS_ULTIPANEL
  67. #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  68. #define DOGLCD
  69. #define U8GLIB_ST7920
  70. #define IS_ULTIPANEL
  71. #elif ENABLED(CR10_STOCKDISPLAY)
  72. #define IS_RRD_FG_SC
  73. #ifndef ST7920_DELAY_1
  74. #define ST7920_DELAY_1 DELAY_NS(125)
  75. #endif
  76. #ifndef ST7920_DELAY_2
  77. #define ST7920_DELAY_2 DELAY_NS(125)
  78. #endif
  79. #ifndef ST7920_DELAY_3
  80. #define ST7920_DELAY_3 DELAY_NS(125)
  81. #endif
  82. #elif ENABLED(MKS_12864OLED)
  83. #define IS_RRD_SC
  84. #define U8GLIB_SH1106
  85. #elif ENABLED(MKS_12864OLED_SSD1306)
  86. #define IS_RRD_SC
  87. #define IS_U8GLIB_SSD1306
  88. #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
  89. #define MINIPANEL
  90. #elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1)
  91. #define FYSETC_MINI_12864
  92. #define DOGLCD
  93. #define IS_ULTIPANEL
  94. #define LED_COLORS_REDUCE_GREEN
  95. #if ENABLED(PSU_CONTROL) && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1)
  96. #define LED_BACKLIGHT_TIMEOUT 10000
  97. #endif
  98. // Require LED backlighting enabled
  99. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
  100. #define RGB_LED
  101. #elif ENABLED(FYSETC_MINI_12864_2_1)
  102. #define LED_CONTROL_MENU
  103. #define NEOPIXEL_LED
  104. #undef NEOPIXEL_TYPE
  105. #define NEOPIXEL_TYPE NEO_RGB
  106. #if NEOPIXEL_PIXELS < 3
  107. #undef NEOPIXELS_PIXELS
  108. #define NEOPIXEL_PIXELS 3
  109. #endif
  110. #ifndef NEOPIXEL_BRIGHTNESS
  111. #define NEOPIXEL_BRIGHTNESS 127
  112. #endif
  113. //#define NEOPIXEL_STARTUP_TEST
  114. #endif
  115. #elif ENABLED(ULTI_CONTROLLER)
  116. #define IS_ULTIPANEL
  117. #define U8GLIB_SSD1309
  118. #define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin
  119. #define ENCODER_PULSES_PER_STEP 2
  120. #define ENCODER_STEPS_PER_MENU_ITEM 2
  121. #elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602)
  122. #define IS_RRD_SC
  123. #define LCD_WIDTH 16
  124. #define LCD_HEIGHT 2
  125. #endif
  126. #if ENABLED(IS_RRD_FG_SC)
  127. #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  128. #endif
  129. #if EITHER(MAKRPANEL, MINIPANEL)
  130. #define IS_ULTIPANEL
  131. #define DOGLCD
  132. #if ENABLED(MAKRPANEL)
  133. #define U8GLIB_ST7565_64128N
  134. #endif
  135. #endif
  136. #if ENABLED(IS_U8GLIB_SSD1306)
  137. #define U8GLIB_SSD1306
  138. #endif
  139. #if ENABLED(OVERLORD_OLED)
  140. #define IS_ULTIPANEL
  141. #define U8GLIB_SH1106
  142. /**
  143. * PCA9632 for buzzer and LEDs via i2c
  144. * No auto-inc, red and green leds switched, buzzer
  145. */
  146. #define PCA9632
  147. #define PCA9632_NO_AUTO_INC
  148. #define PCA9632_GRN 0x00
  149. #define PCA9632_RED 0x02
  150. #define PCA9632_BUZZER
  151. #define PCA9632_BUZZER_DATA { 0x09, 0x02 }
  152. #define ENCODER_PULSES_PER_STEP 1 // Overlord uses buttons
  153. #define ENCODER_STEPS_PER_MENU_ITEM 1
  154. #endif
  155. // 128x64 I2C OLED LCDs - SSD1306/SSD1309/SH1106
  156. #define HAS_SSD1306_OLED_I2C ANY(U8GLIB_SSD1306, U8GLIB_SSD1309, U8GLIB_SH1106)
  157. #if HAS_SSD1306_OLED_I2C
  158. #define IS_ULTRA_LCD
  159. #define DOGLCD
  160. #endif
  161. // ST7920-based graphical displays
  162. #if ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, LCD_FOR_MELZI, SILVER_GATE_GLCD_CONTROLLER)
  163. #define DOGLCD
  164. #define U8GLIB_ST7920
  165. #define IS_RRD_SC
  166. #endif
  167. // RepRapDiscount LCD or Graphical LCD with rotary click encoder
  168. #if ENABLED(IS_RRD_SC)
  169. #define REPRAP_DISCOUNT_SMART_CONTROLLER
  170. #endif
  171. /**
  172. * SPI Ultipanels
  173. */
  174. // Basic Ultipanel-like displays
  175. #if ANY(ULTIMAKERCONTROLLER, REPRAP_DISCOUNT_SMART_CONTROLLER, G3D_PANEL, RIGIDBOT_PANEL, PANEL_ONE, U8GLIB_SH1106)
  176. #define IS_ULTIPANEL
  177. #endif
  178. // Einstart OLED has Cardinal nav via pins defined in pins_EINSTART-S.h
  179. #if ENABLED(U8GLIB_SH1106_EINSTART)
  180. #define DOGLCD
  181. #define IS_ULTIPANEL
  182. #endif
  183. // FSMC/SPI TFT Panels
  184. #if ENABLED(FSMC_GRAPHICAL_TFT)
  185. #define DOGLCD
  186. #define IS_ULTIPANEL
  187. #define DELAYED_BACKLIGHT_INIT
  188. #endif
  189. /**
  190. * I2C Panels
  191. */
  192. #if EITHER(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004)
  193. #define LCD_I2C_TYPE_PCF8575
  194. #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
  195. #if ENABLED(LCD_SAINSMART_I2C_2004)
  196. #define LCD_WIDTH 20
  197. #define LCD_HEIGHT 4
  198. #endif
  199. #elif ENABLED(LCD_I2C_PANELOLU2)
  200. // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
  201. #define LCD_I2C_TYPE_MCP23017
  202. #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
  203. #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (optional)
  204. #define IS_ULTIPANEL
  205. #elif ENABLED(LCD_I2C_VIKI)
  206. /**
  207. * Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
  208. *
  209. * This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
  210. * Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
  211. * Note: The pause/stop/resume LCD button pin should be connected to the Arduino
  212. * BTN_ENC pin (or set BTN_ENC to -1 if not used)
  213. */
  214. #define LCD_I2C_TYPE_MCP23017
  215. #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
  216. #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
  217. #define IS_ULTIPANEL
  218. #define ENCODER_FEEDRATE_DEADZONE 4
  219. #define STD_ENCODER_PULSES_PER_STEP 1
  220. #define STD_ENCODER_STEPS_PER_MENU_ITEM 2
  221. #elif ENABLED(G3D_PANEL)
  222. #define STD_ENCODER_PULSES_PER_STEP 2
  223. #define STD_ENCODER_STEPS_PER_MENU_ITEM 1
  224. #elif ANY(REPRAP_DISCOUNT_SMART_CONTROLLER, miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864, OLED_PANEL_TINYBOY2, BQ_LCD_SMART_CONTROLLER, LCD_I2C_PANELOLU2)
  225. #define STD_ENCODER_PULSES_PER_STEP 4
  226. #define STD_ENCODER_STEPS_PER_MENU_ITEM 1
  227. #endif
  228. #ifndef STD_ENCODER_PULSES_PER_STEP
  229. #if ENABLED(TOUCH_BUTTONS)
  230. #define STD_ENCODER_PULSES_PER_STEP 2
  231. #else
  232. #define STD_ENCODER_PULSES_PER_STEP 5
  233. #endif
  234. #endif
  235. #ifndef STD_ENCODER_STEPS_PER_MENU_ITEM
  236. #define STD_ENCODER_STEPS_PER_MENU_ITEM 1
  237. #endif
  238. #ifndef ENCODER_PULSES_PER_STEP
  239. #define ENCODER_PULSES_PER_STEP STD_ENCODER_PULSES_PER_STEP
  240. #endif
  241. #ifndef ENCODER_STEPS_PER_MENU_ITEM
  242. #define ENCODER_STEPS_PER_MENU_ITEM STD_ENCODER_STEPS_PER_MENU_ITEM
  243. #endif
  244. #ifndef ENCODER_FEEDRATE_DEADZONE
  245. #define ENCODER_FEEDRATE_DEADZONE 6
  246. #endif
  247. // Shift register panels
  248. // ---------------------
  249. // 2 wire Non-latching LCD SR from:
  250. // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
  251. #if ENABLED(FF_INTERFACEBOARD)
  252. #define SR_LCD_3W_NL // Non latching 3 wire shift register
  253. #define IS_ULTIPANEL
  254. #elif ENABLED(SAV_3DLCD)
  255. #define SR_LCD_2W_NL // Non latching 2 wire shift register
  256. #define IS_ULTIPANEL
  257. #endif
  258. #if ENABLED(IS_ULTIPANEL)
  259. #define ULTIPANEL
  260. #endif
  261. #if ENABLED(ULTIPANEL)
  262. #define IS_ULTRA_LCD
  263. #ifndef NEWPANEL
  264. #define NEWPANEL
  265. #endif
  266. #endif
  267. #if ENABLED(IS_ULTRA_LCD)
  268. #define ULTRA_LCD
  269. #endif
  270. #if ENABLED(IS_RRW_KEYPAD)
  271. #define REPRAPWORLD_KEYPAD
  272. #endif
  273. // Keypad needs a move step
  274. #if ENABLED(REPRAPWORLD_KEYPAD)
  275. #define NEWPANEL
  276. #ifndef REPRAPWORLD_KEYPAD_MOVE_STEP
  277. #define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
  278. #endif
  279. #endif
  280. // Extensible UI serial touch screens. (See src/lcd/extensible_ui)
  281. #if ANY(MALYAN_LCD, DGUS_LCD, TOUCH_UI_FTDI_EVE)
  282. #define IS_EXTUI
  283. #define EXTENSIBLE_UI
  284. #endif
  285. // Aliases for LCD features
  286. #define HAS_SPI_LCD ENABLED(ULTRA_LCD)
  287. #define HAS_DISPLAY (HAS_SPI_LCD || ENABLED(EXTENSIBLE_UI))
  288. #define HAS_GRAPHICAL_LCD ENABLED(DOGLCD)
  289. #define HAS_CHARACTER_LCD (HAS_SPI_LCD && !HAS_GRAPHICAL_LCD)
  290. #define HAS_LCD_MENU (ENABLED(ULTIPANEL) && DISABLED(NO_LCD_MENUS))
  291. #define HAS_ADC_BUTTONS ENABLED(ADC_KEYPAD)
  292. #define HAS_DGUS_LCD ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY)
  293. #if HAS_GRAPHICAL_LCD
  294. #ifndef LCD_PIXEL_WIDTH
  295. #define LCD_PIXEL_WIDTH 128
  296. #endif
  297. #ifndef LCD_PIXEL_HEIGHT
  298. #define LCD_PIXEL_HEIGHT 64
  299. #endif
  300. #endif
  301. /**
  302. * Extruders have some combination of stepper motors and hotends
  303. * so we separate these concepts into the defines:
  304. *
  305. * EXTRUDERS - Number of Selectable Tools
  306. * HOTENDS - Number of hotends, whether connected or separate
  307. * E_STEPPERS - Number of actual E stepper motors
  308. * E_MANUAL - Number of E steppers for LCD move options
  309. *
  310. */
  311. #if EXTRUDERS == 0
  312. #undef DISTINCT_E_FACTORS
  313. #undef SINGLENOZZLE
  314. #undef SWITCHING_EXTRUDER
  315. #undef SWITCHING_NOZZLE
  316. #undef MIXING_EXTRUDER
  317. #undef MK2_MULTIPLEXER
  318. #undef PRUSA_MMU2
  319. #endif
  320. #if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS
  321. #if EXTRUDERS > 4
  322. #define E_STEPPERS 3
  323. #elif EXTRUDERS > 2
  324. #define E_STEPPERS 2
  325. #else
  326. #define E_STEPPERS 1
  327. #endif
  328. #if DISABLED(SWITCHING_NOZZLE)
  329. #define HOTENDS E_STEPPERS
  330. #endif
  331. #elif ENABLED(MIXING_EXTRUDER)
  332. #define E_STEPPERS MIXING_STEPPERS
  333. #define E_MANUAL 1
  334. #define DUAL_MIXING_EXTRUDER (MIXING_STEPPERS == 2)
  335. #elif ENABLED(SWITCHING_TOOLHEAD)
  336. #define E_STEPPERS EXTRUDERS
  337. #define E_MANUAL EXTRUDERS
  338. #elif ENABLED(PRUSA_MMU2)
  339. #define E_STEPPERS 1
  340. #endif
  341. // No inactive extruders with MK2_MULTIPLEXER or SWITCHING_NOZZLE
  342. #if EITHER(MK2_MULTIPLEXER, SWITCHING_NOZZLE)
  343. #undef DISABLE_INACTIVE_EXTRUDER
  344. #endif
  345. // Prusa MK2 Multiplexer and MMU 2.0 force SINGLENOZZLE
  346. #if EITHER(MK2_MULTIPLEXER, PRUSA_MMU2)
  347. #define SINGLENOZZLE
  348. #endif
  349. #if EITHER(SINGLENOZZLE, MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset
  350. #undef HOTENDS
  351. #define HOTENDS 1
  352. #undef HOTEND_OFFSET_X
  353. #undef HOTEND_OFFSET_Y
  354. #endif
  355. #ifndef HOTENDS
  356. #define HOTENDS EXTRUDERS
  357. #endif
  358. #ifndef E_STEPPERS
  359. #define E_STEPPERS EXTRUDERS
  360. #endif
  361. #ifndef E_MANUAL
  362. #define E_MANUAL EXTRUDERS
  363. #endif
  364. // Helper macros for extruder and hotend arrays
  365. #define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++)
  366. #define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V)
  367. #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1, v1, v1, v1, v1)
  368. #define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V)
  369. #define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1, v1, v1)
  370. #define DO_SWITCH_EXTRUDER (ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR))
  371. #define SWITCHING_NOZZLE_TWO_SERVOS defined(SWITCHING_NOZZLE_E1_SERVO_NR)
  372. #define HAS_DUPLICATION_MODE EITHER(DUAL_X_CARRIAGE, MULTI_NOZZLE_DUPLICATION)
  373. #define HAS_HOTEND_OFFSET (HOTENDS > 1)
  374. /**
  375. * Default hotend offsets, if not defined
  376. */
  377. #if HAS_HOTEND_OFFSET
  378. #ifndef HOTEND_OFFSET_X
  379. #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
  380. #endif
  381. #ifndef HOTEND_OFFSET_Y
  382. #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
  383. #endif
  384. #ifndef HOTEND_OFFSET_Z
  385. #define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder
  386. #endif
  387. #endif
  388. /**
  389. * DISTINCT_E_FACTORS affects how some E factors are accessed
  390. */
  391. #if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1
  392. #define XYZE_N (XYZ + E_STEPPERS)
  393. #define E_AXIS_N(E) AxisEnum(E_AXIS + E)
  394. #define UNUSED_E(E) NOOP
  395. #else
  396. #undef DISTINCT_E_FACTORS
  397. #define XYZE_N XYZE
  398. #define E_AXIS_N(E) E_AXIS
  399. #define UNUSED_E(E) UNUSED(E)
  400. #endif
  401. /**
  402. * The BLTouch Probe emulates a servo probe
  403. * and uses "special" angles for its state.
  404. */
  405. #if ENABLED(BLTOUCH)
  406. #ifndef Z_PROBE_SERVO_NR
  407. #define Z_PROBE_SERVO_NR 0
  408. #endif
  409. #ifndef NUM_SERVOS
  410. #define NUM_SERVOS (Z_PROBE_SERVO_NR + 1)
  411. #endif
  412. #undef DEACTIVATE_SERVOS_AFTER_MOVE
  413. #if NUM_SERVOS == 1
  414. #undef SERVO_DELAY
  415. #define SERVO_DELAY { 50 }
  416. #endif
  417. // Always disable probe pin inverting for BLTouch
  418. #undef Z_MIN_PROBE_ENDSTOP_INVERTING
  419. #define Z_MIN_PROBE_ENDSTOP_INVERTING false
  420. #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  421. #undef Z_MIN_ENDSTOP_INVERTING
  422. #define Z_MIN_ENDSTOP_INVERTING false
  423. #endif
  424. #endif
  425. #ifndef PREHEAT_1_LABEL
  426. #define PREHEAT_1_LABEL "PLA"
  427. #endif
  428. #ifndef PREHEAT_2_LABEL
  429. #define PREHEAT_2_LABEL "ABS"
  430. #endif
  431. /**
  432. * Set a flag for a servo probe (or BLTouch)
  433. */
  434. #define HAS_Z_SERVO_PROBE (defined(Z_PROBE_SERVO_NR) && Z_PROBE_SERVO_NR >= 0)
  435. #define HAS_SERVO_ANGLES (HAS_Z_SERVO_PROBE || EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE))
  436. #if !HAS_SERVO_ANGLES
  437. #undef EDITABLE_SERVO_ANGLES
  438. #endif
  439. /**
  440. * Set flags for enabled probes
  441. */
  442. #define HAS_BED_PROBE (HAS_Z_SERVO_PROBE || ANY(FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, SOLENOID_PROBE, SENSORLESS_PROBING, RACK_AND_PINION_PROBE))
  443. #define PROBE_SELECTED (HAS_BED_PROBE || EITHER(PROBE_MANUALLY, MESH_BED_LEVELING))
  444. #if HAS_BED_PROBE
  445. #define HAS_PROBE_XY_OFFSET DISABLED(NOZZLE_AS_PROBE)
  446. #define HAS_CUSTOM_PROBE_PIN DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  447. #define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0 && !HAS_CUSTOM_PROBE_PIN)
  448. #ifndef Z_PROBE_LOW_POINT
  449. #define Z_PROBE_LOW_POINT -5
  450. #endif
  451. #if ENABLED(Z_PROBE_ALLEN_KEY)
  452. #define PROBE_TRIGGERED_WHEN_STOWED_TEST // Extra test for Allen Key Probe
  453. #endif
  454. #ifdef MULTIPLE_PROBING
  455. #if EXTRA_PROBING
  456. #define TOTAL_PROBING (MULTIPLE_PROBING + EXTRA_PROBING)
  457. #else
  458. #define TOTAL_PROBING MULTIPLE_PROBING
  459. #endif
  460. #endif
  461. #else
  462. // Clear probe pin settings when no probe is selected
  463. #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
  464. #endif
  465. #ifdef GRID_MAX_POINTS_X
  466. #define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y))
  467. #endif
  468. #define HAS_EXTRA_ENDSTOPS ANY(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS, Z_MULTI_ENDSTOPS)
  469. #define HAS_SOFTWARE_ENDSTOPS EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
  470. #define HAS_RESUME_CONTINUE ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER)
  471. #define HAS_COLOR_LEDS ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED)
  472. #define HAS_LEDS_OFF_FLAG (BOTH(PRINTER_EVENT_LEDS, SDSUPPORT) && HAS_RESUME_CONTINUE)
  473. #define HAS_PRINT_PROGRESS EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
  474. #define HAS_PRINT_PROGRESS_PERMYRIAD (HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME))
  475. #define HAS_SERVICE_INTERVALS (ENABLED(PRINTCOUNTER) && (SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0))
  476. #define HAS_FILAMENT_SENSOR ENABLED(FILAMENT_RUNOUT_SENSOR)
  477. #define HAS_GAMES ANY(MARLIN_BRICKOUT, MARLIN_INVADERS, MARLIN_SNAKE, MARLIN_MAZE)
  478. #define HAS_GAME_MENU (1 < ENABLED(MARLIN_BRICKOUT) + ENABLED(MARLIN_INVADERS) + ENABLED(MARLIN_SNAKE) + ENABLED(MARLIN_MAZE))
  479. #define IS_SCARA ENABLED(MORGAN_SCARA)
  480. #define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA)
  481. #define IS_CARTESIAN !IS_KINEMATIC
  482. #ifndef INVERT_X_DIR
  483. #define INVERT_X_DIR false
  484. #endif
  485. #ifndef INVERT_Y_DIR
  486. #define INVERT_Y_DIR false
  487. #endif
  488. #ifndef INVERT_Z_DIR
  489. #define INVERT_Z_DIR false
  490. #endif
  491. #ifndef INVERT_E_DIR
  492. #define INVERT_E_DIR false
  493. #endif
  494. #if ENABLED(SLIM_LCD_MENUS)
  495. #define BOOT_MARLIN_LOGO_SMALL
  496. #endif
  497. #define IS_RE_ARM_BOARD MB(RAMPS_14_RE_ARM_EFB, RAMPS_14_RE_ARM_EEB, RAMPS_14_RE_ARM_EFF, RAMPS_14_RE_ARM_EEF, RAMPS_14_RE_ARM_SF)
  498. // Linear advance uses Jerk since E is an isolated axis
  499. #define HAS_LINEAR_E_JERK (DISABLED(CLASSIC_JERK) && ENABLED(LIN_ADVANCE))
  500. // This flag indicates some kind of jerk storage is needed
  501. #define HAS_CLASSIC_JERK (ENABLED(CLASSIC_JERK) || IS_KINEMATIC)
  502. // E jerk exists with JD disabled (of course) but also when Linear Advance is disabled on Delta/SCARA
  503. #define HAS_CLASSIC_E_JERK (ENABLED(CLASSIC_JERK) || (IS_KINEMATIC && DISABLED(LIN_ADVANCE)))
  504. #ifndef SPI_SPEED
  505. #define SPI_SPEED SPI_FULL_SPEED
  506. #endif
  507. /**
  508. * This setting is also used by M109 when trying to calculate
  509. * a ballpark safe margin to prevent wait-forever situation.
  510. */
  511. #ifndef EXTRUDE_MINTEMP
  512. #define EXTRUDE_MINTEMP 170
  513. #endif