Index: firmware/App/Controllers/AirTrap.c =================================================================== diff -u -r435f9880b9ed32660a1451c771454f9831d06509 -r91068f6a6f3e2adae502fcda49e901e5ed752632 --- firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision 435f9880b9ed32660a1451c771454f9831d06509) +++ firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision 91068f6a6f3e2adae502fcda49e901e5ed752632) @@ -104,7 +104,6 @@ resetAirTrap(); airTrapDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; - airTrapValveOpenAtStartOfTreatement = TRUE; airPumpOnDelayStartTime = getMSTimerCount(); stopAirPumpStartTime = 0; @@ -135,9 +134,10 @@ *************************************************************************/ void resetAirTrap( void ) { - airTrapControllerState = AIR_TRAP_INIT_STATE; - pendingStartAirTrapController = FALSE; - pendingStopAirTrapController = FALSE; + airTrapControllerState = AIR_TRAP_INIT_STATE; + pendingStartAirTrapController = FALSE; + pendingStopAirTrapController = FALSE; + airTrapValveOpenAtStartOfTreatement = TRUE; } /*********************************************************************//** @@ -411,7 +411,6 @@ ( ( TRUE == didTimeout( stopAirPumpStartTime, airPumpStopTime ) ) || ( ( AIR_TRAP_LEVEL_AIR == getRawAirTrapLevel( AIR_TRAP_LEVEL_SENSOR_UPPER ) ) && ( AIR_TRAP_LEVEL_FLUID == getAirTrapLevel( AIR_TRAP_LEVEL_SENSOR_LOWER ) ) ) ) ) - { setAirPumpState( AIR_PUMP_STATE_OFF ); airPumpOnDelayStartTime = getMSTimerCount(); Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -r3cdf15b3a22f16b4ad58e1378622c4432e91f4c1 -r91068f6a6f3e2adae502fcda49e901e5ed752632 --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 3cdf15b3a22f16b4ad58e1378622c4432e91f4c1) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 91068f6a6f3e2adae502fcda49e901e5ed752632) @@ -701,7 +701,7 @@ * The handleBloodLeakInitState function handles the Blood Leak module in init * state. * @details Inputs: bloodLeakEmbModeHasZeroBeenRqustd - * @details Outputs: none + * @details Outputs: bloodLeakEmbModeHasZeroBeenRqustd, bloodLeakPersistenceCtr * @return next state *************************************************************************/ static BLOOD_LEAK_STATE_T handleBloodLeakInitState( void ) @@ -712,6 +712,7 @@ if ( TRUE == bloodLeakEmbModeHasZeroBeenRqustd ) { bloodLeakEmbModeHasZeroBeenRqustd = FALSE; + bloodLeakPersistenceCtr = 0; state = BLOOD_LEAK_CHECK_ZERO_AND_SELF_TEST_STATE; } Index: firmware/App/Controllers/Bubble.c =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r91068f6a6f3e2adae502fcda49e901e5ed752632 --- firmware/App/Controllers/Bubble.c (.../Bubble.c) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Controllers/Bubble.c (.../Bubble.c) (revision 91068f6a6f3e2adae502fcda49e901e5ed752632) @@ -77,14 +77,15 @@ for ( bubble = ADV; bubble < NUM_OF_BUBBLES; bubble++ ) { - bubblesState[ bubble ] = BUBBLE_NORMAL_STATE; - bubblesStatus[ bubble ].data = BUBBLE_NOT_DETECTED; + bubblesState[ bubble ] = BUBBLE_NORMAL_STATE; + bubblesStatus[ bubble ].data = BUBBLE_NOT_DETECTED; bubblesStatus[ bubble ].ovInitData = BUBBLE_NOT_DETECTED; - bubblesStatus[ bubble ].ovData = BUBBLE_NOT_DETECTED; - bubblesStatus[ bubble ].override = OVERRIDE_RESET; - bubblesSelfTestStatus[ bubble ] = SELF_TEST_STATUS_IN_PROGRESS; + bubblesStatus[ bubble ].ovData = BUBBLE_NOT_DETECTED; + bubblesStatus[ bubble ].override = OVERRIDE_RESET; + bubblesSelfTestStatus[ bubble ] = SELF_TEST_STATUS_IN_PROGRESS; bubblesSelfTestRequested[ bubble ] = FALSE; bubblesSelfTestStartTime[ bubble ] = 0; + bubbleDetectionEnabled[ bubble ] = FALSE; } bubblesDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -r592af09c58d6270e3f6b3ebc3ce87147ba9ea3c1 -r91068f6a6f3e2adae502fcda49e901e5ed752632 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 592af09c58d6270e3f6b3ebc3ce87147ba9ea3c1) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 91068f6a6f3e2adae502fcda49e901e5ed752632) @@ -139,6 +139,10 @@ dgDialysateFlowRateRawLMin = 0.0F; dgDialysateFlowDataFreshFlag = FALSE; dgHeatDisinfectTemp = 0.0F; + dgLoadCellDataFreshFlag = FALSE; + dgDialysateTemperatureDataFreshFlag = FALSE; + dgReservoirsDataFreshFlag = FALSE; + dgOpModeDataFreshFlag = FALSE; // initialize load cell weights for ( i = 0; i < NUM_OF_LOAD_CELLS; i++ ) Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -rb1f1988fea3bf396aef67e2795f51a067c5f99a2 -r91068f6a6f3e2adae502fcda49e901e5ed752632 --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision b1f1988fea3bf396aef67e2795f51a067c5f99a2) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 91068f6a6f3e2adae502fcda49e901e5ed752632) @@ -268,35 +268,53 @@ initFPGAPersistentAlarm( FPGA_PERS_ERROR_VENOUS_PRESSURE_SESNOR, ALARM_ID_HD_VENOUS_SENSOR_FPGA_FAULT, PRES_SENSORS_FPGA_ERROR_TIMEOUT_MS, PRES_SENSORS_FPGA_ERROR_TIMEOUT_MS ); - setPressureLimitsToOuterBounds(); + resetPresOccl(); currPresLimitsState = PRESSURE_LIMITS_STATE_OFF; pressureLimitsActive = FALSE; stabilizationStartTimeMs = 0; stableArterialPressure = 0; stableVenousPressure = 0; - venLowPresExemptAfterAirTrapFillTimerCtr = 0; prevVenLowPresExemptAfterAirTrapFillTimerCtr = 0; - resetArtVenPressureOffsets(); longFilteredArterialPressure = 0.0F; shortFilteredArterialPressure.data = 0.0F; longFilteredVenousPressure = 0.0F; shortFilteredVenousPressure.data = 0.0F; filteredBloodPumpOccl.data = 0.0F; - bloodPumpPartialOcclusionBaseline.data = 0.0F; - partialBloodPumpOcclBaselineUpdateTimerCounter = 0; presOcclDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; presOcclState = PRESSURE_WAIT_FOR_POST_STATE; presOcclPostState = PRESSURE_SELF_TEST_STATE_START; - bloodPumpOcclusionAfterCartridgeInstall = 0; - partialBloodPumpOcclBaselineUpdate = FALSE; - pressureStabilizeTime = USE_NORMAL_STABILIZATION_PERIOD; - resetFillExemptPeriod = TRUE; - lowVenousPressureExemptCheck = TRUE; } /*********************************************************************//** * @brief + * The resetPresOccl function resets the pressure occlusion variables for + * a new treatment. + * @details Inputs: none + * @details Outputs: venLowPresExemptAfterAirTrapFillTimerCtr, resetFillExemptPeriod + * lowVenousPressureExemptCheck, pressureStabilizeTime, + * bloodPumpOcclusionAfterCartridgeInstall, bloodPumpPartialOcclusionBaseline, + * partialBloodPumpOcclBaselineUpdateTimerCounter, emptySalineBagCtr + * @return none + *************************************************************************/ +void resetPresOccl( void ) +{ + venLowPresExemptAfterAirTrapFillTimerCtr = 0; + resetFillExemptPeriod = TRUE; + lowVenousPressureExemptCheck = TRUE; + pressureStabilizeTime = USE_NORMAL_STABILIZATION_PERIOD; + bloodPumpOcclusionAfterCartridgeInstall = 0; + bloodPumpPartialOcclusionBaseline.data = 0.0F; + partialBloodPumpOcclBaselineUpdate = FALSE; + partialBloodPumpOcclBaselineUpdateTimerCounter = 0; + emptySalineBagCtr = 0; + + setPressureLimitsToOuterBounds(); + resetArtVenPressureOffsets(); +} + +/*********************************************************************//** + * @brief * The resetArtVenPressureOffsets function resets the arterial and venous * offsets to zero. * @details Inputs: none @@ -965,7 +983,7 @@ else { // Increment counter on airtrap valve close state. Also, when next fill happens within exempt period, counter will be keep incremented irrespective of valve state. - if ( TRUE == lowVenousPressureExemptCheck ) + if ( lowVenousPressureExemptCheck != FALSE ) { venLowPresExemptAfterAirTrapFillTimerCtr++; } Index: firmware/App/Controllers/PresOccl.h =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r91068f6a6f3e2adae502fcda49e901e5ed752632 --- firmware/App/Controllers/PresOccl.h (.../PresOccl.h) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Controllers/PresOccl.h (.../PresOccl.h) (revision 91068f6a6f3e2adae502fcda49e901e5ed752632) @@ -82,6 +82,7 @@ void initPresOccl( void ); void execPresOccl( void ); +void resetPresOccl( void ); void execPresOcclTest( void ); SELF_TEST_STATUS_T execPresOcclDryTest( void ); Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r91068f6a6f3e2adae502fcda49e901e5ed752632 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 91068f6a6f3e2adae502fcda49e901e5ed752632) @@ -322,7 +322,6 @@ syringePumpSpeedCalcTimerCounter = 0; syringePumpRampTimerCtr = 0; syringePumpStopPositionTimerCounter = 0; - syringePumpSafetyVolumeDelivered = 0.0; syringePumpStateStartTime = getMSTimerCount(); syringePumpPositionKnown = FALSE; Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r91068f6a6f3e2adae502fcda49e901e5ed752632 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 91068f6a6f3e2adae502fcda49e901e5ed752632) @@ -463,6 +463,9 @@ { energized = TRUE; } + + // Send air trap event + SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_AIR_TRAP_VALVE_ON_OFF, (U32)state, 0 ) } // Of course if invalid air trap state was requested, keep the valve de-energized (close) else Index: firmware/App/Modes/ModePreTreat.c =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r91068f6a6f3e2adae502fcda49e901e5ed752632 --- firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision 91068f6a6f3e2adae502fcda49e901e5ed752632) @@ -1182,6 +1182,9 @@ zeroBloodLeak(); } + // Transitioning to treatment make sure low venous alarm counter is incremented for checking + signalLowVenousPressureCheck(); + patientConnectionConfirm = FALSE; doorOpened = FALSE; setStartReservoirVolume( activeRes ); Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r371355c43e19849e5b1dd27286f62f4424d07ccf -r91068f6a6f3e2adae502fcda49e901e5ed752632 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 371355c43e19849e5b1dd27286f62f4424d07ccf) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 91068f6a6f3e2adae502fcda49e901e5ed752632) @@ -32,6 +32,7 @@ #include "ModeTreatmentParams.h" #include "NVDataMgmt.h" #include "OperationModes.h" +#include "PresOccl.h" #include "RTC.h" #include "Switches.h" #include "SyringePump.h" @@ -136,6 +137,7 @@ resetBloodPumpRotorCount(); resetDialInPumpRotorCount(); resetPreLoadStatus(); + resetPresOccl(); setVenousBubbleDetectionEnabled( FALSE ); setCurrentSubState( NO_SUB_STATE ); clearNoRetriggerFlag();