summaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2017-07-28 11:25:42 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 21:50:23 -0700
commitdf1bd0015a2f69429116c29d6e7818a33a9070b0 (patch)
tree892769b3c77da70a32332dda9c5820515ce1533e /core/dive.c
parentdefa71256fe16de32f69e78657c807828b7488bd (diff)
downloadsubsurface-df1bd0015a2f69429116c29d6e7818a33a9070b0.tar.gz
Calculate momentary SAC rates with the right gases
The momentary SAC rate got broken by the multiple ressure handling too, and always used just the first cylinder. This uses the new "get_gasmix()" helper to see what you're breathing, and will do the SAC rate over all the cylinders that contain that gas. So it should now DTRT even for sidemount diving (assuming you had the same gas in the sidemount cylinders). NOTE! We could just do the SAC rate over *all* the gases you have pressures for, and maybe that's the right thing to do. The ones you are not breating from shouldn't have their pressure change. But maybe some people add their drysuit argon gas to the gas list? So this may need more work, but it's a step in the right direction. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/dive.c b/core/dive.c
index d07a9d2aa..7f89e5063 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -2071,7 +2071,7 @@ static void cylinder_renumber(struct dive *dive, int mapping[])
dc_cylinder_renumber(dive, dc, mapping);
}
-static int same_gasmix(struct gasmix *a, struct gasmix *b)
+int same_gasmix(struct gasmix *a, struct gasmix *b)
{
if (gasmix_is_air(a) && gasmix_is_air(b))
return 1;