Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -r206e45dff167966b800a628d1708f74e597f1772 -r45627442c3b93ec57ed18cd0943eed2662fb2dbc --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 206e45dff167966b800a628d1708f74e597f1772) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 45627442c3b93ec57ed18cd0943eed2662fb2dbc) @@ -254,6 +254,7 @@ initPersistentAlarm( ALARM_ID_BLOOD_PUMP_MOTOR_SPEED_CHECK, 0, BP_MOTOR_SPEED_ERROR_PERSIST ); initPersistentAlarm( ALARM_ID_BLOOD_PUMP_ROTOR_SPEED_CHECK, 0, BP_ROTOR_SPEED_ERROR_PERSIST ); initPersistentAlarm( ALARM_ID_BLOOD_PUMP_MC_DIRECTION_CHECK, 0, BP_DIRECTION_ERROR_PERSIST ); + initPersistentAlarm( ALARM_ID_HD_PUMP_DIRECTION_STATUS_ERROR, 0, BP_DIRECTION_ERROR_PERSIST ); initPersistentAlarm( ALARM_ID_BLOOD_PUMP_ROTOR_SPEED_TOO_HIGH, 0, BP_MAX_ROTOR_SPEED_ERROR_PERSIST ); initPersistentAlarm( ALARM_ID_BLOOD_PUMP_MC_CURRENT_CHECK, 0, BP_MAX_CURR_ERROR_DURATION_MS ); initPersistentAlarm( ALARM_ID_HD_BLOOD_FLOW_OUT_OF_RANGE, 0, BP_MAX_FLOW_RATE_OUT_OF_RANGE_PERSIST ); @@ -1085,20 +1086,20 @@ { MOTOR_DIR_T bpMCDir, bpDir; BOOL isDirIncorrect; - U08 dirErrorCnt = getFPGABloodPumpHallSensorStatus() & PUMP_DIR_ERROR_COUNT_MASK; + BOOL isHallSensorFailed = ( lastBloodPumpDirectionCount != dirErrorCnt ? TRUE : FALSE ); // Check pump direction error count - if ( lastBloodPumpDirectionCount != dirErrorCnt ) + if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_PUMP_DIRECTION_STATUS_ERROR, isHallSensorFailed ) ) { #ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_PUMP_DIRECTION_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) #endif { - lastBloodPumpDirectionCount = dirErrorCnt; SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_PUMP_DIRECTION_STATUS_ERROR, (U32)HD_PUMP_BLOOD_PUMP ) } } + lastBloodPumpDirectionCount = dirErrorCnt; bpMCDir = ( getMeasuredBloodPumpMCSpeed() >= 0.0 ? MOTOR_DIR_FORWARD : MOTOR_DIR_REVERSE ); bpDir = ( getMeasuredBloodPumpSpeed() >= 0.0 ? MOTOR_DIR_FORWARD : MOTOR_DIR_REVERSE );