Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -r8e62ede02d0f1d4bfc8aebbfa75a5ce308c994bd -r63c61071a2fbef248bc13d3959abed0586736e73 --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 8e62ede02d0f1d4bfc8aebbfa75a5ce308c994bd) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 63c61071a2fbef248bc13d3959abed0586736e73) @@ -97,15 +97,15 @@ // ********** private data ********** -/// Fill for calibration check enumeration -typedef enum fill_for_cal +/// Fill for calibration check enumeration from dialin +typedef enum dialin_fill_for_cal { - FILL_FOR_CAL_PRIME = 0, ///< Fill for calibration prime. - FILL_FOR_CAL_BICARB_CHECK, ///< Fill for calibration bicarb check. - FILL_FOR_CAL_ACID_CHECK, ///< Fill for calibration acid check. - FILL_FOR_CAL_NONE, ///< Fill for calibration none. - NUM_OF_FILL_FOR_CAL ///< Number of fill for calibration. -} FILL_FOR_CAL_CHECK_T; + DIALIN_FILL_FOR_CAL_PRIME = 0, ///< Dialin fill for calibration prime. + DIALIN_FILL_FOR_CAL_BICARB_CHECK, ///< Dialin fill for calibration bicarb check. + DIALIN_FILL_FOR_CAL_ACID_CHECK, ///< Dialin fill for calibration acid check. + DIALIN_FILL_FOR_CAL_NONE, ///< Dialin fill for calibration none. + NUM_OF_DIALIN_FILL_FOR_CAL ///< Number of dialin fill for calibration. +} DIALIN_FILL_FOR_CAL_CHECK_T; /// Fill conditions status typedef struct @@ -170,7 +170,7 @@ static BOOL hasROOnlyModeBeenEnabled = FALSE; ///< Flag to indicate the RO only mode has been set or not. // NOTE: This variable should be initialized here because the init function is called every time and then it cannot be initialized there. This variable is // set via Dialin for calibration check purposes only -static FILL_FOR_CAL_CHECK_T fillForCalCheck = FILL_FOR_CAL_NONE; ///< Fill for calibration check. +static DIALIN_FILL_FOR_CAL_CHECK_T dialinFillForCalCheck = DIALIN_FILL_FOR_CAL_NONE; ///< Dialin fill for calibration check. static OVERRIDE_F32_T usedAcidVolumeML = { 0.0, 0.0, 0.0, 0.0 }; ///< The integrated acid concentration volume has been used in mL. static OVERRIDE_F32_T usedBicarbVolumeML = { 0.0, 0.0, 0.0, 0.0 }; ///< The integrated bicarb concentration volume has been used in mL. static OVERRIDE_U32_T fillModeDataPublishInterval = { FILL_MODE_DATA_PUB_INTERVAL, @@ -630,23 +630,26 @@ result = DG_FILL_MODE_STATE_PRODUCE_DIALYSATE; } - switch ( fillForCalCheck ) + if ( TRUE == isTestingActivated() ) { - case FILL_FOR_CAL_PRIME: - result = DG_FILL_MODE_STATE_PRIME_CONCENTRATE_LINES; - break; + switch ( dialinFillForCalCheck ) + { + case DIALIN_FILL_FOR_CAL_PRIME: + result = DG_FILL_MODE_STATE_PRIME_CONCENTRATE_LINES; + break; - case FILL_FOR_CAL_BICARB_CHECK: - result = DG_FILL_MODE_STATE_TEST_BICARB_CONDUCTIVITY; - break; + case DIALIN_FILL_FOR_CAL_BICARB_CHECK: + result = DG_FILL_MODE_STATE_TEST_BICARB_CONDUCTIVITY; + break; - case FILL_FOR_CAL_ACID_CHECK: - result = DG_FILL_MODE_STATE_TEST_ACID_CONDUCTIVITY; - break; + case DIALIN_FILL_FOR_CAL_ACID_CHECK: + result = DG_FILL_MODE_STATE_TEST_ACID_CONDUCTIVITY; + break; - default: - // Do nothing. This means there is not a request for the fill calibration check so proceed with the normal operations. - break; + default: + // Do nothing. This means there is not a request for the fill calibration check so proceed with the normal operations. + break; + } } setModeFillStateTransition( result ); @@ -1093,11 +1096,11 @@ pumpSpeedIndex = 0; setROPumpTargetFlowRateLPM( RO_PUMP_FLUSH_BUBBLES_FLOWS[ pumpSpeedIndex ] / MILLILITERS_PER_LITER, TARGET_RO_PRESSURE_PSI ); flushBubblesStartTime = getMSTimerCount(); - if ( FILL_FOR_CAL_PRIME == fillForCalCheck ) + if ( ( DIALIN_FILL_FOR_CAL_PRIME == dialinFillForCalCheck ) && ( TRUE == isTestingActivated() ) ) { // After prime, the state transitions to flush bubbles. If the cal for check prime was set, transition to Gen Idle and // set the fill for cal check to none. This is done upon the transition of the next state so then we can transition to Gen Idle. - fillForCalCheck = FILL_FOR_CAL_NONE; + dialinFillForCalCheck = DIALIN_FILL_FOR_CAL_NONE; requestNewOperationMode( DG_MODE_GENE ); } break; @@ -1131,13 +1134,13 @@ bicarbConductivitySampleCount = 0; acidConductivitySampleCount = 0; concentrateTestStartTime = getMSTimerCount(); - if ( FILL_FOR_CAL_BICARB_CHECK == fillForCalCheck ) + if ( ( DIALIN_FILL_FOR_CAL_BICARB_CHECK == dialinFillForCalCheck ) && ( TRUE == isTestingActivated() ) ) { // After bicarb test, the state transitions to acid test. If the cal for check prime was set, transition to Gen Idle and // set the fill for cal check to none. This is done upon the transition of the next state so then we can transition to Gen Idle. // NOTE: If the bicarb test fails, it transitions to fault mode so it automatically exits mode fill so this is only for the situation // that bicarb test was successful - fillForCalCheck = FILL_FOR_CAL_NONE; + dialinFillForCalCheck = DIALIN_FILL_FOR_CAL_NONE; requestNewOperationMode( DG_MODE_GENE ); } break; @@ -1149,13 +1152,13 @@ requestConcentratePumpOn( CONCENTRATEPUMPS_CP2_BICARB ); concPumpPrimeStartTimeMS = getMSTimerCount(); fillStatus.isThisFirstFill = FALSE; - if ( FILL_FOR_CAL_ACID_CHECK == fillForCalCheck ) + if ( ( DIALIN_FILL_FOR_CAL_ACID_CHECK == dialinFillForCalCheck ) && ( TRUE == isTestingActivated() ) ) { // After acid test, the state transitions to acid test. If the cal for check prime was set, transition to Gen Idle and // set the fill for cal check to none. This is done upon the transition of the next state so then we can transition to Gen Idle. // NOTE: If the acid test fails, it transitions to fault mode so it automatically exits mode fill so this is only for the situation // that bicarb test was successful - fillForCalCheck = FILL_FOR_CAL_NONE; + dialinFillForCalCheck = DIALIN_FILL_FOR_CAL_NONE; requestNewOperationMode( DG_MODE_GENE ); } break; @@ -1532,9 +1535,9 @@ { BOOL result = FALSE; - if ( calForCheck < NUM_OF_FILL_FOR_CAL ) + if ( ( calForCheck < NUM_OF_DIALIN_FILL_FOR_CAL ) && ( TRUE == isTestingActivated() ) ) { - fillForCalCheck = (FILL_FOR_CAL_CHECK_T)calForCheck; + dialinFillForCalCheck = (DIALIN_FILL_FOR_CAL_CHECK_T)calForCheck; result = TRUE; }