Index: firmware/App/Controllers/DryBiCart.c =================================================================== diff -u -r11c6fba719b5759b7261775fbcf87ad2862c7562 -re9d780d77db564793278dac7dc613354f7b93049 --- firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision 11c6fba719b5759b7261775fbcf87ad2862c7562) +++ firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision e9d780d77db564793278dac7dc613354f7b93049) @@ -101,7 +101,7 @@ DRY_BICART_SUPPLY, ///< Dry bicart chamber fill DRY_BICART_DRAIN, ///< Dry bicart drain DRY_BICART_DEPRESSURIZE, ///< Dry bicart depressurize - DRY_BICART_PRE_GEN_CHAMBER_FILL, + DRY_BICART_PRE_GEN_CHAMBER_FILL, ///< Dry bicart pre generate no delivery fill. NUM_OF_DRY_BICART_OPERATION ///< Number of dry bicart operation } DRY_BICART_OPERATION_T; @@ -111,7 +111,7 @@ 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_DEPRESSURIZE_EXEC_STATE_T dryBiCartDepressurizeExecState; ///< Current state of dry bicart depressurize executive state machine -static BICARB_CHAMBER_PRE_GEN_FILL_EXEC_STATE_T bicarbChamberPreGenFillExecState; +static BICARB_CHAMBER_PRE_GEN_FILL_EXEC_STATE_T bicarbChamberPreGenFillExecState; ///< Current state of dry bicart pre gen fill executive state machine. // fill static U32 dryBiCartFillStartTime; ///< Dry bicart fill start time. static U32 biCartFillCycleCounter; ///< Number of drybicart fill cycle @@ -144,8 +144,8 @@ //static U32 dryBiCartDrainCondStableCount; ///< Debounce counter for "zero" conductivity static U32 dryBiCartDrainTimePeriod; ///< Dry bicart drain time period -static U32 dryBiCarbPreGenSupplyStartTime; -static U32 dryBiCartPreGenPersistenceStartTime; +static U32 dryBiCarbPreGenSupplyStartTime; ///< Dry bicart pre gen supply start time. +static U32 dryBiCartPreGenPersistenceStartTime; ///< Dry bicart pre gen persistense start time. static U32 drybicartPreGenPersistenceOnLowercartPressureStartTime; ///< Dry bicart Persistence on lower cart pressure start time. static U32 dryBiCartPersistenceStartTime; ///< Dry bicart Persistence time. static U32 drybicartPersistenceOnLowercartPressureStartTime; ///< Dry bicart Persistence on lower cart pressure start time. @@ -536,10 +536,10 @@ /*********************************************************************//** * @brief - * The execBicarbChamberFillMode function executes the bicarb chamber fill - * (delivering bicarbonate from Bicart assembly to chamber F)state machine. - * @details \b Inputs: bicarbChamberFillExecState - * @details \b Outputs: bicarbChamberFillExecState + * The execBicarbChamberPreGenFillMode function executes the bicarb chamber fill + * (delivering bicarbonate from Bicart assembly to chamber F) state machine for pre gen. + * @details \b Inputs: bicarbChamberPreGenFillExecState + * @details \b Outputs: bicarbChamberPreGenFillExecState * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when wrong bicarb chamber * fill state invoked. * @return current state. @@ -579,7 +579,7 @@ break; default: - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_BICARB_CHAMBER_FILL_INVALID_EXEC_STATE, bicarbChamberFillExecState ); + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_BICARB_CHAMBER_PRE_GEN_FILL_INVALID_EXEC_STATE, bicarbChamberPreGenFillExecState ); break; } @@ -600,6 +600,7 @@ BOOL result = FALSE; BOOL requestStatus = getU32OverrideValue( &bicarbChamberPreGenFillRequested ) \ || getU32OverrideValue( &dryBiCartDrainRequested ) || \ + getU32OverrideValue( &dryBiCartFillRequested ) || \ getU32OverrideValue( &dryBiCartDepressurizeRequested ) ; //ensure that there is no other operation in progress before new request set to true @@ -659,8 +660,10 @@ BOOL result = FALSE; BOOL requestStatus = getU32OverrideValue( &dryBiCartFillRequested ) ||\ getU32OverrideValue( &dryBiCartDrainRequested ) || \ - getU32OverrideValue( &dryBiCartDepressurizeRequested ); + getU32OverrideValue( &dryBiCartDepressurizeRequested )|| \ + getU32OverrideValue( &bicarbChamberPreGenFillRequested ); + // ensure that there is no other operation in progress before new request set to true if ( FALSE == requestStatus ) { @@ -745,8 +748,10 @@ BOOL result = FALSE; BOOL requestStatus = getU32OverrideValue( &bicarbChamberFillRequested ) \ || getU32OverrideValue( &dryBiCartDrainRequested ) || \ - getU32OverrideValue( &dryBiCartDepressurizeRequested ) ; + getU32OverrideValue( &dryBiCartDepressurizeRequested ) || \ + getU32OverrideValue( &bicarbChamberPreGenFillRequested ); + //ensure that there is no other operation in progress before new request set to true if ( FALSE == requestStatus ) { @@ -791,8 +796,10 @@ BOOL result = FALSE; BOOL requestStatus = getU32OverrideValue( &bicarbChamberFillRequested ) || \ getU32OverrideValue( &dryBiCartFillRequested ) || \ - getU32OverrideValue( &dryBiCartDepressurizeRequested ); + getU32OverrideValue( &dryBiCartDepressurizeRequested ) || \ + getU32OverrideValue( &bicarbChamberPreGenFillRequested ); + //ensure that there is no other operation in progress before new request set to true if ( FALSE == requestStatus ) { @@ -836,7 +843,8 @@ BOOL result = FALSE; BOOL requestStatus = getU32OverrideValue( &bicarbChamberFillRequested ) || \ getU32OverrideValue( &dryBiCartFillRequested ) || \ - getU32OverrideValue( &dryBiCartDrainRequested ); + getU32OverrideValue( &dryBiCartDrainRequested ) || \ + getU32OverrideValue( &bicarbChamberPreGenFillRequested ); //ensure that there is no other operation in progress before new request set to true if ( FALSE == requestStatus ) @@ -1822,7 +1830,7 @@ /*********************************************************************//** * @brief - * The handleBicarbChamberStartState function wait for bicarb chamber fill request + * The handleBicarbChamberPreGenStartState function wait for pre gen bicarb chamber fill request * @details \b Inputs: bicarbChamberFillRequested * @details \b Outputs: none * @return the next drybicart fluid drain state. @@ -1842,7 +1850,7 @@ } /*********************************************************************//** * @brief - * The handleBicarbChamberCartridgeFillWaterStartState function fill water in the dry bicart + * The handleBicarbChamberPreGenCartridgeFillWaterStartState function fill water in the dry bicart * @details \b Inputs: none * @details \b Outputs: valve states, dryBiCarbSupplyStartTime, dryBiCartPersistenceStartTime * @return the next bicarb cartridge fill water end state. @@ -1869,8 +1877,8 @@ /*********************************************************************//** * @brief - * The handleBicarbChamberCartridgeFillWaterStartState function stop water in the dry bicart - * @details \b Inputs: D66 pressure, dryBiCartPersistenceStartTime + * The handleBicarbChamberPreGenCartridgeFillWaterEndState function stop water in the dry bicart + * @details \b Inputs: D66 pressure, dryBiCartPreGenPersistenceStartTime * @details \b Outputs: valve states * @return the next bicarb chamber check level state. *************************************************************************/ @@ -1909,9 +1917,9 @@ /*********************************************************************//** * @brief - * The handleBicarbChamberSupplyStart function open the bicarb inlet valve (D80). + * The handleBicarbChamberPreGenSupplyStart function open the bicarb inlet valve (D80). * @details \b Inputs: none - * @details \b Outputs: valve states, dryBiCarbSupplyStartTime + * @details \b Outputs: valve states, dryBiCarbPreGenSupplyStartTime * @return the next bicarb chamber fill state. *************************************************************************/ static BICARB_CHAMBER_PRE_GEN_FILL_EXEC_STATE_T handleBicarbChamberPreGenSupplyStart( void ) @@ -1933,10 +1941,10 @@ /*********************************************************************//** * @brief - * The handleBicarbChamberPressureCheckStartState function actuates the vent valve + * The handleBicarbChamberPreGenPressureCheckState function actuates the vent valve * present in the Bicart assembly. - * @details \b Inputs: D66 Pressure, D63 level, dryBiCarbSupplyStartTime, - * dryBiCarbSypplyVentStartTime, dryBiCartPersistenceStartTime, bicarbChamberLevel, + * @details \b Inputs: D66 Pressure, D63 level, dryBiCarbPreGenSupplyStartTime, + * dryBiCarbSupplyVentStartTime, dryBiCartPersistenceStartTime, bicarbChamberLevel, * dryBiCartPressureDecayStartTimeFlag, drybicartPersistenceOnLowercartPressureStartTime * @details \b Outputs: dryBiCarbSypplyVentStartTime * @return the next bicarb chamber Supply Vent Start state. @@ -2015,9 +2023,9 @@ /*********************************************************************//** * @brief - * The handleBicarbChamberSupplyVentStartState function actuates the vent valve + * The handleBicarbChamberPreGenSupplyVentStartState function actuates the vent valve * present in the Bicart assembly. - * @details \b Inputs: dryBiCarbSypplyVentStartTime, dryBiCartPersistenceStartTime + * @details \b Inputs: dryBiCarbSypplyVentStartTime, dryBiCartPreGenPersistenceStartTime * @details \b Outputs: dryBiCarbSypplyVentStartTime * @return the next bicarb chamber Supply Vent End state. *************************************************************************/ @@ -2067,10 +2075,10 @@ /*********************************************************************//** * @brief - * The handleBicarbChamberSupplyVentEndState function actuates the vent valve + * The handleBicarbChamberPreGenSupplyVentEndState function actuates the vent valve * present in the Bicart assembly. - * @details \b Inputs: dryBiCarbSypplyVentStartTime - * @details \b Outputs: bicarbChamberFillRequested + * @details \b Inputs: dryBiCartPressureDecayStartTimeFlag + * @details \b Outputs: bicarbChamberPreGenFillRequested * @return the next bicarb chamber start state. *************************************************************************/ static BICARB_CHAMBER_PRE_GEN_FILL_EXEC_STATE_T handleBicarbChamberPreGenSupplyVentEndState(void) @@ -2201,6 +2209,23 @@ /*********************************************************************//** * @brief + * The testPreGenBiCarbChamberFillRequestOverride function starts/stops the pre gen bicarb + * chamber F fill. + * @details \b Inputs: bicarbChamberPreGenFillRequested + * @details \b Outputs: bicarbChamberPreGenFillRequested + * @param message set message from Dialin which includes the bicarb chamber + * fill start/stop. + * @return TRUE if set request is successful, FALSE if not + *************************************************************************/ +BOOL testPreGenBiCarbChamberFillRequestOverride( MESSAGE_T *message ) +{ + BOOL result = u32Override( message, &bicarbChamberPreGenFillRequested, FALSE, TRUE ); + + return result; +} + +/*********************************************************************//** + * @brief * The testDryBiCartDrainRequestOverride function starts/stops the bicart * drain request * @details \b Inputs: dryBiCartDrainRequested Index: firmware/App/Controllers/DryBiCart.h =================================================================== diff -u -rfc8066063a8661238cc763832484d00edd5b9312 -re9d780d77db564793278dac7dc613354f7b93049 --- firmware/App/Controllers/DryBiCart.h (.../DryBiCart.h) (revision fc8066063a8661238cc763832484d00edd5b9312) +++ firmware/App/Controllers/DryBiCart.h (.../DryBiCart.h) (revision e9d780d77db564793278dac7dc613354f7b93049) @@ -48,7 +48,7 @@ U32 dryBiCartCurrentFillTime; ///< Dry bicart current fill duration in milli second U32 dryBiCartType; ///< Dry bicart type (small-0/large-1) U32 dryBiCartDrainTimePeriod; ///< Dry bicart drain time based on catridge type (small/large) - U32 dryBiCartPreGenFillState; + U32 dryBiCartPreGenFillState; ///< Dry bicart pre generate fill state } DRY_BICART_DATA_T; #pragma pack(pop) @@ -79,7 +79,7 @@ BOOL testDryBiCartDrainRequestOverride( MESSAGE_T *message ); BOOL testDryBiCartDepressurizeRequestOverride( MESSAGE_T *message ); BOOL testDryBiCartTypeOverride( MESSAGE_T *message ); - +BOOL testPreGenBiCarbChamberFillRequestOverride( MESSAGE_T *message ); BOOL testDryBiCartUpperCartPressureOverride( MESSAGE_T *message ); BOOL testDryBiCartLowerCartPressureOverride( MESSAGE_T *message ); Index: firmware/App/Modes/ModePreGenDialysate.c =================================================================== diff -u -r0452674a0f7a356ab65d147d8222b6efabfd0bf7 -re9d780d77db564793278dac7dc613354f7b93049 --- firmware/App/Modes/ModePreGenDialysate.c (.../ModePreGenDialysate.c) (revision 0452674a0f7a356ab65d147d8222b6efabfd0bf7) +++ firmware/App/Modes/ModePreGenDialysate.c (.../ModePreGenDialysate.c) (revision e9d780d77db564793278dac7dc613354f7b93049) @@ -46,16 +46,16 @@ #define PRE_GEN_DIALYSATE_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the pre-gen dialysate mode data published. #define HYD_CHAMBER_PRES_CHECK_TIME_OUT ( 30 * MS_PER_SECOND ) ///< Time out period when hydraulics chamber pressure check initiated #define NEG_PRES_PERSISTENCE_TIME_MS ( 1 * MS_PER_SECOND ) ///< Persistence time for Hydraulics chamber negative degassing pressure check. -#define PRE_GEN_DEFAULT_TIME_OUT ( 60 * MS_PER_SECOND ) -#define PRE_GEN_FILL_HYDRO_CHAMBER_TIMEOUT ( 60 * MS_PER_SECOND ) -#define PRE_GEN_FILL_HYDRO_CHAMBER_STABILITY_TIMER ( 10 * MS_PER_SECOND ) -#define PRE_GEN_PRIME_CONCENTRATE_TIMEOUT ( 30 * MS_PER_SECOND ) -#define PRE_GEN_PRIME_CONCENTRATE_PUMP_SPEED 100.0F -#define PRE_GEN_PRIME_CONCENTRATE_VOLUME 0xFFFF -#define PRE_GEN_PRIME_BAL_CHAMBER_CONCENTRATE_PUMP_SPEED 60.0F -#define PRE_GEN_PRIME_D12_RPM 1600.0F -#define PRE_GEN_PRIME_D48_RPM 2000.0F -#define PRE_GEN_PRIME_DIALYZER_CONCENTRATE_PUMP_SPEED 30.0F +#define PRE_GEN_DEFAULT_TIME_OUT ( 60 * MS_PER_SECOND ) ///< Pre Generate Default timeout for various states in ms. +#define PRE_GEN_FILL_HYDRO_CHAMBER_TIMEOUT ( 60 * MS_PER_SECOND ) ///< Pre Generate Hydro Chamber timeout in ms +#define PRE_GEN_FILL_HYDRO_CHAMBER_STABILITY_TIMER ( 10 * MS_PER_SECOND ) ///< Pre Generate Hydro Chamber stability timer +#define PRE_GEN_PRIME_CONCENTRATE_TIMEOUT ( 30 * MS_PER_SECOND ) ///< Pre Generate concentrate line priming timer. +#define PRE_GEN_PRIME_CONCENTRATE_PUMP_SPEED 100.0F ///< Concentrate line priming speed. +#define PRE_GEN_PRIME_CONCENTRATE_VOLUME 0xFFFF ///< Concentrate line volume. FFFF = no set volume. +#define PRE_GEN_PRIME_BAL_CHAMBER_CONCENTRATE_PUMP_SPEED 60.0F ///< Concentrate line speed for balancing chamber switching. +#define PRE_GEN_PRIME_D12_RPM 1600.0F ///< Pre Generate D12 set RPM. +#define PRE_GEN_PRIME_D48_RPM 2000.0F ///< Pre Generate D48 set rpm. +#define PRE_GEN_PRIME_DIALYZER_CONCENTRATE_PUMP_SPEED 30.0F ///< Pre Generate prime dialyzer concentate pump speed. // ********** private data ********** @@ -67,11 +67,11 @@ static BOOL pendingStopDDPreGenDialRequest; ///< Flag indicating TD has requested DD stop the pre generation dialysate. static U32 preGenDialysatePublishTimerCounter; ///< Pre-Gen Dialysate data broadcast timer counter used to schedule when to transmit data. static OVERRIDE_U32_T preGenDialysateModePublishInterval; ///< Interval (in task intervals) at which to publish pre-gen dialysate mode data to CAN bus. -static U32 preGenAcidPrimeTimer; -static U32 preGenBicarbPrimeTimer; -static U32 preGenfillChamberCTimer; -static BOOL currentHydroChamberStatus; -static U32 startPreGenHydroStabilityTimer; +static U32 preGenAcidPrimeTimer; ///< Acid priming timer counter. +static U32 preGenBicarbPrimeTimer; ///< Bicarb priming timer counter. +static U32 preGenfillChamberCTimer; ///< Hydro chamber timer counter. +static BOOL currentHydroChamberStatus; ///< Current hydro chamber status. +static U32 startPreGenHydroStabilityTimer; ///< Hydro Chamber stability timer. // ********** private function prototypes ********** @@ -151,8 +151,6 @@ { DD_PRE_GEN_DIALYSATE_STATE_T prevState = preGenDialysateState; - - if ( TRUE == getTestConfigStatus( TEST_CONFIG_DD_SKIP_PRE_GEN_PRIMING ) ) { preGenDialysateState = DD_PRE_GEN_DIALYSATE_WAIT_FOR_GEND; @@ -421,6 +419,14 @@ return state; } +/*********************************************************************//** + * @brief + * The handlePrimeAcidLine function handles priming the acid line + * and transition to next state. + * @details \b Inputs: state + * @details \b Outputs: none + * @return current state of PreGenDialysate mode + *************************************************************************/ static DD_PRE_GEN_DIALYSATE_STATE_T handlePrimeAcidLine( void ) { DD_PRE_GEN_DIALYSATE_STATE_T state = DD_PRE_GEN_PRIME_ACID_LINE; Index: firmware/App/Services/AlarmMgmtSWFaults.h =================================================================== diff -u -rff0edadf0c6f161a0a092ddaf94d1940d64f7d5e -re9d780d77db564793278dac7dc613354f7b93049 --- firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision ff0edadf0c6f161a0a092ddaf94d1940d64f7d5e) +++ firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision e9d780d77db564793278dac7dc613354f7b93049) @@ -169,6 +169,7 @@ SW_FAULT_ID_NVM_INVALID_RECORD_SELECTED = 138, SW_FAULT_ID_NVM_OPS_TIMEOUT = 139, SW_FAULT_ID_NVM_INVALID_OPS = 140, + SW_FAULT_ID_BICARB_CHAMBER_PRE_GEN_FILL_INVALID_EXEC_STATE = 122, NUM_OF_SW_FAULT_IDS } DD_SW_FAULT_ID_T;