SConscript 764 B

123456789101112131415161718192021222324252627282930313233
  1. Import('RTT_ROOT')
  2. Import('rtconfig')
  3. from building import *
  4. cwd = GetCurrentDir()
  5. # add the general drivers.
  6. src = Split("""
  7. drv_common.c
  8. """)
  9. if GetDepend(['RT_USING_PIN']):
  10. src += ['drv_gpio.c']
  11. if GetDepend(['RT_USING_SERIAL']):
  12. if GetDepend(['RT_USING_SERIAL_V2']):
  13. src += ['drv_usart_v2.c']
  14. else:
  15. src += ['drv_uart.c']
  16. if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']):
  17. if GetDepend('BSP_USING_I2C1') or GetDepend('BSP_USING_I2C2') or GetDepend('BSP_USING_I2C3') or GetDepend('BSP_USING_I2C4'):
  18. src += ['drv_soft_i2c.c']
  19. if GetDepend(['RT_USING_ADC']):
  20. src += Glob('drv_adc.c')
  21. path = [cwd]
  22. path += [cwd + '/config']
  23. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
  24. Return('group')