rt-thread-official/bsp/swm320-lq100/drivers/SConscript

53 lines
1.2 KiB
Python
Raw Normal View History

2018-12-24 17:17:27 +08:00
# RT-Thread building script for component
from building import *
cwd = GetCurrentDir()
# add the general drivers.
src = Split("""
board.c
""")
# add gpio driver code
if GetDepend(['BSP_USING_GPIO']):
src += ['drv_gpio.c']
# add serial driver code
if GetDepend('BSP_USING_UART0') or GetDepend('BSP_USING_UART1') or GetDepend('BSP_USING_UART2') or GetDepend('BSP_USING_UART3'):
src += ['drv_uart.c']
# add spi driver code
if GetDepend('BSP_USING_SPI0') or GetDepend('BSP_USING_SPI1'):
src += ['drv_spi.c']
# add i2c driver code
if GetDepend(['BSP_USING_I2C']):
src += ['drv_i2c.c']
# add sram driver code
if GetDepend(['BSP_USING_EXT_SRAM']):
src += ['drv_sram.c']
# add nor flash driver code
if GetDepend(['BSP_USING_NOR_FLASH']):
src += ['drv_nor_flash.c']
# add pwm driver code
if GetDepend('BSP_USING_PWM0') or GetDepend('BSP_USING_PWM1') or GetDepend('BSP_USING_PWM2') or GetDepend('BSP_USING_PWM3'):
src += ['drv_pwm.c']
# add rtc driver code
if GetDepend(['BSP_USING_RTC']):
src += ['drv_rtc.c']
# add hwtimer driver code
if GetDepend(['BSP_USING_WDT']):
src += ['drv_iwg.c']
CPPPATH = [cwd]
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
Return('group')