25_R1_chassis/User/task/user_task.c
2025-05-25 20:10:14 +08:00

87 lines
2.2 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
保存任务属<E58AA1><E5B19E>生成任务时使甄1<E79484>7
堆栈大小取决与自己设定,堆栈溢出(分配的内存过小导致过陀螺仪解算的欧拉角出问预1<E9A284>7
堆栈分配过大导致过各个线程跑飞<EFBC88>疑是内存不够导致的
出现各种跑飞和奇<E5928C><E5A587>的问题 可以合理怢<E79086>疄1<E79684>7 是否是堆栈内存给的有问题
对于内存分配的一些理规1<E8A784>7
此处堆栈存放的都是一亄1<E4BA84>7 屢<>部变釄1<E98784>7 全局变量 霢<>要根据线程自身的大小设定
*/
/* Includes ----------------------------------------------------------------- */
#include "task\user_task.h"
Task_Runtime_t task_runtime;
/* 各个任务的参数,根据实际情况分配栈空间*/
const osThreadAttr_t attr_init = {
.name = "init",
.priority = osPriorityRealtime,
.stack_size = 256 * 4,
};
const osThreadAttr_t attr_atti_esti = {
.name = "atti_esti",
.priority = osPriorityRealtime,
.stack_size = 256 * 4,
};
const osThreadAttr_t attr_chassis = {
.name = "chassis",
.priority = osPriorityAboveNormal,
.stack_size = 256 * 4,
};
const osThreadAttr_t attr_r12ds = {
.name = "r12ds",
.priority = osPriorityRealtime,
.stack_size = 128 * 4,
};
const osThreadAttr_t attr_can = {
.name = "can",
.priority = osPriorityRealtime,
.stack_size = 128 * 4,
};
const osThreadAttr_t attr_cmd = {
.name = "cmd",
.priority = osPriorityHigh,
.stack_size = 128 *4,
};
const osThreadAttr_t attr_nuc = {
.name = "nuc",
.priority = osPriorityRealtime,
.stack_size = 128 *4,
};
const osThreadAttr_t attr_ops_9pos = {
.name = "action",
.priority = osPriorityRealtime,
.stack_size = 128 *4,
};
const osThreadAttr_t attr_calc = {
.name = "calc",
.priority = osPriorityRealtime,
.stack_size = 128 *4,
};
const osThreadAttr_t attr_navi = {
.name = "navi",
.priority = osPriorityRealtime,
.stack_size = 256 *4,
};
const osThreadAttr_t attr_error_detect = {
.name = "error_detect",
.priority = osPriorityLow,
.stack_size = 128 *4,
};
const osThreadAttr_t attr_remote = {
.name = "dr16",
.priority = osPriorityRealtime,
.stack_size = 128 *4,
};