Skip to content

Commit

Permalink
Merge pull request #233 from rust-embedded/fa
Browse files Browse the repository at this point in the history
missed adding field arrays
  • Loading branch information
burrbull authored Jul 3, 2024
2 parents dae92c6 + d075942 commit 1426fde
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ This changelog tracks the Rust `svdtools` project. See

## [Unreleased]

## [v0.3.16] 2024-07-03

* Add possibility to add field arrays

## [v0.3.15] 2024-07-02

* Add `info` tool, only with `device-name` for now
Expand Down Expand Up @@ -167,7 +171,8 @@ Other changes:

* Initial release with feature-parity with the Python project.

[Unreleased]: https://github.com/rust-embedded/svdtools/compare/v0.3.15...HEAD
[Unreleased]: https://github.com/rust-embedded/svdtools/compare/v0.3.16...HEAD
[v0.3.16]: https://github.com/rust-embedded/svdtools/compare/v0.3.15...v0.3.16
[v0.3.15]: https://github.com/rust-embedded/svdtools/compare/v0.3.14...v0.3.15
[v0.3.14]: https://github.com/rust-embedded/svdtools/compare/v0.3.13...v0.3.14
[v0.3.13]: https://github.com/rust-embedded/svdtools/compare/v0.3.12...v0.3.13
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "svdtools"
version = "0.3.15"
version = "0.3.16"
repository = "https://github.com/rust-embedded/svdtools/"
description = "Tool for modifying bugs in CMSIS SVD"
authors = [
Expand Down
15 changes: 10 additions & 5 deletions src/patch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,12 +517,17 @@ fn make_register(radd: &Hash, path: Option<&BlockPath>) -> Result<RegisterInfoBu
Some(h) => {
let mut fields = Vec::new();
for (fname, val) in h {
fields.push(
make_field(val.hash()?, None)?
fields.push({
let fadd = val.hash()?;
let field = make_field(fadd, None)?
.name(fname.str()?.into())
.build(VAL_LVL)?
.single(),
);
.build(VAL_LVL)?;
if let Some(dim) = make_dim_element(fadd)? {
field.array(dim.build(VAL_LVL)?)
} else {
field.single()
}
});
}
Some(fields)
}
Expand Down

0 comments on commit 1426fde

Please sign in to comment.