Commit e4c9215e authored by Alexander Potashev's avatar Alexander Potashev
Browse files

RT106080. stm32f2_gpio: Fix setting of GPIOx_OTYPER[i] bits

parent bba92c80
......@@ -214,6 +214,14 @@ s32 stm32f2_gpio_config(const struct stm32f2_gpio_dsc *dsc,
gpio_regs->afr[dsc->pin >> 3] |= af_val[role] << i;
}
i = dsc->pin;
/*
* Output mode configuration
*/
gpio_regs->otyper &= ~(0x1 << i);
gpio_regs->otyper |= otype << i;
i = dsc->pin * 2;
/*
......@@ -222,12 +230,6 @@ s32 stm32f2_gpio_config(const struct stm32f2_gpio_dsc *dsc,
gpio_regs->moder &= ~(0x3 << i);
gpio_regs->moder |= mode << i;
/*
* Output mode configuration
*/
gpio_regs->otyper &= ~(0x3 << i);
gpio_regs->otyper |= otype << i;
/*
* Speed mode configuration
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment