diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-09-02 13:52:48 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-09-03 13:29:40 -0700 |
commit | 5c2bca048f380624eeb3445f12502f26c6953bd2 (patch) | |
tree | 86048b3d4738ddeb971593257ac019056d6015a7 | |
parent | faea11e4fb6e7eef6eb0003c355ce851dc235f41 (diff) | |
download | subsurface-5c2bca048f380624eeb3445f12502f26c6953bd2.tar.gz |
libdivecomputer: allow a "zero depth" deco stop depth
That just means that we're not in deco, the same way as giving a nonzero
NDL value does. But if you don't have NDL, this is a much more
convenient way of saying "not in deco".
The Garmin Descent gives us stop information, but not necessarily NDL,
and really wants this.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | core/libdivecomputer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index c9d67e3ed..64b07961d 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -418,9 +418,9 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata) sample->in_deco = in_deco = false; } else if (value.deco.type == DC_DECO_DECOSTOP || value.deco.type == DC_DECO_DEEPSTOP) { - sample->in_deco = in_deco = true; sample->stopdepth.mm = stopdepth = lrint(value.deco.depth * 1000.0); sample->stoptime.seconds = stoptime = value.deco.time; + sample->in_deco = in_deco = stopdepth > 0; ndl = 0; } else if (value.deco.type == DC_DECO_SAFETYSTOP) { sample->in_deco = in_deco = false; |