diff --git a/.gitignore b/.gitignore index ea8c4bf..20efc89 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/target +/**/target diff --git a/.vscode/launch.json b/.vscode/launch.json index 6fdb447..bf7252e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,13 +6,13 @@ "configurations": [ { "name": "Cortex Debug", - "cwd": "${workspaceFolder}", - "executable": "${workspaceFolder}/target/thumbv7m-none-eabi/debug/bluepill-rust-blinky", + "cwd": "${workspaceFolder}/bluepill-rs", + "executable": "${workspaceFolder}/bluepill-rs/target/thumbv7m-none-eabi/debug/bluepill-rs", "request": "launch", "type": "cortex-debug", "preLaunchTask": "cargo build", "servertype": "openocd", - "svdFile": "${workspaceFolder}/STM32F103.svd", + "svdFile": "${workspaceFolder}/bluepill-rs/STM32F103.svd", "configFiles": [ "interface/stlink.cfg", "target/stm32f1x.cfg" diff --git a/.vscode/tasks.json b/.vscode/tasks.json index bda51d2..6294953 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,6 +4,9 @@ { "type": "cargo", "command": "build", + "options": { + "cwd": "${workspaceFolder}/bluepill-rs" + }, "problemMatcher": [ "$rustc" ], diff --git a/.cargo/config b/bluepill-rs/.cargo/config.toml similarity index 100% rename from .cargo/config rename to bluepill-rs/.cargo/config.toml diff --git a/Cargo.lock b/bluepill-rs/Cargo.lock similarity index 96% rename from Cargo.lock rename to bluepill-rs/Cargo.lock index 64b6716..375ef45 100644 --- a/Cargo.lock +++ b/bluepill-rs/Cargo.lock @@ -30,7 +30,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "bluepill-rust-blinky" +name = "bluepill-rs" version = "0.1.0" dependencies = [ "cortex-m", @@ -61,6 +61,7 @@ checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" dependencies = [ "bare-metal 0.2.5", "bitfield", + "critical-section", "embedded-hal 0.2.7", "volatile-register", ] @@ -85,6 +86,12 @@ dependencies = [ "syn", ] +[[package]] +name = "critical-section" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" + [[package]] name = "embedded-dma" version = "0.2.0" diff --git a/Cargo.toml b/bluepill-rs/Cargo.toml similarity index 70% rename from Cargo.toml rename to bluepill-rs/Cargo.toml index 17a6d4c..519cecb 100644 --- a/Cargo.toml +++ b/bluepill-rs/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "bluepill-rust-blinky" +name = "bluepill-rs" version = "0.1.0" edition = "2021" @@ -8,8 +8,8 @@ edition = "2021" [dependencies] embedded-hal = "1.0.0" nb = "1" -cortex-m = "0.7.6" -cortex-m-rt = "0.7.1" +cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } +cortex-m-rt = { version = "0.7.1", features = ["device"] } # Panic behaviour, see https://crates.io/keywords/panic-impl for alternatives panic-halt = "0.2.0" diff --git a/STM32F103.svd b/bluepill-rs/STM32F103.svd similarity index 100% rename from STM32F103.svd rename to bluepill-rs/STM32F103.svd diff --git a/memory.x b/bluepill-rs/memory.x similarity index 100% rename from memory.x rename to bluepill-rs/memory.x diff --git a/src/main.rs b/bluepill-rs/src/main.rs similarity index 100% rename from src/main.rs rename to bluepill-rs/src/main.rs