aboutsummaryrefslogtreecommitdiff
path: root/include/libopencm3/stm32/f4
diff options
context:
space:
mode:
authorGareth McMullin2012-01-07 16:58:23 +1300
committerPiotr Esden-Tempski2012-02-12 15:00:09 -0800
commite11185d47d0a2fea6d2782761edd5fd489541512 (patch)
tree158a4145fcd04318c75061cd8068b1c1db4d4575 /include/libopencm3/stm32/f4
parent7da1967056c1cdba2b37c57015451224605a8a65 (diff)
Fix setting alternate port functions on the STM32F4.
Thanks to Ricardo Martins.
Diffstat (limited to 'include/libopencm3/stm32/f4')
-rw-r--r--include/libopencm3/stm32/f4/gpio.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/libopencm3/stm32/f4/gpio.h b/include/libopencm3/stm32/f4/gpio.h
index 3fe564e..20901d0 100644
--- a/include/libopencm3/stm32/f4/gpio.h
+++ b/include/libopencm3/stm32/f4/gpio.h
@@ -232,7 +232,7 @@
/* See Datasheet Table 6 (pg. 48) for alternate function mappings. */
#define GPIO_AFR(n, af) (af << ((n) * 4))
-#define GPIO_AFR_MASK(n) (0xf << ((n) * 4))
+#define GPIO_AFR_MASK(n) ~(0xf << ((n) * 4))
#define GPIO_AF0 0x0
#define GPIO_AF1 0x1
#define GPIO_AF2 0x2