From 69637ce5afc1061a8b4e16c7f53899b21c45a71d Mon Sep 17 00:00:00 2001
From: 97gushan <97gustavh@gmail.com>
Date: Wed, 1 Apr 2020 09:46:07 +0200
Subject: [PATCH] fetch new bare labs

---
 .vscode/launch.json | 2 +-
 .vscode/tasks.json  | 4 ++--
 Cargo.toml          | 6 +++---
 examples/bare2.rs   | 9 +++++++++
 openocd.cfg         | 2 ++
 5 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/.vscode/launch.json b/.vscode/launch.json
index a47fdba..1cc8929 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -18,7 +18,7 @@
             "executable": "./target/thumbv7em-none-eabihf/debug/app",
             "configFiles": [
                 "interface/stlink-v2-1.cfg",
-                "target/stm32f4x.cfg"
+                "target/stm32l0.cfg"
             ],
             "postLaunchCommands": [
                 "monitor arm semihosting enable"
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index c5dc1cf..81f15b9 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -29,8 +29,8 @@
         },
         {
             "type": "shell",
-            "label": "cargo build --example",
-            "command": "cargo build --example ${fileBasenameNoExtension}",
+            "label": "cargo build --examples",
+            "command": "cargo build --example ${fileBasenameNoExtension} --features='rtfm'",
             "group": {
                 "kind": "build",
                 "isDefault": true
diff --git a/Cargo.toml b/Cargo.toml
index 11db3ec..944eddd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,13 +11,13 @@ edition = "2018"
 
 [dependencies]
 panic-halt              = "0.2"
-panic-semihosting       = "0.5" # comment out for `cargo doc`
-panic-itm               = "0.4.1" # comment out for `cargo doc`
+#panic-semihosting       = "0.5" # comment out for `cargo doc`
+#panic-itm               = "0.4.1" # comment out for `cargo doc`
 cortex-m-semihosting    = "0.3.5"
 aligned                 = "0.3.2"
 ufmt                    = "0.1.0"
 nb                      = "0.1.2"
-heapless = "0.5.3"
+heapless                = "0.5.3"
 
 [dependencies.cortex-m]
 version         = "0.6.2"
diff --git a/examples/bare2.rs b/examples/bare2.rs
index 231e357..4a874d2 100644
--- a/examples/bare2.rs
+++ b/examples/bare2.rs
@@ -34,6 +34,15 @@ fn main() -> ! {
     let mut dwt = p.DWT;
 
     iprintln!(stim, "bare2");
+    #[interrupt(priority = 3, resources = [RX, INT])]
+    fn EXTI0_1() {
+        resources.INT.clear_irq(resources.RX.pin_number());
+        hprintln!("{}", resources.RX.pin_number()).unwrap();
+        // spawn.button_event().unwrap();
+
+        // let mut int = resources.INT;     
+    }
+
 
     dwt.enable_cycle_counter();
 
diff --git a/openocd.cfg b/openocd.cfg
index b168324..498dfe9 100644
--- a/openocd.cfg
+++ b/openocd.cfg
@@ -1,3 +1,4 @@
+# source [find interface/stlink.cfg]
 source [find interface/stlink-v2-1.cfg]
 
 transport select hla_swd
@@ -5,6 +6,7 @@ transport select hla_swd
 # increase working area to 64KB
 # set WORKAREASIZE 0x10000
 
+# source [find target/stm32l0.cfg]
 source [find target/stm32f4x.cfg]
 
 # reset_config srst_only
-- 
GitLab