Skip to content

Commit 74e8004

Browse files
bors[bot]burrbull
andauthored
Merge #469
469: Remove `_mut` version of alternate register access function r=therealprof a=burrbull As we use `vcell` to access register contents, we don't need mutable references for this. Co-authored-by: Zgarbul Andrey <[email protected]>
2 parents 5b392b4 + b9d8616 commit 74e8004

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/generate/peripheral.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@ fn register_or_cluster_block(
462462

463463
if is_region_a_union {
464464
let name = &reg_block_field.field.ident;
465-
let mut_name = Ident::new(&format!("{}_mut", name.as_ref().unwrap()), span);
466465
let ty = &reg_block_field.field.ty;
467466
let offset = reg_block_field.offset as usize;
468467
have_accessors = true;
@@ -474,14 +473,6 @@ fn register_or_cluster_block(
474473
&*(((self as *const Self) as *const u8).add(#offset) as *const #ty)
475474
}
476475
}
477-
478-
#[doc = #comment]
479-
#[inline(always)]
480-
pub fn #mut_name(&self) -> &mut #ty {
481-
unsafe {
482-
&mut *(((self as *const Self) as *mut u8).add(#offset) as *mut #ty)
483-
}
484-
}
485476
});
486477
} else {
487478
region_fields.extend(quote! {

0 commit comments

Comments
 (0)