summaryrefslogtreecommitdiffstats
path: root/libdivecomputer.c
diff options
context:
space:
mode:
authorGravatar Willem Ferguson <willemferguson@zoology.up.ac.za>2014-06-03 19:21:41 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-03 17:05:25 -0700
commiteaf6d564874ac838dc4f3cca7a781034ae60ef7f (patch)
treed214c58bdc33f6dbd058afe715de357dd14d4114 /libdivecomputer.c
parent1fec6453a2b7b6dcd34901a4e92dd11aae38879c (diff)
downloadsubsurface-eaf6d564874ac838dc4f3cca7a781034ae60ef7f.tar.gz
CCR code: Change to sample structure
1) All the variables in the sample structures are strongly typed 2) Two additional types were declared in units.h: o2pressure_t bearing_t 3) The following variables were added: diluentpressure o2setpoint o2sensor[3] 4) Changes to a number of files were made to chanf sample->po2 to sample->po2.mbar bearing to bearring.degrees Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r--libdivecomputer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c
index d6f2d60b1..e8a033848 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -198,7 +198,7 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
sample->ndl.seconds = ndl;
sample->stoptime.seconds = stoptime;
sample->stopdepth.mm = stopdepth;
- sample->po2 = po2;
+ sample->po2.mbar = po2;
sample->cns = cns;
}
sample = prepare_sample(dc);
@@ -225,7 +225,7 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
sample->heartbeat = value.heartbeat;
break;
case DC_SAMPLE_BEARING:
- sample->bearing = value.bearing;
+ sample->bearing.degrees = value.bearing;
break;
case DC_SAMPLE_VENDOR:
printf(" <vendor time='%u:%02u' type=\"%u\" size=\"%u\">", FRACTION(sample->time.seconds, 60),
@@ -237,10 +237,10 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
#if DC_VERSION_CHECK(0, 3, 0)
case DC_SAMPLE_SETPOINT:
/* for us a setpoint means constant pO2 from here */
- sample->po2 = po2 = rint(value.setpoint * 1000);
+ sample->po2.mbar = po2 = rint(value.setpoint * 1000);
break;
case DC_SAMPLE_PPO2:
- sample->po2 = po2 = rint(value.ppo2 * 1000);
+ sample->po2.mbar = po2 = rint(value.ppo2 * 1000);
break;
case DC_SAMPLE_CNS:
sample->cns = cns = rint(value.cns * 100);