[bsp][stm32] fix variable init
fix https://github.com/RT-Thread/rt-thread/pull/9525
This commit is contained in:
parent
8c1cd39d80
commit
47d941388b
|
@ -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))
|
||||
{
|
||||
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue