-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: serial: Clarify usage of TX/RX IRQ predicates. #159
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
Conversation
|
This implements RFC https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-May/007642.html . Note that this is mechanical replacement of irq_tx_empty to irq_tx_complete. Some drivers clearly (still) don't have correct semantics for tx_ready vs tx_complete, that's the subject of follow-up patches. This patch just clarifies the API. @daniel-thompson, @erwango : Please review. |
include/uart.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when renaming APIs, please deprecate the old function and keep it in place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to add attribute __deprecated, doxygen @deprecated is not enough :)
Look at include/dma.h for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed that, sorry. Now fixed. Used pwm.h/dma.h as a reference re: placement of __deprecated, just in case.
uart_irq_tx_empty() function proved to be problematic: its semantics was not documented properly, and many hardware uses terminology like "TX register empty" to signify condition of TX register being ready to accept another character (what in Zephyr is tested with uart_irq_tx_ready()). To avoid confusion, uart_irq_tx_empty() was renamed to uart_irq_tx_complete(), propagating to drivers/serial device methods. The semantics and usage model of all of uart_irq_rx_ready(), uart_irq_tx_ready(), uart_irq_tx_complete() is now described in detail. Signed-off-by: Paul Sokolovsky <[email protected]>
|
Thanks! |
…r-target [Makefile] Rename x86 target back to zephyr
uart_irq_tx_empty() function proved to be problematic: its semantics
was not documented properly, and many hardware uses terminology like
"TX register empty" to signify condition of TX register being ready
to accept another character (what in Zephyr is tested with
uart_irq_tx_ready()). To avoid confusion, uart_irq_tx_empty() was
renamed to uart_irq_tx_complete(), propagating to drivers/serial
device methods.
The semantics and usage model of all of uart_irq_rx_ready(),
uart_irq_tx_ready(), uart_irq_tx_complete() is now described in
detail.
Signed-off-by: Paul Sokolovsky [email protected]