Question
I am writing AC Dimming code with Zero cross detection as an External interrupt but it is not working as expected.
#include "main.h"
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
while (1)
{
}
}
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
if(GPIO_Pin == GPIO_PIN_9) // If The INT Source Is EXTI Line9 (A9 Pin)
{
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_10); // Toggle The Output (LED) Pin
}
}