From 4c94460831e15e0ad53fe697a25ed87e8ec71289 Mon Sep 17 00:00:00 2001 From: Stephane Bensoussan Date: Sun, 20 Oct 2013 22:08:56 +0200 Subject: [PATCH] Use only 11 bits for the depth. When using up to 14 bits for the depth, the resulting values are too large in some cases. Most likely the upper bits are used to store something else. Even with only 11 bits, the resulting depth range (0-204.7m) should still be more than sufficient. --- src/cressi_leonardo_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cressi_leonardo_parser.c b/src/cressi_leonardo_parser.c index 0291366..470a4fa 100644 --- a/src/cressi_leonardo_parser.c +++ b/src/cressi_leonardo_parser.c @@ -162,7 +162,7 @@ cressi_leonardo_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callbac dc_sample_value_t sample = {0}; unsigned int value = array_uint16_le (data + offset); - unsigned int depth = value & 0x3FFF; + unsigned int depth = value & 0x07FF; // Time (seconds). time += interval;