From 0802b22ed6229a981d26e5d89737877cfb044f61 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 4 Feb 2021 19:23:40 -0500 Subject: [PATCH 001/159] usb descriptors all set; rework of enabling for USB devices --- ports/atmel-samd/mpconfigport.mk | 22 +- .../lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk | 1 - .../boards/microdev_micro_s2/mpconfigboard.mk | 1 - .../mpconfigboard.mk | 1 - .../mpconfigboard.mk | 1 - ports/litex/mpconfigport.mk | 3 + ports/mimxrt10xx/mpconfigport.mk | 3 + ports/nrf/mpconfigport.mk | 3 + ports/raspberrypi/mpconfigport.mk | 1 + .../boards/thunderpack_v12/mpconfigboard.mk | 4 +- ports/stm/mpconfigport.mk | 7 + py/circuitpy_mpconfig.mk | 101 +- supervisor/shared/usb/tusb_config.h | 7 +- supervisor/supervisor.mk | 128 +-- tools/gen_usb_descriptor.py | 908 +++++++++++------- tools/usb_descriptor | 2 +- 16 files changed, 748 insertions(+), 445 deletions(-) diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index fb9cdf2e66..9839a2aa44 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -18,7 +18,16 @@ ifeq ($(LONGINT_IMPL),LONGLONG) MPY_TOOL_LONGINT_IMPL = -mlongint-impl=longlong endif +INTERNAL_LIBM = 1 + +USB_SERIAL_NUMBER_LENGTH = 32 + +# Number of USB endpoint pairs. +USB_NUM_EP = 8 + +###################################################################### # Put samd21-only choices here. + ifeq ($(CHIP_FAMILY),samd21) # The ?='s allow overriding in mpconfigboard.mk. @@ -40,7 +49,9 @@ CIRCUITPY_SDCARDIO ?= 0 CIRCUITPY_FRAMEBUFFERIO ?= 0 # SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic. +# Because of that, there aren't enough endpoints for serial2. USB_MSC_EP_NUM_OUT = 1 +CIRCUITPY_USB_SERIAL2 = 0 CIRCUITPY_ULAB = 0 @@ -55,9 +66,13 @@ CIRCUITPY_TERMINALIO = 0 endif endif # samd21 +###################################################################### +###################################################################### # Put samd51-only choices here. + ifeq ($(CHIP_FAMILY),samd51) + # No native touchio on SAMD51. CIRCUITPY_TOUCHIO_USE_NATIVE = 0 @@ -70,9 +85,4 @@ CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FULL_BUILD) CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD) endif # samd51 - -INTERNAL_LIBM = 1 - -USB_SERIAL_NUMBER_LENGTH = 32 - -USB_NUM_EP = 8 +###################################################################### diff --git a/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk index 38a7ed1fb7..79b45fd92c 100644 --- a/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk +++ b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x303a USB_PID = 0x8007 USB_PRODUCT = "TTGO T8 ESP32-S2" USB_MANUFACTURER = "LILYGO" -USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk index 5156170957..783e7ad4c7 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk +++ b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x80C6 USB_PRODUCT = "microS2" USB_MANUFACTURER = "microDev" -USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk index 9857c07617..d045cc2149 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x80AC USB_PRODUCT = "FeatherS2" USB_MANUFACTURER = "UnexpectedMaker" -USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk index 9857c07617..d045cc2149 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x80AC USB_PRODUCT = "FeatherS2" USB_MANUFACTURER = "UnexpectedMaker" -USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk index 003fb5c2c3..af6a94e64a 100644 --- a/ports/litex/mpconfigport.mk +++ b/ports/litex/mpconfigport.mk @@ -6,6 +6,9 @@ MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz # Internal math library is substantially smaller than toolchain one INTERNAL_LIBM = 1 +# Number of USB endpoint pairs. +USB_NUM_EP = 16 + # Chip supplied serial number, in bytes USB_SERIAL_NUMBER_LENGTH = 30 diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index b4cc9586ac..de594b14be 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -17,6 +17,9 @@ INTERNAL_LIBM = 1 USB_SERIAL_NUMBER_LENGTH = 32 USB_HIGHSPEED = 1 +# Number of USB endpoint pairs. +USB_NUM_EP = 8 + INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_AUDIOIO = 0 diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 9560064fbc..83924ff795 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -11,6 +11,9 @@ INTERNAL_LIBM = 1 USB_SERIAL_NUMBER_LENGTH = 16 +# Number of USB endpoint pairs. +USB_NUM_EP = 8 + # All nRF ports have longints. LONGINT_IMPL = MPZ diff --git a/ports/raspberrypi/mpconfigport.mk b/ports/raspberrypi/mpconfigport.mk index d0a21a7b41..6fb4ffaae3 100644 --- a/ports/raspberrypi/mpconfigport.mk +++ b/ports/raspberrypi/mpconfigport.mk @@ -44,4 +44,5 @@ INTERNAL_LIBM = 1 USB_SERIAL_NUMBER_LENGTH = 32 +# Number of USB endpoint pairs. USB_NUM_EP = 8 diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk index a2e1da1011..4436f04b77 100644 --- a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk @@ -2,7 +2,9 @@ USB_VID = 0x239A USB_PID = 0x8071 USB_PRODUCT = "Thunderpack STM32F411" USB_MANUFACTURER = "Jeremy Gillick" -USB_DEVICES = "CDC,MSC" + +# Turn off HID devices +CIRCUITPY_USB_HID = 0 LONGINT_IMPL = NONE diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index bcecaa5170..fe257fc505 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -8,6 +8,7 @@ ifeq ($(MCU_VARIANT),STM32F405xx) CIRCUITPY_FRAMEBUFFERIO ?= 1 CIRCUITPY_RGBMATRIX ?= 1 CIRCUITPY_SDIOIO ?= 1 + # Number of USB endpoint pairs. USB_NUM_EP = 4 endif @@ -23,6 +24,8 @@ ifeq ($(MCU_SERIES),F4) CIRCUITPY_RTC ?= 0 CIRCUITPY_USB_MIDI ?= 0 CIRCUITPY_USB_HID ?= 0 + + USB_NUM_EP = 4 endif ifeq ($(MCU_SERIES),H7) @@ -40,6 +43,8 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_RTC ?= 0 CIRCUITPY_USB_HID ?= 0 CIRCUITPY_USB_MIDI ?= 0 + + USB_NUM_EP = 9 endif ifeq ($(MCU_SERIES),F7) @@ -56,4 +61,6 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_RTC ?= 0 CIRCUITPY_USB_HID ?= 0 CIRCUITPY_USB_MIDI ?= 0 + + USB_NUM_EP = 6 endif diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index b8fe73eea9..e13eca6efe 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -89,6 +89,9 @@ CFLAGS += -DCIRCUITPY_AUDIOMP3=$(CIRCUITPY_AUDIOMP3) CIRCUITPY_BINASCII ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BINASCII=$(CIRCUITPY_BINASCII) +CIRCUITPY_BITBANG_APA102 ?= 0 +CFLAGS += -DCIRCUITPY_BITBANG_APA102=$(CIRCUITPY_BITBANG_APA102) + CIRCUITPY_BITBANGIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO) @@ -100,6 +103,9 @@ CFLAGS += -DCIRCUITPY_BLEIO_HCI=$(CIRCUITPY_BLEIO_HCI) CIRCUITPY_BLEIO ?= $(CIRCUITPY_BLEIO_HCI) CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO) +CIRCUITPY_BLE_FILE_SERVICE ?= 0 +CFLAGS += -DCIRCUITPY_BLE_FILE_SERVICE=$(CIRCUITPY_BLE_FILE_SERVICE) + CIRCUITPY_BOARD ?= 1 CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD) @@ -127,6 +133,13 @@ CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) CIRCUITPY_DISPLAYIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO) +CIRCUITPY_DUALBANK ?= 0 +CFLAGS += -DCIRCUITPY_DUALBANK=$(CIRCUITPY_DUALBANK) + +# Enabled micropython.native decorator (experimental) +CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 +CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) + CIRCUITPY_ERRNO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ERRNO=$(CIRCUITPY_ERRNO) @@ -179,6 +192,9 @@ CFLAGS += -DCIRCUITPY_MEMORYMONITOR=$(CIRCUITPY_MEMORYMONITOR) CIRCUITPY_MICROCONTROLLER ?= 1 CFLAGS += -DCIRCUITPY_MICROCONTROLLER=$(CIRCUITPY_MICROCONTROLLER) +CIRCUITPY_MSGPACK ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_MSGPACK=$(CIRCUITPY_MSGPACK) + CIRCUITPY_NEOPIXEL_WRITE ?= 1 CFLAGS += -DCIRCUITPY_NEOPIXEL_WRITE=$(CIRCUITPY_NEOPIXEL_WRITE) @@ -192,8 +208,8 @@ CFLAGS += -DCIRCUITPY_NVM=$(CIRCUITPY_NVM) CIRCUITPY_OS ?= 1 CFLAGS += -DCIRCUITPY_OS=$(CIRCUITPY_OS) -CIRCUITPY_DUALBANK ?= 0 -CFLAGS += -DCIRCUITPY_DUALBANK=$(CIRCUITPY_DUALBANK) +CIRCUITPY_PEW ?= 0 +CFLAGS += -DCIRCUITPY_PEW=$(CIRCUITPY_PEW) CIRCUITPY_PIXELBUF ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_PIXELBUF=$(CIRCUITPY_PIXELBUF) @@ -216,6 +232,11 @@ CFLAGS += -DCIRCUITPY_RANDOM=$(CIRCUITPY_RANDOM) CIRCUITPY_RE ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_RE=$(CIRCUITPY_RE) +# Should busio.I2C() check for pullups? +# Some boards in combination with certain peripherals may not want this. +CIRCUITPY_REQUIRE_I2C_PULLUPS ?= 1 +CFLAGS += -DCIRCUITPY_REQUIRE_I2C_PULLUPS=$(CIRCUITPY_REQUIRE_I2C_PULLUPS) + # CIRCUITPY_RP2PIO is handled in the raspberrypi tree. # Only for rp2 chips. # Assume not a rp2 build. @@ -243,6 +264,18 @@ CFLAGS += -DCIRCUITPY_SDCARDIO=$(CIRCUITPY_SDCARDIO) CIRCUITPY_SDIOIO ?= 0 CFLAGS += -DCIRCUITPY_SDIOIO=$(CIRCUITPY_SDIOIO) +# Second USB CDC serial channel. +CIRCUITPY_SERIAL2 ?= +CFLAGS += -DCIRCUITPY_SERIAL2=$(CIRCUITPY_SERIAL2) + +# REPL over BLE +CIRCUITPY_SERIAL_BLE ?= 0 +CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE) + +# REPL over UART +CIRCUITPY_SERIAL_UART ?= 0 +CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART) + CIRCUITPY_SHARPDISPLAY ?= $(CIRCUITPY_FRAMEBUFFERIO) CFLAGS += -DCIRCUITPY_SHARPDISPLAY=$(CIRCUITPY_SHARPDISPLAY) @@ -285,37 +318,48 @@ CFLAGS += -DCIRCUITPY_UHEAP=$(CIRCUITPY_UHEAP) CIRCUITPY_USB_HID ?= 1 CFLAGS += -DCIRCUITPY_USB_HID=$(CIRCUITPY_USB_HID) +CIRCUITPY_USB_HID_CONSUMER ?= 1 +CFLAGS += -DCIRCUITPY_USB_HID_CONSUMER=$(CIRCUITPY_USB_HID_CONSUMER) + +CIRCUITPY_USB_HID_DIGITIZER ?= 0 +CFLAGS += -DCIRCUITPY_USB_HID_DIGITIZER=$(CIRCUITPY_USB_HID_DIGITIZER) + +CIRCUITPY_USB_HID_GAMEPAD ?= 1 +CFLAGS += -DCIRCUITPY_USB_HID_GAMEPAD=$(CIRCUITPY_USB_HID_GAMEPAD) + +CIRCUITPY_USB_HID_KEYBOARD ?= 1 +CFLAGS += -DCIRCUITPY_USB_HID_KEYBOARD=$(CIRCUITPY_USB_HID_KEYBOARD) + +CIRCUITPY_USB_HID_MOUSE ?= 1 +CFLAGS += -DCIRCUITPY_USB_HID_MOUSE=$(CIRCUITPY_USB_HID_MOUSE) + +CIRCUITPY_USB_HID_SYS_CONTROL ?= 0 +CFLAGS += -DCIRCUITPY_USB_HID_CONTROL=$(CIRCUITPY_USB_HID_CONTROL) + +CIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD ?= 0 +CFLAGS += -DCIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD=$(CIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD) + CIRCUITPY_USB_MIDI ?= 1 CFLAGS += -DCIRCUITPY_USB_MIDI=$(CIRCUITPY_USB_MIDI) -CIRCUITPY_PEW ?= 0 -CFLAGS += -DCIRCUITPY_PEW=$(CIRCUITPY_PEW) +CIRCUITPY_USB_MSC ?= 1 +CFLAGS += -DCIRCUITPY_USB_MSC=$(CIRCUITPY_USB_MSC) + +CIRCUITPY_USB_SERIAL ?= 1 +CFLAGS += -DCIRCUITPY_USB_SERIAL=$(CIRCUITPY_USB_MSC) + +ifndef USB_NUM_EP +$(error "USB_NUM_EP (number of USB endpoint pairs)must be defined") +endif + +# Secondary CDC is usually available if there are at least 8 endpoints. +CIRCUITPY_USB_SERIAL2 ?= $(shell expr $(USB_NUM_EP) '>=' 8) +CFLAGS += -DCIRCUITPY_USB_SERIAL2=$(CIRCUITPY_USB_SERIAL2) # For debugging. CIRCUITPY_USTACK ?= 0 CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK) -# Non-module conditionals - -CIRCUITPY_BITBANG_APA102 ?= 0 -CFLAGS += -DCIRCUITPY_BITBANG_APA102=$(CIRCUITPY_BITBANG_APA102) - -# Should busio.I2C() check for pullups? -# Some boards in combination with certain peripherals may not want this. -CIRCUITPY_REQUIRE_I2C_PULLUPS ?= 1 -CFLAGS += -DCIRCUITPY_REQUIRE_I2C_PULLUPS=$(CIRCUITPY_REQUIRE_I2C_PULLUPS) - -# REPL over BLE -CIRCUITPY_SERIAL_BLE ?= 0 -CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE) - -CIRCUITPY_BLE_FILE_SERVICE ?= 0 -CFLAGS += -DCIRCUITPY_BLE_FILE_SERVICE=$(CIRCUITPY_BLE_FILE_SERVICE) - -# REPL over UART -CIRCUITPY_SERIAL_UART ?= 0 -CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART) - # ulab numerics library CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB) @@ -326,10 +370,3 @@ CFLAGS += -DCIRCUITPY_WATCHDOG=$(CIRCUITPY_WATCHDOG) CIRCUITPY_WIFI ?= 0 CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI) - -# Enabled micropython.native decorator (experimental) -CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 -CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) - -CIRCUITPY_MSGPACK ?= $(CIRCUITPY_FULL_BUILD) -CFLAGS += -DCIRCUITPY_MSGPACK=$(CIRCUITPY_MSGPACK) diff --git a/supervisor/shared/usb/tusb_config.h b/supervisor/shared/usb/tusb_config.h index 15d9fabafe..0e70367d0c 100644 --- a/supervisor/shared/usb/tusb_config.h +++ b/supervisor/shared/usb/tusb_config.h @@ -61,10 +61,15 @@ // DEVICE CONFIGURATION //--------------------------------------------------------------------+ -#define CFG_TUD_ENDOINT0_SIZE 64 +#define CFG_TUD_ENDPOINT0_SIZE 64 //------------- CLASS -------------// + +// Could be 2 if secondary CDC channel requested. +#ifndef CFG_TUD_CDC #define CFG_TUD_CDC 1 +#endif + #define CFG_TUD_MSC 1 #define CFG_TUD_HID CIRCUITPY_USB_HID #define CFG_TUD_MIDI CIRCUITPY_USB_MIDI diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index a59e99e3de..8fd32fa0b5 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -14,23 +14,15 @@ SRC_SUPERVISOR = \ supervisor/shared/tick.c \ supervisor/shared/translate.c -ifndef $(NO_USB) - NO_USB = $(wildcard supervisor/usb.c) -endif +NO_USB ?= $(wildcard supervisor/usb.c) -ifndef INTERNAL_FLASH_FILESYSTEM -INTERNAL_FLASH_FILESYSTEM = 0 -endif +INTERNAL_FLASH_FILESYSTEM ?= 0 CFLAGS += -DINTERNAL_FLASH_FILESYSTEM=$(INTERNAL_FLASH_FILESYSTEM) -ifndef QSPI_FLASH_FILESYSTEM -QSPI_FLASH_FILESYSTEM = 0 -endif +QSPI_FLASH_FILESYSTEM ?= 0 CFLAGS += -DQSPI_FLASH_FILESYSTEM=$(QSPI_FLASH_FILESYSTEM) -ifndef SPI_FLASH_FILESYSTEM SPI_FLASH_FILESYSTEM = 0 -endif CFLAGS += -DSPI_FLASH_FILESYSTEM=$(SPI_FLASH_FILESYSTEM) ifeq ($(CIRCUITPY_BLEIO),1) @@ -115,66 +107,78 @@ ifeq ($(CIRCUITPY_DISPLAYIO), 1) SUPERVISOR_O += $(BUILD)/autogen_display_resources.o endif endif -ifndef USB_INTERFACE_NAME -USB_INTERFACE_NAME = "CircuitPython" + +USB_INTERFACE_NAME ?= "CircuitPython" + +ifneq ($(USB_VID),) +CFLAGS += -DUSB_VID=$(USB_VID) +CFLAGS += -DSUB_PID=$(USB_PID) +CFLAGS += -DUSB_MANUFACTURER=$(USB_MANUFACTURER) +CFLAGS += -DUSB_PRODUCT=$(USB_PRODUCT) endif -USB_DEVICES_COMPUTED := CDC,MSC -ifeq ($(CIRCUITPY_USB_MIDI),1) -USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),AUDIO -endif +USB_DEVICES = ifeq ($(CIRCUITPY_USB_HID),1) -USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),HID +USB_DEVICES += HID endif -USB_DEVICES ?= "$(USB_DEVICES_COMPUTED)" - -ifndef USB_HID_DEVICES -USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" +ifeq ($(CIRCUITPY_USB_MIDI),1) +USB_DEVICES += AUDIO +endif +ifeq ($(CIRCUITPY_USB_MSC),1) +USB_DEVICES += MSC +endif +ifeq ($(CIRCUITPY_USB_SERIAL),1) +USB_DEVICES += CDC +endif +ifeq ($(CIRCUITPY_USB_SERIAL2),1) +# Inform TinyUSB there are two CDC devices. +CFLAGS += -DCFG_TUD_CDC=2 +USB_DEVICES += CDC2 endif -ifndef USB_HIGHSPEED -USB_HIGHSPEED = 0 +USB_HID_DEVICES = +ifeq ($(CIRCUITPY_USB_HID_CONSUMER),1) +USB_HID_DEVICES += CONSUMER +endif +ifeq ($(CIRCUITPY_USB_HID_DIGITIZER),1) +USB_HID_DEVICES += DIGITIZER +endif +ifeq ($(CIRCUITPY_USB_HID_GAMEPAD),1) +USB_HID_DEVICES += GAMEPAD +endif +ifeq ($(CIRCUITPY_USB_HID_KEYBOARD),1) +USB_HID_DEVICES += KEYBOARD +endif +ifeq ($(CIRCUITPY_USB_HID_MOUSE),1) +USB_HID_DEVICES += MOUSE +endif +ifeq ($(CIRCUITPY_USB_HID_SYS_CONTROL),1) +USB_HID_DEVICES += SYS_CONTROL +endif +ifeq ($(CIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD),1) +USB_HID_DEVICES += XAC_COMPATIBLE_GAMEPAD endif -ifndef USB_CDC_EP_NUM_NOTIFICATION -USB_CDC_EP_NUM_NOTIFICATION = 0 +# RAW is not compatible with other HID devices. +ifeq ($(CIRCUITPY_USB_HID_RAW),1) + ifneq ($(CIRCUITPY_USB_HID_DEVICES,) + $(error HID RAW must not be combined with other HID devices) + endif +USB_HID_DEVICES += MOUSE endif -ifndef USB_CDC_EP_NUM_DATA_OUT -USB_CDC_EP_NUM_DATA_OUT = 0 -endif +USB_HIGHSPEED ?= 0 -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 - -ifndef USB_NUM_EP -USB_NUM_EP = 0 -endif +USB_CDC_EP_NUM_NOTIFICATION ?= 0 +USB_CDC_EP_NUM_DATA_OUT ?= 0 +USB_CDC_EP_NUM_DATA_IN ?= 0 +USB_MSC_EP_NUM_OUT ?= 0 +USB_MSC_EP_NUM_IN ?= 0 +USB_HID_EP_NUM_OUT ?= 0 +USB_HID_EP_NUM_IN ?= 0 +USB_MIDI_EP_NUM_OUT ?= 0 +USB_MIDI_EP_NUM_IN ?= 0 +USB_NUM_EP ?= 0 USB_DESCRIPTOR_ARGS = \ --manufacturer $(USB_MANUFACTURER)\ @@ -183,8 +187,8 @@ USB_DESCRIPTOR_ARGS = \ --pid $(USB_PID)\ --serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\ --interface_name $(USB_INTERFACE_NAME)\ - --devices $(USB_DEVICES)\ - --hid_devices $(USB_HID_DEVICES)\ + --devices "$(USB_DEVICES)"\ + --hid_devices "$(USB_HID_DEVICES)"\ --max_ep $(USB_NUM_EP) \ --cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\ --cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\ diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index 672f09c889..199cdf9cf6 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -12,60 +12,98 @@ sys.path.append("../../tools/usb_descriptor") from adafruit_usb_descriptor import audio, audio10, cdc, hid, midi, msc, standard, util import hid_report_descriptors -DEFAULT_INTERFACE_NAME = 'CircuitPython' -ALL_DEVICES='CDC,MSC,AUDIO,HID' -ALL_DEVICES_SET=frozenset(ALL_DEVICES.split(',')) -DEFAULT_DEVICES='CDC,MSC,AUDIO,HID' +DEFAULT_INTERFACE_NAME = "CircuitPython" +ALL_DEVICES = "CDC CDC2 MSC AUDIO HID" +ALL_DEVICES_SET = frozenset(ALL_DEVICES.split()) +DEFAULT_DEVICES = "CDC MSC AUDIO HID" -ALL_HID_DEVICES='KEYBOARD,MOUSE,CONSUMER,SYS_CONTROL,GAMEPAD,DIGITIZER,XAC_COMPATIBLE_GAMEPAD,RAW' -ALL_HID_DEVICES_SET=frozenset(ALL_HID_DEVICES.split(',')) +ALL_HID_DEVICES = ( + "KEYBOARD MOUSE CONSUMER SYS_CONTROL GAMEPAD DIGITIZER XAC_COMPATIBLE_GAMEPAD RAW" +) +ALL_HID_DEVICES_SET = frozenset(ALL_HID_DEVICES.split()) # Digitizer works on Linux but conflicts with mouse, so omit it. -DEFAULT_HID_DEVICES='KEYBOARD,MOUSE,CONSUMER,GAMEPAD' +DEFAULT_HID_DEVICES = "KEYBOARD MOUSE CONSUMER GAMEPAD" -parser = argparse.ArgumentParser(description='Generate USB descriptors.') -parser.add_argument('--highspeed', default=False, action='store_true', - help='descriptor for highspeed device') -parser.add_argument('--manufacturer', type=str, - help='manufacturer of the device') -parser.add_argument('--product', type=str, - help='product name of the device') -parser.add_argument('--vid', type=lambda x: int(x, 16), - help='vendor id') -parser.add_argument('--pid', type=lambda x: int(x, 16), - help='product id') -parser.add_argument('--serial_number_length', type=int, default=32, - help='length needed for the serial number in digits') -parser.add_argument('--devices', type=lambda l: tuple(l.split(',')), default=DEFAULT_DEVICES, - 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('--interface_name', type=str, - help='The name/prefix to use in the interface descriptions', - default=DEFAULT_INTERFACE_NAME) -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('--max_ep', type=int, default=0, - help='total number of endpoints available') -parser.add_argument('--output_c_file', type=argparse.FileType('w', encoding='UTF-8'), required=True) -parser.add_argument('--output_h_file', type=argparse.FileType('w', encoding='UTF-8'), required=True) +parser = argparse.ArgumentParser(description="Generate USB descriptors.") +parser.add_argument( + "--highspeed", + default=False, + action="store_true", + help="descriptor for highspeed device", +) +parser.add_argument("--manufacturer", type=str, help="manufacturer of the device") +parser.add_argument("--product", type=str, help="product name of the device") +parser.add_argument("--vid", type=lambda x: int(x, 16), help="vendor id") +parser.add_argument("--pid", type=lambda x: int(x, 16), help="product id") +parser.add_argument( + "--serial_number_length", + type=int, + default=32, + help="length needed for the serial number in digits", +) +parser.add_argument( + "--devices", + type=lambda l: tuple(l.split()), + default=DEFAULT_DEVICES, + 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( + "--interface_name", + type=str, + help="The name/prefix to use in the interface descriptions", + default=DEFAULT_INTERFACE_NAME, +) +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( + "--max_ep", type=int, default=0, help="total number of endpoints available" +) +parser.add_argument( + "--output_c_file", type=argparse.FileType("w", encoding="UTF-8"), required=True +) +parser.add_argument( + "--output_h_file", type=argparse.FileType("w", encoding="UTF-8"), required=True +) args = parser.parse_args() @@ -77,8 +115,17 @@ 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) +include_cdc = "CDC" in args.devices +include_cdc2 = "CDC2" in args.devices +include_msc = "MSC" in args.devices +include_hid = "HID" in args.devices +include_audio = "AUDIO" in args.devices + +if not include_cdc and include_cdc2: + raise ValueError("CDC2 requested without CDC") + if not args.renumber_endpoints: - if 'CDC' in args.devices: + if include_cdc: 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: @@ -86,32 +133,37 @@ if not args.renumber_endpoints: 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 include_cdc2: + raise ValueError("Second CDC not supported without renumbering endpoints") + + if include_msc: if args.msc_ep_num_out == 0: raise ValueError("MSC endpoint OUT number must not be 0") - elif args.msc_ep_num_in == 0: + elif args.msc_ep_num_in == 0: raise ValueError("MSC endpoint IN number must not be 0") - if 'HID' in args.devices: + if include_hid: 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: + elif args.hid_ep_num_in == 0: raise ValueError("HID endpoint IN number must not be 0") - if 'AUDIO' in args.devices: + if include_audio: 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: + 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.""" + string_to_index = {} index_to_variable = {} strings = [] @classmethod - def index(cls, string, *, variable_name = None): + def index(cls, string, *, variable_name=None): if string in cls.string_to_index: idx = cls.string_to_index[string] if not cls.index_to_variable[idx]: @@ -129,11 +181,12 @@ class StringIndex: return cls.strings - # langid must be the 0th string descriptor LANGID_INDEX = StringIndex.index("\u0409", variable_name="language_id") assert LANGID_INDEX == 0 -SERIAL_NUMBER_INDEX = StringIndex.index("S" * args.serial_number_length, variable_name="usb_serial_number") +SERIAL_NUMBER_INDEX = StringIndex.index( + "S" * args.serial_number_length, variable_name="usb_serial_number" +) device = standard.DeviceDescriptor( description="top", @@ -141,212 +194,267 @@ device = standard.DeviceDescriptor( idProduct=args.pid, iManufacturer=StringIndex.index(args.manufacturer), iProduct=StringIndex.index(args.product), - iSerialNumber=SERIAL_NUMBER_INDEX) + iSerialNumber=SERIAL_NUMBER_INDEX, +) # Interface numbers are interface-set local and endpoints are interface local # until util.join_interfaces renumbers them. -cdc_union = cdc.Union( - description="CDC comm", - bMasterInterface=0x00, # Adjust this after interfaces are renumbered. - bSlaveInterface_list=[0x01]) # Adjust this after interfaces are renumbered. -cdc_call_management = cdc.CallManagement( - description="CDC comm", - bmCapabilities=0x01, - bDataInterface=0x01) # Adjust this after interfaces are renumbered. +def make_cdc_union(name): + return cdc.Union( + description="{} comm".format(name), + bMasterInterface=0x00, # Adjust this after interfaces are renumbered. + bSlaveInterface_list=[0x01], + ) # Adjust this after interfaces are renumbered. -cdc_comm_interface = standard.InterfaceDescriptor( - description="CDC comm", - bInterfaceClass=cdc.CDC_CLASS_COMM, # Communications Device Class - bInterfaceSubClass=cdc.CDC_SUBCLASS_ACM, # Abstract control model - bInterfaceProtocol=cdc.CDC_PROTOCOL_NONE, - iInterface=StringIndex.index("{} CDC control".format(args.interface_name)), - subdescriptors=[ - cdc.Header( - description="CDC comm", - bcdCDC=0x0110), - cdc_call_management, - cdc.AbstractControlManagement( - description="CDC comm", - bmCapabilities=0x02), - cdc_union, - standard.EndpointDescriptor( - description="CDC comm in", - bEndpointAddress=args.cdc_ep_num_notification | standard.EndpointDescriptor.DIRECTION_IN, - bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT, - wMaxPacketSize=0x0040, - bInterval=0x10) - ]) -cdc_data_interface = standard.InterfaceDescriptor( - description="CDC data", - bInterfaceClass=cdc.CDC_CLASS_DATA, - iInterface=StringIndex.index("{} CDC data".format(args.interface_name)), - subdescriptors=[ - standard.EndpointDescriptor( - description="CDC data out", - bEndpointAddress=args.cdc_ep_num_data_out | standard.EndpointDescriptor.DIRECTION_OUT, - bmAttributes=standard.EndpointDescriptor.TYPE_BULK, - bInterval=0, - wMaxPacketSize=512 if args.highspeed else 64), - standard.EndpointDescriptor( - description="CDC data in", - bEndpointAddress=args.cdc_ep_num_data_in | standard.EndpointDescriptor.DIRECTION_IN, - bmAttributes=standard.EndpointDescriptor.TYPE_BULK, - bInterval=0, - wMaxPacketSize=512 if args.highspeed else 64), - ]) +def make_cdc_call_management(name): + return cdc.CallManagement( + description="{} comm".format(name), bmCapabilities=0x01, bDataInterface=0x01 + ) # Adjust this after interfaces are renumbered. -cdc_interfaces = [cdc_comm_interface, cdc_data_interface] -msc_interfaces = [ - standard.InterfaceDescriptor( - description="MSC", - bInterfaceClass=msc.MSC_CLASS, - bInterfaceSubClass=msc.MSC_SUBCLASS_TRANSPARENT, - bInterfaceProtocol=msc.MSC_PROTOCOL_BULK, - iInterface=StringIndex.index("{} Mass Storage".format(args.interface_name)), +def make_cdc_comm_interface(name, cdc_union): + return standard.InterfaceDescriptor( + description="{} comm".format(name), + bInterfaceClass=cdc.CDC_CLASS_COMM, # Communications Device Class + bInterfaceSubClass=cdc.CDC_SUBCLASS_ACM, # Abstract control model + bInterfaceProtocol=cdc.CDC_PROTOCOL_NONE, + iInterface=StringIndex.index("{} {} control".format(args.interface_name, name)), subdescriptors=[ + cdc.Header(description="{} comm".format(name), bcdCDC=0x0110), + cdc_call_management, + cdc.AbstractControlManagement( + description="{} comm".format(name), bmCapabilities=0x02 + ), + cdc_union, standard.EndpointDescriptor( - description="MSC in", - bEndpointAddress=args.msc_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN, - bmAttributes=standard.EndpointDescriptor.TYPE_BULK, - bInterval=0, - wMaxPacketSize=512 if args.highspeed else 64), - standard.EndpointDescriptor( - description="MSC out", - bEndpointAddress=(args.msc_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT), - bmAttributes=standard.EndpointDescriptor.TYPE_BULK, - bInterval=0, - wMaxPacketSize=512 if args.highspeed else 64), - ] + description="{} comm in".format(name), + bEndpointAddress=args.cdc_ep_num_notification + | standard.EndpointDescriptor.DIRECTION_IN, + bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT, + wMaxPacketSize=0x0040, + bInterval=0x10, + ), + ], ) -] -# When there's only one hid_device, it shouldn't have a report id. -# Otherwise, report ids are assigned sequentially: -# args.hid_devices[0] has report_id 1 -# args.hid_devices[1] has report_id 2 -# etc. -report_ids = {} - -if len(args.hid_devices) == 1: - name = args.hid_devices[0] - combined_hid_report_descriptor = hid.ReportDescriptor( - description=name, - report_descriptor=bytes(hid_report_descriptors.REPORT_DESCRIPTOR_FUNCTIONS[name](0))) - report_ids[name] = 0 -else: - report_id = 1 - concatenated_descriptors = bytearray() - for name in args.hid_devices: - concatenated_descriptors.extend( - bytes(hid_report_descriptors.REPORT_DESCRIPTOR_FUNCTIONS[name](report_id))) - report_ids[name] = report_id - report_id += 1 - combined_hid_report_descriptor = hid.ReportDescriptor( - description="MULTIDEVICE", - report_descriptor=bytes(concatenated_descriptors)) - -# ASF4 expects keyboard and generic devices to have both in and out endpoints, -# and will fail (possibly silently) if both are not supplied. -hid_endpoint_in_descriptor = standard.EndpointDescriptor( - description="HID 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=args.hid_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT, - bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT, - bInterval=8) - -hid_interfaces = [ - standard.InterfaceDescriptor( - description="HID Multiple Devices", - bInterfaceClass=hid.HID_CLASS, - bInterfaceSubClass=hid.HID_SUBCLASS_NOBOOT, - bInterfaceProtocol=hid.HID_PROTOCOL_NONE, - iInterface=StringIndex.index("{} HID".format(args.interface_name)), +def make_cdc_data_interface(name): + return standard.InterfaceDescriptor( + description="{} data".format(name), + bInterfaceClass=cdc.CDC_CLASS_DATA, + iInterface=StringIndex.index("{} {} data".format(args.interface_name, name)), subdescriptors=[ - hid.HIDDescriptor( - description="HID", - wDescriptorLength=len(bytes(combined_hid_report_descriptor))), - hid_endpoint_in_descriptor, - hid_endpoint_out_descriptor, - ] + standard.EndpointDescriptor( + description="{} data out".format(name), + bEndpointAddress=args.cdc_ep_num_data_out + | standard.EndpointDescriptor.DIRECTION_OUT, + bmAttributes=standard.EndpointDescriptor.TYPE_BULK, + bInterval=0, + wMaxPacketSize=512 if args.highspeed else 64, + ), + standard.EndpointDescriptor( + description="{} data in".format(name), + bEndpointAddress=args.cdc_ep_num_data_in + | standard.EndpointDescriptor.DIRECTION_IN, + bmAttributes=standard.EndpointDescriptor.TYPE_BULK, + bInterval=0, + wMaxPacketSize=512 if args.highspeed else 64, + ), + ], + ) + + +if include_cdc: + cdc_union = make_cdc_union("CDC") + cdc_call_management = make_cdc_call_management("CDC") + cdc_comm_interface = make_cdc_comm_interface("CDC", cdc_union) + cdc_data_interface = make_cdc_data_interface("CDC") + + cdc_interfaces = [cdc_comm_interface, cdc_data_interface] + +if include_cdc2: + cdc2_union = make_cdc_union("CDC2") + cdc2_call_management = make_cdc_call_management("CDC2") + cdc2_comm_interface = make_cdc_comm_interface("CDC2", cdc2_union) + cdc2_data_interface = make_cdc_data_interface("CDC2") + + cdc2_interfaces = [cdc2_comm_interface, cdc2_data_interface] + +if include_msc: + msc_interfaces = [ + standard.InterfaceDescriptor( + description="MSC", + bInterfaceClass=msc.MSC_CLASS, + bInterfaceSubClass=msc.MSC_SUBCLASS_TRANSPARENT, + bInterfaceProtocol=msc.MSC_PROTOCOL_BULK, + iInterface=StringIndex.index("{} Mass Storage".format(args.interface_name)), + subdescriptors=[ + standard.EndpointDescriptor( + description="MSC in", + bEndpointAddress=args.msc_ep_num_in + | standard.EndpointDescriptor.DIRECTION_IN, + bmAttributes=standard.EndpointDescriptor.TYPE_BULK, + bInterval=0, + wMaxPacketSize=512 if args.highspeed else 64, + ), + standard.EndpointDescriptor( + description="MSC out", + bEndpointAddress=( + args.msc_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT + ), + bmAttributes=standard.EndpointDescriptor.TYPE_BULK, + bInterval=0, + wMaxPacketSize=512 if args.highspeed else 64, + ), + ], + ) + ] + + +if include_hid: + # When there's only one hid_device, it shouldn't have a report id. + # Otherwise, report ids are assigned sequentially: + # args.hid_devices[0] has report_id 1 + # args.hid_devices[1] has report_id 2 + # etc. + + report_ids = {} + + if len(args.hid_devices) == 1: + name = args.hid_devices[0] + combined_hid_report_descriptor = hid.ReportDescriptor( + description=name, + report_descriptor=bytes( + hid_report_descriptors.REPORT_DESCRIPTOR_FUNCTIONS[name](0) + ), + ) + report_ids[name] = 0 + else: + report_id = 1 + concatenated_descriptors = bytearray() + for name in args.hid_devices: + concatenated_descriptors.extend( + bytes( + hid_report_descriptors.REPORT_DESCRIPTOR_FUNCTIONS[name](report_id) + ) + ) + report_ids[name] = report_id + report_id += 1 + combined_hid_report_descriptor = hid.ReportDescriptor( + description="MULTIDEVICE", report_descriptor=bytes(concatenated_descriptors) + ) + + # ASF4 expects keyboard and generic devices to have both in and out endpoints, + # and will fail (possibly silently) if both are not supplied. + hid_endpoint_in_descriptor = standard.EndpointDescriptor( + description="HID 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=args.hid_ep_num_out + | standard.EndpointDescriptor.DIRECTION_OUT, + bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT, + bInterval=8, + ) + + hid_interfaces = [ + standard.InterfaceDescriptor( + description="HID Multiple Devices", + bInterfaceClass=hid.HID_CLASS, + bInterfaceSubClass=hid.HID_SUBCLASS_NOBOOT, + bInterfaceProtocol=hid.HID_PROTOCOL_NONE, + iInterface=StringIndex.index("{} HID".format(args.interface_name)), + subdescriptors=[ + hid.HIDDescriptor( + description="HID", + wDescriptorLength=len(bytes(combined_hid_report_descriptor)), + ), + hid_endpoint_in_descriptor, + hid_endpoint_out_descriptor, + ], ), ] -# Audio! -# In and out here are relative to CircuitPython +if include_audio: + # Audio! + # In and out here are relative to CircuitPython -# USB OUT -> midi_in_jack_emb -> midi_out_jack_ext -> CircuitPython -midi_in_jack_emb = midi.InJackDescriptor( - description="MIDI PC -> {}".format(args.interface_name), - bJackType=midi.JACK_TYPE_EMBEDDED, - iJack=StringIndex.index("{} usb_midi.ports[0]".format(args.interface_name))) -midi_out_jack_ext = midi.OutJackDescriptor( - description="MIDI data out to user code.", - bJackType=midi.JACK_TYPE_EXTERNAL, - input_pins=[(midi_in_jack_emb, 1)], - iJack=0) - -# USB IN <- midi_out_jack_emb <- midi_in_jack_ext <- CircuitPython -midi_in_jack_ext = midi.InJackDescriptor( - description="MIDI data in from user code.", - bJackType=midi.JACK_TYPE_EXTERNAL, - iJack=0) -midi_out_jack_emb = midi.OutJackDescriptor( - description="MIDI PC <- {}".format(args.interface_name), - bJackType=midi.JACK_TYPE_EMBEDDED, - input_pins=[(midi_in_jack_ext, 1)], - iJack=StringIndex.index("{} usb_midi.ports[1]".format(args.interface_name))) - - -audio_midi_interface = standard.InterfaceDescriptor( - description="Midi goodness", - bInterfaceClass=audio.AUDIO_CLASS_DEVICE, - bInterfaceSubClass=audio.AUDIO_SUBCLASS_MIDI_STREAMING, - bInterfaceProtocol=audio.AUDIO_PROTOCOL_V1, - iInterface=StringIndex.index("{} MIDI".format(args.interface_name)), - subdescriptors=[ - midi.Header( - jacks_and_elements=[ - midi_in_jack_emb, - midi_in_jack_ext, - midi_out_jack_emb, - midi_out_jack_ext - ], - ), - standard.EndpointDescriptor( - description="MIDI data out to {}".format(args.interface_name), - bEndpointAddress=args.midi_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT, - bmAttributes=standard.EndpointDescriptor.TYPE_BULK, - bInterval=0, - wMaxPacketSize=512 if args.highspeed else 64), - midi.DataEndpointDescriptor(baAssocJack=[midi_in_jack_emb]), - standard.EndpointDescriptor( - description="MIDI data in from {}".format(args.interface_name), - bEndpointAddress=args.midi_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN, - bmAttributes=standard.EndpointDescriptor.TYPE_BULK, - bInterval = 0x0, - wMaxPacketSize=512 if args.highspeed else 64), - midi.DataEndpointDescriptor(baAssocJack=[midi_out_jack_emb]), - ]) - -cs_ac_interface = audio10.AudioControlInterface( - description="Empty audio control", - audio_streaming_interfaces = [], - midi_streaming_interfaces = [ - audio_midi_interface - ] + # USB OUT -> midi_in_jack_emb -> midi_out_jack_ext -> CircuitPython + midi_in_jack_emb = midi.InJackDescriptor( + description="MIDI PC -> {}".format(args.interface_name), + bJackType=midi.JACK_TYPE_EMBEDDED, + iJack=StringIndex.index("{} usb_midi.ports[0]".format(args.interface_name)), + ) + midi_out_jack_ext = midi.OutJackDescriptor( + description="MIDI data out to user code.", + bJackType=midi.JACK_TYPE_EXTERNAL, + input_pins=[(midi_in_jack_emb, 1)], + iJack=0, ) -audio_control_interface = standard.InterfaceDescriptor( + # USB IN <- midi_out_jack_emb <- midi_in_jack_ext <- CircuitPython + midi_in_jack_ext = midi.InJackDescriptor( + description="MIDI data in from user code.", + bJackType=midi.JACK_TYPE_EXTERNAL, + iJack=0, + ) + midi_out_jack_emb = midi.OutJackDescriptor( + description="MIDI PC <- {}".format(args.interface_name), + bJackType=midi.JACK_TYPE_EMBEDDED, + input_pins=[(midi_in_jack_ext, 1)], + iJack=StringIndex.index("{} usb_midi.ports[1]".format(args.interface_name)), + ) + + audio_midi_interface = standard.InterfaceDescriptor( + description="Midi goodness", + bInterfaceClass=audio.AUDIO_CLASS_DEVICE, + bInterfaceSubClass=audio.AUDIO_SUBCLASS_MIDI_STREAMING, + bInterfaceProtocol=audio.AUDIO_PROTOCOL_V1, + iInterface=StringIndex.index("{} MIDI".format(args.interface_name)), + subdescriptors=[ + midi.Header( + jacks_and_elements=[ + midi_in_jack_emb, + midi_in_jack_ext, + midi_out_jack_emb, + midi_out_jack_ext, + ], + ), + standard.EndpointDescriptor( + description="MIDI data out to {}".format(args.interface_name), + bEndpointAddress=args.midi_ep_num_out + | standard.EndpointDescriptor.DIRECTION_OUT, + bmAttributes=standard.EndpointDescriptor.TYPE_BULK, + bInterval=0, + wMaxPacketSize=512 if args.highspeed else 64, + ), + midi.DataEndpointDescriptor(baAssocJack=[midi_in_jack_emb]), + standard.EndpointDescriptor( + description="MIDI data in from {}".format(args.interface_name), + bEndpointAddress=args.midi_ep_num_in + | standard.EndpointDescriptor.DIRECTION_IN, + bmAttributes=standard.EndpointDescriptor.TYPE_BULK, + bInterval=0x0, + wMaxPacketSize=512 if args.highspeed else 64, + ), + midi.DataEndpointDescriptor(baAssocJack=[midi_out_jack_emb]), + ], + ) + + cs_ac_interface = audio10.AudioControlInterface( + description="Empty audio control", + audio_streaming_interfaces=[], + midi_streaming_interfaces=[audio_midi_interface], + ) + + audio_control_interface = standard.InterfaceDescriptor( description="All the audio", bInterfaceClass=audio.AUDIO_CLASS_DEVICE, bInterfaceSubClass=audio.AUDIO_SUBCLASS_CONTROL, @@ -354,57 +462,89 @@ audio_control_interface = standard.InterfaceDescriptor( iInterface=StringIndex.index("{} Audio".format(args.interface_name)), subdescriptors=[ cs_ac_interface, - ]) + ], + ) -# Audio streaming interfaces must occur before MIDI ones. -audio_interfaces = [audio_control_interface] + cs_ac_interface.audio_streaming_interfaces + cs_ac_interface.midi_streaming_interfaces + # Audio streaming interfaces must occur before MIDI ones. + audio_interfaces = ( + [audio_control_interface] + + cs_ac_interface.audio_streaming_interfaces + + cs_ac_interface.midi_streaming_interfaces + ) interfaces_to_join = [] -if 'CDC' in args.devices: +if include_cdc: interfaces_to_join.append(cdc_interfaces) -if 'MSC' in args.devices: +if include_cdc2: + interfaces_to_join.append(cdc2_interfaces) + +if include_msc: interfaces_to_join.append(msc_interfaces) -if 'HID' in args.devices: +if include_hid: interfaces_to_join.append(hid_interfaces) -if 'AUDIO' in args.devices: +if include_audio: interfaces_to_join.append(audio_interfaces) # 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, renumber_endpoints=args.renumber_endpoints) +interfaces = util.join_interfaces( + interfaces_to_join, renumber_endpoints=args.renumber_endpoints +) if args.max_ep != 0: for interface in interfaces: for subdescriptor in interface.subdescriptors: - endpoint_address = getattr(subdescriptor, 'bEndpointAddress', 0) & 0x7f + endpoint_address = getattr(subdescriptor, "bEndpointAddress", 0) & 0x7F 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)) + 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) + print( + "Unable to check whether maximum number of endpoints is respected", + file=sys.stderr, + ) # Now adjust the CDC interface cross-references. -cdc_union.bMasterInterface = cdc_comm_interface.bInterfaceNumber -cdc_union.bSlaveInterface_list = [cdc_data_interface.bInterfaceNumber] +if include_cdc: + cdc_union.bMasterInterface = cdc_comm_interface.bInterfaceNumber + cdc_union.bSlaveInterface_list = [cdc_data_interface.bInterfaceNumber] -cdc_call_management.bDataInterface = cdc_data_interface.bInterfaceNumber + cdc_call_management.bDataInterface = cdc_data_interface.bInterfaceNumber -cdc_iad = standard.InterfaceAssociationDescriptor( - description="CDC IAD", - bFirstInterface=cdc_comm_interface.bInterfaceNumber, - bInterfaceCount=len(cdc_interfaces), - bFunctionClass=cdc.CDC_CLASS_COMM, # Communications Device Class - bFunctionSubClass=cdc.CDC_SUBCLASS_ACM, # Abstract control model - bFunctionProtocol=cdc.CDC_PROTOCOL_NONE) +if include_cdc2: + cdc2_union.bMasterInterface = cdc2_comm_interface.bInterfaceNumber + cdc2_union.bSlaveInterface_list = [cdc2_data_interface.bInterfaceNumber] + + cdc2_call_management.bDataInterface = cdc2_data_interface.bInterfaceNumber + + +def make_cdc_iad(cdc_comm_interface, name): + return standard.InterfaceAssociationDescriptor( + description="{} IAD".format(name), + bFirstInterface=cdc_comm_interface.bInterfaceNumber, + bInterfaceCount=len(cdc_interfaces), + bFunctionClass=cdc.CDC_CLASS_COMM, # Communications Device Class + bFunctionSubClass=cdc.CDC_SUBCLASS_ACM, # Abstract control model + bFunctionProtocol=cdc.CDC_PROTOCOL_NONE, + ) + + +if include_cdc: + cdc_iad = make_cdc_iad(cdc_comm_interface, "CDC") +if include_cdc2: + cdc2_iad = make_cdc_iad(cdc2_comm_interface, "CDC2") descriptor_list = [] -if 'CDC' in args.devices: +if include_cdc: # Put the CDC IAD just before the CDC interfaces. # There appears to be a bug in the Windows composite USB driver that requests the # HID report descriptor with the wrong interface number if the HID interface is not given @@ -414,13 +554,17 @@ if 'CDC' in args.devices: descriptor_list.append(cdc_iad) descriptor_list.extend(cdc_interfaces) -if 'MSC' in args.devices: +if include_cdc2: + descriptor_list.append(cdc2_iad) + descriptor_list.extend(cdc2_interfaces) + +if include_msc: descriptor_list.extend(msc_interfaces) -if 'HID' in args.devices: +if include_hid: descriptor_list.extend(hid_interfaces) -if 'AUDIO' in args.devices: +if include_audio: # Only add the control interface because other audio interfaces are managed by it to ensure the # correct ordering. descriptor_list.append(audio_control_interface) @@ -429,53 +573,74 @@ if 'AUDIO' in args.devices: configuration = standard.ConfigurationDescriptor( description="Composite configuration", - wTotalLength=(standard.ConfigurationDescriptor.bLength + - sum([len(bytes(x)) for x in descriptor_list])), - bNumInterfaces=len(interfaces)) + wTotalLength=( + standard.ConfigurationDescriptor.bLength + + sum([len(bytes(x)) for x in descriptor_list]) + ), + bNumInterfaces=len(interfaces), +) descriptor_list.insert(0, configuration) -string_descriptors = [standard.StringDescriptor(string) for string in StringIndex.strings_in_order()] +string_descriptors = [ + standard.StringDescriptor(string) for string in StringIndex.strings_in_order() +] serial_number_descriptor = string_descriptors[SERIAL_NUMBER_INDEX] c_file = args.output_c_file h_file = args.output_h_file -c_file.write("""\ +c_file.write( + """\ #include #include "py/objtuple.h" #include "shared-bindings/usb_hid/Device.h" #include "{H_FILE_NAME}" -""".format(H_FILE_NAME=h_file.name)) +""".format( + H_FILE_NAME=h_file.name + ) +) -c_file.write("""\ +c_file.write( + """\ // {DESCRIPTION} : {CLASS} -""".format(DESCRIPTION=device.description, - CLASS=device.__class__)) +""".format( + DESCRIPTION=device.description, CLASS=device.__class__ + ) +) -c_file.write("""\ +c_file.write( + """\ const uint8_t usb_desc_dev[] = { -""") +""" +) for b in bytes(device): c_file.write("0x{:02x}, ".format(b)) -c_file.write("""\ +c_file.write( + """\ }; -""") +""" +) -c_file.write("""\ +c_file.write( + """\ const uint8_t usb_desc_cfg[] = { -""") +""" +) # Write out all the regular descriptors as one long array (that's how ASF4 does it). descriptor_length = 0 for descriptor in descriptor_list: - c_file.write("""\ + c_file.write( + """\ // {DESCRIPTION} : {CLASS} -""".format(DESCRIPTION=descriptor.description, - CLASS=descriptor.__class__)) +""".format( + DESCRIPTION=descriptor.description, CLASS=descriptor.__class__ + ) + ) b = bytes(descriptor) notes = descriptor.notes() @@ -493,17 +658,22 @@ for descriptor in descriptor_list: i += length descriptor_length += len(b) -c_file.write("""\ +c_file.write( + """\ }; -""") +""" +) pointers_to_strings = [] for idx, descriptor in enumerate(string_descriptors): - c_file.write("""\ + c_file.write( + """\ // {DESCRIPTION} : {CLASS} -""".format(DESCRIPTION=descriptor.description, - CLASS=descriptor.__class__)) +""".format( + DESCRIPTION=descriptor.description, CLASS=descriptor.__class__ + ) + ) b = bytes(descriptor) notes = descriptor.notes() @@ -517,41 +687,56 @@ for idx, descriptor in enumerate(string_descriptors): const = "const " if variable_name == "usb_serial_number": const = "" - c_file.write("""\ + c_file.write( + """\ {const}uint16_t {NAME}[] = {{ -""".format(const=const, NAME=variable_name)) +""".format( + const=const, NAME=variable_name + ) + ) pointers_to_strings.append("{name}".format(name=variable_name)) n = 0 while i < len(b): length = b[i] for j in range(length // 2): - c_file.write("0x{:04x}, ".format(b[i + 2*j + 1] << 8 | b[i + 2*j])) + c_file.write("0x{:04x}, ".format(b[i + 2 * j + 1] << 8 | b[i + 2 * j])) n += 1 c_file.write("\n") i += length - c_file.write("""\ + c_file.write( + """\ }; -""") +""" + ) -c_file.write("""\ +c_file.write( + """\ // array of pointer to string descriptors uint16_t const * const string_desc_arr [] = { -""") -c_file.write(""",\ +""" +) +c_file.write( + """,\ -""".join(pointers_to_strings)) +""".join( + pointers_to_strings + ) +) -c_file.write(""" +c_file.write( + """ }; -""") +""" +) c_file.write("\n") hid_descriptor_length = len(bytes(combined_hid_report_descriptor)) # Now we values we need for the .h file. -h_file.write("""\ +h_file.write( + """\ #ifndef MICROPY_INCLUDED_AUTOGEN_USB_DESCRIPTOR_H #define MICROPY_INCLUDED_AUTOGEN_USB_DESCRIPTOR_H @@ -574,49 +759,78 @@ extern const uint8_t hid_report_descriptor[{hid_report_descriptor_length}]; // Product name included in Inquiry response, max 16 bytes #define CFG_TUD_MSC_PRODUCT "{msc_product}" -""" -.format(serial_number_length=len(bytes(serial_number_descriptor)) // 2, +""".format( + serial_number_length=len(bytes(serial_number_descriptor)) // 2, device_length=len(bytes(device)), configuration_length=descriptor_length, max_configuration_length=max(hid_descriptor_length, descriptor_length), string_descriptor_length=len(pointers_to_strings), hid_report_descriptor_length=len(bytes(combined_hid_report_descriptor)), - rhport0_mode='OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED' if args.highspeed else 'OPT_MODE_DEVICE', + rhport0_mode="OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED" + if args.highspeed + else "OPT_MODE_DEVICE", hid_num_devices=len(args.hid_devices), msc_vendor=args.manufacturer[:8], - msc_product=args.product[:16])) + msc_product=args.product[:16], + ) +) # Write out the report descriptor and info -c_file.write("""\ +c_file.write( + """\ const uint8_t hid_report_descriptor[{HID_DESCRIPTOR_LENGTH}] = {{ -""".format(HID_DESCRIPTOR_LENGTH=hid_descriptor_length)) +""".format( + HID_DESCRIPTOR_LENGTH=hid_descriptor_length + ) +) for b in bytes(combined_hid_report_descriptor): c_file.write("0x{:02x}, ".format(b)) -c_file.write("""\ +c_file.write( + """\ }; -""") +""" +) # Write out USB HID report buffer definitions. for name in args.hid_devices: - c_file.write("""\ + c_file.write( + """\ static uint8_t {name}_report_buffer[{report_length}]; -""".format(name=name.lower(), report_length=hid_report_descriptors.HID_DEVICE_DATA[name].report_length)) +""".format( + name=name.lower(), + report_length=hid_report_descriptors.HID_DEVICE_DATA[name].report_length, + ) + ) if hid_report_descriptors.HID_DEVICE_DATA[name].out_report_length > 0: - c_file.write("""\ + c_file.write( + """\ static uint8_t {name}_out_report_buffer[{report_length}]; -""".format(name=name.lower(), report_length=hid_report_descriptors.HID_DEVICE_DATA[name].out_report_length)) +""".format( + name=name.lower(), + report_length=hid_report_descriptors.HID_DEVICE_DATA[ + name + ].out_report_length, + ) + ) # Write out table of device objects. -c_file.write(""" +c_file.write( + """ usb_hid_device_obj_t usb_hid_devices[] = { -""") +""" +) for name in args.hid_devices: device_data = hid_report_descriptors.HID_DEVICE_DATA[name] - out_report_buffer = '{}_out_report_buffer'.format(name.lower()) if device_data.out_report_length > 0 else 'NULL' - c_file.write("""\ + out_report_buffer = ( + "{}_out_report_buffer".format(name.lower()) + if device_data.out_report_length > 0 + else "NULL" + ) + c_file.write( + """\ {{ .base = {{ .type = &usb_hid_device_type }}, .report_buffer = {name}_report_buffer, @@ -627,34 +841,52 @@ for name in args.hid_devices: .out_report_buffer = {out_report_buffer}, .out_report_length = {out_report_length}, }}, -""".format(name=name.lower(), report_id=report_ids[name], - report_length=device_data.report_length, - usage_page=device_data.usage_page, - usage=device_data.usage, - out_report_buffer=out_report_buffer, - out_report_length=device_data.out_report_length)) -c_file.write("""\ +""".format( + name=name.lower(), + report_id=report_ids[name], + report_length=device_data.report_length, + usage_page=device_data.usage_page, + usage=device_data.usage, + out_report_buffer=out_report_buffer, + out_report_length=device_data.out_report_length, + ) + ) +c_file.write( + """\ }; -""") +""" +) # Write out tuple of device objects. -c_file.write(""" +c_file.write( + """ mp_obj_tuple_t common_hal_usb_hid_devices = {{ .base = {{ .type = &mp_type_tuple, }}, .len = {num_devices}, .items = {{ -""".format(num_devices=len(args.hid_devices))) +""".format( + num_devices=len(args.hid_devices) + ) +) for idx in range(len(args.hid_devices)): - c_file.write("""\ + c_file.write( + """\ (mp_obj_t) &usb_hid_devices[{idx}], -""".format(idx=idx)) -c_file.write("""\ +""".format( + idx=idx + ) + ) +c_file.write( + """\ }, }; -""") +""" +) -h_file.write("""\ +h_file.write( + """\ #endif // MICROPY_INCLUDED_AUTOGEN_USB_DESCRIPTOR_H -""") +""" +) diff --git a/tools/usb_descriptor b/tools/usb_descriptor index 701cafc50e..2eaa6114b2 160000 --- a/tools/usb_descriptor +++ b/tools/usb_descriptor @@ -1 +1 @@ -Subproject commit 701cafc50e2e574dccaf7a340eedbd64a0b41a42 +Subproject commit 2eaa6114b209fe7f0a795eda8d6a7b3b93d76d2e From 1b7f3d11e73be5cb0f7a97a528fedad87624b97f Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 8 Feb 2021 10:57:41 -0500 Subject: [PATCH 002/159] wip --- ports/nrf/common-hal/supervisor/Runtime.c | 18 +++- shared-bindings/supervisor/Runtime.c | 113 ++++++++++++++++------ shared-bindings/supervisor/Runtime.h | 8 +- supervisor/shared/serial.c | 11 ++- 4 files changed, 114 insertions(+), 36 deletions(-) diff --git a/ports/nrf/common-hal/supervisor/Runtime.c b/ports/nrf/common-hal/supervisor/Runtime.c index ea663f897d..a8f50f70ed 100755 --- a/ports/nrf/common-hal/supervisor/Runtime.c +++ b/ports/nrf/common-hal/supervisor/Runtime.c @@ -28,10 +28,24 @@ #include "shared-bindings/supervisor/Runtime.h" #include "supervisor/serial.h" -bool common_hal_get_serial_connected(void) { +bool common_hal_supervisor_runtime_get_serial_connected(void) { return (bool) serial_connected(); } -bool common_hal_get_serial_bytes_available(void) { +bool common_hal_get_supervisor_runtime_serial_bytes_available(void) { return (bool) serial_bytes_available(); } + +#if CIRCUITPY_USB_SERIAL2 +mp_obj_t common_hal_supervisor_runtime_get_serial2(void) { + return (bool) serial_connected(); +} + +bool common_hal_supervisor_runtime_get_serial2_connected(void) { + return (bool) serial_connected(); +} + +bool common_hal_get_supervisor_runtime_serial2_bytes_available(void) { + return (bool) serial_bytes_available(); +} +#endif diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c index 8e0259a3b3..cfda620bc0 100755 --- a/shared-bindings/supervisor/Runtime.c +++ b/shared-bindings/supervisor/Runtime.c @@ -55,43 +55,96 @@ STATIC supervisor_run_reason_t _run_reason; //| serial_connected: bool //| """Returns the USB serial communication status (read-only).""" //| - -STATIC mp_obj_t supervisor_get_serial_connected(mp_obj_t self){ - if (!common_hal_get_serial_connected()) { - return mp_const_false; - } - else { - return mp_const_true; - } +STATIC mp_obj_t supervisor_runtime_get_serial_connected(mp_obj_t self){ + return mp_obj_new_bool(common_hal_supervisor_runtime_get_serial_connected()); } -MP_DEFINE_CONST_FUN_OBJ_1(supervisor_get_serial_connected_obj, supervisor_get_serial_connected); +MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_serial_connected_obj, supervisor_runtime_get_serial_connected); -const mp_obj_property_t supervisor_serial_connected_obj = { +//| serial2: io.BytesIO +//| """Returns the USB secondary serial communication channel. +//| Raises `NotImplementedError` if it does not exist. +//| """ +//| +STATIC mp_obj_t supervisor_runtime_get_serial2(mp_obj_t self){ +#if CIRCUITPY_USB_SERIAL2 + return mp_obj_new_bool(common_hal_supervisor_runtime_get_serial2()); +#else + mp_raise_NotImplementedError(translate("serial2 not available")); +#endif +} +MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_serial2_obj, supervisor_runtime_get_serial2); + +const mp_obj_property_t supervisor_runtime_serial2_connected_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&supervisor_get_serial_connected_obj, + .proxy = {(mp_obj_t)&supervisor_runtime_get_serial2_connected_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; +const mp_obj_property_t supervisor_runtime_serial_connected_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&supervisor_runtime_get_serial_connected_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| serial2_connected: bool +//| """Returns the USB secondary serial communication status (read-only). +//| Raises `NotImplementedError` if there is no secondary serial channel. +//| """ +//| +STATIC mp_obj_t supervisor_runtime_get_serial2_connected(mp_obj_t self){ +#if CIRCUITPY_USB_SERIAL2 + return mp_obj_new_bool(common_hal_supervisor_runtime_get_serial2_connected()); +#else + mp_raise_NotImplementedError(translate("serial2 not available")); +#endif +} +MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_serial2_connected_obj, supervisor_runtime_get_serial2_connected); + +const mp_obj_property_t supervisor_runtime_serial2_connected_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&supervisor_runtime_get_serial2_connected_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; //| serial_bytes_available: int //| """Returns the whether any bytes are available to read //| on the USB serial input. Allows for polling to see whether //| to call the built-in input() or wait. (read-only)""" //| -STATIC mp_obj_t supervisor_get_serial_bytes_available(mp_obj_t self){ - if (!common_hal_get_serial_bytes_available()) { - return mp_const_false; - } - else { - return mp_const_true; - } +STATIC mp_obj_t supervisor_runtime_get_serial_bytes_available(mp_obj_t self){ + return mp_obj_new_bool(common_hal_supervisor_runtime_get_serial_bytes_available()); } -MP_DEFINE_CONST_FUN_OBJ_1(supervisor_get_serial_bytes_available_obj, supervisor_get_serial_bytes_available); +MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_serial_bytes_available_obj, supervisor_runtime_get_serial_bytes_available); -const mp_obj_property_t supervisor_serial_bytes_available_obj = { +const mp_obj_property_t supervisor_runtime_serial_bytes_available_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&supervisor_get_serial_bytes_available_obj, + .proxy = {(mp_obj_t)&supervisor_runtime_get_serial_bytes_available_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + + +//| serial2_bytes_available: int +//| """Returns the whether any bytes are available to read +//| on the secondary USB serial input (read-only). +//| Raises `NotImplementedError` if there is no secondary serial input. +//| """ +//| +STATIC mp_obj_t supervisor_runtime_get_serial2_bytes_available(mp_obj_t self){ +#if CIRCUITPY_USB_SERIAL2 + return mp_obj_new_bool(common_hal_supervisor_runtime_get_serial2_bytes_available()); +#else + mp_raise_NotImplementedError(translate("serial2 not available")); +#endif +} +MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_serial2_bytes_available_obj, supervisor_runtime_get_serial2_bytes_available); + +const mp_obj_property_t supervisor_runtime_serial2_bytes_available_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&supervisor_runtime_get_serial2_bytes_available_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; @@ -100,26 +153,28 @@ const mp_obj_property_t supervisor_serial_bytes_available_obj = { //| run_reason: RunReason //| """Returns why CircuitPython started running this particular time.""" //| -STATIC mp_obj_t supervisor_get_run_reason(mp_obj_t self) { +STATIC mp_obj_t supervisor_runtime_get_run_reason(mp_obj_t self) { return cp_enum_find(&supervisor_run_reason_type, _run_reason); } -MP_DEFINE_CONST_FUN_OBJ_1(supervisor_get_run_reason_obj, supervisor_get_run_reason); +MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_run_reason_obj, supervisor_runtime_get_run_reason); -const mp_obj_property_t supervisor_run_reason_obj = { +const mp_obj_property_t supervisor_runtime_run_reason_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&supervisor_get_run_reason_obj, + .proxy = {(mp_obj_t)&supervisor_runtime_get_run_reason_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; -void supervisor_set_run_reason(supervisor_run_reason_t run_reason) { +void supervisor_runtime_set_run_reason(supervisor_runtime_run_reason_t run_reason) { _run_reason = run_reason; } STATIC const mp_rom_map_elem_t supervisor_runtime_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_serial_connected), MP_ROM_PTR(&supervisor_serial_connected_obj) }, - { MP_ROM_QSTR(MP_QSTR_serial_bytes_available), MP_ROM_PTR(&supervisor_serial_bytes_available_obj) }, - { MP_ROM_QSTR(MP_QSTR_run_reason), MP_ROM_PTR(&supervisor_run_reason_obj) }, + { MP_ROM_QSTR(MP_QSTR_serial_connected), MP_ROM_PTR(&supervisor_runtime_serial_connected_obj) }, + { MP_ROM_QSTR(MP_QSTR_serial2_connected), MP_ROM_PTR(&supervisor_runtime_serial2_connected_obj) }, + { MP_ROM_QSTR(MP_QSTR_serial_bytes_available), MP_ROM_PTR(&supervisor_runtime_serial_bytes_available_obj) }, + { MP_ROM_QSTR(MP_QSTR_serial2_bytes_available), MP_ROM_PTR(&supervisor_runtime_serial2_bytes_available_obj) }, + { MP_ROM_QSTR(MP_QSTR_run_reason), MP_ROM_PTR(&supervisor_runtime_run_reason_obj) }, }; STATIC MP_DEFINE_CONST_DICT(supervisor_runtime_locals_dict, supervisor_runtime_locals_dict_table); diff --git a/shared-bindings/supervisor/Runtime.h b/shared-bindings/supervisor/Runtime.h index 51ed7604df..6874ac744a 100755 --- a/shared-bindings/supervisor/Runtime.h +++ b/shared-bindings/supervisor/Runtime.h @@ -36,12 +36,12 @@ extern const mp_obj_type_t supervisor_runtime_type; void supervisor_set_run_reason(supervisor_run_reason_t run_reason); -bool common_hal_get_serial_connected(void); +bool common_hal_supervisor_runtime_get_serial_connected(void); -bool common_hal_get_serial_bytes_available(void); +bool common_hal_supervisor_runtime_get_serial_bytes_available(void); //TODO: placeholders for future functions -//bool common_hal_get_repl_active(void); -//bool common_hal_get_usb_enumerated(void); +//bool common_hal_get_supervisor_runtime_repl_active(void); +//bool common_hal_get_supervisor_runtime_usb_enumerated(void); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_SUPERVISOR_RUNTIME_H diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index 303f89e752..6199af379e 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -94,7 +94,6 @@ bool serial_bytes_available(void) { return tud_cdc_available() > 0; #endif } - void serial_write_substring(const char* text, uint32_t length) { if (length == 0) { return; @@ -119,3 +118,13 @@ void serial_write_substring(const char* text, uint32_t length) { void serial_write(const char* text) { serial_write_substring(text, strlen(text)); } + +#if CIRCUITPY_USB_SERIAL2 +bool serial2_bytes_available(void) { + return tud_cdc_n_available(1) > 0; +} + +bool serial2_connected(void) { + return tud_cdc_n_connected(1); +} +#endif From d00bee2149825ee1e187a8a5bfc8c6e75874cc0b Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 10 Feb 2021 13:53:06 -0500 Subject: [PATCH 003/159] Fix I2C Repeated start error by converting to IT mode --- ports/stm/common-hal/busio/I2C.c | 92 +++++++++++++++++++++++++++++++- ports/stm/common-hal/busio/I2C.h | 2 + ports/stm/mpconfigport.h | 6 ++- 3 files changed, 97 insertions(+), 3 deletions(-) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index de69da211a..7726b5e87f 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -61,6 +61,7 @@ STATIC bool never_reset_i2c[MAX_I2C]; #define ALL_CLOCKS 0xFF STATIC void i2c_clock_enable(uint8_t mask); STATIC void i2c_clock_disable(uint8_t mask); +STATIC void i2c_assign_irq(busio_i2c_obj_t *self, I2C_TypeDef * I2Cx); void i2c_reset(void) { uint16_t never_reset_mask = 0x00; @@ -136,6 +137,10 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, i2c_clock_enable(1 << (self->sda->periph_index - 1)); reserved_i2c[self->sda->periph_index - 1] = true; + // Create root pointer and assign IRQ + MP_STATE_PORT(cpy_i2c_obj_all)[self->sda->periph_index - 1] = self; + i2c_assign_irq(self, I2Cx); + // Handle the HAL handle differences #if (CPY_STM32H7 || CPY_STM32F7) if (frequency == 400000) { @@ -163,6 +168,13 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } common_hal_mcu_pin_claim(sda); common_hal_mcu_pin_claim(scl); + + self->frame_in_prog = false; + + //start the receive interrupt chain + HAL_NVIC_DisableIRQ(self->irq); //prevent handle lock contention + HAL_NVIC_SetPriority(self->irq, 1, 0); + HAL_NVIC_EnableIRQ(self->irq); } void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { @@ -229,15 +241,46 @@ void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr, const uint8_t *data, size_t len, bool transmit_stop_bit) { - HAL_StatusTypeDef result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr << 1), + HAL_StatusTypeDef result; + if (!transmit_stop_bit) { + uint32_t xfer_opt; + if (!self->frame_in_prog) { + xfer_opt = I2C_FIRST_FRAME; + } else { + // handle rare possibility of multiple restart writes in a row + xfer_opt = I2C_NEXT_FRAME; + } + result = HAL_I2C_Master_Seq_Transmit_IT(&(self->handle), + (uint16_t)(addr << 1), (uint8_t *)data, + (uint16_t)len, xfer_opt); + while (HAL_I2C_GetState(&(self->handle)) != HAL_I2C_STATE_READY) + { + RUN_BACKGROUND_TASKS; + } + self->frame_in_prog = true; + } else { + result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr << 1), (uint8_t *)data, (uint16_t)len, 500); + } return result == HAL_OK ? 0 : MP_EIO; } uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, uint8_t *data, size_t len) { - return HAL_I2C_Master_Receive(&(self->handle), (uint16_t)(addr<<1), data, (uint16_t)len, 500) + if (!self->frame_in_prog) { + return HAL_I2C_Master_Receive(&(self->handle), (uint16_t)(addr<<1), data, (uint16_t)len, 500) == HAL_OK ? 0 : MP_EIO; + } else { + HAL_StatusTypeDef result = HAL_I2C_Master_Seq_Receive_IT(&(self->handle), + (uint16_t)(addr << 1), (uint8_t *)data, + (uint16_t)len, I2C_LAST_FRAME); + while (HAL_I2C_GetState(&(self->handle)) != HAL_I2C_STATE_READY) + { + RUN_BACKGROUND_TASKS; + } + self->frame_in_prog = false; + return result; + } } STATIC void i2c_clock_enable(uint8_t mask) { @@ -294,3 +337,48 @@ STATIC void i2c_clock_disable(uint8_t mask) { } #endif } + +STATIC void i2c_assign_irq(busio_i2c_obj_t *self, I2C_TypeDef * I2Cx) { + #ifdef I2C1 + if (I2Cx == I2C1) { + self->irq = I2C1_EV_IRQn; + } + #endif + #ifdef I2C2 + if (I2Cx == I2C2) { + self->irq = I2C2_EV_IRQn; + } + #endif + #ifdef I2C3 + if (I2Cx == I2C3) { + self->irq = I2C3_EV_IRQn; + } + #endif + #ifdef I2C4 + if (I2Cx == I2C4) { + self->irq = I2C4_EV_IRQn; + } + #endif +} + +STATIC void call_hal_irq(int i2c_num) { + //Create casted context pointer + busio_i2c_obj_t * context = (busio_i2c_obj_t*)MP_STATE_PORT(cpy_i2c_obj_all)[i2c_num - 1]; + if (context != NULL) { + HAL_NVIC_ClearPendingIRQ(context->irq); + HAL_I2C_EV_IRQHandler(&context->handle); + } +} + +void I2C1_EV_IRQHandler(void) { + call_hal_irq(1); +} +void I2C2_EV_IRQHandler(void) { + call_hal_irq(2); +} +void I2C3_EV_IRQHandler(void) { + call_hal_irq(3); +} +void I2C4_EV_IRQHandler(void) { + call_hal_irq(4); +} diff --git a/ports/stm/common-hal/busio/I2C.h b/ports/stm/common-hal/busio/I2C.h index 5ca2854eb8..687e6a8c4d 100644 --- a/ports/stm/common-hal/busio/I2C.h +++ b/ports/stm/common-hal/busio/I2C.h @@ -37,6 +37,8 @@ typedef struct { mp_obj_base_t base; I2C_HandleTypeDef handle; + IRQn_Type irq; + bool frame_in_prog; bool has_lock; const mcu_periph_obj_t *scl; const mcu_periph_obj_t *sda; diff --git a/ports/stm/mpconfigport.h b/ports/stm/mpconfigport.h index 7cdab04f62..3f64e6565b 100644 --- a/ports/stm/mpconfigport.h +++ b/ports/stm/mpconfigport.h @@ -52,10 +52,14 @@ extern uint8_t _ld_default_stack_size; #define BOARD_NO_VBUS_SENSE (0) #endif -#define MAX_UART 10 //how many UART are implemented +// Peripheral implementation counts +#define MAX_UART 10 +#define MAX_I2C 4 +#define MAX_SPI 6 #define MICROPY_PORT_ROOT_POINTERS \ void *cpy_uart_obj_all[MAX_UART]; \ + void *cpy_i2c_obj_all[MAX_I2C]; \ CIRCUITPY_COMMON_ROOT_POINTERS #endif // __INCLUDED_MPCONFIGPORT_H From 205837c47b14cb242d7e75469fe4ecd056dd29ce Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 11 Feb 2021 12:48:36 +0530 Subject: [PATCH 004/159] nvm implementation for rp2040 --- ports/raspberrypi/common-hal/nvm/ByteArray.c | 72 ++++++++++++++++++++ ports/raspberrypi/common-hal/nvm/ByteArray.h | 38 +++++++++++ ports/raspberrypi/common-hal/nvm/__init__.c | 1 + ports/raspberrypi/mpconfigport.h | 9 +-- ports/raspberrypi/mpconfigport.mk | 2 +- 5 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 ports/raspberrypi/common-hal/nvm/ByteArray.c create mode 100644 ports/raspberrypi/common-hal/nvm/ByteArray.h create mode 100644 ports/raspberrypi/common-hal/nvm/__init__.c diff --git a/ports/raspberrypi/common-hal/nvm/ByteArray.c b/ports/raspberrypi/common-hal/nvm/ByteArray.c new file mode 100644 index 0000000000..2aef1a09ff --- /dev/null +++ b/ports/raspberrypi/common-hal/nvm/ByteArray.c @@ -0,0 +1,72 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "common-hal/nvm/ByteArray.h" + +#include + +#include "py/runtime.h" +#include "src/rp2_common/hardware_flash/include/hardware/flash.h" + +uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t* self) { + return self->len; +} + +static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_t* bytes) { + // Write a whole page to flash, buffering it first and then erasing and rewriting + // it since we can only clear a whole page at a time. + if (offset == 0 && len == FLASH_PAGE_SIZE) { + flash_range_program(page_addr - 0x10000000, bytes, FLASH_PAGE_SIZE); + } else { + uint8_t buffer[FLASH_PAGE_SIZE]; + memcpy(buffer, (uint8_t*) page_addr, FLASH_PAGE_SIZE); + memcpy(buffer + offset, bytes, len); + flash_range_program(page_addr - 0x10000000, buffer, FLASH_PAGE_SIZE); + } +} + +bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t* self, + uint32_t start_index, uint8_t* values, uint32_t len) { + uint32_t address = (uint32_t) self->start_address + start_index; + uint32_t offset = address % FLASH_PAGE_SIZE; + uint32_t page_addr = address - offset; + + while (len) { + uint32_t write_len = MIN(len, FLASH_PAGE_SIZE - offset); + write_page(page_addr, offset, write_len, values); + len -= write_len; + values += write_len; + page_addr += FLASH_PAGE_SIZE; + offset = 0; + } + + return true; +} + +void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t* self, + uint32_t start_index, uint32_t len, uint8_t* values) { + memcpy(values, self->start_address + start_index, len); +} diff --git a/ports/raspberrypi/common-hal/nvm/ByteArray.h b/ports/raspberrypi/common-hal/nvm/ByteArray.h new file mode 100644 index 0000000000..a2a904fea8 --- /dev/null +++ b/ports/raspberrypi/common-hal/nvm/ByteArray.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_NVM_BYTEARRAY_H +#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_NVM_BYTEARRAY_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + uint8_t * start_address; + uint32_t len; +} nvm_bytearray_obj_t; + +#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_NVM_BYTEARRAY_H diff --git a/ports/raspberrypi/common-hal/nvm/__init__.c b/ports/raspberrypi/common-hal/nvm/__init__.c new file mode 100644 index 0000000000..1b702a1584 --- /dev/null +++ b/ports/raspberrypi/common-hal/nvm/__init__.c @@ -0,0 +1 @@ +// No nvm module functions. diff --git a/ports/raspberrypi/mpconfigport.h b/ports/raspberrypi/mpconfigport.h index 77d1ff0805..d57f1c575e 100644 --- a/ports/raspberrypi/mpconfigport.h +++ b/ports/raspberrypi/mpconfigport.h @@ -27,15 +27,16 @@ #ifndef __INCLUDED_MPCONFIGPORT_H #define __INCLUDED_MPCONFIGPORT_H -#define MICROPY_PY_SYS_PLATFORM "RP2040" +#define MICROPY_PY_SYS_PLATFORM "RP2040" -#define CIRCUITPY_INTERNAL_NVM_SIZE 0 +#define CIRCUITPY_INTERNAL_NVM_SIZE (4*1024) +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x100FF000) -#define CIRCUITPY_DEFAULT_STACK_SIZE (24*1024) +#define CIRCUITPY_DEFAULT_STACK_SIZE (24*1024) #define MICROPY_USE_INTERNAL_PRINTF (1) -#define CIRCUITPY_PROCESSOR_COUNT (2) +#define CIRCUITPY_PROCESSOR_COUNT (2) // This also includes mpconfigboard.h. #include "py/circuitpy_mpconfig.h" diff --git a/ports/raspberrypi/mpconfigport.mk b/ports/raspberrypi/mpconfigport.mk index 8681e29949..5477d7f1be 100644 --- a/ports/raspberrypi/mpconfigport.mk +++ b/ports/raspberrypi/mpconfigport.mk @@ -32,7 +32,7 @@ CIRCUITPY_AUDIOMP3 = 0 CIRCUITPY_COUNTIO = 0 # Use PWM interally CIRCUITPY_FREQUENCYIO = 0 # Use PWM interally CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_NVM = 0 +CIRCUITPY_NVM = 1 CIRCUITPY_PULSEIO = 0 # Use PIO interally CIRCUITPY_ROTARYIO = 0 # Use PIO interally CIRCUITPY_WATCHDOG = 1 From edb7f2d807d8fef82d307964907a9763598a5344 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 11 Feb 2021 16:30:27 -0500 Subject: [PATCH 005/159] Free up space for JA build --- ports/stm/boards/espruino_pico/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index 81c3772e72..6d45769f2b 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -21,5 +21,6 @@ LD_FILE = boards/STM32F401xd_fs.ld # meantime CIRCUITPY_ULAB = 0 CIRCUITPY_BUSDEVICE = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 SUPEROPT_GC = 0 From 2d2c40b3d44bc7b73abb9534a7eeab3c27049b26 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 11 Feb 2021 17:36:40 -0500 Subject: [PATCH 006/159] Add Socket tests --- tests/_manual/socketpool/client/cpy-client.py | 26 +++++++++++ .../_manual/socketpool/client/host-server.py | 27 +++++++++++ tests/_manual/socketpool/client/readme.md | 46 +++++++++++++++++++ tests/_manual/socketpool/datagram/ntp.py | 28 +++++++++++ tests/_manual/socketpool/datagram/readme.md | 19 ++++++++ tests/_manual/socketpool/server/cpy-server.py | 31 +++++++++++++ .../_manual/socketpool/server/host-client.py | 18 ++++++++ tests/_manual/socketpool/server/readme.md | 43 +++++++++++++++++ 8 files changed, 238 insertions(+) create mode 100644 tests/_manual/socketpool/client/cpy-client.py create mode 100644 tests/_manual/socketpool/client/host-server.py create mode 100644 tests/_manual/socketpool/client/readme.md create mode 100644 tests/_manual/socketpool/datagram/ntp.py create mode 100644 tests/_manual/socketpool/datagram/readme.md create mode 100644 tests/_manual/socketpool/server/cpy-server.py create mode 100644 tests/_manual/socketpool/server/host-client.py create mode 100644 tests/_manual/socketpool/server/readme.md diff --git a/tests/_manual/socketpool/client/cpy-client.py b/tests/_manual/socketpool/client/cpy-client.py new file mode 100644 index 0000000000..dcc742c9f8 --- /dev/null +++ b/tests/_manual/socketpool/client/cpy-client.py @@ -0,0 +1,26 @@ +import wifi +import socketpool +import ssl +import time + +TIMEOUT = None +HOST = '192.168.10.179' +PORT = 5000 + +# Connect to wifi +print("Connecting to wifi") +wifi.radio.connect("mySSID", "myPASS") +pool = socketpool.SocketPool(wifi.radio) + +print("Creating Socket") +with pool.socket(pool.AF_INET, pool.SOCK_STREAM) as s: + s.settimeout(TIMEOUT) + + print("Connecting") + s.connect((HOST, PORT)) + print("Sending") + sent = s.send(b'Hello, world') + print("Receiving") + buff = bytearray(128) + numbytes = s.recv_into(buff) +print(repr(buff)) diff --git a/tests/_manual/socketpool/client/host-server.py b/tests/_manual/socketpool/client/host-server.py new file mode 100644 index 0000000000..4a5faf2a00 --- /dev/null +++ b/tests/_manual/socketpool/client/host-server.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 +import socket + +TIMEOUT = 10 +HOST = "192.168.10.179" +PORT = 5000 + +print("Create Socket") +with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: + s.settimeout(TIMEOUT) + s.bind((HOST, PORT)) + s.listen() + print("Accepting connections") + while True: + try: + conn, addr = s.accept() + break + except BlockingIOError: + pass + + with conn: + s.settimeout(TIMEOUT) + print('Connected by', addr) + data = conn.recv(128) + print("got: " + str(data)) + conn.sendall(data) + print("sent: " + str(data)) \ No newline at end of file diff --git a/tests/_manual/socketpool/client/readme.md b/tests/_manual/socketpool/client/readme.md new file mode 100644 index 0000000000..1ef0695314 --- /dev/null +++ b/tests/_manual/socketpool/client/readme.md @@ -0,0 +1,46 @@ +# Circuitpython as Client + +This example demonstrates the use of Socket as a client, accessing a server on a host development machine. This Circuitpython sketch uses the Connect, Send, and Recv_Into methods. + +## Prerequisites + +Circuitpython V6.2.0 minimum. Neither the host or client sketch has installed module prerequisites. + +## Setup + +Find a viable IP address for the host machine first and insert it in both sketches as HOST. On mac, this can be done by going to System Preferences/Network and checking the IP address used to connect to the local wireless network. Make sure that both devices are using the same WIFI! + +Each sketch can have Timeout values changed. The host sketch usually needs a value above 0, or the recv() will fail. Currently, Circuitpython's Connect function is always blocking, so changing the client timeout will not cause much change in behavior. + +Start the Server on the host PC first, within this folder: + +``` +python host-server.py +``` + +Then, reload the client sketch in Circuitpython. + +## Expected Behavior + +The example should connect to a server running on the host machine. The client will send a "Hello world" string to the server, which will return it. + +Expected client output: + +``` +Connecting to wifi +Creating Socket +Connecting +Sending +Receiving +bytearray(b'Hello, world') +``` + +Expected Server output (IP/port values will vary): + +``` +Create Socket +Accepting connections +Connected by ('192.168.10.128', 64509) +got: b'Hello, world' +sent: b'Hello, world' +``` \ No newline at end of file diff --git a/tests/_manual/socketpool/datagram/ntp.py b/tests/_manual/socketpool/datagram/ntp.py new file mode 100644 index 0000000000..31d922858a --- /dev/null +++ b/tests/_manual/socketpool/datagram/ntp.py @@ -0,0 +1,28 @@ +import wifi +import socketpool +import struct +import time + +# connect to wifi +print("Connecting to Wifi") +wifi.radio.connect("mySSID", "myPASS") +pool = socketpool.SocketPool(wifi.radio) + +# make socket +print("Creating socket") +sock = pool.socket(pool.AF_INET,pool.SOCK_DGRAM) + +# Fill packet +packet = bytearray(48) +packet[0] = 0b00100011 # Not leap second, NTP version 4, Client mode +NTP_TO_UNIX_EPOCH = 2208988800 # 1970-01-01 00:00:00 + +print("Sending packet") +sock.sendto(packet, ("pool.ntp.org", 123)) + +size, address = sock.recvfrom_into(packet) +print("Received packet") + +seconds = struct.unpack_from("!I", packet, offset=len(packet) - 8)[0] +print("Address:", address) +print("Time:", time.localtime(seconds - NTP_TO_UNIX_EPOCH)) diff --git a/tests/_manual/socketpool/datagram/readme.md b/tests/_manual/socketpool/datagram/readme.md new file mode 100644 index 0000000000..f63f0abccd --- /dev/null +++ b/tests/_manual/socketpool/datagram/readme.md @@ -0,0 +1,19 @@ +# Circuitpython Datagrams + +This example demonstrates using UDP (datagrams) with the Socket module, accessing the time from an NTP server using `sendto` and `recvfrom_into`. + +## Prerequisites + +Circuitpython V6.2.0 minimum. + +## Expected behavior + +The Circuitpython device will attempt to connect to wifi, and send a request for the time to `pool.ntp.org`. It will then convert the seconds returned into a unix time struct. + +Expected output: +``` +Sending packet +Received packet +Address: ('82.197.188.130', 31488) +Time: struct_time(tm_year=2021, tm_mon=2, tm_mday=11, tm_hour=22, tm_min=22, tm_sec=40, tm_wday=3, tm_yday=42, tm_isdst=-1) +``` diff --git a/tests/_manual/socketpool/server/cpy-server.py b/tests/_manual/socketpool/server/cpy-server.py new file mode 100644 index 0000000000..d865156bc8 --- /dev/null +++ b/tests/_manual/socketpool/server/cpy-server.py @@ -0,0 +1,31 @@ +import wifi +import socketpool + +TIMEOUT = None + +print("Connecting to Wifi") +wifi.radio.connect("mySSID", "myPASS") + +pool = socketpool.SocketPool(wifi.radio) + +print("Finding IP address") +print(wifi.radio.ipv4_address) +HOST = str(wifi.radio.ipv4_address) +PORT = 80 # Port to listen on + +print("Creating socket") +sock = pool.socket(pool.AF_INET,pool.SOCK_STREAM) + +sock.bind((HOST, PORT)) +sock.listen(1) +print("Accepting connections") +conn, addr = sock.accept() +with conn: + print('Connected by', addr) + buff = bytearray(128) + print("Receiving") + numbytes = conn.recvfrom_into(buff) + print(buff[:numbytes[0]]) + if numbytes: + print("Sending") + conn.send(buff[:numbytes[0]]) diff --git a/tests/_manual/socketpool/server/host-client.py b/tests/_manual/socketpool/server/host-client.py new file mode 100644 index 0000000000..b5aacbfa8e --- /dev/null +++ b/tests/_manual/socketpool/server/host-client.py @@ -0,0 +1,18 @@ +import socket + +HOST = '192.168.10.128' # The server's hostname or IP address +PORT = 80 # The port used by the server + +with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: + s.settimeout(None) + + print("Connecting") + s.connect((HOST, PORT)) + + print("Sending") + s.send(b'Hello, world') + + print("Receiving") + data = s.recv(1024) + print('Received', repr(data)) + diff --git a/tests/_manual/socketpool/server/readme.md b/tests/_manual/socketpool/server/readme.md new file mode 100644 index 0000000000..26118b8f12 --- /dev/null +++ b/tests/_manual/socketpool/server/readme.md @@ -0,0 +1,43 @@ +# Circuitpython as Client + +This example demonstrates the use of Socket as a server, accessed by a client program on a host development machine. This Circuitpython sketch uses the Bind, Listen, Accept, and recvfrom_into calls. + +## Prerequisites + +Circuitpython V6.2.0 minimum. Neither the host or client sketch has installed module prerequisites. + +## Setup + +Make sure that both devices are using the same WIFI! The Circuitpython Server will automatically pick an IP and print it over the CDC monitor. Copy this value into the host client sketch. Start the Server on Circuitpython first, then run the client sketch in this folder: + +``` +python host-client.py +``` + +Each sketch can have Timeout values changed. + +## Expected behavior + +The host machine will connect to the server running on the Circuitpython device, and send a "Hello, world" string which is then returned. + +Expected client output: + +``` +Connecting +Sending +Receiving +Received b'Hello, world' +``` + +Expected server output: +``` +Connecting to Wifi +Finding IP address +192.168.10.128 +Creating socket +Accepting connections +Connected by ('192.168.10.179', 33274) +Receiving +bytearray(b'Hello, world') +Sending +``` From 527b11f99e2d060f48b6485081f2c0618ce72cc5 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Fri, 12 Feb 2021 18:28:48 +0530 Subject: [PATCH 007/159] implement suggested changes - update FLASH_FIRMWARE length - use linker script define value --- ports/raspberrypi/common-hal/nvm/ByteArray.c | 6 ++++-- ports/raspberrypi/link.ld | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ports/raspberrypi/common-hal/nvm/ByteArray.c b/ports/raspberrypi/common-hal/nvm/ByteArray.c index 2aef1a09ff..6dbd213517 100644 --- a/ports/raspberrypi/common-hal/nvm/ByteArray.c +++ b/ports/raspberrypi/common-hal/nvm/ByteArray.c @@ -31,6 +31,8 @@ #include "py/runtime.h" #include "src/rp2_common/hardware_flash/include/hardware/flash.h" +extern uint32_t __flash_binary_start; + uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t* self) { return self->len; } @@ -39,12 +41,12 @@ static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_ // Write a whole page to flash, buffering it first and then erasing and rewriting // it since we can only clear a whole page at a time. if (offset == 0 && len == FLASH_PAGE_SIZE) { - flash_range_program(page_addr - 0x10000000, bytes, FLASH_PAGE_SIZE); + flash_range_program(page_addr - (uint32_t) &__flash_binary_start, bytes, FLASH_PAGE_SIZE); } else { uint8_t buffer[FLASH_PAGE_SIZE]; memcpy(buffer, (uint8_t*) page_addr, FLASH_PAGE_SIZE); memcpy(buffer + offset, bytes, len); - flash_range_program(page_addr - 0x10000000, buffer, FLASH_PAGE_SIZE); + flash_range_program(page_addr - (uint32_t) &__flash_binary_start, buffer, FLASH_PAGE_SIZE); } } diff --git a/ports/raspberrypi/link.ld b/ports/raspberrypi/link.ld index b83299dee8..653408d4e5 100644 --- a/ports/raspberrypi/link.ld +++ b/ports/raspberrypi/link.ld @@ -23,7 +23,7 @@ MEMORY { - FLASH_FIRMWARE (rx) : ORIGIN = 0x10000000, LENGTH = 1024k + FLASH_FIRMWARE (rx) : ORIGIN = 0x10000000, LENGTH = 1020k RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 256k SCRATCH_X (rwx) : ORIGIN = 0x20040000, LENGTH = 4k SCRATCH_Y (rwx) : ORIGIN = 0x20041000, LENGTH = 4k From d54b5861a30b1b1a352e1c22fc67e729ec95390d Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 12 Feb 2021 19:01:14 -0500 Subject: [PATCH 008/159] wip --- ports/atmel-samd/mpconfigport.mk | 4 +- ports/nrf/bluetooth/ble_uart.c | 4 +- ports/nrf/common-hal/supervisor/Runtime.c | 14 -- ports/nrf/supervisor/serial.c | 10 +- ports/raspberrypi/common-hal/pwmio/PWMOut.c | 2 + py/circuitpy_defns.mk | 3 + py/circuitpy_mpconfig.h | 8 ++ py/circuitpy_mpconfig.mk | 32 ++--- shared-bindings/usb_cdc/Serial.c | 139 ++++++++++++++++++ shared-bindings/usb_cdc/Serial.h | 40 ++++++ shared-bindings/usb_cdc/__init__.c | 57 ++++++++ shared-bindings/usb_cdc/__init__.h | 34 +++++ shared-module/usb_cdc/Serial.c | 44 ++++++ shared-module/usb_cdc/Serial.h | 38 +++++ shared-module/usb_cdc/__init__.c | 55 +++++++ shared-module/usb_cdc/__init__.h | 32 +++++ supervisor/shared/serial.c | 10 -- supervisor/supervisor.mk | 152 +++++++++++--------- tools/gen_usb_descriptor.py | 2 +- 19 files changed, 561 insertions(+), 119 deletions(-) create mode 100644 shared-bindings/usb_cdc/Serial.c create mode 100644 shared-bindings/usb_cdc/Serial.h create mode 100644 shared-bindings/usb_cdc/__init__.c create mode 100644 shared-bindings/usb_cdc/__init__.h create mode 100644 shared-module/usb_cdc/Serial.c create mode 100644 shared-module/usb_cdc/Serial.h create mode 100644 shared-module/usb_cdc/__init__.c create mode 100644 shared-module/usb_cdc/__init__.h diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 9839a2aa44..e47acfb367 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -49,9 +49,9 @@ CIRCUITPY_SDCARDIO ?= 0 CIRCUITPY_FRAMEBUFFERIO ?= 0 # SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic. -# Because of that, there aren't enough endpoints for serial2. +# Because of that, there aren't enough endpoints for a secondary CDC serial connection. USB_MSC_EP_NUM_OUT = 1 -CIRCUITPY_USB_SERIAL2 = 0 +CIRCUITPY_USB_CDC = 0 CIRCUITPY_ULAB = 0 diff --git a/ports/nrf/bluetooth/ble_uart.c b/ports/nrf/bluetooth/ble_uart.c index 1e7a319bdd..1b87b82d11 100644 --- a/ports/nrf/bluetooth/ble_uart.c +++ b/ports/nrf/bluetooth/ble_uart.c @@ -40,7 +40,7 @@ #include "shared-bindings/_bleio/Service.h" #include "shared-bindings/_bleio/UUID.h" -#if CIRCUITPY_SERIAL_BLE +#if CIRCUITPY_REPL_BLE static const char default_name[] = "CP-REPL"; // max 8 chars or uuid won't fit in adv data static const char NUS_UUID[] = "6e400001-b5a3-f393-e0a9-e50e24dcca9e"; @@ -190,4 +190,4 @@ void mp_hal_stdout_tx_strn(const char *str, size_t len) { } } -#endif // CIRCUITPY_SERIAL_BLE +#endif // CIRCUITPY_REPL_BLE diff --git a/ports/nrf/common-hal/supervisor/Runtime.c b/ports/nrf/common-hal/supervisor/Runtime.c index a8f50f70ed..def609cda0 100755 --- a/ports/nrf/common-hal/supervisor/Runtime.c +++ b/ports/nrf/common-hal/supervisor/Runtime.c @@ -35,17 +35,3 @@ bool common_hal_supervisor_runtime_get_serial_connected(void) { bool common_hal_get_supervisor_runtime_serial_bytes_available(void) { return (bool) serial_bytes_available(); } - -#if CIRCUITPY_USB_SERIAL2 -mp_obj_t common_hal_supervisor_runtime_get_serial2(void) { - return (bool) serial_connected(); -} - -bool common_hal_supervisor_runtime_get_serial2_connected(void) { - return (bool) serial_connected(); -} - -bool common_hal_get_supervisor_runtime_serial2_bytes_available(void) { - return (bool) serial_bytes_available(); -} -#endif diff --git a/ports/nrf/supervisor/serial.c b/ports/nrf/supervisor/serial.c index b19e9267cc..2c2c0116fb 100644 --- a/ports/nrf/supervisor/serial.c +++ b/ports/nrf/supervisor/serial.c @@ -28,15 +28,15 @@ #include "supervisor/serial.h" -#if CIRCUITPY_SERIAL_BLE +#if CIRCUITPY_REPL_BLE #include "ble_uart.h" -#elif CIRCUITPY_SERIAL_UART +#elif CIRCUITPY_REPL_UART #include #include "nrf_gpio.h" #include "nrfx_uarte.h" #endif -#if CIRCUITPY_SERIAL_BLE +#if CIRCUITPY_REPL_BLE void serial_init(void) { ble_uart_init(); @@ -58,7 +58,7 @@ void serial_write(const char *text) { ble_uart_stdout_tx_str(text); } -#elif CIRCUITPY_SERIAL_UART +#elif CIRCUITPY_REPL_UART uint8_t serial_received_char; nrfx_uarte_t serial_instance = NRFX_UARTE_INSTANCE(0); @@ -124,4 +124,4 @@ void serial_write_substring(const char *text, uint32_t len) { } } -#endif // CIRCUITPY_SERIAL_UART +#endif // CIRCUITPY_REPL_UART diff --git a/ports/raspberrypi/common-hal/pwmio/PWMOut.c b/ports/raspberrypi/common-hal/pwmio/PWMOut.c index 3d8979a036..799ee887f6 100644 --- a/ports/raspberrypi/common-hal/pwmio/PWMOut.c +++ b/ports/raspberrypi/common-hal/pwmio/PWMOut.c @@ -164,6 +164,7 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) { extern void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty) { self->duty_cycle = duty; uint16_t actual_duty = duty * self->top / ((1 << 16) - 1); + mp_printf(&mp_plat_print, "actual_duty: %d, self->top: %d\n", actual_duty, top); /// *** pwm_set_chan_level(self->slice, self->channel, actual_duty); } @@ -200,6 +201,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t fr } else { uint32_t top = common_hal_mcu_processor_get_frequency() / frequency; self->actual_frequency = common_hal_mcu_processor_get_frequency() / top; + mp_printf(&mp_plat_print, "high speed self->top: %d\n", top); /// *** self->top = top; pwm_set_clkdiv_int_frac(self->slice, 1, 0); pwm_set_wrap(self->slice, self->top - 1); diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index f907bf7ae6..c6dfbb5f2b 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -286,6 +286,9 @@ endif ifeq ($(CIRCUITPY_UHEAP),1) SRC_PATTERNS += uheap/% endif +ifeq ($(CIRCUITPY_USB_CDC),1) +SRC_PATTERNS += usb_cdc/% +endif ifeq ($(CIRCUITPY_USB_HID),1) SRC_PATTERNS += usb_hid/% endif diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index ee23c71569..7db864a42b 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -736,6 +736,13 @@ extern const struct _mp_obj_module_t uheap_module; #define UHEAP_MODULE #endif +#if CIRCUITPY_USB_CDC +extern const struct _mp_obj_module_t usb_cdc_module; +#define USB_CDC_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_usb_cdc),(mp_obj_t)&usb_cdc_module }, +#else +#define USB_CDC_MODULE +#endif + #if CIRCUITPY_USB_HID extern const struct _mp_obj_module_t usb_hid_module; #define USB_HID_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_usb_hid),(mp_obj_t)&usb_hid_module }, @@ -875,6 +882,7 @@ extern const struct _mp_obj_module_t msgpack_module; SUPERVISOR_MODULE \ TOUCHIO_MODULE \ UHEAP_MODULE \ + USB_CDC_MODULE \ USB_HID_MODULE \ USB_MIDI_MODULE \ USTACK_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index b63bbcb3ea..1a12bc50be 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -232,6 +232,15 @@ CFLAGS += -DCIRCUITPY_RANDOM=$(CIRCUITPY_RANDOM) CIRCUITPY_RE ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_RE=$(CIRCUITPY_RE) +CIRCUITPY_REPL_BLE ?= 0 +CFLAGS += -DCIRCUITPY_REPL_BLE=$(CIRCUITPY_REPL_BLE) + +CIRCUITPY_REPL_UART ?= 0 +CFLAGS += -DCIRCUITPY_REPL_UART=$(CIRCUITPY_REPL_UART) + +CIRCUITPY_REPL_USB ?= 1 +CFLAGS += -DCIRCUITPY_REPL_USB=$(CIRCUITPY_REPL_USB) + # Should busio.I2C() check for pullups? # Some boards in combination with certain peripherals may not want this. CIRCUITPY_REQUIRE_I2C_PULLUPS ?= 1 @@ -264,18 +273,6 @@ CFLAGS += -DCIRCUITPY_SDCARDIO=$(CIRCUITPY_SDCARDIO) CIRCUITPY_SDIOIO ?= 0 CFLAGS += -DCIRCUITPY_SDIOIO=$(CIRCUITPY_SDIOIO) -# Second USB CDC serial channel. -CIRCUITPY_SERIAL2 ?= -CFLAGS += -DCIRCUITPY_SERIAL2=$(CIRCUITPY_SERIAL2) - -# REPL over BLE -CIRCUITPY_SERIAL_BLE ?= 0 -CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE) - -# REPL over UART -CIRCUITPY_SERIAL_UART ?= 0 -CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART) - CIRCUITPY_SHARPDISPLAY ?= $(CIRCUITPY_FRAMEBUFFERIO) CFLAGS += -DCIRCUITPY_SHARPDISPLAY=$(CIRCUITPY_SHARPDISPLAY) @@ -315,6 +312,10 @@ CFLAGS += -DCIRCUITPY_TOUCHIO=$(CIRCUITPY_TOUCHIO) CIRCUITPY_UHEAP ?= 0 CFLAGS += -DCIRCUITPY_UHEAP=$(CIRCUITPY_UHEAP) +# Secondary CDC is usually available if there are at least 8 endpoints. +CIRCUITPY_USB_CDC ?= $(shell expr $(USB_NUM_EP) '>=' 8) +CFLAGS += -DCIRCUITPY_USB_CDC=$(CIRCUITPY_USB_CDC) + CIRCUITPY_USB_HID ?= 1 CFLAGS += -DCIRCUITPY_USB_HID=$(CIRCUITPY_USB_HID) @@ -345,9 +346,6 @@ CFLAGS += -DCIRCUITPY_USB_MIDI=$(CIRCUITPY_USB_MIDI) CIRCUITPY_USB_MSC ?= 1 CFLAGS += -DCIRCUITPY_USB_MSC=$(CIRCUITPY_USB_MSC) -CIRCUITPY_USB_SERIAL ?= 1 -CFLAGS += -DCIRCUITPY_USB_SERIAL=$(CIRCUITPY_USB_SERIAL) - CIRCUITPY_USB_VENDOR ?= 0 CFLAGS += -DCIRCUITPY_USB_VENDOR=$(CIRCUITPY_USB_VENDOR) @@ -355,10 +353,6 @@ ifndef USB_NUM_EP $(error "USB_NUM_EP (number of USB endpoint pairs)must be defined") endif -# Secondary CDC is usually available if there are at least 8 endpoints. -CIRCUITPY_USB_SERIAL2 ?= $(shell expr $(USB_NUM_EP) '>=' 8) -CFLAGS += -DCIRCUITPY_USB_SERIAL2=$(CIRCUITPY_USB_SERIAL2) - # For debugging. CIRCUITPY_USTACK ?= 0 CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK) diff --git a/shared-bindings/usb_cdc/Serial.c b/shared-bindings/usb_cdc/Serial.c new file mode 100644 index 0000000000..72e9482a25 --- /dev/null +++ b/shared-bindings/usb_cdc/Serial.c @@ -0,0 +1,139 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "shared-bindings/usb_cdc/Serial.h" +#include "shared-bindings/util.h" + +#include "py/ioctl.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/stream.h" +#include "supervisor/shared/translate.h" + +//| class Serial: +//| """Receives cdc commands over USB""" +//| +//| def __init__(self) -> None: +//| """You cannot create an instance of `usb_cdc.Serial`. +//| +//| Serial objects are constructed for every corresponding entry in the USB +//| descriptor and added to the ``usb_cdc.ports`` tuple.""" +//| ... +//| + +// These are standard stream methods. Code is in py/stream.c. +// +//| def read(self, nbytes: Optional[int] = None) -> Optional[bytes]: +//| """Read characters. If ``nbytes`` is specified then read at most that many +//| bytes. Otherwise, read everything that arrives until the connection +//| times out. Providing the number of bytes expected is highly recommended +//| because it will be faster. +//| +//| :return: Data read +//| :rtype: bytes or None""" +//| ... +//| +//| def readinto(self, buf: WriteableBuffer, nbytes: Optional[int] = None) -> Optional[bytes]: +//| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most +//| that many bytes. Otherwise, read at most ``len(buf)`` bytes. +//| +//| :return: number of bytes read and stored into ``buf`` +//| :rtype: bytes or None""" +//| ... +//| +//| def write(self, buf: ReadableBuffer) -> Optional[int]: +//| """Write the buffer of bytes to the bus. +//| +//| :return: the number of bytes written +//| :rtype: int or None""" +//| ... +//| + +// These three methods are used by the shared stream methods. +STATIC mp_uint_t usb_cdc_serial_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, int *errcode) { + usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); + byte *buf = buf_in; + + // make sure we want at least 1 char + if (size == 0) { + return 0; + } + + return common_hal_usb_cdc_serial_read(self, buf, size, errcode); +} + +STATIC mp_uint_t usb_cdc_serial_write(mp_obj_t self_in, const void *buf_in, mp_uint_t size, int *errcode) { + usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); + const byte *buf = buf_in; + + return common_hal_usb_cdc_serial_write(self, buf, size, errcode); +} + +STATIC mp_uint_t usb_cdc_serial_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t arg, int *errcode) { + usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_uint_t ret; + if (request == MP_IOCTL_POLL) { + mp_uint_t flags = arg; + ret = 0; + if ((flags & MP_IOCTL_POLL_RD) && common_hal_usb_cdc_serial_bytes_available(self) > 0) { + ret |= MP_IOCTL_POLL_RD; + } + if ((flags & MP_IOCTL_POLL_WR) && common_hal_usb_cdc_serial_ready_to_tx(self)) { + ret |= MP_IOCTL_POLL_WR; + } + } else { + *errcode = MP_EINVAL; + ret = MP_STREAM_ERROR; + } + return ret; +} + +STATIC const mp_rom_map_elem_t usb_cdc_serial_locals_dict_table[] = { + // Standard stream methods. + { MP_OBJ_NEW_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(usb_cdc_serial_locals_dict, usb_cdc_serial_locals_dict_table); + +STATIC const mp_stream_p_t usb_cdc_serial_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) + .read = usb_cdc_serial_read, + .write = usb_cdc_serial_write, + .ioctl = usb_cdc_serial_ioctl, + .is_text = false, +}; + +const mp_obj_type_t usb_cdc_serial_type = { + { &mp_type_type }, + .name = MP_QSTR_Serial, + .getiter = mp_identity_getiter, + .iternext = mp_stream_unbuffered_iter, + .protocol = &usb_cdc_serial_stream_p, + .locals_dict = (mp_obj_dict_t*)&usb_cdc_serial_locals_dict, +}; diff --git a/shared-bindings/usb_cdc/Serial.h b/shared-bindings/usb_cdc/Serial.h new file mode 100644 index 0000000000..1ef4167d5e --- /dev/null +++ b/shared-bindings/usb_cdc/Serial.h @@ -0,0 +1,40 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC_SERIAL_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC_SERIAL_H + +#include "shared-module/usb_cdc/Serial.h" + +extern const mp_obj_type_t usb_cdc_serial_type; + +extern size_t common_hal_usb_cdc_serial_read(usb_cdc_serial_obj_t *self, uint8_t *data, size_t len, int *errcode); +extern uint32_t common_hal_usb_cdc_serial_bytes_available(usb_cdc_serial_obj_t *self); +extern void common_hal_usb_cdc_serial_clear_buffer(usb_cdc_serial_obj_t *self); +extern size_t common_hal_usb_cdc_serial_write(usb_cdc_serial_obj_t *self, const uint8_t *data, size_t len, int *errcode); +extern bool common_hal_usb_cdc_serial_ready_to_tx(usb_cdc_serial_obj_t *self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC_SERIAL_H diff --git a/shared-bindings/usb_cdc/__init__.c b/shared-bindings/usb_cdc/__init__.c new file mode 100644 index 0000000000..d6a70b177a --- /dev/null +++ b/shared-bindings/usb_cdc/__init__.c @@ -0,0 +1,57 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Dan Halbertfor Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/usb_cdc/__init__.h" +#include "shared-bindings/usb_cdc/Serial.h" + +#include "py/runtime.h" + +//| """USB CDC Serial streams +//| +//| The `usb_cdc` module allows access to USB CDC (serial) communications. +//| +//| serial: Tuple[Serial, ...] +//| """Tuple of all CDC streams. Each item is a `Serial`.""" +//| + +mp_map_elem_t usb_cdc_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_usb_cdc) }, + { MP_ROM_QSTR(MP_QSTR_Serial), MP_OBJ_FROM_PTR(&usb_cdc_serial_type) }, + { MP_ROM_QSTR(MP_QSTR_serial), mp_const_empty_tuple }, +}; + +// This isn't const so we can set the streams dynamically. +MP_DEFINE_MUTABLE_DICT(usb_cdc_module_globals, usb_cdc_module_globals_table); + +const mp_obj_module_t usb_cdc_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&usb_cdc_module_globals, +}; diff --git a/shared-bindings/usb_cdc/__init__.h b/shared-bindings/usb_cdc/__init__.h new file mode 100644 index 0000000000..7938e91722 --- /dev/null +++ b/shared-bindings/usb_cdc/__init__.h @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC___INIT___H + +#include "py/obj.h" + +extern mp_obj_dict_t usb_cdc_module_globals; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC___INIT___H diff --git a/shared-module/usb_cdc/Serial.c b/shared-module/usb_cdc/Serial.c new file mode 100644 index 0000000000..663b23c259 --- /dev/null +++ b/shared-module/usb_cdc/Serial.c @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-module/usb_cdc/Serial.h" +#include "tusb.h" + +size_t common_hal_usb_cdc_serial_read(usb_cdc_serial_obj_t *self, uint8_t *data, size_t len, int *errcode) { + return tud_cdc_n_read(self->idx, data, len); +} + +uint32_t common_hal_usb_cdc_serial_bytes_available(usb_cdc_serial_obj_t *self) { + return tud_cdc_n_available(self->idx); +} + +size_t common_hal_usb_cdc_serial_write(usb_cdc_serial_obj_t *self, const uint8_t *data, size_t len, int *errcode) { + return tud_cdc_n_write(self->idx, data, len); +} + +bool common_hal_usb_cdc_serial_ready_to_tx(usb_cdc_serial_obj_t *self) { + return tud_cdc_n_connected(self->idx); +} diff --git a/shared-module/usb_cdc/Serial.h b/shared-module/usb_cdc/Serial.h new file mode 100644 index 0000000000..7e3c53e8a4 --- /dev/null +++ b/shared-module/usb_cdc/Serial.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef SHARED_MODULE_USB_CDC_SERIAL_H +#define SHARED_MODULE_USB_CDC_SERIAL_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + // Which CDC device? + uint8_t idx; +} usb_cdc_serial_obj_t; + +#endif // SHARED_MODULE_USB_CDC_SERIAL_H diff --git a/shared-module/usb_cdc/__init__.c b/shared-module/usb_cdc/__init__.c new file mode 100644 index 0000000000..ae2412cddb --- /dev/null +++ b/shared-module/usb_cdc/__init__.c @@ -0,0 +1,55 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 hathach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/usb_cdc/__init__.h" + +#include "genhdr/autogen_usb_descriptor.h" +#include "py/obj.h" +#include "py/mphal.h" +#include "py/runtime.h" +#include "py/objtuple.h" +#include "shared-bindings/usb_cdc/Serial.h" +#include "tusb.h" + +supervisor_allocation* usb_cdc_allocation; + +static usb_cdc_serial_obj_t serial_objs[CFG_TUD_CDC]; + +void usb_cdc_init(void) { + + serial_obj_ptrs *usb_cdc_serial_obj_t[CFG_TUD_CDC]; + + for (size_t i = 0; i < CFG_TUD_CDC; i++) { + serial_objs[i].base.type = &usb_cdc_serial_type; + serial_objs[i].idx = i; + serial_obj_ptrs[i] = &serial_objs[i]; + } + + serials_tuple->base.type = mp_obj_new_tuple(CFG_TUD_CDC, serials); + + repl->base.type = + repl->idx = 0; mp_map_lookup(&usb_cdc_module_globals.map, MP_ROM_QSTR(MP_QSTR_serial), MP_MAP_LOOKUP)->value = MP_OBJ_FROM_PTR(serials_tuple); +} diff --git a/shared-module/usb_cdc/__init__.h b/shared-module/usb_cdc/__init__.h new file mode 100644 index 0000000000..02b48e1165 --- /dev/null +++ b/shared-module/usb_cdc/__init__.h @@ -0,0 +1,32 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef SHARED_MODULE_USB_CDC___INIT___H +#define SHARED_MODULE_USB_CDC___INIT___H + +void usb_cdc_init(void); + +#endif /* SHARED_MODULE_USB_CDC___INIT___H */ diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index 40151cbf68..9cc12de512 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -148,13 +148,3 @@ void serial_write_substring(const char* text, uint32_t length) { void serial_write(const char* text) { serial_write_substring(text, strlen(text)); } - -#if CIRCUITPY_USB_SERIAL2 -bool serial2_bytes_available(void) { - return tud_cdc_n_available(1) > 0; -} - -bool serial2_connected(void) { - return tud_cdc_n_connected(1); -} -#endif diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index b36b9bc00b..374b7a72bd 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -33,84 +33,100 @@ endif # (Right now INTERNAL_FLASH_FILESYSTEM and (Q)SPI_FLASH_FILESYSTEM are mutually exclusive. # But that might not be true in the future.) ifdef EXTERNAL_FLASH_DEVICES - CFLAGS += -DEXTERNAL_FLASH_DEVICES=$(EXTERNAL_FLASH_DEVICES) \ - -DEXTERNAL_FLASH_DEVICE_COUNT=$(EXTERNAL_FLASH_DEVICE_COUNT) + CFLAGS += -DEXTERNAL_FLASH_DEVICES=$(EXTERNAL_FLASH_DEVICES) \ + -DEXTERNAL_FLASH_DEVICE_COUNT=$(EXTERNAL_FLASH_DEVICE_COUNT) - SRC_SUPERVISOR += supervisor/shared/external_flash/external_flash.c - ifeq ($(SPI_FLASH_FILESYSTEM),1) - SRC_SUPERVISOR += supervisor/shared/external_flash/spi_flash.c - else - endif - ifeq ($(QSPI_FLASH_FILESYSTEM),1) - SRC_SUPERVISOR += supervisor/qspi_flash.c supervisor/shared/external_flash/qspi_flash.c - endif + SRC_SUPERVISOR += supervisor/shared/external_flash/external_flash.c + ifeq ($(SPI_FLASH_FILESYSTEM),1) + SRC_SUPERVISOR += supervisor/shared/external_flash/spi_flash.c + endif + ifeq ($(QSPI_FLASH_FILESYSTEM),1) + SRC_SUPERVISOR += supervisor/qspi_flash.c supervisor/shared/external_flash/qspi_flash.c + endif else - ifeq ($(DISABLE_FILESYSTEM),1) - SRC_SUPERVISOR += supervisor/stub/internal_flash.c - else - SRC_SUPERVISOR += supervisor/internal_flash.c - endif + ifeq ($(DISABLE_FILESYSTEM),1) + SRC_SUPERVISOR += supervisor/stub/internal_flash.c + else + SRC_SUPERVISOR += supervisor/internal_flash.c + endif endif ifeq ($(USB),FALSE) - ifeq ($(wildcard supervisor/serial.c),) - SRC_SUPERVISOR += supervisor/stub/serial.c - else - SRC_SUPERVISOR += supervisor/serial.c - endif + ifeq ($(wildcard supervisor/serial.c),) + SRC_SUPERVISOR += supervisor/stub/serial.c + else + SRC_SUPERVISOR += supervisor/serial.c + endif else - SRC_SUPERVISOR += \ - lib/tinyusb/src/common/tusb_fifo.c \ - lib/tinyusb/src/device/usbd.c \ - lib/tinyusb/src/device/usbd_control.c \ - lib/tinyusb/src/class/msc/msc_device.c \ - lib/tinyusb/src/class/cdc/cdc_device.c \ - lib/tinyusb/src/tusb.c \ - supervisor/shared/serial.c \ - supervisor/shared/workflow.c \ - supervisor/usb.c \ - supervisor/shared/usb/usb_desc.c \ - supervisor/shared/usb/usb.c \ - supervisor/shared/usb/usb_msc_flash.c \ - $(BUILD)/autogen_usb_descriptor.c + SRC_SUPERVISOR += \ + lib/tinyusb/src/class/cdc/cdc_device.c \ + lib/tinyusb/src/common/tusb_fifo.c \ + lib/tinyusb/src/device/usbd.c \ + lib/tinyusb/src/device/usbd_control.c \ + lib/tinyusb/src/tusb.c \ + supervisor/shared/serial.c \ + supervisor/shared/workflow.c \ + supervisor/usb.c \ + supervisor/shared/usb/usb_desc.c \ + supervisor/shared/usb/usb.c \ + $(BUILD)/autogen_usb_descriptor.c \ - ifeq ($(CIRCUITPY_USB_HID), 1) - SRC_SUPERVISOR += \ - lib/tinyusb/src/class/hid/hid_device.c \ - shared-bindings/usb_hid/__init__.c \ - shared-bindings/usb_hid/Device.c \ - shared-module/usb_hid/__init__.c \ - shared-module/usb_hid/Device.c - endif + ifeq ($(CIRCUITPY_USB_CDC), 1) + SRC_SUPERVISOR += \ + shared-bindings/usb_cdc/__init__.c \ + shared-bindings/usb_cdc/Serial.c \ + shared-module/usb_cdc/__init__.c \ + shared-module/usb_cdc/Serial.c \ - ifeq ($(CIRCUITPY_USB_MIDI), 1) - SRC_SUPERVISOR += \ - lib/tinyusb/src/class/midi/midi_device.c \ - shared-bindings/usb_midi/__init__.c \ - shared-bindings/usb_midi/PortIn.c \ - shared-bindings/usb_midi/PortOut.c \ - shared-module/usb_midi/__init__.c \ - shared-module/usb_midi/PortIn.c \ - shared-module/usb_midi/PortOut.c - endif + endif - ifeq ($(CIRCUITPY_USB_VENDOR), 1) - SRC_SUPERVISOR += \ - lib/tinyusb/src/class/vendor/vendor_device.c - endif + ifeq ($(CIRCUITPY_USB_HID), 1) + SRC_SUPERVISOR += \ + lib/tinyusb/src/class/hid/hid_device.c \ + shared-bindings/usb_hid/__init__.c \ + shared-bindings/usb_hid/Device.c \ + shared-module/usb_hid/__init__.c \ + shared-module/usb_hid/Device.c \ - CFLAGS += -DUSB_AVAILABLE + endif + + ifeq ($(CIRCUITPY_USB_MIDI), 1) + SRC_SUPERVISOR += \ + lib/tinyusb/src/class/midi/midi_device.c \ + shared-bindings/usb_midi/__init__.c \ + shared-bindings/usb_midi/PortIn.c \ + shared-bindings/usb_midi/PortOut.c \ + shared-module/usb_midi/__init__.c \ + shared-module/usb_midi/PortIn.c \ + shared-module/usb_midi/PortOut.c \ + + endif + + ifeq ($(CIRCUITPY_USB_MSC), 1) + SRC_SUPERVISOR += \ + lib/tinyusb/src/class/msc/msc_device.c \ + supervisor/shared/usb/usb_msc_flash.c \ + + endif + + ifeq ($(CIRCUITPY_USB_VENDOR), 1) + SRC_SUPERVISOR += \ + lib/tinyusb/src/class/vendor/vendor_device.c \ + + endif + + CFLAGS += -DUSB_AVAILABLE endif SUPERVISOR_O = $(addprefix $(BUILD)/, $(SRC_SUPERVISOR:.c=.o)) ifeq ($(CIRCUITPY_DISPLAYIO), 1) - SRC_SUPERVISOR += \ - supervisor/shared/display.c + SRC_SUPERVISOR += \ + supervisor/shared/display.c - ifeq ($(CIRCUITPY_TERMINALIO), 1) - SUPERVISOR_O += $(BUILD)/autogen_display_resources.o - endif + ifeq ($(CIRCUITPY_TERMINALIO), 1) + SUPERVISOR_O += $(BUILD)/autogen_display_resources.o + endif endif USB_INTERFACE_NAME ?= "CircuitPython" @@ -126,16 +142,20 @@ endif # It gets added automatically. USB_WEBUSB_URL ?= "circuitpython.org" +ifeq ($(CIRCUITPY_REPL_USB),1) +USB_DEVICES += CDC +endif + +ifeq ($(CIRCUITPY_USB_HID),1) +USB_DEVICES += HID +endif ifeq ($(CIRCUITPY_USB_MIDI),1) USB_DEVICES += AUDIO endif ifeq ($(CIRCUITPY_USB_MSC),1) USB_DEVICES += MSC endif -ifeq ($(CIRCUITPY_USB_SERIAL),1) -USB_DEVICES += CDC -endif -ifeq ($(CIRCUITPY_USB_SERIAL2),1) +ifeq ($(CIRCUITPY_USB_CDC),1) # Inform TinyUSB there are two CDC devices. CFLAGS += -DCFG_TUD_CDC=2 USB_DEVICES += CDC2 diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index b056f853a7..3f4249f0a6 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -830,7 +830,6 @@ extern uint16_t const * const string_desc_arr [{string_descriptor_length}]; rhport0_mode="OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED" if args.highspeed else "OPT_MODE_DEVICE", - hid_num_devices=len(args.hid_devices), msc_vendor=args.manufacturer[:8], msc_product=args.product[:16], ) @@ -844,6 +843,7 @@ extern const uint8_t hid_report_descriptor[{hid_report_descriptor_length}]; #define USB_HID_NUM_DEVICES {hid_num_devices} """.format( hid_report_descriptor_length=len(bytes(combined_hid_report_descriptor)), + hid_num_devices=len(args.hid_devices), ) ) From 0b8f1b9a9039ab2ad4d43cc1d9bc388518ab0d38 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 15 Feb 2021 20:06:18 -0500 Subject: [PATCH 009/159] wip: usb_cdc.serials --- main.c | 26 ++++++++------ ports/atmel-samd/Makefile | 2 +- ports/raspberrypi/common-hal/pwmio/PWMOut.c | 2 -- shared-bindings/usb_cdc/__init__.c | 9 +++-- shared-bindings/usb_cdc/__init__.h | 4 +-- shared-module/usb_cdc/Serial.h | 2 +- shared-module/usb_cdc/__init__.c | 40 +++++++++++---------- shared-module/usb_cdc/__init__.h | 4 ++- supervisor/shared/usb/usb.c | 5 ++- 9 files changed, 50 insertions(+), 44 deletions(-) diff --git a/main.c b/main.c index 7bfa565df4..7df6e293aa 100755 --- a/main.c +++ b/main.c @@ -69,6 +69,19 @@ #include "shared-bindings/alarm/__init__.h" #endif +#if CIRCUITPY_BLEIO +#include "shared-bindings/_bleio/__init__.h" +#include "supervisor/shared/bluetooth.h" +#endif + +#if CIRCUITPY_BOARD +#include "shared-module/board/__init__.h" +#endif + +#if CIRCUITPY_CANIO +#include "common-hal/canio/CAN.h" +#endif + #if CIRCUITPY_DISPLAYIO #include "shared-module/displayio/__init__.h" #endif @@ -81,17 +94,8 @@ #include "shared-module/network/__init__.h" #endif -#if CIRCUITPY_BOARD -#include "shared-module/board/__init__.h" -#endif - -#if CIRCUITPY_BLEIO -#include "shared-bindings/_bleio/__init__.h" -#include "supervisor/shared/bluetooth.h" -#endif - -#if CIRCUITPY_CANIO -#include "common-hal/canio/CAN.h" +#if CIRCUITPY_USB_CDC +#include "shared-module/usb_cdc/__init__.h" #endif #if CIRCUITPY_WIFI diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 58c1c0d60e..48724af0c8 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -122,7 +122,7 @@ CFLAGS += -ftree-vrp $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) #Debugging/Optimization ifeq ($(DEBUG), 1) - CFLAGS += -ggdb3 -Og + CFLAGS += -ggdb3 -Og -Os # You may want to disable -flto if it interferes with debugging. CFLAGS += -flto -flto-partition=none # You may want to enable these flags to make setting breakpoints easier. diff --git a/ports/raspberrypi/common-hal/pwmio/PWMOut.c b/ports/raspberrypi/common-hal/pwmio/PWMOut.c index 6e23e236be..e861bab5a9 100644 --- a/ports/raspberrypi/common-hal/pwmio/PWMOut.c +++ b/ports/raspberrypi/common-hal/pwmio/PWMOut.c @@ -165,7 +165,6 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) { extern void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty) { self->duty_cycle = duty; uint16_t actual_duty = duty * self->top / ((1 << 16) - 1); - mp_printf(&mp_plat_print, "actual_duty: %d, self->top: %d\n", actual_duty, top); /// *** pwm_set_chan_level(self->slice, self->channel, actual_duty); } @@ -209,7 +208,6 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t fr } else { uint32_t top = common_hal_mcu_processor_get_frequency() / frequency; self->actual_frequency = common_hal_mcu_processor_get_frequency() / top; - mp_printf(&mp_plat_print, "high speed self->top: %d\n", top); /// *** self->top = top; pwm_set_clkdiv_int_frac(self->slice, 1, 0); pwm_set_wrap(self->slice, self->top - 1); diff --git a/shared-bindings/usb_cdc/__init__.c b/shared-bindings/usb_cdc/__init__.c index d6a70b177a..6ded44c4f7 100644 --- a/shared-bindings/usb_cdc/__init__.c +++ b/shared-bindings/usb_cdc/__init__.c @@ -38,18 +38,17 @@ //| //| The `usb_cdc` module allows access to USB CDC (serial) communications. //| -//| serial: Tuple[Serial, ...] +//| serials: Tuple[Serial, ...] //| """Tuple of all CDC streams. Each item is a `Serial`.""" //| -mp_map_elem_t usb_cdc_module_globals_table[] = { +static const mp_map_elem_t usb_cdc_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_usb_cdc) }, { MP_ROM_QSTR(MP_QSTR_Serial), MP_OBJ_FROM_PTR(&usb_cdc_serial_type) }, - { MP_ROM_QSTR(MP_QSTR_serial), mp_const_empty_tuple }, + { MP_ROM_QSTR(MP_QSTR_serials), MP_OBJ_FROM_PTR(&usb_cdc_serials_tuple) }, }; -// This isn't const so we can set the streams dynamically. -MP_DEFINE_MUTABLE_DICT(usb_cdc_module_globals, usb_cdc_module_globals_table); +static MP_DEFINE_CONST_DICT(usb_cdc_module_globals, usb_cdc_module_globals_table); const mp_obj_module_t usb_cdc_module = { .base = { &mp_type_module }, diff --git a/shared-bindings/usb_cdc/__init__.h b/shared-bindings/usb_cdc/__init__.h index 7938e91722..e81d243e6c 100644 --- a/shared-bindings/usb_cdc/__init__.h +++ b/shared-bindings/usb_cdc/__init__.h @@ -27,8 +27,6 @@ #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC___INIT___H #define MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC___INIT___H -#include "py/obj.h" - -extern mp_obj_dict_t usb_cdc_module_globals; +#include "shared-module/usb_cdc/__init__.h" #endif // MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC___INIT___H diff --git a/shared-module/usb_cdc/Serial.h b/shared-module/usb_cdc/Serial.h index 7e3c53e8a4..60a1d1922c 100644 --- a/shared-module/usb_cdc/Serial.h +++ b/shared-module/usb_cdc/Serial.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2020 Dan Halbert for Adafruit Industries + * Copyright (c) 2021 Dan Halbert for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/shared-module/usb_cdc/__init__.c b/shared-module/usb_cdc/__init__.c index ae2412cddb..ecb5777b26 100644 --- a/shared-module/usb_cdc/__init__.c +++ b/shared-module/usb_cdc/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2018 hathach for Adafruit Industries + * Copyright (c) 2021 Dan Halbert for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,32 +24,34 @@ * THE SOFTWARE. */ -#include "shared-bindings/usb_cdc/__init__.h" - #include "genhdr/autogen_usb_descriptor.h" +#include "py/gc.h" #include "py/obj.h" #include "py/mphal.h" #include "py/runtime.h" #include "py/objtuple.h" +#include "shared-bindings/usb_cdc/__init__.h" #include "shared-bindings/usb_cdc/Serial.h" #include "tusb.h" -supervisor_allocation* usb_cdc_allocation; +#if CFG_TUD_CDC != 2 +#error CFG_TUD_CDC must be exactly 2 +#endif -static usb_cdc_serial_obj_t serial_objs[CFG_TUD_CDC]; - -void usb_cdc_init(void) { - - serial_obj_ptrs *usb_cdc_serial_obj_t[CFG_TUD_CDC]; - - for (size_t i = 0; i < CFG_TUD_CDC; i++) { - serial_objs[i].base.type = &usb_cdc_serial_type; - serial_objs[i].idx = i; - serial_obj_ptrs[i] = &serial_objs[i]; +static const usb_cdc_serial_obj_t serial_objs[CFG_TUD_CDC] = { + { .base.type = &usb_cdc_serial_type, + .idx = 0, + }, { + .base.type = &usb_cdc_serial_type, + .idx = 1, } +}; - serials_tuple->base.type = mp_obj_new_tuple(CFG_TUD_CDC, serials); - - repl->base.type = - repl->idx = 0; mp_map_lookup(&usb_cdc_module_globals.map, MP_ROM_QSTR(MP_QSTR_serial), MP_MAP_LOOKUP)->value = MP_OBJ_FROM_PTR(serials_tuple); -} +const mp_rom_obj_tuple_t usb_cdc_serials_tuple = { + .base.type = &mp_type_tuple, + .len = CFG_TUD_CDC, + .items = { + &serial_objs[0], + &serial_objs[1], + }, +}; diff --git a/shared-module/usb_cdc/__init__.h b/shared-module/usb_cdc/__init__.h index 02b48e1165..9de3eb2faa 100644 --- a/shared-module/usb_cdc/__init__.h +++ b/shared-module/usb_cdc/__init__.h @@ -27,6 +27,8 @@ #ifndef SHARED_MODULE_USB_CDC___INIT___H #define SHARED_MODULE_USB_CDC___INIT___H -void usb_cdc_init(void); +#include "py/objtuple.h" + +extern const mp_rom_obj_tuple_t usb_cdc_serials_tuple; #endif /* SHARED_MODULE_USB_CDC___INIT___H */ diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index 43564d5d5c..af48f46737 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -26,7 +26,6 @@ #include "py/objstr.h" #include "shared-bindings/microcontroller/Processor.h" -#include "shared-module/usb_midi/__init__.h" #include "supervisor/background_callback.h" #include "supervisor/port.h" #include "supervisor/serial.h" @@ -35,6 +34,10 @@ #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" +#if CIRCUITPY_USB_MIDI +#include "shared-module/usb_midi/__init__.h" +#endif + #include "tusb.h" #if CIRCUITPY_USB_VENDOR From c26de0136a0ad746bf0ace600a1a9d3ff428c4c6 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 16 Feb 2021 17:11:37 -0500 Subject: [PATCH 010/159] works! no timeouts --- ports/cxd56/mpconfigport.mk | 3 + shared-bindings/usb_cdc/Serial.c | 122 ++++++++++++++++++++++++++--- shared-bindings/usb_cdc/Serial.h | 13 ++- shared-bindings/usb_cdc/__init__.c | 7 +- shared-module/usb_cdc/Serial.c | 27 ++++++- tools/gen_usb_descriptor.py | 87 ++++++++++++++------ 6 files changed, 213 insertions(+), 46 deletions(-) diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index e1ffc79d08..ab39e3bb72 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -7,6 +7,9 @@ USB_CDC_EP_NUM_DATA_IN = 1 USB_MSC_EP_NUM_OUT = 5 USB_MSC_EP_NUM_IN = 4 +# Number of USB endpoint pairs. +USB_NUM_EP = 5 + MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz CIRCUITPY_AUDIOBUSIO = 0 diff --git a/shared-bindings/usb_cdc/Serial.c b/shared-bindings/usb_cdc/Serial.c index 72e9482a25..03fb94f313 100644 --- a/shared-bindings/usb_cdc/Serial.c +++ b/shared-bindings/usb_cdc/Serial.c @@ -67,12 +67,16 @@ //| ... //| //| def write(self, buf: ReadableBuffer) -> Optional[int]: -//| """Write the buffer of bytes to the bus. +//| """Write as many bytes as possible from the buffer of bytes. //| //| :return: the number of bytes written //| :rtype: int or None""" //| ... //| +//| def flush(self) -> None: +//| """Force out any unwritten bytes, waiting until they are written.""" +//| ... +//| // These three methods are used by the shared stream methods. STATIC mp_uint_t usb_cdc_serial_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, int *errcode) { @@ -97,27 +101,121 @@ STATIC mp_uint_t usb_cdc_serial_write(mp_obj_t self_in, const void *buf_in, mp_u STATIC mp_uint_t usb_cdc_serial_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t arg, int *errcode) { usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); mp_uint_t ret; - if (request == MP_IOCTL_POLL) { - mp_uint_t flags = arg; - ret = 0; - if ((flags & MP_IOCTL_POLL_RD) && common_hal_usb_cdc_serial_bytes_available(self) > 0) { - ret |= MP_IOCTL_POLL_RD; + switch (request) { + case MP_IOCTL_POLL: { + mp_uint_t flags = arg; + ret = 0; + if ((flags & MP_IOCTL_POLL_RD) && common_hal_usb_cdc_serial_get_in_waiting(self) > 0) { + ret |= MP_IOCTL_POLL_RD; + } + if ((flags & MP_IOCTL_POLL_WR) && common_hal_usb_cdc_serial_get_out_waiting(self) == 0) { + ret |= MP_IOCTL_POLL_WR; + } + break; } - if ((flags & MP_IOCTL_POLL_WR) && common_hal_usb_cdc_serial_ready_to_tx(self)) { - ret |= MP_IOCTL_POLL_WR; - } - } else { - *errcode = MP_EINVAL; - ret = MP_STREAM_ERROR; + + case MP_STREAM_FLUSH: + common_hal_usb_cdc_serial_flush(self); + break; + + default: + *errcode = MP_EINVAL; + ret = MP_STREAM_ERROR; } return ret; } +//| connected: bool +//| """True if this Serial is connected to a host. (read-only)""" +//| +STATIC mp_obj_t usb_cdc_serial_get_connected(mp_obj_t self_in) { + usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_bool(common_hal_usb_cdc_serial_get_connected(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_connected_obj, usb_cdc_serial_get_connected); + +const mp_obj_property_t usb_cdc_serial__connected_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&usb_cdc_serial_get_connected_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| in_waiting: int +//| """Returns the number of bytes waiting to be read on the USB serial input. (read-only)""" +//| +STATIC mp_obj_t usb_cdc_serial_get_in_waiting(mp_obj_t self_in) { + usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_int(common_hal_usb_cdc_serial_get_in_waiting(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_in_waiting_obj, usb_cdc_serial_get_in_waiting); + +const mp_obj_property_t usb_cdc_serial_in_waiting_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&usb_cdc_serial_get_in_waiting_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| out_waiting: int +//| """Returns the number of bytes waiting to be written on the USB serial output. (read-only)""" +//| +STATIC mp_obj_t usb_cdc_serial_get_out_waiting(mp_obj_t self_in) { + usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_int(common_hal_usb_cdc_serial_get_out_waiting(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_out_waiting_obj, usb_cdc_serial_get_out_waiting); + +const mp_obj_property_t usb_cdc_serial_out_waiting_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&usb_cdc_serial_get_out_waiting_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| def reset_input_buffer(self) -> None: +//| """Clears any unread bytes.""" +//| ... +//| +STATIC mp_obj_t usb_cdc_serial_reset_input_buffer(mp_obj_t self_in) { + usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_usb_cdc_serial_reset_input_buffer(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_reset_input_buffer_obj, usb_cdc_serial_reset_input_buffer); + +//| def reset_output_buffer(self) -> None: +//| """Clears any unwritten bytes.""" +//| ... +//| +STATIC mp_obj_t usb_cdc_serial_reset_output_buffer(mp_obj_t self_in) { + usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_usb_cdc_serial_reset_output_buffer(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_reset_output_buffer_obj, usb_cdc_serial_reset_output_buffer); + + STATIC const mp_rom_map_elem_t usb_cdc_serial_locals_dict_table[] = { // Standard stream methods. + { MP_ROM_QSTR(MP_QSTR_flush), MP_ROM_PTR(&mp_stream_flush_obj) }, { MP_OBJ_NEW_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_obj) }, { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) }, + { MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj)}, + { MP_ROM_QSTR(MP_QSTR_readlines), MP_ROM_PTR(&mp_stream_unbuffered_readlines_obj)}, { MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) }, + + // Other pyserial-inspired attributes. + { MP_OBJ_NEW_QSTR(MP_QSTR_in_waiting), MP_ROM_PTR(&usb_cdc_serial_in_waiting_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_out_waiting), MP_ROM_PTR(&usb_cdc_serial_out_waiting_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_reset_input_buffer), MP_ROM_PTR(&usb_cdc_serial_reset_input_buffer_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_reset_output_buffer), MP_ROM_PTR(&usb_cdc_serial_reset_output_buffer_obj) }, + + // Not in pyserial protocol. + { MP_OBJ_NEW_QSTR(MP_QSTR_connected), MP_ROM_PTR(&usb_cdc_serial_get_connected_obj) }, + + + }; STATIC MP_DEFINE_CONST_DICT(usb_cdc_serial_locals_dict, usb_cdc_serial_locals_dict_table); diff --git a/shared-bindings/usb_cdc/Serial.h b/shared-bindings/usb_cdc/Serial.h index 1ef4167d5e..6e54b9ad35 100644 --- a/shared-bindings/usb_cdc/Serial.h +++ b/shared-bindings/usb_cdc/Serial.h @@ -32,9 +32,16 @@ extern const mp_obj_type_t usb_cdc_serial_type; extern size_t common_hal_usb_cdc_serial_read(usb_cdc_serial_obj_t *self, uint8_t *data, size_t len, int *errcode); -extern uint32_t common_hal_usb_cdc_serial_bytes_available(usb_cdc_serial_obj_t *self); -extern void common_hal_usb_cdc_serial_clear_buffer(usb_cdc_serial_obj_t *self); extern size_t common_hal_usb_cdc_serial_write(usb_cdc_serial_obj_t *self, const uint8_t *data, size_t len, int *errcode); -extern bool common_hal_usb_cdc_serial_ready_to_tx(usb_cdc_serial_obj_t *self); + +extern uint32_t common_hal_usb_cdc_serial_get_in_waiting(usb_cdc_serial_obj_t *self); +extern uint32_t common_hal_usb_cdc_serial_get_out_waiting(usb_cdc_serial_obj_t *self); + +extern void common_hal_usb_cdc_serial_reset_input_buffer(usb_cdc_serial_obj_t *self); +extern uint32_t common_hal_usb_cdc_serial_reset_output_buffer(usb_cdc_serial_obj_t *self); + +extern uint32_t common_hal_usb_cdc_serial_flush(usb_cdc_serial_obj_t *self); + +extern bool common_hal_usb_cdc_serial_get_connected(usb_cdc_serial_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC_SERIAL_H diff --git a/shared-bindings/usb_cdc/__init__.c b/shared-bindings/usb_cdc/__init__.c index 6ded44c4f7..eb9c25e001 100644 --- a/shared-bindings/usb_cdc/__init__.c +++ b/shared-bindings/usb_cdc/__init__.c @@ -36,10 +36,13 @@ //| """USB CDC Serial streams //| -//| The `usb_cdc` module allows access to USB CDC (serial) communications. +//| The `usb_cdc` module allows access to USB CDC (serial) communications.""" //| //| serials: Tuple[Serial, ...] -//| """Tuple of all CDC streams. Each item is a `Serial`.""" +//| """Tuple of all CDC streams. Each item is a `Serial`. +//| ``serials[0]`` is the USB REPL connection. +//| ``serials[1]`` is a second USB serial connection, unconnected to the REPL. +//| """ //| static const mp_map_elem_t usb_cdc_module_globals_table[] = { diff --git a/shared-module/usb_cdc/Serial.c b/shared-module/usb_cdc/Serial.c index 663b23c259..bd3972c8d5 100644 --- a/shared-module/usb_cdc/Serial.c +++ b/shared-module/usb_cdc/Serial.c @@ -31,14 +31,33 @@ size_t common_hal_usb_cdc_serial_read(usb_cdc_serial_obj_t *self, uint8_t *data, return tud_cdc_n_read(self->idx, data, len); } -uint32_t common_hal_usb_cdc_serial_bytes_available(usb_cdc_serial_obj_t *self) { +size_t common_hal_usb_cdc_serial_write(usb_cdc_serial_obj_t *self, const uint8_t *data, size_t len, int *errcode) { + uint32_t num_written = tud_cdc_n_write(self->idx, data, len); + tud_cdc_n_write_flush(self->idx); + return num_written; +} + +uint32_t common_hal_usb_cdc_serial_get_in_waiting(usb_cdc_serial_obj_t *self) { return tud_cdc_n_available(self->idx); } -size_t common_hal_usb_cdc_serial_write(usb_cdc_serial_obj_t *self, const uint8_t *data, size_t len, int *errcode) { - return tud_cdc_n_write(self->idx, data, len); +uint32_t common_hal_usb_cdc_serial_get_out_waiting(usb_cdc_serial_obj_t *self) { + // Return number of FIFO bytes currently occupied. + return CFG_TUD_CDC_TX_BUFSIZE - tud_cdc_n_write_available(self->idx); } -bool common_hal_usb_cdc_serial_ready_to_tx(usb_cdc_serial_obj_t *self) { +void common_hal_usb_cdc_serial_reset_input_buffer(usb_cdc_serial_obj_t *self) { + tud_cdc_n_read_flush(self->idx); +} + +uint32_t common_hal_usb_cdc_serial_reset_output_buffer(usb_cdc_serial_obj_t *self) { + return tud_cdc_n_write_clear(self->idx); +} + +uint32_t common_hal_usb_cdc_serial_flush(usb_cdc_serial_obj_t *self) { + return tud_cdc_n_write_flush(self->idx); +} + +bool common_hal_usb_cdc_serial_get_connected(usb_cdc_serial_obj_t *self) { return tud_cdc_n_connected(self->idx); } diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index 3f4249f0a6..089d00ff23 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -76,12 +76,27 @@ parser.add_argument( default=0, help="endpoint number of CDC NOTIFICATION", ) +parser.add_argument( + "--cdc2_ep_num_notification", + type=int, + default=0, + help="endpoint number of CDC2 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( + "--cdc2_ep_num_data_out", + type=int, + default=0, + help="endpoint number of CDC2 DATA OUT", +) +parser.add_argument( + "--cdc2_ep_num_data_in", type=int, default=0, help="endpoint number of CDC2 DATA IN" +) parser.add_argument( "--msc_ep_num_out", type=int, default=0, help="endpoint number of MSC OUT" ) @@ -146,36 +161,41 @@ if not args.renumber_endpoints: if include_cdc: 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: + if 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: + if args.cdc_ep_num_data_in == 0: raise ValueError("CDC data IN endpoint number must not be 0") if include_cdc2: - raise ValueError("Second CDC not supported without renumbering endpoints") + if args.cdc2_ep_num_notification == 0: + raise ValueError("CDC2 notification endpoint number must not be 0") + if args.cdc2_ep_num_data_out == 0: + raise ValueError("CDC2 data OUT endpoint number must not be 0") + if args.cdc2_ep_num_data_in == 0: + raise ValueError("CDC2 data IN endpoint number must not be 0") if include_msc: if args.msc_ep_num_out == 0: raise ValueError("MSC endpoint OUT number must not be 0") - elif args.msc_ep_num_in == 0: + if args.msc_ep_num_in == 0: raise ValueError("MSC endpoint IN number must not be 0") if include_hid: 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: + if args.hid_ep_num_in == 0: raise ValueError("HID endpoint IN number must not be 0") if include_audio: 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: + if args.midi_ep_num_in == 0: raise ValueError("MIDI endpoint IN number must not be 0") if include_vendor: if args.vendor_ep_num_out == 0: raise ValueError("VENDOR endpoint OUT number must not be 0") - elif args.vendor_ep_num_in == 0: + if args.vendor_ep_num_in == 0: raise ValueError("VENDOR endpoint IN number must not be 0") @@ -228,18 +248,22 @@ device = standard.DeviceDescriptor( def make_cdc_union(name): return cdc.Union( description="{} comm".format(name), - bMasterInterface=0x00, # Adjust this after interfaces are renumbered. + # Set bMasterInterface and bSlaveInterface_list to proper values after interfaces are renumbered. + bMasterInterface=0x00, bSlaveInterface_list=[0x01], - ) # Adjust this after interfaces are renumbered. + ) def make_cdc_call_management(name): + # Set bDataInterface to proper value after interfaces are renumbered. return cdc.CallManagement( description="{} comm".format(name), bmCapabilities=0x01, bDataInterface=0x01 - ) # Adjust this after interfaces are renumbered. + ) -def make_cdc_comm_interface(name, cdc_union): +def make_cdc_comm_interface( + name, cdc_union, cdc_call_management, cdc_ep_num_notification +): return standard.InterfaceDescriptor( description="{} comm".format(name), bInterfaceClass=cdc.CDC_CLASS_COMM, # Communications Device Class @@ -255,7 +279,7 @@ def make_cdc_comm_interface(name, cdc_union): cdc_union, standard.EndpointDescriptor( description="{} comm in".format(name), - bEndpointAddress=args.cdc_ep_num_notification + bEndpointAddress=cdc_ep_num_notification | standard.EndpointDescriptor.DIRECTION_IN, bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT, wMaxPacketSize=0x0040, @@ -265,7 +289,7 @@ def make_cdc_comm_interface(name, cdc_union): ) -def make_cdc_data_interface(name): +def make_cdc_data_interface(name, cdc_ep_num_data_in, cdc_ep_num_data_out): return standard.InterfaceDescriptor( description="{} data".format(name), bInterfaceClass=cdc.CDC_CLASS_DATA, @@ -273,7 +297,7 @@ def make_cdc_data_interface(name): subdescriptors=[ standard.EndpointDescriptor( description="{} data out".format(name), - bEndpointAddress=args.cdc_ep_num_data_out + bEndpointAddress=cdc_ep_num_data_out | standard.EndpointDescriptor.DIRECTION_OUT, bmAttributes=standard.EndpointDescriptor.TYPE_BULK, bInterval=0, @@ -281,7 +305,7 @@ def make_cdc_data_interface(name): ), standard.EndpointDescriptor( description="{} data in".format(name), - bEndpointAddress=args.cdc_ep_num_data_in + bEndpointAddress=cdc_ep_num_data_in | standard.EndpointDescriptor.DIRECTION_IN, bmAttributes=standard.EndpointDescriptor.TYPE_BULK, bInterval=0, @@ -294,16 +318,24 @@ def make_cdc_data_interface(name): if include_cdc: cdc_union = make_cdc_union("CDC") cdc_call_management = make_cdc_call_management("CDC") - cdc_comm_interface = make_cdc_comm_interface("CDC", cdc_union) - cdc_data_interface = make_cdc_data_interface("CDC") + cdc_comm_interface = make_cdc_comm_interface( + "CDC", cdc_union, cdc_call_management, args.cdc_ep_num_notification + ) + cdc_data_interface = make_cdc_data_interface( + "CDC", args.cdc_ep_num_data_in, args.cdc_ep_num_data_out + ) -cdc_interfaces = [cdc_comm_interface, cdc_data_interface] + cdc_interfaces = [cdc_comm_interface, cdc_data_interface] if include_cdc2: cdc2_union = make_cdc_union("CDC2") cdc2_call_management = make_cdc_call_management("CDC2") - cdc2_comm_interface = make_cdc_comm_interface("CDC2", cdc2_union) - cdc2_data_interface = make_cdc_data_interface("CDC2") + cdc2_comm_interface = make_cdc_comm_interface( + "CDC2", cdc2_union, cdc2_call_management, args.cdc2_ep_num_notification + ) + cdc2_data_interface = make_cdc_data_interface( + "CDC2", args.cdc2_ep_num_data_in, args.cdc2_ep_num_data_out + ) cdc2_interfaces = [cdc2_comm_interface, cdc2_data_interface] @@ -842,10 +874,10 @@ extern const uint8_t hid_report_descriptor[{hid_report_descriptor_length}]; #define USB_HID_NUM_DEVICES {hid_num_devices} """.format( - hid_report_descriptor_length=len(bytes(combined_hid_report_descriptor)), - hid_num_devices=len(args.hid_devices), + hid_report_descriptor_length=len(bytes(combined_hid_report_descriptor)), + hid_num_devices=len(args.hid_devices), + ) ) -) if include_vendor: h_file.write( @@ -876,7 +908,10 @@ if include_hid: c_file.write( """\ const uint8_t hid_report_descriptor[{HID_DESCRIPTOR_LENGTH}] = {{ -""".format(HID_DESCRIPTOR_LENGTH=hid_descriptor_length)) +""".format( + HID_DESCRIPTOR_LENGTH=hid_descriptor_length + ) + ) for b in bytes(combined_hid_report_descriptor): c_file.write("0x{:02x}, ".format(b)) @@ -895,7 +930,9 @@ const uint8_t hid_report_descriptor[{HID_DESCRIPTOR_LENGTH}] = {{ static uint8_t {name}_report_buffer[{report_length}]; """.format( name=name.lower(), - report_length=hid_report_descriptors.HID_DEVICE_DATA[name].report_length, + report_length=hid_report_descriptors.HID_DEVICE_DATA[ + name + ].report_length, ) ) From 59429cdcbed8b88e80179c8701dd2ea529b12f19 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 17 Feb 2021 11:41:23 -0500 Subject: [PATCH 011/159] Move manual tests and rename --- .../jeplayer-splash-16000-16bit-mono-signed.wav | Bin .../jeplayer-splash-16000-16bit-stereo-signed.wav | Bin .../jeplayer-splash-16000-24bit-mono-signed.wav | Bin .../jeplayer-splash-16000-24bit-stereo-signed.wav | Bin .../jeplayer-splash-16000-8bit-mono-unsigned.wav | Bin .../jeplayer-splash-16000-8bit-stereo-unsigned.wav | Bin .../jeplayer-splash-44100-16bit-mono-signed.wav | Bin .../jeplayer-splash-44100-16bit-stereo-signed.wav | Bin .../jeplayer-splash-44100-24bit-mono-signed.wav | Bin .../jeplayer-splash-44100-24bit-stereo-signed.wav | Bin .../jeplayer-splash-44100-8bit-mono-unsigned.wav | Bin .../jeplayer-splash-44100-8bit-stereo-unsigned.wav | Bin .../audiocore/jeplayer-splash-44100-stereo.mp3 | Bin .../jeplayer-splash-8000-16bit-mono-signed.wav | Bin .../jeplayer-splash-8000-16bit-stereo-signed.wav | Bin .../jeplayer-splash-8000-24bit-mono-signed.wav | Bin .../jeplayer-splash-8000-24bit-stereo-signed.wav | Bin .../jeplayer-splash-8000-8bit-mono-unsigned.wav | Bin .../jeplayer-splash-8000-8bit-stereo-unsigned.wav | Bin .../audiopwmio/single_buffer_loop.py | 0 .../audiopwmio/wavefile_pause_resume.py | 0 .../audiopwmio/wavefile_playback.py | 0 .../socketpool/client/cpy-client.py | 0 .../socketpool/client/host-server.py | 0 .../socketpool/client/readme.md | 0 .../socketpool/datagram/ntp.py | 0 .../socketpool/datagram/readme.md | 0 .../socketpool/server/cpy-server.py | 0 .../socketpool/server/host-client.py | 0 .../socketpool/server/readme.md | 0 30 files changed, 0 insertions(+), 0 deletions(-) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-16000-16bit-mono-signed.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-16000-16bit-stereo-signed.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-16000-24bit-mono-signed.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-16000-24bit-stereo-signed.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-16000-8bit-mono-unsigned.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-16000-8bit-stereo-unsigned.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-44100-16bit-mono-signed.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-44100-16bit-stereo-signed.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-44100-24bit-mono-signed.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-44100-24bit-stereo-signed.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-44100-8bit-mono-unsigned.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-44100-8bit-stereo-unsigned.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-44100-stereo.mp3 (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-8000-16bit-mono-signed.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-8000-16bit-stereo-signed.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-8000-24bit-mono-signed.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-8000-24bit-stereo-signed.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-8000-8bit-mono-unsigned.wav (100%) rename tests/{manual => circuitpython-manual}/audiocore/jeplayer-splash-8000-8bit-stereo-unsigned.wav (100%) rename tests/{manual => circuitpython-manual}/audiopwmio/single_buffer_loop.py (100%) rename tests/{manual => circuitpython-manual}/audiopwmio/wavefile_pause_resume.py (100%) rename tests/{manual => circuitpython-manual}/audiopwmio/wavefile_playback.py (100%) rename tests/{_manual => circuitpython-manual}/socketpool/client/cpy-client.py (100%) rename tests/{_manual => circuitpython-manual}/socketpool/client/host-server.py (100%) rename tests/{_manual => circuitpython-manual}/socketpool/client/readme.md (100%) rename tests/{_manual => circuitpython-manual}/socketpool/datagram/ntp.py (100%) rename tests/{_manual => circuitpython-manual}/socketpool/datagram/readme.md (100%) rename tests/{_manual => circuitpython-manual}/socketpool/server/cpy-server.py (100%) rename tests/{_manual => circuitpython-manual}/socketpool/server/host-client.py (100%) rename tests/{_manual => circuitpython-manual}/socketpool/server/readme.md (100%) diff --git a/tests/manual/audiocore/jeplayer-splash-16000-16bit-mono-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-16bit-mono-signed.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-16000-16bit-mono-signed.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-16000-16bit-mono-signed.wav diff --git a/tests/manual/audiocore/jeplayer-splash-16000-16bit-stereo-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-16bit-stereo-signed.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-16000-16bit-stereo-signed.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-16000-16bit-stereo-signed.wav diff --git a/tests/manual/audiocore/jeplayer-splash-16000-24bit-mono-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-24bit-mono-signed.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-16000-24bit-mono-signed.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-16000-24bit-mono-signed.wav diff --git a/tests/manual/audiocore/jeplayer-splash-16000-24bit-stereo-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-24bit-stereo-signed.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-16000-24bit-stereo-signed.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-16000-24bit-stereo-signed.wav diff --git a/tests/manual/audiocore/jeplayer-splash-16000-8bit-mono-unsigned.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-8bit-mono-unsigned.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-16000-8bit-mono-unsigned.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-16000-8bit-mono-unsigned.wav diff --git a/tests/manual/audiocore/jeplayer-splash-16000-8bit-stereo-unsigned.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-8bit-stereo-unsigned.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-16000-8bit-stereo-unsigned.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-16000-8bit-stereo-unsigned.wav diff --git a/tests/manual/audiocore/jeplayer-splash-44100-16bit-mono-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-16bit-mono-signed.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-44100-16bit-mono-signed.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-44100-16bit-mono-signed.wav diff --git a/tests/manual/audiocore/jeplayer-splash-44100-16bit-stereo-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-16bit-stereo-signed.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-44100-16bit-stereo-signed.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-44100-16bit-stereo-signed.wav diff --git a/tests/manual/audiocore/jeplayer-splash-44100-24bit-mono-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-24bit-mono-signed.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-44100-24bit-mono-signed.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-44100-24bit-mono-signed.wav diff --git a/tests/manual/audiocore/jeplayer-splash-44100-24bit-stereo-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-24bit-stereo-signed.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-44100-24bit-stereo-signed.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-44100-24bit-stereo-signed.wav diff --git a/tests/manual/audiocore/jeplayer-splash-44100-8bit-mono-unsigned.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-8bit-mono-unsigned.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-44100-8bit-mono-unsigned.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-44100-8bit-mono-unsigned.wav diff --git a/tests/manual/audiocore/jeplayer-splash-44100-8bit-stereo-unsigned.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-8bit-stereo-unsigned.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-44100-8bit-stereo-unsigned.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-44100-8bit-stereo-unsigned.wav diff --git a/tests/manual/audiocore/jeplayer-splash-44100-stereo.mp3 b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-stereo.mp3 similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-44100-stereo.mp3 rename to tests/circuitpython-manual/audiocore/jeplayer-splash-44100-stereo.mp3 diff --git a/tests/manual/audiocore/jeplayer-splash-8000-16bit-mono-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-16bit-mono-signed.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-8000-16bit-mono-signed.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-8000-16bit-mono-signed.wav diff --git a/tests/manual/audiocore/jeplayer-splash-8000-16bit-stereo-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-16bit-stereo-signed.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-8000-16bit-stereo-signed.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-8000-16bit-stereo-signed.wav diff --git a/tests/manual/audiocore/jeplayer-splash-8000-24bit-mono-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-24bit-mono-signed.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-8000-24bit-mono-signed.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-8000-24bit-mono-signed.wav diff --git a/tests/manual/audiocore/jeplayer-splash-8000-24bit-stereo-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-24bit-stereo-signed.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-8000-24bit-stereo-signed.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-8000-24bit-stereo-signed.wav diff --git a/tests/manual/audiocore/jeplayer-splash-8000-8bit-mono-unsigned.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-8bit-mono-unsigned.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-8000-8bit-mono-unsigned.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-8000-8bit-mono-unsigned.wav diff --git a/tests/manual/audiocore/jeplayer-splash-8000-8bit-stereo-unsigned.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-8bit-stereo-unsigned.wav similarity index 100% rename from tests/manual/audiocore/jeplayer-splash-8000-8bit-stereo-unsigned.wav rename to tests/circuitpython-manual/audiocore/jeplayer-splash-8000-8bit-stereo-unsigned.wav diff --git a/tests/manual/audiopwmio/single_buffer_loop.py b/tests/circuitpython-manual/audiopwmio/single_buffer_loop.py similarity index 100% rename from tests/manual/audiopwmio/single_buffer_loop.py rename to tests/circuitpython-manual/audiopwmio/single_buffer_loop.py diff --git a/tests/manual/audiopwmio/wavefile_pause_resume.py b/tests/circuitpython-manual/audiopwmio/wavefile_pause_resume.py similarity index 100% rename from tests/manual/audiopwmio/wavefile_pause_resume.py rename to tests/circuitpython-manual/audiopwmio/wavefile_pause_resume.py diff --git a/tests/manual/audiopwmio/wavefile_playback.py b/tests/circuitpython-manual/audiopwmio/wavefile_playback.py similarity index 100% rename from tests/manual/audiopwmio/wavefile_playback.py rename to tests/circuitpython-manual/audiopwmio/wavefile_playback.py diff --git a/tests/_manual/socketpool/client/cpy-client.py b/tests/circuitpython-manual/socketpool/client/cpy-client.py similarity index 100% rename from tests/_manual/socketpool/client/cpy-client.py rename to tests/circuitpython-manual/socketpool/client/cpy-client.py diff --git a/tests/_manual/socketpool/client/host-server.py b/tests/circuitpython-manual/socketpool/client/host-server.py similarity index 100% rename from tests/_manual/socketpool/client/host-server.py rename to tests/circuitpython-manual/socketpool/client/host-server.py diff --git a/tests/_manual/socketpool/client/readme.md b/tests/circuitpython-manual/socketpool/client/readme.md similarity index 100% rename from tests/_manual/socketpool/client/readme.md rename to tests/circuitpython-manual/socketpool/client/readme.md diff --git a/tests/_manual/socketpool/datagram/ntp.py b/tests/circuitpython-manual/socketpool/datagram/ntp.py similarity index 100% rename from tests/_manual/socketpool/datagram/ntp.py rename to tests/circuitpython-manual/socketpool/datagram/ntp.py diff --git a/tests/_manual/socketpool/datagram/readme.md b/tests/circuitpython-manual/socketpool/datagram/readme.md similarity index 100% rename from tests/_manual/socketpool/datagram/readme.md rename to tests/circuitpython-manual/socketpool/datagram/readme.md diff --git a/tests/_manual/socketpool/server/cpy-server.py b/tests/circuitpython-manual/socketpool/server/cpy-server.py similarity index 100% rename from tests/_manual/socketpool/server/cpy-server.py rename to tests/circuitpython-manual/socketpool/server/cpy-server.py diff --git a/tests/_manual/socketpool/server/host-client.py b/tests/circuitpython-manual/socketpool/server/host-client.py similarity index 100% rename from tests/_manual/socketpool/server/host-client.py rename to tests/circuitpython-manual/socketpool/server/host-client.py diff --git a/tests/_manual/socketpool/server/readme.md b/tests/circuitpython-manual/socketpool/server/readme.md similarity index 100% rename from tests/_manual/socketpool/server/readme.md rename to tests/circuitpython-manual/socketpool/server/readme.md From ab5eb86118f5b446d9cb1996b07cae56e3f45643 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 17 Feb 2021 16:50:49 -0600 Subject: [PATCH 012/159] raspberrypi: implement os.urandom Since the datasheet cast some doubt on the strength of the "rosc_hw->randombit", I use the SHA256 hash function to create a high quality random seed from random values of uncertain entropy, as well as to generate a sequence of random values from that seed using SHA256 as a cryptographically-secure random number generator. In practice, it produces over 100kB/s of random data which does not have any gross problems according to _PractRand_. --- extmod/crypto-algorithms/sha256.c | 1 + ports/raspberrypi/Makefile | 1 + ports/raspberrypi/common-hal/os/__init__.c | 67 +++++++++++++++++++++- 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/extmod/crypto-algorithms/sha256.c b/extmod/crypto-algorithms/sha256.c index 276611cfd5..9b5e45d23d 100644 --- a/extmod/crypto-algorithms/sha256.c +++ b/extmod/crypto-algorithms/sha256.c @@ -14,6 +14,7 @@ /*************************** HEADER FILES ***************************/ #include +#include #include "sha256.h" /****************************** MACROS ******************************/ diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index 7ce5606f8b..f5e65f2560 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -199,6 +199,7 @@ SRC_C += \ audio_dma.c \ background.c \ peripherals/pins.c \ + extmod/crypto-algorithms/sha256.c \ fatfs_port.c \ lib/libc/string0.c \ lib/mp-readline/readline.c \ diff --git a/ports/raspberrypi/common-hal/os/__init__.c b/ports/raspberrypi/common-hal/os/__init__.c index dcbd06e937..0df7653d39 100644 --- a/ports/raspberrypi/common-hal/os/__init__.c +++ b/ports/raspberrypi/common-hal/os/__init__.c @@ -30,6 +30,11 @@ #include "py/objtuple.h" #include "py/qstr.h" +#include "extmod/crypto-algorithms/sha256.h" + +#include "hardware/structs/rosc.h" + +#include STATIC const qstr os_uname_info_fields[] = { MP_QSTR_sysname, MP_QSTR_nodename, @@ -57,6 +62,64 @@ mp_obj_t common_hal_os_uname(void) { return (mp_obj_t)&os_uname_info_obj; } -bool common_hal_os_urandom(uint8_t* buffer, uint32_t length) { - return false; +// NIST Special Publication 800-90B (draft) recommends several extractors, +// including the SHA hash family and states that if the amount of entropy input +// is twice the number of bits output from them, that output can be considered +// essentially fully random. If every RANDOM_SAFETY_MARGIN bits from +// `rosc_hw->randombit` have at least 1 bit of entropy, then this criterion is met. +// +// This works by seeding the `random_state` with plenty of random bits (SHA256 +// as entropy harvesting function), then using that state it as a counter input +// (SHA256 as a CSPRNG), re-seeding at least every 256 blocks (8kB). +// +// In practice, `PractRand` doesn't detect any gross problems with the output +// random numbers on samples of 1 to 8 megabytes, no matter the setting of +// RANDOM_SAFETY_MARGIN. (it does detect "unusual" results from time to time, +// as it will with any RNG) +#define RANDOM_SAFETY_MARGIN (4) + +static BYTE random_state[SHA256_BLOCK_SIZE]; +static void seed_random_bits(BYTE out[SHA256_BLOCK_SIZE]) { + CRYAL_SHA256_CTX context; + sha256_init(&context); + for (int i=0; i<2*RANDOM_SAFETY_MARGIN; i++) { + for(int j=0; jrandombit & 1; + for(int k=0; k<8; k++) { + out[j] = (out[j] << 1) ^ (rosc_hw->randombit & 1); + } + } + sha256_update(&context, out, SHA256_BLOCK_SIZE); + } + sha256_final(&context, out); +} + +static void get_random_bits(BYTE out[SHA256_BLOCK_SIZE]) { + if (!random_state[0]++) { + seed_random_bits(random_state); + } + CRYAL_SHA256_CTX context; + sha256_init(&context); + sha256_update(&context, random_state, SHA256_BLOCK_SIZE); + sha256_final(&context, out); +} + +bool common_hal_os_urandom(uint8_t* buffer, uint32_t length) { +#define ROSC_POWER_SAVE (1) // assume ROSC is not necessarily active all the time +#if ROSC_POWER_SAVE + uint32_t old_rosc_ctrl = rosc_hw->ctrl; + rosc_hw->ctrl = (old_rosc_ctrl & ~ROSC_CTRL_ENABLE_BITS) | (ROSC_CTRL_ENABLE_VALUE_ENABLE << 12); +#endif + while (length) { + size_t n = MIN(length, SHA256_BLOCK_SIZE); + BYTE sha_buf[SHA256_BLOCK_SIZE]; + get_random_bits(sha_buf); + memcpy(buffer, sha_buf, n); + buffer += n; + length -= n; + } +#if ROSC_POWER_SAVE + rosc_hw->ctrl = old_rosc_ctrl; +#endif + return true; } From ed49c02feb7e206e962bf8a40cd69771b83e25cf Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 17 Feb 2021 23:24:11 -0500 Subject: [PATCH 013/159] add timeout; finish up for PR --- py/stream.c | 32 +++++--- py/stream.h | 4 +- shared-bindings/_bleio/CharacteristicBuffer.c | 4 +- shared-bindings/busio/UART.c | 4 +- shared-bindings/usb_cdc/Serial.c | 74 +++++++++++++------ shared-bindings/usb_cdc/Serial.h | 3 + shared-module/usb_cdc/Serial.c | 30 ++++++++ shared-module/usb_cdc/Serial.h | 4 +- shared-module/usb_cdc/__init__.c | 4 +- 9 files changed, 119 insertions(+), 40 deletions(-) diff --git a/py/stream.c b/py/stream.c index ae702bb1b6..0813c1d7f2 100644 --- a/py/stream.c +++ b/py/stream.c @@ -99,14 +99,22 @@ const mp_stream_p_t *mp_get_stream_raise(mp_obj_t self_in, int flags) { STATIC mp_obj_t stream_read_generic(size_t n_args, const mp_obj_t *args, byte flags) { // What to do if sz < -1? Python docs don't specify this case. - // CPython does a readall, but here we silently let negatives through, - // and they will cause a MemoryError. + // CPython does a readall, let's do the same. mp_int_t sz; - if (n_args == 1 || args[1] == mp_const_none || ((sz = mp_obj_get_int(args[1])) == -1)) { - return stream_readall(args[0]); - } - const mp_stream_p_t *stream_p = mp_get_stream(args[0]); + if (stream_p->pyserial_read_compatibility) { + // Pyserial defaults to sz=1 if not specified. + if (n_args == 1) { + sz = 1; + } else { + // Pyserial treats negative size as 0. + sz = MAX(0, mp_obj_get_int(args[1])); + } + } else { + if (n_args == 1 || args[1] == mp_const_none || (sz = mp_obj_get_int(args[1])) <= -1) { + return stream_readall(args[0]); + } + } #if MICROPY_PY_BUILTINS_STR_UNICODE if (stream_p->is_text) { @@ -284,7 +292,7 @@ STATIC mp_obj_t stream_readinto(size_t n_args, const mp_obj_t *args) { // https://docs.python.org/3/library/socket.html#socket.socket.recv_into mp_uint_t len = bufinfo.len; if (n_args > 2) { - if (mp_get_stream(args[0])->pyserial_compatibility) { + if (mp_get_stream(args[0])->pyserial_readinto_compatibility) { mp_raise_ValueError(translate("length argument not allowed for this type")); } len = mp_obj_get_int(args[2]); @@ -297,7 +305,10 @@ STATIC mp_obj_t stream_readinto(size_t n_args, const mp_obj_t *args) { mp_uint_t out_sz = mp_stream_read_exactly(args[0], bufinfo.buf, len, &error); if (error != 0) { if (mp_is_nonblocking_error(error)) { - return mp_const_none; + // pyserial readinto never returns None, just 0. + return mp_get_stream(args[0])->pyserial_dont_return_none_compatibility + ? MP_OBJ_NEW_SMALL_INT(0) + : mp_const_none; } mp_raise_OSError(error); } else { @@ -323,7 +334,10 @@ STATIC mp_obj_t stream_readall(mp_obj_t self_in) { // If we read nothing, return None, just like read(). // Otherwise, return data read so far. if (total_size == 0) { - return mp_const_none; + // pyserial read() never returns None, just b''. + return stream_p->pyserial_dont_return_none_compatibility + ? mp_const_empty_bytes + : mp_const_none; } break; } diff --git a/py/stream.h b/py/stream.h index be6b23d40d..c05dcfc501 100644 --- a/py/stream.h +++ b/py/stream.h @@ -72,7 +72,9 @@ typedef struct _mp_stream_p_t { mp_uint_t (*write)(mp_obj_t obj, const void *buf, mp_uint_t size, int *errcode); mp_uint_t (*ioctl)(mp_obj_t obj, mp_uint_t request, uintptr_t arg, int *errcode); mp_uint_t is_text : 1; // default is bytes, set this for text stream - bool pyserial_compatibility: 1; // adjust API to match pyserial more closely + bool pyserial_readinto_compatibility: 1; // Disallow size parameter in readinto() + bool pyserial_read_compatibility: 1; // Disallow omitting read(size) size parameter + bool pyserial_dont_return_none_compatibility: 1; // Don't return None for read() or readinto() } mp_stream_p_t; MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_read_obj); diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index 4d6c836c13..333b275ffb 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -231,8 +231,8 @@ STATIC const mp_stream_p_t characteristic_buffer_stream_p = { .write = bleio_characteristic_buffer_write, .ioctl = bleio_characteristic_buffer_ioctl, .is_text = false, - // Match PySerial when possible, such as disallowing optional length argument for .readinto() - .pyserial_compatibility = true, + // Disallow readinto() size parameter. + .pyserial_readinto_compatibility = true, }; diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index bf0b7e721d..f48109fdef 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -415,8 +415,8 @@ STATIC const mp_stream_p_t uart_stream_p = { .write = busio_uart_write, .ioctl = busio_uart_ioctl, .is_text = false, - // Match PySerial when possible, such as disallowing optional length argument for .readinto() - .pyserial_compatibility = true, + // Disallow optional length argument for .readinto() + .pyserial_readinto_compatibility = true, }; const mp_obj_type_t busio_uart_type = { diff --git a/shared-bindings/usb_cdc/Serial.c b/shared-bindings/usb_cdc/Serial.c index 03fb94f313..64f851a48e 100644 --- a/shared-bindings/usb_cdc/Serial.c +++ b/shared-bindings/usb_cdc/Serial.c @@ -41,36 +41,34 @@ //| def __init__(self) -> None: //| """You cannot create an instance of `usb_cdc.Serial`. //| -//| Serial objects are constructed for every corresponding entry in the USB +//| Serial objects are pre-constructed for each CDC device in the USB //| descriptor and added to the ``usb_cdc.ports`` tuple.""" //| ... //| -// These are standard stream methods. Code is in py/stream.c. -// -//| def read(self, nbytes: Optional[int] = None) -> Optional[bytes]: -//| """Read characters. If ``nbytes`` is specified then read at most that many -//| bytes. Otherwise, read everything that arrives until the connection -//| times out. Providing the number of bytes expected is highly recommended -//| because it will be faster. +//| def read(self, size: int = 1) -> bytes: +//| """Read at most ``size`` bytes. If ``size`` exceeds the internal buffer size +//| only the bytes in the buffer will be read. If `timeout` is > 0 or ``None``, +//| and fewer than ``size`` bytes are available, keep waiting until the timeout +//| expires or ``size`` bytes are available. //| //| :return: Data read -//| :rtype: bytes or None""" +//| :rtype: bytes""" //| ... //| -//| def readinto(self, buf: WriteableBuffer, nbytes: Optional[int] = None) -> Optional[bytes]: +//| def readinto(self, buf: WriteableBuffer) -> bytes: //| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most -//| that many bytes. Otherwise, read at most ``len(buf)`` bytes. +//| that many bytes, subject to `timeout`. Otherwise, read at most ``len(buf)`` bytes. //| //| :return: number of bytes read and stored into ``buf`` -//| :rtype: bytes or None""" +//| :rtype: bytes""" //| ... //| -//| def write(self, buf: ReadableBuffer) -> Optional[int]: +//| def write(self, buf: ReadableBuffer) -> int: //| """Write as many bytes as possible from the buffer of bytes. //| //| :return: the number of bytes written -//| :rtype: int or None""" +//| :rtype: int""" //| ... //| //| def flush(self) -> None: @@ -79,7 +77,7 @@ //| // These three methods are used by the shared stream methods. -STATIC mp_uint_t usb_cdc_serial_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, int *errcode) { +STATIC mp_uint_t usb_cdc_serial_read_stream(mp_obj_t self_in, void *buf_in, mp_uint_t size, int *errcode) { usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); byte *buf = buf_in; @@ -91,16 +89,16 @@ STATIC mp_uint_t usb_cdc_serial_read(mp_obj_t self_in, void *buf_in, mp_uint_t s return common_hal_usb_cdc_serial_read(self, buf, size, errcode); } -STATIC mp_uint_t usb_cdc_serial_write(mp_obj_t self_in, const void *buf_in, mp_uint_t size, int *errcode) { +STATIC mp_uint_t usb_cdc_serial_write_stream(mp_obj_t self_in, const void *buf_in, mp_uint_t size, int *errcode) { usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); const byte *buf = buf_in; return common_hal_usb_cdc_serial_write(self, buf, size, errcode); } -STATIC mp_uint_t usb_cdc_serial_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t arg, int *errcode) { +STATIC mp_uint_t usb_cdc_serial_ioctl_stream(mp_obj_t self_in, mp_uint_t request, mp_uint_t arg, int *errcode) { usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); - mp_uint_t ret; + mp_uint_t ret = 0; switch (request) { case MP_IOCTL_POLL: { mp_uint_t flags = arg; @@ -134,7 +132,7 @@ STATIC mp_obj_t usb_cdc_serial_get_connected(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_connected_obj, usb_cdc_serial_get_connected); -const mp_obj_property_t usb_cdc_serial__connected_obj = { +const mp_obj_property_t usb_cdc_serial_connected_obj = { .base.type = &mp_type_property, .proxy = {(mp_obj_t)&usb_cdc_serial_get_connected_obj, (mp_obj_t)&mp_const_none_obj, @@ -195,6 +193,32 @@ STATIC mp_obj_t usb_cdc_serial_reset_output_buffer(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_reset_output_buffer_obj, usb_cdc_serial_reset_output_buffer); +//| timeout: Optional[float] +//| """The initial value of `timeout` is ``None``. If ``None``, wait indefinitely to satisfy +//| the conditions of a read operation. If 0, do not wait. If > 0, wait only ``timeout`` seconds.""" +//| +STATIC mp_obj_t usb_cdc_serial_get_timeout(mp_obj_t self_in) { + usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_float_t timeout = common_hal_usb_cdc_serial_get_timeout(self); + return (timeout < 0.0f) ? mp_const_none : mp_obj_new_float(self->timeout); +} +MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_timeout_obj, usb_cdc_serial_get_timeout); + +STATIC mp_obj_t usb_cdc_serial_set_timeout(mp_obj_t self_in, mp_obj_t timeout_in) { + usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_usb_cdc_serial_set_timeout(self, + timeout_in == mp_const_none ? -1.0f : mp_obj_get_float(timeout_in)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(usb_cdc_serial_set_timeout_obj, usb_cdc_serial_set_timeout); + +const mp_obj_property_t usb_cdc_serial_timeout_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&usb_cdc_serial_get_timeout_obj, + (mp_obj_t)&usb_cdc_serial_set_timeout_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + STATIC const mp_rom_map_elem_t usb_cdc_serial_locals_dict_table[] = { // Standard stream methods. @@ -210,9 +234,10 @@ STATIC const mp_rom_map_elem_t usb_cdc_serial_locals_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_out_waiting), MP_ROM_PTR(&usb_cdc_serial_out_waiting_obj) }, { MP_OBJ_NEW_QSTR(MP_QSTR_reset_input_buffer), MP_ROM_PTR(&usb_cdc_serial_reset_input_buffer_obj) }, { MP_OBJ_NEW_QSTR(MP_QSTR_reset_output_buffer), MP_ROM_PTR(&usb_cdc_serial_reset_output_buffer_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&usb_cdc_serial_timeout_obj) }, // Not in pyserial protocol. - { MP_OBJ_NEW_QSTR(MP_QSTR_connected), MP_ROM_PTR(&usb_cdc_serial_get_connected_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_connected), MP_ROM_PTR(&usb_cdc_serial_connected_obj) }, @@ -221,10 +246,13 @@ STATIC MP_DEFINE_CONST_DICT(usb_cdc_serial_locals_dict, usb_cdc_serial_locals_di STATIC const mp_stream_p_t usb_cdc_serial_stream_p = { MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) - .read = usb_cdc_serial_read, - .write = usb_cdc_serial_write, - .ioctl = usb_cdc_serial_ioctl, + .read = usb_cdc_serial_read_stream, + .write = usb_cdc_serial_write_stream, + .ioctl = usb_cdc_serial_ioctl_stream, .is_text = false, + .pyserial_read_compatibility = true, + .pyserial_readinto_compatibility = true, + .pyserial_dont_return_none_compatibility = true, }; const mp_obj_type_t usb_cdc_serial_type = { diff --git a/shared-bindings/usb_cdc/Serial.h b/shared-bindings/usb_cdc/Serial.h index 6e54b9ad35..149d2c2d84 100644 --- a/shared-bindings/usb_cdc/Serial.h +++ b/shared-bindings/usb_cdc/Serial.h @@ -44,4 +44,7 @@ extern uint32_t common_hal_usb_cdc_serial_flush(usb_cdc_serial_obj_t *self); extern bool common_hal_usb_cdc_serial_get_connected(usb_cdc_serial_obj_t *self); +extern mp_float_t common_hal_usb_cdc_serial_get_timeout(usb_cdc_serial_obj_t *self); +extern void common_hal_usb_cdc_serial_set_timeout(usb_cdc_serial_obj_t *self, mp_float_t timeout); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC_SERIAL_H diff --git a/shared-module/usb_cdc/Serial.c b/shared-module/usb_cdc/Serial.c index bd3972c8d5..f569a19133 100644 --- a/shared-module/usb_cdc/Serial.c +++ b/shared-module/usb_cdc/Serial.c @@ -24,10 +24,32 @@ * THE SOFTWARE. */ +#include "lib/utils/interrupt_char.h" #include "shared-module/usb_cdc/Serial.h" +#include "supervisor/shared/tick.h" + #include "tusb.h" size_t common_hal_usb_cdc_serial_read(usb_cdc_serial_obj_t *self, uint8_t *data, size_t len, int *errcode) { + if (self->timeout < 0.0f) { + while (tud_cdc_n_available(self->idx) < len) { + RUN_BACKGROUND_TASKS; + if (mp_hal_is_interrupted()) { + return 0; + } + } + } else if (self->timeout > 0.0f) { + uint64_t timeout_ms = self->timeout * 1000; + uint64_t start_ticks = supervisor_ticks_ms64(); + while (tud_cdc_n_available(self->idx) < len && + supervisor_ticks_ms64() - start_ticks <= timeout_ms) { + RUN_BACKGROUND_TASKS; + if (mp_hal_is_interrupted()) { + return 0; + } + } + } + // Timeout of 0.0f falls through to here with no waiting or unnecessary calculation. return tud_cdc_n_read(self->idx, data, len); } @@ -61,3 +83,11 @@ uint32_t common_hal_usb_cdc_serial_flush(usb_cdc_serial_obj_t *self) { bool common_hal_usb_cdc_serial_get_connected(usb_cdc_serial_obj_t *self) { return tud_cdc_n_connected(self->idx); } + +mp_float_t common_hal_usb_cdc_serial_get_timeout(usb_cdc_serial_obj_t *self) { + return self->timeout; +} + +void common_hal_usb_cdc_serial_set_timeout(usb_cdc_serial_obj_t *self, mp_float_t timeout) { + self->timeout = timeout; +} diff --git a/shared-module/usb_cdc/Serial.h b/shared-module/usb_cdc/Serial.h index 60a1d1922c..ad4bed1a32 100644 --- a/shared-module/usb_cdc/Serial.h +++ b/shared-module/usb_cdc/Serial.h @@ -31,8 +31,8 @@ typedef struct { mp_obj_base_t base; - // Which CDC device? - uint8_t idx; + mp_float_t timeout; // if negative, wait forever. + uint8_t idx; // which CDC device? } usb_cdc_serial_obj_t; #endif // SHARED_MODULE_USB_CDC_SERIAL_H diff --git a/shared-module/usb_cdc/__init__.c b/shared-module/usb_cdc/__init__.c index ecb5777b26..9eae188119 100644 --- a/shared-module/usb_cdc/__init__.c +++ b/shared-module/usb_cdc/__init__.c @@ -38,11 +38,13 @@ #error CFG_TUD_CDC must be exactly 2 #endif -static const usb_cdc_serial_obj_t serial_objs[CFG_TUD_CDC] = { +static usb_cdc_serial_obj_t serial_objs[CFG_TUD_CDC] = { { .base.type = &usb_cdc_serial_type, + .timeout = -1.0f, .idx = 0, }, { .base.type = &usb_cdc_serial_type, + .timeout = -1.0f, .idx = 1, } }; From 696d212dc70e01b9b51b7a19f344338ed387d69b Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 18 Feb 2021 18:42:00 +0530 Subject: [PATCH 014/159] fix nvm rewrite --- ports/raspberrypi/common-hal/nvm/ByteArray.c | 41 +++++++++++++++----- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/ports/raspberrypi/common-hal/nvm/ByteArray.c b/ports/raspberrypi/common-hal/nvm/ByteArray.c index 6dbd213517..5d1147425a 100644 --- a/ports/raspberrypi/common-hal/nvm/ByteArray.c +++ b/ports/raspberrypi/common-hal/nvm/ByteArray.c @@ -32,26 +32,54 @@ #include "src/rp2_common/hardware_flash/include/hardware/flash.h" extern uint32_t __flash_binary_start; +static const uint32_t flash_binary_start = (uint32_t) &__flash_binary_start; + +#define RMV_OFFSET(addr) addr - flash_binary_start uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t* self) { return self->len; } static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_t* bytes) { - // Write a whole page to flash, buffering it first and then erasing and rewriting - // it since we can only clear a whole page at a time. + // Write a whole page to flash, buffering it first and then erasing and rewriting it + // since we can only write a whole page at a time. if (offset == 0 && len == FLASH_PAGE_SIZE) { - flash_range_program(page_addr - (uint32_t) &__flash_binary_start, bytes, FLASH_PAGE_SIZE); + flash_range_program(RMV_OFFSET(page_addr), bytes, FLASH_PAGE_SIZE); } else { uint8_t buffer[FLASH_PAGE_SIZE]; memcpy(buffer, (uint8_t*) page_addr, FLASH_PAGE_SIZE); memcpy(buffer + offset, bytes, len); - flash_range_program(page_addr - (uint32_t) &__flash_binary_start, buffer, FLASH_PAGE_SIZE); + flash_range_program(RMV_OFFSET(page_addr), buffer, FLASH_PAGE_SIZE); } } +static void write_sector(uint32_t address, uint32_t len, uint8_t* bytes) { + // Write a whole sector to flash, buffering it first and then erasing and rewriting it + // since we can only erase a whole sector at a time. + uint8_t buffer[FLASH_SECTOR_SIZE]; + memcpy(buffer, (uint8_t*) CIRCUITPY_INTERNAL_NVM_START_ADDR, FLASH_SECTOR_SIZE); + memcpy(buffer + address, bytes, len); + flash_range_erase(RMV_OFFSET(CIRCUITPY_INTERNAL_NVM_START_ADDR), FLASH_SECTOR_SIZE); + flash_range_program(RMV_OFFSET(CIRCUITPY_INTERNAL_NVM_START_ADDR), buffer, FLASH_SECTOR_SIZE); +} + +void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t* self, + uint32_t start_index, uint32_t len, uint8_t* values) { + memcpy(values, self->start_address + start_index, len); +} + bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t* self, uint32_t start_index, uint8_t* values, uint32_t len) { + uint8_t values_in[len]; + common_hal_nvm_bytearray_get_bytes(self, start_index, len, values_in); + + for (uint32_t i = 0; i < len; i++) { + if (values_in[i] != UINT8_MAX) { + write_sector(start_index, len, values); + return true; + } + } + uint32_t address = (uint32_t) self->start_address + start_index; uint32_t offset = address % FLASH_PAGE_SIZE; uint32_t page_addr = address - offset; @@ -67,8 +95,3 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t* self, return true; } - -void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t* self, - uint32_t start_index, uint32_t len, uint8_t* values) { - memcpy(values, self->start_address + start_index, len); -} From 84d3c0d02f5bcea1774974d748a26c9a3c0d70ad Mon Sep 17 00:00:00 2001 From: Luca De Filippo Date: Wed, 17 Feb 2021 15:03:13 +0000 Subject: [PATCH 015/159] Translated using Weblate (Italian) Currently translated at 45.0% (432 of 960 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/it/ --- locale/it_IT.po | 181 +++++++++++++++++++++++++----------------------- 1 file changed, 95 insertions(+), 86 deletions(-) diff --git a/locale/it_IT.po b/locale/it_IT.po index d85f17b05c..ab0cc7193f 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -7,25 +7,31 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2018-10-02 16:27+0200\n" -"Last-Translator: Enrico Paganin \n" +"PO-Revision-Date: 2021-02-18 15:50+0000\n" +"Last-Translator: Luca De Filippo \n" "Language-Team: \n" "Language: it_IT\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.5\n" #: main.c msgid "" "\n" "Code done running.\n" msgstr "" +"\n" +"Caricamento codice pronto.\n" #: main.c msgid "" "\n" "Code stopped by auto-reload.\n" msgstr "" +"\n" +"Codice fermato dall'auto-ricarica.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -33,6 +39,9 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Per favore, segnala il problema con il contenuto del tuo CIRCUITPY a\n" +"https://github.com/adafruit/circuitpython/issues\n" #: py/obj.c msgid " File \"%q\"" @@ -44,7 +53,7 @@ msgstr " File \"%q\", riga %d" #: py/builtinhelp.c msgid " is of type %q\n" -msgstr "" +msgstr " è di tipo %q\n" #: main.c msgid " output:\n" @@ -60,10 +69,11 @@ msgstr "%%c necessita di int o char" msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +"%d pin indirizzo, %d pin rgb e %d tessere indicano l'altezza di %d, non %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" -msgstr "" +msgstr "%q fallito: %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -79,15 +89,15 @@ msgstr "indice %q fuori intervallo" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "%q gli indici devono essere interi, non %q" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "lista %q deve essere una lista" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q deve essere >= 0" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -100,20 +110,19 @@ msgstr "slice del buffer devono essere della stessa lunghezza" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "%q deve essere una tupla di lunghezza 2" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q oltre il limite" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" -msgstr "" +msgstr "%q pin non valido" #: shared-bindings/fontio/BuiltinFont.c -#, fuzzy msgid "%q should be an int" -msgstr "y dovrebbe essere un int" +msgstr "%q dovrebbe essere un int" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -122,7 +131,7 @@ msgstr "%q() prende %d argomenti posizionali ma ne sono stati forniti %d" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c #, c-format msgid "%s error 0x%x" -msgstr "" +msgstr "%s errore 0x%x" #: py/argcheck.c msgid "'%q' argument required" @@ -130,93 +139,93 @@ msgstr "'%q' argomento richiesto" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "" +msgstr "L'oggetto '%q' non può assegnare l'attributo '%q'" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "" +msgstr "L'oggetto '%q' non supporta '%q'" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "" +msgstr "L'oggetto '%q' non supporta l'assegnazione dell'elemento" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "" +msgstr "L'oggetto '%q' non supporta la rimozione dell'elemento" #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "" +msgstr "L'oggetto '%q' non ha attributi '%q'" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "" +msgstr "L'oggetto '%q' non è un iteratore" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "" +msgstr "L'oggetto '%q' non è richiamabile" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "" +msgstr "L'oggetto '%q' non è iterabile" #: py/obj.c msgid "'%q' object is not subscriptable" -msgstr "" +msgstr "l'oggetto '%q' non è riscrivibile" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" -msgstr "'%s' aspetta una etichetta" +msgstr "'%s' richiede una etichetta" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a register" -msgstr "'%s' aspetta un registro" +msgstr "'%s' richiede un registro" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' expects a special register" -msgstr "'%s' aspetta un registro" +msgstr "'%s' richiede un registro speciale" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' expects an FPU register" -msgstr "'%s' aspetta un registro" +msgstr "'%s' richiede un registro FPU" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' expects an address of the form [a, b]" -msgstr "'%s' aspetta un registro" +msgstr "'%s' richiede un indirizzo dal modulo [a, b]" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects an integer" -msgstr "'%s' aspetta un intero" +msgstr "'%s' richiede un valore intero" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' expects at most r%d" -msgstr "'%s' aspetta un registro" +msgstr "'%s' richiede almeno r%d" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' expects {r0, r1, ...}" -msgstr "'%s' aspetta un registro" +msgstr "'%s' richiede {r0, r1, ...}" #: py/emitinlinextensa.c -#, fuzzy, c-format +#, c-format msgid "'%s' integer %d is not within range %d..%d" -msgstr "intero '%s' non è nell'intervallo %d..%d" +msgstr "Valore intero '%s' %d non è nell'intervallo %d..%d" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' integer 0x%x does not fit in mask 0x%x" -msgstr "intero '%s' non è nell'intervallo %d..%d" +msgstr "Valore intero '%s' 0x%x non rientra nella maschera 0x%x" #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" -msgstr "aligniamento '=' non è permesso per il specificatore formato string" +msgstr "Allineamento'=' non è permesso per lo specificatore formato stringa" #: shared-module/struct/__init__.c msgid "'S' and 'O' are not supported format types" @@ -233,22 +242,23 @@ msgstr "'await' al di fuori della funzione" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" msgstr "" +"'await', 'async for' o 'async with' fuori della funzione sincronizzazione" #: py/compile.c msgid "'break' outside loop" -msgstr "'break' al di fuori del ciclo" +msgstr "'break' fuori del ciclo" #: py/compile.c msgid "'continue' outside loop" -msgstr "'continue' al di fuori del ciclo" +msgstr "'continue' fuori del ciclo" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "L'oggetto 'coroutine' non è un iteratore" #: py/compile.c msgid "'data' requires at least 2 arguments" -msgstr "'data' richiede almeno 2 argomento" +msgstr "'data' richiede almeno 2 argomenti" #: py/compile.c msgid "'data' requires integer arguments" @@ -264,7 +274,7 @@ msgstr "'return' al di fuori della funzione" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "'yield from' è nella funzione sincronizzazione" #: py/compile.c msgid "'yield' outside function" @@ -288,29 +298,29 @@ msgstr "pow() con tre argmomenti non supportata" #: shared-module/msgpack/__init__.c msgid "64 bit types" -msgstr "" +msgstr "Tipo 64 bits" #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" -msgstr "Un canale di interrupt hardware è già in uso" +msgstr "Un canale di interruzione hardware è già in uso" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "ADC2 sta usando il WiFi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c -#, fuzzy, c-format +#, c-format msgid "Address must be %d bytes long" -msgstr "la palette deve essere lunga 32 byte" +msgstr "L'indirizzo deve essere lungo %d byte" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" -msgstr "" +msgstr "Tipo di indirizzo fuori intervallo" #: ports/esp32s2/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "Tutte le periferiche CAN sono in uso" #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -320,13 +330,13 @@ msgstr "Tutte le periferiche I2C sono in uso" #: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" -msgstr "" +msgstr "Tutte le unità PCNT sono in uso" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Tutte le RX FIFO sono in uso" #: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -343,7 +353,7 @@ msgstr "Tutti i canali eventi utilizati" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" -msgstr "" +msgstr "Tutte le state machines sono in uso" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" @@ -376,16 +386,16 @@ msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" -msgstr "" +msgstr "Già in possesso di tutti i listener abbinati" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "Già in funzione" #: ports/esp32s2/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "" +msgstr "Già in ricerca di collegamenti WiFi" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -417,24 +427,24 @@ msgstr "Array deve avere mezzoparole (typo 'H')" #: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "Valori di Array dovrebbero essere bytes singulari" +msgstr "I valori dell'Array dovrebbero essere bytes singoli." #: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Almeno %d %q devono essere specificati (non %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Provo ad allocare %d blocchi" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." -msgstr "" +msgstr "Provo l'allocazione quando MicroPython VM non è attivo." #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "Autenticazione Fallita" #: main.c msgid "Auto-reload is off.\n" @@ -455,7 +465,7 @@ msgstr "" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "" +msgstr "Al di sotto del frame rate minimo" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -465,15 +475,15 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" +msgstr "La profondità dei bit deve essere inclusiva da 1 a 6, non %d" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "La profondità di bit deve essere multipla di 8." +msgstr "La profondità di bit deve essere un multiplo di 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "Sia RX che TX richiedono il controllo del flow" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -483,21 +493,21 @@ msgstr "Entrambi i pin devono supportare gli interrupt hardware" #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "La luminosità deve essere tra 0-1.0" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" -msgstr "La luminosità deve essere compreso tra 0 e 255" +msgstr "La luminosità deve essere compresa tra 0 e 255" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" -msgstr "Illiminazione non è regolabile" +msgstr "Luminosità non è regolabile" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "Buffer + offset troppo piccolo %d %d %d" #: shared-module/usb_hid/Device.c #, c-format @@ -507,26 +517,26 @@ msgstr "Buffer di lunghezza non valida. Dovrebbe essere di %d bytes." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "Buffer non è un array di bites." #: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "Buffer troppo piccolo" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "Lunghezza Buffer %d troppo grande. Deve essere meno di %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "La lunghezza del buffer deve essere un multiplo di 512" #: ports/stm/common-hal/sdioio/SDCard.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "" +msgstr "Il buffer deve essere un multiplo di 512 bytes" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -534,40 +544,39 @@ msgstr "Il buffer deve essere lungo almeno 1" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "Buffer troppo grande ed impossibile allocare" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Buffer troppo piccolo di %d bytes" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c -#, fuzzy, c-format +#, c-format msgid "Bus pin %d is already in use" -msgstr "DAC già in uso" +msgstr "Bus pin %d è già in uso" #: shared-bindings/_bleio/UUID.c -#, fuzzy msgid "Byte buffer must be 16 bytes." -msgstr "i buffer devono essere della stessa lunghezza" +msgstr "I buffer byte devono essere di almeno 16 bytes." #: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." -msgstr "I byte devono essere compresi tra 0 e 255" +msgstr "I byte devono essere compresi tra 0 e 255." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "I blocchi CBC devono essere multipli di 16 bytes" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "CRC or checksum was invalid" -msgstr "" +msgstr "CRC o controllo totale è risultato non valido" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" +msgstr "Chiama super().__init__() prima di accedere ad un oggetto nativo." #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." From 5c37b73c6df1f7954a727401b17e7a1d31064d77 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 18 Feb 2021 11:09:32 -0500 Subject: [PATCH 016/159] fix typo to fix nrf builds --- ports/nrf/common-hal/supervisor/Runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/common-hal/supervisor/Runtime.c b/ports/nrf/common-hal/supervisor/Runtime.c index def609cda0..a24e86cdf0 100755 --- a/ports/nrf/common-hal/supervisor/Runtime.c +++ b/ports/nrf/common-hal/supervisor/Runtime.c @@ -32,6 +32,6 @@ bool common_hal_supervisor_runtime_get_serial_connected(void) { return (bool) serial_connected(); } -bool common_hal_get_supervisor_runtime_serial_bytes_available(void) { +bool common_hal_supervisor_runtime_get_serial_bytes_available(void) { return (bool) serial_bytes_available(); } From 9cf7d73c6c71df1e43d11d4f2f604a76f59365a8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 16 Feb 2021 18:37:11 -0600 Subject: [PATCH 017/159] core: add bit_transpose function .. this version can only handle exactly 8 bits "across". The restriction may be relaxed in a future revision. --- locale/circuitpython.pot | 8 +++ ports/raspberrypi/mpconfigport.mk | 1 + py/circuitpy_defns.mk | 5 ++ py/circuitpy_mpconfig.h | 9 +++ py/circuitpy_mpconfig.mk | 3 + shared-bindings/_bit_transpose/__init__.c | 87 +++++++++++++++++++++++ shared-bindings/_bit_transpose/__init__.h | 32 +++++++++ shared-module/_bit_transpose/__init__.c | 83 +++++++++++++++++++++ shared-module/_bit_transpose/__init__.h | 27 +++++++ 9 files changed, 255 insertions(+) create mode 100644 shared-bindings/_bit_transpose/__init__.c create mode 100644 shared-bindings/_bit_transpose/__init__.h create mode 100644 shared-module/_bit_transpose/__init__.c create mode 100644 shared-module/_bit_transpose/__init__.h diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index e936dd1f83..11335fd325 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1092,6 +1092,10 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "" +#: shared-bindings/_bit_transpose/__init__.c +msgid "Input buffer must be a multiple of 8 bytes" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -1659,6 +1663,10 @@ msgstr "" msgid "Out of sockets" msgstr "" +#: shared-bindings/_bit_transpose/__init__.c +msgid "Output buffer must be at least as big as input buffer" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" diff --git a/ports/raspberrypi/mpconfigport.mk b/ports/raspberrypi/mpconfigport.mk index dac7231dac..6bd617f370 100644 --- a/ports/raspberrypi/mpconfigport.mk +++ b/ports/raspberrypi/mpconfigport.mk @@ -24,6 +24,7 @@ CIRCUITPY_NEOPIXEL_WRITE = 0 endif CIRCUITPY_FULL_BUILD = 1 +CIRCUITPY_BIT_TRANSPOSE = 1 CIRCUITPY_PWMIO = 1 # Things that need to be implemented. diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index f907bf7ae6..e04031e5a6 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -132,6 +132,10 @@ endif ifeq ($(CIRCUITPY_AUDIOMP3),1) SRC_PATTERNS += audiomp3/% endif +ifeq ($(CIRCUITPY_BIT_TRANSPOSE),1) +$(info BIT_TRANSPOSE enabled) +SRC_PATTERNS += _bit_transpose/% +endif ifeq ($(CIRCUITPY_BITBANGIO),1) SRC_PATTERNS += bitbangio/% endif @@ -440,6 +444,7 @@ SRC_BINDINGS_ENUMS += \ util.c SRC_SHARED_MODULE_ALL = \ + _bit_transpose/__init__.c \ _bleio/Address.c \ _bleio/Attribute.c \ _bleio/ScanEntry.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index ee23c71569..be95eabe2e 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -299,6 +299,14 @@ extern const struct _mp_obj_module_t audiopwmio_module; #define BINASCII_MODULE #endif +#if CIRCUITPY_BIT_TRANSPOSE +extern const struct _mp_obj_module_t bit_transpose_module; +#define BIT_TRANSPOSE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__bit_transpose),(mp_obj_t)&bit_transpose_module }, +#else +#define BIT_TRANSPOSE_MODULE +#endif + + #if CIRCUITPY_BITBANGIO #define BITBANGIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_bitbangio), (mp_obj_t)&bitbangio_module }, extern const struct _mp_obj_module_t bitbangio_module; @@ -819,6 +827,7 @@ extern const struct _mp_obj_module_t msgpack_module; AUDIOMP3_MODULE \ AUDIOPWMIO_MODULE \ BINASCII_MODULE \ + BIT_TRANSPOSE_MODULE \ BITBANGIO_MODULE \ BLEIO_MODULE \ BOARD_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index d9c7c0d331..f06e99b57c 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -89,6 +89,9 @@ CFLAGS += -DCIRCUITPY_AUDIOMP3=$(CIRCUITPY_AUDIOMP3) CIRCUITPY_BINASCII ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BINASCII=$(CIRCUITPY_BINASCII) +CIRCUITPY_BIT_TRANSPOSE ?= 0 +CFLAGS += -DCIRCUITPY_BIT_TRANSPOSE=$(CIRCUITPY_BIT_TRANSPOSE) + CIRCUITPY_BITBANGIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO) diff --git a/shared-bindings/_bit_transpose/__init__.c b/shared-bindings/_bit_transpose/__init__.c new file mode 100644 index 0000000000..38f66eb778 --- /dev/null +++ b/shared-bindings/_bit_transpose/__init__.c @@ -0,0 +1,87 @@ +/* + * This file is part of the Circuit Python project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Roy Hooper + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/_bit_transpose/__init__.h" + +//| """A fast bit transposition function for parallel NeoPixel strips +//| +//| When driving multiple NeoPixel strips from a shift register, the bits +//| must be re-ordered in a specific way. This module offers a low-level +//| routine for performing the transformation.""" +//| + +//| def bit_transpose(input: _typing.ReadableBuffer, *, output: Optional[_typing.WritableBuffer]=None): +//| """Convert a sequence of 8*N pixel values into a single stream of bytes suitable for sending via a parallel conversion method (PioPixl8) +//| +//| Returns the output buffer if specified (which must be big enough to hold the result), otherwise a freshly allocated buffer.""" +//| ... +//| +STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_input, ARG_output }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_input, MP_ARG_OBJ | MP_ARG_REQUIRED, {} }, + { MP_QSTR_output, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = mp_const_none } }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_buffer_info_t input_bufinfo; + mp_buffer_info_t output_bufinfo; + + mp_get_buffer_raise(args[ARG_input].u_obj, &input_bufinfo, MP_BUFFER_READ); + int n = input_bufinfo.len; + if (n % 8 != 0) { + mp_raise_ValueError(translate("Input buffer must be a multiple of 8 bytes")); + } + mp_obj_t output = args[ARG_output].u_obj; + + if (!output || output == mp_const_none) { + output = mp_obj_new_bytearray_of_zeros(n); + } + mp_get_buffer_raise(output, &output_bufinfo, MP_BUFFER_WRITE); + int m = output_bufinfo.len; + if (m < n) { + mp_raise_ValueError(translate("Output buffer must be at least as big as input buffer")); + } + common_hal_bit_transpose_bit_transpose(output_bufinfo.buf, input_bufinfo.buf, input_bufinfo.len); + return output; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bit_transpose_bit_transpose_obj, 1, bit_transpose); + +STATIC const mp_rom_map_elem_t bit_transpose_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__bit_transpose) }, + { MP_ROM_QSTR(MP_QSTR_bit_transpose), MP_ROM_PTR(&bit_transpose_bit_transpose_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(bit_transpose_module_globals, bit_transpose_module_globals_table); + +const mp_obj_module_t bit_transpose_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&bit_transpose_module_globals, +}; diff --git a/shared-bindings/_bit_transpose/__init__.h b/shared-bindings/_bit_transpose/__init__.h new file mode 100644 index 0000000000..75d57d980c --- /dev/null +++ b/shared-bindings/_bit_transpose/__init__.h @@ -0,0 +1,32 @@ +/* + * This file is part of the Circuit Python project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Jeff Epler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include +#include + +void common_hal_bit_transpose_bit_transpose(uint8_t *result, const uint8_t *src, size_t n); diff --git a/shared-module/_bit_transpose/__init__.c b/shared-module/_bit_transpose/__init__.c new file mode 100644 index 0000000000..e30f989b93 --- /dev/null +++ b/shared-module/_bit_transpose/__init__.c @@ -0,0 +1,83 @@ +/* + * This file is part of the Circuit Python project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Jeff Epler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/_bit_transpose/__init__.h" + +#include +#include +#include + +// adapted from "Hacker's Delight" - Figure 7-2 Transposing an 8x8-bit matrix +// basic idea is: +// > First, treat the 8x8-bit matrix as 16 2x2-bit matrices, and transpose each +// > of the 16 2x2-bit matrices. Second, treat the matrix as four 2x2 submatrices +// > whose elements are 2x2-bit matrices and transpose each of the four 2x2 +// > submatrices. Finally, treat the matrix as a 2x2 matrix whose elements are +// > 4x4-bit matrices, and transpose the 2x2 matrix. These transformations are +// > illustrated below. +// We want a different definition of bit/byte order, deal with strides differently, etc. +// so the code is heavily re-worked compared to the original. +static void transpose8(uint32_t *result, const uint8_t *src, int src_stride) { + uint32_t x, y, t; + + y = *src; src += src_stride; + y |= (*src << 8); src += src_stride; + y |= (*src << 16); src += src_stride; + y |= (*src << 24); src += src_stride; + x = *src; src += src_stride; + x |= (*src << 8); src += src_stride; + x |= (*src << 16); src += src_stride; + x |= (*src << 24); src += src_stride; + + t = (x ^ (x >> 7)) & 0x00AA00AA; x = x ^ t ^ (t << 7); + t = (y ^ (y >> 7)) & 0x00AA00AA; y = y ^ t ^ (t << 7); + + t = (x ^ (x >>14)) & 0x0000CCCC; x = x ^ t ^ (t <<14); + t = (y ^ (y >>14)) & 0x0000CCCC; y = y ^ t ^ (t <<14); + + t = (x & 0xF0F0F0F0) | ((y >> 4) & 0x0F0F0F0F); + y = ((x << 4) & 0xF0F0F0F0) | (y & 0x0F0F0F0F); + x = t; + +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + x = __builtin_bswap32(x); + y = __builtin_bswap32(y); +#endif + result[0] = x; + result[1] = y; +} + +static void bit_transpose(uint32_t *result, const uint8_t *src, size_t src_stride, size_t n) { + for(size_t i=0; i Date: Thu, 18 Feb 2021 11:33:13 -0600 Subject: [PATCH 018/159] bit_transpose: Support from 2 to 7 strands, not just 8 --- locale/circuitpython.pot | 10 ++- shared-bindings/_bit_transpose/__init__.c | 26 +++++--- shared-bindings/_bit_transpose/__init__.h | 2 +- shared-module/_bit_transpose/__init__.c | 78 +++++++++++++++++++++-- 4 files changed, 99 insertions(+), 17 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 11335fd325..eef1b07f29 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1093,7 +1093,8 @@ msgid "Initialization failed due to lack of memory" msgstr "" #: shared-bindings/_bit_transpose/__init__.c -msgid "Input buffer must be a multiple of 8 bytes" +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -1664,7 +1665,8 @@ msgid "Out of sockets" msgstr "" #: shared-bindings/_bit_transpose/__init__.c -msgid "Output buffer must be at least as big as input buffer" +#, c-format +msgid "Output buffer must be at least %d bytes" msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -3473,6 +3475,10 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: shared-bindings/_bit_transpose/__init__.c +msgid "num_strands must be from 2 to 8 (inclusive)" +msgstr "" + #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" diff --git a/shared-bindings/_bit_transpose/__init__.c b/shared-bindings/_bit_transpose/__init__.c index 38f66eb778..979dff1452 100644 --- a/shared-bindings/_bit_transpose/__init__.c +++ b/shared-bindings/_bit_transpose/__init__.c @@ -43,9 +43,10 @@ //| ... //| STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_input, ARG_output }; + enum { ARG_input, ARG_num_strands, ARG_output }; static const mp_arg_t allowed_args[] = { { MP_QSTR_input, MP_ARG_OBJ | MP_ARG_REQUIRED, {} }, + { MP_QSTR_num_strands, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 8 } }, { MP_QSTR_output, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = mp_const_none } }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -55,21 +56,28 @@ STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t mp_buffer_info_t output_bufinfo; mp_get_buffer_raise(args[ARG_input].u_obj, &input_bufinfo, MP_BUFFER_READ); - int n = input_bufinfo.len; - if (n % 8 != 0) { - mp_raise_ValueError(translate("Input buffer must be a multiple of 8 bytes")); + int num_strands = args[ARG_num_strands].u_int; + + if (num_strands < 2 || num_strands > 8) { + mp_raise_ValueError(translate("num_strands must be from 2 to 8 (inclusive)")); + } + + int inlen = input_bufinfo.len; + if (inlen % num_strands != 0) { + mp_raise_ValueError_varg(translate("Input buffer length (%d) must be a multiple of the strand count (%d)"), inlen, num_strands); } mp_obj_t output = args[ARG_output].u_obj; + int outlen = 8 * (inlen / num_strands); if (!output || output == mp_const_none) { - output = mp_obj_new_bytearray_of_zeros(n); + output = mp_obj_new_bytearray_of_zeros(outlen); } mp_get_buffer_raise(output, &output_bufinfo, MP_BUFFER_WRITE); - int m = output_bufinfo.len; - if (m < n) { - mp_raise_ValueError(translate("Output buffer must be at least as big as input buffer")); + int avail = output_bufinfo.len; + if (avail < outlen) { + mp_raise_ValueError_varg(translate("Output buffer must be at least %d bytes"), outlen); } - common_hal_bit_transpose_bit_transpose(output_bufinfo.buf, input_bufinfo.buf, input_bufinfo.len); + common_hal_bit_transpose_bit_transpose(output_bufinfo.buf, input_bufinfo.buf, inlen, num_strands); return output; } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bit_transpose_bit_transpose_obj, 1, bit_transpose); diff --git a/shared-bindings/_bit_transpose/__init__.h b/shared-bindings/_bit_transpose/__init__.h index 75d57d980c..5fcf11d45b 100644 --- a/shared-bindings/_bit_transpose/__init__.h +++ b/shared-bindings/_bit_transpose/__init__.h @@ -29,4 +29,4 @@ #include #include -void common_hal_bit_transpose_bit_transpose(uint8_t *result, const uint8_t *src, size_t n); +void common_hal_bit_transpose_bit_transpose(uint8_t *result, const uint8_t *src, size_t inlen, size_t num_strands); diff --git a/shared-module/_bit_transpose/__init__.c b/shared-module/_bit_transpose/__init__.c index e30f989b93..517d2d840e 100644 --- a/shared-module/_bit_transpose/__init__.c +++ b/shared-module/_bit_transpose/__init__.c @@ -30,6 +30,12 @@ #include #include +#ifdef __GNUC__ +#define FALLTHROUGH __attribute__((fallthrough)) +#else +#define FALLTHROUGH ((void)0) /* FALLTHROUGH */ +#endif + // adapted from "Hacker's Delight" - Figure 7-2 Transposing an 8x8-bit matrix // basic idea is: // > First, treat the 8x8-bit matrix as 16 2x2-bit matrices, and transpose each @@ -40,7 +46,57 @@ // > illustrated below. // We want a different definition of bit/byte order, deal with strides differently, etc. // so the code is heavily re-worked compared to the original. -static void transpose8(uint32_t *result, const uint8_t *src, int src_stride) { +static void transpose_var(uint32_t *result, const uint8_t *src, int src_stride, int num_strands) { + uint32_t x = 0, y = 0, t; + + src += (num_strands-1) * src_stride; + + switch(num_strands) { + case 7: + x |= *src << 16; + src -= src_stride; + FALLTHROUGH; + case 6: + x |= *src << 8; + src -= src_stride; + FALLTHROUGH; + case 5: + x |= *src; + src -= src_stride; + FALLTHROUGH; + case 4: + y |= *src << 24; + src -= src_stride; + FALLTHROUGH; + case 3: + y |= *src << 16; + src -= src_stride; + FALLTHROUGH; + case 2: + y |= *src << 8; + src -= src_stride; + y |= *src; + } + + t = (x ^ (x >> 7)) & 0x00AA00AA; x = x ^ t ^ (t << 7); + t = (y ^ (y >> 7)) & 0x00AA00AA; y = y ^ t ^ (t << 7); + + t = (x ^ (x >>14)) & 0x0000CCCC; x = x ^ t ^ (t <<14); + t = (y ^ (y >>14)) & 0x0000CCCC; y = y ^ t ^ (t <<14); + + t = (x & 0xF0F0F0F0) | ((y >> 4) & 0x0F0F0F0F); + y = ((x << 4) & 0xF0F0F0F0) | (y & 0x0F0F0F0F); + x = t; + +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + x = __builtin_bswap32(x); + y = __builtin_bswap32(y); +#endif + result[0] = x; + result[1] = y; +} + +static void transpose_8(uint32_t *result, const uint8_t *src, int src_stride) { uint32_t x, y, t; y = *src; src += src_stride; @@ -70,14 +126,26 @@ static void transpose8(uint32_t *result, const uint8_t *src, int src_stride) { result[1] = y; } -static void bit_transpose(uint32_t *result, const uint8_t *src, size_t src_stride, size_t n) { +static void bit_transpose_8(uint32_t *result, const uint8_t *src, size_t src_stride, size_t n) { for(size_t i=0; i Date: Thu, 18 Feb 2021 11:43:43 -0600 Subject: [PATCH 019/159] _bit_transpose: fix docs --- shared-bindings/_bit_transpose/__init__.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shared-bindings/_bit_transpose/__init__.c b/shared-bindings/_bit_transpose/__init__.c index 979dff1452..0b9d31fbef 100644 --- a/shared-bindings/_bit_transpose/__init__.c +++ b/shared-bindings/_bit_transpose/__init__.c @@ -36,8 +36,13 @@ //| routine for performing the transformation.""" //| -//| def bit_transpose(input: _typing.ReadableBuffer, *, output: Optional[_typing.WritableBuffer]=None): -//| """Convert a sequence of 8*N pixel values into a single stream of bytes suitable for sending via a parallel conversion method (PioPixl8) +//| def bit_transpose(input: _typing.ReadableBuffer, *, num_strands:int = 8, output: Optional[_typing.WriteableBuffer]=None) -> WriteableBuffer: +//| """Convert a sequence of pixel values into a single stream of bytes suitable for sending via a parallel conversion method (PioPixl8) +//| +//| The number of bytes in the input buffer must be a multiple of the number of strands. +//| +//| If specified output buffer must be big enough for the output, ``len(input) * 8 // num_strands``. To get a properly sized buffer, +//| you can also pass in ``output=None`` once, then re-use the return value in future calls. //| //| Returns the output buffer if specified (which must be big enough to hold the result), otherwise a freshly allocated buffer.""" //| ... From e344c6d684dedab09b8b373af02af58382b69428 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 18 Feb 2021 14:24:58 -0500 Subject: [PATCH 020/159] fix some builds --- ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk | 1 + ports/cxd56/mpconfigport.mk | 2 +- ports/nrf/boards/pca10100/mpconfigboard.mk | 1 + ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk | 2 -- supervisor/shared/usb/usb.c | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk index 9460d0009b..aef38661be 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk @@ -11,3 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index ab39e3bb72..33a993ad95 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -8,7 +8,7 @@ USB_MSC_EP_NUM_OUT = 5 USB_MSC_EP_NUM_IN = 4 # Number of USB endpoint pairs. -USB_NUM_EP = 5 +USB_NUM_EP = 6 MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index c8cba2877c..fbb9987c24 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -29,6 +29,7 @@ CIRCUITPY_BUSDEVICE = 0 MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 # Override optimization to keep binary small OPTIMIZATION_FLAGS = -Os diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk index c99eb1a008..28874f9c6c 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -16,5 +16,3 @@ MCU_PACKAGE = LQFP144 LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F412_fs.ld - -CIRCUITPY_USB_HID = 1 diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index af48f46737..5b020b8a00 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -219,7 +219,7 @@ bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_requ return true; } -#endif CIRCUITPY_USB_VENDOR +#endif // CIRCUITPY_USB_VENDOR #if MICROPY_KBD_EXCEPTION From e77981f86e53eb5a985e89e03cc984e5b318da37 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 18 Feb 2021 16:26:14 -0500 Subject: [PATCH 021/159] Fix file ends for CI --- tests/circuitpython-manual/socketpool/client/host-server.py | 2 +- tests/circuitpython-manual/socketpool/client/readme.md | 2 +- tests/circuitpython-manual/socketpool/server/host-client.py | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/circuitpython-manual/socketpool/client/host-server.py b/tests/circuitpython-manual/socketpool/client/host-server.py index 4a5faf2a00..fd7ceb7f14 100644 --- a/tests/circuitpython-manual/socketpool/client/host-server.py +++ b/tests/circuitpython-manual/socketpool/client/host-server.py @@ -24,4 +24,4 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: data = conn.recv(128) print("got: " + str(data)) conn.sendall(data) - print("sent: " + str(data)) \ No newline at end of file + print("sent: " + str(data)) diff --git a/tests/circuitpython-manual/socketpool/client/readme.md b/tests/circuitpython-manual/socketpool/client/readme.md index 1ef0695314..45cdf23c8c 100644 --- a/tests/circuitpython-manual/socketpool/client/readme.md +++ b/tests/circuitpython-manual/socketpool/client/readme.md @@ -43,4 +43,4 @@ Accepting connections Connected by ('192.168.10.128', 64509) got: b'Hello, world' sent: b'Hello, world' -``` \ No newline at end of file +``` diff --git a/tests/circuitpython-manual/socketpool/server/host-client.py b/tests/circuitpython-manual/socketpool/server/host-client.py index b5aacbfa8e..b482755d88 100644 --- a/tests/circuitpython-manual/socketpool/server/host-client.py +++ b/tests/circuitpython-manual/socketpool/server/host-client.py @@ -15,4 +15,3 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: print("Receiving") data = s.recv(1024) print('Received', repr(data)) - From 7fd45678939147da1c3034f212331d1d755ddae6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 18 Feb 2021 15:41:23 -0600 Subject: [PATCH 022/159] bitops: rename from _bit_transpose, describe the algorithm --- locale/circuitpython.pot | 12 +-- ports/raspberrypi/mpconfigport.mk | 2 +- py/circuitpy_defns.mk | 8 +- py/circuitpy_mpconfig.h | 10 +- py/circuitpy_mpconfig.mk | 4 +- shared-bindings/_bit_transpose/__init__.c | 100 ----------------- shared-bindings/bitops/__init__.c | 101 ++++++++++++++++++ .../{_bit_transpose => bitops}/__init__.h | 2 +- .../{_bit_transpose => bitops}/__init__.c | 4 +- .../{_bit_transpose => bitops}/__init__.h | 0 10 files changed, 122 insertions(+), 121 deletions(-) delete mode 100644 shared-bindings/_bit_transpose/__init__.c create mode 100644 shared-bindings/bitops/__init__.c rename shared-bindings/{_bit_transpose => bitops}/__init__.h (91%) rename shared-module/{_bit_transpose => bitops}/__init__.c (96%) rename shared-module/{_bit_transpose => bitops}/__init__.h (100%) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index eef1b07f29..b1bc1a390c 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1092,7 +1092,7 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "" -#: shared-bindings/_bit_transpose/__init__.c +#: shared-bindings/bitops/__init__.c #, c-format msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" msgstr "" @@ -1664,7 +1664,7 @@ msgstr "" msgid "Out of sockets" msgstr "" -#: shared-bindings/_bit_transpose/__init__.c +#: shared-bindings/bitops/__init__.c #, c-format msgid "Output buffer must be at least %d bytes" msgstr "" @@ -3475,10 +3475,6 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: shared-bindings/_bit_transpose/__init__.c -msgid "num_strands must be from 2 to 8 (inclusive)" -msgstr "" - #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -4115,6 +4111,10 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/bitops/__init__.c +msgid "width must be from 2 to 8 (inclusive)" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" diff --git a/ports/raspberrypi/mpconfigport.mk b/ports/raspberrypi/mpconfigport.mk index 6bd617f370..b93e4dcc7f 100644 --- a/ports/raspberrypi/mpconfigport.mk +++ b/ports/raspberrypi/mpconfigport.mk @@ -24,7 +24,7 @@ CIRCUITPY_NEOPIXEL_WRITE = 0 endif CIRCUITPY_FULL_BUILD = 1 -CIRCUITPY_BIT_TRANSPOSE = 1 +CIRCUITPY_BITOPS = 1 CIRCUITPY_PWMIO = 1 # Things that need to be implemented. diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index e04031e5a6..c1cf863621 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -132,9 +132,9 @@ endif ifeq ($(CIRCUITPY_AUDIOMP3),1) SRC_PATTERNS += audiomp3/% endif -ifeq ($(CIRCUITPY_BIT_TRANSPOSE),1) -$(info BIT_TRANSPOSE enabled) -SRC_PATTERNS += _bit_transpose/% +ifeq ($(CIRCUITPY_BITOPS),1) +$(info BITOPS enabled) +SRC_PATTERNS += bitops/% endif ifeq ($(CIRCUITPY_BITBANGIO),1) SRC_PATTERNS += bitbangio/% @@ -444,7 +444,6 @@ SRC_BINDINGS_ENUMS += \ util.c SRC_SHARED_MODULE_ALL = \ - _bit_transpose/__init__.c \ _bleio/Address.c \ _bleio/Attribute.c \ _bleio/ScanEntry.c \ @@ -471,6 +470,7 @@ SRC_SHARED_MODULE_ALL = \ bitbangio/OneWire.c \ bitbangio/SPI.c \ bitbangio/__init__.c \ + bitops/__init__.c \ board/__init__.c \ adafruit_bus_device/__init__.c \ adafruit_bus_device/I2CDevice.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index be95eabe2e..d72146c426 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -299,11 +299,11 @@ extern const struct _mp_obj_module_t audiopwmio_module; #define BINASCII_MODULE #endif -#if CIRCUITPY_BIT_TRANSPOSE -extern const struct _mp_obj_module_t bit_transpose_module; -#define BIT_TRANSPOSE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__bit_transpose),(mp_obj_t)&bit_transpose_module }, +#if CIRCUITPY_BITOPS +extern const struct _mp_obj_module_t bitops_module; +#define BITOPS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_bitops),(mp_obj_t)&bitops_module }, #else -#define BIT_TRANSPOSE_MODULE +#define BITOPS_MODULE #endif @@ -827,7 +827,7 @@ extern const struct _mp_obj_module_t msgpack_module; AUDIOMP3_MODULE \ AUDIOPWMIO_MODULE \ BINASCII_MODULE \ - BIT_TRANSPOSE_MODULE \ + BITOPS_MODULE \ BITBANGIO_MODULE \ BLEIO_MODULE \ BOARD_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index f06e99b57c..6244ed1366 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -89,8 +89,8 @@ CFLAGS += -DCIRCUITPY_AUDIOMP3=$(CIRCUITPY_AUDIOMP3) CIRCUITPY_BINASCII ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BINASCII=$(CIRCUITPY_BINASCII) -CIRCUITPY_BIT_TRANSPOSE ?= 0 -CFLAGS += -DCIRCUITPY_BIT_TRANSPOSE=$(CIRCUITPY_BIT_TRANSPOSE) +CIRCUITPY_BITOPS ?= 0 +CFLAGS += -DCIRCUITPY_BITOPS=$(CIRCUITPY_BITOPS) CIRCUITPY_BITBANGIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO) diff --git a/shared-bindings/_bit_transpose/__init__.c b/shared-bindings/_bit_transpose/__init__.c deleted file mode 100644 index 0b9d31fbef..0000000000 --- a/shared-bindings/_bit_transpose/__init__.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * This file is part of the Circuit Python project, https://github.com/adafruit/circuitpython - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Roy Hooper - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/obj.h" -#include "py/runtime.h" - -#include "shared-bindings/_bit_transpose/__init__.h" - -//| """A fast bit transposition function for parallel NeoPixel strips -//| -//| When driving multiple NeoPixel strips from a shift register, the bits -//| must be re-ordered in a specific way. This module offers a low-level -//| routine for performing the transformation.""" -//| - -//| def bit_transpose(input: _typing.ReadableBuffer, *, num_strands:int = 8, output: Optional[_typing.WriteableBuffer]=None) -> WriteableBuffer: -//| """Convert a sequence of pixel values into a single stream of bytes suitable for sending via a parallel conversion method (PioPixl8) -//| -//| The number of bytes in the input buffer must be a multiple of the number of strands. -//| -//| If specified output buffer must be big enough for the output, ``len(input) * 8 // num_strands``. To get a properly sized buffer, -//| you can also pass in ``output=None`` once, then re-use the return value in future calls. -//| -//| Returns the output buffer if specified (which must be big enough to hold the result), otherwise a freshly allocated buffer.""" -//| ... -//| -STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_input, ARG_num_strands, ARG_output }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_input, MP_ARG_OBJ | MP_ARG_REQUIRED, {} }, - { MP_QSTR_num_strands, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 8 } }, - { MP_QSTR_output, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = mp_const_none } }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - mp_buffer_info_t input_bufinfo; - mp_buffer_info_t output_bufinfo; - - mp_get_buffer_raise(args[ARG_input].u_obj, &input_bufinfo, MP_BUFFER_READ); - int num_strands = args[ARG_num_strands].u_int; - - if (num_strands < 2 || num_strands > 8) { - mp_raise_ValueError(translate("num_strands must be from 2 to 8 (inclusive)")); - } - - int inlen = input_bufinfo.len; - if (inlen % num_strands != 0) { - mp_raise_ValueError_varg(translate("Input buffer length (%d) must be a multiple of the strand count (%d)"), inlen, num_strands); - } - mp_obj_t output = args[ARG_output].u_obj; - - int outlen = 8 * (inlen / num_strands); - if (!output || output == mp_const_none) { - output = mp_obj_new_bytearray_of_zeros(outlen); - } - mp_get_buffer_raise(output, &output_bufinfo, MP_BUFFER_WRITE); - int avail = output_bufinfo.len; - if (avail < outlen) { - mp_raise_ValueError_varg(translate("Output buffer must be at least %d bytes"), outlen); - } - common_hal_bit_transpose_bit_transpose(output_bufinfo.buf, input_bufinfo.buf, inlen, num_strands); - return output; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bit_transpose_bit_transpose_obj, 1, bit_transpose); - -STATIC const mp_rom_map_elem_t bit_transpose_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__bit_transpose) }, - { MP_ROM_QSTR(MP_QSTR_bit_transpose), MP_ROM_PTR(&bit_transpose_bit_transpose_obj) }, -}; - -STATIC MP_DEFINE_CONST_DICT(bit_transpose_module_globals, bit_transpose_module_globals_table); - -const mp_obj_module_t bit_transpose_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&bit_transpose_module_globals, -}; diff --git a/shared-bindings/bitops/__init__.c b/shared-bindings/bitops/__init__.c new file mode 100644 index 0000000000..fc57842590 --- /dev/null +++ b/shared-bindings/bitops/__init__.c @@ -0,0 +1,101 @@ +/* + * This file is part of the Circuit Python project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Roy Hooper + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/bitops/__init__.h" + +//| """Routines for low-level manipulation of binary data""" +//| +//| + +//| def bit_transpose(input: _typing.ReadableBuffer, *, width:int = 8, output: Optional[_typing.WriteableBuffer]=None) -> WriteableBuffer: +//| """"Transpose" a buffer by assembling each output byte with bits taken from each of ``width`` different input bytes. +//| +//| This can be useful to convert a sequence of pixel values into a single +//| stream of bytes suitable for sending via a parallel conversion method. +//| +//| The number of bytes in the input buffer must be a multiple of the width, +//| and the width can be any value from 2 to 8. If the width is fewer than 8, +//| then the remaining (less significant) bits of the output are set to zero. +//| +//| Let ``stride = len(input)//width``. Then the first byte is made out of the +//| most significant bits of ``[input[0], input[stride], input[2*stride], ...]``. +//| The second byte is made out of the second bits, and so on until the 8th output +//| byte which is made of the first bits of ``input[1], input[1+stride, +//| input[2*stride], ...]``. +//| +//| The required output buffer size is ``len(input) * 8 // width``. +//| +//| Returns the output buffer.""" +//| ... + +STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_input, ARG_width, ARG_output }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_input, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_output, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_width, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 8 } }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + int width = args[ARG_width].u_int; + if (width < 2 || width > 8) { + mp_raise_ValueError(translate("width must be from 2 to 8 (inclusive)")); + } + + mp_buffer_info_t input_bufinfo; + mp_get_buffer_raise(args[ARG_input].u_obj, &input_bufinfo, MP_BUFFER_READ); + int inlen = input_bufinfo.len; + if (inlen % width != 0) { + mp_raise_ValueError_varg(translate("Input buffer length (%d) must be a multiple of the strand count (%d)"), inlen, width); + } + + mp_buffer_info_t output_bufinfo; + mp_get_buffer_raise(args[ARG_output].u_obj, &output_bufinfo, MP_BUFFER_WRITE); + int avail = output_bufinfo.len; + int outlen = 8 * (inlen / width); + if (avail < outlen) { + mp_raise_ValueError_varg(translate("Output buffer must be at least %d bytes"), outlen); + } + common_hal_bitops_bit_transpose(output_bufinfo.buf, input_bufinfo.buf, inlen, width); + return args[ARG_output].u_obj; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitops_bit_transpose_obj, 1, bit_transpose); + +STATIC const mp_rom_map_elem_t bitops_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_bitops) }, + { MP_ROM_QSTR(MP_QSTR_bit_transpose), MP_ROM_PTR(&bitops_bit_transpose_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(bitops_module_globals, bitops_module_globals_table); + +const mp_obj_module_t bitops_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&bitops_module_globals, +}; diff --git a/shared-bindings/_bit_transpose/__init__.h b/shared-bindings/bitops/__init__.h similarity index 91% rename from shared-bindings/_bit_transpose/__init__.h rename to shared-bindings/bitops/__init__.h index 5fcf11d45b..6654cac5e9 100644 --- a/shared-bindings/_bit_transpose/__init__.h +++ b/shared-bindings/bitops/__init__.h @@ -29,4 +29,4 @@ #include #include -void common_hal_bit_transpose_bit_transpose(uint8_t *result, const uint8_t *src, size_t inlen, size_t num_strands); +void common_hal_bitops_bit_transpose(uint8_t *result, const uint8_t *src, size_t inlen, size_t num_strands); diff --git a/shared-module/_bit_transpose/__init__.c b/shared-module/bitops/__init__.c similarity index 96% rename from shared-module/_bit_transpose/__init__.c rename to shared-module/bitops/__init__.c index 517d2d840e..66898e5bee 100644 --- a/shared-module/_bit_transpose/__init__.c +++ b/shared-module/bitops/__init__.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-bindings/_bit_transpose/__init__.h" +#include "shared-bindings/bitops/__init__.h" #include #include @@ -142,7 +142,7 @@ static void bit_transpose_var(uint32_t *result, const uint8_t *src, size_t src_s } } -void common_hal_bit_transpose_bit_transpose(uint8_t *result, const uint8_t *src, size_t inlen, size_t num_strands) { +void common_hal_bitops_bit_transpose(uint8_t *result, const uint8_t *src, size_t inlen, size_t num_strands) { if(num_strands == 8) { bit_transpose_8((uint32_t*)(void*)result, src, inlen/8, inlen/8); } else { diff --git a/shared-module/_bit_transpose/__init__.h b/shared-module/bitops/__init__.h similarity index 100% rename from shared-module/_bit_transpose/__init__.h rename to shared-module/bitops/__init__.h From d56fe7691d262e80254aaab3c6335479fa3f6ccf Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 18 Feb 2021 15:44:51 -0600 Subject: [PATCH 023/159] bitops: doc correction --- shared-bindings/bitops/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/bitops/__init__.c b/shared-bindings/bitops/__init__.c index fc57842590..0ea556fa24 100644 --- a/shared-bindings/bitops/__init__.c +++ b/shared-bindings/bitops/__init__.c @@ -33,7 +33,7 @@ //| //| -//| def bit_transpose(input: _typing.ReadableBuffer, *, width:int = 8, output: Optional[_typing.WriteableBuffer]=None) -> WriteableBuffer: +//| def bit_transpose(input: _typing.ReadableBuffer, output: _typing.WriteableBuffer, width:int = 8) -> WriteableBuffer: //| """"Transpose" a buffer by assembling each output byte with bits taken from each of ``width`` different input bytes. //| //| This can be useful to convert a sequence of pixel values into a single @@ -59,7 +59,7 @@ STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t static const mp_arg_t allowed_args[] = { { MP_QSTR_input, MP_ARG_OBJ | MP_ARG_REQUIRED }, { MP_QSTR_output, MP_ARG_OBJ | MP_ARG_REQUIRED }, - { MP_QSTR_width, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 8 } }, + { MP_QSTR_width, MP_ARG_INT, { .u_int = 8 } }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); From 72e8fb085cc802cac098747f9b8355ee140009c2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 18 Feb 2021 16:01:23 -0600 Subject: [PATCH 024/159] remove debug print during build --- py/circuitpy_defns.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index c1cf863621..47870ede10 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -133,7 +133,6 @@ ifeq ($(CIRCUITPY_AUDIOMP3),1) SRC_PATTERNS += audiomp3/% endif ifeq ($(CIRCUITPY_BITOPS),1) -$(info BITOPS enabled) SRC_PATTERNS += bitops/% endif ifeq ($(CIRCUITPY_BITBANGIO),1) From ffae89b1914272cdb5978a0837991e33732bbe59 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 18 Feb 2021 16:10:57 -0600 Subject: [PATCH 025/159] bitops: fix argument parsing --- shared-bindings/bitops/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/bitops/__init__.c b/shared-bindings/bitops/__init__.c index 0ea556fa24..0d40e53ca8 100644 --- a/shared-bindings/bitops/__init__.c +++ b/shared-bindings/bitops/__init__.c @@ -55,7 +55,7 @@ //| ... STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_input, ARG_width, ARG_output }; + enum { ARG_input, ARG_output, ARG_width }; static const mp_arg_t allowed_args[] = { { MP_QSTR_input, MP_ARG_OBJ | MP_ARG_REQUIRED }, { MP_QSTR_output, MP_ARG_OBJ | MP_ARG_REQUIRED }, @@ -66,7 +66,7 @@ STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t int width = args[ARG_width].u_int; if (width < 2 || width > 8) { - mp_raise_ValueError(translate("width must be from 2 to 8 (inclusive)")); + mp_raise_ValueError_varg(translate("width must be from 2 to 8 (inclusive), not %d"), width); } mp_buffer_info_t input_bufinfo; From 5c758523c0cd967beccc5e84457b154d9c9e071a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 18 Feb 2021 17:19:34 -0600 Subject: [PATCH 026/159] requested changes --- shared-bindings/bitops/__init__.c | 4 ++-- shared-module/bitops/__init__.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/bitops/__init__.c b/shared-bindings/bitops/__init__.c index 0d40e53ca8..3c567b8ed9 100644 --- a/shared-bindings/bitops/__init__.c +++ b/shared-bindings/bitops/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2018 Roy Hooper + * Copyright (c) 2021 Jeff Epler for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -33,7 +33,7 @@ //| //| -//| def bit_transpose(input: _typing.ReadableBuffer, output: _typing.WriteableBuffer, width:int = 8) -> WriteableBuffer: +//| def bit_transpose(input: ReadableBuffer, output: WriteableBuffer, width:int = 8) -> WriteableBuffer: //| """"Transpose" a buffer by assembling each output byte with bits taken from each of ``width`` different input bytes. //| //| This can be useful to convert a sequence of pixel values into a single diff --git a/shared-module/bitops/__init__.c b/shared-module/bitops/__init__.c index 66898e5bee..cf0ac7bd1f 100644 --- a/shared-module/bitops/__init__.c +++ b/shared-module/bitops/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2021 Jeff Epler + * Copyright (c) 2021 Jeff Epler for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal From b854c06a0ca31e97b4c6998ff8ef5b314ebf49e4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 18 Feb 2021 17:23:55 -0600 Subject: [PATCH 027/159] make translate --- locale/circuitpython.pot | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index b1bc1a390c..0a79520b88 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -4112,7 +4112,8 @@ msgid "watchdog timeout must be greater than 0" msgstr "" #: shared-bindings/bitops/__init__.c -msgid "width must be from 2 to 8 (inclusive)" +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c From df1789c2706a79e275ae081981fe299332f38f58 Mon Sep 17 00:00:00 2001 From: Jose David M Date: Fri, 19 Feb 2021 02:03:36 +0000 Subject: [PATCH 028/159] Translated using Weblate (Spanish) Currently translated at 91.4% (878 of 960 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/locale/es.po b/locale/es.po index 789c041038..6117d4431b 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,15 +8,15 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-08 21:21+0000\n" -"Last-Translator: Alvaro Figueroa \n" +"PO-Revision-Date: 2021-02-19 02:29+0000\n" +"Last-Translator: Jose David M \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.5-dev\n" +"X-Generator: Weblate 4.5\n" #: main.c msgid "" @@ -70,6 +70,8 @@ msgstr "%%c requiere int o char" msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +"%d pines de dirección, %d pines rgb y %d tiles indican una altura de %d, y " +"no de %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" @@ -585,10 +587,12 @@ msgstr "" #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" +"Solo puede alertar en un pin low mientras los otros alertan en high viniendo " +"de deep sleep." #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." -msgstr "" +msgstr "Solo puede alerta en dos low pines viniendo de deep sleep." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" @@ -627,7 +631,7 @@ msgstr "No se puede tener ambos canales en el mismo pin" #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." -msgstr "" +msgstr "No puede hacer pull en un pin de entrada sola." #: shared-module/bitbangio/SPI.c msgid "Cannot read without MISO pin." @@ -931,7 +935,7 @@ msgstr "Se esperaba una dirección" #: shared-bindings/alarm/__init__.c msgid "Expected an alarm" -msgstr "" +msgstr "Un objecto alarm era esperado" #: shared-module/_pixelbuf/PixelBuf.c #, c-format @@ -1089,7 +1093,7 @@ msgstr "I2SOut no disponible" #: ports/esp32s2/common-hal/alarm/pin/__init__.c msgid "IOs 0, 2 & 4 do not support internal pullup in sleep" -msgstr "" +msgstr "IOs 0, 2 y 4 no soportan pullup interno durante sleep" #: shared-bindings/aesio/aes.c #, c-format @@ -1110,7 +1114,7 @@ msgstr "Tamaño incorrecto del buffer" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Init program size invalid" -msgstr "" +msgstr "Tamaño del programa Init invalido" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" @@ -1132,22 +1136,22 @@ msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" -msgstr "" +msgstr "La instruccion %d mueve mas bits que la cuenta del pin" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts out more bits than pin count" -msgstr "" +msgstr "La instruccion %d mueve mas bits que la cuenta del pin" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d uses extra pin" -msgstr "" +msgstr "La instrucción %d usa un pin extra" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d waits on input outside of count" -msgstr "" +msgstr "La instrucción %d espera una entrada fuera del conteo" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" @@ -1206,7 +1210,7 @@ msgstr "Frecuencia PWM inválida" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" -msgstr "" +msgstr "Pin inválido" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c @@ -1322,7 +1326,7 @@ msgstr "'security_mode' no válido" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Invalid size" -msgstr "" +msgstr "Tamaño incorrecto" #: ports/esp32s2/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" From e37ec5199cd554e8d6cf197e1d4d96200bf5810c Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Fri, 19 Feb 2021 03:29:16 +0100 Subject: [PATCH 029/159] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 15 +++++++++++++++ locale/cs.po | 15 +++++++++++++++ locale/de_DE.po | 15 +++++++++++++++ locale/el.po | 15 +++++++++++++++ locale/es.po | 15 +++++++++++++++ locale/fil.po | 15 +++++++++++++++ locale/fr.po | 15 +++++++++++++++ locale/hi.po | 15 +++++++++++++++ locale/it_IT.po | 15 +++++++++++++++ locale/ja.po | 15 +++++++++++++++ locale/ko.po | 15 +++++++++++++++ locale/nl.po | 15 +++++++++++++++ locale/pl.po | 15 +++++++++++++++ locale/pt_BR.po | 15 +++++++++++++++ locale/sv.po | 15 +++++++++++++++ locale/zh_Latn_pinyin.po | 15 +++++++++++++++ 16 files changed, 240 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index 5d6ff8e06a..114bbbbec3 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1113,6 +1113,11 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -1686,6 +1691,11 @@ msgstr "" msgid "Out of sockets" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Sampel berlebihan harus kelipatan 8." @@ -4154,6 +4164,11 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index fe95f9da1d..f7efb829e7 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1095,6 +1095,11 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -1662,6 +1667,11 @@ msgstr "" msgid "Out of sockets" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -4104,6 +4114,11 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 88d0f2fa0e..818482b7af 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1113,6 +1113,11 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "Initialisierung aufgrund von Speichermangel fehlgeschlagen" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -1688,6 +1693,11 @@ msgstr "" msgid "Out of sockets" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample muss ein Vielfaches von 8 sein." @@ -4193,6 +4203,11 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" diff --git a/locale/el.po b/locale/el.po index 675d53fbe9..bdf46fc113 100644 --- a/locale/el.po +++ b/locale/el.po @@ -1092,6 +1092,11 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -1659,6 +1664,11 @@ msgstr "" msgid "Out of sockets" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -4101,6 +4111,11 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" diff --git a/locale/es.po b/locale/es.po index 6117d4431b..39b8b91ba1 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1120,6 +1120,11 @@ msgstr "Tamaño del programa Init invalido" msgid "Initialization failed due to lack of memory" msgstr "Inicializacion fallida por falta de memoria" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "La entrada está durando mucho tiempo" @@ -1693,6 +1698,11 @@ msgstr "" msgid "Out of sockets" msgstr "Se acabaron los enchufes" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "El sobremuestreo debe ser un múltiplo de 8." @@ -4185,6 +4195,11 @@ msgstr "watchdog no inicializado" msgid "watchdog timeout must be greater than 0" msgstr "el tiempo de espera del perro guardián debe ser mayor a 0" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "el ancho debe ser mayor que cero" diff --git a/locale/fil.po b/locale/fil.po index a27b0f8e35..7c040d3645 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1107,6 +1107,11 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -1677,6 +1682,11 @@ msgstr "" msgid "Out of sockets" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample ay dapat multiple ng 8." @@ -4154,6 +4164,11 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 36cfb70b13..3b66b2ed7f 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -1129,6 +1129,11 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "Échec d'initialisation par manque de mémoire" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "L'entrée prend trop de temps" @@ -1702,6 +1707,11 @@ msgstr "Hors de mémoire" msgid "Out of sockets" msgstr "Plus de sockets" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Le sur-échantillonage doit être un multiple de 8." @@ -4214,6 +4224,11 @@ msgstr "chien de garde (watchdog) non initialisé" msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout doit être supérieur à 0" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "width doit être plus que zero" diff --git a/locale/hi.po b/locale/hi.po index 4e5c9dc3bd..b51c3bd559 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -1092,6 +1092,11 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -1659,6 +1664,11 @@ msgstr "" msgid "Out of sockets" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -4101,6 +4111,11 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index ab0cc7193f..404746923e 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -1116,6 +1116,11 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -1691,6 +1696,11 @@ msgstr "" msgid "Out of sockets" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "L'oversampling deve essere multiplo di 8." @@ -4171,6 +4181,11 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index b7915197f5..b72ea99c69 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -1105,6 +1105,11 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -1674,6 +1679,11 @@ msgstr "" msgid "Out of sockets" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "オーバーサンプルは8の倍数でなければなりません" @@ -4132,6 +4142,11 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "watchdogのtimeoutは0以上でなければなりません" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 86c1d46109..8e01c5eb84 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -1095,6 +1095,11 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -1662,6 +1667,11 @@ msgstr "" msgid "Out of sockets" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -4105,6 +4115,11 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 3fcb527b64..05ed8a3ada 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -1106,6 +1106,11 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "De initialisatie is mislukt vanwege een gebrek aan geheugen" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "Invoer duurt te lang" @@ -1679,6 +1684,11 @@ msgstr "" msgid "Out of sockets" msgstr "Geen sockets meer beschikbaar" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample moet een meervoud van 8 zijn." @@ -4165,6 +4175,11 @@ msgstr "watchdog niet geïnitialiseerd" msgid "watchdog timeout must be greater than 0" msgstr "watchdog time-out moet groter zijn dan 0" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "breedte moet groter dan nul zijn" diff --git a/locale/pl.po b/locale/pl.po index 7251f8773c..e3c0f3ae94 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1105,6 +1105,11 @@ msgstr "" msgid "Initialization failed due to lack of memory" msgstr "Inicjalizacja nie powiodła się z powodu braku pamięci" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "" @@ -1673,6 +1678,11 @@ msgstr "Brak pamięci" msgid "Out of sockets" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Nadpróbkowanie musi być wielokrotnością 8." @@ -4124,6 +4134,11 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "szerokość musi być większa niż zero" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index f816984531..44e09385bb 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -1124,6 +1124,11 @@ msgstr "O tamanho do programa Init é inválido" msgid "Initialization failed due to lack of memory" msgstr "A inicialização falhou devido à falta de memória" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "A entrada está demorando demais" @@ -1698,6 +1703,11 @@ msgstr "Sem memória" msgid "Out of sockets" msgstr "Sem soquetes" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "A superamostragem deve ser um múltiplo de 8." @@ -4205,6 +4215,11 @@ msgstr "o watchdog não foi inicializado" msgid "watchdog timeout must be greater than 0" msgstr "o tempo limite do watchdog deve ser maior que 0" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "a largura deve ser maior que zero" diff --git a/locale/sv.po b/locale/sv.po index 91dd4d4fbb..b03dc23de9 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -1111,6 +1111,11 @@ msgstr "Storlek på init-program ogiltigt" msgid "Initialization failed due to lack of memory" msgstr "Initieringen misslyckades på grund av minnesbrist" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "Indata tar för lång tid" @@ -1684,6 +1689,11 @@ msgstr "Slut på minne" msgid "Out of sockets" msgstr "Slut på sockets" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Översampling måste vara multipel av 8." @@ -4166,6 +4176,11 @@ msgstr "watchdog är inte initierad" msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout måste vara större än 0" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "width måste vara större än noll" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 91cd796a85..b1f07ae658 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -1110,6 +1110,11 @@ msgstr "Init chéng xù dà xiǎo wú xiào" msgid "Initialization failed due to lack of memory" msgstr "yóu yú nèi cún bù zú, chū shǐ huà shī bài" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" msgstr "Shūrù shíjiānguò zhǎng" @@ -1683,6 +1688,11 @@ msgstr "nèi cún bù zú" msgid "Out of sockets" msgstr "tào jiē zì wài" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Guò cǎiyàng bìxū shì 8 de bèishù." @@ -4159,6 +4169,11 @@ msgstr "wèi chū shǐ huà jiān shì qì" msgid "watchdog timeout must be greater than 0" msgstr "kān mén gǒu chāoshí bìxū dàyú 0" +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "kuāndù bìxū dàyú líng" From b12ccefbe6afd2c8b1743ce7759880ef3b01e9ed Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Fri, 19 Feb 2021 18:36:00 +0530 Subject: [PATCH 030/159] uart implementation for rp2040 --- locale/circuitpython.pot | 15 +- ports/raspberrypi/common-hal/busio/UART.c | 468 +++++++--------------- ports/raspberrypi/common-hal/busio/UART.h | 18 +- shared-bindings/busio/UART.c | 8 +- 4 files changed, 177 insertions(+), 332 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 0a79520b88..bffc3005cb 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -335,6 +335,10 @@ msgstr "" msgid "All UART peripherals are in use" msgstr "" +#: ports/raspberrypi/common-hal/busio/UART.c +msgid "All UART peripherals in use" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" msgstr "" @@ -1277,6 +1281,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "" @@ -1824,6 +1829,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" +#: ports/raspberrypi/common-hal/busio/UART.c +msgid "RS485 is not supported on this board" +msgstr "" + #: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c #: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c #: ports/raspberrypi/common-hal/rtc/RTC.c @@ -2124,10 +2133,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -2455,7 +2460,7 @@ msgid "binary op %q not implemented" msgstr "" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" +msgid "bits must be between 5 and 8" msgstr "" #: shared-bindings/audiomixer/Mixer.c diff --git a/ports/raspberrypi/common-hal/busio/UART.c b/ports/raspberrypi/common-hal/busio/UART.c index f9a75b4996..660a473ae6 100644 --- a/ports/raspberrypi/common-hal/busio/UART.c +++ b/ports/raspberrypi/common-hal/busio/UART.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2021 microDev * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,295 +24,116 @@ * THE SOFTWARE. */ -#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/busio/UART.h" -#include "mpconfigport.h" -#include "lib/utils/interrupt_char.h" -#include "py/gc.h" +#include "py/stream.h" #include "py/mperrno.h" #include "py/runtime.h" -#include "py/stream.h" -#include "supervisor/shared/translate.h" #include "supervisor/shared/tick.h" +#include "lib/utils/interrupt_char.h" -#define UART_DEBUG(...) (void)0 -// #define UART_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) - -// Do-nothing callback needed so that usart_async code will enable rx interrupts. -// See comment below re usart_async_register_callback() -// static void usart_async_rxc_callback(const struct usart_async_descriptor *const descr) { -// // Nothing needs to be done by us. -// } +#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" #define NO_PIN 0xff +#define UART_INST(uart) (((uart) ? uart1 : uart0)) + +#define TX 0 +#define RX 1 +#define CTS 2 +#define RTS 3 + +typedef enum { + STATUS_FREE = 0, + STATUS_IN_USE, + STATUS_NEVER_RESET +} uart_status_t; + +static uart_status_t uart_status[2]; + +void uart_reset(void) { + for (uint8_t num = 0; num < 2; num++) { + if (uart_status[num] == STATUS_IN_USE) { + uart_status[num] = STATUS_FREE; + uart_deinit(UART_INST(num)); + } + } +} + +void never_reset_uart(uint8_t num) { + uart_status[num] = STATUS_NEVER_RESET; +} + +static uint8_t get_free_uart() { + uint8_t num; + for (num = 0; num < 2; num++) { + if (uart_status[num] == STATUS_FREE) { + break; + } + if (num) { + mp_raise_RuntimeError(translate("All UART peripherals in use")); + } + } + return num; +} + +static uint8_t pin_init(const uint8_t uart, const mcu_pin_obj_t * pin, const uint8_t pin_type) { + if (pin == NULL) { + return NO_PIN; + } + if (!(((pin->number & 3) == pin_type) && ((((pin->number + 4) & 8) >> 3) == uart))) { + mp_raise_ValueError(translate("Invalid pins")); + } + gpio_set_function(pin->number, GPIO_FUNC_UART); + return pin->number; +} + void common_hal_busio_uart_construct(busio_uart_obj_t *self, - const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, - const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, - const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, - mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, - bool sigint_enabled) { - mp_raise_NotImplementedError(translate("UART not yet supported")); + const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, + const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, + const mcu_pin_obj_t * rs485_dir, bool rs485_invert, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, + mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, + bool sigint_enabled) { -// Sercom* sercom = NULL; -// uint8_t sercom_index = 255; // Unset index -// uint32_t rx_pinmux = 0; -// uint8_t rx_pad = 255; // Unset pad -// uint32_t tx_pinmux = 0; -// uint8_t tx_pad = 255; // Unset pad + if ((rs485_dir != NULL) || (rs485_invert)) { + mp_raise_NotImplementedError(translate("RS485 is not supported on this board")); + } -// if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { -// mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); -// } + uint8_t uart_id = get_free_uart(); -// if (bits > 8) { -// mp_raise_NotImplementedError(translate("bytes > 8 bits not supported")); -// } + self->tx_pin = pin_init(uart_id, tx, TX); + self->rx_pin = pin_init(uart_id, rx, RX); + self->cts_pin = pin_init(uart_id, cts, CTS); + self->rts_pin = pin_init(uart_id, rts, RTS); -// bool have_tx = tx != NULL; -// bool have_rx = rx != NULL; -// if (!have_tx && !have_rx) { -// mp_raise_ValueError(translate("tx and rx cannot both be None")); -// } + self->uart = UART_INST(uart_id); + self->baudrate = baudrate; + self->timeout_ms = timeout * 1000; -// self->baudrate = baudrate; -// self->character_bits = bits; -// self->timeout_ms = timeout * 1000; - -// // This assignment is only here because the usart_async routines take a *const argument. -// struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - -// for (int i = 0; i < NUM_SERCOMS_PER_PIN; i++) { -// Sercom* potential_sercom = NULL; -// if (have_tx) { -// sercom_index = tx->sercom[i].index; -// if (sercom_index >= SERCOM_INST_NUM) { -// continue; -// } -// potential_sercom = sercom_insts[sercom_index]; -// #ifdef SAMD21 -// if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 || -// !(tx->sercom[i].pad == 0 || -// tx->sercom[i].pad == 2)) { -// continue; -// } -// #endif -// #ifdef SAM_D5X_E5X -// if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 || -// !(tx->sercom[i].pad == 0)) { -// continue; -// } -// #endif -// tx_pinmux = PINMUX(tx->number, (i == 0) ? MUX_C : MUX_D); -// tx_pad = tx->sercom[i].pad; -// if (rx == NULL) { -// sercom = potential_sercom; -// break; -// } -// } -// for (int j = 0; j < NUM_SERCOMS_PER_PIN; j++) { -// if (((!have_tx && rx->sercom[j].index < SERCOM_INST_NUM && -// sercom_insts[rx->sercom[j].index]->USART.CTRLA.bit.ENABLE == 0) || -// sercom_index == rx->sercom[j].index) && -// rx->sercom[j].pad != tx_pad) { -// rx_pinmux = PINMUX(rx->number, (j == 0) ? MUX_C : MUX_D); -// rx_pad = rx->sercom[j].pad; -// sercom = sercom_insts[rx->sercom[j].index]; -// sercom_index = rx->sercom[j].index; -// break; -// } -// } -// if (sercom != NULL) { -// break; -// } -// } -// if (sercom == NULL) { -// mp_raise_ValueError(translate("Invalid pins")); -// } -// if (!have_tx) { -// tx_pad = 0; -// if (rx_pad == 0) { -// tx_pad = 2; -// } -// } -// if (!have_rx) { -// rx_pad = (tx_pad + 1) % 4; -// } - -// // Set up clocks on SERCOM. -// samd_peripherals_sercom_clock_init(sercom, sercom_index); - -// if (rx && receiver_buffer_size > 0) { -// self->buffer_length = receiver_buffer_size; -// // Initially allocate the UART's buffer in the long-lived part of the -// // heap. UARTs are generally long-lived objects, but the "make long- -// // lived" machinery is incapable of moving internal pointers like -// // self->buffer, so do it manually. (However, as long as internal -// // pointers like this are NOT moved, allocating the buffer -// // in the long-lived pool is not strictly necessary) -// self->buffer = (uint8_t *) gc_alloc(self->buffer_length * sizeof(uint8_t), false, true); -// if (self->buffer == NULL) { -// common_hal_busio_uart_deinit(self); -// mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), self->buffer_length * sizeof(uint8_t)); -// } -// } else { -// self->buffer_length = 0; -// self->buffer = NULL; -// } - -// if (usart_async_init(usart_desc_p, sercom, self->buffer, self->buffer_length, NULL) != ERR_NONE) { -// mp_raise_ValueError(translate("Could not initialize UART")); -// } - -// // usart_async_init() sets a number of defaults based on a prototypical SERCOM -// // which don't necessarily match what we need. After calling it, set the values -// // specific to this instantiation of UART. - -// // Set pads computed for this SERCOM. -// // TXPO: -// // 0x0: TX pad 0; no RTS/CTS -// // 0x1: TX pad 2; no RTS/CTS -// // 0x2: TX pad 0; RTS: pad 2, CTS: pad 3 (not used by us right now) -// // So divide by 2 to map pad to value. -// // RXPO: -// // 0x0: RX pad 0 -// // 0x1: RX pad 1 -// // 0x2: RX pad 2 -// // 0x3: RX pad 3 - -// // Doing a group mask and set of the registers saves 60 bytes over setting the bitfields individually. - -// sercom->USART.CTRLA.reg &= ~(SERCOM_USART_CTRLA_TXPO_Msk | -// SERCOM_USART_CTRLA_RXPO_Msk | -// SERCOM_USART_CTRLA_FORM_Msk); -// sercom->USART.CTRLA.reg |= SERCOM_USART_CTRLA_TXPO(tx_pad / 2) | -// SERCOM_USART_CTRLA_RXPO(rx_pad) | -// (parity == BUSIO_UART_PARITY_NONE ? 0 : SERCOM_USART_CTRLA_FORM(1)); - -// // Enable tx and/or rx based on whether the pins were specified. -// // CHSIZE is 0 for 8 bits, 5, 6, 7 for 5, 6, 7 bits. 1 for 9 bits, but we don't support that. -// sercom->USART.CTRLB.reg &= ~(SERCOM_USART_CTRLB_TXEN | -// SERCOM_USART_CTRLB_RXEN | -// SERCOM_USART_CTRLB_PMODE | -// SERCOM_USART_CTRLB_SBMODE | -// SERCOM_USART_CTRLB_CHSIZE_Msk); -// sercom->USART.CTRLB.reg |= (have_tx ? SERCOM_USART_CTRLB_TXEN : 0) | -// (have_rx ? SERCOM_USART_CTRLB_RXEN : 0) | -// (parity == BUSIO_UART_PARITY_ODD ? SERCOM_USART_CTRLB_PMODE : 0) | -// (stop > 1 ? SERCOM_USART_CTRLB_SBMODE : 0) | -// SERCOM_USART_CTRLB_CHSIZE(bits % 8); - -// // Set baud rate -// common_hal_busio_uart_set_baudrate(self, baudrate); - -// // Turn on rx interrupt handling. The UART async driver has its own set of internal callbacks, -// // which are set up by uart_async_init(). These in turn can call user-specified callbacks. -// // In fact, the actual interrupts are not enabled unless we set up a user-specified callback. -// // This is confusing. It's explained in the Atmel START User Guide -> Implementation Description -> -// // Different read function behavior in some asynchronous drivers. As of this writing: -// // http://start.atmel.com/static/help/index.html?GUID-79201A5A-226F-4FBB-B0B8-AB0BE0554836 -// // Look at the ASFv4 code example for async USART. -// usart_async_register_callback(usart_desc_p, USART_ASYNC_RXC_CB, usart_async_rxc_callback); - - -// if (have_tx) { -// gpio_set_pin_direction(tx->number, GPIO_DIRECTION_OUT); -// gpio_set_pin_pull_mode(tx->number, GPIO_PULL_OFF); -// gpio_set_pin_function(tx->number, tx_pinmux); -// self->tx_pin = tx->number; -// claim_pin(tx); -// } else { -// self->tx_pin = NO_PIN; -// } - -// if (have_rx) { -// gpio_set_pin_direction(rx->number, GPIO_DIRECTION_IN); -// gpio_set_pin_pull_mode(rx->number, GPIO_PULL_OFF); -// gpio_set_pin_function(rx->number, rx_pinmux); -// self->rx_pin = rx->number; -// claim_pin(rx); -// } else { -// self->rx_pin = NO_PIN; -// } - -// usart_async_enable(usart_desc_p); + uart_init(self->uart, self->baudrate); + uart_set_fifo_enabled(self->uart, true); + uart_set_format(self->uart, bits, stop, parity); + uart_set_hw_flow(self->uart, (cts != NULL), (rts != NULL)); } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { - return self->rx_pin == NO_PIN && self->tx_pin == NO_PIN; + return self->tx_pin == NO_PIN && self->rx_pin == NO_PIN; } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { if (common_hal_busio_uart_deinited(self)) { return; } - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // usart_async_disable(usart_desc_p); - // usart_async_deinit(usart_desc_p); - reset_pin_number(self->rx_pin); + uart_deinit(self->uart); reset_pin_number(self->tx_pin); - self->rx_pin = NO_PIN; + reset_pin_number(self->rx_pin); + reset_pin_number(self->cts_pin); + reset_pin_number(self->rts_pin); self->tx_pin = NO_PIN; -} - -// Read characters. -size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { - if (self->rx_pin == NO_PIN) { - mp_raise_ValueError(translate("No RX pin")); - } - - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - - if (len == 0) { - // Nothing to read. - return 0; - } - - // struct io_descriptor *io; - // usart_async_get_io_descriptor(usart_desc_p, &io); - - size_t total_read = 0; - // uint64_t start_ticks = supervisor_ticks_ms64(); - - // // Busy-wait until timeout or until we've read enough chars. - // while (supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) { - // // Read as many chars as we can right now, up to len. - // size_t num_read = io_read(io, data, len); - - // // Advance pointer in data buffer, and decrease how many chars left to read. - // data += num_read; - // len -= num_read; - // total_read += num_read; - // if (len == 0) { - // // Don't need to read any more: data buf is full. - // break; - // } - // if (num_read > 0) { - // // Reset the timeout on every character read. - // start_ticks = supervisor_ticks_ms64(); - // } - // RUN_BACKGROUND_TASKS; - // // Allow user to break out of a timeout with a KeyboardInterrupt. - // if (mp_hal_is_interrupted()) { - // break; - // } - // // If we are zero timeout, make sure we don't loop again (in the event - // // we read in under 1ms) - // if (self->timeout_ms == 0) { - // break; - // } - // } - - // if (total_read == 0) { - // *errcode = EAGAIN; - // return MP_STREAM_ERROR; - // } - - return total_read; + self->rx_pin = NO_PIN; + self->cts_pin = NO_PIN; + self->rts_pin = NO_PIN; } // Write characters. @@ -321,49 +142,81 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, mp_raise_ValueError(translate("No TX pin")); } - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - - // struct io_descriptor *io; - // usart_async_get_io_descriptor(usart_desc_p, &io); - - // // Start writing characters. This is non-blocking and will - // // return immediately after setting up the write. - // if (io_write(io, data, len) < 0) { - // *errcode = MP_EAGAIN; - // return MP_STREAM_ERROR; - // } - - // // Busy-wait until all characters transmitted. - // struct usart_async_status async_status; - // while (true) { - // usart_async_get_status(usart_desc_p, &async_status); - // if (async_status.txcnt >= len) { - // break; - // } - // RUN_BACKGROUND_TASKS; - // } + while (len > 0) { + if (uart_is_writable(self->uart)) { + // Write and advance. + uart_get_hw(self->uart)->dr = *data++; + // Decrease how many chars left to write. + len--; + } + RUN_BACKGROUND_TASKS; + } return len; } +// Read characters. +size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { + if (self->rx_pin == NO_PIN) { + mp_raise_ValueError(translate("No RX pin")); + } + + if (len == 0) { + // Nothing to read. + return 0; + } + + size_t total_read = 0; + uint64_t start_ticks = supervisor_ticks_ms64(); + + // Busy-wait until timeout or until we've read enough chars. + while (supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) { + if (uart_is_readable(self->uart)) { + // Read and advance. + *data++ = uart_get_hw(self->uart)->dr; + + // Decrease how many chars left to read. + len--; + total_read++; + + // Reset the timeout on every character read. + start_ticks = supervisor_ticks_ms64(); + } + + RUN_BACKGROUND_TASKS; + + // Allow user to break out of a timeout with a KeyboardInterrupt. + if (mp_hal_is_interrupted()) { + break; + } + + // Don't need to read any more: data buf is full. + if (len == 0) { + break; + } + + // If we are zero timeout, make sure we don't loop again (in the event + // we read in under 1ms) + if (self->timeout_ms == 0) { + break; + } + } + + if (total_read == 0) { + *errcode = EAGAIN; + return MP_STREAM_ERROR; + } + + return total_read; +} + uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self) { return self->baudrate; } void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrate) { - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // usart_async_set_baud_rate(usart_desc_p, - // // Samples and ARITHMETIC vs FRACTIONAL must correspond to USART_SAMPR in - // // hpl_sercom_config.h. - // _usart_async_calculate_baud_rate(baudrate, // e.g. 9600 baud - // PROTOTYPE_SERCOM_USART_ASYNC_CLOCK_FREQUENCY, - // 16, // samples - // USART_BAUDRATE_ASYNCH_ARITHMETIC, - // 0 // fraction - not used for ARITHMETIC - // )); self->baudrate = baudrate; + uart_set_baudrate(self->uart, baudrate); } mp_float_t common_hal_busio_uart_get_timeout(busio_uart_obj_t *self) { @@ -375,30 +228,15 @@ void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeou } uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // struct usart_async_status async_status; - // usart_async_get_status(usart_desc_p, &async_status); - // return async_status.rxcnt; - return 0; + return uart_is_readable(self->uart); } -void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // usart_async_flush_rx_buffer(usart_desc_p); - -} +void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) {} // True if there are no characters still to be written. bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { if (self->tx_pin == NO_PIN) { return false; } - return false; - // // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // struct usart_async_status async_status; - // usart_async_get_status(usart_desc_p, &async_status); - // return !(async_status.flags & USART_ASYNC_STATUS_BUSY); + return uart_is_writable(self->uart); } diff --git a/ports/raspberrypi/common-hal/busio/UART.h b/ports/raspberrypi/common-hal/busio/UART.h index 43ed9bee01..03613daeb7 100644 --- a/ports/raspberrypi/common-hal/busio/UART.h +++ b/ports/raspberrypi/common-hal/busio/UART.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2021 microDev * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,21 +27,23 @@ #ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_BUSIO_UART_H #define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_BUSIO_UART_H +#include "py/obj.h" #include "common-hal/microcontroller/Pin.h" -#include "py/obj.h" +#include "src/rp2_common/hardware_uart/include/hardware/uart.h" typedef struct { mp_obj_base_t base; - // struct usart_async_descriptor usart_desc; - uint8_t rx_pin; uint8_t tx_pin; - uint8_t character_bits; - bool rx_error; + uint8_t rx_pin; + uint8_t cts_pin; + uint8_t rts_pin; uint32_t baudrate; uint32_t timeout_ms; - uint32_t buffer_length; - uint8_t* buffer; + uart_inst_t * uart; } busio_uart_obj_t; +extern void uart_reset(void); +extern void never_reset_uart(uint8_t num); + #endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_BUSIO_UART_H diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index bf0b7e721d..151081d313 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -55,7 +55,7 @@ //| :param ~microcontroller.Pin rs485_dir: the output pin for rs485 direction setting, or ``None`` if rs485 not in use. //| :param bool rs485_invert: rs485_dir pin active high when set. Active low otherwise. //| :param int baudrate: the transmit and receive speed. -//| :param int bits: the number of bits per byte, 7, 8 or 9. +//| :param int bits: the number of bits per byte, 5 to 8. //| :param Parity parity: the parity used for error checking. //| :param int stop: the number of stop bits, 1 or 2. //| :param float timeout: the timeout in seconds to wait for the first character and between subsequent characters when reading. Raises ``ValueError`` if timeout >100 seconds. @@ -110,10 +110,10 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co mp_raise_ValueError(translate("tx and rx cannot both be None")); } - uint8_t bits = args[ARG_bits].u_int; - if (bits < 7 || bits > 9) { - mp_raise_ValueError(translate("bits must be 7, 8 or 9")); + if (args[ARG_bits].u_int < 5 || args[ARG_bits].u_int > 8) { + mp_raise_ValueError(translate("bits must be between 5 and 8")); } + uint8_t bits = args[ARG_bits].u_int; busio_uart_parity_t parity = BUSIO_UART_PARITY_NONE; if (args[ARG_parity].u_obj == &busio_uart_parity_even_obj) { From f50e7c71f8e845851eee77d182391a9cc7c9ad8b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 19 Feb 2021 10:48:00 -0600 Subject: [PATCH 031/159] docs: ignore the idf_tools folder --- conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conf.py b/conf.py index 0a163e7d3c..0454ff5ec5 100644 --- a/conf.py +++ b/conf.py @@ -178,6 +178,7 @@ exclude_patterns = ["**/build*", "ports/cxd56/spresense-exported-sdk", "ports/esp32s2/certificates", "ports/esp32s2/esp-idf", + "ports/esp32s2/.idf_tools", "ports/esp32s2/peripherals", "ports/litex/hw", "ports/minimal", From 312bbdaa6c8fd29074e8a567738c73d77122543d Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Fri, 19 Feb 2021 18:27:23 +0000 Subject: [PATCH 032/159] Added board names to build.yml --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69dcaf46d1..810e3c1539 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -281,6 +281,9 @@ jobs: - "pewpew10" - "pewpew_m4" - "picoplanet" + - "pimoroni_keybow2040" + - "pimoroni_picosystem" + - "pimoroni_tiny2040" - "pirkey_m0" - "pitaya_go" - "pyb_nano_v2" From db102ab1ad5a20e9c24673fc6c15a9a154d442fb Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Fri, 19 Feb 2021 18:29:57 +0000 Subject: [PATCH 033/159] Create pimoroni_tiny2040 --- ports/raspberrypi/boards/pimoroni_tiny2040 | 1 + 1 file changed, 1 insertion(+) create mode 100644 ports/raspberrypi/boards/pimoroni_tiny2040 diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040 b/ports/raspberrypi/boards/pimoroni_tiny2040 new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_tiny2040 @@ -0,0 +1 @@ + From ee5a48fece37c55a849d709a21b8acff3feab9ea Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Fri, 19 Feb 2021 18:30:29 +0000 Subject: [PATCH 034/159] Delete pimoroni_tiny2040 --- ports/raspberrypi/boards/pimoroni_tiny2040 | 1 - 1 file changed, 1 deletion(-) delete mode 100644 ports/raspberrypi/boards/pimoroni_tiny2040 diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040 b/ports/raspberrypi/boards/pimoroni_tiny2040 deleted file mode 100644 index 8b13789179..0000000000 --- a/ports/raspberrypi/boards/pimoroni_tiny2040 +++ /dev/null @@ -1 +0,0 @@ - From 9d4442e298f4e86fb0686d7986ba627231dd591b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 19 Feb 2021 14:15:31 -0500 Subject: [PATCH 035/159] handle reads/writes larger than buffers; add .write_timeout --- shared-bindings/usb_cdc/Serial.c | 30 +++++++++++- shared-bindings/usb_cdc/Serial.h | 3 ++ shared-module/usb_cdc/Serial.c | 84 ++++++++++++++++++++++++++------ shared-module/usb_cdc/Serial.h | 5 +- shared-module/usb_cdc/__init__.c | 2 + 5 files changed, 106 insertions(+), 18 deletions(-) diff --git a/shared-bindings/usb_cdc/Serial.c b/shared-bindings/usb_cdc/Serial.c index 64f851a48e..c813dce5b3 100644 --- a/shared-bindings/usb_cdc/Serial.c +++ b/shared-bindings/usb_cdc/Serial.c @@ -56,7 +56,7 @@ //| :rtype: bytes""" //| ... //| -//| def readinto(self, buf: WriteableBuffer) -> bytes: +//| def readinto(self, buf: WriteableBuffer) -> int: //| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most //| that many bytes, subject to `timeout`. Otherwise, read at most ``len(buf)`` bytes. //| @@ -219,6 +219,33 @@ const mp_obj_property_t usb_cdc_serial_timeout_obj = { (mp_obj_t)&mp_const_none_obj}, }; +//| write_timeout: Optional[float] +//| """The initial value of `write_timeout` is ``None``. If ``None``, wait indefinitely to finish +//| writing all the bytes passed to ``write()``.If 0, do not wait. +//| If > 0, wait only ``write_timeout`` seconds.""" +//| +STATIC mp_obj_t usb_cdc_serial_get_write_timeout(mp_obj_t self_in) { + usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_float_t write_timeout = common_hal_usb_cdc_serial_get_write_timeout(self); + return (write_timeout < 0.0f) ? mp_const_none : mp_obj_new_float(self->write_timeout); +} +MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_write_timeout_obj, usb_cdc_serial_get_write_timeout); + +STATIC mp_obj_t usb_cdc_serial_set_write_timeout(mp_obj_t self_in, mp_obj_t write_timeout_in) { + usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_usb_cdc_serial_set_write_timeout(self, + write_timeout_in == mp_const_none ? -1.0f : mp_obj_get_float(write_timeout_in)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(usb_cdc_serial_set_write_timeout_obj, usb_cdc_serial_set_write_timeout); + +const mp_obj_property_t usb_cdc_serial_write_timeout_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&usb_cdc_serial_get_write_timeout_obj, + (mp_obj_t)&usb_cdc_serial_set_write_timeout_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + STATIC const mp_rom_map_elem_t usb_cdc_serial_locals_dict_table[] = { // Standard stream methods. @@ -235,6 +262,7 @@ STATIC const mp_rom_map_elem_t usb_cdc_serial_locals_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_reset_input_buffer), MP_ROM_PTR(&usb_cdc_serial_reset_input_buffer_obj) }, { MP_OBJ_NEW_QSTR(MP_QSTR_reset_output_buffer), MP_ROM_PTR(&usb_cdc_serial_reset_output_buffer_obj) }, { MP_OBJ_NEW_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&usb_cdc_serial_timeout_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_write_timeout), MP_ROM_PTR(&usb_cdc_serial_write_timeout_obj) }, // Not in pyserial protocol. { MP_OBJ_NEW_QSTR(MP_QSTR_connected), MP_ROM_PTR(&usb_cdc_serial_connected_obj) }, diff --git a/shared-bindings/usb_cdc/Serial.h b/shared-bindings/usb_cdc/Serial.h index 149d2c2d84..cdf5c3a914 100644 --- a/shared-bindings/usb_cdc/Serial.h +++ b/shared-bindings/usb_cdc/Serial.h @@ -47,4 +47,7 @@ extern bool common_hal_usb_cdc_serial_get_connected(usb_cdc_serial_obj_t *self); extern mp_float_t common_hal_usb_cdc_serial_get_timeout(usb_cdc_serial_obj_t *self); extern void common_hal_usb_cdc_serial_set_timeout(usb_cdc_serial_obj_t *self, mp_float_t timeout); +extern mp_float_t common_hal_usb_cdc_serial_get_write_timeout(usb_cdc_serial_obj_t *self); +extern void common_hal_usb_cdc_serial_set_write_timeout(usb_cdc_serial_obj_t *self, mp_float_t write_timeout); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC_SERIAL_H diff --git a/shared-module/usb_cdc/Serial.c b/shared-module/usb_cdc/Serial.c index f569a19133..6037fddcc5 100644 --- a/shared-module/usb_cdc/Serial.c +++ b/shared-module/usb_cdc/Serial.c @@ -31,32 +31,78 @@ #include "tusb.h" size_t common_hal_usb_cdc_serial_read(usb_cdc_serial_obj_t *self, uint8_t *data, size_t len, int *errcode) { - if (self->timeout < 0.0f) { - while (tud_cdc_n_available(self->idx) < len) { - RUN_BACKGROUND_TASKS; - if (mp_hal_is_interrupted()) { - return 0; - } - } - } else if (self->timeout > 0.0f) { - uint64_t timeout_ms = self->timeout * 1000; + + const bool wait_forever = self->timeout < 0.0f; + const bool wait_for_timeout = self->timeout > 0.0f; + + // Read up to len bytes immediately. + // The number of bytes read will not be larger than what is already in the TinyUSB FIFO. + uint32_t total_num_read = tud_cdc_n_read(self->idx, data, len); + + if (wait_forever || wait_for_timeout) { + // Read more if we have time. + uint64_t timeout_ms = self->timeout * 1000; // Junk value if timeout < 0. uint64_t start_ticks = supervisor_ticks_ms64(); - while (tud_cdc_n_available(self->idx) < len && - supervisor_ticks_ms64() - start_ticks <= timeout_ms) { + + uint32_t num_read = 0; + while (total_num_read < len && + (wait_forever || supervisor_ticks_ms64() - start_ticks <= timeout_ms)) { + + // Wait for a bit, and check for ctrl-C. RUN_BACKGROUND_TASKS; if (mp_hal_is_interrupted()) { return 0; } + + // Advance buffer pointer and reduce number of bytes that need to be read. + len -= num_read; + data += num_read; + + // Try to read another batch of bytes. + num_read = tud_cdc_n_read(self->idx, data, len); + total_num_read += num_read; } } - // Timeout of 0.0f falls through to here with no waiting or unnecessary calculation. - return tud_cdc_n_read(self->idx, data, len); + + return total_num_read; } size_t common_hal_usb_cdc_serial_write(usb_cdc_serial_obj_t *self, const uint8_t *data, size_t len, int *errcode) { - uint32_t num_written = tud_cdc_n_write(self->idx, data, len); + const bool wait_forever = self->write_timeout < 0.0f; + const bool wait_for_timeout = self->write_timeout > 0.0f; + + // Write as many bytes as possible immediately. + // The number of bytes written at once will not be larger than what can fit in the TinyUSB FIFO. + uint32_t total_num_written = tud_cdc_n_write(self->idx, data, len); tud_cdc_n_write_flush(self->idx); - return num_written; + + if (wait_forever || wait_for_timeout) { + // Write more if we have time. + uint64_t timeout_ms = self->write_timeout * 1000; // Junk value if write_timeout < 0. + uint64_t start_ticks = supervisor_ticks_ms64(); + + uint32_t num_written = 0; + while (total_num_written < len && + (wait_forever || supervisor_ticks_ms64() - start_ticks <= timeout_ms)) { + + // Wait for a bit, and check for ctrl-C. + RUN_BACKGROUND_TASKS; + if (mp_hal_is_interrupted()) { + return 0; + } + + // Advance buffer pointer and reduce number of bytes that need to be written. + len -= num_written; + data += num_written; + + // Try to write another batch of bytes. + num_written = tud_cdc_n_write(self->idx, data, len); + tud_cdc_n_write_flush(self->idx); + total_num_written += num_written; + } + } + + return total_num_written; } uint32_t common_hal_usb_cdc_serial_get_in_waiting(usb_cdc_serial_obj_t *self) { @@ -91,3 +137,11 @@ mp_float_t common_hal_usb_cdc_serial_get_timeout(usb_cdc_serial_obj_t *self) { void common_hal_usb_cdc_serial_set_timeout(usb_cdc_serial_obj_t *self, mp_float_t timeout) { self->timeout = timeout; } + +mp_float_t common_hal_usb_cdc_serial_get_write_timeout(usb_cdc_serial_obj_t *self) { + return self->write_timeout; +} + +void common_hal_usb_cdc_serial_set_write_timeout(usb_cdc_serial_obj_t *self, mp_float_t write_timeout) { + self->write_timeout = write_timeout; +} diff --git a/shared-module/usb_cdc/Serial.h b/shared-module/usb_cdc/Serial.h index ad4bed1a32..ddf78eefa6 100644 --- a/shared-module/usb_cdc/Serial.h +++ b/shared-module/usb_cdc/Serial.h @@ -31,8 +31,9 @@ typedef struct { mp_obj_base_t base; - mp_float_t timeout; // if negative, wait forever. - uint8_t idx; // which CDC device? + mp_float_t timeout; // if negative, wait forever. + mp_float_t write_timeout; // if negative, wait forever. + uint8_t idx; // which CDC device? } usb_cdc_serial_obj_t; #endif // SHARED_MODULE_USB_CDC_SERIAL_H diff --git a/shared-module/usb_cdc/__init__.c b/shared-module/usb_cdc/__init__.c index 9eae188119..fe05cb1075 100644 --- a/shared-module/usb_cdc/__init__.c +++ b/shared-module/usb_cdc/__init__.c @@ -41,10 +41,12 @@ static usb_cdc_serial_obj_t serial_objs[CFG_TUD_CDC] = { { .base.type = &usb_cdc_serial_type, .timeout = -1.0f, + .write_timeout = -1.0f, .idx = 0, }, { .base.type = &usb_cdc_serial_type, .timeout = -1.0f, + .write_timeout = -1.0f, .idx = 1, } }; From 076a7b71617b0ac4ef35fb6f8d15ddf06f838b4b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 19 Feb 2021 15:30:27 -0500 Subject: [PATCH 036/159] CIRCUITPY_BITOPS merge error --- py/circuitpy_mpconfig.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index f379bce309..9d8e53ea7f 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -95,6 +95,9 @@ CFLAGS += -DCIRCUITPY_BITBANG_APA102=$(CIRCUITPY_BITBANG_APA102) CIRCUITPY_BITBANGIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO) +CIRCUITPY_BITOPS ?= 0 +CFLAGS += -DCIRCUITPY_BITOPS=$(CIRCUITPY_BITOPS) + # _bleio can be supported on most any board via HCI CIRCUITPY_BLEIO_HCI ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BLEIO_HCI=$(CIRCUITPY_BLEIO_HCI) From 985e02093690d835ef5adf8d253e1f0405d86538 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 19 Feb 2021 17:39:32 -0500 Subject: [PATCH 037/159] shrink simmel build --- ports/nrf/boards/simmel/mpconfigboard.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 6bc05a7f08..52743d340f 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -3,8 +3,6 @@ USB_PID = 0xc051 USB_PRODUCT = "Simmel" USB_MANUFACTURER = "Betrusted" -CIRCUITPY_DEVICES="CDC,MSC,HID" - MCU_CHIP = nrf52833 # SPI_FLASH_FILESYSTEM = 1 @@ -31,6 +29,7 @@ CIRCUITPY_RTC = 1 CIRCUITPY_SDCARDIO = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_ULAB = 0 +CIRCUITPY_USB_CDC = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_WATCHDOG = 1 From 2529c263de829e6156453bd0746c6795f482900a Mon Sep 17 00:00:00 2001 From: Jose David M Date: Sat, 20 Feb 2021 01:10:06 +0000 Subject: [PATCH 038/159] Translated using Weblate (Spanish) Currently translated at 100.0% (963 of 963 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 171 +++++++++++++++++++++++++++------------------------ 1 file changed, 89 insertions(+), 82 deletions(-) diff --git a/locale/es.po b/locale/es.po index 39b8b91ba1..4f71a9e468 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-19 02:29+0000\n" +"PO-Revision-Date: 2021-02-20 01:10+0000\n" "Last-Translator: Jose David M \n" "Language-Team: \n" "Language: es\n" @@ -582,7 +582,7 @@ msgstr "Llame a super().__ init __() antes de acceder al objeto nativo." #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." -msgstr "" +msgstr "Solo puede alertar en RTC IO de deep sleep" #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." @@ -682,7 +682,7 @@ msgstr "No puede variar la frecuencia en un temporizador que ya está en uso" #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." -msgstr "" +msgstr "No puede despertar en pin edge, solo en nivel." #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." @@ -839,7 +839,7 @@ msgstr "El pin Data 0 debe estar alineado a bytes" #: ports/esp32s2/common-hal/displayio/ParallelBus.c msgid "Data 0 pin must be byte aligned." -msgstr "" +msgstr "El pin de datos 0 debe ser alineado a byte." #: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" @@ -897,7 +897,7 @@ msgstr "Error en regex" #: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c msgid "Error: Failure to bind" -msgstr "" +msgstr "Error: fallo al vincular" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c @@ -1124,6 +1124,8 @@ msgstr "Inicializacion fallida por falta de memoria" #, c-format msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" msgstr "" +"La longitud del buffer de entrada(%d) debe ser un múltiplo del conteo de la " +"tira (%d)" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" @@ -1136,7 +1138,7 @@ msgstr "error Input/output" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d jumps on pin" -msgstr "" +msgstr "La instruction %d jumps en pin" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1335,11 +1337,11 @@ msgstr "Tamaño incorrecto" #: ports/esp32s2/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" -msgstr "" +msgstr "socket invalido para TLS" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Invalid state" -msgstr "" +msgstr "Estado invalido" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" @@ -1383,7 +1385,7 @@ msgstr "Length no deberia ser negativa" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "MAC address was invalid" -msgstr "" +msgstr "La dirección MAC es incorrecta" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." @@ -1421,32 +1423,34 @@ msgstr "Falta el pin MISO o MOSI" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" -msgstr "" +msgstr "first-in-pin no encontrado. La instrucción %d lee el/los pin(es)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)" -msgstr "" +msgstr "first_in_pin no encontrado. La instrucción %d desplaza de los pin(es)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d waits based on pin" -msgstr "" +msgstr "first_in_pin no encontrado. La instrucción %d espera basada en este pin" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)" msgstr "" +"first_in_pin no encontrado. La instrucción %d mueve hacia afuera hacia el/" +"los pin(es)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_out_pin. Instruction %d writes pin(s)" -msgstr "" +msgstr "first_in_pin no encontrado. La instrucción %d escribe pin(es)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_set_pin. Instruction %d sets pin(s)" -msgstr "" +msgstr "first_set_pin no encontrado. La instrucción %d configura el/los pin(es)" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." @@ -1486,12 +1490,12 @@ msgstr "No se encontró el canal DMA" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA pacing timer found" -msgstr "" +msgstr "timer por establecedor de paso DMA no encontrado" #: shared-module/adafruit_bus_device/I2CDevice.c #, c-format msgid "No I2C device at address: %x" -msgstr "" +msgstr "No hay dispositivo I2C en la dirección: %x" #: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/SPI.c @@ -1572,13 +1576,13 @@ msgstr "No hay una red con ese ssid" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No out in program" -msgstr "" +msgstr "No hay out en el programa" #: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c msgid "No pull up found on SDA or SCL; check your wiring" -msgstr "" +msgstr "No se encontró pull up en SDA or SCL; verifique su cableado" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1639,7 +1643,7 @@ msgstr "Solo mono de 8 ó 16 bit con " #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Only IN/OUT of up to 8 supported" -msgstr "" +msgstr "Solamente IN/OUT hasta 8 esta soportado" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" @@ -1668,11 +1672,11 @@ msgstr "" #: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." -msgstr "" +msgstr "Solamente una TouchAlarm puede ser configurada durante deep sleep." #: ports/esp32s2/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." -msgstr "" +msgstr "Solamente una alarm.time puede ser configurada." #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" @@ -1684,15 +1688,15 @@ msgstr "Solo se aceptan enteros crudos para ip" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Operation or feature not supported" -msgstr "" +msgstr "Operación no característica no soportada" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Operation timed out" -msgstr "" +msgstr "Tiempo de espera agotado" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" -msgstr "" +msgstr "Memoria agotada" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Out of sockets" @@ -1701,7 +1705,7 @@ msgstr "Se acabaron los enchufes" #: shared-bindings/bitops/__init__.c #, c-format msgid "Output buffer must be at least %d bytes" -msgstr "" +msgstr "buffer de salida debe ser de por lo menos %d bytes" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1709,7 +1713,7 @@ msgstr "El sobremuestreo debe ser un múltiplo de 8." #: shared-bindings/audiobusio/PDMIn.c msgid "PDMIn not available" -msgstr "" +msgstr "PDMIn no esta disponible" #: shared-bindings/pwmio/PWMOut.c msgid "" @@ -1731,7 +1735,7 @@ msgstr "ParallelBus todavía no soportado" #: ports/esp32s2/common-hal/audiobusio/__init__.c msgid "Peripheral in use" -msgstr "" +msgstr "Periférico en uso" #: py/moduerrno.c msgid "Permission denied" @@ -1739,11 +1743,11 @@ msgstr "Permiso denegado" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Pin count must be at least 1" -msgstr "" +msgstr "El total de pines debe ser por lo menos 1" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" -msgstr "" +msgstr "Total de pines demasiado grande" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c @@ -1781,7 +1785,7 @@ msgstr "" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Pins must share PWM slice" -msgstr "" +msgstr "Los pines deben compartir la división PWM" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1817,30 +1821,33 @@ msgstr "El prefijo del buffer debe estar en el heap" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload.\n" msgstr "" +"Presiona cualquier tecla para entrar al REPL. Usa CTRL-D para recargar.\n" #: main.c msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n" msgstr "" +"Pretendiendo ir a deep sleep hasta la alarma, CTRL-C or una escritura de " +"archivo\n" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Program does IN without loading ISR" -msgstr "" +msgstr "El programa hace un IN sin cargar ISR" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Program does OUT without loading OSR" -msgstr "" +msgstr "El programa hace OUT sin cargar OSR" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program must contain at least one 16-bit instruction." -msgstr "" +msgstr "El programa debe contener por lo menos una instrucción de 16 bits." #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" -msgstr "" +msgstr "El tamaño del programa no es correcto" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program too large" -msgstr "" +msgstr "Programa demasiado grande" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." @@ -1848,7 +1855,7 @@ msgstr "Pull no se usa cuando la dirección es output." #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "RAISE mode is not implemented" -msgstr "" +msgstr "El modo RAISE no esta implementado" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" @@ -1860,7 +1867,7 @@ msgstr "Error de inicialización de RNG" #: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" -msgstr "" +msgstr "RS485 no esta soportado todavía en este dispositivo" #: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c @@ -1901,7 +1908,7 @@ msgstr "Objeto de solo-lectura" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Received response was invalid" -msgstr "" +msgstr "La respuesta recibida es invalida" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" @@ -1917,7 +1924,7 @@ msgstr "El modo AES solicitado no es compatible" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Requested resource not found" -msgstr "" +msgstr "Recurso solicitado no encontrado" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1955,7 +1962,7 @@ msgstr "Error de reinicialización de SPI" #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" -msgstr "" +msgstr "Periférico SPI en uso" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" @@ -1989,11 +1996,11 @@ msgstr "El contexto del lado del servidor no puede tener un hostname" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Set pin count must be between 1 and 5" -msgstr "" +msgstr "La suma de pines configurados debe estar entre 1 y 5" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Side set pin count must be between 1 and 5" -msgstr "" +msgstr "El conteo de pines de Side set debe estar entre 1 y 5" #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" @@ -2028,11 +2035,11 @@ msgstr "El tamaño de la pila debe ser de al menos 256" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" -msgstr "" +msgstr "Estéreo izquierdo debe estar en el canal PWM A" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo right must be on PWM channel B" -msgstr "" +msgstr "Estéreo derecho debe estar en el canal PWM B" #: shared-bindings/multiterminal/__init__.c msgid "Stream missing readinto() or write() method." @@ -2044,7 +2051,7 @@ msgstr "Suministre al menos un pin UART" #: shared-bindings/alarm/time/TimeAlarm.c msgid "Supply one of monotonic_time or epoch_time" -msgstr "" +msgstr "Suministre monotonic_time o epoch_time" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" @@ -2120,7 +2127,7 @@ msgstr "Ancho del Tile debe dividir exactamente el ancho de mapa de bits" #: shared-bindings/alarm/time/TimeAlarm.c msgid "Time is in the past." -msgstr "" +msgstr "Tiempo suministrado esta en el pasado." #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format @@ -2183,7 +2190,7 @@ msgstr "Error de reinicialización de UART" #: ports/raspberrypi/common-hal/busio/UART.c msgid "UART not yet supported" -msgstr "" +msgstr "UART no esta soportado todavia" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" @@ -2243,7 +2250,7 @@ msgstr "Imposible escribir en nvm." #: shared-bindings/alarm/SleepMemory.c msgid "Unable to write to sleep_memory." -msgstr "" +msgstr "Imposible de escribir en sleep_memory." #: ports/nrf/common-hal/_bleio/UUID.c msgid "Unexpected nrfx uuid type" @@ -2257,7 +2264,7 @@ msgstr "Error no manejado de ESP TLS %d %d %x %d" #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" -msgstr "" +msgstr "Fallo desconocido %d" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -2315,7 +2322,7 @@ msgstr "valor pull no soportado." #: ports/esp32s2/common-hal/dualbank/__init__.c msgid "Update Failed" -msgstr "" +msgstr "La actualización fallo" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -2329,7 +2336,7 @@ msgstr "Tamaño de valor > max_length" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Version was invalid" -msgstr "" +msgstr "La versión era invalida" #: py/emitnative.c msgid "Viper functions don't currently support more than 4 arguments" @@ -2389,7 +2396,7 @@ msgstr "La clave de WiFi debe ser entre 8 y 63 caracteres" #: main.c msgid "Woken up by alarm.\n" -msgstr "" +msgstr "Despertado por la alarma.\n" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" @@ -2536,7 +2543,7 @@ msgstr "la rama no está dentro del rango" #: extmod/ulab/code/ulab_create.c msgid "buffer is smaller than requested size" -msgstr "" +msgstr "El buffer es mas pequeño que el requerido" #: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" @@ -2544,7 +2551,7 @@ msgstr "buffer debe de ser un objeto bytes-like" #: extmod/ulab/code/ulab_create.c msgid "buffer size must be a multiple of element size" -msgstr "" +msgstr "El tamaño del buffer debe ser un múltiplo del tamaño del elemento" #: shared-module/struct/__init__.c msgid "buffer size must match format" @@ -2758,7 +2765,7 @@ msgstr "circulo solo puede ser registrado con un pariente" #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" -msgstr "" +msgstr "código fuera del rango 0~127" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" @@ -2834,7 +2841,7 @@ msgstr "los datos deben ser de igual tamaño" #: extmod/ulab/code/ndarray.c msgid "data type not understood" -msgstr "" +msgstr "tipo de dato no comprendido" #: py/parsenum.c msgid "decimal numbers not supported" @@ -2846,7 +2853,7 @@ msgstr "'except' por defecto deberia estar de último" #: shared-bindings/msgpack/__init__.c msgid "default is not a function" -msgstr "" +msgstr "default no es una función" #: shared-bindings/audiobusio/PDMIn.c msgid "" @@ -2906,7 +2913,7 @@ msgstr "end_x debe ser un int" #: shared-bindings/alarm/time/TimeAlarm.c msgid "epoch_time not supported on this board" -msgstr "" +msgstr "epoch_time no esta soportado en esta tarjeta" #: ports/nrf/common-hal/busio/UART.c #, c-format @@ -2951,7 +2958,7 @@ msgstr "esperando la clave:valor para dict" #: shared-bindings/msgpack/__init__.c msgid "ext_hook is not a function" -msgstr "" +msgstr "ext_hook no es una función" #: py/argcheck.c msgid "extra keyword arguments given" @@ -3157,7 +3164,7 @@ msgstr "Formas de entrada y salida no son compactibles" #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer, a tuple, or a list" -msgstr "" +msgstr "argumento de entrada debe ser un entero, una tupla o una lista" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" @@ -3283,7 +3290,7 @@ msgstr "sintaxis inválida para número" #: ports/esp32s2/common-hal/alarm/pin/__init__.c msgid "io must be rtc io" -msgstr "" +msgstr "io debe ser rtc io" #: py/objtype.c msgid "issubclass() arg 1 must be a class" @@ -3384,7 +3391,7 @@ msgstr "max_length debe ser 0-%d cuando fixed_length es %s" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "max_length must be >= 0" -msgstr "" +msgstr "max_length debe ser >= 0" #: extmod/ulab/code/ndarray.c msgid "maximum number of dimensions is 4" @@ -3404,7 +3411,7 @@ msgstr "maxiter debe ser > 0" #: extmod/ulab/code/numerical/numerical.c msgid "median argument must be an ndarray" -msgstr "" +msgstr "argumento median debe ser una matriz ndarray" #: py/runtime.c #, c-format @@ -3490,7 +3497,7 @@ msgstr "no se ha encontrado ningún enlace para nonlocal" #: shared-module/msgpack/__init__.c msgid "no default packer" -msgstr "" +msgstr "no hay empaquetador por defecto" #: py/builtinimport.c msgid "no module named '%q'" @@ -3533,11 +3540,11 @@ msgstr "" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "non-zero timeout must be > 0.01" -msgstr "" +msgstr "el tiempo de espera non-zero deber ser > 0.01" #: shared-bindings/_bleio/Adapter.c msgid "non-zero timeout must be >= interval" -msgstr "" +msgstr "el tiempo de espera non-zero debe ser >= intervalo" #: extmod/ulab/code/linalg/linalg.c msgid "norm is defined for 1D and 2D arrays" @@ -3562,7 +3569,7 @@ msgstr "el número de puntos debe ser al menos 2" #: py/builtinhelp.c msgid "object " -msgstr "" +msgstr "objecto " #: py/obj.c msgid "object '%q' is not a tuple or list" @@ -3618,11 +3625,11 @@ msgstr "offset es demasiado grande" #: shared-bindings/dualbank/__init__.c msgid "offset must be >= 0" -msgstr "" +msgstr "offset debe ser >= 0" #: extmod/ulab/code/ulab_create.c msgid "offset must be non-negative and no greater than buffer length" -msgstr "" +msgstr "offset debe ser non-negative y no mayo que la longitud del buffer" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" @@ -3734,7 +3741,7 @@ msgstr "pop desde %q vacía" #: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c msgid "port must be >= 0" -msgstr "" +msgstr "port debe ser be >= 0" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3772,11 +3779,11 @@ msgstr "presionando ambos botones al inicio.\n" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "pull_threshold must be between 1 and 32" -msgstr "" +msgstr "pull_threshold debe esta entre 1 y 32" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "push_threshold must be between 1 and 32" -msgstr "" +msgstr "push_threshold debe esta entre 1 y 32" #: extmod/modutimeq.c msgid "queue overflow" @@ -3855,7 +3862,7 @@ msgstr "forma tiene que ser una tupla" #: shared-module/msgpack/__init__.c msgid "short read" -msgstr "" +msgstr "lectura corta" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3975,7 +3982,7 @@ msgstr "limite debe ser en el rango 0-65536" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "tile must be greater than zero" -msgstr "" +msgstr "tile debe sera mas grande que cero" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" @@ -3994,7 +4001,7 @@ msgstr "el tiempo de espera debe ser 0.0-100.0 segundos" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" -msgstr "" +msgstr "timeout debe ser < 655.35 segundos" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" @@ -4022,7 +4029,7 @@ msgstr "demasiados argumentos provistos con el formato dado" #: extmod/ulab/code/ulab_create.c msgid "too many dimensions" -msgstr "" +msgstr "demasiadas dimensiones" #: extmod/ulab/code/ndarray.c msgid "too many indices" @@ -4035,7 +4042,7 @@ msgstr "demasiados valores para descomprimir (%d esperado)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays" -msgstr "" +msgstr "trapz esta definido para matrices 1D" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" @@ -4043,7 +4050,7 @@ msgstr "trapz está definido para arreglos 1D de igual tamaño" #: ports/esp32s2/common-hal/alarm/pin/__init__.c msgid "trigger level must be 0 or 1" -msgstr "" +msgstr "nivel de accionamiento debe ser 0 o 1" #: py/obj.c msgid "tuple/list has wrong length" @@ -4185,7 +4192,7 @@ msgstr "los vectores deben tener el mismo tamaño" #: ports/esp32s2/common-hal/alarm/pin/__init__.c msgid "wakeup conflict" -msgstr "" +msgstr "conflicto de wakeup" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" @@ -4198,7 +4205,7 @@ msgstr "el tiempo de espera del perro guardián debe ser mayor a 0" #: shared-bindings/bitops/__init__.c #, c-format msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" +msgstr "ancho debe estar entre 2 y 8 (inclusivamente), no %d" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" @@ -4206,7 +4213,7 @@ msgstr "el ancho debe ser mayor que cero" #: ports/esp32s2/common-hal/wifi/Radio.c msgid "wifi is not enabled" -msgstr "" +msgstr "wifi no esta habilitado" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" @@ -4246,7 +4253,7 @@ msgstr "valor x fuera de límites" #: ports/esp32s2/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" -msgstr "" +msgstr "fallo en xTaskCreate" #: shared-bindings/displayio/Shape.c msgid "y should be an int" From ad8916499d882000182f054b7cac0029e1f80408 Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 13:32:54 +0000 Subject: [PATCH 039/159] Added board.c for Tiny2040 --- .../boards/pimoroni_tiny2040/board.c | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ports/raspberrypi/boards/pimoroni_tiny2040/board.c diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040/board.c b/ports/raspberrypi/boards/pimoroni_tiny2040/board.c new file mode 100644 index 0000000000..67486d4c23 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_tiny2040/board.c @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} From 66dd74cd1236a6b1529dbdbf2de4cbe2bef2a94d Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 13:33:54 +0000 Subject: [PATCH 040/159] Added other files for Tiny2040 --- .../boards/pimoroni_tiny2040/mpconfigboard.h | 24 ++++++++++++ .../boards/pimoroni_tiny2040/mpconfigboard.mk | 11 ++++++ .../boards/pimoroni_tiny2040/pins.c | 39 +++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/pimoroni_tiny2040/pins.c diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h new file mode 100644 index 0000000000..c1285d78f0 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h @@ -0,0 +1,24 @@ +#define MICROPY_HW_BOARD_NAME "Pimoroni Tiny 2040" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_LED_R (&pin_GPIO18) +#define MICROPY_HW_LED_G (&pin_GPIO19) +#define MICROPY_HW_LED_B (&pin_GPIO20) + +#define MICROPY_HW_USER_SW (&pin_GPIO23) + +// These pins are unconnected +#define IGNORE_PIN_GPIO8 1 +#define IGNORE_PIN_GPIO9 1 +#define IGNORE_PIN_GPIO10 1 +#define IGNORE_PIN_GPIO11 1 +#define IGNORE_PIN_GPIO12 1 +#define IGNORE_PIN_GPIO13 1 +#define IGNORE_PIN_GPIO14 1 +#define IGNORE_PIN_GPIO15 1 +#define IGNORE_PIN_GPIO16 1 +#define IGNORE_PIN_GPIO17 1 +#define IGNORE_PIN_GPIO21 1 +#define IGNORE_PIN_GPIO22 1 +#define IGNORE_PIN_GPIO24 1 +#define IGNORE_PIN_GPIO25 1 \ No newline at end of file diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.mk b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.mk new file mode 100644 index 0000000000..75fe36a29d --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x16D0 +USB_PID = 0x08C7 +USB_PRODUCT = "Tiny 2040" +USB_MANUFACTURER = "Pimoroni" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c b/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c new file mode 100644 index 0000000000..4c099d4d97 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c @@ -0,0 +1,39 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_USER_SW), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_GP29_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file From 7ac20bfb8b7ca049909d728855fdc78c1c15d523 Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 13:35:06 +0000 Subject: [PATCH 041/159] Added board.c for Keybow2040 --- .../boards/pimoroni_keybow2040/board.c | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ports/raspberrypi/boards/pimoroni_keybow2040/board.c diff --git a/ports/raspberrypi/boards/pimoroni_keybow2040/board.c b/ports/raspberrypi/boards/pimoroni_keybow2040/board.c new file mode 100644 index 0000000000..67486d4c23 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_keybow2040/board.c @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} From fb7cce6503ccdc63dbefd83cc65d4a6be787531a Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 13:35:27 +0000 Subject: [PATCH 042/159] Added other files for Keybow2040 --- .../pimoroni_keybow2040/mpconfigboard.h | 39 +++++++++++++++++++ .../pimoroni_keybow2040/mpconfigboard.mk | 11 ++++++ .../boards/pimoroni_keybow2040/pins.c | 38 ++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/pimoroni_keybow2040/pins.c diff --git a/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h new file mode 100644 index 0000000000..3abfffeeea --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h @@ -0,0 +1,39 @@ +#define MICROPY_HW_BOARD_NAME "Pimoroni Keybow 2040" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_SW0 (&pin_GPIO21) +#define MICROPY_HW_SW1 (&pin_GPIO20) +#define MICROPY_HW_SW2 (&pin_GPIO19) +#define MICROPY_HW_SW3 (&pin_GPIO18) +#define MICROPY_HW_SW4 (&pin_GPIO17) +#define MICROPY_HW_SW5 (&pin_GPIO16) +#define MICROPY_HW_SW6 (&pin_GPIO15) +#define MICROPY_HW_SW7 (&pin_GPIO14) +#define MICROPY_HW_SW8 (&pin_GPIO13) +#define MICROPY_HW_SW9 (&pin_GPIO12) +#define MICROPY_HW_SW10 (&pin_GPIO11) +#define MICROPY_HW_SW11 (&pin_GPIO10) +#define MICROPY_HW_SW12 (&pin_GPIO9) +#define MICROPY_HW_SW13 (&pin_GPIO8) +#define MICROPY_HW_SW14 (&pin_GPIO7) +#define MICROPY_HW_SW15 (&pin_GPIO6) + +#define MICROPY_HW_USER_SW (&pin_GPIO23) + +#define MICROPY_HW_I2C_INT (&pin_GPIO3) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO5) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO4) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) + +// These pins are unconnected +#define IGNORE_PIN_GPIO2 1 +#define IGNORE_PIN_GPIO22 1 +#define IGNORE_PIN_GPIO24 1 +#define IGNORE_PIN_GPIO25 1 +#define IGNORE_PIN_GPIO26 1 +#define IGNORE_PIN_GPIO27 1 +#define IGNORE_PIN_GPIO28 1 +#define IGNORE_PIN_GPIO29 1 \ No newline at end of file diff --git a/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.mk b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.mk new file mode 100644 index 0000000000..cf74294315 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x16D0 +USB_PID = 0x08C6 +USB_PRODUCT = "Keybow 2040" +USB_MANUFACTURER = "Pimoroni" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c b/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c new file mode 100644 index 0000000000..36c4325b53 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c @@ -0,0 +1,38 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + + + { MP_ROM_QSTR(MP_QSTR_INT), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO5) }, + + + { MP_ROM_QSTR(MP_QSTR_SW0), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SW1), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_SW2), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_SW3), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_SW4), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_SW5), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_SW6), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_SW7), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_SW8), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_SW9), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_SW10), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_SW11), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_SW12), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_SW13), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_SW14), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_SW15), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_USER_SW), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file From e9c7af1dee03fb7eaf0396ba42e063fb389f29ff Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 13:36:46 +0000 Subject: [PATCH 043/159] Added board.c for PicoSystem --- .../boards/pimoroni_picosystem/board.c | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ports/raspberrypi/boards/pimoroni_picosystem/board.c diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/board.c b/ports/raspberrypi/boards/pimoroni_picosystem/board.c new file mode 100644 index 0000000000..67486d4c23 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_picosystem/board.c @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} From 27bc5492f5adeaf9a18b25582312439936939e43 Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 13:37:08 +0000 Subject: [PATCH 044/159] Added other files for PicoSystem --- .../pimoroni_picosystem/mpconfigboard.h | 47 +++++++++++++++++++ .../pimoroni_picosystem/mpconfigboard.mk | 11 +++++ .../boards/pimoroni_picosystem/pins.c | 43 +++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/pimoroni_picosystem/pins.c diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h new file mode 100644 index 0000000000..e952174bd4 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h @@ -0,0 +1,47 @@ +#define MICROPY_HW_BOARD_NAME "Pimoroni PicoSystem" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_VBUS_DETECT (&pin_GPIO2) + +#define MICROPY_HW_LCD_RESET (&pin_GPIO4) +#define MICROPY_HW_LCD_CS (&pin_GPIO5) +#define MICROPY_HW_LCD_SCLK (&pin_GPIO6) +#define MICROPY_HW_LCD_MOSI (&pin_GPIO7) +#define MICROPY_HW_LCD_VSYNC (&pin_GPIO8) +#define MICROPY_HW_LCD_DS (&pin_GPIO9) + +#define MICROPY_HW_AUDIO (&pin_GPIO11) +#define MICROPY_HW_BACKLIGHT (&pin_GPIO12) +#define MICROPY_HW_VBUS_DETECT (&pin_GPIO2) + +#define MICROPY_HW_LED_G (&pin_GPIO13) +#define MICROPY_HW_LED_R (&pin_GPIO14) +#define MICROPY_HW_LED_B (&pin_GPIO15) + +#define MICROPY_HW_SW_Y (&pin_GPIO16) +#define MICROPY_HW_SW_X (&pin_GPIO17) +#define MICROPY_HW_SW_A (&pin_GPIO18) +#define MICROPY_HW_SW_B (&pin_GPIO19) + +#define MICROPY_HW_SW_DOWN (&pin_GPIO20) +#define MICROPY_HW_SW_RIGHT (&pin_GPIO21) +#define MICROPY_HW_SW_LEFT (&pin_GPIO22) +#define MICROPY_HW_SW_UP (&pin_GPIO23) + +#define MICROPY_HW_CHARGE_STAT (&pin_GPIO24) + +#define MICROPY_HW_BAT_SENSE (&pin_GPIO26) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO6) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO7) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) + +// These pins are unconnected +#define IGNORE_PIN_GPIO3 1 +#define IGNORE_PIN_GPIO10 1 +#define IGNORE_PIN_GPIO25 1 +#define IGNORE_PIN_GPIO27 1 +#define IGNORE_PIN_GPIO28 1 +#define IGNORE_PIN_GPIO29 1 \ No newline at end of file diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.mk b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.mk new file mode 100644 index 0000000000..c9d22549ba --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x16D0 +USB_PID = 0x08C8 +USB_PRODUCT = "PicoSystem" +USB_MANUFACTURER = "Pimoroni" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/pins.c b/ports/raspberrypi/boards/pimoroni_picosystem/pins.c new file mode 100644 index 0000000000..337114d1bd --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_picosystem/pins.c @@ -0,0 +1,43 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_VBUS_DETECT), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_LCD_RESET), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_LCD_SCLK), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_LCD_MOSI), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_LCD_VSYNC), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_LCD_DC), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_AUDIO), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_BACKLIGHT), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_SW_Y), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_SW_X), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_SW_A), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_SW_B), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_SW_DOWN), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_SW_RIGHT), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SW_LEFT), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_SW_UP), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_CHARGE_STAT), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_BAT_SENSE), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file From dde2b8dfb322a9994dcdb137668f567de8d9b84e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 20 Feb 2021 10:05:39 -0600 Subject: [PATCH 045/159] update to ulab 1.7.5 --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 743d86487c..2ecad9586d 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 743d86487c83e42024ed508ed50499ad0a527d5d +Subproject commit 2ecad9586d088ee66f1b208ff2204906eba9e987 From 646eb9a7db654ebbbb8c1f85ba362a24db0dc77e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 20 Feb 2021 10:35:27 -0600 Subject: [PATCH 046/159] py: memoryview: implement memoryview.cast if CPYTHON_COMPAT --- py/objarray.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/py/objarray.c b/py/objarray.c index e0b4cbd55f..50b87fb11c 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -238,6 +238,24 @@ STATIC mp_obj_t memoryview_make_new(const mp_obj_type_t *type_in, size_t n_args, return MP_OBJ_FROM_PTR(self); } + +STATIC mp_obj_t memoryview_cast(const mp_obj_t self_in, const mp_obj_t typecode_in) { + mp_obj_array_t *self = MP_OBJ_TO_PTR(self_in); + const char *typecode = mp_obj_str_get_str(typecode_in); + size_t element_size = mp_binary_get_size('@', typecode[0], NULL); + size_t bytelen = self->len * mp_binary_get_size('@', self->typecode & ~MP_OBJ_ARRAY_TYPECODE_FLAG_RW, NULL); + if (bytelen % element_size != 0) { + mp_raise_TypeError(translate("memoryview: length is not a multiple of itemsize")); + } + mp_obj_array_t *result = MP_OBJ_TO_PTR(mp_obj_new_memoryview(*typecode, bytelen / element_size, self->items)); + + // test if the object can be written to + if (self->typecode & MP_OBJ_ARRAY_TYPECODE_FLAG_RW) { + result->typecode |= MP_OBJ_ARRAY_TYPECODE_FLAG_RW; // indicate writable buffer + } + return MP_OBJ_FROM_PTR(result); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(memoryview_cast_obj, memoryview_cast); #endif STATIC mp_obj_t array_unary_op(mp_unary_op_t op, mp_obj_t o_in) { @@ -691,6 +709,15 @@ const mp_obj_type_t mp_type_bytearray = { #endif #if MICROPY_PY_BUILTINS_MEMORYVIEW + +#if MICROPY_CPYTHON_COMPAT +STATIC const mp_rom_map_elem_t memoryview_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_cast), MP_ROM_PTR(&memoryview_cast_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(memoryview_locals_dict, memoryview_locals_dict_table); +#endif + const mp_obj_type_t mp_type_memoryview = { { &mp_type_type }, .name = MP_QSTR_memoryview, @@ -700,6 +727,9 @@ const mp_obj_type_t mp_type_memoryview = { .binary_op = array_binary_op, .subscr = array_subscr, .buffer_p = { .get_buffer = array_get_buffer }, +#if MICROPY_CPYTHON_COMPAT + .locals_dict = (mp_obj_dict_t*)&memoryview_locals_dict, +#endif }; #endif From f1df07002f3740d9042b2e0910ef0e52c6bdb8d3 Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 17:15:20 +0000 Subject: [PATCH 047/159] Added new line --- ports/raspberrypi/boards/pimoroni_picosystem/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/pins.c b/ports/raspberrypi/boards/pimoroni_picosystem/pins.c index 337114d1bd..cbcdecc2d4 100644 --- a/ports/raspberrypi/boards/pimoroni_picosystem/pins.c +++ b/ports/raspberrypi/boards/pimoroni_picosystem/pins.c @@ -40,4 +40,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 0a00f91979e529c978e57f060c3ed9a321ed69af Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 17:15:42 +0000 Subject: [PATCH 048/159] Added new line --- ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h index e952174bd4..8a61d6a76d 100644 --- a/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h +++ b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h @@ -44,4 +44,4 @@ #define IGNORE_PIN_GPIO25 1 #define IGNORE_PIN_GPIO27 1 #define IGNORE_PIN_GPIO28 1 -#define IGNORE_PIN_GPIO29 1 \ No newline at end of file +#define IGNORE_PIN_GPIO29 1 From dac81ea5458c02b1880fd112eac1b3afa12610f9 Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 17:19:31 +0000 Subject: [PATCH 049/159] Added new line --- ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h index c1285d78f0..8f188959cb 100644 --- a/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h @@ -21,4 +21,4 @@ #define IGNORE_PIN_GPIO21 1 #define IGNORE_PIN_GPIO22 1 #define IGNORE_PIN_GPIO24 1 -#define IGNORE_PIN_GPIO25 1 \ No newline at end of file +#define IGNORE_PIN_GPIO25 1 From 03577ec81c86a013075b640b72422a0003d8dca5 Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 17:19:45 +0000 Subject: [PATCH 050/159] Added new line --- ports/raspberrypi/boards/pimoroni_tiny2040/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c b/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c index 4c099d4d97..c09f370426 100644 --- a/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c +++ b/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c @@ -36,4 +36,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 9fbeb0baeabace14fcafc945f41c16bd740bb21b Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 17:20:06 +0000 Subject: [PATCH 051/159] Added new line --- ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h index 3abfffeeea..ecc127db68 100644 --- a/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h @@ -36,4 +36,4 @@ #define IGNORE_PIN_GPIO26 1 #define IGNORE_PIN_GPIO27 1 #define IGNORE_PIN_GPIO28 1 -#define IGNORE_PIN_GPIO29 1 \ No newline at end of file +#define IGNORE_PIN_GPIO29 1 From dea498a51fc9466dc94dd00139237f3e72653898 Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 17:20:28 +0000 Subject: [PATCH 052/159] Added new line --- ports/raspberrypi/boards/pimoroni_keybow2040/pins.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c b/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c index 36c4325b53..017b7680a1 100644 --- a/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c +++ b/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c @@ -7,12 +7,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, - { MP_ROM_QSTR(MP_QSTR_INT), MP_ROM_PTR(&pin_GPIO3) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO5) }, - { MP_ROM_QSTR(MP_QSTR_SW0), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_SW1), MP_ROM_PTR(&pin_GPIO20) }, { MP_ROM_QSTR(MP_QSTR_SW2), MP_ROM_PTR(&pin_GPIO19) }, @@ -35,4 +33,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 9a4b8c5ed908563670cb617b198272d409ebef4a Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 17:23:23 +0000 Subject: [PATCH 053/159] Removed trailing white space --- ports/raspberrypi/boards/pimoroni_picosystem/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/pins.c b/ports/raspberrypi/boards/pimoroni_picosystem/pins.c index cbcdecc2d4..30aafacbad 100644 --- a/ports/raspberrypi/boards/pimoroni_picosystem/pins.c +++ b/ports/raspberrypi/boards/pimoroni_picosystem/pins.c @@ -20,7 +20,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_BACKLIGHT), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_GPIO14) }, { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_GPIO15) }, { MP_ROM_QSTR(MP_QSTR_SW_Y), MP_ROM_PTR(&pin_GPIO16) }, From 417173b7529d3f79c2151741db03199f767e39fc Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 17:24:26 +0000 Subject: [PATCH 054/159] Removed trailing white space --- ports/raspberrypi/boards/pimoroni_keybow2040/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c b/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c index 017b7680a1..c4cdb7b293 100644 --- a/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c +++ b/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c @@ -28,7 +28,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SW14), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_SW15), MP_ROM_PTR(&pin_GPIO6) }, - { MP_ROM_QSTR(MP_QSTR_USER_SW), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_USER_SW), MP_ROM_PTR(&pin_GPIO23) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, From 52f2fd6d53cf94b33a144e962ceb5a9b8b6c1b07 Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Sat, 20 Feb 2021 17:25:26 +0000 Subject: [PATCH 055/159] Removed trailing white space --- ports/raspberrypi/boards/pimoroni_tiny2040/pins.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c b/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c index c09f370426..de79ee7320 100644 --- a/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c +++ b/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c @@ -19,18 +19,18 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, - + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, { MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) }, { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, - + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, { MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) }, { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, - + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, { MP_ROM_QSTR(MP_QSTR_GP29_A3), MP_ROM_PTR(&pin_GPIO29) }, - { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, From a9a21452384b82741f42236b93db4e971faab897 Mon Sep 17 00:00:00 2001 From: Jonah Yolles-Murphy Date: Sat, 20 Feb 2021 15:46:33 -0500 Subject: [PATCH 056/159] fix TG-Watch ble issue --- frozen/Adafruit_CircuitPython_FocalTouch | 2 +- ports/nrf/boards/TG-Watch/mpconfigboard.h | 30 +++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/frozen/Adafruit_CircuitPython_FocalTouch b/frozen/Adafruit_CircuitPython_FocalTouch index 1e3312ab1c..0cfa671b0c 160000 --- a/frozen/Adafruit_CircuitPython_FocalTouch +++ b/frozen/Adafruit_CircuitPython_FocalTouch @@ -1 +1 @@ -Subproject commit 1e3312ab1cba0b1d3bb1f559c52acfdc1a6d57b8 +Subproject commit 0cfa671b0c38386ba4da59119d61d399faa9b358 diff --git a/ports/nrf/boards/TG-Watch/mpconfigboard.h b/ports/nrf/boards/TG-Watch/mpconfigboard.h index 07a607b3d7..1377c921ee 100644 --- a/ports/nrf/boards/TG-Watch/mpconfigboard.h +++ b/ports/nrf/boards/TG-Watch/mpconfigboard.h @@ -30,27 +30,27 @@ #define MICROPY_HW_BOARD_NAME "TG-Watch" #define MICROPY_HW_MCU_NAME "nRF52840" -#define MICROPY_HW_NEOPIXEL (&pin_P0_16) -#define MICROPY_HW_LED_STATUS (&pin_P1_15) - -// TG-Gui requires a deeper call stack than normal CircuitPython +// TG-Gui requires a deeper call stack than normal CircuitPython, this is intentional overkill #define CIRCUITPY_PYSTACK_SIZE 8192 // 1536 is the normal size, (32 bytes/frame * 48 frames) -#define BOARD_HAS_CRYSTAL 0 + +// the board has a 32mhz crystal but NOT a 32khz one +#define BOARD_HAS_32KHZ_XTAL 0 +#define BOARD_HAS_CRYSTAL 1 #if QSPI_FLASH_FILESYSTEM -#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 17) -#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 22) -#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 23) -#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 21) -#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19) -#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 20) + #define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 17) + #define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 22) + #define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 23) + #define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 21) + #define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19) + #define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 20) #endif #if SPI_FLASH_FILESYSTEM -#define SPI_FLASH_MOSI_PIN &pin_P0_17 -#define SPI_FLASH_MISO_PIN &pin_P0_22 -#define SPI_FLASH_SCK_PIN &pin_P0_19 -#define SPI_FLASH_CS_PIN &pin_P0_20 + #define SPI_FLASH_MOSI_PIN &pin_P0_17 + #define SPI_FLASH_MISO_PIN &pin_P0_22 + #define SPI_FLASH_SCK_PIN &pin_P0_19 + #define SPI_FLASH_CS_PIN &pin_P0_20 #endif #define DEFAULT_I2C_BUS_SCL (&pin_P0_11) From d8715ac92a2180e689c55be8a9fff9ea9e6a5d17 Mon Sep 17 00:00:00 2001 From: Jonah Yolles-Murphy Date: Sat, 20 Feb 2021 16:04:31 -0500 Subject: [PATCH 057/159] update adafruit_register --- frozen/Adafruit_CircuitPython_Register | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/Adafruit_CircuitPython_Register b/frozen/Adafruit_CircuitPython_Register index dd7cc167c5..5fee6e0c38 160000 --- a/frozen/Adafruit_CircuitPython_Register +++ b/frozen/Adafruit_CircuitPython_Register @@ -1 +1 @@ -Subproject commit dd7cc167c528a94a9feed81f9c52b5d372f68258 +Subproject commit 5fee6e0c3878110844bc51e16063eeae7d94c457 From 1a3b12a3bcc460f29c9cb2a5ba5033bc63bfe0ce Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 20 Feb 2021 15:17:38 -0600 Subject: [PATCH 058/159] make translate --- locale/circuitpython.pot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 0a79520b88..f9ef4ad13c 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -3337,6 +3337,10 @@ msgstr "" msgid "memory allocation failed, heap is locked" msgstr "" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "" From a04369e0f58623079bc6f1f33f847e5c08b2d587 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 20 Feb 2021 17:41:08 -0600 Subject: [PATCH 059/159] add ifdef-guard --- py/objarray.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/objarray.c b/py/objarray.c index 50b87fb11c..9640f596a3 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -239,6 +239,7 @@ STATIC mp_obj_t memoryview_make_new(const mp_obj_type_t *type_in, size_t n_args, return MP_OBJ_FROM_PTR(self); } +#if MICROPY_CPYTHON_COMPAT STATIC mp_obj_t memoryview_cast(const mp_obj_t self_in, const mp_obj_t typecode_in) { mp_obj_array_t *self = MP_OBJ_TO_PTR(self_in); const char *typecode = mp_obj_str_get_str(typecode_in); @@ -257,6 +258,7 @@ STATIC mp_obj_t memoryview_cast(const mp_obj_t self_in, const mp_obj_t typecode_ } STATIC MP_DEFINE_CONST_FUN_OBJ_2(memoryview_cast_obj, memoryview_cast); #endif +#endif STATIC mp_obj_t array_unary_op(mp_unary_op_t op, mp_obj_t o_in) { mp_obj_array_t *o = MP_OBJ_TO_PTR(o_in); From 156cc4b5770698b91559693bc8769a75fd2ec7b8 Mon Sep 17 00:00:00 2001 From: Rodrigo Argumedo Date: Sat, 20 Feb 2021 01:19:19 +0000 Subject: [PATCH 060/159] Translated using Weblate (Spanish) Currently translated at 100.0% (963 of 963 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/es.po b/locale/es.po index 4f71a9e468..273ee0dce9 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-20 01:10+0000\n" -"Last-Translator: Jose David M \n" +"PO-Revision-Date: 2021-02-21 01:50+0000\n" +"Last-Translator: Rodrigo Argumedo \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -582,7 +582,7 @@ msgstr "Llame a super().__ init __() antes de acceder al objeto nativo." #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." -msgstr "Solo puede alertar en RTC IO de deep sleep" +msgstr "Solo puede alertar en RTC IO de deep sleep." #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." @@ -1138,7 +1138,7 @@ msgstr "error Input/output" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d jumps on pin" -msgstr "La instruction %d jumps en pin" +msgstr "La instruction %d salta en pin" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format From eb8f6e30f1b0b758afc9d2b5073dc53ccb935304 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Fri, 19 Feb 2021 02:58:19 +0000 Subject: [PATCH 061/159] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (963 of 963 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 44e09385bb..0f8b00b6f3 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-12 03:20+0000\n" +"PO-Revision-Date: 2021-02-21 01:50+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.5-dev\n" +"X-Generator: Weblate 4.5\n" #: main.c msgid "" @@ -1128,6 +1128,8 @@ msgstr "A inicialização falhou devido à falta de memória" #, c-format msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" msgstr "" +"O comprimento do buffer de entrada (%d) deve ser um múltiplo da contagem dos " +"fios (%d)" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" @@ -1706,7 +1708,7 @@ msgstr "Sem soquetes" #: shared-bindings/bitops/__init__.c #, c-format msgid "Output buffer must be at least %d bytes" -msgstr "" +msgstr "O buffer de saída deve ter ao menos %d bytes" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -4218,7 +4220,7 @@ msgstr "o tempo limite do watchdog deve ser maior que 0" #: shared-bindings/bitops/__init__.c #, c-format msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" +msgstr "a largura deve ser entre 2 a 8 (inclusive), não %d" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" From 9df8d8269cedcf30236a69ace741232203888f42 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Fri, 19 Feb 2021 08:16:08 +0000 Subject: [PATCH 062/159] Translated using Weblate (Swedish) Currently translated at 100.0% (963 of 963 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index b03dc23de9..78ee4014f3 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-15 00:33+0000\n" +"PO-Revision-Date: 2021-02-21 01:50+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.5-dev\n" +"X-Generator: Weblate 4.5\n" #: main.c msgid "" @@ -1114,7 +1114,7 @@ msgstr "Initieringen misslyckades på grund av minnesbrist" #: shared-bindings/bitops/__init__.c #, c-format msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" -msgstr "" +msgstr "indatabuffertlängd (%d) måste vara en multipel av antal strand (%d)" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" @@ -1692,7 +1692,7 @@ msgstr "Slut på sockets" #: shared-bindings/bitops/__init__.c #, c-format msgid "Output buffer must be at least %d bytes" -msgstr "" +msgstr "Utdatabuffert måste vara minst %d byte" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -4179,7 +4179,7 @@ msgstr "watchdog timeout måste vara större än 0" #: shared-bindings/bitops/__init__.c #, c-format msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" +msgstr "width måste vara mellan 2 och 8, inte %d" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" From 9905e841f374720e2c4fdfd342e1e79f4fcb3078 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sun, 21 Feb 2021 15:16:02 +0100 Subject: [PATCH 063/159] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 4 ++++ locale/cs.po | 4 ++++ locale/de_DE.po | 4 ++++ locale/el.po | 4 ++++ locale/es.po | 10 ++++++++-- locale/fil.po | 4 ++++ locale/fr.po | 4 ++++ locale/hi.po | 4 ++++ locale/it_IT.po | 4 ++++ locale/ja.po | 4 ++++ locale/ko.po | 4 ++++ locale/nl.po | 4 ++++ locale/pl.po | 4 ++++ locale/pt_BR.po | 4 ++++ locale/sv.po | 4 ++++ locale/zh_Latn_pinyin.po | 4 ++++ 16 files changed, 68 insertions(+), 2 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 114bbbbec3..e1aed308ac 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -3388,6 +3388,10 @@ msgstr "" msgid "memory allocation failed, heap is locked" msgstr "" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "modul tidak ditemukan" diff --git a/locale/cs.po b/locale/cs.po index f7efb829e7..c6d537fcce 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -3340,6 +3340,10 @@ msgstr "" msgid "memory allocation failed, heap is locked" msgstr "" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 818482b7af..dfb60ca4e4 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -3418,6 +3418,10 @@ msgstr "Speicherzuordnung fehlgeschlagen, Zuweisung von %u Bytes" msgid "memory allocation failed, heap is locked" msgstr "Speicherzuweisung fehlgeschlagen, der Heap ist gesperrt" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "Modul nicht gefunden" diff --git a/locale/el.po b/locale/el.po index bdf46fc113..b088a7645f 100644 --- a/locale/el.po +++ b/locale/el.po @@ -3337,6 +3337,10 @@ msgstr "" msgid "memory allocation failed, heap is locked" msgstr "" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "" diff --git a/locale/es.po b/locale/es.po index 273ee0dce9..29d5b2a485 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1433,7 +1433,8 @@ msgstr "first_in_pin no encontrado. La instrucción %d desplaza de los pin(es)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d waits based on pin" -msgstr "first_in_pin no encontrado. La instrucción %d espera basada en este pin" +msgstr "" +"first_in_pin no encontrado. La instrucción %d espera basada en este pin" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1450,7 +1451,8 @@ msgstr "first_in_pin no encontrado. La instrucción %d escribe pin(es)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_set_pin. Instruction %d sets pin(s)" -msgstr "first_set_pin no encontrado. La instrucción %d configura el/los pin(es)" +msgstr "" +"first_set_pin no encontrado. La instrucción %d configura el/los pin(es)" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." @@ -3422,6 +3424,10 @@ msgstr "la asignación de memoria falló, asignando %u bytes" msgid "memory allocation failed, heap is locked" msgstr "la asignación de memoria falló, el heap está bloqueado" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "módulo no encontrado" diff --git a/locale/fil.po b/locale/fil.po index 7c040d3645..1eecc49dc9 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -3384,6 +3384,10 @@ msgstr "nabigo ang paglalaan ng memorya, paglalaan ng %u bytes" msgid "memory allocation failed, heap is locked" msgstr "abigo ang paglalaan ng memorya, ang heap ay naka-lock" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "module hindi nakita" diff --git a/locale/fr.po b/locale/fr.po index 3b66b2ed7f..e2ab00372e 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -3442,6 +3442,10 @@ msgstr "l'allocation de mémoire a échoué en allouant %u octets" msgid "memory allocation failed, heap is locked" msgstr "l'allocation de mémoire a échoué, le tas est vérrouillé" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "module introuvable" diff --git a/locale/hi.po b/locale/hi.po index b51c3bd559..3d81006978 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -3337,6 +3337,10 @@ msgstr "" msgid "memory allocation failed, heap is locked" msgstr "" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 404746923e..0153dc889c 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -3396,6 +3396,10 @@ msgstr "allocazione di memoria fallita, allocando %u byte" msgid "memory allocation failed, heap is locked" msgstr "allocazione di memoria fallita, l'heap è bloccato" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "modulo non trovato" diff --git a/locale/ja.po b/locale/ja.po index b72ea99c69..2616789f4b 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -3365,6 +3365,10 @@ msgstr "" msgid "memory allocation failed, heap is locked" msgstr "メモリ確保に失敗。ヒープがロックされています" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "モジュールが見つかりません" diff --git a/locale/ko.po b/locale/ko.po index 8e01c5eb84..26810f87e5 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -3341,6 +3341,10 @@ msgstr "" msgid "memory allocation failed, heap is locked" msgstr "" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 05ed8a3ada..463a70da25 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -3398,6 +3398,10 @@ msgstr "geheugentoewijzing mislukt, %u bytes worden toegewezen" msgid "memory allocation failed, heap is locked" msgstr "geheugentoewijzing mislukt, heap is vergrendeld" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "module niet gevonden" diff --git a/locale/pl.po b/locale/pl.po index e3c0f3ae94..bf914aefb3 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -3358,6 +3358,10 @@ msgstr "alokacja pamięci nie powiodła się, alokowano %u bajtów" msgid "memory allocation failed, heap is locked" msgstr "alokacja pamięci nie powiodła się, sterta zablokowana" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "brak modułu" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 0f8b00b6f3..08eac68a15 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -3436,6 +3436,10 @@ msgstr "" "falha na alocação de memória, a área de alocação dinâmica de variáveis " "(heap) está bloqueada" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "o módulo não foi encontrado" diff --git a/locale/sv.po b/locale/sv.po index 78ee4014f3..b60733b7a0 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -3399,6 +3399,10 @@ msgstr "minnesallokering misslyckades, allokerar %u byte" msgid "memory allocation failed, heap is locked" msgstr "minnesallokeringen misslyckades, heapen är låst" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "modulen hittades inte" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index b1f07ae658..5a08380002 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -3393,6 +3393,10 @@ msgstr "nèicún fēnpèi shībài, fēnpèi %u zì jié" msgid "memory allocation failed, heap is locked" msgstr "jìyì tǐ fēnpèi shībài, duī bèi suǒdìng" +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "zhǎo bù dào mókuài" From 410e728c85939ba073192785473f274f8a03315d Mon Sep 17 00:00:00 2001 From: David Glaude Date: Sun, 21 Feb 2021 15:59:48 +0000 Subject: [PATCH 064/159] Translated using Weblate (French) Currently translated at 96.0% (926 of 964 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index e2ab00372e..4d90ac87e1 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-01-30 02:32+0000\n" -"Last-Translator: Antonin ENFRUN \n" +"PO-Revision-Date: 2021-02-21 16:00+0000\n" +"Last-Translator: David Glaude \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.5-dev\n" +"X-Generator: Weblate 4.5\n" #: main.c msgid "" @@ -352,7 +352,7 @@ msgstr "Tous les canaux d'événements sont utilisés" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" -msgstr "" +msgstr "Tous les automates finis sont utilisés" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" @@ -657,7 +657,7 @@ msgstr "" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Cannot set socket options" -msgstr "" +msgstr "Ne peut définir les options de socket" #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." @@ -1094,7 +1094,7 @@ msgstr "Erreur d'initialisation I2C" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" -msgstr "" +msgstr "périphérique I2C utilisé" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" @@ -1123,7 +1123,7 @@ msgstr "Taille de tampon incorrecte" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Init program size invalid" -msgstr "" +msgstr "Taille du programme d'initialisation non valide" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" From 7113bd13f1a0a12108174474514b366a7aa1ca5b Mon Sep 17 00:00:00 2001 From: David Glaude Date: Sun, 21 Feb 2021 16:18:42 +0000 Subject: [PATCH 065/159] Translated using Weblate (French) Currently translated at 99.0% (955 of 964 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 4d90ac87e1..30368a28e0 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-21 16:00+0000\n" +"PO-Revision-Date: 2021-02-21 16:19+0000\n" "Last-Translator: David Glaude \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -1133,6 +1133,8 @@ msgstr "Échec d'initialisation par manque de mémoire" #, c-format msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" msgstr "" +"La taille (%d) du tampon d'entrée doit être un multiple du nombre (%d) de " +"brins" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" @@ -1143,29 +1145,33 @@ msgid "Input/output error" msgstr "Erreur d'entrée/sortie" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format +#, c-format, fuzzy msgid "Instruction %d jumps on pin" -msgstr "" +msgstr "Instruction %d saute sur la broche" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" msgstr "" +"Instruction %d décale vers l'intérieur de plus de bits que le nombre de " +"broches" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts out more bits than pin count" msgstr "" +"instruction %d décale vers l'extérieur de plus de bits que le nombre de " +"broches" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d uses extra pin" -msgstr "" +msgstr "instruction %d utilise des broches supplémentaires" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d waits on input outside of count" -msgstr "" +msgstr "instruction %d attend sur une entrée hors du compte" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" @@ -1430,7 +1436,7 @@ msgstr "Broche MISO ou MOSI manquante" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" -msgstr "" +msgstr "first_in_pin manquant. Instruction %d lit une/des broche(s)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1446,11 +1452,12 @@ msgstr "" #, c-format msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)" msgstr "" +"first_out_pin manquant. Instruction %d est déplacée par la/les broche(s)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_out_pin. Instruction %d writes pin(s)" -msgstr "" +msgstr "first_out_pin manquant. Instruction %d écrit un/des broche(s)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1495,7 +1502,7 @@ msgstr "Aucun canal DMA trouvé" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA pacing timer found" -msgstr "" +msgstr "Aucun minuteur de rythme DMA trouvé" #: shared-module/adafruit_bus_device/I2CDevice.c #, c-format @@ -1850,11 +1857,11 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" -msgstr "" +msgstr "Taille du programme invalide" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program too large" -msgstr "" +msgstr "Programme trop grand" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." @@ -3443,8 +3450,9 @@ msgid "memory allocation failed, heap is locked" msgstr "l'allocation de mémoire a échoué, le tas est vérrouillé" #: py/objarray.c +#, fuzzy msgid "memoryview: length is not a multiple of itemsize" -msgstr "" +msgstr "memoryview: la longueur n'est pas un multiple de la taille d'un élément" #: py/builtinimport.c msgid "module not found" From a7baca2149cfa08b0ed2bb9b3f9a8df02c2df371 Mon Sep 17 00:00:00 2001 From: Hugo Dahl Date: Sun, 21 Feb 2021 16:17:35 +0000 Subject: [PATCH 066/159] Translated using Weblate (French) Currently translated at 99.0% (955 of 964 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 30368a28e0..89160a5bc4 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2021-02-21 16:19+0000\n" -"Last-Translator: David Glaude \n" +"Last-Translator: Hugo Dahl \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -1441,12 +1441,12 @@ msgstr "first_in_pin manquant. Instruction %d lit une/des broche(s)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)" -msgstr "" +msgstr "first_in_pin manquant. Instruction %d est déplacée par la/les broche(s)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d waits based on pin" -msgstr "" +msgstr "first_in_pin manquant. L'instruction %d attends dépends de la broche" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1462,7 +1462,7 @@ msgstr "first_out_pin manquant. Instruction %d écrit un/des broche(s)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_set_pin. Instruction %d sets pin(s)" -msgstr "" +msgstr "first_set_pin manquant. L'instruction %d règle la/les broche(s)" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." @@ -1588,13 +1588,13 @@ msgstr "Aucun réseau avec ce ssid" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No out in program" -msgstr "" +msgstr "Aucun out dans le programme" #: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c msgid "No pull up found on SDA or SCL; check your wiring" -msgstr "" +msgstr "Aucun pull up trouvé sur SDA ou SCL; vérifiez votre cablage" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1655,7 +1655,7 @@ msgstr "Uniquement 8 ou 16 bit mono avec " #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Only IN/OUT of up to 8 supported" -msgstr "" +msgstr "Seulement des IN/OUT jusqu'à 8 est supporté" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" @@ -1717,7 +1717,7 @@ msgstr "Plus de sockets" #: shared-bindings/bitops/__init__.c #, c-format msgid "Output buffer must be at least %d bytes" -msgstr "" +msgstr "Tampon de sortie doit être au moins %d octets" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1757,11 +1757,11 @@ msgstr "Permission refusée" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Pin count must be at least 1" -msgstr "" +msgstr "Nombre de broches doit être au moins 1" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" -msgstr "" +msgstr "Nombre de broches trop élevé" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c @@ -1799,7 +1799,7 @@ msgstr "" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Pins must share PWM slice" -msgstr "" +msgstr "Les broches doivent partager la tranche PWM" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1869,7 +1869,7 @@ msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "RAISE mode is not implemented" -msgstr "" +msgstr "Mode RAISE n'est pas implémenté" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" @@ -1881,7 +1881,7 @@ msgstr "Erreur d'initialisation du RNG (RNG Init)" #: ports/nrf/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" -msgstr "" +msgstr "RS485 n'est pas encore supporté sur cet appareil" #: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c @@ -1976,7 +1976,7 @@ msgstr "Erreur de réinitialisation SPI" #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" -msgstr "" +msgstr "Périphérique SPI est en untilisation" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" @@ -2010,11 +2010,11 @@ msgstr "Un contexte niveau serveur ne peut avoir de hostname" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Set pin count must be between 1 and 5" -msgstr "" +msgstr "Nombre de broches configurées doit être entre 1 et 5" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Side set pin count must be between 1 and 5" -msgstr "" +msgstr "Nombre de broches Side configurées doit être entre 1 et 5" #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" @@ -2049,11 +2049,11 @@ msgstr "La pile doit être au moins de 256" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" -msgstr "" +msgstr "Canal stéréo gauche doit être sur le canal PWM A" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo right must be on PWM channel B" -msgstr "" +msgstr "Canal stéréo droit doit être sur le canal PWM B" #: shared-bindings/multiterminal/__init__.c msgid "Stream missing readinto() or write() method." @@ -2202,7 +2202,7 @@ msgstr "Erreur de réinitialisation UART" #: ports/raspberrypi/common-hal/busio/UART.c msgid "UART not yet supported" -msgstr "" +msgstr "UART n'est pas encore supporté" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" From 8b5e0f2c623d1f0f83c1b2d2229d733076abd5a0 Mon Sep 17 00:00:00 2001 From: Hugo Dahl Date: Sun, 21 Feb 2021 16:21:46 +0000 Subject: [PATCH 067/159] Translated using Weblate (French) Currently translated at 100.0% (964 of 964 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 89160a5bc4..2a9ae9cb49 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-21 16:19+0000\n" +"PO-Revision-Date: 2021-02-21 16:22+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -1145,7 +1145,7 @@ msgid "Input/output error" msgstr "Erreur d'entrée/sortie" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format, fuzzy +#, c-format msgid "Instruction %d jumps on pin" msgstr "Instruction %d saute sur la broche" @@ -3450,9 +3450,8 @@ msgid "memory allocation failed, heap is locked" msgstr "l'allocation de mémoire a échoué, le tas est vérrouillé" #: py/objarray.c -#, fuzzy msgid "memoryview: length is not a multiple of itemsize" -msgstr "memoryview: la longueur n'est pas un multiple de la taille d'un élément" +msgstr "memoryview: length n'est pas un multiple de itemsize" #: py/builtinimport.c msgid "module not found" @@ -3775,7 +3774,7 @@ msgstr "pop sur %q vide" #: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c msgid "port must be >= 0" -msgstr "" +msgstr "port doit être >= 0" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3813,11 +3812,11 @@ msgstr "les deux boutons appuyés lors du démarrage.\n" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "pull_threshold must be between 1 and 32" -msgstr "" +msgstr "pull_threshold doit être entre 1 et 32" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "push_threshold must be between 1 and 32" -msgstr "" +msgstr "push_threshold doit être entre 1 et 32" #: extmod/modutimeq.c msgid "queue overflow" @@ -4239,7 +4238,7 @@ msgstr "watchdog timeout doit être supérieur à 0" #: shared-bindings/bitops/__init__.c #, c-format msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" +msgstr "width doit être entre 2 et 8 (inclusivement), non %d" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" From 8caa72cfc24266f9eaeb501ac756e9e8f2558b60 Mon Sep 17 00:00:00 2001 From: David Glaude Date: Sun, 21 Feb 2021 16:21:41 +0000 Subject: [PATCH 068/159] Translated using Weblate (French) Currently translated at 100.0% (964 of 964 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 2a9ae9cb49..cef47bb589 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2021-02-21 16:22+0000\n" -"Last-Translator: Hugo Dahl \n" +"Last-Translator: David Glaude \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -1845,15 +1845,15 @@ msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Program does IN without loading ISR" -msgstr "" +msgstr "Le programme fait des entrées sans charger d'ISR" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Program does OUT without loading OSR" -msgstr "" +msgstr "Le programme fait des sorties sans charger d'OSR" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program must contain at least one 16-bit instruction." -msgstr "" +msgstr "Le programme doit contenir au moins une instruction de 16 bits" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" @@ -1976,7 +1976,7 @@ msgstr "Erreur de réinitialisation SPI" #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" -msgstr "Périphérique SPI est en untilisation" +msgstr "Périphérique SPI utilisé" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" From 93bf269c0d56ec5d842ff908e149c635ab323107 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 21 Feb 2021 12:00:32 -0500 Subject: [PATCH 069/159] Avoid pulling in extra float-uint64 routines --- py/obj.h | 1 + py/objfloat.c | 9 +++++++++ shared-module/usb_cdc/Serial.c | 6 ++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/py/obj.h b/py/obj.h index 066562cc43..c3ab63b5cc 100644 --- a/py/obj.h +++ b/py/obj.h @@ -684,6 +684,7 @@ mp_obj_t mp_obj_new_bytearray_by_ref(size_t n, void *items); mp_obj_t mp_obj_new_int_from_float(mp_float_t val); mp_obj_t mp_obj_new_complex(mp_float_t real, mp_float_t imag); extern mp_float_t uint64_to_float(uint64_t ui64); +extern uint64_t float_to_uint64(float f); #endif mp_obj_t mp_obj_new_exception(const mp_obj_type_t *exc_type); mp_obj_t mp_obj_new_exception_arg1(const mp_obj_type_t *exc_type, mp_obj_t arg); diff --git a/py/objfloat.c b/py/objfloat.c index 80f10e816e..329a8b90e0 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -340,6 +340,15 @@ mp_float_t uint64_to_float(uint64_t ui64) { return (mp_float_t) ((uint32_t) (ui64 >> 32) * 4294967296.0f + (uint32_t) (ui64 & 0xffffffff)); } +// Convert a uint64_t to a 32-bit float to a uint64_t without invoking extra math routines. +// which are large. +// Assume f >= 0. +uint64_t float_to_uint64(float f) { + // 4294967296 = 2^32 + const uint32_t upper_half = (uint32_t) (f / 4294967296.0f); + const uint32_t lower_half = (uint32_t) f; + return (((uint64_t) upper_half) << 32) + lower_half; +} #pragma GCC diagnostic pop #endif // MICROPY_PY_BUILTINS_FLOAT diff --git a/shared-module/usb_cdc/Serial.c b/shared-module/usb_cdc/Serial.c index 6037fddcc5..b4d8667ca6 100644 --- a/shared-module/usb_cdc/Serial.c +++ b/shared-module/usb_cdc/Serial.c @@ -41,7 +41,8 @@ size_t common_hal_usb_cdc_serial_read(usb_cdc_serial_obj_t *self, uint8_t *data, if (wait_forever || wait_for_timeout) { // Read more if we have time. - uint64_t timeout_ms = self->timeout * 1000; // Junk value if timeout < 0. + // Use special routine to avoid pulling in uint64-float-compatible math routines. + uint64_t timeout_ms = float_to_uint64(self->timeout * 1000); // Junk value if timeout < 0. uint64_t start_ticks = supervisor_ticks_ms64(); uint32_t num_read = 0; @@ -78,7 +79,8 @@ size_t common_hal_usb_cdc_serial_write(usb_cdc_serial_obj_t *self, const uint8_t if (wait_forever || wait_for_timeout) { // Write more if we have time. - uint64_t timeout_ms = self->write_timeout * 1000; // Junk value if write_timeout < 0. + // Use special routine to avoid pulling in uint64-float-compatible math routines. + uint64_t timeout_ms = float_to_uint64(self->write_timeout * 1000); // Junk value if write_timeout < 0. uint64_t start_ticks = supervisor_ticks_ms64(); uint32_t num_written = 0; From 8470f0fdb7ce37bc476b624c4172c9ea46231388 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 21 Feb 2021 12:37:59 -0500 Subject: [PATCH 070/159] SAMD21: one endpoint pair for MSC now instead of two --- ports/atmel-samd/mpconfigport.mk | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index e47acfb367..c77bf83f1e 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -48,10 +48,8 @@ CIRCUITPY_SDCARDIO ?= 0 # Not enough RAM for framebuffers CIRCUITPY_FRAMEBUFFERIO ?= 0 -# SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic. -# Because of that, there aren't enough endpoints for a secondary CDC serial connection. -USB_MSC_EP_NUM_OUT = 1 -CIRCUITPY_USB_CDC = 0 +# Not enough room in 192kB or 256kB builds for secondary CDC. +CIRCUITPY_USB_CDC ?= 0 CIRCUITPY_ULAB = 0 From 96c3b20d0e8e9f0bffa96b3f8f1b7bcf863a66ad Mon Sep 17 00:00:00 2001 From: Jose David M Date: Sun, 21 Feb 2021 16:51:21 +0000 Subject: [PATCH 071/159] Translated using Weblate (Spanish) Currently translated at 100.0% (964 of 964 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/locale/es.po b/locale/es.po index 29d5b2a485..c5e199719b 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-21 01:50+0000\n" -"Last-Translator: Rodrigo Argumedo \n" +"PO-Revision-Date: 2021-02-21 22:27+0000\n" +"Last-Translator: Jose David M \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -3427,6 +3427,7 @@ msgstr "la asignación de memoria falló, el heap está bloqueado" #: py/objarray.c msgid "memoryview: length is not a multiple of itemsize" msgstr "" +"memoryview: la longitud no es un múltiplo del tamaño del elemento (itemsize)" #: py/builtinimport.c msgid "module not found" From 51e712a9de479fc7a1a2add8579092e0980a33ae Mon Sep 17 00:00:00 2001 From: Hugo Dahl Date: Sun, 21 Feb 2021 16:22:01 +0000 Subject: [PATCH 072/159] Translated using Weblate (French) Currently translated at 100.0% (964 of 964 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index cef47bb589..a53d8658e1 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-21 16:22+0000\n" -"Last-Translator: David Glaude \n" +"PO-Revision-Date: 2021-02-21 22:27+0000\n" +"Last-Translator: Hugo Dahl \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -1853,7 +1853,7 @@ msgstr "Le programme fait des sorties sans charger d'OSR" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program must contain at least one 16-bit instruction." -msgstr "Le programme doit contenir au moins une instruction de 16 bits" +msgstr "Le programme doit contenir au moins une instruction de 16 bits." #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" From 8b7674f0c542490a89f68852b057564dbdbf9a42 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sun, 21 Feb 2021 14:20:01 +0000 Subject: [PATCH 073/159] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (964 of 964 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 08eac68a15..c283cdda81 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-21 01:50+0000\n" +"PO-Revision-Date: 2021-02-21 22:27+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -3438,7 +3438,7 @@ msgstr "" #: py/objarray.c msgid "memoryview: length is not a multiple of itemsize" -msgstr "" +msgstr "memoryview: o comprimento não é um múltiplo do tamanho dos itens" #: py/builtinimport.c msgid "module not found" From 07576b1c22d3f5fa2501b2a002b46b4b2a2d1693 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sun, 21 Feb 2021 15:07:12 +0000 Subject: [PATCH 074/159] Translated using Weblate (Swedish) Currently translated at 100.0% (964 of 964 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index b60733b7a0..7b82d7a7f2 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-21 01:50+0000\n" +"PO-Revision-Date: 2021-02-21 22:27+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -3401,7 +3401,7 @@ msgstr "minnesallokeringen misslyckades, heapen är låst" #: py/objarray.c msgid "memoryview: length is not a multiple of itemsize" -msgstr "" +msgstr "memoryview: längden är inte en multipel av itemsize" #: py/builtinimport.c msgid "module not found" From 144acfcb988479d6e5802bfa600a62be39d39be7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 21 Feb 2021 21:24:49 -0600 Subject: [PATCH 075/159] USB descriptors: Save flash storage for serial number This saves about 60 bytes (Feather M4 went from 45040 -> 45100 bytes free) 66 bytes of data eliminated, but 6 bytes paid back to initialize the length field. --- supervisor/shared/usb/usb.c | 1 + tools/gen_usb_descriptor.py | 42 +++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index 5b020b8a00..3c777c5056 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -62,6 +62,7 @@ void load_serial_number(void) { uint8_t raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH]; common_hal_mcu_processor_get_uid(raw_id); + usb_serial_number[0] = 0x300 | MP_ARRAY_SIZE(usb_serial_number); for (int i = 0; i < COMMON_HAL_MCU_PROCESSOR_UID_LENGTH; i++) { for (int j = 0; j < 2; j++) { uint8_t nibble = (raw_id[i] >> (j * 4)) & 0xf; diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index 089d00ff23..b21cfd920f 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -778,30 +778,32 @@ for idx, descriptor in enumerate(string_descriptors): variable_name = StringIndex.index_to_variable[idx] if not variable_name: variable_name = "string_descriptor{}".format(idx) + pointers_to_strings.append("{name}".format(name=variable_name)) const = "const " if variable_name == "usb_serial_number": - const = "" - c_file.write( - """\ -{const}uint16_t {NAME}[] = {{ -""".format( - const=const, NAME=variable_name + length = len(b) + c_file.write(" uint16_t {NAME}[{length}];\n".format(NAME=variable_name, length=length//2)) + else: + c_file.write( + """\ + const uint16_t {NAME}[] = {{ + """.format( + const=const, NAME=variable_name + ) ) - ) - pointers_to_strings.append("{name}".format(name=variable_name)) - n = 0 - while i < len(b): - length = b[i] - for j in range(length // 2): - c_file.write("0x{:04x}, ".format(b[i + 2 * j + 1] << 8 | b[i + 2 * j])) - n += 1 - c_file.write("\n") - i += length - c_file.write( - """\ -}; -""" + n = 0 + while i < len(b): + length = b[i] + for j in range(length // 2): + c_file.write("0x{:04x}, ".format(b[i + 2 * j + 1] << 8 | b[i + 2 * j])) + n += 1 + c_file.write("\n") + i += length + c_file.write( + """\ + }; + """ ) c_file.write( From aa1de6964588ee4b3f7d7490f80030fd89394eb6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 22 Feb 2021 07:33:04 -0600 Subject: [PATCH 076/159] fix length of generated serial number descriptor --- supervisor/shared/usb/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index 3c777c5056..aa35b95e60 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -62,7 +62,7 @@ void load_serial_number(void) { uint8_t raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH]; common_hal_mcu_processor_get_uid(raw_id); - usb_serial_number[0] = 0x300 | MP_ARRAY_SIZE(usb_serial_number); + usb_serial_number[0] = 0x300 | sizeof(usb_serial_number); for (int i = 0; i < COMMON_HAL_MCU_PROCESSOR_UID_LENGTH; i++) { for (int j = 0; j < 2; j++) { uint8_t nibble = (raw_id[i] >> (j * 4)) & 0xf; From 0aafeac20915fc2844f009cc210c76a4fec32c55 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 22 Feb 2021 17:19:18 -0800 Subject: [PATCH 077/159] Board specific flash sizes for RP2040 Stop-gap solution for #4041. Comment is there to provide info needed in the future. (We currently run the generic "safe" settings.) --- .../raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h | 3 +++ ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h | 3 +++ ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h | 3 +++ ports/raspberrypi/supervisor/internal_flash.c | 3 --- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h index 6a2d063d79..f82f6b6a74 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h @@ -12,3 +12,6 @@ // #define DEFAULT_UART_BUS_RX (&pin_PA11) // #define DEFAULT_UART_BUS_TX (&pin_PA10) + +// Flash chip is GD25Q32 connected over QSPI +#define TOTAL_FLASH_SIZE 4 * 1024 * 1024 diff --git a/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h index 26abe8a835..85398d5e96 100644 --- a/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h @@ -12,3 +12,6 @@ // #define DEFAULT_UART_BUS_RX (&pin_PA11) // #define DEFAULT_UART_BUS_TX (&pin_PA10) + +// Flash chip is GD25Q32 connected over QSPI +#define TOTAL_FLASH_SIZE 4 * 1024 * 1024 diff --git a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h index 4b0a220287..316692dd91 100644 --- a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h +++ b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h @@ -13,3 +13,6 @@ // #define DEFAULT_UART_BUS_RX (&pin_PA11) // #define DEFAULT_UART_BUS_TX (&pin_PA10) + +// Flash chip is W25Q16JVUXIQ connected over QSPI +#define TOTAL_FLASH_SIZE 2 * 1024 * 1024 diff --git a/ports/raspberrypi/supervisor/internal_flash.c b/ports/raspberrypi/supervisor/internal_flash.c index d333830de9..95c1fdd75e 100644 --- a/ports/raspberrypi/supervisor/internal_flash.c +++ b/ports/raspberrypi/supervisor/internal_flash.c @@ -46,9 +46,6 @@ #define RESERVED_FLASH 1 * 1024 * 1024 -// TODO: Parameterize flash size based on the configured flash. -#define TOTAL_FLASH_SIZE 2 * 1024 * 1024 - // TODO: Split the caching out of supervisor/shared/external_flash so we can use it. #define SECTOR_SIZE 4096 #define NO_CACHE 0xffffffff From 863981a5b845e2f3e8c47cc9fb44c51e3af80f55 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 22 Feb 2021 18:31:45 -0800 Subject: [PATCH 078/159] Parens --- .../raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h | 2 +- ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h | 2 +- ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h index f82f6b6a74..f491a77698 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h @@ -14,4 +14,4 @@ // #define DEFAULT_UART_BUS_TX (&pin_PA10) // Flash chip is GD25Q32 connected over QSPI -#define TOTAL_FLASH_SIZE 4 * 1024 * 1024 +#define TOTAL_FLASH_SIZE (4 * 1024 * 1024) diff --git a/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h index 85398d5e96..3f47784572 100644 --- a/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h @@ -14,4 +14,4 @@ // #define DEFAULT_UART_BUS_TX (&pin_PA10) // Flash chip is GD25Q32 connected over QSPI -#define TOTAL_FLASH_SIZE 4 * 1024 * 1024 +#define TOTAL_FLASH_SIZE (4 * 1024 * 1024) diff --git a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h index 316692dd91..a506fec49e 100644 --- a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h +++ b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h @@ -15,4 +15,4 @@ // #define DEFAULT_UART_BUS_TX (&pin_PA10) // Flash chip is W25Q16JVUXIQ connected over QSPI -#define TOTAL_FLASH_SIZE 2 * 1024 * 1024 +#define TOTAL_FLASH_SIZE (2 * 1024 * 1024) From 3fdf29e773852367ce433ffc9a3a5bbd7b3f379e Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 22 Feb 2021 18:35:09 -0800 Subject: [PATCH 079/159] More parens --- ports/raspberrypi/supervisor/internal_flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/supervisor/internal_flash.c b/ports/raspberrypi/supervisor/internal_flash.c index 95c1fdd75e..e8ee5cf1a6 100644 --- a/ports/raspberrypi/supervisor/internal_flash.c +++ b/ports/raspberrypi/supervisor/internal_flash.c @@ -44,7 +44,7 @@ #include "src/rp2_common/hardware_flash/include/hardware/flash.h" #include "src/common/pico_binary_info/include/pico/binary_info.h" -#define RESERVED_FLASH 1 * 1024 * 1024 +#define RESERVED_FLASH (1 * 1024 * 1024) // TODO: Split the caching out of supervisor/shared/external_flash so we can use it. #define SECTOR_SIZE 4096 From a30d4ad25d0305c8aeb59c044e54606623115431 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 22 Feb 2021 23:03:11 -0500 Subject: [PATCH 080/159] set SUPEROPT_VM = 0 on most non-Express SAMD21 boards --- .../boards/8086_commander/mpconfigboard.mk | 3 +-- .../boards/arduino_mkr1300/mpconfigboard.mk | 1 + .../boards/arduino_mkrzero/mpconfigboard.mk | 1 - .../boards/arduino_nano_33_iot/mpconfigboard.mk | 3 +-- .../boards/bast_pro_mini_m0/mpconfigboard.mk | 1 + .../mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 17 +---------------- .../boards/cp_sapling_m0/mpconfigboard.mk | 10 ---------- .../boards/datum_distance/mpconfigboard.mk | 1 + .../boards/datum_imu/mpconfigboard.mk | 1 + .../boards/datum_light/mpconfigboard.mk | 1 + .../boards/datum_weather/mpconfigboard.mk | 1 + .../boards/escornabot_makech/mpconfigboard.mk | 1 + .../boards/feather_m0_basic/mpconfigboard.mk | 1 + .../atmel-samd/boards/fluff_m0/mpconfigboard.mk | 7 +------ .../atmel-samd/boards/gemma_m0/mpconfigboard.mk | 10 ---------- .../hallowing_m0_express/mpconfigboard.mk | 16 +--------------- .../boards/ndgarage_ndbit6/mpconfigboard.mk | 1 + .../boards/ndgarage_ndbit6_v2/mpconfigboard.mk | 1 + .../boards/neopixel_trinkey_m0/mpconfigboard.mk | 12 +----------- .../atmel-samd/boards/pewpew10/mpconfigboard.mk | 8 +------- .../boards/picoplanet/mpconfigboard.mk | 10 ---------- .../boards/pirkey_m0/mpconfigboard.mk | 5 ++--- .../atmel-samd/boards/pyruler/mpconfigboard.mk | 8 ++------ .../atmel-samd/boards/qtpy_m0/mpconfigboard.mk | 2 -- .../atmel-samd/boards/serpente/mpconfigboard.mk | 14 -------------- .../atmel-samd/boards/shirtty/mpconfigboard.mk | 3 +-- .../mpconfigboard.mk | 2 ++ .../boards/sparkfun_samd21_dev/mpconfigboard.mk | 7 +------ .../boards/trinket_m0/mpconfigboard.mk | 1 - ports/atmel-samd/boards/uchip/mpconfigboard.mk | 4 +--- 31 files changed, 27 insertions(+), 128 deletions(-) diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk index f976dfe787..295d7b2aea 100644 --- a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk @@ -15,8 +15,7 @@ CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_USB_MIDI = 0 SUPEROPT_GC = 0 - -CFLAGS_INLINE_LIMIT = 60 +SUPEROPT_VM = 0 CIRCUITPY_GAMEPAD = 1 CIRCUITPY_BUSDEVICE = 1 diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index 36d463697d..1fd96b0aee 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -9,5 +9,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 + SUPEROPT_GC = 0 SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index 20307fc051..fabe52ce23 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -12,4 +12,3 @@ CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 SUPEROPT_VM = 0 -CFLAGS_INLINE_LIMIT = 40 diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk index 07b1b98002..c16c53e6d6 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk @@ -11,5 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -CFLAGS_BOARD = --param max-inline-insns-auto=15 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk index 6a2c896197..ec037837e5 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk @@ -11,3 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index ae0b6837c0..6d240686d7 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -22,7 +22,7 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 SUPEROPT_GC = 0 -CFLAGS_INLINE_LIMIT = 40 +SUPEROPT_VM = 0 # Include these Python libraries in firmware. diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index aace5c0cb5..2a97636ded 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -25,25 +25,10 @@ CIRCUITPY_RTC = 0 CIRCUITPY_VECTORIO = 0 SUPEROPT_GC = 0 -CFLAGS_INLINE_LIMIT = 55 +SUPEROPT_VM = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Thermistor - -CFLAGS_BOARD = --param max-inline-insns-auto=15 -ifeq ($(TRANSLATION), ja) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 15 -endif -ifeq ($(TRANSLATION), zh_Latn_pinyin) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif -ifeq ($(TRANSLATION), de_DE) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -SUPEROPT_VM = 0 -endif diff --git a/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.mk b/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.mk index 861a0a5f7d..3799d7ef73 100644 --- a/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.mk @@ -11,14 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -CFLAGS_BOARD = --param max-inline-insns-auto=15 -ifeq ($(TRANSLATION), zh_Latn_pinyin) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif -ifeq ($(TRANSLATION), de_DE) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 -endif diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk index ae05d32f2c..22b55f6fd5 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk @@ -11,3 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk index 6fd05f403b..7e99182912 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk @@ -11,3 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk index d42a7869de..5916f23b31 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk @@ -11,3 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk index d92cbc71b3..1065fb50aa 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk @@ -11,3 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk index e45b5aae35..ffe76d9307 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk @@ -12,3 +12,4 @@ CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_RTC = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index 69ebdfc237..183a80ffa4 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -11,3 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk index c040eb4304..52fcaec020 100644 --- a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk @@ -11,9 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -CFLAGS_BOARD = --param max-inline-insns-auto=15 -ifeq ($(TRANSLATION), zh_Latn_pinyin) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index e1c0f4b9a7..9d086c8f59 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -11,14 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -CFLAGS_BOARD = --param max-inline-insns-auto=15 -ifeq ($(TRANSLATION), zh_Latn_pinyin) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif -ifeq ($(TRANSLATION), de_DE) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 -endif diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index 2b211abd4e..6950378d53 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -25,22 +25,8 @@ CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 55 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel - -CFLAGS_BOARD = --param max-inline-insns-auto=15 -ifeq ($(TRANSLATION), ja) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif -ifeq ($(TRANSLATION), zh_Latn_pinyin) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif -ifeq ($(TRANSLATION), de_DE) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -SUPEROPT_VM = 0 -endif diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk index 09804bc4e7..3882e780eb 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk @@ -12,3 +12,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk index 193a0cf991..4ae1d8741d 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk @@ -12,3 +12,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/neopixel_trinkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/neopixel_trinkey_m0/mpconfigboard.mk index ab8065a9c5..8607385d22 100644 --- a/ports/atmel-samd/boards/neopixel_trinkey_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/neopixel_trinkey_m0/mpconfigboard.mk @@ -9,8 +9,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -SUPEROPT_GC = 0 - CIRCUITPY_ANALOGIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 @@ -28,16 +26,8 @@ CIRCUITPY_USB_MIDI = 1 CIRCUITPY_TOUCHIO = 1 CIRCUITPY_FULL_BUILD = 0 -CFLAGS_BOARD = --param max-inline-insns-auto=15 -ifeq ($(TRANSLATION), zh_Latn_pinyin) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif -ifeq ($(TRANSLATION), de_DE) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_GC = 0 SUPEROPT_VM = 0 -endif # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index fadcc21448..8b2ac7ff78 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -20,12 +20,6 @@ CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x - -CFLAGS_BOARD = --param max-inline-insns-auto=15 -ifeq ($(TRANSLATION), de_DE) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -SUPEROPT_VM = 0 -endif diff --git a/ports/atmel-samd/boards/picoplanet/mpconfigboard.mk b/ports/atmel-samd/boards/picoplanet/mpconfigboard.mk index da97b90cc2..e931553747 100644 --- a/ports/atmel-samd/boards/picoplanet/mpconfigboard.mk +++ b/ports/atmel-samd/boards/picoplanet/mpconfigboard.mk @@ -11,14 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -CFLAGS_BOARD = --param max-inline-insns-auto=15 -ifeq ($(TRANSLATION), zh_Latn_pinyin) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif -ifeq ($(TRANSLATION), de_DE) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 -endif diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk index 8b7066ac7a..b8ae779216 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk @@ -21,12 +21,11 @@ CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 1 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_FULL_BUILD = 0 -# Make more room. + SUPEROPT_GC = 0 +SUPEROPT_VM = 0 # Include these Python libraries in firmware. # FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_IRRemote - -CFLAGS_BOARD = --param max-inline-insns-auto=12 diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk index 4484b4ed94..1a73ade94d 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk @@ -11,10 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_RTC = 0 -SUPEROPT_GC = 0 -CFLAGS_BOARD = --param max-inline-insns-auto=15 -ifeq ($(TRANSLATION), zh_Latn_pinyin) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif +SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.mk b/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.mk index e100e2da62..c214006ead 100644 --- a/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.mk @@ -12,5 +12,3 @@ CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 SUPEROPT_VM = 0 - -CFLAGS_BOARD = --param max-inline-insns-auto=15 diff --git a/ports/atmel-samd/boards/serpente/mpconfigboard.mk b/ports/atmel-samd/boards/serpente/mpconfigboard.mk index 09036875f1..1f2c83316c 100644 --- a/ports/atmel-samd/boards/serpente/mpconfigboard.mk +++ b/ports/atmel-samd/boards/serpente/mpconfigboard.mk @@ -17,18 +17,4 @@ CIRCUITPY_GAMEPAD = 0 CIRCUITPY_BUSDEVICE = 0 SUPEROPT_GC = 0 - -CFLAGS_BOARD = --param max-inline-insns-auto=15 -ifeq ($(TRANSLATION), zh_Latn_pinyin) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif -ifeq ($(TRANSLATION), ja) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif -ifeq ($(TRANSLATION), de_DE) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 -endif diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk index 0b56e9ae02..70fe447232 100644 --- a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk @@ -13,5 +13,4 @@ CIRCUITPY_I2CPERIPHERAL = 1 CIRCUITPY_TOUCHIO = 0 SUPEROPT_GC = 0 - -CFLAGS_BOARD = --param max-inline-insns-auto=15 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk index 22e2059a93..435ee87fde 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk @@ -10,4 +10,6 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 + SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk index 3104be0a0f..bafcc02a2b 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk @@ -10,10 +10,5 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -ifeq ($(TRANSLATION),de_DE) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -SUPEROPT_VM = 0 -endif - SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index 1f88fbeade..6595fa164d 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -12,4 +12,3 @@ CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 SUPEROPT_VM = 0 -CFLAGS_INLINE_LIMIT = 45 diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index d08690a15a..d6ba805b14 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -10,7 +10,5 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -# Always use aggressive inlining -CFLAGS_INLINE_LIMIT = 45 - SUPEROPT_GC = 0 +SUPEROPT_VM = 0 From 78b2daa2a75d5b5e612433611314ec0d02e6784a Mon Sep 17 00:00:00 2001 From: Seon Rozenblum Date: Mon, 22 Feb 2021 14:41:34 +1100 Subject: [PATCH 081/159] Added Unexpected Maker TinyS2 board definition --- .github/workflows/build.yml | 1 + .../boards/unexpectedmaker_tinys2/board.c | 61 ++++++++++++++ .../unexpectedmaker_tinys2/mpconfigboard.h | 46 +++++++++++ .../unexpectedmaker_tinys2/mpconfigboard.mk | 23 ++++++ .../boards/unexpectedmaker_tinys2/pins.c | 79 +++++++++++++++++++ .../boards/unexpectedmaker_tinys2/sdkconfig | 39 +++++++++ 6 files changed, 249 insertions(+) create mode 100644 ports/esp32s2/boards/unexpectedmaker_tinys2/board.c create mode 100644 ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h create mode 100644 ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c create mode 100644 ports/esp32s2/boards/unexpectedmaker_tinys2/sdkconfig diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69dcaf46d1..8a31f364b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -453,6 +453,7 @@ jobs: - "targett_module_clip_wrover" - "unexpectedmaker_feathers2" - "unexpectedmaker_feathers2_prerelease" + - "unexpectedmaker_tinys2" steps: - name: Set up Python 3.8 diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/board.c b/ports/esp32s2/boards/unexpectedmaker_tinys2/board.c new file mode 100644 index 0000000000..d8fd3a0a2b --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_tinys2/board.c @@ -0,0 +1,61 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART +#ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); +#endif /* DEBUG */ + + // SPI Flash and RAM + common_hal_never_reset_pin(&pin_GPIO26); + common_hal_never_reset_pin(&pin_GPIO27); + common_hal_never_reset_pin(&pin_GPIO28); + common_hal_never_reset_pin(&pin_GPIO29); + common_hal_never_reset_pin(&pin_GPIO30); + common_hal_never_reset_pin(&pin_GPIO31); + common_hal_never_reset_pin(&pin_GPIO32); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} + +void board_deinit(void) { +} diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h new file mode 100644 index 0000000000..85f252328e --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h @@ -0,0 +1,46 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "TinyS2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO1) +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO9) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO44) +#define DEFAULT_UART_BUS_TX (&pin_GPIO43) diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk new file mode 100644 index 0000000000..aa022e1869 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk @@ -0,0 +1,23 @@ +USB_VID = 0x303A +USB_PID = 0x8002 +USB_PRODUCT = "TinyS2" +USB_MANUFACTURER = "UnexpectedMaker" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=qio +CIRCUITPY_ESP_FLASH_FREQ=80m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +# CIRCUITPY_MODULE=wroom + +CIRCUITPY_BITBANG_NEOPIXEL = 1 + +# Include these Python libraries in firmware. +# FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c b/ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c new file mode 100644 index 0000000000..8ca7d98649 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c @@ -0,0 +1,79 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + + + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, + // { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + // { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, + // { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, + // { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, + // { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + // { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) }, + // { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + // { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO6) }, + // { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + // { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, + // { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + + + { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + // { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + // { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + // { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) }, + // { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + // { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + // { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + // { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO9) }, + + + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + // { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) }, + // { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + // { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + // { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/sdkconfig b/ports/esp32s2/boards/unexpectedmaker_tinys2/sdkconfig new file mode 100644 index 0000000000..91447cdc2a --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_tinys2/sdkconfig @@ -0,0 +1,39 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO=y +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=2097152 + +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="UMTinyS2" +# end of LWIP From ca9b7debe0628680df8e4ea47c1b5f9f200519d7 Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Tue, 23 Feb 2021 10:43:35 +0000 Subject: [PATCH 082/159] Added flash size for Tiny2040 --- ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h index 8f188959cb..965dd0e042 100644 --- a/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h @@ -7,6 +7,8 @@ #define MICROPY_HW_USER_SW (&pin_GPIO23) +#define TOTAL_FLASH_SIZE (8 * 1024 * 1024) + // These pins are unconnected #define IGNORE_PIN_GPIO8 1 #define IGNORE_PIN_GPIO9 1 From a9951c9b6c883858e599d5102d5901278b3bf469 Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Tue, 23 Feb 2021 11:01:40 +0000 Subject: [PATCH 083/159] Added flash size for Keybow2040 --- ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h index ecc127db68..234be27c2c 100644 --- a/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h @@ -28,6 +28,8 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO1) #define DEFAULT_UART_BUS_TX (&pin_GPIO0) +#define TOTAL_FLASH_SIZE (2 * 1024 * 1024) + // These pins are unconnected #define IGNORE_PIN_GPIO2 1 #define IGNORE_PIN_GPIO22 1 From 1a0bf4c33f74a7a68a82948504240440b0795221 Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Tue, 23 Feb 2021 11:04:20 +0000 Subject: [PATCH 084/159] Added flash size for PicoSystem --- ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h index 8a61d6a76d..a1395f17d8 100644 --- a/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h +++ b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h @@ -38,6 +38,8 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO1) #define DEFAULT_UART_BUS_TX (&pin_GPIO0) +#define TOTAL_FLASH_SIZE (16 * 1024 * 1024) + // These pins are unconnected #define IGNORE_PIN_GPIO3 1 #define IGNORE_PIN_GPIO10 1 From 7a4198885e060bcb1071a9698fbe7e4a9564d581 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 23 Feb 2021 09:22:20 -0500 Subject: [PATCH 085/159] Fix typos for CIRCUITPY_USB_HID_SYS_CONTROL --- py/circuitpy_mpconfig.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 9d8e53ea7f..ad63866360 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -338,7 +338,7 @@ CIRCUITPY_USB_HID_MOUSE ?= 1 CFLAGS += -DCIRCUITPY_USB_HID_MOUSE=$(CIRCUITPY_USB_HID_MOUSE) CIRCUITPY_USB_HID_SYS_CONTROL ?= 0 -CFLAGS += -DCIRCUITPY_USB_HID_CONTROL=$(CIRCUITPY_USB_HID_CONTROL) +CFLAGS += -DCIRCUITPY_USB_HID_SYS_CONTROL=$(CIRCUITPY_USB_HID_SYS_CONTROL) CIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD ?= 0 CFLAGS += -DCIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD=$(CIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD) From 360475e26618cba98522d5dd86d0051d3a296fb3 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 23 Feb 2021 15:50:00 -0800 Subject: [PATCH 086/159] Implement audiobusio and enhance PIO for it This adds I2SOut and PDMIn support via PIO. StateMachines can now: * read and read while writing * transfer in 1, 2 or 4 byte increments * init pins based on expected defaults automatically * be stopped and restarted * rxfifo can be cleared and rxstalls detected (good for tracking when the reading code isn't keeping up) Fixes #4162 --- ports/raspberrypi/audio_dma.c | 17 + .../bindings/rp2pio/StateMachine.c | 355 ++++++++++++------ .../bindings/rp2pio/StateMachine.h | 38 +- .../common-hal/audiobusio/I2SOut.c | 224 +++++++++++ .../common-hal/audiobusio/I2SOut.h | 47 +++ .../raspberrypi/common-hal/audiobusio/PDMIn.c | 172 +++++++++ .../raspberrypi/common-hal/audiobusio/PDMIn.h | 50 +++ .../common-hal/audiobusio/__init__.c | 1 + .../common-hal/neopixel_write/__init__.c | 22 +- .../common-hal/rp2pio/StateMachine.c | 202 ++++++++-- .../common-hal/rp2pio/StateMachine.h | 7 + ports/raspberrypi/mpconfigport.mk | 2 +- ports/raspberrypi/supervisor/port.c | 3 + .../audiobusio/i2s_sample_loop.py | 36 ++ .../audiobusio/pdmin_rms.py | 44 +++ 15 files changed, 1038 insertions(+), 182 deletions(-) create mode 100644 ports/raspberrypi/common-hal/audiobusio/I2SOut.c create mode 100644 ports/raspberrypi/common-hal/audiobusio/I2SOut.h create mode 100644 ports/raspberrypi/common-hal/audiobusio/PDMIn.c create mode 100644 ports/raspberrypi/common-hal/audiobusio/PDMIn.h create mode 100644 ports/raspberrypi/common-hal/audiobusio/__init__.c create mode 100644 tests/circuitpython-manual/audiobusio/i2s_sample_loop.py create mode 100644 tests/circuitpython-manual/audiobusio/pdmin_rms.py diff --git a/ports/raspberrypi/audio_dma.c b/ports/raspberrypi/audio_dma.c index 96317984df..ccf08b1b49 100644 --- a/ports/raspberrypi/audio_dma.c +++ b/ports/raspberrypi/audio_dma.c @@ -39,6 +39,16 @@ #define AUDIO_DMA_CHANNEL_COUNT NUM_DMA_CHANNELS +void audio_dma_reset(void) { + for (size_t channel = 0; channel < AUDIO_DMA_CHANNEL_COUNT; channel++) { + if (MP_STATE_PORT(playing_audio)[channel] == NULL) { + continue; + } + + audio_dma_stop(MP_STATE_PORT(playing_audio)[channel]); + } +} + void audio_dma_convert_signed(audio_dma_t* dma, uint8_t* buffer, uint32_t buffer_length, uint8_t** output_buffer, uint32_t* output_buffer_length) { if (dma->first_buffer_free) { @@ -292,9 +302,16 @@ void audio_dma_stop(audio_dma_t* dma) { for (size_t i = 0; i < 2; i++) { size_t channel = dma->channel[i]; + dma_channel_config c = dma_channel_get_default_config(dma->channel[i]); + channel_config_set_enable(&c, false); + dma_channel_set_config(channel, &c, false /* trigger */); + if (dma_channel_is_busy(channel)) { dma_channel_abort(channel); } + dma_channel_set_read_addr(channel, NULL, false /* trigger */); + dma_channel_set_write_addr(channel, NULL, false /* trigger */); + dma_channel_set_trans_count(channel, 0, false /* trigger */); dma_channel_unclaim(channel); MP_STATE_PORT(playing_audio)[channel] = NULL; dma->channel[i] = NUM_DMA_CHANNELS; diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index 34633949ed..77f61acd03 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -36,6 +36,7 @@ #include "lib/utils/buffer_helper.h" #include "lib/utils/context_manager_helpers.h" #include "lib/utils/interrupt_char.h" +#include "py/binary.h" #include "py/mperrno.h" #include "py/objproperty.h" #include "py/runtime.h" @@ -64,16 +65,23 @@ //| init: Optional[ReadableBuffer] = None, //| first_out_pin: Optional[microcontroller.Pin] = None, //| out_pin_count: int = 1, +//| initial_out_pin_state: int = 0, +//| initial_out_pin_direction: int = 0xffffffff, //| first_in_pin: Optional[microcontroller.Pin] = None, //| in_pin_count: int = 1, //| first_set_pin: Optional[microcontroller.Pin] = None, //| set_pin_count: int = 1, +//| initial_set_pin_state: int = 0, +//| initial_set_pin_direction: int = 0x1f, //| first_sideset_pin: Optional[microcontroller.Pin] = None, //| sideset_pin_count: int = 1, +//| initial_sideset_pin_state: int = 0, +//| initial_sideset_pin_direction: int = 0x1f, //| exclusive_pin_use: bool = True, //| auto_pull: bool = False, //| pull_threshold : int = 32, //| out_shift_right : bool = True, +//| wait_for_txstall: bool = True, //| auto_push: bool = False, //| push_threshold : int = 32, //| in_shift_right : bool = True) -> None: @@ -87,12 +95,18 @@ //| is started so instructions may be intermingled //| :param ~microcontroller.Pin first_out_pin: the first pin to use with the OUT instruction //| :param int out_pin_count: the count of consecutive pins to use with OUT starting at first_out_pin +//| :param int initial_out_pin_state: the initial output value for out pins starting at first_out_pin +//| :param int initial_out_pin_direction: the initial output direction for out pins starting at first_out_pin //| :param ~microcontroller.Pin first_in_pin: the first pin to use with the IN instruction //| :param int in_pin_count: the count of consecutive pins to use with IN starting at first_in_pin //| :param ~microcontroller.Pin first_set_pin: the first pin to use with the SET instruction //| :param int set_pin_count: the count of consecutive pins to use with SET starting at first_set_pin +//| :param int initial_set_pin_state: the initial output value for set pins starting at first_set_pin +//| :param int initial_set_pin_direction: the initial output direction for set pins starting at first_set_pin //| :param ~microcontroller.Pin first_sideset_pin: the first pin to use with a side set //| :param int sideset_pin_count: the count of consecutive pins to use with a side set starting at first_sideset_pin +//| :param int initial_sideset_pin_state: the initial output value for sideset pins starting at first_sideset_pin +//| :param int initial_sideset_pin_direction: the initial output direction for sideset pins starting at first_sideset_pin //| :param bool exclusive_pin_use: When True, do not share any pins with other state machines. Pins are never shared with other peripherals //| :param bool auto_pull: When True, automatically load data from the tx FIFO into the //| output shift register (OSR) when an OUT instruction shifts more than pull_threshold bits @@ -100,6 +114,10 @@ //| :param bool out_shift_right: When True, data is shifted out the right side (LSB) of the //| OSR. It is shifted out the left (MSB) otherwise. NOTE! This impacts data alignment //| when the number of bytes is not a power of two (1, 2 or 4 bytes). +//| :param bool wait_for_txstall: When True, writing data out will block until the TX FIFO and OSR are empty +//| and an instruction is stalled waiting for more data. When False, data writes won't +//| wait for the OSR to empty (only the TX FIFO) so make sure you give enough time before +//| deiniting or stopping the state machine. //| :param bool auto_push: When True, automatically save data from input shift register //| (ISR) into the rx FIFO when an IN instruction shifts more than push_threshold bits //| :param int push_threshold: Number of bits to shift before saving the ISR value to the RX FIFO @@ -113,29 +131,42 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n rp2pio_statemachine_obj_t *self = m_new_obj(rp2pio_statemachine_obj_t); self->base.type = &rp2pio_statemachine_type; enum { ARG_program, ARG_frequency, ARG_init, - ARG_first_out_pin, ARG_out_pin_count, + ARG_first_out_pin, ARG_out_pin_count, ARG_initial_out_pin_state, ARG_initial_out_pin_direction, ARG_first_in_pin, ARG_in_pin_count, - ARG_first_set_pin, ARG_set_pin_count, - ARG_first_sideset_pin, ARG_sideset_pin_count, + ARG_first_set_pin, ARG_set_pin_count, ARG_initial_set_pin_state, ARG_initial_set_pin_direction, + ARG_first_sideset_pin, ARG_sideset_pin_count, ARG_initial_sideset_pin_state, ARG_initial_sideset_pin_direction, ARG_exclusive_pin_use, ARG_auto_pull, ARG_pull_threshold, ARG_out_shift_right, + ARG_wait_for_txstall, ARG_auto_push, ARG_push_threshold, ARG_in_shift_right}; static const mp_arg_t allowed_args[] = { { MP_QSTR_program, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_frequency, MP_ARG_REQUIRED | MP_ARG_INT }, { MP_QSTR_init, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_first_out_pin, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_out_pin_count, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} }, + { MP_QSTR_initial_out_pin_state, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_initial_out_pin_direction, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0xffffffff} }, + { MP_QSTR_first_in_pin, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_in_pin_count, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} }, + { MP_QSTR_first_set_pin, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_set_pin_count, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} }, + { MP_QSTR_initial_set_pin_state, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_initial_set_pin_direction, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0x1f} }, + { MP_QSTR_first_sideset_pin, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_sideset_pin_count, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} }, + { MP_QSTR_initial_sideset_pin_state, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_initial_sideset_pin_direction, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0x1f} }, + { MP_QSTR_exclusive_pin_use, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, { MP_QSTR_auto_pull, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, { MP_QSTR_pull_threshold, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 32} }, { MP_QSTR_out_shift_right, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, + { MP_QSTR_wait_for_txstall, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, { MP_QSTR_auto_push, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, { MP_QSTR_push_threshold, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 32} }, { MP_QSTR_in_shift_right, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, @@ -201,12 +232,13 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n bufinfo.buf, bufinfo.len / 2, args[ARG_frequency].u_int, init_bufinfo.buf, init_bufinfo.len / 2, - first_out_pin, args[ARG_out_pin_count].u_int, + first_out_pin, args[ARG_out_pin_count].u_int, args[ARG_initial_out_pin_state].u_int, args[ARG_initial_out_pin_direction].u_int, first_in_pin, args[ARG_in_pin_count].u_int, - first_set_pin, args[ARG_set_pin_count].u_int, - first_sideset_pin, args[ARG_sideset_pin_count].u_int, + first_set_pin, args[ARG_set_pin_count].u_int, args[ARG_initial_set_pin_state].u_int, args[ARG_initial_set_pin_direction].u_int, + first_sideset_pin, args[ARG_sideset_pin_count].u_int, args[ARG_initial_sideset_pin_state].u_int, args[ARG_initial_sideset_pin_direction].u_int, args[ARG_exclusive_pin_use].u_bool, args[ARG_auto_pull].u_bool, pull_threshold, args[ARG_out_shift_right].u_bool, + args[ARG_wait_for_txstall].u_bool, args[ARG_auto_push].u_bool, push_threshold, args[ARG_in_shift_right].u_bool); return MP_OBJ_FROM_PTR(self); } @@ -247,11 +279,53 @@ STATIC void check_for_deinit(rp2pio_statemachine_obj_t *self) { } } -// // | def restart(self, *other_state_machines) -> None: -// // | """Restarts this state machine and any others given. They must share -// // | an underlying PIO. An exception will be raised otherwise.""" -// // | ... -// // | +//| def restart(self) -> None: +//| """Resets this state machine, runs any init and enables the clock.""" +// TODO: "and any others given. They must share an underlying PIO. An exception will be raised otherwise."" +//| ... +//| +STATIC mp_obj_t rp2pio_statemachine_restart(mp_obj_t self_obj) { + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_obj); + check_for_deinit(self); + + common_hal_rp2pio_statemachine_restart(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_restart_obj, rp2pio_statemachine_restart); + + +//| def run(self, instructions: ReadableBuffer) -> None: +//| """Runs all given instructions. They will likely be interleaved with +//| in-memory instructions. Make sure this doesn't wait for input! +//| +//| This can be used to output internal state to the RX FIFO and then +//| read with `readinto`.""" +//| ... +//| +STATIC mp_obj_t rp2pio_statemachine_run(mp_obj_t self_obj, mp_obj_t instruction_obj) { + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_obj); + check_for_deinit(self); + + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(instruction_obj, &bufinfo, MP_BUFFER_READ); + + common_hal_rp2pio_statemachine_run(self, bufinfo.buf, bufinfo.len); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(rp2pio_statemachine_run_obj, rp2pio_statemachine_run); + +//| def stop(self) -> None: +//| """Stops the state machine clock. Use `restart` to enable it.""" +//| ... +//| +STATIC mp_obj_t rp2pio_statemachine_stop(mp_obj_t self_obj) { + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_obj); + check_for_deinit(self); + + common_hal_rp2pio_statemachine_stop(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_stop_obj, rp2pio_statemachine_stop); //| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None) -> None: //| """Write the data contained in ``buffer`` to the state machine. If the buffer is empty, nothing happens. @@ -261,7 +335,6 @@ STATIC void check_for_deinit(rp2pio_statemachine_obj_t *self) { //| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" //| ... //| - STATIC mp_obj_t rp2pio_statemachine_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_start, ARG_end }; static const mp_arg_t allowed_args[] = { @@ -279,12 +352,17 @@ STATIC mp_obj_t rp2pio_statemachine_write(size_t n_args, const mp_obj_t *pos_arg int32_t start = args[ARG_start].u_int; size_t length = bufinfo.len; normalize_buffer_bounds(&start, args[ARG_end].u_int, &length); - if (length == 0) { return mp_const_none; } - bool ok = common_hal_rp2pio_statemachine_write(self, ((uint8_t*)bufinfo.buf) + start, length); + uint8_t* original_pointer = bufinfo.buf; + int stride_in_bytes = mp_binary_get_size('@', bufinfo.typecode, NULL); + if (stride_in_bytes > 4) { + mp_raise_ValueError(translate("Buffer elements must be 4 bytes long or less")); + } + + bool ok = common_hal_rp2pio_statemachine_write(self, ((uint8_t*)bufinfo.buf) + start, length, stride_in_bytes); if (mp_hal_is_interrupted()) { return mp_const_none; } @@ -296,110 +374,132 @@ STATIC mp_obj_t rp2pio_statemachine_write(size_t n_args, const mp_obj_t *pos_arg MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine_write); -// // | def readinto(self, buffer: WriteableBuffer, *, start: int = 0, end: Optional[int] = None) -> None: -// // | """Read into ``buffer``. If the number of bytes to read is 0, nothing happens. -// // | -// // | :param ~_typing.WriteableBuffer buffer: Read data into this buffer -// // | :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]`` -// // | :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` -// // | :param int write_value: Value to write while reading. (Usually ignored.)""" -// // | ... -// // | +//| def readinto(self, buffer: WriteableBuffer, *, start: int = 0, end: Optional[int] = None) -> None: +//| """Read into ``buffer``. If the number of bytes to read is 0, nothing happens. The buffer +//| include any data added to the fifo even if it was added before this was called. +//| +//| :param ~_typing.WriteableBuffer buffer: Read data into this buffer +//| :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]`` +//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" +//| ... +//| -// STATIC mp_obj_t rp2pio_statemachine_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { -// enum { ARG_buffer, ARG_start, ARG_end, ARG_write_value }; -// static const mp_arg_t allowed_args[] = { -// { MP_QSTR_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, -// { MP_QSTR_start, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, -// { MP_QSTR_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, -// { MP_QSTR_write_value,MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, -// }; -// rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); -// check_for_deinit(self); -// check_lock(self); -// mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; -// mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); +STATIC mp_obj_t rp2pio_statemachine_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_buffer, ARG_start, ARG_end }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_start, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, + }; + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + check_for_deinit(self); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); -// mp_buffer_info_t bufinfo; -// mp_get_buffer_raise(args[ARG_buffer].u_obj, &bufinfo, MP_BUFFER_WRITE); -// int32_t start = args[ARG_start].u_int; -// size_t length = bufinfo.len; -// normalize_buffer_bounds(&start, args[ARG_end].u_int, &length); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[ARG_buffer].u_obj, &bufinfo, MP_BUFFER_WRITE); + int32_t start = args[ARG_start].u_int; + size_t length = bufinfo.len; + normalize_buffer_bounds(&start, args[ARG_end].u_int, &length); -// if (length == 0) { -// return mp_const_none; -// } + if (length == 0) { + return mp_const_none; + } -// bool ok = common_hal_rp2pio_statemachine_read(self, ((uint8_t*)bufinfo.buf) + start, length, args[ARG_write_value].u_int); -// if (!ok) { -// mp_raise_OSError(MP_EIO); -// } -// return mp_const_none; -// } -// MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_readinto_obj, 2, rp2pio_statemachine_readinto); + uint8_t* original_pointer = bufinfo.buf; + int stride_in_bytes = mp_binary_get_size('@', bufinfo.typecode, NULL); + if (stride_in_bytes > 4) { + mp_raise_ValueError(translate("Buffer elements must be 4 bytes long or less")); + } -// //| def write_readinto(self, buffer_out: ReadableBuffer, buffer_in: WriteableBuffer, *, out_start: int = 0, out_end: Optional[int] = None, in_start: int = 0, in_end: Optional[int] = None) -> None: -// //| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. -// //| The SPI object must be locked. -// //| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` -// //| must be equal. -// //| If buffer slice lengths are both 0, nothing happens. -// //| -// //| :param ~_typing.ReadableBuffer buffer_out: Write out the data in this buffer -// //| :param ~_typing.WriteableBuffer buffer_in: Read data into this buffer -// //| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` -// //| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` -// //| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` -// //| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" -// //| ... -// //| + bool ok = common_hal_rp2pio_statemachine_readinto(self, ((uint8_t*)bufinfo.buf) + start, length, stride_in_bytes); + if (!ok) { + mp_raise_OSError(MP_EIO); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_readinto_obj, 2, rp2pio_statemachine_readinto); -// STATIC mp_obj_t rp2pio_statemachine_write_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { -// enum { ARG_buffer_out, ARG_buffer_in, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; -// static const mp_arg_t allowed_args[] = { -// { MP_QSTR_buffer_out, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, -// { MP_QSTR_buffer_in, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, -// { MP_QSTR_out_start, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, -// { MP_QSTR_out_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, -// { MP_QSTR_in_start, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, -// { MP_QSTR_in_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, -// }; -// rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); -// check_for_deinit(self); -// check_lock(self); -// mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; -// mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); +//| def write_readinto(self, buffer_out: ReadableBuffer, buffer_in: WriteableBuffer, *, out_start: int = 0, out_end: Optional[int] = None, in_start: int = 0, in_end: Optional[int] = None) -> None: +//| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. +//| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` +//| may be different. The function will return once both are filled. +//| If buffer slice lengths are both 0, nothing happens. +//| +//| :param ~_typing.ReadableBuffer buffer_out: Write out the data in this buffer +//| :param ~_typing.WriteableBuffer buffer_in: Read data into this buffer +//| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` +//| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` +//| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` +//| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" +//| ... +//| -// mp_buffer_info_t buf_out_info; -// mp_get_buffer_raise(args[ARG_buffer_out].u_obj, &buf_out_info, MP_BUFFER_READ); -// int32_t out_start = args[ARG_out_start].u_int; -// size_t out_length = buf_out_info.len; -// normalize_buffer_bounds(&out_start, args[ARG_out_end].u_int, &out_length); +STATIC mp_obj_t rp2pio_statemachine_write_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_buffer_out, ARG_buffer_in, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_buffer_out, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_buffer_in, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_out_start, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_out_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, + { MP_QSTR_in_start, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_in_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, + }; + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + check_for_deinit(self); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); -// mp_buffer_info_t buf_in_info; -// mp_get_buffer_raise(args[ARG_buffer_in].u_obj, &buf_in_info, MP_BUFFER_WRITE); -// int32_t in_start = args[ARG_in_start].u_int; -// size_t in_length = buf_in_info.len; -// normalize_buffer_bounds(&in_start, args[ARG_in_end].u_int, &in_length); + mp_buffer_info_t buf_out_info; + mp_get_buffer_raise(args[ARG_buffer_out].u_obj, &buf_out_info, MP_BUFFER_READ); + int32_t out_start = args[ARG_out_start].u_int; + size_t out_length = buf_out_info.len; + normalize_buffer_bounds(&out_start, args[ARG_out_end].u_int, &out_length); -// if (out_length != in_length) { -// mp_raise_ValueError(translate("buffer slices must be of equal length")); -// } + mp_buffer_info_t buf_in_info; + mp_get_buffer_raise(args[ARG_buffer_in].u_obj, &buf_in_info, MP_BUFFER_WRITE); + int32_t in_start = args[ARG_in_start].u_int; + size_t in_length = buf_in_info.len; + normalize_buffer_bounds(&in_start, args[ARG_in_end].u_int, &in_length); -// if (out_length == 0) { -// return mp_const_none; -// } + if (out_length == 0 && in_length == 0) { + return mp_const_none; + } -// bool ok = common_hal_rp2pio_statemachine_transfer(self, -// ((uint8_t*)buf_out_info.buf) + out_start, -// ((uint8_t*)buf_in_info.buf) + in_start, -// out_length); -// if (!ok) { -// mp_raise_OSError(MP_EIO); -// } -// return mp_const_none; -// } -// MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_readinto_obj, 2, rp2pio_statemachine_write_readinto); + int in_stride_in_bytes = mp_binary_get_size('@', buf_in_info.typecode, NULL); + if (in_stride_in_bytes > 4) { + mp_raise_ValueError(translate("In buffer elements must be 4 bytes long or less")); + } + + int out_stride_in_bytes = mp_binary_get_size('@', buf_out_info.typecode, NULL); + if (out_stride_in_bytes > 4) { + mp_raise_ValueError(translate("Out buffer elements must be 4 bytes long or less")); + } + + bool ok = common_hal_rp2pio_statemachine_write_readinto(self, + ((uint8_t*)buf_out_info.buf) + out_start, + out_length, + out_stride_in_bytes, + ((uint8_t*)buf_in_info.buf) + in_start, + in_length, + in_stride_in_bytes); + if (!ok) { + mp_raise_OSError(MP_EIO); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_readinto_obj, 2, rp2pio_statemachine_write_readinto); + +//| def clear_rxfifo(self) -> None: +//| """Clears any unread bytes in the rxfifo.""" +//| ... +//| +STATIC mp_obj_t rp2pio_statemachine_obj_clear_rxfifo(mp_obj_t self_in) { + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_rp2pio_statemachine_clear_rxfifo(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_clear_rxfifo_obj, rp2pio_statemachine_obj_clear_rxfifo); //| frequency: int //| """The actual state machine frequency. This may not match the frequency requested @@ -413,9 +513,37 @@ STATIC mp_obj_t rp2pio_statemachine_obj_get_frequency(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_frequency_obj, rp2pio_statemachine_obj_get_frequency); +STATIC mp_obj_t rp2pio_statemachine_obj_set_frequency(mp_obj_t self_in, mp_obj_t frequency) { + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + common_hal_rp2pio_statemachine_set_frequency(self, mp_obj_get_int(frequency)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(rp2pio_statemachine_set_frequency_obj, rp2pio_statemachine_obj_set_frequency); + const mp_obj_property_t rp2pio_statemachine_frequency_obj = { .base.type = &mp_type_property, .proxy = {(mp_obj_t)&rp2pio_statemachine_get_frequency_obj, + (mp_obj_t)&rp2pio_statemachine_set_frequency_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| rxstall: bool +//| """True when the state machine has stalled due to a full RX FIFO since the last +//| `clear_rxfifo` call.""" +//| + +STATIC mp_obj_t rp2pio_statemachine_obj_get_rxstall(mp_obj_t self_in) { + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_rp2pio_statemachine_get_rxstall(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_rxstall_obj, rp2pio_statemachine_obj_get_rxstall); + +const mp_obj_property_t rp2pio_statemachine_rxstall_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&rp2pio_statemachine_get_rxstall_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; @@ -425,12 +553,17 @@ STATIC const mp_rom_map_elem_t rp2pio_statemachine_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&rp2pio_statemachine_obj___exit___obj) }, -// { MP_ROM_QSTR(MP_QSTR_restart), MP_ROM_PTR(&rp2pio_statemachine_configure_obj) }, + { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&rp2pio_statemachine_stop_obj) }, + { MP_ROM_QSTR(MP_QSTR_restart), MP_ROM_PTR(&rp2pio_statemachine_restart_obj) }, + { MP_ROM_QSTR(MP_QSTR_run), MP_ROM_PTR(&rp2pio_statemachine_run_obj) }, + { MP_ROM_QSTR(MP_QSTR_clear_rxfifo), MP_ROM_PTR(&rp2pio_statemachine_clear_rxfifo_obj) }, -// { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&rp2pio_statemachine_readinto_obj) }, + { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&rp2pio_statemachine_readinto_obj) }, { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&rp2pio_statemachine_write_obj) }, -// { MP_ROM_QSTR(MP_QSTR_write_readinto), MP_ROM_PTR(&rp2pio_statemachine_write_readinto_obj) }, - { MP_ROM_QSTR(MP_QSTR_frequency), MP_ROM_PTR(&rp2pio_statemachine_frequency_obj) } + { MP_ROM_QSTR(MP_QSTR_write_readinto), MP_ROM_PTR(&rp2pio_statemachine_write_readinto_obj) }, + + { MP_ROM_QSTR(MP_QSTR_frequency), MP_ROM_PTR(&rp2pio_statemachine_frequency_obj) }, + { MP_ROM_QSTR(MP_QSTR_rxstall), MP_ROM_PTR(&rp2pio_statemachine_rxstall_obj) } }; STATIC MP_DEFINE_CONST_DICT(rp2pio_statemachine_locals_dict, rp2pio_statemachine_locals_dict_table); diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.h b/ports/raspberrypi/bindings/rp2pio/StateMachine.h index 5ff20a75bf..36e44f1918 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.h +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.h @@ -36,36 +36,38 @@ extern const mp_obj_type_t rp2pio_statemachine_type; // Construct an underlying SPI object. -extern void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, +void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, const uint16_t* program, size_t program_len, size_t frequency, const uint16_t* init, size_t init_len, - const mcu_pin_obj_t * first_out_pin, uint8_t out_pin_count, + const mcu_pin_obj_t * first_out_pin, uint8_t out_pin_count, uint32_t initial_out_pin_state, uint32_t initial_out_pin_direction, const mcu_pin_obj_t * first_in_pin, uint8_t in_pin_count, - const mcu_pin_obj_t * first_set_pin, uint8_t set_pin_count, - const mcu_pin_obj_t * first_sideset_pin, uint8_t sideset_pin_count, + const mcu_pin_obj_t * first_set_pin, uint8_t set_pin_count, uint32_t initial_set_pin_state, uint32_t initial_set_pin_direction, + const mcu_pin_obj_t * first_sideset_pin, uint8_t sideset_pin_count, uint32_t initial_sideset_pin_state, uint32_t initial_sideset_pin_direction, bool exclusive_pin_use, bool auto_pull, uint8_t pull_threshold, bool out_shift_right, + bool wait_for_txstall, bool auto_push, uint8_t push_threshold, bool in_shift_right); -extern void common_hal_rp2pio_statemachine_deinit(rp2pio_statemachine_obj_t *self); -extern bool common_hal_rp2pio_statemachine_deinited(rp2pio_statemachine_obj_t *self); +void common_hal_rp2pio_statemachine_deinit(rp2pio_statemachine_obj_t *self); +bool common_hal_rp2pio_statemachine_deinited(rp2pio_statemachine_obj_t *self); + +void common_hal_rp2pio_statemachine_restart(rp2pio_statemachine_obj_t *self); +void common_hal_rp2pio_statemachine_stop(rp2pio_statemachine_obj_t *self); +void common_hal_rp2pio_statemachine_run(rp2pio_statemachine_obj_t *self, const uint16_t *instructions, size_t len); // Writes out the given data. -extern bool common_hal_rp2pio_statemachine_write(rp2pio_statemachine_obj_t *self, const uint8_t *data, size_t len); +bool common_hal_rp2pio_statemachine_write(rp2pio_statemachine_obj_t *self, const uint8_t *data, size_t len, uint8_t stride_in_bytes); +bool common_hal_rp2pio_statemachine_readinto(rp2pio_statemachine_obj_t *self, uint8_t *data, size_t len, uint8_t stride_in_bytes); +bool common_hal_rp2pio_statemachine_write_readinto(rp2pio_statemachine_obj_t *self, + const uint8_t *data_out, size_t out_len, uint8_t out_stride_in_bytes, + uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes); -// // Reads in len bytes while outputting zeroes. -// extern bool common_hal_rp2pio_statemachine_read(rp2pio_statemachine_obj_t *self, uint8_t *data, size_t len, uint8_t write_value); - -// // Reads and write len bytes simultaneously. -// extern bool common_hal_rp2pio_statemachine_transfer(rp2pio_statemachine_obj_t *self, -// const uint8_t *data_out, size_t out_len, -// uint8_t *data_in, size_t in_len); - -// Return actual SPI bus frequency. +// Return actual state machine frequency. uint32_t common_hal_rp2pio_statemachine_get_frequency(rp2pio_statemachine_obj_t* self); +void common_hal_rp2pio_statemachine_set_frequency(rp2pio_statemachine_obj_t* self, uint32_t frequency); -// This is used by the supervisor to claim SPI devices indefinitely. -// extern void common_hal_rp2pio_statemachine_never_reset(rp2pio_statemachine_obj_t *self); +bool common_hal_rp2pio_statemachine_get_rxstall(rp2pio_statemachine_obj_t* self); +void common_hal_rp2pio_statemachine_clear_rxfifo(rp2pio_statemachine_obj_t *self); #endif // MICROPY_INCLUDED_RASPBERRYPI_BINDINGS_RP2PIO_STATEMACHINE_H diff --git a/ports/raspberrypi/common-hal/audiobusio/I2SOut.c b/ports/raspberrypi/common-hal/audiobusio/I2SOut.c new file mode 100644 index 0000000000..83a443834e --- /dev/null +++ b/ports/raspberrypi/common-hal/audiobusio/I2SOut.c @@ -0,0 +1,224 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include + +#include "mpconfigport.h" + +#include "py/gc.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "common-hal/audiobusio/I2SOut.h" +#include "shared-bindings/audiobusio/I2SOut.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-module/audiocore/__init__.h" +#include "bindings/rp2pio/StateMachine.h" +#include "supervisor/shared/translate.h" + +const uint16_t i2s_program[] = { +// ; Load the next set of samples +// ; /--- LRCLK +// ; |/-- BCLK +// ; || +// pull noblock side 0b01 ; Loads OSR with the next FIFO value or X + 0x8880, +// mov x osr side 0b01 ; Save the new value in case we need it again + 0xa827, +// set y 14 side 0b01 + 0xe84e, +// bitloop1: +// out pins 1 side 0b00 [2] + 0x6201, +// jmp y-- bitloop1 side 0b01 [2] + 0x0a83, +// out pins 1 side 0b10 [2] + 0x7201, +// set y 14 side 0b11 [2] + 0xfa4e, +// bitloop0: +// out pins 1 side 0b10 [2] + 0x7201, +// jmp y-- bitloop0 side 0b11 [2] + 0x1a87, +// out pins 1 side 0b00 [2] + 0x6201 +}; + +const uint16_t i2s_program_left_justified[] = { +// ; Load the next set of samples +// ; /--- LRCLK +// ; |/-- BCLK +// ; || +// pull noblock side 0b11 ; Loads OSR with the next FIFO value or X + 0x9880, +// mov x osr side 0b11 ; Save the new value in case we need it again + 0xb827, +// set y 14 side 0b11 + 0xf84e, +// bitloop1: +// out pins 1 side 0b00 [2] + 0x6201, +// jmp y-- bitloop1 side 0b01 [2] + 0x0a83, +// out pins 1 side 0b10 [2] + 0x6201, +// set y 14 side 0b01 [2] + 0xea4e, +// bitloop0: +// out pins 1 side 0b10 [2] + 0x7201, +// jmp y-- bitloop0 side 0b11 [2] + 0x1a87, +// out pins 1 side 0b10 [2] + 0x7201 +}; + +void i2sout_reset(void) { +} + +// Caller validates that pins are free. +void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self, + const mcu_pin_obj_t* bit_clock, const mcu_pin_obj_t* word_select, + const mcu_pin_obj_t* data, bool left_justified) { + if (bit_clock->number != word_select->number - 1) { + mp_raise_ValueError(translate("Bit clock and word select must be sequential pins")); + } + + const uint16_t* program = i2s_program; + size_t program_len = sizeof(i2s_program) / sizeof(i2s_program[0]); + if (left_justified) { + program = i2s_program_left_justified; + program_len = sizeof(i2s_program_left_justified) / sizeof(i2s_program_left_justified[0]);; + } + + // Use the state machine to manage pins. + common_hal_rp2pio_statemachine_construct(&self->state_machine, + program, program_len, + 44100 * 32 * 6, // Clock at 44.1 khz to warm the DAC up. + NULL, 0, + data, 1, 0, 0xffffffff, // out pin + NULL, 0, // in pins + NULL, 0, 0, 0x1f, // set pins + bit_clock, 2, 0, 0x1f, // sideset pins + true, // exclusive pin use + false, 32, false, // shift out left to start with MSB + false, // Wait for txstall + false, 32, false); // in settings + + self->playing = false; + audio_dma_init(&self->dma); +} + +bool common_hal_audiobusio_i2sout_deinited(audiobusio_i2sout_obj_t* self) { + return common_hal_rp2pio_statemachine_deinited(&self->state_machine); +} + +void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t* self) { + if (common_hal_audiobusio_i2sout_deinited(self)) { + return; + } + + common_hal_rp2pio_statemachine_deinit(&self->state_machine); +} + +void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, + mp_obj_t sample, bool loop) { + if (common_hal_audiobusio_i2sout_get_playing(self)) { + common_hal_audiobusio_i2sout_stop(self); + } + uint8_t bits_per_sample = audiosample_bits_per_sample(sample); + // Make sure we transmit a minimum of 16 bits. + // TODO: Maybe we need an intermediate object to upsample instead. This is + // only needed for some I2S devices that expect at least 8. + if (bits_per_sample < 16) { + bits_per_sample = 16; + } + // We always output stereo so output twice as many bits. + uint16_t bits_per_sample_output = bits_per_sample * 2; + size_t clocks_per_bit = 6; + uint32_t frequency = bits_per_sample_output * audiosample_sample_rate(sample); + common_hal_rp2pio_statemachine_set_frequency(&self->state_machine, clocks_per_bit * frequency); + common_hal_rp2pio_statemachine_restart(&self->state_machine); + + uint8_t channel_count = audiosample_channel_count(sample); + if (channel_count > 2) { + mp_raise_ValueError(translate("Too many channels in sample.")); + } + + audio_dma_result result = audio_dma_setup_playback( + &self->dma, + sample, + loop, + false, // single channel + 0, // audio channel + true, // output signed + bits_per_sample, + (uint32_t) &self->state_machine.pio->txf[self->state_machine.state_machine], // output register + self->state_machine.tx_dreq); // data request line + + if (result == AUDIO_DMA_DMA_BUSY) { + common_hal_audiobusio_i2sout_stop(self); + mp_raise_RuntimeError(translate("No DMA channel found")); + } else if (result == AUDIO_DMA_MEMORY_ERROR) { + common_hal_audiobusio_i2sout_stop(self); + mp_raise_RuntimeError(translate("Unable to allocate buffers for signed conversion")); + } + + // Turn on the state machine's clock. + + self->playing = true; +} + +void common_hal_audiobusio_i2sout_pause(audiobusio_i2sout_obj_t* self) { + audio_dma_pause(&self->dma); +} + +void common_hal_audiobusio_i2sout_resume(audiobusio_i2sout_obj_t* self) { + // Maybe: Clear any overrun/underrun errors + + audio_dma_resume(&self->dma); +} + +bool common_hal_audiobusio_i2sout_get_paused(audiobusio_i2sout_obj_t* self) { + return audio_dma_get_paused(&self->dma); +} + +void common_hal_audiobusio_i2sout_stop(audiobusio_i2sout_obj_t* self) { + audio_dma_stop(&self->dma); + + common_hal_rp2pio_statemachine_stop(&self->state_machine); + + self->playing = false; +} + +bool common_hal_audiobusio_i2sout_get_playing(audiobusio_i2sout_obj_t* self) { + bool playing = audio_dma_get_playing(&self->dma); + if (!playing && self->playing) { + common_hal_audiobusio_i2sout_stop(self); + } + return playing; +} diff --git a/ports/raspberrypi/common-hal/audiobusio/I2SOut.h b/ports/raspberrypi/common-hal/audiobusio/I2SOut.h new file mode 100644 index 0000000000..851e86c8a9 --- /dev/null +++ b/ports/raspberrypi/common-hal/audiobusio/I2SOut.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_AUDIOBUSIO_I2SOUT_H +#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_AUDIOBUSIO_I2SOUT_H + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/rp2pio/StateMachine.h" + +#include "audio_dma.h" +#include "py/obj.h" + +// We don't bit pack because we'll only have two at most. Its better to save code size instead. +typedef struct { + mp_obj_base_t base; + bool left_justified; + rp2pio_statemachine_obj_t state_machine; + bool playing; + audio_dma_t dma; +} audiobusio_i2sout_obj_t; + +void i2sout_reset(void); + +#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_AUDIOBUSIO_I2SOUT_H diff --git a/ports/raspberrypi/common-hal/audiobusio/PDMIn.c b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c new file mode 100644 index 0000000000..ffe09326f3 --- /dev/null +++ b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c @@ -0,0 +1,172 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include +#include + +#include "py/mperrno.h" +#include "py/runtime.h" +#include "shared-bindings/audiobusio/PDMIn.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/translate.h" + +#include "audio_dma.h" + +#define OVERSAMPLING 64 +#define SAMPLES_PER_BUFFER 32 + +// MEMS microphones must be clocked at at least 1MHz. +#define MIN_MIC_CLOCK 1000000 + +const uint16_t pdmin[] = { + // in pins 1 side 0b1 + 0x5001, + // push iffull side 0b0 + 0x8040 +}; + +// Caller validates that pins are free. +void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, + const mcu_pin_obj_t* clock_pin, + const mcu_pin_obj_t* data_pin, + uint32_t sample_rate, + uint8_t bit_depth, + bool mono, + uint8_t oversample) { + if (!(bit_depth == 16 || bit_depth == 8) || !mono || oversample != OVERSAMPLING) { + mp_raise_NotImplementedError(translate("Only 8 or 16 bit mono with " MP_STRINGIFY(OVERSAMPLING) "x oversampling is supported.")); + } + + // Use the state machine to manage pins. + common_hal_rp2pio_statemachine_construct(&self->state_machine, + pdmin, sizeof(pdmin) / sizeof(pdmin[0]), + 44100 * 32 * 2, // Clock at 44.1 khz to warm the DAC up. + NULL, 0, + NULL, 1, 0, 0xffffffff, // out pin + data_pin, 1, // in pins + NULL, 0, 0, 0x1f, // set pins + clock_pin, 1, 0, 0x1f, // sideset pins + true, // exclusive pin use + false, 32, false, // out settings + false, // Wait for txstall + false, 32, true); // in settings + + uint32_t actual_frequency = common_hal_rp2pio_statemachine_get_frequency(&self->state_machine); + if (actual_frequency < MIN_MIC_CLOCK) { + mp_raise_ValueError(translate("sampling rate out of range")); + } + + self->sample_rate = actual_frequency / oversample; + self->bit_depth = bit_depth; +} + +bool common_hal_audiobusio_pdmin_deinited(audiobusio_pdmin_obj_t* self) { + return common_hal_rp2pio_statemachine_deinited(&self->state_machine); +} + +void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t* self) { + if (common_hal_audiobusio_pdmin_deinited(self)) { + return; + } +} + +uint8_t common_hal_audiobusio_pdmin_get_bit_depth(audiobusio_pdmin_obj_t* self) { + return self->bit_depth; +} + +uint32_t common_hal_audiobusio_pdmin_get_sample_rate(audiobusio_pdmin_obj_t* self) { + return self->sample_rate; +} + +// a windowed sinc filter for 44 khz, 64 samples +// +// This filter is good enough to use for lower sample rates as +// well. It does not increase the noise enough to be a problem. +// +// In the long run we could use a fast filter like this to do the +// decimation and initial filtering in real time, filtering to a +// higher sample rate than specified. Then after the audio is +// recorded, a more expensive filter non-real-time filter could be +// used to down-sample and low-pass. +const uint16_t sinc_filter [OVERSAMPLING] = { + 0, 2, 9, 21, 39, 63, 94, 132, + 179, 236, 302, 379, 467, 565, 674, 792, + 920, 1055, 1196, 1341, 1487, 1633, 1776, 1913, + 2042, 2159, 2263, 2352, 2422, 2474, 2506, 2516, + 2506, 2474, 2422, 2352, 2263, 2159, 2042, 1913, + 1776, 1633, 1487, 1341, 1196, 1055, 920, 792, + 674, 565, 467, 379, 302, 236, 179, 132, + 94, 63, 39, 21, 9, 2, 0, 0 +}; + +#define REPEAT_32_TIMES(X) do { X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X } while(0) + +static uint16_t filter_sample(uint32_t pdm_samples[2]) { + uint16_t running_sum = 0; + const uint16_t *filter_ptr = sinc_filter; + for (uint8_t i = 0; i < 2; i++) { + uint32_t pdm_sample = pdm_samples[i]; + REPEAT_32_TIMES( { + if (pdm_sample & 0x1) { + running_sum += *filter_ptr; + } + filter_ptr++; + pdm_sample >>= 1; + } + ); + } + return running_sum; +} + +// output_buffer may be a byte buffer or a halfword buffer. +// output_buffer_length is the number of slots, not the number of bytes. +uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* self, + uint16_t* output_buffer, uint32_t output_buffer_length) { + uint32_t samples[2]; + size_t output_count = 0; + common_hal_rp2pio_statemachine_clear_rxfifo(&self->state_machine); + // Do one read to get the mic going and throw it away. + common_hal_rp2pio_statemachine_readinto(&self->state_machine, (uint8_t*) samples, 2 * sizeof(uint32_t), sizeof(uint32_t)); + while (output_count < output_buffer_length && !common_hal_rp2pio_statemachine_get_rxstall(&self->state_machine)) { + common_hal_rp2pio_statemachine_readinto(&self->state_machine, (uint8_t*) samples, 2 * sizeof(uint32_t), sizeof(uint32_t)); + // Call filter_sample just one place so it can be inlined. + uint16_t value = filter_sample(samples); + if (self->bit_depth == 8) { + // Truncate to 8 bits. + ((uint8_t*) output_buffer)[output_count] = value >> 8; + } else { + output_buffer[output_count] = value; + } + output_count++; + } + + return output_count; +} + +void common_hal_audiobusio_pdmin_record_to_file(audiobusio_pdmin_obj_t* self, uint8_t* buffer, uint32_t length) { + +} diff --git a/ports/raspberrypi/common-hal/audiobusio/PDMIn.h b/ports/raspberrypi/common-hal/audiobusio/PDMIn.h new file mode 100644 index 0000000000..995ffb5d78 --- /dev/null +++ b/ports/raspberrypi/common-hal/audiobusio/PDMIn.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_AUDIOBUSIO_AUDIOOUT_H +#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_AUDIOBUSIO_AUDIOOUT_H + +#include "common-hal/microcontroller/Pin.h" +#include "bindings/rp2pio/StateMachine.h" + +#include "extmod/vfs_fat.h" +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + uint32_t sample_rate; + uint8_t serializer; + uint8_t clock_unit; + uint8_t bytes_per_sample; + uint8_t bit_depth; + rp2pio_statemachine_obj_t state_machine; +} audiobusio_pdmin_obj_t; + +void pdmin_reset(void); + +void pdmin_background(void); + +#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_AUDIOBUSIO_AUDIOOUT_H diff --git a/ports/raspberrypi/common-hal/audiobusio/__init__.c b/ports/raspberrypi/common-hal/audiobusio/__init__.c new file mode 100644 index 0000000000..87db404966 --- /dev/null +++ b/ports/raspberrypi/common-hal/audiobusio/__init__.c @@ -0,0 +1 @@ +// No audiobusio module functions. diff --git a/ports/raspberrypi/common-hal/neopixel_write/__init__.c b/ports/raspberrypi/common-hal/neopixel_write/__init__.c index 561d438e2e..1f0b71ca09 100644 --- a/ports/raspberrypi/common-hal/neopixel_write/__init__.c +++ b/ports/raspberrypi/common-hal/neopixel_write/__init__.c @@ -54,27 +54,25 @@ const uint16_t neopixel_program[] = { 0xa142 }; -const uint16_t init_program[] = { - 0xe081 -}; - void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t num_bytes) { // Set everything up. rp2pio_statemachine_obj_t state_machine; // TODO: Cache the state machine after we create it once. We'll need a way to // change the pins then though. - uint8_t pin_number = digitalinout->pin->number; + uint32_t pins_we_use = 1 << digitalinout->pin->number; bool ok = rp2pio_statemachine_construct(&state_machine, neopixel_program, sizeof(neopixel_program) / sizeof(neopixel_program[0]), 800000 * 6, // 800 khz * 6 cycles per bit - init_program, 1, - NULL, 1, - NULL, 1, - digitalinout->pin, 1, - digitalinout->pin, 1, - 1 << pin_number, true, false, + NULL, 0, // init program + NULL, 1, // out + NULL, 1, // in + NULL, 1, // set + digitalinout->pin, 1, // sideset + 0, pins_we_use, // initial pin state + pins_we_use, true, false, true, 8, false, // TX, auto pull every 8 bits. shift left to output msb first + true, // Wait for txstall. If we don't, then we'll deinit too quickly. false, 32, true, // RX setting we don't use false); // claim pins if (!ok) { @@ -86,7 +84,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, // two. while (port_get_raw_ticks(NULL) < next_start_raw_ticks) {} - common_hal_rp2pio_statemachine_write(&state_machine, pixels, num_bytes); + common_hal_rp2pio_statemachine_write(&state_machine, pixels, num_bytes, 1 /* stride in bytes */); // Use a private deinit of the state machine that doesn't reset the pin. rp2pio_statemachine_deinit(&state_machine, true); diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index 90c48130e1..f0ee842efe 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -54,7 +54,6 @@ STATIC PIO pio_instances[2] = {pio0, pio1}; void _reset_statemachine(PIO pio, uint8_t sm, bool leave_pins) { uint8_t pio_index = pio_get_index(pio); - pio_sm_unclaim(pio, sm); uint32_t program_id = _current_program_id[pio_index][sm]; if (program_id == 0) { return; @@ -89,6 +88,7 @@ void _reset_statemachine(PIO pio, uint8_t sm, bool leave_pins) { } } _current_sm_pins[pio_index][sm] = 0; + pio_sm_unclaim(pio, sm); } void reset_rp2pio_statemachine(void) { @@ -130,8 +130,10 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, const mcu_pin_obj_t * first_in_pin, uint8_t in_pin_count, const mcu_pin_obj_t * first_set_pin, uint8_t set_pin_count, const mcu_pin_obj_t * first_sideset_pin, uint8_t sideset_pin_count, + uint32_t initial_pin_state, uint32_t initial_pin_direction, uint32_t pins_we_use, bool tx_fifo, bool rx_fifo, bool auto_pull, uint8_t pull_threshold, bool out_shift_right, + bool wait_for_txstall, bool auto_push, uint8_t push_threshold, bool in_shift_right, bool claim_pins) { // Create a program id that isn't the pointer so we can store it without storing the original object. @@ -199,6 +201,11 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, _current_sm_pins[pio_index][state_machine] = pins_we_use; _current_pins[pio_index] |= pins_we_use; + pio_sm_set_pins_with_mask(self->pio, state_machine, initial_pin_state, pins_we_use); + pio_sm_set_pindirs_with_mask(self->pio, state_machine, initial_pin_direction, pins_we_use); + self->initial_pin_state = initial_pin_state; + self->initial_pin_direction = initial_pin_direction; + for (size_t pin_number = 0; pin_number < TOTAL_GPIO_COUNT; pin_number++) { if ((pins_we_use & (1 << pin_number)) == 0) { continue; @@ -260,27 +267,38 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, self->out = tx_fifo; self->out_shift_right = out_shift_right; self->in_shift_right = in_shift_right; + self->wait_for_txstall = wait_for_txstall; + + self->init = init; + self->init_len = init_len; sm_config_set_fifo_join(&c, join); pio_sm_init(self->pio, self->state_machine, program_offset, &c); + common_hal_rp2pio_statemachine_run(self, init, init_len); + + common_hal_rp2pio_statemachine_set_frequency(self, frequency); pio_sm_set_enabled(self->pio, self->state_machine, true); - for (size_t i = 0; i < init_len; i++) { - pio_sm_exec(self->pio, self->state_machine, init[i]); - } return true; } +static uint32_t mask_and_rotate(const mcu_pin_obj_t* first_pin, uint32_t bit_count, uint32_t value) { + value = value & ((1 << bit_count) - 1); + uint32_t shift = first_pin->number; + return value << shift | value >> (32 - shift); +} + void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, const uint16_t* program, size_t program_len, size_t frequency, const uint16_t* init, size_t init_len, - const mcu_pin_obj_t * first_out_pin, uint8_t out_pin_count, + const mcu_pin_obj_t * first_out_pin, uint8_t out_pin_count, uint32_t initial_out_pin_state, uint32_t initial_out_pin_direction, const mcu_pin_obj_t * first_in_pin, uint8_t in_pin_count, - const mcu_pin_obj_t * first_set_pin, uint8_t set_pin_count, - const mcu_pin_obj_t * first_sideset_pin, uint8_t sideset_pin_count, + const mcu_pin_obj_t * first_set_pin, uint8_t set_pin_count, uint32_t initial_set_pin_state, uint32_t initial_set_pin_direction, + const mcu_pin_obj_t * first_sideset_pin, uint8_t sideset_pin_count, uint32_t initial_sideset_pin_state, uint32_t initial_sideset_pin_direction, bool exclusive_pin_use, bool auto_pull, uint8_t pull_threshold, bool out_shift_right, + bool wait_for_txstall, bool auto_push, uint8_t push_threshold, bool in_shift_right) { // First, check that all pins are free OR already in use by any PIO if exclusive_pin_use is false. @@ -397,9 +415,26 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, mp_raise_ValueError_varg(translate("Program does OUT without loading OSR")); } - if (in_pin_count > 8 || out_pin_count > 8) { - mp_raise_NotImplementedError(translate("Only IN/OUT of up to 8 supported")); + uint32_t initial_pin_state = mask_and_rotate(first_out_pin, out_pin_count, initial_out_pin_state); + uint32_t initial_pin_direction = mask_and_rotate(first_out_pin, out_pin_count, initial_out_pin_direction); + initial_set_pin_state = mask_and_rotate(first_set_pin, set_pin_count, initial_set_pin_state); + initial_set_pin_direction = mask_and_rotate(first_set_pin, set_pin_count, initial_set_pin_direction); + uint32_t set_out_overlap = mask_and_rotate(first_out_pin, out_pin_count, 0xffffffff) & + mask_and_rotate(first_set_pin, set_pin_count, 0xffffffff); + // Check that OUT and SET settings agree because we don't have a way of picking one over the other. + if ((initial_pin_state & set_out_overlap) != (initial_set_pin_state & set_out_overlap)) { + mp_raise_ValueError(translate("Initial set pin state conflicts with initial out pin state")); } + if ((initial_pin_direction & set_out_overlap) != (initial_set_pin_direction & set_out_overlap)) { + mp_raise_ValueError(translate("Initial set pin direcion conflicts with initial out pin direction")); + } + initial_pin_state |= initial_set_pin_state; + initial_pin_direction |= initial_set_pin_direction; + + // Sideset overrides OUT or SET so we always use its values. + uint32_t sideset_mask = mask_and_rotate(first_sideset_pin, sideset_pin_count, 0x1f); + initial_pin_state = (initial_pin_state & ~sideset_mask) | mask_and_rotate(first_sideset_pin, sideset_pin_count, initial_sideset_pin_state); + initial_pin_direction = (initial_pin_direction & ~sideset_mask) | mask_and_rotate(first_sideset_pin, sideset_pin_count, initial_sideset_pin_direction); bool ok = rp2pio_statemachine_construct(self, program, program_len, @@ -409,8 +444,10 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, first_in_pin, in_pin_count, first_set_pin, set_pin_count, first_sideset_pin, sideset_pin_count, + initial_pin_state, initial_pin_direction, pins_we_use, tx_fifo, rx_fifo, auto_pull, pull_threshold, out_shift_right, + wait_for_txstall, auto_push, push_threshold, in_shift_right, true /* claim pins */); if (!ok) { @@ -418,10 +455,47 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, } } +void common_hal_rp2pio_statemachine_restart(rp2pio_statemachine_obj_t *self) { + pio_sm_restart(self->pio, self->state_machine); + + uint8_t pio_index = pio_get_index(self->pio); + uint32_t pins_we_use = _current_sm_pins[pio_index][self->state_machine]; + pio_sm_set_pins_with_mask(self->pio, self->state_machine, self->initial_pin_state, pins_we_use); + pio_sm_set_pindirs_with_mask(self->pio, self->state_machine, self->initial_pin_direction, pins_we_use); + common_hal_rp2pio_statemachine_run(self, self->init, self->init_len); + pio_sm_set_enabled(self->pio, self->state_machine, true); +} + +void common_hal_rp2pio_statemachine_stop(rp2pio_statemachine_obj_t *self) { + pio_sm_set_enabled(self->pio, self->state_machine, false); +} + +void common_hal_rp2pio_statemachine_run(rp2pio_statemachine_obj_t *self, const uint16_t *instructions, size_t len) { + for (size_t i = 0; i < len; i++) { + pio_sm_exec(self->pio, self->state_machine, instructions[i]); + } +} + uint32_t common_hal_rp2pio_statemachine_get_frequency(rp2pio_statemachine_obj_t* self) { return self->actual_frequency; } +void common_hal_rp2pio_statemachine_set_frequency(rp2pio_statemachine_obj_t* self, uint32_t frequency) { + if (frequency == 0) { + frequency = clock_get_hz(clk_sys); + } + uint64_t frequency256 = ((uint64_t) clock_get_hz(clk_sys)) * 256; + uint64_t div256 = frequency256 / frequency; + if (frequency256 % div256 > 0) { + div256 += 1; + } + self->actual_frequency = frequency256 / div256; + + pio_sm_set_clkdiv_int_frac(self->pio, self->state_machine, div256 / 256, div256 % 256); + // Reset the clkdiv counter in case our new TOP is lower. + pio_sm_clkdiv_restart(self->pio, self->state_machine); +} + void rp2pio_statemachine_deinit(rp2pio_statemachine_obj_t *self, bool leave_pins) { uint8_t sm = self->state_machine; uint8_t pio_index = pio_get_index(self->pio); @@ -445,9 +519,21 @@ bool common_hal_rp2pio_statemachine_deinited(rp2pio_statemachine_obj_t *self) { return self->state_machine == NUM_PIO_STATE_MACHINES; } +enum dma_channel_transfer_size _stride_to_dma_size(uint8_t stride) { + switch (stride) { + case 4: + return DMA_SIZE_32; + case 2: + return DMA_SIZE_16; + case 1: + default: + return DMA_SIZE_8; + } +} + static bool _transfer(rp2pio_statemachine_obj_t *self, - const uint8_t *data_out, size_t out_len, - uint8_t *data_in, size_t in_len) { + const uint8_t *data_out, size_t out_len, uint8_t out_stride_in_bytes, + uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes) { // This implementation is based on SPI but varies because the tx and rx buffers // may be different lengths and occur at different times or speeds. @@ -472,42 +558,43 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, if (tx) { tx_destination = (volatile uint8_t*) &self->pio->txf[self->state_machine]; if (!self->out_shift_right) { - tx_destination += 3; + tx_destination += 4 - out_stride_in_bytes; } } if (rx) { rx_source = (const volatile uint8_t*) &self->pio->rxf[self->state_machine]; - if (!self->in_shift_right) { - rx_source += 3; + if (self->in_shift_right) { + rx_source += 4 - in_stride_in_bytes; } } + uint32_t stall_mask = 1 << (PIO_FDEBUG_TXSTALL_LSB + self->state_machine); bool use_dma = (!rx || chan_rx >= 0) && (!tx || chan_tx >= 0); if (use_dma) { dma_channel_config c; uint32_t channel_mask = 0; if (tx) { c = dma_channel_get_default_config(chan_tx); - channel_config_set_transfer_data_size(&c, DMA_SIZE_8); + channel_config_set_transfer_data_size(&c, _stride_to_dma_size(out_stride_in_bytes)); channel_config_set_dreq(&c, self->tx_dreq); channel_config_set_read_increment(&c, true); channel_config_set_write_increment(&c, false); dma_channel_configure(chan_tx, &c, tx_destination, data_out, - len, + out_len / out_stride_in_bytes, false); channel_mask |= 1u << chan_tx; } if (rx) { c = dma_channel_get_default_config(chan_rx); - channel_config_set_transfer_data_size(&c, DMA_SIZE_8); + channel_config_set_transfer_data_size(&c, _stride_to_dma_size(in_stride_in_bytes)); channel_config_set_dreq(&c, self->rx_dreq); channel_config_set_read_increment(&c, false); channel_config_set_write_increment(&c, true); dma_channel_configure(chan_rx, &c, data_in, rx_source, - len, + in_len / in_stride_in_bytes, false); channel_mask |= 1u << chan_rx; } @@ -528,7 +615,7 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, } } // Clear the stall bit so we can detect when the state machine is done transmitting. - self->pio->fdebug = PIO_FDEBUG_TXSTALL_BITS; + self->pio->fdebug = stall_mask; } // If we have claimed only one channel successfully, we should release immediately. This also @@ -542,27 +629,31 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, if (!use_dma && !mp_hal_is_interrupted()) { // Use software for small transfers, or if couldn't claim two DMA channels - size_t rx_remaining = in_len; - size_t tx_remaining = out_len; + size_t rx_remaining = in_len / in_stride_in_bytes; + size_t tx_remaining = out_len / out_stride_in_bytes; while (rx_remaining || tx_remaining) { - for (int i=0; i<32; i++) { - bool did_transfer = false; - if (tx_remaining && !pio_sm_is_tx_fifo_full(self->pio, self->state_machine)) { + while (tx_remaining && !pio_sm_is_tx_fifo_full(self->pio, self->state_machine)) { + if (out_stride_in_bytes == 1) { *tx_destination = *data_out; - data_out++; - --tx_remaining; - did_transfer = true; + } else if (in_stride_in_bytes == 2) { + *((uint16_t*) tx_destination) = *((uint16_t*) data_out); + } else if (in_stride_in_bytes == 4) { + *((uint32_t*) tx_destination) = *((uint32_t*) data_out); } - if (rx_remaining && !pio_sm_is_rx_fifo_empty(self->pio, self->state_machine)) { + data_out += out_stride_in_bytes; + --tx_remaining; + } + while (rx_remaining && !pio_sm_is_rx_fifo_empty(self->pio, self->state_machine)) { + if (in_stride_in_bytes == 1) { *data_in = (uint8_t) *rx_source; - data_in++; - --rx_remaining; - did_transfer = true; - } - if (!did_transfer) { - break; + } else if (in_stride_in_bytes == 2) { + *((uint16_t*) data_in) = *((uint16_t*) rx_source); + } else if (in_stride_in_bytes == 4) { + *((uint32_t*) data_in) = *((uint32_t*) rx_source); } + data_in += in_stride_in_bytes; + --rx_remaining; } RUN_BACKGROUND_TASKS; if (mp_hal_is_interrupted()) { @@ -570,24 +661,55 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, } } // Clear the stall bit so we can detect when the state machine is done transmitting. - self->pio->fdebug = PIO_FDEBUG_TXSTALL_BITS; + self->pio->fdebug = stall_mask; } // Wait for the state machine to finish transmitting the data we've queued // up. if (tx) { while (!pio_sm_is_tx_fifo_empty(self->pio, self->state_machine) || - (self->pio->fdebug & PIO_FDEBUG_TXSTALL_BITS) == 0) { + (self->wait_for_txstall && (self->pio->fdebug & stall_mask) == 0)) { RUN_BACKGROUND_TASKS; } } return true; } -// Writes out the given data. -bool common_hal_rp2pio_statemachine_write(rp2pio_statemachine_obj_t *self, - const uint8_t *data, size_t len) { +// TODO: Provide a way around these checks in case someone wants to use the FIFO +// with manually run code. + +bool common_hal_rp2pio_statemachine_write(rp2pio_statemachine_obj_t *self, const uint8_t *data, size_t len, uint8_t stride_in_bytes) { if (!self->out) { mp_raise_RuntimeError(translate("No out in program")); } - return _transfer(self, data, len, NULL, 0); + return _transfer(self, data, len, stride_in_bytes, NULL, 0, 0); +} + +bool common_hal_rp2pio_statemachine_readinto(rp2pio_statemachine_obj_t *self, uint8_t *data, size_t len, uint8_t stride_in_bytes) { + if (!self->in) { + mp_raise_RuntimeError(translate("No in in program")); + } + return _transfer(self, NULL, 0, 0, data, len, stride_in_bytes); +} + +bool common_hal_rp2pio_statemachine_write_readinto(rp2pio_statemachine_obj_t *self, + const uint8_t *data_out, size_t out_len, uint8_t out_stride_in_bytes, + uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes) { + if (!self->in || !self->out) { + mp_raise_RuntimeError(translate("No in or out in program")); + } + return _transfer(self, data_out, out_len, out_stride_in_bytes, data_in, in_len, in_stride_in_bytes); +} + +bool common_hal_rp2pio_statemachine_get_rxstall(rp2pio_statemachine_obj_t* self) { + uint32_t stall_mask = 1 << (PIO_FDEBUG_RXSTALL_LSB + self->state_machine); + return (self->pio->fdebug & stall_mask) != 0; +} + +void common_hal_rp2pio_statemachine_clear_rxfifo(rp2pio_statemachine_obj_t *self) { + uint8_t level = pio_sm_get_rx_fifo_level(self->pio, self->state_machine); + uint32_t stall_mask = 1 << (PIO_FDEBUG_RXSTALL_LSB + self->state_machine); + for (size_t i = 0; i < level; i++) { + (void) self->pio->rxf[self->state_machine]; + } + self->pio->fdebug = stall_mask; } diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.h b/ports/raspberrypi/common-hal/rp2pio/StateMachine.h index 6b70b6b5b5..f084e09860 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.h +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.h @@ -36,8 +36,13 @@ typedef struct { uint32_t pins; // Bitmask of what pins this state machine uses. int state_machine; PIO pio; + const uint16_t* init; + size_t init_len; + uint32_t initial_pin_state; + uint32_t initial_pin_direction; bool in; bool out; + bool wait_for_txstall; uint tx_dreq; uint rx_dreq; bool out_shift_right; @@ -56,8 +61,10 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, const mcu_pin_obj_t * first_in_pin, uint8_t in_pin_count, const mcu_pin_obj_t * first_set_pin, uint8_t set_pin_count, const mcu_pin_obj_t * first_sideset_pin, uint8_t sideset_pin_count, + uint32_t initial_pin_state, uint32_t initial_pin_direction, uint32_t pins_we_use, bool tx_fifo, bool rx_fifo, bool auto_pull, uint8_t pull_threshold, bool out_shift_right, + bool wait_for_txstall, bool auto_push, uint8_t push_threshold, bool in_shift_right, bool claim_pins); diff --git a/ports/raspberrypi/mpconfigport.mk b/ports/raspberrypi/mpconfigport.mk index ab85c59f9a..ecd095e4a6 100644 --- a/ports/raspberrypi/mpconfigport.mk +++ b/ports/raspberrypi/mpconfigport.mk @@ -38,7 +38,7 @@ CIRCUITPY_WATCHDOG = 1 # Audio via PWM CIRCUITPY_AUDIOIO = 0 -CIRCUITPY_AUDIOBUSIO ?= 0 # add this later +CIRCUITPY_AUDIOBUSIO ?= 1 CIRCUITPY_AUDIOCORE ?= 1 CIRCUITPY_AUDIOPWMIO ?= 1 diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c index 36d2e8275c..10651d36b6 100644 --- a/ports/raspberrypi/supervisor/port.c +++ b/ports/raspberrypi/supervisor/port.c @@ -112,6 +112,9 @@ void reset_port(void) { #if CIRCUITPY_AUDIOPWMIO audiopwmout_reset(); #endif + #if CIRCUITPY_AUDIOCORE + audio_dma_reset(); + #endif reset_all_pins(); } diff --git a/tests/circuitpython-manual/audiobusio/i2s_sample_loop.py b/tests/circuitpython-manual/audiobusio/i2s_sample_loop.py new file mode 100644 index 0000000000..c0ee5de315 --- /dev/null +++ b/tests/circuitpython-manual/audiobusio/i2s_sample_loop.py @@ -0,0 +1,36 @@ +import audiocore +import audiobusio +import board +import digitalio +import array +import time +import math +import rp2pio +import adafruit_pioasm + +time.sleep(10) + +trigger = digitalio.DigitalInOut(board.D4) +trigger.switch_to_output(True) + +# Generate one period of sine wav. +length = 8000 // 440 + +# signed 16 bit +s16 = array.array("h", [0] * length) +for i in range(length): + s16[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15)) + print(s16[i]) + +sample = audiocore.RawSample(s16, sample_rate=8000) + +dac = audiobusio.I2SOut(bit_clock=board.D10, + word_select=board.D11, data=board.D12) + +trigger.value = False +dac.play(sample, loop=True) +time.sleep(1) +dac.stop() +trigger.value = True + +print("done") diff --git a/tests/circuitpython-manual/audiobusio/pdmin_rms.py b/tests/circuitpython-manual/audiobusio/pdmin_rms.py new file mode 100644 index 0000000000..8d15957527 --- /dev/null +++ b/tests/circuitpython-manual/audiobusio/pdmin_rms.py @@ -0,0 +1,44 @@ +import audiobusio +import board +import digitalio +import array +import time +import math + +trigger = digitalio.DigitalInOut(board.D4) +trigger.switch_to_output(True) + +def mean(values): + return sum(values) / len(values) + + +def normalized_rms(values): + minbuf = int(mean(values)) + samples_sum = sum( + float(sample - minbuf) * (sample - minbuf) + for sample in values + ) + + return math.sqrt(samples_sum / len(values)) + +# signed 16 bit +s16 = array.array("H", [0] * 10000) + +pdm = audiobusio.PDMIn(clock_pin=board.D11, data_pin=board.D12, sample_rate=24000, bit_depth=16) + +print("starting read") +trigger.value = False +count = pdm.record(s16, len(s16)) +trigger.value = True +print("read done") +print("recorded {} samples".format(count)) +for v in s16[:count]: + print(v) + + +magnitude = normalized_rms(s16) +print("magnitude", magnitude) + +print("count", count) + +print("done") From abbbb91fa8813ac332e7a6618c45a2ebc2d82803 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 23 Feb 2021 16:25:02 -0800 Subject: [PATCH 087/159] Add state machine divisor check This causes an exception when setting a state machine too slow or too fast. Fixes #4222 --- ports/raspberrypi/common-hal/rp2pio/StateMachine.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index f0ee842efe..5973f47a2e 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -489,6 +489,10 @@ void common_hal_rp2pio_statemachine_set_frequency(rp2pio_statemachine_obj_t* sel if (frequency256 % div256 > 0) { div256 += 1; } + // 0 is interpreted as 0x10000 so it's valid. + if (div256 / 256 > 0x10000 || frequency > clock_get_hz(clk_sys)) { + mp_raise_ValueError_varg(translate("%q out of range"), MP_QSTR_frequency); + } self->actual_frequency = frequency256 / div256; pio_sm_set_clkdiv_int_frac(self->pio, self->state_machine, div256 / 256, div256 % 256); From 889f02abe4f00cae2ebf864d9ba2e6539eea4e35 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 23 Feb 2021 16:32:16 -0800 Subject: [PATCH 088/159] Translations --- locale/circuitpython.pot | 43 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f9ef4ad13c..36bfa83dea 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -102,6 +102,7 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -453,6 +454,10 @@ msgstr "" msgid "Below minimum frame rate" msgstr "" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "" @@ -494,6 +499,10 @@ msgstr "" msgid "Buffer + offset too small %d %d %d" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1074,6 +1083,10 @@ msgstr "" msgid "IV must be %d bytes long" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1088,6 +1101,14 @@ msgstr "" msgid "Init program size invalid" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1452,6 +1473,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "" @@ -1518,6 +1540,14 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "" @@ -1604,13 +1634,10 @@ msgid "Odd parity is not supported" msgstr "" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" @@ -1656,6 +1683,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "" @@ -2085,6 +2116,7 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2154,6 +2186,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "" @@ -3682,6 +3715,7 @@ msgstr "" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -3759,6 +3793,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "" From b7200286425363c430b7f4466c27e53ea67f7887 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Tue, 23 Feb 2021 23:23:14 -0600 Subject: [PATCH 089/159] Add bitmaptools module --- locale/circuitpython.pot | 9 +- py/circuitpy_defns.mk | 4 + py/circuitpy_mpconfig.h | 9 +- py/circuitpy_mpconfig.mk | 3 + shared-bindings/bitmaptools/__init__.c | 261 +++++++++++++++++++++++++ shared-bindings/bitmaptools/__init__.h | 42 ++++ shared-module/bitmaptools/__init__.c | 174 +++++++++++++++++ 7 files changed, 499 insertions(+), 3 deletions(-) create mode 100644 shared-bindings/bitmaptools/__init__.c create mode 100644 shared-bindings/bitmaptools/__init__.h create mode 100644 shared-module/bitmaptools/__init__.c diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f9ef4ad13c..834aa56aa0 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1852,7 +1852,7 @@ msgstr "" msgid "Read-only filesystem" msgstr "" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "" @@ -2683,6 +2683,10 @@ msgstr "" msgid "circle can only be registered in one parent" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "" @@ -3682,6 +3686,7 @@ msgstr "" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -3830,7 +3835,7 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "" diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 943c99f937..bb177c5d07 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -139,6 +139,9 @@ endif ifeq ($(CIRCUITPY_BITBANG_APA102),1) SRC_PATTERNS += bitbangio/SPI% endif +ifeq ($(CIRCUITPY_BITMAPTOOLS),1) +SRC_PATTERNS += bitmaptools/% +endif ifeq ($(CIRCUITPY_BITOPS),1) SRC_PATTERNS += bitops/% endif @@ -472,6 +475,7 @@ SRC_SHARED_MODULE_ALL = \ bitbangio/OneWire.c \ bitbangio/SPI.c \ bitbangio/__init__.c \ + bitmaptools/__init__.c \ bitops/__init__.c \ board/__init__.c \ adafruit_bus_device/__init__.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index cbe668289b..3eda3b0049 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -306,6 +306,13 @@ extern const struct _mp_obj_module_t bitbangio_module; #define BITBANGIO_MODULE #endif +#if CIRCUITPY_BITMAPTOOLS +#define BITMAPTOOLS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_bitmaptools), (mp_obj_t)&bitmaptools_module }, +extern const struct _mp_obj_module_t bitmaptools_module; +#else +#define BITMAPTOOLS_MODULE +#endif + #if CIRCUITPY_BITOPS extern const struct _mp_obj_module_t bitops_module; #define BITOPS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_bitops),(mp_obj_t)&bitops_module }, @@ -313,7 +320,6 @@ extern const struct _mp_obj_module_t bitops_module; #define BITOPS_MODULE #endif - #if CIRCUITPY_BLEIO #define BLEIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__bleio), (mp_obj_t)&bleio_module }, extern const struct _mp_obj_module_t bleio_module; @@ -835,6 +841,7 @@ extern const struct _mp_obj_module_t msgpack_module; AUDIOPWMIO_MODULE \ BINASCII_MODULE \ BITBANGIO_MODULE \ + BITMAPTOOLS_MODULE \ BITOPS_MODULE \ BLEIO_MODULE \ BOARD_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index ad63866360..d071aff050 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -95,6 +95,9 @@ CFLAGS += -DCIRCUITPY_BITBANG_APA102=$(CIRCUITPY_BITBANG_APA102) CIRCUITPY_BITBANGIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO) +CIRCUITPY_BITMAPTOOLS ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_BITMAPTOOLS=$(CIRCUITPY_BITMAPTOOLS) + CIRCUITPY_BITOPS ?= 0 CFLAGS += -DCIRCUITPY_BITOPS=$(CIRCUITPY_BITOPS) diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c new file mode 100644 index 0000000000..7f7e16bcb6 --- /dev/null +++ b/shared-bindings/bitmaptools/__init__.c @@ -0,0 +1,261 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Kevin Matocha + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/displayio/Bitmap.h" +#include "shared-bindings/bitmaptools/__init__.h" + +#include + +#include "py/obj.h" +#include "py/runtime.h" + +STATIC int16_t validate_point(mp_obj_t point, int16_t default_value) { + // Checks if point is None and returns default_value, otherwise decodes integer value + if ( point == mp_const_none ) { + return default_value; + } + return mp_obj_get_int(point); +} + +STATIC void extract_tuple(mp_obj_t xy_tuple, int16_t *x, int16_t *y, int16_t x_default, int16_t y_default) { + // Helper function for rotozoom + // Extract x,y values from a tuple or default if None + if ( xy_tuple == mp_const_none ) { + *x = x_default; + *y = y_default; + } else if ( !MP_OBJ_IS_OBJ(xy_tuple) ) { + mp_raise_ValueError(translate("clip point must be (x,y) tuple")); + } else { + mp_obj_t* items; + mp_obj_get_array_fixed_n(xy_tuple, 2, &items); + *x = mp_obj_get_int(items[0]); + *y = mp_obj_get_int(items[1]); + } +} + +STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tuple, int16_t *clip0_x, int16_t *clip0_y, + mp_obj_t clip1_tuple, int16_t *clip1_x, int16_t *clip1_y) { + // Helper function for rotozoom + // 1. Extract the clip x,y points from the two clip tuples + // 2. Rearrange values such that clip0_ < clip1_ + // 3. Constrain the clip points to within the bitmap + + extract_tuple(clip0_tuple, clip0_x, clip0_y, 0, 0); + extract_tuple(clip1_tuple, clip1_x, clip1_y, bitmap->width, bitmap->height); + + // Ensure the value for clip0 is less than clip1 (for both x and y) + if ( *clip0_x > *clip1_x ) { + int16_t temp_value = *clip0_x; // swap values + *clip0_x = *clip1_x; + *clip1_x = temp_value; + } + if ( *clip0_y > *clip1_y ) { + int16_t temp_value = *clip0_y; // swap values + *clip0_y = *clip1_y; + *clip1_y = temp_value; + } + + // Constrain the clip window to within the bitmap boundaries + if (*clip0_x < 0) { + *clip0_x = 0; + } + if (*clip0_y < 0) { + *clip0_y = 0; + } + if (*clip0_x > bitmap->width) { + *clip0_x = bitmap->width; + } + if (*clip0_y > bitmap->height) { + *clip0_y = bitmap->height; + } + if (*clip1_x < 0) { + *clip1_x = 0; + } + if (*clip1_y < 0) { + *clip1_y = 0; + } + if (*clip1_x > bitmap->width) { + *clip1_x = bitmap->width; + } + if (*clip1_y > bitmap->height) { + *clip1_y = bitmap->height; + } + +} + + +//| +//| def rotozoom(dest_bitmap: Bitmap, ox: int, oy: int, +//| dest_clip0: Tuple[int, int], +//| dest_clip1: Tuple[int, int], +//| source_bitmap: Bitmap, +//| px: int, py: int, +//| source_clip0: Tuple[int, int], +//| source_clip1: Tuple[int, int], +//| angle: float, +//| scale: float, +//| skip_index: int) -> None: +//| """Inserts the source bitmap region into the destination bitmap with rotation (angle), scale +//| and clipping (both on source and destination bitmaps). +//| +//| :param bitmap dest_bitmap: The bitmap that will be copied into +//| :param int ox: Horizontal pixel location in destination bitmap where source bitmap +//| point (px,py) is placed +//| :param int oy: Vertical pixel location in destination bitmap where source bitmap +//| point (px,py) is placed +//| :param dest_clip0: First corner of rectangular destination clipping +//| region that constrains region of writing into destination bitmap +//| :type dest_clip0: Tuple[int,int] +//| :param dest_clip1: second corner of rectangular destination clipping +//| region that constrains region of writing into destination bitmap +//| :type dest_clip1: Tuple[int,int] +//| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied +//| :param int px: Horizontal pixel location in source bitmap that is placed into the +//| destination bitmap at (ox,oy) +//| :param int py: Vertical pixel location in source bitmap that is placed into the +//| destination bitmap at (ox,oy) +//| :param source_clip0: First corner of rectangular destination clipping +//| region that constrains region of writing into destination bitmap +//| :type source_clip0: Tuple[int,int] +//| :param source_clip1: second corner of rectangular destination clipping +//| region that constrains region of writing into destination bitmap +//| :type source_clip1: Tuple[int,int] +//| :param float angle: angle of rotation, in radians (positive is clockwise direction) +//| :param float scale: scaling factor +//| :param int skip_index: bitmap palette index in the source that will not be copied, +//| set to None to copy all pixels""" +//| ... +//| +STATIC mp_obj_t bitmaptools_obj_rotozoom(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args){ + enum {ARG_dest_bitmap, ARG_ox, ARG_oy, ARG_dest_clip0, ARG_dest_clip1, + ARG_source_bitmap, ARG_px, ARG_py, + ARG_source_clip0, ARG_source_clip1, + ARG_angle, ARG_scale, ARG_skip_index}; + + static const mp_arg_t allowed_args[] = { + {MP_QSTR_dest_bitmap, MP_ARG_REQUIRED | MP_ARG_OBJ}, + {MP_QSTR_ox, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to destination->width / 2 + {MP_QSTR_oy, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to destination->height / 2 + {MP_QSTR_dest_clip0, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + {MP_QSTR_dest_clip1, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + + {MP_QSTR_source_bitmap, MP_ARG_REQUIRED | MP_ARG_OBJ}, + {MP_QSTR_px, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to source->width / 2 + {MP_QSTR_py, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to source->height / 2 + {MP_QSTR_source_clip0, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + {MP_QSTR_source_clip1, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + + {MP_QSTR_angle, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to 0.0 + {MP_QSTR_scale, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to 1.0 + {MP_QSTR_skip_index, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj=mp_const_none} }, + }; + + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + displayio_bitmap_t *destination = MP_OBJ_TO_PTR(args[ARG_dest_bitmap].u_obj); // the destination bitmap + + displayio_bitmap_t *source = MP_OBJ_TO_PTR(args[ARG_source_bitmap].u_obj); // the source bitmap + + // ensure that the destination bitmap has at least as many `bits_per_value` as the source + if (destination->bits_per_value < source->bits_per_value) { + mp_raise_ValueError(translate("source palette too large")); + } + + // Confirm the destination location target (ox,oy); if None, default to bitmap midpoint + int16_t ox, oy; + ox = validate_point(args[ARG_ox].u_obj, destination->width / 2); + oy = validate_point(args[ARG_oy].u_obj, destination->height / 2); + + // Confirm the source location target (px,py); if None, default to bitmap midpoint + int16_t px, py; + px = validate_point(args[ARG_px].u_obj, source->width / 2); + py = validate_point(args[ARG_py].u_obj, source->height / 2); + + // Validate the clipping regions for the destination bitmap + int16_t dest_clip0_x, dest_clip0_y, dest_clip1_x, dest_clip1_y; + + validate_clip_region(destination, args[ARG_dest_clip0].u_obj, &dest_clip0_x, &dest_clip0_y, + args[ARG_dest_clip1].u_obj, &dest_clip1_x, &dest_clip1_y); + + // Validate the clipping regions for the source bitmap + int16_t source_clip0_x, source_clip0_y, source_clip1_x, source_clip1_y; + + validate_clip_region(source, args[ARG_source_clip0].u_obj, &source_clip0_x, &source_clip0_y, + args[ARG_source_clip1].u_obj, &source_clip1_x, &source_clip1_y); + + // Confirm the angle value + float angle=0.0; + if ( args[ARG_angle].u_obj != mp_const_none ) { + angle = mp_obj_get_float(args[ARG_angle].u_obj); + } + + // Confirm the scale value + float scale=1.0; + if ( args[ARG_scale].u_obj != mp_const_none ) { + scale = mp_obj_get_float(args[ARG_scale].u_obj); + } + if (scale < 0) { // ensure scale >= 0 + scale = 1.0; + } + + uint32_t skip_index; + bool skip_index_none; // Flag whether input skip_value was None + if (args[ARG_skip_index].u_obj == mp_const_none ) { + skip_index = 0; + skip_index_none = true; + } else { + skip_index = mp_obj_get_int(args[ARG_skip_index].u_obj); + skip_index_none = false; + } + + common_hal_bitmaptools_rotozoom(destination, ox, oy, + dest_clip0_x, dest_clip0_y, + dest_clip1_x, dest_clip1_y, + source, px, py, + source_clip0_x, source_clip0_y, + source_clip1_x, source_clip1_y, + angle, + scale, + skip_index, skip_index_none); + + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_rotozoom_obj, 0, bitmaptools_obj_rotozoom); +// requires at least 2 arguments (destination bitmap and source bitmap) + + +STATIC const mp_rom_map_elem_t bitmaptools_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_rotozoom), MP_ROM_PTR(&bitmaptools_rotozoom_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(bitmaptools_module_globals, bitmaptools_module_globals_table); + + +const mp_obj_module_t bitmaptools_module = { + .base = {&mp_type_module }, + .globals = (mp_obj_dict_t*)&bitmaptools_module_globals, +}; diff --git a/shared-bindings/bitmaptools/__init__.h b/shared-bindings/bitmaptools/__init__.h new file mode 100644 index 0000000000..e2bb6938bc --- /dev/null +++ b/shared-bindings/bitmaptools/__init__.h @@ -0,0 +1,42 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Kevin Matocha + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_BITMAPTOOLS__INIT__H +#define MICROPY_INCLUDED_SHARED_BINDINGS_BITMAPTOOLS__INIT__H + +#include "py/obj.h" + +void common_hal_bitmaptools_rotozoom(displayio_bitmap_t *self, int16_t ox, int16_t oy, + int16_t dest_clip0_x, int16_t dest_clip0_y, + int16_t dest_clip1_x, int16_t dest_clip1_y, + displayio_bitmap_t *source, int16_t px, int16_t py, + int16_t source_clip0_x, int16_t source_clip0_y, + int16_t source_clip1_x, int16_t source_clip1_y, + float angle, + float scale, + uint32_t skip_index, bool skip_index_none); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BITMAPTOOLS__INIT__H diff --git a/shared-module/bitmaptools/__init__.c b/shared-module/bitmaptools/__init__.c new file mode 100644 index 0000000000..7dc4024ef4 --- /dev/null +++ b/shared-module/bitmaptools/__init__.c @@ -0,0 +1,174 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Kevin Matocha + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include "shared-bindings/displayio/Bitmap.h" + +#include "py/runtime.h" + +#include "math.h" + +void common_hal_bitmaptools_rotozoom(displayio_bitmap_t *self, int16_t ox, int16_t oy, + int16_t dest_clip0_x, int16_t dest_clip0_y, + int16_t dest_clip1_x, int16_t dest_clip1_y, + displayio_bitmap_t *source, int16_t px, int16_t py, + int16_t source_clip0_x, int16_t source_clip0_y, + int16_t source_clip1_x, int16_t source_clip1_y, + float angle, + float scale, + uint32_t skip_index, bool skip_index_none) { + + // Copies region from source to the destination bitmap, including rotation, + // scaling and clipping of either the source or destination regions + // + // *self: destination bitmap + // ox: the (ox, oy) destination point where the source (px,py) point is placed + // oy: + // dest_clip0: (x,y) is the corner of the clip window on the destination bitmap + // dest_clip1: (x,y) is the other corner of the clip window of the destination bitmap + // *source: the source bitmap + // px: the (px, py) point of rotation of the source bitmap + // py: + // source_clip0: (x,y) is the corner of the clip window on the source bitmap + // source_clip1: (x,y) is the other of the clip window on the source bitmap + // angle: angle of rotation in radians, positive is clockwise + // scale: scale factor + // skip_index: color index that should be ignored (and not copied over) + // skip_index_none: if skip_index_none is True, then all color indexes should be copied + // (that is, no color indexes should be skipped) + + + // Copy complete "source" bitmap into "self" bitmap at location x,y in the "self" + // Add a boolean to determine if all values are copied, or only if non-zero + // If skip_value is encountered in the source bitmap, it will not be copied. + // If skip_value is `None`, then all pixels are copied. + + + // # Credit from https://github.com/wernsey/bitmap + // # MIT License from + // # * Copyright (c) 2017 Werner Stoop + // # + // # * + // # * #### `void bm_rotate_blit(Bitmap *dst, int ox, int oy, Bitmap *src, int px, int py, double angle, double scale);` + // # * + // # * Rotates a source bitmap `src` around a pivot point `px,py` and blits it onto a destination bitmap `dst`. + // # * + // # * The bitmap is positioned such that the point `px,py` on the source is at the offset `ox,oy` on the destination. + // # * + // # * The `angle` is clockwise, in radians. The bitmap is also scaled by the factor `scale`. + // # + // # void bm_rotate_blit(Bitmap *dst, int ox, int oy, Bitmap *src, int px, int py, double angle, double scale); + + + // # /* + // # Reference: + // # "Fast Bitmap Rotation and Scaling" By Steven Mortimer, Dr Dobbs' Journal, July 01, 2001 + // # http://www.drdobbs.com/architecture-and-design/fast-bitmap-rotation-and-scaling/184416337 + // # See also http://www.efg2.com/Lab/ImageProcessing/RotateScanline.htm + // # */ + + + if (self->read_only) { + mp_raise_RuntimeError(translate("Read-only object")); + } + + int16_t x,y; + + int16_t minx = dest_clip1_x; + int16_t miny = dest_clip1_y; + int16_t maxx = dest_clip0_x; + int16_t maxy = dest_clip0_y; + + float sinAngle = sinf(angle); + float cosAngle = cosf(angle); + + float dx, dy; + + /* Compute the position of where each corner on the source bitmap + will be on the destination to get a bounding box for scanning */ + dx = -cosAngle * px * scale + sinAngle * py * scale + ox; + dy = -sinAngle * px * scale - cosAngle * py * scale + oy; + if(dx < minx) minx = (int16_t)dx; + if(dx > maxx) maxx = (int16_t)dx; + if(dy < miny) miny = (int16_t)dy; + if(dy > maxy) maxy = (int16_t)dy; + + dx = cosAngle * (source->width - px) * scale + sinAngle * py * scale + ox; + dy = sinAngle * (source->width - px) * scale - cosAngle * py * scale + oy; + if(dx < minx) minx = (int16_t)dx; + if(dx > maxx) maxx = (int16_t)dx; + if(dy < miny) miny = (int16_t)dy; + if(dy > maxy) maxy = (int16_t)dy; + + dx = cosAngle * (source->width - px) * scale - sinAngle * (source->height - py) * scale + ox; + dy = sinAngle * (source->width - px) * scale + cosAngle * (source->height - py) * scale + oy; + if(dx < minx) minx = (int16_t)dx; + if(dx > maxx) maxx = (int16_t)dx; + if(dy < miny) miny = (int16_t)dy; + if(dy > maxy) maxy = (int16_t)dy; + + dx = -cosAngle * px * scale - sinAngle * (source->height - py) * scale + ox; + dy = -sinAngle * px * scale + cosAngle * (source->height - py) * scale + oy; + if(dx < minx) minx = (int16_t)dx; + if(dx > maxx) maxx = (int16_t)dx; + if(dy < miny) miny = (int16_t)dy; + if(dy > maxy) maxy = (int16_t)dy; + + /* Clipping */ + if(minx < dest_clip0_x) minx = dest_clip0_x; + if(maxx > dest_clip1_x - 1) maxx = dest_clip1_x - 1; + if(miny < dest_clip0_y) miny = dest_clip0_y; + if(maxy > dest_clip1_y - 1) maxy = dest_clip1_y - 1; + + float dvCol = cosAngle / scale; + float duCol = sinAngle / scale; + + float duRow = dvCol; + float dvRow = -duCol; + + float startu = px - (ox * dvCol + oy * duCol); + float startv = py - (ox * dvRow + oy * duRow); + + float rowu = startu + miny * duCol; + float rowv = startv + miny * dvCol; + + for(y = miny; y <= maxy; y++) { + float u = rowu + minx * duRow; + float v = rowv + minx * dvRow; + for(x = minx; x <= maxx; x++) { + if(u >= source_clip0_x && u < source_clip1_x && v >= source_clip0_y && v < source_clip1_y) { + uint32_t c = common_hal_displayio_bitmap_get_pixel(source, u, v); + if( (skip_index_none) || (c != skip_index) ) { + common_hal_displayio_bitmap_set_pixel(self, x, y, c); + } + } + u += duRow; + v += dvRow; + } + rowu += duCol; + rowv += dvCol; + } +} From 18658b77f302109284cc36099298f0317becb5af Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Wed, 24 Feb 2021 01:00:13 -0600 Subject: [PATCH 090/159] Sphinx docstring updates --- shared-bindings/bitmaptools/__init__.c | 73 ++++++++++++-------------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index 7f7e16bcb6..8f552e2e00 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -32,6 +32,9 @@ #include "py/obj.h" #include "py/runtime.h" +//| """Collection of bitmap manipulation tools""" +//| + STATIC int16_t validate_point(mp_obj_t point, int16_t default_value) { // Checks if point is None and returns default_value, otherwise decodes integer value if ( point == mp_const_none ) { @@ -106,48 +109,38 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl } - //| -//| def rotozoom(dest_bitmap: Bitmap, ox: int, oy: int, -//| dest_clip0: Tuple[int, int], -//| dest_clip1: Tuple[int, int], -//| source_bitmap: Bitmap, -//| px: int, py: int, -//| source_clip0: Tuple[int, int], -//| source_clip1: Tuple[int, int], -//| angle: float, -//| scale: float, -//| skip_index: int) -> None: -//| """Inserts the source bitmap region into the destination bitmap with rotation (angle), scale -//| and clipping (both on source and destination bitmaps). +//| def rotozoom( +//| dest_bitmap: Bitmap, ox: int, oy: int, +//| dest_clip0: Tuple[int, int], dest_clip1: Tuple[int, int], +//| source_bitmap: Bitmap, px: int, py: int, source_clip0: Tuple[int, int], source_clip1: Tuple[int, int], +//| angle: float, scale: float, skip_index: int) -> None: +//| """Inserts the source bitmap region into the destination bitmap with rotation +//| (angle), scale and clipping (both on source and destination bitmaps). //| -//| :param bitmap dest_bitmap: The bitmap that will be copied into -//| :param int ox: Horizontal pixel location in destination bitmap where source bitmap -//| point (px,py) is placed -//| :param int oy: Vertical pixel location in destination bitmap where source bitmap -//| point (px,py) is placed -//| :param dest_clip0: First corner of rectangular destination clipping -//| region that constrains region of writing into destination bitmap -//| :type dest_clip0: Tuple[int,int] -//| :param dest_clip1: second corner of rectangular destination clipping -//| region that constrains region of writing into destination bitmap -//| :type dest_clip1: Tuple[int,int] -//| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied -//| :param int px: Horizontal pixel location in source bitmap that is placed into the -//| destination bitmap at (ox,oy) -//| :param int py: Vertical pixel location in source bitmap that is placed into the -//| destination bitmap at (ox,oy) -//| :param source_clip0: First corner of rectangular destination clipping -//| region that constrains region of writing into destination bitmap -//| :type source_clip0: Tuple[int,int] -//| :param source_clip1: second corner of rectangular destination clipping -//| region that constrains region of writing into destination bitmap -//| :type source_clip1: Tuple[int,int] -//| :param float angle: angle of rotation, in radians (positive is clockwise direction) -//| :param float scale: scaling factor -//| :param int skip_index: bitmap palette index in the source that will not be copied, -//| set to None to copy all pixels""" -//| ... +//| :param bitmap dest_bitmap: The bitmap that will be copied into +//| :param int ox: Horizontal pixel location in destination bitmap where source bitmap +//| point (px,py) is placed +//| :param int oy: Vertical pixel location in destination bitmap where source bitmap +//| point (px,py) is placed +//| :param Tuple[int,int] dest_clip0: First corner of rectangular destination clipping +//| region that constrains region of writing into destination bitmap +//| :param Tuple[int,int] dest_clip1: Second corner of rectangular destination clipping +//| region that constrains region of writing into destination bitmap +//| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied +//| :param int px: Horizontal pixel location in source bitmap that is placed into the +//| destination bitmap at (ox,oy) +//| :param int py: Vertical pixel location in source bitmap that is placed into the +//| destination bitmap at (ox,oy) +//| :param Tuple[int,int] source_clip0: First corner of rectangular source clipping +//| region that constrains region of reading from the source bitmap +//| :param Tuple[int,int] source_clip1: Second corner of rectangular source clipping +//| region that constrains region of reading from the source bitmap +//| :param float angle: Angle of rotation, in radians (positive is clockwise direction) +//| :param float scale: Scaling factor +//| :param int skip_index: Bitmap palette index in the source that will not be copied, +//| set to None to copy all pixels""" +//| ... //| STATIC mp_obj_t bitmaptools_obj_rotozoom(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args){ enum {ARG_dest_bitmap, ARG_ox, ARG_oy, ARG_dest_clip0, ARG_dest_clip1, From af5ad50125f41fea40103a63232b807ea56654ad Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Wed, 24 Feb 2021 01:18:30 -0600 Subject: [PATCH 091/159] More sphinx fixes --- shared-bindings/bitmaptools/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index 8f552e2e00..63a81e01f2 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -111,9 +111,9 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl //| //| def rotozoom( -//| dest_bitmap: Bitmap, ox: int, oy: int, +//| dest_bitmap: bitmap, ox: int, oy: int, //| dest_clip0: Tuple[int, int], dest_clip1: Tuple[int, int], -//| source_bitmap: Bitmap, px: int, py: int, source_clip0: Tuple[int, int], source_clip1: Tuple[int, int], +//| source_bitmap: bitmap, px: int, py: int, source_clip0: Tuple[int, int], source_clip1: Tuple[int, int], //| angle: float, scale: float, skip_index: int) -> None: //| """Inserts the source bitmap region into the destination bitmap with rotation //| (angle), scale and clipping (both on source and destination bitmaps). From 2815c6dafa77fea930f02fac60caf13f7c4584ea Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Wed, 24 Feb 2021 07:49:34 -0600 Subject: [PATCH 092/159] More sphinx attempts --- shared-bindings/bitmaptools/__init__.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index 63a81e01f2..029995f172 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -109,11 +109,12 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl } +//| """:py:class:`~displayio.Bitmap`""" //| //| def rotozoom( -//| dest_bitmap: bitmap, ox: int, oy: int, +//| dest_bitmap: Bitmap, ox: int, oy: int, //| dest_clip0: Tuple[int, int], dest_clip1: Tuple[int, int], -//| source_bitmap: bitmap, px: int, py: int, source_clip0: Tuple[int, int], source_clip1: Tuple[int, int], +//| source_bitmap: Bitmap, px: int, py: int, source_clip0: Tuple[int, int], source_clip1: Tuple[int, int], //| angle: float, scale: float, skip_index: int) -> None: //| """Inserts the source bitmap region into the destination bitmap with rotation //| (angle), scale and clipping (both on source and destination bitmaps). From e858db07f0f335f36d9780322ab38b025b00d7df Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Wed, 24 Feb 2021 07:59:32 -0600 Subject: [PATCH 093/159] Another sphinx try --- shared-bindings/bitmaptools/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index 029995f172..ede74621a5 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -109,7 +109,7 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl } -//| """:py:class:`~displayio.Bitmap`""" +//| """:py:class:`Bitmap`""" //| //| def rotozoom( //| dest_bitmap: Bitmap, ox: int, oy: int, From cd4d55a57309230eae02df54db65d9b095d78f07 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Wed, 24 Feb 2021 08:05:40 -0600 Subject: [PATCH 094/159] yet another sphinx try --- shared-bindings/bitmaptools/__init__.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index ede74621a5..dce082f9bb 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -109,12 +109,11 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl } -//| """:py:class:`Bitmap`""" //| //| def rotozoom( -//| dest_bitmap: Bitmap, ox: int, oy: int, +//| dest_bitmap: displayio.Bitmap, ox: int, oy: int, //| dest_clip0: Tuple[int, int], dest_clip1: Tuple[int, int], -//| source_bitmap: Bitmap, px: int, py: int, source_clip0: Tuple[int, int], source_clip1: Tuple[int, int], +//| source_bitmap: displayio.Bitmap, px: int, py: int, source_clip0: Tuple[int, int], source_clip1: Tuple[int, int], //| angle: float, scale: float, skip_index: int) -> None: //| """Inserts the source bitmap region into the destination bitmap with rotation //| (angle), scale and clipping (both on source and destination bitmaps). From b7f5c277ad61076848dfc2065bc254092f4dd4ce Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 24 Feb 2021 09:29:59 -0600 Subject: [PATCH 095/159] _pixelbuf: Increase performance of brightness-scaling On the Pico, this increases the "fill rate" of pixels[:] = newvalues considerably. On a strip of 240 RGB LEDs, auto_write=False, the timings are: || Brightness || Before || After || Improvement || || 1.0 || 117 kpix/s || 307 kpix/s || 2.62x || || 0.07 || 117 kpix/s || 273 kpix/s || 2.33x || It's worth noting that even the "before" rate is fast compared to the time to transmit a single neopixel, but any time we can gain back in the whole pipeline will let marginal animations work a little better. To set all the pixels in this way and then show() gives a pleasant bump to the framerate, from about 108Hz to 124Hz (1.15x) The main source of speed-up is using integer math instead of floating point math for the calculation of the post-scaled pixel values. A slight secondary gain is achieved by avoiding the scaling altogether when the scale factor is 1.0. Because the math is not exactly the same, some scaled pixel values may change by +- 1 RGBW "step". In practice, this is unlikely to matter. The gains are bigger on the Pico and other M0 microcontrollers than M4 microcontrollers with floating point math in the hardware. Happily, flash size is also improved a bit on the Pico build I did, going from > 542552 bytes used, 506024 bytes free in flash firmware space out of 1048576 bytes (1024.0kB). to > 542376 bytes used, 506200 bytes free in flash firmware space out of 1048576 bytes (1024.0kB). --- shared-module/_pixelbuf/PixelBuf.c | 99 ++++++++++++++++++++---------- shared-module/_pixelbuf/PixelBuf.h | 3 +- 2 files changed, 68 insertions(+), 34 deletions(-) diff --git a/shared-module/_pixelbuf/PixelBuf.c b/shared-module/_pixelbuf/PixelBuf.c index f3e679631e..f11b03cbb4 100644 --- a/shared-module/_pixelbuf/PixelBuf.c +++ b/shared-module/_pixelbuf/PixelBuf.c @@ -31,6 +31,7 @@ #include "py/runtime.h" #include "shared-bindings/_pixelbuf/PixelBuf.h" #include +#include // Helper to ensure we have the native super class instead of a subclass. static pixelbuf_pixelbuf_obj_t* native_pixelbuf(mp_obj_t pixelbuf_obj) { @@ -69,6 +70,7 @@ void common_hal__pixelbuf_pixelbuf_construct(pixelbuf_pixelbuf_obj_t *self, size } // Call set_brightness so that it can allocate a second buffer if needed. self->brightness = 1.0; + self->scaled_brightness = 0x100; common_hal__pixelbuf_pixelbuf_set_brightness(MP_OBJ_FROM_PTR(self), brightness); // Turn on auto_write. We don't want to do it with the above brightness call. @@ -109,26 +111,31 @@ void common_hal__pixelbuf_pixelbuf_set_brightness(mp_obj_t self_in, mp_float_t b pixelbuf_pixelbuf_obj_t* self = native_pixelbuf(self_in); // Skip out if the brightness is already set. The default of self->brightness is 1.0. So, this // also prevents the pre_brightness_buffer allocation when brightness is set to 1.0 again. - mp_float_t change = brightness - self->brightness; - if (-0.001 < change && change < 0.001) { + self->brightness = brightness; + uint16_t new_scaled_brightness = (int)roundf(brightness * 256); + if (new_scaled_brightness == self->scaled_brightness) { return; } - self->brightness = brightness; + self->scaled_brightness = new_scaled_brightness; size_t pixel_len = self->pixel_count * self->bytes_per_pixel; - if (self->pre_brightness_buffer == NULL) { - self->pre_brightness_buffer = m_malloc(pixel_len, false); - memcpy(self->pre_brightness_buffer, self->post_brightness_buffer, pixel_len); - } - for (size_t i = 0; i < pixel_len; i++) { - // Don't adjust per-pixel luminance bytes in dotstar mode - if (self->byteorder.is_dotstar && i % 4 == 0) { - continue; + if (self->scaled_brightness == 0x100 && !self->pre_brightness_buffer) { + return; + } else { + if (self->pre_brightness_buffer == NULL) { + self->pre_brightness_buffer = m_malloc(pixel_len, false); + memcpy(self->pre_brightness_buffer, self->post_brightness_buffer, pixel_len); + } + for (size_t i = 0; i < pixel_len; i++) { + // Don't adjust per-pixel luminance bytes in dotstar mode + if (self->byteorder.is_dotstar && i % 4 == 0) { + continue; + } + self->post_brightness_buffer[i] = (self->pre_brightness_buffer[i] * self->scaled_brightness) >> 8; } - self->post_brightness_buffer[i] = self->pre_brightness_buffer[i] * self->brightness; - } - if (self->auto_write) { - common_hal__pixelbuf_pixelbuf_show(self_in); + if (self->auto_write) { + common_hal__pixelbuf_pixelbuf_show(self_in); + } } } @@ -197,28 +204,34 @@ void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t* self, size_t index, uint } pixelbuf_rgbw_t *rgbw_order = &self->byteorder.byteorder; size_t offset = index * self->bytes_per_pixel; - if (self->pre_brightness_buffer != NULL) { - uint8_t* pre_brightness_buffer = self->pre_brightness_buffer + offset; - if (self->bytes_per_pixel == 4) { - pre_brightness_buffer[rgbw_order->w] = w; - } - - pre_brightness_buffer[rgbw_order->r] = r; - pre_brightness_buffer[rgbw_order->g] = g; - pre_brightness_buffer[rgbw_order->b] = b; + uint8_t *scaled_buffer, *unscaled_buffer; + if (self->pre_brightness_buffer) { + scaled_buffer = self->post_brightness_buffer + offset; + unscaled_buffer = self->pre_brightness_buffer + offset; + } else { + scaled_buffer = NULL; + unscaled_buffer = self->post_brightness_buffer + offset; } - uint8_t* post_brightness_buffer = self->post_brightness_buffer + offset; if (self->bytes_per_pixel == 4) { - // Only apply brightness if w is actually white (aka not DotStar.) - if (!self->byteorder.is_dotstar) { - w *= self->brightness; - } - post_brightness_buffer[rgbw_order->w] = w; + unscaled_buffer[rgbw_order->w] = w; + } + + unscaled_buffer[rgbw_order->r] = r; + unscaled_buffer[rgbw_order->g] = g; + unscaled_buffer[rgbw_order->b] = b; + + if (scaled_buffer) { + if (self->bytes_per_pixel == 4) { + if (!self->byteorder.is_dotstar) { + w = (w * self->scaled_brightness) >> 8; + } + scaled_buffer[rgbw_order->w] = w; + } + scaled_buffer[rgbw_order->r] = (r * self->scaled_brightness) >> 8; + scaled_buffer[rgbw_order->g] = (g * self->scaled_brightness) >> 8; + scaled_buffer[rgbw_order->b] = (b * self->scaled_brightness) >> 8; } - post_brightness_buffer[rgbw_order->r] = r * self->brightness; - post_brightness_buffer[rgbw_order->g] = g * self->brightness; - post_brightness_buffer[rgbw_order->b] = b * self->brightness; } void _pixelbuf_set_pixel(pixelbuf_pixelbuf_obj_t* self, size_t index, mp_obj_t value) { @@ -318,3 +331,23 @@ void common_hal__pixelbuf_pixelbuf_fill(mp_obj_t self_in, mp_obj_t fill_color) { common_hal__pixelbuf_pixelbuf_show(self_in); } } + +mp_int_t common_hal__pixelbuf_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags) { + pixelbuf_pixelbuf_obj_t *self = native_pixelbuf(self_in); + bufinfo->buf = self->pre_brightness_buffer; + if (self->pre_brightness_buffer) { + // If we have a brightness setting, we must treat the buffer as + // read-only (because we have no way to "fire" the + // brightness-converting code as a side effect of mutation via the + // buffer) + if ((flags & MP_BUFFER_WRITE)) { + return 1; + } + bufinfo->buf = self->pre_brightness_buffer; + } else { + bufinfo->buf = self->post_brightness_buffer; + } + bufinfo->typecode = 'B'; + bufinfo->len = self->bytes_per_pixel * common_hal__pixelbuf_pixelbuf_get_len(self_in); + return 0; +} diff --git a/shared-module/_pixelbuf/PixelBuf.h b/shared-module/_pixelbuf/PixelBuf.h index a9fbed366f..f0c80bcad7 100644 --- a/shared-module/_pixelbuf/PixelBuf.h +++ b/shared-module/_pixelbuf/PixelBuf.h @@ -49,7 +49,8 @@ typedef struct { typedef struct { mp_obj_base_t base; size_t pixel_count; - size_t bytes_per_pixel; + uint16_t bytes_per_pixel; + uint16_t scaled_brightness; pixelbuf_byteorder_details_t byteorder; mp_float_t brightness; mp_obj_t transmit_buffer_obj; From ced820c8a75174f9bb945631e5b7354f720ff6df Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Mon, 22 Feb 2021 12:47:00 +0100 Subject: [PATCH 096/159] Update tinyUSB --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index 045674745a..99d3a32ba2 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 045674745afa59028fbeed6dac5cb5a9c4a6033e +Subproject commit 99d3a32ba24fd16e847f442cf9ad50bd07aa65dc From e3694737947bbe9e8cf2916e7b3fd65e6797f1f6 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 24 Feb 2021 18:17:04 +0100 Subject: [PATCH 097/159] spresense: change RX and TX buffer size for CDC --- ports/cxd56/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index 1c48a23ca5..15eb5e64c7 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -151,7 +151,7 @@ LDFLAGS = \ --end-group \ -L$(BUILD) \ -CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_CXD56 -DCFG_TUD_MIDI_RX_BUFSIZE=512 -DCFG_TUD_CDC_RX_BUFSIZE=512 -DCFG_TUD_MIDI_TX_BUFSIZE=512 -DCFG_TUD_CDC_TX_BUFSIZE=512 -DCFG_TUD_MSC_BUFSIZE=512 $(CFLAGS_MOD) +CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_CXD56 -DCFG_TUD_MIDI_RX_BUFSIZE=512 -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_MIDI_TX_BUFSIZE=512 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=512 $(CFLAGS_MOD) SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \ From dafdd246bc4841357e74725e94a96f18c114fd36 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 24 Feb 2021 18:27:54 +0100 Subject: [PATCH 098/159] Update tinyUSB --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index 99d3a32ba2..280297bdb7 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 99d3a32ba24fd16e847f442cf9ad50bd07aa65dc +Subproject commit 280297bdb7aec67adf347ec046943a48a71647df From ef3a61432be5bf7a4778607d49b3ed49cb141cf7 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 24 Feb 2021 19:09:17 +0100 Subject: [PATCH 099/159] Add the missing argument to the HID functions --- shared-module/usb_hid/Device.c | 6 ++++-- supervisor/shared/usb/usb_desc.c | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index 943c9bfed7..2b560c328b 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -73,7 +73,8 @@ static usb_hid_device_obj_t* get_hid_device(uint8_t report_id) { } // Callbacks invoked when receive Get_Report request through control endpoint -uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen) { +uint16_t tud_hid_get_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen) { + (void) itf; // only support Input Report if ( report_type != HID_REPORT_TYPE_INPUT ) return 0; @@ -83,7 +84,8 @@ uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, } // Callbacks invoked when receive Set_Report request through control endpoint -void tud_hid_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize) { +void tud_hid_set_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize) { + (void) itf; if (report_type == HID_REPORT_TYPE_INVALID) { report_id = buffer[0]; buffer++; diff --git a/supervisor/shared/usb/usb_desc.c b/supervisor/shared/usb/usb_desc.c index 419a70ab30..b08d3b2274 100644 --- a/supervisor/shared/usb/usb_desc.c +++ b/supervisor/shared/usb/usb_desc.c @@ -47,8 +47,9 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index) { // Invoked when received GET HID REPORT DESCRIPTOR // Application return pointer to descriptor // Descriptor contents must exist long enough for transfer to complete -uint8_t const * tud_hid_descriptor_report_cb(void) { - return hid_report_descriptor; +uint8_t const * tud_hid_descriptor_report_cb(uint8_t itf) { + (void) itf; + return hid_report_descriptor; } #endif From 5d7fdafcdec126f4f552689df25cecf30b39265d Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 25 Feb 2021 00:48:36 +0530 Subject: [PATCH 100/159] implement suggested changes - add internal buffering - rtc initialization fix --- locale/circuitpython.pot | 23 ++--- ports/mimxrt10xx/common-hal/busio/UART.c | 8 +- ports/nrf/common-hal/busio/UART.c | 8 +- ports/raspberrypi/common-hal/busio/UART.c | 115 ++++++++++++++-------- ports/raspberrypi/common-hal/busio/UART.h | 6 +- ports/raspberrypi/supervisor/port.c | 7 ++ shared-bindings/busio/UART.c | 6 +- 7 files changed, 107 insertions(+), 66 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index bffc3005cb..6a009f63d1 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -332,11 +332,8 @@ msgid "All SPI peripherals are in use" msgstr "" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -msgid "All UART peripherals are in use" -msgstr "" - #: ports/raspberrypi/common-hal/busio/UART.c -msgid "All UART peripherals in use" +msgid "All UART peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -947,6 +944,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "" @@ -1202,7 +1200,8 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "" @@ -1277,8 +1276,7 @@ msgstr "" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c #: ports/raspberrypi/common-hal/busio/UART.c @@ -1330,7 +1328,8 @@ msgstr "" msgid "Invalid wave file" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "" @@ -1820,7 +1819,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" @@ -1829,10 +1828,6 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 is not supported on this board" -msgstr "" - #: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c #: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c #: ports/raspberrypi/common-hal/rtc/RTC.c @@ -2460,7 +2455,7 @@ msgid "binary op %q not implemented" msgstr "" #: shared-bindings/busio/UART.c -msgid "bits must be between 5 and 8" +msgid "bits must be in range 5 to 9" msgstr "" #: shared-bindings/audiomixer/Mixer.c diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 03a6e8f3ef..503da14c26 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -93,6 +93,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->character_bits = bits; self->timeout_ms = timeout * 1000; + if (self->character_bits != 7 && self->character_bits != 8) { + mp_raise_ValueError(translate("Invalid word/bit length")); + } + // We are transmitting one direction if one pin is NULL and the other isn't. bool is_onedirection = (rx == NULL) != (tx == NULL); bool uart_taken = false; @@ -154,10 +158,6 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("Hardware in use, try alternative pins")); } - if(self->rx == NULL && self->tx == NULL) { - mp_raise_ValueError(translate("Invalid pins")); - } - if (is_onedirection && ((rts != NULL) || (cts != NULL))) { mp_raise_ValueError(translate("Both RX and TX required for flow control")); } diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 6ecf7e0ba3..491e360e4d 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -70,9 +70,9 @@ static uint32_t get_nrf_baud (uint32_t baudrate) { { 14400, NRF_UARTE_BAUDRATE_14400 }, { 19200, NRF_UARTE_BAUDRATE_19200 }, { 28800, NRF_UARTE_BAUDRATE_28800 }, - { 31250, NRF_UARTE_BAUDRATE_31250 }, + { 31250, NRF_UARTE_BAUDRATE_31250 }, { 38400, NRF_UARTE_BAUDRATE_38400 }, - { 56000, NRF_UARTE_BAUDRATE_56000 }, + { 56000, NRF_UARTE_BAUDRATE_56000 }, { 57600, NRF_UARTE_BAUDRATE_57600 }, { 76800, NRF_UARTE_BAUDRATE_76800 }, { 115200, NRF_UARTE_BAUDRATE_115200 }, @@ -144,6 +144,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { + if (bits != 8) { + mp_raise_ValueError(translate("Invalid word/bit length")); + } + if ((rs485_dir != NULL) || (rs485_invert)) { mp_raise_ValueError(translate("RS485 Not yet supported on this device")); } diff --git a/ports/raspberrypi/common-hal/busio/UART.c b/ports/raspberrypi/common-hal/busio/UART.c index 660a473ae6..e319b4ccf2 100644 --- a/ports/raspberrypi/common-hal/busio/UART.c +++ b/ports/raspberrypi/common-hal/busio/UART.c @@ -31,18 +31,15 @@ #include "py/runtime.h" #include "supervisor/shared/tick.h" #include "lib/utils/interrupt_char.h" +#include "common-hal/microcontroller/Pin.h" +#include "src/rp2_common/hardware_irq/include/hardware/irq.h" #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" #define NO_PIN 0xff #define UART_INST(uart) (((uart) ? uart1 : uart0)) -#define TX 0 -#define RX 1 -#define CTS 2 -#define RTS 3 - typedef enum { STATUS_FREE = 0, STATUS_IN_USE, @@ -51,7 +48,7 @@ typedef enum { static uart_status_t uart_status[2]; -void uart_reset(void) { +void reset_uart(void) { for (uint8_t num = 0; num < 2; num++) { if (uart_status[num] == STATUS_IN_USE) { uart_status[num] = STATUS_FREE; @@ -71,7 +68,7 @@ static uint8_t get_free_uart() { break; } if (num) { - mp_raise_RuntimeError(translate("All UART peripherals in use")); + mp_raise_RuntimeError(translate("All UART peripherals are in use")); } } return num; @@ -84,10 +81,21 @@ static uint8_t pin_init(const uint8_t uart, const mcu_pin_obj_t * pin, const uin if (!(((pin->number & 3) == pin_type) && ((((pin->number + 4) & 8) >> 3) == uart))) { mp_raise_ValueError(translate("Invalid pins")); } + claim_pin(pin); gpio_set_function(pin->number, GPIO_FUNC_UART); return pin->number; } +static ringbuf_t ringbuf[2]; + +static void uart0_callback(void) { + while (uart_is_readable(uart0) && !ringbuf_put(&ringbuf[0], (uint8_t)uart_get_hw(uart0)->dr)) {} +} + +static void uart1_callback(void) { + while (uart_is_readable(uart1) && !ringbuf_put(&ringbuf[1], (uint8_t)uart_get_hw(uart1)->dr)) {} +} + void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, @@ -96,25 +104,56 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { + if (bits > 8) { + mp_raise_ValueError(translate("Invalid word/bit length")); + } + + if (receiver_buffer_size == 0) { + mp_raise_ValueError(translate("Invalid buffer size")); + } + if ((rs485_dir != NULL) || (rs485_invert)) { - mp_raise_NotImplementedError(translate("RS485 is not supported on this board")); + mp_raise_NotImplementedError(translate("RS485 Not yet supported on this device")); } uint8_t uart_id = get_free_uart(); - self->tx_pin = pin_init(uart_id, tx, TX); - self->rx_pin = pin_init(uart_id, rx, RX); - self->cts_pin = pin_init(uart_id, cts, CTS); - self->rts_pin = pin_init(uart_id, rts, RTS); + self->tx_pin = pin_init(uart_id, tx, 0); + self->rx_pin = pin_init(uart_id, rx, 1); + self->cts_pin = pin_init(uart_id, cts, 2); + self->rts_pin = pin_init(uart_id, rts, 3); self->uart = UART_INST(uart_id); + self->uart_id = uart_id; self->baudrate = baudrate; self->timeout_ms = timeout * 1000; uart_init(self->uart, self->baudrate); - uart_set_fifo_enabled(self->uart, true); + uart_set_fifo_enabled(self->uart, false); uart_set_format(self->uart, bits, stop, parity); uart_set_hw_flow(self->uart, (cts != NULL), (rts != NULL)); + + if (rx != NULL) { + // Initially allocate the UART's buffer in the long-lived part of the + // heap. UARTs are generally long-lived objects, but the "make long- + // lived" machinery is incapable of moving internal pointers like + // self->buffer, so do it manually. (However, as long as internal + // pointers like this are NOT moved, allocating the buffer + // in the long-lived pool is not strictly necessary) + // (This is a macro.) + if (!ringbuf_alloc(&ringbuf[uart_id], receiver_buffer_size, true)) { + mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); + } + if (uart_id) { + self->uart_irq_id = UART1_IRQ; + irq_set_exclusive_handler(self->uart_irq_id, uart1_callback); + } else { + self->uart_irq_id = UART0_IRQ; + irq_set_exclusive_handler(self->uart_irq_id, uart0_callback); + } + irq_set_enabled(self->uart_irq_id, true); + uart_set_irq_enables(self->uart, true, false); + } } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { @@ -126,6 +165,7 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { return; } uart_deinit(self->uart); + ringbuf_free(&ringbuf[self->uart_id]); reset_pin_number(self->tx_pin); reset_pin_number(self->rx_pin); reset_pin_number(self->cts_pin); @@ -169,36 +209,25 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t size_t total_read = 0; uint64_t start_ticks = supervisor_ticks_ms64(); - // Busy-wait until timeout or until we've read enough chars. - while (supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) { - if (uart_is_readable(self->uart)) { - // Read and advance. - *data++ = uart_get_hw(self->uart)->dr; - - // Decrease how many chars left to read. - len--; - total_read++; - - // Reset the timeout on every character read. + // Busy-wait for all bytes received or timeout + while (len > 0 && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms)) { + // Reset the timeout on every character read. + if (ringbuf_num_filled(&ringbuf[self->uart_id])) { + // Prevent conflict with uart irq. + irq_set_enabled(self->uart_irq_id, false); + // Copy as much received data as available, up to len bytes. + size_t num_read = ringbuf_get_n(&ringbuf[self->uart_id], data, len); + // Re-enable irq. + irq_set_enabled(self->uart_irq_id, true); + len-=num_read; + data+=num_read; + total_read+=num_read; start_ticks = supervisor_ticks_ms64(); } - RUN_BACKGROUND_TASKS; - // Allow user to break out of a timeout with a KeyboardInterrupt. if (mp_hal_is_interrupted()) { - break; - } - - // Don't need to read any more: data buf is full. - if (len == 0) { - break; - } - - // If we are zero timeout, make sure we don't loop again (in the event - // we read in under 1ms) - if (self->timeout_ms == 0) { - break; + return 0; } } @@ -228,12 +257,16 @@ void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeou } uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { - return uart_is_readable(self->uart); + return ringbuf_num_filled(&ringbuf[self->uart_id]); } -void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) {} +void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { + // Prevent conflict with uart irq. + irq_set_enabled(self->uart_irq_id, false); + ringbuf_clear(&ringbuf[self->uart_id]); + irq_set_enabled(self->uart_irq_id, true); +} -// True if there are no characters still to be written. bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { if (self->tx_pin == NO_PIN) { return false; diff --git a/ports/raspberrypi/common-hal/busio/UART.h b/ports/raspberrypi/common-hal/busio/UART.h index 03613daeb7..da6170596b 100644 --- a/ports/raspberrypi/common-hal/busio/UART.h +++ b/ports/raspberrypi/common-hal/busio/UART.h @@ -28,7 +28,7 @@ #define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_BUSIO_UART_H #include "py/obj.h" -#include "common-hal/microcontroller/Pin.h" +#include "py/ringbuf.h" #include "src/rp2_common/hardware_uart/include/hardware/uart.h" @@ -38,12 +38,14 @@ typedef struct { uint8_t rx_pin; uint8_t cts_pin; uint8_t rts_pin; + uint8_t uart_id; + uint8_t uart_irq_id; uint32_t baudrate; uint32_t timeout_ms; uart_inst_t * uart; } busio_uart_obj_t; -extern void uart_reset(void); +extern void reset_uart(void); extern void never_reset_uart(uint8_t num); #endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_BUSIO_UART_H diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c index 36d2e8275c..3b8790ea08 100644 --- a/ports/raspberrypi/supervisor/port.c +++ b/ports/raspberrypi/supervisor/port.c @@ -39,6 +39,9 @@ #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/pwmio/PWMOut.h" +#include "common-hal/rtc/RTC.h" +#include "common-hal/busio/UART.h" + #include "supervisor/shared/safe_mode.h" #include "supervisor/shared/stack.h" #include "supervisor/shared/tick.h" @@ -78,6 +81,9 @@ safe_mode_t port_init(void) { // Reset everything into a known state before board_init. reset_port(); + // Initialize RTC + common_hal_rtc_init(); + // For the tick. hardware_alarm_claim(0); hardware_alarm_set_callback(0, _tick_callback); @@ -95,6 +101,7 @@ void reset_port(void) { #if CIRCUITPY_BUSIO reset_i2c(); reset_spi(); + reset_uart(); #endif #if CIRCUITPY_PWMIO diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 151081d313..50d233f2b9 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -55,7 +55,7 @@ //| :param ~microcontroller.Pin rs485_dir: the output pin for rs485 direction setting, or ``None`` if rs485 not in use. //| :param bool rs485_invert: rs485_dir pin active high when set. Active low otherwise. //| :param int baudrate: the transmit and receive speed. -//| :param int bits: the number of bits per byte, 5 to 8. +//| :param int bits: the number of bits per byte, 5 to 9. //| :param Parity parity: the parity used for error checking. //| :param int stop: the number of stop bits, 1 or 2. //| :param float timeout: the timeout in seconds to wait for the first character and between subsequent characters when reading. Raises ``ValueError`` if timeout >100 seconds. @@ -110,8 +110,8 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co mp_raise_ValueError(translate("tx and rx cannot both be None")); } - if (args[ARG_bits].u_int < 5 || args[ARG_bits].u_int > 8) { - mp_raise_ValueError(translate("bits must be between 5 and 8")); + if (args[ARG_bits].u_int < 5 || args[ARG_bits].u_int > 9) { + mp_raise_ValueError(translate("bits must be in range 5 to 9")); } uint8_t bits = args[ARG_bits].u_int; From c883bb773bbd226d4e18a7b4213b61157e358545 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Wed, 24 Feb 2021 16:03:50 -0600 Subject: [PATCH 101/159] Rearrange input parameters --- shared-bindings/bitmaptools/__init__.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index dce082f9bb..cf48d12dc1 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -111,14 +111,16 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl //| //| def rotozoom( -//| dest_bitmap: displayio.Bitmap, ox: int, oy: int, -//| dest_clip0: Tuple[int, int], dest_clip1: Tuple[int, int], -//| source_bitmap: displayio.Bitmap, px: int, py: int, source_clip0: Tuple[int, int], source_clip1: Tuple[int, int], +//| dest_bitmap: displayio.Bitmap, source_bitmap: displayio.Bitmap, +//| *, +//| ox: int, oy: int, dest_clip0: Tuple[int, int], dest_clip1: Tuple[int, int], +//| px: int, py: int, source_clip0: Tuple[int, int], source_clip1: Tuple[int, int], //| angle: float, scale: float, skip_index: int) -> None: //| """Inserts the source bitmap region into the destination bitmap with rotation //| (angle), scale and clipping (both on source and destination bitmaps). //| -//| :param bitmap dest_bitmap: The bitmap that will be copied into +//| :param bitmap dest_bitmap: Destination bitmap that will be copied into +//| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied //| :param int ox: Horizontal pixel location in destination bitmap where source bitmap //| point (px,py) is placed //| :param int oy: Vertical pixel location in destination bitmap where source bitmap @@ -127,7 +129,6 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl //| region that constrains region of writing into destination bitmap //| :param Tuple[int,int] dest_clip1: Second corner of rectangular destination clipping //| region that constrains region of writing into destination bitmap -//| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied //| :param int px: Horizontal pixel location in source bitmap that is placed into the //| destination bitmap at (ox,oy) //| :param int py: Vertical pixel location in source bitmap that is placed into the @@ -143,19 +144,20 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl //| ... //| STATIC mp_obj_t bitmaptools_obj_rotozoom(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args){ - enum {ARG_dest_bitmap, ARG_ox, ARG_oy, ARG_dest_clip0, ARG_dest_clip1, - ARG_source_bitmap, ARG_px, ARG_py, - ARG_source_clip0, ARG_source_clip1, + enum {ARG_dest_bitmap, ARG_source_bitmap, + ARG_ox, ARG_oy, ARG_dest_clip0, ARG_dest_clip1, + ARG_px, ARG_py, ARG_source_clip0, ARG_source_clip1, ARG_angle, ARG_scale, ARG_skip_index}; static const mp_arg_t allowed_args[] = { {MP_QSTR_dest_bitmap, MP_ARG_REQUIRED | MP_ARG_OBJ}, + {MP_QSTR_source_bitmap, MP_ARG_REQUIRED | MP_ARG_OBJ}, + {MP_QSTR_ox, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to destination->width / 2 {MP_QSTR_oy, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to destination->height / 2 {MP_QSTR_dest_clip0, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, {MP_QSTR_dest_clip1, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, - {MP_QSTR_source_bitmap, MP_ARG_REQUIRED | MP_ARG_OBJ}, {MP_QSTR_px, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to source->width / 2 {MP_QSTR_py, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to source->height / 2 {MP_QSTR_source_clip0, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, From dac4ac5d2a294efea12ad8cea6254a94fe4ec765 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 24 Feb 2021 16:27:09 -0600 Subject: [PATCH 102/159] _pixelbuf: Respond to review comments * Comment on the reason for scaling by 256 * Divide by 256 instead of shifting * fix a cast; eliminate an unneeded roundf() to get a few bytes code back --- shared-module/_pixelbuf/PixelBuf.c | 33 +++++++----------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/shared-module/_pixelbuf/PixelBuf.c b/shared-module/_pixelbuf/PixelBuf.c index f11b03cbb4..4cbf6dc21f 100644 --- a/shared-module/_pixelbuf/PixelBuf.c +++ b/shared-module/_pixelbuf/PixelBuf.c @@ -112,7 +112,8 @@ void common_hal__pixelbuf_pixelbuf_set_brightness(mp_obj_t self_in, mp_float_t b // Skip out if the brightness is already set. The default of self->brightness is 1.0. So, this // also prevents the pre_brightness_buffer allocation when brightness is set to 1.0 again. self->brightness = brightness; - uint16_t new_scaled_brightness = (int)roundf(brightness * 256); + // Use 256 steps of brightness so that we can do integer math below. + uint16_t new_scaled_brightness = (uint16_t)(brightness * 256); if (new_scaled_brightness == self->scaled_brightness) { return; } @@ -130,7 +131,7 @@ void common_hal__pixelbuf_pixelbuf_set_brightness(mp_obj_t self_in, mp_float_t b if (self->byteorder.is_dotstar && i % 4 == 0) { continue; } - self->post_brightness_buffer[i] = (self->pre_brightness_buffer[i] * self->scaled_brightness) >> 8; + self->post_brightness_buffer[i] = (self->pre_brightness_buffer[i] * self->scaled_brightness) / 256; } if (self->auto_write) { @@ -224,13 +225,13 @@ void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t* self, size_t index, uint if (scaled_buffer) { if (self->bytes_per_pixel == 4) { if (!self->byteorder.is_dotstar) { - w = (w * self->scaled_brightness) >> 8; + w = (w * self->scaled_brightness) / 256; } scaled_buffer[rgbw_order->w] = w; } - scaled_buffer[rgbw_order->r] = (r * self->scaled_brightness) >> 8; - scaled_buffer[rgbw_order->g] = (g * self->scaled_brightness) >> 8; - scaled_buffer[rgbw_order->b] = (b * self->scaled_brightness) >> 8; + scaled_buffer[rgbw_order->r] = (r * self->scaled_brightness) / 256; + scaled_buffer[rgbw_order->g] = (g * self->scaled_brightness) / 256; + scaled_buffer[rgbw_order->b] = (b * self->scaled_brightness) / 256; } } @@ -331,23 +332,3 @@ void common_hal__pixelbuf_pixelbuf_fill(mp_obj_t self_in, mp_obj_t fill_color) { common_hal__pixelbuf_pixelbuf_show(self_in); } } - -mp_int_t common_hal__pixelbuf_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags) { - pixelbuf_pixelbuf_obj_t *self = native_pixelbuf(self_in); - bufinfo->buf = self->pre_brightness_buffer; - if (self->pre_brightness_buffer) { - // If we have a brightness setting, we must treat the buffer as - // read-only (because we have no way to "fire" the - // brightness-converting code as a side effect of mutation via the - // buffer) - if ((flags & MP_BUFFER_WRITE)) { - return 1; - } - bufinfo->buf = self->pre_brightness_buffer; - } else { - bufinfo->buf = self->post_brightness_buffer; - } - bufinfo->typecode = 'B'; - bufinfo->len = self->bytes_per_pixel * common_hal__pixelbuf_pixelbuf_get_len(self_in); - return 0; -} From 00b1d4e16799bf2d0bb3165b7e15bfc19066c697 Mon Sep 17 00:00:00 2001 From: Daniel Glocker Date: Wed, 24 Feb 2021 11:38:14 +0000 Subject: [PATCH 103/159] Translated using Weblate (German) Currently translated at 81.2% (783 of 964 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/de/ --- locale/de_DE.po | 58 ++++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index dfb60ca4e4..2aff8ca54f 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -6,14 +6,14 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-05 15:41+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2021-02-25 00:24+0000\n" +"Last-Translator: Daniel Glocker \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.5-dev\n" +"X-Generator: Weblate 4.5\n" #: main.c msgid "" @@ -28,6 +28,8 @@ msgid "" "\n" "Code stopped by auto-reload.\n" msgstr "" +"\n" +"Code durch automatisches neuladen gestoppt\n" #: supervisor/shared/safe_mode.c msgid "" @@ -49,7 +51,7 @@ msgstr " Datei \"%q\", Zeile %d" #: py/builtinhelp.c msgid " is of type %q\n" -msgstr "" +msgstr " ist vom Type %q\n" #: main.c msgid " output:\n" @@ -65,6 +67,8 @@ msgstr "%%c erwartet int oder char" msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +"%d Address Pins, %d rgb Pins und %d Tiles indiziert eine Höhe von %d, nicht " +"%d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" @@ -126,7 +130,7 @@ msgstr "" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c #, c-format msgid "%s error 0x%x" -msgstr "" +msgstr "%s Error 0x%x" #: py/argcheck.c msgid "'%q' argument required" @@ -146,7 +150,7 @@ msgstr "'%q' Objekt unterschützt keine Elementzuweisung" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "'%q' objekt unterstützt das " +msgstr "'%q' Objekt unterstützt löschen von Elementen nicht" #: py/runtime.c msgid "'%q' object has no attribute '%q'" @@ -162,7 +166,7 @@ msgstr "'%q' Objekt ist kein callable" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "" +msgstr "'%q' Objekt ist nicht iterierbar" #: py/obj.c msgid "'%q' object is not subscriptable" @@ -292,7 +296,7 @@ msgstr "3-arg pow() wird nicht unterstützt" #: shared-module/msgpack/__init__.c msgid "64 bit types" -msgstr "" +msgstr "64 bit Typen" #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -346,7 +350,7 @@ msgstr "Alle event Kanäle werden benutzt" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" -msgstr "" +msgstr "Alle state machines in verwendung" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" @@ -455,7 +459,7 @@ msgstr "" #: ports/esp32s2/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "" +msgstr "Baudrate wird von der Peripherie nicht unterstützt" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c @@ -469,7 +473,7 @@ msgstr "Bit clock und word select müssen eine clock unit teilen" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" +msgstr "Bittiefe muss zwischen 1 und 6 liegen, nicht %d" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." @@ -566,7 +570,7 @@ msgstr "CBC-Blöcke müssen ein Vielfaches von 16 Bytes sein" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "CRC or checksum was invalid" -msgstr "" +msgstr "CRC oder Checksumme ungültig" #: py/objtype.c msgid "Call super().__init__() before accessing native object." @@ -574,7 +578,7 @@ msgstr "Rufe super().__init__() vor dem Zugriff auf ein natives Objekt auf." #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." -msgstr "" +msgstr "Alarm der RTC IO kann nur im deep sleep ausgeführt werden." #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." @@ -620,7 +624,7 @@ msgstr "Kann nicht beite Kanäle auf dem gleichen Pin ausgeben" #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." -msgstr "" +msgstr "Kann nicht 'pull' an einem 'input-only' pin." #: shared-module/bitbangio/SPI.c msgid "Cannot read without MISO pin." @@ -642,7 +646,7 @@ msgstr "Reset zum bootloader nicht möglich da bootloader nicht vorhanden." #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Cannot set socket options" -msgstr "" +msgstr "Socket Optionen können nicht gesetzt werden" #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." @@ -672,7 +676,7 @@ msgstr "" #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." -msgstr "" +msgstr "Kann nicht auf Flanke wecken, nur auf Level." #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." @@ -830,7 +834,7 @@ msgstr "Data 0 pin muss am Byte ausgerichtet sein" #: ports/esp32s2/common-hal/displayio/ParallelBus.c msgid "Data 0 pin must be byte aligned." -msgstr "" +msgstr "Data 0 Pin muss Byte aligned sein." #: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" @@ -888,7 +892,7 @@ msgstr "Fehler in regex" #: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c msgid "Error: Failure to bind" -msgstr "" +msgstr "Error: Bind Fehler" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c @@ -926,7 +930,7 @@ msgstr "Erwartet eine Adresse" #: shared-bindings/alarm/__init__.c msgid "Expected an alarm" -msgstr "" +msgstr "Alarm erwartet" #: shared-module/_pixelbuf/PixelBuf.c #, c-format @@ -1042,7 +1046,7 @@ msgstr "Die Funktion erwartet, dass der 'lock'-Befehl zuvor ausgeführt wurde" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Generic Failure" -msgstr "" +msgstr "Generischer Fehler" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c @@ -1078,7 +1082,7 @@ msgstr "I2C-Init-Fehler" #: ports/raspberrypi/common-hal/busio/I2C.c msgid "I2C peripheral in use" -msgstr "" +msgstr "I2C Peripherie in Verwendung" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" @@ -1107,7 +1111,7 @@ msgstr "Inkorrekte Puffergröße" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Init program size invalid" -msgstr "" +msgstr "Init Programm Größe ungültig" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" @@ -1116,11 +1120,11 @@ msgstr "Initialisierung aufgrund von Speichermangel fehlgeschlagen" #: shared-bindings/bitops/__init__.c #, c-format msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" -msgstr "" +msgstr "Input buffer länge (%d) muss ein vielfaches vom Strand Count (%d) sein" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" -msgstr "" +msgstr "Input benötigt zu lange" #: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" @@ -1129,7 +1133,7 @@ msgstr "Eingabe-/Ausgabefehler" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d jumps on pin" -msgstr "" +msgstr "Instruktion %d springt auf Pin" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1208,7 +1212,7 @@ msgstr "Ungültige PWM Frequenz" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" -msgstr "" +msgstr "Ungültiger Pin" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c @@ -2356,7 +2360,7 @@ msgstr "WatchDogTimer.timeout muss größer als 0 sein" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." -msgstr "Watchdog timer abgelaufen " +msgstr "Watchdog timer abgelaufen." #: py/builtinhelp.c #, c-format From d9a2c8308f5b5286efbddb3992a58ae886fb0c07 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 25 Feb 2021 01:24:53 +0100 Subject: [PATCH 104/159] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 43 +++++++++++++++++++++++++++++++---- locale/cs.po | 43 +++++++++++++++++++++++++++++++---- locale/de_DE.po | 43 +++++++++++++++++++++++++++++++---- locale/el.po | 43 +++++++++++++++++++++++++++++++---- locale/es.po | 46 +++++++++++++++++++++++++++++++++---- locale/fil.po | 43 +++++++++++++++++++++++++++++++---- locale/fr.po | 49 ++++++++++++++++++++++++++++++++++++---- locale/hi.po | 43 +++++++++++++++++++++++++++++++---- locale/it_IT.po | 43 +++++++++++++++++++++++++++++++---- locale/ja.po | 43 +++++++++++++++++++++++++++++++---- locale/ko.po | 43 +++++++++++++++++++++++++++++++---- locale/nl.po | 43 +++++++++++++++++++++++++++++++---- locale/pl.po | 43 +++++++++++++++++++++++++++++++---- locale/pt_BR.po | 46 +++++++++++++++++++++++++++++++++---- locale/sv.po | 46 +++++++++++++++++++++++++++++++++---- locale/zh_Latn_pinyin.po | 46 +++++++++++++++++++++++++++++++++---- 16 files changed, 641 insertions(+), 65 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index e1aed308ac..d1f9488710 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -107,6 +107,7 @@ msgstr "%q harus >= 1" msgid "%q must be a tuple of length 2" msgstr "%q harus berupa tuple dengan panjang 2" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q di luar jangkauan" @@ -460,6 +461,10 @@ msgstr "" msgid "Below minimum frame rate" msgstr "Di bawah frame rate minimum" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock dan word harus memiliki kesamaan pada clock unit" @@ -501,6 +506,10 @@ msgstr "Brightness tidak bisa disesuaikan" msgid "Buffer + offset too small %d %d %d" msgstr "Buffer + offset terlalu kecil %d %d %d" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1093,6 +1102,10 @@ msgstr "" msgid "IV must be %d bytes long" msgstr "Panjang IV harus %d byte" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1109,6 +1122,14 @@ msgstr "Ukuran penyangga salah" msgid "Init program size invalid" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1473,6 +1494,7 @@ msgstr "Tidak ada DAC (Digital Analog Converter) di dalam chip" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "tidak ada channel DMA ditemukan" @@ -1539,6 +1561,14 @@ msgstr "Tidak ada dukungan perangkat keras pada pin clk" msgid "No hardware support on pin" msgstr "Tidak ada dukungan hardware untuk pin" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "Tidak ada kunci yang ditentukan" @@ -1627,13 +1657,10 @@ msgid "Odd parity is not supported" msgstr "Parity ganjil tidak didukung" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "Hanya 8 atau 16 bit mono dengan " -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" @@ -1683,6 +1710,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "" @@ -2125,6 +2156,7 @@ msgid "To exit, please reset the board without " msgstr "Untuk keluar, silahkan reset board tanpa " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Terlalu banyak channel dalam sampel" @@ -2195,6 +2227,7 @@ msgstr "Nilai UUID bukan str, int atau byte buffer" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "Tidak dapat mengalokasikan buffer untuk signed conversion" @@ -3734,6 +3767,7 @@ msgstr "" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -3811,6 +3845,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "nilai sampling keluar dari jangkauan" diff --git a/locale/cs.po b/locale/cs.po index c6d537fcce..abcf015688 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -105,6 +105,7 @@ msgstr "%q musí být > = 1" msgid "%q must be a tuple of length 2" msgstr "%q musí být n-tice délky 2" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q je mimo rozsah" @@ -456,6 +457,10 @@ msgstr "" msgid "Below minimum frame rate" msgstr "" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "" @@ -497,6 +502,10 @@ msgstr "" msgid "Buffer + offset too small %d %d %d" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1077,6 +1086,10 @@ msgstr "" msgid "IV must be %d bytes long" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1091,6 +1104,14 @@ msgstr "" msgid "Init program size invalid" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1455,6 +1476,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "" @@ -1521,6 +1543,14 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "" @@ -1607,13 +1637,10 @@ msgid "Odd parity is not supported" msgstr "" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" @@ -1659,6 +1686,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "" @@ -2088,6 +2119,7 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2157,6 +2189,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "" @@ -3685,6 +3718,7 @@ msgstr "" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -3762,6 +3796,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 2aff8ca54f..0f4585b435 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -110,6 +110,7 @@ msgstr "%q muss >= 1 sein" msgid "%q must be a tuple of length 2" msgstr "%q muss ein Tupel der Länge 2 sein" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q außerhalb des Bereichs" @@ -466,6 +467,10 @@ msgstr "Baudrate wird von der Peripherie nicht unterstützt" msgid "Below minimum frame rate" msgstr "Unterhalb der minimalen Frame Rate" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock und word select müssen eine clock unit teilen" @@ -507,6 +512,10 @@ msgstr "Die Helligkeit ist nicht einstellbar" msgid "Buffer + offset too small %d %d %d" msgstr "Buffer + Offset zu klein %d %d %d" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1097,6 +1106,10 @@ msgstr "IOs 0, 2 & 4 unterstützen keinen internen Pull up im sleep-Modus" msgid "IV must be %d bytes long" msgstr "IV muss %d Bytes lang sein" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1113,6 +1126,14 @@ msgstr "Inkorrekte Puffergröße" msgid "Init program size invalid" msgstr "Init Programm Größe ungültig" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "Initialisierung aufgrund von Speichermangel fehlgeschlagen" @@ -1479,6 +1500,7 @@ msgstr "Kein DAC im Chip vorhanden" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "Kein DMA Kanal gefunden" @@ -1545,6 +1567,14 @@ msgstr "Keine Hardwareunterstützung am clk Pin" msgid "No hardware support on pin" msgstr "Keine Hardwareunterstützung an diesem Pin" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "Es wurde kein Schlüssel angegeben" @@ -1633,13 +1663,10 @@ msgid "Odd parity is not supported" msgstr "Eine ungerade Parität wird nicht unterstützt" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "Nur 8 oder 16 bit mono mit " -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" @@ -1689,6 +1716,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "" @@ -2133,6 +2164,7 @@ msgid "To exit, please reset the board without " msgstr "Zum beenden, resette bitte das board ohne " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zu viele Kanäle im sample." @@ -2204,6 +2236,7 @@ msgstr "Der UUID-Wert ist kein str-, int- oder Byte-Puffer" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "Konnte keine Buffer für Vorzeichenumwandlung allozieren" @@ -3771,6 +3804,7 @@ msgstr "pow () mit 3 Argumenten erfordert Integer" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -3850,6 +3884,7 @@ msgstr "" "oder 'B' sein" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "Abtastrate außerhalb der Reichweite" diff --git a/locale/el.po b/locale/el.po index b088a7645f..ce55d55c85 100644 --- a/locale/el.po +++ b/locale/el.po @@ -102,6 +102,7 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -453,6 +454,10 @@ msgstr "" msgid "Below minimum frame rate" msgstr "" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "" @@ -494,6 +499,10 @@ msgstr "" msgid "Buffer + offset too small %d %d %d" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1074,6 +1083,10 @@ msgstr "" msgid "IV must be %d bytes long" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1088,6 +1101,14 @@ msgstr "" msgid "Init program size invalid" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1452,6 +1473,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "" @@ -1518,6 +1540,14 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "" @@ -1604,13 +1634,10 @@ msgid "Odd parity is not supported" msgstr "" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" @@ -1656,6 +1683,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "" @@ -2085,6 +2116,7 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2154,6 +2186,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "" @@ -3682,6 +3715,7 @@ msgstr "" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -3759,6 +3793,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "" diff --git a/locale/es.po b/locale/es.po index c5e199719b..d11003d67b 100644 --- a/locale/es.po +++ b/locale/es.po @@ -113,6 +113,7 @@ msgstr "%q debe ser >= 1" msgid "%q must be a tuple of length 2" msgstr "%q debe ser una tupla de longitud 2" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q fuera de rango" @@ -470,6 +471,10 @@ msgstr "El periférico no maneja el Baudrate" msgid "Below minimum frame rate" msgstr "Por debajo de la tasa mínima de refrescamiento" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock y word select deben compartir una unidad de reloj" @@ -511,6 +516,10 @@ msgstr "El brillo no se puede ajustar" msgid "Buffer + offset too small %d %d %d" msgstr "Búfer + compensado muy pequeños %d %d %d" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1100,6 +1109,10 @@ msgstr "IOs 0, 2 y 4 no soportan pullup interno durante sleep" msgid "IV must be %d bytes long" msgstr "IV debe tener %d bytes de longitud" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1116,6 +1129,14 @@ msgstr "Tamaño incorrecto del buffer" msgid "Init program size invalid" msgstr "Tamaño del programa Init invalido" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "Inicializacion fallida por falta de memoria" @@ -1486,6 +1507,7 @@ msgstr "El chip no tiene DAC" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "No se encontró el canal DMA" @@ -1552,6 +1574,14 @@ msgstr "Sin soporte de hardware en el pin clk" msgid "No hardware support on pin" msgstr "Sin soporte de hardware en pin" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "No se especificó ninguna llave" @@ -1640,13 +1670,10 @@ msgid "Odd parity is not supported" msgstr "Paridad impar no soportada" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "Solo mono de 8 ó 16 bit con " -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "Solamente IN/OUT hasta 8 esta soportado" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Solo hay capacidad para direcciones IPv4" @@ -1696,6 +1723,10 @@ msgstr "Operación no característica no soportada" msgid "Operation timed out" msgstr "Tiempo de espera agotado" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "Memoria agotada" @@ -2150,6 +2181,7 @@ msgid "To exit, please reset the board without " msgstr "Para salir, por favor reinicia la tarjeta sin " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Demasiados canales en sample." @@ -2220,6 +2252,7 @@ msgstr "UUID valor no es un str, int o byte buffer" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "No se pudieron asignar buffers para la conversión con signo" @@ -3773,6 +3806,7 @@ msgstr "pow() con 3 argumentos requiere enteros" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "presionando botón de arranque al inicio.\n" @@ -3852,6 +3886,7 @@ msgstr "" "o'B'" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "frecuencia de muestreo fuera de rango" @@ -4286,6 +4321,9 @@ msgstr "zi debe ser de tipo flotante" msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "Only IN/OUT of up to 8 supported" +#~ msgstr "Solamente IN/OUT hasta 8 esta soportado" + #~ msgid "SDA or SCL needs a pull up" #~ msgstr "SDA o SCL necesitan una pull up" diff --git a/locale/fil.po b/locale/fil.po index 1eecc49dc9..969634711c 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -102,6 +102,7 @@ msgstr "aarehas na haba dapat ang buffer slices" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -458,6 +459,10 @@ msgstr "" msgid "Below minimum frame rate" msgstr "" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "Ang bit clock at word select dapat makibahagi sa isang clock unit" @@ -499,6 +504,10 @@ msgstr "" msgid "Buffer + offset too small %d %d %d" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1087,6 +1096,10 @@ msgstr "" msgid "IV must be %d bytes long" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1103,6 +1116,14 @@ msgstr "" msgid "Init program size invalid" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1467,6 +1488,7 @@ msgstr "Walang DAC sa chip" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "Walang DMA channel na mahanap" @@ -1533,6 +1555,14 @@ msgstr "" msgid "No hardware support on pin" msgstr "Walang support sa hardware ang pin" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "" @@ -1622,13 +1652,10 @@ msgid "Odd parity is not supported" msgstr "Odd na parity ay hindi supportado" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "Tanging 8 o 16 na bit mono na may " -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" @@ -1674,6 +1701,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "" @@ -2105,6 +2136,7 @@ msgid "To exit, please reset the board without " msgstr "Para lumabas, paki-reset ang board na wala ang " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Sobra ang channels sa sample." @@ -2174,6 +2206,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "Hindi ma-allocate ang buffers para sa naka-sign na conversion" @@ -3731,6 +3764,7 @@ msgstr "pow() na may 3 argumento kailangan ng integers" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -3810,6 +3844,7 @@ msgstr "" "'H', 'b' o'B'" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "pagpili ng rate wala sa sakop" diff --git a/locale/fr.po b/locale/fr.po index a53d8658e1..596494a98a 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -113,6 +113,7 @@ msgstr "%q doit être >= 1" msgid "%q must be a tuple of length 2" msgstr "%q doit être un tuple de longueur 2" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q est hors de porté" @@ -470,6 +471,10 @@ msgstr "Baudrate non supporté par le périphérique" msgid "Below minimum frame rate" msgstr "Au-dessous de la fréquence d'images minimale" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "'bit clock' et 'word select' doivent partager une horloge" @@ -511,6 +516,10 @@ msgstr "Luminosité non-ajustable" msgid "Buffer + offset too small %d %d %d" msgstr "Tampon + décalage trop petit %d %d %d" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1109,6 +1118,10 @@ msgstr "IOs 0, 2 & 4 ne supportent pas l'éleveuse interne en mode someil" msgid "IV must be %d bytes long" msgstr "IV doit être de longueur de %d octets" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1125,6 +1138,14 @@ msgstr "Taille de tampon incorrecte" msgid "Init program size invalid" msgstr "Taille du programme d'initialisation non valide" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "Échec d'initialisation par manque de mémoire" @@ -1441,7 +1462,8 @@ msgstr "first_in_pin manquant. Instruction %d lit une/des broche(s)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)" -msgstr "first_in_pin manquant. Instruction %d est déplacée par la/les broche(s)" +msgstr "" +"first_in_pin manquant. Instruction %d est déplacée par la/les broche(s)" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1496,6 +1518,7 @@ msgstr "Pas de DAC sur la puce" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "Aucun canal DMA trouvé" @@ -1562,6 +1585,14 @@ msgstr "Pas de support matériel sur la broche clk" msgid "No hardware support on pin" msgstr "Pas de support matériel pour cette broche" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "Aucune clé n'a été spécifiée" @@ -1650,13 +1681,10 @@ msgid "Odd parity is not supported" msgstr "Parité impaire non supportée" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "Uniquement 8 ou 16 bit mono avec " -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "Seulement des IN/OUT jusqu'à 8 est supporté" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Seulement les adresses IPv4 sont supportées" @@ -1706,6 +1734,10 @@ msgstr "Opération ou fonction non supportée" msgid "Operation timed out" msgstr "Timeout de l'opération" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "Hors de mémoire" @@ -2160,6 +2192,7 @@ msgid "To exit, please reset the board without " msgstr "Pour quitter, SVP redémarrez la carte sans " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Trop de canaux dans l'échantillon." @@ -2233,6 +2266,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "Impossible d'allouer des tampons pour une conversion signée" @@ -3799,6 +3833,7 @@ msgstr "pow() avec 3 arguments nécessite des entiers" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "bouton boot appuyé lors du démarrage.\n" @@ -3878,6 +3913,7 @@ msgstr "" "'h','H', 'b' ou 'B'" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "taux d'échantillonage hors bornes" @@ -4312,6 +4348,9 @@ msgstr "zi doit être de type float" msgid "zi must be of shape (n_section, 2)" msgstr "zi doit être de forme (n_section, 2)" +#~ msgid "Only IN/OUT of up to 8 supported" +#~ msgstr "Seulement des IN/OUT jusqu'à 8 est supporté" + #~ msgid "SDA or SCL needs a pull up" #~ msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')" diff --git a/locale/hi.po b/locale/hi.po index 3d81006978..2124d45655 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -102,6 +102,7 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -453,6 +454,10 @@ msgstr "" msgid "Below minimum frame rate" msgstr "" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "" @@ -494,6 +499,10 @@ msgstr "" msgid "Buffer + offset too small %d %d %d" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1074,6 +1083,10 @@ msgstr "" msgid "IV must be %d bytes long" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1088,6 +1101,14 @@ msgstr "" msgid "Init program size invalid" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1452,6 +1473,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "" @@ -1518,6 +1540,14 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "" @@ -1604,13 +1634,10 @@ msgid "Odd parity is not supported" msgstr "" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" @@ -1656,6 +1683,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "" @@ -2085,6 +2116,7 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2154,6 +2186,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "" @@ -3682,6 +3715,7 @@ msgstr "" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -3759,6 +3793,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 0153dc889c..cc11e9f994 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -112,6 +112,7 @@ msgstr "slice del buffer devono essere della stessa lunghezza" msgid "%q must be a tuple of length 2" msgstr "%q deve essere una tupla di lunghezza 2" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q oltre il limite" @@ -467,6 +468,10 @@ msgstr "" msgid "Below minimum frame rate" msgstr "Al di sotto del frame rate minimo" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "" @@ -509,6 +514,10 @@ msgstr "Luminosità non è regolabile" msgid "Buffer + offset too small %d %d %d" msgstr "Buffer + offset troppo piccolo %d %d %d" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1096,6 +1105,10 @@ msgstr "" msgid "IV must be %d bytes long" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1112,6 +1125,14 @@ msgstr "" msgid "Init program size invalid" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1480,6 +1501,7 @@ msgstr "Nessun DAC sul chip" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "Nessun canale DMA trovato" @@ -1546,6 +1568,14 @@ msgstr "" msgid "No hardware support on pin" msgstr "Nessun supporto hardware sul pin" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "" @@ -1636,13 +1666,10 @@ msgid "Odd parity is not supported" msgstr "operazione I2C non supportata" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" @@ -1688,6 +1715,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "" @@ -2126,6 +2157,7 @@ msgid "To exit, please reset the board without " msgstr "Per uscire resettare la scheda senza " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2195,6 +2227,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "Ipossibilitato ad allocare buffer per la conversione con segno" @@ -3748,6 +3781,7 @@ msgstr "pow() con 3 argomenti richiede interi" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -3827,6 +3861,7 @@ msgstr "" "'H', 'b' o 'B'" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "frequenza di campionamento fuori intervallo" diff --git a/locale/ja.po b/locale/ja.po index 2616789f4b..999ddf4288 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -107,6 +107,7 @@ msgstr "%qは1以上でなければなりません" msgid "%q must be a tuple of length 2" msgstr "%qは長さ2のタプルでなければなりません" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q が範囲外" @@ -460,6 +461,10 @@ msgstr "" msgid "Below minimum frame rate" msgstr "最低のフレームレート未満" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "bit clockとword selectはクロックユニットを共有しなければなりません" @@ -501,6 +506,10 @@ msgstr "Brightnessは調整可能ではありません" msgid "Buffer + offset too small %d %d %d" msgstr "buffer + offsetが小さすぎます %d %d %d" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1085,6 +1094,10 @@ msgstr "" msgid "IV must be %d bytes long" msgstr "IVは%dバイト長でなければなりません" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1101,6 +1114,14 @@ msgstr "バッファサイズが正しくありません" msgid "Init program size invalid" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1465,6 +1486,7 @@ msgstr "チップにDACがありません" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "DMAチャネルが見つかりません" @@ -1531,6 +1553,14 @@ msgstr "clkピンにハードウェア対応がありません" msgid "No hardware support on pin" msgstr "ピンにハードウェア対応がありません" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "キーが指定されていません" @@ -1619,13 +1649,10 @@ msgid "Odd parity is not supported" msgstr "奇数パリティには対応していません" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "8または16ビットの " -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" @@ -1671,6 +1698,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "" @@ -2107,6 +2138,7 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "サンプルのチャンネル数が多すぎます" @@ -2177,6 +2209,7 @@ msgstr "UUIDの値がstr, int, bufferのいずれでもありません" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "" @@ -3712,6 +3745,7 @@ msgstr "pow()の第3引数には整数が必要" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -3790,6 +3824,7 @@ msgstr "" "sample_source バッファには bytearray または 'h','H','b','B'型のarrayが必要" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "サンプリングレートが範囲外" diff --git a/locale/ko.po b/locale/ko.po index 26810f87e5..ef2e40881e 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -103,6 +103,7 @@ msgstr "%q 는 >=1이어야합니다" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -456,6 +457,10 @@ msgstr "" msgid "Below minimum frame rate" msgstr "" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "" @@ -497,6 +502,10 @@ msgstr "밝기를 조절할 수 없습니다" msgid "Buffer + offset too small %d %d %d" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1077,6 +1086,10 @@ msgstr "" msgid "IV must be %d bytes long" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1091,6 +1104,14 @@ msgstr "" msgid "Init program size invalid" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1455,6 +1476,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "" @@ -1521,6 +1543,14 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "" @@ -1607,13 +1637,10 @@ msgid "Odd parity is not supported" msgstr "" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" @@ -1659,6 +1686,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "" @@ -2088,6 +2119,7 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2158,6 +2190,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "" @@ -3686,6 +3719,7 @@ msgstr "" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -3763,6 +3797,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 463a70da25..63be3b62b9 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -105,6 +105,7 @@ msgstr "%q moet >= 1 zijn" msgid "%q must be a tuple of length 2" msgstr "%q moet een tuple van lengte 2 zijn" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q buiten bereik" @@ -458,6 +459,10 @@ msgstr "Baudrate wordt niet ondersteund door randapparatuur" msgid "Below minimum frame rate" msgstr "Onder de minimum frame rate" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock en word select moeten een clock eenheid delen" @@ -499,6 +504,10 @@ msgstr "Helderheid is niet aanpasbaar" msgid "Buffer + offset too small %d %d %d" msgstr "Buffer + offset te klein %d %d %d" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1086,6 +1095,10 @@ msgstr "IO's 0, 2 en 4 ondersteunen geen interne pullup in slaapstand" msgid "IV must be %d bytes long" msgstr "IV %d bytes lang zijn" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1102,6 +1115,14 @@ msgstr "Incorrecte buffer grootte" msgid "Init program size invalid" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "De initialisatie is mislukt vanwege een gebrek aan geheugen" @@ -1466,6 +1487,7 @@ msgstr "Geen DAC op de chip" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "Geen DMA kanaal gevonden" @@ -1532,6 +1554,14 @@ msgstr "Geen hardware ondersteuning beschikbaar op clk pin" msgid "No hardware support on pin" msgstr "Geen hardware ondersteuning op pin" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "Een sleutel was niet gespecificeerd" @@ -1620,13 +1650,10 @@ msgid "Odd parity is not supported" msgstr "Oneven pariteit is niet ondersteund" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "Alleen 8 of 16 bit mono met " -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Alleen IPv4 adressen worden ondersteund" @@ -1676,6 +1703,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "" @@ -2127,6 +2158,7 @@ msgid "To exit, please reset the board without " msgstr "Om te beëindigen, reset het bord zonder " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Teveel kanalen in sample." @@ -2196,6 +2228,7 @@ msgstr "UUID waarde is geen str, int, of byte buffer" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "Niet in staat buffers voor gesigneerde conversie te alloceren" @@ -3744,6 +3777,7 @@ msgstr "pow() met 3 argumenten vereist integers" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "druk bootknop in bij opstarten.\n" @@ -3823,6 +3857,7 @@ msgstr "" "'B' zijn" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "bemonsteringssnelheid buiten bereik" diff --git a/locale/pl.po b/locale/pl.po index bf914aefb3..ad9a120ebe 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -107,6 +107,7 @@ msgstr "%q musi być >= 1" msgid "%q must be a tuple of length 2" msgstr "%q musi być krotką o długości 2" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q poza zakresem" @@ -460,6 +461,10 @@ msgstr "" msgid "Below minimum frame rate" msgstr "" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "Zegar bitowy i wybór słowa muszą współdzielić jednostkę zegara" @@ -501,6 +506,10 @@ msgstr "Jasność nie jest regulowana" msgid "Buffer + offset too small %d %d %d" msgstr "Bufor + przesunięcie za małe %d %d %d" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1085,6 +1094,10 @@ msgstr "" msgid "IV must be %d bytes long" msgstr "IV musi mieć długość %d bajtów" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1101,6 +1114,14 @@ msgstr "Niewłaściwa wielkość bufora" msgid "Init program size invalid" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "Inicjalizacja nie powiodła się z powodu braku pamięci" @@ -1466,6 +1487,7 @@ msgstr "Brak DAC" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "Nie znaleziono kanału DMA" @@ -1532,6 +1554,14 @@ msgstr "" msgid "No hardware support on pin" msgstr "Brak sprzętowej obsługi na nóżce" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "Nie określono klucza" @@ -1618,13 +1648,10 @@ msgid "Odd parity is not supported" msgstr "Nieparzysta parzystość nie jest wspierana" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "Tylko 8 lub 16 bitów mono z " -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" @@ -1670,6 +1697,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "Brak pamięci" @@ -2099,6 +2130,7 @@ msgid "To exit, please reset the board without " msgstr "By wyjść, proszę zresetować płytkę bez " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zbyt wiele kanałów." @@ -2168,6 +2200,7 @@ msgstr "UUID nie jest typu str, int lub bytes" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "Nie udała się alokacja buforów do konwersji ze znakiem" @@ -3704,6 +3737,7 @@ msgstr "trzyargumentowe pow() wymaga liczb całkowitych" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -3782,6 +3816,7 @@ msgstr "" "bufor sample_source musi być bytearray lub tablicą typu 'h', 'H', 'b' lub 'B'" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "częstotliwość próbkowania poza zakresem" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index c283cdda81..7d8142b98c 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -111,6 +111,7 @@ msgstr "%q deve ser >= 1" msgid "%q must be a tuple of length 2" msgstr "%q deve ser uma tupla de comprimento 2" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q fora do alcance" @@ -470,6 +471,10 @@ msgstr "O Baudrate não é suportado pelo periférico" msgid "Below minimum frame rate" msgstr "Abaixo da taxa mínima de quadros" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "" @@ -513,6 +518,10 @@ msgstr "Brilho não ajustável" msgid "Buffer + offset too small %d %d %d" msgstr "O buffer + desvio é muito pequeno %d %d %d" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1104,6 +1113,10 @@ msgstr "IOs 0, 2 e 4 não suportam pullup interno em repouso (sleep)" msgid "IV must be %d bytes long" msgstr "O IV deve ter %d bytes de comprimento" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1120,6 +1133,14 @@ msgstr "O tamanho do buffer está incorreto" msgid "Init program size invalid" msgstr "O tamanho do programa Init é inválido" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "A inicialização falhou devido à falta de memória" @@ -1486,6 +1507,7 @@ msgstr "Nenhum DAC no chip" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "Nenhum canal DMA foi encontrado" @@ -1552,6 +1574,14 @@ msgstr "Sem suporte de hardware no pino de clock" msgid "No hardware support on pin" msgstr "Nenhum suporte de hardware no pino" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "Nenhuma chave foi definida" @@ -1641,13 +1671,10 @@ msgid "Odd parity is not supported" msgstr "A paridade ímpar não é compatível" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "Apenas mono com 8 ou 16 bits com " -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "Somente IN/OUT de até 8 suportados" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Somente os endereços IPv4 são suportados" @@ -1697,6 +1724,10 @@ msgstr "A operação ou o recurso não é suportado" msgid "Operation timed out" msgstr "A operação expirou" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "Sem memória" @@ -2156,6 +2187,7 @@ msgid "To exit, please reset the board without " msgstr "Para sair, por favor, reinicie a placa sem " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Muitos canais na amostra." @@ -2226,6 +2258,7 @@ msgstr "O valor UUID não é um buffer str, int ou byte" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "Não é possível alocar buffers para conversão assinada" @@ -3786,6 +3819,7 @@ msgstr "o pow() com 3 argumentos requer números inteiros" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "pressionando o botão de boot na inicialização.\n" @@ -3865,6 +3899,7 @@ msgstr "" "ou 'B'" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "Taxa de amostragem fora do intervalo" @@ -4298,6 +4333,9 @@ msgstr "zi deve ser de um tipo float" msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" +#~ msgid "Only IN/OUT of up to 8 supported" +#~ msgstr "Somente IN/OUT de até 8 suportados" + #~ msgid "SDA or SCL needs a pull up" #~ msgstr "SDA ou SCL precisa de um pull up" diff --git a/locale/sv.po b/locale/sv.po index 7b82d7a7f2..abf892b099 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -110,6 +110,7 @@ msgstr "%q måste vara >= 1" msgid "%q must be a tuple of length 2" msgstr "%q måste vara en tuple av längd 2" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q utanför intervallet" @@ -463,6 +464,10 @@ msgstr "Baudrate stöds inte av kringutrustning" msgid "Below minimum frame rate" msgstr "Under minsta bildfrekvens" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "Bitklocka och ordval måste dela en klockenhet" @@ -504,6 +509,10 @@ msgstr "Ljusstyrka kan inte justeras" msgid "Buffer + offset too small %d %d %d" msgstr "Buffert + offset för liten %d %d %d" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1091,6 +1100,10 @@ msgstr "IO 0, 2 & 4 stöder inte intern pullup för sovläge" msgid "IV must be %d bytes long" msgstr "IV måste vara %d byte lång" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1107,6 +1120,14 @@ msgstr "Fel buffertstorlek" msgid "Init program size invalid" msgstr "Storlek på init-program ogiltigt" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "Initieringen misslyckades på grund av minnesbrist" @@ -1472,6 +1493,7 @@ msgstr "Ingen DAC på chipet" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "Ingen DMA-kanal hittades" @@ -1538,6 +1560,14 @@ msgstr "Inget hårdvarustöd på clk-pinne" msgid "No hardware support on pin" msgstr "Inget hårdvarustöd på pinne" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "Ingen nyckel angavs" @@ -1626,13 +1656,10 @@ msgid "Odd parity is not supported" msgstr "Udda paritet stöds inte" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "Endast 8 eller 16 bitars mono med " -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "Endast IN/OUT på upp till 8 stöds" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Endast IPv4-adresser stöds" @@ -1681,6 +1708,10 @@ msgstr "Operation eller funktion stöds inte" msgid "Operation timed out" msgstr "Åtgärden orsakade timeout" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "Slut på minne" @@ -2131,6 +2162,7 @@ msgid "To exit, please reset the board without " msgstr "För att avsluta, gör reset på kortet utan " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "För många kanaler i sampling." @@ -2200,6 +2232,7 @@ msgstr "UUID-värdet är inte str, int eller byte-buffert" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "Det går inte att allokera buffert för signerad konvertering" @@ -3745,6 +3778,7 @@ msgstr "pow() med 3 argument kräver heltal" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "trycka på startknappen vid start.\n" @@ -3824,6 +3858,7 @@ msgstr "" "'b' eller 'B'" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "samplingsfrekvens utanför räckvidden" @@ -4257,6 +4292,9 @@ msgstr "zi måste vara av typ float" msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" +#~ msgid "Only IN/OUT of up to 8 supported" +#~ msgstr "Endast IN/OUT på upp till 8 stöds" + #~ msgid "SDA or SCL needs a pull up" #~ msgstr "SDA eller SCL behöver en pullup" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 5a08380002..5487e675cf 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -112,6 +112,7 @@ msgstr "%q bìxū dàyú huò děngyú 1" msgid "%q must be a tuple of length 2" msgstr "%q bìxū shì chángdù wèi 2 de yuán zǔ" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q chāochū fànwéi" @@ -465,6 +466,10 @@ msgstr "wài shè bù zhī chí de bō tè lā tè" msgid "Below minimum frame rate" msgstr "Dī yú zuìdī zhèng sùlǜ" +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "Bǐtè shízhōng hé dānzì xuǎnzé bìxū gòngxiǎng shízhōng dānwèi" @@ -506,6 +511,10 @@ msgstr "Liàngdù wúfǎ tiáozhěng" msgid "Buffer + offset too small %d %d %d" msgstr "Huǎnchōng qū hé piān yí liàng tài xiǎo %d %d %d" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." @@ -1090,6 +1099,10 @@ msgstr "IOS 0, 2 + 4 bù zhī chí shuì mián zhōng de nèi bù shàng lā" msgid "IV must be %d bytes long" msgstr "IV bì xū wéi %d zì jié cháng" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1106,6 +1119,14 @@ msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè" msgid "Init program size invalid" msgstr "Init chéng xù dà xiǎo wú xiào" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "yóu yú nèi cún bù zú, chū shǐ huà shī bài" @@ -1471,6 +1492,7 @@ msgstr "Méiyǒu DAC zài xīnpiàn shàng de" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" msgstr "Wèi zhǎodào DMA píndào" @@ -1537,6 +1559,14 @@ msgstr "Shízhōng yǐn jiǎo wú yìngjiàn zhīchí" msgid "No hardware support on pin" msgstr "Méiyǒu zài yǐn jiǎo shàng de yìngjiàn zhīchí" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "No key was specified" msgstr "Wèi zhǐdìng mì yào" @@ -1624,13 +1654,10 @@ msgid "Odd parity is not supported" msgstr "Bù zhīchí jīshù" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " msgstr "Zhǐyǒu 8 huò 16 wèi dānwèi " -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Only IN/OUT of up to 8 supported" -msgstr "jǐn zhī chí zuì duō 8 gè IN/OUT" - #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Jǐn zhīchí IPv4 dìzhǐ" @@ -1680,6 +1707,10 @@ msgstr "bù zhī chí cāo zuò huò gōng néng" msgid "Operation timed out" msgstr "cāo zuò yǐ fēn shí" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" msgstr "nèi cún bù zú" @@ -2125,6 +2156,7 @@ msgid "To exit, please reset the board without " msgstr "Yào tuìchū, qǐng chóng zhì bǎnkuài ér bùyòng " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Chōuyàng zhōng de píndào tài duō." @@ -2194,6 +2226,7 @@ msgstr "UUID zhí bùshì str,int huò zì jié huǎnchōng qū" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Unable to allocate buffers for signed conversion" msgstr "Wúfǎ fēnpèi huǎnchōng qū yòng yú qiānmíng zhuǎnhuàn" @@ -3738,6 +3771,7 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" #: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "Zài qǐdòng shí àn qǐdòng ànniǔ.\n" @@ -3817,6 +3851,7 @@ msgstr "" "huò 'B' de shùzǔ" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" msgstr "qǔyàng lǜ chāochū fànwéi" @@ -4250,6 +4285,9 @@ msgstr "zi bìxū wèi fú diǎn xíng" msgid "zi must be of shape (n_section, 2)" msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" +#~ msgid "Only IN/OUT of up to 8 supported" +#~ msgstr "jǐn zhī chí zuì duō 8 gè IN/OUT" + #~ msgid "SDA or SCL needs a pull up" #~ msgstr "SDA huò SCL xūyào lādòng" From 69b10d79253a6920f754e53b733674a768a069fa Mon Sep 17 00:00:00 2001 From: Seon Rozenblum Date: Thu, 25 Feb 2021 17:32:34 +1100 Subject: [PATCH 105/159] Added DAC1 & DAC2 pin names for FeatherS2 Expanded pin names for TinyS2 and added some new ones for functionality I forgot to add pin names for Cleaned up mpconfigboard --- .../boards/unexpectedmaker_feathers2/pins.c | 10 +-- .../unexpectedmaker_tinys2/mpconfigboard.mk | 3 - .../boards/unexpectedmaker_tinys2/pins.c | 67 +++++++++++-------- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c index bef2001bac..a4967992a8 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c @@ -1,13 +1,15 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, - { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, - { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO14) }, diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk index aa022e1869..0d054c0cb0 100644 --- a/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk +++ b/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk @@ -14,10 +14,7 @@ CIRCUITPY_ESP_FLASH_MODE=qio CIRCUITPY_ESP_FLASH_FREQ=80m CIRCUITPY_ESP_FLASH_SIZE=4MB -# CIRCUITPY_MODULE=wroom - CIRCUITPY_BITBANG_NEOPIXEL = 1 # Include these Python libraries in firmware. -# FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c b/ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c index 8ca7d98649..7b07b89293 100644 --- a/ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c @@ -1,73 +1,86 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - - { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, - // { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, - // { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, - // { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, - // { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, - // { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, - // { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) }, - // { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, - // { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO6) }, - // { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, - // { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, - // { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, - + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, - // { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO36) }, { MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, - // { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_SDO), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO35) }, { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, - // { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_SDI), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) }, - { MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) }, - // { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, - // { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO14) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, - // { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, - // { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO9) }, - + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, - // { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO38) }, { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) }, - // { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO33) }, { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, - // { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, - // { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + // Battery voltage sense pin + // I really don't know what name to use here. Adafruit use BATTERY & VOLTAGE_MONITOR + // I prefer VBAT or VBAT_SENSE + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_VBAT), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_VBAT_SENSE), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO3) }, + + // 5V present sense pin + { MP_ROM_QSTR(MP_QSTR_VBUS), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO1) }, From fb32e0a7fda168457b9b50a08d164cd34ce23bba Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Thu, 25 Feb 2021 09:44:33 +0100 Subject: [PATCH 106/159] qtpy_m0_haxpress: Change config to make it fit. --- .../boards/qtpy_m0_haxpress/mpconfigboard.mk | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk index 8773c5771d..c653585ea8 100644 --- a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk @@ -20,14 +20,4 @@ CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_MSGPACK = 0 SUPEROPT_GC = 0 - -CFLAGS_BOARD = --param max-inline-insns-auto=15 -ifeq ($(TRANSLATION), zh_Latn_pinyin) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 -endif -ifeq ($(TRANSLATION), de_DE) -RELEASE_NEEDS_CLEAN_BUILD = 1 -CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 -endif From 8170e26a869b1f00e2dc7aade84cb459155bf920 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 25 Feb 2021 23:46:00 +0530 Subject: [PATCH 107/159] more uart improvements - address suggested changes - refine uart instance availibility checks - improve pin validation and rx buffer handling --- ports/raspberrypi/common-hal/busio/UART.c | 99 ++++++++++++----------- 1 file changed, 53 insertions(+), 46 deletions(-) diff --git a/ports/raspberrypi/common-hal/busio/UART.c b/ports/raspberrypi/common-hal/busio/UART.c index e319b4ccf2..1f0f4e2f6f 100644 --- a/ports/raspberrypi/common-hal/busio/UART.c +++ b/ports/raspberrypi/common-hal/busio/UART.c @@ -42,15 +42,15 @@ typedef enum { STATUS_FREE = 0, - STATUS_IN_USE, + STATUS_BUSY, STATUS_NEVER_RESET } uart_status_t; -static uart_status_t uart_status[2]; +static uart_status_t uart_status[NUM_UARTS]; void reset_uart(void) { - for (uint8_t num = 0; num < 2; num++) { - if (uart_status[num] == STATUS_IN_USE) { + for (uint8_t num = 0; num < NUM_UARTS; num++) { + if (uart_status[num] == STATUS_BUSY) { uart_status[num] = STATUS_FREE; uart_deinit(UART_INST(num)); } @@ -61,24 +61,11 @@ void never_reset_uart(uint8_t num) { uart_status[num] = STATUS_NEVER_RESET; } -static uint8_t get_free_uart() { - uint8_t num; - for (num = 0; num < 2; num++) { - if (uart_status[num] == STATUS_FREE) { - break; - } - if (num) { - mp_raise_RuntimeError(translate("All UART peripherals are in use")); - } - } - return num; -} - static uint8_t pin_init(const uint8_t uart, const mcu_pin_obj_t * pin, const uint8_t pin_type) { if (pin == NULL) { return NO_PIN; } - if (!(((pin->number & 3) == pin_type) && ((((pin->number + 4) & 8) >> 3) == uart))) { + if (!(((pin->number % 4) == pin_type) && ((((pin->number + 4) / 8) % NUM_UARTS) == uart))) { mp_raise_ValueError(translate("Invalid pins")); } claim_pin(pin); @@ -86,14 +73,18 @@ static uint8_t pin_init(const uint8_t uart, const mcu_pin_obj_t * pin, const uin return pin->number; } -static ringbuf_t ringbuf[2]; +static ringbuf_t ringbuf[NUM_UARTS]; static void uart0_callback(void) { - while (uart_is_readable(uart0) && !ringbuf_put(&ringbuf[0], (uint8_t)uart_get_hw(uart0)->dr)) {} + while (uart_is_readable(uart0) && ringbuf_num_empty(&ringbuf[0]) > 0) { + ringbuf_put(&ringbuf[0], (uint8_t)uart_get_hw(uart0)->dr); + } } static void uart1_callback(void) { - while (uart_is_readable(uart1) && !ringbuf_put(&ringbuf[1], (uint8_t)uart_get_hw(uart1)->dr)) {} + while (uart_is_readable(uart1) && ringbuf_num_empty(&ringbuf[1]) > 0) { + ringbuf_put(&ringbuf[1], (uint8_t)uart_get_hw(uart1)->dr); + } } void common_hal_busio_uart_construct(busio_uart_obj_t *self, @@ -116,7 +107,13 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_NotImplementedError(translate("RS485 Not yet supported on this device")); } - uint8_t uart_id = get_free_uart(); + uint8_t uart_id = ((((tx != NULL) ? tx->number : rx->number) + 4) / 8) % NUM_UARTS; + + if (uart_status[uart_id] != STATUS_FREE) { + mp_raise_RuntimeError(translate("All UART peripherals are in use")); + } else { + uart_status[uart_id] = STATUS_BUSY; + } self->tx_pin = pin_init(uart_id, tx, 0); self->rx_pin = pin_init(uart_id, rx, 1); @@ -129,7 +126,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->timeout_ms = timeout * 1000; uart_init(self->uart, self->baudrate); - uart_set_fifo_enabled(self->uart, false); + uart_set_fifo_enabled(self->uart, true); uart_set_format(self->uart, bits, stop, parity); uart_set_hw_flow(self->uart, (cts != NULL), (rts != NULL)); @@ -144,7 +141,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if (!ringbuf_alloc(&ringbuf[uart_id], receiver_buffer_size, true)) { mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); } - if (uart_id) { + if (uart_id == 1) { self->uart_irq_id = UART1_IRQ; irq_set_exclusive_handler(self->uart_irq_id, uart1_callback); } else { @@ -166,6 +163,7 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { } uart_deinit(self->uart); ringbuf_free(&ringbuf[self->uart_id]); + uart_status[self->uart_id] = STATUS_FREE; reset_pin_number(self->tx_pin); reset_pin_number(self->rx_pin); reset_pin_number(self->cts_pin); @@ -183,7 +181,7 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, } while (len > 0) { - if (uart_is_writable(self->uart)) { + while (uart_is_writable(self->uart) && len > 0) { // Write and advance. uart_get_hw(self->uart)->dr = *data++; // Decrease how many chars left to write. @@ -206,31 +204,40 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t return 0; } - size_t total_read = 0; - uint64_t start_ticks = supervisor_ticks_ms64(); + // Prevent conflict with uart irq. + irq_set_enabled(self->uart_irq_id, false); - // Busy-wait for all bytes received or timeout - while (len > 0 && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms)) { - // Reset the timeout on every character read. - if (ringbuf_num_filled(&ringbuf[self->uart_id])) { - // Prevent conflict with uart irq. - irq_set_enabled(self->uart_irq_id, false); - // Copy as much received data as available, up to len bytes. - size_t num_read = ringbuf_get_n(&ringbuf[self->uart_id], data, len); - // Re-enable irq. - irq_set_enabled(self->uart_irq_id, true); - len-=num_read; - data+=num_read; - total_read+=num_read; - start_ticks = supervisor_ticks_ms64(); - } - RUN_BACKGROUND_TASKS; - // Allow user to break out of a timeout with a KeyboardInterrupt. - if (mp_hal_is_interrupted()) { - return 0; + // Copy as much received data as available, up to len bytes. + size_t total_read = ringbuf_get_n(&ringbuf[self->uart_id], data, len); + + // Check if we still need to read more data. + if (len > total_read) { + len-=total_read; + uint64_t start_ticks = supervisor_ticks_ms64(); + // Busy-wait until timeout or until we've read enough chars. + while (len > 0 && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms)) { + if (uart_is_readable(self->uart)) { + // Read and advance. + *data++ = uart_get_hw(self->uart)->dr; + + // Adjust the counters. + len--; + total_read++; + + // Reset the timeout on every character read. + start_ticks = supervisor_ticks_ms64(); + } + RUN_BACKGROUND_TASKS; + // Allow user to break out of a timeout with a KeyboardInterrupt. + if (mp_hal_is_interrupted()) { + return 0; + } } } + // Re-enable irq. + irq_set_enabled(self->uart_irq_id, true); + if (total_read == 0) { *errcode = EAGAIN; return MP_STREAM_ERROR; From 199a8ce8b07868c40d9c79157f8a635ab96161d9 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 25 Feb 2021 14:10:19 -0500 Subject: [PATCH 108/159] change DigitalInOut direction only when necessary; strong drive strength --- .../raspberrypi/common-hal/digitalio/DigitalInOut.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c b/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c index b0bc1b96e8..fe4bab27fc 100644 --- a/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c +++ b/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c @@ -43,6 +43,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct( self->output = false; self->open_drain = false; + // Set to input. No output value. gpio_init(pin->number); return DIGITALINOUT_OK; } @@ -75,10 +76,15 @@ digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output( digitalio_digitalinout_obj_t* self, bool value, digitalio_drive_mode_t drive_mode) { const uint8_t pin = self->pin->number; - gpio_set_dir(pin, GPIO_OUT); - // TODO: Turn on "strong" pin driving (more current available). + gpio_disable_pulls(pin); + + // Turn on "strong" pin driving (more current available). + hw_write_masked(&padsbank0_hw->io[pin], + PADS_BANK0_GPIO0_DRIVE_VALUE_12MA << PADS_BANK0_GPIO0_DRIVE_LSB, + PADS_BANK0_GPIO0_DRIVE_BITS); self->output = true; + // Pin direction is ultimately set in set_value. We don't need to do it here. common_hal_digitalio_digitalinout_set_drive_mode(self, drive_mode); common_hal_digitalio_digitalinout_set_value(self, value); return DIGITALINOUT_OK; @@ -110,9 +116,6 @@ digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode( const uint8_t pin = self->pin->number; bool value = common_hal_digitalio_digitalinout_get_value(self); self->open_drain = drive_mode == DRIVE_MODE_OPEN_DRAIN; - if (self->open_drain) { - gpio_put(pin, false); - } // True is implemented differently between modes so reset the value to make // sure it's correct for the new mode. if (value) { From 4097c949a33e53e378cecb1b50fb455f6f209bfb Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Thu, 25 Feb 2021 14:16:40 -0600 Subject: [PATCH 109/159] Update for clean blitting into itself --- shared-module/displayio/Bitmap.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index d1942efc79..cf34f2d358 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -116,14 +116,33 @@ void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16 mp_raise_RuntimeError(translate("Read-only object")); } + bool x_reverse = false; + bool y_reverse = false; + + // Add reverse direction option to protect blitting of self bitmap back into self bitmap + if (x > x1) { + x_reverse = true; + } + if (y > y1) { + y_reverse = true; + } + // simplest version - use internal functions for get/set pixels - for (int16_t i=0; i < (x2-x1) ; i++) { - if ( (x+i >= 0) && (x+i < self->width) ) { + for (int16_t i=0; i < (x2-x1); i++) { + + const int xs_index = x_reverse ? ( (x2 - 1) - i ) : x1+i; // x-index into the source bitmap + const int xd_index = x_reverse ? ((x + (x2-x1)) - i ) : x+i; // x-index into the destination bitmap + + if ( (xd_index >= 0) && (xd_index < self->width) ) { for (int16_t j=0; j < (y2-y1) ; j++){ - if ((y+j >= 0) && (y+j < self->height) ) { - uint32_t value = common_hal_displayio_bitmap_get_pixel(source, x1+i, y1+j); + + const int ys_index = y_reverse ? ( (y2 - 1) - j ) : y1+j ; // y-index into the source bitmap + const int yd_index = y_reverse ? ((y + (y2-y1)) - j ) : y+j ; // y-index into the destination bitmap + + if ((yd_index >= 0) && (yd_index < self->height) ) { + uint32_t value = common_hal_displayio_bitmap_get_pixel(source, xs_index, ys_index); if ( (skip_index_none) || (value != skip_index) ) { // write if skip_value_none is True - common_hal_displayio_bitmap_set_pixel(self, x+i, y+j, value); + common_hal_displayio_bitmap_set_pixel(self, xd_index, yd_index, value); } } } From a7a4f93ff8b600dc58954851c134205fa4a587d8 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Thu, 25 Feb 2021 15:44:32 -0600 Subject: [PATCH 110/159] Updated build configs to turn off BITMAPTOOLS for smaller builds --- ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk | 1 + .../boards/circuitbrains_basic_m0/mpconfigboard.mk | 1 + .../boards/circuitplayground_express/mpconfigboard.mk | 1 + .../circuitplayground_express_crickit/mpconfigboard.mk | 1 + .../circuitplayground_express_displayio/mpconfigboard.mk | 1 + ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk | 1 + .../boards/itsybitsy_m0_express/mpconfigboard.mk | 1 + ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk | 1 + ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk | 1 + ports/atmel-samd/boards/pycubed/mpconfigboard.mk | 1 + ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk | 1 + ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk | 1 + ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk | 1 + ports/atmel-samd/boards/serpente/mpconfigboard.mk | 1 + ports/atmel-samd/boards/snekboard/mpconfigboard.mk | 1 + .../atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk | 1 + .../boards/sparkfun_redboard_turbo/mpconfigboard.mk | 1 + .../atmel-samd/boards/stackrduino_m0_pro/mpconfigboard.mk | 1 + .../boards/stringcar_m0_express/mpconfigboard.mk | 1 + .../atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk | 1 + ports/atmel-samd/boards/ugame10/mpconfigboard.mk | 1 + .../boards/winterbloom_big_honking_button/mpconfigboard.mk | 1 + ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk | 1 + ports/cxd56/boards/spresense/mpconfigboard.mk | 2 +- ports/nrf/boards/pca10100/mpconfigboard.mk | 1 + ports/nrf/boards/simmel/mpconfigboard.mk | 1 + ports/stm/boards/espruino_pico/mpconfigboard.mk | 1 + py/circuitpy_mpconfig.mk | 7 ++++--- 28 files changed, 31 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk index cff5a32d1c..9c1d61ec7a 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk @@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = "MX25L51245G","GD25S512MD" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_MSGPACK = 0 diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk index 2ace30fb53..6ea6a7211a 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk @@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = "W25Q32JV_IQ" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index 0b150a5fbe..e8993d44d1 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ # Make room for frozen libs. +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index 6d240686d7..446d1177ff 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -13,6 +13,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" # Turn off features and optimizations for Crickit build to make room for additional frozen libs. LONGINT_IMPL = NONE CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index 2a97636ded..1f9b98bec0 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -13,6 +13,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" # Turn off features and optimizations for Crickit build to make room for additional frozen libs. LONGINT_IMPL = NONE CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 diff --git a/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk b/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk index 303df650eb..2d5234f821 100644 --- a/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk +++ b/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk @@ -14,6 +14,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_FULLBUILD = 0 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 1 diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk index 0c0d6053e4..b5d22bbbfb 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk @@ -15,6 +15,7 @@ CIRCUITPY_BITBANG_APA102 = 1 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_GAMEPAD = 0 diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 2492651516..ea010ed2ee 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -12,6 +12,7 @@ LONGINT_IMPL = MPZ # Not needed. CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index 03f633e6d8..bda2ff05a7 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_MSGPACK = 0 diff --git a/ports/atmel-samd/boards/pycubed/mpconfigboard.mk b/ports/atmel-samd/boards/pycubed/mpconfigboard.mk index a82362b8d2..09aef7d92e 100644 --- a/ports/atmel-samd/boards/pycubed/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pycubed/mpconfigboard.mk @@ -15,6 +15,7 @@ CIRCUITPY_DRIVE_LABEL = "PYCUBED" # Not needed. CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_GAMEPAD = 0 diff --git a/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk b/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk index 3bf42d7054..46df12c4f2 100644 --- a/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk @@ -15,6 +15,7 @@ CIRCUITPY_DRIVE_LABEL = "PYCUBED" # Not needed. CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_GAMEPAD = 0 diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk index 8773c5771d..54fba40594 100644 --- a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk @@ -14,6 +14,7 @@ EXTERNAL_FLASH_DEVICES = GD25Q16C CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 diff --git a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk index fd6e25f6cb..470e4d9dc4 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk @@ -16,6 +16,7 @@ LONGINT_IMPL = MPZ # No I2S on SAMD51G CIRCUITPY_AUDIOBUSIO = 0 # Make room for more stuff +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 diff --git a/ports/atmel-samd/boards/serpente/mpconfigboard.mk b/ports/atmel-samd/boards/serpente/mpconfigboard.mk index 1f2c83316c..e024736c95 100644 --- a/ports/atmel-samd/boards/serpente/mpconfigboard.mk +++ b/ports/atmel-samd/boards/serpente/mpconfigboard.mk @@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = GD25Q32C LONGINT_IMPL = NONE CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_BUSDEVICE = 0 diff --git a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk index 889490450f..72c98867e2 100644 --- a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk +++ b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk @@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = "W25Q16JV_IQ" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_MSGPACK = 0 diff --git a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk index 2e15bc042a..29579904a2 100755 --- a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk @@ -13,6 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_VECTORIO = 0 CIRCUITPY_BUSDEVICE = 0 diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk index 5b7f93328d..6db5596ba3 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk @@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = "W25Q32FV" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 diff --git a/ports/atmel-samd/boards/stackrduino_m0_pro/mpconfigboard.mk b/ports/atmel-samd/boards/stackrduino_m0_pro/mpconfigboard.mk index 734be2d145..fd1520af15 100644 --- a/ports/atmel-samd/boards/stackrduino_m0_pro/mpconfigboard.mk +++ b/ports/atmel-samd/boards/stackrduino_m0_pro/mpconfigboard.mk @@ -13,6 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 diff --git a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk index 68031e4a18..0f43ab8002 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk @@ -16,6 +16,7 @@ CIRCUITPY_BITBANG_APA102 = 1 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index 7eda151f36..f3afa61a8f 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -13,6 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index 640d421e81..f7214704ce 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -20,6 +20,7 @@ CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index ab2b861c03..5062200e1f 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -17,6 +17,7 @@ CIRCUITPY_AUDIOIO = 1 # Disable modules that are unusable on this special-purpose board. CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_AUDIOBUSIO = 0 diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index fcefaee9b8..e8f94a2902 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -18,6 +18,7 @@ LONGINT_IMPL = MPZ # Disable modules that are unusable on this special-purpose board. CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 diff --git a/ports/cxd56/boards/spresense/mpconfigboard.mk b/ports/cxd56/boards/spresense/mpconfigboard.mk index 80c6e4b692..966fa023f0 100644 --- a/ports/cxd56/boards/spresense/mpconfigboard.mk +++ b/ports/cxd56/boards/spresense/mpconfigboard.mk @@ -4,5 +4,5 @@ USB_PRODUCT = "Spresense" USB_MANUFACTURER = "Sony" INTERNAL_FLASH_FILESYSTEM = 1 - +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_MSGPACK = 0 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index fbb9987c24..74080a1ed9 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -9,6 +9,7 @@ INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_AUDIOMP3 = 0 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_BUSIO = 1 CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 52743d340f..283e3d1690 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -13,6 +13,7 @@ INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_AESIO = 1 CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_BUSDEVICE = 0 CIRCUITPY_BUSIO = 1 CIRCUITPY_DISPLAYIO = 0 diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index 6d45769f2b..d6118adf88 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -21,6 +21,7 @@ LD_FILE = boards/STM32F401xd_fs.ld # meantime CIRCUITPY_ULAB = 0 CIRCUITPY_BUSDEVICE = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_FRAMEBUFFERIO = 0 SUPEROPT_GC = 0 diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index d071aff050..a5b0ed8a44 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -95,9 +95,6 @@ CFLAGS += -DCIRCUITPY_BITBANG_APA102=$(CIRCUITPY_BITBANG_APA102) CIRCUITPY_BITBANGIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO) -CIRCUITPY_BITMAPTOOLS ?= $(CIRCUITPY_FULL_BUILD) -CFLAGS += -DCIRCUITPY_BITMAPTOOLS=$(CIRCUITPY_BITMAPTOOLS) - CIRCUITPY_BITOPS ?= 0 CFLAGS += -DCIRCUITPY_BITOPS=$(CIRCUITPY_BITOPS) @@ -155,11 +152,15 @@ CFLAGS += -DCIRCUITPY_ERRNO=$(CIRCUITPY_ERRNO) CIRCUITPY_ESPIDF ?= 0 CFLAGS += -DCIRCUITPY_ESPIDF=$(CIRCUITPY_ESPIDF) +# bitmaptools and framebufferio rely on displayio ifeq ($(CIRCUITPY_DISPLAYIO),1) +CIRCUITPY_BITMAPTOOLS ?= $(CIRCUITPY_FULL_BUILD) CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD) else +CIRCUITPY_BITMAPTOOLS ?= 0 CIRCUITPY_FRAMEBUFFERIO ?= 0 endif +CFLAGS += -DCIRCUITPY_BITMAPTOOLS=$(CIRCUITPY_BITMAPTOOLS) CFLAGS += -DCIRCUITPY_FRAMEBUFFERIO=$(CIRCUITPY_FRAMEBUFFERIO) CIRCUITPY_VECTORIO ?= $(CIRCUITPY_DISPLAYIO) From 22276710e67884af3fc64eae1f35173a91ce96ca Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 25 Feb 2021 15:50:49 -0600 Subject: [PATCH 111/159] rp2pio: Fix writing where the stride was 2 or 4 The wrong stride value was being checked. --- ports/raspberrypi/common-hal/rp2pio/StateMachine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index 5973f47a2e..7d2385064f 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -640,9 +640,9 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, while (tx_remaining && !pio_sm_is_tx_fifo_full(self->pio, self->state_machine)) { if (out_stride_in_bytes == 1) { *tx_destination = *data_out; - } else if (in_stride_in_bytes == 2) { + } else if (out_stride_in_bytes == 2) { *((uint16_t*) tx_destination) = *((uint16_t*) data_out); - } else if (in_stride_in_bytes == 4) { + } else if (out_stride_in_bytes == 4) { *((uint32_t*) tx_destination) = *((uint32_t*) data_out); } data_out += out_stride_in_bytes; From 80f7972f72e8d437813457b72d04bb87df496813 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 25 Feb 2021 14:46:08 -0800 Subject: [PATCH 112/159] Update RP2040 Feather pinout for production rev --- ports/raspberrypi/boards/adafruit_feather_rp2040/board.c | 4 ---- ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040/board.c b/ports/raspberrypi/boards/adafruit_feather_rp2040/board.c index 8686f6d0c2..c4021a83e9 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040/board.c +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040/board.c @@ -30,10 +30,6 @@ #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" void board_init(void) { - common_hal_never_reset_pin(&pin_GPIO17); - gpio_init(17); - gpio_set_dir(17, GPIO_OUT); - gpio_put(17, true); } bool board_requests_safe_mode(void) { diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c index 1617ac865e..d4840cdca9 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c @@ -14,12 +14,12 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, From 1b00d94b23cc3529dc1762b060f773ac0d8db98c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 23 Feb 2021 17:04:25 -0800 Subject: [PATCH 113/159] Fix second shared PWM Fixes #4210 --- ports/raspberrypi/common-hal/pwmio/PWMOut.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/raspberrypi/common-hal/pwmio/PWMOut.c b/ports/raspberrypi/common-hal/pwmio/PWMOut.c index 00b461880c..b2e55ce6b6 100644 --- a/ports/raspberrypi/common-hal/pwmio/PWMOut.c +++ b/ports/raspberrypi/common-hal/pwmio/PWMOut.c @@ -143,6 +143,7 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self, common_hal_pwmio_pwmout_set_frequency(self, frequency); pwm_set_enabled(slice, true); } else { + common_hal_pwmio_pwmout_set_frequency(self, frequency); common_hal_pwmio_pwmout_set_duty_cycle(self, duty); } From 2b163ccd6a9f934a71cd8450b385977fb009bff5 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 25 Feb 2021 14:57:46 -0800 Subject: [PATCH 114/159] Fix incorrect deinit mask --- ports/raspberrypi/common-hal/pwmio/PWMOut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/common-hal/pwmio/PWMOut.c b/ports/raspberrypi/common-hal/pwmio/PWMOut.c index b2e55ce6b6..f690528ae6 100644 --- a/ports/raspberrypi/common-hal/pwmio/PWMOut.c +++ b/ports/raspberrypi/common-hal/pwmio/PWMOut.c @@ -164,7 +164,7 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) { uint32_t channel_mask = _mask(self->slice, self->channel); channel_use &= ~channel_mask; never_reset_channel &= ~channel_mask; - uint32_t slice_mask = ((1 << CHANNELS_PER_SLICE) - 1) << (self->slice * CHANNELS_PER_SLICE + self->channel); + uint32_t slice_mask = ((1 << CHANNELS_PER_SLICE) - 1) << (self->slice * CHANNELS_PER_SLICE); if ((channel_use & slice_mask) == 0) { target_slice_frequencies[self->slice] = 0; slice_variable_frequency &= ~(1 << self->slice); From d0f1cfb039edde5e1730f28100f49e0898750ad9 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 25 Feb 2021 18:41:22 -0500 Subject: [PATCH 115/159] address review; use gpio_set() carefully --- .../common-hal/digitalio/DigitalInOut.c | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c b/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c index fe4bab27fc..cc63b73a46 100644 --- a/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c +++ b/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c @@ -84,8 +84,9 @@ digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output( PADS_BANK0_GPIO0_DRIVE_BITS); self->output = true; + self->open_drain = drive_mode == DRIVE_MODE_OPEN_DRAIN; + // Pin direction is ultimately set in set_value. We don't need to do it here. - common_hal_digitalio_digitalinout_set_drive_mode(self, drive_mode); common_hal_digitalio_digitalinout_set_value(self, value); return DIGITALINOUT_OK; } @@ -98,10 +99,21 @@ digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( void common_hal_digitalio_digitalinout_set_value( digitalio_digitalinout_obj_t* self, bool value) { const uint8_t pin = self->pin->number; - if (self->open_drain) { - gpio_set_dir(pin, value ? GPIO_IN : GPIO_OUT); + if (value) { + // If true, set the direction -before- setting the pin value, to + // to avoid a glitch true 3.3v on the pin before switching from output to input for open drain. + if (self->open_drain) { + gpio_set_dir(pin, GPIO_IN); + } + gpio_put(pin, true); } else { - gpio_put(pin, value); + // If false, set the direction -after- setting the pin value, + // to avoid a glitch 3.3v on the pin before switching from input to output for open drain, + // when previous value was high. + gpio_put(pin, false); + if (self->open_drain) { + gpio_set_dir(pin, GPIO_OUT); + } } } From ec4cd68edcc8bbbbc5edb5eefb1cfdec70c70a99 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Thu, 25 Feb 2021 17:48:50 -0600 Subject: [PATCH 116/159] More mpconfigboard.mk corrections for small builds --- ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk | 1 + .../boards/feather_m0_express_crickit/mpconfigboard.mk | 1 + ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk | 1 + ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk | 1 + ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk | 1 + 5 files changed, 5 insertions(+) diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk index d1a6fc7ae5..d780336a26 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk @@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk index 309563ff49..c3938345d5 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk @@ -13,6 +13,7 @@ LONGINT_IMPL = MPZ # Make space for frozen libs CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index 6ea21ed82e..b544a3680a 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -13,6 +13,7 @@ CIRCUITPY_FULL_BUILD = 0 # A number of modules are removed for RFM69 to make room for frozen libraries. # Many I/O functions are not available. CIRCUITPY_ANALOGIO = 1 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 1 CIRCUITPY_ROTARYIO = 0 diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index 76a6be2e34..e307ab4f6b 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -14,6 +14,7 @@ CIRCUITPY_FULL_BUILD = 0 # A number of modules are removed for RFM9x to make room for frozen libraries. # Many I/O functions are not available. CIRCUITPY_ANALOGIO = 1 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 1 CIRCUITPY_ROTARYIO = 0 diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk index 3078544fcb..7a80eea9b3 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk @@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL064L" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 From f0432b9d6f6c532291ee01b76ffa2b77f7732557 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 25 Feb 2021 16:37:34 -0800 Subject: [PATCH 117/159] Remove neopixel power --- ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c index d4840cdca9..a558d7fe6c 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c @@ -27,7 +27,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO16) }, - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, From 52bc935fa7aa9e5c94f75fec8b2fa746c83f0be7 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 25 Feb 2021 16:50:57 -0800 Subject: [PATCH 118/159] A few minor fixes for corner cases * Always clear the peripheral interrupt so we don't hang when full * Store the ringbuf in the object so it gets collected when we're alive * Make UART objects have a finaliser so they are deinit when their memory is freed * Copy bytes into the ringbuf from the FIFO after we read to ensure the interrupt is enabled ASAP * Copy bytes into the ringbuf from the FIFO before measuring our rx available because the interrupt is based on a threshold (not > 0). For example, a single byte won't trigger an interrupt. --- ports/raspberrypi/common-hal/busio/UART.c | 57 +++++++++++++++++------ ports/raspberrypi/common-hal/busio/UART.h | 1 + py/gc.c | 2 +- py/malloc.c | 6 +-- py/misc.h | 8 ++-- shared-bindings/busio/UART.c | 3 +- tests/manual/busio/uart_echo.py | 18 +++++++ 7 files changed, 72 insertions(+), 23 deletions(-) create mode 100644 tests/manual/busio/uart_echo.py diff --git a/ports/raspberrypi/common-hal/busio/UART.c b/ports/raspberrypi/common-hal/busio/UART.c index 1f0f4e2f6f..1bc1211777 100644 --- a/ports/raspberrypi/common-hal/busio/UART.c +++ b/ports/raspberrypi/common-hal/busio/UART.c @@ -73,18 +73,27 @@ static uint8_t pin_init(const uint8_t uart, const mcu_pin_obj_t * pin, const uin return pin->number; } -static ringbuf_t ringbuf[NUM_UARTS]; +static busio_uart_obj_t* active_uarts[NUM_UARTS]; -static void uart0_callback(void) { - while (uart_is_readable(uart0) && ringbuf_num_empty(&ringbuf[0]) > 0) { - ringbuf_put(&ringbuf[0], (uint8_t)uart_get_hw(uart0)->dr); +static void _copy_into_ringbuf(ringbuf_t* r, uart_inst_t* uart) { + while (uart_is_readable(uart) && ringbuf_num_empty(r) > 0) { + ringbuf_put(r, (uint8_t) uart_get_hw(uart)->dr); } } +static void shared_callback(busio_uart_obj_t *self) { + _copy_into_ringbuf(&self->ringbuf, self->uart); + // We always clear the interrupt so it doesn't continue to fire because we + // may not have read everything available. + uart_get_hw(self->uart)->icr = UART_UARTICR_RXIC_BITS; +} + +static void uart0_callback(void) { + shared_callback(active_uarts[0]); +} + static void uart1_callback(void) { - while (uart_is_readable(uart1) && ringbuf_num_empty(&ringbuf[1]) > 0) { - ringbuf_put(&ringbuf[1], (uint8_t)uart_get_hw(uart1)->dr); - } + shared_callback(active_uarts[1]); } void common_hal_busio_uart_construct(busio_uart_obj_t *self, @@ -138,9 +147,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // pointers like this are NOT moved, allocating the buffer // in the long-lived pool is not strictly necessary) // (This is a macro.) - if (!ringbuf_alloc(&ringbuf[uart_id], receiver_buffer_size, true)) { + if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); } + active_uarts[uart_id] = self; if (uart_id == 1) { self->uart_irq_id = UART1_IRQ; irq_set_exclusive_handler(self->uart_irq_id, uart1_callback); @@ -149,7 +159,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, irq_set_exclusive_handler(self->uart_irq_id, uart0_callback); } irq_set_enabled(self->uart_irq_id, true); - uart_set_irq_enables(self->uart, true, false); + uart_set_irq_enables(self->uart, true /* rx has data */, false /* tx needs data */); } } @@ -162,7 +172,8 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { return; } uart_deinit(self->uart); - ringbuf_free(&ringbuf[self->uart_id]); + ringbuf_free(&self->ringbuf); + active_uarts[self->uart_id] = NULL; uart_status[self->uart_id] = STATUS_FREE; reset_pin_number(self->tx_pin); reset_pin_number(self->rx_pin); @@ -208,7 +219,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t irq_set_enabled(self->uart_irq_id, false); // Copy as much received data as available, up to len bytes. - size_t total_read = ringbuf_get_n(&ringbuf[self->uart_id], data, len); + size_t total_read = ringbuf_get_n(&self->ringbuf, data, len); // Check if we still need to read more data. if (len > total_read) { @@ -218,7 +229,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t while (len > 0 && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms)) { if (uart_is_readable(self->uart)) { // Read and advance. - *data++ = uart_get_hw(self->uart)->dr; + data[total_read] = uart_get_hw(self->uart)->dr; // Adjust the counters. len--; @@ -230,11 +241,16 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t RUN_BACKGROUND_TASKS; // Allow user to break out of a timeout with a KeyboardInterrupt. if (mp_hal_is_interrupted()) { - return 0; + break; } } } + // Now that we've emptied the ringbuf some, fill it up with anything in the + // FIFO. This ensures that we'll empty the FIFO as much as possible and + // reset the interrupt when we catch up. + _copy_into_ringbuf(&self->ringbuf, self->uart); + // Re-enable irq. irq_set_enabled(self->uart_irq_id, true); @@ -264,13 +280,24 @@ void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeou } uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { - return ringbuf_num_filled(&ringbuf[self->uart_id]); + // Prevent conflict with uart irq. + irq_set_enabled(self->uart_irq_id, false); + // The UART only interrupts after a threshold so make sure to copy anything + // out of its FIFO before measuring how many bytes we've received. + _copy_into_ringbuf(&self->ringbuf, self->uart); + irq_set_enabled(self->uart_irq_id, false); + return ringbuf_num_filled(&self->ringbuf); } void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { // Prevent conflict with uart irq. irq_set_enabled(self->uart_irq_id, false); - ringbuf_clear(&ringbuf[self->uart_id]); + ringbuf_clear(&self->ringbuf); + + // Throw away the FIFO contents too. + while (uart_is_readable(self->uart)) { + (void) uart_get_hw(self->uart)->dr; + } irq_set_enabled(self->uart_irq_id, true); } diff --git a/ports/raspberrypi/common-hal/busio/UART.h b/ports/raspberrypi/common-hal/busio/UART.h index da6170596b..4c07de240b 100644 --- a/ports/raspberrypi/common-hal/busio/UART.h +++ b/ports/raspberrypi/common-hal/busio/UART.h @@ -43,6 +43,7 @@ typedef struct { uint32_t baudrate; uint32_t timeout_ms; uart_inst_t * uart; + ringbuf_t ringbuf; } busio_uart_obj_t; extern void reset_uart(void); diff --git a/py/gc.c b/py/gc.c index 69327060f7..2aa2668dc4 100755 --- a/py/gc.c +++ b/py/gc.c @@ -192,7 +192,7 @@ void gc_init(void *start, void *end) { } void gc_deinit(void) { - // Run any finalizers before we stop using the heap. + // Run any finalisers before we stop using the heap. gc_sweep_all(); MP_STATE_MEM(gc_pool_start) = 0; diff --git a/py/malloc.c b/py/malloc.c index 8d5141ee04..c923e89a65 100644 --- a/py/malloc.c +++ b/py/malloc.c @@ -57,7 +57,7 @@ #undef free #undef realloc #define malloc_ll(b, ll) gc_alloc((b), false, (ll)) -#define malloc_with_finaliser(b) gc_alloc((b), true, false) +#define malloc_with_finaliser(b, ll) gc_alloc((b), true, (ll)) #define free gc_free #define realloc(ptr, n) gc_realloc(ptr, n, true) #define realloc_ext(ptr, n, mv) gc_realloc(ptr, n, mv) @@ -103,8 +103,8 @@ void *m_malloc_maybe(size_t num_bytes, bool long_lived) { } #if MICROPY_ENABLE_FINALISER -void *m_malloc_with_finaliser(size_t num_bytes) { - void *ptr = malloc_with_finaliser(num_bytes); +void *m_malloc_with_finaliser(size_t num_bytes, bool long_lived) { + void *ptr = malloc_with_finaliser(num_bytes, long_lived); if (ptr == NULL && num_bytes != 0) { m_malloc_fail(num_bytes); } diff --git a/py/misc.h b/py/misc.h index 6ed256e705..0fef7e249e 100644 --- a/py/misc.h +++ b/py/misc.h @@ -72,11 +72,13 @@ typedef unsigned int uint; #define m_new_obj_var_maybe(obj_type, var_type, var_num) ((obj_type*)m_malloc_maybe(sizeof(obj_type) + sizeof(var_type) * (var_num), false)) #define m_new_ll_obj_var_maybe(obj_type, var_type, var_num) ((obj_type*)m_malloc_maybe(sizeof(obj_type) + sizeof(var_type) * (var_num), true)) #if MICROPY_ENABLE_FINALISER -#define m_new_obj_with_finaliser(type) ((type*)(m_malloc_with_finaliser(sizeof(type)))) -#define m_new_obj_var_with_finaliser(type, var_type, var_num) ((type*)m_malloc_with_finaliser(sizeof(type) + sizeof(var_type) * (var_num))) +#define m_new_obj_with_finaliser(type) ((type*)(m_malloc_with_finaliser(sizeof(type), false))) +#define m_new_obj_var_with_finaliser(type, var_type, var_num) ((type*)m_malloc_with_finaliser(sizeof(type) + sizeof(var_type) * (var_num), false)) +#define m_new_ll_obj_with_finaliser(type) ((type*)(m_malloc_with_finaliser(sizeof(type), true))) #else #define m_new_obj_with_finaliser(type) m_new_obj(type) #define m_new_obj_var_with_finaliser(type, var_type, var_num) m_new_obj_var(type, var_type, var_num) +#define m_new_ll_obj_with_finaliser(type) m_new_ll_obj(type) #endif #if MICROPY_MALLOC_USES_ALLOCATED_SIZE #define m_renew(type, ptr, old_num, new_num) ((type*)(m_realloc((ptr), sizeof(type) * (old_num), sizeof(type) * (new_num)))) @@ -93,7 +95,7 @@ typedef unsigned int uint; void *m_malloc(size_t num_bytes, bool long_lived); void *m_malloc_maybe(size_t num_bytes, bool long_lived); -void *m_malloc_with_finaliser(size_t num_bytes); +void *m_malloc_with_finaliser(size_t num_bytes, bool long_lived); void *m_malloc0(size_t num_bytes, bool long_lived); #if MICROPY_MALLOC_USES_ALLOCATED_SIZE void *m_realloc(void *ptr, size_t old_num_bytes, size_t new_num_bytes); diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 50d233f2b9..2f8fc9c322 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -82,7 +82,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co // This is needed to avoid crashes with certain UART implementations which // cannot accomodate being moved after creation. (See // https://github.com/adafruit/circuitpython/issues/1056) - busio_uart_obj_t *self = m_new_ll_obj(busio_uart_obj_t); + busio_uart_obj_t *self = m_new_ll_obj_with_finaliser(busio_uart_obj_t); self->base.type = &busio_uart_type; enum { ARG_tx, ARG_rx, ARG_baudrate, ARG_bits, ARG_parity, ARG_stop, ARG_timeout, ARG_receiver_buffer_size, ARG_rts, ARG_cts, ARG_rs485_dir,ARG_rs485_invert}; @@ -387,6 +387,7 @@ const mp_obj_type_t busio_uart_parity_type = { }; STATIC const mp_rom_map_elem_t busio_uart_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&busio_uart_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&busio_uart_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&busio_uart___exit___obj) }, diff --git a/tests/manual/busio/uart_echo.py b/tests/manual/busio/uart_echo.py new file mode 100644 index 0000000000..f55d4db9ec --- /dev/null +++ b/tests/manual/busio/uart_echo.py @@ -0,0 +1,18 @@ +import busio +import board +import time + +i = 0 + +u = busio.UART(tx=board.TX, rx=board.RX) + +while True: + u.write(str(i).encode("utf-8")) + time.sleep(0.1) + print(i, u.in_waiting) # should be the number of digits + time.sleep(0.1) + print(i, u.in_waiting) # should be the number of digits + r = u.read(64 + 10) + print(i, u.in_waiting) # should be 0 + print(len(r), r) + i += 1 From 0259e1a89add44f3a6ec22d6001413f89939a45b Mon Sep 17 00:00:00 2001 From: Jose David M Date: Thu, 25 Feb 2021 13:18:14 +0000 Subject: [PATCH 119/159] Translated using Weblate (Spanish) Currently translated at 100.0% (971 of 971 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/locale/es.po b/locale/es.po index d11003d67b..66101a5e42 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-21 22:27+0000\n" +"PO-Revision-Date: 2021-02-26 13:50+0000\n" "Last-Translator: Jose David M \n" "Language-Team: \n" "Language: es\n" @@ -473,7 +473,7 @@ msgstr "Por debajo de la tasa mínima de refrescamiento" #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must be sequential pins" -msgstr "" +msgstr "Le reloj de bit y de selector de palabra deben ser pines secuenciales" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -518,7 +518,7 @@ msgstr "Búfer + compensado muy pequeños %d %d %d" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Buffer elements must be 4 bytes long or less" -msgstr "" +msgstr "Los elementos del búfer deben de ser de una longitud de 4 bytes o menos" #: shared-module/usb_hid/Device.c #, c-format @@ -1112,6 +1112,8 @@ msgstr "IV debe tener %d bytes de longitud" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "In buffer elements must be 4 bytes long or less" msgstr "" +"Los elementos del búfer de entrada deben ser de una longitud de 4 bytes o " +"menos" #: py/persistentcode.c msgid "" @@ -1132,10 +1134,14 @@ msgstr "Tamaño del programa Init invalido" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin direcion conflicts with initial out pin direction" msgstr "" +"La dirección inicial del pin de configuración esta en conflicto con la " +"dirección de salida inicial del pin" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin state conflicts with initial out pin state" msgstr "" +"El estado inicial del pin de configuración esta en conflicto con el estado " +"inicial de salida del pin" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" @@ -1576,11 +1582,11 @@ msgstr "Sin soporte de hardware en pin" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" -msgstr "" +msgstr "No hay \"in\" en el programa" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in or out in program" -msgstr "" +msgstr "No hay \"in\" o \"out\" en el programa" #: shared-bindings/aesio/aes.c msgid "No key was specified" @@ -1726,6 +1732,8 @@ msgstr "Tiempo de espera agotado" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Out buffer elements must be 4 bytes long or less" msgstr "" +"Los elementos del búfer de salida deben ser de una longitud de 4 bytes o " +"menos" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" From fb4af7e77eaa7db48d1062b4d3c8cd9bb9743e44 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Thu, 25 Feb 2021 08:14:22 +0000 Subject: [PATCH 120/159] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (971 of 971 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 7d8142b98c..8058e0d399 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-21 22:27+0000\n" +"PO-Revision-Date: 2021-02-26 13:50+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -473,7 +473,7 @@ msgstr "Abaixo da taxa mínima de quadros" #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must be sequential pins" -msgstr "" +msgstr "O Bit clock e o word select devem ser pinos sequenciais" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -520,7 +520,7 @@ msgstr "O buffer + desvio é muito pequeno %d %d %d" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Buffer elements must be 4 bytes long or less" -msgstr "" +msgstr "Os elementos do buffer devem ter 4 bytes de comprimento ou menos" #: shared-module/usb_hid/Device.c #, c-format @@ -1115,7 +1115,7 @@ msgstr "O IV deve ter %d bytes de comprimento" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "In buffer elements must be 4 bytes long or less" -msgstr "" +msgstr "No buffer, os elementos devem ter 4 bytes ou menos" #: py/persistentcode.c msgid "" @@ -1136,10 +1136,13 @@ msgstr "O tamanho do programa Init é inválido" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin direcion conflicts with initial out pin direction" msgstr "" +"A direção do pino inicial está em conflito com a direção inicial do pino" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin state conflicts with initial out pin state" msgstr "" +"A definição do estado inicial do pino está em conflito com estado do inicial " +"do pino" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" @@ -1576,11 +1579,11 @@ msgstr "Nenhum suporte de hardware no pino" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" -msgstr "" +msgstr "Sem entrada no programa" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in or out in program" -msgstr "" +msgstr "Sem entrada ou saída no programa" #: shared-bindings/aesio/aes.c msgid "No key was specified" @@ -1726,7 +1729,7 @@ msgstr "A operação expirou" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Out buffer elements must be 4 bytes long or less" -msgstr "" +msgstr "Os elementos da saída do buffer devem ter 4 bytes ou menos" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" From ac880152a135e05a8404d948502716a9c9f5726a Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Thu, 25 Feb 2021 10:21:39 +0000 Subject: [PATCH 121/159] Translated using Weblate (Swedish) Currently translated at 100.0% (971 of 971 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index abf892b099..16f3359f59 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-21 22:27+0000\n" +"PO-Revision-Date: 2021-02-26 13:50+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -466,7 +466,7 @@ msgstr "Under minsta bildfrekvens" #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must be sequential pins" -msgstr "" +msgstr "Bitklocka och word select måste vara sekventiella pinnar" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -511,7 +511,7 @@ msgstr "Buffert + offset för liten %d %d %d" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Buffer elements must be 4 bytes long or less" -msgstr "" +msgstr "Buffertelement måste vara fyra byte långa eller mindre" #: shared-module/usb_hid/Device.c #, c-format @@ -1102,7 +1102,7 @@ msgstr "IV måste vara %d byte lång" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "In buffer elements must be 4 bytes long or less" -msgstr "" +msgstr "Inbuffertelement måste vara 4 byte långa eller mindre" #: py/persistentcode.c msgid "" @@ -1122,11 +1122,13 @@ msgstr "Storlek på init-program ogiltigt" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin direcion conflicts with initial out pin direction" -msgstr "" +msgstr "Initial pinn-riktning står i konflikt med initial utpinn-riktning" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin state conflicts with initial out pin state" msgstr "" +"Initial inställning av pinntillstånd är i konflikt med initialt " +"utpinntillstånd" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" @@ -1562,11 +1564,11 @@ msgstr "Inget hårdvarustöd på pinne" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" -msgstr "" +msgstr "Inget in i programmet" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in or out in program" -msgstr "" +msgstr "Inget in eller ut i programmet" #: shared-bindings/aesio/aes.c msgid "No key was specified" @@ -1710,7 +1712,7 @@ msgstr "Åtgärden orsakade timeout" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Out buffer elements must be 4 bytes long or less" -msgstr "" +msgstr "Utbuffertelement ska vara max fyra byte långa" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" From 7562b0cbb8018b288cbaaebd0412371a4ed2ddcf Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 26 Feb 2021 12:00:01 -0800 Subject: [PATCH 122/159] Turn off GC opt on catwan_usbstick --- ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk index 892a5371ef..b1306f54b6 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk @@ -11,3 +11,5 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_ROTARYIO = 0 + +SUPEROPT_GC = 0 From d9234ffa8276bfc7f9e516a3c801994901e0cb86 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 26 Feb 2021 15:27:35 -0500 Subject: [PATCH 123/159] need to gpio_set_dir() at some point --- .../common-hal/digitalio/DigitalInOut.c | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c b/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c index cc63b73a46..a1a23b9ab9 100644 --- a/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c +++ b/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c @@ -99,21 +99,18 @@ digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( void common_hal_digitalio_digitalinout_set_value( digitalio_digitalinout_obj_t* self, bool value) { const uint8_t pin = self->pin->number; - if (value) { - // If true, set the direction -before- setting the pin value, to - // to avoid a glitch true 3.3v on the pin before switching from output to input for open drain. - if (self->open_drain) { - gpio_set_dir(pin, GPIO_IN); - } - gpio_put(pin, true); + if (self->open_drain && value) { + // If true and open-drain, set the direction -before- setting + // the pin value, to to avoid a high glitch on the pin before + // switching from output to input for open-drain. + gpio_set_dir(pin, GPIO_IN); + gpio_put(pin, value); } else { - // If false, set the direction -after- setting the pin value, - // to avoid a glitch 3.3v on the pin before switching from input to output for open drain, - // when previous value was high. - gpio_put(pin, false); - if (self->open_drain) { - gpio_set_dir(pin, GPIO_OUT); - } + // Otherwise set the direction -after- setting the pin value, + // to avoid a glitch which might occur if the old value was + // different and the pin was previously set to input. + gpio_put(pin, value); + gpio_set_dir(pin, GPIO_OUT); } } From 8aacd3f40a5a9636bf06cf0ccc661764d5def8e8 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Fri, 26 Feb 2021 23:57:34 +0100 Subject: [PATCH 124/159] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 20 ++++++++++---------- locale/cs.po | 20 ++++++++++---------- locale/de_DE.po | 25 ++++++++++++++----------- locale/el.po | 20 ++++++++++---------- locale/es.po | 31 +++++++++++++++++++------------ locale/fil.po | 25 ++++++++++++++----------- locale/fr.po | 28 +++++++++++++++++----------- locale/hi.po | 20 ++++++++++---------- locale/it_IT.po | 25 ++++++++++++++----------- locale/ja.po | 25 ++++++++++++++----------- locale/ko.po | 25 ++++++++++++++----------- locale/nl.po | 25 ++++++++++++++----------- locale/pl.po | 25 ++++++++++++++----------- locale/pt_BR.po | 28 +++++++++++++++++----------- locale/sv.po | 28 +++++++++++++++++----------- locale/zh_Latn_pinyin.po | 28 +++++++++++++++++----------- 16 files changed, 225 insertions(+), 173 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index d1f9488710..57301939e4 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -338,6 +338,7 @@ msgid "All SPI peripherals are in use" msgstr "Semua perangkat SPI sedang digunakan" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Semua perangkat UART sedang digunakan" @@ -971,6 +972,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "Gagal untuk mendapatkan mutex, status: 0x%08lX" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Gagal untuk mengalokasikan buffer RX" @@ -1240,7 +1242,8 @@ msgstr "Argumen tidak valid" msgid "Invalid bits per value" msgstr "Bit per nilai tidak valid" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Ukuran buffer tidak valid" @@ -1315,10 +1318,10 @@ msgstr "Pin untuk channel kanan tidak valid" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "Pin-pin tidak valid" @@ -1367,7 +1370,8 @@ msgstr "Hitungan suara tidak valid" msgid "Invalid wave file" msgstr "File wave tidak valid" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "Panjang kata/bit tidak valid" @@ -1878,7 +1882,7 @@ msgstr "Kesalahan DeInit RNG" msgid "RNG Init Error" msgstr "Kesalahan Init RNG" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" @@ -2197,10 +2201,6 @@ msgstr "Kesalahan Init UART" msgid "UART Re-init error" msgstr "Kesalahan Re-init UART" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "Kesalahan penulisan UART" @@ -2538,7 +2538,7 @@ msgid "binary op %q not implemented" msgstr "" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" +msgid "bits must be in range 5 to 9" msgstr "" #: shared-bindings/audiomixer/Mixer.c diff --git a/locale/cs.po b/locale/cs.po index abcf015688..3976260f4d 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -336,6 +336,7 @@ msgid "All SPI peripherals are in use" msgstr "" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "" @@ -955,6 +956,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "" @@ -1222,7 +1224,8 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "" @@ -1297,10 +1300,10 @@ msgstr "" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "" @@ -1349,7 +1352,8 @@ msgstr "" msgid "Invalid wave file" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "" @@ -1849,7 +1853,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" @@ -2159,10 +2163,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -2491,7 +2491,7 @@ msgid "binary op %q not implemented" msgstr "" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" +msgid "bits must be in range 5 to 9" msgstr "" #: shared-bindings/audiomixer/Mixer.c diff --git a/locale/de_DE.po b/locale/de_DE.po index 0f4585b435..8a356f4544 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -342,6 +342,7 @@ msgid "All SPI peripherals are in use" msgstr "Alle SPI-Peripheriegeräte sind in Benutzung" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Alle UART-Peripheriegeräte sind in Benutzung" @@ -973,6 +974,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "Mutex konnte nicht akquiriert werden. Status: 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Konnte keinen RX Buffer allozieren" @@ -1244,7 +1246,8 @@ msgstr "Ungültiges Argument" msgid "Invalid bits per value" msgstr "Ungültige Bits pro Wert" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Ungültige Puffergröße" @@ -1319,10 +1322,10 @@ msgstr "Ungültiger Pin für rechten Kanal" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "Ungültige Pins" @@ -1371,7 +1374,8 @@ msgstr "Ungültige Anzahl von Stimmen" msgid "Invalid wave file" msgstr "Ungültige wave Datei" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "Ungültige Wort- / Bitlänge" @@ -1882,7 +1886,7 @@ msgstr "RNG DeInit-Fehler" msgid "RNG Init Error" msgstr "RNG Init Fehler" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" @@ -2206,10 +2210,6 @@ msgstr "UART Init Fehler" msgid "UART Re-init error" msgstr "UART Re-Init-Fehler" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART-Schreibfehler" @@ -2553,8 +2553,8 @@ msgid "binary op %q not implemented" msgstr "Der binäre Operator %q ist nicht implementiert" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" -msgstr "bits muss 7, 8 oder 9 sein" +msgid "bits must be in range 5 to 9" +msgstr "" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -4323,6 +4323,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "bits must be 7, 8 or 9" +#~ msgstr "bits muss 7, 8 oder 9 sein" + #~ msgid "SDA or SCL needs a pull up" #~ msgstr "SDA oder SCL brauchen pull up" diff --git a/locale/el.po b/locale/el.po index ce55d55c85..d6d9e44cd3 100644 --- a/locale/el.po +++ b/locale/el.po @@ -333,6 +333,7 @@ msgid "All SPI peripherals are in use" msgstr "" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "" @@ -952,6 +953,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "" @@ -1219,7 +1221,8 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "" @@ -1294,10 +1297,10 @@ msgstr "" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "" @@ -1346,7 +1349,8 @@ msgstr "" msgid "Invalid wave file" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "" @@ -1846,7 +1850,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" @@ -2156,10 +2160,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -2488,7 +2488,7 @@ msgid "binary op %q not implemented" msgstr "" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" +msgid "bits must be in range 5 to 9" msgstr "" #: shared-bindings/audiomixer/Mixer.c diff --git a/locale/es.po b/locale/es.po index 66101a5e42..76917fc34a 100644 --- a/locale/es.po +++ b/locale/es.po @@ -344,6 +344,7 @@ msgid "All SPI peripherals are in use" msgstr "Todos los periféricos SPI están siendo usados" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Todos los periféricos UART están siendo usados" @@ -518,7 +519,8 @@ msgstr "Búfer + compensado muy pequeños %d %d %d" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Buffer elements must be 4 bytes long or less" -msgstr "Los elementos del búfer deben de ser de una longitud de 4 bytes o menos" +msgstr "" +"Los elementos del búfer deben de ser de una longitud de 4 bytes o menos" #: shared-module/usb_hid/Device.c #, c-format @@ -977,6 +979,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "No se puede adquirir el mutex, error 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Ha fallado la asignación del buffer RX" @@ -1255,7 +1258,8 @@ msgstr "Argumento inválido" msgid "Invalid bits per value" msgstr "Inválido bits por valor" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Tamaño de buffer inválido" @@ -1330,10 +1334,10 @@ msgstr "Pin inválido para canal derecho" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "pines inválidos" @@ -1382,7 +1386,8 @@ msgstr "Cuenta de voces inválida" msgid "Invalid wave file" msgstr "Archivo wave inválido" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "Tamaño no válido de palabra/bit" @@ -1906,7 +1911,7 @@ msgstr "Error de desinicialización de RNG" msgid "RNG Init Error" msgstr "Error de inicialización de RNG" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "RS485 no esta soportado todavía en este dispositivo" @@ -2230,10 +2235,6 @@ msgstr "Error de inicialización de UART" msgid "UART Re-init error" msgstr "Error de reinicialización de UART" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "UART no esta soportado todavia" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "Error de escritura UART" @@ -2573,8 +2574,8 @@ msgid "binary op %q not implemented" msgstr "operacion binaria %q no implementada" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" -msgstr "bits deben ser 7, 8 ó 9" +msgid "bits must be in range 5 to 9" +msgstr "" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -4329,6 +4330,12 @@ msgstr "zi debe ser de tipo flotante" msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "UART not yet supported" +#~ msgstr "UART no esta soportado todavia" + +#~ msgid "bits must be 7, 8 or 9" +#~ msgstr "bits deben ser 7, 8 ó 9" + #~ msgid "Only IN/OUT of up to 8 supported" #~ msgstr "Solamente IN/OUT hasta 8 esta soportado" diff --git a/locale/fil.po b/locale/fil.po index 969634711c..26840a1515 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -335,6 +335,7 @@ msgid "All SPI peripherals are in use" msgstr "Lahat ng SPI peripherals ay ginagamit" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c #, fuzzy msgid "All UART peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" @@ -965,6 +966,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "Nabigo sa pag kuha ng mutex, status: 0x%08lX" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Nabigong ilaan ang RX buffer" @@ -1234,7 +1236,8 @@ msgstr "Maling argumento" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Mali ang buffer size" @@ -1309,10 +1312,10 @@ msgstr "Mali ang pin para sa kanang channel" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "Mali ang pins" @@ -1361,7 +1364,8 @@ msgstr "Maling bilang ng voice" msgid "Invalid wave file" msgstr "May hindi tama sa wave file" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "" @@ -1865,7 +1869,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" @@ -2176,10 +2180,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -2518,8 +2518,8 @@ msgid "binary op %q not implemented" msgstr "binary op %q hindi implemented" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" -msgstr "bits ay dapat 7, 8 o 9" +msgid "bits must be in range 5 to 9" +msgstr "" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -4282,6 +4282,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "bits must be 7, 8 or 9" +#~ msgstr "bits ay dapat 7, 8 o 9" + #~ msgid "SDA or SCL needs a pull up" #~ msgstr "Kailangan ng pull up resistors ang SDA o SCL" diff --git a/locale/fr.po b/locale/fr.po index 596494a98a..3eaf1fe747 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -344,6 +344,7 @@ msgid "All SPI peripherals are in use" msgstr "Tous les périphériques SPI sont utilisés" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Tous les périphériques UART sont utilisés" @@ -985,6 +986,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "Echec de l'obtention de mutex, err 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Echec de l'allocation du tampon RX" @@ -1262,7 +1264,8 @@ msgstr "Paramètre invalide" msgid "Invalid bits per value" msgstr "Bits par valeur invalides" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Longueur de tampon invalide" @@ -1337,10 +1340,10 @@ msgstr "Broche invalide pour le canal droit" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "Broches invalides" @@ -1389,7 +1392,8 @@ msgstr "Nombre de voix invalide" msgid "Invalid wave file" msgstr "Fichier WAVE invalide" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "Longueur de mot / bit invalide" @@ -1911,7 +1915,7 @@ msgstr "Erreur de désinitiation du RNG (RNG DeInit)" msgid "RNG Init Error" msgstr "Erreur d'initialisation du RNG (RNG Init)" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "RS485 n'est pas encore supporté sur cet appareil" @@ -2233,10 +2237,6 @@ msgstr "Erreur d'initialisation UART" msgid "UART Re-init error" msgstr "Erreur de réinitialisation UART" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "UART n'est pas encore supporté" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "Erreur d'écriture UART" @@ -2581,8 +2581,8 @@ msgid "binary op %q not implemented" msgstr "opération binaire '%q' non implémentée" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" -msgstr "bits doivent être 7, 8 ou 9" +msgid "bits must be in range 5 to 9" +msgstr "" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -4348,6 +4348,12 @@ msgstr "zi doit être de type float" msgid "zi must be of shape (n_section, 2)" msgstr "zi doit être de forme (n_section, 2)" +#~ msgid "UART not yet supported" +#~ msgstr "UART n'est pas encore supporté" + +#~ msgid "bits must be 7, 8 or 9" +#~ msgstr "bits doivent être 7, 8 ou 9" + #~ msgid "Only IN/OUT of up to 8 supported" #~ msgstr "Seulement des IN/OUT jusqu'à 8 est supporté" diff --git a/locale/hi.po b/locale/hi.po index 2124d45655..59ab8ecc5d 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -333,6 +333,7 @@ msgid "All SPI peripherals are in use" msgstr "" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "" @@ -952,6 +953,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "" @@ -1219,7 +1221,8 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "" @@ -1294,10 +1297,10 @@ msgstr "" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "" @@ -1346,7 +1349,8 @@ msgstr "" msgid "Invalid wave file" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "" @@ -1846,7 +1850,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" @@ -2156,10 +2160,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -2488,7 +2488,7 @@ msgid "binary op %q not implemented" msgstr "" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" +msgid "bits must be in range 5 to 9" msgstr "" #: shared-bindings/audiomixer/Mixer.c diff --git a/locale/it_IT.po b/locale/it_IT.po index cc11e9f994..da9e17381c 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -344,6 +344,7 @@ msgid "All SPI peripherals are in use" msgstr "Tutte le periferiche SPI sono in uso" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c #, fuzzy msgid "All UART peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" @@ -974,6 +975,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Impossibile allocare buffer RX" @@ -1243,7 +1245,8 @@ msgstr "Argomento non valido" msgid "Invalid bits per value" msgstr "bits per valore invalido" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c #, fuzzy msgid "Invalid buffer size" msgstr "lunghezza del buffer non valida" @@ -1320,10 +1323,10 @@ msgstr "Pin non valido per il canale destro" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "Pin non validi" @@ -1373,7 +1376,8 @@ msgstr "Tipo di servizio non valido" msgid "Invalid wave file" msgstr "File wave non valido" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "" @@ -1884,7 +1888,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" @@ -2197,10 +2201,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -2531,8 +2531,8 @@ msgid "binary op %q not implemented" msgstr "operazione binaria %q non implementata" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" -msgstr "i bit devono essere 7, 8 o 9" +msgid "bits must be in range 5 to 9" +msgstr "" #: shared-bindings/audiomixer/Mixer.c #, fuzzy @@ -4299,6 +4299,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "bits must be 7, 8 or 9" +#~ msgstr "i bit devono essere 7, 8 o 9" + #~ msgid "SDA or SCL needs a pull up" #~ msgstr "SDA o SCL necessitano un pull-up" diff --git a/locale/ja.po b/locale/ja.po index 999ddf4288..534b6fcea8 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -338,6 +338,7 @@ msgid "All SPI peripherals are in use" msgstr "全てのSPI周辺機器が使用中" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "全てのUART周辺機器が使用中" @@ -963,6 +964,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "ミューテックスの取得に失敗。エラー 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "RXバッファの確保に失敗" @@ -1232,7 +1234,8 @@ msgstr "不正な引数" msgid "Invalid bits per value" msgstr "不正なbits per value" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "不正なバッファサイズ" @@ -1307,10 +1310,10 @@ msgstr "右チャネルのピンが不正" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "ピンが不正" @@ -1359,7 +1362,8 @@ msgstr "不正なボイス数" msgid "Invalid wave file" msgstr "不正なwaveファイル" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "不正なワード/ビット長" @@ -1862,7 +1866,7 @@ msgstr "RNG解体エラー" msgid "RNG Init Error" msgstr "乱数生成器の初期化エラー" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" @@ -2178,10 +2182,6 @@ msgstr "UARTの初期化エラー" msgid "UART Re-init error" msgstr "UARTの再初期化エラー" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART書き込みエラー" @@ -2511,8 +2511,8 @@ msgid "binary op %q not implemented" msgstr "" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" -msgstr "bitsは7, 8, 9のいずれかでなければなりません" +msgid "bits must be in range 5 to 9" +msgstr "" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -4258,6 +4258,9 @@ msgstr "ziはfloat値でなければなりません" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "bits must be 7, 8 or 9" +#~ msgstr "bitsは7, 8, 9のいずれかでなければなりません" + #~ msgid "SDA or SCL needs a pull up" #~ msgstr "SDAとSCLにプルアップが必要" diff --git a/locale/ko.po b/locale/ko.po index ef2e40881e..e4638507b4 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -334,6 +334,7 @@ msgid "All SPI peripherals are in use" msgstr "사용중인 모든 SPI주변 기기" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "사용중인 모든 UART주변 기기" @@ -955,6 +956,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "" @@ -1222,7 +1224,8 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "" @@ -1297,10 +1300,10 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "핀이 유효하지 않습니다" @@ -1349,7 +1352,8 @@ msgstr "" msgid "Invalid wave file" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "" @@ -1849,7 +1853,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" @@ -2159,10 +2163,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -2492,8 +2492,8 @@ msgid "binary op %q not implemented" msgstr "" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" -msgstr "비트(bits)는 7, 8 또는 9 여야합니다" +msgid "bits must be in range 5 to 9" +msgstr "" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -4231,6 +4231,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "bits must be 7, 8 or 9" +#~ msgstr "비트(bits)는 7, 8 또는 9 여야합니다" + #~ msgid "" #~ "\n" #~ "Code done running. Waiting for reload.\n" diff --git a/locale/nl.po b/locale/nl.po index 63be3b62b9..fd2cee2fd4 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -336,6 +336,7 @@ msgid "All SPI peripherals are in use" msgstr "Alle SPI peripherals zijn in gebruik" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Alle UART peripherals zijn in gebruik" @@ -963,6 +964,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "Fout tijdens verkrijgen mutex, err 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "RX buffer alloceren mislukt" @@ -1233,7 +1235,8 @@ msgstr "Ongeldig argument" msgid "Invalid bits per value" msgstr "Ongeldige bits per waarde" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Ongeldige buffer grootte" @@ -1308,10 +1311,10 @@ msgstr "Ongeldige pin voor rechter kanaal" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "Ongeldige pinnen" @@ -1360,7 +1363,8 @@ msgstr "Ongeldig stem aantal" msgid "Invalid wave file" msgstr "Ongeldig wave bestand" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "Ongeldig woord/bit lengte" @@ -1878,7 +1882,7 @@ msgstr "RNG DeInit Fout" msgid "RNG Init Error" msgstr "RNG Init Fout" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" @@ -2198,10 +2202,6 @@ msgstr "UART Init Fout" msgid "UART Re-init error" msgstr "UART Re-init Fout" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART schrijf fout" @@ -2541,8 +2541,8 @@ msgid "binary op %q not implemented" msgstr "binaire op %q niet geïmplementeerd" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" -msgstr "bits moet 7, 8, of 9 zijn" +msgid "bits must be in range 5 to 9" +msgstr "" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -4291,6 +4291,9 @@ msgstr "zi moet van type float zijn" msgid "zi must be of shape (n_section, 2)" msgstr "zi moet vorm (n_section, 2) hebben" +#~ msgid "bits must be 7, 8 or 9" +#~ msgstr "bits moet 7, 8, of 9 zijn" + #~ msgid "SDA or SCL needs a pull up" #~ msgstr "SDA of SCL hebben een pullup nodig" diff --git a/locale/pl.po b/locale/pl.po index ad9a120ebe..6a94bb67b0 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -338,6 +338,7 @@ msgid "All SPI peripherals are in use" msgstr "Wszystkie peryferia SPI w użyciu" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Wszystkie peryferia UART w użyciu" @@ -963,6 +964,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "Nie udało się uzyskać blokady, błąd 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Nie udała się alokacja bufora RX" @@ -1232,7 +1234,8 @@ msgstr "Zły argument" msgid "Invalid bits per value" msgstr "Zła liczba bitów wartości" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Zła wielkość bufora" @@ -1307,10 +1310,10 @@ msgstr "Zła nóżka dla prawego kanału" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "Złe nóżki" @@ -1359,7 +1362,8 @@ msgstr "Zła liczba głosów" msgid "Invalid wave file" msgstr "Zły plik wave" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "Niepoprawna długość słowa/bitu" @@ -1860,7 +1864,7 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "" @@ -2170,10 +2174,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "Błąd zapisu UART" @@ -2508,8 +2508,8 @@ msgid "binary op %q not implemented" msgstr "brak dwu-argumentowego operatora %q" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" -msgstr "bits musi być 7, 8 lub 9" +msgid "bits must be in range 5 to 9" +msgstr "" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -4250,6 +4250,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "bits must be 7, 8 or 9" +#~ msgstr "bits musi być 7, 8 lub 9" + #~ msgid "SDA or SCL needs a pull up" #~ msgstr "SDA lub SCL wymagają podciągnięcia" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 8058e0d399..b863cbb3f4 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -346,6 +346,7 @@ msgid "All SPI peripherals are in use" msgstr "Todos os periféricos SPI estão em uso" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Todos os periféricos UART estão em uso" @@ -981,6 +982,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "Houve uma falha na aquisição do mutex, err 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Falha ao alocar buffer RX" @@ -1256,7 +1258,8 @@ msgstr "Argumento inválido" msgid "Invalid bits per value" msgstr "Os valores por bits são inválidos" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "O tamanho do buffer é inválido" @@ -1331,10 +1334,10 @@ msgstr "Pino inválido para canal direito" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "Pinos inválidos" @@ -1383,7 +1386,8 @@ msgstr "A contagem da voz é inválida" msgid "Invalid wave file" msgstr "Aqruivo de ondas inválido" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "O comprimento do bit/palavra são inválidos" @@ -1906,7 +1910,7 @@ msgstr "Erro DeInit RNG" msgid "RNG Init Error" msgstr "Houve um erro na inicialização do RNG" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "Ainda não há suporte para o RS485 neste dispositivo" @@ -2231,10 +2235,6 @@ msgstr "Houve um erro na inicialização do UART" msgid "UART Re-init error" msgstr "Houve um erro na reinicialização do UART" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "O UART ainda não é suportado" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "Houve um erro na gravação UART" @@ -2575,8 +2575,8 @@ msgid "binary op %q not implemented" msgstr "a operação binário %q não foi implementada" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" -msgstr "os bits devem ser 7, 8 ou 9" +msgid "bits must be in range 5 to 9" +msgstr "" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -4336,6 +4336,12 @@ msgstr "zi deve ser de um tipo float" msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" +#~ msgid "UART not yet supported" +#~ msgstr "O UART ainda não é suportado" + +#~ msgid "bits must be 7, 8 or 9" +#~ msgstr "os bits devem ser 7, 8 ou 9" + #~ msgid "Only IN/OUT of up to 8 supported" #~ msgstr "Somente IN/OUT de até 8 suportados" diff --git a/locale/sv.po b/locale/sv.po index 16f3359f59..331d56d809 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -341,6 +341,7 @@ msgid "All SPI peripherals are in use" msgstr "All SPI-kringutrustning används" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Alla UART-kringutrustning används" @@ -969,6 +970,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "Det gick inte att förvärva mutex, fel 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Det gick inte att tilldela RX-buffert" @@ -1240,7 +1242,8 @@ msgstr "Ogiltigt argument" msgid "Invalid bits per value" msgstr "Ogiltigt värde för bitar per värde" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Ogiltig buffertstorlek" @@ -1315,10 +1318,10 @@ msgstr "Ogiltig pinne för höger kanal" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "Ogiltiga pinnar" @@ -1367,7 +1370,8 @@ msgstr "Ogiltigt kanalantal" msgid "Invalid wave file" msgstr "Ogiltig wave-fil" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "Ogiltig word-/bitlängd" @@ -1884,7 +1888,7 @@ msgstr "RNG DeInit-fel" msgid "RNG Init Error" msgstr "RNG Init-fel" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "RS485 stöds ännu inte på den här enheten" @@ -2204,10 +2208,6 @@ msgstr "UART Init-fel" msgid "UART Re-init error" msgstr "UART reinit-fel" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "UART stöds ännu inte" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART skrivfel" @@ -2544,8 +2544,8 @@ msgid "binary op %q not implemented" msgstr "binär op %q är inte implementerad" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" -msgstr "bits måste vara 7, 8 eller 9" +msgid "bits must be in range 5 to 9" +msgstr "" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -4294,6 +4294,12 @@ msgstr "zi måste vara av typ float" msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" +#~ msgid "UART not yet supported" +#~ msgstr "UART stöds ännu inte" + +#~ msgid "bits must be 7, 8 or 9" +#~ msgstr "bits måste vara 7, 8 eller 9" + #~ msgid "Only IN/OUT of up to 8 supported" #~ msgstr "Endast IN/OUT på upp till 8 stöds" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 5487e675cf..9d72df64d2 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -343,6 +343,7 @@ msgid "All SPI peripherals are in use" msgstr "Suǒyǒu SPI wàiwéi qì zhèngzài shǐyòng" #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Suǒyǒu UART wàiwéi zhèngzài shǐyòng" @@ -968,6 +969,7 @@ msgid "Failed to acquire mutex, err 0x%04x" msgstr "Wúfǎ huòdé mutex, err 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Fēnpèi RX huǎnchōng shībài" @@ -1237,7 +1239,8 @@ msgstr "Wúxiào de cānshù" msgid "Invalid bits per value" msgstr "Měi gè zhí de wèi wúxiào" -#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Wúxiào de huǎnchōng qū dàxiǎo" @@ -1312,10 +1315,10 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c #: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c msgid "Invalid pins" msgstr "Wúxiào de yǐn jiǎo" @@ -1364,7 +1367,8 @@ msgstr "Wúxiào de yǔyīn jìshù" msgid "Invalid wave file" msgstr "Wúxiào de làng làngcháo wénjiàn" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" msgstr "Wúxiào de zì/wèi chángdù" @@ -1877,7 +1881,7 @@ msgstr "RNG qǔxiāo chūshǐhuà cuòwù" msgid "RNG Init Error" msgstr "RNG chūshǐhuà cuòwù" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c msgid "RS485 Not yet supported on this device" msgstr "RS485 cǐ shè bèi shàng bù zhī chí" @@ -2196,10 +2200,6 @@ msgstr "UART chūshǐhuà cuòwù" msgid "UART Re-init error" msgstr "UART chóngxīn chūshǐhuà cuòwù" -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "UART not yet supported" -msgstr "UART shàng wèi shòu zhī chí" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART xiě cuòwù" @@ -2537,8 +2537,8 @@ msgid "binary op %q not implemented" msgstr "èrjìnzhì bǎn qián bǎn %q wèi zhíxíng" #: shared-bindings/busio/UART.c -msgid "bits must be 7, 8 or 9" -msgstr "bǐtè bìxū shì 7,8 huò 9" +msgid "bits must be in range 5 to 9" +msgstr "" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -4285,6 +4285,12 @@ msgstr "zi bìxū wèi fú diǎn xíng" msgid "zi must be of shape (n_section, 2)" msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" +#~ msgid "UART not yet supported" +#~ msgstr "UART shàng wèi shòu zhī chí" + +#~ msgid "bits must be 7, 8 or 9" +#~ msgstr "bǐtè bìxū shì 7,8 huò 9" + #~ msgid "Only IN/OUT of up to 8 supported" #~ msgstr "jǐn zhī chí zuì duō 8 gè IN/OUT" From 776301c932ab58d029b1757bb0b2de6a101d0618 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 26 Feb 2021 15:03:56 -0800 Subject: [PATCH 125/159] Typo fix: direcion -> direction --- ports/raspberrypi/common-hal/rp2pio/StateMachine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index 7d2385064f..5625a1b29c 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -426,7 +426,7 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, mp_raise_ValueError(translate("Initial set pin state conflicts with initial out pin state")); } if ((initial_pin_direction & set_out_overlap) != (initial_set_pin_direction & set_out_overlap)) { - mp_raise_ValueError(translate("Initial set pin direcion conflicts with initial out pin direction")); + mp_raise_ValueError(translate("Initial set pin direction conflicts with initial out pin direction")); } initial_pin_state |= initial_set_pin_state; initial_pin_direction |= initial_set_pin_direction; From 24fdda038e8beac6103254ca0b8758a86118e542 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 26 Feb 2021 15:18:50 -0800 Subject: [PATCH 126/159] translation update --- locale/circuitpython.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index bc5c4084d7..b50e63b759 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1104,7 +1104,7 @@ msgid "Init program size invalid" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c From 3afc269b18dd8239b170ecbbe47e506306b3db8a Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 26 Feb 2021 17:22:11 -0600 Subject: [PATCH 127/159] fix two off by one errors --- shared-module/displayio/Bitmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index cf34f2d358..c9ea834285 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -130,14 +130,14 @@ void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16 // simplest version - use internal functions for get/set pixels for (int16_t i=0; i < (x2-x1); i++) { - const int xs_index = x_reverse ? ( (x2 - 1) - i ) : x1+i; // x-index into the source bitmap - const int xd_index = x_reverse ? ((x + (x2-x1)) - i ) : x+i; // x-index into the destination bitmap + const int xs_index = x_reverse ? ( (x2) - i - 1) : x1+i; // x-index into the source bitmap + const int xd_index = x_reverse ? ((x + (x2-x1)) - i - 1) : x+i; // x-index into the destination bitmap if ( (xd_index >= 0) && (xd_index < self->width) ) { for (int16_t j=0; j < (y2-y1) ; j++){ - const int ys_index = y_reverse ? ( (y2 - 1) - j ) : y1+j ; // y-index into the source bitmap - const int yd_index = y_reverse ? ((y + (y2-y1)) - j ) : y+j ; // y-index into the destination bitmap + const int ys_index = y_reverse ? ( (y2 ) - j - 1) : y1+j ; // y-index into the source bitmap + const int yd_index = y_reverse ? ((y + (y2-y1)) - j - 1) : y+j ; // y-index into the destination bitmap if ((yd_index >= 0) && (yd_index < self->height) ) { uint32_t value = common_hal_displayio_bitmap_get_pixel(source, xs_index, ys_index); From 8c8d60fb8071b0486cb16deb096122ce7b3a747f Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sat, 27 Feb 2021 15:05:00 +0100 Subject: [PATCH 128/159] Fix for CIRCUITPY_USB_MSC=0 Avoid undefined functions when MSC is disabled. --- supervisor/shared/usb/tusb_config.h | 2 +- supervisor/shared/usb/usb.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/supervisor/shared/usb/tusb_config.h b/supervisor/shared/usb/tusb_config.h index bff7bd6b55..6768101190 100644 --- a/supervisor/shared/usb/tusb_config.h +++ b/supervisor/shared/usb/tusb_config.h @@ -70,7 +70,7 @@ #define CFG_TUD_CDC 1 #endif -#define CFG_TUD_MSC 1 +#define CFG_TUD_MSC CIRCUITPY_USB_MSC #define CFG_TUD_HID CIRCUITPY_USB_HID #define CFG_TUD_MIDI CIRCUITPY_USB_MIDI #define CFG_TUD_VENDOR CIRCUITPY_USB_VENDOR diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index aa35b95e60..614bf85e05 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -131,12 +131,16 @@ void usb_irq_handler(void) { // Invoked when device is mounted void tud_mount_cb(void) { +#if CIRCUITPY_USB_MSC usb_msc_mount(); +#endif } // Invoked when device is unmounted void tud_umount_cb(void) { +#if CIRCUITPY_USB_MSC usb_msc_umount(); +#endif } // Invoked when usb bus is suspended From 6520d169e4df696601c67d7ac80e3a38c6c48002 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Fri, 26 Feb 2021 23:58:32 +0000 Subject: [PATCH 129/159] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (970 of 970 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b863cbb3f4..954f63ce05 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-26 13:50+0000\n" +"PO-Revision-Date: 2021-02-27 15:19+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -2576,7 +2576,7 @@ msgstr "a operação binário %q não foi implementada" #: shared-bindings/busio/UART.c msgid "bits must be in range 5 to 9" -msgstr "" +msgstr "os bits devem estar na faixa entre 5 a 9" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" From 6c3fcead629e5fda9db987d8ea9da719c56720ba Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sat, 27 Feb 2021 14:56:03 +0000 Subject: [PATCH 130/159] Translated using Weblate (Swedish) Currently translated at 100.0% (970 of 970 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 331d56d809..d4e8a2f738 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-26 13:50+0000\n" +"PO-Revision-Date: 2021-02-27 15:19+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -2545,7 +2545,7 @@ msgstr "binär op %q är inte implementerad" #: shared-bindings/busio/UART.c msgid "bits must be in range 5 to 9" -msgstr "" +msgstr "bits måste mellan 5 och 9" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" From 6e0ce23f3e2ce341bcaefdd0a0d5c98ff43949f0 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sat, 20 Feb 2021 23:04:06 +0100 Subject: [PATCH 131/159] displaio: don't store group children native object Since we want to expose the list of group's children to the user, we should only have the original objects in it, without any other additional data, and compute the native object as needed. --- shared-module/displayio/Group.c | 173 +++++++++++++++++++++----------- shared-module/displayio/Group.h | 1 - supervisor/shared/display.c | 6 +- 3 files changed, 117 insertions(+), 63 deletions(-) diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index 15cf5b8e48..ba3bd48691 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -52,11 +52,18 @@ void common_hal_displayio_group_set_hidden(displayio_group_t* self, bool hidden) return; } for (size_t i = 0; i < self->size; i++) { - mp_obj_t layer = self->children[i].native; - if (MP_OBJ_IS_TYPE(layer, &displayio_tilegrid_type)) { + mp_obj_t layer; + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_tilegrid_type); + if (layer != MP_OBJ_NULL) { displayio_tilegrid_set_hidden_by_parent(layer, hidden); - } else if (MP_OBJ_IS_TYPE(layer, &displayio_group_type)) { + continue; + } + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_group_type); + if (layer != MP_OBJ_NULL) { displayio_group_set_hidden_by_parent(layer, hidden); + continue; } } } @@ -71,11 +78,18 @@ void displayio_group_set_hidden_by_parent(displayio_group_t *self, bool hidden) return; } for (size_t i = 0; i < self->size; i++) { - mp_obj_t layer = self->children[i].native; - if (MP_OBJ_IS_TYPE(layer, &displayio_tilegrid_type)) { + mp_obj_t layer; + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_tilegrid_type); + if (layer != MP_OBJ_NULL) { displayio_tilegrid_set_hidden_by_parent(layer, hidden); - } else if (MP_OBJ_IS_TYPE(layer, &displayio_group_type)) { + continue; + } + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_group_type); + if (layer != MP_OBJ_NULL) { displayio_group_set_hidden_by_parent(layer, hidden); + continue; } } } @@ -87,15 +101,21 @@ uint32_t common_hal_displayio_group_get_scale(displayio_group_t* self) { bool displayio_group_get_previous_area(displayio_group_t *self, displayio_area_t* area) { bool first = true; for (size_t i = 0; i < self->size; i++) { - mp_obj_t layer = self->children[i].native; + mp_obj_t layer; displayio_area_t layer_area; - if (MP_OBJ_IS_TYPE(layer, &displayio_tilegrid_type)) { + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_tilegrid_type); + if (layer != MP_OBJ_NULL) { if (!displayio_tilegrid_get_previous_area(layer, &layer_area)) { continue; } - } else if (MP_OBJ_IS_TYPE(layer, &displayio_group_type)) { - if (!displayio_group_get_previous_area(layer, &layer_area)) { - continue; + } else { + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_group_type); + if (layer != MP_OBJ_NULL) { + if (!displayio_group_get_previous_area(layer, &layer_area)) { + continue; + } } } if (first) { @@ -121,17 +141,26 @@ static void _update_child_transforms(displayio_group_t* self) { return; } for (size_t i = 0; i < self->size; i++) { - mp_obj_t layer = self->children[i].native; + mp_obj_t layer; #if CIRCUITPY_VECTORIO - if (MP_OBJ_IS_TYPE(layer, &vectorio_vector_shape_type)) { + layer = mp_instance_cast_to_native_base( + self->children[i].original, &vectorio_vector_shape_type); + if (layer != MP_OBJ_NULL) { vectorio_vector_shape_update_transform(layer, &self->absolute_transform); + continue; } - else #endif - if (MP_OBJ_IS_TYPE(layer, &displayio_tilegrid_type)) { + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_tilegrid_type); + if (layer != MP_OBJ_NULL) { displayio_tilegrid_update_transform(layer, &self->absolute_transform); - } else if (MP_OBJ_IS_TYPE(layer, &displayio_group_type)) { + continue; + } + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_group_type); + if (layer != MP_OBJ_NULL) { displayio_group_update_transform(layer, &self->absolute_transform); + continue; } } } @@ -210,21 +239,17 @@ void common_hal_displayio_group_set_y(displayio_group_t* self, mp_int_t y) { _update_child_transforms(self); } -static mp_obj_t _add_layer(displayio_group_t* self, mp_obj_t layer) { +static void _add_layer(displayio_group_t* self, mp_obj_t layer) { mp_obj_t native_layer; #if CIRCUITPY_VECTORIO native_layer = mp_instance_cast_to_native_base(layer, &vectorio_vector_shape_type); if (native_layer != MP_OBJ_NULL) { vectorio_vector_shape_update_transform(native_layer, &self->absolute_transform); - return native_layer; + return; } #endif - native_layer = mp_instance_cast_to_native_base(layer, &displayio_group_type); - if (native_layer == MP_OBJ_NULL) { - native_layer = mp_instance_cast_to_native_base(layer, &displayio_tilegrid_type); - if (native_layer == MP_OBJ_NULL) { - mp_raise_ValueError(translate("Layer must be a Group or TileGrid subclass.")); - } + native_layer = mp_instance_cast_to_native_base(layer, &displayio_tilegrid_type); + if (native_layer != MP_OBJ_NULL) { displayio_tilegrid_t* tilegrid = native_layer; if (tilegrid->in_group) { mp_raise_ValueError(translate("Layer already in a group.")); @@ -232,7 +257,10 @@ static mp_obj_t _add_layer(displayio_group_t* self, mp_obj_t layer) { tilegrid->in_group = true; } displayio_tilegrid_update_transform(tilegrid, &self->absolute_transform); - } else { + return; + } + native_layer = mp_instance_cast_to_native_base(layer, &displayio_group_type); + if (native_layer != MP_OBJ_NULL) { displayio_group_t* group = native_layer; if (group->in_group) { mp_raise_ValueError(translate("Layer already in a group.")); @@ -240,27 +268,34 @@ static mp_obj_t _add_layer(displayio_group_t* self, mp_obj_t layer) { group->in_group = true; } displayio_group_update_transform(group, &self->absolute_transform); + return; } - return native_layer; + mp_raise_ValueError(translate("Layer must be a Group or TileGrid subclass.")); } static void _remove_layer(displayio_group_t* self, size_t index) { - mp_obj_t layer = self->children[index].native; + mp_obj_t layer; displayio_area_t layer_area; bool rendered_last_frame = false; #if CIRCUITPY_VECTORIO - if (MP_OBJ_IS_TYPE(layer, &vectorio_vector_shape_type)) { + layer = mp_instance_cast_to_native_base( + self->children[index].original, &vectorio_vector_shape_type); + if (layer != MP_OBJ_NULL) { bool has_dirty_area = vectorio_vector_shape_get_dirty_area(layer, &layer_area); rendered_last_frame = has_dirty_area; vectorio_vector_shape_update_transform(layer, NULL); } - else #endif - if (MP_OBJ_IS_TYPE(layer, &displayio_tilegrid_type)) { + layer = mp_instance_cast_to_native_base( + self->children[index].original, &displayio_tilegrid_type); + if (layer != MP_OBJ_NULL) { displayio_tilegrid_t* tilegrid = layer; rendered_last_frame = displayio_tilegrid_get_previous_area(tilegrid, &layer_area); displayio_tilegrid_update_transform(tilegrid, NULL); - } else if (MP_OBJ_IS_TYPE(layer, &displayio_group_type)) { + } + layer = mp_instance_cast_to_native_base( + self->children[index].original, &displayio_group_type); + if (layer != MP_OBJ_NULL) { displayio_group_t* group = layer; rendered_last_frame = displayio_group_get_previous_area(group, &layer_area); displayio_group_update_transform(group, NULL); @@ -280,12 +315,11 @@ void common_hal_displayio_group_insert(displayio_group_t* self, size_t index, mp if (self->size == self->max_size) { mp_raise_RuntimeError(translate("Group full")); } - mp_obj_t native_layer = _add_layer(self, layer); + _add_layer(self, layer); // Shift everything right. for (size_t i = self->size; i > index; i--) { self->children[i] = self->children[i - 1]; } - self->children[index].native = native_layer; self->children[index].original = layer; self->size++; } @@ -299,7 +333,6 @@ mp_obj_t common_hal_displayio_group_pop(displayio_group_t* self, size_t index) { for (size_t i = index; i < self->size; i++) { self->children[i] = self->children[i + 1]; } - self->children[self->size].native = NULL; self->children[self->size].original = NULL; return item; } @@ -322,9 +355,8 @@ mp_obj_t common_hal_displayio_group_get(displayio_group_t* self, size_t index) { } void common_hal_displayio_group_set(displayio_group_t* self, size_t index, mp_obj_t layer) { - mp_obj_t native_layer = _add_layer(self, layer); + _add_layer(self, layer); _remove_layer(self, index); - self->children[index].native = native_layer; self->children[index].original = layer; } @@ -341,47 +373,61 @@ void displayio_group_construct(displayio_group_t* self, displayio_group_child_t* bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorspace_t* colorspace, const displayio_area_t* area, uint32_t* mask, uint32_t* buffer) { // Track if any of the layers finishes filling in the given area. We can ignore any remaining // layers at that point. - bool full_coverage = false; for (int32_t i = self->size - 1; i >= 0 ; i--) { - mp_obj_t layer = self->children[i].native; + mp_obj_t layer; #if CIRCUITPY_VECTORIO - if (MP_OBJ_IS_TYPE(layer, &vectorio_vector_shape_type)) { + layer = mp_instance_cast_to_native_base( + self->children[i].original, &vectorio_vector_shape_type); + if (layer != MP_OBJ_NULL) { if (vectorio_vector_shape_fill_area(layer, colorspace, area, mask, buffer)) { - full_coverage = true; - break; + return true; } + continue; } - else #endif - if (MP_OBJ_IS_TYPE(layer, &displayio_tilegrid_type)) { + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_tilegrid_type); + if (layer != MP_OBJ_NULL) { if (displayio_tilegrid_fill_area(layer, colorspace, area, mask, buffer)) { - full_coverage = true; - break; + return true; } - } else if (MP_OBJ_IS_TYPE(layer, &displayio_group_type)) { + continue; + } + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_group_type); + if (layer != MP_OBJ_NULL) { if (displayio_group_fill_area(layer, colorspace, area, mask, buffer)) { - full_coverage = true; - break; + return true; } + continue; } } - return full_coverage; + return false; } void displayio_group_finish_refresh(displayio_group_t *self) { self->item_removed = false; for (int32_t i = self->size - 1; i >= 0 ; i--) { - mp_obj_t layer = self->children[i].native; + mp_obj_t layer; #if CIRCUITPY_VECTORIO - if (MP_OBJ_IS_TYPE(layer, &vectorio_vector_shape_type)) { + layer = mp_instance_cast_to_native_base( + self->children[i].original, &vectorio_vector_shape_type); + if (layer != MP_OBJ_NULL) { vectorio_vector_shape_finish_refresh(layer); + continue; } - else #endif - if (MP_OBJ_IS_TYPE(layer, &displayio_tilegrid_type)) { + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_tilegrid_type); + if (layer != MP_OBJ_NULL) { displayio_tilegrid_finish_refresh(layer); - } else if (MP_OBJ_IS_TYPE(layer, &displayio_group_type)) { + continue; + } + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_group_type); + if (layer != MP_OBJ_NULL) { displayio_group_finish_refresh(layer); + continue; } } } @@ -393,17 +439,26 @@ displayio_area_t* displayio_group_get_refresh_areas(displayio_group_t *self, dis } for (int32_t i = self->size - 1; i >= 0 ; i--) { - mp_obj_t layer = self->children[i].native; + mp_obj_t layer; #if CIRCUITPY_VECTORIO - if (MP_OBJ_IS_TYPE(layer, &vectorio_vector_shape_type)) { + layer = mp_instance_cast_to_native_base( + self->children[i].original, &vectorio_vector_shape_type); + if (layer != MP_OBJ_NULL) { tail = vectorio_vector_shape_get_refresh_areas(layer, tail); + continue; } - else #endif - if (MP_OBJ_IS_TYPE(layer, &displayio_tilegrid_type)) { + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_tilegrid_type); + if (layer != MP_OBJ_NULL) { tail = displayio_tilegrid_get_refresh_areas(layer, tail); - } else if (MP_OBJ_IS_TYPE(layer, &displayio_group_type)) { + continue; + } + layer = mp_instance_cast_to_native_base( + self->children[i].original, &displayio_group_type); + if (layer != MP_OBJ_NULL) { tail = displayio_group_get_refresh_areas(layer, tail); + continue; } } diff --git a/shared-module/displayio/Group.h b/shared-module/displayio/Group.h index 5afaac1bae..9c2934aecb 100644 --- a/shared-module/displayio/Group.h +++ b/shared-module/displayio/Group.h @@ -35,7 +35,6 @@ #include "shared-module/displayio/Palette.h" typedef struct { - mp_obj_t native; mp_obj_t original; } displayio_group_child_t; diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index 9c9c66cd7f..a5830f7647 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -272,13 +272,13 @@ displayio_tilegrid_t blinka_sprite = { #if CIRCUITPY_TERMINALIO #define CHILD_COUNT 2 displayio_group_child_t splash_children[2] = { - {&blinka_sprite, &blinka_sprite}, - {&supervisor_terminal_text_grid, &supervisor_terminal_text_grid} + {&blinka_sprite}, + {&supervisor_terminal_text_grid}, }; #else #define CHILD_COUNT 1 displayio_group_child_t splash_children[1] = { - {&blinka_sprite, &blinka_sprite}, + {&blinka_sprite}, }; #endif From 121c6bcc9b20d7419f2654680215fd8b4bd455c4 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sun, 21 Feb 2021 13:43:28 +0100 Subject: [PATCH 132/159] Replace displaio.Group.children with a python list This is a first go at it, done by naive replacing of all array operations with corresponding operations on the list. Note that there is a lot of unnecessary type conversions, here. Also, list_pop has been copied, because it's decalerd STATIC in py/objlist.h --- shared-module/displayio/Group.c | 125 +++++++++++++++++--------------- shared-module/displayio/Group.h | 7 +- supervisor/shared/display.c | 23 +++--- 3 files changed, 82 insertions(+), 73 deletions(-) diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index ba3bd48691..48f8694890 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -33,10 +33,31 @@ #include "shared-bindings/vectorio/VectorShape.h" #endif +#include +#define LIST_MIN_ALLOC 4 + +STATIC mp_obj_t list_pop(size_t n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &mp_type_list)); + mp_obj_list_t *self = mp_instance_cast_to_native_base(args[0], &mp_type_list); + if (self->len == 0) { + mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_list); + } + size_t index = mp_get_index(self->base.type, self->len, n_args == 1 ? MP_OBJ_NEW_SMALL_INT(-1) : args[1], false); + mp_obj_t ret = self->items[index]; + self->len -= 1; + memmove(self->items + index, self->items + index + 1, (self->len - index) * sizeof(mp_obj_t)); + // Clear stale pointer from slot which just got freed to prevent GC issues + self->items[self->len] = MP_OBJ_NULL; + if (self->alloc > LIST_MIN_ALLOC && self->alloc > 2 * self->len) { + self->items = m_renew(mp_obj_t, self->items, self->alloc, self->alloc/2); + self->alloc /= 2; + } + return ret; +} void common_hal_displayio_group_construct(displayio_group_t* self, uint32_t max_size, uint32_t scale, mp_int_t x, mp_int_t y) { - displayio_group_child_t* children = m_new(displayio_group_child_t, max_size); - displayio_group_construct(self, children, max_size, scale, x, y); + mp_obj_list_t *members = mp_obj_new_list(0, NULL); + displayio_group_construct(self, members, scale, x, y); } bool common_hal_displayio_group_get_hidden(displayio_group_t* self) { @@ -51,16 +72,16 @@ void common_hal_displayio_group_set_hidden(displayio_group_t* self, bool hidden) if (self->hidden_by_parent) { return; } - for (size_t i = 0; i < self->size; i++) { + for (size_t i = 0; i < self->members->len; i++) { mp_obj_t layer; layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_tilegrid_type); + self->members->items[i], &displayio_tilegrid_type); if (layer != MP_OBJ_NULL) { displayio_tilegrid_set_hidden_by_parent(layer, hidden); continue; } layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_group_type); + self->members->items[i], &displayio_group_type); if (layer != MP_OBJ_NULL) { displayio_group_set_hidden_by_parent(layer, hidden); continue; @@ -77,16 +98,16 @@ void displayio_group_set_hidden_by_parent(displayio_group_t *self, bool hidden) if (self->hidden) { return; } - for (size_t i = 0; i < self->size; i++) { + for (size_t i = 0; i < self->members->len; i++) { mp_obj_t layer; layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_tilegrid_type); + self->members->items[i], &displayio_tilegrid_type); if (layer != MP_OBJ_NULL) { displayio_tilegrid_set_hidden_by_parent(layer, hidden); continue; } layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_group_type); + self->members->items[i], &displayio_group_type); if (layer != MP_OBJ_NULL) { displayio_group_set_hidden_by_parent(layer, hidden); continue; @@ -100,18 +121,18 @@ uint32_t common_hal_displayio_group_get_scale(displayio_group_t* self) { bool displayio_group_get_previous_area(displayio_group_t *self, displayio_area_t* area) { bool first = true; - for (size_t i = 0; i < self->size; i++) { + for (size_t i = 0; i < self->members->len; i++) { mp_obj_t layer; displayio_area_t layer_area; layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_tilegrid_type); + self->members->items[i], &displayio_tilegrid_type); if (layer != MP_OBJ_NULL) { if (!displayio_tilegrid_get_previous_area(layer, &layer_area)) { continue; } } else { layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_group_type); + self->members->items[i], &displayio_group_type); if (layer != MP_OBJ_NULL) { if (!displayio_group_get_previous_area(layer, &layer_area)) { continue; @@ -140,24 +161,24 @@ static void _update_child_transforms(displayio_group_t* self) { if (!self->in_group) { return; } - for (size_t i = 0; i < self->size; i++) { + for (size_t i = 0; i < self->members->len; i++) { mp_obj_t layer; #if CIRCUITPY_VECTORIO layer = mp_instance_cast_to_native_base( - self->children[i].original, &vectorio_vector_shape_type); + self->members->items[i], &vectorio_vector_shape_type); if (layer != MP_OBJ_NULL) { vectorio_vector_shape_update_transform(layer, &self->absolute_transform); continue; } #endif layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_tilegrid_type); + self->members->items[i], &displayio_tilegrid_type); if (layer != MP_OBJ_NULL) { displayio_tilegrid_update_transform(layer, &self->absolute_transform); continue; } layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_group_type); + self->members->items[i], &displayio_group_type); if (layer != MP_OBJ_NULL) { displayio_group_update_transform(layer, &self->absolute_transform); continue; @@ -279,7 +300,7 @@ static void _remove_layer(displayio_group_t* self, size_t index) { bool rendered_last_frame = false; #if CIRCUITPY_VECTORIO layer = mp_instance_cast_to_native_base( - self->children[index].original, &vectorio_vector_shape_type); + self->members->items[index], &vectorio_vector_shape_type); if (layer != MP_OBJ_NULL) { bool has_dirty_area = vectorio_vector_shape_get_dirty_area(layer, &layer_area); rendered_last_frame = has_dirty_area; @@ -287,14 +308,14 @@ static void _remove_layer(displayio_group_t* self, size_t index) { } #endif layer = mp_instance_cast_to_native_base( - self->children[index].original, &displayio_tilegrid_type); + self->members->items[index], &displayio_tilegrid_type); if (layer != MP_OBJ_NULL) { displayio_tilegrid_t* tilegrid = layer; rendered_last_frame = displayio_tilegrid_get_previous_area(tilegrid, &layer_area); displayio_tilegrid_update_transform(tilegrid, NULL); } layer = mp_instance_cast_to_native_base( - self->children[index].original, &displayio_group_type); + self->members->items[index], &displayio_group_type); if (layer != MP_OBJ_NULL) { displayio_group_t* group = layer; rendered_last_frame = displayio_group_get_previous_area(group, &layer_area); @@ -312,59 +333,45 @@ static void _remove_layer(displayio_group_t* self, size_t index) { } void common_hal_displayio_group_insert(displayio_group_t* self, size_t index, mp_obj_t layer) { - if (self->size == self->max_size) { - mp_raise_RuntimeError(translate("Group full")); - } _add_layer(self, layer); - // Shift everything right. - for (size_t i = self->size; i > index; i--) { - self->children[i] = self->children[i - 1]; + mp_obj_list_append(self->members, mp_const_none); + for (size_t i = self->members->len - 1; i > index; i--) { + self->members->items[i] = self->members->items[i - 1]; } - self->children[index].original = layer; - self->size++; + self->members->items[index] = layer; } mp_obj_t common_hal_displayio_group_pop(displayio_group_t* self, size_t index) { - self->size--; - mp_obj_t item = self->children[index].original; _remove_layer(self, index); - - // Shift everything left. - for (size_t i = index; i < self->size; i++) { - self->children[i] = self->children[i + 1]; - } - self->children[self->size].original = NULL; - return item; + mp_obj_t args[] = {self->members, MP_OBJ_NEW_SMALL_INT(index)}; + return list_pop(2, args); } mp_int_t common_hal_displayio_group_index(displayio_group_t* self, mp_obj_t layer) { - for (size_t i = 0; i < self->size; i++) { - if (self->children[i].original == layer) { - return i; - } - } - return -1; + mp_obj_t args[] = {self->members, layer}; + mp_obj_t *index = mp_seq_index_obj( + self->members->items, self->members->len, 2, args); + return MP_OBJ_SMALL_INT_VALUE(index); } size_t common_hal_displayio_group_get_len(displayio_group_t* self) { - return self->size; + return self->members->len; } mp_obj_t common_hal_displayio_group_get(displayio_group_t* self, size_t index) { - return self->children[index].original; + return self->members->items[index]; } void common_hal_displayio_group_set(displayio_group_t* self, size_t index, mp_obj_t layer) { _add_layer(self, layer); _remove_layer(self, index); - self->children[index].original = layer; + mp_obj_list_store(self, MP_OBJ_NEW_SMALL_INT(index), layer); } -void displayio_group_construct(displayio_group_t* self, displayio_group_child_t* child_array, uint32_t max_size, uint32_t scale, mp_int_t x, mp_int_t y) { +void displayio_group_construct(displayio_group_t* self, mp_obj_list_t* members, uint32_t scale, mp_int_t x, mp_int_t y) { self->x = x; self->y = y; - self->children = child_array; - self->max_size = max_size; + self->members = members; self->item_removed = false; self->scale = scale; self->in_group = false; @@ -373,11 +380,11 @@ void displayio_group_construct(displayio_group_t* self, displayio_group_child_t* bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorspace_t* colorspace, const displayio_area_t* area, uint32_t* mask, uint32_t* buffer) { // Track if any of the layers finishes filling in the given area. We can ignore any remaining // layers at that point. - for (int32_t i = self->size - 1; i >= 0 ; i--) { + for (int32_t i = self->members->len - 1; i >= 0 ; i--) { mp_obj_t layer; #if CIRCUITPY_VECTORIO layer = mp_instance_cast_to_native_base( - self->children[i].original, &vectorio_vector_shape_type); + self->members->items[i], &vectorio_vector_shape_type); if (layer != MP_OBJ_NULL) { if (vectorio_vector_shape_fill_area(layer, colorspace, area, mask, buffer)) { return true; @@ -386,7 +393,7 @@ bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorsp } #endif layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_tilegrid_type); + self->members->items[i], &displayio_tilegrid_type); if (layer != MP_OBJ_NULL) { if (displayio_tilegrid_fill_area(layer, colorspace, area, mask, buffer)) { return true; @@ -394,7 +401,7 @@ bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorsp continue; } layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_group_type); + self->members->items[i], &displayio_group_type); if (layer != MP_OBJ_NULL) { if (displayio_group_fill_area(layer, colorspace, area, mask, buffer)) { return true; @@ -407,24 +414,24 @@ bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorsp void displayio_group_finish_refresh(displayio_group_t *self) { self->item_removed = false; - for (int32_t i = self->size - 1; i >= 0 ; i--) { + for (int32_t i = self->members->len - 1; i >= 0 ; i--) { mp_obj_t layer; #if CIRCUITPY_VECTORIO layer = mp_instance_cast_to_native_base( - self->children[i].original, &vectorio_vector_shape_type); + self->members->items[i], &vectorio_vector_shape_type); if (layer != MP_OBJ_NULL) { vectorio_vector_shape_finish_refresh(layer); continue; } #endif layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_tilegrid_type); + self->members->items[i], &displayio_tilegrid_type); if (layer != MP_OBJ_NULL) { displayio_tilegrid_finish_refresh(layer); continue; } layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_group_type); + self->members->items[i], &displayio_group_type); if (layer != MP_OBJ_NULL) { displayio_group_finish_refresh(layer); continue; @@ -438,24 +445,24 @@ displayio_area_t* displayio_group_get_refresh_areas(displayio_group_t *self, dis tail = &self->dirty_area; } - for (int32_t i = self->size - 1; i >= 0 ; i--) { + for (int32_t i = self->members->len - 1; i >= 0 ; i--) { mp_obj_t layer; #if CIRCUITPY_VECTORIO layer = mp_instance_cast_to_native_base( - self->children[i].original, &vectorio_vector_shape_type); + self->members->items[i], &vectorio_vector_shape_type); if (layer != MP_OBJ_NULL) { tail = vectorio_vector_shape_get_refresh_areas(layer, tail); continue; } #endif layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_tilegrid_type); + self->members->items[i], &displayio_tilegrid_type); if (layer != MP_OBJ_NULL) { tail = displayio_tilegrid_get_refresh_areas(layer, tail); continue; } layer = mp_instance_cast_to_native_base( - self->children[i].original, &displayio_group_type); + self->members->items[i], &displayio_group_type); if (layer != MP_OBJ_NULL) { tail = displayio_group_get_refresh_areas(layer, tail); continue; diff --git a/shared-module/displayio/Group.h b/shared-module/displayio/Group.h index 9c2934aecb..b4054eb4a6 100644 --- a/shared-module/displayio/Group.h +++ b/shared-module/displayio/Group.h @@ -31,6 +31,7 @@ #include #include "py/obj.h" +#include "py/objlist.h" #include "shared-module/displayio/area.h" #include "shared-module/displayio/Palette.h" @@ -40,14 +41,12 @@ typedef struct { typedef struct { mp_obj_base_t base; - displayio_group_child_t* children; + mp_obj_list_t *members; displayio_buffer_transform_t absolute_transform; displayio_area_t dirty_area; // Catch all for changed area int16_t x; int16_t y; uint16_t scale; - uint16_t size; - uint16_t max_size; bool item_removed :1; bool in_group :1; bool hidden :1; @@ -55,7 +54,7 @@ typedef struct { uint8_t padding :4; } displayio_group_t; -void displayio_group_construct(displayio_group_t* self, displayio_group_child_t* child_array, uint32_t max_size, uint32_t scale, mp_int_t x, mp_int_t y); +void displayio_group_construct(displayio_group_t* self, mp_obj_list_t* members, uint32_t scale, mp_int_t x, mp_int_t y); void displayio_group_set_hidden_by_parent(displayio_group_t *self, bool hidden); bool displayio_group_get_previous_area(displayio_group_t *group, displayio_area_t* area); bool displayio_group_fill_area(displayio_group_t *group, const _displayio_colorspace_t* colorspace, const displayio_area_t* area, uint32_t* mask, uint32_t *buffer); diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index a5830f7647..1919cf4a47 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -270,15 +270,20 @@ displayio_tilegrid_t blinka_sprite = { }; #if CIRCUITPY_TERMINALIO -#define CHILD_COUNT 2 -displayio_group_child_t splash_children[2] = { - {&blinka_sprite}, - {&supervisor_terminal_text_grid}, +mp_obj_t members[] = { &blinka_sprite, &supervisor_terminal_text_grid, }; +mp_obj_list_t splash_children = { + .base = {.type = &mp_type_list }, + .alloc = 2, + .len = 2, + .items = members, }; #else -#define CHILD_COUNT 1 -displayio_group_child_t splash_children[1] = { - {&blinka_sprite}, +mp_obj_t members[] = { &blinka_sprite }; +mp_obj_list_t splash_children = { + .base = {.type = &mp_type_list }, + .alloc = 1, + .len = 1, + .items = members, }; #endif @@ -287,9 +292,7 @@ displayio_group_t circuitpython_splash = { .x = 0, .y = 0, .scale = 2, - .size = CHILD_COUNT, - .max_size = CHILD_COUNT, - .children = splash_children, + .members = &splash_children, .item_removed = false, .in_group = false, .hidden = false, From e505c59ed838095ccb2bd996fc77bd4aeada2d80 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sun, 21 Feb 2021 16:25:17 +0100 Subject: [PATCH 133/159] Separate mp_obj_list_pop so it can be used outside of objlist.c --- py/objlist.c | 12 ++++++++---- py/objlist.h | 1 + shared-module/displayio/Group.c | 25 ++----------------------- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/py/objlist.c b/py/objlist.c index 51ec920be1..309e0e542c 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -270,13 +270,10 @@ STATIC mp_obj_t list_extend(mp_obj_t self_in, mp_obj_t arg_in) { return mp_const_none; // return None, as per CPython } -STATIC mp_obj_t list_pop(size_t n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &mp_type_list)); - mp_obj_list_t *self = mp_instance_cast_to_native_base(args[0], &mp_type_list); +mp_obj_t mp_obj_list_pop(mp_obj_list_t *self, size_t index) { if (self->len == 0) { mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_list); } - size_t index = mp_get_index(self->base.type, self->len, n_args == 1 ? MP_OBJ_NEW_SMALL_INT(-1) : args[1], false); mp_obj_t ret = self->items[index]; self->len -= 1; memmove(self->items + index, self->items + index + 1, (self->len - index) * sizeof(mp_obj_t)); @@ -289,6 +286,13 @@ STATIC mp_obj_t list_pop(size_t n_args, const mp_obj_t *args) { return ret; } +STATIC mp_obj_t list_pop(size_t n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &mp_type_list)); + mp_obj_list_t *self = mp_instance_cast_to_native_base(args[0], &mp_type_list); + size_t index = mp_get_index(self->base.type, self->len, n_args == 1 ? MP_OBJ_NEW_SMALL_INT(-1) : args[1], false); + return mp_obj_list_pop(self, index); +} + STATIC void mp_quicksort(mp_obj_t *head, mp_obj_t *tail, mp_obj_t key_fn, mp_obj_t binop_less_result) { MP_STACK_CHECK(); while (head < tail) { diff --git a/py/objlist.h b/py/objlist.h index f02030557b..cec23e06c3 100644 --- a/py/objlist.h +++ b/py/objlist.h @@ -36,5 +36,6 @@ typedef struct _mp_obj_list_t { } mp_obj_list_t; void mp_obj_list_init(mp_obj_list_t *o, size_t n); +mp_obj_t mp_obj_list_pop(mp_obj_list_t *self, size_t index); #endif // MICROPY_INCLUDED_PY_OBJLIST_H diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index 48f8694890..97bb86c9ac 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -27,33 +27,13 @@ #include "shared-bindings/displayio/Group.h" #include "py/runtime.h" +#include "py/objlist.h" #include "shared-bindings/displayio/TileGrid.h" #if CIRCUITPY_VECTORIO #include "shared-bindings/vectorio/VectorShape.h" #endif -#include -#define LIST_MIN_ALLOC 4 - -STATIC mp_obj_t list_pop(size_t n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &mp_type_list)); - mp_obj_list_t *self = mp_instance_cast_to_native_base(args[0], &mp_type_list); - if (self->len == 0) { - mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_list); - } - size_t index = mp_get_index(self->base.type, self->len, n_args == 1 ? MP_OBJ_NEW_SMALL_INT(-1) : args[1], false); - mp_obj_t ret = self->items[index]; - self->len -= 1; - memmove(self->items + index, self->items + index + 1, (self->len - index) * sizeof(mp_obj_t)); - // Clear stale pointer from slot which just got freed to prevent GC issues - self->items[self->len] = MP_OBJ_NULL; - if (self->alloc > LIST_MIN_ALLOC && self->alloc > 2 * self->len) { - self->items = m_renew(mp_obj_t, self->items, self->alloc, self->alloc/2); - self->alloc /= 2; - } - return ret; -} void common_hal_displayio_group_construct(displayio_group_t* self, uint32_t max_size, uint32_t scale, mp_int_t x, mp_int_t y) { mp_obj_list_t *members = mp_obj_new_list(0, NULL); @@ -343,8 +323,7 @@ void common_hal_displayio_group_insert(displayio_group_t* self, size_t index, mp mp_obj_t common_hal_displayio_group_pop(displayio_group_t* self, size_t index) { _remove_layer(self, index); - mp_obj_t args[] = {self->members, MP_OBJ_NEW_SMALL_INT(index)}; - return list_pop(2, args); + return mp_obj_list_pop(self->members, index); } mp_int_t common_hal_displayio_group_index(displayio_group_t* self, mp_obj_t layer) { From e9953754ea5e5a249b01c354af0109a12af1da47 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sun, 21 Feb 2021 17:11:55 +0100 Subject: [PATCH 134/159] Add displayio.Group.sort() method --- shared-bindings/displayio/Group.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 386e270abd..a7f42d2b4d 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -328,6 +328,21 @@ STATIC mp_obj_t group_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t valu return mp_const_none; } +//| def sort(self, key: function, reverse: bool) -> None: +//| """Sort the members of the group.""" +//| ... +//| +STATIC mp_obj_t displayio_group_obj_sort(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + displayio_group_t *self = native_group(pos_args[0]); + mp_obj_t *args = m_new(mp_obj_t, n_args); + for (size_t i = 1; i < n_args; ++i) { + args[i] = pos_args[i]; + } + args[0] = self->members; + return mp_obj_list_sort(n_args, pos_args, kw_args); +} +MP_DEFINE_CONST_FUN_OBJ_KW(displayio_group_sort_obj, 1, displayio_group_obj_sort); + STATIC const mp_rom_map_elem_t displayio_group_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_hidden), MP_ROM_PTR(&displayio_group_hidden_obj) }, { MP_ROM_QSTR(MP_QSTR_scale), MP_ROM_PTR(&displayio_group_scale_obj) }, @@ -338,6 +353,7 @@ STATIC const mp_rom_map_elem_t displayio_group_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_index), MP_ROM_PTR(&displayio_group_index_obj) }, { MP_ROM_QSTR(MP_QSTR_pop), MP_ROM_PTR(&displayio_group_pop_obj) }, { MP_ROM_QSTR(MP_QSTR_remove), MP_ROM_PTR(&displayio_group_remove_obj) }, + { MP_ROM_QSTR(MP_QSTR_sort), MP_ROM_PTR(&displayio_group_sort_obj) }, }; STATIC MP_DEFINE_CONST_DICT(displayio_group_locals_dict, displayio_group_locals_dict_table); From 9c41753e44b72f1728931ffb6688d9327da8a8ae Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Tue, 23 Feb 2021 19:40:22 +0100 Subject: [PATCH 135/159] Remove unused typedef for group children --- shared-module/displayio/Group.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/shared-module/displayio/Group.h b/shared-module/displayio/Group.h index b4054eb4a6..0964e0a0ba 100644 --- a/shared-module/displayio/Group.h +++ b/shared-module/displayio/Group.h @@ -35,10 +35,6 @@ #include "shared-module/displayio/area.h" #include "shared-module/displayio/Palette.h" -typedef struct { - mp_obj_t original; -} displayio_group_child_t; - typedef struct { mp_obj_base_t base; mp_obj_list_t *members; From 38fb7b511b7834bdd28bc34a6714ace7df59543b Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sat, 27 Feb 2021 20:51:49 +0100 Subject: [PATCH 136/159] Remove max_size from displayio.Group Still accept it as an argument. Add deprecation note. --- shared-bindings/displayio/Group.c | 9 ++------- shared-bindings/displayio/Group.h | 2 +- shared-module/displayio/Group.c | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index a7f42d2b4d..d61307938e 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -42,7 +42,7 @@ //| """Create a Group of a given size and scale. Scale is in one dimension. For example, scale=2 //| leads to a layer's pixel being 2x2 pixels when in the group. //| -//| :param int max_size: The maximum group size. +//| :param int max_size: Ignored. Will be removed in 7.x. //| :param int scale: Scale of layer pixels in one dimension. //| :param int x: Initial x position within the parent. //| :param int y: Initial y position within the parent.""" @@ -59,11 +59,6 @@ STATIC mp_obj_t displayio_group_make_new(const mp_obj_type_t *type, size_t n_arg mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_int_t max_size = args[ARG_max_size].u_int; - if (max_size < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_max_size); - } - mp_int_t scale = args[ARG_scale].u_int; if (scale < 1) { mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_scale); @@ -71,7 +66,7 @@ STATIC mp_obj_t displayio_group_make_new(const mp_obj_type_t *type, size_t n_arg displayio_group_t *self = m_new_obj(displayio_group_t); self->base.type = &displayio_group_type; - common_hal_displayio_group_construct(self, max_size, scale, args[ARG_x].u_int, args[ARG_y].u_int); + common_hal_displayio_group_construct(self, scale, args[ARG_x].u_int, args[ARG_y].u_int); return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/displayio/Group.h b/shared-bindings/displayio/Group.h index 942a207f2d..69c73bf4dc 100644 --- a/shared-bindings/displayio/Group.h +++ b/shared-bindings/displayio/Group.h @@ -33,7 +33,7 @@ extern const mp_obj_type_t displayio_group_type; displayio_group_t* native_group(mp_obj_t group_obj); -void common_hal_displayio_group_construct(displayio_group_t* self, uint32_t max_size, uint32_t scale, mp_int_t x, mp_int_t y); +void common_hal_displayio_group_construct(displayio_group_t* self, uint32_t scale, mp_int_t x, mp_int_t y); uint32_t common_hal_displayio_group_get_scale(displayio_group_t* self); void common_hal_displayio_group_set_scale(displayio_group_t* self, uint32_t scale); bool common_hal_displayio_group_get_hidden(displayio_group_t* self); diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index 97bb86c9ac..9f08eac651 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -35,7 +35,7 @@ #endif -void common_hal_displayio_group_construct(displayio_group_t* self, uint32_t max_size, uint32_t scale, mp_int_t x, mp_int_t y) { +void common_hal_displayio_group_construct(displayio_group_t* self, uint32_t scale, mp_int_t x, mp_int_t y) { mp_obj_list_t *members = mp_obj_new_list(0, NULL); displayio_group_construct(self, members, scale, x, y); } From 24473b79838412e7be0c65e6dfae45146cf15a6b Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sat, 27 Feb 2021 21:13:55 +0100 Subject: [PATCH 137/159] Separate out mp_obj_list_insert for use in display.Group Note that for some reason this makes the binary 500 bytes larger! --- py/objlist.c | 20 +++++++++++--------- py/objlist.h | 1 + shared-bindings/displayio/Group.c | 2 +- shared-module/displayio/Group.c | 6 +----- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/py/objlist.c b/py/objlist.c index 309e0e542c..7aa4ee89c9 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -270,7 +270,7 @@ STATIC mp_obj_t list_extend(mp_obj_t self_in, mp_obj_t arg_in) { return mp_const_none; // return None, as per CPython } -mp_obj_t mp_obj_list_pop(mp_obj_list_t *self, size_t index) { +inline mp_obj_t mp_obj_list_pop(mp_obj_list_t *self, size_t index) { if (self->len == 0) { mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_list); } @@ -375,6 +375,15 @@ STATIC mp_obj_t list_index(size_t n_args, const mp_obj_t *args) { return mp_seq_index_obj(self->items, self->len, n_args, args); } +inline void mp_obj_list_insert(mp_obj_list_t *self, size_t index, mp_obj_t obj) { + mp_obj_list_append(MP_OBJ_FROM_PTR(self), mp_const_none); + + for (size_t i = self->len - 1; i > index; --i) { + self->items[i] = self->items[i - 1]; + } + self->items[index] = obj; +} + STATIC mp_obj_t list_insert(mp_obj_t self_in, mp_obj_t idx, mp_obj_t obj) { mp_check_self(MP_OBJ_IS_TYPE(self_in, &mp_type_list)); mp_obj_list_t *self = mp_instance_cast_to_native_base(self_in, &mp_type_list); @@ -389,14 +398,7 @@ STATIC mp_obj_t list_insert(mp_obj_t self_in, mp_obj_t idx, mp_obj_t obj) { if ((size_t)index > self->len) { index = self->len; } - - mp_obj_list_append(self_in, mp_const_none); - - for (mp_int_t i = self->len-1; i > index; i--) { - self->items[i] = self->items[i-1]; - } - self->items[index] = obj; - + mp_obj_list_insert(self, index, obj); return mp_const_none; } diff --git a/py/objlist.h b/py/objlist.h index cec23e06c3..eb005e81cf 100644 --- a/py/objlist.h +++ b/py/objlist.h @@ -37,5 +37,6 @@ typedef struct _mp_obj_list_t { void mp_obj_list_init(mp_obj_list_t *o, size_t n); mp_obj_t mp_obj_list_pop(mp_obj_list_t *self, size_t index); +void mp_obj_list_insert(mp_obj_list_t *self, size_t index, mp_obj_t obj); #endif // MICROPY_INCLUDED_PY_OBJLIST_H diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index d61307938e..c1c05504da 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -333,7 +333,7 @@ STATIC mp_obj_t displayio_group_obj_sort(size_t n_args, const mp_obj_t *pos_args for (size_t i = 1; i < n_args; ++i) { args[i] = pos_args[i]; } - args[0] = self->members; + args[0] = MP_OBJ_FROM_PTR(self->members); return mp_obj_list_sort(n_args, pos_args, kw_args); } MP_DEFINE_CONST_FUN_OBJ_KW(displayio_group_sort_obj, 1, displayio_group_obj_sort); diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index 9f08eac651..42efeb18c2 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -314,11 +314,7 @@ static void _remove_layer(displayio_group_t* self, size_t index) { void common_hal_displayio_group_insert(displayio_group_t* self, size_t index, mp_obj_t layer) { _add_layer(self, layer); - mp_obj_list_append(self->members, mp_const_none); - for (size_t i = self->members->len - 1; i > index; i--) { - self->members->items[i] = self->members->items[i - 1]; - } - self->members->items[index] = layer; + mp_obj_list_insert(self->members, index, layer); } mp_obj_t common_hal_displayio_group_pop(displayio_group_t* self, size_t index) { From 34917b8e8eac6785cf543ae87327c8c07d783ff9 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 28 Feb 2021 17:41:35 +0100 Subject: [PATCH 138/159] Added translation using Weblate (Abkhazian) --- locale/ab.po | 4227 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 4227 insertions(+) create mode 100644 locale/ab.po diff --git a/locale/ab.po b/locale/ab.po new file mode 100644 index 0000000000..f266062662 --- /dev/null +++ b/locale/ab.po @@ -0,0 +1,4227 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ab\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: main.c +msgid "" +"\n" +"Code done running.\n" +msgstr "" + +#: main.c +msgid "" +"\n" +"Code stopped by auto-reload.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: py/obj.c +msgid " File \"%q\"" +msgstr "" + +#: py/obj.c +msgid " File \"%q\", line %d" +msgstr "" + +#: py/builtinhelp.c +msgid " is of type %q\n" +msgstr "" + +#: main.c +msgid " output:\n" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "%%c requires int or char" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "" +"%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" +msgstr "" + +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q in use" +msgstr "" + +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c +msgid "%q index out of range" +msgstr "" + +#: py/obj.c +msgid "%q indices must be integers, not %q" +msgstr "" + +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c +msgid "%q must be >= 1" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c +msgid "%q pin invalid" +msgstr "" + +#: shared-bindings/fontio/BuiltinFont.c +msgid "%q should be an int" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "%q() takes %d positional arguments but %d were given" +msgstr "" + +#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#, c-format +msgid "%s error 0x%x" +msgstr "" + +#: py/argcheck.c +msgid "'%q' argument required" +msgstr "" + +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a label" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects a special register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an FPU register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an address of the form [a, b]" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects an integer" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects at most r%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects {r0, r1, ...}" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "'%s' integer %d is not within range %d..%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' integer 0x%x does not fit in mask 0x%x" +msgstr "" + +#: py/objstr.c +msgid "'=' alignment not allowed in string format specifier" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "'S' and 'O' are not supported format types" +msgstr "" + +#: py/compile.c +msgid "'align' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'await' outside function" +msgstr "" + +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + +#: py/compile.c +msgid "'break' outside loop" +msgstr "" + +#: py/compile.c +msgid "'continue' outside loop" +msgstr "" + +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + +#: py/compile.c +msgid "'data' requires at least 2 arguments" +msgstr "" + +#: py/compile.c +msgid "'data' requires integer arguments" +msgstr "" + +#: py/compile.c +msgid "'label' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'return' outside function" +msgstr "" + +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + +#: py/compile.c +msgid "'yield' outside function" +msgstr "" + +#: py/compile.c +msgid "*x must be assignment target" +msgstr "" + +#: py/obj.c +msgid ", in %q\n" +msgstr "" + +#: py/objcomplex.c +msgid "0.0 to a complex power" +msgstr "" + +#: py/modbuiltins.c +msgid "3-arg pow() not supported" +msgstr "" + +#: shared-module/msgpack/__init__.c +msgid "64 bit types" +msgstr "" + +#: ports/atmel-samd/common-hal/countio/Counter.c +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "A hardware interrupt channel is already in use" +msgstr "" + +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c +#, c-format +msgid "Address must be %d bytes long" +msgstr "" + +#: shared-bindings/_bleio/Address.c +msgid "Address type out of range" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +msgid "All I2C peripherals are in use" +msgstr "" + +#: ports/esp32s2/common-hal/countio/Counter.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +msgid "All PCNT units in use" +msgstr "" + +#: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +msgid "All SPI peripherals are in use" +msgstr "" + +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c +msgid "All UART peripherals are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "All event channels in use" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "All state machines in use" +msgstr "" + +#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "All sync event channels in use" +msgstr "" + +#: shared-bindings/pwmio/PWMOut.c +msgid "All timers for this pin are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/_pew/PewPew.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c +msgid "All timers in use" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Already advertising." +msgstr "" + +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogIn.c +msgid "AnalogIn not supported on given pin" +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/nrf/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +msgid "AnalogOut functionality not supported" +msgstr "" + +#: shared-bindings/analogio/AnalogOut.c +msgid "AnalogOut is only 16 bits. Value must be less than 65536." +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +msgid "AnalogOut not supported on given pin" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +msgid "Another send is already active" +msgstr "" + +#: shared-bindings/pulseio/PulseOut.c +msgid "Array must contain halfwords (type 'H')" +msgstr "" + +#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c +msgid "Array values should be single bytes." +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + +#: shared-module/memorymonitor/AllocationAlarm.c +#, c-format +msgid "Attempt to allocate %d blocks" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Attempted heap allocation when MicroPython VM not running." +msgstr "" + +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + +#: main.c +msgid "Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "" +"Auto-reload is on. Simply save files over USB to run them or enter REPL to " +"disable.\n" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c +msgid "Below minimum frame rate" +msgstr "" + +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must be sequential pins" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must share a clock unit" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Bit depth must be from 1 to 6 inclusive, not %d" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Bit depth must be multiple of 8." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "Both pins must support hardware interrupts" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "Brightness must be 0-1.0" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Brightness must be between 0 and 255" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Brightness not adjustable" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +#, c-format +msgid "Buffer + offset too small %d %d %d" +msgstr "" + +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Buffer elements must be 4 bytes long or less" +msgstr "" + +#: shared-module/usb_hid/Device.c +#, c-format +msgid "Buffer incorrect size. Should be %d bytes." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is not a bytearray." +msgstr "" + +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is too small" +msgstr "" + +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#, c-format +msgid "Buffer length %d too big. It must be less than %d" +msgstr "" + +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + +#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c +msgid "Buffer must be at least length 1" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Buffer too large and unable to allocate" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +#, c-format +msgid "Bus pin %d is already in use" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "Byte buffer must be 16 bytes." +msgstr "" + +#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c +msgid "Bytes must be between 0 and 255." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + +#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +msgid "CRC or checksum was invalid" +msgstr "" + +#: py/objtype.c +msgid "Call super().__init__() before accessing native object." +msgstr "" + +#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +msgid "Can only alarm on RTC IO from deep sleep." +msgstr "" + +#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +msgid "Can only alarm on one low pin while others alarm high from deep sleep." +msgstr "" + +#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +msgid "Can only alarm on two low pins from deep sleep." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "Can't set CCCD on local Characteristic" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c +msgid "Cannot delete values" +msgstr "" + +#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +#: ports/nrf/common-hal/digitalio/DigitalInOut.c +#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c +msgid "Cannot get pull while in output mode" +msgstr "" + +#: ports/nrf/common-hal/microcontroller/Processor.c +msgid "Cannot get temperature" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Cannot output both channels on the same pin" +msgstr "" + +#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot pull on input-only pin." +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot read without MISO pin." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Cannot record to a file" +msgstr "" + +#: shared-module/storage/__init__.c +msgid "Cannot remount '/' when USB is active." +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/__init__.c +#: ports/cxd56/common-hal/microcontroller/__init__.c +#: ports/mimxrt10xx/common-hal/microcontroller/__init__.c +msgid "Cannot reset into bootloader because no bootloader is present." +msgstr "" + +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Cannot set socket options" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Cannot set value when direction is input." +msgstr "" + +#: ports/esp32s2/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Cannot specify RTS or CTS in RS485 mode" +msgstr "" + +#: py/objslice.c +msgid "Cannot subclass slice" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot transfer without MOSI and MISO pins." +msgstr "" + +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + +#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot write without MOSI pin." +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "CharacteristicBuffer writing not provided" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Clock pin init failed." +msgstr "" + +#: shared-module/bitbangio/I2C.c +msgid "Clock stretch too long" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Clock unit in use" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Column entry must be digitalio.DigitalInOut" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "Command must be an int between 0 and 255" +msgstr "" + +#: shared-bindings/_bleio/Connection.c +msgid "" +"Connection has been disconnected and can no longer be used. Create a new " +"connection." +msgstr "" + +#: py/persistentcode.c +msgid "Corrupt .mpy file" +msgstr "" + +#: py/emitglue.c +msgid "Corrupt raw code" +msgstr "" + +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c +msgid "Could not initialize UART" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate decoder" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate input buffer" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate second buffer" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Crash into the HardFault_Handler." +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "DAC already in use" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +msgid "Data 0 pin must be byte aligned" +msgstr "" + +#: ports/esp32s2/common-hal/displayio/ParallelBus.c +msgid "Data 0 pin must be byte aligned." +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Data chunk must follow fmt chunk" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Data too large for advertisement packet" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Destination capacity is smaller than destination_length." +msgstr "" + +#: ports/nrf/common-hal/audiobusio/I2SOut.c +msgid "Device in use" +msgstr "" + +#: ports/cxd56/common-hal/digitalio/DigitalInOut.c +msgid "DigitalInOut not supported on given pin" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Display must have a 16 bit colorspace." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Display rotation must be in 90 degree increments" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Drive mode not used when direction is input." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +msgid "EXTINT channel already in use" +msgstr "" + +#: extmod/modure.c +msgid "Error in regex" +msgstr "" + +#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c +msgid "Error: Failure to bind" +msgstr "" + +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/neopixel_write/__init__.c +#: shared-bindings/terminalio/Terminal.c +msgid "Expected a %q" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c +msgid "Expected a Characteristic" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Expected a Service" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +#: shared-bindings/_bleio/Service.c +msgid "Expected a UUID" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Expected an Address" +msgstr "" + +#: shared-bindings/alarm/__init__.c +msgid "Expected an alarm" +msgstr "" + +#: shared-module/_pixelbuf/PixelBuf.c +#, c-format +msgid "Expected tuple of length %d, got %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Extended advertisements with scan response not supported." +msgstr "" + +#: extmod/ulab/code/fft/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + +#: extmod/ulab/code/fft/fft.c +msgid "FFT is implemented for linear arrays only" +msgstr "" + +#: ports/esp32s2/common-hal/ssl/SSLSocket.c +msgid "Failed SSL handshake" +msgstr "" + +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to acquire mutex, err 0x%04x" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c +msgid "Failed to allocate RX buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c +#, c-format +msgid "Failed to allocate RX buffer of %d bytes" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: internal error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: timeout" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Failed to parse MP3 file" +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to release mutex, err 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + +#: py/moduerrno.c +msgid "File exists" +msgstr "" + +#: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + +#: ports/esp32s2/common-hal/dualbank/__init__.c +msgid "Firmware image is invalid" +msgstr "" + +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + +#: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c +#: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c +msgid "Function requires lock" +msgstr "" + +#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +msgid "Generic Failure" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Group already used" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Group full" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + +#: extmod/vfs_posix_file.c py/objstringio.c +msgid "I/O operation on closed file" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + +#: ports/raspberrypi/common-hal/busio/I2C.c +msgid "I2C peripheral in use" +msgstr "" + +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + +#: ports/esp32s2/common-hal/alarm/pin/__init__.c +msgid "IOs 0, 2 & 4 do not support internal pullup in sleep" +msgstr "" + +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "In buffer elements must be 4 bytes long or less" +msgstr "" + +#: py/persistentcode.c +msgid "" +"Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" +"mpy-update for more info." +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Incorrect buffer size" +msgstr "" + +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Init program size invalid" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin direcion conflicts with initial out pin direction" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Initial set pin state conflicts with initial out pin state" +msgstr "" + +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "Initialization failed due to lack of memory" +msgstr "" + +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +msgid "Input/output error" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +msgid "Instruction %d jumps on pin" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +msgid "Instruction %d shifts in more bits than pin count" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +msgid "Instruction %d shifts out more bits than pin count" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +msgid "Instruction %d uses extra pin" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +msgid "Instruction %d waits on input outside of count" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Invalid %q pin" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Invalid BMP file" +msgstr "" + +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + +#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c +msgid "Invalid PWM frequency" +msgstr "" + +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "Invalid Pin" +msgstr "" + +#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c +msgid "Invalid argument" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Invalid bits per value" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid buffer size" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Invalid byteorder string" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +msgid "Invalid capture period. Valid range: 1 - 500" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid channel count" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Invalid direction." +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid file" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid format chunk size" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Invalid memory access." +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "Invalid number of bits" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +msgid "Invalid phase" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Invalid pin" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for left channel" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for right channel" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/SPI.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/busio/SPI.c +#: ports/raspberrypi/common-hal/busio/UART.c +msgid "Invalid pins" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +msgid "Invalid polarity" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Invalid properties" +msgstr "" + +#: shared-bindings/microcontroller/__init__.c +msgid "Invalid run mode." +msgstr "" + +#: shared-module/_bleio/Attribute.c +msgid "Invalid security_mode" +msgstr "" + +#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +msgid "Invalid size" +msgstr "" + +#: ports/esp32s2/common-hal/ssl/SSLContext.c +msgid "Invalid socket for TLS" +msgstr "" + +#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +msgid "Invalid state" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice count" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid wave file" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + +#: py/compile.c +msgid "LHS of keyword arg must be an id" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer already in a group." +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer must be a Group or TileGrid subclass." +msgstr "" + +#: py/objslice.c +msgid "Length must be an int" +msgstr "" + +#: py/objslice.c +msgid "Length must be non-negative" +msgstr "" + +#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +msgid "MAC address was invalid" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MISO pin init failed." +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MOSI pin init failed." +msgstr "" + +#: shared-module/displayio/Shape.c +#, c-format +msgid "Maximum x value when mirrored is %d" +msgstr "" + +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython fatal error." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Microphone startup delay must be in range 0.0 to 1.0" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +msgid "Missing first_in_pin. Instruction %d reads pin(s)" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +msgid "Missing first_in_pin. Instruction %d waits based on pin" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +msgid "Missing first_out_pin. Instruction %d writes pin(s)" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +msgid "Missing first_set_pin. Instruction %d sets pin(s)" +msgstr "" + +#: shared-bindings/displayio/Group.c +msgid "Must be a %q subclass." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + +#: ports/esp32s2/common-hal/nvm/ByteArray.c +msgid "NVS Error" +msgstr "" + +#: py/parse.c +msgid "Name too long" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "No CCCD for this Characteristic" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "No DAC on chip" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c +msgid "No DMA channel found" +msgstr "" + +#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c +msgid "No DMA pacing timer found" +msgstr "" + +#: shared-module/adafruit_bus_device/I2CDevice.c +#, c-format +msgid "No I2C device at address: %x" +msgstr "" + +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "No RX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "No TX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "No available clocks" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + +#: shared-bindings/board/__init__.c +msgid "No default %q bus" +msgstr "" + +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +msgid "No free GCLKs" +msgstr "" + +#: shared-bindings/os/__init__.c +msgid "No hardware random available" +msgstr "" + +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "No hardware support on pin" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in in program" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No in or out in program" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "No out in program" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/busio/I2C.c +msgid "No pull up found on SDA or SCL; check your wiring" +msgstr "" + +#: shared-module/touchio/TouchIn.c +msgid "No pulldown on pin; 1Mohm recommended" +msgstr "" + +#: py/moduerrno.c +msgid "No space left on device" +msgstr "" + +#: py/moduerrno.c +msgid "No such file/directory" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "No timer available" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "Not connected" +msgstr "" + +#: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c +#: shared-bindings/audiopwmio/PWMAudioOut.c +msgid "Not playing" +msgstr "" + +#: main.c +msgid "Not running saved code.\n" +msgstr "" + +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + +#: shared-bindings/util.c +msgid "" +"Object has been deinitialized and can no longer be used. Create a new object." +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "Odd parity is not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c +msgid "Only 8 or 16 bit mono with " +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 sockets supported" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only Windows format, uncompressed BMP supported: given header size is %d" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " +"%d bpp given" +msgstr "" + +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one TouchAlarm can be set in deep sleep." +msgstr "" + +#: ports/esp32s2/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set." +msgstr "" + +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + +#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +msgid "Operation or feature not supported" +msgstr "" + +#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +msgid "Operation timed out" +msgstr "" + +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Out buffer elements must be 4 bytes long or less" +msgstr "" + +#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +msgid "Out of memory" +msgstr "" + +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "Output buffer must be at least %d bytes" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Oversample must be multiple of 8." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "PDMIn not available" +msgstr "" + +#: shared-bindings/pwmio/PWMOut.c +msgid "" +"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +msgstr "" + +#: shared-bindings/pwmio/PWMOut.c +msgid "" +"PWM frequency not writable when variable_frequency is False on construction." +msgstr "" + +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c +msgid "ParallelBus not yet supported" +msgstr "" + +#: ports/esp32s2/common-hal/audiobusio/__init__.c +msgid "Peripheral in use" +msgstr "" + +#: py/moduerrno.c +msgid "Permission denied" +msgstr "" + +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Pin count must be at least 1" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Pin count too large" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogIn.c +#: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +#: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/raspberrypi/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Pin does not have ADC capabilities" +msgstr "" + +#: shared-bindings/adafruit_bus_device/SPIDevice.c +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + +#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c +msgid "Pins must share PWM slice" +msgstr "" + +#: py/builtinhelp.c +msgid "Plus any modules on the filesystem\n" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Prefix buffer must be on the heap" +msgstr "" + +#: main.c +msgid "Press any key to enter the REPL. Use CTRL-D to reload.\n" +msgstr "" + +#: main.c +msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Program does IN without loading ISR" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Program does OUT without loading OSR" +msgstr "" + +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Program must contain at least one 16-bit instruction." +msgstr "" + +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Program size invalid" +msgstr "" + +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Program too large" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pull not used when direction is output." +msgstr "" + +#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c +msgid "RAISE mode is not implemented" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c +msgid "RS485 Not yet supported on this device" +msgstr "" + +#: ports/esp32s2/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "RS485 inversion specified when not in RS485 mode" +msgstr "" + +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/rtc/RTC.c +msgid "RTC calibration is not supported on this board" +msgstr "" + +#: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c +msgid "RTC is not supported on this board" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "RTS/CTS/RS485 Not yet supported on this device" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c +msgid "Read-only" +msgstr "" + +#: extmod/vfs_fat.c py/moduerrno.c +msgid "Read-only filesystem" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Read-only object" +msgstr "" + +#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +msgid "Received response was invalid" +msgstr "" + +#: shared-bindings/displayio/EPaperDisplay.c +msgid "Refresh too soon" +msgstr "" + +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + +#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +msgid "Requested resource not found" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Right channel unsupported" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Row entry must be digitalio.DigitalInOut" +msgstr "" + +#: main.c +msgid "Running in safe mode! " +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + +#: ports/raspberrypi/common-hal/busio/SPI.c +msgid "SPI peripheral in use" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Sample rate must be positive" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#, c-format +msgid "Sample rate too high. It must be less than %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Scan already in progess. Stop with stop_scan." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected CTS pin not valid" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected RTS pin not valid" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Serializer in use" +msgstr "" + +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Set pin count must be between 1 and 5" +msgstr "" + +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "Side set pin count must be between 1 and 5" +msgstr "" + +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + +#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c +msgid "Slice and value different lengths." +msgstr "" + +#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c +msgid "Slices not supported" +msgstr "" + +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Stack size must be at least 256" +msgstr "" + +#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c +msgid "Stereo left must be on PWM channel A" +msgstr "" + +#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c +msgid "Stereo right must be on PWM channel B" +msgstr "" + +#: shared-bindings/multiterminal/__init__.c +msgid "Stream missing readinto() or write() method." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: shared-bindings/alarm/time/TimeAlarm.c +msgid "Supply one of monotonic_time or epoch_time" +msgstr "" + +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The CircuitPython heap was corrupted because the stack was too small.\n" +"Please increase the stack size if you know how, or if not:" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The `microcontroller` module was used to boot into safe mode. Press reset to " +"exit safe mode.\n" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The microcontroller's power dipped. Make sure your power supply provides\n" +"enough power for the whole circuit and press reset (after ejecting " +"CIRCUITPY).\n" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's bits_per_sample does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's channel count does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's sample rate does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's signedness does not match the mixer's" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile height must exactly divide bitmap height" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c +msgid "Tile index out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile value out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile width must exactly divide bitmap width" +msgstr "" + +#: shared-bindings/alarm/time/TimeAlarm.c +msgid "Time is in the past." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample." +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many display busses" +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many displays" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + +#: py/obj.c +msgid "Traceback (most recent call last):\n" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "Tuple or struct_time argument required" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Busy" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Error" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID integer value must be 0-0xffff" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID value is not str, int or byte buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c +#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c +msgid "Unable to allocate buffers for signed conversion" +msgstr "" + +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + +#: shared-module/displayio/I2CDisplay.c +#, c-format +msgid "Unable to find I2C Display at %x" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Unable to find free GCLK" +msgstr "" + +#: py/parse.c +msgid "Unable to init parser" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Unable to read color palette data" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Unable to write to nvm." +msgstr "" + +#: shared-bindings/alarm/SleepMemory.c +msgid "Unable to write to sleep_memory." +msgstr "" + +#: ports/nrf/common-hal/_bleio/UUID.c +msgid "Unexpected nrfx uuid type" +msgstr "" + +#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + +#: shared-bindings/wifi/Radio.c +#, c-format +msgid "Unknown failure %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown security error: 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown soft device error: %04x" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +#, c-format +msgid "Unmatched number of items on RHS (expected %d, got %d)." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "" +"Unspecified issue. Can be that the pairing prompt on the other device was " +"declined or ignored." +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c +#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +msgid "Unsupported baudrate" +msgstr "" + +#: shared-module/displayio/display_core.c +msgid "Unsupported display bus type" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Unsupported format" +msgstr "" + +#: py/moduerrno.c +msgid "Unsupported operation" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Unsupported pull value." +msgstr "" + +#: ports/esp32s2/common-hal/dualbank/__init__.c +msgid "Update Failed" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length != required fixed length" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length > max_length" +msgstr "" + +#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +msgid "Version was invalid" +msgstr "" + +#: py/emitnative.c +msgid "Viper functions don't currently support more than 4 arguments" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + +#: main.c +msgid "WARNING: Your code filename has two extensions\n" +msgstr "" + +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + +#: py/builtinhelp.c +#, c-format +msgid "" +"Welcome to Adafruit CircuitPython %s!\n" +"\n" +"Please visit learn.adafruit.com/category/circuitpython for project guides.\n" +"\n" +"To list built-in modules please do `help(\"modules\")`.\n" +msgstr "" + +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + +#: main.c +msgid "Woken up by alarm.\n" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Writes not supported on Characteristic" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You are in safe mode: something unanticipated happened.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You requested starting safe mode by " +msgstr "" + +#: py/objtype.c +msgid "__init__() should return None" +msgstr "" + +#: py/objtype.c +msgid "__init__() should return None, not '%q'" +msgstr "" + +#: py/objobject.c +msgid "__new__ arg must be a user-type" +msgstr "" + +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c +msgid "a bytes-like object is required" +msgstr "" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "" + +#: shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "address out of bounds" +msgstr "" + +#: shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "addresses is empty" +msgstr "" + +#: py/modbuiltins.c +msgid "arg is an empty sequence" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort is not implemented for flattened arrays" +msgstr "" + +#: py/runtime.c +msgid "argument has wrong type" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + +#: py/argcheck.c shared-bindings/_stage/__init__.c +#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +msgid "argument num/types mismatch" +msgstr "" + +#: py/runtime.c +msgid "argument should be a '%q' not a '%q'" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c +msgid "arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "array and index length must be equal" +msgstr "" + +#: py/objarray.c shared-bindings/alarm/SleepMemory.c +#: shared-bindings/nvm/ByteArray.c +msgid "array/bytes required on right side" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get (arg)min/(arg)max of empty sequence" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + +#: py/objstr.c +msgid "attributes not supported yet" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "axis is out of bounds" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "axis must be None, or an integer" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "axis too long" +msgstr "" + +#: py/builtinevex.c +msgid "bad compile mode" +msgstr "" + +#: py/objstr.c +msgid "bad conversion specifier" +msgstr "" + +#: py/objstr.c +msgid "bad format string" +msgstr "" + +#: py/binary.c py/objarray.c +msgid "bad typecode" +msgstr "" + +#: py/emitnative.c +msgid "binary op %q not implemented" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "bits must be in range 5 to 9" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "bits_per_sample must be 8 or 16" +msgstr "" + +#: py/emitinlinethumb.c +msgid "branch not in range" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "buffer is smaller than requested size" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "buffer must be a bytes-like object" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "buffer size must be a multiple of element size" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "buffer size must match format" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "buffer slices must be of equal length" +msgstr "" + +#: py/modstruct.c shared-bindings/struct/__init__.c +#: shared-module/struct/__init__.c +msgid "buffer too small" +msgstr "" + +#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c +msgid "buffer too small for requested bytes" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "buttons must be digitalio.DigitalInOut" +msgstr "" + +#: py/vm.c +msgid "byte code not implemented" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "byteorder is not a string" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c +msgid "bytes > 8 bits not supported" +msgstr "" + +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + +#: py/objstr.c +msgid "bytes value out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +msgid "calibration is out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c +msgid "calibration is read only" +msgstr "" + +#: ports/atmel-samd/common-hal/rtc/RTC.c +msgid "calibration value out of range +/-127" +msgstr "" + +#: py/emitinlinethumb.c +msgid "can only have up to 4 parameters to Thumb assembly" +msgstr "" + +#: py/emitinlinextensa.c +msgid "can only have up to 4 parameters to Xtensa assembly" +msgstr "" + +#: py/persistentcode.c +msgid "can only save bytecode" +msgstr "" + +#: py/objtype.c +msgid "can't add special method to already-subclassed class" +msgstr "" + +#: py/compile.c +msgid "can't assign to expression" +msgstr "" + +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c +msgid "can't convert %q to %q" +msgstr "" + +#: py/objstr.c +msgid "can't convert '%q' object to %q implicitly" +msgstr "" + +#: py/obj.c +msgid "can't convert to %q" +msgstr "" + +#: py/objstr.c +msgid "can't convert to str implicitly" +msgstr "" + +#: py/compile.c +msgid "can't declare nonlocal in outer code" +msgstr "" + +#: py/compile.c +msgid "can't delete expression" +msgstr "" + +#: py/emitnative.c +msgid "can't do binary op between '%q' and '%q'" +msgstr "" + +#: py/objcomplex.c +msgid "can't do truncated division of a complex number" +msgstr "" + +#: py/compile.c +msgid "can't have multiple **x" +msgstr "" + +#: py/compile.c +msgid "can't have multiple *x" +msgstr "" + +#: py/emitnative.c +msgid "can't implicitly convert '%q' to 'bool'" +msgstr "" + +#: py/emitnative.c +msgid "can't load from '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't load with '%q' index" +msgstr "" + +#: py/objgenerator.c +msgid "can't pend throw to just-started generator" +msgstr "" + +#: py/objgenerator.c +msgid "can't send non-None value to a just-started generator" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + +#: py/objnamedtuple.c +msgid "can't set attribute" +msgstr "" + +#: py/emitnative.c +msgid "can't store '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store to '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store with '%q' index" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from automatic field numbering to manual field specification" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from manual field specification to automatic field numbering" +msgstr "" + +#: extmod/ulab/code/ndarray_operators.c +msgid "cannot cast output with casting rule" +msgstr "" + +#: py/objtype.c +msgid "cannot create '%q' instances" +msgstr "" + +#: py/objtype.c +msgid "cannot create instance" +msgstr "" + +#: py/runtime.c +msgid "cannot import name %q" +msgstr "" + +#: py/builtinimport.c +msgid "cannot perform relative import" +msgstr "" + +#: py/emitnative.c +msgid "casting" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "chars buffer too small" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(0x110000)" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(256)" +msgstr "" + +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + +#: shared-bindings/msgpack/ExtType.c +msgid "code outside range 0~127" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a buffer, tuple, list, or int" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a bytearray or array of type 'b' or 'B'" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color must be between 0x000000 and 0xffffff" +msgstr "" + +#: shared-bindings/displayio/ColorConverter.c +msgid "color should be an int" +msgstr "" + +#: py/objcomplex.c +msgid "complex division by zero" +msgstr "" + +#: py/objfloat.c py/parsenum.c +msgid "complex values not supported" +msgstr "" + +#: extmod/moduzlib.c +msgid "compression header" +msgstr "" + +#: py/parse.c +msgid "constant must be an integer" +msgstr "" + +#: py/emitnative.c +msgid "conversion to object" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "cross is defined for 1D arrays of length 3" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "data must be of equal length" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + +#: py/parsenum.c +msgid "decimal numbers not supported" +msgstr "" + +#: py/compile.c +msgid "default 'except' must be last" +msgstr "" + +#: shared-bindings/msgpack/__init__.c +msgid "default is not a function" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "" +"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination buffer must be an array of type 'H' for bit_depth = 16" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination_length must be an int >= 0" +msgstr "" + +#: py/objdict.c +msgid "dict update sequence has wrong length" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "differentiation order out of range" +msgstr "" + +#: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c +#: shared-bindings/math/__init__.c +msgid "division by zero" +msgstr "" + +#: py/objdeque.c +msgid "empty" +msgstr "" + +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "" + +#: py/objstr.c +msgid "empty separator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "empty sequence" +msgstr "" + +#: py/objstr.c +msgid "end of format while looking for conversion specifier" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "end_x should be an int" +msgstr "" + +#: shared-bindings/alarm/time/TimeAlarm.c +msgid "epoch_time not supported on this board" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +#, c-format +msgid "error = 0x%08lX" +msgstr "" + +#: py/runtime.c +msgid "exceptions must derive from BaseException" +msgstr "" + +#: shared-bindings/canio/CAN.c +msgid "expected '%q' but got '%q'" +msgstr "" + +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + +#: py/objstr.c +msgid "expected ':' after format specifier" +msgstr "" + +#: py/obj.c +msgid "expected tuple/list" +msgstr "" + +#: py/modthread.c +msgid "expecting a dict for keyword args" +msgstr "" + +#: py/compile.c +msgid "expecting an assembler instruction" +msgstr "" + +#: py/compile.c +msgid "expecting just a value for set" +msgstr "" + +#: py/compile.c +msgid "expecting key:value for dict" +msgstr "" + +#: shared-bindings/msgpack/__init__.c +msgid "ext_hook is not a function" +msgstr "" + +#: py/argcheck.c +msgid "extra keyword arguments given" +msgstr "" + +#: py/argcheck.c +msgid "extra positional arguments given" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c +#: shared-bindings/displayio/OnDiskBitmap.c +msgid "file must be a file opened in byte mode" +msgstr "" + +#: shared-bindings/storage/__init__.c +msgid "filesystem must provide mount method" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "first argument must be a function" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "first argument must be a tuple of ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + +#: py/objtype.c +msgid "first argument to super() must be type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + +#: py/objint.c +msgid "float too big" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "font must be 2048 bytes long" +msgstr "" + +#: py/objstr.c +msgid "format requires a dict" +msgstr "" + +#: py/objdeque.c +msgid "full" +msgstr "" + +#: py/argcheck.c +msgid "function does not take keyword arguments" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function expected at most %d arguments, got %d" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "function got multiple values for argument '%q'" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "function is defined for ndarrays only" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function missing %d required positional arguments" +msgstr "" + +#: py/bc.c +msgid "function missing keyword-only argument" +msgstr "" + +#: py/bc.c +msgid "function missing required keyword argument '%q'" +msgstr "" + +#: py/bc.c +#, c-format +msgid "function missing required positional argument #%d" +msgstr "" + +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c +#, c-format +msgid "function takes %d positional arguments but %d were given" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "function takes exactly 9 arguments" +msgstr "" + +#: py/objgenerator.c +msgid "generator already executing" +msgstr "" + +#: py/objgenerator.c +msgid "generator ignored GeneratorExit" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "graphic must be 2048 bytes long" +msgstr "" + +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as global" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as nonlocal" +msgstr "" + +#: py/objstr.c +msgid "incomplete format" +msgstr "" + +#: py/objstr.c +msgid "incomplete format key" +msgstr "" + +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +msgid "index out of range" +msgstr "" + +#: py/obj.c +msgid "indices must be integers" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "initial values must be iterable" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + +#: py/compile.c +msgid "inline assembler must be a function" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "input and output shapes are not compatible" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input argument must be an integer, a tuple, or a list" +msgstr "" + +#: extmod/ulab/code/fft/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input arrays are not compatible" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/user/user.c +msgid "input must be a dense ndarray" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input must be a tensor of rank 2" +msgstr "" + +#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c +msgid "input must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "input must be one-dimensional" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "input vectors must be of equal length" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "inputs are not iterable" +msgstr "" + +#: py/parsenum.c +msgid "int() arg 2 must be >= 2 and <= 36" +msgstr "" + +#: py/objstr.c +msgid "integer required" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +#, c-format +msgid "interval must be in range %s-%s" +msgstr "" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "" + +#: py/objstr.c +msgid "invalid format specifier" +msgstr "" + +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "" + +#: py/compile.c +msgid "invalid micropython decorator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "invalid step" +msgstr "" + +#: py/compile.c py/parse.c +msgid "invalid syntax" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for integer" +msgstr "" + +#: py/parsenum.c +#, c-format +msgid "invalid syntax for integer with base %d" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for number" +msgstr "" + +#: ports/esp32s2/common-hal/alarm/pin/__init__.c +msgid "io must be rtc io" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 1 must be a class" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 2 must be a class or a tuple of classes" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "iterations did not converge" +msgstr "" + +#: py/objstr.c +msgid "join expects a list of str/bytes objects consistent with self object" +msgstr "" + +#: py/argcheck.c +msgid "keyword argument(s) not yet implemented - use normal args instead" +msgstr "" + +#: py/bc.c +msgid "keywords must be strings" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +msgid "label '%q' not defined" +msgstr "" + +#: py/compile.c +msgid "label redefined" +msgstr "" + +#: py/stream.c +msgid "length argument not allowed for this type" +msgstr "" + +#: shared-bindings/audiomixer/MixerVoice.c +msgid "level must be between 0 and 1" +msgstr "" + +#: py/objarray.c +msgid "lhs and rhs should be compatible" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' has type '%q' but source is '%q'" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' used before type known" +msgstr "" + +#: py/vm.c +msgid "local variable referenced before assignment" +msgstr "" + +#: py/objint.c +msgid "long int not supported in this build" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + +#: py/parse.c +msgid "malformed f-string" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "map buffer too small" +msgstr "" + +#: py/modmath.c shared-bindings/math/__init__.c +msgid "math domain error" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "matrix is not positive definite" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +#, c-format +msgid "max_length must be 0-%d when fixed_length is %s" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be >= 0" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "maximum number of dimensions is 4" +msgstr "" + +#: py/runtime.c +msgid "maximum recursion depth exceeded" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "memory allocation failed, allocating %u bytes" +msgstr "" + +#: py/runtime.c +msgid "memory allocation failed, heap is locked" +msgstr "" + +#: py/objarray.c +msgid "memoryview: length is not a multiple of itemsize" +msgstr "" + +#: py/builtinimport.c +msgid "module not found" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + +#: py/compile.c +msgid "multiple *x in assignment" +msgstr "" + +#: py/objtype.c +msgid "multiple bases have instance lay-out conflict" +msgstr "" + +#: py/objtype.c +msgid "multiple inheritance not supported" +msgstr "" + +#: py/emitnative.c +msgid "must raise an object" +msgstr "" + +#: py/modbuiltins.c +msgid "must use keyword argument for key function" +msgstr "" + +#: py/runtime.c +msgid "name '%q' is not defined" +msgstr "" + +#: py/runtime.c +msgid "name not defined" +msgstr "" + +#: py/compile.c +msgid "name reused for argument" +msgstr "" + +#: py/emitnative.c +msgid "native yield" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "need more than %d values to unpack" +msgstr "" + +#: py/objint_longlong.c py/objint_mpz.c py/runtime.c +msgid "negative power with no float support" +msgstr "" + +#: py/objint_mpz.c py/runtime.c +msgid "negative shift count" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + +#: py/vm.c +msgid "no active exception to reraise" +msgstr "" + +#: shared-bindings/socket/__init__.c shared-module/network/__init__.c +msgid "no available NIC" +msgstr "" + +#: py/compile.c +msgid "no binding for nonlocal found" +msgstr "" + +#: shared-module/msgpack/__init__.c +msgid "no default packer" +msgstr "" + +#: py/builtinimport.c +msgid "no module named '%q'" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "no reset pin available" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + +#: py/runtime.c +msgid "no such attribute" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Connection.c +msgid "non-UUID found in service_uuids_whitelist" +msgstr "" + +#: py/compile.c +msgid "non-default argument follows default argument" +msgstr "" + +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after */**" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after keyword arg" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "non-zero timeout must be > 0.01" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "non-zero timeout must be >= interval" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "norm is defined for 1D and 2D arrays" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "not a 128-bit UUID" +msgstr "" + +#: py/objstr.c +msgid "not all arguments converted during string formatting" +msgstr "" + +#: py/objstr.c +msgid "not enough arguments for format string" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "number of points must be at least 2" +msgstr "" + +#: py/builtinhelp.c +msgid "object " +msgstr "" + +#: py/obj.c +msgid "object '%q' is not a tuple or list" +msgstr "" + +#: py/obj.c +msgid "object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "object does not support item deletion" +msgstr "" + +#: py/obj.c +msgid "object has no len" +msgstr "" + +#: py/obj.c +msgid "object is not subscriptable" +msgstr "" + +#: py/runtime.c +msgid "object not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "object not callable" +msgstr "" + +#: py/sequence.c shared-bindings/displayio/Group.c +msgid "object not in sequence" +msgstr "" + +#: py/runtime.c +msgid "object not iterable" +msgstr "" + +#: py/obj.c +msgid "object of type '%q' has no len()" +msgstr "" + +#: py/obj.c +msgid "object with buffer protocol required" +msgstr "" + +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "offset is too large" +msgstr "" + +#: shared-bindings/dualbank/__init__.c +msgid "offset must be >= 0" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "offset must be non-negative and no greater than buffer length" +msgstr "" + +#: py/objstr.c py/objstrunicode.c +msgid "offset out of bounds" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only bit_depth=16 is supported" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only sample_rate=16000 is supported" +msgstr "" + +#: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c +msgid "only slices with step=1 (aka None) are supported" +msgstr "" + +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is implemented for 1D Boolean arrays only" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + +#: py/modbuiltins.c +msgid "ord expects a character" +msgstr "" + +#: py/modbuiltins.c +#, c-format +msgid "ord() expected a character, but string of length %d found" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + +#: py/objint_mpz.c +msgid "overflow converting long int to machine word" +msgstr "" + +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + +#: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c +msgid "palette must be 32 bytes long" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "palette_index should be an int" +msgstr "" + +#: py/compile.c +msgid "parameter annotation must be an identifier" +msgstr "" + +#: py/emitinlinextensa.c +msgid "parameters must be registers in sequence a2 to a5" +msgstr "" + +#: py/emitinlinethumb.c +msgid "parameters must be registers in sequence r0 to r3" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel coordinates out of bounds" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel value requires too many bits" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" + +#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c +msgid "port must be >= 0" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() 3rd argument cannot be 0" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() with 3 arguments requires integers" +msgstr "" + +#: ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h +#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h +#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h +#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +msgid "pressing boot button at start up.\n" +msgstr "" + +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "pressing both buttons at start up.\n" +msgstr "" + +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "pull_threshold must be between 1 and 32" +msgstr "" + +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +msgid "push_threshold must be between 1 and 32" +msgstr "" + +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "" + +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + +#: extmod/ulab/code/fft/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + +#: py/builtinimport.c +msgid "relative import" +msgstr "" + +#: py/obj.c +#, c-format +msgid "requested length %d but object has length %d" +msgstr "" + +#: extmod/ulab/code/ndarray_operators.c +msgid "results cannot be cast to specified type" +msgstr "" + +#: py/compile.c +msgid "return annotation must be an identifier" +msgstr "" + +#: py/emitnative.c +msgid "return expected '%q' but got '%q'" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "roll argument must be an ndarray" +msgstr "" + +#: py/objstr.c +msgid "rsplit(None,n)" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "" +"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " +"'B'" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c +msgid "sampling rate out of range" +msgstr "" + +#: py/modmicropython.c +msgid "schedule stack full" +msgstr "" + +#: lib/utils/pyexec.c py/builtinimport.c +msgid "script compilation not supported" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "shape must be a tuple" +msgstr "" + +#: shared-module/msgpack/__init__.c +msgid "short read" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed in string format specifier" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed with integer format specifier 'c'" +msgstr "" + +#: py/objstr.c +msgid "single '}' encountered in format string" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "sleep length must be non-negative" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + +#: py/objslice.c py/sequence.c +msgid "slice step cannot be zero" +msgstr "" + +#: py/objint.c py/sequence.c +msgid "small int overflow" +msgstr "" + +#: main.c +msgid "soft reboot\n" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + +#: py/objstr.c +msgid "start/end indices" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "start_x should be an int" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "step must be non-zero" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "stop must be 1 or 2" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "stop not reachable from start" +msgstr "" + +#: py/stream.c +msgid "stream operation not supported" +msgstr "" + +#: py/objstrunicode.c +msgid "string indices must be integers, not %q" +msgstr "" + +#: py/stream.c +msgid "string not supported; use bytes or bytearray" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "" + +#: py/objarray.c py/objstr.c +msgid "substring not found" +msgstr "" + +#: py/compile.c +msgid "super() can't find self" +msgstr "" + +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "" + +#: extmod/moductypes.c +msgid "syntax error in uctypes descriptor" +msgstr "" + +#: shared-bindings/touchio/TouchIn.c +msgid "threshold must be in the range 0-65536" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "tile must be greater than zero" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "time.struct_time() takes a 9-sequence" +msgstr "" + +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "timeout must be 0.0-100.0 seconds" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "timeout must be < 655.35 secs" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "timeout must be >= 0.0" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "timestamp out of range for platform time_t" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "tobytes can be invoked for dense arrays only" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "too many arguments provided with the given format" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "too many values to unpack (expected %d)" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: ports/esp32s2/common-hal/alarm/pin/__init__.c +msgid "trigger level must be 0 or 1" +msgstr "" + +#: py/obj.c +msgid "tuple/list has wrong length" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c +msgid "tx and rx cannot both be None" +msgstr "" + +#: py/objtype.c +msgid "type '%q' is not an acceptable base type" +msgstr "" + +#: py/objtype.c +msgid "type is not an acceptable base type" +msgstr "" + +#: py/runtime.c +msgid "type object '%q' has no attribute '%q'" +msgstr "" + +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + +#: py/objtype.c +msgid "type takes 1 or 3 arguments" +msgstr "" + +#: py/objint_longlong.c +msgid "ulonglong too large" +msgstr "" + +#: py/emitnative.c +msgid "unary op %q not implemented" +msgstr "" + +#: py/parse.c +msgid "unexpected indent" +msgstr "" + +#: py/bc.c +msgid "unexpected keyword argument" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "unexpected keyword argument '%q'" +msgstr "" + +#: py/lexer.c +msgid "unicode name escapes" +msgstr "" + +#: py/parse.c +msgid "unindent does not match any outer indentation level" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown conversion specifier %c" +msgstr "" + +#: py/objstr.c +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" + +#: py/compile.c +msgid "unknown type" +msgstr "" + +#: py/emitnative.c +msgid "unknown type '%q'" +msgstr "" + +#: py/objstr.c +msgid "unmatched '{' in format" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "unreadable attribute" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c +msgid "unsupported %q type" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "unsupported Thumb instruction '%s' with %d arguments" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "unsupported Xtensa instruction '%s' with %d arguments" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unsupported format character '%c' (0x%x) at index %d" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for %q: '%q'" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for operator" +msgstr "" + +#: py/runtime.c +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" + +#: py/objint.c +#, c-format +msgid "value must fit in %d byte(s)" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "value_count must be > 0" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + +#: ports/esp32s2/common-hal/alarm/pin/__init__.c +msgid "wakeup conflict" +msgstr "" + +#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +msgid "watchdog not initialized" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + +#: shared-bindings/bitops/__init__.c +#, c-format +msgid "width must be from 2 to 8 (inclusive), not %d" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "wifi is not enabled" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "window must be <= interval" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "wrong axis index" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "wrong axis specified" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "wrong input type" +msgstr "" + +#: extmod/ulab/code/ulab_create.c py/objstr.c +msgid "wrong number of arguments" +msgstr "" + +#: py/runtime.c +msgid "wrong number of values to unpack" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "wrong output type" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "x value out of bounds" +msgstr "" + +#: ports/esp32s2/common-hal/audiobusio/__init__.c +msgid "xTaskCreate failed" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "y should be an int" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "y value out of bounds" +msgstr "" + +#: py/objrange.c +msgid "zero step" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" From 347d0fcb491f24e93200581c785a50afaadcaffb Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 28 Feb 2021 17:42:34 +0100 Subject: [PATCH 139/159] Deleted translation using Weblate (Abkhazian) --- locale/ab.po | 4227 -------------------------------------------------- 1 file changed, 4227 deletions(-) delete mode 100644 locale/ab.po diff --git a/locale/ab.po b/locale/ab.po deleted file mode 100644 index f266062662..0000000000 --- a/locale/ab.po +++ /dev/null @@ -1,4227 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" -"Language: ab\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: main.c -msgid "" -"\n" -"Code done running.\n" -msgstr "" - -#: main.c -msgid "" -"\n" -"Code stopped by auto-reload.\n" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"Please file an issue with the contents of your CIRCUITPY drive at \n" -"https://github.com/adafruit/circuitpython/issues\n" -msgstr "" - -#: py/obj.c -msgid " File \"%q\"" -msgstr "" - -#: py/obj.c -msgid " File \"%q\", line %d" -msgstr "" - -#: py/builtinhelp.c -msgid " is of type %q\n" -msgstr "" - -#: main.c -msgid " output:\n" -msgstr "" - -#: py/objstr.c -#, c-format -msgid "%%c requires int or char" -msgstr "" - -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "" -"%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" -msgstr "" - -#: ports/atmel-samd/common-hal/sdioio/SDCard.c -msgid "%q failure: %d" -msgstr "" - -#: shared-bindings/microcontroller/Pin.c -msgid "%q in use" -msgstr "" - -#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c -msgid "%q index out of range" -msgstr "" - -#: py/obj.c -msgid "%q indices must be integers, not %q" -msgstr "" - -#: shared-bindings/vectorio/Polygon.c -msgid "%q list must be a list" -msgstr "" - -#: shared-bindings/memorymonitor/AllocationAlarm.c -msgid "%q must be >= 0" -msgstr "" - -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c -#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c -msgid "%q must be >= 1" -msgstr "" - -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#: shared-bindings/canio/Match.c -msgid "%q out of range" -msgstr "" - -#: ports/atmel-samd/common-hal/microcontroller/Pin.c -msgid "%q pin invalid" -msgstr "" - -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "" - -#: py/bc.c py/objnamedtuple.c -msgid "%q() takes %d positional arguments but %d were given" -msgstr "" - -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c -#, c-format -msgid "%s error 0x%x" -msgstr "" - -#: py/argcheck.c -msgid "'%q' argument required" -msgstr "" - -#: py/runtime.c -msgid "'%q' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%q' object does not support '%q'" -msgstr "" - -#: py/obj.c -msgid "'%q' object does not support item assignment" -msgstr "" - -#: py/obj.c -msgid "'%q' object does not support item deletion" -msgstr "" - -#: py/runtime.c -msgid "'%q' object has no attribute '%q'" -msgstr "" - -#: py/runtime.c -msgid "'%q' object is not an iterator" -msgstr "" - -#: py/objtype.c py/runtime.c -msgid "'%q' object is not callable" -msgstr "" - -#: py/runtime.c -msgid "'%q' object is not iterable" -msgstr "" - -#: py/obj.c -msgid "'%q' object is not subscriptable" -msgstr "" - -#: py/emitinlinethumb.c py/emitinlinextensa.c -#, c-format -msgid "'%s' expects a label" -msgstr "" - -#: py/emitinlinethumb.c py/emitinlinextensa.c -#, c-format -msgid "'%s' expects a register" -msgstr "" - -#: py/emitinlinethumb.c -#, c-format -msgid "'%s' expects a special register" -msgstr "" - -#: py/emitinlinethumb.c -#, c-format -msgid "'%s' expects an FPU register" -msgstr "" - -#: py/emitinlinethumb.c -#, c-format -msgid "'%s' expects an address of the form [a, b]" -msgstr "" - -#: py/emitinlinethumb.c py/emitinlinextensa.c -#, c-format -msgid "'%s' expects an integer" -msgstr "" - -#: py/emitinlinethumb.c -#, c-format -msgid "'%s' expects at most r%d" -msgstr "" - -#: py/emitinlinethumb.c -#, c-format -msgid "'%s' expects {r0, r1, ...}" -msgstr "" - -#: py/emitinlinextensa.c -#, c-format -msgid "'%s' integer %d is not within range %d..%d" -msgstr "" - -#: py/emitinlinethumb.c -#, c-format -msgid "'%s' integer 0x%x does not fit in mask 0x%x" -msgstr "" - -#: py/objstr.c -msgid "'=' alignment not allowed in string format specifier" -msgstr "" - -#: shared-module/struct/__init__.c -msgid "'S' and 'O' are not supported format types" -msgstr "" - -#: py/compile.c -msgid "'align' requires 1 argument" -msgstr "" - -#: py/compile.c -msgid "'await' outside function" -msgstr "" - -#: py/compile.c -msgid "'await', 'async for' or 'async with' outside async function" -msgstr "" - -#: py/compile.c -msgid "'break' outside loop" -msgstr "" - -#: py/compile.c -msgid "'continue' outside loop" -msgstr "" - -#: py/objgenerator.c -msgid "'coroutine' object is not an iterator" -msgstr "" - -#: py/compile.c -msgid "'data' requires at least 2 arguments" -msgstr "" - -#: py/compile.c -msgid "'data' requires integer arguments" -msgstr "" - -#: py/compile.c -msgid "'label' requires 1 argument" -msgstr "" - -#: py/compile.c -msgid "'return' outside function" -msgstr "" - -#: py/compile.c -msgid "'yield from' inside async function" -msgstr "" - -#: py/compile.c -msgid "'yield' outside function" -msgstr "" - -#: py/compile.c -msgid "*x must be assignment target" -msgstr "" - -#: py/obj.c -msgid ", in %q\n" -msgstr "" - -#: py/objcomplex.c -msgid "0.0 to a complex power" -msgstr "" - -#: py/modbuiltins.c -msgid "3-arg pow() not supported" -msgstr "" - -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - -#: ports/atmel-samd/common-hal/countio/Counter.c -#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c -msgid "A hardware interrupt channel is already in use" -msgstr "" - -#: ports/esp32s2/common-hal/analogio/AnalogIn.c -msgid "ADC2 is being used by WiFi" -msgstr "" - -#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c -#, c-format -msgid "Address must be %d bytes long" -msgstr "" - -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "" - -#: ports/esp32s2/common-hal/canio/CAN.c -msgid "All CAN peripherals are in use" -msgstr "" - -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c -msgid "All I2C peripherals are in use" -msgstr "" - -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c -msgid "All PCNT units in use" -msgstr "" - -#: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c -#: ports/stm/common-hal/canio/Listener.c -msgid "All RX FIFOs in use" -msgstr "" - -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c -msgid "All SPI peripherals are in use" -msgstr "" - -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "All UART peripherals are in use" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "All event channels in use" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "All state machines in use" -msgstr "" - -#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c -msgid "All sync event channels in use" -msgstr "" - -#: shared-bindings/pwmio/PWMOut.c -msgid "All timers for this pin are in use" -msgstr "" - -#: ports/atmel-samd/common-hal/_pew/PewPew.c -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c -#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c -msgid "All timers in use" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Already advertising." -msgstr "" - -#: ports/atmel-samd/common-hal/canio/Listener.c -msgid "Already have all-matches listener" -msgstr "" - -#: shared-module/memorymonitor/AllocationAlarm.c -#: shared-module/memorymonitor/AllocationSize.c -msgid "Already running" -msgstr "" - -#: ports/esp32s2/common-hal/wifi/Radio.c -msgid "Already scanning for wifi networks" -msgstr "" - -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -msgid "Another send is already active" -msgstr "" - -#: shared-bindings/pulseio/PulseOut.c -msgid "Array must contain halfwords (type 'H')" -msgstr "" - -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Array values should be single bytes." -msgstr "" - -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "" - -#: shared-module/memorymonitor/AllocationAlarm.c -#, c-format -msgid "Attempt to allocate %d blocks" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running." -msgstr "" - -#: shared-bindings/wifi/Radio.c -msgid "Authentication failure" -msgstr "" - -#: main.c -msgid "Auto-reload is off.\n" -msgstr "" - -#: main.c -msgid "" -"Auto-reload is on. Simply save files over USB to run them or enter REPL to " -"disable.\n" -msgstr "" - -#: ports/esp32s2/common-hal/canio/CAN.c -msgid "Baudrate not supported by peripheral" -msgstr "" - -#: shared-module/displayio/Display.c -#: shared-module/framebufferio/FramebufferDisplay.c -msgid "Below minimum frame rate" -msgstr "" - -#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c -msgid "Bit clock and word select must be sequential pins" -msgstr "" - -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -msgid "Bit clock and word select must share a clock unit" -msgstr "" - -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - -#: shared-bindings/audiobusio/PDMIn.c -msgid "Bit depth must be multiple of 8." -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "Both RX and TX required for flow control" -msgstr "" - -#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c -msgid "Both pins must support hardware interrupts" -msgstr "" - -#: shared-bindings/displayio/Display.c -#: shared-bindings/framebufferio/FramebufferDisplay.c -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "Brightness must be 0-1.0" -msgstr "" - -#: shared-bindings/supervisor/__init__.c -msgid "Brightness must be between 0 and 255" -msgstr "" - -#: shared-bindings/displayio/Display.c -#: shared-bindings/framebufferio/FramebufferDisplay.c -msgid "Brightness not adjustable" -msgstr "" - -#: shared-bindings/_bleio/UUID.c -#, c-format -msgid "Buffer + offset too small %d %d %d" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Buffer elements must be 4 bytes long or less" -msgstr "" - -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" - -#: shared-bindings/displayio/Display.c -#: shared-bindings/framebufferio/FramebufferDisplay.c -msgid "Buffer is not a bytearray." -msgstr "" - -#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c -#: shared-bindings/framebufferio/FramebufferDisplay.c -msgid "Buffer is too small" -msgstr "" - -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#, c-format -msgid "Buffer length %d too big. It must be less than %d" -msgstr "" - -#: ports/atmel-samd/common-hal/sdioio/SDCard.c -#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c -msgid "Buffer length must be a multiple of 512" -msgstr "" - -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Buffer must be a multiple of 512 bytes" -msgstr "" - -#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "" - -#: ports/nrf/common-hal/_bleio/PacketBuffer.c -msgid "Buffer too large and unable to allocate" -msgstr "" - -#: shared-bindings/_bleio/PacketBuffer.c -#, c-format -msgid "Buffer too short by %d bytes" -msgstr "" - -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#, c-format -msgid "Bus pin %d is already in use" -msgstr "" - -#: shared-bindings/_bleio/UUID.c -msgid "Byte buffer must be 16 bytes." -msgstr "" - -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "" - -#: shared-bindings/aesio/aes.c -msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" - -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c -msgid "CRC or checksum was invalid" -msgstr "" - -#: py/objtype.c -msgid "Call super().__init__() before accessing native object." -msgstr "" - -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c -msgid "Can only alarm on RTC IO from deep sleep." -msgstr "" - -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c -msgid "Can only alarm on one low pin while others alarm high from deep sleep." -msgstr "" - -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c -msgid "Can only alarm on two low pins from deep sleep." -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -msgid "Can't set CCCD on local Characteristic" -msgstr "" - -#: shared-bindings/_bleio/Adapter.c -msgid "Cannot create a new Adapter; use _bleio.adapter;" -msgstr "" - -#: shared-bindings/displayio/Bitmap.c -#: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c -msgid "Cannot delete values" -msgstr "" - -#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c -#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c -#: ports/nrf/common-hal/digitalio/DigitalInOut.c -#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c -msgid "Cannot get pull while in output mode" -msgstr "" - -#: ports/nrf/common-hal/microcontroller/Processor.c -msgid "Cannot get temperature" -msgstr "" - -#: shared-bindings/_bleio/Adapter.c -msgid "Cannot have scan responses for extended, connectable advertisements." -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "" - -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot pull on input-only pin." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "" - -#: shared-bindings/audiobusio/PDMIn.c -msgid "Cannot record to a file" -msgstr "" - -#: shared-module/storage/__init__.c -msgid "Cannot remount '/' when USB is active." -msgstr "" - -#: ports/atmel-samd/common-hal/microcontroller/__init__.c -#: ports/cxd56/common-hal/microcontroller/__init__.c -#: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "" - -#: ports/esp32s2/common-hal/socketpool/Socket.c -msgid "Cannot set socket options" -msgstr "" - -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Cannot set value when direction is input." -msgstr "" - -#: ports/esp32s2/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" - -#: py/objslice.c -msgid "Cannot subclass slice" -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "" - -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" - -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "" - -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "CharacteristicBuffer writing not provided" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "" -"CircuitPython is in safe mode because you pressed the reset button during " -"boot. Press again to exit safe mode.\n" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "CircuitPython was unable to allocate the heap.\n" -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "" - -#: shared-module/bitbangio/I2C.c -msgid "Clock stretch too long" -msgstr "" - -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -msgid "Clock unit in use" -msgstr "" - -#: shared-bindings/_pew/PewPew.c -msgid "Column entry must be digitalio.DigitalInOut" -msgstr "" - -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "" - -#: shared-bindings/_bleio/Connection.c -msgid "" -"Connection has been disconnected and can no longer be used. Create a new " -"connection." -msgstr "" - -#: py/persistentcode.c -msgid "Corrupt .mpy file" -msgstr "" - -#: py/emitglue.c -msgid "Corrupt raw code" -msgstr "" - -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "" - -#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not initialize channel" -msgstr "" - -#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not initialize timer" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -msgid "Could not retrieve clock" -msgstr "" - -#: shared-bindings/_bleio/Adapter.c -msgid "Could not set address" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not start PWM" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate decoder" -msgstr "" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler." -msgstr "" - -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "" - -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "DAC already in use" -msgstr "" - -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -msgid "Data 0 pin must be byte aligned" -msgstr "" - -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -msgid "Data 0 pin must be byte aligned." -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Data chunk must follow fmt chunk" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Data too large for advertisement packet" -msgstr "" - -#: shared-bindings/audiobusio/PDMIn.c -msgid "Destination capacity is smaller than destination_length." -msgstr "" - -#: ports/nrf/common-hal/audiobusio/I2SOut.c -msgid "Device in use" -msgstr "" - -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "" - -#: shared-bindings/displayio/Display.c -#: shared-bindings/framebufferio/FramebufferDisplay.c -msgid "Display must have a 16 bit colorspace." -msgstr "" - -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c -#: shared-bindings/framebufferio/FramebufferDisplay.c -msgid "Display rotation must be in 90 degree increments" -msgstr "" - -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Drive mode not used when direction is input." -msgstr "" - -#: shared-bindings/aesio/aes.c -msgid "ECB only operates on 16 bytes at a time" -msgstr "" - -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c -msgid "ESP-IDF memory allocation failed" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -msgid "EXTINT channel already in use" -msgstr "" - -#: extmod/modure.c -msgid "Error in regex" -msgstr "" - -#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c -msgid "Error: Failure to bind" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c -#: shared-bindings/terminalio/Terminal.c -msgid "Expected a %q" -msgstr "" - -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c -msgid "Expected a Characteristic" -msgstr "" - -#: shared-bindings/_bleio/Adapter.c -msgid "Expected a DigitalInOut" -msgstr "" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Expected a Service" -msgstr "" - -#: shared-bindings/_bleio/Adapter.c -msgid "Expected a UART" -msgstr "" - -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -#: shared-bindings/_bleio/Service.c -msgid "Expected a UUID" -msgstr "" - -#: shared-bindings/_bleio/Adapter.c -msgid "Expected an Address" -msgstr "" - -#: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "" - -#: shared-module/_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Extended advertisements with scan response not supported." -msgstr "" - -#: extmod/ulab/code/fft/fft.c -msgid "FFT is defined for ndarrays only" -msgstr "" - -#: extmod/ulab/code/fft/fft.c -msgid "FFT is implemented for linear arrays only" -msgstr "" - -#: ports/esp32s2/common-hal/ssl/SSLSocket.c -msgid "Failed SSL handshake" -msgstr "" - -#: shared-bindings/ps2io/Ps2.c -msgid "Failed sending command." -msgstr "" - -#: ports/nrf/sd_mutex.c -#, c-format -msgid "Failed to acquire mutex, err 0x%04x" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "" - -#: ports/esp32s2/common-hal/wifi/__init__.c -msgid "Failed to allocate Wifi memory" -msgstr "" - -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c -msgid "Failed to allocate wifi scan memory" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to connect: internal error" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to connect: timeout" -msgstr "" - -#: ports/esp32s2/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Failed to parse MP3 file" -msgstr "" - -#: ports/nrf/sd_mutex.c -#, c-format -msgid "Failed to release mutex, err 0x%04x" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "Failed to write internal flash." -msgstr "" - -#: py/moduerrno.c -msgid "File exists" -msgstr "" - -#: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c -#: ports/stm/common-hal/canio/Listener.c -msgid "Filters too complex" -msgstr "" - -#: ports/esp32s2/common-hal/dualbank/__init__.c -msgid "Firmware image is invalid" -msgstr "" - -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Format not supported" -msgstr "" - -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "" - -#: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c -#: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c -msgid "Function requires lock" -msgstr "" - -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c -msgid "Generic Failure" -msgstr "" - -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c -#: shared-bindings/framebufferio/FramebufferDisplay.c -msgid "Group already used" -msgstr "" - -#: shared-module/displayio/Group.c -msgid "Group full" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Hardware busy, try alternative pins" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "" - -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "" - -#: extmod/vfs_posix_file.c py/objstringio.c -msgid "I/O operation on closed file" -msgstr "" - -#: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" - -#: ports/raspberrypi/common-hal/busio/I2C.c -msgid "I2C peripheral in use" -msgstr "" - -#: shared-bindings/audiobusio/I2SOut.c -msgid "I2SOut not available" -msgstr "" - -#: ports/esp32s2/common-hal/alarm/pin/__init__.c -msgid "IOs 0, 2 & 4 do not support internal pullup in sleep" -msgstr "" - -#: shared-bindings/aesio/aes.c -#, c-format -msgid "IV must be %d bytes long" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "In buffer elements must be 4 bytes long or less" -msgstr "" - -#: py/persistentcode.c -msgid "" -"Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" -"mpy-update for more info." -msgstr "" - -#: shared-bindings/_pew/PewPew.c -msgid "Incorrect buffer size" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Init program size invalid" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin state conflicts with initial out pin state" -msgstr "" - -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c -msgid "Initialization failed due to lack of memory" -msgstr "" - -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "Input taking too long" -msgstr "" - -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c -msgid "Input/output error" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Instruction %d jumps on pin" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Instruction %d shifts in more bits than pin count" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Instruction %d shifts out more bits than pin count" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Instruction %d uses extra pin" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Instruction %d waits on input outside of count" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -msgid "Insufficient authentication" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -msgid "Insufficient encryption" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "" - -#: shared-module/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Internal error #%d" -msgstr "" - -#: shared-bindings/sdioio/SDCard.c -msgid "Invalid %q" -msgstr "" - -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -msgid "Invalid %q pin" -msgstr "" - -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "" - -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "" - -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "" - -#: shared-bindings/wifi/Radio.c -msgid "Invalid BSSID" -msgstr "" - -#: ports/esp32s2/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "" - -#: ports/esp32s2/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c -#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid argument" -msgstr "" - -#: shared-module/displayio/Bitmap.c -msgid "Invalid bits per value" -msgstr "" - -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "" - -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "" - -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid format chunk size" -msgstr "" - -#: ports/esp32s2/common-hal/pwmio/PWMOut.c -msgid "Invalid frequency" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "Invalid memory access." -msgstr "" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Invalid pins" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "" - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "" - -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c -msgid "Invalid size" -msgstr "" - -#: ports/esp32s2/common-hal/ssl/SSLContext.c -msgid "Invalid socket for TLS" -msgstr "" - -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c -msgid "Invalid state" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - -#: shared-bindings/aesio/aes.c -msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" - -#: py/compile.c -msgid "LHS of keyword arg must be an id" -msgstr "" - -#: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "" - -#: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "" - -#: py/objslice.c -msgid "Length must be an int" -msgstr "" - -#: py/objslice.c -msgid "Length must be non-negative" -msgstr "" - -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c -msgid "MAC address was invalid" -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "" - -#: shared-module/displayio/Shape.c -#, c-format -msgid "Maximum x value when mirrored is %d" -msgstr "" - -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption." -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error." -msgstr "" - -#: shared-bindings/audiobusio/PDMIn.c -msgid "Microphone startup delay must be in range 0.0 to 1.0" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing first_in_pin. Instruction %d reads pin(s)" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing first_in_pin. Instruction %d waits based on pin" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing first_out_pin. Instruction %d writes pin(s)" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing first_set_pin. Instruction %d sets pin(s)" -msgstr "" - -#: shared-bindings/displayio/Group.c -msgid "Must be a %q subclass." -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "" - -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" - -#: ports/esp32s2/common-hal/nvm/ByteArray.c -msgid "NVS Error" -msgstr "" - -#: py/parse.c -msgid "Name too long" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -msgid "No CCCD for this Characteristic" -msgstr "" - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "No DAC on chip" -msgstr "" - -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c -#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c -msgid "No DMA channel found" -msgstr "" - -#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c -msgid "No DMA pacing timer found" -msgstr "" - -#: shared-module/adafruit_bus_device/I2CDevice.c -#, c-format -msgid "No I2C device at address: %x" -msgstr "" - -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "" - -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "No RX pin" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "No TX pin" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -msgid "No available clocks" -msgstr "" - -#: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: length cannot be determined" -msgstr "" - -#: shared-bindings/board/__init__.c -msgid "No default %q bus" -msgstr "" - -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -msgid "No free GCLKs" -msgstr "" - -#: shared-bindings/os/__init__.c -msgid "No hardware random available" -msgstr "" - -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "No in in program" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "No in or out in program" -msgstr "" - -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - -#: shared-bindings/time/__init__.c -msgid "No long integer support" -msgstr "" - -#: ports/esp32s2/common-hal/pwmio/PWMOut.c -msgid "No more channels available" -msgstr "" - -#: ports/esp32s2/common-hal/pwmio/PWMOut.c -msgid "No more timers available" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "" - -#: shared-bindings/wifi/Radio.c -msgid "No network with that ssid" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "No out in program" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -msgid "No pull up found on SDA or SCL; check your wiring" -msgstr "" - -#: shared-module/touchio/TouchIn.c -msgid "No pulldown on pin; 1Mohm recommended" -msgstr "" - -#: py/moduerrno.c -msgid "No space left on device" -msgstr "" - -#: py/moduerrno.c -msgid "No such file/directory" -msgstr "" - -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "No timer available" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "Nordic Soft Device failure assertion." -msgstr "" - -#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c -msgid "Not a valid IP string" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "Not connected" -msgstr "" - -#: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c -#: shared-bindings/audiopwmio/PWMAudioOut.c -msgid "Not playing" -msgstr "" - -#: main.c -msgid "Not running saved code.\n" -msgstr "" - -#: shared-bindings/_bleio/__init__.c -msgid "Not settable" -msgstr "" - -#: shared-bindings/util.c -msgid "" -"Object has been deinitialized and can no longer be used. Create a new object." -msgstr "" - -#: ports/nrf/common-hal/busio/UART.c -msgid "Odd parity is not supported" -msgstr "" - -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c -msgid "Only 8 or 16 bit mono with " -msgstr "" - -#: ports/esp32s2/common-hal/wifi/__init__.c -msgid "Only IPv4 addresses supported" -msgstr "" - -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Only IPv4 sockets supported" -msgstr "" - -#: shared-module/displayio/OnDiskBitmap.c -#, c-format -msgid "" -"Only Windows format, uncompressed BMP supported: given header size is %d" -msgstr "" - -#: shared-module/displayio/OnDiskBitmap.c -#, c-format -msgid "" -"Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " -"%d bpp given" -msgstr "" - -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "Only one TouchAlarm can be set in deep sleep." -msgstr "" - -#: ports/esp32s2/common-hal/alarm/time/TimeAlarm.c -msgid "Only one alarm.time alarm can be set." -msgstr "" - -#: shared-module/displayio/ColorConverter.c -msgid "Only one color can be transparent at a time" -msgstr "" - -#: shared-bindings/ipaddress/__init__.c -msgid "Only raw int supported for ip" -msgstr "" - -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c -msgid "Operation or feature not supported" -msgstr "" - -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c -msgid "Operation timed out" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Out buffer elements must be 4 bytes long or less" -msgstr "" - -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c -msgid "Out of memory" -msgstr "" - -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "Out of sockets" -msgstr "" - -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - -#: shared-bindings/audiobusio/PDMIn.c -msgid "Oversample must be multiple of 8." -msgstr "" - -#: shared-bindings/audiobusio/PDMIn.c -msgid "PDMIn not available" -msgstr "" - -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" - -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." -msgstr "" - -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c -msgid "Peripheral in use" -msgstr "" - -#: py/moduerrno.c -msgid "Permission denied" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Pin count too large" -msgstr "" - -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "" - -#: shared-bindings/adafruit_bus_device/SPIDevice.c -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Pin is input only" -msgstr "" - -#: ports/atmel-samd/common-hal/countio/Counter.c -msgid "Pin must support hardware interrupts" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "" -"Pinout uses %d bytes per element, which consumes more than the ideal %d " -"bytes. If this cannot be avoided, pass allow_inefficient=True to the " -"constructor" -msgstr "" - -#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c -msgid "Pins must share PWM slice" -msgstr "" - -#: py/builtinhelp.c -msgid "Plus any modules on the filesystem\n" -msgstr "" - -#: shared-module/vectorio/Polygon.c -msgid "Polygon needs at least 3 points" -msgstr "" - -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" - -#: shared-bindings/_bleio/Adapter.c -msgid "Prefix buffer must be on the heap" -msgstr "" - -#: main.c -msgid "Press any key to enter the REPL. Use CTRL-D to reload.\n" -msgstr "" - -#: main.c -msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Program does IN without loading ISR" -msgstr "" - -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Program does OUT without loading OSR" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program size invalid" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Pull not used when direction is output." -msgstr "" - -#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c -msgid "RAISE mode is not implemented" -msgstr "" - -#: ports/stm/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "" - -#: ports/stm/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "" - -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "" - -#: ports/esp32s2/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "RS485 inversion specified when not in RS485 mode" -msgstr "" - -#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - -#: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c -msgid "RTC is not supported on this board" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" - -#: ports/stm/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "" - -#: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c -msgid "Read-only" -msgstr "" - -#: extmod/vfs_fat.c py/moduerrno.c -msgid "Read-only filesystem" -msgstr "" - -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "" - -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c -msgid "Received response was invalid" -msgstr "" - -#: shared-bindings/displayio/EPaperDisplay.c -msgid "Refresh too soon" -msgstr "" - -#: shared-bindings/canio/RemoteTransmissionRequest.c -msgid "RemoteTransmissionRequests limited to 8 bytes" -msgstr "" - -#: shared-bindings/aesio/aes.c -msgid "Requested AES mode is unsupported" -msgstr "" - -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c -msgid "Requested resource not found" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Right channel unsupported" -msgstr "" - -#: shared-bindings/_pew/PewPew.c -msgid "Row entry must be digitalio.DigitalInOut" -msgstr "" - -#: main.c -msgid "Running in safe mode! " -msgstr "" - -#: shared-module/sdcardio/SDCard.c -msgid "SD card CSD format not supported" -msgstr "" - -#: ports/stm/common-hal/sdioio/SDCard.c -#, c-format -msgid "SDIO GetCardInfo Error %d" -msgstr "" - -#: ports/stm/common-hal/sdioio/SDCard.c -#, c-format -msgid "SDIO Init Error %d" -msgstr "" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - -#: ports/raspberrypi/common-hal/busio/SPI.c -msgid "SPI peripheral in use" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "Selected CTS pin not valid" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "Selected RTS pin not valid" -msgstr "" - -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -msgid "Serializer in use" -msgstr "" - -#: shared-bindings/ssl/SSLContext.c -msgid "Server side context cannot have hostname" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Size not supported" -msgstr "" - -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Slice and value different lengths." -msgstr "" - -#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c -#: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c -msgid "Slices not supported" -msgstr "" - -#: ports/esp32s2/common-hal/socketpool/SocketPool.c -msgid "SocketPool can only be used with wifi.radio" -msgstr "" - -#: shared-bindings/aesio/aes.c -msgid "Source and destination buffers must be the same length" -msgstr "" - -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "" - -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - -#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c -msgid "Stereo left must be on PWM channel A" -msgstr "" - -#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c -msgid "Stereo right must be on PWM channel B" -msgstr "" - -#: shared-bindings/multiterminal/__init__.c -msgid "Stream missing readinto() or write() method." -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "" - -#: shared-bindings/alarm/time/TimeAlarm.c -msgid "Supply one of monotonic_time or epoch_time" -msgstr "" - -#: shared-bindings/gnss/GNSS.c -msgid "System entry must be gnss.SatelliteSystem" -msgstr "" - -#: ports/stm/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "" -"The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase the stack size if you know how, or if not:" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "" -"The `microcontroller` module was used to boot into safe mode. Press reset to " -"exit safe mode.\n" -msgstr "" - -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "" -"The microcontroller's power dipped. Make sure your power supply provides\n" -"enough power for the whole circuit and press reset (after ejecting " -"CIRCUITPY).\n" -msgstr "" - -#: shared-module/audiomixer/MixerVoice.c -msgid "The sample's bits_per_sample does not match the mixer's" -msgstr "" - -#: shared-module/audiomixer/MixerVoice.c -msgid "The sample's channel count does not match the mixer's" -msgstr "" - -#: shared-module/audiomixer/MixerVoice.c -msgid "The sample's sample rate does not match the mixer's" -msgstr "" - -#: shared-module/audiomixer/MixerVoice.c -msgid "The sample's signedness does not match the mixer's" -msgstr "" - -#: shared-bindings/displayio/TileGrid.c -msgid "Tile height must exactly divide bitmap height" -msgstr "" - -#: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c -msgid "Tile index out of bounds" -msgstr "" - -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "" - -#: shared-bindings/displayio/TileGrid.c -msgid "Tile width must exactly divide bitmap width" -msgstr "" - -#: shared-bindings/alarm/time/TimeAlarm.c -msgid "Time is in the past." -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Timeout is too long: Maximum timeout length is %d seconds" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "" -"Timer was reserved for internal use - declare PWM pins earlier in the program" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "" - -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c -msgid "Too many channels in sample." -msgstr "" - -#: shared-module/displayio/__init__.c -msgid "Too many display busses" -msgstr "" - -#: shared-module/displayio/__init__.c -msgid "Too many displays" -msgstr "" - -#: ports/nrf/common-hal/_bleio/PacketBuffer.c -msgid "Total data to write is larger than outgoing_packet_length" -msgstr "" - -#: py/obj.c -msgid "Traceback (most recent call last):\n" -msgstr "" - -#: shared-bindings/time/__init__.c -msgid "Tuple or struct_time argument required" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "" - -#: shared-module/usb_hid/Device.c -msgid "USB Busy" -msgstr "" - -#: shared-module/usb_hid/Device.c -msgid "USB Error" -msgstr "" - -#: shared-bindings/_bleio/UUID.c -msgid "UUID integer value must be 0-0xffff" -msgstr "" - -#: shared-bindings/_bleio/UUID.c -msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "" - -#: shared-bindings/_bleio/UUID.c -msgid "UUID value is not str, int or byte buffer" -msgstr "" - -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c -#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c -msgid "Unable to allocate buffers for signed conversion" -msgstr "" - -#: ports/esp32s2/common-hal/busio/I2C.c -msgid "Unable to create lock" -msgstr "" - -#: shared-module/displayio/I2CDisplay.c -#, c-format -msgid "Unable to find I2C Display at %x" -msgstr "" - -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -msgid "Unable to find free GCLK" -msgstr "" - -#: py/parse.c -msgid "Unable to init parser" -msgstr "" - -#: shared-module/displayio/OnDiskBitmap.c -msgid "Unable to read color palette data" -msgstr "" - -#: shared-bindings/nvm/ByteArray.c -msgid "Unable to write to nvm." -msgstr "" - -#: shared-bindings/alarm/SleepMemory.c -msgid "Unable to write to sleep_memory." -msgstr "" - -#: ports/nrf/common-hal/_bleio/UUID.c -msgid "Unexpected nrfx uuid type" -msgstr "" - -#: ports/esp32s2/common-hal/ssl/SSLSocket.c -#, c-format -msgid "Unhandled ESP TLS error %d %d %x %d" -msgstr "" - -#: shared-bindings/wifi/Radio.c -#, c-format -msgid "Unknown failure %d" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Unknown gatt error: 0x%04x" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "Unknown reason." -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Unknown security error: 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Unknown soft device error: %04x" -msgstr "" - -#: shared-bindings/_pixelbuf/PixelBuf.c -#, c-format -msgid "Unmatched number of items on RHS (expected %d, got %d)." -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -msgid "" -"Unspecified issue. Can be that the pairing prompt on the other device was " -"declined or ignored." -msgstr "" - -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - -#: shared-module/displayio/display_core.c -msgid "Unsupported display bus type" -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Unsupported format" -msgstr "" - -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Unsupported pull value." -msgstr "" - -#: ports/esp32s2/common-hal/dualbank/__init__.c -msgid "Update Failed" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#: ports/nrf/common-hal/_bleio/Descriptor.c -msgid "Value length != required fixed length" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#: ports/nrf/common-hal/_bleio/Descriptor.c -msgid "Value length > max_length" -msgstr "" - -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c -msgid "Version was invalid" -msgstr "" - -#: py/emitnative.c -msgid "Viper functions don't currently support more than 4 arguments" -msgstr "" - -#: ports/stm/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - -#: main.c -msgid "WARNING: Your code filename has two extensions\n" -msgstr "" - -#: ports/nrf/common-hal/watchdog/WatchDogTimer.c -#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c -msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" -msgstr "" - -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer is not currently running" -msgstr "" - -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" -msgstr "" - -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "" - -#: py/builtinhelp.c -#, c-format -msgid "" -"Welcome to Adafruit CircuitPython %s!\n" -"\n" -"Please visit learn.adafruit.com/category/circuitpython for project guides.\n" -"\n" -"To list built-in modules please do `help(\"modules\")`.\n" -msgstr "" - -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "" - -#: main.c -msgid "Woken up by alarm.\n" -msgstr "" - -#: ports/nrf/common-hal/_bleio/PacketBuffer.c -msgid "Writes not supported on Characteristic" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "You are in safe mode: something unanticipated happened.\n" -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "" - -#: py/objtype.c -msgid "__init__() should return None" -msgstr "" - -#: py/objtype.c -msgid "__init__() should return None, not '%q'" -msgstr "" - -#: py/objobject.c -msgid "__new__ arg must be a user-type" -msgstr "" - -#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c -msgid "a bytes-like object is required" -msgstr "" - -#: lib/embed/abort_.c -msgid "abort() called" -msgstr "" - -#: extmod/machine_mem.c -#, c-format -msgid "address %08x is not aligned to %d bytes" -msgstr "" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "address out of bounds" -msgstr "" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "addresses is empty" -msgstr "" - -#: py/modbuiltins.c -msgid "arg is an empty sequence" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "argsort argument must be an ndarray" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "argsort is not implemented for flattened arrays" -msgstr "" - -#: py/runtime.c -msgid "argument has wrong type" -msgstr "" - -#: extmod/ulab/code/linalg/linalg.c -msgid "argument must be ndarray" -msgstr "" - -#: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c -msgid "argument num/types mismatch" -msgstr "" - -#: py/runtime.c -msgid "argument should be a '%q' not a '%q'" -msgstr "" - -#: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c -msgid "arguments must be ndarrays" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "array and index length must be equal" -msgstr "" - -#: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/nvm/ByteArray.c -msgid "array/bytes required on right side" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "attempt to get (arg)min/(arg)max of empty sequence" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "attempt to get argmin/argmax of an empty sequence" -msgstr "" - -#: py/objstr.c -msgid "attributes not supported yet" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "axis is out of bounds" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "axis must be None, or an integer" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "axis too long" -msgstr "" - -#: py/builtinevex.c -msgid "bad compile mode" -msgstr "" - -#: py/objstr.c -msgid "bad conversion specifier" -msgstr "" - -#: py/objstr.c -msgid "bad format string" -msgstr "" - -#: py/binary.c py/objarray.c -msgid "bad typecode" -msgstr "" - -#: py/emitnative.c -msgid "binary op %q not implemented" -msgstr "" - -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "bits_per_sample must be 8 or 16" -msgstr "" - -#: py/emitinlinethumb.c -msgid "branch not in range" -msgstr "" - -#: extmod/ulab/code/ulab_create.c -msgid "buffer is smaller than requested size" -msgstr "" - -#: shared-bindings/audiocore/RawSample.c -msgid "buffer must be a bytes-like object" -msgstr "" - -#: extmod/ulab/code/ulab_create.c -msgid "buffer size must be a multiple of element size" -msgstr "" - -#: shared-module/struct/__init__.c -msgid "buffer size must match format" -msgstr "" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "buffer slices must be of equal length" -msgstr "" - -#: py/modstruct.c shared-bindings/struct/__init__.c -#: shared-module/struct/__init__.c -msgid "buffer too small" -msgstr "" - -#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c -msgid "buffer too small for requested bytes" -msgstr "" - -#: shared-bindings/_pew/PewPew.c -msgid "buttons must be digitalio.DigitalInOut" -msgstr "" - -#: py/vm.c -msgid "byte code not implemented" -msgstr "" - -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "" - -#: py/objarray.c -msgid "bytes length not a multiple of item size" -msgstr "" - -#: py/objstr.c -msgid "bytes value out of range" -msgstr "" - -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration is out of range" -msgstr "" - -#: ports/atmel-samd/bindings/samd/Clock.c -msgid "calibration is read only" -msgstr "" - -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - -#: py/emitinlinethumb.c -msgid "can only have up to 4 parameters to Thumb assembly" -msgstr "" - -#: py/emitinlinextensa.c -msgid "can only have up to 4 parameters to Xtensa assembly" -msgstr "" - -#: py/persistentcode.c -msgid "can only save bytecode" -msgstr "" - -#: py/objtype.c -msgid "can't add special method to already-subclassed class" -msgstr "" - -#: py/compile.c -msgid "can't assign to expression" -msgstr "" - -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c -#: shared-module/_pixelbuf/PixelBuf.c -msgid "can't convert %q to %q" -msgstr "" - -#: py/objstr.c -msgid "can't convert '%q' object to %q implicitly" -msgstr "" - -#: py/obj.c -msgid "can't convert to %q" -msgstr "" - -#: py/objstr.c -msgid "can't convert to str implicitly" -msgstr "" - -#: py/compile.c -msgid "can't declare nonlocal in outer code" -msgstr "" - -#: py/compile.c -msgid "can't delete expression" -msgstr "" - -#: py/emitnative.c -msgid "can't do binary op between '%q' and '%q'" -msgstr "" - -#: py/objcomplex.c -msgid "can't do truncated division of a complex number" -msgstr "" - -#: py/compile.c -msgid "can't have multiple **x" -msgstr "" - -#: py/compile.c -msgid "can't have multiple *x" -msgstr "" - -#: py/emitnative.c -msgid "can't implicitly convert '%q' to 'bool'" -msgstr "" - -#: py/emitnative.c -msgid "can't load from '%q'" -msgstr "" - -#: py/emitnative.c -msgid "can't load with '%q' index" -msgstr "" - -#: py/objgenerator.c -msgid "can't pend throw to just-started generator" -msgstr "" - -#: py/objgenerator.c -msgid "can't send non-None value to a just-started generator" -msgstr "" - -#: shared-module/sdcardio/SDCard.c -msgid "can't set 512 block size" -msgstr "" - -#: py/objnamedtuple.c -msgid "can't set attribute" -msgstr "" - -#: py/emitnative.c -msgid "can't store '%q'" -msgstr "" - -#: py/emitnative.c -msgid "can't store to '%q'" -msgstr "" - -#: py/emitnative.c -msgid "can't store with '%q' index" -msgstr "" - -#: py/objstr.c -msgid "" -"can't switch from automatic field numbering to manual field specification" -msgstr "" - -#: py/objstr.c -msgid "" -"can't switch from manual field specification to automatic field numbering" -msgstr "" - -#: extmod/ulab/code/ndarray_operators.c -msgid "cannot cast output with casting rule" -msgstr "" - -#: py/objtype.c -msgid "cannot create '%q' instances" -msgstr "" - -#: py/objtype.c -msgid "cannot create instance" -msgstr "" - -#: py/runtime.c -msgid "cannot import name %q" -msgstr "" - -#: py/builtinimport.c -msgid "cannot perform relative import" -msgstr "" - -#: py/emitnative.c -msgid "casting" -msgstr "" - -#: shared-bindings/_stage/Text.c -msgid "chars buffer too small" -msgstr "" - -#: py/modbuiltins.c -msgid "chr() arg not in range(0x110000)" -msgstr "" - -#: py/modbuiltins.c -msgid "chr() arg not in range(256)" -msgstr "" - -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - -#: shared-bindings/msgpack/ExtType.c -msgid "code outside range 0~127" -msgstr "" - -#: shared-bindings/displayio/Palette.c -msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" -msgstr "" - -#: shared-bindings/displayio/Palette.c -msgid "color buffer must be a buffer, tuple, list, or int" -msgstr "" - -#: shared-bindings/displayio/Palette.c -msgid "color buffer must be a bytearray or array of type 'b' or 'B'" -msgstr "" - -#: shared-bindings/displayio/Palette.c -msgid "color must be between 0x000000 and 0xffffff" -msgstr "" - -#: shared-bindings/displayio/ColorConverter.c -msgid "color should be an int" -msgstr "" - -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "" - -#: py/objfloat.c py/parsenum.c -msgid "complex values not supported" -msgstr "" - -#: extmod/moduzlib.c -msgid "compression header" -msgstr "" - -#: py/parse.c -msgid "constant must be an integer" -msgstr "" - -#: py/emitnative.c -msgid "conversion to object" -msgstr "" - -#: extmod/ulab/code/filter/filter.c -msgid "convolve arguments must be linear arrays" -msgstr "" - -#: extmod/ulab/code/filter/filter.c -msgid "convolve arguments must be ndarrays" -msgstr "" - -#: extmod/ulab/code/filter/filter.c -msgid "convolve arguments must not be empty" -msgstr "" - -#: extmod/ulab/code/poly/poly.c -msgid "could not invert Vandermonde matrix" -msgstr "" - -#: shared-module/sdcardio/SDCard.c -msgid "couldn't determine SD card version" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "cross is defined for 1D arrays of length 3" -msgstr "" - -#: extmod/ulab/code/approx/approx.c -msgid "data must be iterable" -msgstr "" - -#: extmod/ulab/code/approx/approx.c -msgid "data must be of equal length" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "data type not understood" -msgstr "" - -#: py/parsenum.c -msgid "decimal numbers not supported" -msgstr "" - -#: py/compile.c -msgid "default 'except' must be last" -msgstr "" - -#: shared-bindings/msgpack/__init__.c -msgid "default is not a function" -msgstr "" - -#: shared-bindings/audiobusio/PDMIn.c -msgid "" -"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" -msgstr "" - -#: shared-bindings/audiobusio/PDMIn.c -msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "" - -#: shared-bindings/audiobusio/PDMIn.c -msgid "destination_length must be an int >= 0" -msgstr "" - -#: py/objdict.c -msgid "dict update sequence has wrong length" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "diff argument must be an ndarray" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "differentiation order out of range" -msgstr "" - -#: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c -#: shared-bindings/math/__init__.c -msgid "division by zero" -msgstr "" - -#: py/objdeque.c -msgid "empty" -msgstr "" - -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "" - -#: py/objstr.c -msgid "empty separator" -msgstr "" - -#: shared-bindings/random/__init__.c -msgid "empty sequence" -msgstr "" - -#: py/objstr.c -msgid "end of format while looking for conversion specifier" -msgstr "" - -#: shared-bindings/displayio/Shape.c -msgid "end_x should be an int" -msgstr "" - -#: shared-bindings/alarm/time/TimeAlarm.c -msgid "epoch_time not supported on this board" -msgstr "" - -#: ports/nrf/common-hal/busio/UART.c -#, c-format -msgid "error = 0x%08lX" -msgstr "" - -#: py/runtime.c -msgid "exceptions must derive from BaseException" -msgstr "" - -#: shared-bindings/canio/CAN.c -msgid "expected '%q' but got '%q'" -msgstr "" - -#: shared-bindings/canio/CAN.c -msgid "expected '%q' or '%q' but got '%q'" -msgstr "" - -#: py/objstr.c -msgid "expected ':' after format specifier" -msgstr "" - -#: py/obj.c -msgid "expected tuple/list" -msgstr "" - -#: py/modthread.c -msgid "expecting a dict for keyword args" -msgstr "" - -#: py/compile.c -msgid "expecting an assembler instruction" -msgstr "" - -#: py/compile.c -msgid "expecting just a value for set" -msgstr "" - -#: py/compile.c -msgid "expecting key:value for dict" -msgstr "" - -#: shared-bindings/msgpack/__init__.c -msgid "ext_hook is not a function" -msgstr "" - -#: py/argcheck.c -msgid "extra keyword arguments given" -msgstr "" - -#: py/argcheck.c -msgid "extra positional arguments given" -msgstr "" - -#: py/parse.c -msgid "f-string expression part cannot include a '#'" -msgstr "" - -#: py/parse.c -msgid "f-string expression part cannot include a backslash" -msgstr "" - -#: py/parse.c -msgid "f-string: empty expression not allowed" -msgstr "" - -#: py/parse.c -msgid "f-string: expecting '}'" -msgstr "" - -#: py/parse.c -msgid "f-string: single '}' is not allowed" -msgstr "" - -#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c -msgid "file must be a file opened in byte mode" -msgstr "" - -#: shared-bindings/storage/__init__.c -msgid "filesystem must provide mount method" -msgstr "" - -#: extmod/ulab/code/vector/vectorise.c -msgid "first argument must be a callable" -msgstr "" - -#: extmod/ulab/code/approx/approx.c -msgid "first argument must be a function" -msgstr "" - -#: extmod/ulab/code/ulab_create.c -msgid "first argument must be a tuple of ndarrays" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "first argument must be an iterable" -msgstr "" - -#: extmod/ulab/code/vector/vectorise.c -msgid "first argument must be an ndarray" -msgstr "" - -#: py/objtype.c -msgid "first argument to super() must be type" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "flattening order must be either 'C', or 'F'" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "flip argument must be an ndarray" -msgstr "" - -#: py/objint.c -msgid "float too big" -msgstr "" - -#: shared-bindings/_stage/Text.c -msgid "font must be 2048 bytes long" -msgstr "" - -#: py/objstr.c -msgid "format requires a dict" -msgstr "" - -#: py/objdeque.c -msgid "full" -msgstr "" - -#: py/argcheck.c -msgid "function does not take keyword arguments" -msgstr "" - -#: py/argcheck.c -#, c-format -msgid "function expected at most %d arguments, got %d" -msgstr "" - -#: py/bc.c py/objnamedtuple.c -msgid "function got multiple values for argument '%q'" -msgstr "" - -#: extmod/ulab/code/approx/approx.c -msgid "function has the same sign at the ends of interval" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "function is defined for ndarrays only" -msgstr "" - -#: py/argcheck.c -#, c-format -msgid "function missing %d required positional arguments" -msgstr "" - -#: py/bc.c -msgid "function missing keyword-only argument" -msgstr "" - -#: py/bc.c -msgid "function missing required keyword argument '%q'" -msgstr "" - -#: py/bc.c -#, c-format -msgid "function missing required positional argument #%d" -msgstr "" - -#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c -#, c-format -msgid "function takes %d positional arguments but %d were given" -msgstr "" - -#: shared-bindings/time/__init__.c -msgid "function takes exactly 9 arguments" -msgstr "" - -#: py/objgenerator.c -msgid "generator already executing" -msgstr "" - -#: py/objgenerator.c -msgid "generator ignored GeneratorExit" -msgstr "" - -#: shared-bindings/_stage/Layer.c -msgid "graphic must be 2048 bytes long" -msgstr "" - -#: extmod/moduheapq.c -msgid "heap must be a list" -msgstr "" - -#: py/compile.c -msgid "identifier redefined as global" -msgstr "" - -#: py/compile.c -msgid "identifier redefined as nonlocal" -msgstr "" - -#: py/objstr.c -msgid "incomplete format" -msgstr "" - -#: py/objstr.c -msgid "incomplete format key" -msgstr "" - -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "index is out of bounds" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c -msgid "index out of range" -msgstr "" - -#: py/obj.c -msgid "indices must be integers" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "indices must be integers, slices, or Boolean lists" -msgstr "" - -#: extmod/ulab/code/approx/approx.c -msgid "initial values must be iterable" -msgstr "" - -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "initial_value length is wrong" -msgstr "" - -#: py/compile.c -msgid "inline assembler must be a function" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "input and output shapes are not compatible" -msgstr "" - -#: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer, a tuple, or a list" -msgstr "" - -#: extmod/ulab/code/fft/fft.c -msgid "input array length must be power of 2" -msgstr "" - -#: extmod/ulab/code/ulab_create.c -msgid "input arrays are not compatible" -msgstr "" - -#: extmod/ulab/code/poly/poly.c -msgid "input data must be an iterable" -msgstr "" - -#: extmod/ulab/code/linalg/linalg.c -msgid "input matrix is asymmetric" -msgstr "" - -#: extmod/ulab/code/linalg/linalg.c -msgid "input matrix is singular" -msgstr "" - -#: extmod/ulab/code/user/user.c -msgid "input must be a dense ndarray" -msgstr "" - -#: extmod/ulab/code/ulab_create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c -msgid "input must be an ndarray" -msgstr "" - -#: extmod/ulab/code/filter/filter.c -msgid "input must be one-dimensional" -msgstr "" - -#: extmod/ulab/code/linalg/linalg.c -msgid "input must be square matrix" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "input must be tuple, list, range, or ndarray" -msgstr "" - -#: extmod/ulab/code/poly/poly.c -msgid "input vectors must be of equal length" -msgstr "" - -#: extmod/ulab/code/poly/poly.c -msgid "inputs are not iterable" -msgstr "" - -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" - -#: py/objstr.c -msgid "integer required" -msgstr "" - -#: extmod/ulab/code/approx/approx.c -msgid "interp is defined for 1D arrays of equal length" -msgstr "" - -#: shared-bindings/_bleio/Adapter.c -#, c-format -msgid "interval must be in range %s-%s" -msgstr "" - -#: lib/netutils/netutils.c -msgid "invalid arguments" -msgstr "" - -#: extmod/modussl_axtls.c -msgid "invalid cert" -msgstr "" - -#: extmod/uos_dupterm.c -msgid "invalid dupterm index" -msgstr "" - -#: extmod/modframebuf.c -msgid "invalid format" -msgstr "" - -#: py/objstr.c -msgid "invalid format specifier" -msgstr "" - -#: shared-bindings/wifi/Radio.c -msgid "invalid hostname" -msgstr "" - -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "" - -#: py/compile.c -msgid "invalid micropython decorator" -msgstr "" - -#: shared-bindings/random/__init__.c -msgid "invalid step" -msgstr "" - -#: py/compile.c py/parse.c -msgid "invalid syntax" -msgstr "" - -#: py/parsenum.c -msgid "invalid syntax for integer" -msgstr "" - -#: py/parsenum.c -#, c-format -msgid "invalid syntax for integer with base %d" -msgstr "" - -#: py/parsenum.c -msgid "invalid syntax for number" -msgstr "" - -#: ports/esp32s2/common-hal/alarm/pin/__init__.c -msgid "io must be rtc io" -msgstr "" - -#: py/objtype.c -msgid "issubclass() arg 1 must be a class" -msgstr "" - -#: py/objtype.c -msgid "issubclass() arg 2 must be a class or a tuple of classes" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "iterables are not of the same length" -msgstr "" - -#: extmod/ulab/code/linalg/linalg.c -msgid "iterations did not converge" -msgstr "" - -#: py/objstr.c -msgid "join expects a list of str/bytes objects consistent with self object" -msgstr "" - -#: py/argcheck.c -msgid "keyword argument(s) not yet implemented - use normal args instead" -msgstr "" - -#: py/bc.c -msgid "keywords must be strings" -msgstr "" - -#: py/emitinlinethumb.c py/emitinlinextensa.c -msgid "label '%q' not defined" -msgstr "" - -#: py/compile.c -msgid "label redefined" -msgstr "" - -#: py/stream.c -msgid "length argument not allowed for this type" -msgstr "" - -#: shared-bindings/audiomixer/MixerVoice.c -msgid "level must be between 0 and 1" -msgstr "" - -#: py/objarray.c -msgid "lhs and rhs should be compatible" -msgstr "" - -#: py/emitnative.c -msgid "local '%q' has type '%q' but source is '%q'" -msgstr "" - -#: py/emitnative.c -msgid "local '%q' used before type known" -msgstr "" - -#: py/vm.c -msgid "local variable referenced before assignment" -msgstr "" - -#: py/objint.c -msgid "long int not supported in this build" -msgstr "" - -#: ports/esp32s2/common-hal/canio/CAN.c -msgid "loopback + silent mode not supported by peripheral" -msgstr "" - -#: py/parse.c -msgid "malformed f-string" -msgstr "" - -#: shared-bindings/_stage/Layer.c -msgid "map buffer too small" -msgstr "" - -#: py/modmath.c shared-bindings/math/__init__.c -msgid "math domain error" -msgstr "" - -#: extmod/ulab/code/linalg/linalg.c -msgid "matrix dimensions do not match" -msgstr "" - -#: extmod/ulab/code/linalg/linalg.c -msgid "matrix is not positive definite" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#: ports/nrf/common-hal/_bleio/Descriptor.c -#, c-format -msgid "max_length must be 0-%d when fixed_length is %s" -msgstr "" - -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "" - -#: py/runtime.c -msgid "maximum recursion depth exceeded" -msgstr "" - -#: extmod/ulab/code/approx/approx.c -msgid "maxiter must be > 0" -msgstr "" - -#: extmod/ulab/code/approx/approx.c -msgid "maxiter should be > 0" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "median argument must be an ndarray" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "memory allocation failed, allocating %u bytes" -msgstr "" - -#: py/runtime.c -msgid "memory allocation failed, heap is locked" -msgstr "" - -#: py/objarray.c -msgid "memoryview: length is not a multiple of itemsize" -msgstr "" - -#: py/builtinimport.c -msgid "module not found" -msgstr "" - -#: extmod/ulab/code/poly/poly.c -msgid "more degrees of freedom than data points" -msgstr "" - -#: py/compile.c -msgid "multiple *x in assignment" -msgstr "" - -#: py/objtype.c -msgid "multiple bases have instance lay-out conflict" -msgstr "" - -#: py/objtype.c -msgid "multiple inheritance not supported" -msgstr "" - -#: py/emitnative.c -msgid "must raise an object" -msgstr "" - -#: py/modbuiltins.c -msgid "must use keyword argument for key function" -msgstr "" - -#: py/runtime.c -msgid "name '%q' is not defined" -msgstr "" - -#: py/runtime.c -msgid "name not defined" -msgstr "" - -#: py/compile.c -msgid "name reused for argument" -msgstr "" - -#: py/emitnative.c -msgid "native yield" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "need more than %d values to unpack" -msgstr "" - -#: py/objint_longlong.c py/objint_mpz.c py/runtime.c -msgid "negative power with no float support" -msgstr "" - -#: py/objint_mpz.c py/runtime.c -msgid "negative shift count" -msgstr "" - -#: shared-module/sdcardio/SDCard.c -msgid "no SD card" -msgstr "" - -#: py/vm.c -msgid "no active exception to reraise" -msgstr "" - -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "" - -#: py/compile.c -msgid "no binding for nonlocal found" -msgstr "" - -#: shared-module/msgpack/__init__.c -msgid "no default packer" -msgstr "" - -#: py/builtinimport.c -msgid "no module named '%q'" -msgstr "" - -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c -msgid "no reset pin available" -msgstr "" - -#: shared-module/sdcardio/SDCard.c -msgid "no response from SD card" -msgstr "" - -#: py/runtime.c -msgid "no such attribute" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "non-UUID found in service_uuids_whitelist" -msgstr "" - -#: py/compile.c -msgid "non-default argument follows default argument" -msgstr "" - -#: extmod/modubinascii.c -msgid "non-hex digit found" -msgstr "" - -#: py/compile.c -msgid "non-keyword arg after */**" -msgstr "" - -#: py/compile.c -msgid "non-keyword arg after keyword arg" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "non-zero timeout must be > 0.01" -msgstr "" - -#: shared-bindings/_bleio/Adapter.c -msgid "non-zero timeout must be >= interval" -msgstr "" - -#: extmod/ulab/code/linalg/linalg.c -msgid "norm is defined for 1D and 2D arrays" -msgstr "" - -#: shared-bindings/_bleio/UUID.c -msgid "not a 128-bit UUID" -msgstr "" - -#: py/objstr.c -msgid "not all arguments converted during string formatting" -msgstr "" - -#: py/objstr.c -msgid "not enough arguments for format string" -msgstr "" - -#: extmod/ulab/code/ulab_create.c -msgid "number of points must be at least 2" -msgstr "" - -#: py/builtinhelp.c -msgid "object " -msgstr "" - -#: py/obj.c -msgid "object '%q' is not a tuple or list" -msgstr "" - -#: py/obj.c -msgid "object does not support item assignment" -msgstr "" - -#: py/obj.c -msgid "object does not support item deletion" -msgstr "" - -#: py/obj.c -msgid "object has no len" -msgstr "" - -#: py/obj.c -msgid "object is not subscriptable" -msgstr "" - -#: py/runtime.c -msgid "object not an iterator" -msgstr "" - -#: py/objtype.c py/runtime.c -msgid "object not callable" -msgstr "" - -#: py/sequence.c shared-bindings/displayio/Group.c -msgid "object not in sequence" -msgstr "" - -#: py/runtime.c -msgid "object not iterable" -msgstr "" - -#: py/obj.c -msgid "object of type '%q' has no len()" -msgstr "" - -#: py/obj.c -msgid "object with buffer protocol required" -msgstr "" - -#: extmod/modubinascii.c -msgid "odd-length string" -msgstr "" - -#: extmod/ulab/code/ulab_create.c -msgid "offset is too large" -msgstr "" - -#: shared-bindings/dualbank/__init__.c -msgid "offset must be >= 0" -msgstr "" - -#: extmod/ulab/code/ulab_create.c -msgid "offset must be non-negative and no greater than buffer length" -msgstr "" - -#: py/objstr.c py/objstrunicode.c -msgid "offset out of bounds" -msgstr "" - -#: ports/nrf/common-hal/audiobusio/PDMIn.c -msgid "only bit_depth=16 is supported" -msgstr "" - -#: ports/nrf/common-hal/audiobusio/PDMIn.c -msgid "only sample_rate=16000 is supported" -msgstr "" - -#: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "only slices with step=1 (aka None) are supported" -msgstr "" - -#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vector/vectorise.c -msgid "operands could not be broadcast together" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "operation is implemented for 1D Boolean arrays only" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented on ndarrays" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "operation is not supported for given type" -msgstr "" - -#: py/modbuiltins.c -msgid "ord expects a character" -msgstr "" - -#: py/modbuiltins.c -#, c-format -msgid "ord() expected a character, but string of length %d found" -msgstr "" - -#: shared-bindings/displayio/Bitmap.c -msgid "out of range of source" -msgstr "" - -#: shared-bindings/displayio/Bitmap.c -msgid "out of range of target" -msgstr "" - -#: py/objint_mpz.c -msgid "overflow converting long int to machine word" -msgstr "" - -#: py/modstruct.c -#, c-format -msgid "pack expected %d items for packing (got %d)" -msgstr "" - -#: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c -msgid "palette must be 32 bytes long" -msgstr "" - -#: shared-bindings/displayio/Palette.c -msgid "palette_index should be an int" -msgstr "" - -#: py/compile.c -msgid "parameter annotation must be an identifier" -msgstr "" - -#: py/emitinlinextensa.c -msgid "parameters must be registers in sequence a2 to a5" -msgstr "" - -#: py/emitinlinethumb.c -msgid "parameters must be registers in sequence r0 to r3" -msgstr "" - -#: shared-bindings/displayio/Bitmap.c -msgid "pixel coordinates out of bounds" -msgstr "" - -#: shared-bindings/displayio/Bitmap.c -msgid "pixel value requires too many bits" -msgstr "" - -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" -msgstr "" - -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c -#: shared-bindings/ps2io/Ps2.c -msgid "pop from empty %q" -msgstr "" - -#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c -msgid "port must be >= 0" -msgstr "" - -#: py/objint_mpz.c -msgid "pow() 3rd argument cannot be 0" -msgstr "" - -#: py/objint_mpz.c -msgid "pow() with 3 arguments requires integers" -msgstr "" - -#: ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h -msgid "pressing boot button at start up.\n" -msgstr "" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "" - -#: py/parse.c -msgid "raw f-strings are not implemented" -msgstr "" - -#: extmod/ulab/code/fft/fft.c -msgid "real and imaginary parts must be of equal length" -msgstr "" - -#: py/builtinimport.c -msgid "relative import" -msgstr "" - -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "" - -#: extmod/ulab/code/ndarray_operators.c -msgid "results cannot be cast to specified type" -msgstr "" - -#: py/compile.c -msgid "return annotation must be an identifier" -msgstr "" - -#: py/emitnative.c -msgid "return expected '%q' but got '%q'" -msgstr "" - -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "" - -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "roll argument must be an ndarray" -msgstr "" - -#: py/objstr.c -msgid "rsplit(None,n)" -msgstr "" - -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" - -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c -msgid "sampling rate out of range" -msgstr "" - -#: py/modmicropython.c -msgid "schedule stack full" -msgstr "" - -#: lib/utils/pyexec.c py/builtinimport.c -msgid "script compilation not supported" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "shape must be a tuple" -msgstr "" - -#: shared-module/msgpack/__init__.c -msgid "short read" -msgstr "" - -#: py/objstr.c -msgid "sign not allowed in string format specifier" -msgstr "" - -#: py/objstr.c -msgid "sign not allowed with integer format specifier 'c'" -msgstr "" - -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "" - -#: extmod/ulab/code/linalg/linalg.c -msgid "size is defined for ndarrays only" -msgstr "" - -#: shared-bindings/time/__init__.c -msgid "sleep length must be non-negative" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "slice step can't be zero" -msgstr "" - -#: py/objslice.c py/sequence.c -msgid "slice step cannot be zero" -msgstr "" - -#: py/objint.c py/sequence.c -msgid "small int overflow" -msgstr "" - -#: main.c -msgid "soft reboot\n" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "sort argument must be an ndarray" -msgstr "" - -#: extmod/ulab/code/filter/filter.c -msgid "sos array must be of shape (n_section, 6)" -msgstr "" - -#: extmod/ulab/code/filter/filter.c -msgid "sos[:, 3] should be all ones" -msgstr "" - -#: extmod/ulab/code/filter/filter.c -msgid "sosfilt requires iterable arguments" -msgstr "" - -#: shared-bindings/displayio/Bitmap.c -msgid "source palette too large" -msgstr "" - -#: py/objstr.c -msgid "start/end indices" -msgstr "" - -#: shared-bindings/displayio/Shape.c -msgid "start_x should be an int" -msgstr "" - -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "" - -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "" - -#: shared-bindings/random/__init__.c -msgid "stop not reachable from start" -msgstr "" - -#: py/stream.c -msgid "stream operation not supported" -msgstr "" - -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "" - -#: py/stream.c -msgid "string not supported; use bytes or bytearray" -msgstr "" - -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "" - -#: py/objarray.c py/objstr.c -msgid "substring not found" -msgstr "" - -#: py/compile.c -msgid "super() can't find self" -msgstr "" - -#: extmod/modujson.c -msgid "syntax error in JSON" -msgstr "" - -#: extmod/moductypes.c -msgid "syntax error in uctypes descriptor" -msgstr "" - -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "" - -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "" - -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c -#: ports/nrf/common-hal/watchdog/WatchDogTimer.c -#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c -msgid "timeout duration exceeded the maximum supported value" -msgstr "" - -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "timeout must be < 655.35 secs" -msgstr "" - -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "" - -#: shared-module/sdcardio/SDCard.c -msgid "timeout waiting for v1 card" -msgstr "" - -#: shared-module/sdcardio/SDCard.c -msgid "timeout waiting for v2 card" -msgstr "" - -#: shared-bindings/time/__init__.c -msgid "timestamp out of range for platform time_t" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "tobytes can be invoked for dense arrays only" -msgstr "" - -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - -#: extmod/ulab/code/ulab_create.c -msgid "too many dimensions" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "too many indices" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "too many values to unpack (expected %d)" -msgstr "" - -#: extmod/ulab/code/approx/approx.c -msgid "trapz is defined for 1D arrays" -msgstr "" - -#: extmod/ulab/code/approx/approx.c -msgid "trapz is defined for 1D arrays of equal length" -msgstr "" - -#: ports/esp32s2/common-hal/alarm/pin/__init__.c -msgid "trigger level must be 0 or 1" -msgstr "" - -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "" - -#: ports/esp32s2/common-hal/canio/CAN.c -#, c-format -msgid "twai_driver_install returned esp-idf error #%d" -msgstr "" - -#: ports/esp32s2/common-hal/canio/CAN.c -#, c-format -msgid "twai_start returned esp-idf error #%d" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c -msgid "tx and rx cannot both be None" -msgstr "" - -#: py/objtype.c -msgid "type '%q' is not an acceptable base type" -msgstr "" - -#: py/objtype.c -msgid "type is not an acceptable base type" -msgstr "" - -#: py/runtime.c -msgid "type object '%q' has no attribute '%q'" -msgstr "" - -#: py/objgenerator.c -msgid "type object 'generator' has no attribute '__await__'" -msgstr "" - -#: py/objtype.c -msgid "type takes 1 or 3 arguments" -msgstr "" - -#: py/objint_longlong.c -msgid "ulonglong too large" -msgstr "" - -#: py/emitnative.c -msgid "unary op %q not implemented" -msgstr "" - -#: py/parse.c -msgid "unexpected indent" -msgstr "" - -#: py/bc.c -msgid "unexpected keyword argument" -msgstr "" - -#: py/bc.c py/objnamedtuple.c -msgid "unexpected keyword argument '%q'" -msgstr "" - -#: py/lexer.c -msgid "unicode name escapes" -msgstr "" - -#: py/parse.c -msgid "unindent does not match any outer indentation level" -msgstr "" - -#: py/objstr.c -#, c-format -msgid "unknown conversion specifier %c" -msgstr "" - -#: py/objstr.c -msgid "unknown format code '%c' for object of type '%q'" -msgstr "" - -#: py/compile.c -msgid "unknown type" -msgstr "" - -#: py/emitnative.c -msgid "unknown type '%q'" -msgstr "" - -#: py/objstr.c -msgid "unmatched '{' in format" -msgstr "" - -#: py/objtype.c py/runtime.c -msgid "unreadable attribute" -msgstr "" - -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c -msgid "unsupported %q type" -msgstr "" - -#: py/emitinlinethumb.c -#, c-format -msgid "unsupported Thumb instruction '%s' with %d arguments" -msgstr "" - -#: py/emitinlinextensa.c -#, c-format -msgid "unsupported Xtensa instruction '%s' with %d arguments" -msgstr "" - -#: py/objstr.c -#, c-format -msgid "unsupported format character '%c' (0x%x) at index %d" -msgstr "" - -#: py/runtime.c -msgid "unsupported type for %q: '%q'" -msgstr "" - -#: py/runtime.c -msgid "unsupported type for operator" -msgstr "" - -#: py/runtime.c -msgid "unsupported types for %q: '%q', '%q'" -msgstr "" - -#: py/objint.c -#, c-format -msgid "value must fit in %d byte(s)" -msgstr "" - -#: shared-bindings/displayio/Bitmap.c -msgid "value_count must be > 0" -msgstr "" - -#: extmod/ulab/code/linalg/linalg.c -msgid "vectors must have same lengths" -msgstr "" - -#: ports/esp32s2/common-hal/alarm/pin/__init__.c -msgid "wakeup conflict" -msgstr "" - -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c -msgid "watchdog not initialized" -msgstr "" - -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "" - -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "width must be greater than zero" -msgstr "" - -#: ports/esp32s2/common-hal/wifi/Radio.c -msgid "wifi is not enabled" -msgstr "" - -#: shared-bindings/_bleio/Adapter.c -msgid "window must be <= interval" -msgstr "" - -#: extmod/ulab/code/numerical/numerical.c -msgid "wrong axis index" -msgstr "" - -#: extmod/ulab/code/ulab_create.c -msgid "wrong axis specified" -msgstr "" - -#: extmod/ulab/code/vector/vectorise.c -msgid "wrong input type" -msgstr "" - -#: extmod/ulab/code/ulab_create.c py/objstr.c -msgid "wrong number of arguments" -msgstr "" - -#: py/runtime.c -msgid "wrong number of values to unpack" -msgstr "" - -#: extmod/ulab/code/ndarray.c -msgid "wrong operand type" -msgstr "" - -#: extmod/ulab/code/vector/vectorise.c -msgid "wrong output type" -msgstr "" - -#: shared-module/displayio/Shape.c -msgid "x value out of bounds" -msgstr "" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c -msgid "xTaskCreate failed" -msgstr "" - -#: shared-bindings/displayio/Shape.c -msgid "y should be an int" -msgstr "" - -#: shared-module/displayio/Shape.c -msgid "y value out of bounds" -msgstr "" - -#: py/objrange.c -msgid "zero step" -msgstr "" - -#: extmod/ulab/code/filter/filter.c -msgid "zi must be an ndarray" -msgstr "" - -#: extmod/ulab/code/filter/filter.c -msgid "zi must be of float type" -msgstr "" - -#: extmod/ulab/code/filter/filter.c -msgid "zi must be of shape (n_section, 2)" -msgstr "" From 07b3a7f6d7fbb0c5ec039e2bd64c4cc45e161a19 Mon Sep 17 00:00:00 2001 From: Jose David M Date: Sun, 28 Feb 2021 16:48:39 +0000 Subject: [PATCH 140/159] Translated using Weblate (Spanish) Currently translated at 100.0% (970 of 970 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/es.po b/locale/es.po index 76917fc34a..680a48becc 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-26 13:50+0000\n" +"PO-Revision-Date: 2021-03-01 03:21+0000\n" "Last-Translator: Jose David M \n" "Language-Team: \n" "Language: es\n" @@ -2575,7 +2575,7 @@ msgstr "operacion binaria %q no implementada" #: shared-bindings/busio/UART.c msgid "bits must be in range 5 to 9" -msgstr "" +msgstr "los bits deben estar en el rango de 5 a 9" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" From 0178c44aaa8f8f35f225795f72eb3cda82bf76e9 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Mon, 1 Mar 2021 04:21:25 +0100 Subject: [PATCH 141/159] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 2 +- locale/cs.po | 2 +- locale/de_DE.po | 2 +- locale/el.po | 2 +- locale/es.po | 9 ++++++--- locale/fil.po | 2 +- locale/fr.po | 2 +- locale/hi.po | 2 +- locale/it_IT.po | 2 +- locale/ja.po | 2 +- locale/ko.po | 2 +- locale/nl.po | 2 +- locale/pl.po | 2 +- locale/pt_BR.po | 7 +++++-- locale/sv.po | 7 +++++-- locale/zh_Latn_pinyin.po | 2 +- 16 files changed, 29 insertions(+), 20 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 57301939e4..add98a933a 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1125,7 +1125,7 @@ msgid "Init program size invalid" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c diff --git a/locale/cs.po b/locale/cs.po index 3976260f4d..f7375b9215 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1107,7 +1107,7 @@ msgid "Init program size invalid" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c diff --git a/locale/de_DE.po b/locale/de_DE.po index 8a356f4544..8c8c14928b 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1129,7 +1129,7 @@ msgid "Init program size invalid" msgstr "Init Programm Größe ungültig" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c diff --git a/locale/el.po b/locale/el.po index d6d9e44cd3..289425d69c 100644 --- a/locale/el.po +++ b/locale/el.po @@ -1104,7 +1104,7 @@ msgid "Init program size invalid" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c diff --git a/locale/es.po b/locale/es.po index 680a48becc..6c6f36d16c 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1135,10 +1135,8 @@ msgid "Init program size invalid" msgstr "Tamaño del programa Init invalido" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" -"La dirección inicial del pin de configuración esta en conflicto con la " -"dirección de salida inicial del pin" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin state conflicts with initial out pin state" @@ -4330,6 +4328,11 @@ msgstr "zi debe ser de tipo flotante" msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "Initial set pin direcion conflicts with initial out pin direction" +#~ msgstr "" +#~ "La dirección inicial del pin de configuración esta en conflicto con la " +#~ "dirección de salida inicial del pin" + #~ msgid "UART not yet supported" #~ msgstr "UART no esta soportado todavia" diff --git a/locale/fil.po b/locale/fil.po index 26840a1515..427265b77d 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1119,7 +1119,7 @@ msgid "Init program size invalid" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c diff --git a/locale/fr.po b/locale/fr.po index 3eaf1fe747..7eb0688301 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -1141,7 +1141,7 @@ msgid "Init program size invalid" msgstr "Taille du programme d'initialisation non valide" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c diff --git a/locale/hi.po b/locale/hi.po index 59ab8ecc5d..f133330344 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -1104,7 +1104,7 @@ msgid "Init program size invalid" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c diff --git a/locale/it_IT.po b/locale/it_IT.po index da9e17381c..f09f0a3622 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -1128,7 +1128,7 @@ msgid "Init program size invalid" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c diff --git a/locale/ja.po b/locale/ja.po index 534b6fcea8..2583e3e228 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -1117,7 +1117,7 @@ msgid "Init program size invalid" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c diff --git a/locale/ko.po b/locale/ko.po index e4638507b4..d455639ee1 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -1107,7 +1107,7 @@ msgid "Init program size invalid" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c diff --git a/locale/nl.po b/locale/nl.po index fd2cee2fd4..a3686ecf96 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -1118,7 +1118,7 @@ msgid "Init program size invalid" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c diff --git a/locale/pl.po b/locale/pl.po index 6a94bb67b0..d2fefba6a6 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1117,7 +1117,7 @@ msgid "Init program size invalid" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 954f63ce05..1ed90e145e 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -1136,9 +1136,8 @@ msgid "Init program size invalid" msgstr "O tamanho do programa Init é inválido" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" -"A direção do pino inicial está em conflito com a direção inicial do pino" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin state conflicts with initial out pin state" @@ -4336,6 +4335,10 @@ msgstr "zi deve ser de um tipo float" msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" +#~ msgid "Initial set pin direcion conflicts with initial out pin direction" +#~ msgstr "" +#~ "A direção do pino inicial está em conflito com a direção inicial do pino" + #~ msgid "UART not yet supported" #~ msgstr "O UART ainda não é suportado" diff --git a/locale/sv.po b/locale/sv.po index d4e8a2f738..7de9ad4297 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -1123,8 +1123,8 @@ msgid "Init program size invalid" msgstr "Storlek på init-program ogiltigt" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" -msgstr "Initial pinn-riktning står i konflikt med initial utpinn-riktning" +msgid "Initial set pin direction conflicts with initial out pin direction" +msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin state conflicts with initial out pin state" @@ -4294,6 +4294,9 @@ msgstr "zi måste vara av typ float" msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" +#~ msgid "Initial set pin direcion conflicts with initial out pin direction" +#~ msgstr "Initial pinn-riktning står i konflikt med initial utpinn-riktning" + #~ msgid "UART not yet supported" #~ msgstr "UART stöds ännu inte" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9d72df64d2..3410690020 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -1122,7 +1122,7 @@ msgid "Init program size invalid" msgstr "Init chéng xù dà xiǎo wú xiào" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -msgid "Initial set pin direcion conflicts with initial out pin direction" +msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c From d68fdf3a3d852894e225fc41cb0563b26eded415 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Mon, 1 Mar 2021 15:45:10 +0100 Subject: [PATCH 142/159] spresense: return the correct value for Analog In --- ports/cxd56/common-hal/analogio/AnalogIn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/cxd56/common-hal/analogio/AnalogIn.c b/ports/cxd56/common-hal/analogio/AnalogIn.c index cdf37c06a7..a26647ac6f 100644 --- a/ports/cxd56/common-hal/analogio/AnalogIn.c +++ b/ports/cxd56/common-hal/analogio/AnalogIn.c @@ -105,11 +105,11 @@ bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { } uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { - uint16_t value = 0; + int16_t value = 0; read(analogin_dev[self->number].fd, &value, sizeof(value)); - return value; + return (uint16_t) 32768 + (uint16_t) value; } // Reference voltage is a fixed value which is depending on the board. From 173608f1aa431f35b6e788e86dca4ddbc67101e6 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Mon, 1 Mar 2021 05:57:44 +0000 Subject: [PATCH 143/159] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (970 of 970 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 1ed90e145e..423a91dd0b 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-27 15:19+0000\n" +"PO-Revision-Date: 2021-03-01 15:19+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1138,6 +1138,8 @@ msgstr "O tamanho do programa Init é inválido" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" +"A direção da definição inicial do pino conflita com a direção inicial do " +"pino de saída" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin state conflicts with initial out pin state" From 5c2c743bbd55bb61f2cbdba0be1a3d5c9a8aace6 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Mon, 1 Mar 2021 07:59:05 +0000 Subject: [PATCH 144/159] Translated using Weblate (Swedish) Currently translated at 100.0% (970 of 970 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 7de9ad4297..c7bdd9ebe4 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-27 15:19+0000\n" +"PO-Revision-Date: 2021-03-01 15:19+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -1124,7 +1124,7 @@ msgstr "Storlek på init-program ogiltigt" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin direction conflicts with initial out pin direction" -msgstr "" +msgstr "Initial pinn-riktning står i konflikt med initial utpinns-riktning" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin state conflicts with initial out pin state" From 1fcc0e47ff8d1095dab826f64538331509c09908 Mon Sep 17 00:00:00 2001 From: hexthat Date: Mon, 1 Mar 2021 05:11:13 +0000 Subject: [PATCH 145/159] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (970 of 970 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 3410690020..2486fda3fa 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-02-09 14:03+0000\n" +"PO-Revision-Date: 2021-03-01 15:19+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.5-dev\n" +"X-Generator: Weblate 4.5\n" #: main.c msgid "" @@ -469,7 +469,7 @@ msgstr "Dī yú zuìdī zhèng sùlǜ" #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must be sequential pins" -msgstr "" +msgstr "wèi shí zhōng hé dān cí xuǎn zé bì xū shì shùn xù yǐn jiǎo" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -514,7 +514,7 @@ msgstr "Huǎnchōng qū hé piān yí liàng tài xiǎo %d %d %d" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Buffer elements must be 4 bytes long or less" -msgstr "" +msgstr "huǎn chōng yuán jiàn bì xū wéi 4 zì jié cháng huò gèng shǎo" #: shared-module/usb_hid/Device.c #, c-format @@ -1103,7 +1103,7 @@ msgstr "IV bì xū wéi %d zì jié cháng" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "In buffer elements must be 4 bytes long or less" -msgstr "" +msgstr "zài huǎn chōng yuán jiàn zhōng bì xū shì 4 zì jié cháng huò gèng shǎo" #: py/persistentcode.c msgid "" @@ -1124,10 +1124,14 @@ msgstr "Init chéng xù dà xiǎo wú xiào" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" +"chū shǐ shè zhì yǐn jiǎo fāng xiàng yǔ chū shǐ chū yǐn jiǎo fāng xiàng chōng " +"tū" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin state conflicts with initial out pin state" msgstr "" +"chū shǐ shè zhì yǐn jiǎo zhuàng tài yǔ chū shǐ chū yǐn jiǎo zhuàng tài chōng " +"tū" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" @@ -1137,6 +1141,7 @@ msgstr "yóu yú nèi cún bù zú, chū shǐ huà shī bài" #, c-format msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" msgstr "" +"shū rù huǎn chōng qū cháng dù (%d) bì xū shì liàn jì shù de bèi shù (%d)" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" @@ -1503,7 +1508,7 @@ msgstr "Wèi zhǎodào DMA píndào" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA pacing timer found" -msgstr "" +msgstr "wèi zhǎo dào DMA qǐ bó qì" #: shared-module/adafruit_bus_device/I2CDevice.c #, c-format @@ -1565,11 +1570,11 @@ msgstr "Méiyǒu zài yǐn jiǎo shàng de yìngjiàn zhīchí" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" -msgstr "" +msgstr "chéng xù zhōng méi yǒu" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in or out in program" -msgstr "" +msgstr "chéng xù zhōng méi yǒu jìn chū" #: shared-bindings/aesio/aes.c msgid "No key was specified" @@ -1713,7 +1718,7 @@ msgstr "cāo zuò yǐ fēn shí" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Out buffer elements must be 4 bytes long or less" -msgstr "" +msgstr "chū huǎn chōng yuán jiàn bì xū shì 4 zì jié cháng huò gèng shǎo" #: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c msgid "Out of memory" @@ -1726,7 +1731,7 @@ msgstr "tào jiē zì wài" #: shared-bindings/bitops/__init__.c #, c-format msgid "Output buffer must be at least %d bytes" -msgstr "" +msgstr "shū chū huǎn chōng qū bì xū zhì shǎo wéi %d zì jié" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1805,7 +1810,7 @@ msgstr "" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Pins must share PWM slice" -msgstr "" +msgstr "yǐn jiǎo bì xū gòng xiǎng PWM qiē piàn" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -2051,11 +2056,11 @@ msgstr "Duīzhàn dàxiǎo bìxū zhìshǎo 256" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" -msgstr "" +msgstr "lì tǐ shēng zuǒ bì xū shì zài PWM tōng dào A" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo right must be on PWM channel B" -msgstr "" +msgstr "lì tǐ shēng yòu cè bì xū zài PWM tōng dào B shàng" #: shared-bindings/multiterminal/__init__.c msgid "Stream missing readinto() or write() method." @@ -2538,7 +2543,7 @@ msgstr "èrjìnzhì bǎn qián bǎn %q wèi zhíxíng" #: shared-bindings/busio/UART.c msgid "bits must be in range 5 to 9" -msgstr "" +msgstr "wèi bì xū zài fàn wéi nèi 5 zhì 9" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -3428,7 +3433,7 @@ msgstr "jìyì tǐ fēnpèi shībài, duī bèi suǒdìng" #: py/objarray.c msgid "memoryview: length is not a multiple of itemsize" -msgstr "" +msgstr "nèi cún shì tú: cháng dù bú shì xiàng mù huà de bèi shù" #: py/builtinimport.c msgid "module not found" @@ -4211,7 +4216,7 @@ msgstr "kān mén gǒu chāoshí bìxū dàyú 0" #: shared-bindings/bitops/__init__.c #, c-format msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" +msgstr "kuān dù bì xū cóng 2 dào 8 ( hán ), ér bù shì %d" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" From f722df70c86a4aa58c83c4dd75e91ddcd1c97b99 Mon Sep 17 00:00:00 2001 From: ajs256 <67526318+ajs256@users.noreply.github.com> Date: Mon, 1 Mar 2021 09:06:24 -0800 Subject: [PATCH 146/159] Fix formatting in SPI docs Close #4293 by changing `..note::` to `.. note::`. --- shared-bindings/busio/SPI.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index e47564c8c2..cbc6b5c088 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -57,7 +57,7 @@ //| //| """Construct an SPI object on the given pins. //| -//| ..note:: The SPI peripherals allocated in order of desirability, if possible, +//| .. note:: The SPI peripherals allocated in order of desirability, if possible, //| such as highest speed and not shared use first. For instance, on the nRF52840, //| there is a single 32MHz SPI peripheral, and multiple 8MHz peripherals, //| some of which may also be used for I2C. The 32MHz SPI peripheral is returned From dac047db615cb36da26e5502fb430771166f251f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 1 Mar 2021 10:33:04 -0800 Subject: [PATCH 147/159] Update Feather RP2040 to 8MB --- .../boards/adafruit_feather_rp2040/mpconfigboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h index f491a77698..a3124c7e5d 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h @@ -13,5 +13,5 @@ // #define DEFAULT_UART_BUS_RX (&pin_PA11) // #define DEFAULT_UART_BUS_TX (&pin_PA10) -// Flash chip is GD25Q32 connected over QSPI -#define TOTAL_FLASH_SIZE (4 * 1024 * 1024) +// Flash chip is GD25Q64 connected over QSPI +#define TOTAL_FLASH_SIZE (8 * 1024 * 1024) From af9dfccab1d126811fe6cab3f141a65b41884c6d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 1 Mar 2021 10:34:25 -0800 Subject: [PATCH 148/159] Update QT Py flash size --- ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h index 3f47784572..f5734b5131 100644 --- a/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h @@ -13,5 +13,5 @@ // #define DEFAULT_UART_BUS_RX (&pin_PA11) // #define DEFAULT_UART_BUS_TX (&pin_PA10) -// Flash chip is GD25Q32 connected over QSPI -#define TOTAL_FLASH_SIZE (4 * 1024 * 1024) +// Flash chip is GD25Q64 connected over QSPI +#define TOTAL_FLASH_SIZE (8 * 1024 * 1024) From bddd6b013d0316157f71ffcecd22173a4e2d8b5c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Mar 2021 15:28:58 -0600 Subject: [PATCH 149/159] build_release_files: Only build languages in an allow-list --- tools/build_release_files.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/build_release_files.py b/tools/build_release_files.py index 98e81499ed..dc6c094c0a 100755 --- a/tools/build_release_files.py +++ b/tools/build_release_files.py @@ -27,6 +27,9 @@ if "BOARDS" in os.environ: sha, version = build_info.get_version_info() languages = build_info.get_languages() +language_allow_list = ['ID', 'de_DE', 'en_US', 'en_x_pirate', 'es', 'fil', 'fr', 'it_IT', 'ja', 'nl', 'pl', 'pt_BR', 'sv', 'zh_Latn_pinyin'] +print('Note: Not building languages', set(languages) - set(language_allow_list)) + exit_status = 0 cores = multiprocessing.cpu_count() print('building boards with parallelism {}'.format(cores)) @@ -35,7 +38,7 @@ for board in build_boards: os.makedirs(bin_directory, exist_ok=True) board_info = all_boards[board] - for language in languages: + for language in language_allow_list: bin_directory = "../bin/{board}/{language}".format(board=board, language=language) os.makedirs(bin_directory, exist_ok=True) start_time = time.monotonic() From 0dabd1ace27b9e7fa4e7faed861e508f4ca39bef Mon Sep 17 00:00:00 2001 From: James Bowman Date: Mon, 1 Mar 2021 14:42:48 -0800 Subject: [PATCH 150/159] Add EVE support for Feather M4 Express --- ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk index 4946788d3e..78959dcd07 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk @@ -12,3 +12,4 @@ EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ CIRCUITPY_VECTORIO = 1 +CIRCUITPY__EVE = 1 From c940e112a0a80fa1f9cba41a7f5c4303cf7da42d Mon Sep 17 00:00:00 2001 From: Jose David M Date: Mon, 1 Mar 2021 22:52:03 +0000 Subject: [PATCH 151/159] Translated using Weblate (Spanish) Currently translated at 100.0% (970 of 970 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locale/es.po b/locale/es.po index 6c6f36d16c..1778c51ff2 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-03-01 03:21+0000\n" +"PO-Revision-Date: 2021-03-02 02:24+0000\n" "Last-Translator: Jose David M \n" "Language-Team: \n" "Language: es\n" @@ -1137,6 +1137,8 @@ msgstr "Tamaño del programa Init invalido" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin direction conflicts with initial out pin direction" msgstr "" +"La dirección configurada inicial del pin esta en conflicto con la dirección " +"de salida inicial del pin" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin state conflicts with initial out pin state" From 5a62a0ec902f53ad5281868d8d73307bbe1bc00c Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 2 Mar 2021 03:24:20 +0100 Subject: [PATCH 152/159] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 8 ++++++-- locale/cs.po | 8 ++++++-- locale/de_DE.po | 8 ++++++-- locale/el.po | 8 ++++++-- locale/es.po | 8 ++++++-- locale/fil.po | 8 ++++++-- locale/fr.po | 8 ++++++-- locale/hi.po | 8 ++++++-- locale/it_IT.po | 8 ++++++-- locale/ja.po | 8 ++++++-- locale/ko.po | 8 ++++++-- locale/nl.po | 8 ++++++-- locale/pl.po | 8 ++++++-- locale/pt_BR.po | 8 ++++++-- locale/sv.po | 8 ++++++-- locale/zh_Latn_pinyin.po | 8 ++++++-- 16 files changed, 96 insertions(+), 32 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index add98a933a..cfda804b1a 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1919,7 +1919,7 @@ msgstr "Baca-saja" msgid "Read-only filesystem" msgstr "sistem file (filesystem) bersifat Read-only" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c #, fuzzy msgid "Read-only object" msgstr "sistem file (filesystem) bersifat Read-only" @@ -2767,6 +2767,10 @@ msgstr "" msgid "circle can only be registered in one parent" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "" @@ -3917,7 +3921,7 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index f7375b9215..f6c3ac8800 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1890,7 +1890,7 @@ msgstr "" msgid "Read-only filesystem" msgstr "" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "" @@ -2719,6 +2719,10 @@ msgstr "" msgid "circle can only be registered in one parent" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "" @@ -3868,7 +3872,7 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 8c8c14928b..beb9160685 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1923,7 +1923,7 @@ msgstr "Nur lesen möglich, da Schreibgeschützt" msgid "Read-only filesystem" msgstr "Schreibgeschützte Dateisystem" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "Schreibgeschützte Objekt" @@ -2789,6 +2789,10 @@ msgstr "chr() arg ist nicht in range(256)" msgid "circle can only be registered in one parent" msgstr "Kreis kann nur in einem Elternteil registriert werden" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "" @@ -3956,7 +3960,7 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "Quell-Palette zu groß" diff --git a/locale/el.po b/locale/el.po index 289425d69c..49f113039c 100644 --- a/locale/el.po +++ b/locale/el.po @@ -1887,7 +1887,7 @@ msgstr "" msgid "Read-only filesystem" msgstr "" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "" @@ -2716,6 +2716,10 @@ msgstr "" msgid "circle can only be registered in one parent" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "" @@ -3865,7 +3869,7 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "" diff --git a/locale/es.po b/locale/es.po index 1778c51ff2..72e569f473 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1948,7 +1948,7 @@ msgstr "Solo-lectura" msgid "Read-only filesystem" msgstr "Sistema de archivos de solo-Lectura" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "Objeto de solo-lectura" @@ -2807,6 +2807,10 @@ msgstr "El argumento de chr() no esta en el rango(256)" msgid "circle can only be registered in one parent" msgstr "circulo solo puede ser registrado con un pariente" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "código fuera del rango 0~127" @@ -3967,7 +3971,7 @@ msgstr "sos[:, 3] deberían ser todos unos" msgid "sosfilt requires iterable arguments" msgstr "sosfilt requiere argumentos iterables" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "paleta fuente muy larga" diff --git a/locale/fil.po b/locale/fil.po index 427265b77d..b2c3d08b82 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1906,7 +1906,7 @@ msgstr "Basahin-lamang" msgid "Read-only filesystem" msgstr "Basahin-lamang mode" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c #, fuzzy msgid "Read-only object" msgstr "Basahin-lamang" @@ -2753,6 +2753,10 @@ msgstr "chr() arg wala sa sakop ng range(256)" msgid "circle can only be registered in one parent" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "" @@ -3916,7 +3920,7 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 7eb0688301..4acd85795d 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -1952,7 +1952,7 @@ msgstr "Lecture seule" msgid "Read-only filesystem" msgstr "Système de fichier en lecture seule" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "Objet en lecture seule" @@ -2818,6 +2818,10 @@ msgstr "paramètre de chr() hors les bornes de range(256)" msgid "circle can only be registered in one parent" msgstr "le cercle ne peut être enregistré que dans un seul parent" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "code hors bornes 0~127" @@ -3985,7 +3989,7 @@ msgstr "sos[:, 3] doivent tous être à un" msgid "sosfilt requires iterable arguments" msgstr "sosfilt nécessite des argument itératifs" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "la palette source est trop grande" diff --git a/locale/hi.po b/locale/hi.po index f133330344..c8805ec90f 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -1887,7 +1887,7 @@ msgstr "" msgid "Read-only filesystem" msgstr "" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "" @@ -2716,6 +2716,10 @@ msgstr "" msgid "circle can only be registered in one parent" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "" @@ -3865,7 +3869,7 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index f09f0a3622..68af6c7790 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -1925,7 +1925,7 @@ msgstr "Sola lettura" msgid "Read-only filesystem" msgstr "Filesystem in sola lettura" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c #, fuzzy msgid "Read-only object" msgstr "Sola lettura" @@ -2763,6 +2763,10 @@ msgstr "argomento di chr() non è in range(256)" msgid "circle can only be registered in one parent" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "" @@ -3933,7 +3937,7 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 2583e3e228..017e5583c8 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -1903,7 +1903,7 @@ msgstr "読み込み専用" msgid "Read-only filesystem" msgstr "読み込み専用のファイルシステム" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "読み込み専用のオブジェクト" @@ -2739,6 +2739,10 @@ msgstr "" msgid "circle can only be registered in one parent" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "" @@ -3896,7 +3900,7 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index d455639ee1..4e87dabf91 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -1890,7 +1890,7 @@ msgstr "" msgid "Read-only filesystem" msgstr "" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "" @@ -2720,6 +2720,10 @@ msgstr "" msgid "circle can only be registered in one parent" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "" @@ -3869,7 +3873,7 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index a3686ecf96..a26c1d7dd1 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -1919,7 +1919,7 @@ msgstr "Alleen-lezen" msgid "Read-only filesystem" msgstr "Alleen-lezen bestandssysteem" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "Alleen-lezen object" @@ -2771,6 +2771,10 @@ msgid "circle can only be registered in one parent" msgstr "" "cirkel kan slechts bij één object van een hoger niveau worden geregistreerd" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "" @@ -3929,7 +3933,7 @@ msgstr "sos[:, 3] moeten allemaal 1 zijn" msgid "sosfilt requires iterable arguments" msgstr "sosfilt vereist itereerbare argumenten" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "bronpalet te groot" diff --git a/locale/pl.po b/locale/pl.po index d2fefba6a6..54035a637d 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1901,7 +1901,7 @@ msgstr "Tylko do odczytu" msgid "Read-only filesystem" msgstr "System plików tylko do odczytu" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "Obiekt tylko do odczytu" @@ -2736,6 +2736,10 @@ msgstr "argument chr() poza zakresem range(256)" msgid "circle can only be registered in one parent" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "" @@ -3888,7 +3892,7 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "źródłowa paleta jest zbyt duża" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 423a91dd0b..dfe9a0dd53 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -1948,7 +1948,7 @@ msgstr "Somente leitura" msgid "Read-only filesystem" msgstr "Sistema de arquivos somente leitura" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "Objeto de leitura apenas" @@ -2808,6 +2808,10 @@ msgstr "o arg chr() está fora do intervalo(256)" msgid "circle can only be registered in one parent" msgstr "o círculo só pode ser registrado em um pai" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "código fora do alcance 0~127" @@ -3975,7 +3979,7 @@ msgstr "sos[:, 3] deve ser um em todos" msgid "sosfilt requires iterable arguments" msgstr "o sosfilt requer que os argumentos sejam iteráveis" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "a paleta de origem é muito grande" diff --git a/locale/sv.po b/locale/sv.po index c7bdd9ebe4..0f6a8e3add 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -1925,7 +1925,7 @@ msgstr "Skrivskyddad" msgid "Read-only filesystem" msgstr "Skrivskyddat filsystem" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "Skrivskyddat objekt" @@ -2774,6 +2774,10 @@ msgstr "chr() arg är inte i intervallet(256)" msgid "circle can only be registered in one parent" msgstr "circle kan endast registreras i en förälder" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "kod utanför intervallet 0~127" @@ -3932,7 +3936,7 @@ msgstr "sos[:, 3] måste vara ettor" msgid "sosfilt requires iterable arguments" msgstr "sosfilt kräver iterable argument" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "källpalett för stor" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 2486fda3fa..694b95b3a9 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -1923,7 +1923,7 @@ msgstr "Zhǐ dú" msgid "Read-only filesystem" msgstr "Zhǐ dú wénjiàn xìtǒng" -#: shared-module/displayio/Bitmap.c +#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "Zhǐ dú duìxiàng" @@ -2771,6 +2771,10 @@ msgstr "chr() cān shǔ bùzài fànwéi (256)" msgid "circle can only be registered in one parent" msgstr "quānzi zhǐ néng zài yī wèi jiāzhǎng zhōng zhùcè" +#: shared-bindings/bitmaptools/__init__.c +msgid "clip point must be (x,y) tuple" +msgstr "" + #: shared-bindings/msgpack/ExtType.c msgid "code outside range 0~127" msgstr "dài mǎ chāo chū fàn wéi 0~127" @@ -3928,7 +3932,7 @@ msgstr "sos [:, 3] yīnggāi quán shì" msgid "sosfilt requires iterable arguments" msgstr "sosfilt xūyào diédài cānshù" -#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "source palette too large" msgstr "yuán miànbǎn tài dà" From 4b63a8c9b4c2aca87da19bab45e7bebe3368d36c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 25 Feb 2021 11:34:03 -0600 Subject: [PATCH 153/159] rp2pio: allow keyboard interrupt while waiting for tx fifo to empty (& stall) --- ports/raspberrypi/common-hal/rp2pio/StateMachine.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index 5625a1b29c..54c5220e70 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -673,6 +673,9 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, while (!pio_sm_is_tx_fifo_empty(self->pio, self->state_machine) || (self->wait_for_txstall && (self->pio->fdebug & stall_mask) == 0)) { RUN_BACKGROUND_TASKS; + if (mp_hal_is_interrupted()) { + break; + } } } return true; From 5a00862b1db24c11356b99c15ff9b449b50e9580 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Mar 2021 20:54:57 -0600 Subject: [PATCH 154/159] raspberrypi: allow directly specifying the original boot .S file .. all the necessary steps to transform it into a padded, checksummed file are now done by the build system. Since it is assigned by "?=", it _should_ be the case that individual builds can override it. I did not "test" this per se, but it gives the same content and checksum (except for the identifying comment with a path) as #4302. --- ports/raspberrypi/Makefile | 21 +++++++++++++++-- .../bs2_default_padded_checksummed.S | 23 ------------------- 2 files changed, 19 insertions(+), 25 deletions(-) delete mode 100644 ports/raspberrypi/bs2_default_padded_checksummed.S diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index f5e65f2560..9d66338c78 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -231,8 +231,9 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)) SRC_S = supervisor/$(CHIP_FAMILY)_cpu.s -SRC_S_UPPER = bs2_default_padded_checksummed.S \ - sdk/src/rp2_common/hardware_divider/divider.S \ +BOOT2_S_UPPER ?= sdk/src/rp2_common/boot_stage2/boot2_generic_03h.S +BOOT2_S_CFLAGS ?= -DPICO_FLASH_SPI_CLKDIV=2 +SRC_S_UPPER = sdk/src/rp2_common/hardware_divider/divider.S \ sdk/src/rp2_common/hardware_irq/irq_handler_chain.S \ sdk/src/rp2_common/pico_bit_ops/bit_ops_aeabi.S \ sdk/src/rp2_common/pico_double/double_aeabi.S \ @@ -253,7 +254,23 @@ endif OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_S_UPPER:.S=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) +OBJ += $(BUILD)/boot2_padded_checksummed.o +$(BUILD)/boot2_padded_checksummed.o: $(BUILD)/boot2_padded_checksummed.S + $(STEPECHO) "CC $<" + $(Q)$(CC) $(CFLAGS) -c -o $@ $< + +$(BUILD)/boot2_padded_checksummed.S: $(BUILD)/boot2.bin + $(STEPECHO) "PAD_CHECKSUM $<" + $(Q)$(PYTHON3) sdk/src/rp2_common/boot_stage2/pad_checksum -s 0xffffffff $< $@ + +$(BUILD)/boot2.bin: $(BUILD)/boot2.elf + $(STEPECHO) "OBJCOPY $<" + $(Q)$(OBJCOPY) -O binary $< $@ + +$(BUILD)/boot2.elf: $(BOOT2_S_UPPER) | $(BUILD)/ + $(STEPECHO) "BOOT $<" + $(Q)$(CC) $(CFLAGS) $(BOOT2_S_CFLAGS) -Isdk/src/rp2_common/boot_stage2/asminclude --specs=nosys.specs -nostartfiles -Wl,-T,sdk/src/rp2_common/boot_stage2/boot_stage2.ld -o $@ $< SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) diff --git a/ports/raspberrypi/bs2_default_padded_checksummed.S b/ports/raspberrypi/bs2_default_padded_checksummed.S deleted file mode 100644 index 6b7074e3b0..0000000000 --- a/ports/raspberrypi/bs2_default_padded_checksummed.S +++ /dev/null @@ -1,23 +0,0 @@ -// Padded and checksummed version of: /home/pi/pico/pico-examples/build/pico-sdk/src/rp2_common/boot_stage2/bs2_default.bin - -.cpu cortex-m0plus -.thumb - -.section .boot2, "ax" - -.byte 0x00, 0xb5, 0x32, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, 0x88, 0x43, 0x98, 0x60 -.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2e, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x02, 0x21, 0x59, 0x61 -.byte 0x01, 0x21, 0xf0, 0x22, 0x99, 0x50, 0x2b, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20 -.byte 0x00, 0xf0, 0x44, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, 0x19, 0x66, 0x00, 0xf0 -.byte 0x34, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0 -.byte 0x2c, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x2f, 0xf8, 0x01, 0x21 -.byte 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x1b, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60 -.byte 0x1a, 0x49, 0x1b, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21 -.byte 0x19, 0x66, 0x00, 0xf0, 0x12, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x16, 0x49, 0x14, 0x48, 0x01, 0x60 -.byte 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, 0x12, 0x48, 0x13, 0x49 -.byte 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, 0x08, 0x47, 0x03, 0xb5, 0x99, 0x6a, 0x04, 0x20 -.byte 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd, 0x02, 0xb5, 0x18, 0x66 -.byte 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd, 0x00, 0x00, 0x02, 0x40 -.byte 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00, 0x21, 0x22, 0x00, 0x00 -.byte 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x10, 0x08, 0xed, 0x00, 0xe0 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0xb2, 0x4e, 0x7a From b02903128679d3ecbe83d19770d2f622b36fe84d Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Tue, 2 Mar 2021 14:36:28 +0530 Subject: [PATCH 155/159] minor structural modification --- ports/raspberrypi/common-hal/nvm/ByteArray.c | 31 ++++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/ports/raspberrypi/common-hal/nvm/ByteArray.c b/ports/raspberrypi/common-hal/nvm/ByteArray.c index 5d1147425a..fdc2c60805 100644 --- a/ports/raspberrypi/common-hal/nvm/ByteArray.c +++ b/ports/raspberrypi/common-hal/nvm/ByteArray.c @@ -53,7 +53,7 @@ static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_ } } -static void write_sector(uint32_t address, uint32_t len, uint8_t* bytes) { +static void erase_and_write_sector(uint32_t address, uint32_t len, uint8_t* bytes) { // Write a whole sector to flash, buffering it first and then erasing and rewriting it // since we can only erase a whole sector at a time. uint8_t buffer[FLASH_SECTOR_SIZE]; @@ -73,24 +73,29 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t* self, uint8_t values_in[len]; common_hal_nvm_bytearray_get_bytes(self, start_index, len, values_in); + bool all_ones = true; for (uint32_t i = 0; i < len; i++) { if (values_in[i] != UINT8_MAX) { - write_sector(start_index, len, values); - return true; + all_ones = false; + break; } } - uint32_t address = (uint32_t) self->start_address + start_index; - uint32_t offset = address % FLASH_PAGE_SIZE; - uint32_t page_addr = address - offset; + if (all_ones) { + uint32_t address = (uint32_t) self->start_address + start_index; + uint32_t offset = address % FLASH_PAGE_SIZE; + uint32_t page_addr = address - offset; - while (len) { - uint32_t write_len = MIN(len, FLASH_PAGE_SIZE - offset); - write_page(page_addr, offset, write_len, values); - len -= write_len; - values += write_len; - page_addr += FLASH_PAGE_SIZE; - offset = 0; + while (len) { + uint32_t write_len = MIN(len, FLASH_PAGE_SIZE - offset); + write_page(page_addr, offset, write_len, values); + len -= write_len; + values += write_len; + page_addr += FLASH_PAGE_SIZE; + offset = 0; + } + } else { + erase_and_write_sector(start_index, len, values); } return true; From cb2cf81136c48695b1097fb2f601bce90e1086c9 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Tue, 2 Mar 2021 11:11:55 +0100 Subject: [PATCH 156/159] ugame10 - disable pulseio to make more room for the French --- ports/atmel-samd/boards/ugame10/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index 640d421e81..81808f5886 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -18,6 +18,7 @@ CIRCUITPY_ANALOGIO = 1 CIRCUITPY_GAMEPAD = 1 CIRCUITPY_DISPLAYIO = 1 +CIRCUITPY_PULSEIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 From f9d21637a3e54ba227f7c1c5003af6ffefe8cacc Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Tue, 2 Mar 2021 13:34:38 +0100 Subject: [PATCH 157/159] spresense: return valid reference voltage --- ports/cxd56/common-hal/analogio/AnalogIn.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ports/cxd56/common-hal/analogio/AnalogIn.c b/ports/cxd56/common-hal/analogio/AnalogIn.c index a26647ac6f..5c47991eb2 100644 --- a/ports/cxd56/common-hal/analogio/AnalogIn.c +++ b/ports/cxd56/common-hal/analogio/AnalogIn.c @@ -114,11 +114,18 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { // Reference voltage is a fixed value which is depending on the board. // e.g.) -// - Reference Voltage of A4 and A5 pins on Main Board is 0.7V. -// - Reference Voltage of A0 ~ A5 pins on External Interface board -// is selected 3.3V or 5.0V by a IO Volt jumper pin. +// - Reference Voltage of A2 and A3 pins on Main Board is 0.7V. +// - Reference Voltage of A0 ~ A5 pins on External Interface board is 5.0V float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { - return 0.0f; + float voltage; + + if (self->number == 2 || self->number == 3) { + voltage = 0.0f; + } else { + voltage = 5.0f; + } + + return voltage; } void analogin_reset(void) { From 7c921b808b3cda1959875d269022d1c93bdbb5d9 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Tue, 2 Mar 2021 14:23:28 +0100 Subject: [PATCH 158/159] spresense: Define LONGINT_IMPL as MPZ --- ports/cxd56/mpconfigport.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 33a993ad95..e767c6326f 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -10,8 +10,14 @@ USB_MSC_EP_NUM_IN = 4 # Number of USB endpoint pairs. USB_NUM_EP = 6 +# Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk +# $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers. +# This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h. MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz +# Longints can be implemented as mpz, as longlong, or not +LONGINT_IMPL = MPZ + CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_CAMERA = 1 From f560b5f3a391d1e4d63fa73e78954fd110423d50 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 2 Mar 2021 08:08:41 -0600 Subject: [PATCH 159/159] raspberry: switch pico back to the boot2 for W25Q16 Presumably, switching it to generic hurt performance a bit. I verified that the build-raspberry_pi_pico/boot2_padded_checksummed.S built file has the same checksum as the old bs2_default_padded_checksummed.S --- ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.mk b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.mk index 54c1306606..8d6ca53305 100644 --- a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.mk +++ b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.mk @@ -9,3 +9,5 @@ CHIP_FAMILY = rp2 INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY__EVE = 1 + +BOOT2_S_UPPER = sdk/src/rp2_common/boot_stage2/boot2_w25q080.S