summaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2016-08-29 20:07:39 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-09-04 07:37:28 -0700
commit833683521a973b4836d70626e0a061f2e384825a (patch)
tree0eaf7acb38428cb17676b044befc7500de134d3f /core/dive.c
parent4e0200863b876d3dab750711bfe1c8facba94f55 (diff)
downloadsubsurface-833683521a973b4836d70626e0a061f2e384825a.tar.gz
Stop trying to fix up pressure sensor indexes
This removes 'fixup_dc_cylinder_index()', which was added to fix up the pressure sensor indexes from the Atomic Cobalt dive computer. Even for the Cobalt it really shouldn't matter, because the libdivecomputer backend for the Cobalt actually tries to do the right thing. See for example commit 8853a1ccd422 ("Associate the pressure samples with the primary tank.") in libdivecomputer. Some historical digging shows that the subsurface sample pressure index code came in from commit e32ba4d6d811 ("Improve tank handling for Cobalt"), dated Tue Oct 28 13:48:15 2014. And the libdivecomputer "use the right cylinder" code was around the same time (Fri Oct 10 20:29:17 2014 +0200). So I suspect that subsurface needed the fixup based on an older version of libdivecomputer. Jef's patch is a couple of weeks before, but we may not have tracked libdivecomputer religiously. The reason to remove this code is because it can (and does) mess up the sensor index when it is actually reliable, like in the multi-sensor case of the Suunto EON Steel. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/core/dive.c b/core/dive.c
index e2107c120..04c0bdc1c 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -1345,26 +1345,6 @@ static void fixup_dc_temp(struct dive *dive, struct divecomputer *dc)
update_min_max_temperatures(dive, dc->watertemp);
}
-/*
- * Fix up cylinder sensor information in the samples if we have
- * an explicit first cylinder
- */
-static void fixup_dc_cylinder_index(struct dive *dive, struct divecomputer *dc)
-{
- int i;
- int first_cylinder = explicit_first_cylinder(dive, dc);
-
- if (!first_cylinder)
- return;
-
- for (i = 0; i < dc->samples; i++) {
- struct sample *sample = dc->sample + i;
-
- if (sample->sensor == 0)
- sample->sensor = first_cylinder;
- }
-}
-
/* Remove redundant pressure information */
static void simplify_dc_pressures(struct divecomputer *dc)
{
@@ -1560,9 +1540,6 @@ static void fixup_dive_dc(struct dive *dive, struct divecomputer *dc)
/* Fix up gas switch events */
fixup_dc_gasswitch(dive, dc);
- /* Fix up cylinder sensor data */
- fixup_dc_cylinder_index(dive, dc);
-
/* Fix up cylinder pressures based on DC info */
fixup_dive_pressures(dive, dc);