Skip to content

Commit 1426fde

Browse files
authored
Merge pull request #233 from rust-embedded/fa
missed adding field arrays
2 parents dae92c6 + d075942 commit 1426fde

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

CHANGELOG-rust.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ This changelog tracks the Rust `svdtools` project. See
55

66
## [Unreleased]
77

8+
## [v0.3.16] 2024-07-03
9+
10+
* Add possibility to add field arrays
11+
812
## [v0.3.15] 2024-07-02
913

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

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

170-
[Unreleased]: https://github.com/rust-embedded/svdtools/compare/v0.3.15...HEAD
174+
[Unreleased]: https://github.com/rust-embedded/svdtools/compare/v0.3.16...HEAD
175+
[v0.3.16]: https://github.com/rust-embedded/svdtools/compare/v0.3.15...v0.3.16
171176
[v0.3.15]: https://github.com/rust-embedded/svdtools/compare/v0.3.14...v0.3.15
172177
[v0.3.14]: https://github.com/rust-embedded/svdtools/compare/v0.3.13...v0.3.14
173178
[v0.3.13]: https://github.com/rust-embedded/svdtools/compare/v0.3.12...v0.3.13

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "svdtools"
3-
version = "0.3.15"
3+
version = "0.3.16"
44
repository = "https://github.com/rust-embedded/svdtools/"
55
description = "Tool for modifying bugs in CMSIS SVD"
66
authors = [

src/patch/mod.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -517,12 +517,17 @@ fn make_register(radd: &Hash, path: Option<&BlockPath>) -> Result<RegisterInfoBu
517517
Some(h) => {
518518
let mut fields = Vec::new();
519519
for (fname, val) in h {
520-
fields.push(
521-
make_field(val.hash()?, None)?
520+
fields.push({
521+
let fadd = val.hash()?;
522+
let field = make_field(fadd, None)?
522523
.name(fname.str()?.into())
523-
.build(VAL_LVL)?
524-
.single(),
525-
);
524+
.build(VAL_LVL)?;
525+
if let Some(dim) = make_dim_element(fadd)? {
526+
field.array(dim.build(VAL_LVL)?)
527+
} else {
528+
field.single()
529+
}
530+
});
526531
}
527532
Some(fields)
528533
}

0 commit comments

Comments
 (0)