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);