My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

SanityCheck.h 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. /**
  2. * SanityCheck.h
  3. *
  4. * Test configuration values for errors at compile-time.
  5. */
  6. #ifndef SANITYCHECK_H
  7. #define SANITYCHECK_H
  8. /**
  9. * Dual Stepper Drivers
  10. */
  11. #if ENABLED(Z_DUAL_STEPPER_DRIVERS) && ENABLED(Y_DUAL_STEPPER_DRIVERS)
  12. #error You cannot have dual stepper drivers for both Y and Z.
  13. #endif
  14. /**
  15. * Progress Bar
  16. */
  17. #if ENABLED(LCD_PROGRESS_BAR)
  18. #if DISABLED(SDSUPPORT)
  19. #error LCD_PROGRESS_BAR requires SDSUPPORT.
  20. #endif
  21. #if ENABLED(DOGLCD)
  22. #error LCD_PROGRESS_BAR does not apply to graphical displays.
  23. #endif
  24. #if ENABLED(FILAMENT_LCD_DISPLAY)
  25. #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
  26. #endif
  27. #endif
  28. /**
  29. * Babystepping
  30. */
  31. #if ENABLED(BABYSTEPPING)
  32. #if ENABLED(COREXY) && ENABLED(BABYSTEP_XY)
  33. #error BABYSTEPPING only implemented for Z axis on CoreXY.
  34. #endif
  35. #if ENABLED(SCARA)
  36. #error BABYSTEPPING is not implemented for SCARA yet.
  37. #endif
  38. #if ENABLED(DELTA) && ENABLED(BABYSTEP_XY)
  39. #error BABYSTEPPING only implemented for Z axis on deltabots.
  40. #endif
  41. #endif
  42. /**
  43. * Filament Change with Extruder Runout Prevention
  44. */
  45. #if ENABLED(FILAMENTCHANGEENABLE) && ENABLED(EXTRUDER_RUNOUT_PREVENT)
  46. #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE.
  47. #endif
  48. /**
  49. * Options only for EXTRUDERS > 1
  50. */
  51. #if EXTRUDERS > 1
  52. #if EXTRUDERS > 4
  53. #error The maximum number of EXTRUDERS in Marlin is 4.
  54. #endif
  55. #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  56. #error EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT.
  57. #endif
  58. #if ENABLED(HEATERS_PARALLEL)
  59. #error EXTRUDERS must be 1 with HEATERS_PARALLEL.
  60. #endif
  61. #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
  62. #error EXTRUDERS must be 1 with Y_DUAL_STEPPER_DRIVERS.
  63. #endif
  64. #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
  65. #error EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS.
  66. #endif
  67. #endif // EXTRUDERS > 1
  68. /**
  69. * Limited number of servos
  70. */
  71. #if NUM_SERVOS > 4
  72. #error The maximum number of SERVOS in Marlin is 4.
  73. #endif
  74. #if defined(NUM_SERVOS) && NUM_SERVOS > 0
  75. #if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || Z_ENDSTOP_SERVO_NR >= 0
  76. #if X_ENDSTOP_SERVO_NR >= NUM_SERVOS
  77. #error X_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS.
  78. #elif Y_ENDSTOP_SERVO_NR >= NUM_SERVOS
  79. #error Y_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS.
  80. #elif Z_ENDSTOP_SERVO_NR >= NUM_SERVOS
  81. #error Z_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS.
  82. #endif
  83. #endif
  84. #endif
  85. /**
  86. * Servo deactivation depends on servo endstops
  87. */
  88. #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_SERVO_ENDSTOPS
  89. #error At least one of the ?_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE.
  90. #endif
  91. /**
  92. * Required LCD language
  93. */
  94. #if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && DISABLED(DISPLAY_CHARSET_HD44780_JAPAN) && DISABLED(DISPLAY_CHARSET_HD44780_WESTERN) && DISABLED(DISPLAY_CHARSET_HD44780_CYRILLIC)
  95. #error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN or DISPLAY_CHARSET_HD44780_CYRILLIC for your LCD controller.
  96. #endif
  97. /**
  98. * Mesh Bed Leveling
  99. */
  100. #if ENABLED(MESH_BED_LEVELING)
  101. #if ENABLED(DELTA)
  102. #error MESH_BED_LEVELING does not yet support DELTA printers.
  103. #endif
  104. #if ENABLED(AUTO_BED_LEVELING_FEATURE)
  105. #error Select AUTO_BED_LEVELING_FEATURE or MESH_BED_LEVELING, not both.
  106. #endif
  107. #if MESH_NUM_X_POINTS > 7 || MESH_NUM_Y_POINTS > 7
  108. #error MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS need to be less than 8.
  109. #endif
  110. #elif ENABLED(MANUAL_BED_LEVELING)
  111. #error MESH_BED_LEVELING is required for MANUAL_BED_LEVELING.
  112. #endif
  113. /**
  114. * Auto Bed Leveling
  115. */
  116. #if ENABLED(AUTO_BED_LEVELING_FEATURE)
  117. /**
  118. * Require a Z min pin
  119. */
  120. #if !PIN_EXISTS(Z_MIN)
  121. #if !PIN_EXISTS(Z_MIN_PROBE) || (DISABLED(Z_MIN_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z probe, but not enable it.
  122. #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
  123. #error You must have a Z_MIN or Z_PROBE endstop to enable Z_MIN_PROBE_REPEATABILITY_TEST.
  124. #else
  125. #error AUTO_BED_LEVELING_FEATURE requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_MIN_PROBE_PIN must point to a valid hardware pin.
  126. #endif
  127. #endif
  128. #endif
  129. /**
  130. * Require a Z probe pin if Z_MIN_PROBE_ENDSTOP is enabled.
  131. */
  132. #if ENABLED(Z_MIN_PROBE_ENDSTOP)
  133. #if !PIN_EXISTS(Z_MIN_PROBE)
  134. #error You must have a Z_MIN_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_MIN_PROBE_ENDSTOP.
  135. #endif
  136. // Forcing Servo definitions can break some hall effect sensor setups. Leaving these here for further comment.
  137. //#ifndef NUM_SERVOS
  138. // #error You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_MIN_PROBE_ENDSTOP.
  139. //#endif
  140. //#if defined(NUM_SERVOS) && NUM_SERVOS < 1
  141. // #error You must have at least 1 servo defined for NUM_SERVOS to use Z_MIN_PROBE_ENDSTOP.
  142. //#endif
  143. //#if Z_ENDSTOP_SERVO_NR < 0
  144. // #error You must have Z_ENDSTOP_SERVO_NR set to at least 0 or above to use Z_MIN_PROBE_ENDSTOP.
  145. //#endif
  146. //#ifndef SERVO_ENDSTOP_ANGLES
  147. // #error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_MIN_PROBE_ENDSTOP.
  148. //#endif
  149. #endif
  150. /**
  151. * Check if Probe_Offset * Grid Points is greater than Probing Range
  152. */
  153. #if ENABLED(AUTO_BED_LEVELING_GRID)
  154. #ifndef DELTA_PROBABLE_RADIUS
  155. // Be sure points are in the right order
  156. #if LEFT_PROBE_BED_POSITION > RIGHT_PROBE_BED_POSITION
  157. #error LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION.
  158. #elif FRONT_PROBE_BED_POSITION > BACK_PROBE_BED_POSITION
  159. #error FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION.
  160. #endif
  161. // Make sure probing points are reachable
  162. #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
  163. #error "The given LEFT_PROBE_BED_POSITION can't be reached by the Z probe."
  164. #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X
  165. #error "The given RIGHT_PROBE_BED_POSITION can't be reached by the Z probe."
  166. #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y
  167. #error "The given FRONT_PROBE_BED_POSITION can't be reached by the Z probe."
  168. #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y
  169. #error "The given BACK_PROBE_BED_POSITION can't be reached by the Z probe."
  170. #endif
  171. #endif
  172. #else // !AUTO_BED_LEVELING_GRID
  173. // Check the triangulation points
  174. #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X
  175. #error "The given ABL_PROBE_PT_1_X can't be reached by the Z probe."
  176. #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X
  177. #error "The given ABL_PROBE_PT_2_X can't be reached by the Z probe."
  178. #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X
  179. #error "The given ABL_PROBE_PT_3_X can't be reached by the Z probe."
  180. #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y
  181. #error "The given ABL_PROBE_PT_1_Y can't be reached by the Z probe."
  182. #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y
  183. #error "The given ABL_PROBE_PT_2_Y can't be reached by the Z probe."
  184. #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y
  185. #error "The given ABL_PROBE_PT_3_Y can't be reached by the Z probe."
  186. #endif
  187. #endif // !AUTO_BED_LEVELING_GRID
  188. #endif // AUTO_BED_LEVELING_FEATURE
  189. /**
  190. * ULTIPANEL encoder
  191. */
  192. #if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
  193. #error ULTIPANEL requires some kind of encoder.
  194. #endif
  195. /**
  196. * Delta has limited bed leveling options
  197. */
  198. #if ENABLED(DELTA)
  199. #if ENABLED(AUTO_BED_LEVELING_FEATURE)
  200. #if DISABLED(AUTO_BED_LEVELING_GRID)
  201. #error Only AUTO_BED_LEVELING_GRID is supported with DELTA.
  202. #endif
  203. #if ENABLED(Z_PROBE_SLED)
  204. #error You cannot use Z_PROBE_SLED with DELTA.
  205. #endif
  206. #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
  207. #error Z_MIN_PROBE_REPEATABILITY_TEST is not supported with DELTA yet.
  208. #endif
  209. #endif
  210. #endif
  211. /**
  212. * Allen Key Z probe requires Auto Bed Leveling grid and Delta
  213. */
  214. #if ENABLED(Z_PROBE_ALLEN_KEY) && !(ENABLED(AUTO_BED_LEVELING_GRID) && ENABLED(DELTA))
  215. #error Invalid use of Z_PROBE_ALLEN_KEY.
  216. #endif
  217. /**
  218. * Dual X Carriage requirements
  219. */
  220. #if ENABLED(DUAL_X_CARRIAGE)
  221. #if EXTRUDERS == 1 || ENABLED(COREXY) \
  222. || !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \
  223. || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
  224. || !HAS_X_MAX
  225. #error Missing or invalid definitions for DUAL_X_CARRIAGE mode.
  226. #endif
  227. #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
  228. #error Please use canonical x-carriage assignment.
  229. #endif
  230. #endif // DUAL_X_CARRIAGE
  231. /**
  232. * Make sure auto fan pins don't conflict with the fan pin
  233. */
  234. #if HAS_AUTO_FAN && HAS_FAN
  235. #if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN
  236. #error You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN.
  237. #elif EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN
  238. #error You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to FAN_PIN.
  239. #elif EXTRUDER_2_AUTO_FAN_PIN == FAN_PIN
  240. #error You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to FAN_PIN.
  241. #elif EXTRUDER_3_AUTO_FAN_PIN == FAN_PIN
  242. #error You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to FAN_PIN.
  243. #endif
  244. #endif
  245. #if HAS_FAN && CONTROLLERFAN_PIN == FAN_PIN
  246. #error You cannot set CONTROLLERFAN_PIN equal to FAN_PIN.
  247. #endif
  248. /**
  249. * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set.
  250. */
  251. #if EXTRUDERS > 3
  252. #if !HAS_HEATER_3
  253. #error HEATER_3_PIN not defined for this board.
  254. #elif !PIN_EXISTS(TEMP_3)
  255. #error TEMP_3_PIN not defined for this board.
  256. #elif !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE)
  257. #error E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board.
  258. #elif TEMP_SENSOR_3 == 0
  259. #error TEMP_SENSOR_3 is required with 4 EXTRUDERS.
  260. #endif
  261. #elif EXTRUDERS > 2
  262. #if !HAS_HEATER_2
  263. #error HEATER_2_PIN not defined for this board.
  264. #elif !PIN_EXISTS(TEMP_2)
  265. #error TEMP_2_PIN not defined for this board.
  266. #elif !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE)
  267. #error E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board.
  268. #elif TEMP_SENSOR_2 == 0
  269. #error TEMP_SENSOR_2 is required with 3 or more EXTRUDERS.
  270. #endif
  271. #elif EXTRUDERS > 1
  272. #if !PIN_EXISTS(TEMP_1)
  273. #error TEMP_1_PIN not defined for this board.
  274. #elif !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE)
  275. #error E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board.
  276. #endif
  277. #endif
  278. #if EXTRUDERS > 1 || ENABLED(HEATERS_PARALLEL)
  279. #if !HAS_HEATER_1
  280. #error HEATER_1_PIN not defined for this board.
  281. #endif
  282. #endif
  283. #if TEMP_SENSOR_1 == 0
  284. #if EXTRUDERS > 1
  285. #error TEMP_SENSOR_1 is required with 2 or more EXTRUDERS.
  286. #elif ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  287. #error TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT.
  288. #endif
  289. #endif
  290. #if !HAS_HEATER_0
  291. #error HEATER_0_PIN not defined for this board.
  292. #elif !PIN_EXISTS(TEMP_0)
  293. #error TEMP_0_PIN not defined for this board.
  294. #elif !PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE)
  295. #error E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board.
  296. #elif TEMP_SENSOR_0 == 0
  297. #error TEMP_SENSOR_0 is required.
  298. #endif
  299. /**
  300. * Warnings for old configurations
  301. */
  302. #if WATCH_TEMP_PERIOD > 500
  303. #error WATCH_TEMP_PERIOD now uses seconds instead of milliseconds.
  304. #elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
  305. #error Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS.
  306. #elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
  307. #error Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED.
  308. #elif ENABLED(COREXZ) && ENABLED(Z_LATE_ENABLE)
  309. #error "Z_LATE_ENABLE can't be used with COREXZ."
  310. #elif defined(X_HOME_RETRACT_MM)
  311. #error [XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM.
  312. #elif defined(PROBE_SERVO_DEACTIVATION_DELAY)
  313. #error PROBE_SERVO_DEACTIVATION_DELAY has been replaced with DEACTIVATE_SERVOS_AFTER_MOVE and SERVO_DEACTIVATION_DELAY.
  314. #elif defined(BEEPER)
  315. #error BEEPER is now BEEPER_PIN. Please update your pins definitions.
  316. #elif defined(SDCARDDETECT)
  317. #error SDCARDDETECT is now SD_DETECT_PIN. Please update your pins definitions.
  318. #elif defined(SDCARDDETECTINVERTED)
  319. #error SDCARDDETECTINVERTED is now SD_DETECT_INVERTED. Please update your configuration.
  320. #elif defined(BTENABLED)
  321. #error BTENABLED is now BLUETOOTH. Please update your configuration.
  322. #elif defined(CUSTOM_MENDEL_NAME)
  323. #error CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration.
  324. #elif defined(HAS_AUTOMATIC_VERSIONING)
  325. #error HAS_AUTOMATIC_VERSIONING deprecated - use USE_AUTOMATIC_VERSIONING instead
  326. #elif defined(ENABLE_AUTO_BED_LEVELING)
  327. #error ENABLE_AUTO_BED_LEVELING deprecated - use AUTO_BED_LEVELING_FEATURE instead
  328. #elif defined(SDSLOW)
  329. #error SDSLOW deprecated - set SPI_SPEED to SPI_HALF_SPEED instead
  330. #elif defined(SDEXTRASLOW)
  331. #error SDEXTRASLOW deprecated - set SPI_SPEED to SPI_QUARTER_SPEED instead
  332. #endif
  333. #endif //SANITYCHECK_H