SConscript 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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_SOFT_SPI_FLASH']):
  17. src += Glob('ports/soft_spi_flash_init.c')
  18. if GetDepend(['BSP_USING_SPI_FLASH']):
  19. src += Glob('ports/spi_flash_init.c')
  20. if GetDepend(['BSP_USING_FS']):
  21. src += Glob('ports/drv_filesystem.c')
  22. if GetDepend(['BSP_USING_SPI_FLASH_LITTLEFS']):
  23. src += Glob('ports/fal_spi_flash_sfud_port.c')
  24. if GetDepend(['BSP_USING_SRAM']):
  25. src += Glob('ports/drv_sram.c')
  26. if GetDepend(['BSP_USING_ONBOARD_LCD']):
  27. src += Glob('ports/drv_lcd.c')
  28. if GetDepend(['BSP_USING_TOUCH_CAP']):
  29. src += Glob('ports/touch/drv_touch_ft.c')
  30. src += Glob('ports/touch/drv_touch.c')
  31. path += [cwd + '/ports/touch']
  32. if GetDepend(['BSP_USING_TOUCH_RES']):
  33. src += Glob('ports/touch/drv_touch_xpt.c')
  34. src += Glob('ports/touch/drv_xpt2046_init.c')
  35. path += [cwd + '/ports/touch']
  36. startup_path_prefix = SDK_LIB
  37. if rtconfig.PLATFORM in ['gcc']:
  38. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f407xx.s']
  39. elif rtconfig.PLATFORM in ['armcc', 'armclang']:
  40. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f407xx.s']
  41. elif rtconfig.PLATFORM in ['iccarm']:
  42. src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.s']
  43. CPPDEFINES = ['STM32F407xx']
  44. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  45. Return('group')