summaryrefslogtreecommitdiff
path: root/bsp/gd32/risc-v/gd32vw553h-eval/board/SConscript
blob: eaea72bc892d94f089526bcf59be687aa915493f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import os
import sys
import rtconfig
from building import *

Import('SDK_LIB')
Import('RTT_ROOT')
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
from env_package import find_package_path

cwd = GetCurrentDir()

# add general drivers
src = Split('''
board.c
trap_gcc.S
''')

# add WiFi driver
if GetDepend(['BSP_USING_WLAN']):
    src += ['drv_wlan.c']
    src += ['wifi.c']

path =  [cwd]

# add startup txt path
package_name = 'gd32-riscv-series-latest'
package_path = find_package_path(
    os.path.dirname(cwd),
    package_name,
    marker=os.path.join('GD32VW55x', 'RISCV', 'env_Eclipse', 'entry.S'),
    extra_candidates=[
        os.path.join(SDK_LIB, package_name),
        os.path.join(os.path.dirname(SDK_LIB), 'packages', package_name),
    ])

if rtconfig.PLATFORM in ['gcc']:
    # Use standard peripheral library startup files for compatibility
    src += [os.path.join(package_path, 'GD32VW55x', 'RISCV', 'env_Eclipse', 'start.S')]
    src += [os.path.join(package_path, 'GD32VW55x', 'RISCV', 'env_Eclipse', 'entry.S')]

CPPDEFINES = ['GD32VW553H_EVAL']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)

list = os.listdir(cwd)
for item in list:
    if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
        group = group + SConscript(os.path.join(item, 'SConscript'))

Return('group')