diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-20 14:39:02 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-20 17:32:54 -0700 |
commit | 11a0c0cc701806ccec975c67d27dec97fbb13b1f (patch) | |
tree | 15a3ace16588b80a88fea76cec30386414bfc3f7 /core/profile.c | |
parent | 94d8abd1a292ac0b02064c906da3a66ccf9e6737 (diff) | |
download | subsurface-11a0c0cc701806ccec975c67d27dec97fbb13b1f.tar.gz |
Unify sample pressure and o2pressure as pressure[2] array
We currently carry two pressures around for all the samples and plot
info, but the second pressure is reserved for CCR dives as the O2
cylinder pressure.
That's kind of annoying when we *could* use it for regular sidemount
dives as the secondary pressure.
So start prepping for that instead: don't make it "pressure" and
"o2pressure", make it just be an array of two pressure values.
NOTE! This is purely mindless prepwork. It literally just does a
search-and-replace, keeping the exact same semantics, so "pressure[1]"
is still just O2 pressure.
But at some future date, we can now start using it for a second sensor
value for sidemount instead.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/profile.c')
-rw-r--r-- | core/profile.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/profile.c b/core/profile.c index 6923d4dd1..0d3646ece 100644 --- a/core/profile.c +++ b/core/profile.c @@ -370,7 +370,7 @@ static int set_cylinder_index(struct plot_info *pi, int i, int cylinderindex, in break; if (entry->cylinderindex != cylinderindex) { entry->cylinderindex = cylinderindex; - entry->pressure[0] = 0; + entry->pressure[0][0] = 0; } i++; } @@ -478,7 +478,7 @@ struct plot_info calculate_max_limits_new(struct dive *dive, struct divecomputer while (--i >= 0) { int depth = s->depth.mm; - int pressure = s->cylinderpressure.mbar; + int pressure = s->pressure[0].mbar; int temperature = s->temperature.mkelvin; int heartbeat = s->heartbeat; @@ -641,8 +641,8 @@ struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer * } /* FIXME! sensor index -> cylinder index translation! */ // entry->cylinderindex = sample->sensor; - SENSOR_PRESSURE(entry) = sample->cylinderpressure.mbar; - O2CYLINDER_PRESSURE(entry) = sample->o2cylinderpressure.mbar; + SENSOR_PRESSURE(entry) = sample->pressure[0].mbar; + O2CYLINDER_PRESSURE(entry) = sample->pressure[1].mbar; if (sample->temperature.mkelvin) entry->temperature = lasttemp = sample->temperature.mkelvin; else |