From 89c1254f69c877ece01e0aee8ae86fb55b7d5630 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 27 Sep 2022 15:55:45 +0200 Subject: [PATCH] Fix ESP8266 compilation --- tasmota/my_user_config.h | 8 ++++---- tasmota/tasmota_support/settings.ino | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index 9a2c46cd9..fe52853f7 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -1015,11 +1015,11 @@ #define SET_ESP32_STACK_SIZE (8 * 1024) // Set the stack size for Tasmota. The default value is 8192 for Arduino, some builds might need to increase it -#ifdef SOC_TOUCH_VERSION_1 - #define ESP32_TOUCH_THRESHOLD 40 +#ifdef SOC_TOUCH_VERSION_1 // ESP32 + #define ESP32_TOUCH_THRESHOLD 40 // [TouchThres] Below this level a touch is detected #endif -#ifdef SOC_TOUCH_VERSION_2 - #define ESP32_TOUCH_THRESHOLD 40000 +#ifdef SOC_TOUCH_VERSION_2 // ESP32-S2 and ESP32-S3 + #define ESP32_TOUCH_THRESHOLD 40000 // [TouchThres] Above this level a touch is detected #endif #define USE_ESP32_SENSORS // Add support for ESP32 temperature and optional hall effect sensor diff --git a/tasmota/tasmota_support/settings.ino b/tasmota/tasmota_support/settings.ino index dfcac5db7..03c44477c 100644 --- a/tasmota/tasmota_support/settings.ino +++ b/tasmota/tasmota_support/settings.ino @@ -976,7 +976,9 @@ void SettingsDefaultSet2(void) { flag.button_swap |= KEY_SWAP_DOUBLE_PRESS; flag.button_single |= KEY_ONLY_SINGLE_PRESS; Settings->param[P_HOLD_TIME] = KEY_HOLD_TIME; // Default 4 seconds hold time +#ifdef ESP32 Settings->touch_threshold = ESP32_TOUCH_THRESHOLD; +#endif // Switch for (uint32_t i = 0; i < MAX_SWITCHES_SET; i++) { Settings->switchmode[i] = SWITCH_MODE; } @@ -1574,9 +1576,11 @@ void SettingsDelta(void) { if (Settings->version < 0x0C000204) { // 12.0.2.4 Settings->param[P_BISTABLE_PULSE] = APP_BISTABLE_PULSE; } +#ifdef ESP32 if (Settings->version < 0x0C010103) { // 12.1.1.3 Settings->touch_threshold = ESP32_TOUCH_THRESHOLD; } +#endif Settings->version = VERSION; SettingsSave(1);