SConscript 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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/GD32F30x/Source/system_gd32f30x.c
  8. GD32F30x_standard_peripheral/Source/gd32f30x_gpio.c
  9. GD32F30x_standard_peripheral/Source/gd32f30x_rcu.c
  10. GD32F30x_standard_peripheral/Source/gd32f30x_exti.c
  11. GD32F30x_standard_peripheral/Source/gd32f30x_misc.c
  12. ''')
  13. if GetDepend(['RT_USING_SERIAL']):
  14. src += ['GD32F30x_standard_peripheral/Source/gd32f30x_usart.c']
  15. if GetDepend(['RT_USING_I2C']):
  16. src += ['GD32F30x_standard_peripheral/Source/gd32f30x_i2c.c']
  17. if GetDepend(['RT_USING_SPI']):
  18. src += ['GD32F30x_standard_peripheral/Source/gd32f30x_spi.c']
  19. if GetDepend(['RT_USING_CAN']):
  20. src += ['GD32F30x_standard_peripheral/Source/gd32f30x_can.c']
  21. if GetDepend(['BSP_USING_ETH']):
  22. src += ['GD32F30x_standard_peripheral/Source/gd32f30x_enet.c']
  23. if GetDepend(['RT_USING_ADC']):
  24. src += ['GD32F30x_standard_peripheral/Source/gd32f30x_adc.c']
  25. if GetDepend(['RT_USING_DAC']):
  26. src += ['GD32F30x_standard_peripheral/Source/gd32f30x_dac.c']
  27. if GetDepend(['RT_USING_RTC']):
  28. src += ['GD32F30x_standard_peripheral/Source/gd32f30x_rtc.c']
  29. src += ['GD32F30x_standard_peripheral/Source/gd32f30x_pmu.c']
  30. if GetDepend(['RT_USING_WDT']):
  31. src += ['GD32F30x_standard_peripheral/Source/gd32f30x_wwdgt.c']
  32. src += ['GD32F30x_standard_peripheral/Source/gd32f30x_fwdgt.c']
  33. if GetDepend(['RT_USING_SDIO']):
  34. src += ['GD32F30x_standard_peripheral/Source/gd32f30x_sdio.c']
  35. src += ['GD32F30x_standard_peripheral/Source/gd32f30x_dma.c']
  36. path = [
  37. cwd + '/CMSIS/GD/GD32F30x/Include',
  38. cwd + '/CMSIS',
  39. cwd + '/GD32F30x_standard_peripheral/Include',]
  40. CPPDEFINES = ['USE_STDPERIPH_DRIVER']
  41. group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  42. Return('group')