BLE Connection Sync - Uninitilize?

I've been working off this example, which provides a great synchronization mechanism.

https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/conn_time_sync/README.html

the example uses RTC, TIMER and EGU peripherals to do the timing, but only initialises it once in controller_timer_nrf52.c and never turns it off. How should i go about uninitialising these peripherals and reinitialising them again? I need to free up the PPI channels for use in other places and need to turn off the peripherals to save on power.

this is my attempt so far

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static int timer_uninit(void)
{
int ret;
nrfx_gppi_channel_free(ppi_chan_timer_clear_on_rtc_tick);
nrfx_timer_uninit(&app_timer_instance);
return 0;
}
static int rtc_uninit(void)
{
int ret;
nrfx_rtc_disable(&app_rtc_instance);
nrfx_rtc_counter_clear(&app_rtc_instance);
nrfx_gppi_channel_free(ppi_chan_on_rtc_match);
nrfx_gppi_channel_free(ppi_chan_on_timer_match);
nrfx_rtc_uninit(&app_rtc_instance);
return 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX