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:
parent
49af321bc5
commit
ca032783a2
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user