1
0

SConscript 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import os
  2. import rtconfig
  3. from building import *
  4. Import('SDK_LIB')
  5. cwd = GetCurrentDir()
  6. # add general drivers
  7. src = Split('''
  8. board.c
  9. ''')
  10. if GetDepend(['BSP_USING_SPI_FLASH']):
  11. src += Glob('ports/spi_flash_init.c')
  12. if GetDepend(['BSP_USING_SDCARD']):
  13. src += Glob('ports/sdcard_port.c')
  14. if GetDepend(['BSP_USING_SDRAM']):
  15. src += Glob('ports/drv_sdram.c')
  16. path = [cwd]
  17. path += [cwd + '/ports']
  18. startup_path_prefix = SDK_LIB
  19. if rtconfig.PLATFORM in ['armcc', 'armclang']:
  20. src += [startup_path_prefix + '/APM32F4xx_Library/Device/Geehy/APM32F4xx/Source/arm/startup_apm32f40x.s']
  21. if rtconfig.PLATFORM in ['iccarm']:
  22. src += [startup_path_prefix + '/APM32F4xx_Library/Device/Geehy/APM32F4xx/Source/iar/startup_apm32f40x.s']
  23. if rtconfig.PLATFORM in ['gcc']:
  24. src += [startup_path_prefix + '/APM32F4xx_Library/Device/Geehy/APM32F4xx/Source/gcc/startup_apm32f40x.s']
  25. # APM32F40X || APM32F41X
  26. # You can select chips from the list above
  27. CPPDEFINES = ['APM32F40X']
  28. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  29. Return('group')