Skip to content

Commit f0473f5

Browse files
jefdriesenmikeller
authored andcommitted
Fix the decoding of the temperature
The lower nibble at offset 0x0C contains part of the dive time and only the higher nibble contains part of the temperature. Since this extra nibble ended up as the second decimal figure, the error is actually very small and nobody really noticed the mistake.
1 parent 93a885d commit f0473f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cressi_edy_parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ cressi_edy_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsign
154154
gasmix->nitrogen = 1.0 - gasmix->oxygen - gasmix->helium;
155155
break;
156156
case DC_FIELD_TEMPERATURE_MINIMUM:
157-
*((double *) value) = (bcd2dec (p[0x0B]) * 100 + bcd2dec (p[0x0C])) / 100.0;
157+
*((double *) value) = (bcd2dec (p[0x0B]) * 10 + ((p[0x0C] & 0xF0) >> 4)) / 10.0;
158158
break;
159159
default:
160160
return DC_STATUS_UNSUPPORTED;

0 commit comments

Comments
 (0)