Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
逆着光、寻觅
rt-thread
提交
dd5ac17f
R
rt-thread
项目概览
逆着光、寻觅
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
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,发现更多精彩内容 >>
提交
dd5ac17f
编写于
10月 19, 2017
作者:
W
weety
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bsp][dm365] Using component initial;
[drv][mmcsd] Add component initial.
上级
121b72df
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
69 addition
and
279 deletion
+69
-279
bsp/dm365/applications/application.c
bsp/dm365/applications/application.c
+6
-120
bsp/dm365/applications/board.c
bsp/dm365/applications/board.c
+24
-2
bsp/dm365/applications/startup.c
bsp/dm365/applications/startup.c
+0
-148
bsp/dm365/dm365_ram.ld
bsp/dm365/dm365_ram.ld
+8
-0
bsp/dm365/drivers/davinci_emac.c
bsp/dm365/drivers/davinci_emac.c
+2
-0
bsp/dm365/drivers/davinci_serial.c
bsp/dm365/drivers/davinci_serial.c
+4
-1
bsp/dm365/drivers/i2c-davinci.c
bsp/dm365/drivers/i2c-davinci.c
+6
-0
bsp/dm365/rtconfig.h
bsp/dm365/rtconfig.h
+3
-0
components/drivers/include/drivers/mmcsd_core.h
components/drivers/include/drivers/mmcsd_core.h
+2
-2
components/drivers/sdio/block_dev.c
components/drivers/sdio/block_dev.c
+5
-1
components/drivers/sdio/mmcsd_core.c
components/drivers/sdio/mmcsd_core.c
+6
-1
components/drivers/sdio/sdio.c
components/drivers/sdio/sdio.c
+3
-4
未找到文件。
bsp/dm365/applications/application.c
浏览文件 @
dd5ac17f
...
...
@@ -29,63 +29,29 @@
/*@{*/
#include <rtthread.h>
//#include <rtdevice.h>
#ifdef RT_USING_DFS
/* dfs filesystem:ELM FatFs filesystem init */
#include <dfs_elm.h>
/* dfs Filesystem APIs */
#include <dfs_fs.h>
#ifdef RT_USING_DFS_UFFS
/* dfs filesystem:UFFS filesystem init */
#include <dfs_uffs.h>
#endif
#endif
#if defined(RT_USING_DFS_DEVFS)
#include <devfs.h>
#endif
#ifdef RT_USING_SDIO
#include <drivers/mmcsd_core.h>
#endif
#ifdef RT_USING_LWIP
#include <netif/ethernetif.h>
#endif
#ifdef RT_USING_SPI
#include <spi-davinci.h>
#endif
#ifdef RT_USING_LED
#include "led.h"
#endif
#define RT_INIT_THREAD_STACK_SIZE (2*1024)
#ifdef RT_USING_DFS_ROMFS
#include <dfs_romfs.h>
#endif
void
rt_init_thread_entry
(
void
*
parameter
)
int
main
(
void
)
{
platform_init
();
/* Filesystem Initialization */
#ifdef RT_USING_DFS
{
/* init the device filesystem */
dfs_init
();
#if defined(RT_USING_DFS_ELMFAT)
/* init the elm chan FatFs filesystam*/
elm_init
();
#endif
#if defined(RT_USING_DFS_ROMFS)
dfs_romfs_init
();
if
(
dfs_mount
(
RT_NULL
,
"/rom"
,
"rom"
,
0
,
&
romfs_root
)
==
0
)
{
rt_kprintf
(
"ROM File System initialized!
\n
"
);
...
...
@@ -94,24 +60,8 @@ void rt_init_thread_entry(void* parameter)
rt_kprintf
(
"ROM File System initialzation failed!
\n
"
);
#endif
#if defined(RT_USING_DFS_DEVFS)
devfs_init
();
if
(
dfs_mount
(
RT_NULL
,
"/dev"
,
"devfs"
,
0
,
0
)
==
0
)
rt_kprintf
(
"Device File System initialized!
\n
"
);
else
rt_kprintf
(
"Device File System initialzation failed!
\n
"
);
#ifdef RT_USING_NEWLIB
/* init libc */
libc_system_init
(
RT_CONSOLE_DEVICE_NAME
);
#endif
#endif
#if defined(RT_USING_DFS_UFFS)
{
/* init the uffs filesystem */
dfs_uffs_init
();
/* mount flash device as flash directory */
if
(
dfs_mount
(
"nand0"
,
"/nand0"
,
"uffs"
,
0
,
0
)
==
0
)
rt_kprintf
(
"UFFS File System initialized!
\n
"
);
...
...
@@ -120,13 +70,6 @@ void rt_init_thread_entry(void* parameter)
}
#endif
#ifdef RT_USING_I2C
{
rt_i2c_core_init
();
davinci_i2c_init
(
"I2C1"
);
}
#endif
#ifdef RT_USING_SPI
{
rt_hw_spi_init
();
...
...
@@ -134,82 +77,25 @@ void rt_init_thread_entry(void* parameter)
#endif
#ifdef RT_USING_SDIO
rt_mmcsd_core_init
();
rt_mmcsd_blk_init
();
rt_hw_mmcsd_init
();
rt_thread_delay
(
RT_TICK_PER_SECOND
*
2
);
/* mount sd card fat partition 1 as root directory */
if
(
MMCSD_HOST_PLUGED
==
mmcsd_wait_cd_changed
(
RT_TICK_PER_SECOND
*
2
))
{
/* mount sd card fat partition 1 as root directory */
if
(
dfs_mount
(
"sd0"
,
"/"
,
"elm"
,
0
,
0
)
==
0
)
{
rt_kprintf
(
"File System initialized!
\n
"
);
}
else
rt_kprintf
(
"File System initialzation failed!%d
\n
"
,
rt_get_errno
());
}
#endif
}
#endif
#ifdef RT_USING_LWIP
{
/* register ethernetif device */
eth_system_device_init
();
rt_hw_davinci_emac_init
();
/* init lwip system */
lwip_system_init
();
}
#endif
}
/* put user application code here */
void
rt_led_thread_entry
(
void
*
parameter
)
{
while
(
1
)
{
/* light on leds for one second */
rt_thread_delay
(
100
);
/* light off leds for one second */
rt_thread_delay
(
100
);
}
}
int
rt_application_init
()
{
rt_thread_t
init_thread
;
#ifdef RT_USING_LED
rt_thread_t
led_thread
;
#endif
#if (RT_THREAD_PRIORITY_MAX == 32)
init_thread
=
rt_thread_create
(
"init"
,
rt_init_thread_entry
,
RT_NULL
,
RT_INIT_THREAD_STACK_SIZE
,
8
,
20
);
#ifdef RT_USING_LED
led_thread
=
rt_thread_create
(
"led"
,
rt_led_thread_entry
,
RT_NULL
,
512
,
20
,
20
);
#endif
#else
init_thread
=
rt_thread_create
(
"init"
,
rt_init_thread_entry
,
RT_NULL
,
RT_INIT_THREAD_STACK_SIZE
,
80
,
20
);
#ifdef RT_USING_LED
led_thread
=
rt_thread_create
(
"led"
,
rt_led_thread_entry
,
RT_NULL
,
512
,
200
,
20
);
#endif
#endif
if
(
init_thread
!=
RT_NULL
)
rt_thread_startup
(
init_thread
);
#ifdef RT_USING_LED
if
(
led_thread
!=
RT_NULL
)
rt_thread_startup
(
led_thread
);
#endif
return
0
;
}
/* NFSv3 Initialization */
#if defined(RT_USING_DFS) && defined(RT_USING_LWIP) && defined(RT_USING_DFS_NFS)
...
...
bsp/dm365/applications/board.c
浏览文件 @
dd5ac17f
...
...
@@ -32,6 +32,19 @@
* @addtogroup dm365
*/
/*@{*/
#if defined(__CC_ARM)
extern
int
Image
$$
ER_ZI
$$
ZI
$$
Base
;
extern
int
Image
$$
ER_ZI
$$
ZI
$$
Length
;
extern
int
Image
$$
ER_ZI
$$
ZI
$$
Limit
;
#elif (defined (__GNUC__))
rt_uint8_t
_irq_stack_start
[
1024
];
rt_uint8_t
_fiq_stack_start
[
1024
];
rt_uint8_t
_undefined_stack_start
[
512
];
rt_uint8_t
_abort_stack_start
[
512
];
rt_uint8_t
_svc_stack_start
[
1024
]
SECTION
(
".nobss"
);
extern
unsigned
char
__bss_start
;
extern
unsigned
char
__bss_end
;
#endif
extern
void
rt_hw_clock_init
(
void
);
extern
void
rt_hw_uart_init
(
void
);
...
...
@@ -99,8 +112,10 @@ void rt_hw_board_init()
//rt_hw_clock_init();
davinci_clk_init
();
/* initialize uart */
rt_hw_uart_init
();
/* initialize early device */
#ifdef RT_USING_COMPONENTS_INIT
rt_components_board_init
();
#endif
#ifdef RT_USING_CONSOLE
rt_console_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
...
...
@@ -108,6 +123,13 @@ void rt_hw_board_init()
/* initialize mmu */
rt_hw_mmu_init
(
dm365_mem_desc
,
sizeof
(
dm365_mem_desc
)
/
sizeof
(
dm365_mem_desc
[
0
]));
/* initialize heap memory system */
#ifdef __CC_ARM
rt_system_heap_init
((
void
*
)
&
Image
$$
ER_ZI
$$
ZI
$$
Limit
,
(
void
*
)
0x88000000
);
#else
rt_system_heap_init
((
void
*
)
&
__bss_end
,
(
void
*
)
0x88000000
);
#endif
/* initialize timer0 */
rt_hw_timer_init
();
...
...
bsp/dm365/applications/startup.c
已删除
100644 → 0
浏览文件 @
121b72df
/*
* File : startup.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, 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
* 2011-01-13 weety first version
*/
#include <rthw.h>
#include <rtthread.h>
#include <dm36x.h>
#ifdef RT_USING_FINSH
#include <finsh.h>
#endif
extern
void
rt_hw_interrupt_init
(
void
);
extern
void
rt_hw_board_init
(
void
);
extern
void
rt_serial_init
(
void
);
extern
void
rt_system_timer_init
(
void
);
extern
void
rt_system_scheduler_init
(
void
);
extern
void
rt_thread_idle_init
(
void
);
extern
void
rt_hw_cpu_icache_enable
(
void
);
extern
void
rt_show_version
(
void
);
extern
void
rt_system_heap_init
(
void
*
,
void
*
);
extern
void
rt_hw_finsh_init
(
void
);
extern
void
rt_application_init
(
void
);
/**
* @addtogroup dm365
*/
/*@{*/
#if defined(__CC_ARM)
extern
int
Image
$$
ER_ZI
$$
ZI
$$
Base
;
extern
int
Image
$$
ER_ZI
$$
ZI
$$
Length
;
extern
int
Image
$$
ER_ZI
$$
ZI
$$
Limit
;
#elif (defined (__GNUC__))
rt_uint8_t
_irq_stack_start
[
1024
];
rt_uint8_t
_fiq_stack_start
[
1024
];
rt_uint8_t
_undefined_stack_start
[
512
];
rt_uint8_t
_abort_stack_start
[
512
];
rt_uint8_t
_svc_stack_start
[
1024
]
SECTION
(
".nobss"
);
extern
unsigned
char
__bss_start
;
extern
unsigned
char
__bss_end
;
#endif
#ifdef RT_USING_FINSH
extern
int
finsh_system_init
(
void
);
#endif
/**
* This function will startup RT-Thread RTOS.
*/
void
rtthread_startup
(
void
)
{
/* enable cpu cache */
//rt_hw_cpu_icache_enable();
//rt_hw_cpu_dcache_enable();
/* initialize hardware interrupt */
rt_hw_interrupt_init
();
/* initialize board */
rt_hw_board_init
();
/* show version */
rt_show_version
();
/* initialize tick */
rt_system_tick_init
();
/* initialize kernel object */
rt_system_object_init
();
/* initialize timer system */
rt_system_timer_init
();
/* initialize heap memory system */
#ifdef __CC_ARM
rt_system_heap_init
((
void
*
)
&
Image
$$
ER_ZI
$$
ZI
$$
Limit
,
(
void
*
)
0x88000000
);
#else
rt_system_heap_init
((
void
*
)
&
__bss_end
,
(
void
*
)
0x88000000
);
#endif
#ifdef RT_USING_MODULE
/* initialize module system*/
rt_system_module_init
();
#endif
/* initialize scheduler system */
rt_system_scheduler_init
();
/* initialize application */
rt_application_init
();
#ifdef RT_USING_FINSH
/* initialize finsh */
finsh_system_init
();
#ifdef RT_USING_DEVICE
finsh_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
#endif
/* initialize system timer thread */
rt_system_timer_thread_init
();
/* initialize idle thread */
rt_thread_idle_init
();
/* start scheduler */
rt_system_scheduler_start
();
/* never reach here */
return
;
}
int
main
(
void
)
{
rt_uint32_t
RT_UNUSED
level
;
/* disable interrupt first */
level
=
rt_hw_interrupt_disable
();
/* startup RT-Thread RTOS */
rtthread_startup
();
return
0
;
}
/*@}*/
bsp/dm365/dm365_ram.ld
浏览文件 @
dd5ac17f
...
...
@@ -28,6 +28,14 @@ SECTIONS
__rtmsymtab_start = .;
KEEP(*(RTMSymTab))
__rtmsymtab_end = .;
. = ALIGN(4);
/* section information for initial. */
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
}
. = ALIGN(4);
...
...
bsp/dm365/drivers/davinci_emac.c
浏览文件 @
dd5ac17f
...
...
@@ -1698,6 +1698,8 @@ void rt_hw_davinci_emac_init()
}
INIT_DEVICE_EXPORT
(
rt_hw_davinci_emac_init
);
#ifdef RT_USING_FINSH
#include <finsh.h>
...
...
bsp/dm365/drivers/davinci_serial.c
浏览文件 @
dd5ac17f
...
...
@@ -223,7 +223,7 @@ void davinci_uart1_init(void)
/**
* This function will handle init uart
*/
void
rt_hw_uart_init
(
void
)
int
rt_hw_uart_init
(
void
)
{
davinci_serial_dev0
.
ops
=
&
davinci_uart_ops
;
//davinci_serial_dev0.config = RT_SERIAL_CONFIG_DEFAULT;
...
...
@@ -257,5 +257,8 @@ void rt_hw_uart_init(void)
UART1
);
davinci_uart1_init
();
return
0
;
}
INIT_BOARD_EXPORT
(
rt_hw_uart_init
);
bsp/dm365/drivers/i2c-davinci.c
浏览文件 @
dd5ac17f
...
...
@@ -647,4 +647,10 @@ err:
return
r
;
}
int
rt_hw_iic_init
(
void
)
{
davinci_i2c_init
(
"I2C1"
);
}
INIT_DEVICE_EXPORT
(
rt_hw_iic_init
);
bsp/dm365/rtconfig.h
浏览文件 @
dd5ac17f
...
...
@@ -267,4 +267,7 @@
* #define RT_DFS_ELM_MAX_LFN 128
*/
#define RT_USING_COMPONENTS_INIT
#define RT_USING_USER_MAIN
#endif
components/drivers/include/drivers/mmcsd_core.h
浏览文件 @
dd5ac17f
...
...
@@ -247,9 +247,9 @@ void mmcsd_change(struct rt_mmcsd_host *host);
void
mmcsd_detect
(
void
*
param
);
struct
rt_mmcsd_host
*
mmcsd_alloc_host
(
void
);
void
mmcsd_free_host
(
struct
rt_mmcsd_host
*
host
);
void
rt_mmcsd_core_init
(
void
);
int
rt_mmcsd_core_init
(
void
);
void
rt_mmcsd_blk_init
(
void
);
int
rt_mmcsd_blk_init
(
void
);
rt_int32_t
rt_mmcsd_blk_probe
(
struct
rt_mmcsd_card
*
card
);
void
rt_mmcsd_blk_remove
(
struct
rt_mmcsd_card
*
card
);
...
...
components/drivers/sdio/block_dev.c
浏览文件 @
dd5ac17f
...
...
@@ -479,7 +479,11 @@ void rt_mmcsd_blk_remove(struct rt_mmcsd_card *card)
* @deprecated since 2.1.0, this function does not need to be invoked
* in the system initialization.
*/
void
rt_mmcsd_blk_init
(
void
)
int
rt_mmcsd_blk_init
(
void
)
{
/* nothing */
return
0
;
}
INIT_PREV_EXPORT
(
rt_mmcsd_blk_init
);
components/drivers/sdio/mmcsd_core.c
浏览文件 @
dd5ac17f
...
...
@@ -655,6 +655,7 @@ void mmcsd_detect(void *param)
if
(
init_sd
(
host
,
ocr
))
mmcsd_power_off
(
host
);
mmcsd_host_unlock
(
host
);
rt_mb_send
(
&
mmcsd_hotpluge_mb
,
(
rt_uint32_t
)
host
);
continue
;
}
...
...
@@ -726,7 +727,7 @@ void mmcsd_free_host(struct rt_mmcsd_host *host)
rt_free
(
host
);
}
void
rt_mmcsd_core_init
(
void
)
int
rt_mmcsd_core_init
(
void
)
{
rt_err_t
ret
;
...
...
@@ -749,5 +750,9 @@ void rt_mmcsd_core_init(void)
}
rt_sdio_init
();
return
0
;
}
INIT_PREV_EXPORT
(
rt_mmcsd_core_init
);
components/drivers/sdio/sdio.c
浏览文件 @
dd5ac17f
...
...
@@ -33,8 +33,8 @@
#define RT_SDIO_THREAD_PRIORITY 0x40
#endif
static
rt_list_t
sdio_cards
;
static
rt_list_t
sdio_drivers
;
static
rt_list_t
sdio_cards
=
RT_LIST_OBJECT_INIT
(
sdio_cards
)
;
static
rt_list_t
sdio_drivers
=
RT_LIST_OBJECT_INIT
(
sdio_drivers
)
;
struct
sdio_card
{
...
...
@@ -1397,7 +1397,6 @@ rt_int32_t sdio_unregister_driver(struct rt_sdio_driver *driver)
void
rt_sdio_init
(
void
)
{
rt_list_init
(
&
sdio_cards
);
rt_list_init
(
&
sdio_drivers
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录