Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
c44b02f0
R
rt-thread
项目概览
BaiXuePrincess
/
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看板
提交
c44b02f0
编写于
7月 12, 2013
作者:
wuyangyong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support auto initial.
上级
8890e83a
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
161 addition
and
188 deletion
+161
-188
bsp/stm32f10x/applications/application.c
bsp/stm32f10x/applications/application.c
+67
-96
bsp/stm32f10x/applications/startup.c
bsp/stm32f10x/applications/startup.c
+36
-46
bsp/stm32f10x/drivers/board.c
bsp/stm32f10x/drivers/board.c
+54
-45
bsp/stm32f10x/rtconfig.h
bsp/stm32f10x/rtconfig.h
+4
-1
未找到文件。
bsp/stm32f10x/applications/application.c
浏览文件 @
c44b02f0
/*
* File : application.c
* This file is part of RT-Thread RTOS
...
...
@@ -11,6 +10,7 @@
* Change Logs:
* Date Author Notes
* 2009-01-05 Bernard the first version
* 2013-07-12 aozima update for auto initial.
*/
/**
...
...
@@ -21,21 +21,17 @@
#include <board.h>
#include <rtthread.h>
#ifdef RT_USING_COMPONENTS_INIT
#include <components.h>
#endif
/* RT_USING_COMPONENTS_INIT */
#ifdef RT_USING_DFS
/* dfs init */
#include <dfs_init.h>
/* dfs filesystem:ELM filesystem init */
#include <dfs_elm.h>
/* dfs Filesystem APIs */
#include <dfs_fs.h>
#endif
#ifdef RT_USING_LWIP
#include <lwip/sys.h>
#include <lwip/api.h>
#include <netif/ethernetif.h>
#endif
#ifdef RT_USING_RTGUI
#include <rtgui/rtgui.h>
#include <rtgui/rtgui_server.h>
...
...
@@ -89,20 +85,21 @@ void cali_store(struct calibration_data *data)
data
->
min_y
,
data
->
max_y
);
}
#endif
#endif
/* RT_USING_RTGUI */
void
rt_init_thread_entry
(
void
*
parameter
)
{
/* Filesystem Initialization */
#ifdef RT_USING_DFS
{
/* init the device filesystem */
dfs_init
();
#ifdef RT_USING_COMPONENTS_INIT
/* initialization RT-Thread Components */
rt_components_init
();
#endif
#ifdef
RT_USING_DFS_ELMFAT
/* init the elm chan FatFs filesystam*/
elm_init
();
#ifdef
RT_USING_FINSH
finsh_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
/* RT_USING_FINSH */
/* Filesystem Initialization */
#if defined(RT_USING_DFS) && defined(RT_USING_DFS_ELMFAT)
/* mount sd card fat partition 1 as root directory */
if
(
dfs_mount
(
"sd0"
,
"/"
,
"elm"
,
0
,
0
)
==
0
)
{
...
...
@@ -110,37 +107,7 @@ void rt_init_thread_entry(void* parameter)
}
else
rt_kprintf
(
"File System initialzation failed!
\n
"
);
#endif
}
#endif
/* LwIP Initialization */
#ifdef RT_USING_LWIP
{
extern
void
lwip_sys_init
(
void
);
/* register ethernetif device */
eth_system_device_init
();
#ifdef STM32F10X_CL
rt_hw_stm32_eth_init
();
#else
/* STM32F103 */
#if STM32_ETH_IF == 0
rt_hw_enc28j60_init
();
#elif STM32_ETH_IF == 1
rt_hw_dm9000_init
();
#endif
#endif
/* re-init device driver */
rt_device_init_all
();
/* init lwip system */
lwip_sys_init
();
rt_kprintf
(
"TCP/IP initialized!
\n
"
);
}
#endif
#endif
/* RT_USING_DFS */
#ifdef RT_USING_RTGUI
{
...
...
@@ -175,7 +142,7 @@ void rt_init_thread_entry(void* parameter)
#endif
/* #ifdef RT_USING_RTGUI */
}
int
rt_application_init
()
int
rt_application_init
(
void
)
{
rt_thread_t
init_thread
;
...
...
@@ -184,8 +151,12 @@ int rt_application_init()
/* init led thread */
result
=
rt_thread_init
(
&
led_thread
,
"led"
,
led_thread_entry
,
RT_NULL
,
(
rt_uint8_t
*
)
&
led_stack
[
0
],
sizeof
(
led_stack
),
20
,
5
);
led_thread_entry
,
RT_NULL
,
(
rt_uint8_t
*
)
&
led_stack
[
0
],
sizeof
(
led_stack
),
20
,
5
);
if
(
result
==
RT_EOK
)
{
rt_thread_startup
(
&
led_thread
);
...
...
bsp/stm32f10x/applications/startup.c
浏览文件 @
c44b02f0
...
...
@@ -24,10 +24,6 @@
/*@{*/
extern
int
rt_application_init
(
void
);
#ifdef RT_USING_FINSH
extern
void
finsh_system_init
(
void
);
extern
void
finsh_set_device
(
const
char
*
device
);
#endif
#ifdef __CC_ARM
extern
int
Image
$$
RW_IRAM1
$$
ZI
$$
Limit
;
...
...
@@ -76,14 +72,14 @@ void rtthread_startup(void)
#if STM32_EXT_SRAM
rt_system_heap_init
((
void
*
)
STM32_EXT_SRAM_BEGIN
,
(
void
*
)
STM32_EXT_SRAM_END
);
#else
#ifdef __CC_ARM
#ifdef __CC_ARM
rt_system_heap_init
((
void
*
)
&
Image
$$
RW_IRAM1
$$
ZI
$$
Limit
,
(
void
*
)
STM32_SRAM_END
);
#elif __ICCARM__
#elif __ICCARM__
rt_system_heap_init
(
__segment_end
(
"HEAP"
),
(
void
*
)
STM32_SRAM_END
);
#else
#else
/* init memory system */
rt_system_heap_init
((
void
*
)
&
__bss_end
,
(
void
*
)
STM32_SRAM_END
);
#endif
#endif
#endif
/* STM32_EXT_SRAM */
#endif
/* RT_USING_HEAP */
...
...
@@ -96,12 +92,6 @@ void rtthread_startup(void)
/* init application */
rt_application_init
();
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init
();
finsh_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
/* init idle thread */
rt_thread_idle_init
();
...
...
bsp/stm32f10x/drivers/board.c
浏览文件 @
c44b02f0
...
...
@@ -10,6 +10,7 @@
* Change Logs:
* Date Author Notes
* 2009-01-05 Bernard first implementation
* 2013-07-12 aozima update for auto initial.
*/
#include <rthw.h>
...
...
@@ -19,6 +20,10 @@
#include "stm32f10x_fsmc.h"
#include "board.h"
#ifdef RT_USING_COMPONENTS_INIT
#include <components.h>
#endif
/* RT_USING_COMPONENTS_INIT */
/**
* @addtogroup STM32
*/
...
...
@@ -181,6 +186,10 @@ void rt_hw_board_init(void)
rt_hw_usart_init
();
rt_console_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#ifdef RT_USING_COMPONENTS_INIT
rt_components_board_init
();
#endif
}
/*@}*/
bsp/stm32f10x/rtconfig.h
浏览文件 @
c44b02f0
...
...
@@ -56,6 +56,9 @@
/* Using Small MM */
#define RT_USING_SMALL_MEM
// <bool name="RT_USING_COMPONENTS_INIT" description="Using RT-Thread components initialization" default="true" />
#define RT_USING_COMPONENTS_INIT
/* SECTION: Device System */
/* Using Device System */
#define RT_USING_DEVICE
...
...
@@ -78,12 +81,12 @@
/* #define RT_USING_DFS */
#define RT_USING_DFS_ELMFAT
#define RT_DFS_ELM_WORD_ACCESS
/* Reentrancy (thread safe) of the FatFs module. */
#define RT_DFS_ELM_REENTRANT
/* Number of volumes (logical drives) to be used. */
#define RT_DFS_ELM_DRIVES 2
/* #define RT_DFS_ELM_USE_LFN 1 */
/* #define RT_DFS_ELM_CODE_PAGE 936 */
#define RT_DFS_ELM_MAX_LFN 255
/* Maximum sector size to be handled. */
#define RT_DFS_ELM_MAX_SECTOR_SIZE 512
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录