External Interrupt Problem.

Hi, I'm trying to get an External Interrupt from my User Button (PB7) on the board (MCBSTM32C). I'm using a sample code i found from the web called; stm32_exti. Even if I clear the interrupt pending bit, I only get the interrupt from the button once. How can i make my program has interrupts anytime i hit the button. Thanks..

The code's like this;

/*---------------------------------------------------------------------------- EXTI9..5 Interrupt Handler for USER button connected to GPIOB.7 *----------------------------------------------------------------------------*/
void EXTI9_5_IRQHandler(void)
{ if (EXTI->PR & (1<<7)) // EXTI0 interrupt pending? { EXTI->PR |= (1<<7); // clear pending interrupt

if ((ledExti ^=1) == 0) GPIOE->ODR &= ~(1 << (ledPosExti+8)); // switch off LED else GPIOE->ODR |= (1 << (ledPosExti+8)); // switch on LED }
}

More questions in this forum