Question
I have a problem with EXTI. I have connected switch with EXTI pin. When the switch is pressed first time it light up the led. But when I pressed the same switch second time it does not light up the led.
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
if(GPIO_Pin == GPIO_PIN_10)
{
Switch10 = 1;
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, GPIO_PIN_SET);
}
if(GPIO_PIN == GPIO_PIN_11)
{
Swtich10 = 0;
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, GPIO_PIN_RESET);
}
}
int main (void)
{
while(1)
{
if(Switch10)
{
Test();
}
}
}