diff options
| author | Nathan Conrad <[email protected]> | 2019-10-02 01:15:47 -0400 |
|---|---|---|
| committer | Nathan Conrad <[email protected]> | 2019-10-02 01:15:47 -0400 |
| commit | cef388b7bd956adbc6af4904d4d95ca4120ebb7b (patch) | |
| tree | 61541614bb829acde7088c99d1c69a31070db32b /examples | |
| parent | 4ea2a4ed60c41c8b55bfb40459e5f54615e2dc72 (diff) | |
| parent | d84a31fd5fd62b9458504615983591a4c4c34f89 (diff) | |
Merge branch 'master' into ZLP_Request2
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/device/usbtmc/visaQuery.py | 18 | ||||
| -rw-r--r-- | examples/make.mk | 1 |
2 files changed, 18 insertions, 1 deletions
diff --git a/examples/device/usbtmc/visaQuery.py b/examples/device/usbtmc/visaQuery.py index 44b5fd875..b5bf8d482 100644 --- a/examples/device/usbtmc/visaQuery.py +++ b/examples/device/usbtmc/visaQuery.py @@ -1,9 +1,10 @@ +#!/usr/bin/env python3 + import visa import time import sys - def test_idn(): idn = inst.query("*idn?"); assert (idn == "TinyUSB,ModelNumber,SerialNumber,FirmwareVer123456\r\n") @@ -129,6 +130,18 @@ def test_multi_read(): assert (x + "\r\n" == y) #inst.chunk_size = old_chunk_size +def test_stall_ep0(): + usb_iface = inst.get_visa_attribute(visa.constants.VI_ATTR_USB_INTFC_NUM) + inst.read_stb() + # This is an invalid request, should create stall. + try: + retv = inst.control_in(request_type_bitmap_field=0xA1, request_id=60, request_value=0x0000, index=usb_iface, length=0x0001) + assert false + except visa.VisaIOError: + pass + + assert (inst.read_stb() == 0) + rm = visa.ResourceManager("/c/Windows/system32/visa64.dll") reslist = rm.list_resources("USB?::?*::INSTR") @@ -171,6 +184,9 @@ test_echo(165,170) print("+ Read timeout (no MAV)") test_read_timeout() +print("+ Test EP0 stall recovery") +test_stall_ep0() + print("+ MAV") test_mav() diff --git a/examples/make.mk b/examples/make.mk index f35195fde..22d8f7455 100644 --- a/examples/make.mk +++ b/examples/make.mk @@ -56,6 +56,7 @@ CFLAGS += \ -Wno-endif-labels \ -Wstrict-prototypes \ -Wall \ + -Wextra \ -Werror \ -Werror-implicit-function-declaration \ -Wfatal-errors \ |
