Correct handling of O2 values below 21%

We incorrectly "fixed" those to be 21%. Not useful when diving trimix.

Fixes #4

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2012-10-27 18:03:13 -07:00
parent 2be4a9f961
commit b63a5f0de6

View file

@ -60,7 +60,7 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
he = gasmix.helium * 1000 + 0.5;
/* Ignore bogus data - libdivecomputer does some crazy stuff */
if (o2 <= AIR_PERMILLE || o2 >= 1000)
if (o2 + he <= AIR_PERMILLE || o2 >= 1000)
o2 = 0;
if (he < 0 || he >= 800 || o2+he >= 1000)
he = 0;