[beken-72xx] Fix digitalRead() setting wrong pin mode

This commit is contained in:
Kuba Szczodrzyński
2022-09-01 21:13:04 +02:00
parent d30decfbc8
commit 44c1a3f695

View File

@@ -55,7 +55,7 @@ PinStatus digitalRead(pin_size_t pinNumber) {
if (!pin)
return 0;
// pin is not GPIO yet or not INPUT; change the mode
if (!pinEnabled(pin, PIN_GPIO) || !pinIsOutput(pin))
if (!pinEnabled(pin, PIN_GPIO) || !pinIsInput(pin))
pinMode(pinNumber, INPUT);
// read the value
return gpio_input(pin->gpio);