summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/stm32/stm32_gpio.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-12-30 14:54:43 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-12-30 14:54:43 +0000
commitb3aa316f2e4affe5e17c50a178e6c25c08be30c5 (patch)
tree5049d401a207143ebb88ae56dc470424168093c5 /nuttx/arch/arm/src/stm32/stm32_gpio.c
parente20ee86ffd4d06095641bcecd3dfb0f91552eb89 (diff)
downloadpx4-nuttx-b3aa316f2e4affe5e17c50a178e6c25c08be30c5.tar.gz
px4-nuttx-b3aa316f2e4affe5e17c50a178e6c25c08be30c5.tar.bz2
px4-nuttx-b3aa316f2e4affe5e17c50a178e6c25c08be30c5.zip
STM32 GPIO fix; Fixes for PIC32 USB term example
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4241 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/stm32/stm32_gpio.c')
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_gpio.c20
1 files changed, 10 insertions, 10 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;