summaryrefslogtreecommitdiff
path: root/tools/gen_usb_descriptor.py
diff options
context:
space:
mode:
authorDan Halbert <halbert@adafruit.com>2020-08-28 11:12:31 -0400
committerGitHub <noreply@github.com>2020-08-28 11:12:31 -0400
commit893a125dd0ac2ad7df48c62314932c599d166e6c (patch)
treef6e481b96155d87fa410300417c8a3369d746428 /tools/gen_usb_descriptor.py
parentac06202c2137e4c68e07c4a6dd2f487e2b368357 (diff)
parent563e038c0d210dd0d17f6dc65f2c9eb5bbff1892 (diff)
Merge pull request #3338 from jepler/endpoint-count-checking-stm32f4056.0.0-alpha.3
add endpoint count checking on stm32f405
Diffstat (limited to 'tools/gen_usb_descriptor.py')
-rw-r--r--tools/gen_usb_descriptor.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py
index baee8cad7..adf0d8270 100644
--- a/tools/gen_usb_descriptor.py
+++ b/tools/gen_usb_descriptor.py
@@ -382,8 +382,9 @@ if args.max_ep != 0:
for interface in interfaces:
for subdescriptor in interface.subdescriptors:
endpoint_address = getattr(subdescriptor, 'bEndpointAddress', 0) & 0x7f
- if endpoint_address > args.max_ep:
- raise ValueError("Endpoint address %d of %s may not exceed %d" % (endpoint_address & 0x7f, interface.description, args.max_ep))
+ print("Endpoint %d - vs max_ep %d" % (endpoint_address, args.max_ep))
+ if endpoint_address >= args.max_ep:
+ raise ValueError("Endpoint address %d of %s must be less than %d" % (endpoint_address & 0x7f, interface.description, args.max_ep))
else:
print("Unable to check whether maximum number of endpoints is respected", file=sys.stderr)