From 45009814713ccc9cfeff76146a5562bb38cce30d Mon Sep 17 00:00:00 2001
From: Per <Per Lindgren>
Date: Sun, 22 Oct 2017 20:47:48 +0200
Subject: [PATCH] polishing

---
 .vscode/launch.json | 23 ++++++-----------------
 .vscode/tasks.json  |  5 +----
 src/main.rs         | 13 ++++++++-----
 3 files changed, 15 insertions(+), 26 deletions(-)

diff --git a/.vscode/launch.json b/.vscode/launch.json
index cf8d8a9..efdb5fb 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -9,17 +9,14 @@
             "request": "attach",
             "name": "Release",
             "gdbpath": "/usr/bin/arm-none-eabi-gdb",
-            "executable": "./target/thumbv7em-none-eabihf/release/bluepill",
+            //"executable": "./target/thumbv7em-none-eabihf/release/bluepill",
             "target": ":3333",
             "remote": true,
             "autorun": [
                 "monitor arm semihosting enable",
                 "monitor reset init",
-                //"set target-async off",
-                "load ./target/thumbv7em-none-eabihf/release/bluepill"
-                //"set remotetimeout 30",
-                //"monitor reset halt",
-                //"step"
+                "file ./target/thumbv7em-none-eabihf/release/bluepill",
+                "load"
             ],
             "cwd": "${workspaceRoot}"
         },
@@ -28,22 +25,14 @@
             "request": "attach",
             "name": "Debug",
             "gdbpath": "/usr/bin/arm-none-eabi-gdb",
-            "executable": "./target/thumbv7em-none-eabihf/debug/bluepill",
+            //"executable": "./target/thumbv7em-none-eabihf/debug/bluepill",
             "target": ":3333",
             "remote": true,
             "autorun": [
                 "monitor reset init",
                 "monitor arm semihosting enable",
-                "set mem inaccessible-by-default off",
-                "d breakpoints",
-                //"set target-async off",
-                "set remotetimeout 300",
-                //"monitor reset halt",
-                "load ./target/thumbv7em-none-eabihf/debug/bluepill",
-                "step",
-                "monitor reset halt"
-                //"info target"
-                //"cont"
+                "file ./target/thumbv7em-none-eabihf/debug/bluepill",
+                "load"
             ],
             "cwd": "${workspaceRoot}"
         }
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index e16c85b..fd45ed4 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -7,10 +7,6 @@
             "taskName": "xargo build --release",
             "type": "shell",
             "command": "xargo build --release",
-            "group": {
-                "kind": "build",
-                "isDefault": true
-            },
             "problemMatcher": [
                 "$rustc"
             ]
@@ -21,6 +17,7 @@
             "command": "xargo build",
             "group": {
                 "kind": "build",
+                "isDefault": true
             },
             "problemMatcher": [
                 "$rustc"
diff --git a/src/main.rs b/src/main.rs
index 1c913db..6f74b52 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -233,16 +233,19 @@ fn main() {
     writeln!(stdout, "{:#08x}", codgen(&mut seed)).unwrap();
 
     seed = 0x0e0657c1;
-    //asm::bkpt();
+    asm::bkpt();
     unsafe {
         (*DWT.get()).enable_cycle_counter();
         (*DWT.get()).cyccnt.write(0);
     }
-    //asm::bkpt();
+    asm::bkpt();
     decode(&ABC, unsafe { &mut PLAIN }, &mut seed);
-    //asm::bkpt();
-    writeln!(stdout, "string {}", from_utf8(unsafe { &PLAIN }).unwrap())
-        .unwrap();
+    asm::bkpt();
+    writeln!(
+        stdout,
+        "plain string {}",
+        from_utf8(unsafe { &PLAIN }).unwrap()
+    ).unwrap();
 }
 
 // As we are not using interrupts, we just register a dummy catch all handler
-- 
GitLab