implementation {
- queue_t queue[QUEUE_SIZE];
+ queue_t ONE_NOK queue[QUEUE_SIZE];
uint8_t head = 0;
uint8_t tail = 0;
uint8_t size = 0;
command queue_t Queue.element(uint8_t idx) {
idx += head;
- idx %= QUEUE_SIZE;
+ if (idx >= QUEUE_SIZE) {
+ idx -= QUEUE_SIZE;
+ }
return queue[idx];
}