Skip to content

Commit 4ce7a4c

Browse files
authored
Merge branch 'master' into stm32-DAC
2 parents 5f33c54 + cc3e0a0 commit 4ce7a4c

File tree

7 files changed

+147
-51
lines changed

7 files changed

+147
-51
lines changed

locale/de_DE.po

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ msgstr "%q in Benutzung"
4848

4949
#: py/obj.c
5050
msgid "%q index out of range"
51-
msgstr "Der Index %q befindet sich außerhalb der Reihung"
51+
msgstr "Der Index %q befindet sich außerhalb des Bereiches"
5252

5353
#: py/obj.c
5454
msgid "%q indices must be integers, not %s"
@@ -124,7 +124,7 @@ msgstr "'%s' Integer 0x%x passt nicht in Maske 0x%x"
124124
#: py/obj.c
125125
#, c-format
126126
msgid "'%s' object does not support item assignment"
127-
msgstr "'%s' Objekt unterstützt keine item assignment"
127+
msgstr "'%s' Objekt unterstützt keine Zuordnung von Elementen"
128128

129129
#: py/obj.c
130130
#, c-format
@@ -226,7 +226,7 @@ msgstr "Die Adresse muss %d Bytes lang sein"
226226

227227
#: shared-bindings/_bleio/Address.c
228228
msgid "Address type out of range"
229-
msgstr ""
229+
msgstr "Adresstyp außerhalb des zulässigen Bereichs"
230230

231231
#: ports/nrf/common-hal/busio/I2C.c
232232
msgid "All I2C peripherals are in use"
@@ -303,7 +303,7 @@ msgstr ""
303303

304304
#: shared-module/displayio/Display.c
305305
msgid "Below minimum frame rate"
306-
msgstr ""
306+
msgstr "Unterhalb der minimalen Frame Rate"
307307

308308
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
309309
msgid "Bit clock and word select must share a clock unit"
@@ -319,7 +319,7 @@ msgstr "Beide pins müssen Hardware Interrupts unterstützen"
319319

320320
#: shared-bindings/displayio/Display.c
321321
msgid "Brightness must be 0-1.0"
322-
msgstr ""
322+
msgstr "Die Helligkeit muss zwischen 0 und 1.0 liegen"
323323

324324
#: shared-bindings/supervisor/__init__.c
325325
msgid "Brightness must be between 0 and 255"
@@ -340,7 +340,7 @@ msgstr ""
340340

341341
#: shared-bindings/displayio/Display.c
342342
msgid "Buffer is too small"
343-
msgstr ""
343+
msgstr "Der Puffer ist zu klein"
344344

345345
#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c
346346
#, c-format
@@ -562,7 +562,7 @@ msgstr "Eine UUID wird erwartet"
562562

563563
#: shared-bindings/_bleio/Central.c
564564
msgid "Expected an Address"
565-
msgstr ""
565+
msgstr "Erwartet eine Adresse"
566566

567567
#: shared-module/_pixelbuf/PixelBuf.c
568568
#, c-format
@@ -571,7 +571,7 @@ msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten"
571571

572572
#: shared-bindings/ps2io/Ps2.c
573573
msgid "Failed sending command."
574-
msgstr ""
574+
msgstr "Kommando nicht gesendet."
575575

576576
#: ports/nrf/sd_mutex.c
577577
#, c-format
@@ -614,7 +614,7 @@ msgstr ""
614614

615615
#: ports/nrf/common-hal/_bleio/Central.c
616616
msgid "Failed to connect: timeout"
617-
msgstr ""
617+
msgstr "Verbindung nicht erfolgreich: timeout"
618618

619619
#: ports/nrf/common-hal/_bleio/Scanner.c
620620
#, c-format
@@ -681,7 +681,7 @@ msgstr "Kann advertisement nicht starten. Status: 0x%04x"
681681
#: ports/nrf/common-hal/_bleio/Central.c
682682
#, c-format
683683
msgid "Failed to start connecting, error 0x%04x"
684-
msgstr ""
684+
msgstr "Verbindung konnte nicht hergestellt werden. Fehler: 0x%04x"
685685

686686
#: ports/nrf/common-hal/_bleio/Peripheral.c
687687
#, c-format

ports/atmel-samd/mpconfigport.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ CIRCUITPY_FREQUENCYIO = 0
2222
CIRCUITPY_TOUCHIO_USE_NATIVE = 1
2323

2424
# SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic.
25-
USB_MSC_NUM_ENDPOINT_PAIRS = 2
25+
USB_MSC_EP_NUM_OUT = 1
2626
endif
2727

2828
# Put samd51-only choices here.

ports/stm32f4/mpconfigport.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ CIRCUITPY_DIGITALIO = 1
2020
CIRCUITPY_ANALOGIO = 1
2121
CIRCUITPY_MICROCONTROLLER = 1
2222
CIRCUITPY_BUSIO = 1
23-
CIRCUITPY_TIME = 1
2423
CIRCUITPY_OS = 1
2524
CIRCUITPY_STORAGE = 1
2625
CIRCUITPY_RANDOM = 1
2726
CIRCUITPY_USB_HID = 1
2827
CIRCUITPY_USB_MIDI = 1
2928

30-
3129
#ifeq ($(MCU_SUB_VARIANT), stm32f412zx)
3230
#endif

py/circuitpy_mpconfig.mk

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ ifndef CIRCUITPY_DEFAULT_BUILD
5252
endif
5353
endif
5454

55+
# Some features have no unique HAL component, and thus there's never
56+
# a reason to not include them.
57+
ifndef CIRCUITPY_ALWAYS_BUILD
58+
CIRCUITPY_ALWAYS_BUILD = 1
59+
endif
5560

5661

5762
# All builtin modules are listed below, with default values (0 for off, 1 for on)
@@ -151,7 +156,7 @@ endif
151156
CFLAGS += -DCIRCUITPY_I2CSLAVE=$(CIRCUITPY_I2CSLAVE)
152157

153158
ifndef CIRCUITPY_MATH
154-
CIRCUITPY_MATH = $(CIRCUITPY_DEFAULT_BUILD)
159+
CIRCUITPY_MATH = $(CIRCUITPY_ALWAYS_BUILD)
155160
endif
156161
CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH)
157162

@@ -232,17 +237,17 @@ endif
232237
CFLAGS += -DCIRCUITPY_STORAGE=$(CIRCUITPY_STORAGE)
233238

234239
ifndef CIRCUITPY_STRUCT
235-
CIRCUITPY_STRUCT = $(CIRCUITPY_DEFAULT_BUILD)
240+
CIRCUITPY_STRUCT = $(CIRCUITPY_ALWAYS_BUILD)
236241
endif
237242
CFLAGS += -DCIRCUITPY_STRUCT=$(CIRCUITPY_STRUCT)
238243

239244
ifndef CIRCUITPY_SUPERVISOR
240-
CIRCUITPY_SUPERVISOR = $(CIRCUITPY_DEFAULT_BUILD)
245+
CIRCUITPY_SUPERVISOR = $(CIRCUITPY_ALWAYS_BUILD)
241246
endif
242247
CFLAGS += -DCIRCUITPY_SUPERVISOR=$(CIRCUITPY_SUPERVISOR)
243248

244249
ifndef CIRCUITPY_TIME
245-
CIRCUITPY_TIME = $(CIRCUITPY_DEFAULT_BUILD)
250+
CIRCUITPY_TIME = $(CIRCUITPY_ALWAYS_BUILD)
246251
endif
247252
CFLAGS += -DCIRCUITPY_TIME=$(CIRCUITPY_TIME)
248253

supervisor/supervisor.mk

Lines changed: 64 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,69 @@ ifndef USB_HID_DEVICES
9494
USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD"
9595
endif
9696

97-
# SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic.
98-
ifndef USB_MSC_NUM_ENDPOINT_PAIRS
99-
USB_MSC_NUM_ENDPOINT_PAIRS = 1
97+
ifndef USB_MSC_MAX_PACKET_SIZE
98+
USB_MSC_MAX_PACKET_SIZE = 64
99+
endif
100+
101+
ifndef USB_CDC_EP_NUM_NOTIFICATION
102+
USB_CDC_EP_NUM_NOTIFICATION = 0
103+
endif
104+
105+
ifndef USB_CDC_EP_NUM_DATA_OUT
106+
USB_CDC_EP_NUM_DATA_OUT = 0
107+
endif
108+
109+
ifndef USB_CDC_EP_NUM_DATA_IN
110+
USB_CDC_EP_NUM_DATA_IN = 0
111+
endif
112+
113+
ifndef USB_MSC_EP_NUM_OUT
114+
USB_MSC_EP_NUM_OUT = 0
115+
endif
116+
117+
ifndef USB_MSC_EP_NUM_IN
118+
USB_MSC_EP_NUM_IN = 0
119+
endif
120+
121+
ifndef USB_HID_EP_NUM_OUT
122+
USB_HID_EP_NUM_OUT = 0
123+
endif
124+
125+
ifndef USB_HID_EP_NUM_IN
126+
USB_HID_EP_NUM_IN = 0
127+
endif
128+
129+
ifndef USB_MIDI_EP_NUM_OUT
130+
USB_MIDI_EP_NUM_OUT = 0
131+
endif
132+
133+
ifndef USB_MIDI_EP_NUM_IN
134+
USB_MIDI_EP_NUM_IN = 0
135+
endif
136+
137+
USB_DESCRIPTOR_ARGS = \
138+
--manufacturer $(USB_MANUFACTURER)\
139+
--product $(USB_PRODUCT)\
140+
--vid $(USB_VID)\
141+
--pid $(USB_PID)\
142+
--serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\
143+
--devices $(USB_DEVICES)\
144+
--hid_devices $(USB_HID_DEVICES)\
145+
--msc_max_packet_size $(USB_MSC_MAX_PACKET_SIZE)\
146+
--cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\
147+
--cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\
148+
--cdc_ep_num_data_in $(USB_CDC_EP_NUM_DATA_IN)\
149+
--msc_ep_num_out $(USB_MSC_EP_NUM_OUT)\
150+
--msc_ep_num_in $(USB_MSC_EP_NUM_IN)\
151+
--hid_ep_num_out $(USB_HID_EP_NUM_OUT)\
152+
--hid_ep_num_in $(USB_HID_EP_NUM_IN)\
153+
--midi_ep_num_out $(USB_MIDI_EP_NUM_OUT)\
154+
--midi_ep_num_in $(USB_MIDI_EP_NUM_IN)\
155+
--output_c_file $(BUILD)/autogen_usb_descriptor.c\
156+
--output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h
157+
158+
ifeq ($(USB_RENUMBER_ENDPOINTS), 0)
159+
USB_DESCRIPTOR_ARGS += --no-renumber_endpoints
100160
endif
101161

102162
SUPERVISOR_O = $(addprefix $(BUILD)/, $(SRC_SUPERVISOR:.c=.o)) $(BUILD)/autogen_display_resources.o
@@ -110,17 +170,7 @@ $(BUILD)/autogen_usb_descriptor.c $(BUILD)/genhdr/autogen_usb_descriptor.h: auto
110170
autogen_usb_descriptor.intermediate: ../../tools/gen_usb_descriptor.py Makefile | $(HEADER_BUILD)
111171
$(STEPECHO) "GEN $@"
112172
$(Q)install -d $(BUILD)/genhdr
113-
$(Q)$(PYTHON3) ../../tools/gen_usb_descriptor.py \
114-
--manufacturer $(USB_MANUFACTURER)\
115-
--product $(USB_PRODUCT)\
116-
--vid $(USB_VID)\
117-
--pid $(USB_PID)\
118-
--serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\
119-
--devices $(USB_DEVICES)\
120-
--hid_devices $(USB_HID_DEVICES)\
121-
--msc_num_endpoint_pairs $(USB_MSC_NUM_ENDPOINT_PAIRS)\
122-
--output_c_file $(BUILD)/autogen_usb_descriptor.c\
123-
--output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h
173+
$(Q)$(PYTHON3) ../../tools/gen_usb_descriptor.py $(USB_DESCRIPTOR_ARGS)
124174

125175
CIRCUITPY_DISPLAY_FONT ?= "../../tools/fonts/ter-u12n.bdf"
126176

tools/gen_usb_descriptor.py

Lines changed: 62 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,28 @@
3232
help='devices to include in descriptor (AUDIO includes MIDI support)')
3333
parser.add_argument('--hid_devices', type=lambda l: tuple(l.split(',')), default=DEFAULT_HID_DEVICES,
3434
help='HID devices to include in HID report descriptor')
35-
parser.add_argument('--msc_num_endpoint_pairs', type=int, default=1,
36-
help='Use 1 or 2 endpoint pairs for MSC (1 bidirectional, or 1 input + 1 output (required by SAMD21))')
35+
parser.add_argument('--msc_max_packet_size', type=int, default=64,
36+
help='Max packet size for MSC')
37+
parser.add_argument('--no-renumber_endpoints', dest='renumber_endpoints', action='store_false',
38+
help='use to not renumber endpoint')
39+
parser.add_argument('--cdc_ep_num_notification', type=int, default=0,
40+
help='endpoint number of CDC NOTIFICATION')
41+
parser.add_argument('--cdc_ep_num_data_out', type=int, default=0,
42+
help='endpoint number of CDC DATA OUT')
43+
parser.add_argument('--cdc_ep_num_data_in', type=int, default=0,
44+
help='endpoint number of CDC DATA IN')
45+
parser.add_argument('--msc_ep_num_out', type=int, default=0,
46+
help='endpoint number of MSC OUT')
47+
parser.add_argument('--msc_ep_num_in', type=int, default=0,
48+
help='endpoint number of MSC IN')
49+
parser.add_argument('--hid_ep_num_out', type=int, default=0,
50+
help='endpoint number of HID OUT')
51+
parser.add_argument('--hid_ep_num_in', type=int, default=0,
52+
help='endpoint number of HID IN')
53+
parser.add_argument('--midi_ep_num_out', type=int, default=0,
54+
help='endpoint number of MIDI OUT')
55+
parser.add_argument('--midi_ep_num_in', type=int, default=0,
56+
help='endpoint number of MIDI IN')
3757
parser.add_argument('--output_c_file', type=argparse.FileType('w'), required=True)
3858
parser.add_argument('--output_h_file', type=argparse.FileType('w'), required=True)
3959

@@ -47,9 +67,32 @@
4767
if unknown_hid_devices:
4868
raise ValueError("Unknown HID devices(s)", unknown_hid_devices)
4969

50-
if args.msc_num_endpoint_pairs not in (1, 2):
51-
raise ValueError("--msc_num_endpoint_pairs must be 1 or 2")
52-
70+
if not args.renumber_endpoints:
71+
if 'CDC' in args.devices:
72+
if args.cdc_ep_num_notification == 0:
73+
raise ValueError("CDC notification endpoint number must not be 0")
74+
elif args.cdc_ep_num_data_out == 0:
75+
raise ValueError("CDC data OUT endpoint number must not be 0")
76+
elif args.cdc_ep_num_data_in == 0:
77+
raise ValueError("CDC data IN endpoint number must not be 0")
78+
79+
if 'MSC' in args.devices:
80+
if args.msc_ep_num_out == 0:
81+
raise ValueError("MSC endpoint OUT number must not be 0")
82+
elif args.msc_ep_num_in == 0:
83+
raise ValueError("MSC endpoint IN number must not be 0")
84+
85+
if 'HID' in args.devices:
86+
if args.args.hid_ep_num_out == 0:
87+
raise ValueError("HID endpoint OUT number must not be 0")
88+
elif args.hid_ep_num_in == 0:
89+
raise ValueError("HID endpoint IN number must not be 0")
90+
91+
if 'AUDIO' in args.devices:
92+
if args.args.midi_ep_num_out == 0:
93+
raise ValueError("MIDI endpoint OUT number must not be 0")
94+
elif args.midi_ep_num_in == 0:
95+
raise ValueError("MIDI endpoint IN number must not be 0")
5396

5497
class StringIndex:
5598
"""Assign a monotonically increasing index to each unique string. Start with 0."""
@@ -120,7 +163,7 @@ def strings_in_order(cls):
120163
cdc_union,
121164
standard.EndpointDescriptor(
122165
description="CDC comm in",
123-
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN,
166+
bEndpointAddress=args.cdc_ep_num_notification | standard.EndpointDescriptor.DIRECTION_IN,
124167
bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
125168
wMaxPacketSize=0x0040,
126169
bInterval=0x10)
@@ -133,11 +176,11 @@ def strings_in_order(cls):
133176
subdescriptors=[
134177
standard.EndpointDescriptor(
135178
description="CDC data out",
136-
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_OUT,
179+
bEndpointAddress=args.cdc_ep_num_data_out | standard.EndpointDescriptor.DIRECTION_OUT,
137180
bmAttributes=standard.EndpointDescriptor.TYPE_BULK),
138181
standard.EndpointDescriptor(
139182
description="CDC data in",
140-
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN,
183+
bEndpointAddress=args.cdc_ep_num_data_in | standard.EndpointDescriptor.DIRECTION_IN,
141184
bmAttributes=standard.EndpointDescriptor.TYPE_BULK),
142185
])
143186

@@ -153,16 +196,16 @@ def strings_in_order(cls):
153196
subdescriptors=[
154197
standard.EndpointDescriptor(
155198
description="MSC in",
156-
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN,
199+
bEndpointAddress=args.msc_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN,
157200
bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
158-
bInterval=0),
201+
bInterval=0,
202+
wMaxPacketSize=args.msc_max_packet_size),
159203
standard.EndpointDescriptor(
160204
description="MSC out",
161-
# SAMD21 needs to use a separate pair of endpoints for MSC.
162-
bEndpointAddress=((0x1 if args.msc_num_endpoint_pairs == 2 else 0x0) |
163-
standard.EndpointDescriptor.DIRECTION_OUT),
205+
bEndpointAddress=(args.msc_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT),
164206
bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
165-
bInterval=0)
207+
bInterval=0,
208+
wMaxPacketSize=args.msc_max_packet_size)
166209
]
167210
)
168211
]
@@ -197,13 +240,13 @@ def strings_in_order(cls):
197240
# and will fail (possibly silently) if both are not supplied.
198241
hid_endpoint_in_descriptor = standard.EndpointDescriptor(
199242
description="HID in",
200-
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN,
243+
bEndpointAddress=args.hid_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN,
201244
bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
202245
bInterval=8)
203246

204247
hid_endpoint_out_descriptor = standard.EndpointDescriptor(
205248
description="HID out",
206-
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_OUT,
249+
bEndpointAddress=args.hid_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT,
207250
bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
208251
bInterval=8)
209252

@@ -267,12 +310,12 @@ def strings_in_order(cls):
267310
),
268311
standard.EndpointDescriptor(
269312
description="MIDI data out to CircuitPython",
270-
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_OUT,
313+
bEndpointAddress=args.midi_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT,
271314
bmAttributes=standard.EndpointDescriptor.TYPE_BULK),
272315
midi.DataEndpointDescriptor(baAssocJack=[midi_in_jack_emb]),
273316
standard.EndpointDescriptor(
274317
description="MIDI data in from CircuitPython",
275-
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN,
318+
bEndpointAddress=args.midi_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN,
276319
bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
277320
bInterval = 0x0),
278321
midi.DataEndpointDescriptor(baAssocJack=[midi_out_jack_emb]),
@@ -316,7 +359,7 @@ def strings_in_order(cls):
316359
# util.join_interfaces() will renumber the endpoints to make them unique across descriptors,
317360
# and renumber the interfaces in order. But we still need to fix up certain
318361
# interface cross-references.
319-
interfaces = util.join_interfaces(*interfaces_to_join)
362+
interfaces = util.join_interfaces(interfaces_to_join, renumber_endpoints=args.renumber_endpoints)
320363

321364
# Now adjust the CDC interface cross-references.
322365

0 commit comments

Comments
 (0)