SConscript 990 B

12345678910111213141516171819202122232425262728293031
  1. import os
  2. import rtconfig
  3. from building import *
  4. Import('SDK_LIB')
  5. cwd = GetCurrentDir()
  6. # add general drivers
  7. src = Glob('board.c')
  8. src += Glob('CubeMX_Config/Src/stm32f1xx_hal_msp.c')
  9. if GetDepend(['BSP_USING_SPI_FLASH']):
  10. src += Glob('ports/spi_flash_init.c')
  11. path = [cwd]
  12. path += [cwd + '/CubeMX_Config/Inc']
  13. path += [cwd + '/ports']
  14. startup_path_prefix = SDK_LIB
  15. if rtconfig.CROSS_TOOL == 'gcc':
  16. src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xb.s']
  17. elif rtconfig.CROSS_TOOL == 'keil':
  18. src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/arm/startup_stm32f103xb.s']
  19. elif rtconfig.CROSS_TOOL == 'iar':
  20. src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s']
  21. CPPDEFINES = ['STM32F103xB']
  22. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  23. Return('group')