Skip to content

2.0.0-rc2 - Serial.setRxBufferSize() is missing #5580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
szerwi opened this issue Aug 23, 2021 · 5 comments · Fixed by #5583
Closed

2.0.0-rc2 - Serial.setRxBufferSize() is missing #5580

szerwi opened this issue Aug 23, 2021 · 5 comments · Fixed by #5583
Assignees
Milestone

Comments

@szerwi
Copy link

szerwi commented Aug 23, 2021

Hardware:

Board: ESP32 Dev Module
Core Installation version: 2.0.0-rc2
IDE name: Arduino IDE
Flash Frequency: 40Mhz
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Windows 10

Description:

Serial.setRxBufferSize() function is missing in HardwareSerial library in 2.0.0-rc2.

@me-no-dev me-no-dev added this to the 2.0.0 milestone Aug 23, 2021
@SuGlider
Copy link
Collaborator

SuGlider commented Aug 23, 2021

@szerwi buffer size can be set using begin(...) Function.

It is one of the parameters.
Default RX buffer size is 256 bytes.

It has not been included because UART is now implemented using IDF. There is no IDF API to change RX internal buffer size.

One work around is to end() it and then begin(...) It using a new RX buffer size in the begin parameters.

@szerwi
Copy link
Author

szerwi commented Aug 23, 2021

@SuGlider how can I set it in the begin() function?
From HardwareSerial.h: void begin(unsigned long baud, uint32_t config=SERIAL_8N1, int8_t rxPin=-1, int8_t txPin=-1, bool invert=false, unsigned long timeout_ms = 20000UL, uint8_t rxfifo_full_thrhd = 112);
Is that a rxfifo_full_thrhd parameter?

@atanisoft
Copy link
Collaborator

@szerwi It's not currently exposed in HardwareSerial. @SuGlider can you add another parameter to expose it?

@SuGlider
Copy link
Collaborator

SuGlider commented Aug 23, 2021

@szerwi, @atanisoft parameter exposed in PR #5583
new interface:

void begin(unsigned long baud, uint32_t config=SERIAL_8N1, int8_t rxPin=-1, int8_t txPin=-1, bool invert=false, unsigned long timeout_ms = 20000UL, uint8_t rxfifo_full_thrhd = 112, size_t rxBufferSize = 256);

@SuGlider
Copy link
Collaborator

HardwareSerial::setRxBufferSize(size_t newSize) has been added and commited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants