Closed falahati closed 5 years ago
Also, TX_BUFFER_SIZE
should be equal to SERIAL_TX_BUFFER_SIZE
so the library users can check out if the write buffer is completely empty by comparing it to the returned value of availableForWrite()
. I don't yet know why TX_BUFFER_SIZE
is bigger than SERIAL_TX_BUFFER_SIZE
; but if there is a good reason for this, the minimum we can do is to define it in the header file so that it is public to the library users.
The same thing is true for the RX_BUFFER_SIZE
and the SERIAL_RX_BUFFER_SIZE
values.
These changes, however, are not part of this commit and I am just suggesting these changes here.
@PaulStoffregen, do you have any comment regarding the topic I mentioned above?
No, not at this time. Ping me after Teensy 4.0 is released...
availableForWrite()
is part ofPrint
class which is the parent ofStream
class and declared as virtual expecting subclasses to define it. HoweverAltSoftSerial
seems to have missed that and therefore essentially made it impossible to do non-blocking serial communication.This PR solves this by defining this method.