Define O2 permille for air in one spot

Having the O2 permille defined once is more readable.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
This commit is contained in:
Henrik Brautaset Aronsen 2011-12-31 17:15:59 +01:00
parent 2175226580
commit 16b6df559f
5 changed files with 8 additions and 6 deletions

View file

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