/** @file     OsTask_BSW.c
  *
  * @brief    Task OsTask_BSW body
  *
  * @note     AUTOMATICALLY GENERATED FILE! DO NOT EDIT!
  *
  * @note     Generated by ETAS RTA-RTE
  * @note     Version 6.5.0 
  *
  * @date     Thu Mar  7 11:39:19 2019
  */

#define RTE_CORE

#include "Rte_Const.h"
#if !defined(RTE_VENDOR_MODE)
#pragma message "Compiling an individual task file but RTE_VENDOR_MODE not defined. Compiling a stale file?"
#endif /* !defined(RTE_VENDOR_MODE) */
#if defined(RTE_USE_TASK_HEADER)
#include "OsTask_BSW.h"
#else /* !defined(RTE_USE_TASK_HEADER) */
#include "Os.h"
#endif /* !defined(RTE_USE_TASK_HEADER) */
#if defined(RTE_REQUIRES_IOC)
#include "Ioc.h"
#endif /* defined(RTE_REQUIRES_IOC) */
#include "Rte.h"
#include "Rte_Intl.h"
#include "Rte_Type.h"
#include "Rte_DataHandleType.h"

#define RTE_START_SEC_VAR_CLEARED_16
#include "Rte_MemMap.h" /*lint !e537 permit multiple inclusion */
extern VAR(uint16, RTE_DATA) Rte_RECount_OsTask_BSW_divby1000_0;

extern VAR(uint16, RTE_DATA) Rte_RECount_OsTask_BSW_divby500_0;

#define RTE_STOP_SEC_VAR_CLEARED_16
#include "Rte_MemMap.h" /*lint !e537 permit multiple inclusion */

#define RTE_START_SEC_VAR_CLEARED_8
#include "Rte_MemMap.h" /*lint !e537 permit multiple inclusion */
extern VAR(uint8, RTE_DATA) Rte_RECount_OsTask_BSW_divby100_0;

extern VAR(uint8, RTE_DATA) Rte_RECount_OsTask_BSW_divby10_0;

extern VAR(uint8, RTE_DATA) Rte_RECount_OsTask_BSW_divby250_0;

#define RTE_STOP_SEC_VAR_CLEARED_8
#include "Rte_MemMap.h" /*lint !e537 permit multiple inclusion */

/* Runnable entity prototypes */
#define BSWM_START_SEC_CODE
#include "BswM_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, BSWM_CODE) BswM_MainFunction(void);
#define BSWM_STOP_SEC_CODE
#include "BswM_MemMap.h" /*lint !e537 permit multiple inclusion */
#define CANNM_START_SEC_CODE
#include "CanNm_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, CANNM_CODE) CanNm_MainFunction(void);
#define CANNM_STOP_SEC_CODE
#include "CanNm_MemMap.h" /*lint !e537 permit multiple inclusion */
#define CANSM_START_SEC_CODE
#include "CanSM_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, CANSM_CODE) CanSM_MainFunction(void);
#define CANSM_STOP_SEC_CODE
#include "CanSM_MemMap.h" /*lint !e537 permit multiple inclusion */
#define CANTP_START_SEC_CODE
#include "CanTp_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, CANTP_CODE) CanTp_MainFunction(void);
#define CANTP_STOP_SEC_CODE
#include "CanTp_MemMap.h" /*lint !e537 permit multiple inclusion */
#define CAN_START_SEC_CODE
#include "Can_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, CAN_CODE) Can_MainFunction_BusOff(void);
FUNC(void, CAN_CODE) Can_MainFunction_Mode(void);
FUNC(void, CAN_CODE) Can_MainFunction_Read(void);
FUNC(void, CAN_CODE) Can_MainFunction_Write(void);
#define CAN_STOP_SEC_CODE
#include "Can_MemMap.h" /*lint !e537 permit multiple inclusion */
#define COMM_START_SEC_CODE
#include "ComM_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, COMM_CODE) ComM_MainFunction_ComMChannel_Can_Network_Channel(void);
#define COMM_STOP_SEC_CODE
#include "ComM_MemMap.h" /*lint !e537 permit multiple inclusion */
#define COM_START_SEC_CODE
#include "Com_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, COM_CODE) Com_MainFunctionRx(void);
FUNC(void, COM_CODE) Com_MainFunctionTx(void);
#define COM_STOP_SEC_CODE
#include "Com_MemMap.h" /*lint !e537 permit multiple inclusion */
#define DCM_START_SEC_CODE
#include "Dcm_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, DCM_CODE) Dcm_MainFunction(void);
#define DCM_STOP_SEC_CODE
#include "Dcm_MemMap.h" /*lint !e537 permit multiple inclusion */
#define DEM_START_SEC_CODE
#include "Dem_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, DEM_CODE) Dem_MainFunction(void);
#define DEM_STOP_SEC_CODE
#include "Dem_MemMap.h" /*lint !e537 permit multiple inclusion */
#define ECUM_START_SEC_CODE
#include "EcuM_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, ECUM_CODE) EcuM_MainFunction(void);
#define ECUM_STOP_SEC_CODE
#include "EcuM_MemMap.h" /*lint !e537 permit multiple inclusion */
#define FIM_START_SEC_CODE
#include "FiM_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, FIM_CODE) FiM_MainFunction(void);
#define FIM_STOP_SEC_CODE
#include "FiM_MemMap.h" /*lint !e537 permit multiple inclusion */
#define MEMIF_START_SEC_CODE
#include "MemIf_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, MEMIF_CODE) MemIf_Rb_MainFunction(void);
#define MEMIF_STOP_SEC_CODE
#include "MemIf_MemMap.h" /*lint !e537 permit multiple inclusion */
#define NVM_START_SEC_CODE
#include "NvM_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, NVM_CODE) NvM_MainFunction(void);
#define NVM_STOP_SEC_CODE
#include "NvM_MemMap.h" /*lint !e537 permit multiple inclusion */
#define XCP_START_SEC_CODE
#include "Xcp_MemMap.h" /*lint !e537 permit multiple inclusion */
FUNC(void, XCP_CODE) Xcp_EventChannel_100msRstr(void);
FUNC(void, XCP_CODE) Xcp_EventChannel_1kmsRstr(void);
FUNC(void, XCP_CODE) Xcp_EventChannel_250msRstr(void);
FUNC(void, XCP_CODE) Xcp_EventChannel_500msRstr(void);
FUNC(void, XCP_CODE) Xcp_MainFunction(void);
#define XCP_STOP_SEC_CODE
#include "Xcp_MemMap.h" /*lint !e537 permit multiple inclusion */

#define RTE_START_SEC_CODE
#include "Rte_MemMap.h" /*lint !e537 permit multiple inclusion */
TASK(OsTask_BSW)
{
   /* Box: Implicit Buffer Initialization begin */
   /* Box: Implicit Buffer Initialization end */
   /* Box: Implicit Buffer Fill begin */
   /* Box: Implicit Buffer Fill end */
   /* Box: BSWImpl1_Xcp begin */
   if ( Rte_RECount_OsTask_BSW_divby500_0 == ((VAR(uint16, AUTOMATIC))0U) )
   {
      Xcp_EventChannel_500msRstr();
   }
   /* Box: BSWImpl1_Xcp end */
   {
      /* Box: BSWImpl4_BSWIMPL_Can begin */
      Can_MainFunction_Write();
      /* Box: BSWImpl4_BSWIMPL_Can end */
   }
   {
      /* Box: BSWImpl4_BSWIMPL_Can begin */
      Can_MainFunction_Read();
      /* Box: BSWImpl4_BSWIMPL_Can end */
   }
   /* Box: BSWImpl14_CanSM begin */
   if ( Rte_RECount_OsTask_BSW_divby10_0 == ((VAR(uint8, AUTOMATIC))0U) )
   {
      CanSM_MainFunction();
   }
   /* Box: BSWImpl14_CanSM end */
   /* Box: BSWImpl3_Com begin */
   if ( Rte_RECount_OsTask_BSW_divby10_0 == ((VAR(uint8, AUTOMATIC))0U) )
   {
      Com_MainFunctionTx();
   }
   /* Box: BSWImpl3_Com end */
   {
      /* Box: BSWImpl4_BSWIMPL_Can begin */
      Can_MainFunction_BusOff();
      /* Box: BSWImpl4_BSWIMPL_Can end */
   }
   {
      /* Box: BSWImpl13_CanTp begin */
      CanTp_MainFunction();
      /* Box: BSWImpl13_CanTp end */
   }
   /* Box: BSWImpl12_MemIf begin */
   if ( Rte_RECount_OsTask_BSW_divby10_0 == ((VAR(uint8, AUTOMATIC))0U) )
   {
      MemIf_Rb_MainFunction();
   }
   /* Box: BSWImpl12_MemIf end */
   /* Box: BSWImpl1_Xcp begin */
   if ( Rte_RECount_OsTask_BSW_divby10_0 == ((VAR(uint8, AUTOMATIC))0U) )
   {
      Xcp_MainFunction();
   }
   /* Box: BSWImpl1_Xcp end */
   /* Box: BSWImpl10_BSWIMPL_BswM begin */
   if ( Rte_RECount_OsTask_BSW_divby10_0 == ((VAR(uint8, AUTOMATIC))0U) )
   {
      BswM_MainFunction();
   }
   /* Box: BSWImpl10_BSWIMPL_BswM end */
   /* Box: BSWImpl11_EcuM begin */
   if ( Rte_RECount_OsTask_BSW_divby10_0 == ((VAR(uint8, AUTOMATIC))0U) )
   {
      EcuM_MainFunction();
   }
   /* Box: BSWImpl11_EcuM end */
   /* Box: BSWImpl9_CanNm begin */
   if ( Rte_RECount_OsTask_BSW_divby10_0 == ((VAR(uint8, AUTOMATIC))0U) )
   {
      CanNm_MainFunction();
   }
   /* Box: BSWImpl9_CanNm end */
   {
      /* Box: BSWImpl8_Dcm begin */
      Dcm_MainFunction();
      /* Box: BSWImpl8_Dcm end */
   }
   /* Box: BSWImpl1_Xcp begin */
   if ( Rte_RECount_OsTask_BSW_divby250_0 == ((VAR(uint8, AUTOMATIC))0U) )
   {
      Xcp_EventChannel_250msRstr();
   }
   /* Box: BSWImpl1_Xcp end */
   {
      /* Box: BSWImpl7_Dem begin */
      Dem_MainFunction();
      /* Box: BSWImpl7_Dem end */
   }
   /* Box: BSWImpl6_NvM begin */
   if ( Rte_RECount_OsTask_BSW_divby10_0 == ((VAR(uint8, AUTOMATIC))0U) )
   {
      NvM_MainFunction();
   }
   /* Box: BSWImpl6_NvM end */
   /* Box: BSWImpl1_Xcp begin */
   if ( Rte_RECount_OsTask_BSW_divby100_0 == ((VAR(uint8, AUTOMATIC))0U) )
   {
      Xcp_EventChannel_100msRstr();
   }
   /* Box: BSWImpl1_Xcp end */
   /* Box: BSWImpl5_BSWIMPL_FiM begin */
   if ( Rte_RECount_OsTask_BSW_divby10_0 == ((VAR(uint8, AUTOMATIC))0U) )
   {
      FiM_MainFunction();
   }
   /* Box: BSWImpl5_BSWIMPL_FiM end */
   {
      /* Box: BSWImpl4_BSWIMPL_Can begin */
      Can_MainFunction_Mode();
      /* Box: BSWImpl4_BSWIMPL_Can end */
   }
   /* Box: BSWImpl3_Com begin */
   if ( Rte_RECount_OsTask_BSW_divby10_0 == ((VAR(uint8, AUTOMATIC))0U) )
   {
      Com_MainFunctionRx();
   }
   /* Box: BSWImpl3_Com end */
   /* Box: BSWImpl2_ComM begin */
   if ( Rte_RECount_OsTask_BSW_divby10_0 == ((VAR(uint8, AUTOMATIC))0U) )
   {
      ComM_MainFunction_ComMChannel_Can_Network_Channel();
   }
   /* Box: BSWImpl2_ComM end */
   /* Box: BSWImpl1_Xcp begin */
   if ( Rte_RECount_OsTask_BSW_divby1000_0 == ((VAR(uint16, AUTOMATIC))0U) )
   {
      Xcp_EventChannel_1kmsRstr();
   }
   /* Box: BSWImpl1_Xcp end */
   /* Box: Implicit Buffer Flush begin */
   /* Box: Implicit Buffer Flush end */
   if ( Rte_RECount_OsTask_BSW_divby10_0 != ((VAR(uint8, AUTOMATIC))0U) )
   {
      Rte_RECount_OsTask_BSW_divby10_0--;
   }
   else
   {
      Rte_RECount_OsTask_BSW_divby10_0 = ((VAR(uint8, AUTOMATIC))9);
   }
   if ( Rte_RECount_OsTask_BSW_divby100_0 != ((VAR(uint8, AUTOMATIC))0U) )
   {
      Rte_RECount_OsTask_BSW_divby100_0--;
   }
   else
   {
      Rte_RECount_OsTask_BSW_divby100_0 = ((VAR(uint8, AUTOMATIC))99);
   }
   if ( Rte_RECount_OsTask_BSW_divby250_0 != ((VAR(uint8, AUTOMATIC))0U) )
   {
      Rte_RECount_OsTask_BSW_divby250_0--;
   }
   else
   {
      Rte_RECount_OsTask_BSW_divby250_0 = ((VAR(uint8, AUTOMATIC))249);
   }
   if ( Rte_RECount_OsTask_BSW_divby500_0 != ((VAR(uint16, AUTOMATIC))0U) )
   {
      Rte_RECount_OsTask_BSW_divby500_0--;
   }
   else
   {
      Rte_RECount_OsTask_BSW_divby500_0 = ((VAR(uint16, AUTOMATIC))499);
   }
   if ( Rte_RECount_OsTask_BSW_divby1000_0 != ((VAR(uint16, AUTOMATIC))0U) )
   {
      Rte_RECount_OsTask_BSW_divby1000_0--;
   }
   else
   {
      Rte_RECount_OsTask_BSW_divby1000_0 = ((VAR(uint16, AUTOMATIC))999);
   }
   TerminateTask();
} /* OsTask_BSW */
#define RTE_STOP_SEC_CODE
#include "Rte_MemMap.h" /*lint !e537 permit multiple inclusion */

