Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
task.h
Go to the documentation of this file.
1 
4 #ifndef __TASK_H__
5 #define __TASK_H__
6 
7 #include <stdint.h>
8 
9 typedef void (*task_func_t)(void);
10 typedef void (*thread_func_t)(void);
11 
12 struct task_hook {
13  task_func_t task_func;
14  int priority;
15  int stacksize;
16 };
17 
25 #define HOOK_USER_TASK(_task_func, _priority, _stacksize) \
26  static struct task_hook _##_task_func \
27  __attribute__((section(".tasks"), used)) = { \
28  .task_func = _task_func, \
29  .priority = _priority, \
30  .stacksize = _stacksize, \
31  }
32 
41 int task_create(task_func_t task_func, uint8_t priority, int stack_size);
42 
43 #endif
Definition: task.h:12
int task_create(task_func_t task_func, uint8_t priority, int stack_size)
Create new task.
Definition: task.c:23