/**
 * \brief callback for tmr interrupt
 */
void tc_callback(void)
{
    uint32_t ul_status;
    /* Read TC0 Status. */
    ul_status = tc_get_status(TIMER, TIMER_CHANNEL_ID);
    ul_status &= tc_get_interrupt_mask(TIMER, TIMER_CHANNEL_ID);
#if SAM4E
    if (TC_SR_CPAS == (ul_status & TC_SR_CPAS)) {
        tmr_cca_callback();
    }

    if (TC_SR_CPCS == (ul_status & TC_SR_CPCS)) {
        tmr_ovf_callback();
    }

#else
    if (TC_SR_CPCS == (ul_status & TC_SR_CPCS)) {
        tmr_cca_callback();
    }

    /* Overflow */
    if (TC_SR_COVFS == (ul_status & TC_SR_COVFS)) {
        tmr_ovf_callback();
    }
#endif
}
Beispiel #2
0
__interrupt
#endif
static void tc1_callback(void)
{
	uint32_t status = tc_read_sr(TIMER, TIMER_CHANNEL_ID);
	status &= tc_get_interrupt_settings(TIMER, TIMER_CHANNEL_ID);

	if ((status & AVR32_TC_IDR2_COVFS_MASK) == AVR32_TC_IDR2_COVFS_MASK) {
		tmr_ovf_callback();
	}

	if ((status & AVR32_TC_IDR2_CPCS_MASK) == AVR32_TC_IDR2_CPCS_MASK) {
		tmr_cca_callback();
	}
}
Beispiel #3
0
/*! \brief  hw timer overflow callback
 */
void tc_ovf_callback(void)
{
	tmr_ovf_callback();
}
Beispiel #4
0
static void tc_ovf_callback(struct tc_module *const module_instance)
{
	tmr_ovf_callback();
}