From 6dd6e9068452dc12666aa45cf464031c8a8b0d57 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 13 Feb 2015 21:07:22 -0800 Subject: Don't force the first divecomputer to CCR just because there's po2 value The existing code was bogus as it used cur_dive->dc instead of cur_dc (i.e., it always changed the first dive computer, even if the po2 was found in a different one). But fundamentally I consider this bogus. We are not doing the right thing here - some dive computer send us pO2 values that are just the calculated pO2 at a depth and NOT a setpoint, yet we pretend those are setpoints and then turn these dives into CCR dives. This needs to done differently. Signed-off-by: Dirk Hohndel --- parse-xml.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'parse-xml.c') diff --git a/parse-xml.c b/parse-xml.c index 5c5346c09..cfe3459ed 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -935,10 +935,8 @@ static void try_to_fill_sample(struct sample *sample, const char *name, char *bu return; if (MATCH("sensor3.sample", double_to_o2pressure, &sample->o2sensor[2])) // up to 3 CCR sensors return; - if (MATCH("po2.sample", double_to_o2pressure, &sample->setpoint)) { - cur_dive->dc.divemode = CCR; + if (MATCH("po2.sample", double_to_o2pressure, &sample->setpoint)) return; - } if (MATCH("heartbeat", get_uint8, &sample->heartbeat)) return; if (MATCH("bearing", get_bearing, &sample->bearing)) -- cgit v1.2.3-70-g09d2