Fix gasmix for OTU calculation

With the fixed sematics of get_gasmix to return the new gasmix for
the time of a gas switch (added comments to make this clear), in the
OTU calculation we need the previous gasmix for the interval up to the
current time.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
Robert C. Helling 2018-10-30 12:19:00 +01:00 committed by bstoeger
parent 7e4c8c387b
commit 62c57be1da
2 changed files with 3 additions and 1 deletions

View file

@ -173,7 +173,7 @@ static int calculate_otu(const struct dive *dive)
if (sample->setpoint.mbar) {
po2 = sample->setpoint.mbar;
} else {
int o2 = active_o2(dive, dc, sample->time);
int o2 = active_o2(dive, dc, psample->time);
po2 = lrint(o2 * depth_to_atm(sample->depth.mm, dive));
}
if (po2 >= 500)