if (getMenuDisplay() == MENU_ROOT) {
int temp = getTemperature();
itofpa (temp, (char*) stringBuffer, 0);
setDisplayStr ( (char*) stringBuffer);
if (getParamById (PARAM_OVERHEAT_INDICATION) ) {
if (temp < getParamById (PARAM_MIN_TEMPERATURE) ) {
setDisplayStr ("LLL");
} else if (temp > getParamById (PARAM_MAX_TEMPERATURE) ) { // <------------- Temperature of 110°C is less than 27°C
setDisplayStr ("HHH");
}
}
I noticed that the value returned in getParamById(PARAM_MAX_TEMPERATURE) is "110", but the temperature is a value multiplied by 10, to shift the decimal digit. So I believe I would have to multiply the getParamById() value by 10 to compare.
if (getMenuDisplay() == MENU_ROOT) {
int temp = getTemperature();
temp = getParamById (PARAM_MAX_TEMPERATURE); // <------ For test only
itofpa (temp, (char*) stringBuffer, 0);
setDisplayStr ( (char*) stringBuffer);
if (getParamById (PARAM_OVERHEAT_INDICATION) ) {
if (temp < getParamById (PARAM_MIN_TEMPERATURE) ) {
setDisplayStr ("LLL");
} else if (temp > getParamById (PARAM_MAX_TEMPERATURE) ) {
setDisplayStr ("HHH");
}
}
With this test, the value of 110ºC of parameter P2 appeared on the display with the value 11.0 (which is smaller than the value of 27.0ºC).
Original code: https://github.com/mister-grumbler/w1209-firmware/blob/master/ts.c
I noticed that the value returned in getParamById(PARAM_MAX_TEMPERATURE) is "110", but the temperature is a value multiplied by 10, to shift the decimal digit. So I believe I would have to multiply the getParamById() value by 10 to compare.
With this test, the value of 110ºC of parameter P2 appeared on the display with the value 11.0 (which is smaller than the value of 27.0ºC).