summaryrefslogtreecommitdiffstats
path: root/core/profile.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-07-05 23:23:20 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-07-18 05:50:22 -0700
commit39ede7e9e85e92cfd5b93e32237c6899e595fcfa (patch)
tree90bd7bc5c111582726545ec4226611c219bf2afc /core/profile.c
parent68147c42255598992f2be23e53c9bbcf76e65b91 (diff)
downloadsubsurface-39ede7e9e85e92cfd5b93e32237c6899e595fcfa.tar.gz
Cleanup: introduce function to set pressure values
Instead of assigning the the lvalue of the SENSOR_PRESSURE macro, introduce a general function to set pressure values. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/profile.c')
-rw-r--r--core/profile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/profile.c b/core/profile.c
index d6a26431a..2302822fe 100644
--- a/core/profile.c
+++ b/core/profile.c
@@ -597,9 +597,9 @@ static void populate_plot_entries(struct dive *dive, struct divecomputer *dc, st
entry->pressures.o2 = sample->setpoint.mbar / 1000.0;
}
if (sample->pressure[0].mbar)
- SENSOR_PRESSURE(entry, sample->sensor[0]) = sample->pressure[0].mbar;
+ set_plot_pressure_data(entry, SENSOR_PR, sample->sensor[0], sample->pressure[0].mbar);
if (sample->pressure[1].mbar)
- SENSOR_PRESSURE(entry, sample->sensor[1]) = sample->pressure[1].mbar;
+ set_plot_pressure_data(entry, SENSOR_PR, sample->sensor[1], sample->pressure[1].mbar);
if (sample->temperature.mkelvin)
entry->temperature = lasttemp = sample->temperature.mkelvin;
else
@@ -821,7 +821,7 @@ static void add_plot_pressure(struct plot_info *pi, int time, int cyl, pressure_
if (entry->sec >= time)
break;
}
- SENSOR_PRESSURE(entry, cyl) = p.mbar;
+ set_plot_pressure_data(entry, SENSOR_PR, cyl, p.mbar);
}
static void setup_gas_sensor_pressure(const struct dive *dive, const struct divecomputer *dc, struct plot_info *pi)