Created
July 26, 2014 01:49
-
-
Save patrickelectric/015fc641f5bed6a9d402 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void EXTI9_5_IRQHandler() | |
{ | |
EXTI_ClearITPendingBit(EXTI_LINE); // clear interrupt | |
int pulse_width = TIM_GetCounter(TIM2) - PULSE_INTERVAL; | |
if(pulse_width > SYNC_WIDTH) //sync pulse | |
channel_index = 0; | |
else { | |
if(channel_index < NUM_OF_CHANNELS) { | |
channels[channel_index] = pulse_width; | |
channel_index++; | |
} | |
} | |
TIM_SetCounter(TIM2, 0); | |
/* | |
char str[64]={}; | |
sprintf(str, "INT--------------------------------%d,%d,%d,%d\n\r",channels[0],channels[1],channels[2],channels[3] ); | |
c_common_usart_puts(USART2, str); | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment