File tree 3 files changed +17
-8
lines changed
3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ This changelog tracks the Rust `svdtools` project. See
5
5
6
6
## [ Unreleased]
7
7
8
+ ## [ v0.4.0] 2025-01-06
9
+
10
+ * ** breaking** Support "?~ " in field ` _modify ` & ` _derive `
11
+ * Keep position when merge fields
12
+
8
13
## [ v0.3.21] 2024-12-31
9
14
10
15
* ` _derive ` field
@@ -195,7 +200,8 @@ Other changes:
195
200
196
201
* Initial release with feature-parity with the Python project.
197
202
198
- [ Unreleased ] : https://github.com/rust-embedded/svdtools/compare/v0.3.21...HEAD
203
+ [ Unreleased ] : https://github.com/rust-embedded/svdtools/compare/v0.4.0...HEAD
204
+ [ v0.4.0 ] : https://github.com/rust-embedded/svdtools/compare/v0.3.21...v0.4.0
199
205
[ v0.3.21 ] : https://github.com/rust-embedded/svdtools/compare/v0.3.20...v0.3.21
200
206
[ v0.3.20 ] : https://github.com/rust-embedded/svdtools/compare/v0.3.19...v0.3.20
201
207
[ v0.3.19 ] : https://github.com/rust-embedded/svdtools/compare/v0.3.18...v0.3.19
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " svdtools"
3
- version = " 0.3.21 "
3
+ version = " 0.4.0 "
4
4
repository = " https://github.com/rust-embedded/svdtools/"
5
5
description = " Tool for modifying bugs in CMSIS SVD"
6
6
authors = [
" Andrey Zgarbul <[email protected] >" ,
" MarcoIeni" ]
Original file line number Diff line number Diff line change @@ -454,23 +454,26 @@ impl RegisterExt for Register {
454
454
"Could not find any fields to merge {rpath}:{key}. Present fields: {present}.`"
455
455
) ) ;
456
456
}
457
- let mut bitwidth = 0 ;
458
- let mut bitoffset = u32:: MAX ;
459
- let mut first = true ;
460
- let mut desc = None ;
461
457
if let Some ( fields) = self . fields . as_mut ( ) {
462
- for f in fields. iter_mut ( ) {
458
+ let mut bitwidth = 0 ;
459
+ let mut bitoffset = u32:: MAX ;
460
+ let mut pos = usize:: MAX ;
461
+ let mut first = true ;
462
+ let mut desc = None ;
463
+ for ( i, f) in fields. iter_mut ( ) . enumerate ( ) {
463
464
if names. contains ( & f. name ) {
464
465
if first {
465
466
desc. clone_from ( & f. description ) ;
466
467
first = false ;
467
468
}
468
469
bitwidth += f. bit_range . width ;
469
470
bitoffset = bitoffset. min ( f. bit_range . offset ) ;
471
+ pos = pos. min ( i) ;
470
472
}
471
473
}
472
474
fields. retain ( |f| !names. contains ( & f. name ) ) ;
473
- fields. push (
475
+ fields. insert (
476
+ pos,
474
477
FieldInfo :: builder ( )
475
478
. name ( name)
476
479
. description ( desc)
You can’t perform that action at this time.
0 commit comments