CNS doesn't increase when PO2 is below 0.5 atm

When chasing other bug in CNS code i found this.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2014-06-17 20:01:16 +02:00 committed by Dirk Hohndel
parent 9400e1190b
commit 3f74389b88

View file

@ -248,6 +248,9 @@ static int calculate_cns(struct dive *dive)
int o2 = active_o2(dive, dc, sample->time);
po2 = o2 * depth_to_atm(sample->depth.mm, dive);
}
/* CNS don't increse when below 500 matm */
if (po2 < 500)
continue;
/* Find what table-row we should calculate % for */
for (j = 1; j < sizeof(cns_table) / (sizeof(int) * 3); j++)
if (po2 > cns_table[j][0])