Index: firmware/App/Services/SystemCommTD.c =================================================================== diff -u -r3518e8a088c32e75c0c8960d5e629a7401095feb -r395522dffef1348e176564925656012f529c1910 --- firmware/App/Services/SystemCommTD.c (.../SystemCommTD.c) (revision 3518e8a088c32e75c0c8960d5e629a7401095feb) +++ firmware/App/Services/SystemCommTD.c (.../SystemCommTD.c) (revision 395522dffef1348e176564925656012f529c1910) @@ -1,17 +1,17 @@ /************************************************************************** * -* Copyright (c) 2024-2024 Diality Inc. - All Rights Reserved. +* Copyright (c) 2024-2026 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 SystemComm.c +* @file SystemCommTD.c * -* @author (last) Sean -* @date (last) 30-Jul-2024 +* @author (last) Sean Nash +* @date (last) 07-Oct-2025 * -* @author (original) Sean -* @date (original) 30-Jul-2024 +* @author (original) Sean Nash +* @date (original) 01-Aug-2024 * ***************************************************************************/ @@ -36,15 +36,15 @@ // ********** private definitions ********** -#define UI_COMM_TIMEOUT_IN_MS 7500 ///< Maximum time (in ms) that UI is allowed to wait before checking in with HD. -#define UI_COMM_SERVICE_MODE_TIMEOUT_IN_MS (2 * SEC_PER_MIN * MS_PER_SECOND) ///< Maximum time (in ms) that UI is allowed to wait before checking in with HD when in service mode. -#define DG_COMM_TIMEOUT_IN_MS 1000 ///< DG has not checked in for this much time +#define UI_COMM_TIMEOUT_IN_MS 7500 ///< Maximum time (in ms) that UI is allowed to wait before checking in with HD. +#define UI_COMM_SERVICE_MODE_TIMEOUT_IN_MS (2 * SEC_PER_MIN * MS_PER_SECOND) ///< Maximum time (in ms) that UI is allowed to wait before checking in with HD when in service mode. +#define DG_COMM_TIMEOUT_IN_MS 1000 ///< DG has not checked in for this much time -#define MAX_COMM_CRC_FAILURES 5 ///< Maximum number of CRC errors within window period before alarm -#define MAX_COMM_CRC_FAILURE_WINDOW_MS (10 * SEC_PER_MIN * MS_PER_SECOND) ///< CRC error window +#define MAX_COMM_CRC_FAILURES 5 ///< Maximum number of CRC errors within window period before alarm +#define MAX_COMM_CRC_FAILURE_WINDOW_MS (10 * SEC_PER_MIN * MS_PER_SECOND) ///< CRC error window -#define MAX_FPGA_CLOCK_SPEED_ERRORS 3 ///< maximum number of FPGA clock speed errors within window period before alarm -#define MAX_FPGA_CLOCK_SPEED_ERROR_WINDOW_MS (10 * SEC_PER_MIN * MS_PER_SECOND) ///< FPGA clock speed error window +#define MAX_FPGA_CLOCK_SPEED_ERRORS 3 ///< maximum number of FPGA clock speed errors within window period before alarm +#define MAX_FPGA_CLOCK_SPEED_ERROR_WINDOW_MS (10 * SEC_PER_MIN * MS_PER_SECOND) ///< FPGA clock speed error window /// Array of out-going CAN buffers. const COMM_BUFFER_T CAN_OUT_BUFFERS[ NUM_OF_CAN_OUT_BUFFERS ] = @@ -104,13 +104,13 @@ /*********************************************************************//** * @brief - * The checkInFromDG function checks in the DD with the TD - indicating that + * The checkInFromDD function checks in the DD with the TD - indicating that * the DD is communicating. * @details \b Inputs: none * @details \b Outputs: ddIsCommunicating, timeOfLastDDCheckIn * @return none *************************************************************************/ -void checkInFromDG( void ) +void checkInFromDD( void ) { ddIsCommunicating = TRUE; timeOfLastDDCheckIn = getMSTimerCount(); @@ -181,6 +181,10 @@ *************************************************************************/ BOOL uiCommunicated( void ) { +#ifdef TEST_PROCESS_TASKS_WO_UI + uiDidCommunicate = TRUE; +#endif + return uiDidCommunicate; } @@ -251,13 +255,15 @@ // if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_UI_COMM_ALARMS ) != SW_CONFIG_ENABLE_VALUE ) #endif { +#ifndef TEST_UI_ONLY activateAlarmNoData( ALARM_ID_TD_UI_COMM_TIMEOUT ); +#endif } } if ( TRUE == didTimeout( timeOfLastDDCheckIn, DG_COMM_TIMEOUT_IN_MS ) ) { -#ifndef RUN_WITHOUT_DD +#ifndef TEST_UI_ONLY // Only alarm on DG comm loss while in the treatment workflow if ( MODE_PRET == opMode || MODE_TREA == opMode || MODE_POST == opMode ) { @@ -290,7 +296,7 @@ { if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_BAD_MSG_CRC ) ) { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_TD_COMM_TOO_MANY_BAD_CRCS, (U32)ALARM_SOURCE_TD ); + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_TD_COMM_TOO_MANY_BAD_CRCS, (U32)ALM_SRC_TD ); } }