cancel
Showing results for 
Search instead for 
Did you mean: 

I'm trying to add multiple interrupts on the same port (portD) on my stm8s003f3. I'm not able to attach the second interrupt to the ext interrupt handler function. Some info might help.

PMoop.1
Associate II
 
2 REPLIES 2
Cristian Gyorgy
Senior III

Right, " Some info might help".

Here it is in stm8_it.c

INTERRUPT_HANDLER(EXTI_PORTB_IRQHandler, 4)

{

 /* In order to detect unexpected events during development,

   it is recommended to set a breakpoint on the following instruction.

 */

 if((GPIOD->IDR & GPIO_PIN_3)!=0){

  state = TRUE;

 } else

 {

   state = FALSE;

 }

}

This is how it's setup now for Pin 3 of PortD for interrupt. I want to add another interrupt to the same Port D at Pin 4.

I did a bitwise OR for these two pins if((GPIOD->IDR & GPIO_PIN_3) !=0 || (GPIOD->IDR & GPIO_PIN_4) !=0) ) but there's no result.