From a30fc96c59ee13b5cd721b61b370f003ce7cf8b3 Mon Sep 17 00:00:00 2001 From: Fergus Noble Date: Wed, 21 Mar 2012 20:19:36 -0700 Subject: Revert "Fix setting alternate port functions on the STM32F2." This was also fixed in ac29b654a992a4855626fc0b92874d3847914f85 in a different way. I think the mask definition should be left with 1s indicating the bits of interest. See also 87ea496ca768d18e51d8654cbad9cb261a881b1b. This reverts commit 2433f17e7341d6afcda24d395d0b93c50a37b7b1. --- include/libopencm3/stm32/f2/gpio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libopencm3/stm32/f2/gpio.h b/include/libopencm3/stm32/f2/gpio.h index 63d2880..1a9fd0f 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 -- cgit v1.2.3