Skip to content

Commit aa7afd9

Browse files
committed
bsp: k230: add ipcm driver
ipcm is used for Dual-core communication. This feature need not to be supported bcos there is no demand for RTT-only SDK. Linux+RTT SDK also has no plans to use the latest master vesion of RTT, so there is no demand to support this from Linux+SDK too. Signed-off-by: Wang Chen <[email protected]>
1 parent 4e5bbea commit aa7afd9

File tree

6 files changed

+91
-0
lines changed

6 files changed

+91
-0
lines changed

bsp/k230/drivers/ipcm/SConscript

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# RT-Thread building script for component
2+
3+
from building import *
4+
import os
5+
cwd = GetCurrentDir()
6+
libdir = os.getenv('CDK_SRC_DIR')
7+
src = Glob('*.c')
8+
CPPPATH = ['inc']
9+
if os.path.exists(str(libdir) + '/kernel/ipcm/out/node_1'):
10+
libdir = libdir + '/kernel/ipcm/out/node_1'
11+
else:
12+
libdir = cwd + '/lib'
13+
LIBPATH = [libdir]
14+
libname = ''
15+
liblist = os.listdir(str(libdir))
16+
for item in liblist:
17+
if item[-2:] == ".a":
18+
libname = libname + '-l' + item[3:-2] + ' '
19+
20+
LINKFLAGS = ' -Wl,--whole-archive ' + libname + ' -Wl,--no-whole-archive'
21+
group = DefineGroup('Ipcm', src, depend = ['RT_USING_IPCM'], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS, LIBPATH=LIBPATH)
22+
23+
objs = [group]
24+
25+
list = os.listdir(cwd)
26+
27+
for item in list:
28+
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
29+
objs = objs + SConscript(os.path.join(item, 'SConscript'))
30+
31+
Return('objs')

bsp/k230/drivers/ipcm/ipcm_init.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <rthw.h>
2+
#include <rtthread.h>
3+
#include <rtdevice.h>
4+
5+
rt_int32_t __attribute__((weak)) _ipcm_vdd_init(void)
6+
{
7+
rt_kprintf("no ipcm library!\n");
8+
return RT_EOK;
9+
}
10+
11+
extern rt_int32_t _ipcm_vdd_init(void);
12+
rt_int32_t ipcm_module_init(void)
13+
{
14+
return _ipcm_vdd_init();
15+
}

bsp/k230/drivers/ipcm/lib/.gitkeep

Whitespace-only changes.

bsp/k230/drivers/ipcm/rtt_ctrl_init.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <rthw.h>
2+
#include <rtthread.h>
3+
#include <rtdevice.h>
4+
5+
int __attribute__((weak)) rc_server_init()
6+
{
7+
rt_kprintf("no rtt ctrl device library!\n");
8+
return RT_EOK;
9+
}

bsp/k230/drivers/ipcm/sharefs_init.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <rthw.h>
2+
#include <rtthread.h>
3+
#include <rtdevice.h>
4+
5+
#ifdef RT_USING_DFS
6+
#include <dfs_fs.h>
7+
#endif
8+
9+
int __attribute__((weak)) sharefs_client_init(const char *path)
10+
{
11+
rt_kprintf("no share fs library!\n");
12+
return RT_EOK;
13+
}
14+
15+
extern int sharefs_client_init(const char *path);
16+
rt_int32_t sharefs_module_init(void)
17+
{
18+
return sharefs_client_init("/sharefs");
19+
}
20+
21+
INIT_APP_EXPORT(sharefs_module_init);

bsp/k230/drivers/ipcm/virt_tty_init.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <rthw.h>
2+
#include <rtthread.h>
3+
#include <rtdevice.h>
4+
5+
int __attribute__((weak)) rt_virt_tty_device_init()
6+
{
7+
rt_kprintf("no virt tty device library!\n");
8+
return RT_EOK;
9+
}
10+
11+
int __attribute__((weak)) virt_tty_client_init(void)
12+
{
13+
rt_kprintf("no virt tty client library!\n");
14+
return RT_EOK;
15+
}

0 commit comments

Comments
 (0)