Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -rcb832b3a86cc2a3147e8447f33fc99f34a2b0011 -rd6255708e8305bf5509485a860eb3469a42ec9ad --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision cb832b3a86cc2a3147e8447f33fc99f34a2b0011) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision d6255708e8305bf5509485a860eb3469a42ec9ad) @@ -310,8 +310,13 @@ if ( valvesStatus[ valve ].hasValveBeenHomed != TRUE ) { valvesStatus[ valve ].hasHomingBeenRequested = TRUE; - result = TRUE; } + // Otherwise, go to position A (home position) + else + { + setValvePosition( valve, VALVE_POSITION_A_INSERT_EJECT ); + } + result = TRUE; } else { Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -rcb832b3a86cc2a3147e8447f33fc99f34a2b0011 -rd6255708e8305bf5509485a860eb3469a42ec9ad --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision cb832b3a86cc2a3147e8447f33fc99f34a2b0011) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision d6255708e8305bf5509485a860eb3469a42ec9ad) @@ -565,16 +565,19 @@ HD_STANDBY_STATE_T state = STANDBY_WAIT_FOR_TREATMENT_STATE; DG_OP_MODE_T dgOperationMode = getDGOpMode(); + // If DG is filling while we are in standby mode, abort the fill if ( DG_MODE_FILL == dgOperationMode ) { cmdStopDGFill(); } + // If DG is in idle generation state while we are in standby mode, transition DG to standby too if ( DG_MODE_GENE == dgOperationMode ) { cmdStopDG(); } + // If treatment start is requested by user, initiate treatment workflow (transition to treatment params mode). TODO - check required conditions before allowing treatment start, reject if necessary. if ( TRUE == treatStartReqReceived ) { // Initialize treatment modes before starting a new treatment Index: firmware/App/Modes/ModeStandby.h =================================================================== diff -u -r24b2fe72608344e67ef37234085d15ad5e4fcc37 -rd6255708e8305bf5509485a860eb3469a42ec9ad --- firmware/App/Modes/ModeStandby.h (.../ModeStandby.h) (revision 24b2fe72608344e67ef37234085d15ad5e4fcc37) +++ firmware/App/Modes/ModeStandby.h (.../ModeStandby.h) (revision d6255708e8305bf5509485a860eb3469a42ec9ad) @@ -48,15 +48,11 @@ BOOL signalUserInitiateTreatment( void ); // User has initiated a treatment - go to treatment parameters mode void signalAlarmActionToStandbyMode( ALARM_ACTION_T action ); // Execute alarm action as appropriate for Standby mode +BOOL signalUserInitiateFlushMode( void ); // User has requested to start flush +BOOL signalUserInitiateHeatDisinfectMode( void ); // User has requested to start heat disinfection +BOOL signalUserInitiateChemicalDisinfectMode( void ); // User has requested to start chem disinfection +BOOL signalInitiateStandbyDisinfectSubmode( void ); // UI has signaled user will be selecting a clearning operation to perform -BOOL signalUserInitiateFlushMode( void ); - -BOOL signalUserInitiateHeatDisinfectMode( void ); - -BOOL signalUserInitiateChemicalDisinfectMode( void ); - -BOOL signalInitiateStandbyDisinfectSubmode( void ); - BOOL testSetStandbyModePublishIntervalOverride( U32 ms ); BOOL testResetStandbyModePublishIntervalOverride( void ); Index: firmware/App/Modes/SelfTests.c =================================================================== diff -u -rcb832b3a86cc2a3147e8447f33fc99f34a2b0011 -rd6255708e8305bf5509485a860eb3469a42ec9ad --- firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision cb832b3a86cc2a3147e8447f33fc99f34a2b0011) +++ firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision d6255708e8305bf5509485a860eb3469a42ec9ad) @@ -58,8 +58,9 @@ #define WET_SELF_TEST_RESERVOIR_ONE_SETUP_VOLUME_ML 1200.0F ///< Setup volume for reservoir one before wet self-test in ml. #define WET_SELF_TEST_FIRST_DISPLACEMENT_TARGET_VOLUME_ML 100.0F ///< Target of first displacement volume in ml. #define WET_SELF_TEST_SECOND_DISPLACEMENT_TARGET_VOLUME_ML 600.0F ///< Target of second displacement volume in ml. -#define WET_SELF_TEST_INTEGRATED_VOLUME_TOLERANCE 15.0F ///< Tolerance on integrated volume in percentage. -#define WET_SELF_TEST_DISPLACEMENT_TOLERANCE_G 60.0F ///< Tolerance in the load cell readings of the displacement in grams (2%). +#define WET_SELF_TEST_INTEGRATED_VOLUME_PCT_TOLERANCE 0.05F ///< Tolerance on integrated volume as a percentage (5%). +#define WET_SELF_TEST_INTEGRATED_VOLUME_TOLERANCE 20.0F ///< Tolerance on integrated volume in grams. +#define WET_SELF_TEST_DISPLACEMENT_TOLERANCE_G 20.0F ///< Tolerance in the load cell readings of the displacement in grams. #define WET_SELF_TEST_DISPLACEMENT_TIME_MS ( SEC_PER_MIN * MS_PER_SECOND ) ///< Time to displace dialysate in wet self-test in ms. #define RESERVOIR_SETTLE_TIME_MS ( 4 * MS_PER_SECOND ) ///< Time allotted for reservoir to settle in ms. @@ -549,8 +550,6 @@ *************************************************************************/ void execWetSelfTests( void ) { - SELF_TEST_STATUS_T result = SELF_TEST_STATUS_PASSED; - #ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_WET_SELF_TEST ) == SW_CONFIG_ENABLE_VALUE ) { @@ -620,11 +619,6 @@ // Self-tests flags should be handled by now, reset if flags not handled with current state resetSelfTestsFlags(); - - if ( SELF_TEST_STATUS_FAILED == result ) - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_PRE_TREATMENT_WET_LC_TEST_FAILURE, currentWetSelfTestsState ); - } } /*********************************************************************//** @@ -1424,10 +1418,12 @@ F32 resOneDiffAfterDisplacement = reservoirVolume[ DG_RESERVOIR_1 ] - getReservoirWeightLargeFilter( DG_RESERVOIR_1 ); F32 resTwoDiffAfterDisplacement = getReservoirWeightLargeFilter( DG_RESERVOIR_2 ) - reservoirVolume[ DG_RESERVOIR_2 ]; F32 averageDisp = ( resOneDiffAfterDisplacement + resTwoDiffAfterDisplacement ) / 2.0; + F32 integratedVolumeDiff = fabs( fmdIntegratedVolume - averageDisp ); F32 integratedVolumeToTargetPercent = fabs( 1.0 - ( fmdIntegratedVolume / averageDisp ) ); if ( ( fabs( resOneDiffAfterDisplacement - resTwoDiffAfterDisplacement) <= WET_SELF_TEST_DISPLACEMENT_TOLERANCE_G ) && - ( integratedVolumeToTargetPercent <= WET_SELF_TEST_INTEGRATED_VOLUME_TOLERANCE ) ) + ( ( integratedVolumeDiff <= WET_SELF_TEST_INTEGRATED_VOLUME_TOLERANCE ) || + ( integratedVolumeToTargetPercent <= WET_SELF_TEST_INTEGRATED_VOLUME_PCT_TOLERANCE ) ) ) { state = WET_SELF_TESTS_SECOND_DISPLACEMENT_SETUP_STATE; }