From eec0e00f8586e31ee7672f3557c3da5fbcb046d1 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Sun, 27 Nov 2016 20:38:31 +0100 Subject: [PATCH] dda_queue.c/.h: eliminate queue_current_movement(). Again no stepping performance improvement, but another 34 bytes off the binary size: ATmega sizes '168 '328(P) '644(P) '1280 Program: 19364 bytes 136% 64% 31% 16% Data: 2179 bytes 213% 107% 54% 27% EEPROM: 32 bytes 4% 2% 2% 1% --- dda.c | 4 +++- dda_queue.c | 14 -------------- dda_queue.h | 1 - 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/dda.c b/dda.c index e5bd515..92cf576 100644 --- a/dda.c +++ b/dda.c @@ -764,7 +764,9 @@ void dda_clock() { uint8_t current_id ; #endif - dda = queue_current_movement(); + ATOMIC_START + dda = mb_tail_dda; + ATOMIC_END if (dda != last_dda) { move_state.debounce_count_x = move_state.debounce_count_z = diff --git a/dda_queue.c b/dda_queue.c index dd3486f..93ac376 100644 --- a/dda_queue.c +++ b/dda_queue.c @@ -51,20 +51,6 @@ uint8_t queue_full() { return MB_NEXT(mb_head) == mb_tail; } -/// Return the current movement, or NULL, if there's no movement going on. -DDA *queue_current_movement() { - DDA* current; - - ATOMIC_START - current = &movebuffer[mb_tail]; - - if ( ! current->live) - current = NULL; - ATOMIC_END - - return current; -} - // ------------------------------------------------------- // This is the one function called by the timer interrupt. // It calls a few other functions, though. diff --git a/dda_queue.h b/dda_queue.h index b9943e0..888124b 100644 --- a/dda_queue.h +++ b/dda_queue.h @@ -22,7 +22,6 @@ extern DDA *mb_tail_dda; // queue status methods uint8_t queue_full(void); -DDA *queue_current_movement(void); // take one step void queue_step(void);