mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 17:27:45 +01:00
Fix ESP8266 dallas GPIO16 INPUT_PULLUP (#2581)
This commit is contained in:
parent
eae3d72a4d
commit
ab07ee57c6
1 changed files with 7 additions and 0 deletions
|
@ -50,6 +50,13 @@ void ESP8266GPIOPin::pin_mode(gpio::Flags flags) {
|
||||||
mode = OUTPUT;
|
mode = OUTPUT;
|
||||||
} else if (flags == (gpio::FLAG_INPUT | gpio::FLAG_PULLUP)) {
|
} else if (flags == (gpio::FLAG_INPUT | gpio::FLAG_PULLUP)) {
|
||||||
mode = INPUT_PULLUP;
|
mode = INPUT_PULLUP;
|
||||||
|
if (pin_ == 16) {
|
||||||
|
// GPIO16 doesn't have a pullup, so pinMode would fail.
|
||||||
|
// However, sometimes this method is called with pullup mode anyway
|
||||||
|
// for example from dallas one_wire. For those cases convert this
|
||||||
|
// to a INPUT mode.
|
||||||
|
mode = INPUT;
|
||||||
|
}
|
||||||
} else if (flags == (gpio::FLAG_INPUT | gpio::FLAG_PULLDOWN)) {
|
} else if (flags == (gpio::FLAG_INPUT | gpio::FLAG_PULLDOWN)) {
|
||||||
mode = INPUT_PULLDOWN_16;
|
mode = INPUT_PULLDOWN_16;
|
||||||
} else if (flags == (gpio::FLAG_OUTPUT | gpio::FLAG_OPEN_DRAIN)) {
|
} else if (flags == (gpio::FLAG_OUTPUT | gpio::FLAG_OPEN_DRAIN)) {
|
||||||
|
|
Loading…
Reference in a new issue