Fix time parsing for Divesoft Freedom

Divesoft uses 17 bits for time so parse accordingly.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2016-04-25 21:23:22 +03:00 committed by Dirk Hohndel
parent 90db7d3a50
commit 61c9b2891c

View file

@ -3441,7 +3441,7 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size)
while (ptr < buffer + size) { while (ptr < buffer + size) {
time = ((ptr[0] >> 4) & 0x0f) + time = ((ptr[0] >> 4) & 0x0f) +
((ptr[1] << 4) & 0xff0) + ((ptr[1] << 4) & 0xff0) +
(ptr[2] & 0x0f) * 3600; /* hours */ ((ptr[2] << 12) & 0x1f000);
event = ptr[0] & 0x0f; event = ptr[0] & 0x0f;
switch (event) { switch (event) {
case 0: case 0: