From 0f7f2195d56effff234430cc4314c5216d518a8d Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Thu, 8 Jan 2015 14:42:07 +0100 Subject: Add setpoint events according to divetype When changing to a CCR dive, add a setpoint change to the default setpoint at the beginning of the dive. Otherwise add an explicit setpoint change to 0 . Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- dive.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'dive.c') diff --git a/dive.c b/dive.c index 680ceeb58..c464e7e33 100644 --- a/dive.c +++ b/dive.c @@ -888,8 +888,10 @@ void update_setpoint_events(struct divecomputer *dc) } ev = get_next_event(ev->next, "SP change"); } - if (!changed) - add_event(dc, 0, SAMPLE_EVENT_PO2, 0, new_setpoint, "SP change"); + if (!changed) { + if (!add_event(dc, 0, SAMPLE_EVENT_PO2, 0, new_setpoint, "SP change")) + printf("Could not add setpoint change event\n"); + } } void sanitize_gasmix(struct gasmix *mix) -- cgit v1.2.3-70-g09d2