I have stm32vldiscovery project. I want to use external interrupt by PA0 (user button). When I press the button (PA0), then function EXTI0_IRQHandler must set ldOn equal 0. But ldOn always is 1. Debuger shows what function EXTI0_IRQHandler runned on. ldOn change value to 0, and again stay equal 1. Why? Have this code: main.c
#include "main.h"
...
uint8_t ldOn = 1;
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
HAL_GPIO_WritePin(LD4_GPIO_Port, LD4_Pin, GPIO_PIN_SET);
while (1)
{
if(ldOn == 0)
HAL_GPIO_WritePin(LD4_GPIO_Port, LD4_Pin, GPIO_PIN_RESET);
}
}
it.c
#include "main.h"
...
extern uint8_t ldOn;
void EXTI0_IRQHandler(void)
{
ldOn = 0;
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_0);
}
When I used stm32f4-disc1 board, this construction works perfectly...