summaryrefslogtreecommitdiff
path: root/test/hil
diff options
context:
space:
mode:
authorAleksei Musin <[email protected]>2026-02-09 12:22:20 +0400
committerGitHub <[email protected]>2026-02-09 12:22:20 +0400
commit6e675da608b063e2ea7db1d700d788d6a247f9ec (patch)
tree5bcf5bb529e6ca2ebefc889920b28f1fab851e3f /test/hil
parentebc9edfb7a512c8dd6816a40698c62c364bd78da (diff)
parentf5424c569ddc673a9c23b78febceed8f7f098509 (diff)
Merge branch 'hathach:master' into threadx_osal
Diffstat (limited to 'test/hil')
-rwxr-xr-xtest/hil/hil_test.py12
-rw-r--r--test/hil/tinyusb.json6
2 files changed, 9 insertions, 9 deletions
diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py
index b2e883119..b84740867 100755
--- a/test/hil/hil_test.py
+++ b/test/hil/hil_test.py
@@ -151,7 +151,7 @@ def read_disk_file(uid, lun, fname):
def open_mtp_dev(uid):
mtp = MTP()
# MTP seems to take a while to enumerate
- timeout = 2*ENUM_TIMEOUT
+ timeout = 2 * ENUM_TIMEOUT
while timeout > 0:
# run_cmd(f"gio mount -u mtp://TinyUsb_TinyUsb_Device_{uid}/")
for raw in mtp.detect_devices():
@@ -410,22 +410,22 @@ def test_device_cdc_dual_ports(board):
sizes = [32, 64, 128, 256, 512, random.randint(2000, 5000)]
def write_and_check(writer, payload):
- size = len(payload)
+ payload_len = len(payload)
for s in ser:
s.reset_input_buffer()
rd0 = b''
rd1 = b''
offset = 0
# Write in chunks of random 1-64 bytes (device has 64-byte buffer)
- while offset < size:
- chunk_size = min(random.randint(1, 64), size - offset)
+ while offset < payload_len:
+ chunk_size = min(random.randint(1, 64), payload_len - offset)
ser[writer].write(payload[offset:offset + chunk_size])
ser[writer].flush()
rd0 += ser[0].read(chunk_size)
rd1 += ser[1].read(chunk_size)
offset += chunk_size
- assert rd0 == payload.lower(), f'Port0 wrong data ({size}): expected {payload.lower()[:16]}... was {rd0[:16]}'
- assert rd1 == payload.upper(), f'Port1 wrong data ({size}): expected {payload.upper()[:16]}... was {rd1[:16]}'
+ assert rd0 == payload.lower(), f'Port0 wrong data ({payload_len}): expected {payload.lower()}... was {rd0}'
+ assert rd1 == payload.upper(), f'Port1 wrong data ({payload_len}): expected {payload.upper()}... was {rd1}'
for size in sizes:
payload0 = rand_ascii(size)
diff --git a/test/hil/tinyusb.json b/test/hil/tinyusb.json
index 6afcb2186..7cb561b2d 100644
--- a/test/hil/tinyusb.json
+++ b/test/hil/tinyusb.json
@@ -103,10 +103,10 @@
"name": "ra4m1_ek",
"uid": "152E163038303131393346E46F26574B",
"tests": {
- "device": true, "host": false, "dual": false,
- "skip": ["device/cdc_msc", "device/cdc_msc_freertos"]
+ "device": true,
+ "host": false,
+ "dual": false
},
- "comment": "MSC is slow to enumerated #2602",
"flasher": {
"name": "jlink",
"uid": "000831174392",