From 2dd3ecfc70639a01947ebb51ebe66d08d3aecee8 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 19 Jun 2023 02:39:00 +0200 Subject: [PATCH] Update chiptool (reg access is now safe, creating regs from raw ptrs is unsafe) --- Cargo.lock | 2 +- stm32-data-gen/Cargo.toml | 2 +- stm32-metapac-gen/Cargo.toml | 2 +- stm32-metapac-gen/src/lib.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c7f838..cd01ad0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,7 +49,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chiptool" version = "0.1.0" -source = "git+https://github.com/embassy-rs/chiptool#150ce4a3442001ef73e0c0f29242f8ffa06aedcc" +source = "git+https://github.com/embassy-rs/chiptool?rev=ac6e00be2f28fad41fccc51775042e60445ea4a6#ac6e00be2f28fad41fccc51775042e60445ea4a6" dependencies = [ "anyhow", "clap", diff --git a/stm32-data-gen/Cargo.toml b/stm32-data-gen/Cargo.toml index 7fc4464..9758ccc 100644 --- a/stm32-data-gen/Cargo.toml +++ b/stm32-data-gen/Cargo.toml @@ -17,7 +17,7 @@ quick-xml = { version = "0.26.0", features = ["serialize"] } regex = "1.7.1" serde = { version = "1.0.157", features = ["derive"] } serde_yaml = "0.9.19" -chiptool = { git = "https://github.com/embassy-rs/chiptool" } +chiptool = { git = "https://github.com/embassy-rs/chiptool", rev = "ac6e00be2f28fad41fccc51775042e60445ea4a6" } serde_json = "1.0.94" rayon = { version = "1.7.0", optional = true } stm32-data-serde = { version = "0.1.0", path = "../stm32-data-serde" } diff --git a/stm32-metapac-gen/Cargo.toml b/stm32-metapac-gen/Cargo.toml index 46ccecc..57003f9 100644 --- a/stm32-metapac-gen/Cargo.toml +++ b/stm32-metapac-gen/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" [dependencies] regex = "1.7.1" -chiptool = { git = "https://github.com/embassy-rs/chiptool" } +chiptool = { git = "https://github.com/embassy-rs/chiptool", rev = "ac6e00be2f28fad41fccc51775042e60445ea4a6" } serde = { version = "1.0.157", features = [ "derive" ] } serde_json = "1.0.94" proc-macro2 = "1.0.52" diff --git a/stm32-metapac-gen/src/lib.rs b/stm32-metapac-gen/src/lib.rs index 56cd702..913a165 100644 --- a/stm32-metapac-gen/src/lib.rs +++ b/stm32-metapac-gen/src/lib.rs @@ -101,7 +101,7 @@ impl Gen { let mut extra = format!( "pub fn GPIO(n: usize) -> gpio::Gpio {{ - gpio::Gpio(({} + {}*n) as _) + unsafe {{ gpio::Gpio::from_ptr(({} + {}*n) as _) }} }}", gpio_base, gpio_stride, );