diff --git a/RingStream.h b/RingStream.h index 8b183aa..cfc82eb 100644 --- a/RingStream.h +++ b/RingStream.h @@ -48,7 +48,8 @@ class RingStream : public Print { void flush(); void info(); byte readRawByte(); - inline byte peek() { + inline int peek() { + if ((_pos_read==_pos_write) && !_overflow) return -1; // empty return _buffer[_pos_read]; }; private: