From 46cbe13e9b68d2e872b79b22c709cbedcfe42116 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 25 Sep 2020 18:34:14 +0200 Subject: [PATCH] Fix ESP32 compilation --- tasmota/support.ino | 2 ++ tasmota/support_tasmota.ino | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tasmota/support.ino b/tasmota/support.ino index 399912f78..e23b4519b 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -1119,6 +1119,7 @@ int ResponseJsonEndEnd(void) * GPIO Module and Template management \*********************************************************************************************/ +#ifdef ESP8266 uint16_t GpioConvert(uint8_t gpio) { if (gpio > ARRAY_SIZE(kGpioConvert)) { return AGPIO(GPIO_USER); @@ -1142,6 +1143,7 @@ void TemplateConvert(uint8_t template8[], uint16_t template16[]) { } template16[(sizeof(mytmplt) / 2) -2] = Adc0Convert(template8[sizeof(mytmplt8285) -1]); } +#endif // ESP8266 uint32_t ICACHE_RAM_ATTR Pin(uint32_t gpio, uint32_t index = 0); uint32_t ICACHE_RAM_ATTR Pin(uint32_t gpio, uint32_t index) { diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index e241a9bb2..43e4ce548 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -1476,11 +1476,13 @@ void GpioInit(void) // AddLog_P2(LOG_LEVEL_DEBUG, PSTR("DBG: Used GPIOs %d"), GPIO_SENSOR_END); +#ifdef ESP8266 if (Settings.user_template8.flag != 255) { // Convert 8-bit user template TemplateConvert((uint8_t*)&Settings.user_template8, (uint16_t*)&Settings.user_template); Settings.user_template8.flag = 255; } +#endif // ESP8266 for (uint32_t i = 0; i < ARRAY_SIZE(Settings.user_template.gp.io); i++) { if ((Settings.user_template.gp.io[i] >= AGPIO(GPIO_SENSOR_END)) && (Settings.user_template.gp.io[i] < AGPIO(GPIO_USER))) {