diff options
-rw-r--r-- | core/gaspressures.c | 2 | ||||
-rw-r--r-- | core/profile.c | 6 | ||||
-rw-r--r-- | core/profile.h | 6 |
3 files changed, 9 insertions, 5 deletions
diff --git a/core/gaspressures.c b/core/gaspressures.c index 573e50475..bb55ecb88 100644 --- a/core/gaspressures.c +++ b/core/gaspressures.c @@ -445,7 +445,7 @@ void populate_pressure_information(struct dive *dive, struct divecomputer *dc, s // until we get back to this cylinder. if (cyl != sensor) { current = NULL; - SENSOR_PRESSURE(entry, sensor) = 0; + set_plot_pressure_data(entry, SENSOR_PR, sensor, 0); continue; } 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) diff --git a/core/profile.h b/core/profile.h index 761f270d7..8636be2fd 100644 --- a/core/profile.h +++ b/core/profile.h @@ -97,13 +97,17 @@ int get_maxdepth(struct plot_info *pi); #define SENSOR_PR 0 #define INTERPOLATED_PR 1 -#define SENSOR_PRESSURE(_entry,_idx) (_entry)->pressure[_idx][SENSOR_PR] static inline int get_plot_pressure_data(const struct plot_data *entry, int sensor, int idx) { return entry->pressure[idx][sensor]; } +static inline void set_plot_pressure_data(struct plot_data *entry, int sensor, int idx, int value) +{ + entry->pressure[idx][sensor] = value; +} + static inline int get_plot_sensor_pressure(const struct plot_data *entry, int idx) { return get_plot_pressure_data(entry, SENSOR_PR, idx); |