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 @@ -366,6 +366,10 @@ uint64_t z_nrf_grtc_timer_startup_value_get(void)
366366#if defined(CONFIG_POWEROFF ) && defined(CONFIG_NRF_GRTC_START_SYSCOUNTER )
367367int z_nrf_grtc_wakeup_prepare (uint64_t wake_time_us )
368368{
369+ if (!nrfx_grtc_init_check ()) {
370+ return - ENOTSUP ;
371+ }
372+
369373 nrfx_err_t err_code ;
370374 static uint8_t systemoff_channel ;
371375 uint64_t now = counter ();
@@ -463,6 +467,21 @@ ISR_DIRECT_DECLARE(nrfx_grtc_direct_irq_handler)
463467}
464468#endif
465469
470+ void sys_clock_disable (void )
471+ {
472+ nrfx_grtc_uninit ();
473+ #if defined(CONFIG_CLOCK_CONTROL_NRF )
474+ int err ;
475+ struct onoff_manager * mgr =
476+ z_nrf_clock_control_get_onoff ((clock_control_subsys_t )CLOCK_CONTROL_NRF_TYPE_LFCLK );
477+
478+ err = onoff_release (mgr );
479+ __ASSERT_NO_MSG (err >= 0 );
480+
481+ nrfx_coredep_delay_us (1000 );
482+ #endif
483+ }
484+
466485static int sys_clock_driver_init (void )
467486{
468487 nrfx_err_t err_code ;
You can’t perform that action at this time.
0 commit comments