We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b156c1b commit b216af7Copy full SHA for b216af7
src/accelerators/LinStepAccelerator.h
@@ -55,7 +55,11 @@ int32_t LinStepAccelerator::updateSpeed(int32_t curPos)
55
return v_tgt;
56
57
//deceleration phase --------------------------------------
58
- return sqrtf(two_a * ((stepsDone < delta_tgt - 1) ? delta_tgt - stepsDone - 2 : 0) + v_min2);
+ if(stepsDone < delta_tgt)
59
+ return sqrtf(two_a * ((stepsDone < delta_tgt - 1) ? delta_tgt - stepsDone - 2 : 0) + v_min2);
60
+
61
+ //we are done, make sure to return 0 to stop the step timer
62
+ return 0;
63
}
64
65
uint32_t LinStepAccelerator::initiateStopping(int32_t curPos)
0 commit comments