changing available() to return an int (because the Ethernet Client class or another stream might need more than 255 bytes).
This commit is contained in:
parent
58f043e0f3
commit
2b1c9aea35
|
@ -173,7 +173,7 @@ void HardwareSerial::end()
|
|||
cbi(*_ucsrb, _rxcie);
|
||||
}
|
||||
|
||||
uint8_t HardwareSerial::available(void)
|
||||
int HardwareSerial::available(void)
|
||||
{
|
||||
return (RX_BUFFER_SIZE + _rx_buffer->head - _rx_buffer->tail) % RX_BUFFER_SIZE;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ class HardwareSerial : public Stream
|
|||
uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udre, uint8_t u2x);
|
||||
void begin(long);
|
||||
void end();
|
||||
virtual uint8_t available(void);
|
||||
virtual int available(void);
|
||||
virtual int peek(void);
|
||||
virtual int read(void);
|
||||
virtual void flush(void);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
class Stream : public Print
|
||||
{
|
||||
public:
|
||||
virtual uint8_t available() = 0;
|
||||
virtual int available() = 0;
|
||||
virtual int peek() = 0;
|
||||
virtual int read() = 0;
|
||||
virtual void flush() = 0;
|
||||
|
|
Loading…
Reference in New Issue