diff options
| author | DavePutz <dwputz@gmail.com> | 2020-08-30 12:50:06 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-30 12:50:06 -0500 |
| commit | 635709333480aaf742eeb6f952a4f34bbcb68b0a (patch) | |
| tree | 7c7a6e8415ff947742a9afa431db6995b429a053 /tools | |
| parent | 43aef8af2f92b098923b18ba0e915a27d862a7ce (diff) | |
| parent | 0adccc50dcc9e9db9a054da563fe4f165e8d912e (diff) | |
Merge pull request #23 from adafruit/main
Update from adafruit/main
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/gen_usb_descriptor.py | 5 | ||||
| -rw-r--r-- | tools/mpconfig_category_reader.py | 31 |
2 files changed, 34 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) diff --git a/tools/mpconfig_category_reader.py b/tools/mpconfig_category_reader.py new file mode 100644 index 000000000..2f813931e --- /dev/null +++ b/tools/mpconfig_category_reader.py @@ -0,0 +1,31 @@ +filepath = '../py/circuitpy_mpconfig.mk' +with open(filepath) as fp: + line = fp.readline() + cnt = 1 + fullbuild = [] + defon = [] + defoff = [] + while line: + wordlist = line.split() + if wordlist: + if wordlist[-1] == "$(CIRCUITPY_FULL_BUILD)": + fullbuild.append(wordlist[0]) + elif wordlist[-1] == "0": + defoff.append(wordlist[0]) + elif wordlist[-1] == "1": + defon.append(wordlist[0]) + line = fp.readline() + cnt += 1 + + print(str(cnt) + " Lines Read\n") + print("\nFULL BUILDS ------------------------") + for string in fullbuild: + print(string) + + print("\nON BUILDS ------------------------") + for string in defon: + print(string) + + print("\nOFF BUILDS ------------------------") + for string in defoff: + print(string) |
