diff --git a/libraries/FastSerial/FastSerial.cpp b/libraries/FastSerial/FastSerial.cpp index 99553a877b..c312d1241f 100644 --- a/libraries/FastSerial/FastSerial.cpp +++ b/libraries/FastSerial/FastSerial.cpp @@ -198,9 +198,9 @@ FastSerial::write(uint8_t c) uint8_t i; // wait for room in the tx buffer - do { - i = (_txBuffer.head + 1) % RX_BUFFER_SIZE; - } while (i == _txBuffer.tail); + i = (_txBuffer.head + 1) % TX_BUFFER_SIZE; + while (i == _txBuffer.tail) + ; // add byte to the buffer _txBuffer.bytes[_txBuffer.head] = c; @@ -210,13 +210,6 @@ FastSerial::write(uint8_t c) *_ucsrb |= _portTxBits; } -void -FastSerial::write(const uint8_t *buffer, int count) -{ - while (count--) - write(*buffer++); -} - // STDIO emulation ///////////////////////////////////////////////////////////// int diff --git a/libraries/FastSerial/FastSerial.h b/libraries/FastSerial/FastSerial.h index 9849e4a655..4e425eb035 100644 --- a/libraries/FastSerial/FastSerial.h +++ b/libraries/FastSerial/FastSerial.h @@ -104,7 +104,6 @@ public: int read(void); void flush(void); void write(uint8_t c); - void write(const uint8_t *buffer, int count); using Stream::write; // stdio extensions