Add support for hex (and octal) values
authorJeremy Kerr <jk@ozlabs.org>
Tue, 29 Jul 2008 03:27:50 +0000 (13:27 +1000)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 12 Nov 2009 23:58:48 +0000 (10:58 +1100)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
bitfield

index 3851c4c..7740ff2 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