Use only one byte for the oxygen percentage.

One byte is already more than sufficient to store an oxygen percentage.
Using two bytes doesn't cause any problems for some models, because the
upper byte is always zero, but for other models that's not the case.
Most likely this upper byte is used to store something else.
This commit is contained in:
Jef Driesen 2013-10-22 22:19:28 +02:00
parent 48661ce7a8
commit 68f97e907a

View File

@ -381,7 +381,7 @@ uwatec_smart_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsi
break;
case DC_FIELD_GASMIX:
gasmix->helium = 0.0;
gasmix->oxygen = array_uint16_le (data + table->gasmix + flags * 2) / 100.0;
gasmix->oxygen = data[table->gasmix + flags * 2] / 100.0;
gasmix->nitrogen = 1.0 - gasmix->oxygen - gasmix->helium;
break;
default: