static void grlib_gptimer_enable(GPTimer *timer)

{

    assert(timer != NULL);





    ptimer_stop(timer->ptimer);



    if (!(timer->config & GPTIMER_ENABLE)) {

        /* Timer disabled */

        trace_grlib_gptimer_disabled(timer->id, timer->config);

        return;

    }



    /* ptimer is triggered when the counter reach 0 but GPTimer is triggered at

       underflow. Set count + 1 to simulate the GPTimer behavior. */



    trace_grlib_gptimer_enable(timer->id, timer->counter + 1);



    ptimer_set_count(timer->ptimer, timer->counter + 1);

    ptimer_run(timer->ptimer, 1);

}

static void grlib_gptimer_enable(GPTimer *timer)

{

    assert(timer != NULL);





    ptimer_stop(timer->ptimer);



    if (!(timer->config & GPTIMER_ENABLE)) {

        

        trace_grlib_gptimer_disabled(timer->id, timer->config);

        return;

    }



    





    trace_grlib_gptimer_enable(timer->id, timer->counter + 1);



    ptimer_set_count(timer->ptimer, timer->counter + 1);

    ptimer_run(timer->ptimer, 1);

}

    trace_grlib_gptimer_enable(timer->id, timer->counter + 1);     ptimer_set_count(timer->ptimer, timer->counter + 1);
static void FUNC_0(GPTimer *VAR_0)

{

    assert(VAR_0 != NULL);





    ptimer_stop(VAR_0->ptimer);



    if (!(VAR_0->config & GPTIMER_ENABLE)) {

        

        trace_grlib_gptimer_disabled(VAR_0->id, VAR_0->config);

        return;

    }



    





    trace_grlib_gptimer_enable(VAR_0->id, VAR_0->counter + 1);



    ptimer_set_count(VAR_0->ptimer, VAR_0->counter + 1);

    ptimer_run(VAR_0->ptimer, 1);

}

static void FUNC_0(GPTimer *VAR_0)
{ assert(VAR_0 != NULL); ptimer_stop(VAR_0->ptimer); if (!(VAR_0->config & GPTIMER_ENABLE)) { trace_grlib_gptimer_disabled(VAR_0->id, VAR_0->config); return; } trace_grlib_gptimer_enable(VAR_0->id, VAR_0->counter + 1); ptimer_set_count(VAR_0->ptimer, VAR_0->counter + 1); ptimer_run(VAR_0->ptimer, 1); }