Skip to content

Commit 921e605

Browse files
committed
[clock] Improve the code comment of the clock.c
1 parent 45440d2 commit 921e605

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

src/clock.c

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ static volatile rt_tick_t rt_tick = 0;
3333
/**@{*/
3434

3535
/**
36-
* This function will return current tick from operating system startup
36+
* @brief This function will return current tick from operating system startup
3737
*
38-
* @return current tick
38+
* @return Return current tick
3939
*/
4040
rt_tick_t rt_tick_get(void)
4141
{
@@ -45,7 +45,9 @@ rt_tick_t rt_tick_get(void)
4545
RTM_EXPORT(rt_tick_get);
4646

4747
/**
48-
* This function will set current tick
48+
* @brief This function will set current tick
49+
*
50+
* @param tick is the value that you will set.
4951
*/
5052
void rt_tick_set(rt_tick_t tick)
5153
{
@@ -57,8 +59,8 @@ void rt_tick_set(rt_tick_t tick)
5759
}
5860

5961
/**
60-
* This function will notify kernel there is one tick passed. Normally,
61-
* this function is invoked by clock ISR.
62+
* @brief This function will notify kernel there is one tick passed.
63+
* Normally, this function is invoked by clock ISR.
6264
*/
6365
void rt_tick_increase(void)
6466
{
@@ -97,14 +99,14 @@ void rt_tick_increase(void)
9799
}
98100

99101
/**
100-
* This function will calculate the tick from millisecond.
102+
* @brief This function will calculate the tick from millisecond.
101103
*
102-
* @param ms the specified millisecond
103-
* - Negative Number wait forever
104-
* - Zero not wait
105-
* - Max 0x7fffffff
104+
* @param ms is the specified millisecond
105+
* - Negative Number wait forever
106+
* - Zero not wait
107+
* - Max 0x7fffffff
106108
*
107-
* @return the calculated tick
109+
* @return Return the calculated tick
108110
*/
109111
rt_tick_t rt_tick_from_millisecond(rt_int32_t ms)
110112
{
@@ -126,9 +128,13 @@ rt_tick_t rt_tick_from_millisecond(rt_int32_t ms)
126128
RTM_EXPORT(rt_tick_from_millisecond);
127129

128130
/**
129-
* This function will provide the passed millisecond from boot.
130-
*
131-
* @return passed millisecond from boot
131+
* @brief This function will return the passed millisecond from boot.
132+
*
133+
* @note When the value of RT_TICK_PER_SECOND is lower than 1000 or
134+
* is not an integral multiple of 1000, this function will not
135+
* provide the correct 1ms-based tick.
136+
*
137+
* @return Return passed millisecond from boot
132138
*/
133139
RT_WEAK rt_tick_t rt_tick_get_millisecond(void)
134140
{

0 commit comments

Comments
 (0)