mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-26 20:26:32 +00:00
Merge pull request #16563 from Jason2866/temp_no_nan
Temperature error messages fixed in core 2.0.5
This commit is contained in:
commit
96b7f79d15
@ -672,22 +672,7 @@ void *special_malloc32(uint32_t size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float CpuTemperature(void) {
|
float CpuTemperature(void) {
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
|
||||||
return (float)temperatureRead(); // In Celsius
|
return (float)temperatureRead(); // In Celsius
|
||||||
/*
|
|
||||||
// These jumps are not stable either. Sometimes it jumps to 77.3
|
|
||||||
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
|
|
||||||
// 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
|
|
||||||
}
|
|
||||||
return t;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user