diff --git a/src/generator/codegen_register.rs b/src/generator/codegen_register.rs index baefbc3..78029b0 100644 --- a/src/generator/codegen_register.rs +++ b/src/generator/codegen_register.rs @@ -299,7 +299,7 @@ fn generate_single_ux_field( pub fn #setter_name(&self, val: #field_type) -> Self { let update: #base_type = val & #mask_name; let mut inner = self.inner; - inner &= !mask; + inner &= !#mask_name; inner |= update; Self { inner } }