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 cd66feb8d1.
This commit is contained in:
Nico Tonnhofer 2017-02-11 20:55:01 +01:00
parent 1e052a77a2
commit e707c395f3
1 changed files with 1 additions and 2 deletions

3
dda.c
View File

@ -324,12 +324,11 @@ void dda_create(DDA *dda, const TARGET *target) {
c_limit = 0; c_limit = 0;
for (i = X; i < AXIS_COUNT; i++) { for (i = X; i < AXIS_COUNT; i++) {
c_limit_calc = (delta_um[i] * 2400L) / 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]); pgm_read_dword(&maximum_feedrate_P[i]);
if (c_limit_calc > c_limit) if (c_limit_calc > c_limit)
c_limit = c_limit_calc; c_limit = c_limit_calc;
} }
c_limit = c_limit / dda->total_steps * (F_CPU / 40000);
#ifdef ACCELERATION_REPRAP #ifdef ACCELERATION_REPRAP
// c is initial step time in IOclk ticks // c is initial step time in IOclk ticks