Browse Source

Babystepping code tweak

Scott Lahteine 6 years ago
parent
commit
37eb6d1732
1 changed files with 4 additions and 7 deletions
  1. 4
    7
      Marlin/src/module/temperature.cpp

+ 4
- 7
Marlin/src/module/temperature.cpp View File

@@ -2064,13 +2064,10 @@ void Temperature::isr() {
2064 2064
   #if ENABLED(BABYSTEPPING)
2065 2065
     LOOP_XYZ(axis) {
2066 2066
       const int curTodo = babystepsTodo[axis]; // get rid of volatile for performance
2067
-      if (curTodo > 0) {
2068
-        stepper.babystep((AxisEnum)axis, /*fwd*/true);
2069
-        babystepsTodo[axis]--;
2070
-      }
2071
-      else if (curTodo < 0) {
2072
-        stepper.babystep((AxisEnum)axis, /*fwd*/false);
2073
-        babystepsTodo[axis]++;
2067
+      if (curTodo) {
2068
+        stepper.babystep((AxisEnum)axis, curTodo > 0);
2069
+        if (curTodo > 0) babystepsTodo[axis]--;
2070
+                    else babystepsTodo[axis]++;
2074 2071
       }
2075 2072
     }
2076 2073
   #endif // BABYSTEPPING

Loading…
Cancel
Save