From 5c2bca048f380624eeb3445f12502f26c6953bd2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 2 Sep 2018 13:52:48 -0700 Subject: 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 --- core/libdivecomputer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') 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; -- cgit v1.2.3-70-g09d2