SConscript 1.8 KB

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