Files
STM32_CubeMX_HAL_Template_C/.vscode/tasks.json
2025-09-01 22:44:25 +08:00

80 lines
1.3 KiB
JSON

{
"version": "2.0.0",
"tasks": [
{
"label": "Configure CMake",
"type": "shell",
"command": "cmake",
"args": [
"--preset",
"${input:build_type}"
],
"problemMatcher": []
},
{
"label": "Build",
"type": "shell",
"command": "cmake",
"args": [
"--build",
"--preset",
"${input:build_type}",
"--parallel"
],
"group": {
"kind": "build"
},
"dependsOn": [
"Configure CMake"
]
},
{
"label": "Clean",
"type": "shell",
"command": "cmake",
"args": [
"--build",
"build/${input:build_type}",
"--target",
"clean"
],
"group": "build",
"problemMatcher": []
},
{
"label": "Flash (OpenOCD)",
"type": "shell",
"command": "openocd",
"args": [
"-s",
"/usr/share/openocd/scripts",
"-f",
"${workspaceFolder}/ocd.cfg",
"-c",
"tcl_port disabled",
"-c",
"gdb_port disabled",
"-c",
"program ${workspaceFolder}/build/${input:build_type}/${workspaceFolderBasename}.elf verify reset",
"-c",
"shutdown"
],
"group": "build",
"dependsOn": [
"Build"
]
},
],
"inputs": [
{
"id": "build_type",
"type": "pickString",
"options": [
"Debug",
"Release"
],
"description": "选择构建类型 (Select Build Type)",
"default": "Debug"
}
]
}