diff Discovery/Src/data_central.c @ 771:29d9b5bc7946

Revised automatic setpoint change. The proposed approach is essentially the approach used by most controllers of eCCR ('upshift' on descent, 'downshift' on ascent), so that the OSTC4 when used as a backup computer for eCCR will make the changes at the same time as the eCCR itself.
author heinrichsweikamp
date Fri, 21 Apr 2023 09:48:23 +0200
parents 8a2337c7af52
children 6169309d6eb9
line wrap: on
line diff
--- a/Discovery/Src/data_central.c	Fri Apr 21 09:47:44 2023 +0200
+++ b/Discovery/Src/data_central.c	Fri Apr 21 09:48:23 2023 +0200
@@ -501,8 +501,10 @@
 	lifeData->actualGas.change_during_ascent_depth_meter_otherwise_zero = 0;
 	lifeData->actualGas.AppliedDiveMode = stateUsed->diveSettings.diveMode;
 	lifeData->actualGas.pscr_factor = 1.0 / pSettings->pscr_lung_ratio * pSettings->pscr_o2_drop;
-	if(isLoopMode(pSettings->dive_mode) && (gasId > NUM_OFFSET_DILUENT))
+	if (isLoopMode(pSettings->dive_mode) && gasId > NUM_OFFSET_DILUENT) {
 		lifeData->lastDiluent_GasIdInSettings = gasId;
+        lifeData->lastSetpointChangeDepthM = lifeData->depth_meter;
+    }
 }