Skip to content

Commit 0493af8

Browse files
committed
dm: Use GPPI for PPI resource allocation
nrfx_ppi and nrfx_dppi are deprecated. Signed-off-by: Krzysztof Chruściński <[email protected]>
1 parent 2570e70 commit 0493af8

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

subsys/dm/dm.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,9 @@
2323
#include "rpc/host/dm_rpc_host.h"
2424
#include "rpc/common/dm_rpc_common.h"
2525

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"
3729
#endif
3830

3931
#include <zephyr/logging/log.h>
@@ -504,15 +496,15 @@ int dm_init(struct dm_init_param *init_param)
504496
nrf_dm_antenna_config_t ant_conf = NRF_DM_DEFAULT_SINGLE_ANTENNA_CONFIG;
505497

506498
for (size_t i = 0; i < PPI_CH_COUNT; i++) {
507-
gppi_channel_t channel;
499+
nrfx_gppi_handle_t handle;
508500

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) {
511503
LOG_ERR("(D)PPI channel allocation error: %08x", err);
512-
return -ENOMEM;
504+
return err;
513505
}
514506

515-
ppi_ch[i] = (uint8_t)channel;
507+
ppi_ch[i] = (uint8_t)handle;
516508
}
517509

518510
nrf_dm_init(&ppi_conf, &ant_conf, DM_TIMER);

0 commit comments

Comments
 (0)