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 <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2013-11-20 23:21:05 +01:00 committed by Dirk Hohndel
parent a31499de88
commit ea9b179933

View file

@ -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;
}