rt-thread-official/bsp/stm32/stm32h750-weact-ministm32h7xx/board/SConscript

52 lines
1.6 KiB
Python
Raw Normal View History

2022-10-16 20:42:31 +08:00
import os
import rtconfig
from building import *
2022-10-16 20:42:31 +08:00
Import('SDK_LIB')
objs = []
cwd = GetCurrentDir()
2022-10-16 20:42:31 +08:00
list = os.listdir(cwd)
path = [cwd]
path += [cwd + '/CubeMX_Config/Inc']
2022-10-16 20:42:31 +08:00
path += [cwd + '/port']
# add the general drivers.
src = Glob('board.c')
src += Glob('CubeMX_Config/Src/stm32h7xx_hal_msp.c')
if GetDepend(['BSP_USING_SPI_FLASH']):
2022-10-16 20:42:31 +08:00
src += Glob('port/drv_spi_flash.c')
if GetDepend(['BSP_USING_QSPI_FLASH']):
2022-10-16 20:42:31 +08:00
src += Glob('port/drv_qspi_flash.c')
if GetDepend('BSP_USING_LCD_SPI'):
2022-10-16 20:42:31 +08:00
src = src + ['port/drv_lcd_spi.c']
src = src + ['port/st7735/lcd.c']
src = src + ['port/st7735/st7735.c']
src = src + ['port/st7735/st7735_reg.c']
src = src + ['port/st7735/logo.c']
path += [cwd + '/port/st7735']
for item in list:
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
objs = objs + SConscript(os.path.join(item, 'SConscript'))
startup_path_prefix = SDK_LIB
if rtconfig.PLATFORM in ['gcc']:
src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/gcc/startup_stm32h750xx.s']
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/arm/startup_stm32h750xx.s']
elif rtconfig.PLATFORM in ['iccarm']:
src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/iar/startup_stm32h750xx.s']
# STM32H743xx || STM32H750xx || STM32F753xx
# You can select chips from the list above
CPPDEFINES = ['STM32H750xx']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
Return('group')