Beispiel #1
0
/**
 * \brief Interrupt handler for the TC TC_CHANNEL_CAPTURE
 */
void TC_Handler(void)
{
	if ((tc_get_status(TC, TC_CHANNEL_CAPTURE) & TC_SR_LDRBS) == TC_SR_LDRBS) {
		gs_ul_captured_pulses++;
		gs_ul_captured_ra = tc_read_ra(TC, TC_CHANNEL_CAPTURE);
		gs_ul_captured_rb = tc_read_rb(TC, TC_CHANNEL_CAPTURE);
	}
}
Beispiel #2
0
void TC_FREQ_HANDLER(void){
	if ((tc_get_status(TC0, TC_CHANNEL_CAP_FREQ) & TC_SR_LDRBS) == TC_SR_LDRBS) {
		capture_rb_freq = tc_read_rb(TC0, TC_CHANNEL_CAP_FREQ);
		
		hallA = 1;
		if (hallB){
			flag_neg = 0;
		}
	}
}
Beispiel #3
0
void TC_DUTY_HANDLER(void){
	if ((tc_get_status(TC1, TC_CHANNEL_CAP_DUTY) & TC_SR_LDRBS) == TC_SR_LDRBS) {
		capture_ra_duty = tc_read_ra(TC1, TC_CHANNEL_CAP_DUTY);
		capture_rb_duty = tc_read_rb(TC1, TC_CHANNEL_CAP_DUTY);
	}
}