aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGareth McMullin2012-01-07 18:59:18 +1300
committerPiotr Esden-Tempski2012-02-12 15:00:09 -0800
commit2433f17e7341d6afcda24d395d0b93c50a37b7b1 (patch)
tree2a711de23bcdab05ad2d5f48a3ac417dbd5b699a
parent03e44e91e31a5c26b82a5d8be7de91d489bb7a87 (diff)
Fix setting alternate port functions on the STM32F2.
Thanks to Ricardo Martins.
-rw-r--r--include/libopencm3/stm32/f2/gpio.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/libopencm3/stm32/f2/gpio.h b/include/libopencm3/stm32/f2/gpio.h
index 5e0377d..1c33e44 100644
--- a/include/libopencm3/stm32/f2/gpio.h
+++ b/include/libopencm3/stm32/f2/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