Skip to content

Conversation

@perezpri
Copy link
Contributor

This function is only checking for byte current byte being transmitted. This patch ensures that function returns 1 until TX is disabled and no byte is being transmitted.

@perezpri perezpri requested a review from albertofloyd as a code owner August 30, 2024 21:31
@zephyrbot zephyrbot added area: UART Universal Asynchronous Receiver-Transmitter platform: Microchip MEC Microchip MEC Platform labels Aug 30, 2024
@perezpri
Copy link
Contributor Author

CC: @scottwcpg

scottwcpg
scottwcpg previously approved these changes Sep 3, 2024
Copy link
Contributor

@scottwcpg scottwcpg left a comment

Choose a reason for hiding this comment

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

It works. Note: old and new code could be simplified. TEMT bit[6] of LSR becomes 1 when both tx holding register AND tx shift register are empty. Depends on your purpose. Are you wanting to know if a new byte can be written to the UART TX reg or are you wanting to know if TX is finished transmitting and no longer requires a clock?

@perezpri
Copy link
Contributor Author

perezpri commented Sep 3, 2024

It works. Note: old and new code could be simplified. TEMT bit[6] of LSR becomes 1 when both tx holding register AND tx shift register are empty. Depends on your purpose. Are you wanting to know if a new byte can be written to the UART TX reg or are you wanting to know if TX is finished transmitting and no longer requires a clock?

I want to know if TX has finished transmitting and no longer requires clock. In chrome EC, this function is used by uart_tx_flush to block current thread until all data is transmitted.

@perezpri
Copy link
Contributor Author

perezpri commented Oct 1, 2024

CC: @keith-zephyr

This function is only checking for current byte being transmitted.
This patch ensures that function returns `1` until TX is disabled and
no byte is being transmitted.

Signed-off-by: Bernardo Perez Priego <[email protected]>
@kartben
Copy link
Contributor

kartben commented Oct 16, 2024

Ping @jvasanth1

@dkalowsk dkalowsk added this to the v4.0.0 milestone Oct 29, 2024
@nashif nashif assigned dcpleung and unassigned jvasanth1 Nov 8, 2024
@mmahadevan108 mmahadevan108 merged commit b6b8eee into zephyrproject-rtos:main Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: UART Universal Asynchronous Receiver-Transmitter platform: Microchip MEC Microchip MEC Platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants