the increment in fifo_queue should better do a
if first >= queue_size { first = 0 }
instead of first = (first + 1) % queue_size as this is incorrect for first = 65535.
example: queue_size = 10. first = 65535
6. element is addressed
increment: first = 65536 = 0 = 1. element but should be 7. element
Logged In: YES
user_id=687107
Originator: YES
I guess this is not a real bug. first should not be bigger than queue size.
anyway, using % requires a 16-bit division for no reason. the if first >= queue_size is a simple 16 bit compare and hence much cheaper. I'll fix it.