Update chiptool (reg access is now safe, creating regs from raw ptrs is unsafe)

This commit is contained in:
Dario Nieuwenhuis 2023-06-19 02:39:00 +02:00
parent 19f5df6144
commit 2dd3ecfc70
4 changed files with 4 additions and 4 deletions

2
Cargo.lock generated
View File

@ -49,7 +49,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "chiptool" name = "chiptool"
version = "0.1.0" 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 = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",

View File

@ -17,7 +17,7 @@ quick-xml = { version = "0.26.0", features = ["serialize"] }
regex = "1.7.1" regex = "1.7.1"
serde = { version = "1.0.157", features = ["derive"] } serde = { version = "1.0.157", features = ["derive"] }
serde_yaml = "0.9.19" 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" serde_json = "1.0.94"
rayon = { version = "1.7.0", optional = true } rayon = { version = "1.7.0", optional = true }
stm32-data-serde = { version = "0.1.0", path = "../stm32-data-serde" } stm32-data-serde = { version = "0.1.0", path = "../stm32-data-serde" }

View File

@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
[dependencies] [dependencies]
regex = "1.7.1" 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 = { version = "1.0.157", features = [ "derive" ] }
serde_json = "1.0.94" serde_json = "1.0.94"
proc-macro2 = "1.0.52" proc-macro2 = "1.0.52"

View File

@ -101,7 +101,7 @@ impl Gen {
let mut extra = format!( let mut extra = format!(
"pub fn GPIO(n: usize) -> gpio::Gpio {{ "pub fn GPIO(n: usize) -> gpio::Gpio {{
gpio::Gpio(({} + {}*n) as _) unsafe {{ gpio::Gpio::from_ptr(({} + {}*n) as _) }}
}}", }}",
gpio_base, gpio_stride, gpio_base, gpio_stride,
); );