From 79c5a8f5a7716bec926761de5093e2213c1a71a7 Mon Sep 17 00:00:00 2001
From: Per Lindgren <per.lindgren@ltu.se>
Date: Sat, 1 Feb 2020 16:47:10 +0100
Subject: [PATCH] .vscode

---
 .vscode/launch.json | 133 ++++++++++++++++++++++++++++++++++++++++++++
 .vscode/tasks.json  |  52 +++++++++++++++++
 2 files changed, 185 insertions(+)
 create mode 100644 .vscode/launch.json
 create mode 100644 .vscode/tasks.json

diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..fd6b8ea
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,133 @@
+{
+    // Use IntelliSense to learn about possible attributes.
+    // Hover to view descriptions of existing attributes.
+    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "type": "cortex-debug",
+            "request": "launch",
+            "servertype": "openocd",
+            "name": "app (debug)",
+            "preLaunchTask": "cargo build",
+            "executable": "./target/thumbv7em-none-eabihf/debug/app",
+            "configFiles": [
+                "interface/stlink.cfg",
+                "target/stm32f4x.cfg"
+            ],
+            "postLaunchCommands": [
+                "monitor arm semihosting enable"
+            ],
+            "cwd": "${workspaceRoot}"
+        },
+        {
+            "type": "cortex-debug",
+            "request": "launch",
+            "servertype": "openocd",
+            "name": "itm (debug)",
+            "preLaunchTask": "cargo build --examples",
+            "executable": "./target/thumbv7em-none-eabihf/debug/examples/itm",
+            "configFiles": [
+                "interface/stlink.cfg",
+                "target/stm32f4x.cfg"
+            ],
+            "postLaunchCommands": [
+                "monitor arm semihosting enable",
+            ],
+            "swoConfig": {
+                "enabled": true,
+                "cpuFrequency": 16000000,
+                "swoFrequency": 2000000,
+                "source": "probe",
+                "decoders": [
+                    {
+                        "type": "console",
+                        "label": "ITM",
+                        "port": 0
+                    }
+                ]
+            },
+            "cwd": "${workspaceRoot}"
+        },
+        {
+            "type": "cortex-debug",
+            "request": "launch",
+            "servertype": "openocd",
+            "name": "itm (debug) fifo",
+            "preLaunchTask": "cargo build --examples",
+            "executable": "./target/thumbv7em-none-eabihf/debug/examples/itm",
+            "configFiles": [
+                "interface/stlink.cfg",
+                "target/stm32f4x.cfg"
+            ],
+            "postLaunchCommands": [
+                "monitor arm semihosting enable",
+                "monitor tpiu config internal /tmp/itm.fifo uart off 16000000"
+            ],
+            "cwd": "${workspaceRoot}"
+        },
+        {
+            "type": "cortex-debug",
+            "request": "launch",
+            "servertype": "openocd",
+            "name": "bare0 (debug)",
+            "preLaunchTask": "cargo build --examples",
+            "executable": "./target/thumbv7em-none-eabihf/debug/examples/bare0",
+            "configFiles": [
+                "./openocd.cfg",
+            ],
+            "postLaunchCommands": [
+                "monitor arm semihosting enable"
+            ],
+            "cwd": "${workspaceRoot}"
+        },
+        {
+            "type": "cortex-debug",
+            "request": "launch",
+            "servertype": "openocd",
+            "name": "app (release)",
+            "preLaunchTask": "cargo build --release",
+            "executable": "./target/thumbv7em-none-eabihf/release/app",
+            "configFiles": [
+                "./openocd.cfg",
+            ],
+            "postLaunchCommands": [
+                "monitor arm semihosting enable"
+            ],
+            "cwd": "${workspaceRoot}"
+        },
+        {
+            "type": "cortex-debug",
+            "request": "launch",
+            "servertype": "openocd",
+            "name": "funnel (debug)",
+            "preLaunchTask": "cargo build --examples",
+            "executable": "./target/thumbv7em-none-eabihf/debug/examples/funnel",
+            "configFiles": [
+                "./openocd.cfg",
+            ],
+            "postLaunchCommands": [
+                "monitor arm semihosting enable"
+            ],
+            "swoConfig": {
+                "enabled": true,
+                "cpuFrequency": 16000000,
+                "swoFrequency": 2000000,
+                "source": "probe",
+                "decoders": [
+                    {
+                        "type": "console",
+                        "label": "ITM0",
+                        "port": 0
+                    },
+                    {
+                        "type": "console",
+                        "label": "ITM1",
+                        "port": 1
+                    }
+                ]
+            },
+            "cwd": "${workspaceRoot}"
+        },
+    ],
+}
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 0000000..aa90589
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,52 @@
+{
+    "tasks": [
+        {
+            "type": "shell",
+            "label": "cargo build",
+            "command": "cargo build",
+            "group": {
+                "kind": "build",
+                "isDefault": true
+            },
+            "problemMatcher": [
+                "$rustc",
+            ]
+        },
+        {
+            "type": "shell",
+            "label": "cargo build --release",
+            "command": "cargo build --release",
+            "group": {
+                "kind": "build",
+                "isDefault": true
+            },
+            "problemMatcher": [
+                "$rustc",
+            ]
+        },
+        {
+            "type": "shell",
+            "label": "cargo build --examples",
+            "command": "cargo build --examples",
+            "group": {
+                "kind": "build",
+                "isDefault": true
+            },
+            "problemMatcher": [
+                "$rustc"
+            ]
+        },
+        {
+            "type": "shell",
+            "label": "cargo build --examples --release",
+            "command": "cargo build --examples --release",
+            "group": {
+                "kind": "build",
+                "isDefault": true
+            },
+            "problemMatcher": [
+                "$rustc"
+            ]
+        }
+    ]
+}
\ No newline at end of file
-- 
GitLab