changeset 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 9b4b3decd9ba
children ceecabfddb57
files Discovery/Src/base.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;