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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  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)
  33. #error BABYSTEPPING not implemented for COREXY yet.
  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(ENABLE_AUTO_BED_LEVELING)
  105. #error Select ENABLE_AUTO_BED_LEVELING 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. #endif
  111. /**
  112. * Auto Bed Leveling
  113. */
  114. #if ENABLED(ENABLE_AUTO_BED_LEVELING)
  115. /**
  116. * Require a Z Min pin
  117. */
  118. #if Z_MIN_PIN == -1
  119. #if Z_PROBE_PIN == -1 || (DISABLED(Z_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it.
  120. #if ENABLED(Z_PROBE_REPEATABILITY_TEST)
  121. #error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST.
  122. #else
  123. #error ENABLE_AUTO_BED_LEVELING requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_PROBE_PIN must point to a valid hardware pin.
  124. #endif
  125. #endif
  126. #endif
  127. /**
  128. * Require a Z Probe Pin if Z_PROBE_ENDSTOP is enabled.
  129. */
  130. #if ENABLED(Z_PROBE_ENDSTOP)
  131. #ifndef Z_PROBE_PIN
  132. #error You must have a Z_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_PROBE_ENDSTOP.
  133. #endif
  134. #if Z_PROBE_PIN == -1
  135. #error You must set Z_PROBE_PIN to a valid pin if you enable Z_PROBE_ENDSTOP.
  136. #endif
  137. // Forcing Servo definitions can break some hall effect sensor setups. Leaving these here for further comment.
  138. // #ifndef NUM_SERVOS
  139. // #error You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_PROBE_ENDSTOP.
  140. // #endif
  141. // #if defined(NUM_SERVOS) && NUM_SERVOS < 1
  142. // #error You must have at least 1 servo defined for NUM_SERVOS to use Z_PROBE_ENDSTOP.
  143. // #endif
  144. // #if Z_ENDSTOP_SERVO_NR < 0
  145. // #error You must have Z_ENDSTOP_SERVO_NR set to at least 0 or above to use Z_PROBE_ENDSTOP.
  146. // #endif
  147. // #ifndef SERVO_ENDSTOP_ANGLES
  148. // #error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_PROBE_ENDSTOP.
  149. // #endif
  150. #endif
  151. /**
  152. * Check if Probe_Offset * Grid Points is greater than Probing Range
  153. */
  154. #if ENABLED(AUTO_BED_LEVELING_GRID)
  155. #ifndef DELTA_PROBABLE_RADIUS
  156. // Be sure points are in the right order
  157. #if LEFT_PROBE_BED_POSITION > RIGHT_PROBE_BED_POSITION
  158. #error LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION.
  159. #elif FRONT_PROBE_BED_POSITION > BACK_PROBE_BED_POSITION
  160. #error BACK_PROBE_BED_POSITION must be less than FRONT_PROBE_BED_POSITION.
  161. #endif
  162. // Make sure probing points are reachable
  163. #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
  164. #error "The given LEFT_PROBE_BED_POSITION can't be reached by the probe."
  165. #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X
  166. #error "The given RIGHT_PROBE_BED_POSITION can't be reached by the probe."
  167. #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y
  168. #error "The given FRONT_PROBE_BED_POSITION can't be reached by the probe."
  169. #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y
  170. #error "The given BACK_PROBE_BED_POSITION can't be reached by the probe."
  171. #endif
  172. #endif
  173. #else // !AUTO_BED_LEVELING_GRID
  174. // Check the triangulation points
  175. #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X
  176. #error "The given ABL_PROBE_PT_1_X can't be reached by the probe."
  177. #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X
  178. #error "The given ABL_PROBE_PT_2_X can't be reached by the probe."
  179. #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X
  180. #error "The given ABL_PROBE_PT_3_X can't be reached by the probe."
  181. #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y
  182. #error "The given ABL_PROBE_PT_1_Y can't be reached by the probe."
  183. #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y
  184. #error "The given ABL_PROBE_PT_2_Y can't be reached by the probe."
  185. #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y
  186. #error "The given ABL_PROBE_PT_3_Y can't be reached by the probe."
  187. #endif
  188. #endif // !AUTO_BED_LEVELING_GRID
  189. #endif // ENABLE_AUTO_BED_LEVELING
  190. /**
  191. * ULTIPANEL encoder
  192. */
  193. #if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
  194. #error ULTIPANEL requires some kind of encoder.
  195. #endif
  196. /**
  197. * Delta has limited bed leveling options
  198. */
  199. #if ENABLED(DELTA)
  200. #if ENABLED(ENABLE_AUTO_BED_LEVELING)
  201. #if DISABLED(AUTO_BED_LEVELING_GRID)
  202. #error Only AUTO_BED_LEVELING_GRID is supported with DELTA.
  203. #endif
  204. #if ENABLED(Z_PROBE_SLED)
  205. #error You cannot use Z_PROBE_SLED with DELTA.
  206. #endif
  207. #if ENABLED(Z_PROBE_REPEATABILITY_TEST)
  208. #error Z_PROBE_REPEATABILITY_TEST is not supported with DELTA yet.
  209. #endif
  210. #endif
  211. #endif
  212. /**
  213. * Allen Key Z Probe requires Auto Bed Leveling grid and Delta
  214. */
  215. #if ENABLED(Z_PROBE_ALLEN_KEY) && !(ENABLED(AUTO_BED_LEVELING_GRID) && ENABLED(DELTA))
  216. #error Invalid use of Z_PROBE_ALLEN_KEY.
  217. #endif
  218. /**
  219. * Dual X Carriage requirements
  220. */
  221. #if ENABLED(DUAL_X_CARRIAGE)
  222. #if EXTRUDERS == 1 || ENABLED(COREXY) \
  223. || !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \
  224. || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
  225. || !HAS_X_MAX
  226. #error Missing or invalid definitions for DUAL_X_CARRIAGE mode.
  227. #endif
  228. #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
  229. #error Please use canonical x-carriage assignment.
  230. #endif
  231. #endif // DUAL_X_CARRIAGE
  232. /**
  233. * Make sure auto fan pins don't conflict with the fan pin
  234. */
  235. #if HAS_AUTO_FAN && HAS_FAN
  236. #if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN
  237. #error You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN.
  238. #elif EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN
  239. #error You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to FAN_PIN.
  240. #elif EXTRUDER_2_AUTO_FAN_PIN == FAN_PIN
  241. #error You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to FAN_PIN.
  242. #elif EXTRUDER_3_AUTO_FAN_PIN == FAN_PIN
  243. #error You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to FAN_PIN.
  244. #endif
  245. #endif
  246. #if HAS_FAN && CONTROLLERFAN_PIN == FAN_PIN
  247. #error You cannot set CONTROLLERFAN_PIN equal to FAN_PIN.
  248. #endif
  249. /**
  250. * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set.
  251. */
  252. #if EXTRUDERS > 3
  253. #if !HAS_HEATER_3
  254. #error HEATER_3_PIN not defined for this board.
  255. #elif !PIN_EXISTS(TEMP_3)
  256. #error TEMP_3_PIN not defined for this board.
  257. #elif !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE)
  258. #error E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board.
  259. #elif TEMP_SENSOR_3 == 0
  260. #error TEMP_SENSOR_3 is required with 4 EXTRUDERS.
  261. #endif
  262. #elif EXTRUDERS > 2
  263. #if !HAS_HEATER_2
  264. #error HEATER_2_PIN not defined for this board.
  265. #elif !PIN_EXISTS(TEMP_2)
  266. #error TEMP_2_PIN not defined for this board.
  267. #elif !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE)
  268. #error E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board.
  269. #elif TEMP_SENSOR_2 == 0
  270. #error TEMP_SENSOR_2 is required with 3 or more EXTRUDERS.
  271. #endif
  272. #elif EXTRUDERS > 1
  273. #if !PIN_EXISTS(TEMP_1)
  274. #error TEMP_1_PIN not defined for this board.
  275. #elif !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE)
  276. #error E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board.
  277. #endif
  278. #endif
  279. #if EXTRUDERS > 1 || ENABLED(HEATERS_PARALLEL)
  280. #if !HAS_HEATER_1
  281. #error HEATER_1_PIN not defined for this board.
  282. #endif
  283. #endif
  284. #if TEMP_SENSOR_1 == 0
  285. #if EXTRUDERS > 1
  286. #error TEMP_SENSOR_1 is required with 2 or more EXTRUDERS.
  287. #elif ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
  288. #error TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT.
  289. #endif
  290. #endif
  291. #if !HAS_HEATER_0
  292. #error HEATER_0_PIN not defined for this board.
  293. #elif !PIN_EXISTS(TEMP_0)
  294. #error TEMP_0_PIN not defined for this board.
  295. #elif !PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE)
  296. #error E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board.
  297. #elif TEMP_SENSOR_0 == 0
  298. #error TEMP_SENSOR_0 is required.
  299. #endif
  300. /**
  301. * Warnings for old configurations
  302. */
  303. #ifdef X_HOME_RETRACT_MM
  304. #error [XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM.
  305. #endif
  306. #if WATCH_TEMP_PERIOD > 500
  307. #error WATCH_TEMP_PERIOD now uses seconds instead of milliseconds.
  308. #endif
  309. #if DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
  310. #error Thermal Runaway Protection for hotends must now be enabled with THERMAL_PROTECTION_HOTENDS.
  311. #endif
  312. #if DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
  313. #error Thermal Runaway Protection for the bed must now be enabled with THERMAL_PROTECTION_BED.
  314. #endif
  315. #ifdef PROBE_SERVO_DEACTIVATION_DELAY
  316. #error PROBE_SERVO_DEACTIVATION_DELAY has been replaced with DEACTIVATE_SERVOS_AFTER_MOVE and SERVO_DEACTIVATION_DELAY.
  317. #endif
  318. #if defined(COREXZ) && defined(Z_LATE_ENABLE)
  319. #error "Z_LATE_ENABLE can't be used with COREXZ."
  320. #endif
  321. #endif //SANITYCHECK_H