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.

Conditionals_LCD.h 18KB

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