Hi,
I have nRF52840 DK, and using nRF SDK v17. I am trying to understand radio transmitter example sendpacket().
RTC(1) seems to be used to the transmitting packet.
ret_code_t app_timer_init(void)
{
...
err_code = NRF_ATFIFO_INIT(m_req_fifo);
err_code = drv_rtc_init(&m_rtc_inst, &config, rtc_irq);
drv_rtc_overflow_enable(&m_rtc_inst, true);
drv_rtc_compare_set(&m_rtc_inst, 1, DRV_RTC_MAX_CNT >> 1, true);
if (APP_TIMER_KEEPS_RTC_ACTIVE)
{
drv_rtc_start(&m_rtc_inst);
}
m_global_active = true;
return err_code;
}
If I comment out (In main.c) err_code = app_timer_init(); it will stop sending radio packet.
I traced rtc timer (in app_timer2.c), all the following functions related to RTC(1) timer are not called (break points don't hit)
void rtc_update(drv_rtc_t const * const p_instance);
void timer_req_process(drv_rtc_t const * const p_instance);
void rtc_irq(drv_rtc_t const * const p_instance);
void timer_request_proc_trigger(void);
ret_code_t timer_req_schedule(app_timer_req_type_t type, app_timer_t * p_timer);
What is the role of this timer in the sending of radio packets?
Thank you,
David Zhou
