Skip to content

Commit

Permalink
[bsp][stm32] fix variable init
Browse files Browse the repository at this point in the history
fix #9525
  • Loading branch information
mysterywolf committed Oct 15, 2024
1 parent 8c1cd39 commit 47d9413
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bsp/stm32/libraries/HAL_Drivers/drivers/drv_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ static rt_err_t stm32_pin_irq_enable(struct rt_device *device, rt_base_t pin,

if (enabled == PIN_IRQ_ENABLE)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};

irqindex = bit2bitno(PIN_STPIN(pin));
if (irqindex < 0 || irqindex >= (rt_int32_t)ITEM_NUM(pin_irq_map))
{
Expand All @@ -417,7 +419,6 @@ static rt_err_t stm32_pin_irq_enable(struct rt_device *device, rt_base_t pin,
}

irqmap = &pin_irq_map[irqindex];
GPIO_InitTypeDef GPIO_InitStruct;

/* Configure GPIO_InitStructure */
GPIO_InitStruct.Pin = PIN_STPIN(pin);
Expand Down

0 comments on commit 47d9413

Please sign in to comment.