SConscript 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import rtconfig
  2. from building import *
  3. # get current directory
  4. cwd = GetCurrentDir()
  5. # The set of source files associated with this SConscript file.
  6. src = Split('''
  7. CMSIS/GD/GD32F4xx/Source/system_gd32f4xx.c
  8. GD32F4xx_standard_peripheral/Source/gd32f4xx_gpio.c
  9. GD32F4xx_standard_peripheral/Source/gd32f4xx_rcu.c
  10. GD32F4xx_standard_peripheral/Source/gd32f4xx_exti.c
  11. GD32F4xx_standard_peripheral/Source/gd32f4xx_misc.c
  12. GD32F4xx_standard_peripheral/Source/gd32f4xx_syscfg.c
  13. ''')
  14. if GetDepend(['RT_USING_SERIAL']):
  15. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_usart.c']
  16. if GetDepend(['RT_USING_I2C']):
  17. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_i2c.c']
  18. if GetDepend(['RT_USING_SPI']):
  19. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_spi.c']
  20. if GetDepend(['RT_USING_CAN']):
  21. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_can.c']
  22. if GetDepend(['BSP_USING_ETH']):
  23. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_enet.c']
  24. if GetDepend(['RT_USING_ADC']):
  25. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_adc.c']
  26. if GetDepend(['RT_USING_DAC']):
  27. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_dac.c']
  28. if GetDepend(['RT_USING_RTC']):
  29. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_rtc.c']
  30. if GetDepend(['RT_USING_WDT']):
  31. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_wwdgt.c']
  32. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_fwdgt.c']
  33. if GetDepend(['RT_USING_SDIO']):
  34. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_sdio.c']
  35. path = [
  36. cwd + '/CMSIS/GD/GD32F4xx/Include',
  37. cwd + '/CMSIS',
  38. cwd + '/GD32F4xx_standard_peripheral/Include',]
  39. CPPDEFINES = ['USE_STDPERIPH_DRIVER']
  40. group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  41. Return('group')