From 5ee9a0bd3ce26526027ecdd98f33f8b82747a63b Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Wed, 30 Oct 2013 20:05:01 +0100 Subject: [PATCH] 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. --- dda.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dda.c b/dda.c index beeb39b..6078f0e 100644 --- a/dda.c +++ b/dda.c @@ -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