summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2022-01-16 14:33:41 -0500
committerBernard Xiong <[email protected]>2022-01-20 20:58:46 +0800
commit1874bd25aae647d116dac36a17d3bc79850e200b (patch)
treeeb7eb09e8d360aeb20980412b3416a5a51736522 /components
parent65ecca80ee7b3e63998d2207f28fdc8847169eb3 (diff)
[timer] improve parameter checking
Diffstat (limited to 'components')
-rw-r--r--components/drivers/src/workqueue.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/drivers/src/workqueue.c b/components/drivers/src/workqueue.c
index 6dbb0da627..9ee333cedd 100644
--- a/components/drivers/src/workqueue.c
+++ b/components/drivers/src/workqueue.c
@@ -98,7 +98,7 @@ static rt_err_t _workqueue_submit_work(struct rt_workqueue *queue,
/* remove list */
rt_list_remove(&(work->list));
work->flags &= ~RT_WORK_STATE_PENDING;
- /* */
+
if (ticks == 0)
{
if (queue->work_current != work)
@@ -288,6 +288,7 @@ rt_err_t rt_workqueue_dowork(struct rt_workqueue *queue, struct rt_work *work)
* @param queue A pointer to the workqueue object.
* @param work A pointer to the work item object.
* @param time The delay time (unit: OS ticks) for the work item to be submitted to the work queue.
+ * The max timeout tick should be no more than (RT_TICK_MAX/2 - 1)
*
* @return RT_EOK Success.
* @return -RT_EBUSY This work item is executing.