diff --git a/project/paint_robot_new/paint_robot_new.c b/project/paint_robot_new/paint_robot_new.c index b675162..7f2062f 100644 --- a/project/paint_robot_new/paint_robot_new.c +++ b/project/paint_robot_new/paint_robot_new.c @@ -279,7 +279,9 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg) // 急停或者遥控器失联 if ((g_stMK32.CH8_SE == -1000 && g_stMK32.CH9_SF == -1000) - || g_stMK32.IsOnline == 0 || g_stIV.Left_Motor_Err != 0 || g_stIV.Right_Motor_Err != 0) + || (g_stMK32.IsOnline == 0 && (g_stMK32.CH8_SE == -1000 || g_stMK32.CH8_SE == 1000 || g_stMK32.CH8_SE == 0) + && (g_stMK32.CH9_SF == -1000 || g_stMK32.CH9_SF == 1000 || g_stMK32.CH9_SF == 0)) + || g_stIV.Left_Motor_Err != 0 || g_stIV.Right_Motor_Err != 0) { MsgCenter_SendTo(MODULE_NAME_MOTOR, MOTOR_POWER_DISABLE, NULL, 0); MsgCenter_SendTo(MODULE_NAME_RBCORE, RBCORE_CMD_STOP_ALL, NULL, 0);