1# RT-Thread building script for component
2
3from building import *
4import os
5cwd = GetCurrentDir()
6
7# add the general drivers.
8src = Split("""
9board.c
10""")
11
12# add gpio driver code
13if  GetDepend(['BSP_USING_GPIO']):
14    src += ['drv_gpio.c']
15
16# add serial driver code
17if  GetDepend('BSP_USING_UART0') or GetDepend('BSP_USING_UART1') or GetDepend('BSP_USING_UART2') or GetDepend('BSP_USING_UART3'):
18    src += ['drv_uart.c']
19
20# add inter flash fal filesystem
21if GetDepend('BSP_USING_INTER_FLASH'):
22	src += Glob('ports/*.c')
23
24path_ports = os.path.join(cwd,'ports')
25CPPPATH = [cwd,path_ports]
26
27group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
28
29Return('group')
30