Index: TestSupport.c =================================================================== diff -u -r493fcdf60c9fafd8405944afc73a105c8c1ee0fa -r9f8f3bc0cab51c1d6934de69cc4d1f974d3a1a53 --- TestSupport.c (.../TestSupport.c) (revision 493fcdf60c9fafd8405944afc73a105c8c1ee0fa) +++ TestSupport.c (.../TestSupport.c) (revision 9f8f3bc0cab51c1d6934de69cc4d1f974d3a1a53) @@ -16,18 +16,20 @@ ***************************************************************************/ #include "Common.h" +#include "SystemCommMessages.h" /** * @addtogroup TestSupport * @{ */ // ********** private definitions ********** +#define RELEASE_SOFTWARE_CONFIG_ENABLE_KEY 0xDABA36B2 ///< Release software configuration enable kye. +#define RELEASE_SOFTWARE_CONFIG_DISABLE_KEY 0x00000000 ///< Release software configuration disable key. - // ********** private data ********** +static U32 releaseSoftwareConfig[ NUM_OF_RELEASE_SW_CONFIGS ]; ///< Release software configuration. - // ********** private function prototypes ********** @@ -138,15 +140,65 @@ return result; } -void setReleaseSoftwareConfig( RELEASE_SOFTWARE_CONFIG_T config ) +// ********** Release software configurations functions ********** + +/*********************************************************************//** + * @brief + * The initReleaseSoftwareConfigs function initializes the release software + * configurations. + * @details Inputs: none + * @details Outputs: releaseSoftwareConfig + * @return none + *************************************************************************/ +void initReleaseSoftwareConfigs( void ) { + memset( &releaseSoftwareConfig, RELEASE_SOFTWARE_CONFIG_DISABLE_KEY, sizeof( RELEASE_SOFTWARE_CONFIG_T ) ); +} +/*********************************************************************//** + * @brief + * The setReleaseSoftwareConfig function sets the release software configuration. + * @details Inputs: none + * @details Outputs: releaseSoftwareConfig + * @param config which is the configuration to set + * @return TRUE if the set configuration was successful otherwise, FALSE + *************************************************************************/ +BOOL setReleaseSoftwareConfig( RELEASE_SOFTWARE_CONFIG_T config ) +{ + BOOL status = FALSE; + + if ( config < NUM_OF_RELEASE_SW_CONFIGS ) + { + releaseSoftwareConfig[ config ] = RELEASE_SOFTWARE_CONFIG_ENABLE_KEY; + status = TRUE; + } + else + { + // TODO software fault because this is in release code? + } + + return status; } +/*********************************************************************//** + * @brief + * The getReleaseSoftwareConfigStatus function gets the status of the + * provided release software configuration + * @details Inputs: none + * @details Outputs: releaseSoftwareConfig + * @param config the release software configuration + * @return TRUE if the release software configuration is enabled otherwise, FALSE + *************************************************************************/ BOOL getReleaseSoftwareConfigStatus( RELEASE_SOFTWARE_CONFIG_T config ) { - return 0; -} + BOOL status = FALSE; + if ( ( TRUE == isTestingActivated() ) && ( RELEASE_SOFTWARE_CONFIG_ENABLE_KEY == releaseSoftwareConfig[ config ] ) ) + { + status = TRUE; + } + return status; +} + /**@}*/ Index: TestSupport.h =================================================================== diff -u -r493fcdf60c9fafd8405944afc73a105c8c1ee0fa -r9f8f3bc0cab51c1d6934de69cc4d1f974d3a1a53 --- TestSupport.h (.../TestSupport.h) (revision 493fcdf60c9fafd8405944afc73a105c8c1ee0fa) +++ TestSupport.h (.../TestSupport.h) (revision 9f8f3bc0cab51c1d6934de69cc4d1f974d3a1a53) @@ -31,10 +31,11 @@ #define OVERRIDE_KEY 0xCCC33C33 ///< Override key #define OVERRIDE_RESET 0x00000000 ///< Override reset +/// Release software configurations typedef enum release_software_Config { - RELEASE_SW_CONFIG_ENABLE_MIXING_WATER = 0, - NUM_OF_RELEASE_SW_CONFIGS + RELEASE_SW_CONFIG_ENABLE_MIXING_WITH_WATER = 0, ///< Release software configuration enable mixing with water. + NUM_OF_RELEASE_SW_CONFIGS ///< Number of release software configuration. } RELEASE_SOFTWARE_CONFIG_T; #pragma pack(push,1) @@ -98,7 +99,8 @@ S32 getS32OverrideValue( OVERRIDE_S32_T *ovS32 ); F32 getF32OverrideValue( OVERRIDE_F32_T *ovF32 ); -void setReleaseSoftwareConfig( RELEASE_SOFTWARE_CONFIG_T config ); +void initReleaseSoftwareConfigs( void ); +BOOL setReleaseSoftwareConfig( RELEASE_SOFTWARE_CONFIG_T config ); BOOL getReleaseSoftwareConfigStatus( RELEASE_SOFTWARE_CONFIG_T config ); /**@}*/