SConscript 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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_dma.c
  11. GD32F4xx_standard_peripheral/Source/gd32f4xx_exti.c
  12. GD32F4xx_standard_peripheral/Source/gd32f4xx_misc.c
  13. GD32F4xx_standard_peripheral/Source/gd32f4xx_syscfg.c
  14. ''')
  15. if GetDepend(['RT_USING_SERIAL']):
  16. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_usart.c']
  17. if GetDepend(['RT_USING_I2C']):
  18. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_i2c.c']
  19. if GetDepend(['RT_USING_SPI']):
  20. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_spi.c']
  21. if GetDepend(['RT_USING_CAN']):
  22. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_can.c']
  23. if GetDepend(['BSP_USING_ETH']):
  24. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_enet.c']
  25. if GetDepend(['RT_USING_ADC']):
  26. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_adc.c']
  27. if GetDepend(['RT_USING_DAC']):
  28. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_dac.c']
  29. if GetDepend(['RT_USING_RTC']):
  30. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_rtc.c']
  31. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_pmu.c']
  32. if GetDepend(['RT_USING_WDT']):
  33. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_wwdgt.c']
  34. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_fwdgt.c']
  35. if GetDepend(['RT_USING_SDIO']):
  36. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_sdio.c']
  37. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_dma.c']
  38. if GetDepend(['BSP_USING_SDRAM']):
  39. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_fmc.c']
  40. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_exmc.c']
  41. if GetDepend(['BSP_USING_TLI']):
  42. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_tli.c']
  43. if GetDepend(['BSP_USING_GPU']):
  44. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_ipa.c']
  45. path = [
  46. cwd + '/CMSIS/GD/GD32F4xx/Include',
  47. cwd + '/CMSIS',
  48. cwd + '/GD32F4xx_standard_peripheral/Include',]
  49. CPPDEFINES = ['USE_STDPERIPH_DRIVER']
  50. group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  51. Return('group')