Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -r1a685471524555a374854c0c9ec8e208e71fe2df -r933a18d740285e70be9d00696ed0f5a5381bc8e4 --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 1a685471524555a374854c0c9ec8e208e71fe2df) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 933a18d740285e70be9d00696ed0f5a5381bc8e4) @@ -17,8 +17,10 @@ #include "PresOccl.h" #include "AlarmMgmt.h" -#include "FPGA.h" -#include "OperationModes.h" +#include "FPGA.h" +#include "ModeTreatmentParams.h" +#include "OperationModes.h" +#include "PersistentAlarm.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Timers.h" @@ -39,10 +41,22 @@ #define VENOUS_PRESSURE_OFFSET ( 1638 ) ///< Offset for 14-bit venous pressure sensor reading. #define VENOUS_PRESSURE_SCALE ( 14745 - VENOUS_PRESSURE_OFFSET ) ///< Scale for venous pressure sensor. -#define VENOUS_PRESSURE_MIN ( 30.0 ) ///< Minimum of scale for venous pressure sensor reading (in TBD u/m). -#define VENOUS_PRESSURE_MAX ( 90.0 ) ///< Maximum of scale for venous pressure sensor reading (in TBD u/m). +#define VENOUS_PRESSURE_MIN ( -30.0 ) ///< Minimum of scale for venous pressure sensor reading (in PSI). +#define VENOUS_PRESSURE_MAX ( 30.0 ) ///< Maximum of scale for venous pressure sensor reading (in PSI). -#define PSI_TO_MMHG ( 51.7149 ) ///< Conversion factor (mmHg/PSI) for converting PSI to mmHg. +#define PSI_TO_MMHG ( 51.7149 ) ///< Conversion factor for converting PSI to mmHg. + +#define VENOUS_PRESSURE_NORMAL_OP 0 ///< Venous pressure status bits indicate normal operation. +#define VENOUS_PRESSURE_CMD_MODE 1 ///< Venous pressure status bits indicate sensor in command mode. +#define VENOUS_PRESSURE_STALE_DATA 2 ///< Venous pressure status bits indicate data is stale (no new data since last fpga read). +#define VENOUS_PRESSURE_DIAG_CONDITION 3 ///< Venous pressure status bits diagnostic condition (alarm). + +#define MAX_TIME_BETWEEN_VENOUS_READINGS ( 500 / TASK_GENERAL_INTERVAL ) ///< Maximum time without fresh inline venous pressure reading. + +#define OCCLUSION_THRESHOLD 25000 ///< Threshold above which an occlusion is detected. +#define CARTRIDGE_LOADED_THRESHOLD 5000 ///< Threshold above which a cartridge is considered loaded. + +#define PRES_ALARM_PERSISTENCE ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Alarm persistence period for pressure alarms. /// Defined states for the pressure and occlusion monitor state machine. typedef enum PresOccl_States @@ -66,25 +80,28 @@ static PRESSURE_STATE_T presOcclState = PRESSURE_INIT_STATE; ///< current state of pressure monitor state machine. static U32 presOcclDataPublicationTimerCounter = 0; ///< used to schedule pressure data publication to CAN bus. -static OVERRIDE_U32_T presOcclDataPublishInterval = { PRES_OCCL_DATA_PUB_INTERVAL, PRES_OCCL_DATA_PUB_INTERVAL, 0, 0 }; ///< interval (in ms) at which to publish pressure/occlusion data to CAN bus. +/// interval (in ms) at which to publish pressure/occlusion data to CAN bus. +static OVERRIDE_U32_T presOcclDataPublishInterval = { PRES_OCCL_DATA_PUB_INTERVAL, PRES_OCCL_DATA_PUB_INTERVAL, 0, 0 }; static OVERRIDE_F32_T arterialPressure = {0.0, 0.0, 0.0, 0 }; ///< measured arterial pressure. static OVERRIDE_F32_T venousPressure = {0.0, 0.0, 0.0, 0 }; ///< measured venous pressure. -static OVERRIDE_F32_T bloodPumpOcclusion = {0.0, 0.0, 0.0, 0 }; ///< measured blood pump occlusion pressure. -static OVERRIDE_F32_T dialInPumpOcclusion = {0.0, 0.0, 0.0, 0 }; ///< measured dialysate inlet pump occlusion pressure. -static OVERRIDE_F32_T dialOutPumpOcclusion = {0.0, 0.0, 0.0, 0 }; ///< measured dialysate outlet pump occlusion pressure. +static OVERRIDE_U32_T bloodPumpOcclusion = {0, 0, 0, 0 }; ///< measured blood pump occlusion pressure. +static OVERRIDE_U32_T dialInPumpOcclusion = {0, 0, 0, 0 }; ///< measured dialysate inlet pump occlusion pressure. +static OVERRIDE_U32_T dialOutPumpOcclusion = {0, 0, 0, 0 }; ///< measured dialysate outlet pump occlusion pressure. -static PRESSURE_SELF_TEST_STATE_T presOcclSelfTestState = PRESSURE_SELF_TEST_STATE_START; ///< current pressure self-test state. -static U32 presOcclSelfTestTimerCount = 0; ///< timer counter for pressure self-test. +/// current pressure self-test state. +static PRESSURE_SELF_TEST_STATE_T presOcclSelfTestState = PRESSURE_SELF_TEST_STATE_START; +static U32 bloodPumpSelfTestTimerCount = 0; ///< timer counter for pressure self-test. -// TODO - set thresholds for occlusions -static F32 bloodPumpOcclusionPressureThresholdmmHG = 50.0; ///< pressure threshold for blood pump occlusion. -static F32 dialInPumpOcclusionPressureThresholdmmHG = 50.0; ///< pressure threshold for dialysate inlet pump occlusion. -static F32 dialOutPumpOcclusionPressureThresholdmmHG = 50.0; ///< pressure threshold for dialysate outlet pump occlusion. +static U32 staleVenousPressureCtr = 0; ///< timer counter for stale venous pressure reading. // ********** private function prototypes ********** static PRESSURE_STATE_T handlePresOcclInitState( void ); -static PRESSURE_STATE_T handlePresOcclContReadState( void ); +static PRESSURE_STATE_T handlePresOcclContReadState( void ); +static void convertInlinePressures( void ); +static void convertOcclusionPressures( void ); +static void checkArterialPressureInRange( void ); +static void checkVenousPressureInRange( void ); static void checkOcclusions( void ); static void publishPresOcclData( void ); static DATA_GET_PROTOTYPE( U32, getPublishPresOcclDataInterval ); @@ -93,48 +110,49 @@ * @brief * The initPresOccl function initializes the initPresOccl module. * @details Inputs: none - * @details Outputs: Pressures and Occlusions module initialized. + * @details Outputs: initPresOccl module initialized. * @return none *************************************************************************/ void initPresOccl( void ) { - // TODO - anything to initialize? + // initialize persistent pressure alarms + initPersistentAlarm( PERSISTENT_ALARM_ARTERIAL_PRESSURE_LOW, ALARM_ID_ARTERIAL_PRESSURE_LOW, + isAlarmRecoverable( ALARM_ID_ARTERIAL_PRESSURE_LOW ), PRES_ALARM_PERSISTENCE, PRES_ALARM_PERSISTENCE ); + initPersistentAlarm( PERSISTENT_ALARM_ARTERIAL_PRESSURE_HIGH, ALARM_ID_ARTERIAL_PRESSURE_HIGH, + isAlarmRecoverable( ALARM_ID_ARTERIAL_PRESSURE_HIGH ), PRES_ALARM_PERSISTENCE, PRES_ALARM_PERSISTENCE ); + initPersistentAlarm( PERSISTENT_ALARM_VENOUS_PRESSURE_LOW, ALARM_ID_VENOUS_PRESSURE_LOW, + isAlarmRecoverable( ALARM_ID_VENOUS_PRESSURE_LOW ), PRES_ALARM_PERSISTENCE, PRES_ALARM_PERSISTENCE ); + initPersistentAlarm( PERSISTENT_ALARM_VENOUS_PRESSURE_HIGH, ALARM_ID_VENOUS_PRESSURE_HIGH, + isAlarmRecoverable( ALARM_ID_VENOUS_PRESSURE_HIGH ), PRES_ALARM_PERSISTENCE, PRES_ALARM_PERSISTENCE ); } +/*********************************************************************//** + * @brief + * The isCartridgeLoaded function determines whether a cartridge has been + * properly loaded by looking at the 3 occlusion pressure sensors. + * @details Inputs: occlusion pressures for the pumps + * @details Outputs: none + * @return TRUE if all 3 occlusion sensors read above loaded threshold, FALSE if not. + *************************************************************************/ +BOOL isCartridgeLoaded( void ) +{ + BOOL result = FALSE; + U32 bpOccl = getMeasuredBloodPumpOcclusion(); + U32 diOccl = getMeasuredDialInPumpOcclusion(); + U32 doOccl = getMeasuredDialOutPumpOcclusion(); + + if ( ( bpOccl >= CARTRIDGE_LOADED_THRESHOLD ) && + ( diOccl >= CARTRIDGE_LOADED_THRESHOLD ) && + ( doOccl >= CARTRIDGE_LOADED_THRESHOLD ) ) + { + result = TRUE; + } + + return result; +} + /*********************************************************************//** * @brief - * The setOcclusionThreshold function sets the occlusion pressure threshold - * for a given occlusion sensor. - * @details Inputs: none - * @details Outputs: pressure threshold - * @param sensor occlusion sensor we are setting threshold for - * @param threshold pressure threshold above which indicates an occlusion (mmHg) - * @return none - *************************************************************************/ -void setOcclusionThreshold( OCCLUSION_SENSORS_T sensor, F32 threshold ) -{ - switch ( sensor ) // TODO - will threshold be range checked by caller or should we do it here? what is valid range? - { - case OCCLUSION_SENSOR_BLOOD_PUMP: - bloodPumpOcclusionPressureThresholdmmHG = threshold; - break; - - case OCCLUSION_SENSOR_DIAL_IN_PUMP: - dialInPumpOcclusionPressureThresholdmmHG = threshold; - break; - - case OCCLUSION_SENSOR_DIAL_OUT_PUMP: - dialOutPumpOcclusionPressureThresholdmmHG = threshold; - break; - - default: - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_PRES_OCCL_INVALID_OCCL_SENSOR, sensor ) - break; - } -} - -/*********************************************************************//** - * @brief * The execPresOccl function executes the pressure and occlusion monitor. * @details Inputs: presOcclState * @details Outputs: presOcclState @@ -166,8 +184,8 @@ * @brief * The handlePresOcclInitState function handles the pres/occl initialize state * of the pressure/occlusion monitor state machine. - * @details Inputs: none - * @details Outputs: none + * @details Inputs: TBD + * @details Outputs: TBD * @return next state *************************************************************************/ static PRESSURE_STATE_T handlePresOcclInitState( void ) @@ -187,61 +205,180 @@ *************************************************************************/ static PRESSURE_STATE_T handlePresOcclContReadState( void ) { - PRESSURE_STATE_T result = PRESSURE_CONTINUOUS_READ_STATE; - - S32 artPres = getFPGAArterialPressure(); - U16 venPres = getFPGAVenousPressure(); - U16 bldOccl = getFPGABloodPumpOcclusion(); - U16 dliOccl = getFPGADialInPumpOcclusion(); - U16 dloOccl = getFPGADialOutPumpOcclusion(); - F32 venPresPSI; - - // TODO - convert ADC counts to mmHg for each sensor - arterialPressure.data = ARTERIAL_PRESSURE_V_PER_BIT * ( (F32)(artPres) / ( ARTERIAL_PRESSURE_SENSITIVITY / ARTERIAL_PRESSURE_V_BIAS ) ); - venPresPSI = ( (F32)(venPres - VENOUS_PRESSURE_OFFSET) * (VENOUS_PRESSURE_MAX - VENOUS_PRESSURE_MIN) / (F32)VENOUS_PRESSURE_SCALE ) - VENOUS_PRESSURE_MIN; - venousPressure.data = venPresPSI * PSI_TO_MMHG; - bloodPumpOcclusion.data = (F32)bldOccl; - dialInPumpOcclusion.data = (F32)dliOccl; - dialOutPumpOcclusion.data = (F32)dloOccl; - - // TODO - any filtering required??? - + PRESSURE_STATE_T result = PRESSURE_CONTINUOUS_READ_STATE; + + // read latest in-line (arterial and venous) pressures + convertInlinePressures(); + + // read latest occlusion pressures + convertOcclusionPressures(); + + // check in-line pressures are in range + checkArterialPressureInRange(); + checkVenousPressureInRange(); + // check for occlusions - checkOcclusions(); - - // TODO - any other checks - + checkOcclusions(); + return result; } - + +/*********************************************************************//** + * @brief + * The convertInlinePressures function reads inline pressure sensor readings + * and converts to mmHg. Sensor status/alarm is checked. + * @details Inputs: FPGA + * @details Outputs: arterialPressure, venousPressure + * @return none + *************************************************************************/ +static void convertInlinePressures( void ) +{ + U32 fpgaArtPres = getFPGAArterialPressure(); + S32 artPres = (S32)( fpgaArtPres & MASK_OFF_U32_MSB ) - 0x800000; // subtract 2^23 from low 24 bits to get signed reading + U08 artPresAlarm = (U08)( fpgaArtPres >> 24 ); // high byte is alarm code for arterial pressure + U16 fpgaVenPres = getFPGAVenousPressure(); + U16 venPres = fpgaVenPres & 0x3FFF; // 14-bit data + U08 venPresStatus = (U08)( fpgaVenPres >> 14 ); // high 2 bits is status code for venous pressure + F32 venPresPSI; + + // TODO - any filtering required??? + + // convert arterial pressure to mmHg if no alarm + if ( 0 == artPresAlarm ) + { + arterialPressure.data = ARTERIAL_PRESSURE_V_PER_BIT * ( (F32)(artPres) / ( ARTERIAL_PRESSURE_SENSITIVITY * ARTERIAL_PRESSURE_V_BIAS ) ); + } + else + { +#ifndef DISABLE_PRESSURE_CHECKS + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_ARTERIAL_PRESSURE_SENSOR_FAULT, (U32)artPresAlarm ) +#endif + } + + // convert venous pressure to PSI + venPresPSI = ( (F32)(venPres - VENOUS_PRESSURE_OFFSET) * (VENOUS_PRESSURE_MAX - VENOUS_PRESSURE_MIN) / (F32)VENOUS_PRESSURE_SCALE ) + VENOUS_PRESSURE_MIN; + // convert venous pressure from PSI to mmHg if sensor status is normal + if ( VENOUS_PRESSURE_NORMAL_OP == venPresStatus ) + { + venousPressure.data = venPresPSI * PSI_TO_MMHG; + staleVenousPressureCtr = 0; + } + // if venous pressure sensor status is not normal or reading is stale for too long, fault + else + { + if ( ++staleVenousPressureCtr > MAX_TIME_BETWEEN_VENOUS_READINGS ) + { +#ifndef DISABLE_PRESSURE_CHECKS + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_VENOUS_PRESSURE_SENSOR_FAULT, VENOUS_PRESSURE_STALE_DATA ) +#endif + } + } + + // check for venous pressure sensor alarm or in wrong (cmd) mode + if ( ( VENOUS_PRESSURE_DIAG_CONDITION == venPresStatus ) || ( VENOUS_PRESSURE_CMD_MODE == venPresStatus ) ) + { +#ifndef DISABLE_PRESSURE_CHECKS + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_VENOUS_PRESSURE_SENSOR_FAULT, (U32)venPresStatus ) +#endif + } +} + +/*********************************************************************//** + * @brief + * The convertOcclusionPressures function reads occlusion sensor readings. + * @details Inputs: FPGA + * @details Outputs: bloodPumpOcclusion, dialInPumpOcclusion, dialOutPumpOcclusion + * @return none + *************************************************************************/ +static void convertOcclusionPressures( void ) +{ + // TODO - any filtering required??? + + // occlusion sensor values have no unit - take as is + bloodPumpOcclusion.data = (U32)getFPGABloodPumpOcclusion(); + dialInPumpOcclusion.data = (U32)getFPGADialInPumpOcclusion(); + dialOutPumpOcclusion.data = (U32)getFPGADialOutPumpOcclusion(); +} + +/*********************************************************************//** + * @brief + * The checkArterialPressureInRange function checks that artieral pressure is + * within the set alarm limits. Alarm is triggered if not. + * @details Inputs: arterialPressure + * @details Outputs: Alarm if out of range + * @return none + *************************************************************************/ +static void checkArterialPressureInRange( void ) +{ + F32 artPres = getMeasuredArterialPressure(); + + // check arterial pressure during treatment mode + if ( MODE_TREA == getCurrentOperationMode() ) + { + F32 artLowLimit = (F32)getTreatmentParameterS32( TREATMENT_PARAM_ART_PRESSURE_LOW_LIMIT ); + F32 artHighLimit = (F32)getTreatmentParameterS32( TREATMENT_PARAM_ART_PRESSURE_HIGH_LIMIT ); + +#ifndef DISABLE_PRESSURE_CHECKS + checkPersistentAlarm( PERSISTENT_ALARM_ARTERIAL_PRESSURE_LOW, artPres < artLowLimit, artPres, artLowLimit ); + checkPersistentAlarm( PERSISTENT_ALARM_ARTERIAL_PRESSURE_HIGH, artPres > artHighLimit, artPres, artHighLimit ); +#endif + } +} + +/*********************************************************************//** + * @brief + * The checkVenousPressureInRange function checks that venous pressure is + * within the set alarm limits. Alarm is triggered if not. + * @details Inputs: venousPressure + * @details Outputs: Alarm if out of range + * @return none + *************************************************************************/ +static void checkVenousPressureInRange( void ) +{ + F32 venPres = getMeasuredVenousPressure(); + + // check arterial pressure during treatment mode + if ( MODE_TREA == getCurrentOperationMode() ) + { + F32 venLowLimit = (F32)getTreatmentParameterS32( TREATMENT_PARAM_VEN_PRESSURE_LOW_LIMIT ); + F32 venHighLimit = (F32)getTreatmentParameterS32( TREATMENT_PARAM_VEN_PRESSURE_HIGH_LIMIT ); + +#ifndef DISABLE_PRESSURE_CHECKS + checkPersistentAlarm( PERSISTENT_ALARM_VENOUS_PRESSURE_LOW, venPres < venLowLimit, venPres, venLowLimit ); + checkPersistentAlarm( PERSISTENT_ALARM_VENOUS_PRESSURE_HIGH, venPres > venHighLimit, venPres, venHighLimit ); +#endif + } +} + /*********************************************************************//** * @brief * The checkPressureLimits function gets the pressure/occlusion data * publication interval. * @details Inputs: occlusion pressures for the pumps - * @details Outputs: alarm(s) may be triggered + * @details Outputs: Alarm if occlusion limit exceeded * @return none *************************************************************************/ static void checkOcclusions( void ) { - F32 bpOccl = getMeasuredBloodPumpOcclusion(); - F32 diOccl = getMeasuredDialInPumpOcclusion(); - F32 doOccl = getMeasuredDialOutPumpOcclusion(); - + U32 bpOccl = getMeasuredBloodPumpOcclusion(); + U32 diOccl = getMeasuredDialInPumpOcclusion(); + U32 doOccl = getMeasuredDialOutPumpOcclusion(); + + // TODO - add persistence #ifndef DISABLE_PRESSURE_CHECKS - if ( bpOccl > bloodPumpOcclusionPressureThresholdmmHG ) + if ( bpOccl > OCCLUSION_THRESHOLD ) { - SET_ALARM_WITH_1_F32_DATA( ALARM_ID_OCCLUSION_BLOOD_PUMP, bpOccl ) + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_OCCLUSION_BLOOD_PUMP, bpOccl ) // TODO - stop blood pump immediately, ... } - if ( diOccl > dialInPumpOcclusionPressureThresholdmmHG ) + if ( diOccl > OCCLUSION_THRESHOLD ) { - SET_ALARM_WITH_1_F32_DATA( ALARM_ID_OCCLUSION_DIAL_IN_PUMP, diOccl ) + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_OCCLUSION_DIAL_IN_PUMP, diOccl ) // TODO - stop dialysate inlet pump immediately, ... } - if ( doOccl > dialOutPumpOcclusionPressureThresholdmmHG ) + if ( doOccl > OCCLUSION_THRESHOLD ) { - SET_ALARM_WITH_1_F32_DATA( ALARM_ID_OCCLUSION_DIAL_OUT_PUMP, doOccl ) + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_OCCLUSION_DIAL_OUT_PUMP, doOccl ) // TODO - stop dialysate outlet pump immediately, ... } #endif @@ -255,7 +392,17 @@ * @details Outputs: none * @return the current pressure/occlusion data publication interval (in task intervals). *************************************************************************/ -DATA_GET( U32, getPublishPresOcclDataInterval, presOcclDataPublishInterval ) +U32 getPublishPresOcclDataInterval( void ) +{ + U32 result = presOcclDataPublishInterval.data; + + if ( OVERRIDE_KEY == presOcclDataPublishInterval.override ) + { + result = presOcclDataPublishInterval.ovData; + } + + return result; +} /*********************************************************************//** * @brief @@ -264,7 +411,17 @@ * @details Outputs: none * @return the current arterial pressure (in mmHg). *************************************************************************/ -DATA_GET( F32, getMeasuredArterialPressure, arterialPressure ) +F32 getMeasuredArterialPressure( void ) +{ + F32 result = arterialPressure.data; + + if ( OVERRIDE_KEY == arterialPressure.override ) + { + result = arterialPressure.ovData; + } + + return result; +} /*********************************************************************//** * @brief @@ -273,7 +430,17 @@ * @details Outputs: none * @return the current venous pressure (in mmHg). *************************************************************************/ -DATA_GET( F32, getMeasuredVenousPressure, venousPressure ) +F32 getMeasuredVenousPressure( void ) +{ + F32 result = venousPressure.data; + + if ( OVERRIDE_KEY == venousPressure.override ) + { + result = venousPressure.ovData; + } + + return result; +} /*********************************************************************//** * @brief @@ -283,7 +450,17 @@ * @details Outputs: none * @return the current blood pump occlusion pressure (in mmHg). *************************************************************************/ -DATA_GET( F32, getMeasuredBloodPumpOcclusion, bloodPumpOcclusion ) +U32 getMeasuredBloodPumpOcclusion( void ) +{ + U32 result = bloodPumpOcclusion.data; + + if ( OVERRIDE_KEY == bloodPumpOcclusion.override ) + { + result = bloodPumpOcclusion.ovData; + } + + return result; +} /*********************************************************************//** * @brief @@ -293,7 +470,17 @@ * @details Outputs: none * @return the current dialysis inlet pump occlusion pressure (in mmHg). *************************************************************************/ -DATA_GET( F32, getMeasuredDialInPumpOcclusion, dialInPumpOcclusion ) +U32 getMeasuredDialInPumpOcclusion( void ) +{ + U32 result = dialInPumpOcclusion.data; + + if ( OVERRIDE_KEY == dialInPumpOcclusion.override ) + { + result = dialInPumpOcclusion.ovData; + } + + return result; +} /*********************************************************************//** * @brief @@ -303,7 +490,17 @@ * @details Outputs: none * @return the current dialysis outlet pump occlusion pressure (in mmHg). *************************************************************************/ -DATA_GET( F32, getMeasuredDialOutPumpOcclusion, dialOutPumpOcclusion ) +U32 getMeasuredDialOutPumpOcclusion( void ) +{ + U32 result = dialOutPumpOcclusion.data; + + if ( OVERRIDE_KEY == dialOutPumpOcclusion.override ) + { + result = dialOutPumpOcclusion.ovData; + } + + return result; +} /*********************************************************************//** * @brief @@ -317,14 +514,16 @@ { // publish pressure/occlusion data on interval if ( ++presOcclDataPublicationTimerCounter >= getPublishPresOcclDataInterval() ) - { - F32 artPres = getMeasuredArterialPressure(); - F32 venPres = getMeasuredVenousPressure(); - F32 bpOccl = getMeasuredBloodPumpOcclusion(); - F32 diOccl = getMeasuredDialInPumpOcclusion(); - F32 doOccl = getMeasuredDialOutPumpOcclusion(); + { + PRESSURE_OCCLUSION_DATA_T data; - broadcastPresOcclData( artPres, venPres, bpOccl, diOccl, doOccl ); + data.arterialPressure = getMeasuredArterialPressure(); + data.venousPressure = getMeasuredVenousPressure(); + data.bldPumpOcclusion = getMeasuredBloodPumpOcclusion(); + data.diPumpOcclusion = getMeasuredDialInPumpOcclusion(); + data.doPumpOcclusion = getMeasuredDialOutPumpOcclusion(); + + broadcastPresOcclData( data ); presOcclDataPublicationTimerCounter = 0; } } @@ -492,13 +691,13 @@ /*********************************************************************//** * @brief * The testSetBloodPumpOcclusionOverride function overrides the measured - * blood pump occlusion pressure.n + * blood pump occlusion pressure. * @details Inputs: none * @details Outputs: bloodPumpOcclusion - * @param value override measured blood pump occlusion pressure with (in mmHg) + * @param value override measured blood pump occlusion pressure with * @return TRUE if override successful, FALSE if not *************************************************************************/ -BOOL testSetBloodPumpOcclusionOverride( F32 value ) +BOOL testSetBloodPumpOcclusionOverride( U32 value ) { BOOL result = FALSE; @@ -540,10 +739,10 @@ * dialysate inlet pump occlusion pressure.n * @details Inputs: none * @details Outputs: dialInPumpOcclusion - * @param value override measured dialysate inlet pump occlusion pressure (in mmHg) + * @param value override measured dialysate inlet pump occlusion pressure * @return TRUE if override successful, FALSE if not *************************************************************************/ -BOOL testSetDialInPumpOcclusionOverride( F32 value ) +BOOL testSetDialInPumpOcclusionOverride( U32 value ) { BOOL result = FALSE; @@ -585,10 +784,10 @@ * dialysate outlet pump occlusion pressure. * @details Inputs: none * @details Outputs: dialOutPumpOcclusion - * @param value override measured dialysate outlet pump occlusion pressure (in mmHg) + * @param value override measured dialysate outlet pump occlusion pressure * @return TRUE if override successful, FALSE if not *************************************************************************/ -BOOL testSetDialOutPumpOcclusionOverride( F32 value ) +BOOL testSetDialOutPumpOcclusionOverride( U32 value ) { BOOL result = FALSE;