mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 17:29:50 +03:00
any unsigned short >0x8000 is a non-value
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user