Skip to content

Commit 69a869c

Browse files
bors[bot]icewind1991burrbull
authored
Merge #539
539: add `#[inline(always)]` to register field reader constructors r=burrbull a=icewind1991 Currently field modifications aren't fully inlined Co-authored-by: Robin Appelman <robin@icewind.nl> Co-authored-by: Andrey Zgarbul <zgarbul.andrey@gmail.com>
2 parents e362074 + b4dbb2b commit 69a869c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10+
### Added
11+
12+
- Missing `inline` on field reader constructors
1013
- Support for device.x generation for riscv targets and `__EXTERNAL_INTERRUPTS` vector table
1114
- Re-export base's module for derived peripherals
15+
16+
### Changed
17+
1218
- More Cluster arrays are now emitted as an array rather than a list of
1319
elements. An `ArrayProxy` wrapper is used when a Rust built-in array does not
1420
match the cluster layout. Requires the `--const_generic` command line option.

src/generate/register.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ pub fn fields(
541541
pub struct #name_pc_r(crate::FieldReader<#fty, #name_pc_a>);
542542

543543
impl #name_pc_r {
544+
#[inline(always)]
544545
pub(crate) fn new(bits: #fty) -> Self {
545546
#name_pc_r(crate::FieldReader::new(bits))
546547
}
@@ -563,6 +564,7 @@ pub fn fields(
563564
pub struct #name_pc_r(crate::FieldReader<#fty, #fty>);
564565

565566
impl #name_pc_r {
567+
#[inline(always)]
566568
pub(crate) fn new(bits: #fty) -> Self {
567569
#name_pc_r(crate::FieldReader::new(bits))
568570
}

0 commit comments

Comments
 (0)