lazy_value.h: improve handling of low steps value

Don't just clamp the speed value to a positive number but immediately
assign the destination value. This is needed in situations where the
number of steps is too low for proper acceleration and deceleration.

Issue #3096
This commit is contained in:
Norman Feske 2018-12-26 22:06:55 +01:00
parent 2565928495
commit b188a4dbc9

View File

@ -76,7 +76,10 @@ class Lazy_value
else
_speed -= _accel;
if (_speed < 1) _speed = 1;
if (_speed < 1) {
_speed = 0;
_curr = _dst;
}
}
operator T () const { return _curr; }