|
|
@ -114,8 +114,14 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg) |
|
|
static int iRight_Compensation = 0; |
|
|
static int iRight_Compensation = 0; |
|
|
static int iVehicleSpeed = 1; |
|
|
static int iVehicleSpeed = 1; |
|
|
static int iIsStopOffPaint = 0; |
|
|
static int iIsStopOffPaint = 0; |
|
|
|
|
|
static int iPaint = 1; |
|
|
switch (pstMsg->m_uiMsgID) |
|
|
switch (pstMsg->m_uiMsgID) |
|
|
{ |
|
|
{ |
|
|
|
|
|
case CUSTOM_RESET_PAINT: |
|
|
|
|
|
{ |
|
|
|
|
|
iPaint = 1; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
case CUSTOM_SET_STOP_OFF_PAINT: |
|
|
case CUSTOM_SET_STOP_OFF_PAINT: |
|
|
{ |
|
|
{ |
|
|
iIsStopOffPaint = 1; |
|
|
iIsStopOffPaint = 1; |
|
|
@ -257,6 +263,7 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg) |
|
|
RD_MEMCPY(&paintstate, pstMsg->m_aucData, sizeof(paintstate)); |
|
|
RD_MEMCPY(&paintstate, pstMsg->m_aucData, sizeof(paintstate)); |
|
|
HAL_GPIO_WritePin(OUT_1_GPIO_Port, OUT_1_Pin, paintstate); |
|
|
HAL_GPIO_WritePin(OUT_1_GPIO_Port, OUT_1_Pin, paintstate); |
|
|
} |
|
|
} |
|
|
|
|
|
if (0 == paintstate) iPaint = 0; |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
case CUSTOM_GET_MK32: |
|
|
case CUSTOM_GET_MK32: |
|
|
@ -439,9 +446,10 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg) |
|
|
// 【注意!!!】摇杆行程死区判断开始,除摇杆以外按键在上边都处理完,不然走不下去
|
|
|
// 【注意!!!】摇杆行程死区判断开始,除摇杆以外按键在上边都处理完,不然走不下去
|
|
|
if (abs(g_stMK32.CH2_LY_V) <= g_stCV.Joy_Sticker_Value_Allowance && abs(g_stMK32.CH3_LY_H) <= g_stCV.Joy_Sticker_Value_Allowance) |
|
|
if (abs(g_stMK32.CH2_LY_V) <= g_stCV.Joy_Sticker_Value_Allowance && abs(g_stMK32.CH3_LY_H) <= g_stCV.Joy_Sticker_Value_Allowance) |
|
|
{ |
|
|
{ |
|
|
if (g_stPV.RunMode == 2 || g_stPV.RunMode == 3) |
|
|
if ((g_stPV.RunMode == 2 || g_stPV.RunMode == 3) && 0 == iPaint) |
|
|
{ |
|
|
{ |
|
|
MsgCenter_SendTo(MODULE_NAME_MOTOR, MOTOR_CMD_STOP_AFTER, NULL, 0); |
|
|
MsgCenter_SendTo(MODULE_NAME_MOTOR, MOTOR_CMD_STOP_AFTER, NULL, 0); |
|
|
|
|
|
log_e("MOTOR_CMD_STOP_AFTER"); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
@ -530,8 +538,8 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg) |
|
|
lua_print("PV Info\n"); |
|
|
lua_print("PV Info\n"); |
|
|
lua_print("{%d, %d, %d, %d, %d, %ld}\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, (long long)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("\ng_Paint_State = %d\ng_angle_protect_lock = %d\ng_ipaintOffCount = %d\ng_Is_All_Button_Reset = %d\n", |
|
|
lua_print("\niPaint = %d\ng_Paint_State = %d\ng_angle_protect_lock = %d\ng_ipaintOffCount = %d\ng_Is_All_Button_Reset = %d\n", |
|
|
g_Paint_State, g_angle_protect_lock, g_ipaintOffCount, g_Is_All_Button_Reset); |
|
|
iPaint, g_Paint_State, g_angle_protect_lock, g_ipaintOffCount, g_Is_All_Button_Reset); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
default: |
|
|
default: |
|
|
|