feat(.vscode/tasks.json): 增加创建构建目录的任务以便于构建过程

🔧 fix(.vscode/launch.json): 修改程序路径并启用在入口时停止的选项

🎨 style(.vscode/settings.json): 添加文件关联以增强代码识别

🐛 fix(demo/oled/test.c): 修复睡眠函数调用格式以确保正确执行
main
JiXieShi 2024-12-15 22:42:46 +08:00
parent 18e6cf26be
commit 68d2ce3205
4 changed files with 68 additions and 4 deletions

4
.vscode/launch.json vendored
View File

@ -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": [],

View File

@ -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"
}
}

59
.vscode/tasks.json vendored
View File

@ -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."
}
]
}

View File

@ -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();
}