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/stm32f1xx_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 + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xb.s'] 22elif rtconfig.PLATFORM in ['armcc', 'armclang']: 23 src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/arm/startup_stm32f103xb.s'] 24elif rtconfig.PLATFORM in ['iccarm']: 25 src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xb.s'] 26 27# STM32F100xB || STM32F100xE || STM32F101x6 28# STM32F101xB || STM32F101xE || STM32F101xG 29# STM32F102x6 || STM32F102xB || STM32F103x6 30# STM32F103xB || STM32F103xE || STM32F103xG 31# STM32F105xC || STM32F107xC) 32# You can select chips from the list above 33CPPDEFINES = ['STM32F103xB'] 34group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) 35Return('group') 36