Improve multi (#7136)
[opentx.git] / radio / src / tasks.h
blob921958363febc1ff3abe4d45b337d145d5f28b47
1 /*
2 * Copyright (C) OpenTX
4 * Based on code named
5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef _TASKS_H_
22 #define _TASKS_H_
24 #include "rtos.h"
26 // stack sizes should be in multiples of 8 for better alignment
27 #define MENUS_STACK_SIZE 2000
28 #define MIXER_STACK_SIZE 400
29 #define AUDIO_STACK_SIZE 400
30 #define CLI_STACK_SIZE 1000 // only consumed with CLI build option
32 #define MIXER_TASK_PRIO 5
33 #define AUDIO_TASK_PRIO 7
34 #define MENUS_TASK_PRIO 10
35 #define CLI_TASK_PRIO 10
37 extern RTOS_TASK_HANDLE menusTaskId;
38 extern RTOS_DEFINE_STACK(menusStack, MENUS_STACK_SIZE);
40 extern RTOS_TASK_HANDLE mixerTaskId;
41 extern RTOS_DEFINE_STACK(mixerStack, MIXER_STACK_SIZE);
43 extern RTOS_TASK_HANDLE audioTaskId;
44 extern RTOS_DEFINE_STACK(audioStack, AUDIO_STACK_SIZE);
46 extern RTOS_MUTEX_HANDLE mixerMutex;
47 extern RTOS_FLAG_HANDLE openTxInitCompleteFlag;
49 void stackPaint();
50 void tasksStart();
52 extern volatile uint16_t timeForcePowerOffPressed;
53 inline void resetForcePowerOffRequest()
55 timeForcePowerOffPressed = 0;
58 #endif // _TASKS_H_