Skip to content

Commit 25985dc

Browse files
authored
Merge pull request #272 from rust-embedded/fix-mwv
Fix optional fspec in set_field_modified_write_values
2 parents 566cd03 + a747ff2 commit 25985dc

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG-rust.md

+6-1
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.4.2] 2025-01-25
9+
10+
* Fix optional `fspec` in `set_field_modified_write_values`
11+
812
## [v0.4.1] 2025-01-21
913

1014
* `html`: field `readAction` and `modifiedWriteValues` in `access`
@@ -205,7 +209,8 @@ Other changes:
205209

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

208-
[Unreleased]: https://github.com/rust-embedded/svdtools/compare/v0.4.1...HEAD
212+
[Unreleased]: https://github.com/rust-embedded/svdtools/compare/v0.4.2...HEAD
213+
[v0.4.2]: https://github.com/rust-embedded/svdtools/compare/v0.4.1...v0.4.2
209214
[v0.4.1]: https://github.com/rust-embedded/svdtools/compare/v0.4.0...v0.4.1
210215
[v0.4.0]: https://github.com/rust-embedded/svdtools/compare/v0.3.21...v0.4.0
211216
[v0.3.21]: https://github.com/rust-embedded/svdtools/compare/v0.3.20...v0.3.21

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "svdtools"
3-
version = "0.4.1"
3+
version = "0.4.2"
44
repository = "https://github.com/rust-embedded/svdtools/"
55
description = "Tool for modifying bugs in CMSIS SVD"
66
authors = ["Andrey Zgarbul <[email protected]>", "MarcoIeni"]

src/patch/register.rs

+2
Original file line numberDiff line numberDiff line change
@@ -711,12 +711,14 @@ impl RegisterExt for Register {
711711
}
712712

713713
fn set_field_read_action(&mut self, fspec: &str, action: ReadAction) {
714+
let (fspec, _) = fspec.spec();
714715
for ftag in self.iter_fields(fspec) {
715716
ftag.read_action = Some(action);
716717
}
717718
}
718719

719720
fn set_field_modified_write_values(&mut self, fspec: &str, mwv: ModifiedWriteValues) {
721+
let (fspec, _) = fspec.spec();
720722
for ftag in self.iter_fields(fspec) {
721723
ftag.modified_write_values = if mwv == ModifiedWriteValues::Modify {
722724
None

0 commit comments

Comments
 (0)