AnsweredAssumed Answered

How to handle a same external interrupt occurred from different sources in cortex-M4

Question asked by Braj Nandan Singh Jadon on Mar 9, 2018
Latest reply on Mar 9, 2018 by Tilen MAJERLE

Hello,

 

I am working on STM32f429ii controller, I want to used a interrupt from different sources say EXTI2, this interrupt can be activated for PH2 and PB2 so I was thinking to use this like,

 

void EXTI2_IRQHandler(void)
{

          if( !HAL_GPIO_ReadPin(GPIOH, GPIO_PIN_2)){                         //  Low level triggered interrupt

                           // if interrupt from this pin Do something

          }

          elseif( !HAL_GPIO_ReadPin( GPIOB, GPIO_PIN_2)){

                          //   if interrupt from this pin DO someting                          //its from keyboard so it can wait

           }

}

 

My question is can we use more then one pin for same interrupt, if yes then my code will work. if not what then what should I do. I don't have any free pins.

I can't use a timer interrupt as it may destroy other critical tasks and main already have other time consuming stuff.

Outcomes