Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天中雨水
rt-thread
提交
98c72007
R
rt-thread
项目概览
天中雨水
/
rt-thread
该项目与 Fork 源项目分叉
Fork自
RT-Thread / rt-thread
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
98c72007
编写于
7月 18, 2021
作者:
mysterywolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[example] replace RT_IPC_FLAG_FIFO with RT_IPC_FLAG_PRIO
上级
6c5546cc
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
15 addition
and
15 deletion
+15
-15
examples/kernel/event_simple.c
examples/kernel/event_simple.c
+1
-1
examples/kernel/mbox_send_wait.c
examples/kernel/mbox_send_wait.c
+1
-1
examples/kernel/mbox_simple.c
examples/kernel/mbox_simple.c
+1
-1
examples/kernel/messageq_simple.c
examples/kernel/messageq_simple.c
+1
-1
examples/kernel/mutex_priority.c
examples/kernel/mutex_priority.c
+1
-1
examples/kernel/mutex_simple.c
examples/kernel/mutex_simple.c
+1
-1
examples/kernel/semaphore_buffer_worker.c
examples/kernel/semaphore_buffer_worker.c
+1
-1
examples/kernel/semaphore_dynamic.c
examples/kernel/semaphore_dynamic.c
+1
-1
examples/kernel/semaphore_producer_consumer.c
examples/kernel/semaphore_producer_consumer.c
+3
-3
examples/kernel/semaphore_static.c
examples/kernel/semaphore_static.c
+1
-1
examples/kernel/tc_comm.c
examples/kernel/tc_comm.c
+1
-1
examples/kernel/timer_timeout.c
examples/kernel/timer_timeout.c
+1
-1
examples/pm/wakeup_app.c
examples/pm/wakeup_app.c
+1
-1
未找到文件。
examples/kernel/event_simple.c
浏览文件 @
98c72007
...
...
@@ -83,7 +83,7 @@ static void thread3_entry(void *param)
int
event_simple_init
()
{
/* 初始化事件对象 */
rt_event_init
(
&
event
,
"event"
,
RT_IPC_FLAG_
FIF
O
);
rt_event_init
(
&
event
,
"event"
,
RT_IPC_FLAG_
PRI
O
);
/* 创建线程1 */
tid1
=
rt_thread_create
(
"t1"
,
...
...
examples/kernel/mbox_send_wait.c
浏览文件 @
98c72007
...
...
@@ -82,7 +82,7 @@ int mbox_send_wait_init()
"mbt"
,
/* 名称是mbt */
&
mb_pool
[
0
],
/* 邮箱用到的内存池是mb_pool */
sizeof
(
mb_pool
)
/
4
,
/* 大小是mb_pool大小除以4,因为一封邮件的大小是4字节 */
RT_IPC_FLAG_
FIFO
);
/* 采用FIF
O方式进行线程等待 */
RT_IPC_FLAG_
PRIO
);
/* 采用PRI
O方式进行线程等待 */
/* 创建线程1 */
tid1
=
rt_thread_create
(
"t1"
,
...
...
examples/kernel/mbox_simple.c
浏览文件 @
98c72007
...
...
@@ -80,7 +80,7 @@ int mbox_simple_init()
"mbt"
,
/* 名称是mbt */
&
mb_pool
[
0
],
/* 邮箱用到的内存池是mb_pool */
sizeof
(
mb_pool
)
/
4
,
/* 大小是mb_pool大小除以4,因为一封邮件的大小是4字节 */
RT_IPC_FLAG_
FIFO
);
/* 采用FIF
O方式进行线程等待 */
RT_IPC_FLAG_
PRIO
);
/* 采用PRI
O方式进行线程等待 */
/* 创建线程1 */
tid1
=
rt_thread_create
(
"t1"
,
...
...
examples/kernel/messageq_simple.c
浏览文件 @
98c72007
...
...
@@ -98,7 +98,7 @@ int messageq_simple_init()
&
msg_pool
[
0
],
/* 内存池指向msg_pool */
128
-
sizeof
(
void
*
),
/* 每个消息的大小是 128 - void* */
sizeof
(
msg_pool
),
/* 内存池的大小是msg_pool的大小 */
RT_IPC_FLAG_
FIFO
);
/* 如果有多个线程等待,按照先来先得到
的方法分配消息 */
RT_IPC_FLAG_
PRIO
);
/* 如果有多个线程等待,按照优先级由高到低
的方法分配消息 */
/* 创建线程1 */
tid1
=
rt_thread_create
(
"t1"
,
...
...
examples/kernel/mutex_priority.c
浏览文件 @
98c72007
...
...
@@ -281,7 +281,7 @@ static void thread29_entry(void* parameter)
static
int
mutex_simple_init
()
{
/* 创建互斥锁 */
mutex
=
rt_mutex_create
(
"mutex"
,
RT_IPC_FLAG_
FIF
O
);
mutex
=
rt_mutex_create
(
"mutex"
,
RT_IPC_FLAG_
PRI
O
);
if
(
mutex
==
RT_NULL
)
{
tc_stat
(
TC_STAT_END
|
TC_STAT_FAILED
);
...
...
examples/kernel/mutex_simple.c
浏览文件 @
98c72007
...
...
@@ -87,7 +87,7 @@ static void thread3_entry(void* parameter)
int
mutex_simple_init
()
{
/* 创建互斥锁 */
mutex
=
rt_mutex_create
(
"mutex"
,
RT_IPC_FLAG_
FIF
O
);
mutex
=
rt_mutex_create
(
"mutex"
,
RT_IPC_FLAG_
PRI
O
);
if
(
mutex
==
RT_NULL
)
{
tc_stat
(
TC_STAT_END
|
TC_STAT_FAILED
);
...
...
examples/kernel/semaphore_buffer_worker.c
浏览文件 @
98c72007
...
...
@@ -209,7 +209,7 @@ int semaphore_buffer_worker_init()
rb_init
(
&
working_rb
,
working_buffer
,
BUFFER_SIZE
);
/* 创建信号量 */
sem
=
rt_sem_create
(
"sem"
,
1
,
RT_IPC_FLAG_
FIF
O
);
sem
=
rt_sem_create
(
"sem"
,
1
,
RT_IPC_FLAG_
PRI
O
);
if
(
sem
==
RT_NULL
)
{
tc_stat
(
TC_STAT_END
|
TC_STAT_FAILED
);
...
...
examples/kernel/semaphore_dynamic.c
浏览文件 @
98c72007
...
...
@@ -78,7 +78,7 @@ static void thread_entry(void* parameter)
int
semaphore_dynamic_init
()
{
/* 创建一个信号量,初始值是0 */
sem
=
rt_sem_create
(
"sem"
,
0
,
RT_IPC_FLAG_
FIF
O
);
sem
=
rt_sem_create
(
"sem"
,
0
,
RT_IPC_FLAG_
PRI
O
);
if
(
sem
==
RT_NULL
)
{
tc_stat
(
TC_STAT_END
|
TC_STAT_FAILED
);
...
...
examples/kernel/semaphore_producer_consumer.c
浏览文件 @
98c72007
...
...
@@ -98,9 +98,9 @@ void consumer_thread_entry(void* parameter)
int
semaphore_producer_consumer_init
()
{
/* 初始化3个信号量 */
rt_sem_init
(
&
sem_lock
,
"lock"
,
1
,
RT_IPC_FLAG_
FIF
O
);
rt_sem_init
(
&
sem_empty
,
"empty"
,
MAXSEM
,
RT_IPC_FLAG_
FIF
O
);
rt_sem_init
(
&
sem_full
,
"full"
,
0
,
RT_IPC_FLAG_
FIF
O
);
rt_sem_init
(
&
sem_lock
,
"lock"
,
1
,
RT_IPC_FLAG_
PRI
O
);
rt_sem_init
(
&
sem_empty
,
"empty"
,
MAXSEM
,
RT_IPC_FLAG_
PRI
O
);
rt_sem_init
(
&
sem_full
,
"full"
,
0
,
RT_IPC_FLAG_
PRI
O
);
/* 创建线程1 */
producer_tid
=
rt_thread_create
(
"producer"
,
...
...
examples/kernel/semaphore_static.c
浏览文件 @
98c72007
...
...
@@ -81,7 +81,7 @@ int semaphore_static_init(void)
rt_err_t
result
;
/* 初始化信号量,初始值是0 */
result
=
rt_sem_init
(
&
sem
,
"sem"
,
0
,
RT_IPC_FLAG_
FIF
O
);
result
=
rt_sem_init
(
&
sem
,
"sem"
,
0
,
RT_IPC_FLAG_
PRI
O
);
if
(
result
!=
RT_EOK
)
{
tc_stat
(
TC_STAT_END
|
TC_STAT_FAILED
);
...
...
examples/kernel/tc_comm.c
浏览文件 @
98c72007
...
...
@@ -35,7 +35,7 @@ void tc_thread_entry(void* parameter)
struct
finsh_syscall
*
index
;
/* create tc semaphore */
rt_sem_init
(
&
_tc_sem
,
"tc"
,
0
,
RT_IPC_FLAG_
FIF
O
);
rt_sem_init
(
&
_tc_sem
,
"tc"
,
0
,
RT_IPC_FLAG_
PRI
O
);
do
{
for
(
index
=
_syscall_table_begin
;
index
<
_syscall_table_end
;
FINSH_NEXT_SYSCALL
(
index
))
...
...
examples/kernel/timer_timeout.c
浏览文件 @
98c72007
...
...
@@ -73,7 +73,7 @@ int timer_timeout_init()
&
msg_pool
[
0
],
/* 内存池指向msg_pool */
128
-
sizeof
(
void
*
),
/* 每个消息的大小是 128 - void* */
sizeof
(
msg_pool
),
/* 内存池的大小是msg_pool的大小 */
RT_IPC_FLAG_
FIFO
);
/* 如果有多个线程等待,按照先来先得到
的方法分配消息 */
RT_IPC_FLAG_
PRIO
);
/* 如果有多个线程等待,按照优先级由高到低
的方法分配消息 */
/* 创建线程 */
tid
=
rt_thread_create
(
"t"
,
...
...
examples/pm/wakeup_app.c
浏览文件 @
98c72007
...
...
@@ -61,7 +61,7 @@ static int wakeup_app(void)
{
rt_thread_t
tid
;
wakeup_event
=
rt_event_create
(
"wakup"
,
RT_IPC_FLAG_
FIF
O
);
wakeup_event
=
rt_event_create
(
"wakup"
,
RT_IPC_FLAG_
PRI
O
);
RT_ASSERT
(
wakeup_event
!=
RT_NULL
);
tid
=
rt_thread_create
(
"wakeup_app"
,
wakeup_app_entry
,
RT_NULL
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录