Index: firmware/App/Controllers/AirTrap.c =================================================================== diff -u -raddd69fc864448c17a4a68b2bfa466af5483f987 -r20fe5dc6869557f96c86fbd9d7f2f634ce23696a --- firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision addd69fc864448c17a4a68b2bfa466af5483f987) +++ firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision 20fe5dc6869557f96c86fbd9d7f2f634ce23696a) @@ -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 -redd44135869db32d23a0c809f6107b153c34d3bd -r20fe5dc6869557f96c86fbd9d7f2f634ce23696a --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision edd44135869db32d23a0c809f6107b153c34d3bd) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 20fe5dc6869557f96c86fbd9d7f2f634ce23696a) @@ -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 -r736cc5b56cc9c784ab1d8fc8687a73d190c35759 -r20fe5dc6869557f96c86fbd9d7f2f634ce23696a --- firmware/App/Controllers/Bubble.c (.../Bubble.c) (revision 736cc5b56cc9c784ab1d8fc8687a73d190c35759) +++ firmware/App/Controllers/Bubble.c (.../Bubble.c) (revision 20fe5dc6869557f96c86fbd9d7f2f634ce23696a) @@ -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 -ra6b63d6a5df69f090372d9409ab3197de8805362 -r20fe5dc6869557f96c86fbd9d7f2f634ce23696a --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision a6b63d6a5df69f090372d9409ab3197de8805362) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 20fe5dc6869557f96c86fbd9d7f2f634ce23696a) @@ -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 -raddd69fc864448c17a4a68b2bfa466af5483f987 -r20fe5dc6869557f96c86fbd9d7f2f634ce23696a --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision addd69fc864448c17a4a68b2bfa466af5483f987) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 20fe5dc6869557f96c86fbd9d7f2f634ce23696a) @@ -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 -r8121bf62592934e01f365a973ac813c3d4748cda -r20fe5dc6869557f96c86fbd9d7f2f634ce23696a --- firmware/App/Controllers/PresOccl.h (.../PresOccl.h) (revision 8121bf62592934e01f365a973ac813c3d4748cda) +++ firmware/App/Controllers/PresOccl.h (.../PresOccl.h) (revision 20fe5dc6869557f96c86fbd9d7f2f634ce23696a) @@ -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 -rf8278ffe0845a6e5ed80018bcebbcfec0eba23d2 -r20fe5dc6869557f96c86fbd9d7f2f634ce23696a --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision f8278ffe0845a6e5ed80018bcebbcfec0eba23d2) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 20fe5dc6869557f96c86fbd9d7f2f634ce23696a) @@ -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 -ra917bdd62000e847e992cbb0b82e706176c1b004 -r20fe5dc6869557f96c86fbd9d7f2f634ce23696a --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision a917bdd62000e847e992cbb0b82e706176c1b004) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 20fe5dc6869557f96c86fbd9d7f2f634ce23696a) @@ -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 -rfb714597ad515d3774d69b94808f065788504724 -r20fe5dc6869557f96c86fbd9d7f2f634ce23696a --- firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision fb714597ad515d3774d69b94808f065788504724) +++ firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision 20fe5dc6869557f96c86fbd9d7f2f634ce23696a) @@ -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 -r2f9807457197c347c20a24c64492edcf063f3daa -r20fe5dc6869557f96c86fbd9d7f2f634ce23696a --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 2f9807457197c347c20a24c64492edcf063f3daa) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 20fe5dc6869557f96c86fbd9d7f2f634ce23696a) @@ -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();