mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
Update webserver.cpp
- Temperature calculation fix when negative.
This commit is contained in:
parent
cb44f4709d
commit
41b4172085
1 changed files with 2 additions and 2 deletions
|
@ -264,12 +264,12 @@ String processor(const String& var) {
|
|||
float tempMaxFloat = 0;
|
||||
float tempMinFloat = 0;
|
||||
if (temperature_max > 32767) { //Handle negative values on this unsigned value
|
||||
tempMaxFloat = static_cast<float>(-(65535 - temperature_max)) / 10.0; // Convert to float and divide by 10
|
||||
tempMaxFloat = static_cast<float>(-(65536 - temperature_max)) / 10.0; // Convert to float and divide by 10
|
||||
} else {
|
||||
tempMaxFloat = static_cast<float>(temperature_max) / 10.0; // Convert to float and divide by 10
|
||||
}
|
||||
if (temperature_min > 32767) { //Handle negative values on this unsigned value
|
||||
tempMinFloat = static_cast<float>(-(65535 - temperature_min)) / 10.0; // Convert to float and divide by 10
|
||||
tempMinFloat = static_cast<float>(-(65536 - temperature_min)) / 10.0; // Convert to float and divide by 10
|
||||
} else {
|
||||
tempMinFloat = static_cast<float>(temperature_min) / 10.0; // Convert to float and divide by 10
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue