/* Function initialization and configuration of RTC driver instance.  */
static void rtc_config(void)
/* Function initialization and configuration of RTC driver instance.  */
static void rtc_config(void)
{
    uint32_t err_code;
    nrf_drv_rtc_config_t config = NRF_DRV_RTC_DEFAULT_CONFIG;
    config.prescaler = 4095;
    err_code = nrf_drv_rtc_init(&rtc, &config, rtc_handler);
    APP_ERROR_CHECK(err_code);
    nrf_drv_rtc_tick_enable(&rtc,true);
    err_code = nrf_drv_rtc_cc_set(&rtc,0,COMPARE_COUNTERTIME * 8,true);
    APP_ERROR_CHECK(err_code);
    nrf_drv_rtc_enable(&rtc);
}