drivers: serial: uart_async_to_irq.c check if baudrate is not zero
assert if baudrate is not zero in order to avoid division by zero error Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
This commit is contained in:
parent
d6b01bc8a0
commit
da241fe722
1 changed files with 2 additions and 0 deletions
|
|
@ -56,6 +56,8 @@ static uint32_t get_rx_timeout(const struct device *dev)
|
|||
baudrate = get_config(dev)->baudrate;
|
||||
}
|
||||
|
||||
__ASSERT_NO_MSG(baudrate != 0);
|
||||
|
||||
uint32_t us = (CONFIG_UART_ASYNC_TO_INT_DRIVEN_RX_TIMEOUT * 1000000) / baudrate;
|
||||
|
||||
return us;
|
||||
|
|
|
|||
Loading…
Reference in a new issue