summaryrefslogtreecommitdiffstats
path: root/core/profile.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-07-05 23:14:07 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-07-18 05:50:22 -0700
commit469cc68b029ac3308b4338a43acfa21679493e8b (patch)
tree110eaf78f7c1123784313009f2b8ee4844ec16f8 /core/profile.c
parent29005b578de4680556f6a3fa01781a8af842ced8 (diff)
downloadsubsurface-469cc68b029ac3308b4338a43acfa21679493e8b.tar.gz
Cleanup: replace pressure reading macros by inline functions
Replace the INTERPOLATED_PRESSURE and SENSOR_PRESSURE macros by inline functions. Generate a common inline function that reads a pressure value for a dynamic sensor. Not all SENSOR_PRESSURE macros can be replaced, because the macro is also used to set the value and C sadly doesn't know the concept of "return reference from a function". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/profile.c')
-rw-r--r--core/profile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/profile.c b/core/profile.c
index bbf654d40..d6a26431a 100644
--- a/core/profile.c
+++ b/core/profile.c
@@ -1309,8 +1309,8 @@ static void debug_print_profiledata(struct plot_info *pi)
fprintf(f1, "id t1 gas gasint t2 t3 dil dilint t4 t5 setpoint sensor1 sensor2 sensor3 t6 po2 fo2\n");
for (i = 0; i < pi->nr; i++) {
entry = pi->entry + i;
- fprintf(f1, "%d gas=%8d %8d ; dil=%8d %8d ; o2_sp= %d %d %d %d PO2= %f\n", i, SENSOR_PRESSURE(entry),
- INTERPOLATED_PRESSURE(entry), O2CYLINDER_PRESSURE(entry), INTERPOLATED_O2CYLINDER_PRESSURE(entry),
+ fprintf(f1, "%d gas=%8d %8d ; dil=%8d %8d ; o2_sp= %d %d %d %d PO2= %f\n", i, get_plot_sensor_pressure(entry),
+ get_plot_interpolated_pressure(entry), O2CYLINDER_PRESSURE(entry), INTERPOLATED_O2CYLINDER_PRESSURE(entry),
entry->o2pressure.mbar, entry->o2sensor[0].mbar, entry->o2sensor[1].mbar, entry->o2sensor[2].mbar, entry->pressures.o2);
}
fclose(f1);