From b3b787db9430ca6d974a167d23b2ffa1ad3d2b2a Mon Sep 17 00:00:00 2001 From: Rick Walsh Date: Fri, 3 Nov 2017 07:40:07 +1100 Subject: VPMB: final_tts may be calculated before final sample We calculate tts every 30s, not every sample. Consider that when determining the time that the ceiling would have cleared if it's after the surfacing time. Signed-off-by: Rick Walsh --- core/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/profile.c b/core/profile.c index 32e2103af..d7f110db3 100644 --- a/core/profile.c +++ b/core/profile.c @@ -1080,7 +1080,7 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru prev_deco_time = deco_state->deco_time; // Do we need to update deco_time? if (final_tts > 0) - deco_state->deco_time = pi->maxtime + final_tts - time_deep_ceiling; + deco_state->deco_time = last_ndl_tts_calc_time + final_tts - time_deep_ceiling; else if (time_clear_ceiling > 0) /* Consistent with planner, deco_time ends after ascending (20s @9m/min from 3m) * at end of whole minute after clearing ceiling. The deepest ceiling when planning a dive -- cgit v1.2.3-70-g09d2