Skip to content

Commit bac9703

Browse files
committed
Add missing unsafe qualifier on 1-bit enumerated fields.
E.g. this from tm4c123x.svd generated by dslite2svd: <field> <name>VREF</name> <description>Voltage Reference Select</description> <lsb>0</lsb> <msb>0</msb> <access>read-write</access> <writeConstraint> <useEnumeratedValues>true</useEnumeratedValues> </writeConstraint> <enumeratedValues> <enumeratedValue> <name>INTERNAL</name> <description>VDDA and GNDA are the voltage references</description> <value>0x0</value> </enumeratedValue> </enumeratedValues> </field>
1 parent 441bd42 commit bac9703

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/generate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,12 +1428,12 @@ pub fn fields(
14281428
if width == 1 {
14291429
proxy_items.push(quote! {
14301430
/// Sets the field bit
1431-
pub fn set_bit(self) -> &'a mut W {
1431+
pub #unsafety fn set_bit(self) -> &'a mut W {
14321432
self.bit(true)
14331433
}
14341434

14351435
/// Clears the field bit
1436-
pub fn clear_bit(self) -> &'a mut W {
1436+
pub #unsafety fn clear_bit(self) -> &'a mut W {
14371437
self.bit(false)
14381438
}
14391439
});

0 commit comments

Comments
 (0)