mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-30 04:20:26 +00:00
Add simple test for hid_boot_interface.
This commit is contained in:
parent
bffe321cd2
commit
992e17fb48
@ -22,6 +22,10 @@
|
|||||||
"name": "dfu_runtime",
|
"name": "dfu_runtime",
|
||||||
"firmware": "examples/device/dfu_runtime/_build/stm32l412nucleo/dfu_runtime.elf"
|
"firmware": "examples/device/dfu_runtime/_build/stm32l412nucleo/dfu_runtime.elf"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "hid_boot_interface",
|
||||||
|
"firmware": "examples/device/hid_boot_interface/_build/stm32l412nucleo/hid_boot_interface.elf"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "board_test",
|
"name": "board_test",
|
||||||
"firmware": "examples/device/board_test/_build/stm32l412nucleo/board_test.elf"
|
"firmware": "examples/device/board_test/_build/stm32l412nucleo/board_test.elf"
|
||||||
@ -50,6 +54,10 @@
|
|||||||
"name": "dfu_runtime",
|
"name": "dfu_runtime",
|
||||||
"firmware": "examples/device/dfu_runtime/_build/stm32f746disco/dfu_runtime.elf"
|
"firmware": "examples/device/dfu_runtime/_build/stm32f746disco/dfu_runtime.elf"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "hid_boot_interface",
|
||||||
|
"firmware": "examples/device/hid_boot_interface/_build/stm32f746disco/hid_boot_interface.elf"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "board_test",
|
"name": "board_test",
|
||||||
"firmware": "examples/device/board_test/_build/stm32f746disco/board_test.elf"
|
"firmware": "examples/device/board_test/_build/stm32f746disco/board_test.elf"
|
||||||
|
@ -54,8 +54,7 @@ def test_cdc_dual_ports(id):
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
timeout = timeout - 1
|
timeout = timeout - 1
|
||||||
|
|
||||||
assert os.path.exists(port1) and os.path.exists(port2), \
|
assert timeout, 'Device not available'
|
||||||
'Device not available'
|
|
||||||
|
|
||||||
# Echo test
|
# Echo test
|
||||||
ser1 = serial.Serial(port1)
|
ser1 = serial.Serial(port1)
|
||||||
@ -89,8 +88,7 @@ def test_cdc_msc(id):
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
timeout = timeout - 1
|
timeout = timeout - 1
|
||||||
|
|
||||||
assert os.path.exists(port) and os.path.isfile(file), \
|
assert timeout, 'Device not available'
|
||||||
'Device not available'
|
|
||||||
|
|
||||||
# Echo test
|
# Echo test
|
||||||
ser1 = serial.Serial(port)
|
ser1 = serial.Serial(port)
|
||||||
@ -170,6 +168,22 @@ def test_dfu_runtime(id):
|
|||||||
|
|
||||||
print('dfu_runtime test done')
|
print('dfu_runtime test done')
|
||||||
|
|
||||||
|
def test_hid_boot_interface(id):
|
||||||
|
kbd = f'/dev/input/by-id/usb-TinyUSB_TinyUSB_Device_{id}-event-kbd'
|
||||||
|
mouse1 = f'/dev/input/by-id/usb-TinyUSB_TinyUSB_Device_{id}-if01-event-mouse'
|
||||||
|
mouse2 = f'/dev/input/by-id/usb-TinyUSB_TinyUSB_Device_{id}-if01-mouse'
|
||||||
|
# Wait device enum
|
||||||
|
timeout = 10
|
||||||
|
while timeout:
|
||||||
|
if os.path.exists(kbd) and os.path.exists(mouse1) and os.path.exists(mouse2):
|
||||||
|
break
|
||||||
|
time.sleep(1)
|
||||||
|
timeout = timeout - 1
|
||||||
|
|
||||||
|
assert timeout, 'Device not available'
|
||||||
|
|
||||||
|
print('hid_boot_interface test done')
|
||||||
|
|
||||||
def test_board_test(id):
|
def test_board_test(id):
|
||||||
# Dummy test
|
# Dummy test
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user