SConscript 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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/GD32F20x/Source/system_gd32f20x.c
  8. GD32F20x_standard_peripheral/Source/gd32f20x_gpio.c
  9. GD32F20x_standard_peripheral/Source/gd32f20x_rcu.c
  10. GD32F20x_standard_peripheral/Source/gd32f20x_exti.c
  11. GD32F20x_standard_peripheral/Source/gd32f20x_misc.c
  12. ''')
  13. if GetDepend(['RT_USING_SERIAL']):
  14. src += ['GD32F20x_standard_peripheral/Source/gd32f20x_usart.c']
  15. if GetDepend(['RT_USING_I2C']):
  16. src += ['GD32F20x_standard_peripheral/Source/gd32f20x_i2c.c']
  17. if GetDepend(['RT_USING_SPI']):
  18. src += ['GD32F20x_standard_peripheral/Source/gd32f20x_spi.c']
  19. if GetDepend(['RT_USING_CAN']):
  20. src += ['GD32F20x_standard_peripheral/Source/gd32f20x_can.c']
  21. if GetDepend(['BSP_USING_ETH']):
  22. src += ['GD32F20x_standard_peripheral/Source/gd32f20x_enet.c']
  23. if GetDepend(['RT_USING_ADC']):
  24. src += ['GD32F20x_standard_peripheral/Source/gd32f20x_adc.c']
  25. if GetDepend(['RT_USING_DAC']):
  26. src += ['GD32F20x_standard_peripheral/Source/gd32f20x_dac.c']
  27. if GetDepend(['RT_USING_RTC']):
  28. src += ['GD32F20x_standard_peripheral/Source/gd32f20x_rtc.c']
  29. if GetDepend(['RT_USING_WDT']):
  30. src += ['GD32F20x_standard_peripheral/Source/gd32f20x_wwdgt.c']
  31. src += ['GD32F20x_standard_peripheral/Source/gd32f20x_fwdgt.c']
  32. if GetDepend(['RT_USING_SDIO']):
  33. src += ['GD32F20x_standard_peripheral/Source/gd32f20x_sdio.c']
  34. path = [
  35. cwd + '/CMSIS/GD/GD32F20x/Include',
  36. cwd + '/CMSIS',
  37. cwd + '/GD32F20x_standard_peripheral/Include',]
  38. CPPDEFINES = ['USE_STDPERIPH_DRIVER']
  39. group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  40. Return('group')