Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -ra4236a98b2de7d007173862dfe6b114bce08f90f -r60a95cb6e1325abd179b4a01d83b8aabe20ccda5 --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision a4236a98b2de7d007173862dfe6b114bce08f90f) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 60a95cb6e1325abd179b4a01d83b8aabe20ccda5) @@ -29,49 +29,49 @@ // ********** private definitions ********** -/// Default publication interval for pressure and occlusion data -#define PRES_OCCL_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) // interval (ms/task time) at which the pressure/occlusion data is published on the CAN bus +/// Default publication interval for pressure and occlusion data. +#define PRES_OCCL_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) // interval (ms/task time) at which the pressure/occlusion data is published on the CAN bus. -/// Defined states for the pressure and occlusion monitor state machine +/// Defined states for the pressure and occlusion monitor state machine. typedef enum PresOccl_States { - PRESSURE_INIT_STATE = 0, ///< Initialization state - PRESSURE_CONTINUOUS_READ_STATE, ///< Continuous read sensors state - NUM_OF_PRESSURE_STATES + PRESSURE_INIT_STATE = 0, ///< Initialization state. + PRESSURE_CONTINUOUS_READ_STATE, ///< Continuous read sensors state. + NUM_OF_PRESSURE_STATES ///< # of pressure/occlusion monitor states. } PRESSURE_STATE_T; -/// Defined states for the pressure and occlusion self test state machine +/// Defined states for the pressure and occlusion self test state machine. typedef enum PresOccl_Self_Test_States { - PRESSURE_SELF_TEST_STATE_START = 0, ///< Self test start state - PRESSURE_TEST_STATE_IN_PROGRESS, ///< Self test in progress state - PRESSURE_TEST_STATE_COMPLETE, ///< Self test completed state - NUM_OF_PRESSURE_SELF_TEST_STATES + PRESSURE_SELF_TEST_STATE_START = 0, ///< Self test start state. + PRESSURE_TEST_STATE_IN_PROGRESS, ///< Self test in progress state. + PRESSURE_TEST_STATE_COMPLETE, ///< Self test completed state. + NUM_OF_PRESSURE_SELF_TEST_STATES ///< # of pressure/occlusion self test states. } PRESSURE_SELF_TEST_STATE_T; // ********** private data ********** -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 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. -DATA_DECL( U32, PresOcclDataPub, presOcclDataPublishInterval, PRES_OCCL_DATA_PUB_INTERVAL, PRES_OCCL_DATA_PUB_INTERVAL ); ///< interval (in ms) at which to publish pressure/occlusion data to CAN bus -DATA_DECL( F32, ArterialPressure, arterialPressure, 0, 0 ); ///< measured arterial pressure -DATA_DECL( F32, VenousPressure, venousPressure, 0.0, 0.0 ); ///< measured venous pressure -DATA_DECL( F32, BloodPumpOcclusion, bloodPumpOcclusion, 0.0, 0.0 ); ///< measured blood pump occlusion pressure -DATA_DECL( F32, DialInPumpOcclusion, dialInPumpOcclusion, 0.0, 0.0 ); ///< measured dialysate inlet pump occlusion pressure -DATA_DECL( F32, DialOutPumpOcclusion, dialOutPumpOcclusion, 0.0, 0.0 ); ///< measured dialysate outlet pump occlusion pressure +DATA_DECL( U32, PresOcclDataPub, presOcclDataPublishInterval, PRES_OCCL_DATA_PUB_INTERVAL, PRES_OCCL_DATA_PUB_INTERVAL ); ///< interval (in ms) at which to publish pressure/occlusion data to CAN bus. +DATA_DECL( F32, ArterialPressure, arterialPressure, 0, 0 ); ///< measured arterial pressure. +DATA_DECL( F32, VenousPressure, venousPressure, 0.0, 0.0 ); ///< measured venous pressure. +DATA_DECL( F32, BloodPumpOcclusion, bloodPumpOcclusion, 0.0, 0.0 ); ///< measured blood pump occlusion pressure. +DATA_DECL( F32, DialInPumpOcclusion, dialInPumpOcclusion, 0.0, 0.0 ); ///< measured dialysate inlet pump occlusion pressure. +DATA_DECL( F32, DialOutPumpOcclusion, 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 bloodPumpSelfTestTimerCount = 0; ///< timer counter for pressure self test +static PRESSURE_SELF_TEST_STATE_T presOcclSelfTestState = PRESSURE_SELF_TEST_STATE_START; ///< current pressure self test state. +static U32 bloodPumpSelfTestTimerCount = 0; ///< timer counter for pressure self test. -static F32 arterialPressureLowLimitmmHG = 0.0; ///< lower alarm limit for arterial pressure -static F32 arterialPressureHighLimitmmHG = 0.0; ///< upper alarm limit for arterial pressure -static F32 venousPressureLowLimitmmHG = 0.0; ///< lower alarm limit for venous pressure -static F32 venousPressureHighLimitmmHG = 0.0; ///< upper alarm limit for venous pressure +static F32 arterialPressureLowLimitmmHG = 0.0; ///< lower alarm limit for arterial pressure. +static F32 arterialPressureHighLimitmmHG = 0.0; ///< upper alarm limit for arterial pressure. +static F32 venousPressureLowLimitmmHG = 0.0; ///< lower alarm limit for venous pressure. +static F32 venousPressureHighLimitmmHG = 0.0; ///< upper alarm limit for venous pressure. // 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 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. // ********** private function prototypes ********** @@ -84,7 +84,7 @@ /**@}*/ /*********************************************************************//** - * @brief initPresOccl + * @brief * The initPresOccl function initializes the initPresOccl module. * @details * Inputs : none @@ -98,7 +98,7 @@ } /*********************************************************************//** - * @brief setPressureLimits + * @brief * The setPressureLimits function sets the lower and upper alarm limits \n * for a given pressure sensor. * @details @@ -130,7 +130,7 @@ } /*********************************************************************//** - * @brief setOcclusionThreshold + * @brief * The setOcclusionThreshold function sets the occlusion pressure threshold \n * for a given occlusion sensor. * @details @@ -163,7 +163,7 @@ } /*********************************************************************//** - * @brief execPresOccl + * @brief * The execPresOccl function executes the pressure and occlusion monitor. * @details * Inputs : presOcclState @@ -194,7 +194,7 @@ } /*********************************************************************//** - * @brief handlePresOcclInitState + * @brief * The handlePresOcclInitState function handles the pres/occl initialize state \n * of the pressure/occlusion monitor state machine. * @details @@ -211,7 +211,7 @@ } /*********************************************************************//** - * @brief handlePresOcclContReadState + * @brief * The handlePresOcclContReadState function handles the continuous read state \n * of the pressure/occlusion monitor state machine. * @details @@ -248,7 +248,7 @@ } /*********************************************************************//** - * @brief checkPressureLimits + * @brief * The checkPressureLimits function gets the pressure/occlusion data \n * publication interval. * @details @@ -281,7 +281,7 @@ } /*********************************************************************//** - * @brief getPublishPresOcclDataInterval + * @brief * The getPublishPresOcclDataInterval function gets the pressure/occlusion data \n * publication interval. * @details @@ -293,7 +293,7 @@ DATA_GET( U32, getPublishPresOcclDataInterval, presOcclDataPublishInterval ) /*********************************************************************//** - * @brief getMeasuredArterialPressure + * @brief * The getMeasuredArterialPressure function gets the current arterial pressure. * @details * Inputs : arterialPressure @@ -304,7 +304,7 @@ DATA_GET( F32, getMeasuredArterialPressure, arterialPressure ) /*********************************************************************//** - * @brief getMeasuredVenousPressure + * @brief * The getMeasuredVenousPressure function gets the measured venous pressure. * @details * Inputs : venousPressure @@ -315,7 +315,7 @@ DATA_GET( F32, getMeasuredVenousPressure, venousPressure ) /*********************************************************************//** - * @brief getMeasuredBloodPumpOcclusion + * @brief * The getMeasuredBloodPumpOcclusion function gets the measured blood pump \n * occlusion pressure. * @details @@ -327,7 +327,7 @@ DATA_GET( F32, getMeasuredBloodPumpOcclusion, bloodPumpOcclusion ) /*********************************************************************//** - * @brief getMeasuredDialInPumpOcclusion + * @brief * The getMeasuredDialInPumpOcclusion function gets the measured dialysate \n * inlet pump occlusion pressure. * @details @@ -339,7 +339,7 @@ DATA_GET( F32, getMeasuredDialInPumpOcclusion, dialInPumpOcclusion ) /*********************************************************************//** - * @brief getMeasuredDialOutPumpOcclusion + * @brief * The getMeasuredDialOutPumpOcclusion function gets the measured dialysate \n * outlet pump occlusion pressure. * @details @@ -351,7 +351,7 @@ DATA_GET( F32, getMeasuredDialOutPumpOcclusion, dialOutPumpOcclusion ) /*********************************************************************//** - * @brief publishPresOcclData + * @brief * The publishPresOcclData function publishes pressure/occlusion data at the \n * set interval. * @details @@ -377,7 +377,7 @@ } /*********************************************************************//** - * @brief execPresOcclTest + * @brief * The execPresOcclTest function executes the state machine for the \n * PresOccl self test. * @details @@ -395,14 +395,16 @@ return result; } +/**@}*/ + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ /*********************************************************************//** - * @brief testSetPresOcclDataPublishIntervalOverride + * @brief * The testSetPresOcclDataPublishIntervalOverride function overrides the \n * pressure and occlusion data publish interval. * @details @@ -428,7 +430,7 @@ } /*********************************************************************//** - * @brief testResetPresOcclDataPublishIntervalOverride + * @brief * The testResetPresOcclDataPublishIntervalOverride function resets the override \n * of the pressure and occlusion data publish interval. * @details @@ -451,7 +453,7 @@ } /*********************************************************************//** - * @brief testSetArterialPressureOverride and testResetArterialPressureOverride + * @brief * The testSetArterialPressureOverride function overrides the measured arterial \n * pressure. * The testResetArterialPressureOverride function resets the override of the \n @@ -465,7 +467,7 @@ DATA_OVERRIDE_FUNC( F32, testSetArterialPressureOverride, testResetArterialPressureOverride, arterialPressure ) /*********************************************************************//** - * @brief testSetVenousPressureOverride and testResetVenousPressureOverride + * @brief * The testSetVenousPressureOverride function overrides the measured venous \n * pressure. * The testResetVenousPressureOverride function resets the override of the \n @@ -479,7 +481,7 @@ DATA_OVERRIDE_FUNC( F32, testSetVenousPressureOverride, testResetVenousPressureOverride, venousPressure ) /*********************************************************************//** - * @brief testSetBloodPumpOcclusionOverride and testResetBloodPumpOcclusionOverride + * @brief * The testSetBloodPumpOcclusionOverride function overrides the measured \n * blood pump occlusion pressure. \n * The testResetBloodPumpOcclusionOverride function resets the override of the \n @@ -493,7 +495,7 @@ DATA_OVERRIDE_FUNC( F32, testSetBloodPumpOcclusionOverride, testResetBloodPumpOcclusionOverride, bloodPumpOcclusion ) /*********************************************************************//** - * @brief testSetDialInPumpOcclusionOverride and testResetDialInPumpOcclusionOverride + * @brief * The testSetDialInPumpOcclusionOverride function overrides the measured \n * dialysate inlet pump occlusion pressure. \n * The testResetDialInPumpOcclusionOverride function resets the override of the \n @@ -507,7 +509,7 @@ DATA_OVERRIDE_FUNC( F32, testSetDialInPumpOcclusionOverride, testResetDialInPumpOcclusionOverride, dialInPumpOcclusion ) /*********************************************************************//** - * @brief testSetDialOutPumpOcclusionOverride and testResetDialOutPumpOcclusionOverride + * @brief * The testSetDialOutPumpOcclusionOverride function overrides the measured \n * dialysate outlet pump occlusion pressure. \n * The testResetDialOutPumpOcclusionOverride function resets the override of the \n