SConscript 1.1 KB
Newer Older
S
Sherman 已提交
1 2 3 4 5 6 7 8 9 10 11
Import('RTT_ROOT')
Import('rtconfig')
from building import *

cwd = GetCurrentDir()

# add the general drivers.
src = Split("""
    drv_common.c
""")

S
Sherman 已提交
12
if GetDepend(['BSP_USING_SERIAL']):
S
Sherman 已提交
13 14 15 16 17 18
    if GetDepend(['RT_USING_SERIAL_V2']):
        src += ['drv_usart_v2.c']
    else:
        print("\nThe current project does not support serial-v1\n")
        Return('group')

S
Sherman 已提交
19
if GetDepend(['BSP_USING_PIN']):
S
Sherman 已提交
20 21
    src += ['drv_gpio.c']

S
Sherman 已提交
22
if GetDepend(['BSP_USING_WDT']):
S
Sherman 已提交
23 24
    src += ['drv_wdt.c']

S
Sherman 已提交
25 26 27
if GetDepend(['BSP_USING_ONCHIP_RTC']):
    src += ['drv_rtc.c']

S
Sherman 已提交
28
if GetDepend(['BSP_USING_I2C', 'RT_USING_I2C_BITOPS']):
S
Sherman 已提交
29 30 31
    if GetDepend('BSP_USING_I2C0') or GetDepend('BSP_USING_I2C1'):
        src += ['drv_soft_i2c.c']

S
Sherman 已提交
32
if GetDepend(['BSP_USING_SPI']):
S
Sherman 已提交
33 34
    src += ['drv_spi.c']

S
Sherman 已提交
35
if GetDepend(['BSP_USING_ADC']):
S
Sherman 已提交
36 37
    src += ['drv_adc.c']

S
Sherman 已提交
38
if GetDepend(['BSP_USING_DAC']):
S
Sherman 已提交
39 40
    src += ['drv_dac.c']

S
Sherman 已提交
41 42 43
if GetDepend(['BSP_USING_ONCHIP_FLASH']):
    src += ['drv_flash.c']

S
Sherman 已提交
44 45 46 47 48 49
path =  [cwd]
path += [cwd + '/config']

group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)

Return('group')