From 367d392880a13d337ebd518dcce29d4717588bbf Mon Sep 17 00:00:00 2001 From: Robert Mendon Date: Sun, 3 Mar 2019 19:58:02 -0700 Subject: [PATCH] Init stepper current after stepper pins are set up (#13302) --- Marlin/src/module/stepper.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 666c9a9c6..56e30bdcb 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -1979,11 +1979,6 @@ bool Stepper::is_block_busy(const block_t* const block) { void Stepper::init() { - // Init Digipot Motor Current - #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - digipot_init(); - #endif - #if MB(ALLIGATOR) const float motor_current[] = MOTOR_CURRENT; unsigned int digipot_motor = 0; @@ -2165,8 +2160,12 @@ void Stepper::init() { | (INVERT_Z_DIR ? _BV(Z_AXIS) : 0); set_directions(); - #if HAS_MOTOR_CURRENT_PWM - initialized = true; + + #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM + #if HAS_MOTOR_CURRENT_PWM + initialized = true; + #endif + digipot_init(); #endif }