From 6afe5ab28bfeeef72e11031e074716a3eb019533 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Sep 2018 20:03:01 -0500 Subject: [PATCH] Set stepper directions after M501/M502 See https://github.com/MarlinFirmware/Marlin/issues/11103#issuecomment-421387611 Co-Authored-By: tcm0116 --- Marlin/stepper.h | 3 +++ Marlin/stepper_indirection.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 709981e5a..786a376e9 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -467,6 +467,9 @@ class Stepper { // Set direction bits for all steppers static void set_directions(); + // Allow reset_stepper_drivers to access private set_directions + friend void reset_stepper_drivers(); + FORCE_INLINE static uint32_t calc_timer_interval(uint32_t step_rate, uint8_t scale, uint8_t* loops) { uint32_t timer; diff --git a/Marlin/stepper_indirection.cpp b/Marlin/stepper_indirection.cpp index 6c3ec5b2d..cde4c31a2 100644 --- a/Marlin/stepper_indirection.cpp +++ b/Marlin/stepper_indirection.cpp @@ -35,6 +35,8 @@ #include "MarlinConfig.h" +#include "stepper.h" + // // TMC26X Driver objects and inits // @@ -578,6 +580,7 @@ void reset_stepper_drivers() { #if HAS_DRIVER(L6470) L6470_init_to_defaults(); #endif + stepper.set_directions(); } //