2024-04-18 11:44:25 +08:00
|
|
|
|
#导入其他模块中的变量
|
|
|
|
|
Import('RTT_ROOT')
|
|
|
|
|
Import('rtconfig')
|
|
|
|
|
|
|
|
|
|
#导入使用到的模块
|
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
|
|
#获取当前目录的路径
|
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
|
|
#创建一个列表,用于保存需要使用到的C文件路径
|
|
|
|
|
src = Split("""
|
|
|
|
|
drv_common.c
|
|
|
|
|
""")
|
|
|
|
|
#drv_common.c
|
|
|
|
|
#根据宏定义来对需要用到的C文件进行裁剪
|
|
|
|
|
if GetDepend(['BSP_USING_GPIO']):
|
|
|
|
|
src += ['drv_gpio.c']
|
|
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_UART']):
|
|
|
|
|
src += ['drv_usart.c']
|
|
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_SPI']):
|
|
|
|
|
src += ['drv_spi.c']
|
|
|
|
|
|
2024-06-19 23:00:12 +08:00
|
|
|
|
if GetDepend(['BSP_USING_I2C_HW']):
|
2024-04-18 11:44:25 +08:00
|
|
|
|
src += ['drv_i2c.c']
|
2024-06-19 23:00:12 +08:00
|
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_I2C_SW']):
|
|
|
|
|
src += ['drv_soft_i2c.c']
|
|
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_ADC']):
|
|
|
|
|
src += ['drv_adc.c']
|
|
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_WDT']):
|
|
|
|
|
src += ['drv_wdt.c']
|
2024-04-18 11:44:25 +08:00
|
|
|
|
|
|
|
|
|
#创建一个列表,用于保存需要包含的H文件路径
|
|
|
|
|
path = [cwd]
|
|
|
|
|
|
|
|
|
|
#创建一个组别
|
|
|
|
|
group = DefineGroup('Drivers', src ,depend = [''], CPPPATH = path)
|
|
|
|
|
|
|
|
|
|
#返回创建好的组别
|
|
|
|
|
Return('group')
|
|
|
|
|
|