From e94af2c0b7ce0dd0e61e25b717829543120c4d33 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 14 Sep 2017 12:14:33 -0700 Subject: Properly clear sensor pressure data for synthetic plotinfo entries We only cleared the first sensor data when we created new synthetic plot info entries, because we only used to have one (well, we had the o2 data, but apparently nobody ever noticed that it didn't get properly interpolated, probably because people who have CCR dives with o2 pressures are few, and the pressure drops are gradual anyway). Clear all the pressure data, so that the interpolation code doesn't think we have some existing real sensor data for the plot info entries in between proper sample entries. Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- core/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/profile.c b/core/profile.c index af9ebff28..4ff27fcd7 100644 --- a/core/profile.c +++ b/core/profile.c @@ -494,7 +494,7 @@ struct plot_info calculate_max_limits_new(struct dive *dive, struct divecomputer entry->sec = _time; \ entry->depth = _depth; \ entry->running_sum = (entry - 1)->running_sum + (_time - (entry - 1)->sec) * (_depth + (entry - 1)->depth) / 2; \ - SENSOR_PRESSURE(entry, 0) = 0; \ + memset(entry->pressure, 0, sizeof(entry->pressure)); \ entry->sac = _sac; \ entry++; \ idx++ -- cgit v1.2.3-70-g09d2