summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-11-09 20:15:48 -0500
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-11-09 20:15:48 -0500
commit2b0f30c3d4773d4e78daf7e2ce76f5c3f3a2d0b3 (patch)
tree9a64a731f5433723c25e0503fee8cd335404453f /profile.c
parentc5073aa4468c1fab57942e6b8616339f7cd155d8 (diff)
downloadsubsurface-2b0f30c3d4773d4e78daf7e2ce76f5c3f3a2d0b3.tar.gz
This should fix the missing end pressure for broken dive computers
Some dive computers randomly drop samples. That was no problem unless it was the LAST sample. We work around that now Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/profile.c b/profile.c
index d2ebf4a09..f0ae0c931 100644
--- a/profile.c
+++ b/profile.c
@@ -698,7 +698,8 @@ static void plot_cylinder_pressure_text(struct graphics_context *gc, struct plot
}
}
cyl = entry->cylinderindex;
- last_pressure[cyl] = GET_PRESSURE(entry);
+ if (GET_PRESSURE(entry))
+ last_pressure[cyl] = GET_PRESSURE(entry);
last_time[cyl] = entry->sec;
for (cyl = 0; cyl < MAX_CYLINDERS; cyl++) {
@@ -934,6 +935,7 @@ static void fill_missing_tank_pressures(struct dive *dive, struct plot_info *pi,
if (!nlist) {
/* just continue without calculating
* interpolated values */
+ INTERPOLATED_PRESSURE(entry) = cur_pr[entry->cylinderindex];
list = NULL;
continue;
}