diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-02-03 12:23:38 +1100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-02-03 12:47:42 +1100 |
commit | 59e92d7cfaa2f95decbaa974c804c781581f22ec (patch) | |
tree | a73415d8939ebc1e1b0771999867d7b3b7af7bf2 | |
parent | 4ddea283a5dfb2ebbb1d0e6a0d578107b4fd8e95 (diff) | |
download | subsurface-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>
-rw-r--r-- | libdivecomputer.c | 1 |
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) { |