From e0ae9b85480e40e80e1f2e53302ede7332544a7d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 21 May 2018 15:23:00 -0500 Subject: [PATCH] Stepper::set_position needed for some applications --- Marlin/stepper.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 1be3f94c99..672654c6cd 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -265,6 +265,21 @@ class Stepper { static void refresh_motor_power(); #endif + // Set the current position in steps + inline static void set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e) { + planner.synchronize(); + CRITICAL_SECTION_START; + _set_position(a, b, c, e); + CRITICAL_SECTION_END; + } + + inline static void set_position(const AxisEnum a, const int32_t &v) { + planner.synchronize(); + CRITICAL_SECTION_START; + count_position[a] = v; + CRITICAL_SECTION_END; + } + private: // Set the current position in steps