2018-12-05 11:44:53 +08:00
|
|
|
from building import *
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
2018-12-05 19:04:47 +08:00
|
|
|
|
|
|
|
src = Split("""
|
|
|
|
board.c
|
|
|
|
clock_config.c
|
2018-12-11 15:04:49 +08:00
|
|
|
drv_gpio.c
|
2018-12-05 19:04:47 +08:00
|
|
|
""")
|
|
|
|
|
|
|
|
CPPPATH = [cwd]
|
2018-12-05 11:44:53 +08:00
|
|
|
|
2018-12-05 19:04:47 +08:00
|
|
|
# add driver code
|
|
|
|
if GetDepend('BSP_USING_UART0'):
|
|
|
|
src = src + ['drv_uart.c']
|
|
|
|
|
|
|
|
if GetDepend('BSP_USING_SPI2'):
|
|
|
|
src = src + ['drv_spi.c']
|
|
|
|
|
|
|
|
if GetDepend('BSP_USING_I2C4'):
|
|
|
|
src = src + ['drv_i2c.c']
|
|
|
|
|
2018-12-11 15:04:49 +08:00
|
|
|
if GetDepend('BSP_USING_ROMFS'):
|
|
|
|
src = src + ['drv_romfs.c']
|
|
|
|
|
2018-12-05 19:04:47 +08:00
|
|
|
if GetDepend('BSP_USING_SDCARD'):
|
|
|
|
src = src + ['drv_sdcard.c']
|
|
|
|
|
|
|
|
if GetDepend('BSP_USING_SPIFLASH'):
|
|
|
|
src = src + ['drv_spi_flash.c']
|
|
|
|
|
2019-11-20 22:21:19 +08:00
|
|
|
if GetDepend('BSP_USING_AUDIO_REPLAY'):
|
|
|
|
src = src + ['audio/drv_sound.c']
|
|
|
|
src = src + ['audio/fsl_wm8904.c']
|
|
|
|
|
|
|
|
if GetDepend('BSP_USING_AUDIO_RECORD'):
|
|
|
|
src = src + ['audio/drv_mic.c']
|
|
|
|
|
|
|
|
if GetDepend('BSP_USING_AUDIO_REPLAY') or GetDepend('BSP_USING_AUDIO_RECORD'):
|
|
|
|
CPPPATH += [cwd+'audio']
|
|
|
|
|
2018-12-05 11:44:53 +08:00
|
|
|
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
|
|
|
|
|
|
|
|
Return('group')
|