-
Notifications
You must be signed in to change notification settings - Fork 0
/
tt_tasks.h
67 lines (60 loc) · 1.47 KB
/
tt_tasks.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef TT_TASKS_H
#define TT_TASKS_H
/**
* @file tt_tasks.h
* @brief implements a cooperative multitasking kernel following
* Pont, Patterns for time-triggered embedded systems. 2014.
* Specially, Chapter 14.
*
* @see https://www.safetty.net/products/publications/pttes
*
* @author Hans Schneebeli
* @date 20/10/2017
*/
/**
* @fn Task_Init
* @brief Initializes the tasks table.
* Can be omitted when BSS section is initialized to zeroes
*
* @param void
* @return void
*/
void Task_Init(void);
/**
* @fn Task_Delete
* @brief Removes a task from tasks table
*
* @param index of task to be deleted
* @return void
*/
void Task_Delete(INT index);
/**
* @fn Task_Add
* @brief Add a task to tasks table
*
* @param f pointer to task function
* @param p period (in ticks)
* @param d initial delay (in ticks)
* @return index of task in tasks table. -1 if there is no more space for this task
*/
int Task_Add(void (*f)(void), INT p, INT d);
/**
* @fn Task_Update
* @brief Update tasks table enabling execution of tasks in Task_Dispatch
*
* Must be run inside the timer interrupt routine
*
* @param void
* @return void
*/
void Task_Update( void );
/**
* @fn Task_Dispatch
* @brief Run the tasks enabled by Task_Update
*
*
* @param void
* @return void
*/
void Task_Dispatch(void);
#endif // TT_TASKS_H