[!AUTOSPACING!]
#====================================================================================================
#
#    @file        Modules.mak
#    @version     1.0.0
#
#    @brief       Integration Framework - Files used to define all components required to be build
#
#    Platform        : PA
#    Build Version   : MPC5777CXG_MCAL_1_0_0_RTM_ASR_REL_4_3_REV_0001_20190318
#
#   (c) Copyright 2006-2016 Freescale Semiconductor, Inc. 
#       Copyright 2017 - 2018 NXP
#       All Rights Reserved.
#
#    This file contains sample code only. It is not part of the production code deliverables.
#
#====================================================================================================
#
# specify modules which will be compiled and linked
[!NOCODE!]

[!CODE!]


APP_BSW_LIST = SysDal

 -include $(GENERATE_DIR)/SysDal_Components.mak 
[!ENDCODE!]


[!SELECT "ApplicationRteConfig"!]

[!VAR "MaxAnalogInCh" = "num:i(0)"!]
[!VAR "MaxDigInCh" = "num:i(0)"!]
[!VAR "MaxAnalogInCh" = "num:i(0)"!]
[!VAR "MaxLightingAnalogInCh" = "num:i(0)"!]
[!VAR "MaxLightingDigInCh" = "num:i(0)"!]
[!VAR "MaxLightingPwmOutCh" = "num:i(0)"!]
[!VAR "MaxLightingDigOutCh" = "num:i(0)"!]
[!LOOP "LightingControlApp/*"!] 
   [!IF "LightCtrlUserInterface/LightCtrlInputSignalType = 'ANALOG_INPUT'"!]
       [!VAR "MaxLightingAnalogInCh" = "num:i($MaxLightingAnalogInCh + 1)"!]	   
   [!ELSEIF "LightCtrlUserInterface/LightCtrlInputSignalType = 'DIGITAL_INPUT'"!]
       [!VAR "MaxLightingDigInCh" = "num:i($MaxLightingDigInCh + 1)"!]   
   [!ELSEIF "LightCtrlOutputSignalType = 'DIGITAL_OUTPUT'"!]
       [!VAR "MaxLightingDigOutCh" = "num:i($MaxLightingDigOutCh + 1)"!]
   [!ELSEIF "LightCtrlOutputSignalType = 'PWM'"!]
       [!VAR "MaxLightingPwmOutCh" = "num:i($MaxLightingPwmOutCh + 1)"!]	   
   [!ELSE!]	   
   [!ENDIF!]
[!ENDLOOP!]	   

[!VAR "IoDalCount" = "(num:i($MaxLightingAnalogInCh + $MaxLightingDigInCh + $MaxLightingDigOutCh + $MaxLightingPwmOutCh) + num:i(count(MotorControlApp/*)))"!]
[!ENDSELECT!]

[!SELECT "PlatformApp_FeatureList"!]
[!VAR "ComDalCount" = "num:i(count(../ApplicationRteConfig/VirtualDataRouterApp/*))"!]

[!VAR "UseMemDal" = "EnableMemDAL"!]
[!ENDSELECT!]

[!CODE!]
[!IF "not($IoDalCount = num:i(0))"!]
APP_BSW_LIST += IoDal
 -include $(GENERATE_DIR)/IoDal_Components.mak[!//
[!ENDIF!]

[!IF "not($ComDalCount = num:i(0))"!]
APP_BSW_LIST += ComDal
 -include $(GENERATE_DIR)/ComDal_Components.mak
[!ENDIF!]

[!IF "$UseMemDal = 'true'"!]
APP_BSW_LIST += MemDal
 -include $(GENERATE_DIR)/MemDal_Components.mak
[!ENDIF!]

[!ENDCODE!]

[!SELECT "PlatformApp_FeatureList"!]
[!CODE!]

APP_SWC_LIST :=[!//
[!IF "(EnableLightingApp = 'true') or (EnableMotorControlApp = 'true') "!]
 Actuators[!//
 [!ENDIF!]
[!IF "EnableLightingApp = 'true'"!]
 Lighting[!//
[!ENDIF!]
[!IF "EnableMotorControlApp = 'true'"!]
 MotorCtrl[!//
[!ENDIF!]
[!IF "(EnableLightingApp = 'true') or (EnableMotorControlApp = 'true') or (EnableVdrApp = 'true') "!]
 Rte[!//
 [!ENDIF!]
 [!IF "(EnableLightingApp = 'true') or (EnableMotorControlApp = 'true') "!]
 Sensors[!//
 [!ENDIF!]
[!IF "EnableVdrApp = 'true'"!]
 Vdr[!//
[!ENDIF!]
    
[!ENDCODE!]
[!ENDSELECT!]
[!CODE!]

SAMPLE_APP_NAME := PlatformIntegration

MOTORCTRL_ENABLED = $(findstring MotorCtrl, $(APP_SWC_LIST))

[!ENDCODE!]
[!ENDNOCODE!]