summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanley <[email protected]>2022-04-20 18:35:17 -0700
committerGitHub <[email protected]>2022-04-21 09:35:17 +0800
commitef7280826f50377ad7b426f90211d6c7e4d91035 (patch)
tree1d7b1a4e9f029ee9c86015b9bcaf656fc29bfdcc
parent77900ab4202d3563d44ae25346c662ab7bf70617 (diff)
correct descriptions (#5849)
* correct descriptions correct descriptions in ipc.c and timer.c Co-authored-by: Stanley <[email protected]>
-rw-r--r--src/ipc.c9
-rw-r--r--src/timer.c16
2 files changed, 21 insertions, 4 deletions
diff --git a/src/ipc.c b/src/ipc.c
index 6fd9ce596b..912ff81536 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -2230,7 +2230,14 @@ RTM_EXPORT(rt_mb_urgent);
* @param value is a flag that you will set for this mailbox's flag.
* You can set an mailbox flag, or you can set multiple flags through OR logic operations.
*
- * @param timeout is a timeout period (unit: an OS tick).
+ * @param timeout is a timeout period (unit: an OS tick). If the mailbox object is not avaliable in the queue,
+ * the thread will wait for the object in the queue up to the amount of time specified by this parameter.
+ *
+ * NOTE:
+ * If use Macro RT_WAITING_FOREVER to set this parameter, which means that when the
+ * mailbox object is unavailable in the queue, the thread will be waiting forever.
+ * If use macro RT_WAITING_NO to set this parameter, which means that this
+ * function is non-blocking and will return immediately.
*
* @return Return the operation status. When the return value is RT_EOK, the operation is successful.
* If the return value is any other values, it means that the mailbox release failed.
diff --git a/src/timer.c b/src/timer.c
index c9b890eed0..f72c71ab9b 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
+ * Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -18,6 +18,7 @@
* timeout function.
* 2021-08-15 supperthomas add the comment
* 2022-01-07 Gabriel Moving __on_rt_xxxxx_hook to timer.c
+ * 2022-04-19 Stanley Correct descriptions
*/
#include <rtthread.h>
@@ -323,9 +324,18 @@ RTM_EXPORT(rt_timer_detach);
*
* @param time is timeout ticks of the timer
*
- * NOTE: The max timeout tick should be no more than (RT_TICK_MAX/2 - 1).
+ * NOTE: The max timeout tick should be no more than (RT_TICK_MAX/2 - 1).
*
- * @param flag is the flag of timer
+ * @param flag is the flag of timer. Timer will invoke the timeout function according to the selected values of flag, if one or more of the following flags is set.
+ *
+ * RT_TIMER_FLAG_ONE_SHOT One shot timing
+ * RT_TIMER_FLAG_PERIODIC Periodic timing
+ *
+ * RT_TIMER_FLAG_HARD_TIMER Hardware timer
+ * RT_TIMER_FLAG_SOFT_TIMER Software timer
+ *
+ * NOTE:
+ * You can use multiple values with "|" logical operator. By default, system will use the RT_TIME_FLAG_HARD_TIMER.
*
* @return the created timer object
*/