Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -rc20c77ef196a760a7642d2426e509995e4a98e01 -ra3d8f8dafc488730c316ae0a64d05cb69ec8bcc9 --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision c20c77ef196a760a7642d2426e509995e4a98e01) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision a3d8f8dafc488730c316ae0a64d05cb69ec8bcc9) @@ -75,17 +75,17 @@ #define BP_MAX_ROTOR_VS_MOTOR_DIFF_RPM 5.0F ///< Maximum difference in speed between motor and rotor (in rotor RPM). #define BP_MAX_MOTOR_SPEED_ERROR_RPM 300.0F ///< Maximum difference in speed between measured and commanded RPM. -/// Persist time (task intervals) for motor off error condition. +/// Persist time (in ms) for motor off error condition. static const U32 BP_OFF_ERROR_PERSIST = ( 5 * MS_PER_SECOND ); -/// Persist time (task intervals) motor speed error condition. +/// Persist time (in ms) motor speed error condition. static const U32 BP_MOTOR_SPEED_ERROR_PERSIST = ( 5 * MS_PER_SECOND ); -/// Persist time (task intervals) rotor speed error condition. +/// Persist time (in ms) rotor speed error condition. static const U32 BP_ROTOR_SPEED_ERROR_PERSIST = ( 22 * MS_PER_SECOND ); -/// Persist time (task intervals) pump direction error condition. +/// Persist time (in ms) pump direction error condition. static const U32 BP_DIRECTION_ERROR_PERSIST = ( 250 ); -/// Persist time period blood pump rotor speed too fast error condition. +/// Persist time period (in ms) blood pump rotor speed too fast error condition. static const U32 BP_MAX_ROTOR_SPEED_ERROR_PERSIST = ( 1 * MS_PER_SECOND ); -/// Persist time (task intervals) blood flow rate out of range error condition. +/// Persist time (in ms) blood flow rate out of range error condition. static const U32 BP_MAX_FLOW_RATE_OUT_OF_RANGE_PERSIST = (1 * MS_PER_SECOND); #define BP_MAX_CURR_WHEN_STOPPED_MA 150.0F ///< Motor controller current should not exceed this when pump should be stopped. Index: firmware/App/Drivers/Battery.c =================================================================== diff -u -r19a8bf98a7154e24c35da25225d4b55bf70ddd09 -ra3d8f8dafc488730c316ae0a64d05cb69ec8bcc9 --- firmware/App/Drivers/Battery.c (.../Battery.c) (revision 19a8bf98a7154e24c35da25225d4b55bf70ddd09) +++ firmware/App/Drivers/Battery.c (.../Battery.c) (revision a3d8f8dafc488730c316ae0a64d05cb69ec8bcc9) @@ -45,6 +45,9 @@ #define AC_POWER_LOST_PERSISTENT_COUNT 3 ///< AC power lost persistent count before alarming. #define BATTERY_COMM_FAULT_PERSISTENTCE_COUNT 5 ///< Battery communication fault persistent count before alarming. +/// Persist time (in ms) for battery pack status error condition. +static const U32 BATT_STATUS_ERROR_PERSIST_MS = ( 5 * MS_PER_SECOND ); + // ********** private data ********** static U16 batteryStatus = 0; ///< Battery current status. @@ -84,6 +87,9 @@ hasBatteryChargerStatus = FALSE; commFaultPersistentCount = 0; + // Initialize persistent alarm for battery pack status error + initPersistentAlarm( ALARM_ID_HD_BATTERY_PACK_ERROR_DETECTED, 0, BATT_STATUS_ERROR_PERSIST_MS ); + setupI2CDriver(); } @@ -144,10 +150,14 @@ if ( TRUE == getBatteryData( BATTERY_PACK_SLAVE_ADDRESS, BATTERY_PACK_STATUS_CMD, &batteryPackStatus ) ) { - if ( 0 != ( batteryPackStatus & BATTERY_PACK_ERROR_BITS ) ) + if ( ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_BATTERY_PACK_ERROR_DETECTED, ( batteryPackStatus & BATTERY_PACK_ERROR_BITS ) != 0 ) ) ) { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_BATTERY_PACK_ERROR_DETECTED, batteryPackStatus ); } + else + { + isPersistentAlarmTriggered( ALARM_ID_HD_BATTERY_PACK_ERROR_DETECTED, FALSE ); + } } } }