Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天中雨水
rt-thread
提交
320c44ad
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,发现更多精彩内容 >>
提交
320c44ad
编写于
8月 28, 2021
作者:
Thomas_Fly
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add the fixed comment
上级
4f110a6d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
68 addition
and
52 deletion
+68
-52
src/irq.c
src/irq.c
+4
-4
src/timer.c
src/timer.c
+64
-48
未找到文件。
src/irq.c
浏览文件 @
320c44ad
...
...
@@ -25,7 +25,7 @@ static void (*rt_interrupt_leave_hook)(void);
*
* @brief This function set a hook function when the system enter a interrupt
*
* @note
t
he hook function must be simple and never be blocked or suspend.
* @note
T
he hook function must be simple and never be blocked or suspend.
*
* @param hook The function point to be called
*/
...
...
@@ -39,7 +39,7 @@ void rt_interrupt_enter_sethook(void (*hook)(void))
*
* @brief This function set a hook function when the system exit a interrupt.
*
* @note
t
he hook function must be simple and never be blocked or suspend.
* @note
T
he hook function must be simple and never be blocked or suspend.
*
* @param hook The function point to be called
*/
...
...
@@ -65,7 +65,7 @@ volatile rt_uint8_t rt_interrupt_nest = 0;
/**
* @brief This function will be invoked by BSP, when enter interrupt service routine
*
* @note
p
lease don't invoke this routine in application
* @note
P
lease don't invoke this routine in application
*
* @see rt_interrupt_leave
*/
...
...
@@ -87,7 +87,7 @@ RTM_EXPORT(rt_interrupt_enter);
/**
* @brief This function will be invoked by BSP, when leave interrupt service routine
*
* @note
p
lease don't invoke this routine in application
* @note
P
lease don't invoke this routine in application
*
* @see rt_interrupt_enter
*/
...
...
src/timer.c
浏览文件 @
320c44ad
...
...
@@ -61,9 +61,9 @@ static void (*rt_timer_exit_hook)(struct rt_timer *timer);
/**
* @brief This function will set a hook function on timer,
* which will be invoked when enter timer timeout callback function.
*
which will be invoked when enter timer timeout callback function.
*
* @param hook
t
he function point of timer
* @param hook
T
he function point of timer
*/
void
rt_timer_enter_sethook
(
void
(
*
hook
)(
struct
rt_timer
*
timer
))
{
...
...
@@ -72,9 +72,9 @@ void rt_timer_enter_sethook(void (*hook)(struct rt_timer *timer))
/**
* @brief This function will set a hook function, which will be
*
invoked when exit *
timer timeout callback function.
*
invoked when exit
timer timeout callback function.
*
* @param hook
t
he function point of timer
* @param hook
T
he function point of timer
*/
void
rt_timer_exit_sethook
(
void
(
*
hook
)(
struct
rt_timer
*
timer
))
{
...
...
@@ -86,17 +86,21 @@ void rt_timer_exit_sethook(void (*hook)(struct rt_timer *timer))
/**
* @brief [internal]
t
he init funtion of timer
* @brief [internal]
T
he init funtion of timer
*
*
t
he internal called function of rt_timer_init
*
T
he internal called function of rt_timer_init
*
* @see rt_timer_init
*
* @param timer the static timer object
* @param timeout the timeout function
* @param parameter the parameter of timeout function
* @param time the tick of timer
* @param flag the flag of timer
* @param timer The static timer object
*
* @param timeout The timeout function
*
* @param parameter The parameter of timeout function
*
* @param time The tick of timer
*
* @param flag The flag of timer
*/
static
void
_timer_init
(
rt_timer_t
timer
,
void
(
*
timeout
)(
void
*
parameter
),
...
...
@@ -126,11 +130,11 @@ static void _timer_init(rt_timer_t timer,
}
/**
* @brief
find the next emtpy timer
* @brief
Find the next emtpy timer ticks
*
* @param timer_list
t
he timer of the next timeout
* @param timer_list
T
he timer of the next timeout
*
* @return rt_tick_t
the point of timer
* @return rt_tick_t
The next timer's ticks
*/
static
rt_tick_t
_timer_list_next_timeout
(
rt_list_t
timer_list
[])
{
...
...
@@ -155,9 +159,9 @@ static rt_tick_t _timer_list_next_timeout(rt_list_t timer_list[])
}
/**
* @brief
r
emove the timer
* @brief
R
emove the timer
*
* @param timer
the point of
timer
* @param timer
The point of the
timer
*/
rt_inline
void
_timer_remove
(
rt_timer_t
timer
)
{
...
...
@@ -171,10 +175,11 @@ rt_inline void _timer_remove(rt_timer_t timer)
#if RT_DEBUG_TIMER
/**
* @brief
t
he number of timer
* @brief
T
he number of timer
*
* @param timer
* @return int the count
* @param timer the head of timer
*
* @return int the count of timer
*/
static
int
_timer_count_height
(
struct
rt_timer
*
timer
)
{
...
...
@@ -218,12 +223,18 @@ void rt_timer_dump(rt_list_t timer_heads[])
/**
* @brief This function will initialize a timer
* normally this function is used to initialize a static timer object.
* @param timer the static timer object
* @param name the name of timer
* @param timeout the timeout function
* @param parameter the parameter of timeout function
* @param time the tick of timer
* @param flag the flag of timer
*
* @param timer The static timer object
*
* @param name The name of timer
*
* @param timeout The timeout function
*
* @param parameter The parameter of timeout function
*
* @param time The tick of timer
*
* @param flag The flag of timer
*/
void
rt_timer_init
(
rt_timer_t
timer
,
const
char
*
name
,
...
...
@@ -245,8 +256,9 @@ RTM_EXPORT(rt_timer_init);
/**
* @brief This function will detach a timer from timer management.
*
* @param timer the timer to be detached
* @return rt_err_t RT_EOK
* @param timer The timer to be detached
*
* @return rt_err_t The status of detach
*/
rt_err_t
rt_timer_detach
(
rt_timer_t
timer
)
{
...
...
@@ -277,13 +289,17 @@ RTM_EXPORT(rt_timer_detach);
/**
* @brief This function will create a timer
*
* @param name the name of timer
* @param timeout the timeout function
* @param parameter the parameter of timeout function
* @param time the tick of timer
* @param flag the flag of timer
* @param name The name of timer
*
* @param timeout The timeout function
*
* @param parameter The parameter of timeout function
*
* @param time The tick of timer
*
* @param flag The flag of timer
*
* @return
t
he created timer object
* @return
T
he created timer object
*/
rt_timer_t
rt_timer_create
(
const
char
*
name
,
void
(
*
timeout
)(
void
*
parameter
),
...
...
@@ -309,9 +325,9 @@ RTM_EXPORT(rt_timer_create);
/**
* @brief This function will delete a timer and release timer memory
*
* @param timer
t
he timer to be deleted
* @param timer
T
he timer to be deleted
*
* @return
t
he operation status, RT_EOK on OK; RT_ERROR on error
* @return
rt_err_t T
he operation status, RT_EOK on OK; RT_ERROR on error
*/
rt_err_t
rt_timer_delete
(
rt_timer_t
timer
)
{
...
...
@@ -342,9 +358,9 @@ RTM_EXPORT(rt_timer_delete);
/**
* @brief This function will start the timer
*
* @param timer
t
he timer to be started
* @param timer
T
he timer to be started
*
* @return
t
he operation status, RT_EOK on OK, -RT_ERROR on error
* @return
T
he operation status, RT_EOK on OK, -RT_ERROR on error
*/
rt_err_t
rt_timer_start
(
rt_timer_t
timer
)
{
...
...
@@ -465,9 +481,9 @@ RTM_EXPORT(rt_timer_start);
/**
* @brief This function will stop the timer
*
* @param timer
t
he timer to be stopped
* @param timer
T
he timer to be stopped
*
* @return
t
he operation status, RT_EOK on OK, -RT_ERROR on error
* @return
T
he operation status, RT_EOK on OK, -RT_ERROR on error
*/
rt_err_t
rt_timer_stop
(
rt_timer_t
timer
)
{
...
...
@@ -499,11 +515,11 @@ RTM_EXPORT(rt_timer_stop);
/**
* @brief This function will get or set some options of the timer
*
* @param timer
t
he timer to be get or set
* @param cmd
t
he control command
* @param arg
t
he argument
* @param timer
T
he timer to be get or set
* @param cmd
T
he control command
* @param arg
T
he argument
*
* @return
RT_EOK
* @return
rt_err_t the statu of control
*/
rt_err_t
rt_timer_control
(
rt_timer_t
timer
,
int
cmd
,
void
*
arg
)
{
...
...
@@ -558,7 +574,7 @@ RTM_EXPORT(rt_timer_control);
* @brief This function will check timer list, if a timeout event happens,
* the corresponding timeout function will be invoked.
*
* @note
t
his function shall be invoked in operating system timer interrupt.
* @note
T
his function shall be invoked in operating system timer interrupt.
*/
void
rt_timer_check
(
void
)
{
...
...
@@ -632,7 +648,7 @@ void rt_timer_check(void)
/**
* @brief This function will return the next timeout tick in the system.
*
* @return
t
he next timeout tick in the system
* @return
T
he next timeout tick in the system
*/
rt_tick_t
rt_timer_next_timeout_tick
(
void
)
{
...
...
@@ -642,7 +658,7 @@ rt_tick_t rt_timer_next_timeout_tick(void)
#ifdef RT_USING_TIMER_SOFT
/**
* @brief This function will check software-timer list, if a timeout event happens, the
* corresponding timeout function will be invoked.
*
corresponding timeout function will be invoked.
*/
void
rt_soft_timer_check
(
void
)
{
...
...
@@ -719,9 +735,9 @@ void rt_soft_timer_check(void)
}
/**
* @brief
s
ystem timer thread entry
* @brief
S
ystem timer thread entry
*
* @param parameter
* @param parameter
The arg of the thread
*/
static
void
_timer_thread_entry
(
void
*
parameter
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录