SConscript 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. Import('RTT_ROOT')
  2. Import('rtconfig')
  3. from building import *
  4. cwd = GetCurrentDir()
  5. # add the general drivers.
  6. src = Split("""
  7. """)
  8. if GetDepend(['RT_USING_SERIAL']):
  9. src += ['drv_usart.c']
  10. if GetDepend(['RT_USING_HWTIMER']):
  11. src += ['drv_hwtimer.c']
  12. if GetDepend(['RT_USING_PWM']):
  13. src += ['drv_pwm.c']
  14. if GetDepend(['RT_USING_SPI']):
  15. src += ['drv_spi.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. if GetDepend(['RT_USING_DAC']):
  22. src += Glob('drv_dac.c')
  23. if GetDepend(['RT_USING_CAN']):
  24. src += ['drv_can.c']
  25. if GetDepend(['RT_USING_PM']):
  26. src += ['drv_pm.c']
  27. src += ['drv_lptim.c']
  28. if GetDepend('BSP_USING_ONCHIP_RTC'):
  29. src += ['drv_rtc.c']
  30. if GetDepend('BSP_USING_ON_CHIP_FLASH'):
  31. src += ['drv_flash.c']
  32. if GetDepend(['BSP_USING_WDT']):
  33. src += ['drv_wdt.c']
  34. src += ['drv_common.c']
  35. path = [cwd]
  36. path += [cwd + '/config']
  37. if GetDepend('BSP_USING_ON_CHIP_FLASH'):
  38. path += [cwd + '/drv_flash']
  39. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
  40. Return('group')