# HG changeset patch # User Jan Mulder # Date 1554038046 -7200 # Node ID 5f535ef6a3dbbdf30d75d6a7059953ffc9e49699 # Parent 9b4b3decd9ba4fb7c53e2f08dc0d4f533d593f70 Bugfix, minor: properly alternate VPM/Buhlmann in deco loop The idea of the counter in this commit is to compute the opposite deco algorithm in 1:10 calls. So, when Buhlmann is selected, also compute VPM with 1:10 sample rate (and vise versa). The idea is good, but this never worked as the counter was local on the stack, so was 0 for every call here. So, when switching between deco algorithm, it took some refresh cycles as the computations where not in sync. Signed-off-by: Jan Mulder diff -r 9b4b3decd9ba -r 5f535ef6a3db Discovery/Src/base.c --- a/Discovery/Src/base.c Fri Mar 29 14:00:43 2019 +0100 +++ b/Discovery/Src/base.c Sun Mar 31 15:14:06 2019 +0200 @@ -1669,7 +1669,7 @@ } CALC_WHAT; static CALC_WHAT what = CALC_INVALID; - int counter = 0; + static int counter = 0; if((stateUsed->mode != MODE_DIVE) || (stateUsed->diveSettings.diveMode == DIVEMODE_Apnea) || (decoLock != DECO_CALC_ready )) return;