Index: firmware/App/Modes/Prime.c =================================================================== diff -u -rac011ddbce0a91f7bf9016610299d281ed2e45ef -ree505bda9bc7191211b1aa99a5e0c79e99834d64 --- firmware/App/Modes/Prime.c (.../Prime.c) (revision ac011ddbce0a91f7bf9016610299d281ed2e45ef) +++ firmware/App/Modes/Prime.c (.../Prime.c) (revision ee505bda9bc7191211b1aa99a5e0c79e99834d64) @@ -61,10 +61,9 @@ #define STEADY_VOLUME_TIME_DEADLINE_MS ( 55 * MS_PER_SECOND ) ///< Time in msec for the steady volume deadline time out. #define VENOUS_PRESSURE_BUBBLE_CLEAR_MAX_MMHG ( 200.0F ) ///< Maximum venous pressure reading (in mmHg) for bubble clear. -//#define BUBBLE_CLEAR_PRESSURE_REPETITIONS ( 5 ) ///< Bubble clear pressure repetitions in dialyzer priming. #define BUBBLE_CLEAR_WAIT_TIME_INITIAL_MS ( 10 * MS_PER_SECOND ) ///< Time in msec to wait for initial bubble clear pressure. #define BUBBLE_CLEAR_WAIT_TIME_MS ( 2 * MS_PER_SECOND ) ///< Time in msec to wait for bubble clear pressure. -#define BUBBLE_CLEAR_MAX_TIME_MS ( 10 * MS_PER_SECOND ) ///< Time in msec maximum for bubble clear pressure. +#define BUBBLE_CLEAR_MAX_TIME_MS ( 10 * MS_PER_SECOND ) ///< Time in msec maximum for bubble clear pressure. #define BUBBLE_CLEAR_VALVE_WAIT_TIME_MS ( 90 ) ///< Time in msec between VDi and VBT valve open /// States of the treatment reservoir management state machine. @@ -521,8 +520,6 @@ { static BOOL bubble_clear_ended = FALSE; U32 timeout; -// TODO Remove debug - U08 tempCharBuffer[ 128 ]; if ( FALSE == bubbleClearActive ) { @@ -545,18 +542,7 @@ setValvePosition( VDI, VALVE_POSITION_C_CLOSE ); setValveAirTrap( STATE_CLOSED ); bubbleClearActive = TRUE; - // TODO remove this debug output - // Send a comma delimited debug message with drift data - sprintf( tempCharBuffer, "Prime bubble pressure ON, VDi Close, VBT Close" ); - broadcastData( MSG_ID_HD_DEBUG_EVENT, COMM_BUFFER_OUT_CAN_HD_BROADCAST, tempCharBuffer, strlen( tempCharBuffer ) ); } - else - { - // TODO remove this debug output - // Send a comma delimited debug message with drift data - sprintf( tempCharBuffer, "Prime bubble pressure ingore - fluid in air trap" ); - broadcastData( MSG_ID_HD_DEBUG_EVENT, COMM_BUFFER_OUT_CAN_HD_BROADCAST, tempCharBuffer, strlen( tempCharBuffer ) ); - } } } else @@ -568,10 +554,6 @@ setValvePosition( VDI, VALVE_POSITION_A_INSERT_EJECT ); primeSalineDialyzerBubbleClearStartTime = getMSTimerCount(); bubble_clear_ended = TRUE; - // TODO remove this debug output - // Send a comma delimited debug message with drift data - sprintf( tempCharBuffer, "Prime bubble pressure OFF 1, VDi Open, VBT Close" ); - broadcastData( MSG_ID_HD_DEBUG_EVENT, COMM_BUFFER_OUT_CAN_HD_BROADCAST, tempCharBuffer, strlen( tempCharBuffer ) ); } else if ( ( TRUE == bubble_clear_ended ) && ( TRUE == didTimeout( primeSalineDialyzerBubbleClearStartTime, BUBBLE_CLEAR_VALVE_WAIT_TIME_MS ) ) ) @@ -580,10 +562,6 @@ setValveAirTrap( STATE_OPEN ); bubbleClearActive = FALSE; bubble_clear_ended = FALSE; - // TODO remove this debug output - // Send a comma delimited debug message with drift data - sprintf( tempCharBuffer, "Prime bubble pressure OFF 2, VDi Close, VBT Open" ); - broadcastData( MSG_ID_HD_DEBUG_EVENT, COMM_BUFFER_OUT_CAN_HD_BROADCAST, tempCharBuffer, strlen( tempCharBuffer ) ); } } } @@ -839,29 +817,12 @@ // static BOOL bubbleClearActive = FALSE; HD_PRE_TREATMENT_PRIME_STATE_T state = HD_PRIME_SALINE_DIALYZER_STATE; -/* - // Close valve 4-5 times to create pressure to clear Dialyzer bubbles - if ( TRUE == didTimeout( primeSalineDialyzerBubbleClearStartTime, ( primeSalineDialyzerTimeLimit / BUBBLE_CLEAR_PRESSURE_REPETITIONS ) ) ) - { - primeSalineDialyzerBubbleClearStartTime = getMSTimerCount(); - setValvePosition( VDI, VALVE_POSITION_C_CLOSE ); - bubbleClearActive = TRUE; - } - // TODO - could also check for valve closed too long here (maybe > 2sec) in case not opening based on pressure - if ( ( TRUE == bubbleClearActive ) && ( getMeasuredVenousPressure() > VENOUS_PRESSURE_BUBBLE_CLEAR_MAX_MMHG ) ) - { - // Pressure max reached, release pressure - setValvePosition( VDI, VALVE_POSITION_A_INSERT_EJECT ); - bubbleClearActive = FALSE; - } -*/ if ( TRUE == didTimeout( primeSalineDialyzerStartTime, primeSalineDialyzerTimeLimit ) ) { state = HD_PRIME_RESERVOIR_TWO_FILL_COMPLETE_STATE; // Release pressure setValvePosition( VDI, VALVE_POSITION_A_INSERT_EJECT ); -// bubbleClearActive = FALSE; } // TODO: Rework alarm and timeout logic here. PRIME_SALINE_DIALYZER_TIME_OUT_COUNT may not be reached. if ( TRUE == didTimeout( primeSalineDialyzerStartTime, PRIME_SALINE_DIALYZER_TIME_OUT_COUNT ) )