#define RTC_INSTANCE 0
nrf_drv_rtc_t rtc = NRF_DRV_RTC_INSTANCE(RTC_INSTANCE);
void Rtc_Handler(nrf_drv_rtc_int_type_t int_type)
{
if(int_type == NRF_DRV_RTC_INT_TICK)
{
nrf_gpio_pin_toggle(LED_1);
}
}
//configure low frequency clock
static void Low_freq_clk(void)
{
ret_code_t err_code = nrf_drv_clock_init();
APP_ERROR_CHECK(err_code);
nrf_drv_clock_lfclk_request(NULL);
}
//RTC configuration
void Rtc_Config(void)
{
ret_code_t error_code;
nrf_drv_rtc_config_t rtc_config = NRF_DRV_RTC_DEFAULT_CONFIG;
rtc_config.prescaler = 4095;
error_code = nrf_drv_rtc_init(&rtc,&rtc_config,Rtc_Handler);
APP_ERROR_CHECK(error_code);
nrfx_rtc_tick_enable(&rtc,true);
nrf_drv_rtc_enable(&rtc);
}
i am trying to toggle led with the help of rtc but event = NRF_RTC_EVENT_TICK; was triggered initially afterwards event = NRF_RTC_EVENT_OVERFLOW; was triggered and why that overflow event was triggered?