From 7275e5e6e10a4086c908697232286797ca3feaca Mon Sep 17 00:00:00 2001 From: Robofish <1683502971@qq.com> Date: Fri, 3 Oct 2025 15:40:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AEcan?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/User_code/device/dm_imu.c | 1 - assets/User_code/device/motor_dm.c | 6 ++---- assets/User_code/device/motor_lk.c | 3 --- assets/User_code/device/motor_lz.c | 2 -- assets/User_code/device/motor_rm.c | 1 - 5 files changed, 2 insertions(+), 11 deletions(-) diff --git a/assets/User_code/device/dm_imu.c b/assets/User_code/device/dm_imu.c index e05c1de..18b05e5 100644 --- a/assets/User_code/device/dm_imu.c +++ b/assets/User_code/device/dm_imu.c @@ -166,7 +166,6 @@ int8_t DM_IMU_Request(DM_IMU_t *imu, DM_IMU_RID_t rid) { .dlc = 4, }; memcpy(frame.data, tx_data, 4); - BSP_CAN_WaitTxMailboxEmpty(imu->param.can, 1); // 等待发送邮箱空闲 int8_t result = BSP_CAN_TransmitStdDataFrame(imu->param.can, &frame); return (result == BSP_OK) ? DEVICE_OK : DEVICE_ERR; } diff --git a/assets/User_code/device/motor_dm.c b/assets/User_code/device/motor_dm.c index b394d59..a77656f 100644 --- a/assets/User_code/device/motor_dm.c +++ b/assets/User_code/device/motor_dm.c @@ -133,7 +133,7 @@ static int8_t MOTOR_DM_SendMITCmd(MOTOR_DM_t *motor, MOTOR_MIT_Output_t *output) frame.dlc = 8; memcpy(frame.data, data, 8); - BSP_CAN_WaitTxMailboxEmpty(motor->param.can, 1); + return BSP_CAN_TransmitStdDataFrame(motor->param.can, &frame) == BSP_OK ? DEVICE_OK : DEVICE_ERR; } @@ -163,7 +163,6 @@ static int8_t MOTOR_DM_SendPosVelCmd(MOTOR_DM_t *motor, float pos, float vel) { frame.dlc = 8; memcpy(frame.data, data, 8); - BSP_CAN_WaitTxMailboxEmpty(motor->param.can, 1); return BSP_CAN_TransmitStdDataFrame(motor->param.can, &frame) == BSP_OK ? DEVICE_OK : DEVICE_ERR; } @@ -190,7 +189,6 @@ static int8_t MOTOR_DM_SendVelCmd(MOTOR_DM_t *motor, float vel) { frame.dlc = 4; memcpy(frame.data, data, 4); - BSP_CAN_WaitTxMailboxEmpty(motor->param.can, 1); return BSP_CAN_TransmitStdDataFrame(motor->param.can, &frame) == BSP_OK ? DEVICE_OK : DEVICE_ERR; } @@ -460,7 +458,7 @@ int8_t MOTOR_DM_Enable(MOTOR_DM_Param_t *param){ frame.data[5] = 0xFF; frame.data[6] = 0xFF; frame.data[7] = 0xFC; - BSP_CAN_WaitTxMailboxEmpty(motor->param.can, 1); + return BSP_CAN_TransmitStdDataFrame(motor->param.can, &frame) == BSP_OK ? DEVICE_OK : DEVICE_ERR; } diff --git a/assets/User_code/device/motor_lk.c b/assets/User_code/device/motor_lk.c index c7911d6..c26878e 100644 --- a/assets/User_code/device/motor_lk.c +++ b/assets/User_code/device/motor_lk.c @@ -253,7 +253,6 @@ int8_t MOTOR_LK_SetOutput(MOTOR_LK_Param_t *param, float value) { tx_frame.data[5] = (uint8_t)((torque_control >> 8) & 0xFF); tx_frame.data[6] = 0x00; tx_frame.data[7] = 0x00; - BSP_CAN_WaitTxMailboxEmpty(param->can, 1); // 等待发送邮箱空闲 return BSP_CAN_TransmitStdDataFrame(param->can, &tx_frame) == BSP_OK ? DEVICE_OK : DEVICE_ERR; } @@ -279,7 +278,6 @@ int8_t MOTOR_LK_MotorOn(MOTOR_LK_Param_t *param) { tx_frame.data[5] = 0x00; tx_frame.data[6] = 0x00; tx_frame.data[7] = 0x00; - BSP_CAN_WaitTxMailboxEmpty(param->can, 1); // 等待发送邮箱空闲 return BSP_CAN_TransmitStdDataFrame(param->can, &tx_frame) == BSP_OK ? DEVICE_OK : DEVICE_ERR; } @@ -299,7 +297,6 @@ int8_t MOTOR_LK_MotorOff(MOTOR_LK_Param_t *param) { tx_frame.data[5] = 0x00; tx_frame.data[6] = 0x00; tx_frame.data[7] = 0x00; - BSP_CAN_WaitTxMailboxEmpty(param->can, 1); // 等待发送邮箱空闲 return BSP_CAN_TransmitStdDataFrame(param->can, &tx_frame) == BSP_OK ? DEVICE_OK : DEVICE_ERR; } diff --git a/assets/User_code/device/motor_lz.c b/assets/User_code/device/motor_lz.c index eb55f36..3b79542 100644 --- a/assets/User_code/device/motor_lz.c +++ b/assets/User_code/device/motor_lz.c @@ -134,7 +134,6 @@ static int8_t MOTOR_LZ_SendExtFrame(BSP_CAN_t can, uint32_t ext_id, uint8_t *dat } else { memset(tx_frame.data, 0, dlc); } - BSP_CAN_WaitTxMailboxEmpty(can, 1); // 等待发送邮箱空闲 return BSP_CAN_TransmitExtDataFrame(can, &tx_frame) == BSP_OK ? DEVICE_OK : DEVICE_ERR; } @@ -369,7 +368,6 @@ int8_t MOTOR_LZ_MotionControl(MOTOR_LZ_Param_t *param, MOTOR_LZ_MotionParam_t *m uint16_t raw_kd = MOTOR_LZ_FloatToRawPositive(send_param.kd, LZ_KD_MAX); data[6] = (raw_kd >> 8) & 0xFF; data[7] = raw_kd & 0xFF; - BSP_CAN_WaitTxMailboxEmpty(param->can, 1); // 等待发送邮箱空闲 return MOTOR_LZ_SendExtFrame(param->can, ext_id, data, 8); } diff --git a/assets/User_code/device/motor_rm.c b/assets/User_code/device/motor_rm.c index e38073a..ba10434 100644 --- a/assets/User_code/device/motor_rm.c +++ b/assets/User_code/device/motor_rm.c @@ -291,7 +291,6 @@ int8_t MOTOR_RM_Ctrl(MOTOR_RM_Param_t *param) { default: return DEVICE_ERR; } - BSP_CAN_WaitTxMailboxEmpty(param->can, 1); // 等待发送邮箱空闲 return BSP_CAN_TransmitStdDataFrame(param->can, &tx_frame) == BSP_OK ? DEVICE_OK : DEVICE_ERR; }