drivers: mcux_flexcomm: fix character glitches at low power entry
Character glitches are observed when entering suspend and standby low power modes. To fix it, we make sure the `poll_out` API waits for the character transfer to complete. This is aligned with the uart driver API description. Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
This commit is contained in:
parent
36aa80337b
commit
0ecaef0053
1 changed files with 13 additions and 2 deletions
|
@ -134,11 +134,22 @@ static void mcux_flexcomm_poll_out(const struct device *dev,
|
|||
{
|
||||
const struct mcux_flexcomm_config *config = dev->config;
|
||||
|
||||
/* Wait until space is available in TX FIFO */
|
||||
while (!(USART_GetStatusFlags(config->base) & kUSART_TxFifoEmptyFlag)) {
|
||||
/* Wait until space is available in TX FIFO, as per API description:
|
||||
* This routine checks if the transmitter is full.
|
||||
* When the transmitter is not full, it writes a character to the data register.
|
||||
* It waits and blocks the calling thread otherwise.
|
||||
*/
|
||||
while (!(USART_GetStatusFlags(config->base) & kUSART_TxFifoNotFullFlag)) {
|
||||
}
|
||||
|
||||
USART_WriteByte(config->base, c);
|
||||
|
||||
/* Wait for the transfer to complete, as per API description:
|
||||
* This function is a blocking call. It blocks the calling thread until the character
|
||||
* is sent.
|
||||
*/
|
||||
while (!(USART_GetStatusFlags(config->base) & kUSART_TxFifoEmptyFlag)) {
|
||||
}
|
||||
}
|
||||
|
||||
static int mcux_flexcomm_err_check(const struct device *dev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue