Bug in HAL_GPIO_DeInit(...) FW_H7 V1.4.0 for EXTI - Wrong Interrupt Pin De-Initialized
I noted that when I call HAL_GPIO_DeInit is called (stm32h7xx_hal_gpio.c v1.4.0) the wrong External Interrupt get's de-initialized. After investigating further and comparing to the previous version I noted the following in the external interrupt de-init block: Everywhere the pin mask:
0x0FUL << (8U * (position & 0x03U))
appears, it should be changed to:
0x0FUL << (4U * (position & 0x03U))
like it was originally.
/*------------------------- EXTI Mode Configuration --------------------*/
/* Clear the External Interrupt or Event for the current IO */
tmp = SYSCFG->EXTICR[position >> 2U];
tmp &= (0x0FUL << (8U * (position & 0x03U))); // <-- Incorrect Here
if (tmp == (GPIO_GET_INDEX(GPIOx) << (8U * (position & 0x03U)))) // <-- Incorrect Here
{
tmp = 0x0FUL << (8U * (position & 0x03U)); // <-- Incorrect Here
SYSCFG->EXTICR[position >> 2U] &= ~tmp;
/* Clear EXTI line configuration for Current CPU */
EXTI_CurrentCPU->IMR1 &= ~(iocurrent);
EXTI_CurrentCPU->EMR1 &= ~(iocurrent);
/* Clear Rising Falling edge configuration */
EXTI->RTSR1 &= ~(iocurrent);
EXTI->FTSR1 &= ~(iocurrent);
}
