|
23 | 23 | #include "rpc/host/dm_rpc_host.h" |
24 | 24 | #include "rpc/common/dm_rpc_common.h" |
25 | 25 |
|
26 | | -#if defined(DPPI_PRESENT) |
27 | | -#include <nrfx_dppi.h> |
28 | | - |
29 | | -static nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); |
30 | | - |
31 | | -#define gppi_channel_t uint8_t |
32 | | -#define gppi_channel_alloc(x) nrfx_dppi_channel_alloc(&dppi, x) |
33 | | -#else |
34 | | -#include <nrfx_ppi.h> |
35 | | -#define gppi_channel_t nrf_ppi_channel_t |
36 | | -#define gppi_channel_alloc nrfx_ppi_channel_alloc |
| 26 | +#include <helpers/nrfx_gppi.h> |
| 27 | +#ifdef NRFX_GPPI_MULTI_DOMAIN |
| 28 | +#error "Not supported" |
37 | 29 | #endif |
38 | 30 |
|
39 | 31 | #include <zephyr/logging/log.h> |
@@ -504,15 +496,15 @@ int dm_init(struct dm_init_param *init_param) |
504 | 496 | nrf_dm_antenna_config_t ant_conf = NRF_DM_DEFAULT_SINGLE_ANTENNA_CONFIG; |
505 | 497 |
|
506 | 498 | for (size_t i = 0; i < PPI_CH_COUNT; i++) { |
507 | | - gppi_channel_t channel; |
| 499 | + nrfx_gppi_handle_t handle; |
508 | 500 |
|
509 | | - err = gppi_channel_alloc(&channel); |
510 | | - if (err != NRFX_SUCCESS) { |
| 501 | + err = nrfx_gppi_domain_conn_alloc(0, 0, &handle); |
| 502 | + if (err < 0) { |
511 | 503 | LOG_ERR("(D)PPI channel allocation error: %08x", err); |
512 | | - return -ENOMEM; |
| 504 | + return err; |
513 | 505 | } |
514 | 506 |
|
515 | | - ppi_ch[i] = (uint8_t)channel; |
| 507 | + ppi_ch[i] = (uint8_t)handle; |
516 | 508 | } |
517 | 509 |
|
518 | 510 | nrf_dm_init(&ppi_conf, &ant_conf, DM_TIMER); |
|
0 commit comments