mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
stm32f1/gpio: pin direction readout of gpio_read was invalid
This commit is contained in:
parent
d3558d26b2
commit
4186e38976
@ -170,7 +170,7 @@ int gpio_read(gpio_t pin)
|
||||
GPIO_TypeDef *port = _port(pin);
|
||||
int pin_num = _pin_num(pin);
|
||||
|
||||
if (port->CR[pin_num >> 3] & (0x3 << (pin_num & 0x7))) {
|
||||
if (port->CR[pin_num >> 3] & (0x3 << ((pin_num & 0x7) << 2))) {
|
||||
/* pin is output */
|
||||
return (port->ODR & (1 << pin_num));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user