8000 Merge pull request #10148 from FoamyGuy/usb_deviceinfo_fix · adafruit/circuitpython@429efe8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 429efe8

Browse files
authored
Merge pull request #10148 from FoamyGuy/usb_deviceinfo_fix
USB device_info test check if pins exist before using
2 parents e40b1f5 + 8afdccc commit 429efe8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/circuitpython-manual/usb/device_info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
d.switch_to_output(value=True)
1010
print("USB power on")
1111

12-
h = usb_host.Port(board.USB_HOST_DP, board.USB_HOST_DM)
12+
if hasattr(board, "USB_HOST_DP") and hasattr(board, "USB_HOST_DM"):
13+
h = usb_host.Port(board.USB_HOST_DP, board.USB_HOST_DM)
1314

1415
while True:
1516
for device in usb.core.find(find_all=True):

0 commit comments

Comments
 (0)
0