From e46fddf3b703d2761fb0ccb471e719c9afce40a5 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 14 Apr 2020 17:21:39 +0200 Subject: [PATCH] More ESP compatibility --- tasmota/tasmota_template_ESP32.h | 1 - tasmota/xdrv_01_webserver.ino | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tasmota/tasmota_template_ESP32.h b/tasmota/tasmota_template_ESP32.h index 04e18af17..11443826c 100644 --- a/tasmota/tasmota_template_ESP32.h +++ b/tasmota/tasmota_template_ESP32.h @@ -42,7 +42,6 @@ #undef USE_DEEPSLEEP #undef USE_MY92X1 #undef USE_TUYA_MCU -#undef USE_I2C #undef USE_PS_16_DZ /********************************************************************************************/ diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index 5206b701d..178502150 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -1477,7 +1477,6 @@ void HandleTemplateConfiguration(void) WSContentSend_P(PSTR("}1")); // Field separator for (uint32_t i = 0; i < sizeof(cmodule); i++) { // 17,148,29,149,7,255,255,255,138,255,139,255,255 -// if ((i < 6) || ((i > 8) && (i != 11))) { // Ignore flash pins GPIO06, 7, 8 and 11 if (!FlashPin(i)) { WSContentSend_P(PSTR("%s%d"), (i>0)?",":"", cmodule.io[i]); } @@ -1501,7 +1500,6 @@ void HandleTemplateConfiguration(void) "
")); WSContentSend_P(HTTP_TABLE100); for (uint32_t i = 0; i < MAX_GPIO_PIN; i++) { -// if ((i < 6) || ((i > 8) && (i != 11))) { // Ignore flash pins GPIO06, 7, 8 and 11 if (!FlashPin(i)) { WSContentSend_P(PSTR("" D_GPIO "%d"), ((9==i)||(10==i)) ? WebColor(COL_TEXT_WARNING) : WebColor(COL_TEXT), i, (0==i) ? " style='width:200px'" : "", i); @@ -1633,17 +1631,24 @@ void HandleModuleConfiguration(void) for (uint32_t i = 0; i < sizeof(cmodule); i++) { if (ValidGPIO(i, cmodule.io[i])) { snprintf_P(stemp, 3, PINS_WEMOS +i*2); +#ifdef ESP8266 char sesp8285[40]; snprintf_P(sesp8285, sizeof(sesp8285), PSTR("ESP8285"), WebColor(COL_TEXT_WARNING)); WSContentSend_P(PSTR("%s " D_GPIO "%d %s"), (WEMOS==my_module_type)?stemp:"", i, (0==i)? D_SENSOR_BUTTON "1":(1==i)? D_SERIAL_OUT :(3==i)? D_SERIAL_IN :((9==i)||(10==i))? sesp8285 :(12==i)? D_SENSOR_RELAY "1":(13==i)? D_SENSOR_LED "1i":(14==i)? D_SENSOR :"", i); +#else // ESP32 + WSContentSend_P(PSTR("%s " D_GPIO "%d"), + (WEMOS==my_module_type)?stemp:"", i, i); +#endif // ESP8266 } } +#ifdef ESP8266 #ifndef USE_ADC_VCC if (ValidAdc()) { WSContentSend_P(PSTR("%s " D_ADC "0"), (WEMOS==my_module_type)?"A0":""); } #endif // USE_ADC_VCC +#endif // ESP8266 WSContentSend_P(PSTR("")); WSContentSend_P(HTTP_FORM_END); WSContentSpaceButton(BUTTON_CONFIGURATION);