Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -r3aa700c036437377bca1de55bc01307705abf0a5 -ra6ead936473ef260bbd330050fcf7e1b10120175 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 3aa700c036437377bca1de55bc01307705abf0a5) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision a6ead936473ef260bbd330050fcf7e1b10120175) @@ -241,7 +241,7 @@ /*********************************************************************//** * @brief - * TThe getBicarbDoseVol function gets the bicarb dose volume + * The getBicarbDoseVol function gets the bicarb dose volume * @details \b Inputs: bicarbDoseVolume * @details \b Outputs: none * @return TRUE if successful, FALSE if not. Index: firmware/App/Controllers/DryBiCart.c =================================================================== diff -u -r4e35963753273d2481691fceb799ca8d5819309a -ra6ead936473ef260bbd330050fcf7e1b10120175 --- firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision 4e35963753273d2481691fceb799ca8d5819309a) +++ firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision a6ead936473ef260bbd330050fcf7e1b10120175) @@ -104,7 +104,7 @@ static DRY_BICART_FILL_EXEC_STATE_T dryBiCartFillExecState; ///< Current state of dry bicart fill executive state machine. static BICARB_CHAMBER_FILL_EXEC_STATE_T bicarbChamberFillExecState; ///< Current state of bicarb chamber fill executive state machine. static DRY_BICART_DRAIN_EXEC_STATE_T dryBiCartDrainExecState; ///< Current state of dry bicart drain executive state machine -static DRY_BICART_DEPRESSURISE_EXEC_STATE_T dryBiCartDepressuriseExecState; ///< Current state of dry bicart depressurise executive state machine +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T dryBiCartDepressurizeExecState; ///< Current state of dry bicart depressurize executive state machine // fill static U32 dryBiCartFillStartTime; ///< Dry bicart fill start time. static U32 biCartFillCycleCounter; ///< Number of drybicart fill cycle @@ -119,7 +119,7 @@ static OVERRIDE_U32_T dryBiCartFillRequested; ///< Start/stop dry bicart fill. static OVERRIDE_U32_T bicarbChamberFillRequested; ///< Start/stop bicarb chamber fill. static OVERRIDE_U32_T dryBiCartDrainRequested; ///< Start/stop dry bicart drain. -static OVERRIDE_U32_T dryBiCartDepressuriseRequested; ///< Start/stop dry bicart depressurise +static OVERRIDE_U32_T dryBiCartDepressurizeRequested; ///< Start/stop dry bicart depressurize // publish static OVERRIDE_U32_T dryBiCartDataPublishInterval; ///< Dry bicart data publish interval. static U32 dryBiCartDataPublicationTimerCounter; ///< Used to schedule drybicart data publication to CAN bus. @@ -165,9 +165,9 @@ static DRY_BICART_DRAIN_EXEC_STATE_T handleDryBicartFluidDrainDurationCheckState( void ); static DRY_BICART_DRAIN_EXEC_STATE_T handleDryBicartFluidDrainEndState( void ); -static DRY_BICART_DEPRESSURISE_EXEC_STATE_T handleDryBicartDepressuriseStartState( void ); -static DRY_BICART_DEPRESSURISE_EXEC_STATE_T handleDryBicartDepressuriseVentStartState( void ); -static DRY_BICART_DEPRESSURISE_EXEC_STATE_T handleDryBicartDepressuriseVentEndState( void ); +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T handleDryBicartDepressurizeStartState( void ); +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T handleDryBicartDepressurizeVentStartState( void ); +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T handleDryBicartDepressurizeVentEndState( void ); static F32 getDryBicartLowerCartPressure( void ); static F32 getDryBicartUpperCartPressure( void ); @@ -454,36 +454,36 @@ /*********************************************************************//** * @brief - * The execDryBicartDepressurise function executes the dry bicart depressurise state machine. - * @details \b Inputs: dryBiCartDepressuriseExecState - * @details \b Outputs: dryBiCartDepressuriseExecState - * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when wrong dry bicart depressurise state + * The execDryBicartDepressurize function executes the dry bicart depressurize state machine. + * @details \b Inputs: dryBiCartDepressurizeExecState + * @details \b Outputs: dryBiCartDepressurizeExecState + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when wrong dry bicart depressurize state * invoked. * @return current state. *************************************************************************/ -U32 execDryBicartDepressurise( void ) +U32 execDryBicartDepressurize( void ) { - // execute drybicart drain state machine - switch ( dryBiCartDepressuriseExecState ) + // execute drybicart depressurize state machines + switch ( dryBiCartDepressurizeExecState ) { - case DRY_BICART_DEPRESSURISE_START_STATE: - dryBiCartDepressuriseExecState = handleDryBicartDepressuriseStartState(); + case DRY_BICART_DEPRESSURIZE_START_STATE: + dryBiCartDepressurizeExecState = handleDryBicartDepressurizeStartState(); break; - case DRY_BICART_DEPRESSURISE_VENT_START_STATE: - dryBiCartDepressuriseExecState = handleDryBicartDepressuriseVentStartState(); + case DRY_BICART_DEPRESSURIZE_VENT_START_STATE: + dryBiCartDepressurizeExecState = handleDryBicartDepressurizeVentStartState(); break; - case DRY_BICART_DEPRESSURISE_VENT_END_STATE: - dryBiCartDepressuriseExecState = handleDryBicartDepressuriseVentEndState(); + case DRY_BICART_DEPRESSURIZE_VENT_END_STATE: + dryBiCartDepressurizeExecState = handleDryBicartDepressurizeVentEndState(); break; default: - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_DRY_BICART_DEPRESURISE_INVALID_EXEC_STATE, dryBiCartDepressuriseExecState ); + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_DRY_BICART_DEPRESURIZE_INVALID_EXEC_STATE, dryBiCartDepressurizeExecState ); break; } - return dryBiCartDepressuriseExecState; + return dryBiCartDepressurizeExecState; } /*********************************************************************//** @@ -1259,29 +1259,6 @@ dryBiCartDrainTimePeriod = SMALL_DRY_BICART_MAX_DRAIN_TIME_MS; } - //Close D14 valve - setValveState( D14_VALV, VALVE_STATE_CLOSED ); - setValveState( D34_VALV, VALVE_STATE_CLOSED ); - setValveState( D35_VALV, VALVE_STATE_CLOSED ); - setValveState( D40_VALV, VALVE_STATE_CLOSED ); - setValveState( D91_VALV, VALVE_STATE_CLOSED ); - - // open bypass valve - setValveState( D34_VALV, VALVE_STATE_OPEN ); - - // open iofp drain valve - setValveState( M12_VALV, VALVE_STATE_OPEN ); - - // Open balancing chamber valves - valveControlForBCOpenState(); - - // Run D10 In Open loop mode(max speed 200ml/min) - setConcentratePumpTargetSpeed( D10_PUMP, DRAIN_BICART_PUMP_SPEED, DOSING_CONT_VOLUME ); - requestConcentratePumpOn( D10_PUMP ); - - // Run D48 at 1000 rpm,There is no improvement over above 1000 rpm for drain duration. - setDialysatePumpTargetRPM( D48_PUMP, DIAL_PUMP_DRAIN_RPM, TRUE ); - dryBiCartDrainStartTime = getMSTimerCount(); dryBiCartDrainLastCondSampleTime = dryBiCartDrainStartTime; dryBiCartDrainCondStableCount = 0; @@ -1304,14 +1281,33 @@ { DRY_BICART_DRAIN_EXEC_STATE_T state = DRY_BICART_FLUID_DRAIN_STATE; - // Open vent valves and close de-scaling valve - setValveState( D80_VALV, VALVE_STATE_OPEN ); + //Close D14 valve + setValveState( D14_VALV, VALVE_STATE_CLOSED ); + setValveState( D65_VALV, VALVE_STATE_CLOSED ); + setValveState( D35_VALV, VALVE_STATE_CLOSED ); + setValveState( D40_VALV, VALVE_STATE_CLOSED ); + setValveState( D91_VALV, VALVE_STATE_CLOSED ); setValveState( D81_VALV, VALVE_STATE_CLOSED ); - setValveState( D85_VALV, VALVE_STATE_OPEN ); + // Open vent valves and close descaling valve + setValveState( D80_VALV, VALVE_STATE_OPEN ); + setValveState( D85_VALV, VALVE_STATE_OPEN ); // Open D64 valve (vent for equilibrium) setValveState( D64_VALV, VALVE_STATE_OPEN ); + // open bypass valve + setValveState( D34_VALV, VALVE_STATE_OPEN ); + // TODO: open iofp drain valve, remove, this should be handled in IO/FP module. + setValveState( M12_VALV, VALVE_STATE_OPEN ); + // Open balancing chamber valves + valveControlForBCOpenState(); + // Run D10 In Open loop mode(max speed 200ml/min) + setConcentratePumpTargetSpeed( D10_PUMP, DRAIN_BICART_PUMP_SPEED, DOSING_CONT_VOLUME ); + requestConcentratePumpOn( D10_PUMP ); + + // Run D48 at 1000 rpm,There is no improvement over above 1000 rpm for drain duration. + setDialysatePumpTargetRPM( D48_PUMP, DIAL_PUMP_DRAIN_RPM, TRUE ); + state = DRY_BICART_FLUID_DRAIN_DURATION_CHECK_STATE; return state; @@ -1346,14 +1342,10 @@ setValveState( D64_VALV, VALVE_STATE_CLOSED ); setValveState( D80_VALV, VALVE_STATE_CLOSED ); setValveState( D85_VALV, VALVE_STATE_CLOSED ); - // close bypass valve setValveState( D34_VALV, VALVE_STATE_CLOSED ); - // TODO: close DD drain - setValveState( D53_VALV, VALVE_STATE_CLOSED ); - - // TODO : close iofp drain valve + // TODO : close iofp drain valve, remove this should be handled in IO/FP module. setValveState( M12_VALV, VALVE_STATE_CLOSED ); //close all balancing chamber valves @@ -1413,39 +1405,39 @@ /*********************************************************************//** * @brief - * The handleDryBicartDepressuriseStartState function set the one time actuation + * The handleDryBicartDepressurizeStartState function set the one time actuation * for drybicart de-pressurise request. - * @details \b Inputs: dryBiCartDepressuriseRequested + * @details \b Inputs: dryBiCartDepressurizeRequested * @details \b Outputs: none - * @return the next drybicart depressurise state. + * @return the next drybicart depressurize state. *************************************************************************/ -static DRY_BICART_DEPRESSURISE_EXEC_STATE_T handleDryBicartDepressuriseStartState( void ) +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T handleDryBicartDepressurizeStartState( void ) { - DRY_BICART_DEPRESSURISE_EXEC_STATE_T state = DRY_BICART_DEPRESSURISE_START_STATE; + DRY_BICART_DEPRESSURIZE_EXEC_STATE_T state = DRY_BICART_DEPRESSURIZE_START_STATE; - if ( TRUE == getU32OverrideValue( &dryBiCartDepressuriseRequested ) ) + if ( TRUE == getU32OverrideValue( &dryBiCartDepressurizeRequested ) ) { setValveState( D85_VALV, VALVE_STATE_OPEN ); - state = DRY_BICART_DEPRESSURISE_VENT_START_STATE; + state = DRY_BICART_DEPRESSURIZE_VENT_START_STATE; } return state; } /*********************************************************************//** * @brief - * The handleDryBicartDepressuriseVentStartState function handles the vent start state for + * The handleDryBicartDepressurizeVentStartState function handles the vent start state for * drybicart de-pressurise * @details \b Inputs: dryBiCarbSypplyVentStartTime, dryBiCartPersistenceStartTime * @details \b Outputs: none - * @return the next drybicart depressurise state. + * @return the next drybicart depressurize state. *************************************************************************/ -static DRY_BICART_DEPRESSURISE_EXEC_STATE_T handleDryBicartDepressuriseVentStartState( void ) +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T handleDryBicartDepressurizeVentStartState( void ) { - DRY_BICART_DEPRESSURISE_EXEC_STATE_T state = DRY_BICART_DEPRESSURISE_VENT_START_STATE; + DRY_BICART_DEPRESSURIZE_EXEC_STATE_T state = DRY_BICART_DEPRESSURIZE_VENT_START_STATE; - F32 d66Pressure = getFilteredPressure( D66_PRES ); + F32 d66Pressure = getFilteredPressure( D66_PRES ); if ( TRUE == didTimeout( dryBiCarbSypplyVentStartTime, DRY_BICART_SUPPLY_VENT_TIME_MS ) ) { @@ -1466,7 +1458,7 @@ setValveState( D85_VALV, VALVE_STATE_CLOSED ); dryBiCartPersistenceStartTime = 0; - state = DRY_BICART_DEPRESSURISE_VENT_END_STATE; + state = DRY_BICART_DEPRESSURIZE_VENT_END_STATE; } } else if ( ( TRUE == didTimeout( dryBiCarbSypplyVentStartTime, DRY_BICART_FILL_VENT_MAX_TIME_MS ) ) ) @@ -1475,7 +1467,7 @@ dryBiCartPersistenceStartTime = 0; dryBiCartFillVentTimeOut = TRUE; - state = DRY_BICART_DEPRESSURISE_VENT_END_STATE; + state = DRY_BICART_DEPRESSURIZE_VENT_END_STATE; } else { @@ -1488,22 +1480,22 @@ /*********************************************************************//** * @brief - * The handleDryBicartDepressuriseVentEndState function handles the vent end state for + * The handleDryBicartDepressurizeVentEndState function handles the vent end state for * drybicart de-pressurise * @details \b Inputs: none - * @details \b Outputs: dryBiCartDepressuriseRequested - * @return the next drybicart depressurise state. + * @details \b Outputs: dryBiCartDepressurizeRequested + * @return the next drybicart depressurize state. *************************************************************************/ -static DRY_BICART_DEPRESSURISE_EXEC_STATE_T handleDryBicartDepressuriseVentEndState( void ) +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T handleDryBicartDepressurizeVentEndState( void ) { - DRY_BICART_DEPRESSURISE_EXEC_STATE_T state = DRY_BICART_DEPRESSURISE_VENT_END_STATE; + DRY_BICART_DEPRESSURIZE_EXEC_STATE_T state = DRY_BICART_DEPRESSURIZE_VENT_END_STATE; // Go idle - dryBiCartDepressuriseRequested.data = FALSE; + dryBiCartDepressurizeRequested.data = FALSE; // for this request override also cleared - dryBiCartDepressuriseRequested.ovData = FALSE; + dryBiCartDepressurizeRequested.ovData = FALSE; - state = DRY_BICART_DEPRESSURISE_START_STATE; + state = DRY_BICART_DEPRESSURIZE_START_STATE; return state; } @@ -1636,17 +1628,17 @@ /*********************************************************************//** * @brief - * The testDryBiCartDepressuriseRequestOverride function starts/stops the bicart - * depressurise request - * @details \b Inputs: dryBiCartDepressuriseRequested - * @details \b Outputs: dryBiCartDepressuriseRequested + * The testDryBiCartDepressurizeRequestOverride function starts/stops the bicart + * depressurize request + * @details \b Inputs: dryBiCartDepressurizeRequested + * @details \b Outputs: dryBiCartDepressurizeRequested * @param message set message from Dialin which includes the bicart - * depressurise request start/stop. + * depressurize request start/stop. * @return TRUE if set request is successful, FALSE if not *************************************************************************/ -BOOL testDryBiCartDepressuriseRequestOverride( MESSAGE_T *message ) +BOOL testDryBiCartDepressurizeRequestOverride( MESSAGE_T *message ) { - BOOL result = u32Override( message, &dryBiCartDepressuriseRequested, FALSE, TRUE ); + BOOL result = u32Override( message, &dryBiCartDepressurizeRequested, FALSE, TRUE ); return result; } Index: firmware/App/Controllers/DryBiCart.h =================================================================== diff -u -r3aa700c036437377bca1de55bc01307705abf0a5 -ra6ead936473ef260bbd330050fcf7e1b10120175 --- firmware/App/Controllers/DryBiCart.h (.../DryBiCart.h) (revision 3aa700c036437377bca1de55bc01307705abf0a5) +++ firmware/App/Controllers/DryBiCart.h (.../DryBiCart.h) (revision a6ead936473ef260bbd330050fcf7e1b10120175) @@ -58,7 +58,7 @@ U32 execDryBicartFillMode( void ); U32 execBicarbChamberFillMode( void ); U32 execDryBicartDrainMode( void ); -U32 execDryBicartDepressurise( void ); +U32 execDryBicartDepressurize( void ); void execDryBicart( void ); BOOL setBicarbChamberFillRequested( void ); BOOL getBicarbChamberFillRequested( void ); @@ -72,7 +72,7 @@ BOOL testDryBiCartFillRequestOverride( MESSAGE_T *message ); BOOL testBiCarbChamberFillRequestOverride( MESSAGE_T *message ); BOOL testDryBiCartDrainRequestOverride( MESSAGE_T *message ); -BOOL testDryBiCartDepressuriseRequestOverride( MESSAGE_T *message ); +BOOL testDryBiCartDepressurizeRequestOverride( MESSAGE_T *message ); BOOL testDryBiCartTypeOverride( MESSAGE_T *message ); BOOL testDryBiCartUpperCartPressureOverride( MESSAGE_T *message ); Index: firmware/App/Controllers/MixingControl.c =================================================================== diff -u -r32fffec9aca122c13f1d664b4c910bda2c8f1186 -ra6ead936473ef260bbd330050fcf7e1b10120175 --- firmware/App/Controllers/MixingControl.c (.../MixingControl.c) (revision 32fffec9aca122c13f1d664b4c910bda2c8f1186) +++ firmware/App/Controllers/MixingControl.c (.../MixingControl.c) (revision a6ead936473ef260bbd330050fcf7e1b10120175) @@ -357,7 +357,7 @@ *************************************************************************/ void execMixingControl( void ) { - if( getCurrentBalancingChamberExecState() > BAL_CHAMBER_STATE_IDLE ) + if ( getCurrentBalancingChamberExecState() > BAL_CHAMBER_STATE_IDLE ) { // closed loop bicarb and acid mixing controller handleDialysateCompositionMixing(); Index: firmware/App/Services/AlarmMgmtSWFaults.h =================================================================== diff -u -r3aa700c036437377bca1de55bc01307705abf0a5 -ra6ead936473ef260bbd330050fcf7e1b10120175 --- firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision 3aa700c036437377bca1de55bc01307705abf0a5) +++ firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision a6ead936473ef260bbd330050fcf7e1b10120175) @@ -160,7 +160,7 @@ SW_FAULT_ID_MODE_UPDATE_INVALID_STATE = 129, SW_FAULT_ID_SUBSTITUTION_PUMP_INVALID_ID = 130, SW_FAULT_ID_SUBSTITUTION_PUMP_EXEC_INVALID_STATE = 131, - SW_FAULT_ID_DRY_BICART_DEPRESURISE_INVALID_EXEC_STATE = 132, + SW_FAULT_ID_DRY_BICART_DEPRESURIZE_INVALID_EXEC_STATE = 132, NUM_OF_SW_FAULT_IDS } DD_SW_FAULT_ID_T; Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r77f2b5f8f77b9776f575290f0945e9d3d5b6a2b7 -ra6ead936473ef260bbd330050fcf7e1b10120175 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 77f2b5f8f77b9776f575290f0945e9d3d5b6a2b7) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision a6ead936473ef260bbd330050fcf7e1b10120175) @@ -298,7 +298,7 @@ { MSG_ID_DD_CONDUCTIVITY_SENSOR_CAL_REQUEST, &testHandleConductivitySensorCalRequest }, { MSG_ID_FP_CONDUCTIVITY_SENSOR_CAL_REQUEST, &testHandleConductivitySensorCalRequest }, { MSG_ID_DD_MIXING_CONTROL_DATA_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testMixingControlDataPublishIntervalOverride }, - { MSG_ID_DD_BICART_DEPRESSURISE_REQUEST_OVERRIDE_REQUEST, &testDryBiCartDepressuriseRequestOverride }, + { MSG_ID_DD_BICART_DEPRESSURISE_REQUEST_OVERRIDE_REQUEST, &testDryBiCartDepressurizeRequestOverride }, }; /// Calculation for number of entries in the incoming message function handler look-up table. Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -r3aa700c036437377bca1de55bc01307705abf0a5 -ra6ead936473ef260bbd330050fcf7e1b10120175 --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 3aa700c036437377bca1de55bc01307705abf0a5) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision a6ead936473ef260bbd330050fcf7e1b10120175) @@ -100,9 +100,11 @@ if ( FALSE == getTestConfigStatus( TEST_CONFIG_DD_DISABLE_DRY_BICARB ) ) { - // manage drybicart state machines + // manage drybicart fill, supply and drain state machines execDryBicart(); - execDryBicartDepressurise(); + + // manage drybicart depressurize state machines + execDryBicartDepressurize(); } execMixingControl();