From 2097c8b1e16ed2e4a2ed9dd75623f02b42cf805a Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 11 Jul 2014 00:06:36 +0300 Subject: moductypes: Add symbolic constants to specify bitfield position/length. --- tests/extmod/uctypes_le.py | 12 ++++++------ tests/extmod/uctypes_native_le.py | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/extmod') diff --git a/tests/extmod/uctypes_le.py b/tests/extmod/uctypes_le.py index 0e3bd9a82..416a00744 100644 --- a/tests/extmod/uctypes_le.py +++ b/tests/extmod/uctypes_le.py @@ -8,13 +8,13 @@ desc = { }), "arr": (uctypes.ARRAY | 0, uctypes.UINT8 | 2), "arr2": (uctypes.ARRAY | 0, 2, {"b": uctypes.UINT8 | 0}), - "bitf0": uctypes.BFUINT16 | 0 | 0 << 17 | 8 << 22, - "bitf1": uctypes.BFUINT16 | 0 | 8 << 17 | 8 << 22, + "bitf0": uctypes.BFUINT16 | 0 | 0 << uctypes.BF_POS | 8 << uctypes.BF_LEN, + "bitf1": uctypes.BFUINT16 | 0 | 8 << uctypes.BF_POS | 8 << uctypes.BF_LEN, - "bf0": uctypes.BFUINT16 | 0 | 0 << 17 | 4 << 22, - "bf1": uctypes.BFUINT16 | 0 | 4 << 17 | 4 << 22, - "bf2": uctypes.BFUINT16 | 0 | 8 << 17 | 4 << 22, - "bf3": uctypes.BFUINT16 | 0 | 12 << 17 | 4 << 22, + "bf0": uctypes.BFUINT16 | 0 | 0 << uctypes.BF_POS | 4 << uctypes.BF_LEN, + "bf1": uctypes.BFUINT16 | 0 | 4 << uctypes.BF_POS | 4 << uctypes.BF_LEN, + "bf2": uctypes.BFUINT16 | 0 | 8 << uctypes.BF_POS | 4 << uctypes.BF_LEN, + "bf3": uctypes.BFUINT16 | 0 | 12 << uctypes.BF_POS | 4 << uctypes.BF_LEN, "ptr": (uctypes.PTR | 0, uctypes.UINT8), "ptr2": (uctypes.PTR | 0, {"b": uctypes.UINT8 | 0}), diff --git a/tests/extmod/uctypes_native_le.py b/tests/extmod/uctypes_native_le.py index 7a5e38733..b4694994a 100644 --- a/tests/extmod/uctypes_native_le.py +++ b/tests/extmod/uctypes_native_le.py @@ -17,13 +17,13 @@ desc = { }), "arr": (uctypes.ARRAY | 0, uctypes.UINT8 | 2), "arr2": (uctypes.ARRAY | 0, 2, {"b": uctypes.UINT8 | 0}), - "bitf0": uctypes.BFUINT16 | 0 | 0 << 17 | 8 << 22, - "bitf1": uctypes.BFUINT16 | 0 | 8 << 17 | 8 << 22, + "bitf0": uctypes.BFUINT16 | 0 | 0 << uctypes.BF_POS | 8 << uctypes.BF_LEN, + "bitf1": uctypes.BFUINT16 | 0 | 8 << uctypes.BF_POS | 8 << uctypes.BF_LEN, - "bf0": uctypes.BFUINT16 | 0 | 0 << 17 | 4 << 22, - "bf1": uctypes.BFUINT16 | 0 | 4 << 17 | 4 << 22, - "bf2": uctypes.BFUINT16 | 0 | 8 << 17 | 4 << 22, - "bf3": uctypes.BFUINT16 | 0 | 12 << 17 | 4 << 22, + "bf0": uctypes.BFUINT16 | 0 | 0 << uctypes.BF_POS | 4 << uctypes.BF_LEN, + "bf1": uctypes.BFUINT16 | 0 | 4 << uctypes.BF_POS | 4 << uctypes.BF_LEN, + "bf2": uctypes.BFUINT16 | 0 | 8 << uctypes.BF_POS | 4 << uctypes.BF_LEN, + "bf3": uctypes.BFUINT16 | 0 | 12 << uctypes.BF_POS | 4 << uctypes.BF_LEN, "ptr": (uctypes.PTR | 0, uctypes.UINT8), "ptr2": (uctypes.PTR | 0, {"b": uctypes.UINT8 | 0}), -- cgit v1.2.3