Apply same STM32 patch to STM32 F7

This commit is contained in:
Gregory Nutt 2016-06-17 06:40:04 -06:00
parent 794a64a99b
commit 9b55cc6bfe
1 changed files with 2 additions and 9 deletions

View File

@ -182,6 +182,7 @@ int stm32_configgpio(uint32_t cfgset)
break; break;
case GPIO_OUTPUT: /* General purpose output mode */ case GPIO_OUTPUT: /* General purpose output mode */
stm32_gpiowrite(cfgset, (cfgset & GPIO_OUTPUT_SET) != 0); /* Set the initial output value */
pinmode = GPIO_MODER_OUTPUT; pinmode = GPIO_MODER_OUTPUT;
break; break;
@ -311,17 +312,9 @@ int stm32_configgpio(uint32_t cfgset)
putreg32(regval, base + STM32_GPIO_OTYPER_OFFSET); putreg32(regval, base + STM32_GPIO_OTYPER_OFFSET);
/* If it is an output... set the pin to the correct initial state. */
if (pinmode == GPIO_MODER_OUTPUT)
{
bool value = ((cfgset & GPIO_OUTPUT_SET) != 0);
stm32_gpiowrite(cfgset, value);
}
/* Otherwise, it is an input pin. Should it configured as an EXTI interrupt? */ /* Otherwise, it is an input pin. Should it configured as an EXTI interrupt? */
else if ((cfgset & GPIO_EXTI) != 0) if (pinmode != GPIO_MODER_OUTPUT && (cfgset & GPIO_EXTI) != 0)
{ {
/* "In STM32 F1 the selection of the EXTI line source is performed through /* "In STM32 F1 the selection of the EXTI line source is performed through
* the EXTIx bits in the AFIO_EXTICRx registers, while in F2 series this * the EXTIx bits in the AFIO_EXTICRx registers, while in F2 series this