summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-11 10:00:45 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-11 10:00:45 +0100
commit4c3dfee446eda061f862e1fdcce93b54a066feff (patch)
treea6a3087c1172f8a4856f453223c433e7aa525b1b /divelist.c
parent776f92edcf9e1fb563f8cae5bc49c54a85ff2faf (diff)
parente167108c76c4a74ab50561fd59b2158704767a75 (diff)
downloadsubsurface-4c3dfee446eda061f862e1fdcce93b54a066feff.tar.gz
Merge branch 'pressure'
Make depth to absolute pressure conversions consistent.
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/divelist.c b/divelist.c
index 056a4f64a..6aa26c2bd 100644
--- a/divelist.c
+++ b/divelist.c
@@ -711,7 +711,7 @@ static int calculate_otu(struct dive *dive)
int o2 = dive->cylinder[sample->cylinderindex].gasmix.o2.permille;
if (!o2)
o2 = AIR_PERMILLE;
- po2 = o2 / 1000.0 * (sample->depth.mm + 10000) / 10000.0;
+ po2 = o2 / 1000.0 * depth_to_mbar(sample->depth.mm, dive) / 1000.0;
if (po2 >= 0.5)
otu += pow(po2 - 0.5, 0.83) * t / 30.0;
}
@@ -771,8 +771,8 @@ static int calculate_sac(struct dive *dive)
}
}
}
- /* Mean pressure in atm: 1 atm per 10m */
- pressure = 1 + (dive->meandepth.mm / 10000.0);
+ /* Mean pressure in bar (SAC calculations are in bar*l/min) */
+ pressure = depth_to_mbar(dive->meandepth.mm, dive) / 1000.0;
sac = airuse / pressure * 60 / duration;
/* milliliters per minute.. */