[!NOCODE!]
/**
  @file    Can_NotifyCheck_Src.m
  @version 1.0.0

  @brief   AUTOSAR Can_43_FLEXCAN - macros.
  @details Macros
  
  Project AUTOSAR 4.3 MCAL
  Platform PA
  Peripheral FLEXCAN
  Dependencies 
  
  ARVersion 4.3.1
  ARRevision ASR_REL_4_3_REV_0001
  ARConfVariant
  SWVersion 1.0.0
  BuildVersion MPC5777C_MCAL_1_0_0_RTM_ASR_REL_4_3_REV_0001_20190315

  (c) Copyright 2006-2016 Freescale Semiconductor, Inc. 
*       Copyright 2017-2019 NXP
  All Rights Reserved.
*/
/*==================================================================================================
==================================================================================================*/
[!ENDNOCODE!]


[!/* avoid multiple inclusion */!]
[!IF "not(var:defined('CAN_NOTIFY_CHECK_SRC_M'))"!]
[!VAR "CAN_NOTIFY_CHECK_SRC_M"="'true'"!]

[!NOCODE!]
[!MACRO "CanRxFifoWarningNotification_PC"!]
    [!VAR "MacOuterLoopCounter" = "0"!]
    [!VAR "MacInnerLoopCounter" = "0"!]
 [!LOOP "CanConfigSet/CanController/*[1]"!]
 
    
        [!VAR "MacOuterLoopCounter" = "$MacOuterLoopCounter + 1"!]
        [!VAR "MacInnerLoopCounter" = "0"!]
        [!VAR "MacMatchcounter" = "0"!]
        [!IF "CanRxFifo/CanControllerRxFifoEnable = 'true'"!]
            [!VAR "MacNotification" = "CanRxFifo/CanRxFifoWarningNotification"!]
        [!ENDIF!]
        [!LOOP "../../CanController/*"!]
             [!IF "CanRxFifo/CanControllerRxFifoEnable = 'true'"!]
                [!IF "(normalize-space(CanRxFifo/CanRxFifoWarningNotification) != 'NULL_PTR')"!]
                    [!VAR "MacInnerLoopCounter" = "$MacInnerLoopCounter + 1"!]
                    [!IF "$MacOuterLoopCounter >= $MacInnerLoopCounter"!]
                        [!IF "($MacNotification = CanRxFifo/CanRxFifoWarningNotification)"!]
                            [!VAR "MacMatchcounter" = "$MacMatchcounter + 1"!]
                        [!ENDIF!]
                    [!ENDIF!]
                [!ENDIF!]
            [!ENDIF!]
        [!ENDLOOP!]
        [!IF "$MacMatchcounter = 1"!][!CODE!]
            [!IF "CanRxFifo/CanControllerRxFifoEnable = 'true'"!]
/* @violates @ref Can_43_FLEXCAN_Cfg_c_REF_3 MISRA 2012 Required Rule 8.5 */
extern FUNC(void,CAN_CODE) [!"normalize-space(CanRxFifo/CanRxFifoWarningNotification)"!]( void);
            [!ENDIF!]
        [!ENDCODE!]
        [!ENDIF!]
      
 [!ENDLOOP!]
 
[!ENDMACRO!]

[!MACRO "CanRxFifoOverflowNotification_PC"!]
    [!VAR "MacOuterLoopCounter" = "0"!]
    [!VAR "MacInnerLoopCounter" = "0"!]
 [!LOOP "CanConfigSet/CanController/*[1]"!]
         [!VAR "MacOuterLoopCounter" = "$MacOuterLoopCounter + 1"!]
        [!VAR "MacInnerLoopCounter" = "0"!]
        [!VAR "MacMatchcounter" = "0"!]
        [!IF "CanRxFifo/CanControllerRxFifoEnable = 'true' or (CanRxFifo/CanControllerEnhancedRxFifoEnable = 'true' and CanRxFifo/CanControllerEnhancedRxFifoDMAEnable = 'false')"!]
            [!VAR "MacNotification" = "CanRxFifo/CanRxFifoOverflowNotification"!]
        [!ENDIF!]
        [!LOOP "../../CanController/*"!]
             [!IF "CanRxFifo/CanControllerRxFifoEnable = 'true' or (CanRxFifo/CanControllerEnhancedRxFifoEnable = 'true' and CanRxFifo/CanControllerEnhancedRxFifoDMAEnable = 'false')"!]
                [!IF "(normalize-space(CanRxFifo/CanRxFifoOverflowNotification) != 'NULL_PTR')"!]
                    [!VAR "MacInnerLoopCounter" = "$MacInnerLoopCounter + 1"!]
                    [!IF "$MacOuterLoopCounter >= $MacInnerLoopCounter"!]
                        [!IF "($MacNotification = CanRxFifo/CanRxFifoOverflowNotification)"!]
                            [!VAR "MacMatchcounter" = "$MacMatchcounter + 1"!]
                        [!ENDIF!]
                    [!ENDIF!]
                [!ENDIF!]
            [!ENDIF!]
        [!ENDLOOP!]
        [!IF "$MacMatchcounter = 1"!][!CODE!]
            [!IF "CanRxFifo/CanControllerRxFifoEnable = 'true' or (CanRxFifo/CanControllerEnhancedRxFifoEnable = 'true' and CanRxFifo/CanControllerEnhancedRxFifoDMAEnable = 'false')"!]
/* @violates @ref Can_43_FLEXCAN_Cfg_c_REF_3 MISRA 2012 Required Rule 8.5 */
extern FUNC(void,CAN_CODE) [!"normalize-space(CanRxFifo/CanRxFifoOverflowNotification)"!]( void);
            [!ENDIF!]
        [!ENDCODE!]
        [!ENDIF!]
 [!ENDLOOP!]
 [!ENDMACRO!]

[!MACRO "CanErrorControllerNotification_PC"!]
    [!VAR "MacOuterLoopCounter" = "0"!]
    [!VAR "MacInnerLoopCounter" = "0"!]
 [!LOOP "CanConfigSet/CanController/*[1]"!]
         [!VAR "MacOuterLoopCounter" = "$MacOuterLoopCounter + 1"!]
        [!VAR "MacInnerLoopCounter" = "0"!]
        [!VAR "MacMatchcounter" = "0"!]
        [!IF "CanErrorControllerNotifEn = 'true'"!]
            [!VAR "MacNotification" = "CanErrorControllerNotification"!]
        [!ENDIF!]            
        [!LOOP "../../CanController/*"!]
             [!IF "CanErrorControllerNotifEn = 'true'"!]
                [!IF "(normalize-space(CanErrorControllerNotification) != 'NULL_PTR')"!]
                    [!VAR "MacInnerLoopCounter" = "$MacInnerLoopCounter + 1"!]
                    [!IF "$MacOuterLoopCounter >= $MacInnerLoopCounter"!]
                        [!IF "($MacNotification = CanErrorControllerNotification)"!]
                            [!VAR "MacMatchcounter" = "$MacMatchcounter + 1"!]
                        [!ENDIF!]
                    [!ENDIF!]
                [!ENDIF!]
            [!ENDIF!]
        [!ENDLOOP!]
        [!IF "$MacMatchcounter = 1"!]
            [!IF "CanErrorControllerNotifEn = 'true'"!][!CODE!]
/* @violates @ref Can_43_FLEXCAN_Cfg_c_REF_3 MISRA 2012 Required Rule 8.5 */
extern FUNC(void,CAN_CODE) [!"normalize-space(CanErrorControllerNotification)"!]( void);
            [!ENDCODE!]
            [!ENDIF!]
        [!ENDIF!]
  [!ENDLOOP!]
  [!ENDMACRO!]

[!ENDNOCODE!]
[!ENDIF!][!// avoid multiple inclusion ENDIF