Merge branch 'master' into stm32-DAC

This commit is contained in:
hierophect 2019-10-09 15:47:43 -04:00 committed by GitHub
commit 4ce7a4cfdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 146 additions and 50 deletions

View File

@ -48,7 +48,7 @@ msgstr "%q in Benutzung"
#: py/obj.c
msgid "%q index out of range"
msgstr "Der Index %q befindet sich außerhalb der Reihung"
msgstr "Der Index %q befindet sich außerhalb des Bereiches"
#: py/obj.c
msgid "%q indices must be integers, not %s"
@ -124,7 +124,7 @@ msgstr "'%s' Integer 0x%x passt nicht in Maske 0x%x"
#: py/obj.c
#, c-format
msgid "'%s' object does not support item assignment"
msgstr "'%s' Objekt unterstützt keine item assignment"
msgstr "'%s' Objekt unterstützt keine Zuordnung von Elementen"
#: py/obj.c
#, c-format
@ -226,7 +226,7 @@ msgstr "Die Adresse muss %d Bytes lang sein"
#: shared-bindings/_bleio/Address.c
msgid "Address type out of range"
msgstr ""
msgstr "Adresstyp außerhalb des zulässigen Bereichs"
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
@ -303,7 +303,7 @@ msgstr ""
#: shared-module/displayio/Display.c
msgid "Below minimum frame rate"
msgstr ""
msgstr "Unterhalb der minimalen Frame Rate"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
msgid "Bit clock and word select must share a clock unit"
@ -319,7 +319,7 @@ msgstr "Beide pins müssen Hardware Interrupts unterstützen"
#: shared-bindings/displayio/Display.c
msgid "Brightness must be 0-1.0"
msgstr ""
msgstr "Die Helligkeit muss zwischen 0 und 1.0 liegen"
#: shared-bindings/supervisor/__init__.c
msgid "Brightness must be between 0 and 255"
@ -340,7 +340,7 @@ msgstr ""
#: shared-bindings/displayio/Display.c
msgid "Buffer is too small"
msgstr ""
msgstr "Der Puffer ist zu klein"
#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c
#, c-format
@ -562,7 +562,7 @@ msgstr "Eine UUID wird erwartet"
#: shared-bindings/_bleio/Central.c
msgid "Expected an Address"
msgstr ""
msgstr "Erwartet eine Adresse"
#: shared-module/_pixelbuf/PixelBuf.c
#, c-format
@ -571,7 +571,7 @@ msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten"
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
msgstr ""
msgstr "Kommando nicht gesendet."
#: ports/nrf/sd_mutex.c
#, c-format
@ -614,7 +614,7 @@ msgstr ""
#: ports/nrf/common-hal/_bleio/Central.c
msgid "Failed to connect: timeout"
msgstr ""
msgstr "Verbindung nicht erfolgreich: timeout"
#: ports/nrf/common-hal/_bleio/Scanner.c
#, c-format
@ -681,7 +681,7 @@ msgstr "Kann advertisement nicht starten. Status: 0x%04x"
#: ports/nrf/common-hal/_bleio/Central.c
#, c-format
msgid "Failed to start connecting, error 0x%04x"
msgstr ""
msgstr "Verbindung konnte nicht hergestellt werden. Fehler: 0x%04x"
#: ports/nrf/common-hal/_bleio/Peripheral.c
#, c-format

View File

@ -22,7 +22,7 @@ CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_TOUCHIO_USE_NATIVE = 1
# SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic.
USB_MSC_NUM_ENDPOINT_PAIRS = 2
USB_MSC_EP_NUM_OUT = 1
endif
# Put samd51-only choices here.

View File

@ -20,13 +20,11 @@ CIRCUITPY_DIGITALIO = 1
CIRCUITPY_ANALOGIO = 1
CIRCUITPY_MICROCONTROLLER = 1
CIRCUITPY_BUSIO = 1
CIRCUITPY_TIME = 1
CIRCUITPY_OS = 1
CIRCUITPY_STORAGE = 1
CIRCUITPY_RANDOM = 1
CIRCUITPY_USB_HID = 1
CIRCUITPY_USB_MIDI = 1
#ifeq ($(MCU_SUB_VARIANT), stm32f412zx)
#endif

View File

@ -52,6 +52,11 @@ ifndef CIRCUITPY_DEFAULT_BUILD
endif
endif
# Some features have no unique HAL component, and thus there's never
# a reason to not include them.
ifndef CIRCUITPY_ALWAYS_BUILD
CIRCUITPY_ALWAYS_BUILD = 1
endif
# All builtin modules are listed below, with default values (0 for off, 1 for on)
@ -151,7 +156,7 @@ endif
CFLAGS += -DCIRCUITPY_I2CSLAVE=$(CIRCUITPY_I2CSLAVE)
ifndef CIRCUITPY_MATH
CIRCUITPY_MATH = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_MATH = $(CIRCUITPY_ALWAYS_BUILD)
endif
CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH)
@ -232,17 +237,17 @@ endif
CFLAGS += -DCIRCUITPY_STORAGE=$(CIRCUITPY_STORAGE)
ifndef CIRCUITPY_STRUCT
CIRCUITPY_STRUCT = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_STRUCT = $(CIRCUITPY_ALWAYS_BUILD)
endif
CFLAGS += -DCIRCUITPY_STRUCT=$(CIRCUITPY_STRUCT)
ifndef CIRCUITPY_SUPERVISOR
CIRCUITPY_SUPERVISOR = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_SUPERVISOR = $(CIRCUITPY_ALWAYS_BUILD)
endif
CFLAGS += -DCIRCUITPY_SUPERVISOR=$(CIRCUITPY_SUPERVISOR)
ifndef CIRCUITPY_TIME
CIRCUITPY_TIME = $(CIRCUITPY_DEFAULT_BUILD)
CIRCUITPY_TIME = $(CIRCUITPY_ALWAYS_BUILD)
endif
CFLAGS += -DCIRCUITPY_TIME=$(CIRCUITPY_TIME)

View File

@ -94,9 +94,69 @@ ifndef USB_HID_DEVICES
USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD"
endif
# SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic.
ifndef USB_MSC_NUM_ENDPOINT_PAIRS
USB_MSC_NUM_ENDPOINT_PAIRS = 1
ifndef USB_MSC_MAX_PACKET_SIZE
USB_MSC_MAX_PACKET_SIZE = 64
endif
ifndef USB_CDC_EP_NUM_NOTIFICATION
USB_CDC_EP_NUM_NOTIFICATION = 0
endif
ifndef USB_CDC_EP_NUM_DATA_OUT
USB_CDC_EP_NUM_DATA_OUT = 0
endif
ifndef USB_CDC_EP_NUM_DATA_IN
USB_CDC_EP_NUM_DATA_IN = 0
endif
ifndef USB_MSC_EP_NUM_OUT
USB_MSC_EP_NUM_OUT = 0
endif
ifndef USB_MSC_EP_NUM_IN
USB_MSC_EP_NUM_IN = 0
endif
ifndef USB_HID_EP_NUM_OUT
USB_HID_EP_NUM_OUT = 0
endif
ifndef USB_HID_EP_NUM_IN
USB_HID_EP_NUM_IN = 0
endif
ifndef USB_MIDI_EP_NUM_OUT
USB_MIDI_EP_NUM_OUT = 0
endif
ifndef USB_MIDI_EP_NUM_IN
USB_MIDI_EP_NUM_IN = 0
endif
USB_DESCRIPTOR_ARGS = \
--manufacturer $(USB_MANUFACTURER)\
--product $(USB_PRODUCT)\
--vid $(USB_VID)\
--pid $(USB_PID)\
--serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\
--devices $(USB_DEVICES)\
--hid_devices $(USB_HID_DEVICES)\
--msc_max_packet_size $(USB_MSC_MAX_PACKET_SIZE)\
--cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\
--cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\
--cdc_ep_num_data_in $(USB_CDC_EP_NUM_DATA_IN)\
--msc_ep_num_out $(USB_MSC_EP_NUM_OUT)\
--msc_ep_num_in $(USB_MSC_EP_NUM_IN)\
--hid_ep_num_out $(USB_HID_EP_NUM_OUT)\
--hid_ep_num_in $(USB_HID_EP_NUM_IN)\
--midi_ep_num_out $(USB_MIDI_EP_NUM_OUT)\
--midi_ep_num_in $(USB_MIDI_EP_NUM_IN)\
--output_c_file $(BUILD)/autogen_usb_descriptor.c\
--output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h
ifeq ($(USB_RENUMBER_ENDPOINTS), 0)
USB_DESCRIPTOR_ARGS += --no-renumber_endpoints
endif
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
autogen_usb_descriptor.intermediate: ../../tools/gen_usb_descriptor.py Makefile | $(HEADER_BUILD)
$(STEPECHO) "GEN $@"
$(Q)install -d $(BUILD)/genhdr
$(Q)$(PYTHON3) ../../tools/gen_usb_descriptor.py \
--manufacturer $(USB_MANUFACTURER)\
--product $(USB_PRODUCT)\
--vid $(USB_VID)\
--pid $(USB_PID)\
--serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\
--devices $(USB_DEVICES)\
--hid_devices $(USB_HID_DEVICES)\
--msc_num_endpoint_pairs $(USB_MSC_NUM_ENDPOINT_PAIRS)\
--output_c_file $(BUILD)/autogen_usb_descriptor.c\
--output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h
$(Q)$(PYTHON3) ../../tools/gen_usb_descriptor.py $(USB_DESCRIPTOR_ARGS)
CIRCUITPY_DISPLAY_FONT ?= "../../tools/fonts/ter-u12n.bdf"

View File

@ -32,8 +32,28 @@ parser.add_argument('--devices', type=lambda l: tuple(l.split(',')), default=DEF
help='devices to include in descriptor (AUDIO includes MIDI support)')
parser.add_argument('--hid_devices', type=lambda l: tuple(l.split(',')), default=DEFAULT_HID_DEVICES,
help='HID devices to include in HID report descriptor')
parser.add_argument('--msc_num_endpoint_pairs', type=int, default=1,
help='Use 1 or 2 endpoint pairs for MSC (1 bidirectional, or 1 input + 1 output (required by SAMD21))')
parser.add_argument('--msc_max_packet_size', type=int, default=64,
help='Max packet size for MSC')
parser.add_argument('--no-renumber_endpoints', dest='renumber_endpoints', action='store_false',
help='use to not renumber endpoint')
parser.add_argument('--cdc_ep_num_notification', type=int, default=0,
help='endpoint number of CDC NOTIFICATION')
parser.add_argument('--cdc_ep_num_data_out', type=int, default=0,
help='endpoint number of CDC DATA OUT')
parser.add_argument('--cdc_ep_num_data_in', type=int, default=0,
help='endpoint number of CDC DATA IN')
parser.add_argument('--msc_ep_num_out', type=int, default=0,
help='endpoint number of MSC OUT')
parser.add_argument('--msc_ep_num_in', type=int, default=0,
help='endpoint number of MSC IN')
parser.add_argument('--hid_ep_num_out', type=int, default=0,
help='endpoint number of HID OUT')
parser.add_argument('--hid_ep_num_in', type=int, default=0,
help='endpoint number of HID IN')
parser.add_argument('--midi_ep_num_out', type=int, default=0,
help='endpoint number of MIDI OUT')
parser.add_argument('--midi_ep_num_in', type=int, default=0,
help='endpoint number of MIDI IN')
parser.add_argument('--output_c_file', type=argparse.FileType('w'), required=True)
parser.add_argument('--output_h_file', type=argparse.FileType('w'), required=True)
@ -47,9 +67,32 @@ unknown_hid_devices = list(frozenset(args.hid_devices) - ALL_HID_DEVICES_SET)
if unknown_hid_devices:
raise ValueError("Unknown HID devices(s)", unknown_hid_devices)
if args.msc_num_endpoint_pairs not in (1, 2):
raise ValueError("--msc_num_endpoint_pairs must be 1 or 2")
if not args.renumber_endpoints:
if 'CDC' in args.devices:
if args.cdc_ep_num_notification == 0:
raise ValueError("CDC notification endpoint number must not be 0")
elif args.cdc_ep_num_data_out == 0:
raise ValueError("CDC data OUT endpoint number must not be 0")
elif args.cdc_ep_num_data_in == 0:
raise ValueError("CDC data IN endpoint number must not be 0")
if 'MSC' in args.devices:
if args.msc_ep_num_out == 0:
raise ValueError("MSC endpoint OUT number must not be 0")
elif args.msc_ep_num_in == 0:
raise ValueError("MSC endpoint IN number must not be 0")
if 'HID' in args.devices:
if args.args.hid_ep_num_out == 0:
raise ValueError("HID endpoint OUT number must not be 0")
elif args.hid_ep_num_in == 0:
raise ValueError("HID endpoint IN number must not be 0")
if 'AUDIO' in args.devices:
if args.args.midi_ep_num_out == 0:
raise ValueError("MIDI endpoint OUT number must not be 0")
elif args.midi_ep_num_in == 0:
raise ValueError("MIDI endpoint IN number must not be 0")
class StringIndex:
"""Assign a monotonically increasing index to each unique string. Start with 0."""
@ -120,7 +163,7 @@ cdc_comm_interface = standard.InterfaceDescriptor(
cdc_union,
standard.EndpointDescriptor(
description="CDC comm in",
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN,
bEndpointAddress=args.cdc_ep_num_notification | standard.EndpointDescriptor.DIRECTION_IN,
bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
wMaxPacketSize=0x0040,
bInterval=0x10)
@ -133,11 +176,11 @@ cdc_data_interface = standard.InterfaceDescriptor(
subdescriptors=[
standard.EndpointDescriptor(
description="CDC data out",
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_OUT,
bEndpointAddress=args.cdc_ep_num_data_out | standard.EndpointDescriptor.DIRECTION_OUT,
bmAttributes=standard.EndpointDescriptor.TYPE_BULK),
standard.EndpointDescriptor(
description="CDC data in",
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN,
bEndpointAddress=args.cdc_ep_num_data_in | standard.EndpointDescriptor.DIRECTION_IN,
bmAttributes=standard.EndpointDescriptor.TYPE_BULK),
])
@ -153,16 +196,16 @@ msc_interfaces = [
subdescriptors=[
standard.EndpointDescriptor(
description="MSC in",
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN,
bEndpointAddress=args.msc_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN,
bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
bInterval=0),
bInterval=0,
wMaxPacketSize=args.msc_max_packet_size),
standard.EndpointDescriptor(
description="MSC out",
# SAMD21 needs to use a separate pair of endpoints for MSC.
bEndpointAddress=((0x1 if args.msc_num_endpoint_pairs == 2 else 0x0) |
standard.EndpointDescriptor.DIRECTION_OUT),
bEndpointAddress=(args.msc_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT),
bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
bInterval=0)
bInterval=0,
wMaxPacketSize=args.msc_max_packet_size)
]
)
]
@ -197,13 +240,13 @@ else:
# and will fail (possibly silently) if both are not supplied.
hid_endpoint_in_descriptor = standard.EndpointDescriptor(
description="HID in",
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN,
bEndpointAddress=args.hid_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN,
bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
bInterval=8)
hid_endpoint_out_descriptor = standard.EndpointDescriptor(
description="HID out",
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_OUT,
bEndpointAddress=args.hid_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT,
bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
bInterval=8)
@ -267,12 +310,12 @@ audio_midi_interface = standard.InterfaceDescriptor(
),
standard.EndpointDescriptor(
description="MIDI data out to CircuitPython",
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_OUT,
bEndpointAddress=args.midi_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT,
bmAttributes=standard.EndpointDescriptor.TYPE_BULK),
midi.DataEndpointDescriptor(baAssocJack=[midi_in_jack_emb]),
standard.EndpointDescriptor(
description="MIDI data in from CircuitPython",
bEndpointAddress=0x0 | standard.EndpointDescriptor.DIRECTION_IN,
bEndpointAddress=args.midi_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN,
bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
bInterval = 0x0),
midi.DataEndpointDescriptor(baAssocJack=[midi_out_jack_emb]),
@ -316,7 +359,7 @@ if 'AUDIO' in args.devices:
# util.join_interfaces() will renumber the endpoints to make them unique across descriptors,
# and renumber the interfaces in order. But we still need to fix up certain
# interface cross-references.
interfaces = util.join_interfaces(*interfaces_to_join)
interfaces = util.join_interfaces(interfaces_to_join, renumber_endpoints=args.renumber_endpoints)
# Now adjust the CDC interface cross-references.

@ -1 +1 @@
Subproject commit dac9689e274844294bbe4fd1b78defff9ff27533
Subproject commit 701cafc50e2e574dccaf7a340eedbd64a0b41a42