drivers: serial: nrf_uarte: Reset rx byte counters
Reset rx byte counters when hw timer/counter is disabled. Fixes issue where disabling and re-enabling async uart rx can produce "UART_RX_RDY" events with invalid data when power management is used. Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
This commit is contained in:
parent
51d6931b16
commit
1e227d1576
1 changed files with 3 additions and 0 deletions
|
@ -1452,6 +1452,9 @@ static void uarte_nrfx_set_power_state(const struct device *dev,
|
|||
#ifdef CONFIG_UART_ASYNC_API
|
||||
if (hw_rx_counting_enabled(get_dev_data(dev))) {
|
||||
nrfx_timer_disable(&get_dev_config(dev)->timer);
|
||||
/* Timer/counter value is reset when disabled. */
|
||||
data->async->rx_total_byte_cnt = 0;
|
||||
data->async->rx_total_user_byte_cnt = 0;
|
||||
}
|
||||
if (get_dev_data(dev)->async) {
|
||||
nrf_uarte_disable(uarte);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue