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

Merge pull request #3203 from haukepetersen/fix_f4_gpio

cpu/stm32f4: fix init_af in GPIO driver
This commit is contained in:
Peter Kietzmann 2015-06-16 08:05:14 +02:00
commit 9304d5a893

View File

@ -152,8 +152,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)