We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I wanna get the signal in transparent mode, for that I use TIM2_CH2 for input capture, however I can't call interrupt.
I added irq handler into main.c
ISR_TIM2_CC(TIM2_CAP_COM) { printf("/\r\n"); if (TIM2_SR1 & 0x04) { // interrupt on rising edge if (!flag){ flag = true; pulse_width = 0; TIM2_SR1 = 0; } else { flag = false; period = ((TIM2_CCR2L | (TIM2_CCR2H << 8)) - period); if (period > 200) { // check if it's not a preamble code = (code << 1) | (pulse_width < period/2) ? 1 : 0; period = 0; TIM2_CCR2H = 0; TIM2_CCR2L = 0; counter++; } else { preamble = (preamble << 1) | 1; } } if (TIM2_SR2) { // overcapture TIM2_SR2 = 0; } } if (TIM2_SR1 & 0x02) { // interrupt on falling edge pulse_width = TIM2_CCR2L | (TIM2_CCR2H << 8); if (counter >= 60) { printf("Preamble: 0x%x\r\n", preamble); printf("Code: 0x%x\r\n", code); counter = 0; } } }
But even I can't display printf
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I wanna get the signal in transparent mode, for that I use TIM2_CH2 for input capture, however I can't call interrupt.
I added irq handler into main.c
But even I can't display printf
The text was updated successfully, but these errors were encountered: