/* Function for selecting a timer resource. This function may be called directly, or through dtm_cmd() specifying DTM_PKT_VENDORSPECIFIC as payload, SELECT_TIMER as length, and the timer as freq.  */
bool dtm_set_timer(uint32_t new_timer)
/* Function for selecting a timer resource. This function may be called directly, or through dtm_cmd() specifying DTM_PKT_VENDORSPECIFIC as payload, SELECT_TIMER as length, and the timer as freq.  */
bool dtm_set_timer(uint32_t new_timer)
{
    if (m_state > STATE_IDLE)
    {
        return false;
    }
    if (new_timer == 0)
    {
        mp_timer    = NRF_TIMER0;
        m_timer_irq = TIMER0_IRQn;
    }
    else if (new_timer == 1)
    {
        mp_timer    = NRF_TIMER1;
        m_timer_irq = TIMER1_IRQn;
    }
    else if (new_timer == 2)
    {
        mp_timer    = NRF_TIMER2;
        m_timer_irq = TIMER2_IRQn;
    }
    else
    {
        return false;
    }
    return true;
}