diff --git a/tasmota/settings.h b/tasmota/settings.h index 6df543660..17229145a 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -424,13 +424,13 @@ struct { SysBitfield3 flag3; // 3A0 uint8_t switchmode[MAX_SWITCHES]; // 3A4 (6.0.0b - moved from 0x4CA) -//#ifdef ESP8266 // char ex_friendlyname[4][33]; // 3AC // char ex_switch_topic[33]; // 430 -//#else // ESP32 + myio my_gp; // 3AC - 2 x 18 bytes (ESP8266) / 2 x 40 bytes (ESP32) #ifdef ESP8266 - uint8_t free_esp8266_3D0[44]; // 3D0 + uint16_t gpio16_converted; // 3D0 + uint8_t free_esp8266_3D2[42]; // 3D2 #endif mytmplt user_template; // 3FC - 2 x 15 bytes (ESP8266) / 2 x 37 bytes (ESP32) #ifdef ESP8266 @@ -455,12 +455,12 @@ struct { uint8_t ws_width[3]; // 481 #ifdef ESP8266 - myio8 my_gp8; // 484 - 17 bytes (ESP8266) + myio8 ex_my_gp8; // 484 - 17 bytes (ESP8266) - free once gpio16 is active #else // ESP32 uint8_t free_esp32_484[17]; // 484 #endif // ESP8266 - ESP32 + uint8_t ex_my_adc0; // 495 free once gpio16 is active - uint8_t my_adc0; // 495 uint16_t light_pixels; // 496 uint8_t light_color[5]; // 498 uint8_t light_correction; // 49D @@ -514,7 +514,7 @@ struct { char user_template_name[15]; // 720 15 bytes - Backward compatibility since v8.2.0.3 #ifdef ESP8266 - mytmplt8285 user_template8; // 72F 14 bytes (ESP8266) + mytmplt8285 ex_user_template8; // 72F 14 bytes (ESP8266) - free once gpio16 is active #else // ESP32 uint8_t free_esp32_72f[14]; // 72F #endif // ESP8266 - ESP32 diff --git a/tasmota/settings.ino b/tasmota/settings.ino index 767cc9ed8..66c1c6712 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -1193,8 +1193,8 @@ void SettingsDelta(void) } } for (uint32_t i = 0; i < ARRAY_SIZE(Settings.my_gp.io); i++) { - if (Settings.my_gp8.io[i] >= GPI8_SWT5) { // Move up from GPIO_SWT5 to GPIO_KEY1 - Settings.my_gp8.io[i] += 4; + if (Settings.ex_my_gp8.io[i] >= GPI8_SWT5) { // Move up from GPI8_SWT5 to GPI8_KEY1 + Settings.ex_my_gp8.io[i] += 4; } } } @@ -1259,7 +1259,7 @@ void SettingsDelta(void) Settings.ledmask = APP_LEDMASK; } if (Settings.version < 0x0605000A) { - Settings.my_adc0 = GPIO_NONE; + Settings.ex_my_adc0 = GPIO_NONE; } if (Settings.version < 0x0605000D) { Settings.param[P_IR_UNKNOW_THRESHOLD] = IR_RCV_MIN_UNKNOWN_SIZE; diff --git a/tasmota/support.ino b/tasmota/support.ino index 892bedd0f..413747f7f 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -1143,36 +1143,32 @@ void TemplateConvert(uint8_t template8[], uint16_t template16[]) { } template16[(sizeof(mytmplt) / 2) -2] = Adc0Convert(template8[sizeof(mytmplt8285) -1]); - AddLog_P2(LOG_LEVEL_DEBUG, PSTR("FNC: TemplateConvert")); - AddLogBuffer(LOG_LEVEL_DEBUG, template8, sizeof(mytmplt8285)); - AddLogBufferSize(LOG_LEVEL_DEBUG, (uint8_t*)template16, sizeof(mytmplt) / 2, 2); +// AddLog_P2(LOG_LEVEL_DEBUG, PSTR("FNC: TemplateConvert")); +// AddLogBuffer(LOG_LEVEL_DEBUG, template8, sizeof(mytmplt8285)); +// AddLogBufferSize(LOG_LEVEL_DEBUG, (uint8_t*)template16, sizeof(mytmplt) / 2, 2); } void ConvertGpios(void) { - if (Settings.user_template8.flag != 255) { + if (Settings.gpio16_converted != 0xF5A0) { // Convert 8-bit user template - TemplateConvert((uint8_t*)&Settings.user_template8, (uint16_t*)&Settings.user_template); - Settings.user_template8.flag = 255; + TemplateConvert((uint8_t*)&Settings.ex_user_template8, (uint16_t*)&Settings.user_template); - for (uint32_t i = 0; i < sizeof(Settings.my_gp8.io); i++) { - Settings.my_gp.io[i] = GpioConvert(Settings.my_gp8.io[i]); + for (uint32_t i = 0; i < sizeof(Settings.ex_my_gp8.io); i++) { + Settings.my_gp.io[i] = GpioConvert(Settings.ex_my_gp8.io[i]); } - Settings.my_gp.io[(sizeof(myio) / 2) -1] = Adc0Convert(Settings.my_adc0); + Settings.my_gp.io[(sizeof(myio) / 2) -1] = Adc0Convert(Settings.ex_my_adc0); + Settings.gpio16_converted = 0xF5A0; - AddLog_P2(LOG_LEVEL_DEBUG, PSTR("FNC: ConvertGpios")); - AddLogBuffer(LOG_LEVEL_DEBUG, (uint8_t *)&Settings.my_gp8.io, sizeof(myio8)); - AddLogBufferSize(LOG_LEVEL_DEBUG, (uint8_t *)&Settings.my_gp.io, sizeof(myio) / 2, 2); +// AddLog_P2(LOG_LEVEL_DEBUG, PSTR("FNC: ConvertGpios")); +// AddLogBuffer(LOG_LEVEL_DEBUG, (uint8_t *)&Settings.ex_my_gp8.io, sizeof(myio8)); +// AddLogBufferSize(LOG_LEVEL_DEBUG, (uint8_t *)&Settings.my_gp.io, sizeof(myio) / 2, 2); } } #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) { -//#ifdef ESP8266 -// uint16_t real_gpio = gpio + index; -//#else // ESP32 uint16_t real_gpio = (gpio << 5) + index; -//#endif // ESP8266 - ESP32 for (uint32_t i = 0; i < ARRAY_SIZE(gpio_pin); i++) { if (gpio_pin[i] == real_gpio) { return i; // Pin number configured for gpio @@ -1289,20 +1285,15 @@ void GetInternalTemplate(void* ptr, uint32_t module, uint32_t option) { } memcpy(ptr, &template16[index], size); - AddLog_P2(LOG_LEVEL_DEBUG, PSTR("FNC: GetInternalTemplate option %d"), option); - AddLogBufferSize(LOG_LEVEL_DEBUG, (uint8_t *)ptr, size / 2, 2); +// AddLog_P2(LOG_LEVEL_DEBUG, PSTR("FNC: GetInternalTemplate option %d"), option); +// AddLogBufferSize(LOG_LEVEL_DEBUG, (uint8_t *)ptr, size / 2, 2); } #endif // ESP8266 void ModuleGpios(myio *gp) { -//#ifdef ESP8266 -// uint8_t *dest = (uint8_t *)gp; -// uint8_t src[ARRAY_SIZE(Settings.user_template.gp.io)]; -//#else // ESP32 uint16_t *dest = (uint16_t *)gp; uint16_t src[ARRAY_SIZE(Settings.user_template.gp.io)]; -//#endif // ESP8266 - ESP32 memset(dest, GPIO_NONE, sizeof(myio)); if (USER_MODULE == Settings.module) { @@ -1396,19 +1387,7 @@ bool ValidGPIO(uint32_t pin, uint32_t gpio) return (GPIO_USER == ValidPin(pin, BGPIO(gpio))); // Only allow GPIO_USER pins } -//#ifdef ESP8266 -//bool ValidAdc(void) { -// gpio_flag flag = ModuleFlag(); -// uint32_t template_adc0 = flag.data &15; -// return (ADC0_USER == template_adc0); -//} -//#endif // ESP8266 - -//#ifdef ESP8266 -//bool GetUsedInModule(uint32_t val, uint8_t *arr) -//#else // ESP32 bool GetUsedInModule(uint32_t val, uint16_t *arr) -//#endif // ESP8266 - ESP32 { int offset = 0; @@ -1471,8 +1450,8 @@ bool GetUsedInModule(uint32_t val, uint16_t *arr) bool JsonTemplate(const char* dataBuf) { - // Old: {"NAME":"Generic","GPIO":[17,254,29,254,7,254,254,254,138,254,139,254,254],"FLAG":1,"BASE":255} - // New: {"NAME":"Generic16","GPIO":[17,254,29,254,7,254,254,254,138,254,139,254,254,254],"FLAG":1,"BASE":255} + // Old: {"NAME":"Shelly 2.5","GPIO":[56,0,17,0,21,83,0,0,6,82,5,22,156],"FLAG":2,"BASE":18} + // New: {"NAME":"Shelly 2.5","GPIO":[320,0,32,0,224,193,0,0,640,192,608,225,3456,4736],"FLAG":0,"BASE":18} if (strlen(dataBuf) < 9) { return false; } // Workaround exception if empty JSON like {} - Needs checks @@ -1507,15 +1486,11 @@ bool JsonTemplate(const char* dataBuf) } else { #endif for (uint32_t i = 0; i < ARRAY_SIZE(Settings.user_template.gp.io); i++) { -// #ifdef ESP8266 -// Settings.user_template.gp.io[i] = obj[D_JSON_GPIO][i] | 0; -// #else // ESP32 uint16_t gpio = obj[D_JSON_GPIO][i] | 0; if (gpio == (AGPIO(GPIO_NONE) +1)) { gpio = AGPIO(GPIO_USER); } Settings.user_template.gp.io[i] = gpio; -// #endif } if (obj[D_JSON_FLAG].success()) { Settings.user_template.flag.data = obj[D_JSON_FLAG] | 0; @@ -1524,10 +1499,6 @@ bool JsonTemplate(const char* dataBuf) } #endif } -// if (obj[D_JSON_FLAG].success()) { -// uint32_t flag = obj[D_JSON_FLAG] | 0; -// memcpy(&Settings.user_template.flag, &flag, sizeof(gpio_flag)); -// } if (obj[D_JSON_BASE].success()) { uint32_t base = obj[D_JSON_BASE]; if ((0 == base) || !ValidTemplateModule(base -1)) { base = 18; } @@ -1540,15 +1511,11 @@ void TemplateJson(void) { Response_P(PSTR("{\"" D_JSON_NAME "\":\"%s\",\"" D_JSON_GPIO "\":["), SettingsText(SET_TEMPLATE_NAME)); for (uint32_t i = 0; i < ARRAY_SIZE(Settings.user_template.gp.io); i++) { -//#ifdef ESP8266 -// ResponseAppend_P(PSTR("%s%d"), (i>0)?",":"", Settings.user_template.gp.io[i]); -//#else // ESP32 uint16_t gpio = Settings.user_template.gp.io[i]; if (gpio == AGPIO(GPIO_USER)) { gpio = AGPIO(GPIO_NONE) +1; } ResponseAppend_P(PSTR("%s%d"), (i>0)?",":"", gpio); -//#endif } ResponseAppend_P(PSTR("],\"" D_JSON_FLAG "\":%d,\"" D_JSON_BASE "\":%d}"), Settings.user_template.flag, Settings.user_template_base +1); } diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index 3558808c7..4272d3a0c 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -1119,19 +1119,11 @@ void CmndGpio(void) if (ValidGPIO(XdrvMailbox.index, cmodule.io[XdrvMailbox.index]) && (XdrvMailbox.payload >= 0) && (XdrvMailbox.payload < AGPIO(GPIO_SENSOR_END))) { bool present = false; for (uint32_t i = 0; i < ARRAY_SIZE(kGpioNiceList); i++) { -//#ifdef ESP8266 -// uint32_t midx = pgm_read_byte(kGpioNiceList + i); -// if (midx == XdrvMailbox.payload) { -// present = true; -// break; -// } -//#else // ESP32 uint32_t midx = pgm_read_word(kGpioNiceList + i); if ((XdrvMailbox.payload >= (midx & 0xFFE0)) && (XdrvMailbox.payload < midx)) { present = true; break; } -//#endif // ESP8266 - ESP32 } if (present) { for (uint32_t i = 0; i < ARRAY_SIZE(Settings.my_gp.io); i++) { @@ -1146,7 +1138,7 @@ void CmndGpio(void) Response_P(PSTR("{")); bool jsflg = false; for (uint32_t i = 0; i < ARRAY_SIZE(Settings.my_gp.io); i++) { - if (ValidGPIO(i, cmodule.io[i]) || ((AGPIO(GPIO_USER) == XdrvMailbox.payload) && !FlashPin(i))) { + if (ValidGPIO(i, cmodule.io[i]) || ((255 == XdrvMailbox.payload) && !FlashPin(i))) { if (jsflg) { ResponseAppend_P(PSTR(",")); } jsflg = true; uint32_t sensor_type = Settings.my_gp.io[i]; @@ -1158,7 +1150,6 @@ void CmndGpio(void) } char sindex[4] = { 0 }; uint32_t sensor_name_idx = BGPIO(sensor_type); -//#ifdef ESP32 uint32_t nice_list_search = sensor_type & 0xFFE0; for (uint32_t j = 0; j < ARRAY_SIZE(kGpioNiceList); j++) { uint32_t nls_idx = pgm_read_word(kGpioNiceList + j); @@ -1167,7 +1158,6 @@ void CmndGpio(void) break; } } -//#endif // ESP32 const char *sensor_names = kSensorNames; if (sensor_name_idx > GPIO_FIX_START) { sensor_name_idx = sensor_name_idx - GPIO_FIX_START -1; @@ -1186,20 +1176,13 @@ void CmndGpio(void) } } -void CmndGpios(void) -{ +void ShowGpios(const uint16_t *NiceList, uint32_t size, uint32_t offset, uint32_t &lines) { myio cmodule; ModuleGpios(&cmodule); - uint32_t lines = 1; bool jsflg = false; - for (uint32_t i = 0; i < ARRAY_SIZE(kGpioNiceList); i++) { -//#ifdef ESP8266 -// uint32_t midx = pgm_read_byte(kGpioNiceList + i); -// uint32_t ridx = midx; -//#else // ESP32 - uint32_t ridx = pgm_read_word(kGpioNiceList + i) & 0xFFE0; + for (uint32_t i = offset; i < size; i++) { // Skip ADC_NONE + uint32_t ridx = pgm_read_word(NiceList + i) & 0xFFE0; uint32_t midx = BGPIO(ridx); -//#endif // ESP8266 - ESP32 if ((XdrvMailbox.payload != 255) && GetUsedInModule(midx, cmodule.io)) { continue; } if (!jsflg) { Response_P(PSTR("{\"" D_CMND_GPIOS "%d\":{"), lines); @@ -1208,19 +1191,31 @@ void CmndGpios(void) } jsflg = true; char stemp1[TOPSZ]; - if ((ResponseAppend_P(PSTR("\"%d\":\"%s\""), ridx, GetTextIndexed(stemp1, sizeof(stemp1), midx, kSensorNames)) > (LOGSZ - TOPSZ)) || (i == ARRAY_SIZE(kGpioNiceList) -1)) { + if ((ResponseAppend_P(PSTR("\"%d\":\"%s\""), ridx, GetTextIndexed(stemp1, sizeof(stemp1), midx, kSensorNames)) > (LOGSZ - TOPSZ)) || (i == size -1)) { ResponseJsonEndEnd(); MqttPublishPrefixTopic_P(RESULT_OR_STAT, XdrvMailbox.command); jsflg = false; lines++; } } +} + +void CmndGpios(void) +{ + uint32_t lines = 1; + ShowGpios(kGpioNiceList, ARRAY_SIZE(kGpioNiceList), 0, lines); +#ifdef ESP8266 +#ifndef USE_ADC_VCC + ShowGpios(kAdcNiceList, ARRAY_SIZE(kAdcNiceList), 1, lines); +#endif // USE_ADC_VCC +#endif // ESP8266 mqtt_data[0] = '\0'; } void CmndTemplate(void) { - // {"NAME":"Generic","GPIO":[17,254,29,254,7,254,254,254,138,254,139,254,254],"FLAG":1,"BASE":255} + // {"NAME":"Shelly 2.5","GPIO":[320,0,32,0,224,193,0,0,640,192,608,225,3456,4736],"FLAG":0,"BASE":18} + bool error = false; if (strstr(XdrvMailbox.data, "{") == nullptr) { // If no JSON it must be parameter diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index 4812ac788..62ba70a33 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -1499,19 +1499,6 @@ void GpioInit(void) my_module.io[i] = def_gp.io[i]; // Force Template override } } -//#ifdef ESP8266 -// if ((Settings.my_adc0 >= ADC0_END) && (Settings.my_adc0 < ADC0_USER)) { -// Settings.my_adc0 = ADC0_NONE; // Fix not supported sensor ids in module -// } -// else if (Settings.my_adc0 > ADC0_NONE) { -// my_adc0 = Settings.my_adc0; // Set User selected Module sensors -// } -// my_module_flag = ModuleFlag(); -// uint32_t template_adc0 = my_module_flag.data &15; -// if ((template_adc0 > ADC0_NONE) && (template_adc0 < ADC0_USER)) { -// my_adc0 = template_adc0; // Force Template override -// } -//#endif for (uint32_t i = 0; i < ARRAY_SIZE(my_module.io); i++) { uint32_t mpin = ValidPin(i, my_module.io[i]); diff --git a/tasmota/tasmota.h b/tasmota/tasmota.h index 622c8211b..3a9c7ab9e 100644 --- a/tasmota/tasmota.h +++ b/tasmota/tasmota.h @@ -83,7 +83,7 @@ const uint8_t MAX_BUTTON_TEXT = 16; // Max number of GUI button labels const uint8_t MAX_GROUP_TOPICS = 4; // Max number of Group Topics const uint8_t MAX_DEV_GROUP_NAMES = 4; // Max number of Device Group names #ifdef ESP8266 -const uint8_t MAX_ADCS = 1; // Max number of ADC pins +const uint8_t MAX_ADCS = 1; // Max number of ESP8266 ADC pins #else const uint8_t MAX_ADCS = 8; // Max number of ESP32 ADC pins (ADC2 pins are unusable with Wifi enabled) #endif diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 8da42b961..111df2e4a 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -115,11 +115,7 @@ uint16_t tele_period = 9999; // Tele period timer uint16_t blink_counter = 0; // Number of blink cycles uint16_t seriallog_timer = 0; // Timer to disable Seriallog uint16_t syslog_timer = 0; // Timer to re-enable syslog_level - -//#ifdef ESP32 uint16_t gpio_pin[MAX_GPIO_PIN] = { 0 }; // GPIO functions indexed by pin number -//#endif // ESP32 - int16_t save_data_counter; // Counter and flag for config save to Flash RulesBitfield rules_flag; // Rule state flags (16 bits) uint8_t mqtt_cmnd_blocked = 0; // Ignore flag for publish command @@ -128,11 +124,6 @@ uint8_t state_250mS = 0; // State 250msecond per second flag uint8_t latching_relay_pulse = 0; // Latching relay pulse timer uint8_t ssleep; // Current copy of Settings.sleep uint8_t blinkspeed = 1; // LED blink rate - -//#ifdef ESP8266 -//uint8_t gpio_pin[MAX_GPIO_PIN] = { 0 }; // GPIO functions indexed by pin number -//#endif // ESP8266 - ESP32 - uint8_t active_device = 1; // Active device in ExecuteCommandPower uint8_t leds_present = 0; // Max number of LED supported uint8_t led_inverted = 0; // LED inverted flag (1 = (0 = On, 1 = Off)) @@ -149,7 +140,6 @@ uint8_t masterlog_level = 0; // Master log level used to override uint8_t seriallog_level; // Current copy of Settings.seriallog_level uint8_t syslog_level; // Current copy of Settings.syslog_level uint8_t my_module_type; // Current copy of Settings.module or user template type -uint8_t my_adc0 = 0; // Active copy of Module ADC0 uint8_t last_source = 0; // Last command source uint8_t shutters_present = 0; // Number of actual define shutters uint8_t prepped_loglevel = 0; // Delayed log level message @@ -171,7 +161,6 @@ bool is_8285 = false; // Hardware device ESP8266EX (0) or bool skip_light_fade; // Temporarily skip light fading bool restart_halt = false; // Do not restart but stay in wait loop myio my_module; // Active copy of Module GPIOs (17 x 8 bits) -//gpio_flag my_module_flag; // Active copy of Template GPIO flags StateBitfield global_state; // Global states (currently Wifi and Mqtt) (8 bits) char my_version[33]; // Composed version string char my_image[33]; // Code image and/or commit @@ -276,9 +265,6 @@ void setup(void) { for (uint32_t i = 0; i < ARRAY_SIZE(Settings.my_gp.io); i++) { Settings.my_gp.io[i] = GPIO_NONE; // Reset user defined GPIO disabling sensors } -//#ifdef ESP8266 -// Settings.my_adc0 = ADC0_NONE; // Reset user defined ADC0 disabling sensors -//#endif } if (RtcReboot.fast_reboot_count > Settings.param[P_BOOT_LOOP_OFFSET] +4) { // Restarted 6 times Settings.module = Settings.fallback_module; // Reset module to fallback module diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index e587a4a7e..53841b333 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -590,12 +590,12 @@ const uint16_t kGpioNiceList[] PROGMEM = { AGPIO(GPIO_WEBCAM_PSCLK), AGPIO(GPIO_WEBCAM_HSD) + MAX_WEBCAM_HSD, AGPIO(GPIO_WEBCAM_PSRCS), -#endif +#endif // USE_WEBCAM #ifdef USE_ETHERNET AGPIO(GPIO_ETH_PHY_POWER), AGPIO(GPIO_ETH_PHY_MDC), AGPIO(GPIO_ETH_PHY_MDIO), // Ethernet -#endif +#endif // USE_ETHERNET AGPIO(GPIO_ADC_INPUT) + MAX_ADCS, // Analog inputs AGPIO(GPIO_ADC_TEMP) + MAX_ADCS, // Thermistor AGPIO(GPIO_ADC_LIGHT) + MAX_ADCS, // Light sensor @@ -621,10 +621,6 @@ const uint16_t kAdcNiceList[] PROGMEM = { }; #endif // ESP8266 -/*********************************************************************************************\ - * ATTENTION: No user changeable features beyond this point - do not add templates !!! -\*********************************************************************************************/ - // User selectable ADC functionality enum UserSelectableAdc { ADC_NONE, // Not used @@ -640,13 +636,17 @@ enum UserSelectableAdc { // ADC_SWITCH_INV, ADC_END }; +/*********************************************************************************************\ + * ATTENTION: No user changeable features beyond this point - do not add templates !!! +\*********************************************************************************************/ + #ifdef ESP8266 #define MAX_GPI8_PIN 17 // Number of supported GPIO (0..16) #define FLASH_PINS 6 // Number of flash chip pins -#define ADC0_PIN 17 // Pin number of ADC0 #define MAX_GPIO_PIN 18 // Number of supported GPIO (0..16 + ADC0) +#define ADC0_PIN 17 // Pin number of ADC0 #define MIN_FLASH_PINS 4 // Number of flash chip pins unusable for configuration (GPIO6, 7, 8 and 11) #define MAX_USER_PINS 14 // MAX_GPIO_PIN - MIN_FLASH_PINS #define WEMOS_MODULE 17 // Wemos module @@ -731,8 +731,7 @@ typedef struct MYTMPLT { #ifdef ESP8266 // User selectable GPIO functionality -// ATTENTION: Only add at the end of this list just before GPI8_SENSOR_END -// Then add the same name(s) in a nice location in array kGpioNiceList +// ATTENTION: No additions are supported enum LegacyUserSelectablePins { GPI8_NONE, // Not used GPI8_DHT11, // DHT11 diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index 1258d10d8..c878ae5ca 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -368,16 +368,12 @@ const char HTTP_SCRIPT_CONSOL[] PROGMEM = "wl(h);"; // Add console command key eventlistener after name has been synced with id (= wl(jd)) #endif //USE_UNISHOX_COMPRESSION -const char HTTP_MODULE_TEMPLATE_REPLACE[] PROGMEM = - "}2%d'>%s (%d}3"; // }2 and }3 are used in below os.replace - const char HTTP_MODULE_TEMPLATE_REPLACE_INDEX[] PROGMEM = "}2%d'>%s (%d)}3"; // }2 and }3 are used in below os.replace const char HTTP_MODULE_TEMPLATE_REPLACE_NO_INDEX[] PROGMEM = "}2%d'>%s}3"; // }2 and }3 are used in below os.replace -#if defined(USE_UNISHOX_COMPRESSION) && defined(ESP32) -// no compression on ESP8266, we would lose 16 bytes +#if defined(USE_UNISHOX_COMPRESSION) const size_t HTTP_SCRIPT_MODULE_TEMPLATE_SIZE = 602; const char HTTP_SCRIPT_MODULE_TEMPLATE_COMPRESSED[] PROGMEM = "\x33\xBF\xAC\xF1\xD4\x2B\xC7\x83\x02\xF8\x3A\xDC\xE4\x1B\x3B\xBA\x75\x1A\x8E\xF1" "\xED\x33\xBF\xAC\x3E\x09\x81\x8B\x1A\xFA\x8E\x81\xFD\xDD\x32\x61\x31\xAF\xA8\xEE" @@ -405,14 +401,6 @@ const char HTTP_SCRIPT_MODULE_TEMPLATE_COMPRESSED[] PROGMEM = "\x33\xBF\xAC\xF1\ #define HTTP_SCRIPT_MODULE_TEMPLATE Decompress(HTTP_SCRIPT_MODULE_TEMPLATE_COMPRESSED,HTTP_SCRIPT_MODULE_TEMPLATE_SIZE).c_str() #else const char HTTP_SCRIPT_MODULE_TEMPLATE[] PROGMEM = -//#ifdef ESP8266 -// "var os;" -// "function sk(s,g){" // s = value, g = id and name -// "var o=os.replace(/}2/g,\"