From edbf34cf0059b4ab04823aabc8ab80664d350831 Mon Sep 17 00:00:00 2001 From: "Jonathan Pallant (Ferrous Systems)" Date: Thu, 26 Jan 2023 18:52:11 +0000 Subject: [PATCH] Use a task file for the beginner apps. Lets you set the DEFMT_LOG env variable more easily even with VS Code is auto-building the code. --- beginner/apps/.vscode/launch.json | 4 ++-- beginner/apps/.vscode/tasks.json | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 beginner/apps/.vscode/tasks.json diff --git a/beginner/apps/.vscode/launch.json b/beginner/apps/.vscode/launch.json index 5eba276..ec06c3d 100644 --- a/beginner/apps/.vscode/launch.json +++ b/beginner/apps/.vscode/launch.json @@ -7,9 +7,9 @@ "executable": "./target/thumbv7em-none-eabihf/debug/hello", "name": "Debug Microcontroller (launch)", "request": "launch", - "preLaunchTask": "rust: cargo build", + "preLaunchTask": "Build Rust (Debug)", "type": "cortex-debug", - "runToMain": true, + "runToEntryPoint": "main", "configFiles": [ "interface/jlink.cfg", ], diff --git a/beginner/apps/.vscode/tasks.json b/beginner/apps/.vscode/tasks.json new file mode 100644 index 0000000..0fc2cde --- /dev/null +++ b/beginner/apps/.vscode/tasks.json @@ -0,0 +1,27 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Build Rust (Debug)", + "type": "shell", + "command": "cargo build", + "options": { + "env": { + "DEFMT_LOG": "debug", + } + } + }, + { + "label": "Build Rust (Warn)", + "type": "shell", + "command": "cargo build", + "options": { + "env": { + "DEFMT_LOG": "warn", + } + } + } + ] +} \ No newline at end of file