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 <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2017-09-14 12:14:33 -07:00 committed by Dirk Hohndel
parent 41bbae31f5
commit e94af2c0b7

View file

@ -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++