From a201dd12226df273bedb8863344741a6bdfa10d6 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 17 Feb 2019 16:05:53 +0100 Subject: [PATCH] Remove command SetOption62 Remove command SetOption62 as it's functionality is replaced by user changing the device template (#5255) --- sonoff/_changelog.ino | 1 + sonoff/settings.h | 2 +- sonoff/sonoff.ino | 3 --- sonoff/sonoff_template.h | 7 +++---- sonoff/support_button.ino | 6 ------ sonoff/support_switch.ino | 6 ------ sonoff/xdrv_01_webserver.ino | 16 +--------------- 7 files changed, 6 insertions(+), 35 deletions(-) diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index fd3c2845f..8872f0e4a 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -4,6 +4,7 @@ * Fix GUI wifi password acception starting with asteriks (*) (#5231, #5242) * Add rule expression enabled by define USE_EXPRESSION in my_user_config.h (#5210) * Add Configure Template menu option to GUI (#5222) + * Remove command SetOption62 as it's functionality is replaced by user changing the device template (#5255) * * 6.4.1.16 20190211 * Initial support for online template change using command Template or GUI Configure Other (#5177) diff --git a/sonoff/settings.h b/sonoff/settings.h index 1698c582e..bc39d7d8a 100644 --- a/sonoff/settings.h +++ b/sonoff/settings.h @@ -75,7 +75,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t hass_tele_on_power : 1; // bit 9 (v6.3.0.13) uint32_t sleep_normal : 1; // bit 10 (v6.3.0.15) - SetOption60 - Enable normal sleep instead of dynamic sleep uint32_t button_switch_force_local : 1;// bit 11 (v6.3.0.16) - SetOption61 - Force local operation when button/switch topic is set - uint32_t no_pullup : 1; // bit 12 (v6.4.1.7) - SetOption62 - Force no pull-up (0 = (no)pull-up, 1 = no pull-up) + uint32_t spare12 : 1; uint32_t spare13 : 1; uint32_t spare14 : 1; uint32_t spare15 : 1; diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 9efbd9be7..ad16735db 100755 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -776,9 +776,6 @@ void MqttDataHandler(char* topic, uint8_t* data, unsigned int data_len) if (10 == pindex) { // SetOption60 enable or disable traditional sleep WiFiSetSleepMode(); // Update WiFi sleep mode accordingly } - if ((12 == pindex) && (my_module_flag.pullup)) { // SetOption62 change input pull-up - restart_flag = 2; // Only restart if module supports it - } } } else { // SetOption32 .. 49 diff --git a/sonoff/sonoff_template.h b/sonoff/sonoff_template.h index 6d48cded2..bf900ac6b 100644 --- a/sonoff/sonoff_template.h +++ b/sonoff/sonoff_template.h @@ -336,7 +336,7 @@ typedef struct MYCFGIO { } mycfgio; #define GPIO_FLAG_ADC0 1 // Allow ADC0 when define USE_ADC_VCC is disabled -#define GPIO_FLAG_PULLUP 2 // Allow input pull-up control using SetOption62 +#define GPIO_FLAG_SPARE01 2 // Allow input pull-up control using SetOption62 - Superseded by user template editing #define GPIO_FLAG_SPARE02 4 #define GPIO_FLAG_SPARE03 8 #define GPIO_FLAG_SPARE04 16 @@ -348,7 +348,7 @@ typedef union { uint8_t data; struct { uint8_t adc0 : 1; // Allow ADC0 when define USE_ADC_VCC is disabled - uint8_t pullup : 1; // Allow input pull-up control using SetOption62 + uint8_t spare01 : 1; uint8_t spare02 : 1; uint8_t spare03 : 1; uint8_t spare04 : 1; @@ -974,7 +974,6 @@ const mytmplt kModules[MAXMODULE] PROGMEM = { GPIO_USER, // GPIO15 D8 GPIO_USER, // GPIO16 D0 Wemos Wake GPIO_FLAG_ADC0 // ADC0 A0 Analog input -// + GPIO_FLAG_PULLUP // Allow input pull-up control }, { "Sonoff Dev", // Sonoff Dev (ESP8266) GPIO_KEY1, // GPIO00 E-FW Button @@ -1503,7 +1502,7 @@ const mytmplt kModules[MAXMODULE] PROGMEM = { GPIO_SWT2, // GPIO14 GPIO_MCP39F5_RST, // GPIO15 MCP39F501 Reset 0, - GPIO_FLAG_PULLUP // Allow input pull-up control + 0 }, { "Xiaomi Philips", // Xiaomi Philips bulb (ESP8266) 0, 0, 0, 0, 0, 0, diff --git a/sonoff/support_button.ino b/sonoff/support_button.ino index b0e6e695c..93b1c22c4 100644 --- a/sonoff/support_button.ino +++ b/sonoff/support_button.ino @@ -50,12 +50,6 @@ void ButtonInvertFlag(uint8 button_bit) void ButtonInit(void) { - if (my_module_flag.pullup) { - if (Settings.flag3.no_pullup) { - key_no_pullup = 0xff; - } - } - buttons_found = 0; for (uint8_t i = 0; i < MAX_KEYS; i++) { if (pin[GPIO_KEY1 +i] < 99) { diff --git a/sonoff/support_switch.ino b/sonoff/support_switch.ino index b820a8151..7e84149ba 100644 --- a/sonoff/support_switch.ino +++ b/sonoff/support_switch.ino @@ -110,12 +110,6 @@ void SwitchProbe(void) void SwitchInit(void) { - if (my_module_flag.pullup) { - if (Settings.flag3.no_pullup) { - switch_no_pullup = 0xffff; - } - } - switches_found = 0; for (uint8_t i = 0; i < MAX_SWITCHES; i++) { lastwallswitch[i] = 1; // Init global to virtual switch state; diff --git a/sonoff/xdrv_01_webserver.ino b/sonoff/xdrv_01_webserver.ino index 60e49407b..df9764748 100644 --- a/sonoff/xdrv_01_webserver.ino +++ b/sonoff/xdrv_01_webserver.ino @@ -177,7 +177,7 @@ const char HTTP_SCRIPT_TEMPLATE[] PROGMEM = "sk(g[i],j);" // Set GPIO "j++;" "}" - "for(i=0;i<2;i++){" + "for(i=0;i<1;i++){" "p=(g[13]>>i)&1;" "eb('c'+i).checked=p;" // Set FLAG checkboxes "}" @@ -331,15 +331,12 @@ const char HTTP_FORM_TEMPLATE_FLAG[] PROGMEM = "

" // Keep close so do not use
"
 " D_TEMPLATE_FLAGS " 

" "" D_ALLOW_ADC0 "
" - "" D_ALLOW_PULLUP "
" "

"; const char HTTP_FORM_MODULE[] PROGMEM = "
 " D_MODULE_PARAMETERS " " "
" "

" D_MODULE_TYPE " ({mt)

"; -const char HTTP_FORM_MODULE_PULLUP[] PROGMEM = - "
" D_PULLUP_ENABLE "
"; const char HTTP_LNK_ITEM[] PROGMEM = "
{v} ({w}) {i} {r}%
"; @@ -1073,12 +1070,6 @@ void HandleModuleConfiguration(void) page += FPSTR(HTTP_HEAD_STYLE); page += FPSTR(HTTP_FORM_MODULE); page.replace(F("{mt"), AnyModuleName(MODULE)); - - if (my_module_flag.pullup) { - page += FPSTR(HTTP_FORM_MODULE_PULLUP); - page.replace(F("{r1"), (Settings.flag3.no_pullup) ? F(" checked") : F("")); - } - page += F("
"); for (uint8_t i = 0; i < sizeof(cmodule); i++) { if (ValidGPIO(i, cmodule.io[i])) { @@ -1104,11 +1095,6 @@ void ModuleSaveSettings(void) Settings.last_module = Settings.module; Settings.module = new_module; SetModuleType(); - if (Settings.last_module == new_module) { - if (my_module_flag.pullup) { - Settings.flag3.no_pullup = WebServer->hasArg("b1"); - } - } myio cmodule; ModuleGpios(&cmodule); String gpios = "";