File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ menuconfig NRF_GRTC_TIMER
66 default y
77 depends on DT_HAS_NORDIC_NRF_GRTC_ENABLED
88 select TICKLESS_CAPABLE
9+ select SYSTEM_TIMER_HAS_DISABLE_SUPPORT
910 select TIMER_HAS_64BIT_CYCLE_COUNTER
1011 select NRFX_GRTC
1112 help
Original file line number Diff line number Diff line change @@ -368,6 +368,10 @@ uint64_t z_nrf_grtc_timer_startup_value_get(void)
368368#if defined(CONFIG_POWEROFF ) && defined(CONFIG_NRF_GRTC_START_SYSCOUNTER )
369369int z_nrf_grtc_wakeup_prepare (uint64_t wake_time_us )
370370{
371+ if (!nrfx_grtc_init_check ()) {
372+ return - ENOTSUP ;
373+ }
374+
371375 nrfx_err_t err_code ;
372376 static struct k_spinlock lock ;
373377 static uint8_t systemoff_channel ;
@@ -460,6 +464,21 @@ ISR_DIRECT_DECLARE(nrfx_grtc_direct_irq_handler)
460464}
461465#endif
462466
467+ void sys_clock_disable (void )
468+ {
469+ nrfx_grtc_uninit ();
470+ #if defined(CONFIG_CLOCK_CONTROL_NRF )
471+ int err ;
472+ struct onoff_manager * mgr =
473+ z_nrf_clock_control_get_onoff ((clock_control_subsys_t )CLOCK_CONTROL_NRF_TYPE_LFCLK );
474+
475+ err = onoff_release (mgr );
476+ __ASSERT_NO_MSG (err >= 0 );
477+
478+ nrfx_coredep_delay_us (1000 );
479+ #endif
480+ }
481+
463482static int sys_clock_driver_init (void )
464483{
465484 nrfx_err_t err_code ;
You can’t perform that action at this time.
0 commit comments