From eaf6d564874ac838dc4f3cca7a781034ae60ef7f Mon Sep 17 00:00:00 2001 From: Willem Ferguson Date: Tue, 3 Jun 2014 19:21:41 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- libdivecomputer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libdivecomputer.c') 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(" ", 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); -- cgit v1.2.3-70-g09d2