Index: TestSupport.c =================================================================== diff -u -r21f8f1d1ab4bfd0592c8744528a65f98d6b8a4c4 -rbe8027c8521b547926489d1332c9119f285cd706 --- TestSupport.c (.../TestSupport.c) (revision 21f8f1d1ab4bfd0592c8744528a65f98d6b8a4c4) +++ TestSupport.c (.../TestSupport.c) (revision be8027c8521b547926489d1332c9119f285cd706) @@ -24,10 +24,12 @@ */ // ********** private definitions ********** -#define TEST_CONFIG_ENABLE_KEY 0xDABA36B2 ///< Release software configuration enable kye. + +#define TEST_CONFIG_ENABLE_KEY 0xDABA36B2 ///< Release software configuration enable key. #define TEST_CONFIG_DISABLE_KEY 0x00000000 ///< Release software configuration disable key. // ********** private data ********** + static U32 testConfig[ NUM_OF_TEST_CONFIGS ]; ///< Release software configuration. // ********** private function prototypes ********** @@ -151,7 +153,12 @@ *************************************************************************/ void initTestConfigs( void ) { - memset( &testConfig, TEST_CONFIG_DISABLE_KEY, sizeof( TEST_CONFIG_T ) ); + TEST_CONFIG_T config; + + for ( config = TEST_CONFIG_ENABLE_MIXING_WITH_WATER; config < NUM_OF_TEST_CONFIGS; ++config ) + { + testConfig[ config ] = TEST_CONFIG_DISABLE_KEY; + } } /*********************************************************************//** @@ -166,14 +173,16 @@ { BOOL status = FALSE; - if ( config < NUM_OF_TEST_CONFIGS ) + if ( ( config < NUM_OF_TEST_CONFIGS ) && ( TRUE == isTestingActivated() ) ) { testConfig[ config ] = TEST_CONFIG_ENABLE_KEY; status = TRUE; } else { - // TODO software fault because this is in release code? +#ifdef _DG_ + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_DG_INVALID_TEST_CONFIG_SELECTED, config ) +#endif } return status; @@ -191,14 +200,16 @@ { BOOL status = FALSE; - if ( config < NUM_OF_TEST_CONFIGS ) + if ( ( config < NUM_OF_TEST_CONFIGS ) && ( TRUE == isTestingActivated() ) ) { testConfig[ config ] = TEST_CONFIG_DISABLE_KEY; status = TRUE; } else { - // TODO software fault because this is in release code? +#ifdef _DG_ + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_DG_INVALID_TEST_CONFIG_SELECTED, config ) +#endif } return status; @@ -208,16 +219,16 @@ * @brief * The getTestConfigStatus function gets the status of the provided test * configuration. - * @details Inputs: none - * @details Outputs: testConfig + * @details Inputs: testConfig + * @details Outputs: none * @param config the test configuration - * @return TRUE if the release software configuration is enabled otherwise, FALSE + * @return TRUE if the test configuration is enabled otherwise, FALSE *************************************************************************/ BOOL getTestConfigStatus( TEST_CONFIG_T config ) { BOOL status = FALSE; - if ( ( TRUE == isTestingActivated() ) && ( TEST_CONFIG_ENABLE_KEY == testConfig[ config ] ) ) + if ( TEST_CONFIG_ENABLE_KEY == testConfig[ config ] ) { status = TRUE; } Index: TestSupport.h =================================================================== diff -u -r21f8f1d1ab4bfd0592c8744528a65f98d6b8a4c4 -rbe8027c8521b547926489d1332c9119f285cd706 --- TestSupport.h (.../TestSupport.h) (revision 21f8f1d1ab4bfd0592c8744528a65f98d6b8a4c4) +++ TestSupport.h (.../TestSupport.h) (revision be8027c8521b547926489d1332c9119f285cd706) @@ -31,12 +31,26 @@ #define OVERRIDE_KEY 0xCCC33C33 ///< Override key #define OVERRIDE_RESET 0x00000000 ///< Override reset -/// Test software configurations +#ifdef _DG_ +/// DG test software configurations +typedef enum test_Config_enums +{ + TEST_CONFIG_ENABLE_MIXING_WITH_WATER = 0, ///< Test configuration enable mixing with water. + TEST_CONFIG_FIRST = TEST_CONFIG_ENABLE_MIXING_WITH_WATER, ///< Test configuration first configuration. + NUM_OF_TEST_CONFIGS ///< Number of test configuration. +} TEST_CONFIG_T; +#endif + +#ifdef _HD_ +/// HD test software configurations typedef enum test_Config { - TEST_CONFIG_ENABLE_MIXING_WITH_WATER = 0, ///< Test configuration enable mixing with water. - NUM_OF_TEST_CONFIGS ///< Number of test configuration. + // TODO update this enum in HD + TEST_CONFIG_FIRST = 0, ///< Test configuration first configuration. + TEST_CONFIG_ENABLE_MIXING_WITH_WATER = TEST_CONFIG_FIRST, ///< Test configuration enable mixing with water. + NUM_OF_TEST_CONFIGS ///< Number of test configuration. } TEST_CONFIG_T; +#endif #pragma pack(push,1)