diff options
Diffstat (limited to 'nuttx/arch/arm')
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_gpio.c | 20 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_start.c | 3 |
2 files changed, 10 insertions, 13 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_gpio.c b/nuttx/arch/arm/src/stm32/stm32_gpio.c index 6787c5777..c514ff954 100644 --- a/nuttx/arch/arm/src/stm32/stm32_gpio.c +++ b/nuttx/arch/arm/src/stm32/stm32_gpio.c @@ -563,9 +563,17 @@ int stm32_configgpio(uint32_t cfgset) putreg32(regval, base + STM32_GPIO_OTYPER_OFFSET); - /* If it is an input pin, hould it configured as an EXTI interrupt? */ + /* 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? */ - if ((cfgset & GPIO_EXTI) != 0) + else if ((cfgset & GPIO_EXTI) != 0) { /* "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 @@ -590,14 +598,6 @@ int stm32_configgpio(uint32_t cfgset) putreg32(regval, regaddr); } - - /* If it is an output... set the pin to the correct initial state. */ - - else if (pinmode == GPIO_MODER_OUTPUT) - { - bool value = ((cfgset & GPIO_OUTPUT_SET) != 0); - stm32_gpiowrite(cfgset, value); - } irqrestore(flags); return OK; diff --git a/nuttx/arch/arm/src/stm32/stm32_start.c b/nuttx/arch/arm/src/stm32/stm32_start.c index 7ac7ac1f9..5434e3429 100644 --- a/nuttx/arch/arm/src/stm32/stm32_start.c +++ b/nuttx/arch/arm/src/stm32/stm32_start.c @@ -78,9 +78,6 @@ * Configure the FPU. The the MCU has an FPU, then enable full access * to coprocessors CP10 and CP11. * - * This is implemented as a macro because the stack has not yet been - * initialized. - * ****************************************************************************/ #ifdef CONFIG_ARCH_FPU |