mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-01 17:40:25 +08:00
34 lines
764 B
Python
34 lines
764 B
Python
|
Import('RTT_ROOT')
|
||
|
Import('rtconfig')
|
||
|
from building import *
|
||
|
|
||
|
cwd = GetCurrentDir()
|
||
|
|
||
|
# add the general drivers.
|
||
|
src = Split("""
|
||
|
drv_common.c
|
||
|
""")
|
||
|
|
||
|
if GetDepend(['RT_USING_PIN']):
|
||
|
src += ['drv_gpio.c']
|
||
|
|
||
|
if GetDepend(['RT_USING_SERIAL']):
|
||
|
if GetDepend(['RT_USING_SERIAL_V2']):
|
||
|
src += ['drv_usart_v2.c']
|
||
|
else:
|
||
|
src += ['drv_uart.c']
|
||
|
|
||
|
if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']):
|
||
|
if GetDepend('BSP_USING_I2C1') or GetDepend('BSP_USING_I2C2') or GetDepend('BSP_USING_I2C3') or GetDepend('BSP_USING_I2C4'):
|
||
|
src += ['drv_soft_i2c.c']
|
||
|
|
||
|
if GetDepend(['RT_USING_ADC']):
|
||
|
src += Glob('drv_adc.c')
|
||
|
|
||
|
path = [cwd]
|
||
|
path += [cwd + '/config']
|
||
|
|
||
|
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
|
||
|
|
||
|
Return('group')
|