Browse Source

Merge branch 'hms' of https://dev.lpusch.de/lukas/ahoy into hms

pull/935/head
lumapu 2 years ago
parent
commit
769aeb5a9e
  1. 6
      src/hm/hmInverter.h
  2. 2
      src/hms/hmsDefines.h

6
src/hm/hmInverter.h

@ -264,9 +264,9 @@ class Inverter {
val <<= 8;
val |= buf[ptr];
} while(++ptr != end);
if (FLD_T == rec->assign[pos].fieldId) {
// temperature is a signed value!
rec->record[pos] = (REC_TYP)((int16_t)val) / (REC_TYP)(div);
if ((FLD_T == rec->assign[pos].fieldId) || (FLD_Q == rec->assign[pos].fieldId) || (FLD_PF == rec->assign[pos].fieldId)) {
// temperature, Qvar, and power factor are a signed values
rec->record[pos] = ((REC_TYP)((int16_t)val)) / (REC_TYP)(div);
} else if (FLD_YT == rec->assign[pos].fieldId) {
rec->record[pos] = ((REC_TYP)(val) / (REC_TYP)(div)) + ((REC_TYP)config->yieldCor[rec->assign[pos].ch-1]);
} else {

2
src/hms/hmsDefines.h

@ -43,7 +43,7 @@ const byteAssign_t hms4chAssignment[] = {
{ FLD_PAC, UNIT_W, CH0, 54, 2, 10 },
{ FLD_Q, UNIT_VAR, CH0, 56, 2, 10 }, // signed!
{ FLD_IAC, UNIT_A, CH0, 58, 2, 100 },
{ FLD_PF, UNIT_NONE, CH0, 60, 2, 1000 },
{ FLD_PF, UNIT_NONE, CH0, 60, 2, 1000 }, // signed!
{ FLD_T, UNIT_C, CH0, 62, 2, 10 }, // signed!
{ FLD_EVT, UNIT_NONE, CH0, 64, 2, 1 },
{ FLD_YD, UNIT_WH, CH0, CALC_YD_CH0, 0, CMD_CALC },

Loading…
Cancel
Save