This prevents nasty surprises because this restriction is not mentioned in the configuration files. It also allows better tuning of performance against memory usage.
Traumflug: costs 18 bytes flash, so it's bearable.
This required to also introduce dda_init() and re-adjust the
number of accelerating steps a bit.
Goal of this is to make look-ahead possible by just reducing
the number of deceleration steps and acceleration steps of
the next move. dda->c and dda->n no longer go down to their
initial values, then.
Also, quite a number of variables in the dda struct are used only when
the dda is live, so there is no need to store that for each
movement of the queue.
This is an intermediate step where both, the old and the new
ramping calculation methods are used and compared. The commit
is done for the case the new method needs debugging in other setups.
if delay is not zero, otherwise the timer is not turned off when it
should be. Move the test and setting back inside the block that is only
executed if delay > 0.
This fix is really a hack to protect from overflow/underflows
in the acceleration code due to the limited precision of the
fixed point calculations. It does, however, protect the code
from accidently turning off the step timer or setting the
timer interval value outside of the range defined by the current
interval and the ultimate endpoint interval.
This is a cleanup replacement for the code posted on the reprap forum:
http://forums.reprap.org/read.php?147,33082,83467#msg-83467
Specifically, disable interrupts just before returning and then enable
the timer interrupt if appropriate. This means that the timer interrupt
cannot actually fire until after the RETI, so the function cannot be
entered recursively.
service routine in the case that the requested timer interval is too
small.
Calling the interrupt service routine at this point is likely to
recursively clobber the stack.
Setting a lower bounds on the interrupt delay will limit the upper
speed of pulse generation, but it should not change the relative
pulse rates, and will not recurvisely clobber the stack.
Note that the lower limit of 17 has not been researched, it is
simply the value below which the old code attempted to call
the interrupt service routine directly.