summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLucian Copeland <hierophect@gmail.com>2020-09-09 13:24:30 -0400
committerLucian Copeland <hierophect@gmail.com>2020-09-09 13:24:30 -0400
commitbe199983c155118717b56a405e546b3bb79c49ea (patch)
treef8d8fa2aae3b451df7463e6d7b5f1711bf43a57d /tools
parent4733a672265f97a83353d005160f8e24ed8755b8 (diff)
parent66cf6c46c005cf67181e2ba58ecadc619344687d (diff)
Merge remote-tracking branch 'upstream/main' into esp32-displayio-fix
Diffstat (limited to 'tools')
-rw-r--r--tools/gen_usb_descriptor.py4
-rw-r--r--tools/mpconfig_category_reader.py31
2 files changed, 33 insertions, 2 deletions
diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py
index baee8cad7..15bf2daa0 100644
--- a/tools/gen_usb_descriptor.py
+++ b/tools/gen_usb_descriptor.py
@@ -382,8 +382,8 @@ 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))
+ 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)