mirror of https://github.com/arendst/Tasmota.git
Workaround ESP32C3/S2 IDF temperature error message
This commit is contained in:
parent
c06f850cb4
commit
0f1ebe8734
|
@ -508,7 +508,16 @@ void *special_calloc(size_t num, size_t size) {
|
|||
}
|
||||
|
||||
float CpuTemperature(void) {
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
return (float)temperatureRead(); // In Celsius
|
||||
#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…
Reference in New Issue