Fisheye: Tag 60a95cb6e1325abd179b4a01d83b8aabe20ccda5 refers to a dead (removed) revision in file `firmware/App/Common.h'. Fisheye: No comparison available. Pass `N' to diff? 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 Index: firmware/App/Controllers/PresOccl.h =================================================================== diff -u -ra4236a98b2de7d007173862dfe6b114bce08f90f -r60a95cb6e1325abd179b4a01d83b8aabe20ccda5 --- firmware/App/Controllers/PresOccl.h (.../PresOccl.h) (revision a4236a98b2de7d007173862dfe6b114bce08f90f) +++ firmware/App/Controllers/PresOccl.h (.../PresOccl.h) (revision 60a95cb6e1325abd179b4a01d83b8aabe20ccda5) @@ -30,20 +30,20 @@ // ********** public definitions ********** -/// Pressure sensors monitored by this module +/// Pressure sensors monitored by this module. typedef enum PressureSensors { - PRESSURE_SENSOR_ARTERIAL = 0, ///< arterial blood line pressure sensor - PRESSURE_SENSOR_VENOUS, ///< vensous blood line pressure sensor + PRESSURE_SENSOR_ARTERIAL = 0, ///< arterial blood line pressure sensor. + PRESSURE_SENSOR_VENOUS, ///< vensous blood line pressure sensor. NUM_OF_PRESSURE_SENSORS } PRESSURE_SENSORS_T; -/// Occlusion sensors monitored by this module +/// Occlusion sensors monitored by this module. typedef enum OcclusionSensors { - OCCLUSION_SENSOR_BLOOD_PUMP = 0, ///< blood pump occlusion sensor - OCCLUSION_SENSOR_DIAL_IN_PUMP, ///< dialysate inlet pump occlusion sensor - OCCLUSION_SENSOR_DIAL_OUT_PUMP, ///< dialysate outlet pump occlusion sensor + OCCLUSION_SENSOR_BLOOD_PUMP = 0, ///< blood pump occlusion sensor. + OCCLUSION_SENSOR_DIAL_IN_PUMP, ///< dialysate inlet pump occlusion sensor. + OCCLUSION_SENSOR_DIAL_OUT_PUMP, ///< dialysate outlet pump occlusion sensor. NUM_OF_OCCLUSION_SENSORS } OCCLUSION_SENSORS_T; Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -r07a5add2dff254f7be3699e4efac2b99d3554847 -r60a95cb6e1325abd179b4a01d83b8aabe20ccda5 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 07a5add2dff254f7be3699e4efac2b99d3554847) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 60a95cb6e1325abd179b4a01d83b8aabe20ccda5) @@ -1,4 +1,4 @@ -/************************************************************************** +/**********************************************************************//** * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * @@ -16,41 +16,47 @@ * **************************************************************************/ -#include "Common.h" #include "AlarmLamp.h" #include "OperationModes.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Timers.h" +/** + * @addtogroup AlarmManagement + * @{ + */ + // ********** private definitions ********** -#define ALARM_STATUS_PUBLISH_INTERVAL (500/TASK_GENERAL_INTERVAL) // 500ms / task interval +#define ALARM_STATUS_PUBLISH_INTERVAL (500/TASK_GENERAL_INTERVAL) ///< Default interval to publish alarm status data. -#define ALARM_SILENCE_EXPIRES_IN_SECS (60) +#define ALARM_SILENCE_EXPIRES_IN_SECS (60) ///< Alarm silence expiration time in seconds. -#define ALM_ESC_1_MIN (1 * SEC_PER_MIN * MS_PER_SECOND) -#define ALM_ESC_4_MIN (4 * SEC_PER_MIN * MS_PER_SECOND) -#define ALM_ESC_5_MIN (5 * SEC_PER_MIN * MS_PER_SECOND) -#define ALM_ESC_10_MIN (10 * SEC_PER_MIN * MS_PER_SECOND) +#define ALM_ESC_1_MIN (1 * SEC_PER_MIN * MS_PER_SECOND) ///< # of ms in 1 minute. +#define ALM_ESC_4_MIN (4 * SEC_PER_MIN * MS_PER_SECOND) ///< # of ms in 4 minutes. +#define ALM_ESC_5_MIN (5 * SEC_PER_MIN * MS_PER_SECOND) ///< # of ms in 5 minutes. +#define ALM_ESC_10_MIN (10 * SEC_PER_MIN * MS_PER_SECOND) ///< # of ms in 10 minutes. #pragma pack(push,1) +/// Record defining the properties of each individual alarm. typedef struct { - ALARM_PRIORITY_T alarmPriority; // priority of alarm - U32 alarmEscalatesAfter; // time (s) after start when alarm will escalate if not cleared (zero indicates no escalation) - ALARM_ID_T alarmEscalatesTo; // ID of alarm that this alarm will escalate to (ALARM_ID_NO_ALARM indicates no esclation) - BOOL alarmIsFault; // alarm is a system fault? - BOOL alarmStops; // alarm activation should cause a controlled stop - BOOL alarmNoClear; // alarm cannot be cleared (unrecoverable)? - BOOL alarmNoResume; // alarm prevents treatment resume - BOOL alarmNoRinseback; // alarm prevents rinseback - BOOL alarmNoEndTreatment; // alarm prevents ending treatment - BOOL alarmNoNewTreatment; // alarm prevents any new treatments - BOOL alarmDialyzerBypass; // alarm activation should cause dialyzer bypass until cleared + ALARM_PRIORITY_T alarmPriority; ///< priority of alarm + U32 alarmEscalatesAfter; ///< time (s) after start when alarm will escalate if not cleared (zero indicates no escalation) + ALARM_ID_T alarmEscalatesTo; ///< ID of alarm that this alarm will escalate to (ALARM_ID_NO_ALARM indicates no esclation) + BOOL alarmIsFault; ///< alarm is a system fault? + BOOL alarmStops; ///< alarm activation should cause a controlled stop + BOOL alarmNoClear; ///< alarm cannot be cleared (unrecoverable)? + BOOL alarmNoResume; ///< alarm prevents treatment resume + BOOL alarmNoRinseback; ///< alarm prevents rinseback + BOOL alarmNoEndTreatment; ///< alarm prevents ending treatment + BOOL alarmNoNewTreatment; ///< alarm prevents any new treatments + BOOL alarmDialyzerBypass; ///< alarm activation should cause dialyzer bypass until cleared } ALARM_T; #pragma pack(pop) +/// Table of alarms and their static properties. const ALARM_T alarmTable[ NUM_OF_ALARM_IDS ] = { // Priority Escalate In Escalate To Fault Stops NoClr NoRes NoRin NoEnd NoNew Bypass { ALARM_PRIORITY_NONE, 0, ALARM_ID_NO_ALARM, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_NO_ALARM @@ -91,20 +97,21 @@ { ALARM_PRIORITY_HIGH, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_VENOUS_PRESSURE_HIGH }; +/// A blank alarm data record for alarms that do not include alarm data when triggered. const ALARM_DATA_T blankAlarmData = { ALARM_DATA_TYPE_NONE, 0 }; // ********** private data ********** -// interval (in ms) at which to publish alarm status to CAN bus +/// interval (in ms) at which to publish alarm status to CAN bus DATA_DECL( U32, AlarmStatusPub, alarmStatusPublishInterval, ALARM_STATUS_PUBLISH_INTERVAL, ALARM_STATUS_PUBLISH_INTERVAL ); -static U32 alarmStatusPublicationTimerCounter = 0; // used to schedule alarm status publication to CAN bus +static U32 alarmStatusPublicationTimerCounter = 0; ///< Used to schedule alarm status publication to CAN bus. -// table - current state of each alarm +/// table - current state of each alarm DATA_ARRAY_DECL( BOOL, AlarmStates, NUM_OF_ALARM_IDS, alarmIsActive ); -// table - when alarm became active for each alarm (if active) or zero (if inactive) +/// table - when alarm became active for each alarm (if active) or zero (if inactive) DATA_ARRAY_DECL( U32, AlarmStarts, NUM_OF_ALARM_IDS, alarmStartedAt ); -static COMP_ALARM_STATUS_T alarmStatus; +static COMP_ALARM_STATUS_T alarmStatus; ///< Record for the current composite alarm status. static ALARM_ID_T alarmPriorityFIFO[ NUM_OF_ALARM_PRIORITIES ]; @@ -693,7 +700,9 @@ *************************************************************************/ DATA_GET( U32, getPublishAlarmStatusInterval, alarmStatusPublishInterval ) +/**@}*/ + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ Index: firmware/App/Services/AlarmMgmt.h =================================================================== diff -u -rd830f37cf6a42a16399c87985bd51dfd9312ced3 -r60a95cb6e1325abd179b4a01d83b8aabe20ccda5 --- firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision d830f37cf6a42a16399c87985bd51dfd9312ced3) +++ firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision 60a95cb6e1325abd179b4a01d83b8aabe20ccda5) @@ -1,4 +1,4 @@ -/************************************************************************** +/**********************************************************************//** * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * @@ -17,123 +17,96 @@ #ifndef __ALARM_MGMT_H__ #define __ALARM_MGMT_H__ -// ********** public definitions ********** +#include "Common.h" -typedef enum Alarm_List -{ - ALARM_ID_NO_ALARM = 0, - ALARM_ID_SOFTWARE_FAULT, - ALARM_ID_STUCK_BUTTON_TEST_FAILED, - ALARM_ID_FPGA_POST_TEST_FAILED, - ALARM_ID_WATCHDOG_POST_TEST_FAILED, - ALARM_ID_UI_COMM_POST_FAILED, // 5 - ALARM_ID_BLOOD_PUMP_MC_CURRENT_CHECK, - ALARM_ID_BLOOD_PUMP_MC_SPEED_CHECK, - ALARM_ID_BLOOD_PUMP_MC_DIRECTION_CHECK, - ALARM_ID_BLOOD_PUMP_ROTOR_SPEED_CHECK, - ALARM_ID_DIAL_IN_PUMP_MC_CURRENT_CHECK, // 10 - ALARM_ID_DIAL_IN_PUMP_MC_SPEED_CHECK, - ALARM_ID_DIAL_IN_PUMP_MC_DIRECTION_CHECK, - ALARM_ID_DIAL_IN_PUMP_ROTOR_SPEED_CHECK, - ALARM_ID_DIAL_OUT_PUMP_MC_CURRENT_CHECK, - ALARM_ID_DIAL_OUT_PUMP_MC_SPEED_CHECK, // 15 - ALARM_ID_DIAL_OUT_PUMP_MC_DIRECTION_CHECK, - ALARM_ID_DIAL_OUT_PUMP_ROTOR_SPEED_CHECK, - ALARM_ID_WATCHDOG_EXPIRED, - ALARM_ID_RTC_COMM_ERROR, - ALARM_ID_RTC_CONFIG_ERROR, // 20 - ALARM_ID_DG_COMM_TIMEOUT, - ALARM_ID_UI_COMM_TIMEOUT, - ALARM_ID_COMM_TOO_MANY_BAD_CRCS, - ALARM_ID_TREATMENT_STOPPED_BY_USER, - ALARM_ID_BLOOD_SITTING_WARNING, // 25 - ALARM_ID_BLOOD_SITTING_TOO_LONG_NO_RESUME, - ALARM_ID_BLOOD_SITTING_TOO_LONG_NO_RINSEBACK, - ALARM_ID_CAN_MESSAGE_NOT_ACKED, - ALARM_ID_OCCLUSION_BLOOD_PUMP, - ALARM_ID_OCCLUSION_DIAL_IN_PUMP, // 30 - ALARM_ID_OCCLUSION_DIAL_OUT_PUMP, - ALARM_ID_ARTERIAL_PRESSURE_LOW, - ALARM_ID_ARTERIAL_PRESSURE_HIGH, - ALARM_ID_VENOUS_PRESSURE_LOW, - ALARM_ID_VENOUS_PRESSURE_HIGH, // 35 - NUM_OF_ALARM_IDS -} ALARM_ID_T; +/** + * @defgroup AlarmManagement AlarmManagement + * @brief Alarm Management service module. Provides general alarm management \n + * functionality including support functions for triggering and clearing \n + * specific alarms. + * + * @addtogroup AlarmManagement + * @{ + */ -typedef enum Alarm_Priorities -{ - ALARM_PRIORITY_NONE = 0, - ALARM_PRIORITY_LOW, - ALARM_PRIORITY_MEDIUM, - ALARM_PRIORITY_HIGH, - NUM_OF_ALARM_PRIORITIES -} ALARM_PRIORITY_T; +// ********** public definitions ********** +#include "AlarmDefs.h" + +/// Alarm data types list. typedef enum Alarm_Data_Types { - ALARM_DATA_TYPE_NONE = 0, - ALARM_DATA_TYPE_U32, - ALARM_DATA_TYPE_S32, - ALARM_DATA_TYPE_F32, - ALARM_DATA_TYPE_BOOL, - NUM_OF_ALARM_DATA_TYPES + ALARM_DATA_TYPE_NONE = 0, ///< No data given. + ALARM_DATA_TYPE_U32 = 1, ///< Alarm data is unsigned 32-bit integer type. + ALARM_DATA_TYPE_S32 = 2, ///< Alarm data is signed 32-bit integer type. + ALARM_DATA_TYPE_F32 = 3, ///< Alarm data is 32-bit floating point type. + ALARM_DATA_TYPE_BOOL = 4, ///< Alarm data is 32-bit boolean type. + NUM_OF_ALARM_DATA_TYPES ///< Total # of alarm data types. } ALARM_DATA_TYPES_T; #pragma pack(push,4) +/// Record structure for detailing the properties of the current composite alarm status. typedef struct { - ALARM_PRIORITY_T alarmsState; // current alarm priority level - BOOL alarmsSilenced; // alarms are currently silenced? - U32 alarmsSilenceStart; // time stamp for when alarms were silenced (ms) - U32 alarmsSilenceExpiresIn; // time until alarm silence expires (seconds) - BOOL alarmsToEscalate; // are any active alarms due to escalate (should UI show count down timer?) - U32 alarmsEscalatesIn; // time until alarm will escalate (seconds) - ALARM_ID_T alarmTop; // ID of current top alarm that will drive lamp/audio and UI should be displaying right now - BOOL systemFault; // a system fault is active? - BOOL stop; // we should be in controlled stop right now - BOOL noClear; // no recovery will be possible - BOOL noResume; // treatment may not be resumed at this time - BOOL noRinseback; // rinseback may not be initiated at this time - BOOL noEndTreatment; // ending the treatment is not an option at this time - BOOL noNewTreatment; // no new treatments may be started even if current treatment is ended - BOOL bypassDialyzer; // the dialyzer should be bypassed at this time + ALARM_PRIORITY_T alarmsState; ///< current alarm priority level + BOOL alarmsSilenced; ///< alarms are currently silenced? + U32 alarmsSilenceStart; ///< time stamp for when alarms were silenced (ms) + U32 alarmsSilenceExpiresIn; ///< time until alarm silence expires (seconds) + BOOL alarmsToEscalate; ///< are any active alarms due to escalate (should UI show count down timer?) + U32 alarmsEscalatesIn; ///< time until alarm will escalate (seconds) + ALARM_ID_T alarmTop; ///< ID of current top alarm that will drive lamp/audio and UI should be displaying right now + BOOL systemFault; ///< a system fault is active? + BOOL stop; ///< we should be in controlled stop right now + BOOL noClear; ///< no recovery will be possible + BOOL noResume; ///< treatment may not be resumed at this time + BOOL noRinseback; ///< rinseback may not be initiated at this time + BOOL noEndTreatment; ///< ending the treatment is not an option at this time + BOOL noNewTreatment; ///< no new treatments may be started even if current treatment is ended + BOOL bypassDialyzer; ///< the dialyzer should be bypassed at this time } COMP_ALARM_STATUS_T; +/// Record structure for unsigned integer alarm data. typedef struct { - U32 data; + U32 data; ///< Alarm data of unsigned integer type. } ALARM_DATA_U32_T; +/// Record structure for signed integer alarm data. typedef struct { - S32 data; + S32 data; ///< Alarm data of signed integer type. } ALARM_DATA_S32_T; +/// Record structure for floating point alarm data. typedef struct { - F32 data; + F32 data; ///< Alarm data of floating point type. } ALARM_DATA_F32_T; +/// Record structure for boolean alarm data. typedef struct { - BOOL data; + BOOL data; ///< Alarm data of boolean type. } ALARM_DATA_BOOL_T; +/// Record structure for alarm data of any supported type. typedef union { - ALARM_DATA_U32_T uInt; - ALARM_DATA_S32_T sInt; - ALARM_DATA_F32_T flt; - ALARM_DATA_BOOL_T bln; + ALARM_DATA_U32_T uInt; ///< Alarm data of unsigned integer type. + ALARM_DATA_S32_T sInt; ///< Alarm data of signed integer type. + ALARM_DATA_F32_T flt; ///< Alarm data of floating point type. + ALARM_DATA_BOOL_T bln; ///< Alarm data of boolean type. } ALARM_DATAS_T; +/// Record structure for alarm data including the data type to aid in interpretation. typedef struct { - ALARM_DATA_TYPES_T dataType; - ALARM_DATAS_T data; + ALARM_DATA_TYPES_T dataType; ///< The type of alarm data provided. + ALARM_DATAS_T data; ///< The alarm data of specified type. } ALARM_DATA_T; #pragma pack(pop) +// Listing of specific software faults for logging purposes. typedef enum { SW_FAULT_ID_NONE = 0, @@ -203,6 +176,8 @@ void clearAlarm( ALARM_ID_T alarm ); BOOL isAlarmActive( ALARM_ID_T alarm ); +/**@}*/ + BOOL testSetAlarmStatusPublishIntervalOverride( U32 value ); BOOL testResetAlarmStatusPublishIntervalOverride( void ); BOOL testSetAlarmStateOverride( U32 alarmID, BOOL value ); Index: firmware/App/Services/PIControllers.c =================================================================== diff -u -ra4236a98b2de7d007173862dfe6b114bce08f90f -r60a95cb6e1325abd179b4a01d83b8aabe20ccda5 --- firmware/App/Services/PIControllers.c (.../PIControllers.c) (revision a4236a98b2de7d007173862dfe6b114bce08f90f) +++ firmware/App/Services/PIControllers.c (.../PIControllers.c) (revision 60a95cb6e1325abd179b4a01d83b8aabe20ccda5) @@ -28,26 +28,26 @@ // ********** private definitions ********** -/// minimum integral coefficient - cannot be zero +/// minimum integral coefficient - cannot be zero. #define MIN_KI NEARLY_ZERO -/// record for PI controller +/// record for PI controller. typedef struct { // -- PI's parameters -- - F32 Kp; ///< Proportional Value - F32 Ki; ///< Integral Value - F32 uMax; ///< Maximum control signal - F32 uMin; ///< Minimum control signal + F32 Kp; ///< Proportional Value. + F32 Ki; ///< Integral Value. + F32 uMax; ///< Maximum control signal. + F32 uMin; ///< Minimum control signal. // -- PI's signals -- - F32 referenceSignal; ///< reference signal - F32 measuredSignal; ///< measured signal - F32 errorSignal; ///< reference - measured signal - F32 errorSumBeforeWindUp; ///< error signal before windup correction - F32 errorSum; ///< error integral after windup correction - F32 controlSignal; ///< actual control signal + F32 referenceSignal; ///< reference signal. + F32 measuredSignal; ///< measured signal. + F32 errorSignal; ///< reference - measured signal. + F32 errorSumBeforeWindUp; ///< error signal before windup correction. + F32 errorSum; ///< error integral after windup correction. + F32 controlSignal; ///< actual control signal. } PI_CONTROLLER_T; -#define SET_CONTROLLER( c, id ) ((c) = &piControllers[id]) ///< macro to set a local controller pointer to a given piController +#define SET_CONTROLLER( c, id ) ((c) = &piControllers[id]) ///< macro to set a local controller pointer to a given piController. // ********** private data ********** @@ -62,7 +62,7 @@ /**@}*/ /*********************************************************************//** - * @brief initializePIController + * @brief * Initialize controller before operation. Make sure to call it before * first call to runController function. * @@ -100,7 +100,7 @@ } /*********************************************************************//** - * @brief resetPIController + * @brief * Reset controller before new set point. Make sure to call it before first * call to runController function. * @@ -130,7 +130,7 @@ } /*********************************************************************//** - * @brief runPIController + * @brief * Call this function whenever a new measured signal sampled is acquired. * * @param controllerID - ID filter number @@ -195,7 +195,7 @@ } /*********************************************************************//** - * @brief getPIControllerSignals + * @brief * Returns the latest requested signal sample. * * @param controllerID - ID filter number @@ -259,3 +259,5 @@ return output; } +/**@}*/ + Index: firmware/App/Services/PIControllers.h =================================================================== diff -u -ra4236a98b2de7d007173862dfe6b114bce08f90f -r60a95cb6e1325abd179b4a01d83b8aabe20ccda5 --- firmware/App/Services/PIControllers.h (.../PIControllers.h) (revision a4236a98b2de7d007173862dfe6b114bce08f90f) +++ firmware/App/Services/PIControllers.h (.../PIControllers.h) (revision 60a95cb6e1325abd179b4a01d83b8aabe20ccda5) @@ -32,24 +32,24 @@ /// Enumeration of PI controllers typedef enum ControllerList { - PI_CONTROLLER_ID_LOAD_CELL = 0, ///< Load cell controller for dialysate outlet pump - PI_CONTROLLER_ID_BLOOD_FLOW, ///< Flow controller for blood pump - PI_CONTROLLER_ID_DIALYSATE_FLOW, ///< Flow controller for dialysate inlet pump - NUM_OF_PI_CONTROLLERS_IDS + PI_CONTROLLER_ID_LOAD_CELL = 0, ///< Load cell controller for dialysate outlet pump. + PI_CONTROLLER_ID_BLOOD_FLOW, ///< Flow controller for blood pump. + PI_CONTROLLER_ID_DIALYSATE_FLOW, ///< Flow controller for dialysate inlet pump. + NUM_OF_PI_CONTROLLERS_IDS ///< # of PI controllers. } PI_CONTROLLER_ID_T; /// Enumeration of PI controller signals typedef enum ControllerSignals { - CONTROLLER_SIGNAL_REFERENCE = 0, ///< Reference value - CONTROLLER_SIGNAL_MEASURED, ///< Measured value - CONTROLLER_SIGNAL_ERROR, ///< Error value - CONTROLLER_SIGNAL_ERROR_SUM, ///< Error sum before anti-windup - CONTROLLER_SIGNAL_ERROR_SUM_AFTER_WINDUP, ///< Error sum after anti-windup - CONTROLLER_SIGNAL_PROPORTIONAL_OUTPUT, ///< P portion of controller output signal - CONTROLLER_SIGNAL_INTEGRAL_OUTPUT, ///< I portion of controller output signal - CONTROLLER_SIGNAL_CONTROL, ///< Controller output signal - NUM_OF_CONTROLLER_SIGNAL + CONTROLLER_SIGNAL_REFERENCE = 0, ///< Reference value. + CONTROLLER_SIGNAL_MEASURED, ///< Measured value. + CONTROLLER_SIGNAL_ERROR, ///< Error value. + CONTROLLER_SIGNAL_ERROR_SUM, ///< Error sum before anti-windup. + CONTROLLER_SIGNAL_ERROR_SUM_AFTER_WINDUP, ///< Error sum after anti-windup. + CONTROLLER_SIGNAL_PROPORTIONAL_OUTPUT, ///< P portion of controller output signal. + CONTROLLER_SIGNAL_INTEGRAL_OUTPUT, ///< I portion of controller output signal. + CONTROLLER_SIGNAL_CONTROL, ///< Controller output signal. + NUM_OF_CONTROLLER_SIGNAL ///< # of PI controller signals. } PI_CONTROLLER_SIGNALS_ID; // ********** public function prototypes ********** Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -rb831c4f803bd92f6a16f854e3d02222fe76a379e -r60a95cb6e1325abd179b4a01d83b8aabe20ccda5 --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision b831c4f803bd92f6a16f854e3d02222fe76a379e) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 60a95cb6e1325abd179b4a01d83b8aabe20ccda5) @@ -60,7 +60,7 @@ #endif { // monitor pressure/occlusion sensors - execPresOccl(); + //execPresOccl(); // run operation mode state machine execOperationModes(); @@ -69,10 +69,9 @@ execBloodFlowController(); // control dialysate inlet pump - execDialInFlowController(); + //execDialInFlowController(); - // Control RTC - // After CommRx and and before execOperationModes() + // manage RTC execRTC(); // manage alarm state Index: firmware/App/Tasks/TaskPriority.c =================================================================== diff -u -rd830f37cf6a42a16399c87985bd51dfd9312ced3 -r60a95cb6e1325abd179b4a01d83b8aabe20ccda5 --- firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision d830f37cf6a42a16399c87985bd51dfd9312ced3) +++ firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision 60a95cb6e1325abd179b4a01d83b8aabe20ccda5) @@ -53,7 +53,7 @@ execBloodFlowMonitor(); // monitor dialysate inlet pump and flow - execDialInFlowMonitor(); + //execDialInFlowMonitor(); // 2nd pass for FPGA execFPGAOut(); Fisheye: Tag 60a95cb6e1325abd179b4a01d83b8aabe20ccda5 refers to a dead (removed) revision in file `firmware/App/TestSupport.h'. Fisheye: No comparison available. Pass `N' to diff?