Merge pull request #1333 from jonny5532/fix/cpu-temperature

Fix: Ignore erroneous 53.3c CPU temperature value that ESP32 often returns
This commit is contained in:
Daniel Öster 2025-07-22 11:18:31 +03:00 committed by GitHub
commit a26f28aaa3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -370,7 +370,14 @@ void check_interconnect_available() {
void update_calculated_values() {
/* Update CPU temperature*/
datalayer.system.info.CPU_temperature = temperatureRead();
union {
float temp;
uint32_t hex;
} temp = {.temp = temperatureRead()};
if (temp.hex != 0x42555555) {
// Ignoring erroneous temperature value that ESP32 sometimes returns
datalayer.system.info.CPU_temperature = temp.temp;
}
/* Calculate allowed charge/discharge currents*/
if (datalayer.battery.status.voltage_dV > 10) {