From 494eb1a14d203d7efd110f47f9b7d92e223c99db Mon Sep 17 00:00:00 2001 From: zyx Date: Sat, 23 Nov 2024 10:20:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=9A=90=E8=97=8Fbug(?= =?UTF-8?q?=E6=95=B0=E7=BB=84=E8=B6=8A=E7=95=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/shoot/shoot.c | 2 +- modules/motor/DJImotor/dji_motor.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/application/shoot/shoot.c b/application/shoot/shoot.c index 36988e5..297db2b 100644 --- a/application/shoot/shoot.c +++ b/application/shoot/shoot.c @@ -63,7 +63,7 @@ void ShootInit() Motor_Init_Config_s loader_config = { .can_init_config = { .can_handle = &hcan2, - .tx_id = 1 + .tx_id = 1, }, .controller_param_init_config = { .angle_PID = { diff --git a/modules/motor/DJImotor/dji_motor.c b/modules/motor/DJImotor/dji_motor.c index d9e877b..673b296 100644 --- a/modules/motor/DJImotor/dji_motor.c +++ b/modules/motor/DJImotor/dji_motor.c @@ -44,10 +44,11 @@ static CANInstance sender_assignment[10] = { }; /** - * @brief 6个用于确认是否有电机注册到sender_assignment中的标志位,防止发送空帧,此变量将在DJIMotorControl()使用 + * @brief 10个用于确认是否有电机注册到sender_assignment中的标志位,防止发送空帧,此变量将在DJIMotorControl()使用 * flag的初始化在 MotorSenderGrouping()中进行 + * 6个会发生数组越界 */ -static uint8_t sender_enable_flag[6] = {0}; +static uint8_t sender_enable_flag[10] = {0}; /** * @brief 根据电调/拨码开关上的ID,根据说明书的默认id分配方式计算发送ID和接收ID,