arduino / arduino/ArduinoCore-avr
Feature Request: Callback for "Buffer near full" for HardwareSerial class or HW-Flow-Control implementation
- Dominant language
- C
- Stars
- 1.5k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
I currently try to integrate an ESP8266 together with Arduino MEga2560 in a project and the most common problem with ESP8266 (especially for Non-Mega devices) is that it sends data when they are available - and the TX buffer in ESP8266 is bigger then the RX buffer in the standard HardwareSerial class.
Some ideas in the net are to change the buffer size on Arduino and so modifying the classes. This is an option but when the device has more to do in the loop it may be not enough to read the data before ESP has send so many data that RX buffer in Arduino is overload.
ESP8266 supports hardware flow control in general so it should be able to control the data that will be sended ... but we need a trigger.
My idea was to add some kind of optional callback call/interrupt as soon as the RX buffer is filled to to (e.g.) 80% or such, so that the device can react on it and use the flow control to stop data sending before buffer overflows in a first step till it's avble to handle that ...
What do you think of such an idea?!
The alternative (or real solution) would be to support HW Flow Control (CTS/RTS) in HW-Serial, so no buffer overflow ever can happen ...
Ingo
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.