Limit the depth value to 11 bits
The depth value is encoded with only 11 bits instead of 12 bits. The extra bit contains the gas mix index. This resulted in wrong depths, with values larger than 204.8m.
This commit is contained in:
parent
a01b9bc9b9
commit
59d9791446
@ -190,7 +190,7 @@ cressi_goa_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t c
|
||||
|
||||
if (type == DEPTH) {
|
||||
// Depth (1/10 m).
|
||||
unsigned int depth = value & 0x0FFF;
|
||||
unsigned int depth = value & 0x07FF;
|
||||
sample.depth = depth / 10.0;
|
||||
if (callback) callback (DC_SAMPLE_DEPTH, sample, userdata);
|
||||
complete = 1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user