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.

SanityCheck.h 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. #if PIO_PLATFORM_VERSION < 1001
  24. #error "nxplpc-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries. You may need to remove the platform and let it reinstall automatically."
  25. #endif
  26. #if PIO_FRAMEWORK_VERSION < 2002
  27. #error "framework-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries."
  28. #endif
  29. /**
  30. * Detect an old pins file by checking for old ADC pins values.
  31. */
  32. #define _OLD_TEMP_PIN(P) PIN_EXISTS(P) && _CAT(P,_PIN) <= 7 && _CAT(P,_PIN) != 2 && _CAT(P,_PIN) != 3
  33. #if _OLD_TEMP_PIN(TEMP_BED)
  34. #error "TEMP_BED_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
  35. #elif _OLD_TEMP_PIN(TEMP_0)
  36. #error "TEMP_0_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
  37. #elif _OLD_TEMP_PIN(TEMP_1)
  38. #error "TEMP_1_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
  39. #elif _OLD_TEMP_PIN(TEMP_2)
  40. #error "TEMP_2_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
  41. #elif _OLD_TEMP_PIN(TEMP_3)
  42. #error "TEMP_3_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
  43. #elif _OLD_TEMP_PIN(TEMP_4)
  44. #error "TEMP_4_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
  45. #elif _OLD_TEMP_PIN(TEMP_5)
  46. #error "TEMP_5_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
  47. #elif _OLD_TEMP_PIN(TEMP_6)
  48. #error "TEMP_6_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
  49. #elif _OLD_TEMP_PIN(TEMP_7)
  50. #error "TEMP_7_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
  51. #endif
  52. #undef _OLD_TEMP_PIN
  53. /**
  54. * Because PWM hardware channels all share the same frequency, along with the
  55. * fallback software channels, FAST_PWM_FAN is incompatible with Servos.
  56. */
  57. #if NUM_SERVOS > 0 && ENABLED(FAST_PWM_FAN)
  58. #error "BLTOUCH and Servos are incompatible with FAST_PWM_FAN on LPC176x boards."
  59. #endif
  60. /**
  61. * Test LPC176x-specific configuration values for errors at compile-time.
  62. */
  63. //#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
  64. // #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
  65. //#endif
  66. #if IS_RE_ARM_BOARD && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI)
  67. #error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 require TMC_USE_SW_SPI"
  68. #endif
  69. #if ENABLED(BAUD_RATE_GCODE)
  70. #error "BAUD_RATE_GCODE is not yet supported on LPC176x."
  71. #endif
  72. /**
  73. * Flag any serial port conflicts
  74. *
  75. * Port | TX | RX |
  76. * --- | --- | --- |
  77. * Serial | P0_02 | P0_03 |
  78. * Serial1 | P0_15 | P0_16 |
  79. * Serial2 | P0_10 | P0_11 |
  80. * Serial3 | P0_00 | P0_01 |
  81. */
  82. #if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0) || (defined(DGUS_SERIAL_PORT) && DGUS_SERIAL_PORT == 0)
  83. #if X_CS_PIN == P0_02 || TMC_SW_MISO == P0_02 || (E_STEPPERS && E_MUX1_PIN == P0_02) \
  84. || Y_CS_PIN == P0_03 || TMC_SW_MOSI == P0_03 || (E_STEPPERS && E_MUX0_PIN == P0_03)
  85. #error "Serial port assignment (0) conflicts with other pins!"
  86. #endif
  87. #endif
  88. #if SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 || DGUS_SERIAL_PORT == 1
  89. #if TMC_SW_SCK == P0_15
  90. #error "Serial port assignment (1) conflicts with other pins!"
  91. #elif HAS_SPI_LCD
  92. #if BTN_EN2 == P0_15 || SCK_PIN == P0_15 || LCD_PINS_D4 == P0_15 || DOGLCD_SCK == P0_15 || LCD_RESET_PIN == P0_15 || LCD_PINS_RS == P0_15 || SHIFT_CLK == P0_15 \
  93. || BTN_EN1 == P0_16 || LCD_SDSS == P0_16 || LCD_PINS_RS == P0_16 || MISO_PIN == P0_16 || DOGLCD_A0 == P0_16 || SS_PIN == P0_16 || LCD_SDSS == P0_16 || DOGLCD_CS == P0_16 || LCD_RESET_PIN == P0_16 || LCD_BACKLIGHT_PIN == P0_16
  94. #error "Serial port assignment (1) conflicts with other pins!"
  95. #endif
  96. #endif
  97. #endif
  98. #if SERIAL_PORT == 2 || SERIAL_PORT_2 == 2 || DGUS_SERIAL_PORT == 2
  99. #if Y_MIN_PIN == P0_10 || Z_MIN_PROBE_PIN == P0_10 \
  100. || X_ENABLE_PIN == P0_10 || Y_ENABLE_PIN == P0_10 || X2_ENABLE_PIN == P0_10 || Y2_ENABLE_PIN == P0_10 || Z2_ENABLE_PIN == P0_10 || Z3_ENABLE_PIN == P0_10 || Z4_ENABLE_PIN == P0_10 \
  101. || X2_CS_PIN == P0_10 || Y2_CS_PIN == P0_10 || Z2_CS_PIN == P0_10 || Z3_CS_PIN == P0_10 || Z4_CS_PIN == P0_10 \
  102. || X_DIR_PIN == P0_11 || Y_DIR_PIN == P0_11 || X2_DIR_PIN == P0_11 || Y2_DIR_PIN == P0_11 || Z2_DIR_PIN == P0_11 || Z3_DIR_PIN == P0_11 || Z4_DIR_PIN == P0_11 \
  103. || X2_STEP_PIN == P0_11 || Y2_STEP_PIN == P0_11 || Z2_STEP_PIN == P0_11 || Z3_STEP_PIN == P0_11 || Z4_STEP_PIN == P0_11
  104. #error "Serial port assignment (2) conflicts with other pins!"
  105. #elif (E_STEPPERS > 1 && (E1_ENABLE_PIN == P0_10 || E1_CS_PIN == P0_10)) || (E_STEPPERS > 0 && (E0_DIR_PIN == P0_11 || E0_STEP_PIN == P0_11))
  106. #error "Serial port assignment (2) conflicts with other pins!"
  107. #endif
  108. #endif
  109. #if SERIAL_PORT == 3 || SERIAL_PORT_2 == 3 || DGUS_SERIAL_PORT == 3
  110. #if X_MIN_PIN == P0_00 || Y_SERIAL_TX_PIN == P0_00 || Y_SERIAL_RX_PIN == P0_00 \
  111. || X_MAX_PIN == P0_01 || X_SERIAL_TX_PIN == P0_01 || X_SERIAL_RX_PIN == P0_01
  112. #error "Serial port assignment (2) conflicts with other pins!"
  113. #elif E_STEPPERS > 1 && (E1_DIR_PIN == P0_00 || E1_STEP_PIN == P0_01)
  114. #error "Serial port assignment (2) conflicts with other pins!"
  115. #endif
  116. #endif