From ea9b1799337f5bb82c41f4f5288da24b85f6ae50 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Wed, 20 Nov 2013 23:21:05 +0100 Subject: [PATCH] Don't interpolate gas consumption when at surface Don't calculate pressure-track for depth above SURFACE_THRESHOLD, because then we would guess that were actually at surface breathing. Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- profile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/profile.c b/profile.c index 0f90370f0..453da991a 100644 --- a/profile.c +++ b/profile.c @@ -496,6 +496,9 @@ static inline int pressure_time(struct dive *dive, struct divecomputer *dc, stru int time = b->sec - a->sec; int depth = (a->depth + b->depth)/2; + if (depth <= SURFACE_THRESHOLD) + return 0; + return depth_to_mbar(depth, dive) * time; }