Index: firmware/App/Controllers/Switches.c =================================================================== diff -u -r1747702a2e89998cd3fa1348907eeb623e9c16c8 -rb8a36ae9692adf58ae92ff1093f7be2eda9397d8 --- firmware/App/Controllers/Switches.c (.../Switches.c) (revision 1747702a2e89998cd3fa1348907eeb623e9c16c8) +++ firmware/App/Controllers/Switches.c (.../Switches.c) (revision b8a36ae9692adf58ae92ff1093f7be2eda9397d8) @@ -8,7 +8,7 @@ * @file Switches.c * * @author (last) Dara Navaei -* @date (last) 25-May-2022 +* @date (last) 14-Jun-2022 * * @author (original) Dara Navaei * @date (original) 24-Jul-2021 @@ -45,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_CAPS ]; ///< Switches status array. +static SWITCH_STATUS_T switchesStatus[ NUM_OF_CAPS ]; ///< Switches status array. // ********** private function prototypes ********** @@ -115,6 +115,16 @@ // If the debounce time has been elapsed, update the switch status to the new status else if ( TRUE == didTimeout( switchesStatus[ i ].debounceStartTime, SWITCHES_DEBOUNCE_TIME_MS ) ) { + if (CONCENTRATE_CAP == i) + { + SEND_EVENT_WITH_2_U32_DATA( DG_EVENT_CONCENTRATE_CAP_SWITCH_CHANGE, + (U32)switchesStatus[ i ].status.data, (U32)currentSwitchStatus ); + } + else if (DIALYSATE_CAP == i) + { + SEND_EVENT_WITH_2_U32_DATA( DG_EVENT_DIALYSATE_CAP_SWITCH_CHANGE, + (U32)switchesStatus[ i ].status.data, (U32)currentSwitchStatus ); + } switchesStatus[ i ].debounceStartTime = 0; switchesStatus[ i ].status.data = currentSwitchStatus; } @@ -183,7 +193,6 @@ } } - /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/