From 68f97e907a036dc207058b83d46e4cedde3ddf0d Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 22 Oct 2013 22:19:28 +0200 Subject: [PATCH] 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. --- src/uwatec_smart_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uwatec_smart_parser.c b/src/uwatec_smart_parser.c index 1d4b715..104481e 100644 --- a/src/uwatec_smart_parser.c +++ b/src/uwatec_smart_parser.c @@ -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: