File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 54
54
55
55
#define MAX_CYCLES (MAX_TICKS * CYC_PER_TICK)
56
56
57
+ #if DT_NODE_HAS_STATUS_OKAY (LFCLK_NODE )
57
58
#define LFCLK_FREQUENCY_HZ DT_PROP(LFCLK_NODE, clock_frequency)
59
+ #else
60
+ #define LFCLK_FREQUENCY_HZ CONFIG_CLOCK_CONTROL_NRF_K32SRC_FREQUENCY
61
+ #endif
58
62
59
63
#if defined(CONFIG_TEST )
60
64
const int32_t z_sys_timer_irq_for_test = DT_IRQN (GRTC_NODE );
@@ -414,8 +418,8 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us)
414
418
415
419
/* This mechanism ensures that stored CC value is latched. */
416
420
uint32_t wait_time =
417
- nrfy_grtc_timeout_get (NRF_GRTC ) * CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC / 32768 +
418
- MAX_CC_LATCH_WAIT_TIME_US ;
421
+ nrfy_grtc_timeout_get (NRF_GRTC ) * CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC /
422
+ LFCLK_FREQUENCY_HZ + MAX_CC_LATCH_WAIT_TIME_US ;
419
423
k_busy_wait (wait_time );
420
424
k_spin_unlock (& lock , key );
421
425
return 0 ;
You can’t perform that action at this time.
0 commit comments