Skip to content

Commit 43f6813

Browse files
committed
[BSP] Add fh8620 bsp from Shanghai Fullhan Microelectronics Co., Ltd.
FH8620 BSP Copyright (c) 2016 Shanghai Fullhan Microelectronics Co., Ltd. All rights reserved
1 parent 6d03ce9 commit 43f6813

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+23485
-0
lines changed

bsp/fh8620/SConscript

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# for module compiling
2+
import os
3+
Import('RTT_ROOT')
4+
5+
cwd = str(Dir('#'))
6+
objs = []
7+
list = os.listdir(cwd)
8+
9+
for d in list:
10+
path = os.path.join(cwd, d)
11+
if os.path.isfile(os.path.join(path, 'SConscript')):
12+
objs = objs + SConscript(os.path.join(d, 'SConscript'))
13+
14+
Return('objs')

bsp/fh8620/SConstruct

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import os
2+
import sys
3+
import rtconfig
4+
5+
if os.getenv('RTT_ROOT'):
6+
RTT_ROOT = os.getenv('RTT_ROOT')
7+
else:
8+
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
9+
10+
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
11+
from building import *
12+
13+
TARGET = rtconfig.OUTPUT_NAME + rtconfig.TARGET_EXT
14+
15+
# add rtconfig.h path to the assembler
16+
rtconfig.AFLAGS += ' -I' + str(Dir('#')) +' -I' + RTT_ROOT + '/libcpu/arm/armv6'
17+
18+
env = Environment(tools = ['mingw'],
19+
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
20+
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
21+
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
22+
AR = rtconfig.AR, ARFLAGS = '-rc',
23+
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
24+
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
25+
26+
Export('RTT_ROOT')
27+
Export('rtconfig')
28+
29+
# prepare building environment
30+
objs = PrepareBuilding(env, RTT_ROOT)
31+
32+
# make a building
33+
DoBuilding(TARGET, objs)

bsp/fh8620/applications/SConscript

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import rtconfig
2+
Import('RTT_ROOT')
3+
from building import *
4+
5+
cwd = GetCurrentDir()
6+
src = Glob('*.c')
7+
8+
CPPPATH = [cwd, str(Dir('#'))]
9+
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
10+
11+
Return('group')

bsp/fh8620/applications/main.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* This file is part of FH8620 BSP for RT-Thread distribution.
3+
*
4+
* Copyright (c) 2016 Shanghai Fullhan Microelectronics Co., Ltd.
5+
* All rights reserved
6+
*
7+
* This program is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation; either version 2 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License along
18+
* with this program; if not, write to the Free Software Foundation, Inc.,
19+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Visit http://www.fullhan.com to get contact with Fullhan.
22+
*
23+
* Change Logs:
24+
* Date Author Notes
25+
*/
26+
#include <rtthread.h>
27+
#include <components.h>
28+
29+
void init_thread(void *parameter)
30+
{
31+
rt_components_init();
32+
33+
return ;
34+
}
35+
36+
int rt_application_init(void)
37+
{
38+
rt_thread_t tid;
39+
40+
tid = rt_thread_create("init", init_thread, RT_NULL,
41+
4096, RT_THREAD_PRIORITY_MAX/3, 20);
42+
if (tid) rt_thread_startup(tid);
43+
44+
return 0;
45+
}

bsp/fh8620/drivers/SConscript

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from building import *
2+
3+
cwd = GetCurrentDir()
4+
src = Glob('*.c')
5+
CPPPATH = [cwd]
6+
7+
group = DefineGroup('drivers', src, depend = [''], CPPPATH = CPPPATH)
8+
9+
Return('group')

0 commit comments

Comments
 (0)