Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix MAGNETIC_SWITCHING_TOOLHEAD sanity check #22224

Merged
merged 2 commits into from
Jun 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -1249,23 +1249,28 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#endif

/**
* (Electro)magnetic Switching Toolhead requirements
* Magnetic / Electromagnetic Switching Toolhead requirements
*/
#if EITHER(MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
#ifndef SWITCHING_TOOLHEAD_Y_POS
#error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_POS"
#error "(ELECTRO)?MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_POS"
#elif !defined(SWITCHING_TOOLHEAD_X_POS)
#error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_X_POS"
#elif !defined(SWITCHING_TOOLHEAD_Z_HOP)
#error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
#error "(ELECTRO)?MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_X_POS"
#elif !defined(SWITCHING_TOOLHEAD_Y_CLEAR)
#error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_CLEAR."
#elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
#if ENABLED(EXT_SOLENOID)
#error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD and EXT_SOLENOID are incompatible. (Pins are used twice.)"
#elif !PIN_EXISTS(SOL0)
#error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SOL0_PIN."
#endif
#error "(ELECTRO)?MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_CLEAR."
#endif
#endif

/**
* Electromagnetic Switching Toolhead requirements
*/
#if ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
#if ENABLED(EXT_SOLENOID)
#error "ELECTROMAGNETIC_SWITCHING_TOOLHEAD and EXT_SOLENOID are incompatible. (Pins are used twice.)"
#elif !PIN_EXISTS(SOL0)
#error "ELECTROMAGNETIC_SWITCHING_TOOLHEAD requires SOL0_PIN."
#elif !defined(SWITCHING_TOOLHEAD_Z_HOP)
#error "ELECTROMAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
#endif
#endif

Expand Down