Index: firmware/App/Controllers/Switches.c =================================================================== diff -u -r34e8d77ff4891ad697f1017af3b7e9bfaadbd753 -rb53c3ab97a715ef9dc823a7148d0c0a52c413865 --- firmware/App/Controllers/Switches.c (.../Switches.c) (revision 34e8d77ff4891ad697f1017af3b7e9bfaadbd753) +++ firmware/App/Controllers/Switches.c (.../Switches.c) (revision b53c3ab97a715ef9dc823a7148d0c0a52c413865) @@ -119,27 +119,6 @@ // If the bit is 0, the door switch is open, because it is normally open switch // TODO investigate the polarity of the pump track switch once it tied to the cartridge latch switchesStatus[ i ].status.data = currentSwitchStatus; - - // Clear active Alarms - switch ( i ) - { - case FRONT_DOOR: - if ( STATE_CLOSED == currentSwitchStatus ) - { - clearAlarmCondition( ALARM_ID_CARTRIDGE_DOOR_OPENED ); - } - break; - - case PUMP_TRACK_SWITCH: - if ( STATE_CLOSED == currentSwitchStatus ) - { - clearAlarmCondition( ALARM_ID_PUMP_TRACK_LATCH_OPENED ); - } - break; - - default: - break; - } } } else @@ -148,6 +127,17 @@ } } + // Clear active Alarms + if ( STATE_CLOSED == getSwitchStatus( FRONT_DOOR ) ) + { + clearAlarmCondition( ALARM_ID_CARTRIDGE_DOOR_OPENED ); + } + + if ( STATE_CLOSED == getSwitchStatus( PUMP_TRACK_SWITCH ) ) + { + clearAlarmCondition( ALARM_ID_PUMP_TRACK_LATCH_OPENED ); + } + publishSwitchesData(); }