Index: TestSupport.c =================================================================== diff -u -r329c473b3245e42c365bc637136e9ef21ed2a5f0 -rbb4952a602ec8ee91f2d04bd24e8270b7511dcaf --- TestSupport.c (.../TestSupport.c) (revision 329c473b3245e42c365bc637136e9ef21ed2a5f0) +++ TestSupport.c (.../TestSupport.c) (revision bb4952a602ec8ee91f2d04bd24e8270b7511dcaf) @@ -7,8 +7,8 @@ * * @file TestSupport.c * -* @author (last) Michael Garthwaite -* @date (last) 01-Feb-2023 +* @author (last) Dara Navaei +* @date (last) 19-Oct-2023 * * @author (original) Sean Nash * @date (original) 10-Aug-2021 @@ -28,12 +28,13 @@ #define TEST_CONFIG_ENABLE_KEY 0xDABA36B2 ///< Release software configuration enable key. #define TEST_CONFIG_DISABLE_KEY 0x00000000 ///< Release software configuration disable key. -#define DIALIN_CHECK_IN_TIMEOUT_MS ( 5 * SEC_PER_MIN * MS_PER_SECOND ) ///< Dialin check in timeout in milliseconds. +#define DIALIN_CHECK_IN_TIMEOUT_MS ( 8 * MIN_PER_HOUR * SEC_PER_MIN * MS_PER_SECOND ) ///< Dialin check in timeout in milliseconds. // ********** private data ********** static U32 testConfig[ NUM_OF_TEST_CONFIGS ]; ///< Release software configuration. static U32 dialinCheckInTimeStamp; ///< Dialin checkin time stamp. +static BOOL signalRecoverFromFaultMode; ///< Boolean flag to allow the user to recover from fault mode in test configurations. // ********** private function prototypes ********** @@ -151,12 +152,13 @@ * @brief * The initTestConfigs function initializes the test software configurations. * @details Inputs: none - * @details Outputs: testConfig + * @details Outputs: signalRecoverFromFaultMode * @return none *************************************************************************/ void initTestConfigs( void ) { resetAllTestConfigs(); + signalRecoverFromFaultMode = FALSE; } /*********************************************************************//** @@ -182,6 +184,9 @@ #ifdef _DG_ SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_DG_INVALID_TEST_CONFIG_SELECTED, config ) #endif +#ifdef _HD_ + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_HD_INVALID_TEST_CONFIG_SELECTED, config ) +#endif } return status; @@ -210,6 +215,9 @@ #ifdef _DG_ SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_DG_INVALID_TEST_CONFIG_SELECTED, config ) #endif +#ifdef _HD_ + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_HD_INVALID_TEST_CONFIG_SELECTED, config ) +#endif } return status; @@ -259,9 +267,12 @@ #ifdef _DG_ msg.hdr.msgID = MSG_ID_DG_SEND_TEST_CONFIGURATION; #endif +#ifdef _HD_ + msg.hdr.msgID = MSG_ID_HD_SEND_TEST_CONFIGURATION; +#endif msg.hdr.payloadLen = sizeof( testConfig ); - for ( config = TEST_CONFIG_ENABLE_MIXING_WITH_WATER; config < NUM_OF_TEST_CONFIGS; ++config ) + for ( config = TEST_CONFIG_FIRST; config < NUM_OF_TEST_CONFIGS; ++config ) { configStatus = (U32)getTestConfigStatus( config ); @@ -292,7 +303,7 @@ { TEST_CONFIG_T config; - for ( config = TEST_CONFIG_ENABLE_MIXING_WITH_WATER; config < NUM_OF_TEST_CONFIGS; ++config ) + for ( config = TEST_CONFIG_FIRST; config < NUM_OF_TEST_CONFIGS; ++config ) { testConfig[ config ] = TEST_CONFIG_DISABLE_KEY; } @@ -329,14 +340,46 @@ if ( ( TRUE == didTimeout( dialinCheckInTimeStamp, DIALIN_CHECK_IN_TIMEOUT_MS ) ) && ( TRUE == isTestingActivated() ) ) { - // If the user has logged in and the check in from dialin has expired, set the status to true + // If the dialin check in has timed out and tester has logged in check for the expiration value status = TRUE; } - // TODO remove when the dialin portion has been implemented - status = FALSE; - // TODo remove when the dialin portion has been implemented + return status; +} +/*********************************************************************//** + * @brief + * The setRecoverFromFaultModeSignal function sets the recover from fault + * mode signal upon receiving it from the user. + * @details Inputs: none + * @details Outputs: signalRecoverFromFaultMode + * @return none + *************************************************************************/ +void setRecoverFromFaultModeSignal( void ) +{ + if ( TRUE == isTestingActivated() ) + { + signalRecoverFromFaultMode = TRUE; + } +} + +/*********************************************************************//** + * @brief + * The hasRecoverFromFaultModeBeenSet function returns the status of the + * recover from fault mode signal + * @details Inputs: none + * @details Outputs: signalRecoverFromFaultMode + * @return TRUE is the user is logged in and the signal is TRUE, otherwise FLASE + *************************************************************************/ +BOOL hasRecoverFromFaultModeBeenSet( void ) +{ + BOOL status = FALSE; + + if ( TRUE == isTestingActivated() ) + { + status = signalRecoverFromFaultMode; + } + return status; }