summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-07-11 00:06:36 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-07-11 00:06:36 +0300
commit2097c8b1e16ed2e4a2ed9dd75623f02b42cf805a (patch)
tree638740c658008603ba294c331794cfff8c10649c /tests
parent8215847b4d3bbbf859893db44f6de8a9fdea9f35 (diff)
downloadmicropython-2097c8b1e16ed2e4a2ed9dd75623f02b42cf805a.tar.gz
micropython-2097c8b1e16ed2e4a2ed9dd75623f02b42cf805a.zip
moductypes: Add symbolic constants to specify bitfield position/length.
Diffstat (limited to 'tests')
-rw-r--r--tests/extmod/uctypes_le.py12
-rw-r--r--tests/extmod/uctypes_native_le.py12
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/extmod/uctypes_le.py b/tests/extmod/uctypes_le.py
index 0e3bd9a82d..416a007448 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 7a5e38733a..b4694994a2 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}),