From 1692241b25148af2cf616ceb33e2ba1fa5b56cd4 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 1 Dec 2019 19:03:53 +0100 Subject: [PATCH] Fix lost functionality of GPIO9 and GPIO10 - Remove inconsistent hardware detection introduced in version 7.0.0.5 - Fix lost functionality of GPIO9 and GPIO10 on some devices (#7080) --- tasmota/CHANGELOG.md | 2 ++ tasmota/support.ino | 28 +--------------------------- tasmota/support_command.ino | 5 ++--- 3 files changed, 5 insertions(+), 30 deletions(-) diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 6ce18c917..309ea6e63 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -2,6 +2,8 @@ ### 7.1.1.1 20191201 +- Remove inconsistent hardware detection introduced in version 7.0.0.5 +- Fix lost functionality of GPIO9 and GPIO10 on some devices (#7080) - Change light color schemes 2, 3 and 4 from color wheel to Hue driven ## Released diff --git a/tasmota/support.ino b/tasmota/support.ino index 55c01b71d..1e639494b 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -521,32 +521,6 @@ char* GetPowerDevice(char* dest, uint32_t idx, size_t size) return GetPowerDevice(dest, idx, size, 0); } -bool IsEsp8285(void) -{ - // esptool.py get_efuses - uint32_t efuse1 = *(uint32_t*)(0x3FF00050); - uint32_t efuse2 = *(uint32_t*)(0x3FF00054); -// uint32_t efuse3 = *(uint32_t*)(0x3FF00058); -// uint32_t efuse4 = *(uint32_t*)(0x3FF0005C); - - bool is_8285 = ( (efuse1 & (1 << 4)) || (efuse2 & (1 << 16)) ); - if (is_8285 && (ESP.getFlashChipRealSize() > 1048576)) { - is_8285 = false; // ESP8285 can only have 1M flash - } - return is_8285; -} - -String GetDeviceHardware(void) -{ - char buff[10]; - if (IsEsp8285()) { - strcpy_P(buff, PSTR("ESP8285")); - } else { - strcpy_P(buff, PSTR("ESP8266EX")); - } - return String(buff); -} - float ConvertTemp(float c) { float result = c; @@ -1039,7 +1013,7 @@ uint8_t ValidPin(uint32_t pin, uint32_t gpio) if (FlashPin(pin)) { result = GPIO_NONE; // Disable flash pins GPIO6, GPIO7, GPIO8 and GPIO11 } - if (!IsEsp8285() && !Settings.flag3.user_esp8285_enable) { // SetOption51 - Enable ESP8285 user GPIO's + if ((WEMOS == Settings.module) && !Settings.flag3.user_esp8285_enable) { // SetOption51 - Enable ESP8285 user GPIO's if ((pin == 9) || (pin == 10)) { result = GPIO_NONE; // Disable possible flash GPIO9 and GPIO10 } diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index fe8640045..e5c19c0e0 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -376,10 +376,9 @@ void CmndStatus(void) if ((0 == payload) || (2 == payload)) { Response_P(PSTR("{\"" D_CMND_STATUS D_STATUS2_FIRMWARE "\":{\"" D_JSON_VERSION "\":\"%s%s\",\"" D_JSON_BUILDDATETIME "\":\"%s\",\"" - D_JSON_BOOTVERSION "\":%d,\"" D_JSON_COREVERSION "\":\"" ARDUINO_ESP8266_RELEASE "\",\"" D_JSON_SDKVERSION "\":\"%s\"," - "\"Hardware\":\"%s\"}}"), + D_JSON_BOOTVERSION "\":%d,\"" D_JSON_COREVERSION "\":\"" ARDUINO_ESP8266_RELEASE "\",\"" D_JSON_SDKVERSION "\":\"%s\"}}"), my_version, my_image, GetBuildDateAndTime().c_str(), - ESP.getBootVersion(), ESP.getSdkVersion(), GetDeviceHardware().c_str()); + ESP.getBootVersion(), ESP.getSdkVersion()); MqttPublishPrefixTopic_P(option, PSTR(D_CMND_STATUS "2")); }