Adds HardwareSerial::setTxBufferSize() (#6383)

* Adds HardwareSerial::setTxBufferSize()

* uartBegin def fix

* checks TXBufferSize  as defined in IDF

Makes sure that the buffer size will not cause a reset to the board.

* Removes double value in Rx/Tx Buffer Size 

Keeps Rx/Tx buffer size as set, not doubling it. It makes the process more clear.

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
This commit is contained in:
Gonzalo Brusco
2022-03-28 05:37:12 -03:00
committed by GitHub
parent 8fe0efe8c0
commit 77e95311e0
4 changed files with 26 additions and 7 deletions

View File

@ -132,11 +132,13 @@ public:
void setHwFlowCtrlMode(uint8_t mode = HW_FLOWCTRL_CTS_RTS, uint8_t threshold = 64); // 64 is half FIFO Length
size_t setRxBufferSize(size_t new_size);
size_t setTxBufferSize(size_t new_size);
protected:
int _uart_nr;
uart_t* _uart;
size_t _rxBufferSize;
size_t _txBufferSize;
OnReceiveCb _onReceiveCB;
OnReceiveErrorCb _onReceiveErrorCB;
TaskHandle_t _eventTask;