From eb121bcb56057b54bc39985f6bf474fcec63a061 Mon Sep 17 00:00:00 2001 From: kai <1797003616@qq.com> Date: Sat, 2 Mar 2024 17:04:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=99=9A=E6=8B=9F=E4=B8=B2?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/c_cpp_properties.json | 4 +- .vscode/launch.json | 12 +++++- .vscode/settings.json | 71 ++++------------------------------- .vscode/tasks.json | 4 +- Src/usbd_conf.c | 6 +-- 5 files changed, 22 insertions(+), 75 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 0859405..eec0eb2 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -11,8 +11,8 @@ "_UNICODE" ], "cStandard": "c17", - "cppStandard": "gnu++17", - "intelliSenseMode": "windows-gcc-arm", + "cppStandard": "gnu++14", + "intelliSenseMode": "windows-gcc-x86", "configurationProvider": "ms-vscode.makefile-tools" } ], diff --git a/.vscode/launch.json b/.vscode/launch.json index 0e9742c..704f635 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -21,7 +21,11 @@ ], "runToEntryPoint": "main", // 调试时在main函数入口停下 "rtos": "FreeRTOS", - //"preLaunchTask": "build task",//先运行Build任务编译项目,取消注释即可使用 + "preLaunchTask": "build task",//先运行Build任务编译项目,取消注释即可使用 + "liveWatch": { + "enabled": true, + "samplesPerSecond": 4 + } // dap若要使用log,请使用Jlink调试任务启动,之后再打开log任务 // 若想要在调试前编译并且打开log,可只使用log的prelaunch task并为log任务添加depends on依赖 }, @@ -39,7 +43,11 @@ "interface": "swd", "svdFile": "STM32F407.svd", "rtos": "FreeRTOS", - // "preLaunchTask": "build task",//先运行Build任务,取消注释即可使用 + "preLaunchTask": "build task",//先运行Build任务,取消注释即可使用 + "liveWatch": { + "enabled": true, + "samplesPerSecond": 4 + } //"preLaunchTask": "log", // 调试时同时开启RTT viewer窗口,若daplink使用jlinkGDBserver启动,需要先开始调试再打开log // 若想要在调试前编译并且打开log,可只使用log的prelaunch task并为log任务添加depends on依赖 }, diff --git a/.vscode/settings.json b/.vscode/settings.json index c84d887..fae2d40 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,68 +1,11 @@ { "files.associations": { - "robot_def.h": "c", - "bsp_dwt.h": "c", - "dji_motor.h": "c", - "message_center.h": "c", - "super_cap.h": "c", - "can_comm.h": "c", - "lqr.h": "c", - "math.h": "c", - "stdint.h": "c", - "general_def.h": "c", - "lk9025.h": "c", - "arm_math.h": "c", - "bmi088driver.h": "c", - "bmi088middleware.h": "c", - "bmi088_regndef.h": "c", - "bmi088reg.h": "c", - "balance.h": "c", - "stdlib.h": "c", - "memory.h": "c", - "bsp_usart.h": "c", - "compare": "c", - "limits": "c", - "*.tcc": "c", - "type_traits": "c", - "bsp_log.h": "c", - "segger_rtt.h": "c", - "referee.h": "c", - "referee_communication.h": "c", - "vmc_project.h": "c", - "user_lib.h": "c", - "quaternionekf.h": "c", + "stm32f4xx_hal_def.h": "c", "bsp_usb.h": "c", - "robot.h": "c", - "rm_referee.h": "c", - "stdio.h": "c", - "crc.h": "c", - "bmi088.h": "c", - "cmath": "c", - "ht04.h": "c", - "gain_table.h": "c", - "referee_task.h": "c", - "task.h": "c", - "robot_task.h": "c", - "motor_task.h": "c", - "bsp_flash.h": "c", - "bsp_iic.h": "c", - "usbd_cdc_if.h": "c", - "kf.h": "c", - "none.h": "c", - "buzzer.h": "c", - "bsp_pwm.h": "c", - "main.h": "c", - "stm32f4xx_hal_conf.h": "c", - "master_process.h": "c", - "bsp_can.h": "c", - "can.h": "c", - "servo_motor.h": "c" - }, - // "clangd.arguments": [ - // "-query-driver=C:/msys64/mingw64/bin/arm-none-eabi-*.exe", - // ], - "cortex-debug.variableUseNaturalFormat": true, - "C_Cpp.default.configurationProvider": "ms-vscode.makefile-tools", - // "C_Cpp.default.compilerPath": "D:\\Msys2\\mingw64\\bin\\arm-none-eabi-gcc.exe" - "makefile.compileCommandsPath": "build/compile_commands.json" + "usb_device.h": "c", + "usbd_cdc.h": "c", + "usbd_conf.h": "c", + "usbd_desc.h": "c", + "usbd_cdc_if.h": "c" + } } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 3c32888..00c3de3 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -15,7 +15,7 @@ { "label": "download dap", "type": "shell", // 如果希望在下载前编译,可以把command换成下面的命令 - "command":"mingw32-make download_dap", // "mingw32-make -j24 ; mingw32-make download_dap", + "command":"mingw32-make -j24 ; mingw32-make download_dap", // "mingw32-make -j24 ; mingw32-make download_dap", "group": { // 如果没有修改代码,编译任务不会消耗时间,因此推荐使用上面的替换. "kind": "build", "isDefault": false, @@ -24,7 +24,7 @@ { "label": "download jlink", // 要使用此任务,需添加jlink的环境变量 "type": "shell", - "command":"mingw32-make download_jlink", // "mingw32-make -j24 ; mingw32-make download_dap" + "command":"mingw32-make -j24 ; mingw32-make download_jlink", // "mingw32-make -j24 ; mingw32-make download_jlink" "group": { "kind": "build", "isDefault": false, diff --git a/Src/usbd_conf.c b/Src/usbd_conf.c index 4d67d2a..217c497 100644 --- a/Src/usbd_conf.c +++ b/Src/usbd_conf.c @@ -95,11 +95,7 @@ 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设备 - 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); + /* USER CODE END USB_OTG_FS_MspInit 1 */ } }