Inherit from Serial and use software buffers for TX and RX. This allows the UART peripherals to operate in a IRQ driven mode. Overrides most (but not all) stdio functions as Serial did
Revision 14:1d0446cdfcb0, committed 2021-03-27
- Comitter:
- howanglam3
- Date:
- Sat Mar 27 07:51:50 2021 +0000
- Parent:
- 13:e2a9eb801c48
- Commit message:
- 9600
Changed in this revision
BufferedSerial.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r e2a9eb801c48 -r 1d0446cdfcb0 BufferedSerial.cpp --- a/BufferedSerial.cpp Tue Sep 29 23:56:04 2020 +0000 +++ b/BufferedSerial.cpp Sat Mar 27 07:51:50 2021 +0000 @@ -26,7 +26,7 @@ BufferedSerial::BufferedSerial(PinName tx, PinName rx, uint32_t buf_size, uint32_t tx_multiple, const char* name) : RawSerial(tx, rx) , _rxbuf(buf_size), _txbuf((uint32_t)(tx_multiple*buf_size)) { - RawSerial::baud( 115200 ); + RawSerial::baud( 9600 ); RawSerial::attach(this, &BufferedSerial::rxIrq, Serial::RxIrq); this->_buf_size = buf_size;