Skip to content

Commit

Permalink
Merge pull request #3338 from jepler/endpoint-count-checking-stm32f405
Browse files Browse the repository at this point in the history
add endpoint count checking on stm32f405
  • Loading branch information
dhalbert committed Aug 28, 2020
2 parents ac06202 + 563e038 commit 893a125
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions ports/stm/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ifeq ($(MCU_VARIANT),STM32F405xx)
CIRCUITPY_FRAMEBUFFERIO ?= 1
CIRCUITPY_RGBMATRIX ?= 1
CIRCUITPY_SDIOIO ?= 1
USB_NUM_EP = 4
endif

ifeq ($(MCU_SERIES),F4)
Expand Down
5 changes: 3 additions & 2 deletions tools/gen_usb_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,9 @@ def strings_in_order(cls):
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)

Expand Down

0 comments on commit 893a125

Please sign in to comment.