summaryrefslogtreecommitdiffstats
path: root/libdivecomputer.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-03 12:23:38 +1100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-03 12:47:42 +1100
commit59e92d7cfaa2f95decbaa974c804c781581f22ec (patch)
treea73415d8939ebc1e1b0771999867d7b3b7af7bf2 /libdivecomputer.c
parent4ddea283a5dfb2ebbb1d0e6a0d578107b4fd8e95 (diff)
downloadsubsurface-59e92d7cfaa2f95decbaa974c804c781581f22ec.tar.gz
Correctly reset stop depth if we receive NDL sample from libdivecomputer
The existing code forgot to reset the stopdepth to 0 which resulted in a bogus safety stop being displayed on some divecomputers after the diver finished their deco obligation. Reported-by: Jan.Schubert <Jan.Schubert@GMX.li> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r--libdivecomputer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c
index e0d180906..d41c27b29 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -249,6 +249,7 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
case DC_SAMPLE_DECO:
if (value.deco.type == DC_DECO_NDL) {
sample->ndl.seconds = ndl = value.deco.time;
+ sample->stopdepth.mm = stopdepth = value.deco.depth * 1000.0 + 0.5;
sample->in_deco = in_deco = FALSE;
} else if (value.deco.type == DC_DECO_DECOSTOP ||
value.deco.type == DC_DECO_DEEPSTOP) {