SConscript 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. CubeMX_Config/Src/stm32f4xx_hal_msp.c
  10. ''')
  11. path = [cwd]
  12. path += [cwd + '/CubeMX_Config/Inc']
  13. path += [cwd + '/ports']
  14. if GetDepend(['BSP_USING_ETH']):
  15. src += Glob('ports/phy_reset.c')
  16. if GetDepend(['BSP_USING_SPI_FLASH']):
  17. src += Glob('ports/spi_flash_init.c')
  18. if GetDepend(['BSP_USING_FS']):
  19. src += Glob('ports/drv_filesystem.c')
  20. if GetDepend(['BSP_USING_SPI_FLASH_LITTLEFS']):
  21. src += Glob('ports/fal_spi_flash_sfud_port.c')
  22. if GetDepend(['BSP_USING_SRAM']):
  23. src += Glob('ports/drv_sram.c')
  24. if GetDepend(['BSP_USING_ONBOARD_LCD']):
  25. src += Glob('ports/drv_lcd.c')
  26. if GetDepend(['BSP_USING_TOUCH']):
  27. src += Glob('ports/touch/*.c')
  28. path += [cwd + '/ports/touch']
  29. startup_path_prefix = SDK_LIB
  30. if rtconfig.PLATFORM == 'gcc':
  31. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s']
  32. elif rtconfig.PLATFORM in ['armcc', 'armclang']:
  33. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f407xx.s']
  34. elif rtconfig.CROSS_TOOL == 'iar':
  35. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.s']
  36. CPPDEFINES = ['STM32F407xx']
  37. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  38. Return('group')