any unsigned short >0x8000 is a non-value

This commit is contained in:
Paul
2020-01-01 14:59:11 +01:00
parent d3427011fb
commit 2684ccc594
2 changed files with 12 additions and 8 deletions

View File

@@ -76,11 +76,11 @@ char * _short_to_char(char * s, int16_t value, uint8_t decimals) {
return s;
}
// convert short (two bytes) to text string and prints it
// convert unsigned short (two bytes) to text string and prints it
// decimals: 0 = no division, 1=divide value by 10, 2=divide by 2, 10=divide value by 100
char * _ushort_to_char(char * s, uint16_t value, uint8_t decimals) {
// remove errors or invalid values
if (value == EMS_VALUE_USHORT_NOTSET) {
if (value >= EMS_VALUE_USHORT_NOTSET) {
strlcpy(s, "?", 10);
return (s);
}