SConscript 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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(['BSP_USING_UART']):
  10. if GetDepend(['RT_USING_SERIAL_V2']):
  11. src += ['drv_usart_v2.c']
  12. else:
  13. print("\nThe current project does not support serial-v1\n")
  14. Return('group')
  15. if GetDepend(['BSP_USING_GPIO']):
  16. src += ['drv_gpio.c']
  17. if GetDepend(['BSP_USING_WDT']):
  18. src += ['drv_wdt.c']
  19. if GetDepend(['BSP_USING_ONCHIP_RTC']):
  20. src += ['drv_rtc.c']
  21. if GetDepend(['BSP_USING_I2C', 'RT_USING_I2C_BITOPS']):
  22. if GetDepend('BSP_USING_I2C0') or GetDepend('BSP_USING_I2C1'):
  23. src += ['drv_soft_i2c.c']
  24. if GetDepend(['BSP_USING_SPI']):
  25. src += ['drv_spi.c']
  26. if GetDepend(['BSP_USING_ADC']):
  27. src += ['drv_adc.c']
  28. if GetDepend(['BSP_USING_DAC']):
  29. src += ['drv_dac.c']
  30. if GetDepend(['BSP_USING_ONCHIP_FLASH']):
  31. src += ['drv_flash.c']
  32. if GetDepend(['BSP_USING_PWM']):
  33. src += ['drv_pwm.c']
  34. if GetDepend(['BSP_USING_CAN']):
  35. src += ['drv_can.c']
  36. if GetDepend(['BSP_USING_SDHI']):
  37. src += ['drv_sdhi.c']
  38. path = [cwd]
  39. path += [cwd + '/config']
  40. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
  41. Return('group')