1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

stm32f1: fix gpio mode GPIO_IN_PU

This commit is contained in:
Tristan Bruns 2018-01-12 10:27:09 +01:00
parent f6a5f36e18
commit d4de629c34

View File

@ -90,6 +90,12 @@ int gpio_init(gpio_t pin, gpio_mode_t mode)
port->CR[pin_num >> 3] &= ~(0xf << ((pin_num & 0x7) * 4));
port->CR[pin_num >> 3] |= ((mode & MODE_MASK) << ((pin_num & 0x7) * 4));
/* set ODR */
if (mode == GPIO_IN_PU)
port->ODR |= 1 << pin_num;
else
port->ODR &= ~(1 << pin_num);
return 0; /* all OK */
}