comparison Discovery/Src/base.c @ 223:5f535ef6a3db div-fixes-3

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 <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Sun, 31 Mar 2019 15:14:06 +0200
parents ce05c801b002
children 2bb1db22b5f5
comparison
equal deleted inserted replaced
222:9b4b3decd9ba 223:5f535ef6a3db
1667 CALC_BUEHLMANN_FUTURE, 1667 CALC_BUEHLMANN_FUTURE,
1668 CALC_INVALID 1668 CALC_INVALID
1669 } CALC_WHAT; 1669 } CALC_WHAT;
1670 1670
1671 static CALC_WHAT what = CALC_INVALID; 1671 static CALC_WHAT what = CALC_INVALID;
1672 int counter = 0; 1672 static int counter = 0;
1673 if((stateUsed->mode != MODE_DIVE) || (stateUsed->diveSettings.diveMode == DIVEMODE_Apnea) || (decoLock != DECO_CALC_ready )) 1673 if((stateUsed->mode != MODE_DIVE) || (stateUsed->diveSettings.diveMode == DIVEMODE_Apnea) || (decoLock != DECO_CALC_ready ))
1674 return; 1674 return;
1675 1675
1676 decoLock = DECO_CALC_running; 1676 decoLock = DECO_CALC_running;
1677 1677