From b5ad2c8c06adc08545ef22e2c9b307d086a7ea3f Mon Sep 17 00:00:00 2001 From: Peter Nyilas Date: Fri, 11 Jan 2019 13:59:51 +0000 Subject: [PATCH] Remove rotary_debounce from settings --- sonoff/_changelog.ino | 10 ++++------ sonoff/i18n.h | 1 - sonoff/my_user_config.h | 1 - sonoff/settings.h | 2 +- sonoff/settings.ino | 5 ----- sonoff/sonoff_version.h | 2 +- sonoff/support_rotary.ino | 2 +- 7 files changed, 7 insertions(+), 16 deletions(-) diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index 90a05184c..1d133a47d 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -1,8 +1,4 @@ -/* 6.4.1.9 20190111 - * Add support for rotary switch - * Add support for Mi Desk Lamp - * - * 6.4.1.8 20190107 +/* 6.4.1.8 20190107 * Change sonoff_template.h layout regarding optional module flags like ADC0 * Add command SetOption62 1 to force no Button/Switch pullup on dedicated modules. Currently only supported on Shelly2 (#4841) * Fix Display exception 28 when JSON value is NULL received @@ -15,7 +11,9 @@ * Add support for Luminea ZX2820 Smart Socket with Energy monitoring (#4921) * Add define MDNS_ENABLE to control initial mDNS state (#4923) * Add split interlock part 1 (#4910) - * + * Add support for rotary switch + * Add support for Mi Desk Lamp + * * 6.4.1.7 20190106 * Fix HLW8012, HJL01 and BL0937 based energy sensors low Power (below 10W) measurement regression from 6.4.1.6 * Add Power status functionality to LED2 when configured leaving LED1 for Link status indication diff --git a/sonoff/i18n.h b/sonoff/i18n.h index f12f562da..a90028e8d 100644 --- a/sonoff/i18n.h +++ b/sonoff/i18n.h @@ -214,7 +214,6 @@ #define D_CMND_COUNTERDEBOUNCE "CounterDebounce" #define D_CMND_BUTTONDEBOUNCE "ButtonDebounce" #define D_CMND_SWITCHDEBOUNCE "SwitchDebounce" -#define D_CMND_ROTARYDEBOUNCE "RotaryDebounce" #define D_CMND_SLEEP "Sleep" #define D_CMND_UPLOAD "Upload" #define D_CMND_UPGRADE "Upgrade" diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index a364fcf22..706276c22 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -177,7 +177,6 @@ #define KEY_HOLD_TIME 40 // [SetOption32] Number of 0.1 seconds to hold Button or external Pushbutton before sending HOLD message #define SWITCH_DEBOUNCE_TIME 50 // [SwitchDebounce] Number of mSeconds switch press debounce time #define SWITCH_MODE TOGGLE // [SwitchMode] TOGGLE, FOLLOW, FOLLOW_INV, PUSHBUTTON, PUSHBUTTON_INV, PUSHBUTTONHOLD, PUSHBUTTONHOLD_INV, PUSHBUTTON_TOGGLE (the wall switch state) -#define ROTARY_DEBOUNCE_TIME 50 // [RotaryDebounce] Number of mSeconds rotary debounce time #define WS2812_LEDS 30 // [Pixels] Number of WS2812 LEDs to start with (max is 512) #define TEMP_CONVERSION 0 // [SetOption8] Return temperature in (0 = Celsius or 1 = Fahrenheit) diff --git a/sonoff/settings.h b/sonoff/settings.h index e472ff292..714dee800 100644 --- a/sonoff/settings.h +++ b/sonoff/settings.h @@ -330,7 +330,7 @@ struct SYSCFG { uint32_t energy_kWhtotal_time; // 7B4 unsigned long weight_item; // 7B8 Weight of one item in gram * 10 - uint16_t rotary_debounce; // 7BC + byte free_7BC[2]; // 7BC uint16_t weight_max; // 7BE Total max weight in kilogram unsigned long weight_reference; // 7C0 Reference weight in gram diff --git a/sonoff/settings.ino b/sonoff/settings.ino index db0c7cbef..65f42e979 100644 --- a/sonoff/settings.ino +++ b/sonoff/settings.ino @@ -789,7 +789,6 @@ void SettingsDefaultSet2(void) SettingsDefaultSet_5_13_1c(); // Time STD/DST settings Settings.button_debounce = KEY_DEBOUNCE_TIME; - Settings.rotary_debounce = ROTARY_DEBOUNCE_TIME; Settings.switch_debounce = SWITCH_DEBOUNCE_TIME; for (byte j = 0; j < 5; j++) { @@ -1024,10 +1023,6 @@ void SettingsDelta(void) Settings.param[P_MDNS_DELAYED_START] = 0; } - if (Settings.version < 0x06040109) { - Settings.rotary_debounce = ROTARY_DEBOUNCE_TIME; - } - Settings.version = VERSION; SettingsSave(1); } diff --git a/sonoff/sonoff_version.h b/sonoff/sonoff_version.h index 534276418..f371936aa 100644 --- a/sonoff/sonoff_version.h +++ b/sonoff/sonoff_version.h @@ -20,7 +20,7 @@ #ifndef _SONOFF_VERSION_H_ #define _SONOFF_VERSION_H_ -#define VERSION 0x06040109 +#define VERSION 0x06040108 #define D_PROGRAMNAME "Sonoff-Tasmota" #define D_AUTHOR "Theo Arends" diff --git a/sonoff/support_rotary.ino b/sonoff/support_rotary.ino index 6a186bae4..9c7600b09 100644 --- a/sonoff/support_rotary.ino +++ b/sonoff/support_rotary.ino @@ -125,7 +125,7 @@ void RotaryLoop(void) { if (rotaries_found) { if (TimeReached(rotary_debounce)) { - SetNextTimeInterval(rotary_debounce, Settings.rotary_debounce); + SetNextTimeInterval(rotary_debounce, Settings.button_debounce); // Using button_debounce setting for this as well RotaryHandler(); } }