Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -ra711f7995e555b503ed8c295f98fbe7bb9e5abf5 -rf566862925b5ae66ddce4f210b995dc59f4f3779 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision a711f7995e555b503ed8c295f98fbe7bb9e5abf5) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision f566862925b5ae66ddce4f210b995dc59f4f3779) @@ -417,13 +417,9 @@ spentDialPressure = getFilteredPressure( D51_PRES ); // Check fresh and spent dialysate pressure in range or BC switch only flag set -#ifndef __BC_PRESSURE_ALARM__ - if ( 1 ) -#else if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && - ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) || - ( TRUE == getBalChamberSwitchingOnlyStatus() ) ) -#endif + ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) || + ( TRUE == getBalChamberSwitchingOnlyStatus() ) || ( TRUE == getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) ) ) { //Valve control for state 1 fill valveControlForBCState1FillStart(); @@ -445,10 +441,11 @@ } else { -#ifdef __BC_PRESSURE_ALARM__ - //Alarm when pressure is not in range - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE1_FILL_START_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); -#endif + if ( getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) != TRUE ) + { + //Alarm when pressure is not in range + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE1_FILL_START_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + } } return state; @@ -520,19 +517,22 @@ spentDialPressure = getFilteredPressure( D51_PRES ); // Check fresh and spent dialysate pressure back in range to indicate fill complete. -#ifdef __BC_PRESSURE_ALARM__ - if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && - ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) ) + if ( getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) != TRUE ) { - if ( ++balChamberFillCompleteStablePressureCounter >= BAL_CHAMBER_FILL_COMPLETE_MS ) + if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && + ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) ) { - // stabilized pressure indicating fill is complete - isPressureStalbilizedDuringFill = TRUE; + if ( ++balChamberFillCompleteStablePressureCounter >= BAL_CHAMBER_FILL_COMPLETE_MS ) + { + // stabilized pressure indicating fill is complete + isPressureStalbilizedDuringFill = TRUE; + } } } -#else + else + { isPressureStalbilizedDuringFill = FALSE; -#endif + } // Switching time met or pressure in range, close valves if ( ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ) || @@ -573,26 +573,29 @@ if ( TRUE != getBalChamberSwitchingOnlyStatus() ) { -#ifdef __BC_PRESSURE_ALARM__ - if ( ( TRUE != isPressureDroppedDuringFill ) && ( TRUE == isFirstCycleBCSwitchingCompleted ) ) + if ( getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) != TRUE ) { - // When fill initiated, pressure is not dropped to the expected range, possible valve failures. - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE1_FILL_PRESSURE_DROP_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + if ( ( TRUE != isPressureDroppedDuringFill ) && ( TRUE == isFirstCycleBCSwitchingCompleted ) ) + { + // When fill initiated, pressure is not dropped to the expected range, possible valve failures. + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE1_FILL_PRESSURE_DROP_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + } + else if ( TRUE != isPressureStalbilizedDuringFill ) + { + // Alarm when switching time expired, but still pressure not in range which indicates fill is not yet completed. + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE1_FILL_END_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + } + else + { + // Move to next state when pressure is in range. + state = BAL_CHAMBER_STATE2_FILL_START; + } } - else if ( TRUE != isPressureStalbilizedDuringFill ) - { - // Alarm when switching time expired, but still pressure not in range which indicates fill is not yet completed. - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE1_FILL_END_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); - } else { - // Move to next state when pressure is in range. + // Allow to proceed next state even though pressure is not stabilized. state = BAL_CHAMBER_STATE2_FILL_START; } -#else - // Allow to proceed next state even though pressure is not stabilized. - state = BAL_CHAMBER_STATE2_FILL_START; -#endif } else { @@ -628,13 +631,9 @@ spentDialPressure = getFilteredPressure( D51_PRES ); // Check fresh and spent dialysate pressure in range -#ifndef __BC_PRESSURE_ALARM__ - if ( 1 ) -#else if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) || - ( TRUE == getBalChamberSwitchingOnlyStatus() ) ) -#endif + ( TRUE == getBalChamberSwitchingOnlyStatus() ) || ( TRUE == getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) ) ) { // Valve control for state 2 fill valveControlForBCState2FillStart(); @@ -656,10 +655,11 @@ } else { -#ifdef __BC_PRESSURE_ALARM__ - //Alarm when pressure is not in range - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_START_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); -#endif + if ( getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) != TRUE ) + { + //Alarm when pressure is not in range + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_START_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + } } return state; } @@ -680,19 +680,22 @@ spentDialPressure = getFilteredPressure( D51_PRES ); // Check fresh and spent dialysate pressure back in range to indicate fill complete. -#ifdef __BC_PRESSURE_ALARM__ - if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && - ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) ) + if ( getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) != TRUE ) { - if ( ++balChamberFillCompleteStablePressureCounter >= BAL_CHAMBER_FILL_COMPLETE_MS ) + if ( ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) && + ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) ) { - // stabilized pressure indicating fill is complete - isPressureStalbilizedDuringFill = TRUE; + if ( ++balChamberFillCompleteStablePressureCounter >= BAL_CHAMBER_FILL_COMPLETE_MS ) + { + // stabilized pressure indicating fill is complete + isPressureStalbilizedDuringFill = TRUE; + } } } -#else + else + { isPressureStalbilizedDuringFill = FALSE; -#endif + } // Check switching cycle time or pressure check for valve closure if ( ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ) || @@ -734,32 +737,35 @@ // Pressure alarm check if ( TRUE != getBalChamberSwitchingOnlyStatus() ) { -#ifdef __BC_PRESSURE_ALARM__ - if ( ( TRUE != isPressureDroppedDuringFill ) && ( TRUE == isFirstCycleBCSwitchingCompleted ) ) + if ( getTestConfigStatus( TEST_CONFIG_DISABLE_BC_PRESSURE_ALARMS ) != TRUE ) { - // When fill initiated, pressure is not dropped to the expected range, possible valve failures. - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_PRESSURE_DROP_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + if ( ( TRUE != isPressureDroppedDuringFill ) && ( TRUE == isFirstCycleBCSwitchingCompleted ) ) + { + // When fill initiated, pressure is not dropped to the expected range, possible valve failures. + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_PRESSURE_DROP_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + } + else if ( TRUE != isPressureStalbilizedDuringFill ) + { + // Alarm when switching time expired, but still pressure not in range which indicates fill is not completed. + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_END_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); + } + else + { + // Move to next state when pressure is in range. + state = BAL_CHAMBER_STATE1_FILL_START; + + // Trigger pressure drop alarm after first cycle of balancing chamber switching complete + if ( FALSE == isFirstCycleBCSwitchingCompleted ) + { + isFirstCycleBCSwitchingCompleted = TRUE; + } + } } - else if ( TRUE != isPressureStalbilizedDuringFill ) - { - // Alarm when switching time expired, but still pressure not in range which indicates fill is not completed. - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_END_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); - } else { - // Move to next state when pressure is in range. + // Allow to proceed next state even though pressure is not stabilized. state = BAL_CHAMBER_STATE1_FILL_START; - - // Trigger pressure drop alarm after first cycle of balancing chamber switching complete - if ( FALSE == isFirstCycleBCSwitchingCompleted ) - { - isFirstCycleBCSwitchingCompleted = TRUE; - } } -#else - // Allow to proceed next state even though pressure is not stabilized. - state = BAL_CHAMBER_STATE1_FILL_START; -#endif } else { Index: firmware/App/DDCommon.h =================================================================== diff -u -r6afca6de94a0318f44c1f1f976b304e52086b378 -rf566862925b5ae66ddce4f210b995dc59f4f3779 --- firmware/App/DDCommon.h (.../DDCommon.h) (revision 6afca6de94a0318f44c1f1f976b304e52086b378) +++ firmware/App/DDCommon.h (.../DDCommon.h) (revision f566862925b5ae66ddce4f210b995dc59f4f3779) @@ -25,26 +25,18 @@ #define DD_VERSION_MAJOR 0 #define DD_VERSION_MINOR 0 #define DD_VERSION_MICRO 0 -#define DD_VERSION_BUILD 13 +#define DD_VERSION_BUILD 26 + // ********** development build switches ********** #ifndef _RELEASE_ #ifndef _VECTORCAST_ // #define TASK_TIMING_OUTPUT_ENABLED 1 // Re-purposes alarm lamp pins for task timing -//Uncomment the below line for new dosing pump testing -//#define __PUMPTEST__ 1 - //Uncomment below for dialysate pump PI testing //#define __PITEST__ 1 -//Uncomment below if diener concentrate pump used -//#define __DIENER_CONC_PUMP__ 1 - -//Uncomment below if beta hardware is used -//#define __BETA_HW_VER__ 1 - //Uncomment below if barometric pressure sensor reading available //#define __BARO_PRES_SENSOR__ 1 @@ -53,20 +45,15 @@ //Uncomment below once characterization/study completed //#define ENABLE_ALARM_2 +//Uncomment below to disable heaters debug message +#define __HEATERS_DEBUG__ 1 //Uncomment below for spent chamber filling //#define __SPENT_CHAMBER_FILL__ 1 //Uncomment below for bicarb chamber filling //#define __BICARB_CHAMBER_FILL__ 1 -//Uncomment below if balancing chamber pressure alarm is required -//#define __BC_PRESSURE_ALARM__ 1 - -//Uncomment below to disable heaters debug message -#define __HEATERS_DEBUG__ 1 - - #include #include #endif Index: firmware/source/sys_main.c =================================================================== diff -u -r03d752c607e90f52e2f0b05a2ebd01283ed3f033 -rf566862925b5ae66ddce4f210b995dc59f4f3779 --- firmware/source/sys_main.c (.../sys_main.c) (revision 03d752c607e90f52e2f0b05a2ebd01283ed3f033) +++ firmware/source/sys_main.c (.../sys_main.c) (revision f566862925b5ae66ddce4f210b995dc59f4f3779) @@ -46,6 +46,7 @@ /* USER CODE END */ /* Include Files */ + #include "sys_common.h" /* USER CODE BEGIN (1) */ @@ -74,9 +75,6 @@ #include "Level.h" #include "MsgQueues.h" #include "OperationModes.h" -#ifdef __PUMPTEST__ -#include "PistonPumpControl.h" -#endif #include "Pressure.h" #include "SafetyShutdown.h" #include "SystemCommDD.h" @@ -186,9 +184,7 @@ initTDInterface(); initFPInterface(); initUltrafiltration(); -#ifdef __PUMPTEST__ - initPistonPump(); -#endif + initBloodLeak(); } /*************************************************************************