diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index 0461104e5..4d1919c86 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -1,5 +1,6 @@ /* 6.4.1.17 20190214 * Change template update by removing possibility to add user module config keeping template as defined (#5222) + * Fix regression from 6.4.1.16 where GPIO9 and GPIO10 connected devices did not work (#5197) * * 6.4.1.16 20190211 * Initial support for online template change using command Template or GUI Configure Other (#5177) diff --git a/sonoff/support.ino b/sonoff/support.ino index 80c1c53e3..f03c131ef 100644 --- a/sonoff/support.ino +++ b/sonoff/support.ino @@ -769,32 +769,19 @@ void SetModuleType() uint8_t ValidPin(uint8_t pin, uint8_t gpio) { uint8_t result = gpio; - if ((pin > 5) && (pin < 12)) { - result = GPIO_NONE; // Disable all flash pins + + if (((pin > 5) && (pin < 9)) || (11 == pin)) { + result = GPIO_NONE; // Disable flash pins GPIO6, GPIO7, GPIO8 and GPIO11 } - if (Settings.flag3.user_esp8285_enable) { - if ((pin == 9) || (pin == 10)) { - result = gpio; // Allow optional flash pins - } + if ((WEMOS == Settings.module) && (!Settings.flag3.user_esp8285_enable)) { + if ((pin == 9) || (pin == 10)) { result = GPIO_NONE; } // Disable possible flash GPIO9 and GPIO10 } return result; } bool ValidGPIO(uint8_t pin, uint8_t gpio) { - bool result = false; -/* - // Version 6.4.1.16 - Use user module config in template - if (USER_MODULE == Settings.module) { - result = (ValidPin(pin, gpio) > GPIO_NONE); // Allow any pin - } else { - result = (GPIO_USER == ValidPin(pin, gpio)); // Only allow GPIO_USER pins - } -*/ - // Version 6.4.1.17 - Use template as defined - result = (GPIO_USER == ValidPin(pin, gpio)); // Only allow GPIO_USER pins - - return result; + return (GPIO_USER == ValidPin(pin, gpio)); // Only allow GPIO_USER pins } bool GetUsedInModule(uint8_t val, uint8_t *arr)