Skip to content

Commit 3c4e058

Browse files
committed
[nrf noup] drivers: serial: nrfx_uarte: Adapt to the new GPPI API
Adapt workaround which count bytes with timer to use the new GPPI API. Signed-off-by: Krzysztof Chruściński <[email protected]>
1 parent b360e92 commit 3c4e058

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/serial/uart_nrfx_uarte.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ struct uarte_async_rx_cbwt {
229229
uint8_t *anomaly_byte_dst;
230230
uint8_t anomaly_byte;
231231
#endif
232+
nrfx_gppi_handle_t ppi_h;
232233
uint8_t bounce_idx;
233-
uint8_t ppi_ch;
234234
bool in_irq;
235235
bool discard_fifo;
236236
};
@@ -1722,18 +1722,17 @@ static int cbwt_uarte_async_init(const struct device *dev)
17221722
NRF_UARTE_INT_RXTO_MASK;
17231723
uint32_t evt = nrf_uarte_event_address_get(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY);
17241724
uint32_t tsk = nrf_timer_task_address_get(cfg->timer_regs, NRF_TIMER_TASK_COUNT);
1725-
nrfx_err_t ret;
1725+
int ret;
17261726

17271727
nrf_timer_mode_set(cfg->timer_regs, NRF_TIMER_MODE_COUNTER);
17281728
nrf_timer_bit_width_set(cfg->timer_regs, NRF_TIMER_BIT_WIDTH_32);
17291729

1730-
ret = nrfx_gppi_channel_alloc(&cbwt_data->ppi_ch);
1731-
if (ret != NRFX_SUCCESS) {
1732-
return -ENOMEM;
1730+
ret = nrfx_gppi_conn_alloc(evt, tsk, &cbwt_data->ppi_h);
1731+
if (ret < 0) {
1732+
return ret;
17331733
}
17341734

1735-
nrfx_gppi_channel_endpoints_setup(cbwt_data->ppi_ch, evt, tsk);
1736-
nrfx_gppi_channels_enable(BIT(cbwt_data->ppi_ch));
1735+
nrfx_gppi_conn_enable(cbwt_data->ppi_h);
17371736

17381737
#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE
17391738
cbwt_data->bounce_buf_swap_len = cfg->bounce_buf_swap_len;

0 commit comments

Comments
 (0)