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

🔧 Edge Stepping sanity-check #25674

Merged
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,9 @@
#endif
#endif

// Test for edge stepping on any axis
#define AXIS_HAS_DEDGE(A) (ENABLED(EDGE_STEPPING) && AXIS_IS_TMC(A))

#if ENABLED(DIRECT_STEPPING)
#ifndef STEPPER_PAGES
#define STEPPER_PAGES 16
Expand Down
34 changes: 34 additions & 0 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -4313,6 +4313,40 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#error "MONITOR_DRIVER_STATUS and SDSUPPORT cannot be used together on boards with shared SPI."
#endif

// Although it just toggles STEP, EDGE_STEPPING requires HIGH state for logic
#if ENABLED(EDGE_STEPPING)
#if AXIS_HAS_DEDGE(X) && STEP_STATE_X != HIGH
#error "STEP_STATE_X must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(Y) && STEP_STATE_Y != HIGH
#error "STEP_STATE_Y must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(Z) && STEP_STATE_Z != HIGH
#error "STEP_STATE_Z must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(I) && STEP_STATE_I != HIGH
#error "STEP_STATE_I must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(J) && STEP_STATE_J != HIGH
#error "STEP_STATE_J must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(K) && STEP_STATE_K != HIGH
#error "STEP_STATE_K must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(U) && STEP_STATE_U != HIGH
#error "STEP_STATE_U must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(V) && STEP_STATE_V != HIGH
#error "STEP_STATE_V must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(W) && STEP_STATE_W != HIGH
#error "STEP_STATE_W must be HIGH for EDGE_STEPPING."
#endif
#if AXIS_HAS_DEDGE(E0) && STEP_STATE_E != HIGH
#error "STEP_STATE_E must be HIGH for EDGE_STEPPING."
#endif
#endif

// G60/G61 Position Save
#if SAVED_POSITIONS > 256
#error "SAVED_POSITIONS must be an integer from 0 to 256."
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/module/stepper/trinamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@
void restore_trinamic_drivers();
void reset_trinamic_drivers();

#define AXIS_HAS_DEDGE(A) (AXIS_IS_TMC(A) && ENABLED(EDGE_STEPPING))

// X Stepper
#if AXIS_IS_TMC(X)
extern TMC_CLASS(X, X) stepperX;
Expand Down