Exemple #1
0
static void rt1052_hwtimer_stop(rt_hwtimer_t *timer)
{
    GPT_Type *hwtimer_dev;
    hwtimer_dev = (GPT_Type *)timer->parent.user_data;

    RT_ASSERT(timer != RT_NULL);

    GPT_StopTimer(hwtimer_dev);
}
Exemple #2
0
/** Set interrupt for specified timestamp
 *
 * @param timestamp The time in ticks to be set
 */
void lp_ticker_set_interrupt(timestamp_t timestamp)
{
    if (timestamp == 0) {
        timestamp = 1;
    }

    GPT_StopTimer(GPT2);
    GPT_SetOutputCompareValue(GPT2, kGPT_OutputCompare_Channel1, timestamp);
    GPT_ClearStatusFlags(GPT2, kGPT_OutputCompare1Flag);
    GPT_EnableInterrupts(GPT2, kGPT_OutputCompare1InterruptEnable);
    GPT_StartTimer(GPT2);
}