1import os
2from building import *
3
4objs = []
5cwd  = GetCurrentDir()
6
7# add general drivers
8src = []
9path =  [cwd]
10
11if GetDepend(['BSP_USING_FAL']):
12    src += Glob('fal/fal_spi_flash_sfud_port.c')
13    path += [cwd + '/fal']
14
15if GetDepend(['BSP_USING_ONBOARD_PM']):
16	src += Glob('pm/drv_pm.c')
17	src += Glob('pm/drv_wakeup.c')
18	path += [cwd + '/pm']
19
20if GetDepend(['BSP_USING_FS']):
21    src += Glob('drv_filesystem.c')
22
23if GetDepend(['BSP_USING_EASYFLASH']):
24    src += Glob('ef_fal_port.c')
25
26if GetDepend(['BSP_USING_ETH']):
27    src += Glob('phy_reset.c')
28
29if GetDepend(['BSP_USING_SOFT_SPI_FLASH']):
30    src += Glob('soft_spi_flash_init.c')
31
32if GetDepend(['BSP_USING_SPI_FLASH']):
33    src += Glob('spi_flash_init.c')
34
35CPPDEFINES = ['STM32F407xx']
36group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
37
38list = os.listdir(cwd)
39for item in list:
40    if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
41        group = group + SConscript(os.path.join(item, 'SConscript'))
42
43Return('group')
44