From 68d2ce320545332bf57beb1a36e2192ceb518919 Mon Sep 17 00:00:00 2001 From: JiXieShi Date: Sun, 15 Dec 2024 22:42:46 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(.vscode/tasks.json):=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=9B=E5=BB=BA=E6=9E=84=E5=BB=BA=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E7=9A=84=E4=BB=BB=E5=8A=A1=E4=BB=A5=E4=BE=BF=E4=BA=8E?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E8=BF=87=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 fix(.vscode/launch.json): 修改程序路径并启用在入口时停止的选项 🎨 style(.vscode/settings.json): 添加文件关联以增强代码识别 🐛 fix(demo/oled/test.c): 修复睡眠函数调用格式以确保正确执行 --- .vscode/launch.json | 4 +-- .vscode/settings.json | 7 ++++- .vscode/tasks.json | 59 +++++++++++++++++++++++++++++++++++++++++++ demo/oled/test.c | 2 +- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 30c4356..c76cc72 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,9 +8,9 @@ "name": "(gdb) 启动", "type": "cppdbg", "request": "launch", - "program": "${workspaceFolder}/build/HW_Lib.exe", + "program": "${workspaceFolder}/build/HW_Lib", "args": [], - "stopAtEntry": false, + "stopAtEntry": true, "cwd": "${workspaceFolder}/build", "preLaunchTask": "CMake Build", "environment": [], diff --git a/.vscode/settings.json b/.vscode/settings.json index 6b827d7..076281c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,5 +4,10 @@ "C_Cpp.default.customConfigurationVariables": { }, "C_Cpp.inlayHints.autoDeclarationTypes.enabled": false, - "C_Cpp.inlayHints.parameterNames.enabled": true + "C_Cpp.inlayHints.parameterNames.enabled": true, + "files.associations": { + "*.dpf": "yaml", + "compare": "cpp", + "cstdint": "cpp" + } } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ba071ec..e2b1a76 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,10 +1,55 @@ { "version": "2.0.0", "tasks": [ + { + "label": "Create Build Directories", + "type": "shell", + "command": "sh", + "args": [ + "-c", + "mkdir -p build" + ], + "problemMatcher": [], + "detail": "Create necessary directories for builds.", + "windows": { + "command": "cmd.exe", + "args": [ + "/C", + "if not exist build (mkdir build)" + ] + } + }, + { + "label": "CMake Configure", + "type": "shell", + "command": "cmake", + "dependsOn": [ + "Create Build Directories" + ], + "args": [ + "-S", + ".", + "-B", + "build", + "-G", + "${input:cmakeGenerator}" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ], + "detail": "Configure the project using CMake." + }, { "label": "CMake Build", "type": "shell", "command": "cmake", + "dependsOn": [ + "CMake Configure" + ], "args": [ "--build", "build", @@ -20,5 +65,19 @@ ], "detail": "Build the project using CMake and Ninja." } + ], + "inputs": [ + { + "type": "pickString", + "id": "cmakeGenerator", + "options": [ + "Ninja", + "Unix Makefiles", + "MinGW Makefiles", + "Xcode" + ], + "default": "Ninja", + "description": "The CMake generator to use." + } ] } diff --git a/demo/oled/test.c b/demo/oled/test.c index 7b79e97..d8996e4 100644 --- a/demo/oled/test.c +++ b/demo/oled/test.c @@ -140,7 +140,7 @@ int Test_OLED(void *pVoid) { //// sprintf(buf, "DATA:%d", s); //// OLED_ShowString(&oled, 2, 51, buf, 12); // OLED_Refresh(&oled); -// Sleep(200); + Sleep(200); } SIM_OLED_STOP(); }