diff --git a/RBcore/BHBF.c b/RBcore/BHBF.c index e235e7a..10fa93e 100644 --- a/RBcore/BHBF.c +++ b/RBcore/BHBF.c @@ -249,7 +249,7 @@ void RBcore_Init(void) const osThreadAttr_t GF_Dispatch_attributes = { .name = MODULE_NAME_RBCORE, - .stack_size = 2048, + .stack_size = THREAD_DEFAULT_STACK, .priority = (osPriority_t) osPriorityRealtime1, }; (void)osThreadNew(RBcore_Task, NULL, &GF_Dispatch_attributes); diff --git a/RBcore/TL720D.c b/RBcore/TL720D.c index a44465d..d2b12d3 100644 --- a/RBcore/TL720D.c +++ b/RBcore/TL720D.c @@ -149,7 +149,7 @@ void TL720D_Init(void) const osThreadAttr_t Read_TL720D_attributes = { .name = "Read_TL720D", - .stack_size = 2048, + .stack_size = THREAD_DEFAULT_STACK, .priority = (osPriority_t) osPriorityRealtime1, }; (void)osThreadNew(Read_TL720D, NULL, &Read_TL720D_attributes); diff --git a/RBcore/client_setting.c b/RBcore/client_setting.c index 5b152e0..9c1289a 100644 --- a/RBcore/client_setting.c +++ b/RBcore/client_setting.c @@ -151,7 +151,7 @@ void SendIV_Init(void) const osThreadAttr_t Send_PV_attributes = { .name = MODULE_NAME_SENDIV, - .stack_size = 1024, + .stack_size = THREAD_DEFAULT_STACK, .priority = (osPriority_t) osPriorityRealtime1, }; (void)osThreadNew(Send_IV, NULL, &Send_PV_attributes); diff --git a/RBcore/daemon_task.c b/RBcore/daemon_task.c index 1017d41..54c3136 100644 --- a/RBcore/daemon_task.c +++ b/RBcore/daemon_task.c @@ -171,7 +171,7 @@ void daemon_Init(void) const osThreadAttr_t daemon_attributes = { .name = MODULE_NAME_DAEMON, - .stack_size = 1024, + .stack_size = THREAD_DEFAULT_STACK, .priority = (osPriority_t) osPriorityRealtime1, }; (void)osThreadNew(daemon_task, NULL, &daemon_attributes); diff --git a/RBcore/drv_interface.c b/RBcore/drv_interface.c index eec244f..48b5f68 100644 --- a/RBcore/drv_interface.c +++ b/RBcore/drv_interface.c @@ -268,7 +268,7 @@ void Drv_InterfaceInit(void) const osThreadAttr_t Custom_attributes = { .name = MODULE_NAME_CUSTOM, - .stack_size = 2048, + .stack_size = THREAD_DEFAULT_STACK, .priority = (osPriority_t) osPriorityRealtime1, }; (void)osThreadNew(Custom_Task, NULL, &Custom_attributes); @@ -276,14 +276,14 @@ void Drv_InterfaceInit(void) // 创建电机任务 const osThreadAttr_t motor_task_attributes = { .name = MODULE_NAME_MOTOR, - .stack_size = 2048, + .stack_size = THREAD_DEFAULT_STACK, .priority = (osPriority_t) osPriorityRealtime1, }; (void)osThreadNew(MotorTask, NULL, &motor_task_attributes); const osThreadAttr_t Read_motor_attributes = { .name = "Read_motor", - .stack_size = 2048, + .stack_size = THREAD_DEFAULT_STACK, .priority = (osPriority_t) osPriorityRealtime1, }; (void)osThreadNew(Read_motor, NULL, &Read_motor_attributes); @@ -299,7 +299,7 @@ void Drv_InterfaceInit(void) const osThreadAttr_t Read_PV_attributes = { .name = "Read_PV", - .stack_size = 2048, + .stack_size = THREAD_DEFAULT_STACK, .priority = (osPriority_t) osPriorityRealtime1, }; (void)osThreadNew(Read_PV, NULL, &Read_PV_attributes); diff --git a/RBcore/include/BHBF.h b/RBcore/include/BHBF.h index aab082e..5c17eb8 100644 --- a/RBcore/include/BHBF.h +++ b/RBcore/include/BHBF.h @@ -116,6 +116,8 @@ typedef enum { DAEMON_SET_MK32_UDP, // 置位ComError_MK32_UDP } BHBF_Cmd_e; +#define THREAD_DEFAULT_STACK 4096 + typedef struct { int m_iMode; //正数表示前进,负数表示倒退 int m_iAngle; //目标角度 diff --git a/controller/msp_MK32.c b/controller/msp_MK32.c index dc2801f..5eae2a2 100644 --- a/controller/msp_MK32.c +++ b/controller/msp_MK32.c @@ -138,7 +138,7 @@ void controller_init(void) const osThreadAttr_t MK32_Task_attributes = { .name = "Read_MK32", - .stack_size = 2048, + .stack_size = THREAD_DEFAULT_STACK, .priority = (osPriority_t) osPriorityRealtime1, }; (void)osThreadNew(Read_MK32, NULL, &MK32_Task_attributes); diff --git a/project/paint_robot_new/paint_robot_new.c b/project/paint_robot_new/paint_robot_new.c index e1d5632..0ff41e7 100644 --- a/project/paint_robot_new/paint_robot_new.c +++ b/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("CH15_RT \t%d\n", g_stMK32.CH15_RT); lua_print("PV Info\n"); - lua_print("{%d, %d, %d, %d, %d, %d}\n", - g_stPV.RunMode, g_stPV.RobotSpeed, g_stPV.LaneChangeDistance, (int)g_stPV.Vertical_Calibration, g_stPV.IV_IsRestart_Notified, (int)g_stPV.TimeStamp); + 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, (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; } default: