Skip to main content
PMoop.1
Associate
September 23, 2020
Question

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.

  • September 23, 2020
  • 2 replies
  • 2278 views

..

This topic has been closed for replies.

2 replies

Cristian Gyorgy
Associate II
September 24, 2020

Right, " Some info might help".

PMoop.1
PMoop.1Author
Associate
September 24, 2020

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.