You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fw/drivers/sf32lb52/exti: optimize interrupt handling and remove GPIO2 support
Optimize GPIO1_IRQHandler to prevent interrupt storms that were blocking
other tasks (e.g. I2C). The handler now only checks pending interrupts
across GPIO1's 3 banks (78 pins) using ISR & IER masking and __builtin_ctz
for efficient bit scanning, instead of iterating through all pins.
Move NVIC configuration from exti_enable() to exti_configure_pin() so the
interrupt controller is configured once during setup rather than on every
enable call.
Fix register write operations for IESR/IECR (interrupt enable set/clear
registers) by using direct assignment instead of read-modify-write, as
these are write-only registers.
Add ISR clearing in exti_disable() to prevent stale interrupts from firing
after a line is disabled.
Remove all GPIO2 support as it is unused - this simplifies the driver and
removes conditional logic from prv_gpio_get_instance(), prv_insert_handler(),
prv_delete_handler(), exti_enable(), exti_disable(), and removes the
GPIO2_IRQHandler entirely.
Signed-off-by: Joshua Jun <[email protected]>
0 commit comments