Index: firmware/App/Controllers/Switches.c =================================================================== diff -u -r02654dc5b372b3af948ebd28aabb95cc4b51c785 -r22176ce95e49213c48454f34ddf5d29b8109f2cb --- firmware/App/Controllers/Switches.c (.../Switches.c) (revision 02654dc5b372b3af948ebd28aabb95cc4b51c785) +++ firmware/App/Controllers/Switches.c (.../Switches.c) (revision 22176ce95e49213c48454f34ddf5d29b8109f2cb) @@ -1,21 +1,20 @@ /************************************************************************** * -* Copyright (c) 2019-2022 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) 06-Nov-2021 +* @date (last) 25-May-2022 * * @author (original) Dara Navaei * @date (original) 24-Jul-2021 * ***************************************************************************/ - #include "FPGA.h" #include "MessageSupport.h" #include "Switches.h" @@ -46,7 +45,7 @@ static U32 switchesDataPublicationCounter; ///< Switches data publication counter. static OVERRIDE_U32_T switchesDataPublishInterval = { SWITCHES_DATA_PUB_INTERVAL, SWITCHES_DATA_PUB_INTERVAL, 0, 0 }; ///< Interval (in ms) at which to publish switches data to CAN bus. -static SWITCH_STATUS_T switchesStatus[ NUM_OF_DOORS_AND_CAPS ]; ///< Switches status array. +static SWITCH_STATUS_T switchesStatus[ NUM_OF_CAPS ]; ///< Switches status array. // ********** private function prototypes ********** @@ -66,7 +65,7 @@ switchesDataPublicationCounter = DATA_PUBLISH_COUNTER_START_COUNT; // Initialize all the switches - for ( i = 0; i < NUM_OF_DOORS_AND_CAPS; i++ ) + for ( i = 0; i < NUM_OF_CAPS; i++ ) { switchesStatus[ i ].status.data = (U32)STATE_CLOSED; switchesStatus[ i ].status.ovData = (U32)STATE_CLOSED; @@ -86,10 +85,9 @@ void execSwitches( void ) { U08 i; - U08 currentSwitchStatus = 0; - for ( i = 0; i < NUM_OF_DOORS_AND_CAPS; i++ ) + for ( i = 0; i < NUM_OF_CAPS; i++ ) { // Get the current switch status switch ( i ) @@ -102,10 +100,6 @@ currentSwitchStatus = ( getFPGADialysateCapStatus() != 0 ? STATE_OPEN : STATE_CLOSED ); break; - case FLUID_DOOR: - currentSwitchStatus = ( getFPGAGFluidDoorStatus() != 0 ? STATE_OPEN : STATE_CLOSED ); - break; - // NOTE: the default case was removed since this switch case is executed using a for loop so the default // case is never called. The default case is unreachable in development testing. } @@ -142,11 +136,11 @@ * @param switchId which is the switch that its status is requested * @return switch status *************************************************************************/ -OPN_CLS_STATE_T getSwitchStatus( SWITCH_T switchId ) +OPN_CLS_STATE_T getSwitchStatus( CAP_T switchId ) { U32 status = 0; - if ( switchId < NUM_OF_DOORS_AND_CAPS ) + if ( switchId < NUM_OF_CAPS ) { // Assume there is no override status = switchesStatus[ switchId ].status.data; @@ -182,7 +176,6 @@ data.concentrateCap = (U32)getSwitchStatus( CONCENTRATE_CAP ); data.dialysateCap = (U32)getSwitchStatus( DIALYSATE_CAP ); - data.fluidDoor = (U32)getSwitchStatus( FLUID_DOOR ); switchesDataPublicationCounter = 0; @@ -257,7 +250,7 @@ { BOOL result = FALSE; - if ( switchId < NUM_OF_DOORS_AND_CAPS ) + if ( switchId < NUM_OF_CAPS ) { if ( TRUE == isTestingActivated() ) { @@ -283,7 +276,7 @@ { BOOL result = FALSE; - if ( switchId < NUM_OF_DOORS_AND_CAPS ) + if ( switchId < NUM_OF_CAPS ) { if ( TRUE == isTestingActivated() ) {