DDA: The test of total_steps against step_no was a good idea.

So let's bring this part back.

We save 35 clock cycles at 'LED on time maximum'

ATmega sizes               '168   '328(P)   '644(P)     '1280
Program:  18038 bytes      126%       59%       29%       14%
   Data:   1936 bytes      190%       95%       48%       24%
 EEPROM:     32 bytes        4%        2%        2%        1%

short-moves.gcode statistics:
LED on occurences: 888.
LED on time minimum: 217 clock cycles.
LED on time maximum: 520 clock cycles.
LED on time average: 249.626 clock cycles.

smooth-curves.gcode statistics:
LED on occurences: 22589.
LED on time minimum: 217 clock cycles.
LED on time maximum: 537 clock cycles.
LED on time average: 284.747 clock cycles.

triangle-odd.gcode statistics:
LED on occurences: 1636.
LED on time minimum: 217 clock cycles.
LED on time maximum: 520 clock cycles.
LED on time average: 270.933 clock cycles.
This commit is contained in:
Nico Tonnhofer 2017-01-26 23:27:23 +01:00
parent 22489c69cb
commit 1e052a77a2
1 changed files with 6 additions and 4 deletions

10
dda.c
View File

@ -676,12 +676,14 @@ void dda_step(DDA *dda) {
// //
// TODO: with ACCELERATION_TEMPORAL this duplicates some code. See where // TODO: with ACCELERATION_TEMPORAL this duplicates some code. See where
// dda->live is zero'd, about 10 lines above. // dda->live is zero'd, about 10 lines above.
if ((move_state.steps[X] == 0 && move_state.steps[Y] == 0 && #if ! defined ACCELERATION_TEMPORAL
if (move_state.step_no >= dda->total_steps ||
(move_state.endstop_stop && dda->n <= 0))
#else
if (move_state.steps[X] == 0 && move_state.steps[Y] == 0 &&
move_state.steps[Z] == 0 && move_state.steps[E] == 0) move_state.steps[Z] == 0 && move_state.steps[E] == 0)
#ifdef ACCELERATION_RAMPING
|| (move_state.endstop_stop && dda->n <= 0)
#endif #endif
) { {
dda->live = 0; dda->live = 0;
dda->done = 1; dda->done = 1;
#ifdef LOOKAHEAD #ifdef LOOKAHEAD