From e707c395f311844f975c8e235444ccb69e83162f Mon Sep 17 00:00:00 2001 From: Nico Tonnhofer Date: Sat, 11 Feb 2017 20:55:01 +0100 Subject: [PATCH] Revert "dda.c: let's save 3 divisions." delta_um can become very small, where maximum_feedrate_P is constant. When moving this division out of the loop, the result can be wrong. dda->total_steps becomes also very small with delta_um. So this will fit perfectly. This reverts commit cd66feb8d1d2cb16f440a0a09dfe65e7a914f415. --- dda.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dda.c b/dda.c index 854e7e004..a52079af1 100644 --- a/dda.c +++ b/dda.c @@ -324,12 +324,11 @@ void dda_create(DDA *dda, const TARGET *target) { c_limit = 0; for (i = X; i < AXIS_COUNT; i++) { c_limit_calc = (delta_um[i] * 2400L) / - // dda->total_steps * (F_CPU / 40000) / + dda->total_steps * (F_CPU / 40000) / pgm_read_dword(&maximum_feedrate_P[i]); if (c_limit_calc > c_limit) c_limit = c_limit_calc; } - c_limit = c_limit / dda->total_steps * (F_CPU / 40000); #ifdef ACCELERATION_REPRAP // c is initial step time in IOclk ticks