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>
This commit is contained in:
Dirk Hohndel 2013-02-03 12:23:38 +11:00
parent 4ddea283a5
commit 59e92d7cfa

View file

@ -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) {