diff options
| author | Wayne Lin <[email protected]> | 2022-01-25 18:53:52 +0800 |
|---|---|---|
| committer | Wayne Lin <[email protected]> | 2022-01-25 18:53:52 +0800 |
| commit | c95c296e9915a38a666ae1a2575c2a4d0ba1d376 (patch) | |
| tree | c6e5a1ffe4ceb997e853ba0c3daffc9dc60c8b79 /components/drivers/include | |
| parent | f7ba146a01fcf23a2b06a141d1b1a56cb27b878c (diff) | |
| parent | 32a5668593c578b85560338c29d76f3a252c8dbc (diff) | |
Merge branch 'master' of https://github.com/RT-Thread/rt-thread into nuvoton
# Conflicts:
# bsp/gd32/gd32107c-eval/rtconfig.h
Diffstat (limited to 'components/drivers/include')
| -rw-r--r-- | components/drivers/include/ipc/workqueue.h | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/components/drivers/include/ipc/workqueue.h b/components/drivers/include/ipc/workqueue.h index edefb0933e..b2224bdcf4 100644 --- a/components/drivers/include/ipc/workqueue.h +++ b/components/drivers/include/ipc/workqueue.h @@ -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 * @@ -54,37 +54,23 @@ struct rt_work /** * WorkQueue for DeviceDriver */ +void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_work *work, void *work_data), void *work_data); struct rt_workqueue *rt_workqueue_create(const char *name, rt_uint16_t stack_size, rt_uint8_t priority); rt_err_t rt_workqueue_destroy(struct rt_workqueue *queue); rt_err_t rt_workqueue_dowork(struct rt_workqueue *queue, struct rt_work *work); -rt_err_t rt_workqueue_submit_work(struct rt_workqueue *queue, struct rt_work *work, rt_tick_t time); +rt_err_t rt_workqueue_submit_work(struct rt_workqueue *queue, struct rt_work *work, rt_tick_t ticks); rt_err_t rt_workqueue_cancel_work(struct rt_workqueue *queue, struct rt_work *work); rt_err_t rt_workqueue_cancel_work_sync(struct rt_workqueue *queue, struct rt_work *work); rt_err_t rt_workqueue_cancel_all_work(struct rt_workqueue *queue); rt_err_t rt_workqueue_urgent_work(struct rt_workqueue *queue, struct rt_work *work); #ifdef RT_USING_SYSTEM_WORKQUEUE -rt_err_t rt_work_submit(struct rt_work *work, rt_tick_t time); +rt_err_t rt_work_submit(struct rt_work *work, rt_tick_t ticks); +rt_err_t rt_work_urgent(struct rt_work *work); rt_err_t rt_work_cancel(struct rt_work *work); #endif /* RT_USING_SYSTEM_WORKQUEUE */ -/** - * @brief Initialize a work item, binding with a callback function. - * - * @param work A pointer to the work item object. - * @param work_func A callback function that will be called when this work item is executed. - * @param work_data A user data passed to the callback function as the second parameter. - */ -rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_work *work, void *work_data), - void *work_data) -{ - rt_list_init(&(work->list)); - work->work_func = work_func; - work->work_data = work_data; - work->workqueue = RT_NULL; - work->flags = 0; - work->type = 0; -} + #endif /* RT_USING_HEAP */ |
