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
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue