drivers: serial: nrf_uarte: Add missing check for async API
uarte_enable function was not supporting a case when async api was enabled but instance did not use it. Added runtime check for async instance presence. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
485f593bb7
commit
1ddfea32bf
1 changed files with 10 additions and 7 deletions
|
@ -514,6 +514,8 @@ static void uarte_enable(const struct device *dev, uint32_t mask)
|
|||
{
|
||||
#ifdef CONFIG_UART_ASYNC_API
|
||||
struct uarte_nrfx_data *data = get_dev_data(dev);
|
||||
|
||||
if (data->async) {
|
||||
bool disabled = data->async->low_power_mask == 0;
|
||||
|
||||
data->async->low_power_mask |= mask;
|
||||
|
@ -526,6 +528,7 @@ static void uarte_enable(const struct device *dev, uint32_t mask)
|
|||
nrfx_timer_increment(timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
nrf_uarte_enable(get_uarte_instance(dev));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue