2014-11-01 10:32 AM
Hi Guys,
I have written a handler for an external IR beeing executed on a STM32F107 controller. It looks like this: void EXTI9_5_IRQHandler(void) { //TEST GPIOE->BSRR = GPIO_Pin_9; //set PE9 works fine GPIOE->BRR = GPIO_Pin_9; //clear PE9 works fine if( (EXTI->IMR & EXTI_IMR_MR8) && (EXTI->PR & EXTI_PR_PR8)) { EXTI_ClearITPendingBit(EXTI_Line8); GPIOE->BSRR = GPIO_Pin_9; //TEST does not work if (GPIOA->ODR & GPIO_Pin_8) //PA8 is set { if (GPIOE->ODR & GPIO_Pin_8) { SetLED1(); } else { GPIOE->BSRR = GPIO_Pin_9; //set PE9 doesn't work } } else { GPIOE->BRR = GPIO_Pin_9; //clear PE9 GPIO_ResetBits() } } } I use Keil µVision 5.11.1.0 Lite version. I wonder, why I cannot set PE9 by the command GPIOE->BRR = GPIO_Pin_9; in the code above. I a afraid, that it is some kind of compiler problem and it is simply removing the important part of the code. I decide, wether the code is working by looking at the GPIOE Peripherals view in Debug mode. Thanks for your hints2014-11-01 03:21 PM
I a afraid, that it is some kind of compiler problem and it is simply removing the important part of the code.
Because that would be infinitely more probable than a failure in your logic? Suggest you review what the registers actually contain as it enters.