dda_queue: optimize enqueue().
Suggestion by ItsDrone, see http://forums.reprap.org/read.php?146,174364,174364#msg-174364
This commit is contained in:
parent
f3e502c1ef
commit
d51ec02cdf
|
|
@ -91,10 +91,6 @@ void queue_step() {
|
||||||
/// add a move to the movebuffer
|
/// add a move to the movebuffer
|
||||||
/// \note this function waits for space to be available if necessary, check queue_full() first if waiting is a problem
|
/// \note this function waits for space to be available if necessary, check queue_full() first if waiting is a problem
|
||||||
/// This is the only function that modifies mb_head and it always called from outside an interrupt.
|
/// This is the only function that modifies mb_head and it always called from outside an interrupt.
|
||||||
void enqueue(TARGET *t) {
|
|
||||||
enqueue_home(t, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void enqueue_home(TARGET *t, uint8_t endstop_check, uint8_t endstop_stop_cond) {
|
void enqueue_home(TARGET *t, uint8_t endstop_check, uint8_t endstop_stop_cond) {
|
||||||
// don't call this function when the queue is full, but just in case, wait for a move to complete and free up the space for the passed target
|
// don't call this function when the queue is full, but just in case, wait for a move to complete and free up the space for the passed target
|
||||||
while (queue_full())
|
while (queue_full())
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,13 @@ void queue_step(void);
|
||||||
|
|
||||||
// add a new target to the queue
|
// add a new target to the queue
|
||||||
// t == NULL means add a wait for target temp to the queue
|
// t == NULL means add a wait for target temp to the queue
|
||||||
void enqueue(TARGET *t);
|
|
||||||
void enqueue_home(TARGET *t, uint8_t endstop_check, uint8_t endstop_stop_cond);
|
void enqueue_home(TARGET *t, uint8_t endstop_check, uint8_t endstop_stop_cond);
|
||||||
|
|
||||||
|
static void enqueue(TARGET *) __attribute__ ((always_inline));
|
||||||
|
inline void enqueue(TARGET *t) {
|
||||||
|
enqueue_home(t, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
// called from step timer when current move is complete
|
// called from step timer when current move is complete
|
||||||
void next_move(void) __attribute__ ((hot));
|
void next_move(void) __attribute__ ((hot));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue