# HG changeset patch # User Ideenmodellierer # Date 1738268686 -3600 # Node ID f0622dd93fdf81ab2c9a7a22d96457e487171896 # Parent 0b81ac558e89c3d949ca2c791d03210324668341 Bugfix ppo2 display in simulator mode: In the previous version a wrong ppo2 value was display if a digital O2 sensor was used. Rootcause was that the calibration data of the analog sensors was used. To fix this a default calibration coefficient is used (calibration is done within the sensor => no need to store it in OSTC) if the sensor is identified as digital O2 sensor. diff -r 0b81ac558e89 -r f0622dd93fdf Discovery/Src/simulation.c --- a/Discovery/Src/simulation.c Wed Jan 29 17:21:20 2025 +0100 +++ b/Discovery/Src/simulation.c Thu Jan 30 21:24:46 2025 +0100 @@ -183,21 +183,28 @@ for(index = 0; index < 3; index++) { - localCalibCoeff[index] = pSettings->ppo2sensors_calibCoeff[index]; - if(localCalibCoeff[index] < 0.01) + if(pDiveState->lifeData.extIf_sensor_map[index] == SENSOR_DIGO2M) + { + localCalibCoeff[index] = 0.01; + } + else { - for(index2 = 0; index2 < 3; index2++) /* no valid coeff => check other entries */ - { - if(pSettings->ppo2sensors_calibCoeff[index2] > 0.01) - { - localCalibCoeff[index] = pSettings->ppo2sensors_calibCoeff[index2]; - break; - } - if(index2 == 3) /* no coeff at all => use default */ - { - localCalibCoeff[index] = 0.02; - } - } + localCalibCoeff[index] = pSettings->ppo2sensors_calibCoeff[index]; + if(localCalibCoeff[index] < 0.01) + { + for(index2 = 0; index2 < 3; index2++) /* no valid coeff => check other entries */ + { + if(pSettings->ppo2sensors_calibCoeff[index2] > 0.01) + { + localCalibCoeff[index] = pSettings->ppo2sensors_calibCoeff[index2]; + break; + } + if(index2 == 3) /* no coeff at all => use default */ + { + localCalibCoeff[index] = 0.02; + } + } + } } } @@ -495,7 +502,9 @@ SDecoinfo* simulation_decoplaner(uint16_t depth_meter, uint16_t intervall_time_minutes, uint16_t dive_time_minutes, uint8_t *gasChangeListDepthGas20x2) { uint8_t ptrGasChangeList = 0; // new hw 160704 +#ifdef ENABLE_DECOCALC_OPTION uint8_t index = 0; +#endif for (int i = 0; i < 40; i++) gasChangeListDepthGas20x2[i] = 0;