Browse Source

Stepper::set_position needed for some applications

Scott Lahteine 6 years ago
parent
commit
65a004564c
1 changed files with 15 additions and 0 deletions
  1. 15
    0
      Marlin/src/module/stepper.h

+ 15
- 0
Marlin/src/module/stepper.h View File

@@ -244,6 +244,21 @@ class Stepper {
244 244
       static void refresh_motor_power();
245 245
     #endif
246 246
 
247
+    // Set the current position in steps
248
+    inline static void set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e) {
249
+      planner.synchronize();
250
+      CRITICAL_SECTION_START;
251
+      _set_position(a, b, c, e);
252
+      CRITICAL_SECTION_END;
253
+    }
254
+
255
+    inline static void set_position(const AxisEnum a, const int32_t &v) {
256
+      planner.synchronize();
257
+      CRITICAL_SECTION_START;
258
+      count_position[a] = v;
259
+      CRITICAL_SECTION_END;
260
+    }
261
+
247 262
   private:
248 263
 
249 264
     // Set the current position in steps

Loading…
Cancel
Save