Loading...
Searching...
No Matches
dpl_tasks.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2020 Inria
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
18
19#include "os/os_task.h"
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
28struct dpl_task {
29 struct os_task t;
30};
31
35typedef os_task_func_t dpl_task_func_t;
36
56static inline int dpl_task_init(struct dpl_task *t, const char *name, dpl_task_func_t func,
57 void *arg, uint8_t prio, dpl_time_t sanity_itvl,
58 dpl_stack_t *stack_bottom, uint16_t stack_size)
59{
60 return os_task_init(&t->t, name, func, arg, prio, sanity_itvl, stack_bottom, stack_size);
61}
62
67static inline int dpl_task_remove(struct dpl_task *t)
68{
69 return os_task_remove(&t->t);
70}
71
77static inline uint8_t dpl_task_count(void)
78{
79 return os_task_count();
80}
81
85static inline void dpl_task_yield(void)
86{
87 return os_task_yield();
88}
89
90#ifdef __cplusplus
91}
92#endif
static void dpl_task_yield(void)
Lets current thread yield.
Definition dpl_tasks.h:85
static int dpl_task_init(struct dpl_task *t, const char *name, dpl_task_func_t func, void *arg, uint8_t prio, dpl_time_t sanity_itvl, dpl_stack_t *stack_bottom, uint16_t stack_size)
Initialize a task.
Definition dpl_tasks.h:56
static int dpl_task_remove(struct dpl_task *t)
removes specified task
Definition dpl_tasks.h:67
os_task_func_t dpl_task_func_t
dpl task function
Definition dpl_tasks.h:35
static uint8_t dpl_task_count(void)
Return the number of tasks initialized.
Definition dpl_tasks.h:77
os_time_t dpl_time_t
dpl time type
Definition dpl_types.h:53
os_stack_t dpl_stack_t
dpl stack buffer type
Definition dpl_types.h:58
dpl task wrapper
Definition dpl_tasks.h:28
struct os_task t
os task
Definition dpl_tasks.h:29