Skip to content

Commit 893a125

Browse files
authored
Merge pull request #3338 from jepler/endpoint-count-checking-stm32f405
add endpoint count checking on stm32f405
2 parents ac06202 + 563e038 commit 893a125

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ports/stm/mpconfigport.mk

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ifeq ($(MCU_VARIANT),STM32F405xx)
77
CIRCUITPY_FRAMEBUFFERIO ?= 1
88
CIRCUITPY_RGBMATRIX ?= 1
99
CIRCUITPY_SDIOIO ?= 1
10+
USB_NUM_EP = 4
1011
endif
1112

1213
ifeq ($(MCU_SERIES),F4)

tools/gen_usb_descriptor.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,9 @@ def strings_in_order(cls):
382382
for interface in interfaces:
383383
for subdescriptor in interface.subdescriptors:
384384
endpoint_address = getattr(subdescriptor, 'bEndpointAddress', 0) & 0x7f
385-
if endpoint_address > args.max_ep:
386-
raise ValueError("Endpoint address %d of %s may not exceed %d" % (endpoint_address & 0x7f, interface.description, args.max_ep))
385+
print("Endpoint %d - vs max_ep %d" % (endpoint_address, args.max_ep))
386+
if endpoint_address >= args.max_ep:
387+
raise ValueError("Endpoint address %d of %s must be less than %d" % (endpoint_address & 0x7f, interface.description, args.max_ep))
387388
else:
388389
print("Unable to check whether maximum number of endpoints is respected", file=sys.stderr)
389390

0 commit comments

Comments
 (0)