drivers: serial: stm32: simplify logic
Simplify the logic for the `uart_stm32_cfg2ll_databits` function regarding `LL_USART_DATAWIDTH_9B` being defined or not. Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
This commit is contained in:
parent
0f22fde988
commit
7fe85f8cb4
1 changed files with 2 additions and 4 deletions
|
@ -411,13 +411,11 @@ static inline uint32_t uart_stm32_cfg2ll_databits(enum uart_config_data_bits db,
|
|||
#endif /* LL_USART_DATAWIDTH_9B */
|
||||
case UART_CFG_DATA_BITS_8:
|
||||
default:
|
||||
if (p == UART_CFG_PARITY_NONE) {
|
||||
return LL_USART_DATAWIDTH_8B;
|
||||
#ifdef LL_USART_DATAWIDTH_9B
|
||||
} else {
|
||||
if (p != UART_CFG_PARITY_NONE) {
|
||||
return LL_USART_DATAWIDTH_9B;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
return LL_USART_DATAWIDTH_8B;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue