SConscript 1.1 KB

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