My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

SanityCheck.h 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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 defined(Z_DUAL_STEPPER_DRIVERS) && defined(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. #ifdef LCD_PROGRESS_BAR
  18. #ifndef SDSUPPORT
  19. #error LCD_PROGRESS_BAR requires SDSUPPORT.
  20. #endif
  21. #ifdef DOGLCD
  22. #error LCD_PROGRESS_BAR does not apply to graphical displays.
  23. #endif
  24. #ifdef 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. #ifdef BABYSTEPPING
  32. #ifdef COREXY
  33. #error BABYSTEPPING not implemented for COREXY yet.
  34. #endif
  35. #ifdef SCARA
  36. #error BABYSTEPPING is not implemented for SCARA yet.
  37. #endif
  38. #if defined(DELTA) && defined(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 defined(FILAMENTCHANGEENABLE) && defined(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. #ifdef TEMP_SENSOR_1_AS_REDUNDANT
  56. #error EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT.
  57. #endif
  58. #ifdef HEATERS_PARALLEL
  59. #error EXTRUDERS must be 1 with HEATERS_PARALLEL.
  60. #endif
  61. #ifdef Y_DUAL_STEPPER_DRIVERS
  62. #error EXTRUDERS must be 1 with Y_DUAL_STEPPER_DRIVERS.
  63. #endif
  64. #ifdef 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. /**
  75. * Servo deactivation depends on servo endstops
  76. */
  77. #if defined(DEACTIVATE_SERVOS_AFTER_MOVE) && !defined(SERVO_ENDSTOPS)
  78. #error SERVO_ENDSTOPS is required for DEACTIVATE_SERVOS_AFTER_MOVE.
  79. #endif
  80. /**
  81. * Required LCD language
  82. */
  83. #if !defined(DOGLCD) && defined(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780_JAPAN) && !defined(DISPLAY_CHARSET_HD44780_WESTERN)&& !defined(DISPLAY_CHARSET_HD44780_CYRILLIC)
  84. #error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN or DISPLAY_CHARSET_HD44780_CYRILLIC for your LCD controller.
  85. #endif
  86. /**
  87. * Mesh Bed Leveling
  88. */
  89. #ifdef MESH_BED_LEVELING
  90. #ifdef DELTA
  91. #error MESH_BED_LEVELING does not yet support DELTA printers.
  92. #endif
  93. #ifdef ENABLE_AUTO_BED_LEVELING
  94. #error Select ENABLE_AUTO_BED_LEVELING or MESH_BED_LEVELING, not both.
  95. #endif
  96. #if MESH_NUM_X_POINTS > 7 || MESH_NUM_Y_POINTS > 7
  97. #error MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS need to be less than 8.
  98. #endif
  99. #endif
  100. /**
  101. * Auto Bed Leveling
  102. */
  103. #ifdef ENABLE_AUTO_BED_LEVELING
  104. /**
  105. * Require a Z Min pin
  106. */
  107. #if Z_MIN_PIN == -1
  108. #if Z_PROBE_PIN == -1 || (!defined(Z_PROBE_ENDSTOP) || defined(DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it.
  109. #ifdef Z_PROBE_REPEATABILITY_TEST
  110. #error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST.
  111. #else
  112. #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.
  113. #endif
  114. #endif
  115. #endif
  116. /**
  117. * Require a Z Probe Pin if Z_PROBE_ENDSTOP is enabled.
  118. */
  119. #if defined(Z_PROBE_ENDSTOP)
  120. #ifndef Z_PROBE_PIN
  121. #error You must have a Z_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_PROBE_ENDSTOP.
  122. #endif
  123. #if Z_PROBE_PIN == -1
  124. #error You must set Z_PROBE_PIN to a valid pin if you enable Z_PROBE_ENDSTOP.
  125. #endif
  126. // Forcing Servo definitions can break some hall effect sensor setups. Leaving these here for further comment.
  127. // #ifndef NUM_SERVOS
  128. // #error You must have NUM_SERVOS defined and there must be at least 1 configured to use Z_PROBE_ENDSTOP.
  129. // #endif
  130. // #if defined(NUM_SERVOS) && NUM_SERVOS < 1
  131. // #error You must have at least 1 servo defined for NUM_SERVOS to use Z_PROBE_ENDSTOP.
  132. // #endif
  133. // #ifndef SERVO_ENDSTOPS
  134. // #error You must have SERVO_ENDSTOPS defined and have the Z index set to at least 0 or above to use Z_PROBE_ENDSTOP.
  135. // #endif
  136. // #ifndef SERVO_ENDSTOP_ANGLES
  137. // #error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_PROBE_ENDSTOP.
  138. // #endif
  139. #endif
  140. /**
  141. * Check if Probe_Offset * Grid Points is greater than Probing Range
  142. */
  143. #ifdef AUTO_BED_LEVELING_GRID
  144. #ifndef DELTA_PROBABLE_RADIUS
  145. // Be sure points are in the right order
  146. #if LEFT_PROBE_BED_POSITION > RIGHT_PROBE_BED_POSITION
  147. #error LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION.
  148. #elif FRONT_PROBE_BED_POSITION > BACK_PROBE_BED_POSITION
  149. #error BACK_PROBE_BED_POSITION must be less than FRONT_PROBE_BED_POSITION.
  150. #endif
  151. // Make sure probing points are reachable
  152. #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
  153. #error "The given LEFT_PROBE_BED_POSITION can't be reached by the probe."
  154. #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X
  155. #error "The given RIGHT_PROBE_BED_POSITION can't be reached by the probe."
  156. #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y
  157. #error "The given FRONT_PROBE_BED_POSITION can't be reached by the probe."
  158. #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y
  159. #error "The given BACK_PROBE_BED_POSITION can't be reached by the probe."
  160. #endif
  161. #endif
  162. #else // !AUTO_BED_LEVELING_GRID
  163. // Check the triangulation points
  164. #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X
  165. #error "The given ABL_PROBE_PT_1_X can't be reached by the probe."
  166. #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X
  167. #error "The given ABL_PROBE_PT_2_X can't be reached by the probe."
  168. #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X
  169. #error "The given ABL_PROBE_PT_3_X can't be reached by the probe."
  170. #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y
  171. #error "The given ABL_PROBE_PT_1_Y can't be reached by the probe."
  172. #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y
  173. #error "The given ABL_PROBE_PT_2_Y can't be reached by the probe."
  174. #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y
  175. #error "The given ABL_PROBE_PT_3_Y can't be reached by the probe."
  176. #endif
  177. #endif // !AUTO_BED_LEVELING_GRID
  178. #endif // ENABLE_AUTO_BED_LEVELING
  179. /**
  180. * ULTIPANEL encoder
  181. */
  182. #if defined(ULTIPANEL) && !defined(NEWPANEL) && !defined(SR_LCD_2W_NL) && !defined(SHIFT_CLK)
  183. #error ULTIPANEL requires some kind of encoder.
  184. #endif
  185. /**
  186. * Delta has limited bed leveling options
  187. */
  188. #ifdef DELTA
  189. #ifdef ENABLE_AUTO_BED_LEVELING
  190. #ifndef AUTO_BED_LEVELING_GRID
  191. #error Only AUTO_BED_LEVELING_GRID is supported with DELTA.
  192. #endif
  193. #ifdef Z_PROBE_SLED
  194. #error You cannot use Z_PROBE_SLED with DELTA.
  195. #endif
  196. #ifdef Z_PROBE_REPEATABILITY_TEST
  197. #error Z_PROBE_REPEATABILITY_TEST is not supported with DELTA yet.
  198. #endif
  199. #endif
  200. #endif
  201. /**
  202. * Allen Key Z Probe requires Auto Bed Leveling grid and Delta
  203. */
  204. #if defined(Z_PROBE_ALLEN_KEY) && !(defined(AUTO_BED_LEVELING_GRID) && defined(DELTA))
  205. #error Invalid use of Z_PROBE_ALLEN_KEY.
  206. #endif
  207. /**
  208. * Dual X Carriage requirements
  209. */
  210. #ifdef DUAL_X_CARRIAGE
  211. #if EXTRUDERS == 1 || defined(COREXY) \
  212. || !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \
  213. || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
  214. || !HAS_X_MAX
  215. #error Missing or invalid definitions for DUAL_X_CARRIAGE mode.
  216. #endif
  217. #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
  218. #error Please use canonical x-carriage assignment.
  219. #endif
  220. #endif // DUAL_X_CARRIAGE
  221. /**
  222. * Make sure auto fan pins don't conflict with the fan pin
  223. */
  224. #if HAS_AUTO_FAN && HAS_FAN
  225. #if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN
  226. #error You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN.
  227. #elif EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN
  228. #error You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to FAN_PIN.
  229. #elif EXTRUDER_2_AUTO_FAN_PIN == FAN_PIN
  230. #error You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to FAN_PIN.
  231. #elif EXTRUDER_3_AUTO_FAN_PIN == FAN_PIN
  232. #error You cannot set EXTRUDER_3_AUTO_FAN_PIN equal to FAN_PIN.
  233. #endif
  234. #endif
  235. #if HAS_FAN && CONTROLLERFAN_PIN == FAN_PIN
  236. #error You cannot set CONTROLLERFAN_PIN equal to FAN_PIN.
  237. #endif
  238. /**
  239. * Test required HEATER defines
  240. */
  241. #if EXTRUDERS > 3
  242. #if !HAS_HEATER_3
  243. #error HEATER_3_PIN not defined for this board.
  244. #endif
  245. #elif EXTRUDERS > 2
  246. #if !HAS_HEATER_2
  247. #error HEATER_2_PIN not defined for this board.
  248. #endif
  249. #elif EXTRUDERS > 1 || defined(HEATERS_PARALLEL)
  250. #if !HAS_HEATER_1
  251. #error HEATER_1_PIN not defined for this board.
  252. #endif
  253. #endif
  254. #if !HAS_HEATER_0
  255. #error HEATER_0_PIN not defined for this board.
  256. #endif
  257. /**
  258. * Warnings for old configurations
  259. */
  260. #ifdef X_HOME_RETRACT_MM
  261. #error [XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM.
  262. #endif
  263. #if WATCH_TEMP_PERIOD > 500
  264. #error WATCH_TEMP_PERIOD now uses seconds instead of milliseconds.
  265. #endif
  266. #if !defined(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
  267. #error Thermal Runaway Protection for hotends must now be enabled with THERMAL_PROTECTION_HOTENDS.
  268. #endif
  269. #if !defined(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
  270. #error Thermal Runaway Protection for the bed must now be enabled with THERMAL_PROTECTION_BED.
  271. #endif
  272. #endif //SANITYCHECK_H