1import os
2import rtconfig
3from building import *
4
5Import('SDK_LIB')
6
7cwd = GetCurrentDir()
8
9# add general drivers
10src = Split('''
11board.c
12CubeMX_Config/Src/stm32f2xx_hal_msp.c
13''')
14
15path =  [cwd]
16path += [cwd + '/CubeMX_Config/Inc']
17
18startup_path_prefix = SDK_LIB
19
20if rtconfig.PLATFORM in ['gcc']:
21    src += [startup_path_prefix + '/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f207xx.s']
22elif rtconfig.PLATFORM in ['armcc', 'armclang']:
23    src += [startup_path_prefix + '/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/arm/startup_stm32f207xx.s']
24elif rtconfig.PLATFORM in ['iccarm']:
25    src += [startup_path_prefix + '/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/iar/startup_stm32f207xx.s']
26
27# STM32F205xx || STM32F207xx || STM32F215xx
28# STM32F217xx
29# You can select chips from the list above
30CPPDEFINES = ['STM32F207xx']
31group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
32Return('group')
33