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 3.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. * Test Arduino Due specific configuration values for errors at compile-time.
  25. */
  26. /**
  27. * Check for common serial pin conflicts
  28. */
  29. #define CHECK_SERIAL_PIN(N) ( \
  30. X_STOP_PIN == N || Y_STOP_PIN == N || Z_STOP_PIN == N \
  31. || X_MIN_PIN == N || Y_MIN_PIN == N || Z_MIN_PIN == N \
  32. || X_MAX_PIN == N || Y_MAX_PIN == N || Z_MAX_PIN == N \
  33. || X_STEP_PIN == N || Y_STEP_PIN == N || Z_STEP_PIN == N \
  34. || X_DIR_PIN == N || Y_DIR_PIN == N || Z_DIR_PIN == N \
  35. || X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \
  36. )
  37. #if SERIAL_IN_USE(0) // D0-D1. No known conflicts.
  38. #endif
  39. #if SERIAL_IN_USE(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19))
  40. #error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board."
  41. #endif
  42. #if SERIAL_IN_USE(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17))
  43. #error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board."
  44. #endif
  45. #if SERIAL_IN_USE(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15))
  46. #error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board."
  47. #endif
  48. #undef CHECK_SERIAL_PIN
  49. /**
  50. * HARDWARE VS. SOFTWARE SPI COMPATIBILITY
  51. *
  52. * DUE selects hardware vs. software SPI depending on whether one of the hardware-controllable SDSS pins is in use.
  53. *
  54. * The hardware SPI controller doesn't allow software SPIs to control any shared pins.
  55. *
  56. * When DUE software SPI is used then Trinamic drivers must use the TMC softSPI.
  57. *
  58. * When DUE hardware SPI is used then a Trinamic driver can use either its hardware SPI or, if there are no shared
  59. * pins, its software SPI.
  60. *
  61. * Usually the hardware SPI pins are only available to the LCD. This makes the DUE hard SPI used at the same time
  62. * as the TMC2130 soft SPI the most common setup.
  63. */
  64. #define _IS_HW_SPI(P) (defined(TMC_SW_##P) && (TMC_SW_##P == SD_MOSI_PIN || TMC_SW_##P == SD_MISO_PIN || TMC_SW_##P == SD_SCK_PIN))
  65. #if ENABLED(SDSUPPORT) && HAS_DRIVER(TMC2130)
  66. #if ENABLED(TMC_USE_SW_SPI)
  67. #if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK))
  68. #error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs."
  69. #endif
  70. #elif ENABLED(DUE_SOFTWARE_SPI)
  71. #error "DUE software SPI is required but is incompatible with TMC2130 hardware SPI. Enable TMC_USE_SW_SPI to fix."
  72. #endif
  73. #endif
  74. #if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
  75. #error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on DUE."
  76. #endif
  77. #if HAS_TMC_SW_SERIAL
  78. #error "TMC220x Software Serial is not supported on the DUE platform."
  79. #endif
  80. #if USING_PULLDOWNS
  81. #error "PULLDOWN pin mode is not available on DUE boards."
  82. #endif