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

Merge pull request #8556 from kaspar030/stm32_gpio_read

cpu: stm32_common: always do gpio_read() from input register
This commit is contained in:
Hauke Petersen 2018-03-06 15:30:01 +01:00 committed by GitHub
commit e78b055787
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -203,12 +203,7 @@ void gpio_irq_disable(gpio_t pin)
int gpio_read(gpio_t pin)
{
if (_port(pin)->MODER & (0x3 << (_pin_num(pin) * 2))) {
return _port(pin)->ODR & (1 << _pin_num(pin));
}
else {
return _port(pin)->IDR & (1 << _pin_num(pin));
}
return (_port(pin)->IDR & (1 << _pin_num(pin)));
}
void gpio_set(gpio_t pin)