Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -rfacca88de0d4c72d943b59bad9264a9b0a031ae5 -r949b386b5f58ab8bc534bd7e913ecb9f2c084c17 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision facca88de0d4c72d943b59bad9264a9b0a031ae5) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 949b386b5f58ab8bc534bd7e913ecb9f2c084c17) @@ -135,9 +135,6 @@ resetBloodPumpRotorCount(); resetDialInPumpRotorCount(); - doorClosedRequired( FALSE, FALSE ); - syringeDetectionRequired( FALSE ); - // Set user alarm recovery actions allowed in this mode setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); @@ -159,8 +156,15 @@ // If we just exited Post Treatment Mode, goto disinfect sub state. if ( MODE_POST == previousOpMode ) { + doorClosedRequired( FALSE, FALSE ); // door no longer required to be closed in standby mode currentStandbyState = STANDBY_WAIT_FOR_DISINFECT_STATE; } + else + { + doorClosedRequired( TRUE, FALSE ); + } + syringeDetectionRequired( FALSE ); + // Request DG service record and usage information from DG sendDGServiceRequestToDG(); sendDGUsageInfoRequestToDG(); @@ -647,16 +651,12 @@ { syringePumpVerifyForceSensorDACCalibration(); homingInitiated = FALSE; // reset for next time + doorClosedRequired( FALSE, FALSE ); // door no longer required to be closed in standby mode state = STANDBY_WAIT_FOR_TREATMENT_STATE; // Go to wait for treatment state after above check } } } } - else - { - // Trigger door open alarm to prompt user to close the door - activateAlarmNoData( ALARM_ID_CARTRIDGE_DOOR_OPENED ); - } return state; } Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -ra57994f752662abc0aaa8c2cf5c3af47ec2c5a20 -r949b386b5f58ab8bc534bd7e913ecb9f2c084c17 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision a57994f752662abc0aaa8c2cf5c3af47ec2c5a20) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 949b386b5f58ab8bc534bd7e913ecb9f2c084c17) @@ -411,13 +411,7 @@ broadcastData( MSG_ID_ALARM_CLEARED, COMM_BUFFER_OUT_CAN_HD_ALARM, (U08*)&data, sizeof( ALARM_ID_DATA_PUBLISH_T ) ); alarmIsActive[ alarm ] = FALSE; clearAlarmCondition( alarm ); - alarmStartedAt[ alarm ].data = 0; - // Clear FIFO if this alarm was in it - if ( alarmPriorityFIFO[ ALARM_TABLE[ alarm ].alarmPriority ].alarmID == alarm ) - { - resetAlarmPriorityFIFO( ALARM_TABLE[ alarm ].alarmPriority ); - } } } } @@ -685,11 +679,13 @@ U32 index; U32 activeAlarmListIndex = 0; + // Blank alarm list initially for ( index = 0; index < MAX_ALARM_LIST_SIZE; index++ ) { activeAlarmList[ index ] = ALARM_ID_NO_ALARM; } + // Fill alarm list from (up to) 10 highest priority active alarms if ( TRUE == isAnyAlarmActive() ) { for ( index = 0; index < NUM_OF_ALARM_IDS; index++ ) @@ -799,11 +795,17 @@ *************************************************************************/ static void updateAlarmsState( void ) { - ALARM_PRIORITY_T highestPriority = ALARM_PRIORITY_NONE; + ALARM_PRIORITY_T highestPriority = ALARM_PRIORITY_NONE, p; ALARM_ID_T a; BOOL faultsActive = FALSE; BOOL dialysateRecircBlocked = FALSE; BOOL bloodRecircBlocked = FALSE; + + // Reset priority FIFOs so we can re-determine them below + for ( p = ALARM_PRIORITY_NONE; p < NUM_OF_ALARM_PRIORITIES; p++ ) + { + resetAlarmPriorityFIFO( p ); + } // Update FIFOs and sub-ranks per active alarms table - for alarm ranking purposes to determine "top" alarm for ( a = ALARM_ID_NO_ALARM; a < NUM_OF_ALARM_IDS; a++ ) @@ -814,7 +816,7 @@ U32 subRank = ALARM_TABLE[ a ].alarmSubRank; U32 msSinceTriggered = calcTimeSince( getAlarmStartTime( a ) ); - // See if this alarm is higher rank than highest active alarm in this priority category so far + // See if this alarm is higher rank than highest active alarm in this priority category so far (lower rank # = higher rank) if ( subRank <= alarmPriorityFIFO[ almPriority ].subRank ) { // If sub-rank is a tie, see which alarm was triggered first