diff --git a/Src/usbd_conf.c b/Src/usbd_conf.c index 4d67d2a..43bd48a 100644 --- a/Src/usbd_conf.c +++ b/Src/usbd_conf.c @@ -95,11 +95,13 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle) HAL_NVIC_SetPriority(OTG_FS_IRQn, 5, 0); HAL_NVIC_EnableIRQ(OTG_FS_IRQn); /* USER CODE BEGIN USB_OTG_FS_MspInit 1 */ - // 上电后重新枚举usb设备 + + // 上电后重新枚举usb设备 HAL_GPIO_WritePin(GPIOA, GPIO_PIN_12, GPIO_PIN_RESET); - DWT_Delay(100); - HAL_GPIO_WritePin(GPIOA, GPIO_PIN_12, GPIO_PIN_RESET); - DWT_Delay(100); + DWT_Delay(0.1); + HAL_GPIO_WritePin(GPIOA, GPIO_PIN_12, GPIO_PIN_SET); + DWT_Delay(0.1); + /* USER CODE END USB_OTG_FS_MspInit 1 */ } } diff --git a/modules/motor/DJImotor/dji_motor.c b/modules/motor/DJImotor/dji_motor.c index e9345cc..bc215d4 100644 --- a/modules/motor/DJImotor/dji_motor.c +++ b/modules/motor/DJImotor/dji_motor.c @@ -300,7 +300,7 @@ void DJIMotorControl() // 若该电机处于停止状态,直接将buff置零 if (motor->stop_flag == MOTOR_STOP) - memset(sender_assignment[group].tx_buff + 2 * num, 0, 16u); + memset(sender_assignment[group].tx_buff + 2 * num, 0, sizeof(uint16_t)); } // 遍历flag,检查是否要发送这一帧报文