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/stm32f3xx_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 + '/STM32F3xx_HAL/CMSIS/Device/ST/STM32F3xx/Source/Templates/gcc/startup_stm32f302x8.s']
22elif rtconfig.PLATFORM in ['armcc', 'armclang']:
23    src += [startup_path_prefix + '/STM32F3xx_HAL/CMSIS/Device/ST/STM32F3xx/Source/Templates/arm/startup_stm32f302x8.s']
24elif rtconfig.PLATFORM in ['iccarm']:
25    src += [startup_path_prefix + '/STM32F3xx_HAL/CMSIS/Device/ST/STM32F3xx/Source/Templates/iar/startup_stm32f302x8.s']
26
27# (STM32F301x8) || (STM32F302x8) || (STM32F318xx)
28# (STM32F302xC) || (STM32F303xC) || (STM32F358xx)
29# (STM32F303x8) || (STM32F334x8) || (STM32F328xx)
30# (STM32F302xE) || (STM32F303xE) || (STM32F398xx)
31# (STM32F373xC) || (STM32F378xx)
32# You can select chips from the list above
33CPPDEFINES = ['STM32F302x8']
34group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
35
36Return('group')
37