Commit 2022f7fd authored by Michael Büsch's avatar Michael Büsch

WordPacker: Pass types > 32 bit unmodified

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent e482b043
......@@ -82,6 +82,8 @@ class _WordPacker:
}
def fromBytes(self, byteBuffer, bitWidth, byteOffset=0):
if bitWidth > 32:
return byteBuffer
try:
handler = self.__fromBytesHandlers[bitWidth]
return handler(self, byteBuffer, byteOffset)
......@@ -89,6 +91,8 @@ class _WordPacker:
raise AwlSimError("Failed to unpack %d bits from buffer" % bitWidth)
def toBytes(self, byteBuffer, bitWidth, byteOffset=0, value=0):
if bitWidth > 32:
return value
try:
handler = self.__toBytesHandlers[bitWidth]
handler(self, byteBuffer, byteOffset, value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment