dda.c: re-enable the hack with overly large rampup steps.

Until we have accurate rampup steps calculations, this hack is
neccessary for endstop searches.
This commit is contained in:
Markus Hitter 2013-10-30 20:05:01 +01:00
parent 28cc8d3f84
commit 5ee9a0bd3c
1 changed files with 11 additions and 4 deletions

15
dda.c
View File

@ -818,10 +818,17 @@ void dda_clock() {
// We hit max speed not always exactly.
move_c = dda->c_min;
#ifndef LOOKAHEAD
// This is a hack which deals with movements with an unknown number of
// acceleration steps. dda_create() sets a very high number, then,
// but we don't want to re-calculate all the time.
// This is a hack which deals with movements with an unknown number of
// acceleration steps. dda_create() sets a very high number, then,
// but we don't want to re-calculate all the time.
// This hack doesn't work with (and isn't neccessary for) movements
// accelerated by look-ahead.
#ifdef LOOKAHEAD
if (dda->crossF == 0) { // For example, endstop searches.
dda->rampup_steps = move_step_no;
dda->rampdown_steps = dda->total_steps - dda->rampup_steps;
}
#else // Without LOOKAHEAD, there's no dda->crossF.
dda->rampup_steps = move_step_no;
dda->rampdown_steps = dda->total_steps - dda->rampup_steps;
#endif