From f64bddea04a8ed0f9477551ed366a0464a7a261a Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Thu, 18 Aug 2022 16:10:21 +0200 Subject: [PATCH 1/2] S3 Temp sensor support --- tasmota/tasmota_support/support_esp.ino | 11 ++++------- .../tasmota_xsns_sensor/xsns_127_esp32_sensors.ino | 3 --- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/tasmota/tasmota_support/support_esp.ino b/tasmota/tasmota_support/support_esp.ino index 7d451d612..5fc80f08b 100644 --- a/tasmota/tasmota_support/support_esp.ino +++ b/tasmota/tasmota_support/support_esp.ino @@ -656,17 +656,14 @@ float CpuTemperature(void) { return t; */ #else - #ifndef CONFIG_IDF_TARGET_ESP32S3 // Currently (20210801) repeated calls to temperatureRead() on ESP32C3 and ESP32S2 result in IDF error messages - static float t = NAN; - if (isnan(t)) { - t = (float)temperatureRead(); // In Celsius +static float t = NAN; + if (isnan(t)) { + t = (float)temperatureRead(); // In Celsius } return t; - #else - return NAN; #endif -#endif +return NAN; } /* diff --git a/tasmota/tasmota_xsns_sensor/xsns_127_esp32_sensors.ino b/tasmota/tasmota_xsns_sensor/xsns_127_esp32_sensors.ino index 8ac2ee7f6..93c9b24eb 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_127_esp32_sensors.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_127_esp32_sensors.ino @@ -19,7 +19,6 @@ #ifdef ESP32 #ifdef USE_ESP32_SENSORS -#ifndef CONFIG_IDF_TARGET_ESP32S3 /*********************************************************************************************\ * ESP32 CPU Temperature and optional Hall Effect sensor * @@ -139,7 +138,5 @@ bool Xsns127(uint8_t function) { } return result; } - -#endif // Not CONFIG_IDF_TARGET_ESP32S3 #endif // USE_ESP32_SENSORS #endif // ESP32 From 14c1c5dfd4ff9eb7b80cc5a5e8016924587a9ae8 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Fri, 19 Aug 2022 11:27:15 +0200 Subject: [PATCH 2/2] Review changes --- tasmota/tasmota_support/support_esp.ino | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tasmota/tasmota_support/support_esp.ino b/tasmota/tasmota_support/support_esp.ino index 5fc80f08b..b0fa13396 100644 --- a/tasmota/tasmota_support/support_esp.ino +++ b/tasmota/tasmota_support/support_esp.ino @@ -657,13 +657,12 @@ float CpuTemperature(void) { */ #else // Currently (20210801) repeated calls to temperatureRead() on ESP32C3 and ESP32S2 result in IDF error messages -static float t = NAN; - if (isnan(t)) { - t = (float)temperatureRead(); // In Celsius + static float t = NAN; + if (isnan(t)) { + t = (float)temperatureRead(); // In Celsius } return t; - #endif -return NAN; +#endif } /*