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_adv.h 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  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. * Conditionals_adv.h
  25. * Defines that depend on advanced configuration.
  26. */
  27. #ifdef SWITCHING_NOZZLE_E1_SERVO_NR
  28. #define SWITCHING_NOZZLE_TWO_SERVOS 1
  29. #endif
  30. // Determine NUM_SERVOS if none was supplied
  31. #ifndef NUM_SERVOS
  32. #define NUM_SERVOS 0
  33. #if ANY(CHAMBER_VENT, HAS_Z_SERVO_PROBE, SWITCHING_EXTRUDER, SWITCHING_NOZZLE)
  34. #if NUM_SERVOS <= Z_PROBE_SERVO_NR
  35. #undef NUM_SERVOS
  36. #define NUM_SERVOS (Z_PROBE_SERVO_NR + 1)
  37. #endif
  38. #if NUM_SERVOS <= CHAMBER_VENT_SERVO_NR
  39. #undef NUM_SERVOS
  40. #define NUM_SERVOS (CHAMBER_VENT_SERVO_NR + 1)
  41. #endif
  42. #if NUM_SERVOS <= SWITCHING_TOOLHEAD_SERVO_NR
  43. #undef NUM_SERVOS
  44. #define NUM_SERVOS (SWITCHING_TOOLHEAD_SERVO_NR + 1)
  45. #endif
  46. #if NUM_SERVOS <= SWITCHING_NOZZLE_SERVO_NR
  47. #undef NUM_SERVOS
  48. #define NUM_SERVOS (SWITCHING_NOZZLE_SERVO_NR + 1)
  49. #endif
  50. #if NUM_SERVOS <= SWITCHING_NOZZLE_E1_SERVO_NR
  51. #undef NUM_SERVOS
  52. #define NUM_SERVOS (SWITCHING_NOZZLE_E1_SERVO_NR + 1)
  53. #endif
  54. #if NUM_SERVOS <= SWITCHING_EXTRUDER_SERVO_NR
  55. #undef NUM_SERVOS
  56. #define NUM_SERVOS (SWITCHING_EXTRUDER_SERVO_NR + 1)
  57. #endif
  58. #if NUM_SERVOS <= SWITCHING_EXTRUDER_E23_SERVO_NR
  59. #undef NUM_SERVOS
  60. #define NUM_SERVOS (SWITCHING_EXTRUDER_E23_SERVO_NR + 1)
  61. #endif
  62. #endif
  63. #endif
  64. // Convenience override for a BLTouch alone
  65. #if ENABLED(BLTOUCH) && NUM_SERVOS == 1
  66. #undef SERVO_DELAY
  67. #define SERVO_DELAY { 50 }
  68. #endif
  69. #if EXTRUDERS == 0
  70. #define NO_VOLUMETRICS
  71. #undef TEMP_SENSOR_0
  72. #undef TEMP_SENSOR_1
  73. #undef TEMP_SENSOR_2
  74. #undef TEMP_SENSOR_3
  75. #undef TEMP_SENSOR_4
  76. #undef TEMP_SENSOR_5
  77. #undef TEMP_SENSOR_6
  78. #undef TEMP_SENSOR_7
  79. #undef FWRETRACT
  80. #undef PIDTEMP
  81. #undef AUTOTEMP
  82. #undef PID_EXTRUSION_SCALING
  83. #undef LIN_ADVANCE
  84. #undef FILAMENT_RUNOUT_SENSOR
  85. #undef ADVANCED_PAUSE_FEATURE
  86. #undef FILAMENT_RUNOUT_DISTANCE_MM
  87. #undef FILAMENT_LOAD_UNLOAD_GCODES
  88. #undef DISABLE_INACTIVE_EXTRUDER
  89. #undef FILAMENT_LOAD_UNLOAD_GCODES
  90. #undef EXTRUDER_RUNOUT_PREVENT
  91. #undef PREVENT_COLD_EXTRUSION
  92. #undef PREVENT_LENGTHY_EXTRUDE
  93. #undef THERMAL_PROTECTION_HOTENDS
  94. #undef THERMAL_PROTECTION_PERIOD
  95. #undef WATCH_TEMP_PERIOD
  96. #undef SHOW_TEMP_ADC_VALUES
  97. #endif
  98. #if TEMP_SENSOR_BED == 0
  99. #undef THERMAL_PROTECTION_BED
  100. #undef THERMAL_PROTECTION_BED_PERIOD
  101. #endif
  102. #if TEMP_SENSOR_CHAMBER == 0
  103. #undef THERMAL_PROTECTION_CHAMBER
  104. #endif
  105. #if ENABLED(MIXING_EXTRUDER) && (ENABLED(RETRACT_SYNC_MIXING) || BOTH(FILAMENT_LOAD_UNLOAD_GCODES, FILAMENT_UNLOAD_ALL_EXTRUDERS))
  106. #define HAS_MIXER_SYNC_CHANNEL 1
  107. #endif
  108. #if EITHER(DUAL_X_CARRIAGE, MULTI_NOZZLE_DUPLICATION)
  109. #define HAS_DUPLICATION_MODE 1
  110. #endif
  111. #if ENABLED(PRINTCOUNTER) && (SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0)
  112. #define HAS_SERVICE_INTERVALS 1
  113. #endif
  114. #if ENABLED(FILAMENT_RUNOUT_SENSOR)
  115. #define HAS_FILAMENT_SENSOR 1
  116. #ifdef FILAMENT_RUNOUT_DISTANCE_MM
  117. #define HAS_FILAMENT_RUNOUT_DISTANCE 1
  118. #endif
  119. #endif
  120. // Let SD_FINISHED_RELEASECOMMAND stand in for SD_FINISHED_STEPPERRELEASE
  121. #if ENABLED(SD_FINISHED_STEPPERRELEASE)
  122. #ifndef SD_FINISHED_RELEASECOMMAND
  123. #define SD_FINISHED_RELEASECOMMAND "M84" // planner.finish_and_disable()
  124. #endif
  125. #else
  126. #undef SD_FINISHED_RELEASECOMMAND
  127. #endif
  128. #if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
  129. #define HAS_PRINT_PROGRESS 1
  130. #endif
  131. #if HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME)
  132. #define HAS_PRINT_PROGRESS_PERMYRIAD 1
  133. #endif
  134. #if ANY(MARLIN_BRICKOUT, MARLIN_INVADERS, MARLIN_SNAKE, MARLIN_MAZE)
  135. #define HAS_GAMES 1
  136. #if (1 < ENABLED(MARLIN_BRICKOUT) + ENABLED(MARLIN_INVADERS) + ENABLED(MARLIN_SNAKE) + ENABLED(MARLIN_MAZE))
  137. #define HAS_GAME_MENU 1
  138. #endif
  139. #endif
  140. #if ANY(FWRETRACT, HAS_LEVELING, SKEW_CORRECTION)
  141. #define HAS_POSITION_MODIFIERS 1
  142. #endif
  143. #if ANY(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS, Z_MULTI_ENDSTOPS)
  144. #define HAS_EXTRA_ENDSTOPS 1
  145. #endif
  146. #if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
  147. #define HAS_SOFTWARE_ENDSTOPS 1
  148. #endif
  149. #if ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER, HAS_ADC_BUTTONS, DWIN_CREALITY_LCD)
  150. #define HAS_RESUME_CONTINUE 1
  151. #endif
  152. #if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED)
  153. #define HAS_COLOR_LEDS 1
  154. #endif
  155. #if ALL(HAS_RESUME_CONTINUE, PRINTER_EVENT_LEDS, SDSUPPORT)
  156. #define HAS_LEDS_OFF_FLAG 1
  157. #endif
  158. #if EITHER(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
  159. #define HAS_I2C_DIGIPOT 1
  160. #endif
  161. // Multiple Z steppers
  162. #ifndef NUM_Z_STEPPER_DRIVERS
  163. #define NUM_Z_STEPPER_DRIVERS 1
  164. #endif
  165. #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
  166. #undef Z_STEPPER_ALIGN_AMP
  167. #endif
  168. #ifndef Z_STEPPER_ALIGN_AMP
  169. #define Z_STEPPER_ALIGN_AMP 1.0
  170. #endif
  171. //
  172. // Spindle/Laser power display types
  173. // Defined here so sanity checks can use them
  174. //
  175. #if EITHER(SPINDLE_FEATURE, LASER_FEATURE)
  176. #define HAS_CUTTER 1
  177. #define _CUTTER_POWER_PWM255 1
  178. #define _CUTTER_POWER_PERCENT 2
  179. #define _CUTTER_POWER_RPM 3
  180. #define _CUTTER_POWER(V) _CAT(_CUTTER_POWER_, V)
  181. #define CUTTER_UNIT_IS(V) (_CUTTER_POWER(CUTTER_POWER_UNIT) == _CUTTER_POWER(V))
  182. #endif
  183. // Add features that need hardware PWM here
  184. #if ANY(FAST_PWM_FAN, SPINDLE_LASER_PWM)
  185. #define NEEDS_HARDWARE_PWM 1
  186. #endif
  187. #if !defined(__AVR__) || !defined(USBCON)
  188. // Define constants and variables for buffering serial data.
  189. // Use only 0 or powers of 2 greater than 1
  190. // : [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...]
  191. #ifndef RX_BUFFER_SIZE
  192. #define RX_BUFFER_SIZE 128
  193. #endif
  194. // 256 is the max TX buffer limit due to uint8_t head and tail
  195. // : [0, 4, 8, 16, 32, 64, 128, 256]
  196. #ifndef TX_BUFFER_SIZE
  197. #define TX_BUFFER_SIZE 32
  198. #endif
  199. #else
  200. // SERIAL_XON_XOFF not supported on USB-native devices
  201. #undef SERIAL_XON_XOFF
  202. #endif
  203. #if ENABLED(HOST_ACTION_COMMANDS)
  204. #ifndef ACTION_ON_PAUSE
  205. #define ACTION_ON_PAUSE "pause"
  206. #endif
  207. #ifndef ACTION_ON_PAUSED
  208. #define ACTION_ON_PAUSED "paused"
  209. #endif
  210. #ifndef ACTION_ON_RESUME
  211. #define ACTION_ON_RESUME "resume"
  212. #endif
  213. #ifndef ACTION_ON_RESUMED
  214. #define ACTION_ON_RESUMED "resumed"
  215. #endif
  216. #ifndef ACTION_ON_CANCEL
  217. #define ACTION_ON_CANCEL "cancel"
  218. #endif
  219. #ifndef ACTION_ON_START
  220. #define ACTION_ON_START "start"
  221. #endif
  222. #ifndef ACTION_ON_KILL
  223. #define ACTION_ON_KILL "poweroff"
  224. #endif
  225. #if HAS_FILAMENT_SENSOR
  226. #ifndef ACTION_ON_FILAMENT_RUNOUT
  227. #define ACTION_ON_FILAMENT_RUNOUT "filament_runout"
  228. #endif
  229. #ifndef ACTION_REASON_ON_FILAMENT_RUNOUT
  230. #define ACTION_REASON_ON_FILAMENT_RUNOUT "filament_runout"
  231. #endif
  232. #endif
  233. #if ENABLED(G29_RETRY_AND_RECOVER)
  234. #ifndef ACTION_ON_G29_RECOVER
  235. #define ACTION_ON_G29_RECOVER "probe_rewipe"
  236. #endif
  237. #ifndef ACTION_ON_G29_FAILURE
  238. #define ACTION_ON_G29_FAILURE "probe_failed"
  239. #endif
  240. #endif
  241. #endif
  242. #if EITHER(FYSETC_MINI_12864_2_1, FYSETC_242_OLED_12864)
  243. #define LED_CONTROL_MENU
  244. #define LED_USER_PRESET_STARTUP
  245. #define LED_COLOR_PRESETS
  246. #ifndef LED_USER_PRESET_GREEN
  247. #define LED_USER_PRESET_GREEN 128
  248. #endif
  249. #ifndef LED_USER_PRESET_BLUE
  250. #define LED_USER_PRESET_BLUE 0
  251. #endif
  252. #ifndef LED_USER_PRESET_BRIGHTNESS
  253. #define LED_USER_PRESET_BRIGHTNESS 255
  254. #endif
  255. #endif
  256. // Set defaults for unspecified LED user colors
  257. #if ENABLED(LED_CONTROL_MENU)
  258. #ifndef LED_USER_PRESET_RED
  259. #define LED_USER_PRESET_RED 255
  260. #endif
  261. #ifndef LED_USER_PRESET_GREEN
  262. #define LED_USER_PRESET_GREEN 255
  263. #endif
  264. #ifndef LED_USER_PRESET_BLUE
  265. #define LED_USER_PRESET_BLUE 255
  266. #endif
  267. #ifndef LED_USER_PRESET_WHITE
  268. #define LED_USER_PRESET_WHITE 0
  269. #endif
  270. #ifndef LED_USER_PRESET_BRIGHTNESS
  271. #ifdef NEOPIXEL_BRIGHTNESS
  272. #define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS
  273. #else
  274. #define LED_USER_PRESET_BRIGHTNESS 255
  275. #endif
  276. #endif
  277. #endif
  278. #if BOTH(LED_CONTROL_MENU, NEOPIXEL2_SEPARATE)
  279. #ifndef LED2_USER_PRESET_RED
  280. #define LED2_USER_PRESET_RED 255
  281. #endif
  282. #ifndef LED2_USER_PRESET_GREEN
  283. #define LED2_USER_PRESET_GREEN 255
  284. #endif
  285. #ifndef LED2_USER_PRESET_BLUE
  286. #define LED2_USER_PRESET_BLUE 255
  287. #endif
  288. #ifndef LED2_USER_PRESET_WHITE
  289. #define LED2_USER_PRESET_WHITE 0
  290. #endif
  291. #ifndef LED2_USER_PRESET_BRIGHTNESS
  292. #ifdef NEOPIXEL2_BRIGHTNESS
  293. #define LED2_USER_PRESET_BRIGHTNESS NEOPIXEL2_BRIGHTNESS
  294. #else
  295. #define LED2_USER_PRESET_BRIGHTNESS 255
  296. #endif
  297. #endif
  298. #endif
  299. // If platform requires early initialization of watchdog to properly boot
  300. #if ENABLED(USE_WATCHDOG) && defined(ARDUINO_ARCH_SAM)
  301. #define EARLY_WATCHDOG 1
  302. #endif
  303. // Full Touch Screen needs 'tft/xpt2046'
  304. #if EITHER(TOUCH_SCREEN, HAS_TFT_LVGL_UI)
  305. #define HAS_TFT_XPT2046 1
  306. #endif
  307. // Touch Screen or "Touch Buttons" need XPT2046 pins
  308. // but they use different components
  309. #if EITHER(HAS_TFT_XPT2046, HAS_TOUCH_XPT2046)
  310. #define NEED_TOUCH_PINS 1
  311. #endif
  312. // Extensible UI pin mapping for RepRapDiscount
  313. #if ENABLED(TOUCH_UI_FTDI_EVE) && ANY(AO_EXP1_PINMAP, AO_EXP2_PINMAP, CR10_TFT_PINMAP)
  314. #define TOUCH_UI_ULTIPANEL 1
  315. #endif
  316. // Poll-based jogging for joystick and other devices
  317. #if ENABLED(JOYSTICK)
  318. #define POLL_JOG
  319. #endif
  320. /**
  321. * Driver Timings (in nanoseconds)
  322. * NOTE: Driver timing order is longest-to-shortest duration.
  323. * Preserve this ordering when adding new drivers.
  324. */
  325. #ifndef MINIMUM_STEPPER_POST_DIR_DELAY
  326. #if HAS_DRIVER(TB6560)
  327. #define MINIMUM_STEPPER_POST_DIR_DELAY 15000
  328. #elif HAS_DRIVER(TB6600)
  329. #define MINIMUM_STEPPER_POST_DIR_DELAY 1500
  330. #elif HAS_DRIVER(DRV8825)
  331. #define MINIMUM_STEPPER_POST_DIR_DELAY 650
  332. #elif HAS_DRIVER(LV8729)
  333. #define MINIMUM_STEPPER_POST_DIR_DELAY 500
  334. #elif HAS_DRIVER(A5984)
  335. #define MINIMUM_STEPPER_POST_DIR_DELAY 400
  336. #elif HAS_DRIVER(A4988)
  337. #define MINIMUM_STEPPER_POST_DIR_DELAY 200
  338. #elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE
  339. #define MINIMUM_STEPPER_POST_DIR_DELAY 60
  340. #else
  341. #define MINIMUM_STEPPER_POST_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire
  342. #endif
  343. #endif
  344. #ifndef MINIMUM_STEPPER_PRE_DIR_DELAY
  345. #define MINIMUM_STEPPER_PRE_DIR_DELAY MINIMUM_STEPPER_POST_DIR_DELAY
  346. #endif
  347. #ifndef MINIMUM_STEPPER_PULSE
  348. #if HAS_DRIVER(TB6560)
  349. #define MINIMUM_STEPPER_PULSE 30
  350. #elif HAS_DRIVER(TB6600)
  351. #define MINIMUM_STEPPER_PULSE 3
  352. #elif HAS_DRIVER(DRV8825)
  353. #define MINIMUM_STEPPER_PULSE 2
  354. #elif HAS_DRIVER(A4988) || HAS_DRIVER(A5984)
  355. #define MINIMUM_STEPPER_PULSE 1
  356. #elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE
  357. #define MINIMUM_STEPPER_PULSE 0
  358. #elif HAS_DRIVER(LV8729)
  359. #define MINIMUM_STEPPER_PULSE 0
  360. #else
  361. #define MINIMUM_STEPPER_PULSE 2
  362. #endif
  363. #endif
  364. #ifndef MAXIMUM_STEPPER_RATE
  365. #if HAS_DRIVER(TB6560)
  366. #define MAXIMUM_STEPPER_RATE 15000
  367. #elif HAS_DRIVER(TB6600)
  368. #define MAXIMUM_STEPPER_RATE 150000
  369. #elif HAS_DRIVER(DRV8825)
  370. #define MAXIMUM_STEPPER_RATE 250000
  371. #elif HAS_DRIVER(A4988)
  372. #define MAXIMUM_STEPPER_RATE 500000
  373. #elif HAS_DRIVER(LV8729)
  374. #define MAXIMUM_STEPPER_RATE 1000000
  375. #elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE
  376. #define MAXIMUM_STEPPER_RATE 5000000
  377. #else
  378. #define MAXIMUM_STEPPER_RATE 250000
  379. #endif
  380. #endif
  381. #if ENABLED(DIRECT_STEPPING)
  382. #ifndef STEPPER_PAGES
  383. #define STEPPER_PAGES 16
  384. #endif
  385. #ifndef STEPPER_PAGE_FORMAT
  386. #define STEPPER_PAGE_FORMAT SP_4x2_256
  387. #endif
  388. #ifndef PAGE_MANAGER
  389. #define PAGE_MANAGER SerialPageManager
  390. #endif
  391. #endif
  392. //
  393. // SD Card connection methods
  394. // Defined here so pins and sanity checks can use them
  395. //
  396. #if ENABLED(SDSUPPORT)
  397. #define _SDCARD_LCD 1
  398. #define _SDCARD_ONBOARD 2
  399. #define _SDCARD_CUSTOM_CABLE 3
  400. #define _SDCARD_ID(V) _CAT(_SDCARD_, V)
  401. #define SD_CONNECTION_IS(V) (_SDCARD_ID(SDCARD_CONNECTION) == _SDCARD_ID(V))
  402. #else
  403. #define SD_CONNECTION_IS(...) 0
  404. #endif
  405. // Power Monitor sensors
  406. #if EITHER(POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE)
  407. #define HAS_POWER_MONITOR 1
  408. #endif
  409. #if ENABLED(POWER_MONITOR_CURRENT) && defined(POWER_MONITOR_FIXED_VOLTAGE)
  410. #define HAS_POWER_MONITOR_VREF 1
  411. #endif
  412. #if BOTH(HAS_POWER_MONITOR_VREF, POWER_MONITOR_CURRENT)
  413. #define HAS_POWER_MONITOR_WATTS 1
  414. #endif
  415. // Flag if an EEPROM type is pre-selected
  416. #if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM, QSPI_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION)
  417. #define NO_EEPROM_SELECTED 1
  418. #endif
  419. // Flag whether hex_print.cpp is used
  420. #if ANY(AUTO_BED_LEVELING_UBL, M100_FREE_MEMORY_WATCHER, DEBUG_GCODE_PARSER, TMC_DEBUG, MARLIN_DEV_MODE)
  421. #define NEED_HEX_PRINT 1
  422. #endif
  423. // Flag whether least_squares_fit.cpp is used
  424. #if ANY(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_LINEAR, Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
  425. #define NEED_LSF 1
  426. #endif
  427. // Flag the indexed serial ports that are in use
  428. #define ANY_SERIAL_IS(N) (defined(SERIAL_PORT) && SERIAL_PORT == (N)) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == (N)) || (defined(LCD_SERIAL_PORT) && LCD_SERIAL_PORT == (N))
  429. #if ANY_SERIAL_IS(-1)
  430. #define USING_SERIAL_DEFAULT
  431. #endif
  432. #if ANY_SERIAL_IS(0)
  433. #define USING_SERIAL_0 1
  434. #endif
  435. #if ANY_SERIAL_IS(1)
  436. #define USING_SERIAL_1 1
  437. #endif
  438. #if ANY_SERIAL_IS(2)
  439. #define USING_SERIAL_2 1
  440. #endif
  441. #if ANY_SERIAL_IS(3)
  442. #define USING_SERIAL_3 1
  443. #endif
  444. #if ANY_SERIAL_IS(4)
  445. #define USING_SERIAL_4 1
  446. #endif
  447. #if ANY_SERIAL_IS(5)
  448. #define USING_SERIAL_5 1
  449. #endif
  450. #if ANY_SERIAL_IS(6)
  451. #define USING_SERIAL_6 1
  452. #endif
  453. #if ANY_SERIAL_IS(7)
  454. #define USING_SERIAL_7 1
  455. #endif
  456. #if ANY_SERIAL_IS(8)
  457. #define USING_SERIAL_8 1
  458. #endif
  459. #undef ANY_SERIAL_IS