Fix the decoding of the dive time.

I originally assumed the second byte contains the hour, but that turns
out to be wrong. At least some of the bits have a different meaning.
With only seconds and minutes, the maximum divetime is limited to at
most 99 minutes and 59 seconds. That shouldn't be a problem for
freedives.
This commit is contained in:
Jef Driesen 2016-01-14 10:50:08 +01:00
parent 49af321bc5
commit ca032783a2

View File

@ -468,7 +468,7 @@ oceanic_atom2_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, uns
case DC_FIELD_DIVETIME:
if (parser->model == F10 || parser->model == F11A ||
parser->model == F11B)
*((unsigned int *) value) = bcd2dec (data[2]) + bcd2dec (data[3]) * 60 + bcd2dec (data[1]) * 3600;
*((unsigned int *) value) = bcd2dec (data[2]) + bcd2dec (data[3]) * 60;
else
*((unsigned int *) value) = parser->divetime;
break;