Skip to content

Commit be1150a

Browse files
committed
use for field array offset
1 parent ab2c67f commit be1150a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2828

2929
### Changed
3030

31+
- use `u8` for field array offset
32+
3133
- [breaking-change] remove `Variant<U, ENUM_A>`, use `Option<ENUM_A>` instead
3234

3335
- split out register size type (`RawType`) from `ResetValue` trait

src/generate/register.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ pub fn fields(
379379
r_impl_items.extend(quote! {
380380
#[doc = #doc]
381381
#inline
382-
pub unsafe fn #name_sc(&self, n: usize) -> #name_pc_r {
382+
pub unsafe fn #name_sc(&self, n: u8) -> #name_pc_r {
383383
#name_pc_r::new ( #value )
384384
}
385385
});
@@ -675,7 +675,7 @@ pub fn fields(
675675
util::replace_suffix(&f.name, suffixes_str),
676676
description
677677
);
678-
offset_entry = quote! {offset: usize,};
678+
offset_entry = quote! {offset: u8,};
679679
} else {
680680
doc = format!("Field `{}` writer - {}", f.name, description);
681681
offset_entry = quote! {};
@@ -699,7 +699,7 @@ pub fn fields(
699699
w_impl_items.extend(quote! {
700700
#[doc = #doc]
701701
#inline
702-
pub unsafe fn #name_sc(&mut self, n: usize) -> #name_pc_w {
702+
pub unsafe fn #name_sc(&mut self, n: u8) -> #name_pc_w {
703703
#name_pc_w { w: self, offset: #offset_calc }
704704
}
705705
});

0 commit comments

Comments
 (0)