1# RT-Thread building script for component
2
3from building import *
4
5cwd     = GetCurrentDir()
6src     = Split('''
7drv_uart.c
8drv_io_config.c
9dmalock.c
10''')
11CPPPATH = [cwd]
12
13if GetDepend('RT_USING_PIN'):
14    src += ['drv_gpio.c']
15
16if GetDepend('BSP_USING_LCD'):
17    src += ['drv_lcd.c']
18    src += ['drv_mpylcd.c']
19    src += ['test/lcd_test.c']
20
21if GetDepend('RT_USING_HWTIMER'):
22    src += ['drv_hw_timer.c']
23
24if GetDepend('RT_USING_CPUTIME'):
25    src += ['drv_cputime.c']
26
27if GetDepend('RT_USING_I2C'):
28    src += ['drv_i2c.c']
29
30if GetDepend('RT_USING_SPI'):
31    src += ['drv_spi.c']
32
33if GetDepend('RT_USING_PWM'):
34    src += ['drv_pwm.c']
35
36if GetDepend('RT_USING_WDT'):
37    src += ['drv_wdt.c']
38
39group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=['NNCASE_NO_EXCEPTIONS'])
40
41objs = [group]
42
43list = os.listdir(cwd)
44
45for item in list:
46    if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
47        objs = objs + SConscript(os.path.join(item, 'SConscript'))
48
49Return('objs')
50