Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

Commit

Permalink
Revert "dda.c: let's save 3 divisions."
Browse files Browse the repository at this point in the history
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 cd66feb.
  • Loading branch information
Wurstnase committed Feb 13, 2017
1 parent 1e052a7 commit e707c39
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dda.c
Expand Up @@ -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
Expand Down

0 comments on commit e707c39

Please sign in to comment.