Index: Accel.c =================================================================== diff -u -rcd1dbf44ebce97f61ad4a757d47449562ec366f0 -r85db35aef9a57d1efc02bb3b42fc802b65aa3646 --- Accel.c (.../Accel.c) (revision cd1dbf44ebce97f61ad4a757d47449562ec366f0) +++ Accel.c (.../Accel.c) (revision 85db35aef9a57d1efc02bb3b42fc802b65aa3646) @@ -39,7 +39,7 @@ #define MAX_TILT_ANGLE ( 7.0 ) ///< Maximum tilt of system before alarm #define MIN_TILT_ANGLE_TO_CLEAR_ALARM ( 5.0 ) ///< Minimum tilt of system before alarm is cleared #define MAX_TILT_PERSISTENCE ( 1 * MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Maximum time (in task intervals) that a tilt in excess of limit can persist before alarm -#define MAX_SHOCK_ACCELERATION ( 2.0 ) ///< Maximum shock (acceleration) measured on any axis before alarm +#define MAX_SHOCK_ACCELERATION ( 4.0 ) ///< Maximum shock (acceleration) measured on any axis before alarm #define MAX_TILT_G ( 1.0 ) ///< Maximum tilt (in g) #define MAX_TILT_ANGLE_DEG ( 90.0 ) ///< Maximum tilt angle (in degrees) @@ -208,9 +208,9 @@ accelAxes[ ACCEL_AXIS_X ].data = (F32)x * G_PER_LSB + accelCalOffsets[ ACCEL_AXIS_X ]; accelAxes[ ACCEL_AXIS_Y ].data = (F32)y * G_PER_LSB + accelCalOffsets[ ACCEL_AXIS_Y ]; accelAxes[ ACCEL_AXIS_Z ].data = (F32)z * G_PER_LSB + accelCalOffsets[ ACCEL_AXIS_Z ]; - xMax = (F32)xm * G_PER_LSB; - yMax = (F32)ym * G_PER_LSB; - zMax = (F32)zm * G_PER_LSB; + xMax = fabs( (F32)xm * G_PER_LSB ); + yMax = fabs( (F32)ym * G_PER_LSB ); + zMax = fabs( (F32)zm * G_PER_LSB ); if ( xMax > accelMaxs[ ACCEL_AXIS_X ].data ) { accelMaxs[ ACCEL_AXIS_X ].data = xMax; @@ -529,9 +529,9 @@ if ( maxAll > MAX_SHOCK_ACCELERATION ) { #ifdef _DG_ - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DG_SHOCK, (F32)maxAxis, maxAll ) + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DG_SHOCK, (F32)maxAxis, getMaxAccelAxis( maxAxis ) ) #else - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_SHOCK, (F32)maxAxis, maxAll ) + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_SHOCK, (F32)maxAxis, getMaxAccelAxis( maxAxis ) ) #endif } } Index: PersistentAlarm.c =================================================================== diff -u -r756c1e778f5a2b4953e70492c8dd16163328d0d8 -r85db35aef9a57d1efc02bb3b42fc802b65aa3646 --- PersistentAlarm.c (.../PersistentAlarm.c) (revision 756c1e778f5a2b4953e70492c8dd16163328d0d8) +++ PersistentAlarm.c (.../PersistentAlarm.c) (revision 85db35aef9a57d1efc02bb3b42fc802b65aa3646) @@ -7,8 +7,8 @@ * * @file PersistentAlarm.c * -* @author (last) Quang Nguyen -* @date (last) 17-Aug-2020 +* @author (last) Sean Nash +* @date (last) 01-Oct-2020 * * @author (original) Quang Nguyen * @date (original) 17-Aug-2020 @@ -48,9 +48,8 @@ * @brief * The initPersistentAlarm function initializes the PersistentAlarm module * when the alarm count lower than maximum persistent alarm allowed. - * @details - * Inputs : none - * Outputs : PersistentAlarm module initialized + * @details Inputs: none + * @details Outputs: PersistentAlarm module initialized * @param alarmIndex Persistent alarm index * @param alarm Alarm id * @param isClearable Flag to indicate alarm is clearable or not @@ -85,9 +84,8 @@ * The checkPersistentAlarm function check whether data is out of range or * not. Then the function set or clear alarm once the persistent counter * exceeds the limit. - * @details - * Inputs : none - * Outputs : Checks for out of range data and set/clear alarm + * @details Inputs: none + * @details Outputs: Checks for out of range data and set/clear alarm * @param alarmIndex Persistent alarm index * @param isOutOfRange Flag indicates data out of range * @param data Data to be check for out of range Index: PersistentAlarm.h =================================================================== diff -u -r16f92db060dba2b44020c683dc9e9fe50b3cd25d -r85db35aef9a57d1efc02bb3b42fc802b65aa3646 --- PersistentAlarm.h (.../PersistentAlarm.h) (revision 16f92db060dba2b44020c683dc9e9fe50b3cd25d) +++ PersistentAlarm.h (.../PersistentAlarm.h) (revision 85db35aef9a57d1efc02bb3b42fc802b65aa3646) @@ -34,6 +34,8 @@ typedef enum PersistentAlarm { #ifdef _HD_ + PERSISTENT_ALARM_BLOOD_FLOW_SIGNAL_STRENGTH, ///< Blood flow signal strength too low + PERSISTENT_ALARM_DIALYSATE_FLOW_SIGNAL_STRENGTH, ///< Dialysate flow signal strength too low #endif #ifdef _DG_ PERSISTENT_ALARM_INLET_WATER_HIGH_TEMPERATURE, ///< Inlet water high temperature persistent alarm @@ -50,7 +52,7 @@ // ********** public function prototypes ********** void initPersistentAlarm( PERSISTENT_ALARM_T alarmIndex, ALARM_ID_T alarm, BOOL isClearable, - F32 persistentClearCount, F32 persistentTriggerCount ); + U32 persistentClearCount, U32 persistentTriggerCount ); void checkPersistentAlarm( PERSISTENT_ALARM_T const alarmIndex, BOOL const isOutOfRange, F32 const data ); /**@}*/ Index: Utilities.c =================================================================== diff -u -r9361f8520b9f9510dc5376d4ff5b16cbc5ac6693 -r85db35aef9a57d1efc02bb3b42fc802b65aa3646 --- Utilities.c (.../Utilities.c) (revision 9361f8520b9f9510dc5376d4ff5b16cbc5ac6693) +++ Utilities.c (.../Utilities.c) (revision 85db35aef9a57d1efc02bb3b42fc802b65aa3646) @@ -8,7 +8,7 @@ * @file Utilities.c * * @author (last) Sean Nash -* @date (last) 04-Sep-2020 +* @date (last) 24-Sep-2020 * * @author (original) Sean * @date (original) 17-Feb-2020 @@ -100,9 +100,8 @@ * @brief * The crc16 function calculates a 16-bit CRC for a given range of bytes * in memory. Poly = 0x1021. Not reflected. Initial value = 0xFFFF. - * @details - * Inputs: crc16_table[] - * Outputs: none + * @details Inputs: crc16_table[] + * @details Outputs: none * @param address pointer to start address of memory range to calculate CRC for * @param len number of bytes in the memory range to calculate CRC for * @return CRC as a U16 @@ -124,9 +123,8 @@ * @brief * The crc8 function calculates a 8-bit CRC for a given range of bytes * in memory. - * @details - * Inputs: crc8_table[] - * Outputs: none + * @details Inputs: crc8_table[] + * @details Outputs: none * @param address pointer to start address of memory range to calculate CRC for * @param len number of bytes in the memory range to calculate CRC for * @return CRC as a U08 @@ -177,9 +175,8 @@ /*********************************************************************//** * @brief * The initTimeWindowedCount function initializes a given time windowed count. - * @details - * Inputs: timeWindowedCountsMaxCount, timeWindowedCountsInitialized - * Outputs: timeWindowedCountsMaxCount, timeWindowedCountsInitialized, alarm if + * @details Inputs: timeWindowedCountsMaxCount, timeWindowedCountsInitialized + * @details Outputs: timeWindowedCountsMaxCount, timeWindowedCountsInitialized, alarm if * software fault occurred * @param cnt ID of the time windowed count to initialize * @param maxCnt maximum number of instances in the time window for this count @@ -232,9 +229,8 @@ * function for a given time windowed count. * *Note - thread protection not provided - assumed function will be called * by one task for a given time windowed count. - * @details - * Inputs: timeWindowedCounts, timeWindowedCountIndexes, timeWindowedCountCounts - * Outputs: timeWindowedCounts, timeWindowedCountIndexes, timeWindowedCountCounts, + * @details Inputs: timeWindowedCounts, timeWindowedCountIndexes, timeWindowedCountCounts + * @details Outputs: timeWindowedCounts, timeWindowedCountIndexes, timeWindowedCountCounts, * alarm if a software fault occurred * @param cnt ID of the time windowed count to add an instance to * @return TRUE if this instances brings the count to the maximum within @@ -277,9 +273,8 @@ * The getCriticalData function gets the value for a given critical data * record. The integrity of the critical data is checked first. If the * critical data record fails the integrity check, a fault is triggered. - * @details - * Inputs: none - * Outputs: alarm if HD critical error occurred + * @details Inputs: none + * @details Outputs: alarm if HD critical error occurred * @param data Ptr to a critical data record * @return The data from a critical data record *************************************************************************/ @@ -314,9 +309,8 @@ * @brief * The isCriticalDataInRange function determines whether a critical data * value is within the range set for that critical data. - * @details - * Inputs: none - * Outputs: none + * @details Inputs: none + * @details Outputs: none * @param data Ptr to a critical data record * @return TRUE if given data is in range, FALSE if not *************************************************************************/ @@ -353,9 +347,8 @@ * @brief * The setCriticalData function sets the value for a given critical data * record. - * @details - * Inputs: none - * Outputs: alarm if HD critical error occurred + * @details Inputs: none + * @details Outputs: alarm if HD critical error occurred * @param data Ptr to a critical data record * @param value a value to set * @return TRUE if set was successful, FALSE if not (out of range) @@ -395,9 +388,8 @@ /*********************************************************************//** * @brief * The resetCriticalData function resets a critical data record. - * @details - * Inputs: none - * Outputs: Given critical data record is reset to unset w/ default value. + * @details Inputs: none + * @details Outputs: Given critical data record is reset to unset w/ default value. * @param data Ptr to a critical data record * @return none *************************************************************************/