/*
  保存任务属性，生成任务时使用。
  堆栈大小取决于自己设定，堆栈溢出（分配的内存过小）可能导致陀螺仪解算的欧拉角出问题。
  堆栈分配过大可能导致各个线程跑飞（怀疑是内存不够导致的）。

  ！！！如果出现各种跑飞和奇怪的问题，请合理怀疑是否是堆栈内存分配的问题。

  对于内存分配的一些理论规则：
  此处堆栈存放的都是一些局部变量和全局变量，需要根据线程自身的需求大小进行设定。
*/

/* 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_ops_9pos = {
//	  .name = "action",
//	  .priority = osPriorityRealtime,
//	  .stack_size = 256 *4,
//};
//const osThreadAttr_t attr_chassis = {
//    .name = "chassis",
//    .priority = osPriorityAboveNormal,
//    .stack_size = 512 * 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 = 256 * 4,
};

const osThreadAttr_t attr_cmd = {
	  .name = "cmd",
	  .priority = osPriorityHigh,
	  .stack_size = 256 *4,
};

const osThreadAttr_t attr_nuc = {
	  .name = "nuc",
	  .priority = osPriorityRealtime,
	  .stack_size = 128 *4,
};

const osThreadAttr_t attr_error_detect = {
	  .name = "error_detect",
	  .priority = osPriorityLow,
	  .stack_size = 128 *4,
};

const osThreadAttr_t attr_dr16 = {
	   .name = "dr16",
	   .priority = osPriorityRealtime,
	   .stack_size = 128 *4,
};

//const osThreadAttr_t attr_navi = {
//	   .name = "navi",
//	   .priority = osPriorityRealtime,
//	   .stack_size = 128 *4,
//};

const osThreadAttr_t attr_up = {
	   .name = "up",
	   .priority = osPriorityRealtime,
	   .stack_size = 512 * 4,
};
