diff options
Diffstat (limited to 'core/profile.h')
-rw-r--r-- | core/profile.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/profile.h b/core/profile.h index ba8c05178..96b672187 100644 --- a/core/profile.h +++ b/core/profile.h @@ -109,12 +109,12 @@ extern int get_maxdepth(const struct plot_info *pi); static inline int get_plot_pressure_data(const struct plot_info *pi, int idx, enum plot_pressure sensor, int cylinder) { - return pi->pressures[cylinder * pi->nr + idx].data[sensor]; + return pi->pressures[cylinder + idx * pi->nr_cylinders].data[sensor]; } static inline void set_plot_pressure_data(struct plot_info *pi, int idx, enum plot_pressure sensor, int cylinder, int value) { - pi->pressures[cylinder * pi->nr + idx].data[sensor] = value; + pi->pressures[cylinder + idx * pi->nr_cylinders].data[sensor] = value; } static inline int get_plot_sensor_pressure(const struct plot_info *pi, int idx, int cylinder) |