Index: firmware/App/Controllers/ConductivitySensors.c =================================================================== diff -u -r9e5ee62245eb2a73b167eabd6c274a71a76a7b0e -re608f0a2bda2ad8df59a604a511cbd2a1c323dc3 --- firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 9e5ee62245eb2a73b167eabd6c274a71a76a7b0e) +++ firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision e608f0a2bda2ad8df59a604a511cbd2a1c323dc3) @@ -649,11 +649,27 @@ *************************************************************************/ static F32 getCalibrationAppliedConductivityValue( U32 sensorId, F32 compensatedValue ) { - F32 conductivity = pow( compensatedValue, 4 ) * condSensorsCalRecord.condSensors[ (CAL_DATA_DG_COND_SENSORS_T)sensorId ].fourthOrderCoeff + - pow( compensatedValue, 3 ) * condSensorsCalRecord.condSensors[ (CAL_DATA_DG_COND_SENSORS_T)sensorId ].thirdOrderCoeff + - pow( compensatedValue, 2 ) * condSensorsCalRecord.condSensors[ (CAL_DATA_DG_COND_SENSORS_T)sensorId ].secondOrderCoeff + - compensatedValue * condSensorsCalRecord.condSensors[ (CAL_DATA_DG_COND_SENSORS_T)sensorId ].gain + - condSensorsCalRecord.condSensors[ (CAL_DATA_DG_COND_SENSORS_T)sensorId ].offset; + CAL_DATA_DG_COND_SENSORS_T id = (CAL_DATA_DG_COND_SENSORS_T)sensorId; + F32 conductivity = 0.0F; + + if ( DG_MODE_CHEM == getCurrentOperationMode() ) + { + // If the mode is in chemical disinfect, use the chemical disinfect calibration data for CD1 and CD2 + if ( CAL_DATA_CD1_COND_SENSOR == id ) + { + id = CAL_DATA_CD1_CHEM_DIS_COND_SENSOR; + } + else if ( CAL_DATA_CD2_COND_SENSOR == id ) + { + id = CAL_DATA_CD2_CHEM_DIS_COND_SENSOR; + } + } + + conductivity = pow( compensatedValue, 4 ) * condSensorsCalRecord.condSensors[ id ].fourthOrderCoeff + + pow( compensatedValue, 3 ) * condSensorsCalRecord.condSensors[ id ].thirdOrderCoeff + + pow( compensatedValue, 2 ) * condSensorsCalRecord.condSensors[ id ].secondOrderCoeff + + compensatedValue * condSensorsCalRecord.condSensors[ id ].gain + + condSensorsCalRecord.condSensors[ id ].offset; return conductivity; }