Skip to content

Commit 47d9413

Browse files
committed
[bsp][stm32] fix variable init
fix #9525
1 parent 8c1cd39 commit 47d9413

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bsp/stm32/libraries/HAL_Drivers/drivers/drv_gpio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ static rt_err_t stm32_pin_irq_enable(struct rt_device *device, rt_base_t pin,
402402

403403
if (enabled == PIN_IRQ_ENABLE)
404404
{
405+
GPIO_InitTypeDef GPIO_InitStruct = {0};
406+
405407
irqindex = bit2bitno(PIN_STPIN(pin));
406408
if (irqindex < 0 || irqindex >= (rt_int32_t)ITEM_NUM(pin_irq_map))
407409
{
@@ -417,7 +419,6 @@ static rt_err_t stm32_pin_irq_enable(struct rt_device *device, rt_base_t pin,
417419
}
418420

419421
irqmap = &pin_irq_map[irqindex];
420-
GPIO_InitTypeDef GPIO_InitStruct;
421422

422423
/* Configure GPIO_InitStructure */
423424
GPIO_InitStruct.Pin = PIN_STPIN(pin);

0 commit comments

Comments
 (0)