AnsweredAssumed Answered

STM32F407 - External interrupt PD4 (Only LL)

Question asked by Pilous Droip on Nov 9, 2017

Hi friend.

 

I try create program working with external interrupt. And I have a problem. Interrupt never work....

 

int8_t InitPin(void)
{

LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_GPIOD);
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SYSCFG);
LL_GPIO_SetPinMode(GPIOD, LL_GPIO_PIN_4, LL_GPIO_MODE_INPUT);
LL_GPIO_SetPinPull(GPIOD, LL_GPIO_PIN_4, LL_GPIO_PULL_UP);

NVIC_EnableIRQ(EXTI4_IRQn);

SYSCFG->EXTICR[1] &= SYSCFG_EXTICR2_EXTI4_PD;

LL_EXTI_EnableFallingTrig_0_31(LL_EXTI_LINE_4);
LL_EXTI_EnableIT_0_31(LL_EXTI_LINE_4);

NVIC_SetPriority(EXTI4_IRQn,0);
NVIC_ClearPendingIRQ(EXTI4_IRQn);
NVIC_EnableIRQ(EXTI4_IRQn);

/* LED out PIN */
LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_GPIOD);
LL_GPIO_SetPinMode(GPIOD,LL_GPIO_PIN_14,LL_GPIO_MODE_OUTPUT);

return 0;
}

 

void EXTI4_IRQHandler (void)
{


LL_GPIO_TogglePin(GPIOD,LL_GPIO_PIN_14);

//LL_EXTI_ClearFlag_0_31(LL_EXTI_LINE_4);
NVIC_ClearPendingIRQ(EXTI4_IRQn);

}

 

Any idea, what is wrong??? Thank you

Outcomes