dda_queue.c: remove trigraphs in queue_full() and queue_empty().
Saves just 2 bytes binary size, but better than moving the work to the trash.
This commit is contained in:
parent
fa8ec35bc1
commit
9075459659
12
dda_queue.c
12
dda_queue.c
|
|
@ -41,9 +41,9 @@ DDA BSS movebuffer[MOVEBUFFER_SIZE];
|
||||||
uint8_t queue_full() {
|
uint8_t queue_full() {
|
||||||
MEMORY_BARRIER();
|
MEMORY_BARRIER();
|
||||||
if (mb_tail > mb_head) {
|
if (mb_tail > mb_head) {
|
||||||
return ((mb_tail - mb_head - 1) == 0) ? 255 : 0;
|
return (mb_tail - mb_head - 1 == 0);
|
||||||
} else {
|
} else {
|
||||||
return ((mb_tail + MOVEBUFFER_SIZE - mb_head - 1) == 0) ? 255 : 0;
|
return (mb_tail + MOVEBUFFER_SIZE - mb_head - 1 == 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -52,7 +52,7 @@ uint8_t queue_empty() {
|
||||||
uint8_t result;
|
uint8_t result;
|
||||||
|
|
||||||
ATOMIC_START
|
ATOMIC_START
|
||||||
result = ((mb_tail == mb_head) && (movebuffer[mb_tail].live == 0))?255:0;
|
result = (mb_tail == mb_head && movebuffer[mb_tail].live == 0);
|
||||||
ATOMIC_END
|
ATOMIC_END
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -154,7 +154,7 @@ void enqueue_home(TARGET *t, uint8_t endstop_check, uint8_t endstop_stop_cond) {
|
||||||
/// be interrupted such that it can be re-entered from within an interrupt.
|
/// be interrupted such that it can be re-entered from within an interrupt.
|
||||||
/// The timer interrupt MUST be disabled on entry. This is ensured because
|
/// The timer interrupt MUST be disabled on entry. This is ensured because
|
||||||
/// the timer was disabled at the start of the ISR or else because the current
|
/// the timer was disabled at the start of the ISR or else because the current
|
||||||
/// move buffer was dead in the non-interrupt case (which indicates that the
|
/// move buffer was dead in the non-interrupt case (which indicates that the
|
||||||
/// timer interrupt is disabled).
|
/// timer interrupt is disabled).
|
||||||
void next_move() {
|
void next_move() {
|
||||||
while ((queue_empty() == 0) && (movebuffer[mb_tail].live == 0)) {
|
while ((queue_empty() == 0) && (movebuffer[mb_tail].live == 0)) {
|
||||||
|
|
@ -164,7 +164,7 @@ void next_move() {
|
||||||
DDA* current_movebuffer = &movebuffer[t];
|
DDA* current_movebuffer = &movebuffer[t];
|
||||||
// Tail must be set before calling timer_set(), as timer_set() reenables
|
// Tail must be set before calling timer_set(), as timer_set() reenables
|
||||||
// the timer interrupt, potentially exposing mb_tail to the timer
|
// the timer interrupt, potentially exposing mb_tail to the timer
|
||||||
// interrupt routine.
|
// interrupt routine.
|
||||||
mb_tail = t;
|
mb_tail = t;
|
||||||
if (current_movebuffer->waitfor_temp) {
|
if (current_movebuffer->waitfor_temp) {
|
||||||
serial_writestr_P(PSTR("Waiting for target temp\n"));
|
serial_writestr_P(PSTR("Waiting for target temp\n"));
|
||||||
|
|
@ -174,7 +174,7 @@ void next_move() {
|
||||||
else {
|
else {
|
||||||
dda_start(current_movebuffer);
|
dda_start(current_movebuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// DEBUG - print queue.
|
/// DEBUG - print queue.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue