| 123456789101112131415161718192021222324252627282930313233343536373839 |
- import rtconfig
- from building import *
- # Import environment variables
- Import('env')
- # get current directory
- cwd = GetCurrentDir()
- # The set of source files associated with this SConscript file.
- src = Split('''
- GD/GD32F20x/Source/system_gd32f20x.c
- ''')
- path = [
- cwd + '/GD/GD32F20x/Include',
- cwd,]
- # Map microcontroller units (MCUs) to their corresponding startup files
- mcu_startup_files = {
- 'GD32F20X_CL': 'startup_gd32f20x_cl.s',
- }
- # Check each defined MCU, match the platform and append the appropriate startup file
- for mcu, startup_file in mcu_startup_files.items():
- if mcu in env.get('CPPDEFINES', []):
- if rtconfig.PLATFORM in ['gcc']:
- src += [os.path.join(cwd, 'GD', 'GD32F20x', 'Source', 'GCC', startup_file)]
- elif rtconfig.PLATFORM in ['armcc', 'armclang']:
- src += [os.path.join(cwd, 'GD', 'GD32F20x', 'Source', 'ARM', startup_file)]
- elif rtconfig.PLATFORM in ['iccarm']:
- src += [os.path.join(cwd, 'GD', 'GD32F20x', 'Source', 'IAR', startup_file)]
- break
- CPPDEFINES = ['USE_STDPERIPH_DRIVER']
- group = DefineGroup('Libraries', src, depend = ['SOC_SERIES_GD32F20x'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
- Return('group')
|