Fixed gpio_primary_remap; swjdisable is pre-shifted and therefore needs to be u32.

This commit is contained in:
Vegard Storheil Eriksen 2013-02-26 13:49:42 +01:00
parent 1e1859e8c7
commit bc853e7ebd
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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);
}
/*-----------------------------------------------------------------------------*/