drivers: uart_nrfx_uarte: Fix call to HW_RX_COUNTING_ENABLED()
Since the macro references `data->async->hw_rx_counting`, it cannot be called when `data->async` is NULL, and this could happen when the PM_DEVICE_ACTION_RESUME action was requested for an instance that uses the interrupt-driven API while for another instance that uses the asynchronous API the hardware counting of bytes was configured. Prevent this by calling the macro from a proper `if` block. Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
parent
676441e0ca
commit
9628ecdc39
1 changed files with 4 additions and 3 deletions
|
@ -1956,10 +1956,11 @@ static int uarte_nrfx_pm_action(const struct device *dev,
|
||||||
nrf_uarte_enable(uarte);
|
nrf_uarte_enable(uarte);
|
||||||
|
|
||||||
#ifdef UARTE_ANY_ASYNC
|
#ifdef UARTE_ANY_ASYNC
|
||||||
|
if (data->async) {
|
||||||
if (HW_RX_COUNTING_ENABLED(data)) {
|
if (HW_RX_COUNTING_ENABLED(data)) {
|
||||||
nrfx_timer_enable(&cfg->timer);
|
nrfx_timer_enable(&cfg->timer);
|
||||||
}
|
}
|
||||||
if (data->async) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue