diff --git a/cpu/stm32_common/periph/gpio.c b/cpu/stm32_common/periph/gpio.c index bd5db19cc5..7aa0eaba3b 100644 --- a/cpu/stm32_common/periph/gpio.c +++ b/cpu/stm32_common/periph/gpio.c @@ -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)