Skip to content

Commit 3a4afdf

Browse files
jefdriesenmikeller
authored andcommitted
Fix the active gasmix detection
The Cressi Edy appears to set the disabled gas mixes to 0xFF. The check for the magic value 0xF0 doesn't catch this case and therefore the value 0xFF results in a gas mix with 165% O2, which is obviously invalid. Fixed by checking the high nibble only.
1 parent f0473f5 commit 3a4afdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cressi_edy_parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ cressi_edy_parser_count_gasmixes (const unsigned char *data)
6565
// as the first gas marked as disabled is found.
6666
unsigned int i = 0;
6767
while (i < 3) {
68-
if (data[0x17 - i] == 0xF0)
68+
if ((data[0x17 - i] & 0xF0) == 0xF0)
6969
break;
7070
i++;
7171
}

0 commit comments

Comments
 (0)