From ac38aa02431377086c83308b028214b3e66edf8b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 19 Feb 2013 15:10:01 -0800 Subject: Planner: fix incorrect gas change event We stored the He permille instead of the He percentage. But for most casual testing this was hidden by the previous bug. Reported-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- planner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planner.c b/planner.c index 1057bea13..ee13b8bd8 100644 --- a/planner.c +++ b/planner.c @@ -294,7 +294,7 @@ struct dive *create_dive_from_plan(struct diveplan *diveplan) int planhe = (he + 5) / 10 * 10; int value; add_gas(dive, plano2, planhe); - value = (plano2 / 10) | (planhe << 16); + value = (plano2 / 10) | ((planhe / 10) << 16); add_event(dc, lasttime, 25, 0, value, "gaschange"); // SAMPLE_EVENT_GASCHANGE2 oldo2 = o2; oldhe = he; } -- cgit v1.2.3-70-g09d2