aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-06-17 20:01:16 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-18 05:05:54 -0700
commit3f74389b883a8c06f2021a26070fdc76c6666880 (patch)
tree8871639cf1602cd82cae586152a22227f4f85350
parent9400e1190bdf0df170e86a6bc5ef27183fcbcba5 (diff)
downloadsubsurface-3f74389b883a8c06f2021a26070fdc76c6666880.tar.gz
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>
-rw-r--r--divelist.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/divelist.c b/divelist.c
index a07583857..ff493393d 100644
--- a/divelist.c
+++ b/divelist.c
@@ -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])