Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -r61c74b7c3a092f9e2900665f1a4f0391f78c5c03 -reeac2a1df1afbdcf4d1775b62cc810582472404d --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 61c74b7c3a092f9e2900665f1a4f0391f78c5c03) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision eeac2a1df1afbdcf4d1775b62cc810582472404d) @@ -8,7 +8,7 @@ * @file ModeFill.c * * @author (last) Dara Navaei -* @date (last) 21-Feb-2024 +* @date (last) 07-Mar-2024 * * @author (original) Leonardo Baloa * @date (original) 19-Nov-2019 @@ -785,9 +785,8 @@ if ( TRUE == didTimeout( concentrateTestStartTime, CONCENTRATE_TEST_TIME_OUT_MS ) ) { - F32 acidCondUSPerCM = chemicalsCond.fillCondValues[ chemicalsTypes.acidType ][ FILL_COND_ACID_TEST ].acidConduSPerCM; + F32 acidCondUSPerCM = chemicalsCond.fillCondValues[ chemicalsTypes.acidType ][ FILL_COND_ACID_TEST ].bicarbConduSPerCM; BOOL hasAcidTestPassed = FALSE; - BOOL hasCD1CD2TestPassed = FALSE; averageBicarbConductivity = totalBicarbConductivity / bicarbConductivitySampleCount; averageAcidConductivity = totalAcidConductivity / acidConductivitySampleCount; @@ -808,17 +807,8 @@ SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DG_ACID_CONDUCTIVITY_OUT_OF_RANGE, averageBicarbConductivity, acidCondUSPerCM ) } - if ( ( pctDiffInConductivity < FIVE_PERCENT_FACTOR ) || ( TRUE == getTestConfigStatus( TEST_CONFIG_MIX_WITH_WATER ) ) ) + if ( TRUE == hasAcidTestPassed ) { - hasCD1CD2TestPassed = TRUE; - } - else - { - SET_ALARM_WITH_1_F32_DATA( ALARM_ID_DG_CD1_CD2_CHECK_FAULT, pctDiffInConductivity ) - } - - if ( ( TRUE == hasAcidTestPassed ) && ( TRUE == hasCD1CD2TestPassed ) ) - { result = DG_FILL_MODE_STATE_PRODUCE_DIALYSATE; setModeFillStateTransition( result ); } @@ -847,18 +837,16 @@ if ( TRUE == didTimeout( concPumpPrimeStartTimeMS, CONC_PUMPS_PRIME_CHECK_COND_SNSRS_TIME_OUT_MS ) ) { /* Once the time for priming the concentrate lines has elapsed, check the mixing conductivity of the sensors - * If the acid and bicarb conductivity values are at about 100% of the target concentrate during fill, transition to the next state - * If the acid and bicarb conductivity values are not at 100% but the maximum prime time has elapsed, transition to the next state + * If the bicarb conductivity values are at about 100% of the target concentrate during fill, transition to the next state + * If the bicarb conductivity values are not at 100% but the maximum prime time has elapsed, transition to the next state */ - F32 acidConduSPerCM = getConductivityValue( CONDUCTIVITYSENSORS_CD1_SENSOR ); F32 bicarbConduSPerCM = getConductivityValue( CONDUCTIVITYSENSORS_CD2_SENSOR ); - F32 acidFillConduSPerCM = chemicalsCond.fillCondValues[ chemicalsTypes.acidType ][ FILL_COND_NORMAL_OP ].acidConduSPerCM; F32 bicarbFillConduSPerCM = chemicalsCond.fillCondValues[ chemicalsTypes.acidType ][ FILL_COND_NORMAL_OP ].bicarbConduSPerCM; /* we are insisting conductivity reach 100% of expected level since signal is very noisy and peak noise will reach 100% when average is about 93%. * if sensor noise is reduced, this level should also be reduced accordingly. */ - if ( ( acidConduSPerCM >= ( acidFillConduSPerCM * HUNDRED_PERCENT_FACTOR ) ) && ( bicarbConduSPerCM >= ( bicarbFillConduSPerCM * HUNDRED_PERCENT_FACTOR ) ) ) + if ( bicarbConduSPerCM >= ( bicarbFillConduSPerCM * HUNDRED_PERCENT_FACTOR ) ) { result = DG_FILL_MODE_STATE_DELIVER_DIALYSATE; setModeFillStateTransition( result );