Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2345VOR
rt-thread
提交
6c83ff6e
R
rt-thread
项目概览
2345VOR
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6c83ff6e
编写于
3月 31, 2015
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'coding/master'
上级
81c4f431
0da8d515
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
173 addition
and
31 deletion
+173
-31
components/cplusplus/crt.cpp
components/cplusplus/crt.cpp
+24
-0
components/cplusplus/crt.h
components/cplusplus/crt.h
+24
-0
components/cplusplus/crt_init.c
components/cplusplus/crt_init.c
+1
-1
components/finsh/cmd.c
components/finsh/cmd.c
+0
-1
components/libc/newlib/libc.c
components/libc/newlib/libc.c
+21
-15
components/libc/newlib/libc.h
components/libc/newlib/libc.h
+7
-7
include/components.h
include/components.h
+79
-0
include/rtthread.h
include/rtthread.h
+9
-4
src/SConscript
src/SConscript
+7
-2
tools/wizard.py
tools/wizard.py
+1
-1
未找到文件。
components/cplusplus/crt.cpp
浏览文件 @
6c83ff6e
/*
* File : crt.cpp
* This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2008-2015, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2015-03-07 Bernard Add copyright header.
*/
#include <rtthread.h>
#include <rtthread.h>
#include "crt.h"
#include "crt.h"
...
...
components/cplusplus/crt.h
浏览文件 @
6c83ff6e
/*
* File : crt.h
* This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2008-2015, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2015-03-07 Bernard Add copyright header.
*/
#ifndef CRT_H_
#ifndef CRT_H_
#define CRT_H_
#define CRT_H_
...
...
components/cplusplus/crt_init.c
浏览文件 @
6c83ff6e
/*
/*
* File : crt_init.c
* File : crt_init.c
* This file is part of Device File System in RT-Thread RTOS
* This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2008-201
1
, RT-Thread Development Team
* COPYRIGHT (C) 2008-201
5
, RT-Thread Development Team
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* it under the terms of the GNU General Public License as published by
...
...
components/finsh/cmd.c
浏览文件 @
6c83ff6e
...
@@ -623,7 +623,6 @@ int list_mod_detail(const char *name)
...
@@ -623,7 +623,6 @@ int list_mod_detail(const char *name)
return
0
;
return
0
;
}
}
FINSH_FUNCTION_EXPORT
(
list_mod_detail
,
list
module
objects
in
system
)
FINSH_FUNCTION_EXPORT
(
list_mod_detail
,
list
module
objects
in
system
)
MSH_CMD_EXPORT
(
list_mod_detail
,
list
module
objects
in
system
)
#endif
#endif
long
list
(
void
)
long
list
(
void
)
...
...
components/libc/newlib/libc.c
浏览文件 @
6c83ff6e
...
@@ -18,32 +18,38 @@
...
@@ -18,32 +18,38 @@
#endif
#endif
void
libc_system_init
(
const
char
*
tty_name
)
int
libc_system_init
(
void
)
{
{
#ifdef RT_USING_DFS
#ifdef RT_USING_DFS
int
fd
;
int
fd
;
struct
rt_device
*
console_dev
;
#ifndef RT_USING_DFS_DEVFS
#ifndef RT_USING_DFS_DEVFS
#error Please enable devfs by defining RT_USING_DFS_DEVFS in rtconfig.h
#error Please enable devfs by defining RT_USING_DFS_DEVFS in rtconfig.h
#endif
#endif
/* initialize console device */
console_dev
=
rt_console_get_device
();
rt_console_init
(
tty_name
);
if
(
console_dev
)
{
/* initialize console device */
rt_console_init
(
console_dev
->
parent
.
name
);
/* open console as stdin/stdout/stderr */
/* open console as stdin/stdout/stderr */
fd
=
open
(
"/dev/console"
,
O_RDONLY
,
0
);
/* for stdin */
fd
=
open
(
"/dev/console"
,
O_RDONLY
,
0
);
/* for stdin */
fd
=
open
(
"/dev/console"
,
O_WRONLY
,
0
);
/* for stdout */
fd
=
open
(
"/dev/console"
,
O_WRONLY
,
0
);
/* for stdout */
fd
=
open
(
"/dev/console"
,
O_WRONLY
,
0
);
/* for stderr */
fd
=
open
(
"/dev/console"
,
O_WRONLY
,
0
);
/* for stderr */
/* skip warning */
/* skip warning */
fd
=
fd
;
fd
=
fd
;
}
#endif
#endif
/* set PATH and HOME */
/* set PATH and HOME */
putenv
(
"PATH=/
"
);
putenv
(
"PATH=/bin
"
);
putenv
(
"HOME=/
"
);
putenv
(
"HOME=/home
"
);
#ifdef RT_USING_PTHREADS
#ifdef RT_USING_PTHREADS
pthread_system_init
();
pthread_system_init
();
#endif
#endif
}
}
INIT_COMPONENT_EXPORT
(
libc_system_init
);
components/libc/newlib/libc.h
浏览文件 @
6c83ff6e
...
@@ -3,15 +3,15 @@
...
@@ -3,15 +3,15 @@
#include <sys/time.h>
#include <sys/time.h>
#define MILLISECOND_PER_SECOND
1000UL
#define MILLISECOND_PER_SECOND
1000UL
#define MICROSECOND_PER_SECOND
1000000UL
#define MICROSECOND_PER_SECOND
1000000UL
#define NANOSECOND_PER_SECOND
1000000000UL
#define NANOSECOND_PER_SECOND
1000000000UL
#define MILLISECOND_PER_TICK
(MILLISECOND_PER_SECOND / RT_TICK_PER_SECOND)
#define MILLISECOND_PER_TICK
(MILLISECOND_PER_SECOND / RT_TICK_PER_SECOND)
#define MICROSECOND_PER_TICK
(MICROSECOND_PER_SECOND / RT_TICK_PER_SECOND)
#define MICROSECOND_PER_TICK
(MICROSECOND_PER_SECOND / RT_TICK_PER_SECOND)
#define NANOSECOND_PER_TICK
(NANOSECOND_PER_SECOND / RT_TICK_PER_SECOND)
#define NANOSECOND_PER_TICK
(NANOSECOND_PER_SECOND / RT_TICK_PER_SECOND)
void
libc_system_init
(
const
char
*
tty_name
);
int
libc_system_init
(
void
);
/* some time related function */
/* some time related function */
int
libc_set_time
(
const
struct
timespec
*
time
);
int
libc_set_time
(
const
struct
timespec
*
time
);
...
...
include/components.h
0 → 100644
浏览文件 @
6c83ff6e
/*
* File : components.h
* header for RT-Thread components
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012-2015, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2012-09-20 Bernard Change the name to components.h
* And all components related header files.
* 2015-02-06 Bernard Rename the components.h to rtcom.h
* 2015-03-22 Bernard Keep the compatibility.
*/
#ifndef COMPONENTS_H__
#define COMPONENTS_H__
#ifdef RT_USING_FINSH
#include <finsh.h>
#include <shell.h>
#endif
#ifdef RT_USING_LWIP
#include <lwip/sys.h>
#include <netif/ethernetif.h>
#endif
#ifdef RT_USING_DFS
#include <dfs_init.h>
#include <dfs_fs.h>
#ifdef RT_USING_DFS_ELMFAT
#include <dfs_elm.h>
#endif
#if defined(RT_USING_LWIP) && defined(RT_USING_DFS_NFS)
#include <dfs_nfs.h>
#endif
#ifdef RT_USING_DFS_ROMFS
#include <dfs_romfs.h>
#endif
#ifdef RT_USING_DFS_DEVFS
#include <devfs.h>
#endif
#ifdef RT_USING_DFS_UFFS
#include <dfs_uffs.h>
#endif
#ifdef RT_USING_DFS_JFFS2
#include <dfs_jffs2.h>
#endif
#ifdef RT_USING_DFS_YAFFS2
#include <dfs_yaffs2.h>
#endif
#ifdef RT_USING_DFS_ROMFS
#include <dfs_romfs.h>
#endif
#endif
#ifdef RT_USING_PTHREADS
#include <pthread.h>
#endif
#ifdef RT_USING_MODULE
#include <rtm.h>
#endif
#endif
include/rtthread.h
浏览文件 @
6c83ff6e
...
@@ -437,6 +437,11 @@ void rt_module_unload_sethook(void (*hook)(rt_module_t module));
...
@@ -437,6 +437,11 @@ void rt_module_unload_sethook(void (*hook)(rt_module_t module));
void
rt_module_init_object_container
(
struct
rt_module
*
module
);
void
rt_module_init_object_container
(
struct
rt_module
*
module
);
rt_err_t
rt_module_destroy
(
rt_module_t
module
);
rt_err_t
rt_module_destroy
(
rt_module_t
module
);
/*
* application module system initialization
*/
int
rt_system_module_init
(
void
);
/*@}*/
/*@}*/
#endif
#endif
...
@@ -455,10 +460,10 @@ void rt_interrupt_leave(void);
...
@@ -455,10 +460,10 @@ void rt_interrupt_leave(void);
*/
*/
rt_uint8_t
rt_interrupt_get_nest
(
void
);
rt_uint8_t
rt_interrupt_get_nest
(
void
);
/**
#ifdef RT_USING_COMPONENTS_INIT
* application module
void
rt_components_init
(
void
);
*/
void
rt_components_board_init
(
void
);
int
rt_system_module_init
(
void
);
#endif
/**
/**
* @addtogroup KernelService
* @addtogroup KernelService
...
...
src/SConscript
浏览文件 @
6c83ff6e
...
@@ -5,8 +5,13 @@ from building import *
...
@@ -5,8 +5,13 @@ from building import *
src
=
Glob
(
'*.c'
)
src
=
Glob
(
'*.c'
)
CPPPATH
=
[
RTT_ROOT
+
'/include'
]
CPPPATH
=
[
RTT_ROOT
+
'/include'
]
if
rtconfig
.
CROSS_TOOL
==
'keil'
and
GetDepend
(
'RT_USING_MODULE'
)
==
True
:
if
rtconfig
.
CROSS_TOOL
==
'keil'
:
LINKFLAGS
=
' --keep __rtmsym_* '
# add more link flags for module and components_init.
LINKFLAGS
=
''
if
GetDepend
(
'RT_USING_MODULE'
):
LINKFLAGS
=
' --keep __rtmsym_* '
if
GetDepend
(
'RT_USING_COMPONENTS_INIT'
):
LINKFLAGS
=
' --keep __rt_init* '
else
:
else
:
LINKFLAGS
=
''
LINKFLAGS
=
''
...
...
tools/wizard.py
浏览文件 @
6c83ff6e
...
@@ -40,7 +40,7 @@ SConscript_com = '''# RT-Thread building script for component
...
@@ -40,7 +40,7 @@ SConscript_com = '''# RT-Thread building script for component
from building import *
from building import *
cwd = GetCurrentDir()
cwd = GetCurrentDir()
src = Glob('*.c')
src = Glob('*.c')
+ Glob('*.cpp')
CPPPATH = [cwd]
CPPPATH = [cwd]
group = DefineGroup('COMPONENT_NAME', src, depend = [''], CPPPATH = CPPPATH)
group = DefineGroup('COMPONENT_NAME', src, depend = [''], CPPPATH = CPPPATH)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录