Deepblu Cosmiq+: fix oxygen percentage reporting
When I added more parsing of the dive data of the Cosmiq+ in commit
4dff291a1a53 ("Deepblu Cosmiq+: fill in some parsing details") I got the
gasmix units completely wrong and clearly never tested it.
The DC_FIELD_GASMIX reporting uses floating point percentages, not
integer percentages, and instead of reporting 21% as 0.21, we used to
report it as 21.0. It all looked fine in my profiles, because I'd only
tested simulated air dives, and subsurface defaults to air even if
somebody reports crazy impossible gases.
Easy enough to fix, and now actually tested by doing a simulated nitrox
dive.
Reported-by: Michael Werle <mwerle@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
aab3d7a68e
commit
df7aeeef01
@ -189,7 +189,7 @@ deepblu_parser_set_data (dc_parser_t *abstract, const unsigned char *data, unsig
|
||||
case 2:
|
||||
// SCUBA - divetime in minutes
|
||||
divetime *= 60;
|
||||
deepblu->cache.gasmix[0].oxygen = data[3];
|
||||
deepblu->cache.gasmix[0].oxygen = data[3] / 100.0;
|
||||
deepblu->cache.initialized |= 1u << DC_FIELD_GASMIX;
|
||||
ASSIGN_FIELD(GASMIX_COUNT, 1);
|
||||
ASSIGN_FIELD(DIVEMODE, DC_DIVEMODE_OC);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user