Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
959f6c69
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
959f6c69
编写于
1月 05, 2015
作者:
G
Grissiom
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lpc43xx: move the application code into its own space
上级
5542af8b
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
287 addition
and
17 deletion
+287
-17
bsp/lpc43xx/M0/SConscript
bsp/lpc43xx/M0/SConscript
+10
-6
bsp/lpc43xx/M0/applications/SConscript
bsp/lpc43xx/M0/applications/SConscript
+0
-0
bsp/lpc43xx/M0/applications/application.c
bsp/lpc43xx/M0/applications/application.c
+3
-2
bsp/lpc43xx/M0/applications/board.h
bsp/lpc43xx/M0/applications/board.h
+59
-0
bsp/lpc43xx/M0/applications/startup.c
bsp/lpc43xx/M0/applications/startup.c
+0
-0
bsp/lpc43xx/M0/rtconfig.h
bsp/lpc43xx/M0/rtconfig.h
+3
-1
bsp/lpc43xx/M4/SConscript
bsp/lpc43xx/M4/SConscript
+10
-6
bsp/lpc43xx/M4/applications/SConscript
bsp/lpc43xx/M4/applications/SConscript
+13
-0
bsp/lpc43xx/M4/applications/application.c
bsp/lpc43xx/M4/applications/application.c
+113
-0
bsp/lpc43xx/M4/applications/board.h
bsp/lpc43xx/M4/applications/board.h
+0
-1
bsp/lpc43xx/M4/applications/startup.c
bsp/lpc43xx/M4/applications/startup.c
+74
-0
bsp/lpc43xx/M4/rtconfig.h
bsp/lpc43xx/M4/rtconfig.h
+2
-1
未找到文件。
bsp/lpc43xx/M0/SConscript
浏览文件 @
959f6c69
...
...
@@ -2,12 +2,16 @@ from building import *
cwd
=
GetCurrentDir
()
objs
=
[]
list
=
os
.
listdir
(
os
.
path
.
join
(
cwd
,
'..'
))
for
d
in
list
:
if
(
d
!=
'M4'
and
d
!=
'M0'
):
path
=
os
.
path
.
join
(
cwd
,
'..'
,
d
)
if
os
.
path
.
isfile
(
os
.
path
.
join
(
path
,
'SConscript'
)):
objs
=
objs
+
SConscript
(
os
.
path
.
join
(
path
,
'SConscript'
))
for
d
in
os
.
listdir
(
os
.
path
.
join
(
cwd
,
'..'
)):
if
d
not
in
(
'M0'
,
'M4'
):
path
=
os
.
path
.
join
(
cwd
,
'..'
,
d
,
'SConscript'
)
if
os
.
path
.
isfile
(
path
):
objs
=
objs
+
SConscript
(
path
)
for
d
in
os
.
listdir
(
cwd
):
p
=
os
.
path
.
join
(
cwd
,
d
,
'SConscript'
);
if
os
.
path
.
isfile
(
p
):
objs
=
objs
+
SConscript
(
p
)
Return
(
'objs'
)
bsp/lpc43xx/applications/SConscript
→
bsp/lpc43xx/
M0/
applications/SConscript
浏览文件 @
959f6c69
文件已移动
bsp/lpc43xx/applications/application.c
→
bsp/lpc43xx/
M0/
applications/application.c
浏览文件 @
959f6c69
...
...
@@ -49,12 +49,12 @@ static void led_thread_entry(void *parameter)
{
/* led0 on */
led_value
=
1
;
led_dev
->
write
(
led_dev
,
0
,
&
led_value
,
1
);
led_dev
->
write
(
led_dev
,
1
,
&
led_value
,
1
);
rt_thread_delay
(
RT_TICK_PER_SECOND
/
2
);
/* sleep 0.5 second and switch to other thread */
/* led0 off */
led_value
=
0
;
led_dev
->
write
(
led_dev
,
0
,
&
led_value
,
1
);
led_dev
->
write
(
led_dev
,
1
,
&
led_value
,
1
);
rt_thread_delay
(
RT_TICK_PER_SECOND
/
2
);
}
}
...
...
@@ -82,3 +82,4 @@ int rt_application_init(void)
}
return
0
;
}
bsp/lpc43xx/M0/applications/board.h
0 → 100644
浏览文件 @
959f6c69
/*
* File : board.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-09-22 Bernard add board.h to this bsp
* 2010-02-04 Magicoe add board.h to LPC176x bsp
* 2013-12-18 Bernard porting to LPC4088 bsp
*/
#ifndef __BOARD_H__
#define __BOARD_H__
#include "LPC43xx.h"
#include <rtthread.h>
/* disable SDRAM in default */
#ifndef LPC_EXT_SDRAM
#define LPC_EXT_SDRAM 0
#endif
// <RDTConfigurator URL="http://www.rt-thread.com/eclipse">
// <integer name="LPC_EXT_SDRAM" description="Begin Address of External SDRAM" default="0xA0000000" />
#define LPC_EXT_SDRAM_BEGIN 0xA0000000
// <integer name="LPC_EXT_SDRAM_END" description="End Address of External SDRAM" default="0xA2000000" />
#define LPC_EXT_SDRAM_END 0xA2000000
// <bool name="RT_USING_UART0" description="Using UART0" default="true" />
// <bool name="RT_USING_UART1" description="Using UART1" default="true" />
//#define RT_USING_UART1
// <bool name="RT_USING_UART2" description="Using UART2" default="true" />
//#define RT_USING_UART2
// </RDTConfigurator>
#ifdef __CC_ARM
extern
int
Image
$$
RW_IRAM2
$$
ZI
$$
Limit
;
#define HEAP_BEGIN ((void *)&Image$$RW_IRAM2$$ZI$$Limit)
#elif __ICCARM__
#pragma section="HEAP"
#define HEAP_BEGIN (__segment_end("HEAP"))
#else
extern
int
__bss_end
;
#define HEAP_BEGIN ((void *)&__bss_end)
#endif
#define HEAP_END (void*)(0x10080000 + 0x8000)
void
rt_hw_board_init
(
void
);
int
rt_hw_board_heap_init
(
void
);
#endif
bsp/lpc43xx/applications/startup.c
→
bsp/lpc43xx/
M0/
applications/startup.c
浏览文件 @
959f6c69
文件已移动
bsp/lpc43xx/M0/rtconfig.h
浏览文件 @
959f6c69
...
...
@@ -24,6 +24,7 @@
#define RT_DEBUG
// <bool name="RT_DEBUG_INIT" description="debug init enable" default=0 />
#define RT_DEBUG_INIT 0
//#define RT_DEBUG_SCHEDULER 1
// <bool name="RT_THREAD_DEBUG" description="Thread debug enable" default="false" />
// #define RT_THREAD_DEBUG
// <bool name="RT_USING_OVERFLOW_CHECK" description="Thread stack over flow detect" default="true" />
...
...
@@ -33,7 +34,7 @@
// <bool name="RT_USING_HOOK" description="Using hook functions" default="true" />
#define RT_USING_HOOK
// <section name="RT_USING_TIMER_SOFT" description="Using software timer which will start a thread to handle soft-timer" default="true" >
#define RT_USING_TIMER_SOFT
//
#define RT_USING_TIMER_SOFT
// <integer name="RT_TIMER_THREAD_PRIO" description="The priority level of timer thread" default="4" />
#define RT_TIMER_THREAD_PRIO 4
// <integer name="RT_TIMER_THREAD_STACK_SIZE" description="The stack size of timer thread" default="512" />
...
...
@@ -96,6 +97,7 @@
#define RT_CONSOLEBUF_SIZE 128
// <string name="RT_CONSOLE_DEVICE_NAME" description="The device name for console" default="uart" />
#define RT_CONSOLE_DEVICE_NAME "uart0"
#define RT_USING_UART0
// </section>
// <bool name="RT_USING_COMPONENTS_INIT" description="Using RT-Thread components initialization" default="true" />
...
...
bsp/lpc43xx/M4/SConscript
浏览文件 @
959f6c69
...
...
@@ -2,12 +2,16 @@ from building import *
cwd
=
GetCurrentDir
()
objs
=
[]
list
=
os
.
listdir
(
os
.
path
.
join
(
cwd
,
'..'
))
for
d
in
list
:
if
(
d
!=
'M4'
and
d
!=
'M0'
):
path
=
os
.
path
.
join
(
cwd
,
'..'
,
d
)
if
os
.
path
.
isfile
(
os
.
path
.
join
(
path
,
'SConscript'
)):
objs
=
objs
+
SConscript
(
os
.
path
.
join
(
path
,
'SConscript'
))
for
d
in
os
.
listdir
(
os
.
path
.
join
(
cwd
,
'..'
)):
if
d
not
in
(
'M0'
,
'M4'
):
path
=
os
.
path
.
join
(
cwd
,
'..'
,
d
,
'SConscript'
)
if
os
.
path
.
isfile
(
path
):
objs
=
objs
+
SConscript
(
path
)
for
d
in
os
.
listdir
(
cwd
):
p
=
os
.
path
.
join
(
cwd
,
d
,
'SConscript'
);
if
os
.
path
.
isfile
(
p
):
objs
=
objs
+
SConscript
(
p
)
Return
(
'objs'
)
bsp/lpc43xx/M4/applications/SConscript
0 → 100644
浏览文件 @
959f6c69
Import
(
'RTT_ROOT'
)
Import
(
'rtconfig'
)
from
building
import
*
cwd
=
os
.
path
.
join
(
str
(
Dir
(
'#'
)),
'applications'
)
src
=
Glob
(
'*.c'
)
CPPPATH
=
[
cwd
,
str
(
Dir
(
'#'
))]
group
=
DefineGroup
(
'Applications'
,
src
,
depend
=
[
''
],
CPPPATH
=
CPPPATH
,
CPPDEFINES
=
[
'BOOT_PROCESSOR'
])
Return
(
'group'
)
bsp/lpc43xx/M4/applications/application.c
0 → 100644
浏览文件 @
959f6c69
/*
* File : application.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2014, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2014-07-13 xiaonong port for lpc43xx
*/
#include <rtthread.h>
#include <board.h>
#include <rtdevice.h>
#include "drv_led.h"
#ifdef RT_USING_FINSH
#include <finsh.h>
#include <shell.h>
#endif
static
const
unsigned
char
_M0_CODE
[]
SECTION
(
"M0_CODE"
)
=
{
#include "M0_CODE.h"
};
static
void
_boot_M0
(
void
)
{
volatile
uint32_t
u32REG
,
u32Val
;
LPC_CREG
->
M0APPMEMMAP
=
(
uint32_t
)
&
_M0_CODE
[
0
];
// Release Slave from reset, first read status
u32REG
=
LPC_RGU
->
RESET_ACTIVE_STATUS1
;
// If the M0 is being held in reset, release it...
// 1 = no reset, 0 = reset
while
(
!
(
u32REG
&
(
1u
<<
24
)))
{
u32Val
=
(
~
(
u32REG
)
&
(
~
(
1
<<
24
)));
LPC_RGU
->
RESET_CTRL1
=
u32Val
;
u32REG
=
LPC_RGU
->
RESET_ACTIVE_STATUS1
;
}
rt_kprintf
(
"M0 boot to %p
\n
"
,
&
_M0_CODE
[
0
]);
}
/* thread phase init */
void
rt_init_thread_entry
(
void
*
parameter
)
{
#ifdef RT_USING_FINSH
/* initialize finsh */
finsh_system_init
();
finsh_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
_boot_M0
();
}
/*the led thread*/
ALIGN
(
RT_ALIGN_SIZE
)
static
rt_uint8_t
led_stack
[
512
];
static
struct
rt_thread
led_thread
;
static
void
led_thread_entry
(
void
*
parameter
)
{
rt_uint8_t
led_value
=
0
;
rt_device_t
led_dev
;
rt_led_hw_init
();
led_dev
=
rt_device_find
(
"led"
);
if
(
led_dev
==
RT_NULL
)
{
rt_kprintf
(
"can not find the led device!
\n
"
);
return
;
}
while
(
1
)
{
/* led0 on */
led_value
=
1
;
led_dev
->
write
(
led_dev
,
0
,
&
led_value
,
1
);
rt_thread_delay
(
RT_TICK_PER_SECOND
/
2
);
/* sleep 0.5 second and switch to other thread */
/* led0 off */
led_value
=
0
;
led_dev
->
write
(
led_dev
,
0
,
&
led_value
,
1
);
rt_thread_delay
(
RT_TICK_PER_SECOND
/
2
);
}
}
int
rt_application_init
(
void
)
{
rt_thread_t
tid
;
rt_err_t
result
;
tid
=
rt_thread_create
(
"init"
,
rt_init_thread_entry
,
RT_NULL
,
2048
,
RT_THREAD_PRIORITY_MAX
/
3
,
20
);
if
(
tid
!=
RT_NULL
)
rt_thread_startup
(
tid
);
/* 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
);
if
(
result
==
RT_EOK
)
{
rt_thread_startup
(
&
led_thread
);
}
return
0
;
}
bsp/lpc43xx/
driver
s/board.h
→
bsp/lpc43xx/
M4/application
s/board.h
浏览文件 @
959f6c69
...
...
@@ -33,7 +33,6 @@
#define LPC_EXT_SDRAM_END 0xA2000000
// <bool name="RT_USING_UART0" description="Using UART0" default="true" />
#define RT_USING_UART0
// <bool name="RT_USING_UART1" description="Using UART1" default="true" />
//#define RT_USING_UART1
// <bool name="RT_USING_UART2" description="Using UART2" default="true" />
...
...
bsp/lpc43xx/M4/applications/startup.c
0 → 100644
浏览文件 @
959f6c69
/*
* File : startup.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-01-05 Bernard first implementation
* 2014-07-13 xiaonong for LPC43xx
*/
#include <rthw.h>
#include <rtthread.h>
#include "board.h"
extern
int
rt_application_init
(
void
);
/**
* This function will startup RT-Thread RTOS.
*/
void
rtthread_startup
(
void
)
{
/* initialize board */
rt_hw_board_init
();
/* show version */
rt_show_version
();
#ifdef RT_USING_HEAP
#if LPC_EXT_SDRAM
rt_system_heap_init
((
void
*
)
LPC_EXT_SDRAM_BEGIN
,
(
void
*
)
LPC_EXT_SDRAM_END
);
sram_init
();
#else
rt_system_heap_init
((
void
*
)
HEAP_BEGIN
,
(
void
*
)
HEAP_END
);
#endif
#endif
/* initialize scheduler system */
rt_system_scheduler_init
();
/* initialize system timer*/
rt_system_timer_init
();
/* initialize application */
rt_application_init
();
/* initialize 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
)
{
/* disable interrupt first */
rt_hw_interrupt_disable
();
/* startup RT-Thread RTOS */
rtthread_startup
();
return
0
;
}
bsp/lpc43xx/M4/rtconfig.h
浏览文件 @
959f6c69
...
...
@@ -95,7 +95,8 @@
// <integer name="RT_CONSOLEBUF_SIZE" description="The buffer size for console output" default="128" />
#define RT_CONSOLEBUF_SIZE 128
// <string name="RT_CONSOLE_DEVICE_NAME" description="The device name for console" default="uart" />
#define RT_CONSOLE_DEVICE_NAME "uart0"
#define RT_CONSOLE_DEVICE_NAME "uart3"
#define RT_USING_UART3
// </section>
// <bool name="RT_USING_COMPONENTS_INIT" description="Using RT-Thread components initialization" default="true" />
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录