Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
码肥人壮
rt-thread
提交
f6c8e391
R
rt-thread
项目概览
码肥人壮
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f6c8e391
编写于
8月 01, 2014
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #309 from BernardXiong/stable-v1.2.x
prepare RT-Thread 1.2.2 release
上级
350b1080
ea598b9a
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
96 addition
and
56 deletion
+96
-56
bsp/beaglebone/drivers/serial.c
bsp/beaglebone/drivers/serial.c
+2
-2
bsp/stm32f40x/drivers/usart.c
bsp/stm32f40x/drivers/usart.c
+2
-2
components/dfs/src/dfs_file.c
components/dfs/src/dfs_file.c
+9
-1
components/libc/newlib/syscalls.c
components/libc/newlib/syscalls.c
+8
-0
components/pthreads/pthread_cond.c
components/pthreads/pthread_cond.c
+5
-1
libcpu/arm/cortex-m0/context_gcc.S
libcpu/arm/cortex-m0/context_gcc.S
+4
-4
libcpu/arm/cortex-m0/context_iar.S
libcpu/arm/cortex-m0/context_iar.S
+4
-4
libcpu/arm/cortex-m0/context_rvds.S
libcpu/arm/cortex-m0/context_rvds.S
+4
-4
libcpu/arm/cortex-m3/context_gcc.S
libcpu/arm/cortex-m3/context_gcc.S
+4
-4
libcpu/arm/cortex-m3/context_iar.S
libcpu/arm/cortex-m3/context_iar.S
+4
-4
libcpu/arm/cortex-m3/context_rvds.S
libcpu/arm/cortex-m3/context_rvds.S
+4
-4
libcpu/arm/cortex-m4/context_gcc.S
libcpu/arm/cortex-m4/context_gcc.S
+4
-4
libcpu/arm/cortex-m4/context_iar.S
libcpu/arm/cortex-m4/context_iar.S
+4
-4
libcpu/arm/cortex-m4/context_rvds.S
libcpu/arm/cortex-m4/context_rvds.S
+4
-4
src/idle.c
src/idle.c
+1
-1
tools/building.py
tools/building.py
+33
-13
未找到文件。
bsp/beaglebone/drivers/serial.c
浏览文件 @
f6c8e391
...
...
@@ -426,7 +426,7 @@ int rt_hw_serial_init(void)
config
.
stop_bits
=
STOP_BITS_1
;
config
.
invert
=
NRZ_NORMAL
;
serial3
.
ops
=
&
am33xx_uart_ops
;
serial3
.
int_rx
=
&
uart
_
3_int_rx
;
serial3
.
int_rx
=
&
uart3_int_rx
;
serial3
.
config
=
config
;
/* enable RX interrupt */
UART_IER_REG
(
uart3
.
base
)
=
0x01
;
...
...
@@ -470,7 +470,7 @@ int rt_hw_serial_init(void)
config
.
parity
=
PARITY_NONE
;
config
.
stop_bits
=
STOP_BITS_1
;
config
.
invert
=
NRZ_NORMAL
;
serial5
.
ops
=
&
am33xx_uart_ops
;
serial5
.
int_rx
=
&
uart5_int_rx
;
serial5
.
config
=
config
;
...
...
bsp/stm32f40x/drivers/usart.c
浏览文件 @
f6c8e391
...
...
@@ -165,8 +165,8 @@ static void GPIO_Configuration(void)
GPIO_Init
(
UART3_GPIO
,
&
GPIO_InitStructure
);
/* Connect alternate function */
GPIO_PinAFConfig
(
UART
2
_GPIO
,
UART3_TX_PIN_SOURCE
,
GPIO_AF_USART3
);
GPIO_PinAFConfig
(
UART
2
_GPIO
,
UART3_RX_PIN_SOURCE
,
GPIO_AF_USART3
);
GPIO_PinAFConfig
(
UART
3
_GPIO
,
UART3_TX_PIN_SOURCE
,
GPIO_AF_USART3
);
GPIO_PinAFConfig
(
UART
3
_GPIO
,
UART3_RX_PIN_SOURCE
,
GPIO_AF_USART3
);
#endif
}
...
...
components/dfs/src/dfs_file.c
浏览文件 @
f6c8e391
...
...
@@ -629,7 +629,15 @@ static void copyfile(const char *src, const char *dst)
read_bytes
=
dfs_file_read
(
&
src_fd
,
block_ptr
,
BUF_SZ
);
if
(
read_bytes
>
0
)
{
dfs_file_write
(
&
fd
,
block_ptr
,
read_bytes
);
int
length
;
length
=
dfs_file_write
(
&
fd
,
block_ptr
,
read_bytes
);
if
(
length
!=
read_bytes
)
{
/* write failed. */
rt_kprintf
(
"Write file data failed, errno=%d
\n
"
,
length
);
break
;
}
}
}
while
(
read_bytes
>
0
);
...
...
components/libc/newlib/syscalls.c
浏览文件 @
f6c8e391
...
...
@@ -3,6 +3,14 @@
#include <sys/time.h>
#include <rtthread.h>
#ifdef RT_USING_DFS
#include <dfs_posix.h>
#endif
#ifdef RT_USING_PTHREADS
#include <pthread.h>
#endif
/* Reentrant versions of system calls. */
int
...
...
components/pthreads/pthread_cond.c
浏览文件 @
f6c8e391
...
...
@@ -98,7 +98,11 @@ int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
rt_snprintf
(
cond_name
,
sizeof
(
cond_name
),
"cond%02d"
,
cond_num
++
);
cond
->
attr
=
*
attr
;
if
(
attr
==
RT_NULL
)
/* use default value */
cond
->
attr
=
PTHREAD_PROCESS_PRIVATE
;
else
cond
->
attr
=
*
attr
;
result
=
rt_sem_init
(
&
cond
->
sem
,
cond_name
,
0
,
RT_IPC_FLAG_FIFO
);
if
(
result
!=
RT_EOK
)
return
EINVAL
;
...
...
libcpu/arm/cortex-m0/context_gcc.S
浏览文件 @
f6c8e391
...
...
@@ -79,8 +79,8 @@ _reswitch:
STR
R1
,
[
R0
]
BX
LR
/*
R0
-->
swith
from
thread
stack
*
R1
-->
swith
to
thread
stack
/*
R0
-->
swit
c
h
from
thread
stack
*
R1
-->
swit
c
h
to
thread
stack
*
psr
,
pc
,
LR
,
R12
,
R3
,
R2
,
R1
,
R0
are
pushed
into
[
from
]
stack
*/
.
global
PendSV_Handler
...
...
@@ -103,7 +103,7 @@ PendSV_Handler:
LDR
R0
,
=
rt_interrupt_from_thread
LDR
R1
,
[
R0
]
CMP
R1
,
#
0x00
BEQ
sw
ti
ch_to_thread
/*
skip
register
save
at
the
first
time
*/
BEQ
sw
it
ch_to_thread
/*
skip
register
save
at
the
first
time
*/
MRS
R1
,
PSP
/*
get
from
thread
stack
pointer
*/
...
...
@@ -118,7 +118,7 @@ PendSV_Handler:
MOV
R6
,
R10
MOV
R7
,
R11
STMIA
R1
!,
{
R4
-
R7
}
/*
push
thread
{
R8
-
R11
}
high
register
to
thread
stack
*/
sw
ti
ch_to_thread
:
sw
it
ch_to_thread
:
LDR
R1
,
=
rt_interrupt_to_thread
LDR
R1
,
[
R1
]
LDR
R1
,
[
R1
]
/*
load
thread
stack
pointer
*/
...
...
libcpu/arm/cortex-m0/context_iar.S
浏览文件 @
f6c8e391
...
...
@@ -81,8 +81,8 @@ _reswitch
STR
r1
,
[
r0
]
BX
LR
; r0 --> swith from thread stack
; r1 --> swith to thread stack
; r0 --> swit
c
h from thread stack
; r1 --> swit
c
h to thread stack
; psr, pc, lr, r12, r3, r2, r1, r0 are pushed into [from] stack
EXPORT
PendSV_Handler
PendSV_Handler
:
...
...
@@ -104,7 +104,7 @@ PendSV_Handler:
LDR
r0
,
=
rt_interrupt_from_thread
LDR
r1
,
[
r0
]
CMP
r1
,
#
0x00
BEQ
sw
ti
ch_to_thread
; skip register save at the first time
BEQ
sw
it
ch_to_thread
; skip register save at the first time
MRS
r1
,
psp
; get from thread stack pointer
...
...
@@ -120,7 +120,7 @@ PendSV_Handler:
MOV
r7
,
r11
STMIA
r1
!,
{
r4
-
r7
}
; push thread {r8 - r11} high register to thread stack
sw
ti
ch_to_thread
sw
it
ch_to_thread
LDR
r1
,
=
rt_interrupt_to_thread
LDR
r1
,
[
r1
]
LDR
r1
,
[
r1
]
; load thread stack pointer
...
...
libcpu/arm/cortex-m0/context_rvds.S
浏览文件 @
f6c8e391
...
...
@@ -85,8 +85,8 @@ _reswitch
BX
LR
ENDP
; r0 --> swith from thread stack
; r1 --> swith to thread stack
; r0 --> swit
c
h from thread stack
; r1 --> swit
c
h to thread stack
; psr, pc, lr, r12, r3, r2, r1, r0 are pushed into [from] stack
PendSV_Handler
PROC
EXPORT
PendSV_Handler
...
...
@@ -108,7 +108,7 @@ PendSV_Handler PROC
LDR
r0
,
=
rt_interrupt_from_thread
LDR
r1
,
[
r0
]
CMP
r1
,
#
0x00
BEQ
sw
ti
ch_to_thread
; skip register save at the first time
BEQ
sw
it
ch_to_thread
; skip register save at the first time
MRS
r1
,
psp
; get from thread stack pointer
...
...
@@ -124,7 +124,7 @@ PendSV_Handler PROC
MOV
r7
,
r11
STMIA
r1
!,
{
r4
-
r7
}
; push thread {r8 - r11} high register to thread stack
sw
ti
ch_to_thread
sw
it
ch_to_thread
LDR
r1
,
=
rt_interrupt_to_thread
LDR
r1
,
[
r1
]
LDR
r1
,
[
r1
]
; load thread stack pointer
...
...
libcpu/arm/cortex-m3/context_gcc.S
浏览文件 @
f6c8e391
...
...
@@ -80,8 +80,8 @@ _reswitch:
STR
R1
,
[
R0
]
BX
LR
/*
R0
-->
swith
from
thread
stack
*
R1
-->
swith
to
thread
stack
/*
R0
-->
swit
c
h
from
thread
stack
*
R1
-->
swit
c
h
to
thread
stack
*
psr
,
pc
,
LR
,
R12
,
R3
,
R2
,
R1
,
R0
are
pushed
into
[
from
]
stack
*/
.
global
PendSV_Handler
...
...
@@ -102,14 +102,14 @@ PendSV_Handler:
LDR
R0
,
=
rt_interrupt_from_thread
LDR
R1
,
[
R0
]
CBZ
R1
,
sw
ti
ch_to_thread
/*
skip
register
save
at
the
first
time
*/
CBZ
R1
,
sw
it
ch_to_thread
/*
skip
register
save
at
the
first
time
*/
MRS
R1
,
PSP
/*
get
from
thread
stack
pointer
*/
STMFD
R1
!,
{
R4
-
R11
}
/*
push
R4
-
R11
register
*/
LDR
R0
,
[
R0
]
STR
R1
,
[
R0
]
/*
update
from
thread
stack
pointer
*/
sw
ti
ch_to_thread
:
sw
it
ch_to_thread
:
LDR
R1
,
=
rt_interrupt_to_thread
LDR
R1
,
[
R1
]
LDR
R1
,
[
R1
]
/*
load
thread
stack
pointer
*/
...
...
libcpu/arm/cortex-m3/context_iar.S
浏览文件 @
f6c8e391
...
...
@@ -81,8 +81,8 @@ _reswitch
STR
r1
,
[
r0
]
BX
LR
; r0 --> swith from thread stack
; r1 --> swith to thread stack
; r0 --> swit
c
h from thread stack
; r1 --> swit
c
h to thread stack
; psr, pc, lr, r12, r3, r2, r1, r0 are pushed into [from] stack
EXPORT
PendSV_Handler
PendSV_Handler
:
...
...
@@ -102,14 +102,14 @@ PendSV_Handler:
LDR
r0
,
=
rt_interrupt_from_thread
LDR
r1
,
[
r0
]
CBZ
r1
,
sw
ti
ch_to_thread
; skip register save at the first time
CBZ
r1
,
sw
it
ch_to_thread
; skip register save at the first time
MRS
r1
,
psp
; get from thread stack pointer
STMFD
r1
!,
{
r4
-
r11
}
; push r4 - r11 register
LDR
r0
,
[
r0
]
STR
r1
,
[
r0
]
; update from thread stack pointer
sw
ti
ch_to_thread
sw
it
ch_to_thread
LDR
r1
,
=
rt_interrupt_to_thread
LDR
r1
,
[
r1
]
LDR
r1
,
[
r1
]
; load thread stack pointer
...
...
libcpu/arm/cortex-m3/context_rvds.S
浏览文件 @
f6c8e391
...
...
@@ -84,8 +84,8 @@ _reswitch
BX
LR
ENDP
; r0 --> swith from thread stack
; r1 --> swith to thread stack
; r0 --> swit
c
h from thread stack
; r1 --> swit
c
h to thread stack
; psr, pc, lr, r12, r3, r2, r1, r0 are pushed into [from] stack
PendSV_Handler
PROC
EXPORT
PendSV_Handler
...
...
@@ -105,14 +105,14 @@ PendSV_Handler PROC
LDR
r0
,
=
rt_interrupt_from_thread
LDR
r1
,
[
r0
]
CBZ
r1
,
sw
ti
ch_to_thread
; skip register save at the first time
CBZ
r1
,
sw
it
ch_to_thread
; skip register save at the first time
MRS
r1
,
psp
; get from thread stack pointer
STMFD
r1
!,
{
r4
-
r11
}
; push r4 - r11 register
LDR
r0
,
[
r0
]
STR
r1
,
[
r0
]
; update from thread stack pointer
sw
ti
ch_to_thread
sw
it
ch_to_thread
LDR
r1
,
=
rt_interrupt_to_thread
LDR
r1
,
[
r1
]
LDR
r1
,
[
r1
]
; load thread stack pointer
...
...
libcpu/arm/cortex-m4/context_gcc.S
浏览文件 @
f6c8e391
...
...
@@ -82,8 +82,8 @@ _reswitch:
STR
r1
,
[
r0
]
BX
LR
/*
r0
-->
swith
from
thread
stack
*
r1
-->
swith
to
thread
stack
/*
r0
-->
swit
c
h
from
thread
stack
*
r1
-->
swit
c
h
to
thread
stack
*
psr
,
pc
,
lr
,
r12
,
r3
,
r2
,
r1
,
r0
are
pushed
into
[
from
]
stack
*/
.
global
PendSV_Handler
...
...
@@ -104,7 +104,7 @@ PendSV_Handler:
LDR
r0
,
=
rt_interrupt_from_thread
LDR
r1
,
[
r0
]
CBZ
r1
,
sw
ti
ch_to_thread
/*
skip
register
save
at
the
first
time
*/
CBZ
r1
,
sw
it
ch_to_thread
/*
skip
register
save
at
the
first
time
*/
MRS
r1
,
psp
/*
get
from
thread
stack
pointer
*/
...
...
@@ -127,7 +127,7 @@ PendSV_Handler:
LDR
r0
,
[
r0
]
STR
r1
,
[
r0
]
/*
update
from
thread
stack
pointer
*/
sw
ti
ch_to_thread
:
sw
it
ch_to_thread
:
LDR
r1
,
=
rt_interrupt_to_thread
LDR
r1
,
[
r1
]
LDR
r1
,
[
r1
]
/*
load
thread
stack
pointer
*/
...
...
libcpu/arm/cortex-m4/context_iar.S
浏览文件 @
f6c8e391
...
...
@@ -82,8 +82,8 @@ _reswitch
STR
r1
,
[
r0
]
BX
LR
; r0 --> swith from thread stack
; r1 --> swith to thread stack
; r0 --> swit
c
h from thread stack
; r1 --> swit
c
h to thread stack
; psr, pc, lr, r12, r3, r2, r1, r0 are pushed into [from] stack
EXPORT
PendSV_Handler
PendSV_Handler
:
...
...
@@ -103,7 +103,7 @@ PendSV_Handler:
LDR
r0
,
=
rt_interrupt_from_thread
LDR
r1
,
[
r0
]
CBZ
r1
,
sw
ti
ch_to_thread
; skip register save at the first time
CBZ
r1
,
sw
it
ch_to_thread
; skip register save at the first time
MRS
r1
,
psp
; get from thread stack pointer
...
...
@@ -130,7 +130,7 @@ push_flag
LDR
r0
,
[
r0
]
STR
r1
,
[
r0
]
; update from thread stack pointer
sw
ti
ch_to_thread
sw
it
ch_to_thread
LDR
r1
,
=
rt_interrupt_to_thread
LDR
r1
,
[
r1
]
LDR
r1
,
[
r1
]
; load thread stack pointer
...
...
libcpu/arm/cortex-m4/context_rvds.S
浏览文件 @
f6c8e391
...
...
@@ -85,8 +85,8 @@ _reswitch
BX
LR
ENDP
; r0 --> swith from thread stack
; r1 --> swith to thread stack
; r0 --> swit
c
h from thread stack
; r1 --> swit
c
h to thread stack
; psr, pc, lr, r12, r3, r2, r1, r0 are pushed into [from] stack
PendSV_Handler
PROC
EXPORT
PendSV_Handler
...
...
@@ -106,7 +106,7 @@ PendSV_Handler PROC
LDR
r0
,
=
rt_interrupt_from_thread
LDR
r1
,
[
r0
]
CBZ
r1
,
sw
ti
ch_to_thread
; skip register save at the first time
CBZ
r1
,
sw
it
ch_to_thread
; skip register save at the first time
MRS
r1
,
psp
; get from thread stack pointer
...
...
@@ -129,7 +129,7 @@ PendSV_Handler PROC
LDR
r0
,
[
r0
]
STR
r1
,
[
r0
]
; update from thread stack pointer
sw
ti
ch_to_thread
sw
it
ch_to_thread
LDR
r1
,
=
rt_interrupt_to_thread
LDR
r1
,
[
r1
]
LDR
r1
,
[
r1
]
; load thread stack pointer
...
...
src/idle.c
浏览文件 @
f6c8e391
...
...
@@ -180,7 +180,7 @@ static void rt_thread_idle_entry(void *parameter)
}
/**
* @ingroup Sy
m
stemInit
* @ingroup SystemInit
*
* This function will initialize idle thread, then start it.
*
...
...
tools/building.py
浏览文件 @
f6c8e391
...
...
@@ -12,24 +12,44 @@ Env = None
class
Win32Spawn
:
def
spawn
(
self
,
sh
,
escape
,
cmd
,
args
,
env
):
# deal with the cmd build-in commands which cannot be used in
# subprocess.Popen
if
cmd
==
'del'
:
for
f
in
args
[
1
:]:
try
:
os
.
remove
(
f
)
except
Exception
as
e
:
print
'Error removing file: %s'
%
e
return
-
1
return
0
import
subprocess
newargs
=
string
.
join
(
args
[
1
:],
' '
)
cmdline
=
cmd
+
" "
+
newargs
startupinfo
=
subprocess
.
STARTUPINFO
()
startupinfo
.
dwFlags
|=
subprocess
.
STARTF_USESHOWWINDOW
# Make sure the env is constructed by strings
_e
=
{
k
:
str
(
v
)
for
k
,
v
in
env
.
items
()}
proc
=
subprocess
.
Popen
(
cmdline
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
startupinfo
=
startupinfo
,
shell
=
False
)
data
,
err
=
proc
.
communicate
()
rv
=
proc
.
wait
()
if
data
:
print
data
if
err
:
print
err
# Windows(tm) CreateProcess does not use the env passed to it to find
# the executables. So we have to modify our own PATH to make Popen
# work.
old_path
=
os
.
environ
[
'PATH'
]
os
.
environ
[
'PATH'
]
=
_e
[
'PATH'
]
try
:
proc
=
subprocess
.
Popen
(
cmdline
,
env
=
_e
,
startupinfo
=
startupinfo
,
shell
=
False
)
except
Exception
as
e
:
print
'Error in calling:
\n
%s'
%
cmdline
print
'Exception: %s: %s'
%
(
e
,
os
.
strerror
(
e
.
errno
))
return
e
.
errno
finally
:
os
.
environ
[
'PATH'
]
=
old_path
if
rv
:
return
rv
return
0
return
proc
.
wait
()
def
PrepareBuilding
(
env
,
root_directory
,
has_libcpu
=
False
,
remove_components
=
[]):
import
SCons.cpp
...
...
@@ -59,11 +79,11 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
env
[
'LIBDIRPREFIX'
]
=
'--userlibpath '
# patch for win32 spawn
if
env
[
'PLATFORM'
]
==
'win32'
and
rtconfig
.
PLATFORM
==
'gcc'
:
if
env
[
'PLATFORM'
]
==
'win32'
:
win32_spawn
=
Win32Spawn
()
win32_spawn
.
env
=
env
env
[
'SPAWN'
]
=
win32_spawn
.
spawn
if
env
[
'PLATFORM'
]
==
'win32'
:
os
.
environ
[
'PATH'
]
=
rtconfig
.
EXEC_PATH
+
";"
+
os
.
environ
[
'PATH'
]
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录