Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2301_76519099
rt-thread
提交
24b4b6cb
R
rt-thread
项目概览
2301_76519099
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
3
Star
1
Fork
1
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
24b4b6cb
编写于
6月 09, 2021
作者:
mysterywolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[kernel]补充endif后缀注释
上级
5c8625c8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
40 addition
and
40 deletion
+40
-40
src/clock.c
src/clock.c
+3
-3
src/components.c
src/components.c
+13
-13
src/cpu.c
src/cpu.c
+1
-1
src/device.c
src/device.c
+7
-7
src/idle.c
src/idle.c
+16
-16
未找到文件。
src/clock.c
浏览文件 @
24b4b6cb
...
...
@@ -24,7 +24,7 @@
#define rt_tick rt_cpu_index(0)->tick
#else
static
volatile
rt_tick_t
rt_tick
=
0
;
#endif
#endif
/* RT_USING_SMP */
/**
* @addtogroup Clock
...
...
@@ -72,7 +72,7 @@ void rt_tick_increase(void)
rt_cpu_self
()
->
tick
++
;
#else
++
rt_tick
;
#endif
#endif
/* RT_USING_SMP */
/* check time slice */
thread
=
rt_thread_self
();
...
...
@@ -138,7 +138,7 @@ RT_WEAK rt_tick_t rt_tick_get_millisecond(void)
#warning "rt-thread cannot provide a correct 1ms-based tick any longer,\
please redefine this function in another file by using a high-precision hard-timer."
return
0
;
#endif
#endif
/* 1000 % RT_TICK_PER_SECOND == 0u */
}
/**@}*/
...
...
src/components.c
浏览文件 @
24b4b6cb
...
...
@@ -23,11 +23,11 @@
#ifdef RT_USING_USER_MAIN
#ifndef RT_MAIN_THREAD_STACK_SIZE
#define RT_MAIN_THREAD_STACK_SIZE 2048
#endif
#endif
/* RT_MAIN_THREAD_STACK_SIZE */
#ifndef RT_MAIN_THREAD_PRIORITY
#define RT_MAIN_THREAD_PRIORITY (RT_THREAD_PRIORITY_MAX / 3)
#endif
#endif
#endif
/* RT_MAIN_THREAD_PRIORITY */
#endif
/* RT_USING_USER_MAIN */
#ifdef RT_USING_COMPONENTS_INIT
/*
...
...
@@ -98,7 +98,7 @@ void rt_components_board_init(void)
{
(
*
fn_ptr
)();
}
#endif
#endif
/* RT_DEBUG_INIT */
}
/**
...
...
@@ -124,9 +124,9 @@ void rt_components_init(void)
{
(
*
fn_ptr
)();
}
#endif
#endif
/* RT_DEBUG_INIT */
}
#endif
/* RT_USING_COMPONENTS_INIT */
#endif
/* RT_USING_COMPONENTS_INIT */
#ifdef RT_USING_USER_MAIN
...
...
@@ -167,7 +167,7 @@ int entry(void)
ALIGN
(
8
)
static
rt_uint8_t
main_stack
[
RT_MAIN_THREAD_STACK_SIZE
];
struct
rt_thread
main_thread
;
#endif
#endif
/* RT_USING_HEAP */
/* the system main thread */
void
main_thread_entry
(
void
*
parameter
)
...
...
@@ -177,11 +177,11 @@ void main_thread_entry(void *parameter)
#ifdef RT_USING_COMPONENTS_INIT
/* RT-Thread components initialization */
rt_components_init
();
#endif
#endif
/* RT_USING_COMPONENTS_INIT */
#ifdef RT_USING_SMP
rt_hw_secondary_cpu_up
();
#endif
#endif
/* RT_USING_SMP */
/* invoke system main function */
#if defined(__CC_ARM) || defined(__CLANG_ARM)
{
...
...
@@ -211,7 +211,7 @@ void rt_application_init(void)
/* if not define RT_USING_HEAP, using to eliminate the warning */
(
void
)
result
;
#endif
#endif
/* RT_USING_HEAP */
rt_thread_startup
(
tid
);
}
...
...
@@ -237,7 +237,7 @@ int rtthread_startup(void)
#ifdef RT_USING_SIGNALS
/* signal system initialization */
rt_system_signal_init
();
#endif
#endif
/* RT_USING_SIGNALS */
/* create init_thread */
rt_application_init
();
...
...
@@ -250,7 +250,7 @@ int rtthread_startup(void)
#ifdef RT_USING_SMP
rt_hw_spin_lock
(
&
_cpus_lock
);
#endif
/*
RT_USING_SMP
*/
#endif
/*
RT_USING_SMP
*/
/* start scheduler */
rt_system_scheduler_start
();
...
...
@@ -258,4 +258,4 @@ int rtthread_startup(void)
/* never reach here */
return
0
;
}
#endif
#endif
/* RT_USING_USER_MAIN */
src/cpu.c
浏览文件 @
24b4b6cb
...
...
@@ -185,4 +185,4 @@ void rt_cpus_lock_status_restore(struct rt_thread *thread)
}
RTM_EXPORT
(
rt_cpus_lock_status_restore
);
#endif
#endif
/* RT_USING_SMP */
src/device.c
浏览文件 @
24b4b6cb
...
...
@@ -16,9 +16,9 @@
*/
#include <rtthread.h>
#if
defined(RT_USING_POSIX)
#if
def RT_USING_POSIX
#include <rtdevice.h>
/* for wqueue_init */
#endif
#endif
/* RT_USING_POSIX */
#ifdef RT_USING_DEVICE
...
...
@@ -36,7 +36,7 @@
#define device_read (dev->read)
#define device_write (dev->write)
#define device_control (dev->control)
#endif
#endif
/* RT_USING_DEVICE_OPS */
/**
* This function registers a device driver with specified name.
...
...
@@ -62,10 +62,10 @@ rt_err_t rt_device_register(rt_device_t dev,
dev
->
ref_count
=
0
;
dev
->
open_flag
=
0
;
#if
defined(RT_USING_POSIX)
#if
def RT_USING_POSIX
dev
->
fops
=
RT_NULL
;
rt_wqueue_init
(
&
(
dev
->
wait_queue
));
#endif
#endif
/* RT_USING_POSIX */
return
RT_EOK
;
}
...
...
@@ -150,7 +150,7 @@ void rt_device_destroy(rt_device_t dev)
rt_free
(
dev
);
}
RTM_EXPORT
(
rt_device_destroy
);
#endif
#endif
/* RT_USING_HEAP */
/**
* This function will initialize the specified device
...
...
@@ -434,4 +434,4 @@ rt_device_set_tx_complete(rt_device_t dev,
}
RTM_EXPORT
(
rt_device_set_tx_complete
);
#endif
#endif
/* RT_USING_DEVICE */
src/idle.c
浏览文件 @
24b4b6cb
...
...
@@ -22,27 +22,27 @@
#ifdef RT_USING_MODULE
#include <dlmodule.h>
#endif
#endif
/* RT_USING_MODULE */
#if
defined (RT_USING_HOOK)
#if
def RT_USING_HOOK
#ifndef RT_USING_IDLE_HOOK
#define RT_USING_IDLE_HOOK
#endif
#endif
#endif
/* RT_USING_IDLE_HOOK */
#endif
/* RT_USING_HOOK */
#ifndef IDLE_THREAD_STACK_SIZE
#if defined (RT_USING_IDLE_HOOK) || defined(RT_USING_HEAP)
#define IDLE_THREAD_STACK_SIZE 256
#else
#define IDLE_THREAD_STACK_SIZE 128
#endif
#endif
#endif
/* (RT_USING_IDLE_HOOK) || defined(RT_USING_HEAP) */
#endif
/* IDLE_THREAD_STACK_SIZE */
#ifdef RT_USING_SMP
#define _CPUS_NR RT_CPUS_NR
#else
#define _CPUS_NR 1
#endif
#endif
/* RT_USING_SMP */
extern
rt_list_t
rt_thread_defunct
;
...
...
@@ -53,7 +53,7 @@ static rt_uint8_t rt_thread_stack[_CPUS_NR][IDLE_THREAD_STACK_SIZE];
#ifdef RT_USING_IDLE_HOOK
#ifndef RT_IDLE_HOOK_LIST_SIZE
#define RT_IDLE_HOOK_LIST_SIZE 4
#endif
#endif
/* RT_IDLE_HOOK_LIST_SIZE */
static
void
(
*
idle_hook_list
[
RT_IDLE_HOOK_LIST_SIZE
])(
void
);
...
...
@@ -125,7 +125,7 @@ rt_err_t rt_thread_idle_delhook(void (*hook)(void))
return
ret
;
}
#endif
#endif
/* RT_USING_IDLE_HOOK */
#ifdef RT_USING_HEAP
/* Return whether there is defunctional thread to be deleted. */
...
...
@@ -141,7 +141,7 @@ rt_inline int _has_defunct_thread(void)
return
l
->
next
!=
l
;
}
#endif
#endif
/* RT_USING_HEAP */
/**
* @ingroup Thread
...
...
@@ -182,7 +182,7 @@ void rt_thread_idle_excute(void)
rt_object_delete
((
rt_object_t
)
thread
);
rt_hw_interrupt_enable
(
lock
);
}
#endif
#endif
/* RT_USING_HEAP */
}
extern
void
rt_system_power_manager
(
void
);
...
...
@@ -196,7 +196,7 @@ static void rt_thread_idle_entry(void *parameter)
rt_hw_secondary_cpu_idle_exec
();
}
}
#endif
#endif
/* RT_USING_SMP */
while
(
1
)
{
...
...
@@ -212,12 +212,12 @@ static void rt_thread_idle_entry(void *parameter)
idle_hook
();
}
}
#endif
#endif
/* RT_USING_IDLE_HOOK */
rt_thread_idle_excute
();
#ifdef RT_USING_PM
rt_system_power_manager
();
#endif
#endif
/* RT_USING_PM */
}
}
...
...
@@ -246,7 +246,7 @@ void rt_thread_idle_init(void)
32
);
#ifdef RT_USING_SMP
rt_thread_control
(
&
idle
[
i
],
RT_THREAD_CTRL_BIND_CPU
,
(
void
*
)
i
);
#endif
#endif
/* RT_USING_SMP */
/* startup */
rt_thread_startup
(
&
idle
[
i
]);
}
...
...
@@ -264,7 +264,7 @@ rt_thread_t rt_thread_idle_gethandler(void)
register
int
id
=
rt_hw_cpu_id
();
#else
register
int
id
=
0
;
#endif
#endif
/* RT_USING_SMP */
return
(
rt_thread_t
)(
&
idle
[
id
]);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录