Skip to content

Commit 8bb3c6f

Browse files
committed
handle := defs in shared_bindings_matrix.py; update adafruit_hid
1 parent adc3d7d commit 8bb3c6f

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

docs/shared_bindings_matrix.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ def get_settings_from_makefile(port_dir, board_name):
155155

156156
settings = {}
157157
for line in contents.stdout.split('\n'):
158-
m = re.match(r'^([A-Z][A-Z0-9_]*) = (.*)$', line)
158+
# Handle both = and := definitions.
159+
m = re.match(r'^([A-Z][A-Z0-9_]*) :?= (.*)$', line)
159160
if m:
160161
settings[m.group(1)] = m.group(2)
161162

py/circuitpy_mpconfig.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ CFLAGS += -DCIRCUITPY_UHEAP=$(CIRCUITPY_UHEAP)
332332
CIRCUITPY_USB ?= 1
333333
CFLAGS += -DCIRCUITPY_USB=$(CIRCUITPY_USB)
334334

335-
# If you need to count endpoints, use:
336-
# $(shell expr $(USB_NUM_EP) '>=' 8)
335+
# Compute this value once, so the shell command is not reinvoked many times.
336+
USB_NUM_EP_8_OR_GREATER := $(shell expr $(USB_NUM_EP) '>=' 8)
337337

338338
CIRCUITPY_USB_CDC ?= 1
339339
CFLAGS += -DCIRCUITPY_USB_CDC=$(CIRCUITPY_USB_CDC)
@@ -348,7 +348,7 @@ CIRCUITPY_USB_HID_ENABLED_DEFAULT = $(CIRCUITPY_USB_HID)
348348
CFLAGS += -DCIRCUITPY_USB_HID_ENABLED_DEFAULT=$(CIRCUITPY_USB_HID_ENABLED_DEFAULT)
349349

350350
# MIDI is usually available if there are at least 8 endpoints.
351-
CIRCUITPY_USB_MIDI ?= $(shell expr $(USB_NUM_EP) '>=' 8)
351+
CIRCUITPY_USB_MIDI ?= $(USB_NUM_EP_8_OR_GREATER)
352352
CFLAGS += -DCIRCUITPY_USB_MIDI=$(CIRCUITPY_USB_MIDI)
353353
CIRCUITPY_USB_MIDI_ENABLED_DEFAULT = $(CIRCUITPY_USB_MIDI)
354354
CFLAGS += -DCIRCUITPY_USB_MIDI_ENABLED_DEFAULT=$(CIRCUITPY_USB_MIDI_ENABLED_DEFAULT)

0 commit comments

Comments
 (0)