changeset 683:6f5a18bb25be Betatest

Bugfix: Set actual gas after basic dive settings were created: Previous version showed unexpected warnings (ppo2 low) and deco data in simulator mode in case the dive mode had been changed before (e.g. from CCR to OC). Root cause was the update of the gas list before basic settings were set in the divesettings. To solve this the gas selection function has been moved behind the section initializing the gas variables.
author Ideenmodellierer
date Mon, 16 May 2022 20:50:26 +0200
parents 8775d3dc6325
children 9bc817e9e221
files Discovery/Src/data_central.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/data_central.c	Mon Apr 25 21:15:01 2022 +0200
+++ b/Discovery/Src/data_central.c	Mon May 16 20:50:26 2022 +0200
@@ -320,8 +320,6 @@
 	int i;
 	SSettings* pSettings = settingsGetPointer();
 
-	setActualGasFirst(&stateReal.lifeData);
-
 	stateReal.diveSettings.compassHeading = pSettings->compassBearing;
 	stateReal.diveSettings.ascentRate_meterperminute = 10;
 
@@ -339,6 +337,9 @@
 		stateReal.diveSettings.ccrOption = 0;
 	memcpy(stateReal.diveSettings.gas, pSettings->gas,sizeof(pSettings->gas));
 	memcpy(stateReal.diveSettings.setpoint, pSettings->setpoint,sizeof(pSettings->setpoint));
+
+	setActualGasFirst(&stateReal.lifeData);
+
 	stateReal.diveSettings.gf_high = pSettings->GF_high;
 	stateReal.diveSettings.gf_low = pSettings->GF_low;
 	stateReal.diveSettings.input_next_stop_increment_depth_bar = ((float)pSettings->stop_increment_depth_meter) / 10.0f;