/* Function for Timer 1 initialization. 
Initializes Timer 1 peripheral, creates event and interrupt every 2 seconds, by configuring CC to timer overflow value, we create events at even number of seconds for example, events are created at 2,4,6 ... seconds. This event can be used to stop Timer 0 with Timer1->Event_Compare triggering Timer 0 TASK_STOP through PPI.  */
static void timer1_init(void)
/* Function for Timer 1 initialization. 
Initializes Timer 1 peripheral, creates event and interrupt every 2 seconds, by configuring CC to timer overflow value, we create events at even number of seconds for example, events are created at 2,4,6 ... seconds. This event can be used to stop Timer 0 with Timer1->Event_Compare triggering Timer 0 TASK_STOP through PPI.  */
static void timer1_init(void)
{
    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    timer_cfg.frequency = NRF_TIMER_FREQ_31250Hz;
    ret_code_t err_code = nrf_drv_timer_init(&timer1, &timer_cfg, timer_event_handler);
    APP_ERROR_CHECK(err_code);
    nrf_drv_timer_extended_compare(&timer1, NRF_TIMER_CC_CHANNEL0, 0xFFFFUL, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false);
}