From 002dce0d7bf02750fdae7611d6dab541b37e6bbf Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 16 Feb 2021 16:33:22 +0000 Subject: [PATCH] adapt botchify so it can be used for 31- or 15- etc. etc. --- src/soc/consts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/soc/consts.py b/src/soc/consts.py index 25ce8758..0482125b 100644 --- a/src/soc/consts.py +++ b/src/soc/consts.py @@ -1,9 +1,9 @@ # sigh create little-ended versions of bitfield flags -def botchify(bekls, lekls): +def botchify(bekls, lekls, msb=63): for attr in dir(bekls): if attr[0] == '_': continue - setattr(lekls, attr, 63-getattr(bekls, attr)) + setattr(lekls, attr, msb-getattr(bekls, attr)) # Can't think of a better place to put these functions. -- 2.30.2