Hi,
I think I may have found a bug in CircularBufferInputOutputStream.
I'm testing it with usart receive interrupt. The buffer seems to get full
even if I'm reading it right away. I'm doing it this way:
In the interrupt routine
d = _usart.receive();
if (!inStream.isFull())
inStream.write(d);
then in my GetChar which I call in main, this what it does:
if (inStream.available()) {
d = inStream.read();
_usart.send(d);
}
In
int16_t CircularBufferInputOutputStream::read() {
....
if(_readPtr >= _buffer + _bufferSize) {
_readPtr=_buffer;
_wrappedWrite = false; /* This seems to be a fix */
}
return value;
}
I add _wrappedWrite = false;
It would be nice to have a confirmation if it's a bug or I'm doing it wrong again :)
Thanks for reporting this, I promise I'll investigate and fix any problem. It may take a couple of weeks though as I'm very busy with something else.