PaulStoffregen / AltSoftSerial

Software emulated serial using hardware timers for improved compatibility
http://www.pjrc.com/teensy/td_libs_AltSoftSerial.html
334 stars 131 forks source link

void flush() { flushInput(); } ? #21

Closed PhiJu5 closed 8 years ago

PhiJu5 commented 8 years ago

if ARDUINO >= 100

size_t write(uint8_t byte) { writeByte(byte); return 1; }
void flush() { flushOutput(); }

else

void write(uint8_t byte) { writeByte(byte); }
void flush() { flushInput(); }

10

Shouln't void flush() { flushInput(); } be void flush() { flushOutput(); } ?

PaulStoffregen commented 8 years ago

Before Arduino 1.0, the flush() function discarded input. This code does the post-1.0 behavior on Arduino 1.0 and later, and the pre-1.0 behavior on old versions.