diff --git a/RBcore/BHBF.c b/RBcore/BHBF.c index d7d4d0a..787846c 100644 --- a/RBcore/BHBF.c +++ b/RBcore/BHBF.c @@ -70,7 +70,7 @@ static void RBcore_ModuleHandler(const Msg_t *pstMsg) { aiMotorSpeed[0] = iSpeed; aiMotorSpeed[1] = iSpeed; - MsgCenter_SendTo(MODULE_NAME_MOTOR, MOTOR_CMD_SET_SPEED, aiMotorSpeed, sizeof(aiMotorSpeed)); + MsgCenter_SendTo(MODULE_NAME_MOTOR, MOTOR_SET_SPEED, aiMotorSpeed, sizeof(aiMotorSpeed)); } break; } @@ -80,7 +80,7 @@ static void RBcore_ModuleHandler(const Msg_t *pstMsg) { aiMotorSpeed[0] = -iSpeed; aiMotorSpeed[1] = -iSpeed; - MsgCenter_SendTo(MODULE_NAME_MOTOR, MOTOR_CMD_SET_SPEED, aiMotorSpeed, sizeof(aiMotorSpeed)); + MsgCenter_SendTo(MODULE_NAME_MOTOR, MOTOR_SET_SPEED, aiMotorSpeed, sizeof(aiMotorSpeed)); } break; } @@ -90,7 +90,7 @@ static void RBcore_ModuleHandler(const Msg_t *pstMsg) { aiMotorSpeed[0] = -g_stCV.LeftTurnSpeed; aiMotorSpeed[1] = g_stCV.RightTurnSpeed; - MsgCenter_SendTo(MODULE_NAME_MOTOR, MOTOR_CMD_SET_SPEED, aiMotorSpeed, sizeof(aiMotorSpeed)); + MsgCenter_SendTo(MODULE_NAME_MOTOR, MOTOR_SET_SPEED, aiMotorSpeed, sizeof(aiMotorSpeed)); } break; } @@ -100,7 +100,7 @@ static void RBcore_ModuleHandler(const Msg_t *pstMsg) { aiMotorSpeed[0] = g_stCV.LeftTurnSpeed; aiMotorSpeed[1] = -g_stCV.RightTurnSpeed; - MsgCenter_SendTo(MODULE_NAME_MOTOR, MOTOR_CMD_SET_SPEED, aiMotorSpeed, sizeof(aiMotorSpeed)); + MsgCenter_SendTo(MODULE_NAME_MOTOR, MOTOR_SET_SPEED, aiMotorSpeed, sizeof(aiMotorSpeed)); } break; } diff --git a/RBcore/include/BHBF.h b/RBcore/include/BHBF.h index 6256c58..c4f0c7f 100644 --- a/RBcore/include/BHBF.h +++ b/RBcore/include/BHBF.h @@ -75,13 +75,9 @@ extern "C"{ typedef enum { LUA_SHOW_INFO, - MOTOR_CMD_SET_SPEED, // 设置速度 - MOTOR_CMD_SET_POSITION, // 设置位置 - MOTOR_CMD_GET_SPEED, // 获取速度 - MOTOR_CMD_GET_FAULT_CODE, // 获取错误码 - MOTOR_CMD_SET_HOME, // 设置零点 - MOTOR_CMD_SPEED_MODE, // 速度模式 - MOTOR_CMD_POSITION_MODE, // 位置模式 + MOTOR_SET_SPEED, // 设置速度 + MOTOR_GET_SPEED, // 获取速度 + MOTOR_GET_FAULT_CODE, // 获取错误码 MOTOR_CMD_END = 0x0100, CMD_STOP_ALL, // 机器人停止 diff --git a/motor/msp_motor_leisai.c b/motor/msp_motor_leisai.c index 7249c53..ea6c900 100644 --- a/motor/msp_motor_leisai.c +++ b/motor/msp_motor_leisai.c @@ -407,7 +407,7 @@ static int LeiSai_ParseResponse(Motor_Instance_t *pstMotor, const uint8_t *pucDa { pstMotor->m_eState = MOTOR_STATE_ERROR; } - MsgCenter_SendTo(MODULE_NAME_CUSTOM, MOTOR_CMD_GET_FAULT_CODE, uiFaultCode, sizeof(uiFaultCode)); + MsgCenter_SendTo(MODULE_NAME_CUSTOM, MOTOR_GET_FAULT_CODE, uiFaultCode, sizeof(uiFaultCode)); break; } case LEISAI_OD_VELOCITY_ACTUAL: @@ -419,7 +419,7 @@ static int LeiSai_ParseResponse(Motor_Instance_t *pstMotor, const uint8_t *pucDa | (pucData[7] << 24)); iRealVelocity[1] = MotorMgr_SpeedConvertex(pstMotor, iRealVelocity[0]); iRealVelocity[0] = pstMotor->m_stConfig.m_ucMotorID; - MsgCenter_SendTo(MODULE_NAME_CUSTOM, MOTOR_CMD_GET_SPEED, iRealVelocity, sizeof(iRealVelocity)); + MsgCenter_SendTo(MODULE_NAME_CUSTOM, MOTOR_GET_SPEED, iRealVelocity, sizeof(iRealVelocity)); log_d("iRealVelocity[1] = %d", iRealVelocity[1]); break; } diff --git a/project/paint_robot_new/paint_robot_new.c b/project/paint_robot_new/paint_robot_new.c index e25e14e..dc5f905 100644 --- a/project/paint_robot_new/paint_robot_new.c +++ b/project/paint_robot_new/paint_robot_new.c @@ -67,7 +67,7 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg) switch (pstMsg->m_uiMsgID) { - case MOTOR_CMD_GET_FAULT_CODE: + case MOTOR_GET_FAULT_CODE: { uint32_t uiFailtCode[2] = {0}; if (pstMsg->m_uiDataLen >= sizeof(uiFailtCode)) @@ -76,7 +76,7 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg) } break; } - case MOTOR_CMD_GET_SPEED: + case MOTOR_GET_SPEED: { int32_t iCurrentSpeed[2] = {0}; if (pstMsg->m_uiDataLen >= sizeof(iCurrentSpeed)) diff --git a/project/paint_robot_new/paint_robot_new_motors.c b/project/paint_robot_new/paint_robot_new_motors.c index 2c3c5ef..59ba299 100644 --- a/project/paint_robot_new/paint_robot_new_motors.c +++ b/project/paint_robot_new/paint_robot_new_motors.c @@ -61,7 +61,7 @@ static void Motor_ModuleHandler(const Msg_t *pstMsg) switch (pstMsg->m_uiMsgID) { - case MOTOR_CMD_SET_SPEED: + case MOTOR_SET_SPEED: { int aiMotorSpeed[2] = {0}; if (pstMsg->m_uiDataLen >= sizeof(aiMotorSpeed))