mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 01:39:30 +02:00
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:
commit
a26f28aaa3
1 changed files with 8 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue