We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c88f7c5 commit 225f51aCopy full SHA for 225f51a
src/generate/peripheral.rs
@@ -413,13 +413,16 @@ fn register_or_cluster_block(
413
let name = ®_block_field.field.ident;
414
let mut_name = Ident::new(format!("{}_mut", name.as_ref().unwrap()));
415
let ty = ®_block_field.field.ty;
416
- let offset = reg_block_field.offset;
+ let offset = reg_block_field.offset as usize;
417
accessors.append(quote! {
418
+ #[doc = #comment]
419
pub fn #name(&self) -> &#ty {
420
unsafe {
421
&*(((self as *const Self) as *const u8).add(#offset) as *const #ty)
422
}
423
424
+
425
426
pub fn #mut_name(&self) -> &mut #ty {
427
428
&mut *(((self as *const Self) as *mut u8).add(#offset) as *mut #ty)
0 commit comments