fix vbus signed word

This commit is contained in:
gemu2015 2021-12-28 12:38:39 +01:00
parent 89e3851903
commit 3845708acc
1 changed files with 6 additions and 2 deletions

View File

@ -1976,7 +1976,7 @@ void SML_Decode(uint8_t index) {
} else {
// low word
if (usign) ebus_dval = vbus_get_septet(cp) & 0xffff;
else (int16_t)(vbus_get_septet(cp) & 0xffff);
else ebus_dval = (int16_t)(vbus_get_septet(cp) & 0xffff);
}
break;
case 'b':
@ -2993,10 +2993,14 @@ uint8_t hflg=0;
}
float SML_GetVal(uint32_t index) {
if (index<1 && index>SML_MAX_VARS) { index = 1;}
if (index < 1 || index > SML_MAX_VARS) { index = 1;}
return meter_vars[index-1];
}
char *SML_GetSVal(uint32_t index) {
if (index < 1 || index > MAX_METERS) { index = 1;}
return &meter_id[index - 1][0];
}
#endif // USE_SML_SCRIPT_CMD