From d7a56e656b200f5c5266368de6d27264d6ee298c Mon Sep 17 00:00:00 2001 From: Robofish <1683502971@qq.com> Date: Sat, 20 Sep 2025 00:50:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9lk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/User_code/device/motor_lk.c | 6 +++--- assets/User_code/device/motor_lz.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/User_code/device/motor_lk.c b/assets/User_code/device/motor_lk.c index d556c3c..c7911d6 100644 --- a/assets/User_code/device/motor_lk.c +++ b/assets/User_code/device/motor_lk.c @@ -253,7 +253,7 @@ 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_WaitForEmptyMailbox(param->can, 1); + BSP_CAN_WaitTxMailboxEmpty(param->can, 1); // 等待发送邮箱空闲 return BSP_CAN_TransmitStdDataFrame(param->can, &tx_frame) == BSP_OK ? DEVICE_OK : DEVICE_ERR; } @@ -279,7 +279,7 @@ 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 +299,7 @@ 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 7d6e048..eb55f36 100644 --- a/assets/User_code/device/motor_lz.c +++ b/assets/User_code/device/motor_lz.c @@ -369,7 +369,7 @@ 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_WaitForEmptyMailbox(param->can, 1); + BSP_CAN_WaitTxMailboxEmpty(param->can, 1); // 等待发送邮箱空闲 return MOTOR_LZ_SendExtFrame(param->can, ext_id, data, 8); }