uart: esp32: fix baudrate return value

HAL call function used to retrieve the configured baudrate
returns the real calculated value, which might not be exactly as
the configured. For baudrate of 115200, HAL api
returns 115201, which then causes uart_basic_api test
to fail. Instead of returning the calculated baudrate value,
returns the configured one.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
This commit is contained in:
Sylvio Alves 2022-01-28 08:35:41 -03:00 committed by Anas Nashif
commit ef3ecbe596

View file

@ -136,7 +136,7 @@ static int uart_esp32_config_get(const struct device *dev,
uart_word_length_t data_bit;
uart_hw_flowcontrol_t hw_flow;
uart_hal_get_baudrate(&data->hal, &cfg->baudrate);
cfg->baudrate = data->uart_config.baudrate;
uart_hal_get_parity(&data->hal, &parity);
switch (parity) {