BUG FIX: always showing offset against DS18B20 in temp sensor role screen

This commit is contained in:
Ray Jones 2020-01-09 12:50:54 +11:00
parent 88cf18bfcf
commit 083fb63764
2 changed files with 15 additions and 5 deletions

View File

@ -126,8 +126,8 @@
const int FirmwareRevision = 31;
const int FirmwareSubRevision = 7;
const int FirmwareMinorRevision = 4;
const char* FirmwareDate = "4 Jan 2020";
const int FirmwareMinorRevision = 5;
const char* FirmwareDate = "9 Jan 2020";
#ifdef ESP32

View File

@ -108,10 +108,20 @@ CTempSensorScreen::show()
_printMenuText(border, baseLine, msg, _rowSel == 2 && _colSel == 0);
_printMenuText(27, baseLine, "DS18B20");
if(_nDS18B20 == 1) {
sprintf(msg, "%+.01f", _OffsetDS18B20);
_printMenuText(90, baseLine, msg, _rowSel == 2 && _colSel == 1);
if(_nDS18B20 > 1) {
sprintf(msg, "x%d", _nDS18B20);
_printMenuText(72, baseLine, msg);
}
if(_colSel == 0) {
// get temperature of primary DS18B20
float temperature;
getTempSensor().getDS18B20().getTemperature(0, temperature, false);
sprintf(msg, "%.01f`C", temperature + _OffsetDS18B20);
}
else {
sprintf(msg, "%+.01f", _OffsetDS18B20);
}
_printMenuText(90, baseLine, msg, _rowSel == 2 && _colSel == 1);
}
}