Browse Source

新增机器人相关线程大小归一化

paint_robot_new-v1.5
Lizongdi 2 weeks ago
parent
commit
b619b99eff
  1. 2
      RBcore/BHBF.c
  2. 2
      RBcore/TL720D.c
  3. 2
      RBcore/client_setting.c
  4. 2
      RBcore/daemon_task.c
  5. 8
      RBcore/drv_interface.c
  6. 2
      RBcore/include/BHBF.h
  7. 2
      controller/msp_MK32.c
  8. 6
      project/paint_robot_new/paint_robot_new.c

2
RBcore/BHBF.c

@ -249,7 +249,7 @@ void RBcore_Init(void)
const osThreadAttr_t GF_Dispatch_attributes = { const osThreadAttr_t GF_Dispatch_attributes = {
.name = MODULE_NAME_RBCORE, .name = MODULE_NAME_RBCORE,
.stack_size = 2048, .stack_size = THREAD_DEFAULT_STACK,
.priority = (osPriority_t) osPriorityRealtime1, .priority = (osPriority_t) osPriorityRealtime1,
}; };
(void)osThreadNew(RBcore_Task, NULL, &GF_Dispatch_attributes); (void)osThreadNew(RBcore_Task, NULL, &GF_Dispatch_attributes);

2
RBcore/TL720D.c

@ -149,7 +149,7 @@ void TL720D_Init(void)
const osThreadAttr_t Read_TL720D_attributes = { const osThreadAttr_t Read_TL720D_attributes = {
.name = "Read_TL720D", .name = "Read_TL720D",
.stack_size = 2048, .stack_size = THREAD_DEFAULT_STACK,
.priority = (osPriority_t) osPriorityRealtime1, .priority = (osPriority_t) osPriorityRealtime1,
}; };
(void)osThreadNew(Read_TL720D, NULL, &Read_TL720D_attributes); (void)osThreadNew(Read_TL720D, NULL, &Read_TL720D_attributes);

2
RBcore/client_setting.c

@ -151,7 +151,7 @@ void SendIV_Init(void)
const osThreadAttr_t Send_PV_attributes = { const osThreadAttr_t Send_PV_attributes = {
.name = MODULE_NAME_SENDIV, .name = MODULE_NAME_SENDIV,
.stack_size = 1024, .stack_size = THREAD_DEFAULT_STACK,
.priority = (osPriority_t) osPriorityRealtime1, .priority = (osPriority_t) osPriorityRealtime1,
}; };
(void)osThreadNew(Send_IV, NULL, &Send_PV_attributes); (void)osThreadNew(Send_IV, NULL, &Send_PV_attributes);

2
RBcore/daemon_task.c

@ -171,7 +171,7 @@ void daemon_Init(void)
const osThreadAttr_t daemon_attributes = { const osThreadAttr_t daemon_attributes = {
.name = MODULE_NAME_DAEMON, .name = MODULE_NAME_DAEMON,
.stack_size = 1024, .stack_size = THREAD_DEFAULT_STACK,
.priority = (osPriority_t) osPriorityRealtime1, .priority = (osPriority_t) osPriorityRealtime1,
}; };
(void)osThreadNew(daemon_task, NULL, &daemon_attributes); (void)osThreadNew(daemon_task, NULL, &daemon_attributes);

8
RBcore/drv_interface.c

@ -268,7 +268,7 @@ void Drv_InterfaceInit(void)
const osThreadAttr_t Custom_attributes = { const osThreadAttr_t Custom_attributes = {
.name = MODULE_NAME_CUSTOM, .name = MODULE_NAME_CUSTOM,
.stack_size = 2048, .stack_size = THREAD_DEFAULT_STACK,
.priority = (osPriority_t) osPriorityRealtime1, .priority = (osPriority_t) osPriorityRealtime1,
}; };
(void)osThreadNew(Custom_Task, NULL, &Custom_attributes); (void)osThreadNew(Custom_Task, NULL, &Custom_attributes);
@ -276,14 +276,14 @@ void Drv_InterfaceInit(void)
// 创建电机任务 // 创建电机任务
const osThreadAttr_t motor_task_attributes = { const osThreadAttr_t motor_task_attributes = {
.name = MODULE_NAME_MOTOR, .name = MODULE_NAME_MOTOR,
.stack_size = 2048, .stack_size = THREAD_DEFAULT_STACK,
.priority = (osPriority_t) osPriorityRealtime1, .priority = (osPriority_t) osPriorityRealtime1,
}; };
(void)osThreadNew(MotorTask, NULL, &motor_task_attributes); (void)osThreadNew(MotorTask, NULL, &motor_task_attributes);
const osThreadAttr_t Read_motor_attributes = { const osThreadAttr_t Read_motor_attributes = {
.name = "Read_motor", .name = "Read_motor",
.stack_size = 2048, .stack_size = THREAD_DEFAULT_STACK,
.priority = (osPriority_t) osPriorityRealtime1, .priority = (osPriority_t) osPriorityRealtime1,
}; };
(void)osThreadNew(Read_motor, NULL, &Read_motor_attributes); (void)osThreadNew(Read_motor, NULL, &Read_motor_attributes);
@ -299,7 +299,7 @@ void Drv_InterfaceInit(void)
const osThreadAttr_t Read_PV_attributes = { const osThreadAttr_t Read_PV_attributes = {
.name = "Read_PV", .name = "Read_PV",
.stack_size = 2048, .stack_size = THREAD_DEFAULT_STACK,
.priority = (osPriority_t) osPriorityRealtime1, .priority = (osPriority_t) osPriorityRealtime1,
}; };
(void)osThreadNew(Read_PV, NULL, &Read_PV_attributes); (void)osThreadNew(Read_PV, NULL, &Read_PV_attributes);

2
RBcore/include/BHBF.h

@ -116,6 +116,8 @@ typedef enum {
DAEMON_SET_MK32_UDP, // 置位ComError_MK32_UDP DAEMON_SET_MK32_UDP, // 置位ComError_MK32_UDP
} BHBF_Cmd_e; } BHBF_Cmd_e;
#define THREAD_DEFAULT_STACK 4096
typedef struct { typedef struct {
int m_iMode; //正数表示前进,负数表示倒退 int m_iMode; //正数表示前进,负数表示倒退
int m_iAngle; //目标角度 int m_iAngle; //目标角度

2
controller/msp_MK32.c

@ -138,7 +138,7 @@ void controller_init(void)
const osThreadAttr_t MK32_Task_attributes = { const osThreadAttr_t MK32_Task_attributes = {
.name = "Read_MK32", .name = "Read_MK32",
.stack_size = 2048, .stack_size = THREAD_DEFAULT_STACK,
.priority = (osPriority_t) osPriorityRealtime1, .priority = (osPriority_t) osPriorityRealtime1,
}; };
(void)osThreadNew(Read_MK32, NULL, &MK32_Task_attributes); (void)osThreadNew(Read_MK32, NULL, &MK32_Task_attributes);

6
project/paint_robot_new/paint_robot_new.c

@ -521,8 +521,10 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg)
lua_print("CH14_LT \t%d\n", g_stMK32.CH14_LT); lua_print("CH14_LT \t%d\n", g_stMK32.CH14_LT);
lua_print("CH15_RT \t%d\n", g_stMK32.CH15_RT); lua_print("CH15_RT \t%d\n", g_stMK32.CH15_RT);
lua_print("PV Info\n"); lua_print("PV Info\n");
lua_print("{%d, %d, %d, %d, %d, %d}\n", lua_print("{%d, %d, %d, %d, %d, %ld}\n",
g_stPV.RunMode, g_stPV.RobotSpeed, g_stPV.LaneChangeDistance, (int)g_stPV.Vertical_Calibration, g_stPV.IV_IsRestart_Notified, (int)g_stPV.TimeStamp); g_stPV.RunMode, g_stPV.RobotSpeed, g_stPV.LaneChangeDistance, (int)g_stPV.Vertical_Calibration, g_stPV.IV_IsRestart_Notified, (long long)g_stPV.TimeStamp);
lua_print("g_RB_State = %d\ng_Paint_State = %d\nangle_protect_lock = %d\ng_ipaintOffCount = %d\nIs_All_Button_Reset = %d\n",
g_RB_State, g_Paint_State, angle_protect_lock, g_ipaintOffCount, Is_All_Button_Reset);
break; break;
} }
default: default:

Loading…
Cancel
Save