From dff95dee9e677e42a0dd5c5c51a800a1aca86b39 Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Thu, 17 Sep 2026 15:53:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=89=8B=E5=8A=A8=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E5=81=9C=E8=BD=A6=E5=85=B3=E6=9E=AA=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=AF=BC=E8=87=B4=E7=9A=84=E5=96=B7=E6=9E=AA=E5=BC=80?= =?UTF-8?q?=E5=85=B3=E6=8A=96=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/paint_robot_new/paint_robot_new.c | 13 +++++++++++-- project/paint_robot_new/paint_robot_new_motors.c | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/project/paint_robot_new/paint_robot_new.c b/project/paint_robot_new/paint_robot_new.c index 489db45..117d681 100644 --- a/project/paint_robot_new/paint_robot_new.c +++ b/project/paint_robot_new/paint_robot_new.c @@ -114,8 +114,13 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg) static int iLeft_Compensation = 0; static int iRight_Compensation = 0; static int iVehicleSpeed = 1; + static int iIsStopOffPaint = 0; switch (pstMsg->m_uiMsgID) { + case CUSTOM_SET_STOP_OFF_PAINT: + { + iIsStopOffPaint = 1; + } case CUSTOM_GET_DAEMON_CODE: { if (pstMsg->m_uiDataLen >= sizeof(int32_t)) @@ -359,11 +364,15 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg) { if (g_stMK32.CH6_SC == -1000) { - g_Paint_State = 0; - MsgCenter_SendTo(MODULE_NAME_CUSTOM, CUSTOM_CMD_PAINTGUN, &g_Paint_State, sizeof(int)); + if (0 == iIsStopOffPaint) + { + g_Paint_State = 0; + MsgCenter_SendTo(MODULE_NAME_CUSTOM, CUSTOM_CMD_PAINTGUN, &g_Paint_State, sizeof(int)); + } } else { + iIsStopOffPaint = 0; g_Paint_State = 1; MsgCenter_SendTo(MODULE_NAME_CUSTOM, CUSTOM_CMD_PAINTGUN, &g_Paint_State, sizeof(int)); } diff --git a/project/paint_robot_new/paint_robot_new_motors.c b/project/paint_robot_new/paint_robot_new_motors.c index 740d48c..aca475a 100644 --- a/project/paint_robot_new/paint_robot_new_motors.c +++ b/project/paint_robot_new/paint_robot_new_motors.c @@ -83,6 +83,7 @@ static void Motor_ModuleHandler(const Msg_t *pstMsg) } if (0 == iVehicleMove && 1 == g_iLastVehicleMove) { + MsgCenter_SendTo(MODULE_NAME_CUSTOM, CUSTOM_SET_STOP_OFF_PAINT, NULL, 0); MsgCenter_SendTo(MODULE_NAME_CUSTOM, COMMON_CMD_STOP_ALL, NULL, 0);//先关枪 } g_iLastVehicleMove = iVehicleMove; @@ -104,6 +105,7 @@ static void Motor_ModuleHandler(const Msg_t *pstMsg) iVehicleMove = 0; if (1 == g_iLastVehicleMove) { + MsgCenter_SendTo(MODULE_NAME_CUSTOM, CUSTOM_SET_STOP_OFF_PAINT, NULL, 0); MsgCenter_SendTo(MODULE_NAME_CUSTOM, COMMON_CMD_STOP_ALL, NULL, 0);//先关枪 } g_iLastVehicleMove = 0;