Skip to content

Commit

Permalink
Ensure TMC + LIN_ADVANCE pulse length (MarlinFirmware#15807)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelMcLure authored and christran206 committed Dec 30, 2019
1 parent 00dc67e commit 7a2953a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
13 changes: 13 additions & 0 deletions Marlin/src/core/drivers.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,19 @@
|| AXIS_DRIVER_TYPE(A,TMC5130) \
|| AXIS_DRIVER_TYPE(A,TMC5160) )

#define HAS_TMC_E_DRIVER ( HAS_E_DRIVER(TMC2130) \
|| HAS_E_DRIVER(TMC2160) \
|| HAS_E_DRIVER(TMC2660) \
|| HAS_E_DRIVER(TMC2209) \
|| HAS_E_DRIVER(TMC5130) \
|| HAS_E_DRIVER(TMC5160) )

#define HAS_TMC_STANDALONE_E_DRIVER ( HAS_E_DRIVER(TMC2130_STANDALONE) \
|| HAS_E_DRIVER(TMC2160_STANDALONE) \
|| HAS_E_DRIVER(TMC2660_STANDALONE) \
|| HAS_E_DRIVER(TMC2209_STANDALONE) \
|| HAS_E_DRIVER(TMC5130_STANDALONE) \
|| HAS_E_DRIVER(TMC5160_STANDALONE) )
//
// Stretching 'drivers.h' to include LPC/SAMD51 SD options
//
Expand Down
8 changes: 6 additions & 2 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,13 @@
#define MINIMUM_STEPPER_PULSE 2
#elif HAS_DRIVER(A4988) || HAS_DRIVER(A5984)
#define MINIMUM_STEPPER_PULSE 1
#elif HAS_DRIVER(LV8729)
#define MINIMUM_STEPPER_PULSE 0
#elif TRINAMICS
#if ENABLED(LIN_ADVANCE) && (HAS_TMC_STANDALONE_E_DRIVER || (HAS_TMC_E_DRIVER && DISABLED(SQUARE_WAVE_STEPPING)))
#define MINIMUM_STEPPER_PULSE 1
#else
#define MINIMUM_STEPPER_PULSE 0
#endif
#elif HAS_DRIVER(LV8729)
#define MINIMUM_STEPPER_PULSE 0
#else
#define MINIMUM_STEPPER_PULSE 2
Expand Down
8 changes: 8 additions & 0 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -2546,3 +2546,11 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
#error "SHOW_REMAINING_TIME currently requires a Graphical LCD."
#endif
#endif

#if ENABLED(LIN_ADVANCE) && MINIMUM_STEPPER_PULSE < 1
#if HAS_TMC_STANDALONE_E_DRIVER
#error "LIN_ADVANCE with TMC standalone driver on extruder requires MIMIMUM_STEPPER_PULSE >= 1"
#elif HAS_TMC_E_DRIVER && DISABLED(SQUARE_WAVE_STEPPING)
#error "LIN_ADVANCE with TMC driver on extruder requires SQUARE_WAVE_STEPPING or MINIMUM_STEPPER_PULSE >= 1"
#endif
#endif

0 comments on commit 7a2953a

Please sign in to comment.