Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r8a0735916a4006faaf0651d685131916517c4f33 -re45524455c005d4fa1734efcbaf7ed0499302670 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 8a0735916a4006faaf0651d685131916517c4f33) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision e45524455c005d4fa1734efcbaf7ed0499302670) @@ -106,29 +106,9 @@ ///< Macro converts a 12-bit ADC reading to a signed 16-bit value. #define SIGN_FROM_12_BIT_VALUE(v) ( (S16)(v) - (S16)DIAL_IN_PUMP_ADC_ZERO ) -#ifdef USE_FMD_FLOW_SENSOR /// Measured dialIn flow is filtered w/ moving average. -#define SIZE_OF_ROLLING_AVG ( ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) * DIP_CONTROL_INTERVAL_SEC ) -#else #define SIZE_OF_ROLLING_AVG 10 -#endif -#ifdef USE_FMD_FLOW_SENSOR -/// Dialysate flow sensor signal strength low alarm persistence. -#define FLOW_SIG_STRGTH_ALARM_PERSIST ( 5 * MS_PER_SECOND ) -#define MIN_FLOW_SIG_STRENGTH 0.9 ///< Minimum flow sensor signal strength (90%). - -/// Dialysate flow fast read timeout alarm persistence. -#define DIALYSATE_FLOW_FAST_READ_TO_PERSIST 100 -/// Dialysate flow slow read timeout alarm persistence. -#define DIALYSATE_FLOW_SLOW_READ_TO_PERSIST ( MS_PER_SECOND * 3 ) -/// Blood flow comm error persistence. -#define DIALYSATE_FLOW_COMM_ERROR_PERSIST MS_PER_SECOND - -#define DFM_SENSOR_CONNECTED_STATUS 0x00 ///< Dialysate flow meter connected status. -#define DFM_SENSOR_PARAM_CORRUPT_STATUS 0x07 ///< Dialysate flow meter NVM parameter corrupt status. -#endif - #define PUMP_DIR_ERROR_COUNT_MASK 0x3F ///< Bit mask for pump direction error counter. /// Enumeration of dialysate inlet pump states. @@ -179,17 +159,7 @@ static OVERRIDE_F32_T dialInPumpSpeedRPM = { 0.0, 0.0, 0.0, 0 }; ///< Measured dialysate inlet pump motor speed static OVERRIDE_F32_T adcDialInPumpMCSpeedRPM = { 0.0, 0.0, 0.0, 0 }; ///< Measured dialysate inlet pump motor controller speed static OVERRIDE_F32_T adcDialInPumpMCCurrentmA = { 0.0, 0.0, 0.0, 0 }; ///< Measured dialysate inlet pump motor controller current -#ifdef USE_FMD_FLOW_SENSOR -static OVERRIDE_F32_T dialInFlowSignalStrength = { 0.0, 0.0, 0.0, 0 }; ///< Measured dialysate flow signal strength (%) -static U08 lastDialysateFlowFastPacketReadCtr = 0; ///< Previous read counter for the dialysate flow fast packets. -static U08 lastDialysateFlowSlowPacketReadCtr = 0; ///< Previous read counter for the dialysate flow slow packets. -#ifndef DISABLE_PUMP_FLOW_CHECKS -static U08 lastDialysateFlowCommErrorCount = 0; ///< Previous DPi flow sensor comm error count. -#endif -static HD_FLOW_SENSORS_CAL_RECORD_T dialysateFlowCalRecord; ///< Dialysate flow sensor calibration record. -#endif - static U08 lastDialInPumpDirectionCount = 0; ///< Previous pump direction error count reported by FPGA. static U32 dipControlTimerCounter = 0; ///< Determines when to perform control on dialIn flow @@ -233,10 +203,6 @@ static void checkDialInPumpSpeeds( void ); static void checkDialInPumpMCCurrent( void ); static void checkDialInPumpFlowRate( void ); -#ifdef USE_FMD_FLOW_SENSOR -static void checkDialInFlowSensorSignalStrength( void ); -static BOOL processCalibrationData( void ); -#endif /*********************************************************************//** * @brief @@ -268,12 +234,6 @@ MIN_DIAL_IN_PUMP_PWM_DUTY_CYCLE, MAX_DIAL_IN_PUMP_PWM_DUTY_CYCLE ); // Initialize persistent alarm for flow sensor signal strength too low -#ifdef USE_FMD_FLOW_SENSOR - initPersistentAlarm( ALARM_ID_DIALYSATE_FLOW_SIGNAL_STRENGTH_TOO_LOW, FLOW_SIG_STRGTH_ALARM_PERSIST, FLOW_SIG_STRGTH_ALARM_PERSIST ); - initPersistentAlarm( ALARM_ID_HD_DP_FLOW_READ_TIMEOUT_ERROR, 0, DIALYSATE_FLOW_FAST_READ_TO_PERSIST ); - initPersistentAlarm( ALARM_ID_HD_DP_FLOW_SLOW_READ_TIMEOUT_ERROR, 0, DIALYSATE_FLOW_SLOW_READ_TO_PERSIST ); - initPersistentAlarm( ALARM_ID_HD_DP_FLOW_SENSOR_ERROR, 0, DIALYSATE_FLOW_COMM_ERROR_PERSIST ); -#endif initPersistentAlarm( ALARM_ID_HD_DIAL_IN_FLOW_OUT_OF_RANGE, 0, DIP_MAX_FLOW_RATE_OUT_OF_RANGE_PERSIST ); } @@ -441,53 +401,6 @@ U08 spReadCtr = getFPGADialysateFlowSlowPacketReadCounter(); U08 flowErrorCtr = getFPGADialysateFlowErrorCounter(); U08 flowStatus = getFPGADialysateFlowMeterStatus(); - F32 dipFlow; -#ifdef USE_FMD_FLOW_SENSOR - F32 dpFlow = getFPGADialysateFlow(); - - // Check if a new calibration is available - if ( TRUE == isNewCalibrationRecordAvailable() ) - { - // Get the new calibration data and check its validity - processCalibrationData(); - } - dipFlow = pow(dpFlow, 4) * dialysateFlowCalRecord.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].fourthOrderCoeff + - pow(dpFlow, 3) * dialysateFlowCalRecord.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].thirdOrderCoeff + - pow(dpFlow, 2) * dialysateFlowCalRecord.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].secondOrderCoeff + - dpFlow * dialysateFlowCalRecord.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].gain + - dialysateFlowCalRecord.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].offset; - -#ifndef DISABLE_PUMP_FLOW_CHECKS - if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_DP_FLOW_SENSOR_ERROR, ( flowErrorCtr != lastDialysateFlowCommErrorCount ) ) ) - { - activateAlarmNoData( ALARM_ID_HD_DP_FLOW_SENSOR_ERROR ); - } - if ( flowStatus != DFM_SENSOR_CONNECTED_STATUS ) - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_DIALYSATE_FLOW_STATUS_SELF_TEST_FAILURE, (U32)flowStatus ); - } - lastDialysateFlowCommErrorCount = flowErrorCtr; -#endif - -#ifndef DISABLE_FPGA_COUNTER_CHECKS - // Check for stale flow reading - if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_DP_FLOW_READ_TIMEOUT_ERROR, ( fpReadCtr == lastDialysateFlowFastPacketReadCtr ) ) ) - { - activateAlarmNoData( ALARM_ID_HD_DP_FLOW_READ_TIMEOUT_ERROR ); - } - if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_DP_FLOW_SLOW_READ_TIMEOUT_ERROR, ( spReadCtr == lastDialysateFlowSlowPacketReadCtr ) ) ) - { - activateAlarmNoData( ALARM_ID_HD_DP_FLOW_SLOW_READ_TIMEOUT_ERROR ); - } -#endif - - // Record flow read counters for next time around - lastDialysateFlowFastPacketReadCtr = fpReadCtr; - lastDialysateFlowSlowPacketReadCtr = spReadCtr; - - dialInFlowSignalStrength.data = getFPGADialysateFlowSignalStrength(); - filterDialInFlowReadings( dipFlow ); -#endif adcDialInPumpMCSpeedRPM.data = (F32)(SIGN_FROM_12_BIT_VALUE(dipRPM)) * DIP_SPEED_ADC_TO_RPM_FACTOR; adcDialInPumpMCCurrentmA.data = (F32)(SIGN_FROM_12_BIT_VALUE(dipmA)) * DIP_CURRENT_ADC_TO_MA_FACTOR; @@ -505,9 +418,6 @@ // Check pump speeds and flow checkDialInPumpSpeeds(); checkDialInPumpFlowRate(); -#ifdef USE_FMD_FLOW_SENSOR - checkDialInFlowSensorSignalStrength(); -#endif // Check for home position, zero/low speed checkDialInPumpRotor(); } @@ -758,56 +668,8 @@ } } -#ifdef USE_FMD_FLOW_SENSOR /*********************************************************************//** * @brief - * The processCalibrationData function gets the calibration data and makes - * sure it is valid by checking the calibration date. The calibration date - * should not be 0. - * @details Inputs: none - * @details Outputs: dialysateFlowCalRecord - * @return TRUE if the calibration record is valid, otherwise FALSE - *************************************************************************/ -static BOOL processCalibrationData( void ) -{ - BOOL status = TRUE; - - // Get the calibration record from NVDataMgmt - HD_FLOW_SENSORS_CAL_RECORD_T calData = getHDFlowSensorsCalibrationRecord(); - - // Check if the calibration data that was received from NVDataMgmt is legitimate - // The calibration date item should not be zero. If the calibration date is 0, - // then the dialysate flow sensors data is not stored in the NV memory or it was corrupted. - if ( 0 == calData.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].calibrationTime ) - { -#ifndef SKIP_CAL_CHECK - activateAlarmNoData( ALARM_ID_HD_DIALYSATE_FLOW_INVALID_CAL_RECORD ); - status = FALSE; -#endif - } - - // The calibration data was valid, update the local copy - dialysateFlowCalRecord.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].fourthOrderCoeff = - calData.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].fourthOrderCoeff; - - dialysateFlowCalRecord.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].thirdOrderCoeff = - calData.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].thirdOrderCoeff; - - dialysateFlowCalRecord.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].secondOrderCoeff = - calData.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].secondOrderCoeff; - - dialysateFlowCalRecord.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].gain = - calData.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].gain; - - dialysateFlowCalRecord.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].offset = - calData.hdFlowSensors[ CAL_DATA_HD_DIALYSATE_FLOW_SENSOR ].offset; - - return status; -} -#endif - -/*********************************************************************//** - * @brief * The getTargetDialInFlowRate function gets the current target dialIn flow * rate. * @details Inputs: targetDialInFlowRate @@ -839,28 +701,6 @@ return result; } -#ifdef USE_FMD_FLOW_SENSOR -/*********************************************************************//** - * @brief - * The getMeasuredDialInFlowSignalStrength function gets the measured dialIn flow - * signal strength. - * @details Inputs: dialInFlowSignalStrength - * @details Outputs: none - * @return the current dialIn flow signal strength (in %). - *************************************************************************/ -F32 getMeasuredDialInFlowSignalStrength( void ) -{ - F32 result = dialInFlowSignalStrength.data; - - if ( OVERRIDE_KEY == dialInFlowSignalStrength.override ) - { - result = dialInFlowSignalStrength.ovData; - } - - return result; -} -#endif - /*********************************************************************//** * @brief * The getMeasuredDialInPumpRotorSpeed function gets the measured dialIn flow @@ -985,11 +825,7 @@ payload.measMCSpd = getMeasuredDialInPumpMCSpeed(); payload.measMCCurr = getMeasuredDialInPumpMCCurrent(); payload.pwmDC = dialInPumpPWMDutyCyclePctSet * FRACTION_TO_PERCENT_FACTOR; -#ifdef USE_FMD_FLOW_SENSOR - payload.flowSigStrength = getMeasuredDialInFlowSignalStrength() * FRACTION_TO_PERCENT_FACTOR; -#else payload.flowSigStrength = 0.0; -#endif broadcastData( MSG_ID_DIALYSATE_FLOW_DATA, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&payload, sizeof( DIALIN_PUMP_STATUS_PAYLOAD_T ) ); dialInFlowDataPublicationTimerCounter = 0; } @@ -1343,35 +1179,6 @@ } } -#ifdef USE_FMD_FLOW_SENSOR -/*********************************************************************//** - * @brief - * The checkDialInFlowSensorSignalStrength function checks the measured - * dialysate flow sensor signal strength is sufficient for accurate flow sensing. - * @details Inputs: - * @details Outputs: - * @return none - *************************************************************************/ -static void checkDialInFlowSensorSignalStrength( void ) -{ -#ifndef DISABLE_PUMP_FLOW_CHECKS - HD_OP_MODE_T opMode = getCurrentOperationMode(); - - // Check flow sensor signal strength when appropriate TODO - in pre-treatment, must be far enough along for fluid to be in tubing - if ( MODE_TREA == opMode || ( MODE_PRET == opMode && FALSE ) ) - { - F32 sigStrength = getMeasuredDialInFlowSignalStrength(); - BOOL outOfRange = ( sigStrength < MIN_FLOW_SIG_STRENGTH ? TRUE : FALSE ); - - if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_DIALYSATE_FLOW_SIGNAL_STRENGTH_TOO_LOW, outOfRange ) ) - { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DIALYSATE_FLOW_SIGNAL_STRENGTH_TOO_LOW, sigStrength, MIN_FLOW_SIG_STRENGTH ); - } - } -#endif -} -#endif - /*********************************************************************//** * @brief * The execDialInFlowTest function executes the state machine for the @@ -1382,30 +1189,7 @@ *************************************************************************/ SELF_TEST_STATUS_T execDialInFlowTest( void ) { -#ifdef USE_FMD_FLOW_SENSOR - SELF_TEST_STATUS_T result = SELF_TEST_STATUS_IN_PROGRESS; - U08 const dfmStatus = getFPGADialysateFlowMeterStatus(); - - if ( DFM_SENSOR_PARAM_CORRUPT_STATUS != dfmStatus ) - { - BOOL calStatus = processCalibrationData(); - - if ( TRUE == calStatus ) - { - result = SELF_TEST_STATUS_PASSED; - } - else - { - result = SELF_TEST_STATUS_FAILED; - } - } - else - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_DIALYSATE_FLOW_STATUS_SELF_TEST_FAILURE, (U32)dfmStatus ); - } -#else SELF_TEST_STATUS_T result = SELF_TEST_STATUS_PASSED; -#endif return result; } @@ -1724,51 +1508,4 @@ return result; } -#ifdef USE_FMD_FLOW_SENSOR -/*********************************************************************//** - * @brief - * The testSetMeasuredDialInFlowSignalStrengthOverride function overrides the measured - * dialysate flow signal strength. - * @details Inputs: none - * @details Outputs: dialInFlowSignalStrength - * @param value override measured dialysate flow signal strength (in %) - * @return TRUE if override successful, FALSE if not - *************************************************************************/ -BOOL testSetMeasuredDialInFlowSignalStrengthOverride( F32 value ) -{ - BOOL result = FALSE; - - if ( TRUE == isTestingActivated() ) - { - result = TRUE; - dialInFlowSignalStrength.ovData = value / 100.0; - dialInFlowSignalStrength.override = OVERRIDE_KEY; - } - - return result; -} - -/*********************************************************************//** - * @brief - * The testResetMeasuredDialInFlowSignalStrengthOverride function resets the override - * of the measured dialysate flow signal strength. - * @details Inputs: none - * @details Outputs: dialInFlowSignalStrength - * @return TRUE if reset successful, FALSE if not - *************************************************************************/ -BOOL testResetMeasuredDialInFlowSignalStrengthOverride( void ) -{ - BOOL result = FALSE; - - if ( TRUE == isTestingActivated() ) - { - result = TRUE; - dialInFlowSignalStrength.override = OVERRIDE_RESET; - dialInFlowSignalStrength.ovData = dialInFlowSignalStrength.ovInitData; - } - - return result; -} -#endif - /**@}*/ Index: firmware/App/Controllers/DialInFlow.h =================================================================== diff -u -r8a0735916a4006faaf0651d685131916517c4f33 -re45524455c005d4fa1734efcbaf7ed0499302670 --- firmware/App/Controllers/DialInFlow.h (.../DialInFlow.h) (revision 8a0735916a4006faaf0651d685131916517c4f33) +++ firmware/App/Controllers/DialInFlow.h (.../DialInFlow.h) (revision e45524455c005d4fa1734efcbaf7ed0499302670) @@ -65,9 +65,6 @@ S32 getTargetDialInFlowRate( void ); F32 getMeasuredDialInFlowRate( void ); -#ifdef USE_FMD_FLOW_SENSOR -F32 getMeasuredDialInFlowSignalStrength( void ); -#endif F32 getMeasuredDialInPumpRotorSpeed( void ); F32 getMeasuredDialInPumpSpeed( void ); F32 getMeasuredDialInPumpMCSpeed( void ); @@ -87,10 +84,6 @@ BOOL testResetMeasuredDialInPumpMCSpeedOverride( void ); BOOL testSetMeasuredDialInPumpMCCurrentOverride( F32 value ); BOOL testResetMeasuredDialInPumpMCCurrentOverride( void ); -#ifdef USE_FMD_FLOW_SENSOR -BOOL testSetMeasuredDialInFlowSignalStrengthOverride( F32 value ); -BOOL testResetMeasuredDialInFlowSignalStrengthOverride( void ); -#endif /**@}*/ Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -re4cc37257141c5227186ac6d8ca3d6c87d009042 -re45524455c005d4fa1734efcbaf7ed0499302670 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision e4cc37257141c5227186ac6d8ca3d6c87d009042) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision e45524455c005d4fa1734efcbaf7ed0499302670) @@ -523,17 +523,29 @@ { syringePumpSetRate = SYRINGE_PUMP_PRIME_RATE; syringePumpPrimeRequested = TRUE; - // Reset volume and start pos before starting prime operation - syringePumpVolumeDelivered.data = 0.0; - syringePumpSafetyVolumeDelivered = 0.0; - syringePumpVolumeStartPosition = getSyringePumpPosition(); + resetHeparinVolumeDelivered(); } return syringePumpPrimeRequested; } /*********************************************************************//** * @brief + * The resetHeparinVolumeDelivered function resets the Heparin volume delivered. + * @details Inputs: none + * @details Outputs: syringePumpVolumeDelivered, syringePumpSafetyVolumeDelivered, + * syringePumpVolumeStartPosition + * @return none + *************************************************************************/ +void resetHeparinVolumeDelivered( void ) +{ + syringePumpVolumeDelivered.data = 0.0; + syringePumpSafetyVolumeDelivered = 0.0; + syringePumpVolumeStartPosition = getSyringePumpPosition(); +} + +/*********************************************************************//** + * @brief * The startHeparinBolus function requests Heparin bolus delivery. * @details Inputs: syringePumpState * @details Outputs: syringePumpSetRate, syringePumpBolusRequested @@ -554,10 +566,6 @@ { syringePumpSetRate = tgtRate; syringePumpBolusRequested = TRUE; - // Reset volume and start pos before starting bolus operation - syringePumpVolumeDelivered.data = 0.0; - syringePumpSafetyVolumeDelivered = 0.0; - syringePumpVolumeStartPosition = getSyringePumpPosition(); } } else @@ -934,6 +942,7 @@ static void execSyringePumpMonitor( void ) { F32 forceSensorBeforCal = 0.0; + BOOL prevSyringeDetected = isSyringeDetected(); // Check if a new calibration is available if ( TRUE == isNewCalibrationRecordAvailable() ) @@ -953,6 +962,11 @@ // Get latest ADC data and convert to V syringePumpMeasHome.data = ( (F32)getFPGASyringePumpADCChannel2() * SYRINGE_PUMP_ADC_REF_V ) / SYRINGE_PUMP_ADC_FULL_SCALE_BITS; syringePumpMeasSyringeDetectionSwitch.data = ( (F32)getFPGASyringePumpADCChannel1() * SYRINGE_PUMP_ADC_REF_V ) / SYRINGE_PUMP_ADC_FULL_SCALE_BITS; + // On transition from not detected to detected - clear syringe removed alarm condition + if ( ( prevSyringeDetected != TRUE ) && ( TRUE == isSyringeDetected() ) ) + { + clearAlarmCondition( ALARM_ID_HD_SYRINGE_PUMP_SYRINGE_REMOVED ); + } forceSensorBeforCal = ( (F32)getFPGASyringePumpADCChannel0() * SYRINGE_PUMP_ADC_REF_V ) / SYRINGE_PUMP_ADC_FULL_SCALE_BITS; syringePumpMeasForce.data = pow(forceSensorBeforCal, 4) * forceSensorCalRecord.hdHeparinForceSensor.fourthOrderCoeff + @@ -1312,6 +1326,7 @@ if ( TRUE == stopPump ) { stopSyringePump(); + retractSyringePump(); result = SYRINGE_PUMP_OFF_STATE; } Index: firmware/App/Controllers/SyringePump.h =================================================================== diff -u -rabbad386f4cc94f315300dffef321fe8c03fbd52 -re45524455c005d4fa1734efcbaf7ed0499302670 --- firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision abbad386f4cc94f315300dffef321fe8c03fbd52) +++ firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision e45524455c005d4fa1734efcbaf7ed0499302670) @@ -84,6 +84,7 @@ BOOL retractSyringePump( void ); BOOL seekSyringePlunger( void ); BOOL primeSyringePump( void ); +void resetHeparinVolumeDelivered( void ); BOOL startHeparinBolus( void ); BOOL startHeparinContinuous( void ); BOOL setSyringePumpDACVref( F32 vRef ); Index: firmware/App/Modes/BloodPrime.c =================================================================== diff -u -rec348bf3bbbe48b5a5e25d563a0aa5686bfcd237 -re45524455c005d4fa1734efcbaf7ed0499302670 --- firmware/App/Modes/BloodPrime.c (.../BloodPrime.c) (revision ec348bf3bbbe48b5a5e25d563a0aa5686bfcd237) +++ firmware/App/Modes/BloodPrime.c (.../BloodPrime.c) (revision e45524455c005d4fa1734efcbaf7ed0499302670) @@ -36,17 +36,9 @@ // ********** private definitiions *********** -// TODO - get from Systems when available #define TARGET_BLOOD_PRIME_VOLUME_ML 300.0 ///< Target blood prime volume to prime the blood side circuit (in mL). #define MIN_RAMP_TIME_SEC 60 ///< Minimum ramp time for blood prime (in seconds). -#ifndef DISABLE_PUMP_FLOW_CHECKS -/// Maximum blood prime volume measured by independent means (as % of target). -static const F32 MAX_BLOOD_PRIME_SAFETY_VOLUME_ML = ( TARGET_BLOOD_PRIME_VOLUME_ML * 1.2 ); -/// Minimum blood prime volume measured by independent means (as % of target). -static const F32 MIN_BLOOD_PRIME_SAFETY_VOLUME_ML = ( TARGET_BLOOD_PRIME_VOLUME_ML * 0.8 ); -#endif - /// Initial flow rate for blood pump when starting blood prime operation. #define BLOOD_PRIME_INIT_BP_FLOW_RATE_ML_MIN 100 @@ -72,15 +64,11 @@ static OVERRIDE_U32_T bloodPrimePublishInterval = { BLOOD_PRIME_DATA_PUBLISH_INTERVAL, BLOOD_PRIME_DATA_PUBLISH_INTERVAL, BLOOD_PRIME_DATA_PUBLISH_INTERVAL, 0 }; static OVERRIDE_F32_T cumulativeBloodPrimeVolume_mL = { 0.0, 0.0, 0.0, 0 }; ///< Total cumulative blood prime volume (in mL). -static OVERRIDE_F32_T bloodPrimeVolumeDelivered_Safety = { 0.0, 0.0, 0.0, 0 }; ///< The cumulative independent blood prime volume (in mL) calculated so far. -static S32 bloodPrimeMotorCount; ///< The cumulative sum of BP motor encoder counts used for independent blood prime volume check. -static U32 bloodPrimeLastMotorCount; ///< The last BP motor encoder count read for independent blood prime volume check. // ********** private function prototypes ********** static void resetBloodPrimeFlags( void ); static F32 getBloodPrimeVolume( void ); -static F32 getBloodPrimeSafetyVolume( void ); static BLOOD_PRIME_STATE_T handleBloodPrimeRampState( void ); static void publishBloodPrimeData( void ); @@ -100,9 +88,6 @@ bloodPrimeRampControlTimerCtr = 0; bloodPrimePublishTimerCtr = BLOOD_PRIME_DATA_PUBLISH_INTERVAL; cumulativeBloodPrimeVolume_mL.data = 0.0; - bloodPrimeVolumeDelivered_Safety.data = 0.0; - bloodPrimeMotorCount = 0; - bloodPrimeLastMotorCount = getBloodPumpMotorCount(); resetBloodPrimeFlags(); bloodPrimeRampFlowRate_mL_min = (F32)BLOOD_PRIME_INIT_BP_FLOW_RATE_ML_MIN; @@ -194,26 +179,6 @@ /*********************************************************************//** * @brief - * The getBloodPrimeSafetyVolume function gets the calculated independent - * blood prime volume delivered. - * @details Inputs: bloodPrimeVolumeDelivered_Safety - * @details Outputs: none - * @return the current blood prime safety volume delivered (in mL). - *************************************************************************/ -static F32 getBloodPrimeSafetyVolume( void ) -{ - F32 result = bloodPrimeVolumeDelivered_Safety.data; - - if ( OVERRIDE_KEY == bloodPrimeVolumeDelivered_Safety.override ) - { - result = bloodPrimeVolumeDelivered_Safety.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The execBloodPrime function executes the Blood Prime sub-mode state machine. * @details Inputs: bloodPrimeState * @details Outputs: bloodPrimeState @@ -253,33 +218,20 @@ // Update blood prime volume delivered so far cumulativeBloodPrimeVolume_mL.data += ( getMeasuredBloodFlowRate() * BLOOD_PRIME_FLOW_INTEGRATOR ); - // Update independent calculated safety volume delivered so far - bloodPrimeMotorCount = u32BiDiffWithWrap( bloodPrimeLastMotorCount, getBloodPumpMotorCount() ) / BP_HALL_EDGE_COUNTS_PER_REV; - bloodPrimeVolumeDelivered_Safety.data = ( (F32)bloodPrimeMotorCount * VOLUME_PER_BP_MOTOR_REV_ML ); // TODO - include upstream pressure compensation to this calc // Has blood prime completed? if ( getBloodPrimeVolume() >= TARGET_BLOOD_PRIME_VOLUME_ML ) { -#ifndef DISABLE_PUMP_FLOW_CHECKS - // check for under-delivery - if ( getBloodPrimeSafetyVolume() < MIN_BLOOD_PRIME_SAFETY_VOLUME_ML ) - { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_BLOOD_PRIME_VOLUME_CHECK_FAILURE, TARGET_BLOOD_PRIME_VOLUME_ML, getBloodPrimeSafetyVolume() ); - } - else -#endif - { - setBloodIsPrimed( TRUE ); - signalDialInPumpHardStop(); - signalBloodPrimeToDialysis(); - cmdStopDGTrimmerHeater(); - } + setBloodIsPrimed( TRUE ); + signalDialInPumpHardStop(); + signalBloodPrimeToDialysis(); + cmdStopDGTrimmerHeater(); } #ifndef DISABLE_PUMP_FLOW_CHECKS - // Has independent safety volume exceeded safety limit? - else if ( getBloodPrimeSafetyVolume() > MAX_BLOOD_PRIME_SAFETY_VOLUME_ML ) + // Is blood prime taking too long based on set BP rate? + else if ( TBD ) { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_BLOOD_PRIME_VOLUME_CHECK_FAILURE, TARGET_BLOOD_PRIME_VOLUME_ML, getBloodPrimeSafetyVolume() ); + activateAlarmNoData( ALARM_ID_BLOOD_PRIME_VOLUME_CHECK_FAILURE ); } #endif else @@ -331,7 +283,7 @@ bloodPrimePublishTimerCtr = 0; data.targetBloodPrimeVolumeMl = TARGET_BLOOD_PRIME_VOLUME_ML; data.deliveredBloodPrimeVolumeMl = getBloodPrimeVolume(); - data.indDeliveredBloodPrimeVolumeMl = getBloodPrimeSafetyVolume(); + data.unused = 0.0; // TODO - remove later when UI no longer looking for this field. broadcastData( MSG_ID_HD_BLOOD_PRIME_PROGRESS, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&data, sizeof( BLOOD_PRIME_DATA_PAYLOAD_T ) ); } } @@ -389,51 +341,6 @@ /*********************************************************************//** * @brief - * The testSetBloodPrimeSafetyVolumeOverride function overrides the calculated - * blood prime volume. - * @details Inputs: none - * @details Outputs: bloodPrimeVolumeDelivered_Safety - * @param vol override calculated blood prime safety volume (in mL) - * @return TRUE if override successful, FALSE if not - *************************************************************************/ -BOOL testSetBloodPrimeSafetyVolumeOverride( F32 vol ) -{ - BOOL result = FALSE; - - if ( TRUE == isTestingActivated() ) - { - result = TRUE; - bloodPrimeVolumeDelivered_Safety.ovData = vol; - bloodPrimeVolumeDelivered_Safety.override = OVERRIDE_KEY; - } - - return result; -} - -/*********************************************************************//** - * @brief - * The testResetBloodPrimeSafetyVolumeOverride function resets the override of the - * calculated blood prime safety volume. - * @details Inputs: none - * @details Outputs: bloodPrimeVolumeDelivered_Safety - * @return TRUE if reset successful, FALSE if not - *************************************************************************/ -BOOL testResetBloodPrimeSafetyVolumeOverride( void ) -{ - BOOL result = FALSE; - - if ( TRUE == isTestingActivated() ) - { - result = TRUE; - bloodPrimeVolumeDelivered_Safety.override = OVERRIDE_RESET; - bloodPrimeVolumeDelivered_Safety.ovData = bloodPrimeVolumeDelivered_Safety.ovInitData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The testSetBloodPrimePublishIntervalOverride function sets the override of the * blood prime data publication interval. * @details Inputs: none Index: firmware/App/Modes/BloodPrime.h =================================================================== diff -u -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 -re45524455c005d4fa1734efcbaf7ed0499302670 --- firmware/App/Modes/BloodPrime.h (.../BloodPrime.h) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) +++ firmware/App/Modes/BloodPrime.h (.../BloodPrime.h) (revision e45524455c005d4fa1734efcbaf7ed0499302670) @@ -41,7 +41,7 @@ { F32 targetBloodPrimeVolumeMl; F32 deliveredBloodPrimeVolumeMl; - F32 indDeliveredBloodPrimeVolumeMl; + F32 unused; } BLOOD_PRIME_DATA_PAYLOAD_T; // ********** public function prototypes ********** @@ -54,8 +54,6 @@ BOOL testSetBloodPrimeVolumeOverride( F32 vol ); BOOL testResetBloodPrimeVolumeOverride( void ); -BOOL testSetBloodPrimeSafetyVolumeOverride( F32 vol ); -BOOL testResetBloodPrimeSafetyVolumeOverride( void ); BOOL testSetBloodPrimePublishIntervalOverride( U32 ms ); BOOL testResetBloodPrimePublishIntervalOverride( void ); Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -rdfece12385652318f19c2aa3bd0a5992b0396bec -re45524455c005d4fa1734efcbaf7ed0499302670 --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision dfece12385652318f19c2aa3bd0a5992b0396bec) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision e45524455c005d4fa1734efcbaf7ed0499302670) @@ -80,9 +80,6 @@ static BOOL salineBolusAutoResumeUF = FALSE; ///< Flag indicates UF should be auto-resumed after saline bolus completes. static F32 totalSalineVolumeDelivered; ///< Volume (mL) in total of saline delivered so far (cumulative for all boluses including current one). static F32 bolusSalineVolumeDelivered; ///< Volume (mL) of current bolus delivered so far. -static F32 bolusSalineVolumeDelivered_Safety; ///< Volume (mL) of current bolus delivered so far according to safety monitor. -static S32 bolusSalineMotorCount; ///< Blood pump motor rev count during saline bolus to calculate saline bolus volume independently for safety. -static U32 bolusSalineLastMotorCount; ///< Last blood pump count from last saline bolus volume update. static U32 bolusSalineLastVolumeTimeStamp; ///< Time stamp for last saline volume update. static U32 uFAccuracyCheckTimerCtr; ///< Timer counter to determine when next to check ultrafiltration accuracy. @@ -161,8 +158,6 @@ salineBolusStartRequested = FALSE; salineBolusAbortRequested = FALSE; bolusSalineVolumeDelivered = 0.0; - bolusSalineVolumeDelivered_Safety = 0.0; - bolusSalineMotorCount = 0; if ( currentSalineBolusState != SALINE_BOLUS_STATE_MAX_DELIVERED ) { currentSalineBolusState = SALINE_BOLUS_STATE_IDLE; @@ -252,7 +247,7 @@ // If not done with bolus, start/resume bolus if ( ( bolusVol > 0.0 ) && ( getSyringePumpVolumeDelivered() < bolusVol ) ) { - startHeparinBolus(); // TODO - check return status + startHeparinBolus(); // TODO - check return status or have function trigger alarm if not successful } // Otherwise, start/resume continuous delivery else @@ -874,9 +869,6 @@ { // Reset bolus data before we start bolusSalineVolumeDelivered = 0.0; - bolusSalineVolumeDelivered_Safety = 0.0; - bolusSalineMotorCount = 0; - bolusSalineLastMotorCount = getBloodPumpMotorCount(); bolusSalineLastVolumeTimeStamp = getMSTimerCount(); // Bypass dialyzer @@ -925,8 +917,6 @@ bolusSalineLastVolumeTimeStamp = getMSTimerCount(); bolusSalineVolumeDelivered += volSinceLastUpdateMl; totalSalineVolumeDelivered += volSinceLastUpdateMl; - bolusSalineMotorCount = u32BiDiffWithWrap( bolusSalineLastMotorCount, getBloodPumpMotorCount() ) / BP_HALL_EDGE_COUNTS_PER_REV; - bolusSalineVolumeDelivered_Safety = ( (F32)bolusSalineMotorCount * VOLUME_PER_BP_MOTOR_REV_ML ); // TODO - include upstream pressure compensation to this calc (from PBA). // Check for empty saline bag per arterial line pressure if ( TRUE == isSalineBagEmpty() ) @@ -946,14 +936,6 @@ // Determine if bolus is complete if ( bolusSalineVolumeDelivered >= bolusTargetVolume ) { - // If safety thinks we have under-delivered the bolus, throw a fault - if ( bolusSalineVolumeDelivered_Safety < ( bolusTargetVolume * MIN_SALINE_BOLUS_VOLUME_PCT ) ) - { -#ifndef DISABLE_PUMP_FLOW_CHECKS - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_SALINE_BOLUS_VOLUME_CHECK_FAILURE, bolusTargetVolume, bolusSalineVolumeDelivered_Safety ); - errorFound = TRUE; -#endif - } result = SALINE_BOLUS_STATE_IDLE; } // User is aborting saline bolus @@ -962,15 +944,15 @@ salineBolusAbortRequested = FALSE; result = SALINE_BOLUS_STATE_IDLE; } - // Determine if safety thinks we have over-delivered the bolus - else if ( bolusSalineVolumeDelivered_Safety > ( bolusTargetVolume * MAX_SALINE_BOLUS_VOLUME_PCT ) ) - { #ifndef DISABLE_PUMP_FLOW_CHECKS - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_SALINE_BOLUS_VOLUME_CHECK_FAILURE, bolusTargetVolume, bolusSalineVolumeDelivered_Safety ); + // Determine if saline bolus delivery is taking too long to complete + else if ( TBD ) + { + activateAlarmNoData( ALARM_ID_SALINE_BOLUS_VOLUME_CHECK_FAILURE ); errorFound = TRUE; result = SALINE_BOLUS_STATE_IDLE; -#endif } +#endif } // Are we stopping the bolus? Index: firmware/App/Modes/ModePreTreat.c =================================================================== diff -u -r41885eaa6f8d4b38f57448bc6f6639867e8a8d24 -re45524455c005d4fa1734efcbaf7ed0499302670 --- firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision 41885eaa6f8d4b38f57448bc6f6639867e8a8d24) +++ firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision e45524455c005d4fa1734efcbaf7ed0499302670) @@ -775,7 +775,9 @@ if ( TRUE == treatmentStartRequested ) { DG_RESERVOIR_ID_T const activeRes = getDGActiveReservoir(); + setStartReservoirVolume( activeRes ); + resetHeparinVolumeDelivered(); // get clean starting volume/position before we start treatment requestNewOperationMode( MODE_TREA ); } Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -r0237b2fc49d60b6602bac35ce43831b37f294c81 -re45524455c005d4fa1734efcbaf7ed0499302670 --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 0237b2fc49d60b6602bac35ce43831b37f294c81) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision e45524455c005d4fa1734efcbaf7ed0499302670) @@ -44,13 +44,6 @@ #define MIN_RINSEBACK_FLOW_RATE_ML_MIN 50 ///< Minimum rinseback flow rate (in mL/min). #define MAX_RINSEBACK_FLOW_RATE_ML_MIN 150 ///< Maximum rinseback flow rate (in mL/min). -#ifndef DISABLE_PUMP_FLOW_CHECKS -/// Maximum rinseback volume measured by independent means (as % of target). -static const F32 MAX_RINSEBACK_SAFETY_VOLUME_ML = ( TARGET_RINSEBACK_VOLUME_ML * 1.2 ); -/// Minimum rinseback volume measured by independent means (as % of target). -static const F32 MIN_RINSEBACK_SAFETY_VOLUME_ML = ( TARGET_RINSEBACK_VOLUME_ML * 0.8 ); -#endif - /// Interval at which rinseback progress is to be published to UI. #define RINSEBACK_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) /// Maximum time allowed for rinseback operation until full volume is delivered. Timer is reset whenever BP is running. @@ -71,7 +64,6 @@ static U32 rinsebackTimerCtr; ///< Timer counter for time spent in rinseback sub-mode. static OVERRIDE_F32_T cumulativeRinsebackVolume_mL = { 0.0, 0.0, 0.0, 0 }; ///< Total cumulative rinseback volume (in mL). -static OVERRIDE_F32_T rinsebackVolumeDelivered_Safety = { 0.0, 0.0, 0.0, 0 }; ///< The cumulative independent rinseback volume (in mL) calculated so far. static F32 targetRinsebackVolumePlusAdditional_mL; ///< Target rinseback volume w/ additional volume(s) added (in mL). static F32 additionalRinsebackVolume_mL; ///< Total volume (in mL) delivered so far for additional volume request. static F32 totalAdditionalRinsebackVolume_mL; ///< Total accumulated volume (in mL) delivered so far for all additional volumes combined. @@ -101,7 +93,6 @@ static void setupForRinsebackStopOrPause( void ); static F32 getRinsebackVolume( void ); -static F32 getRinsebackSafetyVolume( void ); static RINSEBACK_STATE_T handleRinsebackStopInitState( void ); static RINSEBACK_STATE_T handleRinsebackRunState( void ); @@ -137,7 +128,6 @@ targetRinsebackVolumePlusAdditional_mL = TARGET_RINSEBACK_VOLUME_ML; rinsebackTimerCtr = 0; cumulativeRinsebackVolume_mL.data = 0.0; - rinsebackVolumeDelivered_Safety.data = 0.0; additionalRinsebackVolume_mL = 0.0; totalAdditionalRinsebackVolume_mL = 0.0; rinsebackMotorCount = 0; @@ -265,26 +255,6 @@ /*********************************************************************//** * @brief - * The getRinsebackSafetyVolume function gets the calculated independent - * blood prime volume delivered. - * @details Inputs: rinsebackVolumeDelivered_Safety - * @details Outputs: none - * @return the current rinseback safety volume delivered (in mL). - *************************************************************************/ -static F32 getRinsebackSafetyVolume( void ) -{ - F32 result = rinsebackVolumeDelivered_Safety.data; - - if ( OVERRIDE_KEY == rinsebackVolumeDelivered_Safety.override ) - { - result = rinsebackVolumeDelivered_Safety.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The getCurrentRinsebackState function returns the current state of the * rinseback sub-mode. * @details Inputs: rinsebackState @@ -388,7 +358,7 @@ * The handleRinsebackRunState function handles the rinseback run state * operations. * @details Inputs: flags - * @details Outputs: cumulativeRinsebackVolume_mL, rinsebackVolumeDelivered_Safety, flags handled + * @details Outputs: cumulativeRinsebackVolume_mL, flags handled * @return next rinseback state *************************************************************************/ static RINSEBACK_STATE_T handleRinsebackRunState( void ) @@ -400,9 +370,6 @@ // Update rinseback volume delivered so far cumulativeRinsebackVolume_mL.data += ( getMeasuredBloodFlowRate() * RINSEBACK_FLOW_INTEGRATOR ); - // update independent calculated safety volume delivered so far - rinsebackMotorCount = u32BiDiffWithWrap( rinsebackLastMotorCount, getBloodPumpMotorCount() ) / BP_HALL_EDGE_COUNTS_PER_REV; - rinsebackVolumeDelivered_Safety.data = ( (F32)rinsebackMotorCount * VOLUME_PER_BP_MOTOR_REV_ML ); // TODO - include upstream pressure compensation to this calc // Has user requested to end rinseback? if ( TRUE == endRinsebackRequested ) @@ -418,13 +385,6 @@ setupForRinsebackStopOrPause(); targetRinsebackVolumePlusAdditional_mL = getRinsebackVolume(); result = RINSEBACK_STOP_STATE; -#ifndef DISABLE_PUMP_FLOW_CHECKS - // Check for under-delivery - if ( getRinsebackSafetyVolume() < MIN_RINSEBACK_SAFETY_VOLUME_ML ) - { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_RINSEBACK_VOLUME_CHECK_FAILURE, TARGET_RINSEBACK_VOLUME_ML, getRinsebackSafetyVolume() ); - } -#endif } // Check for empty saline bag if ( TRUE == isSalineBagEmpty() ) @@ -440,12 +400,12 @@ result = RINSEBACK_PAUSED_STATE; } #ifndef DISABLE_PUMP_FLOW_CHECKS - // Has independent safety volume exceeded safety limit? - else if ( getRinsebackSafetyVolume() > MAX_RINSEBACK_SAFETY_VOLUME_ML ) + // Is rinseback taking too long? + else if ( TBD ) { setRinsebackIsCompleted( TRUE ); setupForRinsebackStopOrPause(); - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_RINSEBACK_VOLUME_CHECK_FAILURE, TARGET_RINSEBACK_VOLUME_ML, getRinsebackSafetyVolume() ); + activateAlarmNoData( ALARM_ID_RINSEBACK_VOLUME_CHECK_FAILURE ); result = RINSEBACK_STOP_STATE; } #endif @@ -1043,14 +1003,14 @@ timeout = MAX_RINSEBACK_DONE_TIME / ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ); } data.deliveredRinsebackVolumeMl = getRinsebackVolume(); - data.safetyRinsebackVolumeMl = getRinsebackSafetyVolume(); data.rinsebackFlowRateMlMin = rinsebackRate_mL_min; if ( RINSEBACK_RUN_ADDITIONAL_STATE == rinsebackState ) { data.rinsebackFlowRateMlMin = MIN_RINSEBACK_FLOW_RATE_ML_MIN; } data.timeout = timeout; data.countdown = countdown; + data.unused = 0.0; // TODO - remove when UI no longer looks for this field broadcastData( MSG_ID_HD_RINSEBACK_PROGRESS, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&data, sizeof( RINSEBACK_DATA_PAYLOAD_T ) ); } } @@ -1128,51 +1088,6 @@ /*********************************************************************//** * @brief - * The testSetRinsebackSafetyVolumeOverride function overrides the calculated - * rinseback safety volume. - * @details Inputs: none - * @details Outputs: rinsebackVolumeDelivered_Safety - * @param vol override calculated rinseback safety volume (in mL) - * @return TRUE if override successful, FALSE if not - *************************************************************************/ -BOOL testSetRinsebackSafetyVolumeOverride( F32 vol ) -{ - BOOL result = FALSE; - - if ( TRUE == isTestingActivated() ) - { - result = TRUE; - rinsebackVolumeDelivered_Safety.ovData = vol; - rinsebackVolumeDelivered_Safety.override = OVERRIDE_KEY; - } - - return result; -} - -/*********************************************************************//** - * @brief - * The testResetRinsebackSafetyVolumeOverride function resets the override of the - * calculated rinseback safety volume. - * @details Inputs: none - * @details Outputs: rinsebackVolumeDelivered_Safety - * @return TRUE if reset successful, FALSE if not - *************************************************************************/ -BOOL testResetRinsebackSafetyVolumeOverride( void ) -{ - BOOL result = FALSE; - - if ( TRUE == isTestingActivated() ) - { - result = TRUE; - rinsebackVolumeDelivered_Safety.override = OVERRIDE_RESET; - rinsebackVolumeDelivered_Safety.ovData = rinsebackVolumeDelivered_Safety.ovInitData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The testSetRinsebackPublishIntervalOverride function sets the override of the * rinseback data publication interval. * @details Inputs: none Index: firmware/App/Modes/Rinseback.h =================================================================== diff -u -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 -re45524455c005d4fa1734efcbaf7ed0499302670 --- firmware/App/Modes/Rinseback.h (.../Rinseback.h) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) +++ firmware/App/Modes/Rinseback.h (.../Rinseback.h) (revision e45524455c005d4fa1734efcbaf7ed0499302670) @@ -44,7 +44,7 @@ U32 rinsebackFlowRateMlMin; U32 timeout; U32 countdown; - F32 safetyRinsebackVolumeMl; + F32 unused; } RINSEBACK_DATA_PAYLOAD_T; #pragma pack(pop) @@ -60,8 +60,6 @@ BOOL testSetRinsebackVolumeOverride( F32 vol ); BOOL testResetRinsebackVolumeOverride( void ); -BOOL testSetRinsebackSafetyVolumeOverride( F32 vol ); -BOOL testResetRinsebackSafetyVolumeOverride( void ); BOOL testSetRinsebackPublishIntervalOverride( U32 ms ); BOOL testResetRinsebackPublishIntervalOverride( void ); Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -rd39ef6232e746a4f2d425135208602670fae60bd -re45524455c005d4fa1734efcbaf7ed0499302670 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision d39ef6232e746a4f2d425135208602670fae60bd) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision e45524455c005d4fa1734efcbaf7ed0499302670) @@ -1583,18 +1583,10 @@ handleBatteryRemainingPercentOverrideRequest( message ); break; - case MSG_ID_HD_BLOOD_PRIME_SAFETY_VOLUME_OVERRIDE: - handleBloodPrimeSafetyVolumeOverrideRequest( message ); - break; - case MSG_ID_HD_RINSEBACK_VOLUME_OVERRIDE: handleRinsebackVolumeOverrideRequest( message ); break; - case MSG_ID_HD_RINSEBACK_SAFETY_VOLUME_OVERRIDE: - handleRinsebackSafetyVolumeOverrideRequest( message ); - break; - case MSG_ID_HD_SYRINGE_PUMP_SEND_INTERVAL_OVERRIDE: handleTestSyringePumpDataBroadcastIntervalOverrideRequest( message ); break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rd39ef6232e746a4f2d425135208602670fae60bd -re45524455c005d4fa1734efcbaf7ed0499302670 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision d39ef6232e746a4f2d425135208602670fae60bd) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision e45524455c005d4fa1734efcbaf7ed0499302670) @@ -3822,40 +3822,6 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } -#ifdef USE_FMD_FLOW_SENSOR -/*********************************************************************//** - * @brief - * The handleTestDialInFlowSignalStrengthOverrideRequest function handles a - * request to override the measured dialysate inlet flow signal strength (%). - * @details Inputs: none - * @details Outputs: message handled - * @param message a pointer to the message to handle - * @return none - *************************************************************************/ -void handleTestDialInFlowSignalStrengthOverrideRequest( MESSAGE_T *message ) -{ - TEST_OVERRIDE_PAYLOAD_T payload; - BOOL result = FALSE; - - // Verify payload length - if ( sizeof(TEST_OVERRIDE_PAYLOAD_T) == message->hdr.payloadLen ) - { - memcpy( &payload, message->payload, sizeof(TEST_OVERRIDE_PAYLOAD_T) ); - if ( FALSE == payload.reset ) - { - result = testSetMeasuredDialInFlowSignalStrengthOverride( payload.state.f32 ); - } - else - { - result = testResetMeasuredDialInFlowSignalStrengthOverride(); - } - } - - // Respond to request - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); -} -#endif - /*********************************************************************//** * @brief * The handleTestDialInPumpRotorMeasuredSpeedOverrideRequest function handles a request to @@ -5201,38 +5167,6 @@ /*********************************************************************//** * @brief - * The handleBloodPrimeSafetyVolumeOverrideRequest function handles a request to - * override the calculated safety blood prime volume (in mL). - * @details Inputs: none - * @details Outputs: message handled - * @param message : a pointer to the message to handle - * @return none - *************************************************************************/ -void handleBloodPrimeSafetyVolumeOverrideRequest( MESSAGE_T *message ) -{ - TEST_OVERRIDE_PAYLOAD_T payload; - BOOL result = FALSE; - - // Verify payload length - if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) - { - memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); - if ( FALSE == payload.reset ) - { - result = testSetBloodPrimeSafetyVolumeOverride( payload.state.f32 ); - } - else - { - result = testResetBloodPrimeSafetyVolumeOverride(); - } - } - - // Respond to request - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); -} - -/*********************************************************************//** - * @brief * The handleRinsebackVolumeOverrideRequest function handles a request to * override the calculated rinseback volume (in mL). * @details Inputs: none @@ -5265,38 +5199,6 @@ /*********************************************************************//** * @brief - * The handleRinsebackSafetyVolumeOverrideRequest function handles a request to - * override the calculated safety rinseback volume (in mL). - * @details Inputs: none - * @details Outputs: message handled - * @param message : a pointer to the message to handle - * @return none - *************************************************************************/ -void handleRinsebackSafetyVolumeOverrideRequest( MESSAGE_T *message ) -{ - TEST_OVERRIDE_PAYLOAD_T payload; - BOOL result = FALSE; - - // Verify payload length - if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) - { - memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); - if ( FALSE == payload.reset ) - { - result = testSetRinsebackSafetyVolumeOverride( payload.state.f32 ); - } - else - { - result = testResetRinsebackSafetyVolumeOverride(); - } - } - - // Respond to request - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); -} - -/*********************************************************************//** - * @brief * The handleHDSoftwareResetRequest function handles a request to reset the * HD firmware processor. * @details Inputs: none Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -rd39ef6232e746a4f2d425135208602670fae60bd -re45524455c005d4fa1734efcbaf7ed0499302670 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision d39ef6232e746a4f2d425135208602670fae60bd) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision e45524455c005d4fa1734efcbaf7ed0499302670) @@ -469,11 +469,6 @@ // MSG_ID_DIAL_IN_FLOW_MEAS_OVERRIDE void handleTestDialInFlowMeasuredOverrideRequest( MESSAGE_T *message ); -#ifdef USE_FMD_FLOW_SENSOR -// MSG_ID_DIAL_IN_FLOW_SIG_STRENGTH_OVERRIDE -void handleTestDialInFlowSignalStrengthOverrideRequest( MESSAGE_T *message ); -#endif - // MSG_ID_DIAL_IN_PUMP_MC_MEAS_SPEED_OVERRIDE void handleTestDialInPumpMCMeasuredSpeedOverrideRequest( MESSAGE_T *message ); @@ -605,15 +600,9 @@ // MSG_ID_HD_BLOOD_PRIME_VOLUME_OVERRIDE void handleBloodPrimeVolumeOverrideRequest( MESSAGE_T *message ); -// MSG_ID_HD_BLOOD_PRIME_SAFETY_VOLUME_OVERRIDE -void handleBloodPrimeSafetyVolumeOverrideRequest( MESSAGE_T *message ); - // MSG_ID_HD_RINSEBACK_VOLUME_OVERRIDE void handleRinsebackVolumeOverrideRequest( MESSAGE_T *message ); -// MSG_ID_HD_RINSEBACK_SAFETY_VOLUME_OVERRIDE -void handleRinsebackSafetyVolumeOverrideRequest( MESSAGE_T *message ); - // MSG_ID_HD_SWITCHES_STATUS_OVERRIDE void handleSetSwitchesStatusOverrideRequest( MESSAGE_T *message );