Index: firmware/App/Controllers/Switches.c =================================================================== diff -u -r8bd1ae47aa13a843aa8abd6321ddc050deacb4a6 -r37a9fd8f15e413db5337371a7d1a1cb65567af7c --- firmware/App/Controllers/Switches.c (.../Switches.c) (revision 8bd1ae47aa13a843aa8abd6321ddc050deacb4a6) +++ firmware/App/Controllers/Switches.c (.../Switches.c) (revision 37a9fd8f15e413db5337371a7d1a1cb65567af7c) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. +* Copyright (c) 2021-2022 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file Switches.c * -* @author (last) Dara Navaei -* @date (last) 16-Aug-2021 +* @author (last) Darren Cox +* @date (last) 10-Mar-2022 * * @author (original) Dara Navaei * @date (original) 25-Jul-2021 @@ -30,6 +30,7 @@ #define SWITCHES_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the switches data is published on the CAN bus. #define SWITCHES_DEBOUNCE_TIME_MS ( MS_PER_SECOND / 4 ) ///< Switches FPGA status check interval. +#define DATA_PUBLISH_COUNTER_START_COUNT 4 ///< Data publish counter start count. /// Switch status structure typedef struct @@ -61,7 +62,7 @@ { U08 i; - switchesDataPublicationCounter = 0; + switchesDataPublicationCounter = DATA_PUBLISH_COUNTER_START_COUNT; // Initialize all the switches for ( i = 0; i < NUM_OF_DOORS_AND_SWITCHES; i++ ) @@ -127,6 +128,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(); }