/**
 * \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
}
Example #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();
	}
}
Example #3
0
/*! \brief  hw timer compare callback
 */
void tc_cca_callback(void)
{
	tmr_cca_callback();
}
Example #4
0
/*! \brief  hw timer compare callback
 */
static void tc_cca_callback(struct tc_module *const module_instance)
{
	tmr_cca_callback();
}