-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Forces UART Flush() to wait until all bits are sent #6026
Conversation
Just curious, why must the uart mode be set to half duplex for all use cases? It would make more sense to add such a set mode function to the class, or add the mode as a parameter to te Now we're stuck with a change in mode settings we cannot adjust when you need full duplex. So can you please explain why this can only be fixed by this, instead of fixing it where it (IMHO) should be fixed: the flush function. |
@SuGlider Just sending a reminder, PTAL on last comment. |
@TD-er / @VojtechBartoska (FYI) IDF 4.4 supports some features RS-485 natively. The way how IDF forces it is by setting the flag with It is not stuck to any mode, because Arduino Libraries for MODBUS or RS-485 will actually control it in whatever it wants by software. This change doesn't force UART to act as full or half duplex. As said, it just forces IDF UART driver to wait until all data is flushed out when using arduino |
This patch feels hacky and I suspect is what's causing issue #6126. Digging into the IDF libraries: |
@mrengineer7777 |
@mrengineer7777 |
Summary
HardwareSerial flush() was returning before all data was sent out through serial port.
This is a problem to some RS485 libraries that depend on it to signaling.
This PR solves the issue by forcing it to block flush() until all data is sent.
Impact
None, just fixes an issue.
Related links
fix #5877