cpu/native/periph/uart: uart_poweroff() closes the file descriptor + extended baud-rate support on Linux#20365
Merged
benpicco merged 1 commit intoRIOT-OS:masterfrom Feb 10, 2024
Conversation
benpicco
reviewed
Feb 9, 2024
437df91 to
795415d
Compare
Contributor
Author
|
On a second glance, it looks that some baudrates already included (e.g. 115200) are not POSIX either, so I think I should enable them all uncoditionally. |
benpicco
approved these changes
Feb 9, 2024
fabian18
reviewed
Feb 10, 2024
| if (res < 0) { | ||
| err(EXIT_FAILURE, "native_async_read_remove_handler(): fcntl(F_GETFL)"); | ||
| } | ||
| unsigned flags = (unsigned)res & !O_ASYNC; |
Contributor
Author
There was a problem hiding this comment.
Ouch, yes, ~O_ASYNC. Why was this merged?
Contributor
Author
There was a problem hiding this comment.
Haha ok I'll fix is
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
uart_poweroff()now closes the underlying file descriptorThis is needed if for re-initializing the UART device. An example use-case is baud-rate probing.
On Linux, extended baud-rate support
On Linux, the extended baud-rates are defined in
bits/termios-baud.has follows:As such, I'm not sure if they are available on other platforms too, so I enabled them for Linux only.
Testing procedure
The following should be a valid use-case: