SConscript 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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'):
  18. src += ['drv_soft_i2c.c']
  19. if GetDepend(['RT_USING_I2C']):
  20. if GetDepend('BSP_USING_HW_I2C3') or GetDepend('BSP_USING_HW_I2C6'):
  21. src += ['drv_i2c.c']
  22. if GetDepend(['BSP_USING_SDIO1']):
  23. src += Glob('drv_sdio.c')
  24. if GetDepend(['BSP_USING_PWM']):
  25. src += ['drv_pwm.c']
  26. if GetDepend(['BSP_USING_SPI']):
  27. src += ['drv_spi.c']
  28. if GetDepend(['BSP_USING_ADC']):
  29. src += ['drv_adc.c']
  30. if GetDepend('BSP_USING_RTC'):
  31. src += ['drv_rtc.c']
  32. if GetDepend(['RT_USING_WDT']):
  33. src += ['drv_wdt.c']
  34. path = [cwd]
  35. path += [cwd + '/config']
  36. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
  37. Return('group')