aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen2013-02-26 13:49:42 +0100
committerVegard Storheil Eriksen2013-02-26 13:49:42 +0100
commitbc853e7ebddf0cbe9abce161afcb0c0ee02c2567 (patch)
tree0da98b2dd857d53cb4587529e41d20edc91d651a
parent1e1859e8c708ff47869a33d21ee3c7ac457f18c0 (diff)
Fixed gpio_primary_remap; swjdisable is pre-shifted and therefore needs to be u32.
-rw-r--r--include/libopencm3/stm32/f1/gpio.h2
-rw-r--r--lib/stm32/f1/gpio.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/libopencm3/stm32/f1/gpio.h b/include/libopencm3/stm32/f1/gpio.h
index 580c501..1e97b73 100644
--- a/include/libopencm3/stm32/f1/gpio.h
+++ b/include/libopencm3/stm32/f1/gpio.h
@@ -929,7 +929,7 @@ BEGIN_DECLS
void gpio_set_mode(u32 gpioport, u8 mode, u8 cnf, u16 gpios);
void gpio_set_eventout(u8 evoutport, u8 evoutpin);
-void gpio_primary_remap(u8 swjenable, u32 maps);
+void gpio_primary_remap(u32 swjenable, u32 maps);
void gpio_secondary_remap(u32 maps);
END_DECLS
diff --git a/lib/stm32/f1/gpio.c b/lib/stm32/f1/gpio.c
index 2b33cad..cbb6b9d 100644
--- a/lib/stm32/f1/gpio.c
+++ b/lib/stm32/f1/gpio.c
@@ -162,9 +162,9 @@ value cannot be ascertained from the hardware.
@ref afio_remap_usart3. For connectivity line devices only @ref afio_remap_cld are
also available.
*/
-void gpio_primary_remap(u8 swjdisable, u32 maps)
+void gpio_primary_remap(u32 swjdisable, u32 maps)
{
- AFIO_MAPR |= swjdisable | (maps & 0x1FFFFF);
+ AFIO_MAPR |= (swjdisable & AFIO_MAPR_SWJ_MASK) | (maps & 0x1FFFFF);
}
/*-----------------------------------------------------------------------------*/