Skip to content

Conversation

@pfalcon
Copy link
Contributor

@pfalcon pfalcon commented May 11, 2017

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]

@pfalcon
Copy link
Contributor Author

pfalcon commented May 11, 2017

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
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

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.

Copy link
Contributor Author

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.

@pfalcon pfalcon force-pushed the uart-tx-complete branch from 6fdc183 to fe686cc Compare May 11, 2017 16:44
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]>
@nashif nashif merged commit 0fdc9b5 into zephyrproject-rtos:master May 13, 2017
@pfalcon
Copy link
Contributor Author

pfalcon commented May 13, 2017

Thanks!

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 this pull request may close these issues.

2 participants