Add support for hex (and octal) values
[bitfield] / bitfield
index 3851c4c9119bb1ecdecf0c47c1057df780cad626..7740ff2b0d375ebd049109ad4b7971e593faea2b 100644 (file)
--- a/bitfield
+++ b/bitfield
@@ -29,7 +29,7 @@ class bitfield:
                return len(self.bits)
 
        def add_value(self, value, description):
-               self.values[int(value)] = description
+               self.values[int(value, 0)] = description
 
        def mask(self, reg_width, value):
                ret = 0