SConscript 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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_PIN']):
  9. src += ['drv_gpio.c']
  10. if GetDepend(['RT_USING_SERIAL']):
  11. src += ['drv_usart.c']
  12. if GetDepend(['RT_USING_HWTIMER']):
  13. src += ['drv_hwtimer.c']
  14. if GetDepend(['RT_USING_PWM']):
  15. src += ['drv_pwm.c']
  16. if GetDepend(['RT_USING_SPI']):
  17. src += ['drv_spi.c']
  18. if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']):
  19. if GetDepend('BSP_USING_I2C1') or GetDepend('BSP_USING_I2C2') or GetDepend('BSP_USING_I2C3') or GetDepend('BSP_USING_I2C4'):
  20. src += ['drv_soft_i2c.c']
  21. if GetDepend(['RT_USING_ADC']):
  22. src += Glob('drv_adc.c')
  23. if GetDepend(['RT_USING_DAC']):
  24. src += Glob('drv_dac.c')
  25. if GetDepend(['RT_USING_CAN']):
  26. src += ['drv_can.c']
  27. if GetDepend(['RT_USING_PM']):
  28. src += ['drv_pm.c']
  29. src += ['drv_lptim.c']
  30. if GetDepend('BSP_USING_ONCHIP_RTC'):
  31. src += ['drv_rtc.c']
  32. if GetDepend('BSP_USING_ON_CHIP_FLASH'):
  33. src += ['drv_flash.c']
  34. if GetDepend(['BSP_USING_WDT']):
  35. src += ['drv_wdt.c']
  36. src += ['drv_common.c']
  37. path = [cwd]
  38. path += [cwd + '/config']
  39. if GetDepend('BSP_USING_ON_CHIP_FLASH'):
  40. path += [cwd + '/drv_flash']
  41. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
  42. Return('group')