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

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