Generate Software Interrupt (SI) with STM32F· Discovery board with HAL drivers
Hi,
I don’t understand the use of your waiting loop in EXTI2_TSC_IRQHandler: you will just wait for a few microseconds, or even less, before setting delay_SI to 200. Where did you see a 200ms delay?
According to your code, you toggle GPIO1 every millisecond, and GPIO10 and GPIO2 every 100ms (the first two in the callback, the last in the software generated interrupt handler, which is triggered every 100ms). If you want GPIO2 to be toggled every 200ms you should have a static counter in the SW handler, and only toggle GPIO2 when it is equal to 2 (then reset it to 0).
Bernard (Ac6)