mirror of https://github.com/arendst/Tasmota.git
Fix ESP32 temperature jump on some devices
Fix ESP32 temperature jump on some devices like Sonoff DualR3
This commit is contained in:
parent
f674822782
commit
89751c4d86
|
@ -478,7 +478,10 @@ void *special_calloc(size_t num, size_t size) {
|
||||||
|
|
||||||
float CpuTemperature(void) {
|
float CpuTemperature(void) {
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||||
return (float)temperatureRead(); // In Celsius
|
// return (float)temperatureRead(); // In Celsius
|
||||||
|
float t = (float)temperatureRead(); // In Celsius
|
||||||
|
if (t > 81) { t = t - 27.2; } // Fix temp jump observed on some ESP32 like DualR3
|
||||||
|
return t;
|
||||||
#else
|
#else
|
||||||
// Currently (20210801) repeated calls to temperatureRead() on ESP32C3 and ESP32S2 result in IDF error messages
|
// Currently (20210801) repeated calls to temperatureRead() on ESP32C3 and ESP32S2 result in IDF error messages
|
||||||
static float t = NAN;
|
static float t = NAN;
|
||||||
|
|
Loading…
Reference in New Issue