diff --git a/static_pins/static_pins_macros/src/lib.rs b/static_pins/static_pins_macros/src/lib.rs index 6963111..15dd6d4 100644 --- a/static_pins/static_pins_macros/src/lib.rs +++ b/static_pins/static_pins_macros/src/lib.rs @@ -32,6 +32,7 @@ pub fn impl_static_pin(pin: TokenStream) -> TokenStream { let target_field_port = proc_macro2::TokenStream::from_str(&port.to_ascii_lowercase()).unwrap(); + let target_pin = format_ident!("pin{}", port_register_name.to_ascii_lowercase()); let target_data_direction = format_ident!("ddr{}", port_register_name.to_ascii_lowercase()); let trait_name = proc_macro2::TokenStream::from_str("StaticPin").unwrap(); @@ -54,7 +55,7 @@ pub fn impl_static_pin(pin: TokenStream) -> TokenStream { fn read() -> u8 { unsafe { (*Self::Port::ptr()) - .#target_field_port + .#target_pin .read() .bits() }