/**
*   @file           Mcem_DemErrors.c
*
*   @version 1.0.0
*
*   @brief   AUTOSAR Mcem - MCEM extended DEM reporting mechanism file
*   @details Implementation of MCEM extended DEM reporting mechanism
*
*   @addtogroup MCEM_MODULE
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : Fccu
*   Dependencies         : none
*
*   Autosar Version      : 4.3.1
*   Autosar Revision     : ASR_REL_4_3_REV_0001
*   Autosar Conf.Variant :
*   SW Version           : 1.0.0
*   Build Version        : MPC5777C_MCAL_1_0_0_RTM_ASR_REL_4_3_REV_0001_20190315
*
*   (c) Copyright 2006-2016 Freescale Semiconductor, Inc. 
*       Copyright 2017-2018 NXP
*   All Rights Reserved.
==================================================================================================*/
/*==================================================================================================
==================================================================================================*/

#ifdef __cplusplus
extern "C"{
#endif

/**
 *
 * @page misra_violations MISRA-C:2004 violations
 *
 * @section Mcem_DemErrors_c_REF_1
 * Violates MISRA 2004 Required Rule 19.15, Precautions shall be taken in order to prevent the
 * contents of a header file being included twice
 * This is not a violation since all header files are protected against multiple inclusions
 * 
 * @section Mcem_DemErrors_c_REF_2
 * Violates MISRA 2004 Required Rule 1.4, Exceeds 31 characters due to AUTOSAR 
 * compatibility
 *
 * @section Mcem_DemErrors_c_REF_3
 * Violates MISRA 2004 Advisory Rule 19.1, #include statements in a file should only be preceded by other
 * preprocessor directives or comments.
 * Violated due to AUTOSAR requirement MEMMAP003.
 *
 * @section Mcem_DemErrors_c_REF_4
 * Violates MISRA 2004 Required Rule 1.2, No reliance shall be placed on undefined or unspecified behaviour.
 * It is not a violation as taking an address of a variable is a standard C operation.
 *
 * @section [global]
 * Violates MISRA 2004 Required Rule 5.1, Exceeds 31 characters due to AUTOSAR compatibility
 *
 */

/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/
#include "Mcem_DemErrors.h"

/*==================================================================================================
*                              SOURCE FILE VERSION INFORMATION
==================================================================================================*/
#define MCEM_DEM_ERRORS_VENDOR_ID_C                      43
/* @violates @ref Mcem_DemErrors_c_REF_2 Exceeds 31 characters */
#define MCEM_DEM_ERRORS_AR_RELEASE_MAJOR_VERSION_C       4
/* @violates @ref Mcem_DemErrors_c_REF_2 Exceeds 31 characters */
#define MCEM_DEM_ERRORS_AR_RELEASE_MINOR_VERSION_C       3
/* @violates @ref Mcem_DemErrors_c_REF_2 Exceeds 31 characters */
#define MCEM_DEM_ERRORS_AR_RELEASE_REVISION_VERSION_C    1
/* @violates @ref Mcem_DemErrors_c_REF_2 Exceeds 31 characters */
#define MCEM_DEM_ERRORS_SW_MAJOR_VERSION_C               1
/* @violates @ref Mcem_DemErrors_c_REF_2 Exceeds 31 characters */
#define MCEM_DEM_ERRORS_SW_MINOR_VERSION_C               0
/* @violates @ref Mcem_DemErrors_c_REF_2 Exceeds 31 characters */
#define MCEM_DEM_ERRORS_SW_PATCH_VERSION_C               0

/*==================================================================================================
*                                     FILE VERSION CHECKS
==================================================================================================*/
/* Check if current file and Mcem_DemErrors.h header file are of the same vendor */
#if (MCEM_DEM_ERRORS_VENDOR_ID_C != MCEM_DEM_ERRORS_VENDOR_ID)
    #error "Mcem_DemErrors.c and Mcem_DemErrors.h have different Vendor ids"
#endif
/* Check if current file and Mcem_DemErrors.h header file are of the same Autosar version */
#if ((MCEM_DEM_ERRORS_AR_RELEASE_MAJOR_VERSION_C    != MCEM_DEM_ERRORS_AR_RELEASE_MAJOR_VERSION) || \
     (MCEM_DEM_ERRORS_AR_RELEASE_MINOR_VERSION_C    != MCEM_DEM_ERRORS_AR_RELEASE_MINOR_VERSION) || \
     (MCEM_DEM_ERRORS_AR_RELEASE_REVISION_VERSION_C != MCEM_DEM_ERRORS_AR_RELEASE_REVISION_VERSION))
    #error "AutoSar Version Numbers of Mcem_DemErrors.c and Mcem_DemErrors.h are different"
#endif
/* Check if current file and Mcem_DemErrors.h header file are of the same Software version */
#if ((MCEM_DEM_ERRORS_SW_MAJOR_VERSION_C != MCEM_DEM_ERRORS_SW_MAJOR_VERSION) || \
     (MCEM_DEM_ERRORS_SW_MINOR_VERSION_C != MCEM_DEM_ERRORS_SW_MINOR_VERSION) || \
     (MCEM_DEM_ERRORS_SW_PATCH_VERSION_C != MCEM_DEM_ERRORS_SW_PATCH_VERSION))
    #error "Software Version Numbers of Mcem_DemErrors.c and Mcem_DemErrors.h are different"
#endif

/* Everything in this file is available only when extended DEM reporting mechanism is enabled */
#if (STD_ON == MCEM_DEM_EXTENDED_DATA)

/*==================================================================================================
*                          LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
==================================================================================================*/



/*==================================================================================================
*                                       LOCAL MACROS
==================================================================================================*/


/*==================================================================================================
*                                      LOCAL CONSTANTS
==================================================================================================*/


/*==================================================================================================
*                                      LOCAL VARIABLES
==================================================================================================*/


/*==================================================================================================
*                                      GLOBAL CONSTANTS
==================================================================================================*/


/*==================================================================================================
*                                      GLOBAL VARIABLES
==================================================================================================*/
#define MCEM_START_SEC_VAR_NO_INIT_UNSPECIFIED
/* @violates @ref Mcem_DemErrors_c_REF_1 precautions to prevent the contents of a header file being included twice. */
/* @violates @ref Mcem_DemErrors_c_REF_3 #include statements should only be preceded by other preprocessor directives or comments. */
#include "Mcem_MemMap.h"

/* DEM extended data kept internally by the Mcem driver and reported to upper layer through call
of Dem_ReportErrorStatusPreExtData() API, when a runtime error occurs */
VAR(Mcem_DemExtDataType, MCEM_VAR) Mcem_DemExtData;

#define MCEM_STOP_SEC_VAR_NO_INIT_UNSPECIFIED
/* @violates @ref Mcem_DemErrors_c_REF_1 precautions to prevent the contents of a header file being included twice. */
/* @violates @ref Mcem_DemErrors_c_REF_3 #include statements should only be preceded by other preprocessor directives or comments. */
#include "Mcem_MemMap.h"


#define MCEM_START_SEC_VAR_NO_INIT_8
/* @violates @ref Mcem_DemErrors_c_REF_1 precautions to prevent the contents of a header file being included twice. */
/* @violates @ref Mcem_DemErrors_c_REF_3 #include statements should only be preceded by other preprocessor directives or comments. */
#include "Mcem_MemMap.h"

/* Variable storing the length of the valid information inside DEM extended data structure above */
VAR(uint8, MCEM_VAR) u8DemExtDataLength;

#define MCEM_STOP_SEC_VAR_NO_INIT_8
/* @violates @ref Mcem_DemErrors_c_REF_1 precautions to prevent the contents of a header file being included twice. */
/* @violates @ref Mcem_DemErrors_c_REF_3 #include statements should only be preceded by other preprocessor directives or comments. */
#include "Mcem_MemMap.h"
    
/*==================================================================================================
*                                   LOCAL FUNCTION PROTOTYPES
==================================================================================================*/

/*==================================================================================================
*                                       LOCAL FUNCTIONS
==================================================================================================*/

/*==================================================================================================
*                                       GLOBAL FUNCTIONS
==================================================================================================*/

#endif /* (STD_ON == MCEM_DEM_EXTENDED_DATA) */
    
#ifdef __cplusplus
}
#endif

/** @} */
