1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

cpu/stm32f3: fixed init_af in GPIO driver

This commit is contained in:
Hauke Petersen 2015-06-15 20:39:34 +02:00
parent 55752ff4f2
commit ad0e9c26b6

View File

@ -155,8 +155,8 @@ void gpio_init_af(gpio_t pin, gpio_af_t af)
port->MODER &= ~(3 << (2 * pin_num));
port->MODER |= (2 << (2 * pin_num));
/* set selected function */
port->AFR[pin_num & 0x10] &= ~(0xf << ((pin_num & 0x0f) * 4));
port->AFR[pin_num & 0x10] |= (af << ((pin_num & 0x0f) * 4));
port->AFR[(pin_num > 7) ? 1 : 0] &= ~(0xf << ((pin_num & 0x07) * 4));
port->AFR[(pin_num > 7) ? 1 : 0] |= (af << ((pin_num & 0x07) * 4));
}
void gpio_irq_enable(gpio_t pin)