Files
edgetx-gx12/radio/src/tasks.h
T
MichaelandGitHub 34ea422e39 chore: freeRTOS task stack diagnostics (#2976)
* migrated stack diagnostics (available, free) to using built in FreeRTOS builtin function

Note: main stack must be and is treated differently as it is not under FreeRTOS control. main stack is painted by the STM32 startup routine. free main stack is calculated checking the remaining painted stack area.

* corrected my merge error

* missed a blank
2023-01-15 11:48:04 +10:00

75 lines
2.1 KiB
C

/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _TASKS_H_
#define _TASKS_H_
#include "rtos.h"
// stack sizes should be in multiples of 8 for better alignment
#if defined (COLORLCD)
#define MENUS_STACK_SIZE (8 * 1024)
#else
#define MENUS_STACK_SIZE 2000
#endif
#define MIXER_STACK_SIZE 400
#define AUDIO_STACK_SIZE 400
#define CLI_STACK_SIZE 1024 // only consumed with CLI build option
#if defined(FREE_RTOS)
#define MIXER_TASK_PRIO (tskIDLE_PRIORITY + 4)
#define AUDIO_TASK_PRIO (tskIDLE_PRIORITY + 3) // Note: FreeRTOSConfig.h defines software timers as priority 2
#define MENUS_TASK_PRIO (tskIDLE_PRIORITY + 1)
#define CLI_TASK_PRIO (tskIDLE_PRIORITY + 1)
#else
#define MIXER_TASK_PRIO (4)
#define AUDIO_TASK_PRIO (2)
#define MENUS_TASK_PRIO (1)
#define CLI_TASK_PRIO (1)
#endif
extern RTOS_MUTEX_HANDLE mixerMutex;
extern RTOS_TASK_HANDLE menusTaskId;
extern TaskStack<MENUS_STACK_SIZE> menusStack;
extern RTOS_TASK_HANDLE mixerTaskId;
extern TaskStack<MIXER_STACK_SIZE> mixerStack;
extern RTOS_TASK_HANDLE audioTaskId;
extern TaskStack<AUDIO_STACK_SIZE> audioStack;
#if defined(CLI)
extern RTOS_TASK_HANDLE cliTaskId;
extern TaskStack<CLI_STACK_SIZE> cliStack;
#endif
void tasksStart();
extern volatile uint16_t timeForcePowerOffPressed;
inline void resetForcePowerOffRequest()
{
timeForcePowerOffPressed = 0;
}
#endif // _TASKS_H_