aboutsummaryrefslogtreecommitdiff
path: root/docs/parts/tasks.md
blob: e4f71df630e2f1e778c69bfbf2899ea0f9ab37c6 (plain)
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
Tasks
=====
Tasks can be used for sharing processor for example during period of waiting for
interrupt. Planing is based on priority.

## Functions
### tasks_run
```C
int8_t tasks_run(void)
```
This function starts tasks execution. Should be called after all task slots are
prepared and at least one task is started. This function exits if no task exist or
all existing tasks exited.

### task_init

## Structures
### Task
```C
typedef struct {
    uint8_t flags;
    void (*func) (void);
} Task;
```

### TaskSlot
```C
typedef struct {
    uint8_t flags;
    Task *task;
    uint8_t stack_size;
    uint8_t stack[];
} TaskSlot;
```

### Mutex

### Semaphore