# HG changeset patch # User Ideenmodellierer # Date 1652727026 -7200 # Node ID 6f5a18bb25bee44f04875a4cb1b7106e41eb0b28 # Parent 8775d3dc6325e3a18a4ea6bbb602aa4d02e10ea6 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. diff -r 8775d3dc6325 -r 6f5a18bb25be Discovery/Src/data_central.c --- 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;