dda_queue.c: eliminate a local variable.
This shaves off just 2 bytes binary size and saves only one clock
cycle for the slowest movement step. But heck, that's better than
nothing and comes without drawback, so let's keep this experiment.
Performance:
ATmega sizes '168 '328(P) '644(P) '1280
Program: 19608 bytes 137% 64% 31% 16%
Data: 2175 bytes 213% 107% 54% 27%
EEPROM: 32 bytes 4% 2% 2% 1%
short-moves.gcode statistics:
LED on occurences: 888.
LED on time minimum: 280 clock cycles.
LED on time maximum: 548 clock cycles.
LED on time average: 286.252 clock cycles.
smooth-curves.gcode statistics:
LED on occurences: 23648.
LED on time minimum: 272 clock cycles.
LED on time maximum: 579 clock cycles.
LED on time average: 307.437 clock cycles.
triangle-odd.gcode statistics:
LED on occurences: 1636.
LED on time minimum: 272 clock cycles.
LED on time maximum: 538 clock cycles.
LED on time average: 297.73 clock cycles.
This commit is contained in:
parent
3ba52e5906
commit
9fe3855c3e
|
|
@ -154,12 +154,11 @@ void enqueue_home(TARGET *t, uint8_t endstop_check, uint8_t endstop_stop_cond) {
|
|||
void next_move() {
|
||||
while ((queue_empty() == 0) && (movebuffer[mb_tail].live == 0)) {
|
||||
// next item
|
||||
uint8_t t = MB_NEXT(mb_tail);
|
||||
DDA* current_movebuffer = &movebuffer[t];
|
||||
mb_tail = MB_NEXT(mb_tail);
|
||||
DDA* current_movebuffer = &movebuffer[mb_tail];
|
||||
// Tail must be set before calling timer_set(), as timer_set() reenables
|
||||
// the timer interrupt, potentially exposing mb_tail to the timer
|
||||
// interrupt routine.
|
||||
mb_tail = t;
|
||||
if (current_movebuffer->waitfor_temp) {
|
||||
serial_writestr_P(PSTR("Waiting for target temp\n"));
|
||||
current_movebuffer->live = 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue